support for glade and new new session dialog
[ardour.git] / gtk2_ardour / editor_timefx.cc
index 70cac67d0370bb450c68accba87cefb723537fb4..274f9587d6f3530022e9fb48e093059730f680de 100644 (file)
@@ -41,7 +41,7 @@
 #include "i18n.h"
 
 using namespace ARDOUR;
-using namespace SigC;
+using namespace sigc;
 using namespace Gtk;
 
 Editor::TimeStretchDialog::TimeStretchDialog (Editor& e)
@@ -53,7 +53,7 @@ Editor::TimeStretchDialog::TimeStretchDialog (Editor& e)
          action_button (_("Stretch/Shrink it"))
 {
        set_modal (true);
-       set_position (GTK_WIN_POS_MOUSE);
+       set_position (Gtk::WIN_POS_MOUSE);
        set_title (_("ardour: timestretch"));
        set_name (N_("TimeStretchDialog"));
 
@@ -85,13 +85,13 @@ Editor::TimeStretchDialog::TimeStretchDialog (Editor& e)
        antialias_button.set_name (N_("TimeStretchButton"));
        progress_bar.set_name (N_("TimeStretchProgress"));
 
-       action_button.clicked.connect (bind (slot (*this, &ArdourDialog::stop), 1));
+       action_button.signal_clicked().connect (bind (mem_fun(*this, &ArdourDialog::stop), 1));
 }
 
 gint
 Editor::TimeStretchDialog::update_progress ()
 {
-       progress_bar.set_percentage (request.progress);
+       progress_bar.set_fraction (request.progress/100);
        return request.running;
 }
 
@@ -119,14 +119,16 @@ Editor::run_timestretch (AudioRegionSelection& regions, float fraction)
                current_timestretch = new TimeStretchDialog (*this);
        }
 
-       current_timestretch->progress_bar.set_percentage (0.0f);
-       current_timestretch->first_cancel = current_timestretch->cancel_button.clicked.connect (bind (slot (*current_timestretch, &ArdourDialog::stop), -1));
-       current_timestretch->first_delete = current_timestretch->delete_event.connect (slot (*current_timestretch, &ArdourDialog::wm_close_event));
+       current_timestretch->progress_bar.set_fraction (0.0f);
+       current_timestretch->first_cancel = current_timestretch->cancel_button.signal_clicked().connect (bind (mem_fun (*current_timestretch, &ArdourDialog::stop), -1));
+       // GTK2FIX
+       // current_timestretch->first_delete = current_timestretch->signal_delete_event().connect (mem_fun (*current_timestretch, &ArdourDialog::wm_close_event));
 
        current_timestretch->run ();
 
        if (current_timestretch->run_status() != 1) {
-               current_timestretch->close ();
+               // GTK2FIX
+               // current_timestretch->close ();
                return 1; /* no error, but we did nothing */
        }
 
@@ -143,8 +145,8 @@ Editor::run_timestretch (AudioRegionSelection& regions, float fraction)
        current_timestretch->first_cancel.disconnect();
        current_timestretch->first_delete.disconnect();
        
-       current_timestretch->cancel_button.clicked.connect (slot (current_timestretch, &TimeStretchDialog::cancel_timestretch_in_progress));
-       current_timestretch->delete_event.connect (slot (current_timestretch, &TimeStretchDialog::delete_timestretch_in_progress));
+       current_timestretch->cancel_button.signal_clicked().connect (mem_fun (current_timestretch, &TimeStretchDialog::cancel_timestretch_in_progress));
+       current_timestretch->signal_delete_event().connect (mem_fun (current_timestretch, &TimeStretchDialog::delete_timestretch_in_progress));
 
        if (pthread_create_and_store ("timestretch", &thread, 0, timestretch_thread, current_timestretch)) {
                current_timestretch->close ();
@@ -154,15 +156,16 @@ Editor::run_timestretch (AudioRegionSelection& regions, float fraction)
 
        pthread_detach (thread);
 
-       SigC::Connection c = Main::timeout.connect (slot (current_timestretch, &TimeStretchDialog::update_progress), 100);
+       sigc::connection c = Glib::signal_timeout().connect (mem_fun (current_timestretch, &TimeStretchDialog::update_progress), 100);
 
        while (current_timestretch->request.running) {
                gtk_main_iteration ();
        }
 
        c.disconnect ();
-
-       current_timestretch->close ();
+       
+       // GTK2FIX
+       // current_timestretch->close ();
        return current_timestretch->status;
 }