add sampo's synthesize_sources perl script to tools; add scroll-playhead-{forward...
[ardour.git] / gtk2_ardour / public_editor.h
index f70e4c20bd5ee163f2bbf7ea2ccfe581d21194bc..f672ea180d01c2c0ee66174902e50b571939e458 100644 (file)
 #include <jack/types.h>
 #include <sigc++/signal.h>
 
+#include <pbd/statefuldestructible.h> 
+
 #include "editing.h"
 #include "keyboard_target.h"
 #include "canvas.h"
+#include "selection.h"
 
 namespace ARDOUR {
        class Session;
@@ -31,6 +34,7 @@ namespace Gtk {
 class Editor;
 class TimeAxisViewItem;
 class TimeAxisView;
+class PluginUIWindow;
 class PluginSelector;
 class PlaylistSelector;
 class XMLNode;
@@ -50,7 +54,7 @@ class ImageFrameView;
 class ImageFrameTimeAxis;
 class MarkerView;
 
-class PublicEditor : public Gtk::Window, public Stateful {
+class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway {
   public:
        PublicEditor();
        virtual ~PublicEditor();
@@ -74,7 +78,7 @@ class PublicEditor : public Gtk::Window, public Stateful {
        virtual void connect_to_image_compositor()  = 0;
        virtual void scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item)  = 0;
        virtual TimeAxisView* get_named_time_axis(const string & name)  = 0;
-       virtual void consider_auditioning (ARDOUR::Region&) = 0;
+       virtual void consider_auditioning (boost::shared_ptr<ARDOUR::Region>) = 0;
        virtual void set_show_waveforms (bool yn) = 0;
        virtual bool show_waveforms() const = 0;
        virtual void set_show_waveforms_recording (bool yn) = 0;
@@ -82,14 +86,14 @@ class PublicEditor : public Gtk::Window, public Stateful {
        virtual void new_region_from_selection () = 0;
        virtual void separate_region_from_selection () = 0;
        virtual void toggle_playback (bool with_abort) = 0;
-       virtual void set_edit_menu (Gtk::Menu&) = 0;
-       virtual jack_nframes_t unit_to_frame (double unit) = 0;
-       virtual double frame_to_unit (jack_nframes_t frame) = 0;
+       virtual nframes_t unit_to_frame (double unit) = 0;
+       virtual double frame_to_unit (nframes_t frame) = 0;
        virtual double frame_to_unit (double frame) = 0;
-       virtual jack_nframes_t pixel_to_frame (double pixel) = 0;
-       virtual gulong frame_to_pixel (jack_nframes_t frame) = 0;
+       virtual nframes_t pixel_to_frame (double pixel) = 0;
+       virtual gulong frame_to_pixel (nframes_t frame) = 0;
        virtual Selection& get_selection() const = 0;
        virtual Selection& get_cut_buffer() const = 0;
+       virtual bool extend_selection_to_track (TimeAxisView&) = 0;
        virtual void play_selection () = 0;
        virtual void set_show_measures (bool yn) = 0;
        virtual bool show_measures () const = 0;
@@ -103,26 +107,29 @@ class PublicEditor : public Gtk::Window, public Stateful {
        virtual gdouble   get_current_zoom () = 0;
        virtual PlaylistSelector& playlist_selector() const = 0;
        virtual void route_name_changed (TimeAxisView *) = 0;
-       virtual void clear_playlist (ARDOUR::Playlist&) = 0;
+       virtual void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>) = 0;
        virtual void new_playlists () = 0;
        virtual void copy_playlists () = 0;
        virtual void clear_playlists () = 0;
+       virtual bool set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove = false) = 0;
        virtual void set_selected_mixer_strip (TimeAxisView&) = 0;
        virtual void hide_track_in_display (TimeAxisView& tv) = 0;
+       virtual void show_track_in_display (TimeAxisView& tv) = 0;
        virtual void set_follow_playhead (bool yn) = 0;
        virtual void toggle_follow_playhead () = 0;
        virtual bool follow_playhead() const = 0;
+       virtual bool dragging_playhead() const = 0;
        virtual void ensure_float (Gtk::Window&) = 0;
        virtual void show_window () = 0;
        virtual TrackViewList* get_valid_views (TimeAxisView*, ARDOUR::RouteGroup* grp = 0) = 0;
-       virtual jack_nframes_t leftmost_position() const = 0;
-       virtual jack_nframes_t current_page_frames() const = 0;
+       virtual nframes_t leftmost_position() const = 0;
+       virtual nframes_t current_page_frames() const = 0;
        virtual void temporal_zoom_step (bool coarser) = 0;
        virtual void scroll_tracks_down_line () = 0;
        virtual void scroll_tracks_up_line () = 0;
        virtual bool new_regionviews_display_gain () = 0;
        virtual void prepare_for_cleanup () = 0;
-       virtual void reposition_x_origin (jack_nframes_t frame) = 0;
+       virtual void reset_x_origin (nframes_t frame) = 0;
        virtual void remove_last_capture () = 0;
        virtual void maximise_editing_space() = 0;
        virtual void restore_editing_space() = 0;
@@ -132,6 +139,8 @@ class PublicEditor : public Gtk::Window, public Stateful {
        sigc::signal<void> ZoomChanged;
        sigc::signal<void> Resized;
        sigc::signal<void> Realized;
+       sigc::signal<void> GoingAway;
+       sigc::signal<void,nframes_t> UpdateAllTransportClocks;
 
        Glib::RefPtr<Gtk::ActionGroup> editor_actions;
 
@@ -171,6 +180,8 @@ class PublicEditor : public Gtk::Window, public Stateful {
        virtual bool canvas_markerview_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*) = 0;
 
        static PublicEditor* _instance;
+
+       friend class PluginUIWindow;
 };
 
 #endif // __gtk_ardour_public_editor_h__