Shut up.
[ardour.git] / gtk2_ardour / editor.h
index aaaa7397e87c14740013193a0595145212376c58..167ad65b1f0ebd7647d2b0f29b48e6e14268053e 100644 (file)
 #include <gtkmm2ext/click_box.h>
 #include <gtkmm2ext/dndtreeview.h>
 
-#include <pbd/stateful.h>
-#include <ardour/session.h>
-#include <ardour/tempo.h>
-#include <ardour/stretch.h>
-#include <ardour/location.h>
-#include <ardour/audioregion.h>
-#include <ardour/track.h>
-#include <ardour/types.h>
+#include "pbd/stateful.h"
+#include "ardour/session.h"
+#include "ardour/tempo.h"
+#include "ardour/stretch.h"
+#include "ardour/location.h"
+#include "ardour/audioregion.h"
+#include "ardour/track.h"
+#include "ardour/types.h"
 
 #include "audio_clock.h"
 #include "gtk-custom-ruler.h"
@@ -88,30 +88,31 @@ namespace LADSPA {
        class Plugin;
 }
 
-class TimeAxisView;
+class AnalysisWindow;
+class AudioRegionView;
+class AudioStreamView;
 class AudioTimeAxisView;
+class AutomationLine;
+class AutomationSelection;
 class AutomationTimeAxisView;
-class AudioRegionView;
+class BundleManager;
+class ControlPoint;
 class CrossfadeView;
-class PluginSelector;
-class PlaylistSelector;
-class Marker;
+class GlobalPortMatrixWindow;
 class GroupedButtons;
-class AutomationLine;
+class Marker;
+class MixerStrip;
+class PlaylistSelector;
+class PluginSelector;
+class RhythmFerret;
 class Selection;
+class SoundFileOmega;
+class StreamView;
 class TempoLines;
+class TimeAxisView;
+class TimeFXDialog;
 class TimeSelection;
 class TrackSelection;
-class AutomationSelection;
-class MixerStrip;
-class StreamView;
-class AudioStreamView;
-class ControlPoint;
-class SoundFileOmega;
-class RhythmFerret;
-class AnalysisWindow;
-class BundleManager;
-class GlobalPortMatrixWindow;
 
 /* <CMT Additions> */
 class ImageFrameView;
@@ -133,7 +134,7 @@ class Editor : public PublicEditor
        void             connect_to_session (ARDOUR::Session *);
        ARDOUR::Session* current_session() const { return session; }
        void             first_idle ();
