Fix erroneous parameter passed to Editor::motion_handler. Makes autoscroll work...
[ardour.git] / gtk2_ardour / ardour_ui_dialogs.cc
index 1624824ec5822c97d5ac292e79031b554cc544f4..91ff10d4730aa6c76c2ab0a69f56d3ffc88a5e5c 100644 (file)
    This is to cut down on the compile times.  It also helps with my sanity.
 */
 
-#include <ardour/session.h>
+#include "ardour/session.h"
 
 #include "actions.h"
 #include "ardour_ui.h"
 #include "location_ui.h"
 #include "mixer_ui.h"
-#include "option_editor.h"
+#include "rc_option_editor.h"
+#include "session_option_editor.h"
 #include "public_editor.h"
 #include "route_params_ui.h"
 #include "sfdb_ui.h"
@@ -99,10 +100,6 @@ ARDOUR_UI::connect_to_session (Session *s)
                route_params->set_session (s);
        }
 
-       if (option_editor) {
-               option_editor->set_session (s);
-       }
-
        setup_session_options ();
 
        Blink.connect (mem_fun(*this, &ARDOUR_UI::transport_rec_enable_blink));
@@ -202,10 +199,6 @@ ARDOUR_UI::unload_session (bool hide_stuff)
        preroll_clock.set_session (0);
        postroll_clock.set_session (0);
 
-       if (option_editor) {
-               option_editor->set_session (0);
-       }
-
        delete session;
        session = 0;
 
@@ -231,23 +224,44 @@ ARDOUR_UI::toggle_big_clock_window ()
 }
 
 void
-ARDOUR_UI::toggle_options_window ()
+ARDOUR_UI::toggle_rc_options_window ()
 {
-       if (option_editor == 0) {
-               option_editor = new OptionEditor (*this, *editor, *mixer);
-               option_editor->signal_unmap().connect(sigc::bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleOptionsEditor")));
-               option_editor->set_session (session);
+       if (rc_option_editor == 0) {
+               rc_option_editor = new RCOptionEditor;
+               rc_option_editor->signal_unmap().connect(sigc::bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleRCOptionsEditor")));
+               rc_option_editor->set_session (session);
        } 
 
-       RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleOptionsEditor"));
+       RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleRCOptionsEditor"));
        if (act) {
                RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
        
                if (tact->get_active()) {
-                       option_editor->show_all ();
-                       option_editor->present ();
+                       rc_option_editor->show_all ();
+                       rc_option_editor->present ();
+               } else {
+                       rc_option_editor->hide ();
+               } 
+       }
+}
+
+void
+ARDOUR_UI::toggle_session_options_window ()
+{
+       if (session_option_editor == 0) {
+               session_option_editor = new SessionOptionEditor (session);
+               session_option_editor->signal_unmap().connect(sigc::bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleSessionOptionsEditor")));
+       } 
+
+       RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleSessionOptionsEditor"));
+       if (act) {
+               RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
+       
+               if (tact->get_active()) {
+                       session_option_editor->show_all ();
+                       session_option_editor->present ();
                } else {
-                       option_editor->hide ();
+                       session_option_editor->hide ();
                } 
        }
 }
@@ -379,7 +393,7 @@ ARDOUR_UI::toggle_route_params_window ()
 }
 
 void
-ARDOUR_UI::handle_locations_change (Location* ignored)
+ARDOUR_UI::handle_locations_change (Location *)
 {
        if (session) {
                if (session->locations()->num_range_markers()) {