13
0

meterbridge: if track-name starts with number, display only number

This commit is contained in:
Robin Gareus 2013-07-08 16:24:17 +02:00
parent c47afaab74
commit 7121e19437
4 changed files with 41 additions and 1 deletions

View File

@ -352,6 +352,7 @@ widget "*ProcessorList*" style:highest "processor_list"
widget "*PortMatrixLabel*" style:highest "small_text" widget "*PortMatrixLabel*" style:highest "small_text"
widget "*MidiTracerTextView" style:highest "midi_tracer_textview" widget "*MidiTracerTextView" style:highest "midi_tracer_textview"
widget "*solo isolate" style:highest "solo_isolate" widget "*solo isolate" style:highest "solo_isolate"
widget "meterbridge numlabel" style:highest "larger_text"
widget "*meterbridge label" style:highest "meterbridge_label" widget "*meterbridge label" style:highest "meterbridge_label"
widget "*solo safe" style:highest "solo_safe" widget "*solo safe" style:highest "solo_safe"
widget "*ContrastingPopup" style:highest "contrasting_popup" widget "*ContrastingPopup" style:highest "contrasting_popup"

View File

@ -147,8 +147,23 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
name_label.set_size_request(18, 50); name_label.set_size_request(18, 50);
name_label.set_alignment(-1.0, .5); name_label.set_alignment(-1.0, .5);
number_label.set_alignment(1.0, .5);
number_label.set_name("meterbridge numlabel");
if (atoi(_route->name().c_str()) > 0) {
char buf[16];
snprintf(buf, 15, "%d", atoi(_route->name().c_str()));
number_label.set_text(buf);
number_label.show();
name_label.hide();
} else {
name_label.show();
number_label.hide();
}
namebx.set_size_request(18, 52); namebx.set_size_request(18, 52);
namebx.pack_start(name_label, true, false, 3); namebx.pack_start(name_label, true, false, 3);
namebx.pack_start(number_label, true, false, 0);
// rec-enable button // rec-enable button
btnbox.pack_start(*rec_enable_button, true, false); btnbox.pack_start(*rec_enable_button, true, false);
@ -169,7 +184,6 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
meter_align.show(); meter_align.show();
peak_align.show(); peak_align.show();
btnbox.show(); btnbox.show();
name_label.show();
namebx.show(); namebx.show();
_route->shared_peak_meter()->ConfigurationChanged.connect ( _route->shared_peak_meter()->ConfigurationChanged.connect (
@ -254,6 +268,17 @@ MeterStrip::strip_property_changed (const PropertyChange& what_changed)
} }
ENSURE_GUI_THREAD (*this, &MeterStrip::strip_name_changed, what_changed) ENSURE_GUI_THREAD (*this, &MeterStrip::strip_name_changed, what_changed)
name_label.set_text(_route->name()); name_label.set_text(_route->name());
if (atoi(_route->name().c_str()) > 0) {
char buf[16];
snprintf(buf, 15, "%d", atoi(_route->name().c_str()));
number_label.set_text(buf);
number_label.show();
name_label.hide();
} else {
name_label.show();
number_label.hide();
}
} }
void void
@ -378,6 +403,12 @@ MeterStrip::set_metric_mode (int metricmode)
meter_metric_area.queue_draw (); meter_metric_area.queue_draw ();
} }
void
MeterStrip::set_pos (int pos)
{
number_label.set_alignment(1.0, pos%2 ? .2 : .8 );
}
gint gint
MeterStrip::meter_ticks1_expose (GdkEventExpose *ev) MeterStrip::meter_ticks1_expose (GdkEventExpose *ev)
{ {

View File

@ -63,6 +63,7 @@ class MeterStrip : public Gtk::VBox, public RouteUI
void set_meter_type_multi (int, ARDOUR::RouteGroup*, ARDOUR::MeterType); void set_meter_type_multi (int, ARDOUR::RouteGroup*, ARDOUR::MeterType);
void set_metric_mode (int); void set_metric_mode (int);
void set_pos(int);
bool has_midi() { return _has_midi; } bool has_midi() { return _has_midi; }
protected: protected:
@ -89,6 +90,7 @@ class MeterStrip : public Gtk::VBox, public RouteUI
Gtk::HBox meterbox; Gtk::HBox meterbox;
Gtk::HBox namebx; Gtk::HBox namebx;
ArdourButton name_label; ArdourButton name_label;
Gtk::Label number_label;
Gtk::DrawingArea meter_metric_area; Gtk::DrawingArea meter_metric_area;
Gtk::DrawingArea meter_ticks1_area; Gtk::DrawingArea meter_ticks1_area;
Gtk::DrawingArea meter_ticks2_area; Gtk::DrawingArea meter_ticks2_area;

View File

@ -587,6 +587,7 @@ Meterbridge::sync_order_keys (RouteSortOrderKey src)
strips.sort(sorter); strips.sort(sorter);
int pos = 0; int pos = 0;
int vis = 0;
for (list<MeterBridgeStrip>::iterator i = strips.begin(); i != strips.end(); ++i) { for (list<MeterBridgeStrip>::iterator i = strips.begin(); i != strips.end(); ++i) {
@ -598,6 +599,7 @@ Meterbridge::sync_order_keys (RouteSortOrderKey src)
if (_show_master) { if (_show_master) {
(*i).s->show(); (*i).s->show();
(*i).visible = true; (*i).visible = true;
vis++;
} else { } else {
(*i).s->hide(); (*i).s->hide();
(*i).visible = false; (*i).visible = false;
@ -610,6 +612,7 @@ Meterbridge::sync_order_keys (RouteSortOrderKey src)
if (_show_busses) { if (_show_busses) {
(*i).s->show(); (*i).s->show();
(*i).visible = true; (*i).visible = true;
vis++;
} else { } else {
(*i).s->hide(); (*i).s->hide();
(*i).visible = false; (*i).visible = false;
@ -619,6 +622,7 @@ Meterbridge::sync_order_keys (RouteSortOrderKey src)
if (_show_midi) { if (_show_midi) {
(*i).s->show(); (*i).s->show();
(*i).visible = true; (*i).visible = true;
vis++;
} else { } else {
(*i).s->hide(); (*i).s->hide();
(*i).visible = false; (*i).visible = false;
@ -627,7 +631,9 @@ Meterbridge::sync_order_keys (RouteSortOrderKey src)
else { else {
(*i).s->show(); (*i).s->show();
(*i).visible = true; (*i).visible = true;
vis++;
} }
(*i).s->set_pos(vis);
meterarea.reorder_child(*((*i).s), pos++); meterarea.reorder_child(*((*i).s), pos++);
} }
} }