change behaviour of play-at-edit-point....; fix crash in SAE context with automation...
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 20 Dec 2007 19:54:54 +0000 (19:54 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 20 Dec 2007 19:54:54 +0000 (19:54 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2801 d708f5d6-7413-0410-9779-e7cbd77b26cf

13 files changed:
gtk2_ardour/ardour_ui2.cc
gtk2_ardour/editor.cc
gtk2_ardour/editor.h
gtk2_ardour/editor_ops.cc
gtk2_ardour/icons/sae.png [new file with mode: 0644]
gtk2_ardour/icons/saelogo.png
gtk2_ardour/public_editor.h
gtk2_ardour/route_time_axis.cc
libs/ardour/ardour/configuration_vars.h
libs/ardour/ardour/session.h
libs/ardour/session_events.cc
libs/ardour/session_state.cc
libs/ardour/session_transport.cc

index 461a246aa40d778ad0244a905e8ad003c0eccc38..426571bcec8bfee610c1a6a10d6ccfb03997baba 100644 (file)
@@ -449,6 +449,11 @@ ARDOUR_UI::setup_transport ()
 
        transport_tearoff_hbox.pack_start (*toggle_box, false, false, 4);
        transport_tearoff_hbox.pack_start (alert_box, false, false);
+
+       if (Profile->get_sae()) {
+               Image* img = manage (new Image ((::get_icon (X_("sae")))));
+               transport_tearoff_hbox.pack_end (*img, false, false, 6);
+       }
 }
 
 void
index c850b835d73aeb0f91f62908193a510fac32660e..14c89e8ee4ffe0f1532f23189ad69bc2c25fed7b 100644 (file)
@@ -4119,16 +4119,21 @@ Editor::sort_track_selection ()
 }
 
 nframes64_t
