Removed unused MeterBridgeStrip and MeterBridge classes.
[ardour.git] / gtk2_ardour / ardour_ui_ed.cc
index 2ebcb765c33e69c7413af24be44ebbe8c58f4c78..7fcbd3ed23300966a2db130fe8848c21c90c4398 100644 (file)
@@ -15,7 +15,6 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 /* This file contains any ARDOUR_UI methods that require knowledge of
@@ -35,6 +34,7 @@
 #include "actions.h"
 
 #include <ardour/session.h>
+#include <ardour/audioengine.h>
 #include <ardour/control_protocol_manager.h>
 
 #include <control_protocol/control_protocol.h>
@@ -54,7 +54,7 @@ ARDOUR_UI::create_editor ()
 
 {
        try {
-               editor = new Editor (*engine);
+               editor = new Editor ();
        }
 
        catch (failed_constructor& err) {
@@ -99,7 +99,8 @@ ARDOUR_UI::install_actions ()
        act = ActionManager::register_action (main_actions, X_("Close"), _("Close"),  mem_fun(*this, &ARDOUR_UI::close_session));
        ActionManager::session_sensitive_actions.push_back (act);
 
-       act = ActionManager::register_action (main_actions, X_("AddTrackBus"), _("Add Track/Bus"),  mem_fun(*this, &ARDOUR_UI::add_route));
+       act = ActionManager::register_action (main_actions, X_("AddTrackBus"), _("Add Track/Bus"),  
+                                             bind (mem_fun(*this, &ARDOUR_UI::add_route), (Gtk::Window*) 0));
        ActionManager::session_sensitive_actions.push_back (act);
 
        
@@ -180,7 +181,6 @@ ARDOUR_UI::install_actions ()
        
        common_actions = ActionGroup::create (X_("Common"));
        ActionManager::register_action (main_actions, X_("Windows"), _("Windows"));
-       ActionManager::register_action (common_actions, X_("Start-Prefix"), _("start prefix"), mem_fun(*this, &ARDOUR_UI::start_keyboard_prefix));
        ActionManager::register_action (common_actions, X_("Quit"), _("Quit"), (mem_fun(*this, &ARDOUR_UI::finish)));
 
         /* windows visibility actions */
@@ -233,6 +233,22 @@ ARDOUR_UI::install_actions ()
        ActionManager::register_action (transport_actions, X_("ToggleRollForgetCapture"), _("Stop + Forget Capture"), bind (mem_fun(*editor, &PublicEditor::toggle_playback), true));
        ActionManager::session_sensitive_actions.push_back (act);
        ActionManager::transport_sensitive_actions.push_back (act);
+
+       /* these two behave as follows:
+
+          - if transport speed != 1.0 or != -1.0, change speed to 1.0 or -1.0 (respectively)
+          - otherwise do nothing
+       */
+
+       ActionManager::register_action (transport_actions, X_("TransitionToRoll"), _("Transition To Roll"), bind (mem_fun (*editor, &PublicEditor::transition_to_rolling), true));
+       ActionManager::session_sensitive_actions.push_back (act);
+       ActionManager::session_sensitive_actions.push_back (act);
+
+       ActionManager::register_action (transport_actions, X_("TransitionToReverse"), _("Transition To Reverse"), bind (mem_fun (*editor, &PublicEditor::transition_to_rolling), false));
+       ActionManager::session_sensitive_actions.push_back (act);
+       ActionManager::session_sensitive_actions.push_back (act);
+
+
        act = ActionManager::register_action (transport_actions, X_("Loop"), _("Play Loop Range"), mem_fun(*this, &ARDOUR_UI::toggle_session_auto_loop));
        ActionManager::session_sensitive_actions.push_back (act);
        ActionManager::transport_sensitive_actions.push_back (act);
@@ -383,12 +399,15 @@ ARDOUR_UI::install_actions ()
        ActionManager::register_toggle_action (option_actions, X_("StopTransportAtEndOfSession"), _("Stop transport at session end"), mem_fun (*this, &ARDOUR_UI::toggle_StopTransportAtEndOfSession));
        ActionManager::register_toggle_action (option_actions, X_("GainReduceFastTransport"), _("-12dB gain reduce ffwd/rewind"), mem_fun (*this, &ARDOUR_UI::toggle_GainReduceFastTransport));
        ActionManager::register_toggle_action (option_actions, X_("LatchedRecordEnable"), _("Rec-enable stays engaged at stop"), mem_fun (*this, &ARDOUR_UI::toggle_LatchedRecordEnable));
