improve sysex data display.
[ardour.git] / gtk2_ardour / editor.h
index ccebaa853ef6d60f2a1417b2e231afc1ab3ad366..fa5ed9057a2cc67309683414c19b5b5d581dc430 100644 (file)
@@ -67,6 +67,10 @@ namespace Gtkmm2ext {
        class Bindings;
 }
 
+namespace Evoral {
+       class SMF;
+}
+
 namespace ARDOUR {
        class AudioPlaylist;
        class AudioRegion;
@@ -130,6 +134,7 @@ class SoundFileOmega;
 class StreamView;
 class TempoLines;
 class TimeAxisView;
+class TimeInfoBox;
 class TimeFXDialog;
 class TimeSelection;
 class RegionLayeringOrderEditor;
@@ -251,14 +256,13 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        Selection& get_selection() const { return *selection; }
        bool get_selection_extents (framepos_t &start, framepos_t &end) const;  // the time extents of the current selection, whether Range, Region(s), Control Points, or Notes
        Selection& get_cut_buffer() const { return *cut_buffer; }
-       void track_mixer_selection ();
 
        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 rec_with_preroll ();
        void select_all_in_track (Selection::Operation op);
        void select_all_objects (Selection::Operation op);
        void invert_selection_in_track ();
@@ -332,7 +336,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        unsigned get_grid_beat_divisions(framepos_t position);
        Evoral::Beats get_grid_type_as_beats (bool& success, framepos_t position);
 
-       unsigned get_grid_music_divisions (uint32_t event_state);
+       int32_t get_grid_music_divisions (uint32_t event_state);
 
        void nudge_forward (bool next, bool force_playhead);
        void nudge_backward (bool next, bool force_playhead);
@@ -362,8 +366,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        /* fades */
 
-       void toggle_region_fades (int dir);
-       void update_region_fade_visibility ();
+       void toggle_region_fades (int dir);
+       void update_region_fade_visibility ();
 
        /* redirect shared ops menu. caller must free returned menu */
 
@@ -428,6 +432,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
                        Editing::ImportDisposition            disposition,
                        Editing::ImportMode                   mode,
                        ARDOUR::SrcQuality                    quality,
+                       ARDOUR::MidiTrackNameSource           mts,
+                       ARDOUR::MidiTempoMapDisposition       mtd,
                        framepos_t&                           pos,
                        boost::shared_ptr<ARDOUR::PluginInfo> instrument = boost::shared_ptr<ARDOUR::PluginInfo>());
 
@@ -446,20 +452,20 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        TrackViewList axis_views_from_routes (boost::shared_ptr<ARDOUR::RouteList>) const;
 
-       void snap_to (framepos_t&       first,
-                     ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
-                     bool              for_mark  = false,
-                     bool              ensure_snap = false);
+       void snap_to (ARDOUR::MusicFrame& first,
+                     ARDOUR::RoundMode   direction = ARDOUR::RoundNearest,
+                     bool                for_mark  = false,
+                     bool                ensure_snap = false);
 
-       void snap_to_with_modifier (framepos_t&       first,
-                                   GdkEvent const *  ev,
-                                   ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
-                                   bool              for_mark  = false);
+       void snap_to_with_modifier (ARDOUR::MusicFrame& first,
+                                   GdkEvent const *    ev,
+                                   ARDOUR::RoundMode   direction = ARDOUR::RoundNearest,
+                                   bool                for_mark  = false);
 
-       void snap_to (framepos_t&       first,
-                     framepos_t&       last,
-                     ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
-                     bool              for_mark  = false);
+       void snap_to (ARDOUR::MusicFrame& first,
+                     ARDOUR::MusicFrame& last,
+                     ARDOUR::RoundMode   direction = ARDOUR::RoundNearest,
+                     bool                for_mark  = false);
 
        void begin_selection_op_history ();
        void begin_reversible_selection_op (std::string cmd_name);
@@ -536,7 +542,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        /* editing operations that need to be public */
        void mouse_add_new_marker (framepos_t where, bool is_cd=false);
-       void split_regions_at (framepos_t, RegionSelection&, const int32_t sub_num);
+       void split_regions_at (ARDOUR::MusicFrame, RegionSelection&, bool snap = true);
        void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false);
        RegionSelection get_regions_from_selection_and_mouse (framepos_t);
 
@@ -565,6 +571,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        PlaylistSelector* _playlist_selector;
 
+       TimeInfoBox*      _time_info_box;
+
        typedef std::pair<TimeAxisView*,XMLNode*> TAVState;
 
        struct VisualState {
@@ -617,6 +625,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        boost::optional<float>  pre_notebook_shrink_pane_width;
 
+       Gtk::VBox _editor_list_vbox;
        Gtk::Notebook _the_notebook;
        bool _notebook_shrunk;
        void add_notebook_page (std::string const &, Gtk::Widget &);
@@ -645,6 +654,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void toggle_marker_lines ();
        void set_marker_line_visibility (bool);
 
+       void jump_forward_to_mark ();
+       void jump_backward_to_mark ();
+
        uint32_t location_marker_color;
        uint32_t location_range_color;
        uint32_t location_loop_color;
@@ -1009,7 +1021,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        friend class EditorCursor;
 
-       EditorCursor*        playhead_cursor;
+       EditorCursor* playhead_cursor;
+       framepos_t playhead_cursor_sample () const;
 
        framepos_t get_region_boundary (framepos_t pos, int32_t dir, bool with_selection, bool only_onscreen);
 
@@ -1044,7 +1057,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        Gtk::HBox           toplevel_hpacker;
 
-       Gtk::HBox           top_hbox;
        Gtk::HBox           bottom_hbox;
 
        Gtk::Table          edit_packer;
@@ -1304,8 +1316,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void loop_location (ARDOUR::Location&);
 
        void calc_extra_zoom_edges(framepos_t &start, framepos_t &end);
-       void temporal_zoom_selection (bool both_axes = false);
-       void temporal_zoom_region (bool both_axes);
+       void temporal_zoom_selection (Editing::ZoomAxis);
        void temporal_zoom_session ();
        void temporal_zoom (framecnt_t samples_per_pixel);
        void temporal_zoom_by_frame (framepos_t start, framepos_t end);
@@ -1328,8 +1339,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        /* import & embed */
 
        void add_external_audio_action (Editing::ImportMode);
-       void external_audio_dialog ();
-       void session_import_dialog ();
 
        int  check_whether_and_how_to_import(std::string, bool all_or_nothing = true);
        bool check_multichannel_status (const std::vector<std::string>& paths);
@@ -1392,6 +1401,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        AnalysisWindow* analysis_window;
 
+       /* import & embed */
+       void external_audio_dialog ();
+       void session_import_dialog ();
+
        /* import specific info */
 
        struct EditorImportStatus : public ARDOUR::ImportStatus {
@@ -1412,7 +1425,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        void import_audio (bool as_tracks);
        void do_import (std::vector<std::string> paths, bool split, bool as_tracks);
-
+       void import_smf_tempo_map (Evoral::SMF const &, framepos_t pos);
        void move_to_start ();
        void move_to_end ();
        void center_playhead ();
@@ -1430,8 +1443,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void clear_locations ();
        void unhide_markers ();
        void unhide_ranges ();
-       void jump_forward_to_mark ();
-       void jump_backward_to_mark ();
        void cursor_align (bool playhead_to_edit);
        void toggle_skip_playback ();
 
@@ -1656,6 +1667,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void edit_meter_marker (MeterMarker&);
        void edit_control_point (ArdourCanvas::Item*);
        void edit_notes (MidiRegionView*);
+       void edit_region (RegionView*);
+
+       void edit_current_meter ();
+       void edit_current_tempo ();
 
        void marker_menu_edit ();
        void marker_menu_remove ();
@@ -1685,7 +1700,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
        void tempo_or_meter_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
        void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
-       void build_range_marker_menu (bool, bool);
+       void build_range_marker_menu (ARDOUR::Location *, bool, bool);
        void build_marker_menu (ARDOUR::Location *);
        void build_tempo_marker_menu (TempoMarker *, bool);
        void build_meter_marker_menu (MeterMarker *, bool);
@@ -1713,7 +1728,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void compute_current_bbt_points (std::vector<ARDOUR::TempoMap::BBTPoint>& grid, framepos_t left, framepos_t right);
 
        void tempo_map_changed (const PBD::PropertyChange&);
-       void marker_position_changed ();
+       void tempometric_position_changed (const PBD::PropertyChange&);
        void redisplay_tempo (bool immediate_redraw);
 
        uint32_t bbt_beat_subdivision;
@@ -1802,6 +1817,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        Glib::RefPtr<Gtk::RadioAction> zoom_focus_action (Editing::ZoomFocus);
 
+       Gtk::HBox           _track_box;
+
        Gtk::HBox           _zoom_box;
        void                zoom_adjustment_changed();
 
@@ -1810,12 +1827,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void setup_tooltips ();
 
        Gtk::HBox                toolbar_hbox;
-       Gtk::EventBox            toolbar_base;
-       Gtk::Frame               toolbar_frame;
-       Gtk::Viewport           _toolbar_viewport;
 
        void setup_midi_toolbar ();
 
+       void presentation_info_changed (PBD::PropertyChange const &);
+
        /* selection process */
 
        Selection* selection;
@@ -1839,8 +1855,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void point_selection_changed ();
        void marker_selection_changed ();
 
-       bool _ignore_follow_edits;
-
        void cancel_selection ();
        void cancel_time_selection ();
 
@@ -2138,14 +2152,14 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void select_next_route ();
        void select_prev_route ();
 
-       void snap_to_internal (framepos_t&       first,
-                              ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
-                              bool              for_mark  = false,
-                              bool              ensure_snap = false);
+       void snap_to_internal (ARDOUR::MusicFrame& first,
+                              ARDOUR::RoundMode   direction = ARDOUR::RoundNearest,
+                              bool                for_mark  = false,
+                              bool                ensure_snap = false);
 
-       void timecode_snap_to_internal (framepos_t&       first,
-                                       ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
-                                       bool              for_mark  = false);
+       void timecode_snap_to_internal (ARDOUR::MusicFrame& first,
+                                       ARDOUR::RoundMode   direction = ARDOUR::RoundNearest,
+                                       bool                for_mark  = false);
 
        RhythmFerret* rhythm_ferret;
 
@@ -2208,8 +2222,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        bool _region_selection_change_updates_region_list;
 
        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;
 
@@ -2256,6 +2268,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        Gtkmm2ext::ActionMap myactions;
 
        friend class Drag;
+       friend class RegionCutDrag;
        friend class RegionDrag;
        friend class RegionMoveDrag;
        friend class RegionSpliceDrag;