Two patches from Brian Ahr. Thanks!
authorTaybin Rutkin <taybin@taybin.com>
Mon, 6 Nov 2006 17:59:03 +0000 (17:59 +0000)
committerTaybin Rutkin <taybin@taybin.com>
Mon, 6 Nov 2006 17:59:03 +0000 (17:59 +0000)
*Fixed zooming on edit cursor.
*Fixed play-from-edit-cursor.

git-svn-id: svn://localhost/ardour2/trunk@1078 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor.cc
gtk2_ardour/editor.h
gtk2_ardour/editor_ops.cc

index 32d4f4e658fd8f92c7948a80f0d51b4f75eb897d..a9f4b4b7dc62dfe7d7ef49690d2fda5ca3fc4e6f 100644 (file)
@@ -1865,7 +1865,7 @@ Editor::add_dstream_context_items (Menu_Helpers::MenuList& edit_items)
        MenuList& play_items = play_menu->items();
        play_menu->set_name ("ArdourContextMenu");
        
-       play_items.push_back (MenuElem (_("Play from edit cursor")));
+       play_items.push_back (MenuElem (_("Play from edit cursor"), mem_fun(*this, &Editor::play_from_edit_cursor)));
        play_items.push_back (MenuElem (_("Play from start"), mem_fun(*this, &Editor::play_from_start)));
        play_items.push_back (MenuElem (_("Play region"), mem_fun(*this, &Editor::play_selected_region)));
        play_items.push_back (SeparatorElem());
@@ -1950,7 +1950,7 @@ Editor::add_bus_context_items (Menu_Helpers::MenuList& edit_items)
        MenuList& play_items = play_menu->items();
        play_menu->set_name ("ArdourContextMenu");
        
-       play_items.push_back (MenuElem (_("Play from edit cursor")));
+       play_items.push_back (MenuElem (_("Play from edit cursor"), mem_fun(*this, &Editor::play_from_edit_cursor)));
        play_items.push_back (MenuElem (_("Play from start"), mem_fun(*this, &Editor::play_from_start)));
        edit_items.push_back (MenuElem (_("Play"), *play_menu));
 
index 0117d364f110f397792e4139e0c28e263b599b37..10747735b58bafa98360819309aee3376cf39765 100644 (file)
@@ -893,6 +893,7 @@ class Editor : public PublicEditor
        void rename_region_finished (bool);
 
        void play_from_start ();
+       void play_from_edit_cursor ();
        void play_selected_region ();
        void audition_selected_region ();
        void loop_selected_region ();
index ec2435c67b9ff7be74201900e994d32f905c8dd2..6d006f94bf5a54e16a42eb4637cbb9ae4d4523bc 100644 (file)
@@ -1088,7 +1088,7 @@ Editor::temporal_zoom (gdouble fpu)
 
        case ZoomFocusEdit:
                /* try to keep the edit cursor in the center */
-               if (edit_cursor->current_frame > leftmost_frame + (new_page/2)) {
+               if (edit_cursor->current_frame > new_page/2) {
                        leftmost_after_zoom = edit_cursor->current_frame - (new_page/2);
                } else {
                        leftmost_after_zoom = 0;
@@ -1854,6 +1854,12 @@ Editor::play_from_start ()
        session->request_locate (session->current_start_frame(), true);
 }
 
+void
+Editor::play_from_edit_cursor ()
+{
+       session->request_locate (edit_cursor->current_frame, true);
+}
+
 void
 Editor::play_selection ()
 {