-       virtual bool have_idled() const { return _have_idled; }
+       virtual bool     have_idled () const { return _have_idled; }
 
        nframes64_t leftmost_position() const { return leftmost_frame; }
        nframes64_t current_page_frames() const {
@@ -264,6 +265,7 @@ class Editor : public PublicEditor
        bool show_measures () const { return _show_measures; }
 
        /* analysis window */
+
        void analyze_region_selection();
        void analyze_range_selection();
 
@@ -277,9 +279,9 @@ class Editor : public PublicEditor
        void add_toplevel_controls (Gtk::Container&);
        Gtk::HBox& get_status_bar_packer()  { return status_bar_hpacker; }
 
-       void      set_zoom_focus (Editing::ZoomFocus);
+       void               set_zoom_focus (Editing::ZoomFocus);
        Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
-       double   get_current_zoom () const { return frames_per_unit; }
+       double             get_current_zoom () const { return frames_per_unit; }
 
        void temporal_zoom_step (bool coarser);
 
@@ -294,6 +296,7 @@ class Editor : public PublicEditor
        void clear_playlists (TimeAxisView* v);
 
        TrackViewList* get_valid_views (TimeAxisView*, ARDOUR::RouteGroup* grp = 0);
+       void get_onscreen_tracks (TrackViewList&);
 
        Width editor_mixer_strip_width;
        void maybe_add_mixer_strip_width (XMLNode&);
@@ -337,8 +340,8 @@ class Editor : public PublicEditor
        void video_pullup_chosen (ARDOUR::Session::PullupFormat pullup);
        void subframes_per_frame_chosen (uint32_t);
 
-       void update_smpte_mode();
-       void update_video_pullup();
+       void update_smpte_mode ();
+       void update_video_pullup ();
        void update_subframes_per_frame ();
 
        /* fades/xfades */
@@ -525,10 +528,10 @@ class Editor : public PublicEditor
 
        TimeAxisView*      clicked_axisview;
        RouteTimeAxisView* clicked_routeview;
-        /** The last RegionView that was clicked on, or 0 if the last click was not
-         * on a RegionView.  This is set up by the canvas event handlers in
-         * editor_canvas_events.cc
-         */
+       /** The last RegionView that was clicked on, or 0 if the last click was not
+        * on a RegionView.  This is set up by the canvas event handlers in
+        * editor_canvas_events.cc
+        */
        RegionView*        clicked_regionview;
        RegionSelection    latest_regionviews;
        uint32_t           clicked_selection;
@@ -595,7 +598,7 @@ class Editor : public PublicEditor
 
        void add_item_with_sensitivity (Gtk::Menu_Helpers::MenuList&, Gtk::Menu_Helpers::MenuElem, bool) const;
 
-       void handle_new_route (ARDOUR::Session::RouteList&);
+       void handle_new_route (ARDOUR::RouteList&);
        void remove_route (TimeAxisView *);
        bool route_removal;
 
@@ -628,10 +631,10 @@ class Editor : public PublicEditor
 
        bool verbose_cursor_on; // so far unused
 
-       Gtk::EventBox      time_canvas_event_box;
-       Gtk::EventBox      track_canvas_event_box;
-       Gtk::EventBox      time_button_event_box;
-       Gtk::EventBox      ruler_label_event_box;
+       Gtk::EventBox             time_canvas_event_box;
+       Gtk::EventBox             track_canvas_event_box;
+       Gtk::EventBox             time_button_event_box;
+       Gtk::EventBox             ruler_label_event_box;
 
        ArdourCanvas::Group      *minsec_group;
        ArdourCanvas::Pixbuf     *logo_item;
@@ -696,14 +699,14 @@ class Editor : public PublicEditor
        Glib::RefPtr<Gtk::ToggleAction> ruler_range_action;
        Glib::RefPtr<Gtk::ToggleAction> ruler_loop_punch_action;
        Glib::RefPtr<Gtk::ToggleAction> ruler_cd_marker_action;
-       bool                   no_ruler_shown_update;
+       bool                            no_ruler_shown_update;
        
        gint ruler_button_press (GdkEventButton*);
        gint ruler_button_release (GdkEventButton*);
        gint ruler_mouse_motion (GdkEventMotion*);
        bool ruler_scroll (GdkEventScroll* event);
 
-       gint ruler_pressed_button;
+       gint          ruler_pressed_button;
        Gtk::Widget * ruler_grabbed_widget;
        
        void initialize_rulers ();
@@ -813,7 +816,6 @@ class Editor : public PublicEditor
        Gtk::Label  range_mark_label;
        Gtk::Label  transport_mark_label;
        Gtk::Label  cd_mark_label;
-       
 
        Gtk::VBox          time_button_vbox;
        Gtk::HBox          time_button_hbox;
@@ -833,25 +835,23 @@ class Editor : public PublicEditor
            void set_y_axis (double position);
        };
 
-       friend struct Cursor; /* it needs access to several private
-                                fields. XXX fix me.
-                             */
-
-       Cursor* playhead_cursor;
+       Cursor*              playhead_cursor;
        ArdourCanvas::Group* cursor_group;
 
-       void    cursor_to_region_boundary (Cursor*, int32_t dir);
-       void    cursor_to_next_region_boundary (Cursor*);
-       void    cursor_to_previous_region_boundary (Cursor*);
+       nframes64_t get_region_boundary (nframes64_t pos, int32_t dir, bool with_selection, bool only_onscreen);
+
+       void    cursor_to_region_boundary (bool with_selection, int32_t dir);
+       void    cursor_to_next_region_boundary (bool with_selection);
+       void    cursor_to_previous_region_boundary (bool with_selection);
        void    cursor_to_next_region_point (Cursor*, ARDOUR::RegionPoint);
        void    cursor_to_previous_region_point (Cursor*, ARDOUR::RegionPoint);
        void    cursor_to_region_point (Cursor*, ARDOUR::RegionPoint, int32_t dir);
        void    cursor_to_selection_start (Cursor *);
        void    cursor_to_selection_end   (Cursor *);
 
-       void    selected_marker_to_region_boundary (int32_t dir);
-       void    selected_marker_to_next_region_boundary ();
-       void    selected_marker_to_previous_region_boundary ();
+       void    selected_marker_to_region_boundary (bool with_selection, int32_t dir);
+       void    selected_marker_to_next_region_boundary (bool with_selection);
+       void    selected_marker_to_previous_region_boundary (bool with_selection);
        void    selected_marker_to_next_region_point (ARDOUR::RegionPoint);
        void    selected_marker_to_previous_region_point (ARDOUR::RegionPoint);
        void    selected_marker_to_region_point (ARDOUR::RegionPoint, int32_t dir);
