tweak display of remote control id (dialog text)
[ardour.git] / gtk2_ardour / editor.h
index 82fa3c41afbb783b3051dc42b525ad0454252717..ca4a3ec87a977fe9ff5a01354288af66b8be872e 100644 (file)
 #include "canvas.h"
 #include "window_proxy.h"
 
-namespace Gnome { namespace Canvas {
-       class NoEventText;
-} }
+namespace Gnome {
+       namespace Canvas {
+               class NoEventText;
+               class CanvasNoteEvent;
+       }
+}
 
 namespace Gtkmm2ext {
        class TearOff;
@@ -80,7 +83,6 @@ namespace ARDOUR {
        class Region;
        class Location;
        class TempoSection;
-       class NamedSelection;
        class Session;
        class Filter;
        class ChanCount;
@@ -239,6 +241,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
                return rint ((double) frame / (double) frames_per_unit);
        }
 
+       double frame_to_unit_unrounded (framepos_t frame) const {
+               return frame / frames_per_unit;
+       }
+       
        double frame_to_unit (double frame) const {
                return rint (frame / frames_per_unit);
        }
@@ -280,6 +286,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        bool extend_selection_to_track (TimeAxisView&);
 
        void play_selection ();
+       framepos_t get_preroll ();
+       void maybe_locate_with_edit_preroll (framepos_t);
+       void play_with_preroll ();
        void select_all_in_track (Selection::Operation op);
        void select_all (Selection::Operation op);
        void invert_selection_in_track ();
@@ -393,6 +402,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void maximise_editing_space();
        void restore_editing_space();
 
+       void update_tearoff_visibility();
+
        void reset_x_origin (framepos_t);
        void reset_x_origin_to_follow_playhead ();
        void reset_y_origin (double);
@@ -461,6 +472,14 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        void get_pointer_position (double &, double &) const;
 
+       TimeAxisView* stepping_axis_view () {
+               return _stepping_axis_view;
+       }
+       
+       void set_stepping_axis_view (TimeAxisView* v) {
+               _stepping_axis_view = v;
+       }
+
   protected:
        void map_transport_state ();
        void map_position_change (framepos_t);
@@ -508,7 +527,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        Editing::ZoomFocus zoom_focus;
 
        void set_frames_per_unit (double);
-       void post_zoom ();
+       bool clamp_frames_per_unit (double &) const;
 
        Editing::MouseMode mouse_mode;
        Editing::MouseMode pre_internal_mouse_mode;
@@ -615,6 +634,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void hide_marker (ArdourCanvas::Item*, GdkEvent*);
        void clear_marker_display ();
        void mouse_add_new_marker (framepos_t where, bool is_cd=false, bool is_xrun=false);
+       void mouse_add_new_range (framepos_t);
        bool choose_new_marker_name(std::string &name);
        void update_cd_marker_display ();
        void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
@@ -687,7 +707,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void popup_control_point_context_menu (ArdourCanvas::Item *, GdkEvent *);
        Gtk::Menu _control_point_context_menu;
 
-       void handle_new_route (ARDOUR::RouteList&);
+       void add_routes (ARDOUR::RouteList&);
        void timeaxisview_deleted (TimeAxisView *);
 
        Gtk::HBox           global_hpacker;
@@ -1011,22 +1031,19 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
                double y_origin;
 
                int idle_handler_id;
+               /** true if we are currently in the idle handler */
+               bool being_handled;
 
-               VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_unit (0), idle_handler_id (-1) {}
+               VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_unit (0), idle_handler_id (-1), being_handled (false) {}
                void add (Type t) {
                        pending = Type (pending | t);
                }
        };
 
-
        VisualChange pending_visual_change;
 
        static int _idle_visual_changer (void *arg);
        int idle_visual_changer ();
-
-       void queue_visual_change (framepos_t);
-       void queue_visual_change (double);
-       void queue_visual_change_y (double);
        void ensure_visual_change_idle_handler ();
 
        /* track views */
@@ -1195,7 +1212,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void temporal_zoom_region (bool both_axes);
        void zoom_to_region (bool both_axes);
        void temporal_zoom_session ();
-       void temporal_zoom (gdouble scale);
+       void temporal_zoom (double scale);
        void temporal_zoom_by_frame (framepos_t start, framepos_t end);
        void temporal_zoom_to_frame (bool coarser, framepos_t frame);
 
@@ -1233,6 +1250,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        boost::shared_ptr<ARDOUR::AudioTrack> get_nth_selected_audio_track (int nth) const;
        boost::shared_ptr<ARDOUR::MidiTrack> get_nth_selected_midi_track (int nth) const;
 