+       ActionManager::register_toggle_action (option_actions, X_("RegionEquivalentsOverlap"), _("Region equivalents overlap"), mem_fun (*this, &ARDOUR_UI::toggle_RegionEquivalentsOverlap));
 
        act = ActionManager::register_toggle_action (option_actions, X_("DoNotRunPluginsWhileRecording"), _("Do not run plugins while recording"), mem_fun (*this, &ARDOUR_UI::toggle_DoNotRunPluginsWhileRecording));
        ActionManager::session_sensitive_actions.push_back (act);
 
        act = ActionManager::register_toggle_action (option_actions, X_("LatchedSolo"), _("Latched solo"), mem_fun (*this, &ARDOUR_UI::toggle_LatchedSolo));
        ActionManager::session_sensitive_actions.push_back (act);
+       act = ActionManager::register_toggle_action (option_actions, X_("ShowSoloMutes"), _("Show solo muting"), mem_fun (*this, &ARDOUR_UI::toggle_ShowSoloMutes));
+       ActionManager::session_sensitive_actions.push_back (act);
 
        /* !!! REMEMBER THAT RADIO ACTIONS HAVE TO BE HANDLED WITH MORE FINESSE THAN SIMPLE TOGGLES !!! */
 
@@ -451,6 +470,15 @@ ARDOUR_UI::install_actions ()
        act = ActionManager::register_radio_action (option_actions, output_auto_connect_group, X_("OutputAutoConnectManual"), _("Manually connect outputs"), hide_return (bind (mem_fun (*this, &ARDOUR_UI::set_output_auto_connect), (AutoConnectOption) 0)));
        ActionManager::session_sensitive_actions.push_back (act);
 
+       RadioAction::Group remote_group;
+
+       act = ActionManager::register_radio_action (option_actions, remote_group, X_("RemoteUserDefined"), _("Remote ID assigned by User"), hide_return (bind (mem_fun (*this, &ARDOUR_UI::set_remote_model), UserOrdered)));
+       ActionManager::session_sensitive_actions.push_back (act);
+       act = ActionManager::register_radio_action (option_actions, remote_group, X_("RemoteMixerDefined"), _("Remote ID follows order of Mixer"), hide_return (bind (mem_fun (*this, &ARDOUR_UI::set_remote_model), MixerOrdered)));
+       ActionManager::session_sensitive_actions.push_back (act);
+       act = ActionManager::register_radio_action (option_actions, remote_group, X_("RemoteEditorDefined"), _("Remote ID follows order of Editor"), hide_return (bind (mem_fun (*this, &ARDOUR_UI::set_remote_model), EditorOrdered)));
+       ActionManager::session_sensitive_actions.push_back (act);
+
        ActionManager::add_action_group (shuttle_actions);
        ActionManager::add_action_group (option_actions);
        ActionManager::add_action_group (jack_actions);
@@ -505,6 +533,57 @@ ARDOUR_UI::toggle_control_protocol_feedback (ControlProtocolInfo* cpi, const cha
        }
 }
 
+void
+ARDOUR_UI::set_jack_buffer_size (nframes_t nframes)
+{
+       Glib::RefPtr<Action> action;
+       char* action_name = 0;
+
+       switch (nframes) {
+       case 32:
+               action_name = X_("JACKLatency32");
+               break;
+       case 64:
+               action_name = X_("JACKLatency64");
+               break;
+       case 128:
+               action_name = X_("JACKLatency128");
+               break;
+       case 512:
+               action_name = X_("JACKLatency512");
+               break;
+       case 1024:
+               action_name = X_("JACKLatency1024");
+               break;
+       case 2048:
+               action_name = X_("JACKLatency2048");
+               break;
+       case 4096:
+               action_name = X_("JACKLatency4096");
+               break;
+       case 8192:
+               action_name = X_("JACKLatency8192");
+               break;
+       default:
+               /* XXX can we do anything useful ? */
+               break;
+       }
+
+       if (action_name) {
+
+               action = ActionManager::get_action (X_("JACK"), action_name);
+
+               if (action) {
+                       Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic (action);
+
+                       if (ract && ract->get_active()) {
+                               engine->request_buffer_size (nframes);
+                               update_sample_rate (0);
+                       }
+               }
+       }
+}
+
 void
 ARDOUR_UI::build_control_surface_menu ()
 {