@@ -1191,6 +1191,7 @@ class Editor : public PublicEditor
        void audition_playlist_region_via_route (boost::shared_ptr<ARDOUR::Region>, ARDOUR::Route&);
        void split_multichannel_region();
        void reverse_region ();
+       void strip_region_silence ();
        void normalize_region ();
        void denormalize_region ();
        void adjust_region_scale_amplitude (bool up);
@@ -1305,7 +1306,7 @@ class Editor : public PublicEditor
 
        /* import specific info */
 
-       struct EditorImportStatus : public ARDOUR::Session::import_status {
+       struct EditorImportStatus : public ARDOUR::Session::ImportStatus {
            Editing::ImportMode mode;
            nframes64_t pos;
            int target_tracks;
@@ -1911,6 +1912,7 @@ public:
        void route_list_reordered (const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator& iter, int* what);
        bool ignore_route_list_reorder;
        bool no_route_list_redisplay;
+       bool sync_track_view_list_and_route_list ();
 
        void build_route_list_menu ();
        void show_route_list_menu ();
@@ -1996,8 +1998,8 @@ public:
        void point_trim (GdkEvent*);
        void trim_motion_callback (ArdourCanvas::Item*, GdkEvent*);
        void single_contents_trim (RegionView&, nframes64_t, bool, bool, bool);
-       void single_start_trim (RegionView&, nframes64_t, bool, bool);
-       void single_end_trim (RegionView&, nframes64_t, bool, bool);
+       void single_start_trim (RegionView&, nframes64_t, bool, bool, bool);
+       void single_end_trim (RegionView&, nframes64_t, bool, bool, bool);
 
        void trim_finished_callback (ArdourCanvas::Item*, GdkEvent*);
        void thaw_region_after_trim (RegionView& rv);
@@ -2012,59 +2014,69 @@ public:
        void trim_region_to_punch ();
        void trim_region_to_location (const ARDOUR::Location&, const char* cmd);
 
+       void trim_to_region(bool forward);
+       void trim_region_to_previous_region_end();
+       void trim_region_to_next_region_start();
+
        bool show_gain_after_trim;
 
        /* Drag-n-Drop */
 
-       int convert_drop_to_paths (std::vector<Glib::ustring>& paths,
-                                  const Glib::RefPtr<Gdk::DragContext>& context,
-                                  gint                x,
-                                  gint                y,
-                                  const Gtk::SelectionData& data,
-                                  guint               info,
-                                  guint               time);
-
-       void  track_canvas_drag_data_received  (const Glib::RefPtr<Gdk::DragContext>& context,
-                                               gint                x,
-                                               gint                y,
-                                               const Gtk::SelectionData& data,
-                                               guint               info,
-                                               guint               time);
+       int convert_drop_to_paths (
+                       std::vector<Glib::ustring>&           paths,
+                       const Glib::RefPtr<Gdk::DragContext>& context,
+                       gint                                  x,
+                       gint                                  y,
+                       const Gtk::SelectionData&             data,
+                       guint                                 info,
+                       guint                                 time);
+
+       void track_canvas_drag_data_received (
+                       const Glib::RefPtr<Gdk::DragContext>& context,
+                       gint                                  x,
+                       gint                                  y,
+                       const Gtk::SelectionData&             data,
+                       guint                                 info,
+                       guint                                 time);
        
-       void  region_list_display_drag_data_received  (const Glib::RefPtr<Gdk::DragContext>& context,
-                                                      gint                x,
-                                                      gint                y,
-                                                      const Gtk::SelectionData& data,
-                                                      guint               info,
-                                                      guint               time);
-
-       void  drop_paths  (const Glib::RefPtr<Gdk::DragContext>& context,
-                          gint                x,
-                          gint                y,
-                          const Gtk::SelectionData& data,
-                          guint               info,
-                          guint               time);
-
-       void  drop_regions  (const Glib::RefPtr<Gdk::DragContext>& context,
-                            gint                x,
-                            gint                y,
-                            const Gtk::SelectionData& data,
-                            guint               info,
-                            guint               time);
-
-       void  drop_routes (const Glib::RefPtr<Gdk::DragContext>& context,
-                          gint                x,
-                          gint                y,
-                          const Gtk::SelectionData& data,
-                          guint               info,
-                          guint               time);
+       void region_list_display_drag_data_received (
+                       const Glib::RefPtr<Gdk::DragContext>& context,
+                       gint                                  x,
+                       gint                                  y,
+                       const Gtk::SelectionData&             data,
+                       guint                                 info,
+                       guint                                 time);
+
+       void drop_paths (
+                       const Glib::RefPtr<Gdk::DragContext>& context,
+                       gint                                  x,
+                       gint                                  y,
+                       const Gtk::SelectionData&             data,
+                       guint                                 info,
+                       guint                                 time);
+
+       void drop_regions (
+                       const Glib::RefPtr<Gdk::DragContext>& context,
+                       gint                                  x,
+                       gint                                  y,
+                       const Gtk::SelectionData&             data,
+                       guint                                 info,
+                       guint                                 time);
+
+       void drop_routes (
+                       const Glib::RefPtr<Gdk::DragContext>& context,
+                       gint                x,
+                       gint                y,
+                       const Gtk::SelectionData& data,
+                       guint               info,
+                       guint               time);
 
        /* audio export */
 
        int  write_region_selection(RegionSelection&);
        bool write_region (string path, boost::shared_ptr<ARDOUR::AudioRegion>);
        void bounce_region_selection ();
-       void bounce_range_selection (bool replace);
+       void bounce_range_selection (bool replace, bool enable_processing);
        void external_edit_region ();
 
        int write_audio_selection (TimeSelection&);
@@ -2072,10 +2084,6 @@ public:
 
        void write_selection ();
 
-       /* history */
-
-       UndoAction get_memento() const;
-
        XMLNode *before; /* used in *_reversible_command */
 
        void begin_reversible_command (string cmd_name);
@@ -2128,49 +2136,8 @@ public:
        void start_time_fx (ArdourCanvas::Item*, GdkEvent*);
        void end_time_fx (ArdourCanvas::Item*, GdkEvent*);
 
-       struct TimeFXDialog : public ArdourDialog {
-           ARDOUR::TimeFXRequest request;
-           Editor&               editor;
-           bool                  pitching;
-           Gtk::Adjustment       pitch_octave_adjustment;
-           Gtk::Adjustment       pitch_semitone_adjustment;
-           Gtk::Adjustment       pitch_cent_adjustment;
-           Gtk::SpinButton       pitch_octave_spinner;
-           Gtk::SpinButton       pitch_semitone_spinner;
-           Gtk::SpinButton       pitch_cent_spinner;
-           RegionSelection       regions;
-           Gtk::ProgressBar      progress_bar;
-
-           /* SoundTouch */
-           Gtk::ToggleButton     quick_button;
-           Gtk::ToggleButton     antialias_button;
-           Gtk::HBox             upper_button_box;
-
-           /* RubberBand */
-           Gtk::ComboBoxText     stretch_opts_selector;
-           Gtk::Label            stretch_opts_label;
-           Gtk::ToggleButton     precise_button;
-           Gtk::ToggleButton     preserve_formants_button;
-           Gtk::HBox             opts_box;
-
-           Gtk::Button*          cancel_button;
-           Gtk::Button*          action_button;
-           Gtk::VBox             packer;
-           int                   status;
-
-           TimeFXDialog (Editor& e, bool for_pitch);
-
-           gint update_progress ();
-           sigc::connection first_cancel;
-           sigc::connection first_delete;
-           void cancel_in_progress ();
-           gint delete_in_progress (GdkEventAny*);
-       };
-
        /* "whats mine is yours" */
 
-       friend class TimeFXDialog;
-
        TimeFXDialog* current_timefx;
 
        static void* timefx_thread (void *arg);
@@ -2356,12 +2323,6 @@ public:
 
        void fit_tracks ();
        void set_track_height (uint32_t h);
-       void set_track_height_largest ();
-       void set_track_height_large ();
-       void set_track_height_larger ();
-       void set_track_height_normal ();
-       void set_track_height_smaller ();
-       void set_track_height_small ();
 
        void remove_tracks ();
        void toggle_tracks_active ();
@@ -2376,6 +2337,9 @@ public:
 
        void visible_order_range (int*, int*) const;
        bool y_movement_disallowed (int, int, int, int, int, std::bitset<512> const &, std::vector<int32_t> const &) const;
+
+       void located ();
+       bool _pending_locate_request;
 };
 
 #endif /* __ardour_editor_h__ */