mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
Split route group list out of Editor.
git-svn-id: svn://localhost/ardour2/branches/3.0@5308 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
6e614ae3bf
commit
b233455b3f
22 changed files with 980 additions and 885 deletions
|
|
@ -98,9 +98,10 @@
|
||||||
#include "editor_drag.h"
|
#include "editor_drag.h"
|
||||||
#include "editor_group_tabs.h"
|
#include "editor_group_tabs.h"
|
||||||
#include "automation_time_axis.h"
|
#include "automation_time_axis.h"
|
||||||
#include "editor_route_list.h"
|
#include "editor_routes.h"
|
||||||
#include "midi_time_axis.h"
|
#include "midi_time_axis.h"
|
||||||
#include "mixer_strip.h"
|
#include "mixer_strip.h"
|
||||||
|
#include "editor_route_groups.h"
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
|
|
@ -314,7 +315,6 @@ Editor::Editor ()
|
||||||
_xfade_visibility = true;
|
_xfade_visibility = true;
|
||||||
editor_ruler_menu = 0;
|
editor_ruler_menu = 0;
|
||||||
no_ruler_shown_update = false;
|
no_ruler_shown_update = false;
|
||||||
route_group_menu = 0;
|
|
||||||
region_list_menu = 0;
|
region_list_menu = 0;
|
||||||
marker_menu = 0;
|
marker_menu = 0;
|
||||||
start_end_marker_menu = 0;
|
start_end_marker_menu = 0;
|
||||||
|
|
@ -338,7 +338,6 @@ Editor::Editor ()
|
||||||
clear_entered_track = false;
|
clear_entered_track = false;
|
||||||
_new_regionviews_show_envelope = false;
|
_new_regionviews_show_envelope = false;
|
||||||
current_timefx = 0;
|
current_timefx = 0;
|
||||||
in_route_group_row_change = false;
|
|
||||||
playhead_cursor = 0;
|
playhead_cursor = 0;
|
||||||
button_release_can_deselect = true;
|
button_release_can_deselect = true;
|
||||||
_dragging_playhead = false;
|
_dragging_playhead = false;
|
||||||
|
|
@ -531,117 +530,8 @@ Editor::Editor ()
|
||||||
bottom_hbox.set_border_width (2);
|
bottom_hbox.set_border_width (2);
|
||||||
bottom_hbox.set_spacing (3);
|
bottom_hbox.set_spacing (3);
|
||||||
|
|
||||||
group_model = ListStore::create(group_columns);
|
_route_groups = new EditorRouteGroups (this);
|
||||||
route_group_display.set_model (group_model);
|
_routes = new EditorRoutes (this);
|
||||||
|
|
||||||
route_group_display.append_column (_("Name"), group_columns.text);
|
|
||||||
|
|
||||||
route_group_display.append_column (_("G"), group_columns.gain);
|
|
||||||
route_group_display.append_column (_("R"), group_columns.record);
|
|
||||||
route_group_display.append_column (_("M"), group_columns.mute);
|
|
||||||
route_group_display.append_column (_("S"), group_columns.solo);
|
|
||||||
route_group_display.append_column (_("Sel"), group_columns.select);
|
|
||||||
route_group_display.append_column (_("E"), group_columns.edits);
|
|
||||||
|
|
||||||
route_group_display.append_column (_("Show"), group_columns.is_visible);
|
|
||||||
|
|
||||||
route_group_display.get_column (0)->set_data (X_("colnum"), GUINT_TO_POINTER(0));
|
|
||||||
route_group_display.get_column (1)->set_data (X_("colnum"), GUINT_TO_POINTER(1));
|
|
||||||
route_group_display.get_column (2)->set_data (X_("colnum"), GUINT_TO_POINTER(2));
|
|
||||||
route_group_display.get_column (3)->set_data (X_("colnum"), GUINT_TO_POINTER(3));
|
|
||||||
route_group_display.get_column (4)->set_data (X_("colnum"), GUINT_TO_POINTER(4));
|
|
||||||
route_group_display.get_column (5)->set_data (X_("colnum"), GUINT_TO_POINTER(5));
|
|
||||||
route_group_display.get_column (6)->set_data (X_("colnum"), GUINT_TO_POINTER(6));
|
|
||||||
route_group_display.get_column (7)->set_data (X_("colnum"), GUINT_TO_POINTER(7));
|
|
||||||
|
|
||||||
route_group_display.get_column (0)->set_expand (true);
|
|
||||||
route_group_display.get_column (1)->set_expand (false);
|
|
||||||
route_group_display.get_column (2)->set_expand (false);
|
|
||||||
route_group_display.get_column (3)->set_expand (false);
|
|
||||||
route_group_display.get_column (4)->set_expand (false);
|
|
||||||
route_group_display.get_column (5)->set_expand (false);
|
|
||||||
route_group_display.get_column (6)->set_expand (false);
|
|
||||||
route_group_display.get_column (7)->set_expand (false);
|
|
||||||
|
|
||||||
route_group_display.set_headers_visible (true);
|
|
||||||
|
|
||||||
/* name is directly editable */
|
|
||||||
|
|
||||||
CellRendererText* name_cell = dynamic_cast<CellRendererText*>(route_group_display.get_column_cell_renderer (0));
|
|
||||||
name_cell->property_editable() = true;
|
|
||||||
name_cell->signal_edited().connect (mem_fun (*this, &Editor::route_group_name_edit));
|
|
||||||
|
|
||||||
/* use checkbox for the active + visible columns */
|
|
||||||
|
|
||||||
CellRendererToggle* active_cell = dynamic_cast<CellRendererToggle*>(route_group_display.get_column_cell_renderer (1));
|
|
||||||
active_cell->property_activatable() = true;
|
|
||||||
active_cell->property_radio() = false;
|
|
||||||
|
|
||||||
active_cell = dynamic_cast<CellRendererToggle*>(route_group_display.get_column_cell_renderer (2));
|
|
||||||
active_cell->property_activatable() = true;
|
|
||||||
active_cell->property_radio() = false;
|
|
||||||
|
|
||||||
active_cell = dynamic_cast<CellRendererToggle*>(route_group_display.get_column_cell_renderer (3));
|
|
||||||
active_cell->property_activatable() = true;
|
|
||||||
active_cell->property_radio() = false;
|
|
||||||
|
|
||||||
active_cell = dynamic_cast<CellRendererToggle*>(route_group_display.get_column_cell_renderer (4));
|
|
||||||
active_cell->property_activatable() = true;
|
|
||||||
active_cell->property_radio() = false;
|
|
||||||
|
|
||||||
active_cell = dynamic_cast<CellRendererToggle*>(route_group_display.get_column_cell_renderer (5));
|
|
||||||
active_cell->property_activatable() = true;
|
|
||||||
active_cell->property_radio() = false;
|
|
||||||
|
|
||||||
active_cell = dynamic_cast<CellRendererToggle*>(route_group_display.get_column_cell_renderer (6));
|
|
||||||
active_cell->property_activatable() = true;
|
|
||||||
active_cell->property_radio() = false;
|
|
||||||
|
|
||||||
active_cell = dynamic_cast<CellRendererToggle*>(route_group_display.get_column_cell_renderer (7));
|
|
||||||
active_cell->property_activatable() = true;
|
|
||||||
active_cell->property_radio() = false;
|
|
||||||
|
|
||||||
group_model->signal_row_changed().connect (mem_fun (*this, &Editor::route_group_row_change));
|
|
||||||
|
|
||||||
_route_list = new EditorRouteList (this);
|
|
||||||
|
|
||||||
route_group_display.set_name ("EditGroupList");
|
|
||||||
route_group_display.get_selection()->set_mode (SELECTION_SINGLE);
|
|
||||||
route_group_display.set_headers_visible (true);
|
|
||||||
route_group_display.set_reorderable (false);
|
|
||||||
route_group_display.set_rules_hint (true);
|
|
||||||
route_group_display.set_size_request (75, -1);
|
|
||||||
|
|
||||||
route_group_display_scroller.add (route_group_display);
|
|
||||||
route_group_display_scroller.set_policy (POLICY_AUTOMATIC, POLICY_AUTOMATIC);
|
|
||||||
|
|
||||||
route_group_display.signal_button_press_event().connect (mem_fun(*this, &Editor::route_group_list_button_press_event), false);
|
|
||||||
|
|
||||||
VBox* route_group_display_packer = manage (new VBox());
|
|
||||||
HBox* route_group_display_button_box = manage (new HBox());
|
|
||||||
route_group_display_button_box->set_homogeneous (true);
|
|
||||||
|
|
||||||
Button* route_group_add_button = manage (new Button ());
|
|
||||||
Button* route_group_remove_button = manage (new Button ());
|
|
||||||
|
|
||||||
Widget* w;
|
|
||||||
|
|
||||||
w = manage (new Image (Stock::ADD, ICON_SIZE_BUTTON));
|
|
||||||
w->show();
|
|
||||||
route_group_add_button->add (*w);
|
|
||||||
|
|
||||||
w = manage (new Image (Stock::REMOVE, ICON_SIZE_BUTTON));
|
|
||||||
w->show();
|
|
||||||
route_group_remove_button->add (*w);
|
|
||||||
|
|
||||||
route_group_add_button->signal_clicked().connect (mem_fun (*this, &Editor::new_route_group));
|
|
||||||
route_group_remove_button->signal_clicked().connect (mem_fun (*this, &Editor::remove_selected_route_group));
|
|
||||||
|
|
||||||
route_group_display_button_box->pack_start (*route_group_add_button);
|
|
||||||
route_group_display_button_box->pack_start (*route_group_remove_button);
|
|
||||||
|
|
||||||
route_group_display_packer->pack_start (route_group_display_scroller, true, true);
|
|
||||||
route_group_display_packer->pack_start (*route_group_display_button_box, false, false);
|
|
||||||
|
|
||||||
region_list_display.set_size_request (100, -1);
|
region_list_display.set_size_request (100, -1);
|
||||||
region_list_display.set_name ("RegionListDisplay");
|
region_list_display.set_name ("RegionListDisplay");
|
||||||
|
|
@ -748,13 +638,13 @@ Editor::Editor ()
|
||||||
the_notebook.append_page (region_list_scroller, *nlabel);
|
the_notebook.append_page (region_list_scroller, *nlabel);
|
||||||
nlabel = manage (new Label (_("Tracks/Busses")));
|
nlabel = manage (new Label (_("Tracks/Busses")));
|
||||||
nlabel->set_angle (-90);
|
nlabel->set_angle (-90);
|
||||||
the_notebook.append_page (_route_list->widget (), *nlabel);
|
the_notebook.append_page (_routes->widget (), *nlabel);
|
||||||
nlabel = manage (new Label (_("Snapshots")));
|
nlabel = manage (new Label (_("Snapshots")));
|
||||||
nlabel->set_angle (-90);
|
nlabel->set_angle (-90);
|
||||||
the_notebook.append_page (snapshot_display_scroller, *nlabel);
|
the_notebook.append_page (snapshot_display_scroller, *nlabel);
|
||||||
nlabel = manage (new Label (_("Route Groups")));
|
nlabel = manage (new Label (_("Route Groups")));
|
||||||
nlabel->set_angle (-90);
|
nlabel->set_angle (-90);
|
||||||
the_notebook.append_page (*route_group_display_packer, *nlabel);
|
the_notebook.append_page (_route_groups->widget (), *nlabel);
|
||||||
|
|
||||||
if (!Profile->get_sae()) {
|
if (!Profile->get_sae()) {
|
||||||
nlabel = manage (new Label (_("Chunks")));
|
nlabel = manage (new Label (_("Chunks")));
|
||||||
|
|
@ -893,7 +783,8 @@ Editor::~Editor()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
delete _route_list;
|
delete _routes;
|
||||||
|
delete _route_groups;
|
||||||
delete track_canvas;
|
delete track_canvas;
|
||||||
delete _drag;
|
delete _drag;
|
||||||
}
|
}
|
||||||
|
|
@ -1278,8 +1169,6 @@ Editor::connect_to_session (Session *t)
|
||||||
session_connections.push_back (session->RegionsAdded.connect (mem_fun(*this, &Editor::handle_new_regions)));
|
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->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->DurationChanged.connect (mem_fun(*this, &Editor::handle_new_duration)));
|
||||||
session_connections.push_back (session->route_group_added.connect (mem_fun(*this, &Editor::add_route_group)));
|
|
||||||
session_connections.push_back (session->route_group_removed.connect (mem_fun(*this, &Editor::route_groups_changed)));
|
|
||||||
session_connections.push_back (session->NamedSelectionAdded.connect (mem_fun(*this, &Editor::handle_new_named_selection)));
|
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->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->DirtyChanged.connect (mem_fun(*this, &Editor::update_title)));
|
||||||
|
|
@ -1294,7 +1183,7 @@ Editor::connect_to_session (Session *t)
|
||||||
session_connections.push_back (session->Located.connect (mem_fun (*this, &Editor::located)));
|
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)));
|
session_connections.push_back (session->config.ParameterChanged.connect (mem_fun (*this, &Editor::parameter_changed)));
|
||||||
|
|
||||||
route_groups_changed ();
|
_route_groups->connect_to_session (session);
|
||||||
|
|
||||||
edit_point_clock.set_mode(AudioClock::BBT);
|
edit_point_clock.set_mode(AudioClock::BBT);
|
||||||
edit_point_clock.set_session (session);
|
edit_point_clock.set_session (session);
|
||||||
|
|
@ -1375,7 +1264,7 @@ Editor::connect_to_session (Session *t)
|
||||||
//tempo_map_changed (Change (0));
|
//tempo_map_changed (Change (0));
|
||||||
session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks);
|
session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks);
|
||||||
|
|
||||||
_route_list->initial_display ();
|
_routes->initial_display ();
|
||||||
|
|
||||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||||
(static_cast<TimeAxisView*>(*i))->set_samples_per_unit (frames_per_unit);
|
(static_cast<TimeAxisView*>(*i))->set_samples_per_unit (frames_per_unit);
|
||||||
|
|
@ -1398,8 +1287,8 @@ Editor::connect_to_session (Session *t)
|
||||||
/* register for undo history */
|
/* register for undo history */
|
||||||
session->register_with_memento_command_factory(_id, this);
|
session->register_with_memento_command_factory(_id, this);
|
||||||
|
|
||||||
_summary->set_session (session);
|
_summary->connect_to_session (session);
|
||||||
_group_tabs->set_session (session);
|
_group_tabs->connect_to_session (session);
|
||||||
|
|
||||||
start_updating ();
|
start_updating ();
|
||||||
}
|
}
|
||||||
|
|
@ -4615,7 +4504,7 @@ Editor::use_visual_state (VisualState& vs)
|
||||||
{
|
{
|
||||||
no_save_visual = true;
|
no_save_visual = true;
|
||||||
|
|
||||||
_route_list->suspend_redisplay ();
|
_routes->suspend_redisplay ();
|
||||||
|
|
||||||
vertical_adjustment.set_value (vs.y_position);
|
vertical_adjustment.set_value (vs.y_position);
|
||||||
|
|
||||||
|
|
@ -4635,10 +4524,10 @@ Editor::use_visual_state (VisualState& vs)
|
||||||
|
|
||||||
|
|
||||||
if (!vs.track_states.empty()) {
|
if (!vs.track_states.empty()) {
|
||||||
_route_list->update_visibility ();
|
_routes->update_visibility ();
|
||||||
}
|
}
|
||||||
|
|
||||||
_route_list->resume_redisplay ();
|
_routes->resume_redisplay ();
|
||||||
|
|
||||||
no_save_visual = false;
|
no_save_visual = false;
|
||||||
}
|
}
|
||||||
|
|
@ -5136,7 +5025,7 @@ Editor::first_idle ()
|
||||||
}
|
}
|
||||||
|
|
||||||
// first idle adds route children (automation tracks), so we need to redisplay here
|
// first idle adds route children (automation tracks), so we need to redisplay here
|
||||||
_route_list->redisplay ();
|
_routes->redisplay ();
|
||||||
|
|
||||||
delete dialog;
|
delete dialog;
|
||||||
|
|
||||||
|
|
@ -5282,7 +5171,7 @@ Editor::handle_new_route (RouteList& routes)
|
||||||
rtv->GoingAway.connect (bind (mem_fun(*this, &Editor::remove_route), rtv));
|
rtv->GoingAway.connect (bind (mem_fun(*this, &Editor::remove_route), rtv));
|
||||||
}
|
}
|
||||||
|
|
||||||
_route_list->routes_added (new_views);
|
_routes->routes_added (new_views);
|
||||||
|
|
||||||
if (show_editor_mixer_when_tracks_arrive) {
|
if (show_editor_mixer_when_tracks_arrive) {
|
||||||
show_editor_mixer (true);
|
show_editor_mixer (true);
|
||||||
|
|
@ -5343,13 +5232,13 @@ Editor::hide_track_in_display (TimeAxisView& tv, bool temponly)
|
||||||
set_selected_mixer_strip (tv);
|
set_selected_mixer_strip (tv);
|
||||||
}
|
}
|
||||||
|
|
||||||
_route_list->hide_track_in_display (tv);
|
_routes->hide_track_in_display (tv);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Editor::sync_track_view_list_and_route_list ()
|
Editor::sync_track_view_list_and_routes ()
|
||||||
{
|
{
|
||||||
track_views = TrackSelection (_route_list->views ());
|
track_views = TrackSelection (_routes->views ());
|
||||||
|
|
||||||
_summary->set_dirty ();
|
_summary->set_dirty ();
|
||||||
_group_tabs->set_dirty ();
|
_group_tabs->set_dirty ();
|
||||||
|
|
@ -5381,3 +5270,9 @@ Editor::get_route_view_by_id (PBD::ID& id)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Editor::fit_route_group (RouteGroup *g)
|
||||||
|
{
|
||||||
|
TrackSelection ts = axis_views_from_routes (g->route_list ());
|
||||||
|
fit_tracks (ts);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,8 @@ class TimeFXDialog;
|
||||||
class TimeSelection;
|
class TimeSelection;
|
||||||
class TrackSelection;
|
class TrackSelection;
|
||||||
class EditorGroupTabs;
|
class EditorGroupTabs;
|
||||||
class EditorRouteList;
|
class EditorRoutes;
|
||||||
|
class EditorRouteGroups;
|
||||||
|
|
||||||
/* <CMT Additions> */
|
/* <CMT Additions> */
|
||||||
class ImageFrameView;
|
class ImageFrameView;
|
||||||
|
|
@ -399,6 +400,10 @@ class Editor : public PublicEditor
|
||||||
void goto_visual_state (uint32_t);
|
void goto_visual_state (uint32_t);
|
||||||
void save_visual_state (uint32_t);
|
void save_visual_state (uint32_t);
|
||||||
|
|
||||||
|
TrackViewList const & get_track_views () {
|
||||||
|
return track_views;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void map_transport_state ();
|
void map_transport_state ();
|
||||||
void map_position_change (nframes64_t);
|
void map_position_change (nframes64_t);
|
||||||
|
|
@ -1761,7 +1766,8 @@ public:
|
||||||
ArdourCanvas::SimpleRect *zoom_rect;
|
ArdourCanvas::SimpleRect *zoom_rect;
|
||||||
void reposition_zoom_rect (nframes64_t start, nframes64_t end);
|
void reposition_zoom_rect (nframes64_t start, nframes64_t end);
|
||||||
|
|
||||||
EditorRouteList* _route_list;
|
EditorRouteGroups* _route_groups;
|
||||||
|
EditorRoutes* _routes;
|
||||||
|
|
||||||
/* diskstream/route display management */
|
/* diskstream/route display management */
|
||||||
Glib::RefPtr<Gdk::Pixbuf> rec_enabled_icon;
|
Glib::RefPtr<Gdk::Pixbuf> rec_enabled_icon;
|
||||||
|
|
@ -1769,65 +1775,7 @@ public:
|
||||||
|
|
||||||
Glib::RefPtr<Gtk::TreeSelection> route_display_selection;
|
Glib::RefPtr<Gtk::TreeSelection> route_display_selection;
|
||||||
|
|
||||||
bool sync_track_view_list_and_route_list ();
|
bool sync_track_view_list_and_routes ();
|
||||||
|
|
||||||
/* edit group management */
|
|
||||||
|
|
||||||
struct GroupListModelColumns : public Gtk::TreeModel::ColumnRecord {
|
|
||||||
|
|
||||||
GroupListModelColumns () {
|
|
||||||
add (is_visible);
|
|
||||||
add (gain);
|
|
||||||
add (record);
|
|
||||||
add (mute);
|
|
||||||
add (solo);
|
|
||||||
add (select);
|
|
||||||
add (edits);
|
|
||||||
add (text);
|
|
||||||
add (routegroup);
|
|
||||||
}
|
|
||||||
|
|
||||||
Gtk::TreeModelColumn<bool> is_visible;
|
|
||||||
Gtk::TreeModelColumn<bool> gain;
|
|
||||||
Gtk::TreeModelColumn<bool> record;
|
|
||||||
Gtk::TreeModelColumn<bool> mute;
|
|
||||||
Gtk::TreeModelColumn<bool> solo;
|
|
||||||
Gtk::TreeModelColumn<bool> select;
|
|
||||||
Gtk::TreeModelColumn<bool> edits;
|
|
||||||
Gtk::TreeModelColumn<std::string> text;
|
|
||||||
Gtk::TreeModelColumn<ARDOUR::RouteGroup*> routegroup;
|
|
||||||
};
|
|
||||||
|
|
||||||
GroupListModelColumns group_columns;
|
|
||||||
|
|
||||||
Glib::RefPtr<Gtk::ListStore> group_model;
|
|
||||||
Glib::RefPtr<Gtk::TreeSelection> group_selection;
|
|
||||||
|
|
||||||
Gtk::TreeView route_group_display;
|
|
||||||
Gtk::ScrolledWindow route_group_display_scroller;
|
|
||||||
Gtk::Menu* route_group_menu;
|
|
||||||
|
|
||||||
void build_route_group_menu (ARDOUR::RouteGroup *);
|
|
||||||
void activate_all_route_groups ();
|
|
||||||
void disable_all_route_groups ();
|
|
||||||
void subgroup_route_group (ARDOUR::RouteGroup*);
|
|
||||||
void unsubgroup_route_group (ARDOUR::RouteGroup*);
|
|
||||||
|
|
||||||
bool in_route_group_row_change;
|
|
||||||
void route_group_row_change (const Gtk::TreeModel::Path&,const Gtk::TreeModel::iterator&);
|
|
||||||
void route_group_name_edit (const Glib::ustring&, const Glib::ustring&);
|
|
||||||
void new_route_group ();
|
|
||||||
void new_route_group_from_selection ();
|
|
||||||
void new_route_group_from_rec_enabled ();
|
|
||||||
void new_route_group_from_soloed ();
|
|
||||||
void edit_route_group (ARDOUR::RouteGroup *);
|
|
||||||
void fit_route_group (ARDOUR::RouteGroup *);
|
|
||||||
void route_group_list_button_clicked ();
|
|
||||||
gint route_group_list_button_press_event (GdkEventButton* ev);
|
|
||||||
void add_route_group (ARDOUR::RouteGroup* group);
|
|
||||||
void remove_selected_route_group ();
|
|
||||||
void route_groups_changed ();
|
|
||||||
void group_flags_changed (void*, ARDOUR::RouteGroup*);
|
|
||||||
|
|
||||||
Gtk::VBox list_vpacker;
|
Gtk::VBox list_vpacker;
|
||||||
|
|
||||||
|
|
@ -2197,8 +2145,7 @@ public:
|
||||||
void streamview_height_changed ();
|
void streamview_height_changed ();
|
||||||
|
|
||||||
EditorGroupTabs* _group_tabs;
|
EditorGroupTabs* _group_tabs;
|
||||||
|
void fit_route_group (ARDOUR::RouteGroup *);
|
||||||
void set_route_group_activation (ARDOUR::RouteGroup *, bool);
|
|
||||||
|
|
||||||
friend class Drag;
|
friend class Drag;
|
||||||
friend class RegionDrag;
|
friend class RegionDrag;
|
||||||
|
|
@ -2227,7 +2174,7 @@ public:
|
||||||
friend class EditorSummary;
|
friend class EditorSummary;
|
||||||
friend class EditorGroupTabs;
|
friend class EditorGroupTabs;
|
||||||
|
|
||||||
friend class EditorRouteList;
|
friend class EditorRoutes;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __ardour_editor_h__ */
|
#endif /* __ardour_editor_h__ */
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
#include "audio_time_axis.h"
|
#include "audio_time_axis.h"
|
||||||
#include "editor_group_tabs.h"
|
#include "editor_group_tabs.h"
|
||||||
#include "editor_route_list.h"
|
#include "editor_routes.h"
|
||||||
|
|
||||||
using namespace Gtk;
|
using namespace Gtk;
|
||||||
using namespace Glib;
|
using namespace Glib;
|
||||||
|
|
@ -313,9 +313,9 @@ Editor::register_actions ()
|
||||||
act = ActionManager::register_action (editor_actions, "toggle-zoom", _("Toggle Zoom State"), mem_fun(*this, &Editor::swap_visual_state));
|
act = ActionManager::register_action (editor_actions, "toggle-zoom", _("Toggle Zoom State"), mem_fun(*this, &Editor::swap_visual_state));
|
||||||
ActionManager::session_sensitive_actions.push_back (act);
|
ActionManager::session_sensitive_actions.push_back (act);
|
||||||
|
|
||||||
act = ActionManager::register_action (editor_actions, "move-selected-tracks-up", _("Move Selected Tracks Up"), bind (mem_fun(*_route_list, &EditorRouteList::move_selected_tracks), true));
|
act = ActionManager::register_action (editor_actions, "move-selected-tracks-up", _("Move Selected Tracks Up"), bind (mem_fun(*_routes, &EditorRoutes::move_selected_tracks), true));
|
||||||
ActionManager::session_sensitive_actions.push_back (act);
|
ActionManager::session_sensitive_actions.push_back (act);
|
||||||
act = ActionManager::register_action (editor_actions, "move-selected-tracks-down", _("Move Selected Tracks Down"), bind (mem_fun(*_route_list, &EditorRouteList::move_selected_tracks), false));
|
act = ActionManager::register_action (editor_actions, "move-selected-tracks-down", _("Move Selected Tracks Down"), bind (mem_fun(*_routes, &EditorRoutes::move_selected_tracks), false));
|
||||||
ActionManager::session_sensitive_actions.push_back (act);
|
ActionManager::session_sensitive_actions.push_back (act);
|
||||||
|
|
||||||
act = ActionManager::register_action (editor_actions, "scroll-tracks-up", _("Scroll Tracks Up"), mem_fun(*this, &Editor::scroll_tracks_up));
|
act = ActionManager::register_action (editor_actions, "scroll-tracks-up", _("Scroll Tracks Up"), mem_fun(*this, &Editor::scroll_tracks_up));
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
#include "editor_drag.h"
|
#include "editor_drag.h"
|
||||||
#include "region_view.h"
|
#include "region_view.h"
|
||||||
#include "editor_group_tabs.h"
|
#include "editor_group_tabs.h"
|
||||||
#include "editor_route_list.h"
|
#include "editor_routes.h"
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
|
|
|
||||||
48
gtk2_ardour/editor_component.cc
Normal file
48
gtk2_ardour/editor_component.cc
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
/*
|
||||||
|
Copyright (C) 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 "ardour/session.h"
|
||||||
|
#include "editor_component.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
using namespace sigc;
|
||||||
|
using namespace ARDOUR;
|
||||||
|
|
||||||
|
EditorComponent::EditorComponent (Editor* e)
|
||||||
|
: _editor (e),
|
||||||
|
_session (0)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorComponent::connect_to_session (Session* s)
|
||||||
|
{
|
||||||
|
_session = s;
|
||||||
|
|
||||||
|
_session_connections.push_back (_session->GoingAway.connect (mem_fun (*this, &EditorComponent::session_going_away)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorComponent::session_going_away ()
|
||||||
|
{
|
||||||
|
for (list<connection>::iterator i = _session_connections.begin(); i != _session_connections.end(); ++i) {
|
||||||
|
i->disconnect ();
|
||||||
|
}
|
||||||
|
}
|
||||||
51
gtk2_ardour/editor_component.h
Normal file
51
gtk2_ardour/editor_component.h
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
/*
|
||||||
|
Copyright (C) 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.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ardour_gtk_editor_component_h__
|
||||||
|
#define __ardour_gtk_editor_component_h__
|
||||||
|
|
||||||
|
#include <list>
|
||||||
|
#include <sigc++/sigc++.h>
|
||||||
|
|
||||||
|
namespace ARDOUR {
|
||||||
|
class Session;
|
||||||
|
}
|
||||||
|
|
||||||
|
class Editor;
|
||||||
|
|
||||||
|
class EditorComponent
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
EditorComponent (Editor *);
|
||||||
|
|
||||||
|
virtual void connect_to_session (ARDOUR::Session *);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
Editor* _editor;
|
||||||
|
ARDOUR::Session* _session;
|
||||||
|
std::list<sigc::connection> _session_connections;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void session_going_away ();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -1,580 +0,0 @@
|
||||||
/*
|
|
||||||
Copyright (C) 2000 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 <cstdlib>
|
|
||||||
#include <cmath>
|
|
||||||
|
|
||||||
#include <gtkmm2ext/stop_signal.h>
|
|
||||||
#include <gtkmm2ext/gtk_ui.h>
|
|
||||||
#include "ardour/route_group.h"
|
|
||||||
|
|
||||||
#include "editor.h"
|
|
||||||
#include "keyboard.h"
|
|
||||||
#include "marker.h"
|
|
||||||
#include "time_axis_view.h"
|
|
||||||
#include "prompter.h"
|
|
||||||
#include "gui_thread.h"
|
|
||||||
#include "editor_group_tabs.h"
|
|
||||||
#include "route_group_dialog.h"
|
|
||||||
#include "route_time_axis.h"
|
|
||||||
#include "editor_route_list.h"
|
|
||||||
|
|
||||||
#include "ardour/route.h"
|
|
||||||
|
|
||||||
#include "i18n.h"
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace sigc;
|
|
||||||
using namespace ARDOUR;
|
|
||||||
using namespace PBD;
|
|
||||||
using namespace Gtk;
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::build_route_group_menu (RouteGroup* g)
|
|
||||||
{
|
|
||||||
using namespace Gtk::Menu_Helpers;
|
|
||||||
|
|
||||||
delete route_group_menu;
|
|
||||||
|
|
||||||
Menu* new_from = new Menu;
|
|
||||||
MenuList& f = new_from->items ();
|
|
||||||
f.push_back (MenuElem (_("Selection..."), mem_fun (*this, &Editor::new_route_group_from_selection)));
|
|
||||||
f.push_back (MenuElem (_("Record Enabled..."), mem_fun (*this, &Editor::new_route_group_from_rec_enabled)));
|
|
||||||
f.push_back (MenuElem (_("Soloed..."), mem_fun (*this, &Editor::new_route_group_from_soloed)));
|
|
||||||
|
|
||||||
route_group_menu = new Menu;
|
|
||||||
route_group_menu->set_name ("ArdourContextMenu");
|
|
||||||
MenuList& items = route_group_menu->items();
|
|
||||||
|
|
||||||
items.push_back (MenuElem (_("New..."), mem_fun(*this, &Editor::new_route_group)));
|
|
||||||
items.push_back (MenuElem (_("New From"), *new_from));
|
|
||||||
if (g) {
|
|
||||||
items.push_back (MenuElem (_("Edit..."), bind (mem_fun (*this, &Editor::edit_route_group), g)));
|
|
||||||
items.push_back (MenuElem (_("Fit to Window"), bind (mem_fun (*this, &Editor::fit_route_group), g)));
|
|
||||||
items.push_back (MenuElem (_("Subgroup"), bind (mem_fun (*this, &Editor::subgroup_route_group), g)));
|
|
||||||
}
|
|
||||||
items.push_back (SeparatorElem());
|
|
||||||
items.push_back (MenuElem (_("Activate All"), mem_fun(*this, &Editor::activate_all_route_groups)));
|
|
||||||
items.push_back (MenuElem (_("Disable All"), mem_fun(*this, &Editor::disable_all_route_groups)));
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::subgroup_route_group (RouteGroup* g)
|
|
||||||
{
|
|
||||||
g->make_subgroup ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::unsubgroup_route_group (RouteGroup* g)
|
|
||||||
{
|
|
||||||
g->destroy_subgroup ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::activate_all_route_groups ()
|
|
||||||
{
|
|
||||||
session->foreach_route_group (bind (mem_fun (*this, &Editor::set_route_group_activation), true));
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::disable_all_route_groups ()
|
|
||||||
{
|
|
||||||
session->foreach_route_group (bind (mem_fun (*this, &Editor::set_route_group_activation), false));
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::set_route_group_activation (RouteGroup* g, bool a)
|
|
||||||
{
|
|
||||||
g->set_active (a, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::new_route_group ()
|
|
||||||
{
|
|
||||||
RouteGroup* g = new RouteGroup (*session, "", RouteGroup::Active, (RouteGroup::Property) (RouteGroup::Mute | RouteGroup::Solo | RouteGroup::Edit));
|
|
||||||
|
|
||||||
RouteGroupDialog d (g, Gtk::Stock::NEW);
|
|
||||||
int const r = d.do_run ();
|
|
||||||
|
|
||||||
if (r == Gtk::RESPONSE_OK) {
|
|
||||||
session->add_route_group (g);
|
|
||||||
} else {
|
|
||||||
delete g;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::new_route_group_from_selection ()
|
|
||||||
{
|
|
||||||
RouteGroup* g = new RouteGroup (*session, "", RouteGroup::Active, (RouteGroup::Property) (RouteGroup::Mute | RouteGroup::Solo | RouteGroup::Edit | RouteGroup::Select));
|
|
||||||
|
|
||||||
RouteGroupDialog d (g, Gtk::Stock::NEW);
|
|
||||||
int const r = d.do_run ();
|
|
||||||
|
|
||||||
if (r == Gtk::RESPONSE_OK) {
|
|
||||||
session->add_route_group (g);
|
|
||||||
|
|
||||||
for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) {
|
|
||||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*i);
|
|
||||||
if (rtv) {
|
|
||||||
rtv->route()->set_route_group (g, this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
delete g;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::new_route_group_from_rec_enabled ()
|
|
||||||
{
|
|
||||||
RouteGroup* g = new RouteGroup (*session, "", RouteGroup::Active, (RouteGroup::Property) (RouteGroup::Mute | RouteGroup::Solo | RouteGroup::Edit | RouteGroup::RecEnable));
|
|
||||||
|
|
||||||
RouteGroupDialog d (g, Gtk::Stock::NEW);
|
|
||||||
int const r = d.do_run ();
|
|
||||||
|
|
||||||
if (r == Gtk::RESPONSE_OK) {
|
|
||||||
session->add_route_group (g);
|
|
||||||
|
|
||||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
|
||||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*i);
|
|
||||||
if (rtv && rtv->route()->record_enabled()) {
|
|
||||||
rtv->route()->set_route_group (g, this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
delete g;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::new_route_group_from_soloed ()
|
|
||||||
{
|
|
||||||
RouteGroup* g = new RouteGroup (*session, "", RouteGroup::Active, (RouteGroup::Property) (RouteGroup::Mute | RouteGroup::Solo | RouteGroup::Edit));
|
|
||||||
|
|
||||||
RouteGroupDialog d (g, Gtk::Stock::NEW);
|
|
||||||
int const r = d.do_run ();
|
|
||||||
|
|
||||||
if (r == Gtk::RESPONSE_OK) {
|
|
||||||
session->add_route_group (g);
|
|
||||||
|
|
||||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
|
||||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*i);
|
|
||||||
if (rtv && !rtv->route()->is_master() && rtv->route()->soloed()) {
|
|
||||||
rtv->route()->set_route_group (g, this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
delete g;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::edit_route_group (RouteGroup* g)
|
|
||||||
{
|
|
||||||
RouteGroupDialog d (g, Gtk::Stock::APPLY);
|
|
||||||
d.do_run ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::remove_selected_route_group ()
|
|
||||||
{
|
|
||||||
Glib::RefPtr<TreeSelection> selection = route_group_display.get_selection();
|
|
||||||
TreeView::Selection::ListHandle_Path rows = selection->get_selected_rows ();
|
|
||||||
|
|
||||||
if (rows.empty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
TreeView::Selection::ListHandle_Path::iterator i = rows.begin();
|
|
||||||
TreeIter iter;
|
|
||||||
|
|
||||||
/* selection mode is single, so rows.begin() is it */
|
|
||||||
|
|
||||||
if ((iter = group_model->get_iter (*i))) {
|
|
||||||
|
|
||||||
RouteGroup* rg = (*iter)[group_columns.routegroup];
|
|
||||||
|
|
||||||
if (rg) {
|
|
||||||
session->remove_route_group (*rg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::route_group_list_button_clicked ()
|
|
||||||
{
|
|
||||||
new_route_group ();
|
|
||||||
}
|
|
||||||
|
|
||||||
gint
|
|
||||||
Editor::route_group_list_button_press_event (GdkEventButton* ev)
|
|
||||||
{
|
|
||||||
TreeModel::Path path;
|
|
||||||
TreeIter iter;
|
|
||||||
RouteGroup* group = 0;
|
|
||||||
TreeViewColumn* column;
|
|
||||||
int cellx;
|
|
||||||
int celly;
|
|
||||||
|
|
||||||
bool const p = route_group_display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly);
|
|
||||||
|
|
||||||
if (p) {
|
|
||||||
iter = group_model->get_iter (path);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (iter) {
|
|
||||||
group = (*iter)[group_columns.routegroup];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Keyboard::is_context_menu_event (ev)) {
|
|
||||||
build_route_group_menu (group);
|
|
||||||
route_group_menu->popup (1, ev->time);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!p) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (GPOINTER_TO_UINT (column->get_data (X_("colnum")))) {
|
|
||||||
case 0:
|
|
||||||
if (Keyboard::is_edit_event (ev)) {
|
|
||||||
if ((iter = group_model->get_iter (path))) {
|
|
||||||
if ((group = (*iter)[group_columns.routegroup]) != 0) {
|
|
||||||
// edit_route_group (group);
|
|
||||||
#ifdef GTKOSX
|
|
||||||
route_group_display.queue_draw();
|
|
||||||
#endif
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
if ((iter = group_model->get_iter (path))) {
|
|
||||||
bool gain = (*iter)[group_columns.gain];
|
|
||||||
(*iter)[group_columns.gain] = !gain;
|
|
||||||
#ifdef GTKOSX
|
|
||||||
route_group_display.queue_draw();
|
|
||||||
#endif
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
if ((iter = group_model->get_iter (path))) {
|
|
||||||
bool record = (*iter)[group_columns.record];
|
|
||||||
(*iter)[group_columns.record] = !record;
|
|
||||||
#ifdef GTKOSX
|
|
||||||
route_group_display.queue_draw();
|
|
||||||
#endif
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
if ((iter = group_model->get_iter (path))) {
|
|
||||||
bool mute = (*iter)[group_columns.mute];
|
|
||||||
(*iter)[group_columns.mute] = !mute;
|
|
||||||
#ifdef GTKOSX
|
|
||||||
route_group_display.queue_draw();
|
|
||||||
#endif
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
if ((iter = group_model->get_iter (path))) {
|
|
||||||
bool solo = (*iter)[group_columns.solo];
|
|
||||||
(*iter)[group_columns.solo] = !solo;
|
|
||||||
#ifdef GTKOSX
|
|
||||||
route_group_display.queue_draw();
|
|
||||||
#endif
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 5:
|
|
||||||
if ((iter = group_model->get_iter (path))) {
|
|
||||||
bool select = (*iter)[group_columns.select];
|
|
||||||
(*iter)[group_columns.select] = !select;
|
|
||||||
#ifdef GTKOSX
|
|
||||||
route_group_display.queue_draw();
|
|
||||||
#endif
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 6:
|
|
||||||
if ((iter = group_model->get_iter (path))) {
|
|
||||||
bool edits = (*iter)[group_columns.edits];
|
|
||||||
(*iter)[group_columns.edits] = !edits;
|
|
||||||
#ifdef GTKOSX
|
|
||||||
route_group_display.queue_draw();
|
|
||||||
#endif
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 7:
|
|
||||||
if ((iter = group_model->get_iter (path))) {
|
|
||||||
bool visible = (*iter)[group_columns.is_visible];
|
|
||||||
(*iter)[group_columns.is_visible] = !visible;
|
|
||||||
#ifdef GTKOSX
|
|
||||||
route_group_display.queue_draw();
|
|
||||||
#endif
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::route_group_row_change (const Gtk::TreeModel::Path& path,const Gtk::TreeModel::iterator& iter)
|
|
||||||
{
|
|
||||||
RouteGroup* group;
|
|
||||||
|
|
||||||
if (in_route_group_row_change) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((group = (*iter)[group_columns.routegroup]) == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((*iter)[group_columns.is_visible]) {
|
|
||||||
for (TrackViewList::iterator j = track_views.begin(); j != track_views.end(); ++j) {
|
|
||||||
if ((*j)->route_group() == group) {
|
|
||||||
_route_list->show_track_in_display (**j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (TrackViewList::iterator j = track_views.begin(); j != track_views.end(); ++j) {
|
|
||||||
if ((*j)->route_group() == group) {
|
|
||||||
hide_track_in_display (**j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((*iter)[group_columns.gain]) {
|
|
||||||
for (TrackViewList::iterator j = track_views.begin(); j != track_views.end(); ++j) {
|
|
||||||
if ((*j)->route_group() == group) {
|
|
||||||
group->set_property (RouteGroup::Gain, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (TrackViewList::iterator j = track_views.begin(); j != track_views.end(); ++j) {
|
|
||||||
if ((*j)->route_group() == group) {
|
|
||||||
group->set_property (RouteGroup::Gain, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((*iter)[group_columns.record]) {
|
|
||||||
for (TrackViewList::iterator j = track_views.begin(); j != track_views.end(); ++j) {
|
|
||||||
if ((*j)->route_group() == group) {
|
|
||||||
group->set_property (RouteGroup::RecEnable, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (TrackViewList::iterator j = track_views.begin(); j != track_views.end(); ++j) {
|
|
||||||
if ((*j)->route_group() == group) {
|
|
||||||
group->set_property (RouteGroup::RecEnable, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((*iter)[group_columns.mute]) {
|
|
||||||
for (TrackViewList::iterator j = track_views.begin(); j != track_views.end(); ++j) {
|
|
||||||
if ((*j)->route_group() == group) {
|
|
||||||
group->set_property (RouteGroup::Mute, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (TrackViewList::iterator j = track_views.begin(); j != track_views.end(); ++j) {
|
|
||||||
if ((*j)->route_group() == group) {
|
|
||||||
group->set_property (RouteGroup::Mute, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((*iter)[group_columns.solo]) {
|
|
||||||
for (TrackViewList::iterator j = track_views.begin(); j != track_views.end(); ++j) {
|
|
||||||
if ((*j)->route_group() == group) {
|
|
||||||
group->set_property (RouteGroup::Solo, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (TrackViewList::iterator j = track_views.begin(); j != track_views.end(); ++j) {
|
|
||||||
if ((*j)->route_group() == group) {
|
|
||||||
group->set_property (RouteGroup::Solo, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((*iter)[group_columns.select]) {
|
|
||||||
for (TrackViewList::iterator j = track_views.begin(); j != track_views.end(); ++j) {
|
|
||||||
if ((*j)->route_group() == group) {
|
|
||||||
group->set_property (RouteGroup::Select, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (TrackViewList::iterator j = track_views.begin(); j != track_views.end(); ++j) {
|
|
||||||
if ((*j)->route_group() == group) {
|
|
||||||
group->set_property (RouteGroup::Select, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((*iter)[group_columns.edits]) {
|
|
||||||
for (TrackViewList::iterator j = track_views.begin(); j != track_views.end(); ++j) {
|
|
||||||
if ((*j)->route_group() == group) {
|
|
||||||
group->set_property (RouteGroup::Edit, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (TrackViewList::iterator j = track_views.begin(); j != track_views.end(); ++j) {
|
|
||||||
if ((*j)->route_group() == group) {
|
|
||||||
group->set_property (RouteGroup::Edit, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
string name = (*iter)[group_columns.text];
|
|
||||||
|
|
||||||
if (name != group->name()) {
|
|
||||||
group->set_name (name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::add_route_group (RouteGroup* group)
|
|
||||||
{
|
|
||||||
ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::add_route_group), group));
|
|
||||||
bool focus = false;
|
|
||||||
|
|
||||||
TreeModel::Row row = *(group_model->append());
|
|
||||||
|
|
||||||
row[group_columns.is_visible] = !group->is_hidden();
|
|
||||||
row[group_columns.gain] = group->property(RouteGroup::Gain);
|
|
||||||
row[group_columns.record] = group->property(RouteGroup::RecEnable);
|
|
||||||
row[group_columns.mute] = group->property(RouteGroup::Mute);
|
|
||||||
row[group_columns.solo] = group->property(RouteGroup::Solo);
|
|
||||||
row[group_columns.select] = group->property(RouteGroup::Select);
|
|
||||||
row[group_columns.edits] = group->property(RouteGroup::Edit);
|
|
||||||
|
|
||||||
in_route_group_row_change = true;
|
|
||||||
|
|
||||||
row[group_columns.routegroup] = group;
|
|
||||||
|
|
||||||
if (!group->name().empty()) {
|
|
||||||
row[group_columns.text] = group->name();
|
|
||||||
} else {
|
|
||||||
row[group_columns.text] = _("unnamed");
|
|
||||||
focus = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
group->FlagsChanged.connect (bind (mem_fun(*this, &Editor::group_flags_changed), group));
|
|
||||||
|
|
||||||
if (focus) {
|
|
||||||
TreeViewColumn* col = route_group_display.get_column (0);
|
|
||||||
CellRendererText* name_cell = dynamic_cast<CellRendererText*>(route_group_display.get_column_cell_renderer (0));
|
|
||||||
route_group_display.set_cursor (group_model->get_path (row), *col, *name_cell, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
in_route_group_row_change = false;
|
|
||||||
|
|
||||||
_group_tabs->set_dirty ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::route_groups_changed ()
|
|
||||||
{
|
|
||||||
ENSURE_GUI_THREAD (mem_fun (*this, &Editor::route_groups_changed));
|
|
||||||
|
|
||||||
/* just rebuild the while thing */
|
|
||||||
|
|
||||||
group_model->clear ();
|
|
||||||
|
|
||||||
{
|
|
||||||
TreeModel::Row row;
|
|
||||||
row = *(group_model->append());
|
|
||||||
row[group_columns.is_visible] = true;
|
|
||||||
row[group_columns.text] = (_("-all-"));
|
|
||||||
row[group_columns.routegroup] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
session->foreach_route_group (mem_fun (*this, &Editor::add_route_group));
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::group_flags_changed (void* src, RouteGroup* group)
|
|
||||||
{
|
|
||||||
ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::group_flags_changed), src, group));
|
|
||||||
|
|
||||||
in_route_group_row_change = true;
|
|
||||||
|
|
||||||
Gtk::TreeModel::Children children = group_model->children();
|
|
||||||
|
|
||||||
for(Gtk::TreeModel::Children::iterator iter = children.begin(); iter != children.end(); ++iter) {
|
|
||||||
if (group == (*iter)[group_columns.routegroup]) {
|
|
||||||
(*iter)[group_columns.is_visible] = !group->is_hidden();
|
|
||||||
(*iter)[group_columns.text] = group->name();
|
|
||||||
(*iter)[group_columns.gain] = group->property(RouteGroup::Gain);
|
|
||||||
(*iter)[group_columns.record] = group->property(RouteGroup::RecEnable);
|
|
||||||
(*iter)[group_columns.mute] = group->property(RouteGroup::Mute);
|
|
||||||
(*iter)[group_columns.solo] = group->property(RouteGroup::Solo);
|
|
||||||
(*iter)[group_columns.select] = group->property(RouteGroup::Select);
|
|
||||||
(*iter)[group_columns.edits] = group->property(RouteGroup::Edit);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
in_route_group_row_change = false;
|
|
||||||
|
|
||||||
_group_tabs->set_dirty ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::route_group_name_edit (const Glib::ustring& path, const Glib::ustring& new_text)
|
|
||||||
{
|
|
||||||
RouteGroup* group;
|
|
||||||
TreeIter iter;
|
|
||||||
|
|
||||||
if ((iter = group_model->get_iter (path))) {
|
|
||||||
|
|
||||||
if ((group = (*iter)[group_columns.routegroup]) == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (new_text != group->name()) {
|
|
||||||
group->set_name (new_text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -22,12 +22,13 @@
|
||||||
#include "editor.h"
|
#include "editor.h"
|
||||||
#include "route_time_axis.h"
|
#include "route_time_axis.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
#include "editor_route_groups.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
|
|
||||||
EditorGroupTabs::EditorGroupTabs (Editor* e)
|
EditorGroupTabs::EditorGroupTabs (Editor* e)
|
||||||
: _editor (e)
|
: GroupTabs (e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -157,6 +158,5 @@ EditorGroupTabs::reflect_tabs (list<Tab> const & tabs)
|
||||||
Gtk::Menu*
|
Gtk::Menu*
|
||||||
EditorGroupTabs::get_menu (RouteGroup *g)
|
EditorGroupTabs::get_menu (RouteGroup *g)
|
||||||
{
|
{
|
||||||
_editor->build_route_group_menu (g);
|
return _editor->_route_groups->menu (g);
|
||||||
return _editor->route_group_menu;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,4 @@ private:
|
||||||
return _height;
|
return _height;
|
||||||
}
|
}
|
||||||
Gtk::Menu* get_menu (ARDOUR::RouteGroup* g);
|
Gtk::Menu* get_menu (ARDOUR::RouteGroup* g);
|
||||||
|
|
||||||
Editor* _editor;
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,8 @@
|
||||||
#include "selection.h"
|
#include "selection.h"
|
||||||
#include "audio_time_axis.h"
|
#include "audio_time_axis.h"
|
||||||
#include "actions.h"
|
#include "actions.h"
|
||||||
#include "editor_route_list.h"
|
#include "editor_routes.h"
|
||||||
|
#include "editor_route_groups.h"
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
|
|
@ -364,22 +365,20 @@ Editor::session_going_away ()
|
||||||
|
|
||||||
/* hide all tracks */
|
/* hide all tracks */
|
||||||
|
|
||||||
_route_list->hide_all_tracks (false);
|
_routes->hide_all_tracks (false);
|
||||||
|
|
||||||
/* rip everything out of the list displays */
|
/* rip everything out of the list displays */
|
||||||
|
|
||||||
region_list_display.set_model (Glib::RefPtr<Gtk::TreeStore>(0));
|
region_list_display.set_model (Glib::RefPtr<Gtk::TreeStore>(0));
|
||||||
_route_list->clear ();
|
_routes->clear ();
|
||||||
|
_route_groups->clear ();
|
||||||
named_selection_display.set_model (Glib::RefPtr<Gtk::TreeStore>(0));
|
named_selection_display.set_model (Glib::RefPtr<Gtk::TreeStore>(0));
|
||||||
route_group_display.set_model (Glib::RefPtr<Gtk::TreeStore>(0));
|
|
||||||
|
|
||||||
region_list_model->clear ();
|
region_list_model->clear ();
|
||||||
named_selection_model->clear ();
|
named_selection_model->clear ();
|
||||||
group_model->clear ();
|
|
||||||
|
|
||||||
region_list_display.set_model (region_list_model);
|
region_list_display.set_model (region_list_model);
|
||||||
named_selection_display.set_model (named_selection_model);
|
named_selection_display.set_model (named_selection_model);
|
||||||
route_group_display.set_model (group_model);
|
|
||||||
|
|
||||||
edit_point_clock_connection_a.disconnect();
|
edit_point_clock_connection_a.disconnect();
|
||||||
edit_point_clock_connection_b.disconnect();
|
edit_point_clock_connection_b.disconnect();
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "editor_drag.h"
|
#include "editor_drag.h"
|
||||||
#include "strip_silence_dialog.h"
|
#include "strip_silence_dialog.h"
|
||||||
#include "editor_route_list.h"
|
#include "editor_routes.h"
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
|
|
@ -1745,7 +1745,7 @@ Editor::temporal_zoom_region (bool both_axes)
|
||||||
|
|
||||||
/* hide irrelevant tracks */
|
/* hide irrelevant tracks */
|
||||||
|
|
||||||
_route_list->suspend_redisplay ();
|
_routes->suspend_redisplay ();
|
||||||
|
|
||||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||||
if (find (tracks.begin(), tracks.end(), (*i)) == tracks.end()) {
|
if (find (tracks.begin(), tracks.end(), (*i)) == tracks.end()) {
|
||||||
|
|
@ -1753,7 +1753,7 @@ Editor::temporal_zoom_region (bool both_axes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_route_list->resume_redisplay ();
|
_routes->resume_redisplay ();
|
||||||
|
|
||||||
vertical_adjustment.set_value (0.0);
|
vertical_adjustment.set_value (0.0);
|
||||||
no_save_visual = false;
|
no_save_visual = false;
|
||||||
|
|
@ -6376,13 +6376,6 @@ Editor::fit_selected_tracks ()
|
||||||
fit_tracks (selection->tracks);
|
fit_tracks (selection->tracks);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Editor::fit_route_group (RouteGroup *g)
|
|
||||||
{
|
|
||||||
TrackSelection ts = axis_views_from_routes (g->route_list ());
|
|
||||||
fit_tracks (ts);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::fit_tracks (TrackSelection & tracks)
|
Editor::fit_tracks (TrackSelection & tracks)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
668
gtk2_ardour/editor_route_groups.cc
Normal file
668
gtk2_ardour/editor_route_groups.cc
Normal file
|
|
@ -0,0 +1,668 @@
|
||||||
|
/*
|
||||||
|
Copyright (C) 2000 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 <cstdlib>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
|
#include <gtkmm2ext/stop_signal.h>
|
||||||
|
#include <gtkmm2ext/gtk_ui.h>
|
||||||
|
#include "ardour/route_group.h"
|
||||||
|
|
||||||
|
#include "editor.h"
|
||||||
|
#include "keyboard.h"
|
||||||
|
#include "marker.h"
|
||||||
|
#include "time_axis_view.h"
|
||||||
|
#include "prompter.h"
|
||||||
|
#include "gui_thread.h"
|
||||||
|
#include "editor_group_tabs.h"
|
||||||
|
#include "route_group_dialog.h"
|
||||||
|
#include "route_time_axis.h"
|
||||||
|
#include "editor_routes.h"
|
||||||
|
#include "editor_route_groups.h"
|
||||||
|
|
||||||
|
#include "ardour/route.h"
|
||||||
|
|
||||||
|
#include "i18n.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
using namespace sigc;
|
||||||
|
using namespace ARDOUR;
|
||||||
|
using namespace PBD;
|
||||||
|
using namespace Gtk;
|
||||||
|
|
||||||
|
EditorRouteGroups::EditorRouteGroups (Editor* e)
|
||||||
|
: EditorComponent (e),
|
||||||
|
_menu (0),
|
||||||
|
_in_row_change (false)
|
||||||
|
|
||||||
|
{
|
||||||
|
_model = ListStore::create (_columns);
|
||||||
|
_display.set_model (_model);
|
||||||
|
|
||||||
|
_display.append_column (_("Name"), _columns.text);
|
||||||
|
|
||||||
|
_display.append_column (_("G"), _columns.gain);
|
||||||
|
_display.append_column (_("R"), _columns.record);
|
||||||
|
_display.append_column (_("M"), _columns.mute);
|
||||||
|
_display.append_column (_("S"), _columns.solo);
|
||||||
|
_display.append_column (_("Sel"), _columns.select);
|
||||||
|
_display.append_column (_("E"), _columns.edits);
|
||||||
|
|
||||||
|
_display.append_column (_("Show"), _columns.is_visible);
|
||||||
|
|
||||||
|
_display.get_column (0)->set_data (X_("colnum"), GUINT_TO_POINTER(0));
|
||||||
|
_display.get_column (1)->set_data (X_("colnum"), GUINT_TO_POINTER(1));
|
||||||
|
_display.get_column (2)->set_data (X_("colnum"), GUINT_TO_POINTER(2));
|
||||||
|
_display.get_column (3)->set_data (X_("colnum"), GUINT_TO_POINTER(3));
|
||||||
|
_display.get_column (4)->set_data (X_("colnum"), GUINT_TO_POINTER(4));
|
||||||
|
_display.get_column (5)->set_data (X_("colnum"), GUINT_TO_POINTER(5));
|
||||||
|
_display.get_column (6)->set_data (X_("colnum"), GUINT_TO_POINTER(6));
|
||||||
|
_display.get_column (7)->set_data (X_("colnum"), GUINT_TO_POINTER(7));
|
||||||
|
|
||||||
|
_display.get_column (0)->set_expand (true);
|
||||||
|
_display.get_column (1)->set_expand (false);
|
||||||
|
_display.get_column (2)->set_expand (false);
|
||||||
|
_display.get_column (3)->set_expand (false);
|
||||||
|
_display.get_column (4)->set_expand (false);
|
||||||
|
_display.get_column (5)->set_expand (false);
|
||||||
|
_display.get_column (6)->set_expand (false);
|
||||||
|
_display.get_column (7)->set_expand (false);
|
||||||
|
|
||||||
|
_display.set_headers_visible (true);
|
||||||
|
|
||||||
|
/* name is directly editable */
|
||||||
|
|
||||||
|
CellRendererText* name_cell = dynamic_cast<CellRendererText*>(_display.get_column_cell_renderer (0));
|
||||||
|
name_cell->property_editable() = true;
|
||||||
|
name_cell->signal_edited().connect (mem_fun (*this, &EditorRouteGroups::name_edit));
|
||||||
|
|
||||||
|
/* use checkbox for the active + visible columns */
|
||||||
|
|
||||||
|
CellRendererToggle* active_cell = dynamic_cast<CellRendererToggle*>(_display.get_column_cell_renderer (1));
|
||||||
|
active_cell->property_activatable() = true;
|
||||||
|
active_cell->property_radio() = false;
|
||||||
|
|
||||||
|
active_cell = dynamic_cast<CellRendererToggle*>(_display.get_column_cell_renderer (2));
|
||||||
|
active_cell->property_activatable() = true;
|
||||||
|
active_cell->property_radio() = false;
|
||||||
|
|
||||||
|
active_cell = dynamic_cast<CellRendererToggle*>(_display.get_column_cell_renderer (3));
|
||||||
|
active_cell->property_activatable() = true;
|
||||||
|
active_cell->property_radio() = false;
|
||||||
|
|
||||||
|
active_cell = dynamic_cast<CellRendererToggle*>(_display.get_column_cell_renderer (4));
|
||||||
|
active_cell->property_activatable() = true;
|
||||||
|
active_cell->property_radio() = false;
|
||||||
|
|
||||||
|
active_cell = dynamic_cast<CellRendererToggle*>(_display.get_column_cell_renderer (5));
|
||||||
|
active_cell->property_activatable() = true;
|
||||||
|
active_cell->property_radio() = false;
|
||||||
|
|
||||||
|
active_cell = dynamic_cast<CellRendererToggle*>(_display.get_column_cell_renderer (6));
|
||||||
|
active_cell->property_activatable() = true;
|
||||||
|
active_cell->property_radio() = false;
|
||||||
|
|
||||||
|
active_cell = dynamic_cast<CellRendererToggle*>(_display.get_column_cell_renderer (7));
|
||||||
|
active_cell->property_activatable() = true;
|
||||||
|
active_cell->property_radio() = false;
|
||||||
|
|
||||||
|
_model->signal_row_changed().connect (mem_fun (*this, &EditorRouteGroups::row_change));
|
||||||
|
|
||||||
|
_display.set_name ("EditGroupList");
|
||||||
|
_display.get_selection()->set_mode (SELECTION_SINGLE);
|
||||||
|
_display.set_headers_visible (true);
|
||||||
|
_display.set_reorderable (false);
|
||||||
|
_display.set_rules_hint (true);
|
||||||
|
_display.set_size_request (75, -1);
|
||||||
|
|
||||||
|
_scroller.add (_display);
|
||||||
|
_scroller.set_policy (POLICY_AUTOMATIC, POLICY_AUTOMATIC);
|
||||||
|
|
||||||
|
_display.signal_button_press_event().connect (mem_fun(*this, &EditorRouteGroups::button_press_event), false);
|
||||||
|
|
||||||
|
_display_packer = new VBox;
|
||||||
|
HBox* button_box = manage (new HBox());
|
||||||
|
button_box->set_homogeneous (true);
|
||||||
|
|
||||||
|
Button* add_button = manage (new Button ());
|
||||||
|
Button* remove_button = manage (new Button ());
|
||||||
|
|
||||||
|
Widget* w;
|
||||||
|
|
||||||
|
w = manage (new Image (Stock::ADD, ICON_SIZE_BUTTON));
|
||||||
|
w->show();
|
||||||
|
add_button->add (*w);
|
||||||
|
|
||||||
|
w = manage (new Image (Stock::REMOVE, ICON_SIZE_BUTTON));
|
||||||
|
w->show();
|
||||||
|
remove_button->add (*w);
|
||||||
|
|
||||||
|
add_button->signal_clicked().connect (mem_fun (*this, &EditorRouteGroups::new_route_group));
|
||||||
|
remove_button->signal_clicked().connect (mem_fun (*this, &EditorRouteGroups::remove_selected));
|
||||||
|
|
||||||
|
button_box->pack_start (*add_button);
|
||||||
|
button_box->pack_start (*remove_button);
|
||||||
|
|
||||||
|
_display_packer->pack_start (_scroller, true, true);
|
||||||
|
_display_packer->pack_start (*button_box, false, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Gtk::Menu*
|
||||||
|
EditorRouteGroups::menu (RouteGroup* g)
|
||||||
|
{
|
||||||
|
using namespace Gtk::Menu_Helpers;
|
||||||
|
|
||||||
|
delete _menu;
|
||||||
|
|
||||||
|
Menu* new_from = new Menu;
|
||||||
|
MenuList& f = new_from->items ();
|
||||||
|
f.push_back (MenuElem (_("Selection..."), mem_fun (*this, &EditorRouteGroups::new_from_selection)));
|
||||||
|
f.push_back (MenuElem (_("Record Enabled..."), mem_fun (*this, &EditorRouteGroups::new_from_rec_enabled)));
|
||||||
|
f.push_back (MenuElem (_("Soloed..."), mem_fun (*this, &EditorRouteGroups::new_from_soloed)));
|
||||||
|
|
||||||
|
_menu = new Menu;
|
||||||
|
_menu->set_name ("ArdourContextMenu");
|
||||||
|
MenuList& items = _menu->items();
|
||||||
|
|
||||||
|
items.push_back (MenuElem (_("New..."), mem_fun(*this, &EditorRouteGroups::new_route_group)));
|
||||||
|
items.push_back (MenuElem (_("New From"), *new_from));
|
||||||
|
if (g) {
|
||||||
|
items.push_back (MenuElem (_("Edit..."), bind (mem_fun (*this, &EditorRouteGroups::edit), g)));
|
||||||
|
items.push_back (MenuElem (_("Fit to Window"), bind (mem_fun (*_editor, &Editor::fit_route_group), g)));
|
||||||
|
items.push_back (MenuElem (_("Subgroup"), bind (mem_fun (*this, &EditorRouteGroups::subgroup), g)));
|
||||||
|
}
|
||||||
|
items.push_back (SeparatorElem());
|
||||||
|
items.push_back (MenuElem (_("Activate All"), mem_fun(*this, &EditorRouteGroups::activate_all)));
|
||||||
|
items.push_back (MenuElem (_("Disable All"), mem_fun(*this, &EditorRouteGroups::disable_all)));
|
||||||
|
|
||||||
|
return _menu;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorRouteGroups::subgroup (RouteGroup* g)
|
||||||
|
{
|
||||||
|
g->make_subgroup ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorRouteGroups::unsubgroup (RouteGroup* g)
|
||||||
|
{
|
||||||
|
g->destroy_subgroup ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorRouteGroups::activate_all ()
|
||||||
|
{
|
||||||
|
_session->foreach_route_group (
|
||||||
|
bind (mem_fun (*this, &EditorRouteGroups::set_activation), true)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorRouteGroups::disable_all ()
|
||||||
|
{
|
||||||
|
_session->foreach_route_group (
|
||||||
|
bind (mem_fun (*this, &EditorRouteGroups::set_activation), false)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorRouteGroups::set_activation (RouteGroup* g, bool a)
|
||||||
|
{
|
||||||
|
g->set_active (a, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorRouteGroups::new_route_group ()
|
||||||
|
{
|
||||||
|
RouteGroup* g = new RouteGroup (
|
||||||
|
*_session,
|
||||||
|
"",
|
||||||
|
RouteGroup::Active,
|
||||||
|
(RouteGroup::Property) (RouteGroup::Mute | RouteGroup::Solo | RouteGroup::Edit)
|
||||||
|
);
|
||||||
|
|
||||||
|
RouteGroupDialog d (g, Gtk::Stock::NEW);
|
||||||
|
int const r = d.do_run ();
|
||||||
|
|
||||||
|
if (r == Gtk::RESPONSE_OK) {
|
||||||
|
_session->add_route_group (g);
|
||||||
|
} else {
|
||||||
|
delete g;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorRouteGroups::new_from_selection ()
|
||||||
|
{
|
||||||
|
RouteGroup* g = new RouteGroup (
|
||||||
|
*_session,
|
||||||
|
"",
|
||||||
|
RouteGroup::Active,
|
||||||
|
(RouteGroup::Property) (RouteGroup::Mute | RouteGroup::Solo | RouteGroup::Edit | RouteGroup::Select)
|
||||||
|
);
|
||||||
|
|
||||||
|
RouteGroupDialog d (g, Gtk::Stock::NEW);
|
||||||
|
int const r = d.do_run ();
|
||||||
|
|
||||||
|
if (r == Gtk::RESPONSE_OK) {
|
||||||
|
_session->add_route_group (g);
|
||||||
|
|
||||||
|
for (TrackSelection::iterator i = _editor->get_selection().tracks.begin(); i != _editor->get_selection().tracks.end(); ++i) {
|
||||||
|
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*i);
|
||||||
|
if (rtv) {
|
||||||
|
rtv->route()->set_route_group (g, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
delete g;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorRouteGroups::new_from_rec_enabled ()
|
||||||
|
{
|
||||||
|
RouteGroup* g = new RouteGroup (
|
||||||
|
*_session,
|
||||||
|
"",
|
||||||
|
RouteGroup::Active,
|
||||||
|
(RouteGroup::Property) (RouteGroup::Mute | RouteGroup::Solo | RouteGroup::Edit | RouteGroup::RecEnable)
|
||||||
|
);
|
||||||
|
|
||||||
|
RouteGroupDialog d (g, Gtk::Stock::NEW);
|
||||||
|
int const r = d.do_run ();
|
||||||
|
|
||||||
|
if (r == Gtk::RESPONSE_OK) {
|
||||||
|
_session->add_route_group (g);
|
||||||
|
|
||||||
|
for (Editor::TrackViewList::const_iterator i = _editor->get_track_views().begin(); i != _editor->get_track_views().end(); ++i) {
|
||||||
|
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*i);
|
||||||
|
if (rtv && rtv->route()->record_enabled()) {
|
||||||
|
rtv->route()->set_route_group (g, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
delete g;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorRouteGroups::new_from_soloed ()
|
||||||
|
{
|
||||||
|
RouteGroup* g = new RouteGroup (
|
||||||
|
*_session,
|
||||||
|
"",
|
||||||
|
RouteGroup::Active,
|
||||||
|
(RouteGroup::Property) (RouteGroup::Mute | RouteGroup::Solo | RouteGroup::Edit)
|
||||||
|
);
|
||||||
|
|
||||||
|
RouteGroupDialog d (g, Gtk::Stock::NEW);
|
||||||
|
int const r = d.do_run ();
|
||||||
|
|
||||||
|
if (r == Gtk::RESPONSE_OK) {
|
||||||
|
_session->add_route_group (g);
|
||||||
|
|
||||||
|
for (Editor::TrackViewList::const_iterator i = _editor->get_track_views().begin(); i != _editor->get_track_views().end(); ++i) {
|
||||||
|
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*i);
|
||||||
|
if (rtv && !rtv->route()->is_master() && rtv->route()->soloed()) {
|
||||||
|
rtv->route()->set_route_group (g, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
delete g;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorRouteGroups::edit (RouteGroup* g)
|
||||||
|
{
|
||||||
|
RouteGroupDialog d (g, Gtk::Stock::APPLY);
|
||||||
|
d.do_run ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorRouteGroups::remove_selected ()
|
||||||
|
{
|
||||||
|
Glib::RefPtr<TreeSelection> selection = _display.get_selection();
|
||||||
|
TreeView::Selection::ListHandle_Path rows = selection->get_selected_rows ();
|
||||||
|
|
||||||
|
if (rows.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
TreeView::Selection::ListHandle_Path::iterator i = rows.begin();
|
||||||
|
TreeIter iter;
|
||||||
|
|
||||||
|
/* selection mode is single, so rows.begin() is it */
|
||||||
|
|
||||||
|
if ((iter = _model->get_iter (*i))) {
|
||||||
|
|
||||||
|
RouteGroup* rg = (*iter)[_columns.routegroup];
|
||||||
|
|
||||||
|
if (rg) {
|
||||||
|
_session->remove_route_group (*rg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorRouteGroups::button_clicked ()
|
||||||
|
{
|
||||||
|
new_route_group ();
|
||||||
|
}
|
||||||
|
|
||||||
|
gint
|
||||||
|
EditorRouteGroups::button_press_event (GdkEventButton* ev)
|
||||||
|
{
|
||||||
|
TreeModel::Path path;
|
||||||
|
TreeIter iter;
|
||||||
|
RouteGroup* group = 0;
|
||||||
|
TreeViewColumn* column;
|
||||||
|
int cellx;
|
||||||
|
int celly;
|
||||||
|
|
||||||
|
bool const p = _display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly);
|
||||||
|
|
||||||
|
if (p) {
|
||||||
|
iter = _model->get_iter (path);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (iter) {
|
||||||
|
group = (*iter)[_columns.routegroup];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Keyboard::is_context_menu_event (ev)) {
|
||||||
|
menu(group)->popup (1, ev->time);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!p) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (GPOINTER_TO_UINT (column->get_data (X_("colnum")))) {
|
||||||
|
case 0:
|
||||||
|
if (Keyboard::is_edit_event (ev)) {
|
||||||
|
if ((iter = _model->get_iter (path))) {
|
||||||
|
if ((group = (*iter)[_columns.routegroup]) != 0) {
|
||||||
|
// edit_route_group (group);
|
||||||
|
#ifdef GTKOSX
|
||||||
|
_display.queue_draw();
|
||||||
|
#endif
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
if ((iter = _model->get_iter (path))) {
|
||||||
|
bool gain = (*iter)[_columns.gain];
|
||||||
|
(*iter)[_columns.gain] = !gain;
|
||||||
|
#ifdef GTKOSX
|
||||||
|
_display.queue_draw();
|
||||||
|
#endif
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
if ((iter = _model->get_iter (path))) {
|
||||||
|
bool record = (*iter)[_columns.record];
|
||||||
|
(*iter)[_columns.record] = !record;
|
||||||
|
#ifdef GTKOSX
|
||||||
|
_display.queue_draw();
|
||||||
|
#endif
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
if ((iter = _model->get_iter (path))) {
|
||||||
|
bool mute = (*iter)[_columns.mute];
|
||||||
|
(*iter)[_columns.mute] = !mute;
|
||||||
|
#ifdef GTKOSX
|
||||||
|
_display.queue_draw();
|
||||||
|
#endif
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 4:
|
||||||
|
if ((iter = _model->get_iter (path))) {
|
||||||
|
bool solo = (*iter)[_columns.solo];
|
||||||
|
(*iter)[_columns.solo] = !solo;
|
||||||
|
#ifdef GTKOSX
|
||||||
|
_display.queue_draw();
|
||||||
|
#endif
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 5:
|
||||||
|
if ((iter = _model->get_iter (path))) {
|
||||||
|
bool select = (*iter)[_columns.select];
|
||||||
|
(*iter)[_columns.select] = !select;
|
||||||
|
#ifdef GTKOSX
|
||||||
|
_display.queue_draw();
|
||||||
|
#endif
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 6:
|
||||||
|
if ((iter = _model->get_iter (path))) {
|
||||||
|
bool edits = (*iter)[_columns.edits];
|
||||||
|
(*iter)[_columns.edits] = !edits;
|
||||||
|
#ifdef GTKOSX
|
||||||
|
_display.queue_draw();
|
||||||
|
#endif
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 7:
|
||||||
|
if ((iter = _model->get_iter (path))) {
|
||||||
|
bool visible = (*iter)[_columns.is_visible];
|
||||||
|
(*iter)[_columns.is_visible] = !visible;
|
||||||
|
#ifdef GTKOSX
|
||||||
|
_display.queue_draw();
|
||||||
|
#endif
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorRouteGroups::row_change (const Gtk::TreeModel::Path& path,const Gtk::TreeModel::iterator& iter)
|
||||||
|
{
|
||||||
|
RouteGroup* group;
|
||||||
|
|
||||||
|
if (_in_row_change) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((group = (*iter)[_columns.routegroup]) == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((*iter)[_columns.is_visible]) {
|
||||||
|
for (Editor::TrackViewList::const_iterator j = _editor->get_track_views().begin(); j != _editor->get_track_views().end(); ++j) {
|
||||||
|
if ((*j)->route_group() == group) {
|
||||||
|
_editor->_routes->show_track_in_display (**j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (Editor::TrackViewList::const_iterator j = _editor->get_track_views().begin(); j != _editor->get_track_views().end(); ++j) {
|
||||||
|
if ((*j)->route_group() == group) {
|
||||||
|
_editor->hide_track_in_display (**j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
group->set_property (RouteGroup::Gain, (*iter)[_columns.gain]);
|
||||||
|
group->set_property (RouteGroup::RecEnable, (*iter)[_columns.record]);
|
||||||
|
group->set_property (RouteGroup::Mute, (*iter)[_columns.mute]);
|
||||||
|
group->set_property (RouteGroup::Solo, (*iter)[_columns.solo]);
|
||||||
|
group->set_property (RouteGroup::Select, (*iter)[_columns.select]);
|
||||||
|
group->set_property (RouteGroup::Edit, (*iter)[_columns.edits]);
|
||||||
|
|
||||||
|
string name = (*iter)[_columns.text];
|
||||||
|
|
||||||
|
if (name != group->name()) {
|
||||||
|
group->set_name (name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorRouteGroups::add (RouteGroup* group)
|
||||||
|
{
|
||||||
|
ENSURE_GUI_THREAD (bind (mem_fun(*this, &EditorRouteGroups::add), group));
|
||||||
|
bool focus = false;
|
||||||
|
|
||||||
|
TreeModel::Row row = *(_model->append());
|
||||||
|
|
||||||
|
row[_columns.is_visible] = !group->is_hidden();
|
||||||
|
row[_columns.gain] = group->property(RouteGroup::Gain);
|
||||||
|
row[_columns.record] = group->property(RouteGroup::RecEnable);
|
||||||
|
row[_columns.mute] = group->property(RouteGroup::Mute);
|
||||||
|
row[_columns.solo] = group->property(RouteGroup::Solo);
|
||||||
|
row[_columns.select] = group->property(RouteGroup::Select);
|
||||||
|
row[_columns.edits] = group->property(RouteGroup::Edit);
|
||||||
|
|
||||||
|
_in_row_change = true;
|
||||||
|
|
||||||
|
row[_columns.routegroup] = group;
|
||||||
|
|
||||||
|
if (!group->name().empty()) {
|
||||||
|
row[_columns.text] = group->name();
|
||||||
|
} else {
|
||||||
|
row[_columns.text] = _("unnamed");
|
||||||
|
focus = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
group->FlagsChanged.connect (bind (mem_fun (*this, &EditorRouteGroups::flags_changed), group));
|
||||||
|
|
||||||
|
if (focus) {
|
||||||
|
TreeViewColumn* col = _display.get_column (0);
|
||||||
|
CellRendererText* name_cell = dynamic_cast<CellRendererText*>(_display.get_column_cell_renderer (0));
|
||||||
|
_display.set_cursor (_model->get_path (row), *col, *name_cell, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
_in_row_change = false;
|
||||||
|
|
||||||
|
_editor->_group_tabs->set_dirty ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorRouteGroups::groups_changed ()
|
||||||
|
{
|
||||||
|
ENSURE_GUI_THREAD (mem_fun (*this, &EditorRouteGroups::groups_changed));
|
||||||
|
|
||||||
|
/* just rebuild the while thing */
|
||||||
|
|
||||||
|
_model->clear ();
|
||||||
|
|
||||||
|
{
|
||||||
|
TreeModel::Row row;
|
||||||
|
row = *(_model->append());
|
||||||
|
row[_columns.is_visible] = true;
|
||||||
|
row[_columns.text] = (_("-all-"));
|
||||||
|
row[_columns.routegroup] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
_session->foreach_route_group (mem_fun (*this, &EditorRouteGroups::add));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorRouteGroups::flags_changed (void* src, RouteGroup* group)
|
||||||
|
{
|
||||||
|
ENSURE_GUI_THREAD (bind (mem_fun(*this, &EditorRouteGroups::flags_changed), src, group));
|
||||||
|
|
||||||
|
_in_row_change = true;
|
||||||
|
|
||||||
|
Gtk::TreeModel::Children children = _model->children();
|
||||||
|
|
||||||
|
for(Gtk::TreeModel::Children::iterator iter = children.begin(); iter != children.end(); ++iter) {
|
||||||
|
if (group == (*iter)[_columns.routegroup]) {
|
||||||
|
(*iter)[_columns.is_visible] = !group->is_hidden();
|
||||||
|
(*iter)[_columns.text] = group->name();
|
||||||
|
(*iter)[_columns.gain] = group->property(RouteGroup::Gain);
|
||||||
|
(*iter)[_columns.record] = group->property(RouteGroup::RecEnable);
|
||||||
|
(*iter)[_columns.mute] = group->property(RouteGroup::Mute);
|
||||||
|
(*iter)[_columns.solo] = group->property(RouteGroup::Solo);
|
||||||
|
(*iter)[_columns.select] = group->property(RouteGroup::Select);
|
||||||
|
(*iter)[_columns.edits] = group->property(RouteGroup::Edit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_in_row_change = false;
|
||||||
|
|
||||||
|
_editor->_group_tabs->set_dirty ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorRouteGroups::name_edit (const Glib::ustring& path, const Glib::ustring& new_text)
|
||||||
|
{
|
||||||
|
RouteGroup* group;
|
||||||
|
TreeIter iter;
|
||||||
|
|
||||||
|
if ((iter = _model->get_iter (path))) {
|
||||||
|
|
||||||
|
if ((group = (*iter)[_columns.routegroup]) == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (new_text != group->name()) {
|
||||||
|
group->set_name (new_text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorRouteGroups::clear ()
|
||||||
|
{
|
||||||
|
_display.set_model (Glib::RefPtr<Gtk::TreeStore> (0));
|
||||||
|
_model->clear ();
|
||||||
|
_display.set_model (_model);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EditorRouteGroups::connect_to_session (Session* s)
|
||||||
|
{
|
||||||
|
EditorComponent::connect_to_session (s);
|
||||||
|
|
||||||
|
_session_connections.push_back (_session->route_group_added.connect (mem_fun (*this, &EditorRouteGroups::add)));
|
||||||
|
_session_connections.push_back (_session->route_group_removed.connect (mem_fun (*this, &EditorRouteGroups::groups_changed)));
|
||||||
|
|
||||||
|
groups_changed ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
77
gtk2_ardour/editor_route_groups.h
Normal file
77
gtk2_ardour/editor_route_groups.h
Normal file
|
|
@ -0,0 +1,77 @@
|
||||||
|
#include "editor_component.h"
|
||||||
|
|
||||||
|
class EditorRouteGroups : public EditorComponent
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
EditorRouteGroups (Editor *);
|
||||||
|
|
||||||
|
void connect_to_session (ARDOUR::Session *);
|
||||||
|
|
||||||
|
Gtk::Widget& widget () {
|
||||||
|
return *_display_packer;
|
||||||
|
}
|
||||||
|
|
||||||
|
Gtk::Menu* menu (ARDOUR::RouteGroup *);
|
||||||
|
|
||||||
|
void clear ();
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
struct Columns : public Gtk::TreeModel::ColumnRecord {
|
||||||
|
|
||||||
|
Columns () {
|
||||||
|
add (is_visible);
|
||||||
|
add (gain);
|
||||||
|
add (record);
|
||||||
|
add (mute);
|
||||||
|
add (solo);
|
||||||
|
add (select);
|
||||||
|
add (edits);
|
||||||
|
add (text);
|
||||||
|
add (routegroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
Gtk::TreeModelColumn<bool> is_visible;
|
||||||
|
Gtk::TreeModelColumn<bool> gain;
|
||||||
|
Gtk::TreeModelColumn<bool> record;
|
||||||
|
Gtk::TreeModelColumn<bool> mute;
|
||||||
|
Gtk::TreeModelColumn<bool> solo;
|
||||||
|
Gtk::TreeModelColumn<bool> select;
|
||||||
|
Gtk::TreeModelColumn<bool> edits;
|
||||||
|
Gtk::TreeModelColumn<std::string> text;
|
||||||
|
Gtk::TreeModelColumn<ARDOUR::RouteGroup*> routegroup;
|
||||||
|
};
|
||||||
|
|
||||||
|
Columns _columns;
|
||||||
|
|
||||||
|
void activate_all ();
|
||||||
|
void disable_all ();
|
||||||
|
void subgroup (ARDOUR::RouteGroup*);
|
||||||
|
void unsubgroup (ARDOUR::RouteGroup*);
|
||||||
|
|
||||||
|
void row_change (const Gtk::TreeModel::Path&,const Gtk::TreeModel::iterator&);
|
||||||
|
void name_edit (const Glib::ustring&, const Glib::ustring&);
|
||||||
|
void new_route_group ();
|
||||||
|
void new_from_selection ();
|
||||||
|
void new_from_rec_enabled ();
|
||||||
|
void new_from_soloed ();
|
||||||
|
void edit (ARDOUR::RouteGroup *);
|
||||||
|
void button_clicked ();
|
||||||
|
gint button_press_event (GdkEventButton* ev);
|
||||||
|
void add (ARDOUR::RouteGroup* group);
|
||||||
|
void remove_route_group ();
|
||||||
|
void groups_changed ();
|
||||||
|
void flags_changed (void*, ARDOUR::RouteGroup*);
|
||||||
|
void set_activation (ARDOUR::RouteGroup *, bool);
|
||||||
|
void remove_selected ();
|
||||||
|
|
||||||
|
Gtk::Menu* _menu;
|
||||||
|
Glib::RefPtr<Gtk::ListStore> _model;
|
||||||
|
Glib::RefPtr<Gtk::TreeSelection> _selection;
|
||||||
|
Gtk::TreeView _display;
|
||||||
|
Gtk::ScrolledWindow _scroller;
|
||||||
|
Gtk::VBox* _display_packer;
|
||||||
|
bool _in_row_change;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
#include "actions.h"
|
#include "actions.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "editor_group_tabs.h"
|
#include "editor_group_tabs.h"
|
||||||
#include "editor_route_list.h"
|
#include "editor_routes.h"
|
||||||
|
|
||||||
#include "pbd/unknown_type.h"
|
#include "pbd/unknown_type.h"
|
||||||
|
|
||||||
|
|
@ -54,8 +54,8 @@ using namespace Gtk;
|
||||||
using namespace Gtkmm2ext;
|
using namespace Gtkmm2ext;
|
||||||
using namespace Glib;
|
using namespace Glib;
|
||||||
|
|
||||||
EditorRouteList::EditorRouteList (Editor* e)
|
EditorRoutes::EditorRoutes (Editor* e)
|
||||||
: _editor (e),
|
: EditorComponent (e),
|
||||||
_ignore_reorder (false),
|
_ignore_reorder (false),
|
||||||
_no_redisplay (false),
|
_no_redisplay (false),
|
||||||
_redisplay_does_not_sync_order_keys (false),
|
_redisplay_does_not_sync_order_keys (false),
|
||||||
|
|
@ -73,7 +73,7 @@ EditorRouteList::EditorRouteList (Editor* e)
|
||||||
rec_col_renderer->set_active_pixbuf (::get_icon("record_normal_red"));
|
rec_col_renderer->set_active_pixbuf (::get_icon("record_normal_red"));
|
||||||
rec_col_renderer->set_inactive_pixbuf (::get_icon("record_disabled_grey"));
|
rec_col_renderer->set_inactive_pixbuf (::get_icon("record_disabled_grey"));
|
||||||
|
|
||||||
rec_col_renderer->signal_toggled().connect (mem_fun (*this, &EditorRouteList::on_tv_rec_enable_toggled));
|
rec_col_renderer->signal_toggled().connect (mem_fun (*this, &EditorRoutes::on_tv_rec_enable_toggled));
|
||||||
|
|
||||||
Gtk::TreeViewColumn* rec_state_column = manage (new TreeViewColumn("Rec", *rec_col_renderer));
|
Gtk::TreeViewColumn* rec_state_column = manage (new TreeViewColumn("Rec", *rec_col_renderer));
|
||||||
rec_state_column->add_attribute(rec_col_renderer->property_active(), _columns.rec_enabled);
|
rec_state_column->add_attribute(rec_col_renderer->property_active(), _columns.rec_enabled);
|
||||||
|
|
@ -100,16 +100,16 @@ EditorRouteList::EditorRouteList (Editor* e)
|
||||||
visible_cell->property_activatable() = true;
|
visible_cell->property_activatable() = true;
|
||||||
visible_cell->property_radio() = false;
|
visible_cell->property_radio() = false;
|
||||||
|
|
||||||
_model->signal_row_deleted().connect (mem_fun (*this, &EditorRouteList::route_deleted));
|
_model->signal_row_deleted().connect (mem_fun (*this, &EditorRoutes::route_deleted));
|
||||||
_model->signal_row_changed().connect (mem_fun (*this, &EditorRouteList::changed));
|
_model->signal_row_changed().connect (mem_fun (*this, &EditorRoutes::changed));
|
||||||
_model->signal_rows_reordered().connect (mem_fun (*this, &EditorRouteList::reordered));
|
_model->signal_rows_reordered().connect (mem_fun (*this, &EditorRoutes::reordered));
|
||||||
_display.signal_button_press_event().connect (mem_fun (*this, &EditorRouteList::button_press), false);
|
_display.signal_button_press_event().connect (mem_fun (*this, &EditorRoutes::button_press), false);
|
||||||
|
|
||||||
Route::SyncOrderKeys.connect (mem_fun (*this, &EditorRouteList::sync_order_keys));
|
Route::SyncOrderKeys.connect (mem_fun (*this, &EditorRoutes::sync_order_keys));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::on_tv_rec_enable_toggled (Glib::ustring const & path_string)
|
EditorRoutes::on_tv_rec_enable_toggled (Glib::ustring const & path_string)
|
||||||
{
|
{
|
||||||
// Get the model row that has been toggled.
|
// Get the model row that has been toggled.
|
||||||
Gtk::TreeModel::Row row = *_model->get_iter (Gtk::TreeModel::Path (path_string));
|
Gtk::TreeModel::Row row = *_model->get_iter (Gtk::TreeModel::Path (path_string));
|
||||||
|
|
@ -123,7 +123,7 @@ EditorRouteList::on_tv_rec_enable_toggled (Glib::ustring const & path_string)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::build_menu ()
|
EditorRoutes::build_menu ()
|
||||||
{
|
{
|
||||||
using namespace Menu_Helpers;
|
using namespace Menu_Helpers;
|
||||||
using namespace Gtk;
|
using namespace Gtk;
|
||||||
|
|
@ -133,17 +133,17 @@ EditorRouteList::build_menu ()
|
||||||
MenuList& items = _menu->items();
|
MenuList& items = _menu->items();
|
||||||
_menu->set_name ("ArdourContextMenu");
|
_menu->set_name ("ArdourContextMenu");
|
||||||
|
|
||||||
items.push_back (MenuElem (_("Show All"), mem_fun (*this, &EditorRouteList::show_all_routes)));
|
items.push_back (MenuElem (_("Show All"), mem_fun (*this, &EditorRoutes::show_all_routes)));
|
||||||
items.push_back (MenuElem (_("Hide All"), mem_fun (*this, &EditorRouteList::hide_all_routes)));
|
items.push_back (MenuElem (_("Hide All"), mem_fun (*this, &EditorRoutes::hide_all_routes)));
|
||||||
items.push_back (MenuElem (_("Show All Audio Tracks"), mem_fun (*this, &EditorRouteList::show_all_audiotracks)));
|
items.push_back (MenuElem (_("Show All Audio Tracks"), mem_fun (*this, &EditorRoutes::show_all_audiotracks)));
|
||||||
items.push_back (MenuElem (_("Hide All Audio Tracks"), mem_fun (*this, &EditorRouteList::hide_all_audiotracks)));
|
items.push_back (MenuElem (_("Hide All Audio Tracks"), mem_fun (*this, &EditorRoutes::hide_all_audiotracks)));
|
||||||
items.push_back (MenuElem (_("Show All Audio Busses"), mem_fun (*this, &EditorRouteList::show_all_audiobus)));
|
items.push_back (MenuElem (_("Show All Audio Busses"), mem_fun (*this, &EditorRoutes::show_all_audiobus)));
|
||||||
items.push_back (MenuElem (_("Hide All Audio Busses"), mem_fun (*this, &EditorRouteList::hide_all_audiobus)));
|
items.push_back (MenuElem (_("Hide All Audio Busses"), mem_fun (*this, &EditorRoutes::hide_all_audiobus)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::show_menu ()
|
EditorRoutes::show_menu ()
|
||||||
{
|
{
|
||||||
if (_menu == 0) {
|
if (_menu == 0) {
|
||||||
build_menu ();
|
build_menu ();
|
||||||
|
|
@ -155,7 +155,7 @@ EditorRouteList::show_menu ()
|
||||||
const char* _order_key = N_("editor");
|
const char* _order_key = N_("editor");
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::redisplay ()
|
EditorRoutes::redisplay ()
|
||||||
{
|
{
|
||||||
TreeModel::Children rows = _model->children();
|
TreeModel::Children rows = _model->children();
|
||||||
TreeModel::Children::iterator i;
|
TreeModel::Children::iterator i;
|
||||||
|
|
@ -204,7 +204,7 @@ EditorRouteList::redisplay ()
|
||||||
the track order and has caused a redisplay of the list.
|
the track order and has caused a redisplay of the list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Glib::signal_idle().connect (mem_fun (*_editor, &Editor::sync_track_view_list_and_route_list));
|
Glib::signal_idle().connect (mem_fun (*_editor, &Editor::sync_track_view_list_and_routes));
|
||||||
|
|
||||||
_editor->full_canvas_height = position + _editor->canvas_timebars_vsize;
|
_editor->full_canvas_height = position + _editor->canvas_timebars_vsize;
|
||||||
_editor->vertical_adjustment.set_upper (_editor->full_canvas_height);
|
_editor->vertical_adjustment.set_upper (_editor->full_canvas_height);
|
||||||
|
|
@ -223,7 +223,7 @@ EditorRouteList::redisplay ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::route_deleted (Gtk::TreeModel::Path const & path)
|
EditorRoutes::route_deleted (Gtk::TreeModel::Path const & path)
|
||||||
{
|
{
|
||||||
/* this could require an order reset & sync */
|
/* this could require an order reset & sync */
|
||||||
_editor->current_session()->set_remote_control_ids();
|
_editor->current_session()->set_remote_control_ids();
|
||||||
|
|
@ -234,7 +234,7 @@ EditorRouteList::route_deleted (Gtk::TreeModel::Path const & path)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::changed (Gtk::TreeModel::Path const & path, Gtk::TreeModel::iterator const & iter)
|
EditorRoutes::changed (Gtk::TreeModel::Path const & path, Gtk::TreeModel::iterator const & iter)
|
||||||
{
|
{
|
||||||
/* never reset order keys because of a property change */
|
/* never reset order keys because of a property change */
|
||||||
_redisplay_does_not_reset_order_keys = true;
|
_redisplay_does_not_reset_order_keys = true;
|
||||||
|
|
@ -244,7 +244,7 @@ EditorRouteList::changed (Gtk::TreeModel::Path const & path, Gtk::TreeModel::ite
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::routes_added (list<RouteTimeAxisView*> routes)
|
EditorRoutes::routes_added (list<RouteTimeAxisView*> routes)
|
||||||
{
|
{
|
||||||
TreeModel::Row row;
|
TreeModel::Row row;
|
||||||
|
|
||||||
|
|
@ -271,13 +271,13 @@ EditorRouteList::routes_added (list<RouteTimeAxisView*> routes)
|
||||||
_ignore_reorder = false;
|
_ignore_reorder = false;
|
||||||
|
|
||||||
boost::weak_ptr<Route> wr ((*x)->route());
|
boost::weak_ptr<Route> wr ((*x)->route());
|
||||||
(*x)->route()->gui_changed.connect (mem_fun (*this, &EditorRouteList::handle_gui_changes));
|
(*x)->route()->gui_changed.connect (mem_fun (*this, &EditorRoutes::handle_gui_changes));
|
||||||
(*x)->route()->NameChanged.connect (bind (mem_fun (*this, &EditorRouteList::route_name_changed), wr));
|
(*x)->route()->NameChanged.connect (bind (mem_fun (*this, &EditorRoutes::route_name_changed), wr));
|
||||||
(*x)->GoingAway.connect (bind (mem_fun (*this, &EditorRouteList::route_removed), *x));
|
(*x)->GoingAway.connect (bind (mem_fun (*this, &EditorRoutes::route_removed), *x));
|
||||||
|
|
||||||
if ((*x)->is_track()) {
|
if ((*x)->is_track()) {
|
||||||
boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track> ((*x)->route());
|
boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track> ((*x)->route());
|
||||||
t->diskstream()->RecordEnableChanged.connect (mem_fun (*this, &EditorRouteList::update_rec_display));
|
t->diskstream()->RecordEnableChanged.connect (mem_fun (*this, &EditorRoutes::update_rec_display));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -286,9 +286,9 @@ EditorRouteList::routes_added (list<RouteTimeAxisView*> routes)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::handle_gui_changes (string const & what, void *src)
|
EditorRoutes::handle_gui_changes (string const & what, void *src)
|
||||||
{
|
{
|
||||||
ENSURE_GUI_THREAD (bind (mem_fun(*this, &EditorRouteList::handle_gui_changes), what, src));
|
ENSURE_GUI_THREAD (bind (mem_fun(*this, &EditorRoutes::handle_gui_changes), what, src));
|
||||||
|
|
||||||
if (what == "track_height") {
|
if (what == "track_height") {
|
||||||
/* Optional :make tracks change height while it happens, instead
|
/* Optional :make tracks change height while it happens, instead
|
||||||
|
|
@ -304,9 +304,9 @@ EditorRouteList::handle_gui_changes (string const & what, void *src)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::route_removed (TimeAxisView *tv)
|
EditorRoutes::route_removed (TimeAxisView *tv)
|
||||||
{
|
{
|
||||||
ENSURE_GUI_THREAD (bind (mem_fun(*this, &EditorRouteList::route_removed), tv));
|
ENSURE_GUI_THREAD (bind (mem_fun(*this, &EditorRoutes::route_removed), tv));
|
||||||
|
|
||||||
TreeModel::Children rows = _model->children();
|
TreeModel::Children rows = _model->children();
|
||||||
TreeModel::Children::iterator ri;
|
TreeModel::Children::iterator ri;
|
||||||
|
|
@ -328,9 +328,9 @@ EditorRouteList::route_removed (TimeAxisView *tv)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::route_name_changed (boost::weak_ptr<Route> r)
|
EditorRoutes::route_name_changed (boost::weak_ptr<Route> r)
|
||||||
{
|
{
|
||||||
ENSURE_GUI_THREAD (bind (mem_fun (*this, &EditorRouteList::route_name_changed), r));
|
ENSURE_GUI_THREAD (bind (mem_fun (*this, &EditorRoutes::route_name_changed), r));
|
||||||
|
|
||||||
boost::shared_ptr<Route> route = r.lock ();
|
boost::shared_ptr<Route> route = r.lock ();
|
||||||
if (!route) {
|
if (!route) {
|
||||||
|
|
@ -350,7 +350,7 @@ EditorRouteList::route_name_changed (boost::weak_ptr<Route> r)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::update_visibility ()
|
EditorRoutes::update_visibility ()
|
||||||
{
|
{
|
||||||
TreeModel::Children rows = _model->children();
|
TreeModel::Children rows = _model->children();
|
||||||
TreeModel::Children::iterator i;
|
TreeModel::Children::iterator i;
|
||||||
|
|
@ -367,7 +367,7 @@ EditorRouteList::update_visibility ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::hide_track_in_display (TimeAxisView& tv)
|
EditorRoutes::hide_track_in_display (TimeAxisView& tv)
|
||||||
{
|
{
|
||||||
TreeModel::Children rows = _model->children();
|
TreeModel::Children rows = _model->children();
|
||||||
TreeModel::Children::iterator i;
|
TreeModel::Children::iterator i;
|
||||||
|
|
@ -381,7 +381,7 @@ EditorRouteList::hide_track_in_display (TimeAxisView& tv)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::show_track_in_display (TimeAxisView& tv)
|
EditorRoutes::show_track_in_display (TimeAxisView& tv)
|
||||||
{
|
{
|
||||||
TreeModel::Children rows = _model->children();
|
TreeModel::Children rows = _model->children();
|
||||||
TreeModel::Children::iterator i;
|
TreeModel::Children::iterator i;
|
||||||
|
|
@ -395,14 +395,14 @@ EditorRouteList::show_track_in_display (TimeAxisView& tv)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::reordered (TreeModel::Path const & path, TreeModel::iterator const & iter, int* what)
|
EditorRoutes::reordered (TreeModel::Path const & path, TreeModel::iterator const & iter, int* what)
|
||||||
{
|
{
|
||||||
redisplay ();
|
redisplay ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::sync_order_keys (char const * src)
|
EditorRoutes::sync_order_keys (char const * src)
|
||||||
{
|
{
|
||||||
vector<int> neworder;
|
vector<int> neworder;
|
||||||
TreeModel::Children rows = _model->children();
|
TreeModel::Children rows = _model->children();
|
||||||
|
|
@ -443,7 +443,7 @@ EditorRouteList::sync_order_keys (char const * src)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::hide_all_tracks (bool with_select)
|
EditorRoutes::hide_all_tracks (bool with_select)
|
||||||
{
|
{
|
||||||
TreeModel::Children rows = _model->children();
|
TreeModel::Children rows = _model->children();
|
||||||
TreeModel::Children::iterator i;
|
TreeModel::Children::iterator i;
|
||||||
|
|
@ -472,7 +472,7 @@ EditorRouteList::hide_all_tracks (bool with_select)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::set_all_tracks_visibility (bool yn)
|
EditorRoutes::set_all_tracks_visibility (bool yn)
|
||||||
{
|
{
|
||||||
TreeModel::Children rows = _model->children();
|
TreeModel::Children rows = _model->children();
|
||||||
TreeModel::Children::iterator i;
|
TreeModel::Children::iterator i;
|
||||||
|
|
@ -495,7 +495,7 @@ EditorRouteList::set_all_tracks_visibility (bool yn)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::set_all_audio_visibility (int tracks, bool yn)
|
EditorRoutes::set_all_audio_visibility (int tracks, bool yn)
|
||||||
{
|
{
|
||||||
TreeModel::Children rows = _model->children();
|
TreeModel::Children rows = _model->children();
|
||||||
TreeModel::Children::iterator i;
|
TreeModel::Children::iterator i;
|
||||||
|
|
@ -536,41 +536,41 @@ EditorRouteList::set_all_audio_visibility (int tracks, bool yn)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::hide_all_routes ()
|
EditorRoutes::hide_all_routes ()
|
||||||
{
|
{
|
||||||
set_all_tracks_visibility (false);
|
set_all_tracks_visibility (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::show_all_routes ()
|
EditorRoutes::show_all_routes ()
|
||||||
{
|
{
|
||||||
set_all_tracks_visibility (true);
|
set_all_tracks_visibility (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::show_all_audiobus ()
|
EditorRoutes::show_all_audiobus ()
|
||||||
{
|
{
|
||||||
set_all_audio_visibility (2, true);
|
set_all_audio_visibility (2, true);
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
EditorRouteList::hide_all_audiobus ()
|
EditorRoutes::hide_all_audiobus ()
|
||||||
{
|
{
|
||||||
set_all_audio_visibility (2, false);
|
set_all_audio_visibility (2, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::show_all_audiotracks()
|
EditorRoutes::show_all_audiotracks()
|
||||||
{
|
{
|
||||||
set_all_audio_visibility (1, true);
|
set_all_audio_visibility (1, true);
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
EditorRouteList::hide_all_audiotracks ()
|
EditorRoutes::hide_all_audiotracks ()
|
||||||
{
|
{
|
||||||
set_all_audio_visibility (1, false);
|
set_all_audio_visibility (1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
EditorRouteList::button_press (GdkEventButton* ev)
|
EditorRoutes::button_press (GdkEventButton* ev)
|
||||||
{
|
{
|
||||||
if (Keyboard::is_context_menu_event (ev)) {
|
if (Keyboard::is_context_menu_event (ev)) {
|
||||||
show_menu ();
|
show_menu ();
|
||||||
|
|
@ -614,7 +614,7 @@ EditorRouteList::button_press (GdkEventButton* ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
EditorRouteList::selection_filter (Glib::RefPtr<TreeModel> const &, TreeModel::Path const &, bool)
|
EditorRoutes::selection_filter (Glib::RefPtr<TreeModel> const &, TreeModel::Path const &, bool)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -627,7 +627,7 @@ struct EditorOrderRouteSorter {
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::initial_display ()
|
EditorRoutes::initial_display ()
|
||||||
{
|
{
|
||||||
boost::shared_ptr<RouteList> routes = _editor->current_session()->get_routes();
|
boost::shared_ptr<RouteList> routes = _editor->current_session()->get_routes();
|
||||||
RouteList r (*routes);
|
RouteList r (*routes);
|
||||||
|
|
@ -668,7 +668,7 @@ EditorRouteList::initial_display ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::track_list_reorder (Gtk::TreeModel::Path const & path, Gtk::TreeModel::iterator const & iter, int* new_order)
|
EditorRoutes::track_list_reorder (Gtk::TreeModel::Path const & path, Gtk::TreeModel::iterator const & iter, int* new_order)
|
||||||
{
|
{
|
||||||
_redisplay_does_not_sync_order_keys = true;
|
_redisplay_does_not_sync_order_keys = true;
|
||||||
_editor->current_session()->set_remote_control_ids();
|
_editor->current_session()->set_remote_control_ids();
|
||||||
|
|
@ -677,7 +677,7 @@ EditorRouteList::track_list_reorder (Gtk::TreeModel::Path const & path, Gtk::Tre
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::display_drag_data_received (const RefPtr<Gdk::DragContext>& context,
|
EditorRoutes::display_drag_data_received (const RefPtr<Gdk::DragContext>& context,
|
||||||
int x, int y,
|
int x, int y,
|
||||||
const SelectionData& data,
|
const SelectionData& data,
|
||||||
guint info, guint time)
|
guint info, guint time)
|
||||||
|
|
@ -691,7 +691,7 @@ EditorRouteList::display_drag_data_received (const RefPtr<Gdk::DragContext>& con
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::move_selected_tracks (bool up)
|
EditorRoutes::move_selected_tracks (bool up)
|
||||||
{
|
{
|
||||||
if (_editor->selection->tracks.empty()) {
|
if (_editor->selection->tracks.empty()) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -803,7 +803,7 @@ EditorRouteList::move_selected_tracks (bool up)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::update_rec_display ()
|
EditorRoutes::update_rec_display ()
|
||||||
{
|
{
|
||||||
TreeModel::Children rows = _model->children();
|
TreeModel::Children rows = _model->children();
|
||||||
TreeModel::Children::iterator i;
|
TreeModel::Children::iterator i;
|
||||||
|
|
@ -823,7 +823,7 @@ EditorRouteList::update_rec_display ()
|
||||||
}
|
}
|
||||||
|
|
||||||
list<TimeAxisView*>
|
list<TimeAxisView*>
|
||||||
EditorRouteList::views () const
|
EditorRoutes::views () const
|
||||||
{
|
{
|
||||||
list<TimeAxisView*> v;
|
list<TimeAxisView*> v;
|
||||||
for (TreeModel::Children::iterator i = _model->children().begin(); i != _model->children().end(); ++i) {
|
for (TreeModel::Children::iterator i = _model->children().begin(); i != _model->children().end(); ++i) {
|
||||||
|
|
@ -834,7 +834,7 @@ EditorRouteList::views () const
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRouteList::clear ()
|
EditorRoutes::clear ()
|
||||||
{
|
{
|
||||||
_display.set_model (Glib::RefPtr<Gtk::TreeStore> (0));
|
_display.set_model (Glib::RefPtr<Gtk::TreeStore> (0));
|
||||||
_model->clear ();
|
_model->clear ();
|
||||||
|
|
@ -17,10 +17,10 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class EditorRouteList
|
class EditorRoutes : public EditorComponent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EditorRouteList (Editor *);
|
EditorRoutes (Editor *);
|
||||||
|
|
||||||
Gtk::Widget& widget () {
|
Gtk::Widget& widget () {
|
||||||
return _scroller;
|
return _scroller;
|
||||||
|
|
@ -89,7 +89,6 @@ private:
|
||||||
Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> > route;
|
Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> > route;
|
||||||
};
|
};
|
||||||
|
|
||||||
Editor* _editor;
|
|
||||||
Gtk::ScrolledWindow _scroller;
|
Gtk::ScrolledWindow _scroller;
|
||||||
Gtkmm2ext::DnDTreeView<boost::shared_ptr<ARDOUR::Route> > _display;
|
Gtkmm2ext::DnDTreeView<boost::shared_ptr<ARDOUR::Route> > _display;
|
||||||
Glib::RefPtr<Gtk::ListStore> _model;
|
Glib::RefPtr<Gtk::ListStore> _model;
|
||||||
|
|
@ -35,8 +35,7 @@ using namespace ARDOUR;
|
||||||
* @param e Editor to represent.
|
* @param e Editor to represent.
|
||||||
*/
|
*/
|
||||||
EditorSummary::EditorSummary (Editor* e)
|
EditorSummary::EditorSummary (Editor* e)
|
||||||
: _editor (e),
|
: EditorComponent (e),
|
||||||
_session (0),
|
|
||||||
_x_scale (1),
|
_x_scale (1),
|
||||||
_y_scale (1),
|
_y_scale (1),
|
||||||
_last_playhead (-1),
|
_last_playhead (-1),
|
||||||
|
|
@ -48,19 +47,19 @@ EditorSummary::EditorSummary (Editor* e)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Set the session.
|
/** Connect to a session.
|
||||||
* @param s Session.
|
* @param s Session.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
EditorSummary::set_session (Session* s)
|
EditorSummary::connect_to_session (Session* s)
|
||||||
{
|
{
|
||||||
_session = s;
|
EditorComponent::connect_to_session (s);
|
||||||
|
|
||||||
Region::RegionPropertyChanged.connect (sigc::hide (mem_fun (*this, &EditorSummary::set_dirty)));
|
Region::RegionPropertyChanged.connect (sigc::hide (mem_fun (*this, &EditorSummary::set_dirty)));
|
||||||
|
|
||||||
_session->RegionRemoved.connect (sigc::hide (mem_fun (*this, &EditorSummary::set_dirty)));
|
_session_connections.push_back (_session->RegionRemoved.connect (sigc::hide (mem_fun (*this, &EditorSummary::set_dirty))));
|
||||||
_session->EndTimeChanged.connect (mem_fun (*this, &EditorSummary::set_dirty));
|
_session_connections.push_back (_session->EndTimeChanged.connect (mem_fun (*this, &EditorSummary::set_dirty)));
|
||||||
_session->StartTimeChanged.connect (mem_fun (*this, &EditorSummary::set_dirty));
|
_session_connections.push_back (_session->StartTimeChanged.connect (mem_fun (*this, &EditorSummary::set_dirty)));
|
||||||
_editor->playhead_cursor->PositionChanged.connect (mem_fun (*this, &EditorSummary::playhead_position_changed));
|
_editor->playhead_cursor->PositionChanged.connect (mem_fun (*this, &EditorSummary::playhead_position_changed));
|
||||||
|
|
||||||
set_dirty ();
|
set_dirty ();
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
#define __gtk_ardour_editor_summary_h__
|
#define __gtk_ardour_editor_summary_h__
|
||||||
|
|
||||||
#include "cairo_widget.h"
|
#include "cairo_widget.h"
|
||||||
|
#include "editor_component.h"
|
||||||
|
|
||||||
namespace ARDOUR {
|
namespace ARDOUR {
|
||||||
class Session;
|
class Session;
|
||||||
|
|
@ -31,12 +32,12 @@ class Editor;
|
||||||
/** Class to provide a visual summary of the contents of an editor window; represents
|
/** Class to provide a visual summary of the contents of an editor window; represents
|
||||||
* the whole session as a set of lines, one per region view.
|
* the whole session as a set of lines, one per region view.
|
||||||
*/
|
*/
|
||||||
class EditorSummary : public CairoWidget
|
class EditorSummary : public CairoWidget, public EditorComponent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EditorSummary (Editor *);
|
EditorSummary (Editor *);
|
||||||
|
|
||||||
void set_session (ARDOUR::Session *);
|
void connect_to_session (ARDOUR::Session *);
|
||||||
void set_overlays_dirty ();
|
void set_overlays_dirty ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
@ -54,8 +55,6 @@ private:
|
||||||
void set_editor (std::pair<double, double> const &, std::pair<double, double> const &);
|
void set_editor (std::pair<double, double> const &, std::pair<double, double> const &);
|
||||||
void playhead_position_changed (nframes64_t);
|
void playhead_position_changed (nframes64_t);
|
||||||
|
|
||||||
Editor* _editor; ///< our editor
|
|
||||||
ARDOUR::Session* _session; ///< our session
|
|
||||||
double _x_scale; ///< pixels per frame for the x axis of the pixmap
|
double _x_scale; ///< pixels per frame for the x axis of the pixmap
|
||||||
double _y_scale;
|
double _y_scale;
|
||||||
double _last_playhead;
|
double _last_playhead;
|
||||||
|
|
|
||||||
|
|
@ -29,18 +29,19 @@ using namespace std;
|
||||||
using namespace Gtk;
|
using namespace Gtk;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
|
|
||||||
GroupTabs::GroupTabs ()
|
GroupTabs::GroupTabs (Editor* e)
|
||||||
: _session (0),
|
: EditorComponent (e),
|
||||||
_dragging (0)
|
_dragging (0)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
GroupTabs::set_session (Session* s)
|
GroupTabs::connect_to_session (Session* s)
|
||||||
{
|
{
|
||||||
_session = s;
|
EditorComponent::connect_to_session (s);
|
||||||
s->RouteGroupChanged.connect (mem_fun (*this, &GroupTabs::set_dirty));
|
|
||||||
|
_session_connections.push_back (_session->RouteGroupChanged.connect (mem_fun (*this, &GroupTabs::set_dirty)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <gtkmm/menu.h>
|
#include <gtkmm/menu.h>
|
||||||
|
#include "editor_component.h"
|
||||||
#include "cairo_widget.h"
|
#include "cairo_widget.h"
|
||||||
|
|
||||||
namespace ARDOUR {
|
namespace ARDOUR {
|
||||||
|
|
@ -30,12 +31,12 @@ class Editor;
|
||||||
/** Parent class for tabs which represent route groups as coloured tabs;
|
/** Parent class for tabs which represent route groups as coloured tabs;
|
||||||
* Currently used on the left-hand side of the editor and at the top of the mixer.
|
* Currently used on the left-hand side of the editor and at the top of the mixer.
|
||||||
*/
|
*/
|
||||||
class GroupTabs : public CairoWidget
|
class GroupTabs : public CairoWidget, public EditorComponent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GroupTabs ();
|
GroupTabs (Editor *);
|
||||||
|
|
||||||
void set_session (ARDOUR::Session *);
|
void connect_to_session (ARDOUR::Session *);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
@ -48,8 +49,6 @@ protected:
|
||||||
double last_ui_size; ///< GUI size of the last route in the group
|
double last_ui_size; ///< GUI size of the last route in the group
|
||||||
};
|
};
|
||||||
|
|
||||||
ARDOUR::Session* _session; ///< our session
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** Compute all the tabs for this widget.
|
/** Compute all the tabs for this widget.
|
||||||
* @return Tabs.
|
* @return Tabs.
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,8 @@ using namespace Gtk;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
|
|
||||||
MixerGroupTabs::MixerGroupTabs (Mixer_UI* m)
|
MixerGroupTabs::MixerGroupTabs (Mixer_UI* m)
|
||||||
: _mixer (m),
|
: GroupTabs (0),
|
||||||
|
_mixer (m),
|
||||||
_menu (0)
|
_menu (0)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -486,7 +486,7 @@ Mixer_UI::connect_to_session (Session* sess)
|
||||||
show_window();
|
show_window();
|
||||||
}
|
}
|
||||||
|
|
||||||
_group_tabs->set_session (sess);
|
_group_tabs->connect_to_session (sess);
|
||||||
|
|
||||||
start_updating ();
|
start_updating ();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -103,9 +103,10 @@ def build(bld):
|
||||||
editor_audiotrack.cc
|
editor_audiotrack.cc
|
||||||
editor_canvas.cc
|
editor_canvas.cc
|
||||||
editor_canvas_events.cc
|
editor_canvas_events.cc
|
||||||
|
editor_component.cc
|
||||||
editor_cursors.cc
|
editor_cursors.cc
|
||||||
editor_drag.cc
|
editor_drag.cc
|
||||||
editor_edit_groups.cc
|
editor_route_groups.cc
|
||||||
editor_export_audio.cc
|
editor_export_audio.cc
|
||||||
editor_group_tabs.cc
|
editor_group_tabs.cc
|
||||||
editor_hscroller.cc
|
editor_hscroller.cc
|
||||||
|
|
@ -117,7 +118,7 @@ def build(bld):
|
||||||
editor_nudge.cc
|
editor_nudge.cc
|
||||||
editor_ops.cc
|
editor_ops.cc
|
||||||
editor_region_list.cc
|
editor_region_list.cc
|
||||||
editor_route_list.cc
|
editor_routes.cc
|
||||||
editor_rulers.cc
|
editor_rulers.cc
|
||||||
editor_scrub.cc
|
editor_scrub.cc
|
||||||
editor_selection.cc
|
editor_selection.cc
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue