minor tweaks to MIDI clock support, including delivery of position events/messages...
[ardour.git] / gtk2_ardour / editor.cc
index 95abd4b087a0e256c12add43fa955de806d854ca..cf3eab57245640583676310de71b17570cebe163 100644 (file)
@@ -229,8 +229,7 @@ pane_size_watcher (Paned* pane)
 }
 
 Editor::Editor ()
-       : VisibilityTracker (*((Gtk::Window*) this))
-       , _join_object_range_state (JOIN_OBJECT_RANGE_NONE)
+       : _join_object_range_state (JOIN_OBJECT_RANGE_NONE)
 
          /* time display buttons */
        , minsec_label (_("Mins:Secs"))
@@ -366,6 +365,7 @@ Editor::Editor ()
        location_loop_color = ARDOUR_UI::config()->canvasvar_LocationLoop.get();
        location_punch_color = ARDOUR_UI::config()->canvasvar_LocationPunch.get();
 
+       zoom_focus = ZoomFocusLeft;
        _edit_point = EditAtMouse;
        _internal_editing = false;
        current_canvas_cursor = 0;
@@ -374,8 +374,6 @@ Editor::Editor ()
 
        _scroll_callbacks = 0;
 
-       zoom_focus = ZoomFocusLeft;
-       set_zoom_focus (ZoomFocusLeft);
        zoom_range_clock->ValueChanged.connect (sigc::mem_fun(*this, &Editor::zoom_adjustment_changed));
 
        bbt_label.set_name ("EditorRulerLabel");
@@ -636,6 +634,7 @@ Editor::Editor ()
 
        setup_toolbar ();
 
+       set_zoom_focus (zoom_focus);
        _snap_type = SnapToBeat;
        set_snap_to (_snap_type);
        _snap_mode = SnapOff;
@@ -698,7 +697,7 @@ Editor::Editor ()
        signal_configure_event().connect (sigc::mem_fun (*ARDOUR_UI::instance(), &ARDOUR_UI::configure_handler));
        signal_delete_event().connect (sigc::mem_fun (*ARDOUR_UI::instance(), &ARDOUR_UI::exit_on_main_window_close));
 
-       Gtkmm2ext::Keyboard::the_keyboard().ShiftReleased.connect (sigc::mem_fun (*this, &Editor::shift_key_released));
+       Gtkmm2ext::Keyboard::the_keyboard().ZoomVerticalModifierReleased.connect (sigc::mem_fun (*this, &Editor::zoom_vertical_modifier_released));
        
        /* allow external control surfaces/protocols to do various things */
 
@@ -1259,7 +1258,8 @@ Editor::set_session (Session *t)
 
        /* These signals can all be emitted by a non-GUI thread. Therefore the
           handlers for them must not attempt to directly interact with the GUI,
-          but use Gtkmm2ext::UI::instance()->call_slot();
+          but use PBD::Signal<T>::connect() which accepts an event loop
+          ("context") where the handler will be asked to run.
        */
 
        _session->StepEditStatusChange.connect (_session_connections, invalidator (*this), boost::bind (&Editor::step_edit_status_change, this, _1), gui_context());
@@ -1911,6 +1911,9 @@ Editor::add_selection_context_items (Menu_Helpers::MenuList& edit_items)
        edit_items.push_back (MenuElem (_("Bounce Range to Region List"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), false, false)));
        edit_items.push_back (MenuElem (_("Bounce Range to Region List With Processing"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), false, true)));
        edit_items.push_back (MenuElem (_("Export Range..."), sigc::mem_fun(*this, &Editor::export_selection)));
+       if (ARDOUR_UI::instance()->video_timeline->get_duration() > 0) {
+               edit_items.push_back (MenuElem (_("Export Video Range..."), sigc::bind (sigc::mem_fun(*this, &Editor::export_video), true)));
+       }
 }
 
 
@@ -3126,12 +3129,12 @@ Editor::convert_drop_to_paths (
                */
 
                string txt = data.get_text();
-               const char* p;
+               char* p;
                const char* q;
 
-               p = (const char *) malloc (txt.length() + 1);
-               txt.copy (const_cast<char *> (p), txt.length(), 0);
-               const_cast<char*>(p)[txt.length()] = '\0';
+               p = (char *) malloc (txt.length() + 1);
+               txt.copy (p, txt.length(), 0);
+               p[txt.length()] = '\0';
 
                while (p)
                {
@@ -3311,8 +3314,6 @@ Editor::duplicate_range (bool with_dialog)
                win.add_button (_("Duplicate"), RESPONSE_ACCEPT);
                win.set_default_response (RESPONSE_ACCEPT);
 
-               win.set_position (WIN_POS_MOUSE);
-
                spinner.grab_focus ();
 
                switch (win.run ()) {
@@ -5389,7 +5390,6 @@ Editor::change_region_layering_order (bool from_context_menu)
 
        if (layering_order_editor == 0) {
                layering_order_editor = new RegionLayeringOrderEditor (*this);
-               layering_order_editor->set_position (WIN_POS_MOUSE);
        }
 
        layering_order_editor->set_context (clicked_routeview->name(), _session, clicked_routeview, pl, position);
@@ -5503,7 +5503,7 @@ Editor::popup_control_point_context_menu (ArdourCanvas::Item* item, GdkEvent* ev
 }
 
 void
-Editor::shift_key_released ()
+Editor::zoom_vertical_modifier_released()
 {
        _stepping_axis_view = 0;
 }