mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
meterbridge peak-indicator: button only
This commit is contained in:
parent
92c271b9d3
commit
e57a66fa31
1 changed files with 7 additions and 13 deletions
|
|
@ -142,13 +142,15 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
|
||||||
|
|
||||||
// peak display
|
// peak display
|
||||||
peak_display.set_name ("MixerStripPeakDisplay");
|
peak_display.set_name ("MixerStripPeakDisplay");
|
||||||
set_size_request_to_display_given_text (peak_display, "-80.g", 2, 6);
|
|
||||||
max_peak = minus_infinity();
|
max_peak = minus_infinity();
|
||||||
peak_display.set_label (_("-inf"));
|
|
||||||
peak_display.unset_flags (Gtk::CAN_FOCUS);
|
peak_display.unset_flags (Gtk::CAN_FOCUS);
|
||||||
|
peak_display.set_size_request(-1, 8);
|
||||||
|
|
||||||
peakbx.pack_start(peak_display, true, true);
|
Gtk::Alignment *peak_align = Gtk::manage (new Gtk::Alignment());
|
||||||
peakbx.set_size_request(-1, 16);
|
peak_align->set(0.5, 1.0, 0.75, 0.8); // TODO rather add padding 4px left+right (ticks)
|
||||||
|
peak_align->add(peak_display);
|
||||||
|
peakbx.pack_start(*peak_align, true, true);
|
||||||
|
peakbx.set_size_request(-1, 14);
|
||||||
|
|
||||||
// add track-name label -- TODO ellipsize
|
// add track-name label -- TODO ellipsize
|
||||||
label.set_text(_route->name().c_str());
|
label.set_text(_route->name().c_str());
|
||||||
|
|
@ -173,6 +175,7 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
|
||||||
meterbox.show();
|
meterbox.show();
|
||||||
level_meter->show();
|
level_meter->show();
|
||||||
meter_align->show();
|
meter_align->show();
|
||||||
|
peak_align->show();
|
||||||
btnbox.show();
|
btnbox.show();
|
||||||
label.show();
|
label.show();
|
||||||
|
|
||||||
|
|
@ -239,17 +242,9 @@ MeterStrip::strip_property_changed (const PropertyChange& what_changed)
|
||||||
void
|
void
|
||||||
MeterStrip::fast_update ()
|
MeterStrip::fast_update ()
|
||||||
{
|
{
|
||||||
char buf[32];
|
|
||||||
float mpeak = level_meter->update_meters();
|
float mpeak = level_meter->update_meters();
|
||||||
if (mpeak > max_peak) {
|
if (mpeak > max_peak) {
|
||||||
max_peak = mpeak;
|
max_peak = mpeak;
|
||||||
if (mpeak <= -200.0f) {
|
|
||||||
peak_display.set_label (_("-inf"));
|
|
||||||
} else {
|
|
||||||
snprintf (buf, sizeof(buf), "%.1f", mpeak);
|
|
||||||
peak_display.set_label (buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mpeak >= 0.0f) {
|
if (mpeak >= 0.0f) {
|
||||||
peak_display.set_name ("MixerStripPeakDisplayPeak");
|
peak_display.set_name ("MixerStripPeakDisplayPeak");
|
||||||
}
|
}
|
||||||
|
|
@ -766,7 +761,6 @@ MeterStrip::reset_peak_display ()
|
||||||
_route->shared_peak_meter()->reset_max();
|
_route->shared_peak_meter()->reset_max();
|
||||||
level_meter->clear_meters();
|
level_meter->clear_meters();
|
||||||
max_peak = -INFINITY;
|
max_peak = -INFINITY;
|
||||||
peak_display.set_label (_("-inf"));
|
|
||||||
peak_display.set_name ("MixerStripPeakDisplay");
|
peak_display.set_name ("MixerStripPeakDisplay");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue