#include "fix_carbon.h"
+#include <gtkmm/stock.h>
+
#include "gtkmm2ext/gtk_ui.h"
#include "gtkmm2ext/cell_renderer_color_selector.h"
+#include "widgets/tooltips.h"
+
#include "ardour/route_group.h"
#include "ardour/route.h"
#include "ardour/session.h"
#include "gui_thread.h"
#include "keyboard.h"
#include "marker.h"
-#include "prompter.h"
#include "route_group_dialog.h"
#include "route_time_axis.h"
#include "time_axis_view.h"
#include "utils.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace std;
using namespace ARDOUR;
using namespace ARDOUR_UI_UTILS;
+using namespace ArdourWidgets;
using namespace PBD;
using namespace Gtk;
using Gtkmm2ext::Keyboard;
struct ColumnInfo {
- int index;
- const char* label;
- const char* tooltip;
+ int index;
+ const char* label;
+ const char* tooltip;
};
EditorRouteGroups::EditorRouteGroups (Editor* e)
TreeViewColumn* color_column = manage (new TreeViewColumn ("", *color_renderer));
color_column->add_attribute (color_renderer->property_color(), _columns.gdkcolor);
-
+
_display.append_column (*color_column);
_display.append_column ("", _columns.text);
Gtk::Label* l;
ColumnInfo ci[] = {
- { 0, _("Col"), _("Group Tab Color") },
- { 1, _("Name"), _("Name of Group") },
- { 2, _("V"), _("Group is visible?") },
- { 3, _("On"), _("Group is enabled?") },
- { 4, S_("group|G"), _("Sharing Gain?") },
- { 5, S_("relative|Rel"), _("Relative Gain Changes?") },
- { 6, S_("mute|M"), _("Sharing Mute?") },
- { 7, S_("solo|S"), _("Sharing Solo?") },
- { 8, _("Rec"), _("Sharing Record-enable Status?") },
- { 9, S_("monitoring|Mon"), _("Sharing Monitoring Choice?") },
- { 10, S_("selection|Sel"), _("Sharing Selected/Editing Status?") },
- { 11, S_("active|A"), _("Sharing Active Status?") },
+ { 0, _("Col"), _("Group Tab Color") },
+ { 1, _("Name"), _("Name of Group") },
+ { 2, S_("Visible|V"), _("Group is visible?") },
+ { 3, _("On"), _("Group is enabled?") },
+ { 4, S_("Group|G"), _("Sharing Gain?") },
+ { 5, S_("Relative|Rel"), _("Relative Gain Changes?") },
+ { 6, S_("Mute|M"), _("Sharing Mute?") },
+ { 7, S_("Solo|S"), _("Sharing Solo?") },
+ { 8, _("Rec"), _("Sharing Record-enable Status?") },
+ { 9, S_("Monitoring|Mon"), _("Sharing Monitoring Choice?") },
+ { 10, S_("Selection|Sel"), _("Sharing Selected/Editing Status?") },
+ { 11, S_("Active|A"), _("Sharing Active Status?") },
{ -1, 0, 0 }
};
for (int i = 0; ci[i].index >= 0; ++i) {
col = _display.get_column (ci[i].index);
l = manage (new Label (ci[i].label));
- ARDOUR_UI::instance()->set_tip (*l, ci[i].tooltip);
+ set_tooltip (*l, ci[i].tooltip);
col->set_widget (*l);
l->show ();
CellRendererText* name_cell = dynamic_cast<CellRendererText*>(_display.get_column_cell_renderer (1));
name_cell->property_editable() = true;
name_cell->signal_edited().connect (sigc::mem_fun (*this, &EditorRouteGroups::name_edit));
-
+
for (int i = 1; ci[i].index >= 0; ++i) {
CellRendererToggle* active_cell = dynamic_cast <CellRendererToggle*> (_display.get_column_cell_renderer (i));
if (iter) {
group = (*iter)[_columns.routegroup];
- }
+ }
if (Keyboard::is_context_menu_event (ev)) {
_editor->_group_tabs->get_menu(group)->popup (1, ev->time);
return true;
- }
+ }
if (!p) {
/* cancel selection */
group = (*iter)[_columns.routegroup];
switch (GPOINTER_TO_UINT (column->get_data (X_("colnum")))) {
- case 0:
+ case 0:
c = (*iter)[_columns.gdkcolor];
color_dialog.get_colorsel()->set_previous_color (c);
color_dialog.get_colorsel()->set_current_color (c);
case RESPONSE_ACCEPT:
c = color_dialog.get_colorsel()->get_current_color();
GroupTabs::set_group_color (group, gdk_color_to_rgba (c));
- ARDOUR_UI::config()->set_dirty ();
break;
-
+
default:
break;
-
+
}
color_dialog.hide ();
ret = true;
break;
-
+
case 3:
val = (*iter)[_columns.active_state];
group->set_active (!val, this);
plist.add (Properties::name, string ((*iter)[_columns.text]));
bool val = (*iter)[_columns.gain];
- plist.add (Properties::gain, val);
+ plist.add (Properties::group_gain, val);
val = (*iter)[_columns.gain_relative];
- plist.add (Properties::relative, val);
+ plist.add (Properties::group_relative, val);
val = (*iter)[_columns.mute];
- plist.add (Properties::mute, val);
+ plist.add (Properties::group_mute, val);
val = (*iter)[_columns.solo];
- plist.add (Properties::solo, val);
+ plist.add (Properties::group_solo, val);
val = (*iter)[_columns.record];
- plist.add (Properties::recenable, val);
+ plist.add (Properties::group_recenable, val);
val = (*iter)[_columns.monitoring];
- plist.add (Properties::monitoring, val);
+ plist.add (Properties::group_monitoring, val);
val = (*iter)[_columns.select];
- plist.add (Properties::select, val);
+ plist.add (Properties::group_select, val);
val = (*iter)[_columns.active_shared];
- plist.add (Properties::route_active, val);
+ plist.add (Properties::group_route_active, val);
+
val = (*iter)[_columns.active_state];
plist.add (Properties::active, val);
val = (*iter)[_columns.is_visible];
row[_columns.active_shared] = group->is_route_active ();
row[_columns.active_state] = group->is_active ();
row[_columns.is_visible] = !group->is_hidden();
-
+
Gdk::Color c;
set_color_from_rgba (c, GroupTabs::group_color (group));
row[_columns.gdkcolor] = c;
-
+
_in_row_change = true;
row[_columns.routegroup] = group;
void
EditorRouteGroups::property_changed (RouteGroup* group, const PropertyChange&)
{
+ assert(group);
_in_row_change = true;
Gtk::TreeModel::Children children = _model->children();
break;
}
}
-
+
_in_row_change = false;
for (TrackViewList::const_iterator i = _editor->get_track_views().begin(); i != _editor->get_track_views().end(); ++i) {
}
PBD::PropertyChange pc;
- pc.add (Properties::select);
+ pc.add (Properties::group_select);
pc.add (Properties::active);
groups_changed ();
void
EditorRouteGroups::run_new_group_dialog ()
{
- RouteList rl;
-
- return _editor->_group_tabs->run_new_group_dialog (rl);
+ return _editor->_group_tabs->run_new_group_dialog (0, false);
}
/** Called when a model row is deleted, but also when the model is