-Editor::get_preferred_edit_position()
+Editor::get_preferred_edit_position (bool ignore_playhead)
 {
        bool ignored;
        nframes64_t where = 0;
+       EditPoint ep = _edit_point;
 
        if (entered_marker) {
                return entered_marker->position();
        }
 
-       switch (_edit_point) {
+       if (ignore_playhead && ep == EditAtPlayhead) {
+               ep = EditAtSelectedMarker;
+       }
+
+       switch (ep) {
        case EditAtPlayhead:
                where = session->audible_frame();
                break;
index faec9d19ec307a9d460961fb9299e0e624641b52..b54555b68d87be5bb21c76f9fbb1297c78b0b09e 100644 (file)
@@ -350,7 +350,7 @@ class Editor : public PublicEditor
        void reset_zoom (double);
        void reposition_and_zoom (nframes_t, double);
 
-       nframes64_t get_preferred_edit_position ();
+       nframes64_t get_preferred_edit_position (bool ignore_playhead = false);
 
        bool update_mouse_speed ();
        bool decelerate_mouse_speed ();
index dc170e938fed79353ca0187aff0760a717f81ca4..5ec2d5da6fc702e67d5933a8ec4ac80f4d803362 100644 (file)
@@ -2124,23 +2124,16 @@ Editor::play_from_edit_point_and_return ()
        nframes64_t start_frame;
        nframes64_t return_frame;
 
-       if (session->transport_rolling()) {
-               session->request_stop ();
-               return;
+       /* don't reset the return frame if its already set */
+
+       if ((return_frame = session->requested_return_frame()) < 0) {
+               return_frame = session->audible_frame();
        }
 
-       switch (_edit_point) {
-       case EditAtPlayhead:
-               session->request_transport_speed (1.0f);
-               break;
-               
-       default:
-               return_frame = session->transport_frame();
-               start_frame = get_preferred_edit_position ();
-               if (start_frame >= 0) {
-                       session->request_roll_at_and_return (start_frame, return_frame);
-               }
-               break;
+       start_frame = get_preferred_edit_position (true);
+
+       if (start_frame >= 0) {
+               session->request_roll_at_and_return (start_frame, return_frame);
        }
 }
 
diff --git a/gtk2_ardour/icons/sae.png b/gtk2_ardour/icons/sae.png
new file mode 100644 (file)
index 0000000..69af495
Binary files /dev/null and b/gtk2_ardour/icons/sae.png differ
index dff529edab8caf371533cdf6b53bdbd0e9b6e4f3..43be5fe5aab184e2431402278555b3332fd8eb10 100644 (file)
Binary files a/gtk2_ardour/icons/saelogo.png and b/gtk2_ardour/icons/saelogo.png differ
index 797ff72d42d48271ed58f4fb587166d55f8bf29d..9242a6e49a19738466fd8fdf3476e8c47c179d7d 100644 (file)
@@ -155,7 +155,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
        virtual void remove_last_capture () = 0;
        virtual void maximise_editing_space() = 0;
        virtual void restore_editing_space() = 0;
-       virtual nframes64_t get_preferred_edit_position () = 0;
+       virtual nframes64_t get_preferred_edit_position (bool ignore_playhead = false) = 0;
 
        sigc::signal<void> ZoomFocusChanged;
        sigc::signal<void> ZoomChanged;
index f1838efbd9769e3347068b8df5260f9adf21121b..4bdb392f0ebd1822a2606efdeb17ddc99cf61592 100644 (file)
@@ -424,9 +424,10 @@ RouteTimeAxisView::build_display_menu ()
        items.push_back (SeparatorElem());
 
        build_remote_control_menu ();
+       build_automation_action_menu ();
+
        if (!Profile->get_sae()) {
                items.push_back (MenuElem (_("Remote Control ID"), *remote_control_menu));
-               build_automation_action_menu ();
                items.push_back (MenuElem (_("Automation"), *automation_action_menu));
                items.push_back (SeparatorElem());
        }
index e6254042b8109c51cfec2836ce225e757a071fd4..8e8307677ae492b8d8bdc82759cc50566e6d95e1 100644 (file)
@@ -149,6 +149,8 @@ CONFIG_VARIABLE (uint32_t, periodic_safety_backup_interval, "periodic-safety-bac
 CONFIG_VARIABLE (float, automation_interval, "automation-interval", 50)
 CONFIG_VARIABLE (bool, sync_all_route_ordering, "sync-all-route-ordering", true)
 CONFIG_VARIABLE (bool, only_copy_imported_files, "only-copy-imported-files", true)
+CONFIG_VARIABLE (std::string, keyboard_layout, "keyboard-layout", "ansi")
+CONFIG_VARIABLE (std::string, default_bindings, "default-bindings", "ardour")
 
 /* denormal management */
 
index cea96e6c95f1b5c74b514c9799762f05282ef7b4..42ad79f3c0fb414275202d7071ec40ace4c46b13 100644 (file)
@@ -494,6 +494,7 @@ class Session : public PBD::StatefulDestructible
 
        nframes_t transport_frame () const {return _transport_frame; }
        nframes_t audible_frame () const;
+       nframes64_t requested_return_frame() const { return _requested_return_frame; }
 
        enum PullupFormat {
                pullup_Plus4Plus1,
@@ -986,7 +987,7 @@ class Session : public PBD::StatefulDestructible
        nframes_t          _last_slave_transport_frame;
        nframes_t           maximum_output_latency;
        nframes_t           last_stop_frame;
-       nframes64_t              requested_return_frame;
+       nframes64_t             _requested_return_frame;
        vector<Sample *>        _passthru_buffers;
        vector<Sample *>        _silent_buffers;
        vector<Sample *>        _send_buffers;
index a0c556b516ec30f3eec72052dc98cc8b4b7319d6..f86f3cbb3bb3c91bf234b0fe76d013c16a994139 100644 (file)
@@ -350,7 +350,7 @@ Session::process_event (Event* ev)
 
        case Event::LocateRollLocate:
                // locate is handled by ::request_roll_at_and_return()
-               requested_return_frame = ev->target_frame;
+               _requested_return_frame = ev->target_frame;
                set_transport_speed (ev->speed, true);
                break;
 
index fd2c9fa98285b747f537e5174537f3c0f75f8b5f..f4fceb1d91d1575153de7b419fd543ccc7da4e94 100644 (file)
@@ -138,7 +138,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
        transport_sub_state = 0;
        _transport_frame = 0;
        last_stop_frame = 0;
-       requested_return_frame = -1;
+       _requested_return_frame = -1;
        end_location = new Location (0, 0, _("end"), Location::Flags ((Location::IsMark|Location::IsEnd)));
        start_location = new Location (0, 0, _("start"), Location::Flags ((Location::IsMark|Location::IsStart)));
        _end_location_is_free = true;
index c01f6ed0638bdaaad382097336c09b67bac4dacf..635e32de627dcd09b5a9f8c00098f0aba92b5e3b 100644 (file)
@@ -373,7 +373,7 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
 
        if ((Config->get_slave_source() == None && Config->get_auto_return()) || 
            (post_transport_work & PostTransportLocate) || 
-           (requested_return_frame >= 0) ||
+           (_requested_return_frame >= 0) ||
            synced_to_jack()) {
                
                if (pending_locate_flush) {
@@ -382,14 +382,14 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
                
                if (((Config->get_slave_source() == None && Config->get_auto_return()) || 
                     synced_to_jack() ||
-                    requested_return_frame >= 0) &&
+                    _requested_return_frame >= 0) &&
                    !(post_transport_work & PostTransportLocate)) {
 
                        bool do_locate = false;
 
-                       if (requested_return_frame >= 0) {
-                               _transport_frame = requested_return_frame;
-                               requested_return_frame = -1;
+                       if (_requested_return_frame >= 0) {
+                               _transport_frame = _requested_return_frame;
+                               _requested_return_frame = -1;
                                do_locate = true;
                        } else {
                                _transport_frame = last_stop_frame;
@@ -1185,9 +1185,7 @@ Session::setup_auto_play ()
 void
 Session::request_roll_at_and_return (nframes_t start, nframes_t return_to)
 {
-       request_stop ();
        request_locate (start, false);
-
        Event *ev = new Event (Event::LocateRollLocate, Event::Add, Event::Immediate, return_to, 1.0);
        queue_event (ev);
 }