Factor regions list out of Editor.
git-svn-id: svn://localhost/ardour2/branches/3.0@5312 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
06ce1ae213
commit
a3f7f86d9b
|
@ -102,6 +102,7 @@
|
|||
#include "midi_time_axis.h"
|
||||
#include "mixer_strip.h"
|
||||
#include "editor_route_groups.h"
|
||||
#include "editor_regions.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
|
@ -305,17 +306,14 @@ Editor::Editor ()
|
|||
show_gain_after_trim = false;
|
||||
verbose_cursor_on = true;
|
||||
route_removal = false;
|
||||
show_automatic_regions_in_region_list = true;
|
||||
last_item_entered = 0;
|
||||
last_item_entered_n = 0;
|
||||
|
||||
region_list_sort_type = (Editing::RegionListSortType) 0;
|
||||
have_pending_keyboard_selection = false;
|
||||
_follow_playhead = true;
|
||||
_xfade_visibility = true;
|
||||
editor_ruler_menu = 0;
|
||||
no_ruler_shown_update = false;
|
||||
region_list_menu = 0;
|
||||
marker_menu = 0;
|
||||
start_end_marker_menu = 0;
|
||||
range_marker_menu = 0;
|
||||
|
@ -352,7 +350,6 @@ Editor::Editor ()
|
|||
}
|
||||
allow_vertical_scroll = false;
|
||||
no_save_visual = false;
|
||||
no_region_list_redisplay = false;
|
||||
resize_idle_id = -1;
|
||||
|
||||
scrubbing_direction = 0;
|
||||
|
@ -532,74 +529,8 @@ Editor::Editor ()
|
|||
|
||||
_route_groups = new EditorRouteGroups (this);
|
||||
_routes = new EditorRoutes (this);
|
||||
_regions = new EditorRegions (this);
|
||||
|
||||
region_list_display.set_size_request (100, -1);
|
||||
region_list_display.set_name ("RegionListDisplay");
|
||||
/* Try to prevent single mouse presses from initiating edits.
|
||||
This relies on a hack in gtktreeview.c:gtk_treeview_button_press()
|
||||
*/
|
||||
region_list_display.set_data ("mouse-edits-require-mod1", (gpointer) 0x1);
|
||||
|
||||
region_list_model = TreeStore::create (region_list_columns);
|
||||
region_list_model->set_sort_func (0, mem_fun (*this, &Editor::region_list_sorter));
|
||||
region_list_model->set_sort_column (0, SORT_ASCENDING);
|
||||
|
||||
region_list_display.set_model (region_list_model);
|
||||
region_list_display.append_column (_("Regions"), region_list_columns.name);
|
||||
region_list_display.append_column (_("Start"), region_list_columns.start);
|
||||
region_list_display.append_column (_("End"), region_list_columns.end);
|
||||
region_list_display.append_column (_("Length"), region_list_columns.length);
|
||||
region_list_display.append_column (_("Sync"), region_list_columns.sync);
|
||||
region_list_display.append_column (_("Fade In"), region_list_columns.fadein);
|
||||
region_list_display.append_column (_("Fade Out"), region_list_columns.fadeout);
|
||||
region_list_display.append_column (_("L"), region_list_columns.locked);
|
||||
region_list_display.append_column (_("G"), region_list_columns.glued);
|
||||
region_list_display.append_column (_("M"), region_list_columns.muted);
|
||||
region_list_display.append_column (_("O"), region_list_columns.opaque);
|
||||
region_list_display.append_column (_("Used"), region_list_columns.used);
|
||||
region_list_display.append_column (_("Path"), region_list_columns.path);
|
||||
region_list_display.set_headers_visible (true);
|
||||
//region_list_display.set_grid_lines (TREE_VIEW_GRID_LINES_BOTH);
|
||||
|
||||
CellRendererText* region_name_cell = dynamic_cast<CellRendererText*>(region_list_display.get_column_cell_renderer (0));
|
||||
region_name_cell->property_editable() = true;
|
||||
region_name_cell->signal_edited().connect (mem_fun (*this, &Editor::region_name_edit));
|
||||
|
||||
region_list_display.get_selection()->set_select_function (mem_fun (*this, &Editor::region_list_selection_filter));
|
||||
|
||||
TreeViewColumn* tv_col = region_list_display.get_column(0);
|
||||
CellRendererText* renderer = dynamic_cast<CellRendererText*>(region_list_display.get_column_cell_renderer (0));
|
||||
tv_col->add_attribute(renderer->property_text(), region_list_columns.name);
|
||||
tv_col->add_attribute(renderer->property_foreground_gdk(), region_list_columns.color_);
|
||||
|
||||
region_list_display.get_selection()->set_mode (SELECTION_MULTIPLE);
|
||||
region_list_display.add_object_drag (region_list_columns.region.index(), "regions");
|
||||
|
||||
/* setup DnD handling */
|
||||
|
||||
list<TargetEntry> region_list_target_table;
|
||||
|
||||
region_list_target_table.push_back (TargetEntry ("text/plain"));
|
||||
region_list_target_table.push_back (TargetEntry ("text/uri-list"));
|
||||
region_list_target_table.push_back (TargetEntry ("application/x-rootwin-drop"));
|
||||
|
||||
region_list_display.add_drop_targets (region_list_target_table);
|
||||
region_list_display.signal_drag_data_received().connect (mem_fun(*this, &Editor::region_list_display_drag_data_received));
|
||||
|
||||
region_list_scroller.add (region_list_display);
|
||||
region_list_scroller.set_policy (POLICY_AUTOMATIC, POLICY_AUTOMATIC);
|
||||
|
||||
region_list_display.signal_key_press_event().connect (mem_fun(*this, &Editor::region_list_display_key_press));
|
||||
region_list_display.signal_key_release_event().connect (mem_fun(*this, &Editor::region_list_display_key_release));
|
||||
region_list_display.signal_button_press_event().connect (mem_fun(*this, &Editor::region_list_display_button_press), false);
|
||||
region_list_display.signal_button_release_event().connect (mem_fun(*this, &Editor::region_list_display_button_release));
|
||||
region_list_change_connection = region_list_display.get_selection()->signal_changed().connect (mem_fun(*this, &Editor::region_list_selection_changed));
|
||||
// region_list_display.signal_popup_menu().connect (bind (mem_fun (*this, &Editor::show_region_list_display_context_menu), 1, 0));
|
||||
|
||||
//ARDOUR_UI::instance()->secondary_clock.mode_changed.connect (mem_fun(*this, &Editor::redisplay_regions));
|
||||
ARDOUR_UI::instance()->secondary_clock.mode_changed.connect (mem_fun(*this, &Editor::update_all_region_rows));
|
||||
ARDOUR::Region::RegionPropertyChanged.connect (mem_fun(*this, &Editor::update_region_row));
|
||||
|
||||
named_selection_scroller.add (named_selection_display);
|
||||
named_selection_scroller.set_policy (POLICY_NEVER, POLICY_AUTOMATIC);
|
||||
|
||||
|
@ -635,7 +566,7 @@ Editor::Editor ()
|
|||
|
||||
nlabel = manage (new Label (_("Regions")));
|
||||
nlabel->set_angle (-90);
|
||||
the_notebook.append_page (region_list_scroller, *nlabel);
|
||||
the_notebook.append_page (_regions->widget (), *nlabel);
|
||||
nlabel = manage (new Label (_("Tracks/Busses")));
|
||||
nlabel->set_angle (-90);
|
||||
the_notebook.append_page (_routes->widget (), *nlabel);
|
||||
|
@ -1166,15 +1097,12 @@ Editor::connect_to_session (Session *t)
|
|||
session_connections.push_back (session->TransportStateChange.connect (mem_fun(*this, &Editor::map_transport_state)));
|
||||
session_connections.push_back (session->PositionChanged.connect (mem_fun(*this, &Editor::map_position_change)));
|
||||
session_connections.push_back (session->RouteAdded.connect (mem_fun(*this, &Editor::handle_new_route)));
|
||||
session_connections.push_back (session->RegionsAdded.connect (mem_fun(*this, &Editor::handle_new_regions)));
|
||||
session_connections.push_back (session->RegionRemoved.connect (mem_fun(*this, &Editor::handle_region_removed)));
|
||||
session_connections.push_back (session->DurationChanged.connect (mem_fun(*this, &Editor::handle_new_duration)));
|
||||
session_connections.push_back (session->NamedSelectionAdded.connect (mem_fun(*this, &Editor::handle_new_named_selection)));
|
||||
session_connections.push_back (session->NamedSelectionRemoved.connect (mem_fun(*this, &Editor::handle_new_named_selection)));
|
||||
session_connections.push_back (session->DirtyChanged.connect (mem_fun(*this, &Editor::update_title)));
|
||||
session_connections.push_back (session->StateSaved.connect (mem_fun(*this, &Editor::update_title_s)));
|
||||
session_connections.push_back (session->AskAboutPlaylistDeletion.connect (mem_fun(*this, &Editor::playlist_deletion_dialog)));
|
||||
session_connections.push_back (session->RegionHiddenChange.connect (mem_fun(*this, &Editor::region_hidden)));
|
||||
|
||||
session_connections.push_back (session->SMPTEOffsetChanged.connect (mem_fun(*this, &Editor::update_just_smpte)));
|
||||
|
||||
|
@ -1183,8 +1111,6 @@ Editor::connect_to_session (Session *t)
|
|||
session_connections.push_back (session->Located.connect (mem_fun (*this, &Editor::located)));
|
||||
session_connections.push_back (session->config.ParameterChanged.connect (mem_fun (*this, &Editor::parameter_changed)));
|
||||
|
||||
_route_groups->connect_to_session (session);
|
||||
|
||||
edit_point_clock.set_mode(AudioClock::BBT);
|
||||
edit_point_clock.set_session (session);
|
||||
zoom_range_clock.set_session (session);
|
||||
|
@ -1256,7 +1182,6 @@ Editor::connect_to_session (Session *t)
|
|||
|
||||
handle_new_duration ();
|
||||
|
||||
redisplay_regions ();
|
||||
redisplay_named_selections ();
|
||||
redisplay_snapshots ();
|
||||
|
||||
|
@ -1289,6 +1214,8 @@ Editor::connect_to_session (Session *t)
|
|||
|
||||
_summary->connect_to_session (session);
|
||||
_group_tabs->connect_to_session (session);
|
||||
_route_groups->connect_to_session (session);
|
||||
_regions->connect_to_session (session);
|
||||
|
||||
start_updating ();
|
||||
}
|
||||
|
@ -2477,8 +2404,7 @@ Editor::set_state (const XMLNode& node)
|
|||
}
|
||||
|
||||
if ((prop = node.property ("region-list-sort-type"))) {
|
||||
region_list_sort_type = (Editing::RegionListSortType) -1; // force change
|
||||
reset_region_list_sort_type(str2regionlistsorttype(prop->value()));
|
||||
_regions->reset_sort_type (str2regionlistsorttype(prop->value()), true);
|
||||
}
|
||||
|
||||
if ((prop = node.property ("xfades-visible"))) {
|
||||
|
@ -2579,7 +2505,7 @@ Editor::get_state ()
|
|||
node->add_property ("show-measures", _show_measures ? "yes" : "no");
|
||||
node->add_property ("follow-playhead", _follow_playhead ? "yes" : "no");
|
||||
node->add_property ("xfades-visible", _xfade_visibility ? "yes" : "no");
|
||||
node->add_property ("region-list-sort-type", enum2str(region_list_sort_type));
|
||||
node->add_property ("region-list-sort-type", enum2str (_regions->sort_type ()));
|
||||
node->add_property ("mouse-mode", enum2str(mouse_mode));
|
||||
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("show-editor-mixer"));
|
||||
|
@ -4086,14 +4012,13 @@ Editor::prepare_for_cleanup ()
|
|||
selection->clear_regions ();
|
||||
selection->clear_playlists ();
|
||||
|
||||
no_region_list_redisplay = true;
|
||||
_regions->suspend_redisplay ();
|
||||
}
|
||||
|
||||
void
|
||||
Editor::finish_cleanup ()
|
||||
{
|
||||
no_region_list_redisplay = false;
|
||||
redisplay_regions ();
|
||||
_regions->resume_redisplay ();
|
||||
}
|
||||
|
||||
Location*
|
||||
|
@ -5276,3 +5201,50 @@ Editor::fit_route_group (RouteGroup *g)
|
|||
TrackSelection ts = axis_views_from_routes (g->route_list ());
|
||||
fit_tracks (ts);
|
||||
}
|
||||
|
||||
void
|
||||
Editor::consider_auditioning (boost::shared_ptr<Region> region)
|
||||
{
|
||||
boost::shared_ptr<AudioRegion> r = boost::dynamic_pointer_cast<AudioRegion> (region);
|
||||
|
||||
if (r == 0) {
|
||||
session->cancel_audition ();
|
||||
return;
|
||||
}
|
||||
|
||||
if (session->is_auditioning()) {
|
||||
session->cancel_audition ();
|
||||
if (r == last_audition_region) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
session->audition_region (r);
|
||||
last_audition_region = r;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Editor::hide_a_region (boost::shared_ptr<Region> r)
|
||||
{
|
||||
r->set_hidden (true);
|
||||
}
|
||||
|
||||
void
|
||||
Editor::remove_a_region (boost::shared_ptr<Region> r)
|
||||
{
|
||||
session->remove_region_from_region_list (r);
|
||||
}
|
||||
|
||||
void
|
||||
Editor::audition_region_from_region_list ()
|
||||
{
|
||||
_regions->selection_mapover (mem_fun (*this, &Editor::consider_auditioning));
|
||||
}
|
||||
|
||||
void
|
||||
Editor::hide_region_from_region_list ()
|
||||
{
|
||||
_regions->selection_mapover (mem_fun (*this, &Editor::hide_a_region));
|
||||
}
|
||||
|
||||
|
|
|
@ -118,6 +118,7 @@ class TrackSelection;
|
|||
class EditorGroupTabs;
|
||||
class EditorRoutes;
|
||||
class EditorRouteGroups;
|
||||
class EditorRegions;
|
||||
|
||||
/* <CMT Additions> */
|
||||
class ImageFrameView;
|
||||
|
@ -279,6 +280,8 @@ class Editor : public PublicEditor
|
|||
void invert_selection_in_track ();
|
||||
void invert_selection ();
|
||||
void deselect_all ();
|
||||
|
||||
void set_selected_regionview_from_region_list (boost::shared_ptr<ARDOUR::Region> region, Selection::Operation op = Selection::Set);
|
||||
|
||||
/* tempo */
|
||||
|
||||
|
@ -404,6 +407,13 @@ class Editor : public PublicEditor
|
|||
return track_views;
|
||||
}
|
||||
|
||||
int get_regionview_count_from_region_list (boost::shared_ptr<ARDOUR::Region>);
|
||||
|
||||
void do_import (std::vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t&);
|
||||
void do_embed (std::vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
|
||||
|
||||
void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions);
|
||||
|
||||
protected:
|
||||
void map_transport_state ();
|
||||
void map_position_change (nframes64_t);
|
||||
|
@ -412,9 +422,9 @@ class Editor : public PublicEditor
|
|||
|
||||
private:
|
||||
|
||||
/// The session that we are editing, or 0
|
||||
void color_handler ();
|
||||
ARDOUR::Session *session;
|
||||
|
||||
ARDOUR::Session *session; ///< The session that we are editing, or 0
|
||||
bool constructed;
|
||||
|
||||
// to keep track of the playhead position for control_scroll
|
||||
|
@ -557,14 +567,11 @@ class Editor : public PublicEditor
|
|||
void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false);
|
||||
void select_all_tracks ();
|
||||
|
||||
int get_regionview_count_from_region_list (boost::shared_ptr<ARDOUR::Region> region);
|
||||
|
||||
bool set_selected_control_point_from_click (Selection::Operation op = Selection::Set, bool no_remove=false);
|
||||
void set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false);
|
||||
void set_selected_track_as_side_effect (bool force = 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);
|
||||
bool set_selected_regionview_from_map_event (GdkEventAny*, StreamView*, boost::weak_ptr<ARDOUR::Region>);
|
||||
void collect_new_region_view (RegionView *);
|
||||
void collect_and_select_new_region_view (RegionView *);
|
||||
|
@ -932,81 +939,6 @@ class Editor : public PublicEditor
|
|||
|
||||
void end_location_changed (ARDOUR::Location*);
|
||||
|
||||
struct RegionListDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
|
||||
RegionListDisplayModelColumns() {
|
||||
add (name);
|
||||
add (region);
|
||||
add (color_);
|
||||
add (start);
|
||||
add (end);
|
||||
add (length);
|
||||
add (sync);
|
||||
add (fadein);
|
||||
add (fadeout);
|
||||
add (locked);
|
||||
add (glued);
|
||||
add (muted);
|
||||
add (opaque);
|
||||
add (used);
|
||||
add (path);
|
||||
}
|
||||
Gtk::TreeModelColumn<Glib::ustring> name;
|
||||
Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Region> > region;
|
||||
Gtk::TreeModelColumn<Gdk::Color> color_;
|
||||
Gtk::TreeModelColumn<Glib::ustring> start;
|
||||
Gtk::TreeModelColumn<Glib::ustring> end;
|
||||
Gtk::TreeModelColumn<Glib::ustring> length;
|
||||
Gtk::TreeModelColumn<Glib::ustring> sync;
|
||||
Gtk::TreeModelColumn<Glib::ustring> fadein;
|
||||
Gtk::TreeModelColumn<Glib::ustring> fadeout;
|
||||
Gtk::TreeModelColumn<bool> locked;
|
||||
Gtk::TreeModelColumn<bool> glued;
|
||||
Gtk::TreeModelColumn<bool> muted;
|
||||
Gtk::TreeModelColumn<bool> opaque;
|
||||
Gtk::TreeModelColumn<Glib::ustring> used;
|
||||
Gtk::TreeModelColumn<Glib::ustring> path;
|
||||
};
|
||||
|
||||
RegionListDisplayModelColumns region_list_columns;
|
||||
Gtkmm2ext::DnDTreeView<boost::shared_ptr<ARDOUR::Region> > region_list_display;
|
||||
|
||||
Glib::RefPtr<Gtk::TreeStore> region_list_model;
|
||||
Glib::RefPtr<Gtk::ToggleAction> toggle_full_region_list_action;
|
||||
Glib::RefPtr<Gtk::ToggleAction> toggle_show_auto_regions_action;
|
||||
|
||||
void region_list_region_changed (ARDOUR::Change, boost::weak_ptr<ARDOUR::Region>);
|
||||
void region_list_selection_changed ();
|
||||
sigc::connection region_list_change_connection;
|
||||
void set_selected_in_region_list(RegionSelection&);
|
||||
bool set_selected_in_region_list_subrow(boost::shared_ptr<ARDOUR::Region>, Gtk::TreeModel::Row const &, int);
|
||||
bool region_list_selection_filter (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool yn);
|
||||
void region_name_edit (const Glib::ustring&, const Glib::ustring&);
|
||||
void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions);
|
||||
|
||||
Gtk::Menu *region_list_menu;
|
||||
Gtk::ScrolledWindow region_list_scroller;
|
||||
Gtk::Frame region_list_frame;
|
||||
|
||||
bool region_list_display_key_press (GdkEventKey *);
|
||||
bool region_list_display_key_release (GdkEventKey *);
|
||||
bool region_list_display_button_press (GdkEventButton *);
|
||||
bool region_list_display_button_release (GdkEventButton *);
|
||||
void region_list_clear ();
|
||||
void region_list_selection_mapover (sigc::slot<void,boost::shared_ptr<ARDOUR::Region> >);
|
||||
void build_region_list_menu ();
|
||||
void show_region_list_display_context_menu (int button, int time);
|
||||
|
||||
bool show_automatic_regions_in_region_list;
|
||||
Editing::RegionListSortType region_list_sort_type;
|
||||
|
||||
void reset_region_list_sort_direction (bool);
|
||||
void reset_region_list_sort_type (Editing::RegionListSortType);
|
||||
|
||||
void toggle_full_region_list ();
|
||||
void toggle_show_auto_regions ();
|
||||
|
||||
int region_list_sorter (Gtk::TreeModel::iterator, Gtk::TreeModel::iterator);
|
||||
|
||||
/* snapshots */
|
||||
|
||||
Gtk::ScrolledWindow snapshot_display_scroller;
|
||||
|
@ -1109,23 +1041,6 @@ class Editor : public PublicEditor
|
|||
|
||||
int ensure_cursor (nframes64_t* pos);
|
||||
|
||||
void handle_new_region (boost::weak_ptr<ARDOUR::Region>);
|
||||
void handle_new_regions (std::vector<boost::weak_ptr<ARDOUR::Region> >& );
|
||||
void handle_region_removed (boost::weak_ptr<ARDOUR::Region>);
|
||||
void add_region_to_region_display (boost::shared_ptr<ARDOUR::Region>);
|
||||
void add_regions_to_region_display (std::vector<boost::weak_ptr<ARDOUR::Region> > & );
|
||||
void region_hidden (boost::shared_ptr<ARDOUR::Region>);
|
||||
void redisplay_regions ();
|
||||
void populate_row (boost::shared_ptr<ARDOUR::Region>, Gtk::TreeModel::Row const &);
|
||||
void update_region_row (boost::shared_ptr<ARDOUR::Region>);
|
||||
bool update_region_subrows (boost::shared_ptr<ARDOUR::Region>, Gtk::TreeModel::Row const &, int);
|
||||
void update_all_region_rows ();
|
||||
void update_all_region_subrows (Gtk::TreeModel::Row const &, int);
|
||||
bool no_region_list_redisplay;
|
||||
void insert_into_tmp_regionlist(boost::shared_ptr<ARDOUR::Region>);
|
||||
|
||||
std::list<boost::shared_ptr<ARDOUR::Region> > tmp_region_list;
|
||||
|
||||
void cut_copy (Editing::CutCopyOp);
|
||||
bool can_cut_copy () const;
|
||||
void cut_copy_points (Editing::CutCopyOp);
|
||||
|
@ -1192,7 +1107,6 @@ class Editor : public PublicEditor
|
|||
|
||||
void audition_region_from_region_list ();
|
||||
void hide_region_from_region_list ();
|
||||
void remove_region_from_region_list ();
|
||||
|
||||
void align (ARDOUR::RegionPoint);
|
||||
void align_relative (ARDOUR::RegionPoint);
|
||||
|
@ -1256,9 +1170,6 @@ class Editor : public PublicEditor
|
|||
bool idle_drop_paths (std::vector<Glib::ustring> paths, nframes64_t frame, double ypos);
|
||||
void drop_paths_part_two (const std::vector<Glib::ustring>& paths, nframes64_t frame, double ypos);
|
||||
|
||||
void do_import (std::vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t&);
|
||||
void do_embed (std::vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
|
||||
|
||||
int import_sndfiles (std::vector<Glib::ustring> paths, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t& pos,
|
||||
int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>, bool, uint32_t total);
|
||||
int embed_sndfiles (std::vector<Glib::ustring> paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
|
||||
|
@ -1768,6 +1679,7 @@ public:
|
|||
|
||||
EditorRouteGroups* _route_groups;
|
||||
EditorRoutes* _routes;
|
||||
EditorRegions* _regions;
|
||||
|
||||
/* diskstream/route display management */
|
||||
Glib::RefPtr<Gdk::Pixbuf> rec_enabled_icon;
|
||||
|
@ -1840,14 +1752,6 @@ public:
|
|||
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,
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "audio_time_axis.h"
|
||||
#include "editor_group_tabs.h"
|
||||
#include "editor_routes.h"
|
||||
#include "editor_regions.h"
|
||||
|
||||
using namespace Gtk;
|
||||
using namespace Glib;
|
||||
|
@ -766,37 +767,37 @@ Editor::register_actions ()
|
|||
ActionManager::region_list_selection_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (rl_actions, X_("rlHide"), _("Hide"), mem_fun(*this, &Editor::hide_region_from_region_list));
|
||||
ActionManager::region_list_selection_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (rl_actions, X_("rlRemove"), _("Remove"), mem_fun (*this, &Editor::remove_region_from_region_list));
|
||||
act = ActionManager::register_action (rl_actions, X_("rlRemove"), _("Remove"), mem_fun (*_regions, &EditorRegions::remove_region));
|
||||
ActionManager::region_list_selection_sensitive_actions.push_back (act);
|
||||
ActionManager::register_toggle_action (rl_actions, X_("rlShowAll"), _("Show All"), mem_fun(*this, &Editor::toggle_full_region_list));
|
||||
ActionManager::register_toggle_action (rl_actions, X_("rlShowAuto"), _("Show Automatic Regions"), mem_fun(*this, &Editor::toggle_show_auto_regions));
|
||||
ActionManager::register_toggle_action (rl_actions, X_("rlShowAll"), _("Show All"), mem_fun(*_regions, &EditorRegions::toggle_full));
|
||||
ActionManager::register_toggle_action (rl_actions, X_("rlShowAuto"), _("Show Automatic Regions"), mem_fun (*_regions, &EditorRegions::toggle_show_auto_regions));
|
||||
|
||||
ActionManager::register_radio_action (rl_actions, sort_order_group, X_("SortAscending"), _("Ascending"),
|
||||
bind (mem_fun(*this, &Editor::reset_region_list_sort_direction), true));
|
||||
bind (mem_fun (*_regions, &EditorRegions::reset_sort_direction), true));
|
||||
ActionManager::register_radio_action (rl_actions, sort_order_group, X_("SortDescending"), _("Descending"),
|
||||
bind (mem_fun(*this, &Editor::reset_region_list_sort_direction), false));
|
||||
bind (mem_fun (*_regions, &EditorRegions::reset_sort_direction), false));
|
||||
|
||||
ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionName"), _("By Region Name"),
|
||||
bind (mem_fun(*this, &Editor::reset_region_list_sort_type), ByName));
|
||||
bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByName, false));
|
||||
ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionLength"), _("By Region Length"),
|
||||
bind (mem_fun(*this, &Editor::reset_region_list_sort_type), ByLength));
|
||||
bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByLength, false));
|
||||
ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionPosition"), _("By Region Position"),
|
||||
bind (mem_fun(*this, &Editor::reset_region_list_sort_type), ByPosition));
|
||||
bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByPosition, false));
|
||||
ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionTimestamp"), _("By Region Timestamp"),
|
||||
bind (mem_fun(*this, &Editor::reset_region_list_sort_type), ByTimestamp));
|
||||
bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByTimestamp, false));
|
||||
ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionStartinFile"), _("By Region Start in File"),
|
||||
bind (mem_fun(*this, &Editor::reset_region_list_sort_type), ByStartInFile));
|
||||
bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByStartInFile, false));
|
||||
ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionEndinFile"), _("By Region End in File"),
|
||||
bind (mem_fun(*this, &Editor::reset_region_list_sort_type), ByEndInFile));
|
||||
bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByEndInFile, false));
|
||||
ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFileName"), _("By Source File Name"),
|
||||
bind (mem_fun(*this, &Editor::reset_region_list_sort_type), BySourceFileName));
|
||||
bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileName, false));
|
||||
ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFileLength"), _("By Source File Length"),
|
||||
bind (mem_fun(*this, &Editor::reset_region_list_sort_type), BySourceFileLength));
|
||||
bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileLength, false));
|
||||
ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFileCreationDate"), _("By Source File Creation Date"),
|
||||
bind (mem_fun(*this, &Editor::reset_region_list_sort_type), BySourceFileCreationDate));
|
||||
bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileCreationDate, false));
|
||||
ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFilesystem"), _("By Source Filesystem"),
|
||||
bind (mem_fun(*this, &Editor::reset_region_list_sort_type), BySourceFileFS));
|
||||
|
||||
bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileFS, false));
|
||||
|
||||
|
||||
/* the next two are duplicate items with different names for use in two different contexts */
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include "interactive-item.h"
|
||||
#include "editor_drag.h"
|
||||
#include "midi_time_axis.h"
|
||||
#include "editor_regions.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
|
@ -929,11 +930,7 @@ Editor::track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const & c, int
|
|||
return true;
|
||||
}
|
||||
|
||||
list<boost::shared_ptr<Region> > regions;
|
||||
TreeView* source;
|
||||
region_list_display.get_object_drag_data (regions, &source);
|
||||
assert (regions.size() == 1);
|
||||
boost::shared_ptr<Region> region = regions.front ();
|
||||
boost::shared_ptr<Region> region = _regions->get_dragged_region ();
|
||||
|
||||
boost::shared_ptr<Region> region_copy = RegionFactory::create (region);
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "actions.h"
|
||||
#include "editor_routes.h"
|
||||
#include "editor_route_groups.h"
|
||||
#include "editor_regions.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
|
@ -369,15 +370,12 @@ Editor::session_going_away ()
|
|||
|
||||
/* rip everything out of the list displays */
|
||||
|
||||
region_list_display.set_model (Glib::RefPtr<Gtk::TreeStore>(0));
|
||||
_regions->clear ();
|
||||
_routes->clear ();
|
||||
_route_groups->clear ();
|
||||
|
||||
named_selection_display.set_model (Glib::RefPtr<Gtk::TreeStore>(0));
|
||||
|
||||
region_list_model->clear ();
|
||||
named_selection_model->clear ();
|
||||
|
||||
region_list_display.set_model (region_list_model);
|
||||
named_selection_display.set_model (named_selection_model);
|
||||
|
||||
edit_point_clock_connection_a.disconnect();
|
||||
|
|
|
@ -78,6 +78,7 @@
|
|||
#include "editor_drag.h"
|
||||
#include "strip_silence_dialog.h"
|
||||
#include "editor_routes.h"
|
||||
#include "editor_regions.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
|
@ -2314,29 +2315,17 @@ Editor::insert_region_list_selection (float times)
|
|||
if ((playlist = tv->playlist()) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Glib::RefPtr<TreeSelection> selected = region_list_display.get_selection();
|
||||
|
||||
if (selected->count_selected_rows() != 1) {
|
||||
|
||||
boost::shared_ptr<Region> region = _regions->get_single_selection ();
|
||||
if (region == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
TreeView::Selection::ListHandle_Path rows = selected->get_selected_rows ();
|
||||
|
||||
/* only one row selected, so rows.begin() is it */
|
||||
|
||||
TreeIter iter;
|
||||
|
||||
if ((iter = region_list_model->get_iter (*rows.begin()))) {
|
||||
|
||||
boost::shared_ptr<Region> region = (*iter)[region_list_columns.region];
|
||||
|
||||
begin_reversible_command (_("insert region"));
|
||||
XMLNode &before = playlist->get_state();
|
||||
playlist->add_region ((RegionFactory::create (region)), get_preferred_edit_position(), times);
|
||||
session->add_command(new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
|
||||
commit_reversible_command ();
|
||||
}
|
||||
begin_reversible_command (_("insert region"));
|
||||
XMLNode &before = playlist->get_state();
|
||||
playlist->add_region ((RegionFactory::create (region)), get_preferred_edit_position(), times);
|
||||
session->add_command(new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
|
||||
commit_reversible_command ();
|
||||
}
|
||||
|
||||
/* BUILT-IN EFFECTS */
|
||||
|
@ -2590,7 +2579,7 @@ Editor::rename_region()
|
|||
strip_whitespace_edges (str);
|
||||
if (!str.empty()) {
|
||||
rs.front()->region()->set_name (str);
|
||||
redisplay_regions ();
|
||||
_regions->redisplay ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3114,16 +3103,11 @@ Editor::region_fill_selection ()
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
Glib::RefPtr<TreeSelection> selected = region_list_display.get_selection();
|
||||
|
||||
if (selected->count_selected_rows() != 1) {
|
||||
boost::shared_ptr<Region> region = _regions->get_single_selection ();
|
||||
if (region == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
TreeModel::iterator i = region_list_display.get_selection()->get_selected();
|
||||
boost::shared_ptr<Region> region = (*i)[region_list_columns.region];
|
||||
|
||||
nframes64_t start = selection->time[clicked_selection].start;
|
||||
nframes64_t end = selection->time[clicked_selection].end;
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,151 @@
|
|||
/*
|
||||
Copyright (C) 2000-2009 Paul Davis
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
#include "editor_component.h"
|
||||
|
||||
class EditorRegions : public EditorComponent
|
||||
{
|
||||
public:
|
||||
EditorRegions (Editor *);
|
||||
|
||||
void connect_to_session (ARDOUR::Session *);
|
||||
|
||||
Gtk::Widget& widget () {
|
||||
return _scroller;
|
||||
}
|
||||
|
||||
void clear ();
|
||||
|
||||
void toggle_full ();
|
||||
void toggle_show_auto_regions ();
|
||||
void reset_sort_direction (bool);
|
||||
void reset_sort_type (Editing::RegionListSortType, bool);
|
||||
void set_selected (RegionSelection &);
|
||||
void remove_region ();
|
||||
void selection_mapover (sigc::slot<void,boost::shared_ptr<ARDOUR::Region> >);
|
||||
boost::shared_ptr<ARDOUR::Region> get_dragged_region ();
|
||||
boost::shared_ptr<ARDOUR::Region> get_single_selection ();
|
||||
Editing::RegionListSortType sort_type () const {
|
||||
return _sort_type;
|
||||
}
|
||||
void redisplay ();
|
||||
|
||||
void suspend_redisplay () {
|
||||
_no_redisplay = true;
|
||||
}
|
||||
void resume_redisplay () {
|
||||
_no_redisplay = false;
|
||||
redisplay ();
|
||||
}
|
||||
|
||||
void block_change_connection (bool b) {
|
||||
_change_connection.block (b);
|
||||
}
|
||||
|
||||
void unselect_all () {
|
||||
_display.get_selection()->unselect_all ();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
struct Columns : public Gtk::TreeModel::ColumnRecord {
|
||||
Columns () {
|
||||
add (name);
|
||||
add (region);
|
||||
add (color_);
|
||||
add (start);
|
||||
add (end);
|
||||
add (length);
|
||||
add (sync);
|
||||
add (fadein);
|
||||
add (fadeout);
|
||||
add (locked);
|
||||
add (glued);
|
||||
add (muted);
|
||||
add (opaque);
|
||||
add (used);
|
||||
add (path);
|
||||
}
|
||||
|
||||
Gtk::TreeModelColumn<Glib::ustring> name;
|
||||
Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Region> > region;
|
||||
Gtk::TreeModelColumn<Gdk::Color> color_;
|
||||
Gtk::TreeModelColumn<Glib::ustring> start;
|
||||
Gtk::TreeModelColumn<Glib::ustring> end;
|
||||
Gtk::TreeModelColumn<Glib::ustring> length;
|
||||
Gtk::TreeModelColumn<Glib::ustring> sync;
|
||||
Gtk::TreeModelColumn<Glib::ustring> fadein;
|
||||
Gtk::TreeModelColumn<Glib::ustring> fadeout;
|
||||
Gtk::TreeModelColumn<bool> locked;
|
||||
Gtk::TreeModelColumn<bool> glued;
|
||||
Gtk::TreeModelColumn<bool> muted;
|
||||
Gtk::TreeModelColumn<bool> opaque;
|
||||
Gtk::TreeModelColumn<Glib::ustring> used;
|
||||
Gtk::TreeModelColumn<Glib::ustring> path;
|
||||
};
|
||||
|
||||
Columns _columns;
|
||||
|
||||
void region_changed (ARDOUR::Change, boost::weak_ptr<ARDOUR::Region>);
|
||||
void selection_changed ();
|
||||
sigc::connection _change_connection;
|
||||
bool set_selected_in_subrow (boost::shared_ptr<ARDOUR::Region>, Gtk::TreeModel::Row const &, int);
|
||||
bool selection_filter (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool yn);
|
||||
void name_edit (const Glib::ustring&, const Glib::ustring&);
|
||||
|
||||
bool key_press (GdkEventKey *);
|
||||
bool key_release (GdkEventKey *);
|
||||
bool button_press (GdkEventButton *);
|
||||
bool button_release (GdkEventButton *);
|
||||
void build_menu ();
|
||||
void show_context_menu (int button, int time);
|
||||
|
||||
int sorter (Gtk::TreeModel::iterator, Gtk::TreeModel::iterator);
|
||||
|
||||
void handle_new_region (boost::weak_ptr<ARDOUR::Region>);
|
||||
void handle_new_regions (std::vector<boost::weak_ptr<ARDOUR::Region> >& );
|
||||
void handle_region_removed (boost::weak_ptr<ARDOUR::Region>);
|
||||
void add_region (boost::shared_ptr<ARDOUR::Region>);
|
||||
void add_regions (std::vector<boost::weak_ptr<ARDOUR::Region> > & );
|
||||
void region_hidden (boost::shared_ptr<ARDOUR::Region>);
|
||||
void populate_row (boost::shared_ptr<ARDOUR::Region>, Gtk::TreeModel::Row const &);
|
||||
void update_row (boost::shared_ptr<ARDOUR::Region>);
|
||||
bool update_subrows (boost::shared_ptr<ARDOUR::Region>, Gtk::TreeModel::Row const &, int);
|
||||
void update_all_rows ();
|
||||
void update_all_subrows (Gtk::TreeModel::Row const &, int);
|
||||
void insert_into_tmp_regionlist (boost::shared_ptr<ARDOUR::Region>);
|
||||
|
||||
void drag_data_received (
|
||||
Glib::RefPtr<Gdk::DragContext> const &, gint, gint, Gtk::SelectionData const &, guint, guint
|
||||
);
|
||||
|
||||
Gtk::Menu* _menu;
|
||||
Gtk::ScrolledWindow _scroller;
|
||||
Gtk::Frame _frame;
|
||||
Gtkmm2ext::DnDTreeView<boost::shared_ptr<ARDOUR::Region> > _display;
|
||||
Glib::RefPtr<Gtk::TreeStore> _model;
|
||||
Glib::RefPtr<Gtk::ToggleAction> _toggle_full_action;
|
||||
Glib::RefPtr<Gtk::ToggleAction> _toggle_show_auto_regions_action;
|
||||
bool _show_automatic_regions;
|
||||
Editing::RegionListSortType _sort_type;
|
||||
bool _no_redisplay;
|
||||
std::list<boost::shared_ptr<ARDOUR::Region> > tmp_region_list;
|
||||
};
|
||||
|
||||
|
|
@ -34,6 +34,7 @@
|
|||
#include "audio_streamview.h"
|
||||
#include "automation_line.h"
|
||||
#include "control_point.h"
|
||||
#include "editor_regions.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
|
@ -878,15 +879,15 @@ Editor::sensitize_the_right_region_actions (bool have_selected_regions)
|
|||
void
|
||||
Editor::region_selection_changed ()
|
||||
{
|
||||
region_list_change_connection.block(true);
|
||||
_regions->block_change_connection (true);
|
||||
editor_regions_selection_changed_connection.block(true);
|
||||
|
||||
region_list_display.get_selection()->unselect_all();
|
||||
|
||||
_regions->unselect_all ();
|
||||
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
|
||||
(*i)->set_selected_regionviews (selection->regions);
|
||||
set_selected_in_region_list(selection->regions);
|
||||
_regions->set_selected (selection->regions);
|
||||
|
||||
}
|
||||
|
||||
|
@ -894,7 +895,7 @@ Editor::region_selection_changed ()
|
|||
|
||||
zoomed_to_region = false;
|
||||
|
||||
region_list_change_connection.block(false);
|
||||
_regions->block_change_connection (false);
|
||||
editor_regions_selection_changed_connection.block(false);
|
||||
}
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ def build(bld):
|
|||
editor_mouse.cc
|
||||
editor_nudge.cc
|
||||
editor_ops.cc
|
||||
editor_region_list.cc
|
||||
editor_regions.cc
|
||||
editor_routes.cc
|
||||
editor_rulers.cc
|
||||
editor_scrub.cc
|
||||
|
|
Loading…
Reference in New Issue