along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
#ifndef __ardour_editor_h__
#include <ardour/session.h>
#include <ardour/tempo.h>
#include <ardour/location.h>
-#include <ardour/region.h>
+#include <ardour/audioregion.h>
#include "audio_clock.h"
#include "gtk-custom-ruler.h"
class TearOff;
}
-namespace LinuxAudioSystems {
- class AudioEngine;
-}
-
namespace ARDOUR {
class AudioDiskstream;
class RouteGroup;
class Editor : public PublicEditor
{
public:
- Editor (ARDOUR::AudioEngine&);
+ Editor ();
~Editor ();
void connect_to_session (ARDOUR::Session *);
void step_mouse_mode (bool next);
Editing::MouseMode current_mouse_mode () { return mouse_mode; }
- void add_imageframe_time_axis(const string & track_name, void*) ;
- void add_imageframe_marker_time_axis(const string & track_name, TimeAxisView* marked_track, void*) ;
+ void add_imageframe_time_axis(const std::string & track_name, void*) ;
+ void add_imageframe_marker_time_axis(const std::string & track_name, TimeAxisView* marked_track, void*) ;
void connect_to_image_compositor() ;
void scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item) ;
- TimeAxisView* get_named_time_axis(const string & name) ;
+ TimeAxisView* get_named_time_axis(const std::string & name) ;
void consider_auditioning (boost::shared_ptr<ARDOUR::Region>);
void hide_a_region (boost::shared_ptr<ARDOUR::Region>);
void separate_region_from_selection ();
void separate_regions_using_location (ARDOUR::Location&);
void toggle_playback (bool with_abort);
+ void transition_to_rolling (bool forward);
/* undo related */
TrackViewList* get_valid_views (TimeAxisView*, ARDOUR::RouteGroup* grp = 0);
Width editor_mixer_strip_width;
+ void maybe_add_mixer_strip_width (XMLNode&);
void show_editor_mixer (bool yn);
void set_selected_mixer_strip (TimeAxisView&);
void hide_track_in_display (TimeAxisView& tv);
void toggle_xfades_active ();
void toggle_xfade_visibility ();
bool xfade_visibility() const { return _xfade_visibility; }
+ void update_xfade_visibility ();
void update_crossfade_model ();
void set_crossfade_model (ARDOUR::CrossfadeModel);
bool new_regionviews_display_gain () { return _new_regionviews_show_envelope; }
void prepare_for_cleanup ();
- void reposition_x_origin (nframes_t sample);
-
void maximise_editing_space();
void restore_editing_space();
+ void reset_x_origin (nframes_t);
+ void reset_zoom (double);
+ void reposition_and_zoom (nframes_t, double);
+
+ nframes_t edit_cursor_position(bool);
+
protected:
void map_transport_state ();
void map_position_change (nframes_t);
private:
ARDOUR::Session *session;
- ARDOUR::AudioEngine& engine;
bool constructed;
PlaylistSelector* _playlist_selector;
CrossfadeView* clicked_crossfadeview;
ControlPoint* clicked_control_point;
+ void sort_track_selection ();
+
void get_relevant_tracks (std::set<RouteTimeAxisView*>& relevant_tracks);
+ void get_equivalent_regions (RegionView* rv, std::vector<RegionView*>&);
void mapover_tracks (sigc::slot<void,RouteTimeAxisView&,uint32_t> sl);
/* functions to be passed to mapover_tracks(), possibly with sigc::bind()-supplied arguments */
- void mapped_set_selected_regionview_from_click (RouteTimeAxisView&, uint32_t, RegionView*, vector<RegionView*>*);
+ void mapped_get_equivalent_regions (RouteTimeAxisView&, uint32_t, RegionView*, vector<RegionView*>*);
void mapped_use_new_playlist (RouteTimeAxisView&, uint32_t);
void mapped_use_copy_playlist (RouteTimeAxisView&, uint32_t);
void mapped_clear_playlist (RouteTimeAxisView&, uint32_t);
void catch_vanishing_regionview (RegionView *);
bool set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false);
+ void select_all_tracks ();
bool set_selected_control_point_from_click (Selection::Operation op = Selection::Set, bool no_remove=false);
- bool set_selected_track_from_click (Selection::Operation op = Selection::Set, bool no_remove=false);
+ bool set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false);
bool set_selected_regionview_from_click (bool press, Selection::Operation op = Selection::Set, bool no_track_remove=false);
void set_selected_regionview_from_region_list (boost::shared_ptr<ARDOUR::Region> region, Selection::Operation op = Selection::Set);
void add_dstream_context_items (Gtk::Menu_Helpers::MenuList&);
void add_bus_context_items (Gtk::Menu_Helpers::MenuList&);
void add_region_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Region>, Gtk::Menu_Helpers::MenuList&);
- void add_crossfade_context_items (AudioStreamView*, ARDOUR::Crossfade*, Gtk::Menu_Helpers::MenuList&, bool many);
+ void add_crossfade_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Crossfade>, Gtk::Menu_Helpers::MenuList&, bool many);
void add_selection_context_items (Gtk::Menu_Helpers::MenuList&);
void handle_new_route (ARDOUR::Session::RouteList&);
Gtk::EventBox time_canvas_event_box;
Gtk::EventBox track_canvas_event_box;
Gtk::EventBox time_button_event_box;
+ Gtk::Frame time_button_frame;
ArdourCanvas::Group *minsec_group;
ArdourCanvas::Group *bbt_group;
gint metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
gint metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
+ Gtk::Widget *_ruler_separator;
GtkWidget *_smpte_ruler;
GtkWidget *_bbt_ruler;
GtkWidget *_frames_ruler;
nframes_t current_frame;
double length;
- Cursor (Editor&, const string& color, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*));
+ Cursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*));
~Cursor ();
void set_position (nframes_t);
void controls_layout_size_request (Gtk::Requisition*);
Gtk::HScrollbar edit_hscrollbar;
+ bool _dragging_hscrollbar;
void reset_hscrollbar_stepping ();
void tie_vertical_scrolling ();
void canvas_horizontally_scrolled ();
- void reposition_and_zoom (nframes_t sample, double fpu);
- gint deferred_reposition_and_zoom (nframes_t sample, double fpu);
+ struct VisualChange {
+ enum Type {
+ TimeOrigin = 0x1,
+ ZoomLevel = 0x2
+ };
+
+ Type pending;
+ nframes_t time_origin;
+ double frames_per_unit;
+
+ int idle_handler_id;
+
+ VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_unit (0), idle_handler_id (-1) {}
+ };
+
+
+ VisualChange pending_visual_change;
+
+ static int _idle_visual_changer (void *arg);
+ int idle_visual_changer ();
+
+ void queue_visual_change (nframes_t);
+ void queue_visual_change (double);
+
void end_location_changed (ARDOUR::Location*);
- bool repos_zoom_queued;
struct RegionListDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
RegionListDisplayModelColumns() {
SnapshotDisplayModelColumns snapshot_display_columns;
Glib::RefPtr<Gtk::ListStore> snapshot_display_model;
Gtk::TreeView snapshot_display;
+ Gtk::Menu snapshot_context_menu;
bool snapshot_display_button_press (GdkEventButton*);
void snapshot_display_selection_changed ();
void redisplay_snapshots();
+ void popup_snapshot_context_menu (int, int32_t, Glib::ustring);
/* named selections */
Gtkmm2ext::DnDTreeView<ARDOUR::NamedSelection*> named_selection_display;
Gtk::ScrolledWindow named_selection_scroller;
- void name_selection();
- void named_selection_name_chosen ();
- void create_named_selection (const string &);
+ void create_named_selection ();
void paste_named_selection (float times);
+ void remove_selected_named_selections ();
+ void remove_snapshot (Glib::ustring);
+ void rename_snapshot (Glib::ustring);
void handle_new_named_selection ();
void add_named_selection_to_named_selection_display (ARDOUR::NamedSelection&);
void redisplay_named_selections ();
- gint named_selection_display_button_press (GdkEventButton *ev);
+ bool named_selection_display_button_release (GdkEventButton *ev);
+ bool named_selection_display_key_release (GdkEventKey *ev);
void named_selection_display_selection_changed ();
/* track views */
- int track_spacing;
TrackViewList track_views;
TimeAxisView *trackview_by_y_position (double ypos);
void align_relative (ARDOUR::RegionPoint);
void naturalize ();
+ void reset_focus ();
+
void cut ();
void copy ();
void paste (float times);
void edit_cursor_forward ();
void playhead_backward ();
void playhead_forward ();
+ void scroll_playhead (bool forward);
void scroll_backward (float pages=0.8f);
void scroll_forward (float pages=0.8f);
void scroll_tracks_down ();
void fade_out_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
void fade_in_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
void fade_out_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
+
+ void set_fade_in_shape (ARDOUR::AudioRegion::FadeShape);
+ void set_fade_out_shape (ARDOUR::AudioRegion::FadeShape);
+
+ void set_fade_in_active (bool);
+ void set_fade_out_active (bool);
std::set<boost::shared_ptr<ARDOUR::Playlist> > motion_frozen_playlists;
void region_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
bool canvas_playhead_cursor_event (GdkEvent* event, ArdourCanvas::Item*);
bool canvas_edit_cursor_event (GdkEvent* event, ArdourCanvas::Item*);
- bool track_canvas_event (GdkEvent* event, ArdourCanvas::Item*);
bool track_canvas_scroll (GdkEventScroll* event);
+ bool track_canvas_scroll_event (GdkEventScroll* event);
+ bool track_canvas_button_press_event (GdkEventButton* event);
+ bool track_canvas_button_release_event (GdkEventButton* event);
+ bool track_canvas_motion_notify_event (GdkEventMotion* event);
+
Gtk::Allocation canvas_allocation;
bool canvas_idle_queued;
void track_canvas_allocate (Gtk::Allocation alloc);
- bool track_canvas_idle ();
+ bool track_canvas_size_allocated ();
void set_edit_cursor (GdkEvent* event);
void set_playhead_cursor (GdkEvent* event);
void marker_menu_hide ();
void marker_menu_loop_range ();
void marker_menu_select_all_selectables_using_range ();
+ void marker_menu_select_using_range ();
void marker_menu_separate_regions_using_location ();
void marker_menu_play_from ();
void marker_menu_play_range ();
void draw_metric_marks (const ARDOUR::Metrics& metrics);
void tempo_map_changed (ARDOUR::Change);
- void redisplay_tempo ();
+ void redisplay_tempo (bool immediate_redraw);
void snap_to (nframes_t& first, int32_t direction = 0, bool for_mark = false);
uint32_t bbt_beat_subdivision;
void drag_rubberband_select (ArdourCanvas::Item* item, GdkEvent* event);
void end_rubberband_select (ArdourCanvas::Item* item, GdkEvent* event);
- bool select_all_within (nframes_t start, nframes_t end, gdouble topy, gdouble boty, Selection::Operation op);
+ bool select_all_within (nframes_t start, nframes_t end, gdouble topy, gdouble boty, const TrackViewList&, Selection::Operation op);
ArdourCanvas::SimpleRect *rubberband_rect;
ImageFrameSocketHandler* image_socket_listener ;
/* </CMT Additions> */
- void toggle_xfade_active (ARDOUR::Crossfade*);
- void toggle_xfade_length (ARDOUR::Crossfade*);
- void edit_xfade (ARDOUR::Crossfade*);
+ void toggle_xfade_active (boost::weak_ptr<ARDOUR::Crossfade>);
+ void toggle_xfade_length (boost::weak_ptr<ARDOUR::Crossfade>);
+ void edit_xfade (boost::weak_ptr<ARDOUR::Crossfade>);
void xfade_edit_left_region ();
void xfade_edit_right_region ();
Glib::RefPtr<Gtk::Action> redo_action;
void history_changed ();
-
};
#endif /* __ardour_editor_h__ */