minor cleanups noted while forward porting transport stuff to 3.0
authorPaul Davis <paul@linuxaudiosystems.com>
Sun, 8 Nov 2009 18:00:40 +0000 (18:00 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Sun, 8 Nov 2009 18:00:40 +0000 (18:00 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@6035 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour_ui_ed.cc
libs/ardour/ardour/session.h
libs/ardour/session_events.cc

index 44a390ff0175f40267bb71d2456fce7c7cb46cae..bd1ef8637a7b3016690361890a0c38cddce061bd 100644 (file)
@@ -249,11 +249,13 @@ ARDOUR_UI::install_actions ()
        ActionManager::session_sensitive_actions.push_back (act);
        ActionManager::transport_sensitive_actions.push_back (act);
 
-       ActionManager::register_action (transport_actions, X_("ToggleRoll"), _("Start/Stop"), bind (mem_fun (*this, &ARDOUR_UI::toggle_roll), false, false));
-       ActionManager::register_action (transport_actions, X_("ToggleRollMaybe"), _("Start/Continue/Stop"), bind (mem_fun (*this, &ARDOUR_UI::toggle_roll), false, true));
+       act = ActionManager::register_action (transport_actions, X_("ToggleRoll"), _("Start/Stop"), bind (mem_fun (*this, &ARDOUR_UI::toggle_roll), false, false));
        ActionManager::session_sensitive_actions.push_back (act);
        ActionManager::transport_sensitive_actions.push_back (act);
-       ActionManager::register_action (transport_actions, X_("ToggleRollForgetCapture"), _("Stop + Forget Capture"), bind (mem_fun(*this, &ARDOUR_UI::toggle_roll), true, false));
+       act = ActionManager::register_action (transport_actions, X_("ToggleRollMaybe"), _("Start/Continue/Stop"), bind (mem_fun (*this, &ARDOUR_UI::toggle_roll), false, true));
+       ActionManager::session_sensitive_actions.push_back (act);
+       ActionManager::transport_sensitive_actions.push_back (act);
+       act = ActionManager::register_action (transport_actions, X_("ToggleRollForgetCapture"), _("Stop + Forget Capture"), bind (mem_fun(*this, &ARDOUR_UI::toggle_roll), true, false));
        ActionManager::session_sensitive_actions.push_back (act);
        ActionManager::transport_sensitive_actions.push_back (act);
 
@@ -262,12 +264,12 @@ ARDOUR_UI::install_actions ()
           - 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));
+       
+       act =  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));
+       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);
 
index e46b96b594ca719be74bc3a8c752ed51ff299110..9831d57829e34a1a75e757cc0f6e0b266ce1e85f 100644 (file)
@@ -1733,7 +1733,7 @@ class Session : public PBD::StatefulDestructible
 
        list<AudioRange> current_audio_range;
        bool _play_range;
-       void set_play_range (list<AudioRange>&, bool leave_rolling);
+       void set_play_range (std::list<AudioRange>&, bool leave_rolling);
        void unset_play_range ();
 
        /* main outs */
index 10201cd63850ed913d56923a95b5f487cf34a70d..036918f940e1beb5f1cb938de15e034fd4eabe5e 100644 (file)
@@ -23,6 +23,7 @@
 #include <ardour/timestamps.h>
 
 #include <pbd/error.h>
+#include <pbd/enumwriter.h>
 #include <glibmm/thread.h>
 
 #include <ardour/ardour.h>
@@ -36,28 +37,6 @@ using namespace PBD;
 
 MultiAllocSingleReleasePool Session::Event::pool ("event", sizeof (Session::Event), 512);
 
-static const char* event_names[] = {
-       "SetTransportSpeed",
-       "SetDiskstreamSpeed",
-       "Locate",
-       "LocateRoll",
-       "LocateRollLocate",
-       "SetLoop",
-       "PunchIn",
-       "PunchOut",
-       "RangeStop",
-       "RangeLocate",
-       "Overwrite",
-       "SetSlaveSource",
-       "Audition",
-       "InputConfigurationChange",
-       "SetAudioRange",
-       "SetMusicRange",
-       "SetPlayRange",
-       "StopOnce",
-       "AutoLoop"
-};
-
 void
 Session::add_event (nframes_t frame, Event::Type type, nframes_t target_frame)
 {
@@ -158,8 +137,8 @@ Session::merge_event (Event* ev)
        default:
                for (Events::iterator i = events.begin(); i != events.end(); ++i) {
                        if ((*i)->type == ev->type && (*i)->action_frame == ev->action_frame) {
-                         error << string_compose(_("Session: cannot have two events of type %1 at the same frame (%2)."), 
-                                                event_names[ev->type], ev->action_frame) << endmsg;
+                               error << string_compose(_("Session: cannot have two events of type %1 at the same frame (%2)."), 
+                                                       enum_2_string (ev->type), ev->action_frame) << endmsg;
                                return;
                        }
                }