+        void toggle_midi_input_active (bool flip_others);
+
        ARDOUR::InterThreadInfo* current_interthread_info;
 
        AnalysisWindow* analysis_window;
@@ -1337,6 +1356,12 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        Gtk::Menu fade_context_menu;
        void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
 
+       Gtk::Menu xfade_in_context_menu;
+       Gtk::Menu xfade_out_context_menu;
+       void popup_xfade_in_context_menu (int, int, ArdourCanvas::Item*, ItemType);
+       void popup_xfade_out_context_menu (int, int, ArdourCanvas::Item*, ItemType);
+       void fill_xfade_menu (Gtk::Menu_Helpers::MenuList& items, bool start);
+
        void set_fade_in_shape (ARDOUR::FadeShape);
        void set_fade_out_shape (ARDOUR::FadeShape);
 
@@ -1479,7 +1504,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void edit_tempo_marker (ArdourCanvas::Item*);
        void edit_meter_marker (ArdourCanvas::Item*);
        void edit_control_point (ArdourCanvas::Item*);
-       void edit_note (ArdourCanvas::Item *);
+       void edit_notes (std::set<Gnome::Canvas::CanvasNoteEvent *> const &);
 
        void marker_menu_edit ();
        void marker_menu_remove ();
@@ -1540,9 +1565,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void editor_list_button_toggled ();
 
        AudioClock*               zoom_range_clock;
-       ArdourButton              zoom_in_button;
-       ArdourButton              zoom_out_button;
-       ArdourButton              zoom_out_full_button;
+       Gtk::Button              zoom_in_button;
+       Gtk::Button              zoom_out_button;
+       Gtk::Button              zoom_out_full_button;
 
        Gtk::Button              tav_expand_button;
        Gtk::Button              tav_shrink_button;
@@ -1651,6 +1676,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void marker_selection_changed ();
 
        void cancel_selection ();
+       void cancel_time_selection ();
+
+       bool get_smart_mode() const;
 
        bool audio_region_selection_covers (framepos_t where);
 
@@ -1818,7 +1846,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        /* duplication */
 
-       void duplicate_dialog (bool with_dialog);
+       void duplicate_range (bool with_dialog);
 
        framepos_t event_frame (GdkEvent const *, double* px = 0, double* py = 0) const;
 
@@ -1934,8 +1962,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        */
        RegionView*   entered_regionview;
 
-
-       void ensure_entered_track_selected (bool op_acts_on_objects = false);
        bool clear_entered_track;
        bool left_track_canvas (GdkEventCrossing*);
        bool entered_track_canvas (GdkEventCrossing*);
@@ -1945,8 +1971,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        gint left_automation_track ();
 
        void reset_canvas_action_sensitivity (bool);
-       void set_gain_envelope_visibility (bool);
-       void set_region_gain_visibility (RegionView*, bool);
+       void set_gain_envelope_visibility ();
+       void set_region_gain_visibility (RegionView*);
        void toggle_gain_envelope_active ();
        void reset_region_gain_envelopes ();
 
@@ -2059,6 +2085,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void setup_fade_images ();
        std::map<ARDOUR::FadeShape, Gtk::Image*> _fade_in_images;
        std::map<ARDOUR::FadeShape, Gtk::Image*> _fade_out_images;
+       std::map<ARDOUR::FadeShape, Gtk::Image*> _xfade_in_images;
+       std::map<ARDOUR::FadeShape, Gtk::Image*> _xfade_out_images;
 
        Gtk::MenuItem& action_menu_item (std::string const &);
        void action_pre_activated (Glib::RefPtr<Gtk::Action> const &);
@@ -2084,6 +2112,20 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        void toggle_sound_midi_notes ();
 
+       /** Flag for a bit of a hack wrt control point selection; see set_selected_control_point_from_click */
+       bool _control_point_toggled_on_press;
+
+       /** This is used by TimeAxisView to keep a track of the TimeAxisView that is currently being
+           stepped in height using Shift-Scrollwheel.  When a scroll event occurs, we do the step on
+           this _stepping_axis_view if it is non-0 (and we set up this _stepping_axis_view with the
+           TimeAxisView underneath the mouse if it is 0).  Then Editor resets _stepping_axis_view when
+           the shift key is released.  In this (hacky) way, pushing shift and moving the scroll wheel
+           will operate on the same track until shift is released (rather than skipping about to whatever
+           happens to be underneath the mouse at the time).
+       */
+       TimeAxisView* _stepping_axis_view;
+       void shift_key_released ();
+
        friend class Drag;
        friend class RegionDrag;
        friend class RegionMoveDrag;