meterbridge: if track-name starts with number, display only number
This commit is contained in:
parent
c47afaab74
commit
7121e19437
@ -352,6 +352,7 @@ widget "*ProcessorList*" style:highest "processor_list"
|
||||
widget "*PortMatrixLabel*" style:highest "small_text"
|
||||
widget "*MidiTracerTextView" style:highest "midi_tracer_textview"
|
||||
widget "*solo isolate" style:highest "solo_isolate"
|
||||
widget "meterbridge numlabel" style:highest "larger_text"
|
||||
widget "*meterbridge label" style:highest "meterbridge_label"
|
||||
widget "*solo safe" style:highest "solo_safe"
|
||||
widget "*ContrastingPopup" style:highest "contrasting_popup"
|
||||
|
@ -147,8 +147,23 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
|
||||
name_label.set_size_request(18, 50);
|
||||
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.pack_start(name_label, true, false, 3);
|
||||
namebx.pack_start(number_label, true, false, 0);
|
||||
|
||||
// rec-enable button
|
||||
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();
|
||||
peak_align.show();
|
||||
btnbox.show();
|
||||
name_label.show();
|
||||
namebx.show();
|
||||
|
||||
_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)
|
||||
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
|
||||
@ -378,6 +403,12 @@ MeterStrip::set_metric_mode (int metricmode)
|
||||
meter_metric_area.queue_draw ();
|
||||
}
|
||||
|
||||
void
|
||||
MeterStrip::set_pos (int pos)
|
||||
{
|
||||
number_label.set_alignment(1.0, pos%2 ? .2 : .8 );
|
||||
}
|
||||
|
||||
gint
|
||||
MeterStrip::meter_ticks1_expose (GdkEventExpose *ev)
|
||||
{
|
||||
|
@ -63,6 +63,7 @@ class MeterStrip : public Gtk::VBox, public RouteUI
|
||||
void set_meter_type_multi (int, ARDOUR::RouteGroup*, ARDOUR::MeterType);
|
||||
|
||||
void set_metric_mode (int);
|
||||
void set_pos(int);
|
||||
bool has_midi() { return _has_midi; }
|
||||
|
||||
protected:
|
||||
@ -89,6 +90,7 @@ class MeterStrip : public Gtk::VBox, public RouteUI
|
||||
Gtk::HBox meterbox;
|
||||
Gtk::HBox namebx;
|
||||
ArdourButton name_label;
|
||||
Gtk::Label number_label;
|
||||
Gtk::DrawingArea meter_metric_area;
|
||||
Gtk::DrawingArea meter_ticks1_area;
|
||||
Gtk::DrawingArea meter_ticks2_area;
|
||||
|
@ -587,6 +587,7 @@ Meterbridge::sync_order_keys (RouteSortOrderKey src)
|
||||
strips.sort(sorter);
|
||||
|
||||
int pos = 0;
|
||||
int vis = 0;
|
||||
|
||||
for (list<MeterBridgeStrip>::iterator i = strips.begin(); i != strips.end(); ++i) {
|
||||
|
||||
@ -598,6 +599,7 @@ Meterbridge::sync_order_keys (RouteSortOrderKey src)
|
||||
if (_show_master) {
|
||||
(*i).s->show();
|
||||
(*i).visible = true;
|
||||
vis++;
|
||||
} else {
|
||||
(*i).s->hide();
|
||||
(*i).visible = false;
|
||||
@ -610,6 +612,7 @@ Meterbridge::sync_order_keys (RouteSortOrderKey src)
|
||||
if (_show_busses) {
|
||||
(*i).s->show();
|
||||
(*i).visible = true;
|
||||
vis++;
|
||||
} else {
|
||||
(*i).s->hide();
|
||||
(*i).visible = false;
|
||||
@ -619,6 +622,7 @@ Meterbridge::sync_order_keys (RouteSortOrderKey src)
|
||||
if (_show_midi) {
|
||||
(*i).s->show();
|
||||
(*i).visible = true;
|
||||
vis++;
|
||||
} else {
|
||||
(*i).s->hide();
|
||||
(*i).visible = false;
|
||||
@ -627,7 +631,9 @@ Meterbridge::sync_order_keys (RouteSortOrderKey src)
|
||||
else {
|
||||
(*i).s->show();
|
||||
(*i).visible = true;
|
||||
vis++;
|
||||
}
|
||||
(*i).s->set_pos(vis);
|
||||
meterarea.reorder_child(*((*i).s), pos++);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user