a metric boatload of changes; plugin UIs work, adding tracks work, redirect list is useful again, and more

git-svn-id: svn://localhost/trunk/ardour2@273 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2006-01-17 16:40:57 +00:00
parent aa659d3788
commit 2e582e03e4
17 changed files with 243 additions and 282 deletions

View File

@ -627,13 +627,26 @@ style "automation_track_controls_base"
# Plugin Editors # Plugin Editors
style "plugin_slider" style "plugin_slider"
{ {
font_name ="sans medium 10" font_name ="sans bold 10"
fg[NORMAL] = { 0.45, 0.45, 0.45 } # the slider itself. the inactive part is INSENSITIVE,
fg[ACTIVE] = { 0.45, 0.45, 0.45 } # the active part is something else.
fg[INSENSITIVE] = {0.0, 0.0, 0.0 } # matches default_base
fg[SELECTED] = { 0.45, 0.45, 0.45 } fg[NORMAL] = { 0.37, 0.43, 0.52 }
fg[PRELIGHT] = { 0.45, 0.45, 0.45 } fg[ACTIVE] = { 0.37, 0.43, 0.52 }
fg[INSENSITIVE] = {0.40, 0.40, 0.40 } # matches default_base
fg[SELECTED] = { 0.37, 0.43, 0.52 }
fg[PRELIGHT] = { 0.37, 0.43, 0.52 }
# draws the outer rectangle around the slider
bg[NORMAL] = { 0.80, 0.80, 0.80 }
bg[ACTIVE] = { 0.80, 0.80, 0.80 }
bg[INSENSITIVE] = {0.80, 0.80, 0.80 }
bg[SELECTED] = { 0.80, 0.80, 0.80 }
bg[PRELIGHT] = { 0.80, 0.80, 0.80 }
# the numeric display
text[NORMAL] = { 0.80, 0.80, 0.80 } text[NORMAL] = { 0.80, 0.80, 0.80 }
text[ACTIVE] = { 0.80, 0.80, 0.80 } text[ACTIVE] = { 0.80, 0.80, 0.80 }
@ -655,6 +668,25 @@ style "track_list_display" = "small_bold_text"
base[SELECTED] = { 0, 0, 0 } base[SELECTED] = { 0, 0, 0 }
} }
style "redirect_list_display" = "small_bold_text"
{
text[NORMAL] = { 0.80, 0.80, 0.80 }
text[ACTIVE] = { 0.0, 0.0, 0.9 }
text[INSENSITIVE] = { 0, 0, 0 }
text[SELECTED] = { 0.9, 0.0, 0.0 }
base[NORMAL] = { 0, 0, 0 }
base[ACTIVE] = { 0, 0, 0 }
base[INSENSITIVE] = { 0, 0, 0 }
base[SELECTED] = { 0, 0, 0 }
# these two are explicitly used by the cell renderer for the
# text
fg[NORMAL] = { 0.2, 0.2, 0.2 } # used for inactive
fg[ACTIVE] = { 0.0, 0.5, 0.5 } # used for active
}
# MixerPanZone: # MixerPanZone:
# #
# the NORMAL fg color is used for the pan puck # the NORMAL fg color is used for the pan puck
@ -790,6 +822,7 @@ style "region_list_whole_file"
fg[NORMAL] = { 1.0, 0, 0 } fg[NORMAL] = { 1.0, 0, 0 }
} }
#--------------------------------------------------------------- #---------------------------------------------------------------
widget "*FirstActionMessage" style "first_action_message" widget "*FirstActionMessage" style "first_action_message"
widget "*VerboseCanvasCursor" style "verbose_canvas_cursor" widget "*VerboseCanvasCursor" style "verbose_canvas_cursor"
@ -1047,8 +1080,8 @@ widget "*TrackListDisplay.*" style "small_bold_text"
widget "*EditGroupList" style "track_list_display" widget "*EditGroupList" style "track_list_display"
widget "*RegionListDisplay" style "small_bold_entry" widget "*RegionListDisplay" style "small_bold_entry"
widget "*RegionListDisplay.*" style "small_bold_text" widget "*RegionListDisplay.*" style "small_bold_text"
widget "*MixerRedirectSelector" style "small_bold_entry" widget "*RedirectSelector" style "redirect_list_display"
widget "*MixerRedirectSelector.*" style "small_bold_text" widget "*RedirectSelector.*" style "redirect_list_display"
widget "*MixerTrackNameArea" style "default_base" widget "*MixerTrackNameArea" style "default_base"
widget "*MixerTrackCommentArea" style "option_entry" widget "*MixerTrackCommentArea" style "option_entry"
widget "*MixerPanZone" style "pan_zone" widget "*MixerPanZone" style "pan_zone"

View File

@ -435,7 +435,6 @@ AutomationTimeAxisView::hide_clicked ()
hide (); hide ();
} }
void void
AutomationTimeAxisView::build_display_menu () AutomationTimeAxisView::build_display_menu ()
{ {

View File

@ -48,6 +48,7 @@ list<Gdk::Color> AxisView::used_colors;
AxisView::AxisView (ARDOUR::Session& sess) : _session(sess) AxisView::AxisView (ARDOUR::Session& sess) : _session(sess)
{ {
_selected = false; _selected = false;
_marked_for_display = true;
} }
AxisView::~AxisView() AxisView::~AxisView()

View File

@ -598,13 +598,13 @@ Editor::Editor (AudioEngine& eng)
region_list_model->set_sort_column (0, SORT_ASCENDING); region_list_model->set_sort_column (0, SORT_ASCENDING);
region_list_display.set_model (region_list_model); region_list_display.set_model (region_list_model);
CellRendererText* renderer = manage( new CellRendererText() ); region_list_display.append_column (_("Regions"), region_list_columns.name);
region_list_display.append_column (_("Regions"), *renderer);
region_list_display.set_headers_visible (false); region_list_display.set_headers_visible (false);
region_list_display.get_selection()->set_select_function (mem_fun (*this, &Editor::region_list_selection_filter)); region_list_display.get_selection()->set_select_function (mem_fun (*this, &Editor::region_list_selection_filter));
TreeViewColumn* tv_col = region_list_display.get_column(0); TreeViewColumn* tv_col = region_list_display.get_column(0);
CellRendererText* renderer = dynamic_cast<CellRendererText*>(region_list_display.get_column_cell_renderer (0));
tv_col->add_attribute(renderer->property_text(), region_list_columns.name); tv_col->add_attribute(renderer->property_text(), region_list_columns.name);
tv_col->add_attribute(renderer->property_foreground_gdk(), region_list_columns.color_); tv_col->add_attribute(renderer->property_foreground_gdk(), region_list_columns.color_);
@ -2065,12 +2065,13 @@ Editor::set_state (const XMLNode& node)
{ {
const XMLProperty* prop; const XMLProperty* prop;
XMLNode* geometry; XMLNode* geometry;
int x, y, width, height, xoff, yoff; int x, y, xoff, yoff;
Gdk::Geometry g;
if ((geometry = find_named_node (node, "geometry")) == 0) { if ((geometry = find_named_node (node, "geometry")) == 0) {
width = default_width; g.base_width = default_width;
height = default_height; g.base_height = default_height;
x = 1; x = 1;
y = 1; y = 1;
xoff = 0; xoff = 0;
@ -2078,16 +2079,17 @@ Editor::set_state (const XMLNode& node)
} else { } else {
width = atoi(geometry->property("x_size")->value()); g.base_width = atoi(geometry->property("x_size")->value());
height = atoi(geometry->property("y_size")->value()); g.base_height = atoi(geometry->property("y_size")->value());
x = atoi(geometry->property("x_pos")->value()); x = atoi(geometry->property("x_pos")->value());
y = atoi(geometry->property("y_pos")->value()); y = atoi(geometry->property("y_pos")->value());
xoff = atoi(geometry->property("x_off")->value()); xoff = atoi(geometry->property("x_off")->value());
yoff = atoi(geometry->property("y_off")->value()); yoff = atoi(geometry->property("y_off")->value());
} }
set_default_size(width, height); set_geometry_hints (vpacker, g, Gdk::HINT_BASE_SIZE);
move (x, y-yoff); set_default_size (g.base_width, g.base_height);
move (x, y);
if ((prop = node.property ("zoom-focus"))) { if ((prop = node.property ("zoom-focus"))) {
set_zoom_focus ((ZoomFocus) atoi (prop->value())); set_zoom_focus ((ZoomFocus) atoi (prop->value()));
@ -3333,9 +3335,6 @@ Editor::duplicate_dialog (bool dup_region)
entry.select_region (0, entry.get_text_length()); entry.select_region (0, entry.get_text_length());
entry.grab_focus (); entry.grab_focus ();
// GTK2FIX
// win.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
switch (win.run ()) { switch (win.run ()) {
case RESPONSE_ACCEPT: case RESPONSE_ACCEPT:
@ -3762,9 +3761,6 @@ Editor::edit_xfade (Crossfade* xfade)
ensure_float (cew); ensure_float (cew);
// GTK2FIX
// cew.signal_delete_event().connect (mem_fun (cew, &ArdourDialog::wm_doi_event_stop));
switch (cew.run ()) { switch (cew.run ()) {
case RESPONSE_ACCEPT: case RESPONSE_ACCEPT:
break; break;

View File

@ -373,12 +373,6 @@ Editor::reset_scrolling_region (Gtk::Allocation* alloc)
} }
} }
RefPtr<Gdk::Screen> screen = get_screen();
if (!screen) {
screen = Gdk::Screen::get_default();
}
double last_canvas_unit = ceil ((double) max_frames / frames_per_unit); double last_canvas_unit = ceil ((double) max_frames / frames_per_unit);
track_canvas.set_scroll_region (0.0, 0.0, max (last_canvas_unit, canvas_width), pos); track_canvas.set_scroll_region (0.0, 0.0, max (last_canvas_unit, canvas_width), pos);

View File

@ -253,7 +253,7 @@ Editor::redisplay_route_list ()
bool visible = (*i)[route_display_columns.visible]; bool visible = (*i)[route_display_columns.visible];
if (visible) { if (visible) {
tv->set_marked_for_display (false); tv->set_marked_for_display (true);
position += tv->show_at (position, n, &edit_controls_vbox); position += tv->show_at (position, n, &edit_controls_vbox);
position += track_spacing; position += track_spacing;
} else { } else {

View File

@ -51,6 +51,7 @@ using namespace Gtk;
using namespace Glib; using namespace Glib;
using namespace Gtkmm2ext; using namespace Gtkmm2ext;
using namespace sigc; using namespace sigc;
using namespace std;
Mixer_UI::Mixer_UI (AudioEngine& eng) Mixer_UI::Mixer_UI (AudioEngine& eng)
: Window (Gtk::WINDOW_TOPLEVEL), : Window (Gtk::WINDOW_TOPLEVEL),
@ -146,8 +147,8 @@ Mixer_UI::Mixer_UI (AudioEngine& eng)
rhs_pane1.set_data ("collapse-direction", (gpointer) 0); rhs_pane1.set_data ("collapse-direction", (gpointer) 0);
list_hpane.set_data ("collapse-direction", (gpointer) 1); list_hpane.set_data ("collapse-direction", (gpointer) 1);
rhs_pane1.signal_button_release_event().connect (bind (ptr_fun (pane_handler), static_cast<Paned*>(&rhs_pane1))); rhs_pane1.signal_button_release_event().connect (bind (sigc::ptr_fun (pane_handler), static_cast<Paned*>(&rhs_pane1)));
list_hpane.signal_button_release_event().connect (bind (ptr_fun (pane_handler), static_cast<Paned*>(&list_hpane))); list_hpane.signal_button_release_event().connect (bind (sigc::ptr_fun (pane_handler), static_cast<Paned*>(&list_hpane)));
global_vpacker.pack_start (list_hpane, true, true); global_vpacker.pack_start (list_hpane, true, true);
@ -158,7 +159,7 @@ Mixer_UI::Mixer_UI (AudioEngine& eng)
add_accel_group (ActionManager::ui_manager->get_accel_group()); add_accel_group (ActionManager::ui_manager->get_accel_group());
signal_delete_event().connect (bind (ptr_fun (just_hide_it), static_cast<Gtk::Window *>(this))); signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), static_cast<Gtk::Window *>(this)));
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK); add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK);
group_display.signal_button_press_event().connect (mem_fun (*this, &Mixer_UI::group_display_button_press)); group_display.signal_button_press_event().connect (mem_fun (*this, &Mixer_UI::group_display_button_press));
@ -215,25 +216,22 @@ Mixer_UI::add_strip (Route* route)
strip->set_width (_strip_width); strip->set_width (_strip_width);
show_strip (strip); show_strip (strip);
no_track_list_redisplay = true;
TreeModel::Row row = *(track_display_model->append()); TreeModel::Row row = *(track_display_model->append());
row[track_display_columns.text] = route->name(); row[track_display_columns.text] = route->name();
if (strip->route().master() || strip->route().control()) { row[track_display_columns.visible] = true;
row[track_display_columns.visible] = true;
} else {
row[track_display_columns.visible] = (strip->marked_for_display() || strip->packed());
}
row[track_display_columns.route] = route; row[track_display_columns.route] = route;
row[track_display_columns.strip] = strip; row[track_display_columns.strip] = strip;
no_track_list_redisplay = false;
redisplay_track_list ();
route->name_changed.connect (bind (mem_fun(*this, &Mixer_UI::strip_name_changed), strip)); route->name_changed.connect (bind (mem_fun(*this, &Mixer_UI::strip_name_changed), strip));
strip->GoingAway.connect (bind (mem_fun(*this, &Mixer_UI::remove_strip), strip)); strip->GoingAway.connect (bind (mem_fun(*this, &Mixer_UI::remove_strip), strip));
strip->signal_button_release_event().connect (bind (mem_fun(*this, &Mixer_UI::strip_button_release_event), strip)); strip->signal_button_release_event().connect (bind (mem_fun(*this, &Mixer_UI::strip_button_release_event), strip));
// if (width() < gdk_screen_width()) {
// set_size_request (width() + (_strip_width == Wide ? 75 : 50), height());
// }
} }
void void
@ -523,6 +521,12 @@ Mixer_UI::redisplay_track_list ()
for (order = 0, i = rows.begin(); i != rows.end(); ++i, ++order) { for (order = 0, i = rows.begin(); i != rows.end(); ++i, ++order) {
MixerStrip* strip = (*i)[track_display_columns.strip]; MixerStrip* strip = (*i)[track_display_columns.strip];
if (strip == 0) {
cerr << "row with text = " << (*i)[track_display_columns.text] << " has no strip\n";
/* we're in the middle of changing a row, don't worry */
continue;
}
bool visible = (*i)[track_display_columns.visible]; bool visible = (*i)[track_display_columns.visible];
if (visible) { if (visible) {
@ -545,7 +549,7 @@ Mixer_UI::redisplay_track_list ()
strip_packer.pack_start (*strip, false, false); strip_packer.pack_start (*strip, false, false);
} }
strip->set_packed (true); strip->set_packed (true);
strip->show (); strip->show_all ();
} }
} else { } else {
@ -824,12 +828,13 @@ Mixer_UI::set_state (const XMLNode& node)
{ {
const XMLProperty* prop; const XMLProperty* prop;
XMLNode* geometry; XMLNode* geometry;
int x, y, width, height, xoff, yoff; Gdk::Geometry g;
int x, y, xoff, yoff;
if ((geometry = find_named_node (node, "geometry")) == 0) { if ((geometry = find_named_node (node, "geometry")) == 0) {
width = default_width; g.base_width = default_width;
height = default_height; g.base_height = default_height;
x = 1; x = 1;
y = 1; y = 1;
xoff = 0; xoff = 0;
@ -837,17 +842,17 @@ Mixer_UI::set_state (const XMLNode& node)
} else { } else {
width = atoi(geometry->property("x_size")->value().c_str()); g.base_width = atoi(geometry->property("x_size")->value().c_str());
height = atoi(geometry->property("y_size")->value().c_str()); g.base_height = atoi(geometry->property("y_size")->value().c_str());
x = atoi(geometry->property("x_pos")->value().c_str()); x = atoi(geometry->property("x_pos")->value().c_str());
y = atoi(geometry->property("y_pos")->value().c_str()); y = atoi(geometry->property("y_pos")->value().c_str());
xoff = atoi(geometry->property("x_off")->value().c_str()); xoff = atoi(geometry->property("x_off")->value().c_str());
yoff = atoi(geometry->property("y_off")->value().c_str()); yoff = atoi(geometry->property("y_off")->value().c_str());
} }
set_default_size(width, height); set_geometry_hints (global_vpacker, g, Gdk::HINT_BASE_SIZE);
// GTK2FIX set_default_size(g.base_width, g.base_height);
// set_uposition(x, y-yoff); move (x, y);
if ((prop = node.property ("narrow-strips"))) { if ((prop = node.property ("narrow-strips"))) {
if (prop->value() == "yes") { if (prop->value() == "yes") {

View File

@ -135,7 +135,10 @@ PluginUI::PluginUI (AudioEngine &engine, PluginInsert& pi, bool scrollable)
HBox* constraint_hbox = manage (new HBox); HBox* constraint_hbox = manage (new HBox);
HBox* smaller_hbox = manage (new HBox); HBox* smaller_hbox = manage (new HBox);
Label* combo_label = manage (new Label (_("<span size=\"large\" weight=\"bold\">Presets</span>")));
combo_label->set_use_markup (true);
smaller_hbox->pack_start (*combo_label, false, false, 10);
smaller_hbox->pack_start (combo, false, false); smaller_hbox->pack_start (combo, false, false);
smaller_hbox->pack_start (save_button, false, false); smaller_hbox->pack_start (save_button, false, false);
@ -143,12 +146,6 @@ PluginUI::PluginUI (AudioEngine &engine, PluginInsert& pi, bool scrollable)
constraint_hbox->pack_start (*smaller_hbox, true, false); constraint_hbox->pack_start (*smaller_hbox, true, false);
constraint_hbox->pack_end (bypass_button, false, false); constraint_hbox->pack_end (bypass_button, false, false);
// name_ebox.add (*text_hbox);
// info_vbox.pack_start (name_ebox, false, false);
// info_vbox.pack_start (makerinfo_label, false, false);
// info_vbox.pack_start (paraminfo_label, false, false, 5);
// settings_box.pack_start (info_vbox, false, false, 10);
settings_box.pack_end (*constraint_hbox, false, false); settings_box.pack_end (*constraint_hbox, false, false);
pack_start (settings_box, false, false); pack_start (settings_box, false, false);
@ -165,9 +162,6 @@ PluginUI::PluginUI (AudioEngine &engine, PluginInsert& pi, bool scrollable)
} }
else { else {
pack_start (hpacker, false, false); pack_start (hpacker, false, false);
// this is a hack to get the theme right
name_ebox.set_name ("PluginNameBox");
} }
insert.active_changed.connect (mem_fun(*this, &PluginUI::redirect_active_changed)); insert.active_changed.connect (mem_fun(*this, &PluginUI::redirect_active_changed));
@ -228,6 +222,9 @@ PluginUI::build (AudioEngine &engine)
hpacker.pack_start(*bt_frame, true, true); hpacker.pack_start(*bt_frame, true, true);
box = manage (new VBox); box = manage (new VBox);
box->set_border_width (5);
box->set_spacing (1);
frame = manage (new Frame); frame = manage (new Frame);
frame->set_name ("BaseFrame"); frame->set_name ("BaseFrame");
frame->add (*box); frame->add (*box);
@ -348,42 +345,6 @@ PluginUI::build (AudioEngine &engine)
output_update (); output_update ();
string pname = plugin.name();
if (pname.length() > 24) {
pname = pname.substr (0, 24);
pname += "...";
ARDOUR_UI::instance()->tooltips().set_tip(name_ebox, plugin.name());
}
nameinfo_label.set_text (pname);
nameinfo_label.set_name ("PluginNameInfo");
nameinfo_label.set_alignment (0.0, 0.0);
string maker = plugin.maker();
string::size_type email_pos;
if ((email_pos = maker.find_first_of ('<')) != string::npos) {
maker = maker.substr (0, email_pos - 1);
}
if (maker.length() > 32) {
maker = maker.substr (0, 32);
maker += " ...";
}
makerinfo_label.set_text (maker);
makerinfo_label.set_name ("PluginMakerInfo");
makerinfo_label.set_alignment (0.0, 0.0);
snprintf (info, sizeof(info),"[ %u %s | %u %s ]",
n_ins, ngettext(_("in"), _("ins"), n_ins),
n_outs, ngettext(_("out"), _("outs"), n_outs));
paraminfo_label.set_text (info);
paraminfo_label.set_name ("PluginParameterInfo");
paraminfo_label.set_alignment (0.0, 0.0);
output_table.show_all (); output_table.show_all ();
button_table.show_all (); button_table.show_all ();
} }
@ -397,7 +358,7 @@ PluginUI::ControlUI::ControlUI ()
/* don't fix the height, it messes up the bar controllers */ /* don't fix the height, it messes up the bar controllers */
set_size_request_to_display_given_text (automate_button, X_("longenuff"), 2, -1); set_size_request_to_display_given_text (automate_button, X_("longenuff"), 2, 2);
ignore_change = 0; ignore_change = 0;
display = 0; display = 0;
@ -552,14 +513,11 @@ PluginUI::build_control_ui (AudioEngine &engine, guint32 port_index, MIDI::Contr
Gtkmm2ext::set_size_request_to_display_given_text (*control_ui->clickbox, "g9999999", 2, 2); Gtkmm2ext::set_size_request_to_display_given_text (*control_ui->clickbox, "g9999999", 2, 2);
control_ui->clickbox->set_print_func (integer_printer, 0); control_ui->clickbox->set_print_func (integer_printer, 0);
} else { } else {
// control_ui->control = new HSliderController (ARDOUR_UI::instance()->plugin_ui_slider_pix(),
// control_ui->adjustment,
// mcontrol);
sigc::slot<void,char*,uint32_t> pslot = sigc::bind (mem_fun(*this, &PluginUI::print_parameter), (uint32_t) port_index); sigc::slot<void,char*,uint32_t> pslot = sigc::bind (mem_fun(*this, &PluginUI::print_parameter), (uint32_t) port_index);
control_ui->control = new BarController (*control_ui->adjustment, mcontrol, pslot); control_ui->control = new BarController (*control_ui->adjustment, mcontrol, pslot);
control_ui->control->set_size_request (200, 15); // should really match the height of the text in the automation button+label
control_ui->control->set_size_request (200, 22);
control_ui->control->set_name (X_("PluginSlider")); control_ui->control->set_name (X_("PluginSlider"));
control_ui->control->set_style (BarController::LeftToRight); control_ui->control->set_style (BarController::LeftToRight);
control_ui->control->set_use_parent (true); control_ui->control->set_use_parent (true);
@ -588,7 +546,7 @@ PluginUI::build_control_ui (AudioEngine &engine, guint32 port_index, MIDI::Contr
} }
control_ui->pack_start (control_ui->automate_button, false, false); control_ui->pack_start (control_ui->automate_button, false, false);
control_ui->adjustment->signal_value_changed().connect (bind (mem_fun(*this, &PluginUI::control_adjustment_changed), control_ui)); control_ui->adjustment->signal_value_changed().connect (bind (mem_fun(*this, &PluginUI::control_adjustment_changed), control_ui));
control_ui->automate_button.signal_clicked().connect (bind (mem_fun(*this, &PluginUI::astate_clicked), control_ui, (uint32_t) port_index)); control_ui->automate_button.signal_clicked().connect (bind (mem_fun(*this, &PluginUI::astate_clicked), control_ui, (uint32_t) port_index));
automation_state_changed (control_ui); automation_state_changed (control_ui);

View File

@ -101,8 +101,6 @@ class PluginUI : public PlugUIBase, public Gtk::VBox
ARDOUR::AudioEngine &engine; ARDOUR::AudioEngine &engine;
Gtk::HBox settings_box; Gtk::HBox settings_box;
Gtk::HBox hpacker; Gtk::HBox hpacker;
Gtk::VBox info_vbox;
Gtk::EventBox name_ebox;
Gtk::Table button_table; Gtk::Table button_table;
Gtk::Table output_table; Gtk::Table output_table;
@ -111,9 +109,6 @@ class PluginUI : public PlugUIBase, public Gtk::VBox
Gtk::Adjustment hAdjustment; Gtk::Adjustment hAdjustment;
Gtk::Adjustment vAdjustment; Gtk::Adjustment vAdjustment;
Gtk::Viewport scroller_view; Gtk::Viewport scroller_view;
Gtk::Label nameinfo_label;
Gtk::Label paraminfo_label;
Gtk::Label makerinfo_label;
Gtk::Menu* automation_menu; Gtk::Menu* automation_menu;
bool setting_name_status; bool setting_name_status;

View File

@ -47,5 +47,5 @@ for lang in languages[:]:
env.Alias('install', env.InstallAs (os.path.join (modir, moname), lang + '.mo')) env.Alias('install', env.InstallAs (os.path.join (modir, moname), lang + '.mo'))
env.Alias ('tarball', env.Distribute (env['DISTTREE'], env.Alias ('tarball', env.Distribute (env['DISTTREE'],
[ 'SConscript' ] + [ 'SConscript', 'gtk_ardour.pot' ] +
glob.glob('*.po'))) glob.glob('*.po')))

View File

@ -68,7 +68,10 @@ using namespace Glib;
using namespace Gtkmm2ext; using namespace Gtkmm2ext;
RedirectBox* RedirectBox::_current_redirect_box = 0; RedirectBox* RedirectBox::_current_redirect_box = 0;
RefPtr<Action> RedirectBox::paste_action;
bool RedirectBox::get_colors = true;
Gdk::Color* RedirectBox::active_redirect_color;
Gdk::Color* RedirectBox::inactive_redirect_color;
RedirectBox::RedirectBox (Placement pcmnt, Session& sess, Route& rt, PluginSelector &plugsel, RedirectBox::RedirectBox (Placement pcmnt, Session& sess, Route& rt, PluginSelector &plugsel,
RouteRedirectSelection & rsel, bool owner_is_mixer) RouteRedirectSelection & rsel, bool owner_is_mixer)
@ -78,13 +81,22 @@ RedirectBox::RedirectBox (Placement pcmnt, Session& sess, Route& rt, PluginSelec
_placement(pcmnt), _placement(pcmnt),
_plugin_selector(plugsel), _plugin_selector(plugsel),
_rr_selection(rsel) _rr_selection(rsel)
//redirect_display (1)
{ {
if (get_colors) {
active_redirect_color = new Gdk::Color;
inactive_redirect_color = new Gdk::Color;
set_color (*active_redirect_color, rgba_from_style ("RedirectSelector", 0xff, 0, 0, 0, "fg", Gtk::STATE_ACTIVE, false ));
set_color (*inactive_redirect_color, rgba_from_style ("RedirectSelector", 0xff, 0, 0, 0, "fg", Gtk::STATE_NORMAL, false ));
get_colors = false;
}
_width = Wide; _width = Wide;
redirect_menu = 0; redirect_menu = 0;
send_action_menu = 0; send_action_menu = 0;
redirect_drag_in_progress = false; redirect_drag_in_progress = false;
no_redirect_redisplay = false;
ignore_delete = false;
model = ListStore::create(columns); model = ListStore::create(columns);
RefPtr<TreeSelection> selection = redirect_display.get_selection(); RefPtr<TreeSelection> selection = redirect_display.get_selection();
@ -92,8 +104,8 @@ RedirectBox::RedirectBox (Placement pcmnt, Session& sess, Route& rt, PluginSelec
selection->signal_changed().connect (mem_fun (*this, &RedirectBox::selection_changed)); selection->signal_changed().connect (mem_fun (*this, &RedirectBox::selection_changed));
redirect_display.set_model (model); redirect_display.set_model (model);
redirect_display.append_column ("WHY?", columns.text); redirect_display.append_column (X_("notshown"), columns.text);
redirect_display.set_name ("MixerRedirectSelector"); redirect_display.set_name ("RedirectSelector");
redirect_display.set_headers_visible (false); redirect_display.set_headers_visible (false);
redirect_display.set_reorderable (true); redirect_display.set_reorderable (true);
redirect_display.set_size_request (-1, 48); redirect_display.set_size_request (-1, 48);
@ -102,73 +114,61 @@ RedirectBox::RedirectBox (Placement pcmnt, Session& sess, Route& rt, PluginSelec
redirect_display.add_object_drag (columns.redirect.index(), "redirects"); redirect_display.add_object_drag (columns.redirect.index(), "redirects");
redirect_display.signal_object_drop.connect (mem_fun (*this, &RedirectBox::object_drop)); redirect_display.signal_object_drop.connect (mem_fun (*this, &RedirectBox::object_drop));
// Does this adequately replace the drag start/stop signal handlers? TreeViewColumn* name_col = redirect_display.get_column(0);
model->signal_rows_reordered().connect (mem_fun (*this, &RedirectBox::redirects_reordered)); CellRendererText* renderer = dynamic_cast<CellRendererText*>(redirect_display.get_column_cell_renderer (0));
name_col->add_attribute(renderer->property_foreground_gdk(), columns.color);
redirect_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); redirect_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
model->signal_row_deleted().connect (mem_fun (*this, &RedirectBox::row_deleted));
redirect_scroller.add (redirect_display); redirect_scroller.add (redirect_display);
redirect_eventbox.add (redirect_scroller); redirect_eventbox.add (redirect_scroller);
pack_start (redirect_eventbox, true, true); pack_start (redirect_eventbox, true, true);
_route.redirects_changed.connect (mem_fun(*this, &RedirectBox::redirects_changed)); _route.redirects_changed.connect (mem_fun(*this, &RedirectBox::redisplay_redirects));
redirect_eventbox.signal_enter_notify_event().connect (bind (sigc::ptr_fun (RedirectBox::enter_box), this)); redirect_eventbox.signal_enter_notify_event().connect (bind (sigc::ptr_fun (RedirectBox::enter_box), this));
//redirect_eventbox.signal_leave_notify_event().connect (bind (sigc::ptr_fun (RedirectBox::leave_box), this));
redirect_display.signal_button_press_event().connect (mem_fun(*this, &RedirectBox::redirect_button)); redirect_display.signal_button_press_event().connect (mem_fun(*this, &RedirectBox::redirect_button_press_event), false);
redirect_display.signal_button_release_event().connect (mem_fun(*this, &RedirectBox::redirect_button)); redirect_display.signal_button_release_event().connect (mem_fun(*this, &RedirectBox::redirect_button_press_event));
//redirect_display.signal_button_release_event().connect_after (ptr_fun (do_not_propagate));
set_stuff_from_route ();
/* start off as a passthru strip. we'll correct this, if necessary, /* start off as a passthru strip. we'll correct this, if necessary,
in update_diskstream_display(). in update_diskstream_display().
*/ */
//set_name ("AudioTrackStripBase");
/* now force an update of all the various elements */ /* now force an update of all the various elements */
redirects_changed (0); redisplay_redirects (0);
//add_events (Gdk::BUTTON_RELEASE_MASK);
} }
RedirectBox::~RedirectBox () RedirectBox::~RedirectBox ()
{ {
// GoingAway(); /* EMIT_SIGNAL */
} }
void void
RedirectBox::object_drop (string type, uint32_t cnt, void** ptr) RedirectBox::object_drop (string type, uint32_t cnt, void** ptr)
{ {
if (type != "redirects") { if (type != "redirects" || cnt == 0 || ptr == 0) {
return; return;
} }
}
void /* do something with the dropped redirects */
RedirectBox::set_stuff_from_route ()
{
}
void list<Redirect*> redirects;
RedirectBox::set_title (const std::string & title)
{
redirect_display.get_column(0)->set_title (title);
}
void for (uint32_t n = 0; n < cnt; ++n) {
RedirectBox::set_title_shown (bool flag) redirects.push_back ((Redirect*) ptr[n]);
{ }
paste_redirect_list (redirects);
} }
void void
RedirectBox::update() RedirectBox::update()
{ {
redirects_changed(0); redisplay_redirects (0);
} }
@ -180,10 +180,9 @@ RedirectBox::set_width (Width w)
} }
_width = w; _width = w;
redirects_changed(0); redisplay_redirects (0);
} }
void void
RedirectBox::remove_redirect_gui (Redirect *redirect) RedirectBox::remove_redirect_gui (Redirect *redirect)
{ {
@ -239,6 +238,8 @@ RedirectBox::show_redirect_menu (gint arg)
redirect_menu = build_redirect_menu (); redirect_menu = build_redirect_menu ();
} }
paste_action->set_sensitive (!_rr_selection.redirects.empty());
redirect_menu->popup (1, 0); redirect_menu->popup (1, 0);
} }
@ -254,84 +255,58 @@ RedirectBox::redirect_drag_end (GdkDragContext *context)
redirect_drag_in_progress = false; redirect_drag_in_progress = false;
} }
gint bool
RedirectBox::redirect_button (GdkEventButton *ev) RedirectBox::redirect_button_press_event (GdkEventButton *ev)
{ {
Redirect *redirect; TreeIter iter;
TreeModel::Row row = *(redirect_display.get_selection()->get_selected()); TreeModel::Path path;
TreeViewColumn* column;
int cellx;
int celly;
Redirect* redirect = 0;
int ret = false;
bool selected = false;
if (row) if (redirect_display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly)) {
redirect = row[columns.redirect]; if ((iter = model->get_iter (path))) {
redirect = (*iter)[columns.redirect];
switch (ev->type) { selected = redirect_display.get_selection()->is_selected (iter);
case GDK_BUTTON_PRESS:
if (ev->button == 3) {
show_redirect_menu (0); // Handle the context-click menu here as well
return TRUE;
} }
else
return FALSE;
case GDK_2BUTTON_PRESS:
if (ev->state != 0) {
return FALSE;
}
/* might be edit event, see below */
break;
case GDK_BUTTON_RELEASE:
break;
default:
/* shouldn't be here, but gcc complains */
return FALSE;
} }
if (redirect && Keyboard::is_delete_event (ev)) { if (redirect && Keyboard::is_delete_event (ev)) {
Glib::signal_idle().connect (bind (mem_fun(*this, &RedirectBox::idle_delete_redirect), redirect)); Glib::signal_idle().connect (bind (mem_fun(*this, &RedirectBox::idle_delete_redirect), redirect));
return TRUE; ret = true;
} else if (redirect && (Keyboard::is_edit_event (ev) || ev->type == GDK_2BUTTON_PRESS)) { } else if (redirect && (Keyboard::is_edit_event (ev) || (ev->button == 1 && ev->type == GDK_2BUTTON_PRESS && ev->state == 0))) {
if (_session.engine().connected()) { if (_session.engine().connected()) {
/* XXX giving an error message here is hard, because we may be in the midst of a button press */ /* XXX giving an error message here is hard, because we may be in the midst of a button press */
edit_redirect (redirect); edit_redirect (redirect);
} }
return TRUE; ret = true;
} else if (Keyboard::is_context_menu_event (ev)) { } else if (Keyboard::is_context_menu_event (ev)) {
show_redirect_menu(0); show_redirect_menu(0);
return TRUE; //stop_signal (*clist, "button-release-event"); ret = true;
} else { } else if (redirect && ev->button == 2 && ev->state == 0) {
switch (ev->button) {
case 1: redirect->set_active (!redirect->active(), this);
return FALSE; ret = true;
break;
case 2: }
if (redirect) {
redirect->set_active (!redirect->active(), this);
}
break;
case 3: return ret;
break;
default:
return FALSE;
}
}
return TRUE;
} }
Menu * Menu *
RedirectBox::build_redirect_menu () RedirectBox::build_redirect_menu ()
{ {
redirect_menu = dynamic_cast<Gtk::Menu*>(ActionManager::get_widget("/redirectmenu") ); redirect_menu = dynamic_cast<Gtk::Menu*>(ActionManager::get_widget("/redirectmenu") );
redirect_menu->signal_map_event().connect (mem_fun(*this, &RedirectBox::redirect_menu_map_handler));
redirect_menu->set_name ("ArdourContextMenu"); redirect_menu->set_name ("ArdourContextMenu");
show_all_children(); show_all_children();
@ -349,14 +324,6 @@ RedirectBox::selection_changed ()
} }
} }
gint
RedirectBox::redirect_menu_map_handler (GdkEventAny *ev)
{
// GTK2FIX
// popup_act_grp->get_action("paste")->set_sensitive (!_rr_selection.redirects.empty());
return FALSE;
}
void void
RedirectBox::select_all_redirects () RedirectBox::select_all_redirects ()
{ {
@ -503,12 +470,18 @@ RedirectBox::send_io_finished (IOSelector::Result r, Redirect* redirect, IOSelec
} }
void void
RedirectBox::redirects_changed (void *src) RedirectBox::redisplay_redirects (void *src)
{ {
ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::redirects_changed), src)); ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::redisplay_redirects), src));
//redirect_display.freeze (); if (no_redirect_redisplay) {
return;
}
ignore_delete = true;
model->clear (); model->clear ();
ignore_delete = false;
redirect_active_connections.clear (); redirect_active_connections.clear ();
redirect_name_connections.clear (); redirect_name_connections.clear ();
@ -522,7 +495,6 @@ RedirectBox::redirects_changed (void *src)
build_redirect_tooltip(redirect_eventbox, _("Post-fader inserts, sends & plugins:")); build_redirect_tooltip(redirect_eventbox, _("Post-fader inserts, sends & plugins:"));
break; break;
} }
//redirect_display.thaw ();
} }
void void
@ -631,23 +603,21 @@ RedirectBox::show_redirect_active (Redirect *redirect, void *src)
(*iter)[columns.text] = redirect_name (*redirect); (*iter)[columns.text] = redirect_name (*redirect);
if (redirect->active()) { if (redirect->active()) {
redirect_display.get_selection()->select (iter); (*iter)[columns.color] = *active_redirect_color;
} else { } else {
redirect_display.get_selection()->unselect (iter); (*iter)[columns.color] = *inactive_redirect_color;
} }
} }
void void
RedirectBox::redirects_reordered (const TreeModel::Path& path,const TreeModel::iterator& iter ,int* hmm) RedirectBox::row_deleted (const Gtk::TreeModel::Path& path)
{ {
/* this is called before the reorder has been done, so just queue if (!ignore_delete) {
something for idle time. compute_redirect_sort_keys ();
*/ }
Glib::signal_idle().connect (mem_fun(*this, &RedirectBox::compute_redirect_sort_keys));
} }
gint void
RedirectBox::compute_redirect_sort_keys () RedirectBox::compute_redirect_sort_keys ()
{ {
uint32_t sort_key = 0; uint32_t sort_key = 0;
@ -655,13 +625,13 @@ RedirectBox::compute_redirect_sort_keys ()
for (Gtk::TreeModel::Children::iterator iter = children.begin(); iter != children.end(); ++iter) { for (Gtk::TreeModel::Children::iterator iter = children.begin(); iter != children.end(); ++iter) {
Redirect *redirect = (*iter)[columns.redirect]; Redirect *redirect = (*iter)[columns.redirect];
redirect->set_sort_key (sort_key, this); redirect->set_sort_key (sort_key);
sort_key++; sort_key++;
} }
if (_route.sort_redirects ()) { if (_route.sort_redirects ()) {
redirects_changed (0); redisplay_redirects (0);
/* now tell them about the problem */ /* now tell them about the problem */
@ -673,7 +643,6 @@ You cannot reorder this set of redirects\n\
in that way because the inputs and\n\ in that way because the inputs and\n\
outputs do not work correctly.")); outputs do not work correctly."));
dialog.get_vbox()->pack_start (label); dialog.get_vbox()->pack_start (label);
dialog.add_button (Stock::OK, RESPONSE_ACCEPT); dialog.add_button (Stock::OK, RESPONSE_ACCEPT);
@ -682,14 +651,8 @@ outputs do not work correctly."));
dialog.set_modal (true); dialog.set_modal (true);
dialog.show_all (); dialog.show_all ();
// GTK2FIX
//dialog.realize();
//dialog.get_window()->set_decorations (Gdk::WMDecoration (GDK_DECOR_BORDER|GDK_DECOR_RESIZEH));
dialog.run (); dialog.run ();
} }
return FALSE;
} }
void void
@ -842,19 +805,24 @@ RedirectBox::paste_redirects ()
return; return;
} }
RedirectSelection& sel (_rr_selection.redirects); paste_redirect_list (_rr_selection.redirects);
list<Redirect*> others; }
for (list<Redirect*>::iterator i = sel.begin(); i != sel.end(); ++i) { void
RedirectBox::paste_redirect_list (list<Redirect*>& redirects)
{
list<Redirect*> copies;
for (list<Redirect*>::iterator i = redirects.begin(); i != redirects.end(); ++i) {
Redirect* copy = Redirect::clone (**i); Redirect* copy = Redirect::clone (**i);
copy->set_placement (_placement, this); copy->set_placement (_placement, this);
others.push_back (copy); copies.push_back (copy);
} }
if (_route.add_redirects (others, this)) { if (_route.add_redirects (copies, this)) {
for (list<Redirect*>::iterator i = others.begin(); i != others.end(); ++i) { for (list<Redirect*>::iterator i = copies.begin(); i != copies.end(); ++i) {
delete *i; delete *i;
} }
@ -1083,22 +1051,6 @@ RedirectBox::enter_box (GdkEventCrossing *ev, RedirectBox* rb)
return false; return false;
} }
bool
RedirectBox::leave_box (GdkEventCrossing *ev, RedirectBox* rb)
{
switch (ev->detail) {
case GDK_NOTIFY_INFERIOR:
break;
case GDK_NOTIFY_VIRTUAL:
/* fallthru */
default:
_current_redirect_box = 0;
}
return false;
}
void void
RedirectBox::register_actions () RedirectBox::register_actions ()
{ {
@ -1116,7 +1068,7 @@ RedirectBox::register_actions ()
ActionManager::plugin_selection_sensitive_actions.push_back(act); ActionManager::plugin_selection_sensitive_actions.push_back(act);
act = ActionManager::register_action (popup_act_grp, X_("copy"), _("Copy"), sigc::ptr_fun (RedirectBox::rb_copy)); act = ActionManager::register_action (popup_act_grp, X_("copy"), _("Copy"), sigc::ptr_fun (RedirectBox::rb_copy));
ActionManager::plugin_selection_sensitive_actions.push_back(act); ActionManager::plugin_selection_sensitive_actions.push_back(act);
ActionManager::ActionManager::register_action (popup_act_grp, X_("paste"), _("Paste"), sigc::ptr_fun (RedirectBox::rb_paste)); paste_action = ActionManager::register_action (popup_act_grp, X_("paste"), _("Paste"), sigc::ptr_fun (RedirectBox::rb_paste));
act = ActionManager::register_action (popup_act_grp, X_("rename"), _("Rename"), sigc::ptr_fun (RedirectBox::rb_rename)); act = ActionManager::register_action (popup_act_grp, X_("rename"), _("Rename"), sigc::ptr_fun (RedirectBox::rb_rename));
ActionManager::plugin_selection_sensitive_actions.push_back(act); ActionManager::plugin_selection_sensitive_actions.push_back(act);
ActionManager::register_action (popup_act_grp, X_("selectall"), _("Select All"), sigc::ptr_fun (RedirectBox::rb_select_all)); ActionManager::register_action (popup_act_grp, X_("selectall"), _("Select All"), sigc::ptr_fun (RedirectBox::rb_select_all));
@ -1199,6 +1151,8 @@ RedirectBox::rb_paste ()
if (_current_redirect_box == 0) { if (_current_redirect_box == 0) {
return; return;
} }
_current_redirect_box->paste_redirects ();
} }
void void

View File

@ -69,9 +69,6 @@ class RedirectBox : public Gtk::HBox
void set_width (Width); void set_width (Width);
void set_title (const std::string & title);
void set_title_shown (bool flag);
void update(); void update();
void select_all_redirects (); void select_all_redirects ();
@ -99,18 +96,24 @@ class RedirectBox : public Gtk::HBox
RouteRedirectSelection & _rr_selection; RouteRedirectSelection & _rr_selection;
struct ModelColumns : public Gtk::TreeModel::ColumnRecord { struct ModelColumns : public Gtk::TreeModel::ColumnRecord {
ModelColumns () { ModelColumns () {
add (text); add (text);
add (redirect); add (redirect);
} add (color);
Gtk::TreeModelColumn<std::string> text; }
Gtk::TreeModelColumn<ARDOUR::Redirect*> redirect; Gtk::TreeModelColumn<std::string> text;
Gtk::TreeModelColumn<ARDOUR::Redirect*> redirect;
Gtk::TreeModelColumn<Gdk::Color> color;
}; };
ModelColumns columns; ModelColumns columns;
Glib::RefPtr<Gtk::ListStore> model; Glib::RefPtr<Gtk::ListStore> model;
void selection_changed (); void selection_changed ();
static bool get_colors;
static Gdk::Color* active_redirect_color;
static Gdk::Color* inactive_redirect_color;
Gtk::EventBox redirect_eventbox; Gtk::EventBox redirect_eventbox;
Gtk::HBox redirect_hpacker; Gtk::HBox redirect_hpacker;
@ -139,18 +142,22 @@ class RedirectBox : public Gtk::HBox
void choose_plugin (); void choose_plugin ();
void insert_plugin_chosen (ARDOUR::Plugin *); void insert_plugin_chosen (ARDOUR::Plugin *);
gint redirect_button (GdkEventButton *); bool no_redirect_redisplay;
void redirects_changed (void *); bool ignore_delete;
bool redirect_button_press_event (GdkEventButton *);
void redisplay_redirects (void* src);
void show_redirect_active (ARDOUR::Redirect *, void *); void show_redirect_active (ARDOUR::Redirect *, void *);
void show_redirect_name (void*, ARDOUR::Redirect *); void show_redirect_name (void*, ARDOUR::Redirect *);
void add_redirect_to_display (ARDOUR::Redirect *); void add_redirect_to_display (ARDOUR::Redirect *);
void row_deleted (const Gtk::TreeModel::Path& path);
string redirect_name (ARDOUR::Redirect&); string redirect_name (ARDOUR::Redirect&);
void remove_redirect_gui (ARDOUR::Redirect *); void remove_redirect_gui (ARDOUR::Redirect *);
void redirects_reordered (const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&, int*); void redirects_reordered (const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&, int*);
gint compute_redirect_sort_keys (); void compute_redirect_sort_keys ();
vector<sigc::connection> redirect_active_connections; vector<sigc::connection> redirect_active_connections;
vector<sigc::connection> redirect_name_connections; vector<sigc::connection> redirect_name_connections;
@ -169,6 +176,8 @@ class RedirectBox : public Gtk::HBox
void for_selected_redirects (void (RedirectBox::*pmf)(ARDOUR::Redirect*)); void for_selected_redirects (void (RedirectBox::*pmf)(ARDOUR::Redirect*));
void get_selected_redirects (vector<ARDOUR::Redirect*>&); void get_selected_redirects (vector<ARDOUR::Redirect*>&);
static Glib::RefPtr<Gtk::Action> paste_action;
void paste_redirect_list (std::list<ARDOUR::Redirect*>& redirects);
void activate_redirect (ARDOUR::Redirect*); void activate_redirect (ARDOUR::Redirect*);
void deactivate_redirect (ARDOUR::Redirect*); void deactivate_redirect (ARDOUR::Redirect*);

View File

@ -217,11 +217,6 @@ RouteParams_UI::setup_redirect_boxes()
pre_redirect_box = new RedirectBox(PreFader, *session, *_route, *_plugin_selector, _rr_selection); pre_redirect_box = new RedirectBox(PreFader, *session, *_route, *_plugin_selector, _rr_selection);
post_redirect_box = new RedirectBox(PostFader, *session, *_route, *_plugin_selector, _rr_selection); post_redirect_box = new RedirectBox(PostFader, *session, *_route, *_plugin_selector, _rr_selection);
pre_redirect_box->set_title(_("Pre Redirects"));
pre_redirect_box->set_title_shown (true);
post_redirect_box->set_title(_("Post Redirects"));
post_redirect_box->set_title_shown (true);
pre_redir_hpane.add1 (*pre_redirect_box); pre_redir_hpane.add1 (*pre_redirect_box);
post_redir_hpane.add1 (*post_redirect_box); post_redir_hpane.add1 (*post_redirect_box);

View File

@ -74,7 +74,7 @@ class Redirect : public IO
virtual uint32_t natural_input_streams () const { return n_inputs(); } virtual uint32_t natural_input_streams () const { return n_inputs(); }
uint32_t sort_key() const { return _sort_key; } uint32_t sort_key() const { return _sort_key; }
void set_sort_key (uint32_t sk,void *src) { _sort_key = sk; sort_key_changed (this, src); } void set_sort_key (uint32_t key);
Placement placement() const { return _placement; } Placement placement() const { return _placement; }
void set_placement (Placement, void *src); void set_placement (Placement, void *src);
@ -87,7 +87,6 @@ class Redirect : public IO
virtual void set_block_size (jack_nframes_t nframes) {} virtual void set_block_size (jack_nframes_t nframes) {}
sigc::signal<void,Redirect*,void*> active_changed; sigc::signal<void,Redirect*,void*> active_changed;
sigc::signal<void,Redirect*,void*> sort_key_changed;
sigc::signal<void,Redirect*,void*> placement_changed; sigc::signal<void,Redirect*,void*> placement_changed;
sigc::signal<void,Redirect*,bool> AutomationPlaybackChanged; sigc::signal<void,Redirect*,bool> AutomationPlaybackChanged;
sigc::signal<void,Redirect*,uint32_t> AutomationChanged; sigc::signal<void,Redirect*,uint32_t> AutomationChanged;

View File

@ -81,6 +81,12 @@ Redirect::clone (const Redirect& other)
return 0; return 0;
} }
void
Redirect::set_sort_key (uint32_t key)
{
_sort_key = key;
}
void void
Redirect::set_placement (Placement p, void *src) Redirect::set_placement (Placement p, void *src)
{ {

View File

@ -54,6 +54,8 @@ BarController::BarController (Gtk::Adjustment& adj,
with_text = true; with_text = true;
use_parent = false; use_parent = false;
layout = darea.create_pango_layout("");
set_shadow_type (SHADOW_NONE); set_shadow_type (SHADOW_NONE);
initial_value = adjustment.get_value (); initial_value = adjustment.get_value ();
@ -308,10 +310,10 @@ BarController::expose (GdkEventExpose* event)
win->draw_rectangle (get_style()->get_bg_gc (get_state()), win->draw_rectangle (get_style()->get_bg_gc (get_state()),
false, false,
0, 0, darea.get_width(), darea.get_height()); 0, 0, darea.get_width() - 1, darea.get_height() - 1);
/* draw active box */ /* draw active box */
win->draw_rectangle (get_style()->get_fg_gc (get_state()), win->draw_rectangle (get_style()->get_fg_gc (get_state()),
true, true,
1 + x1, 1 + x1,
@ -347,11 +349,25 @@ BarController::expose (GdkEventExpose* event)
label_callback (buf, 64); label_callback (buf, 64);
if (buf[0] != '\0') { if (buf[0] != '\0') {
int width = 0, height;
darea.create_pango_layout(buf)->get_pixel_size(width, height); int width;
darea.set_size_request(width + 2, -1); int height;
layout->set_text (buf);
layout->get_pixel_size(width, height);
int xpos;
xpos = max (3, 1 + (x2 - (width/2)));
xpos = min (darea.get_width() - width - 3, xpos);
win->draw_layout (get_style()->get_text_gc (get_state()),
xpos,
(darea.get_height()/2) - (height/2),
layout);
} }
} }
return TRUE; return TRUE;
} }

View File

@ -73,6 +73,7 @@ class BarController : public Gtk::Frame
Gtkmm2ext::PopUp prompter; Gtkmm2ext::PopUp prompter;
MIDI::Controllable* midi_control; MIDI::Controllable* midi_control;
sigc::slot<void,char*,unsigned int> label_callback; sigc::slot<void,char*,unsigned int> label_callback;
Glib::RefPtr<Pango::Layout> layout;
Style _style; Style _style;
bool grabbed; bool grabbed;
bool switching; bool switching;