Update Push2 level-meter display (use new API)
The meter-type is now implicit set by route/meter-processor, common to all UIs.
This commit is contained in:
parent
9f20631984
commit
43fe5c0487
@ -51,7 +51,6 @@ LevelMeter::LevelMeter (Push2& p, Item* parent, int len, Meter::Orientation o)
|
|||||||
, meter_length (len)
|
, meter_length (len)
|
||||||
, thin_meter_width(2)
|
, thin_meter_width(2)
|
||||||
, max_peak (minus_infinity())
|
, max_peak (minus_infinity())
|
||||||
, meter_type (MeterPeak)
|
|
||||||
, visible_meter_type (MeterType(0))
|
, visible_meter_type (MeterType(0))
|
||||||
, midi_count (0)
|
, midi_count (0)
|
||||||
, meter_count (0)
|
, meter_count (0)
|
||||||
@ -89,7 +88,7 @@ LevelMeter::set_meter (PeakMeter* meter)
|
|||||||
|
|
||||||
if (_meter) {
|
if (_meter) {
|
||||||
_meter->ConfigurationChanged.connect (_configuration_connection, invalidator(*this), boost::bind (&LevelMeter::configuration_changed, this, _1, _2), &p2);
|
_meter->ConfigurationChanged.connect (_configuration_connection, invalidator(*this), boost::bind (&LevelMeter::configuration_changed, this, _1, _2), &p2);
|
||||||
_meter->TypeChanged.connect (_meter_type_connection, invalidator (*this), boost::bind (&LevelMeter::meter_type_changed, this, _1), &p2);
|
_meter->MeterTypeChanged.connect (_meter_type_connection, invalidator (*this), boost::bind (&LevelMeter::meter_type_changed, this, _1), &p2);
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_meters (meter_length, regular_meter_width, thin_meter_width);
|
setup_meters (meter_length, regular_meter_width, thin_meter_width);
|
||||||
@ -161,6 +160,7 @@ LevelMeter::update_meters ()
|
|||||||
if (n < nmidi) {
|
if (n < nmidi) {
|
||||||
(*i).meter->set (_meter->meter_level (n, MeterPeak));
|
(*i).meter->set (_meter->meter_level (n, MeterPeak));
|
||||||
} else {
|
} else {
|
||||||
|
MeterType meter_type = _meter->meter_type ();
|
||||||
const float peak = _meter->meter_level (n, meter_type);
|
const float peak = _meter->meter_level (n, meter_type);
|
||||||
if (meter_type == MeterPeak) {
|
if (meter_type == MeterPeak) {
|
||||||
(*i).meter->set (log_meter (peak));
|
(*i).meter->set (log_meter (peak));
|
||||||
@ -226,7 +226,6 @@ LevelMeter::configuration_changed (ChanCount /*in*/, ChanCount /*out*/)
|
|||||||
void
|
void
|
||||||
LevelMeter::meter_type_changed (MeterType t)
|
LevelMeter::meter_type_changed (MeterType t)
|
||||||
{
|
{
|
||||||
meter_type = t;
|
|
||||||
setup_meters (meter_length, regular_meter_width, thin_meter_width);
|
setup_meters (meter_length, regular_meter_width, thin_meter_width);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,6 +260,7 @@ LevelMeter::setup_meters (int len, int initial_width, int thin_width)
|
|||||||
return; /* do it later or never */
|
return; /* do it later or never */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MeterType meter_type = _meter->meter_type ();
|
||||||
uint32_t nmidi = _meter->input_streams().n_midi();
|
uint32_t nmidi = _meter->input_streams().n_midi();
|
||||||
uint32_t nmeters = _meter->input_streams().n_total();
|
uint32_t nmeters = _meter->input_streams().n_total();
|
||||||
regular_meter_width = initial_width;
|
regular_meter_width = initial_width;
|
||||||
@ -482,13 +482,6 @@ LevelMeter::setup_meters (int len, int initial_width, int thin_width)
|
|||||||
meter_count = nmeters;
|
meter_count = nmeters;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
LevelMeter::set_type(MeterType t)
|
|
||||||
{
|
|
||||||
meter_type = t;
|
|
||||||
_meter->set_type(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LevelMeter::clear_meters (bool reset_highlight)
|
void LevelMeter::clear_meters (bool reset_highlight)
|
||||||
{
|
{
|
||||||
for (vector<MeterInfo>::iterator i = meters.begin(); i < meters.end(); i++) {
|
for (vector<MeterInfo>::iterator i = meters.begin(); i < meters.end(); i++) {
|
||||||
|
@ -54,8 +54,6 @@ class LevelMeter : public ArdourCanvas::Container, public sigc::trackable
|
|||||||
void setup_meters (int len=0, int width=3, int thin=2);
|
void setup_meters (int len=0, int width=3, int thin=2);
|
||||||
void set_max_audio_meter_count (uint32_t cnt = 0);
|
void set_max_audio_meter_count (uint32_t cnt = 0);
|
||||||
|
|
||||||
void set_type (ARDOUR::MeterType);
|
|
||||||
ARDOUR::MeterType get_type () { return meter_type; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Push2& p2;
|
Push2& p2;
|
||||||
@ -84,7 +82,6 @@ class LevelMeter : public ArdourCanvas::Container, public sigc::trackable
|
|||||||
guint16 thin_meter_width;
|
guint16 thin_meter_width;
|
||||||
std::vector<MeterInfo> meters;
|
std::vector<MeterInfo> meters;
|
||||||
float max_peak;
|
float max_peak;
|
||||||
ARDOUR::MeterType meter_type;
|
|
||||||
ARDOUR::MeterType visible_meter_type;
|
ARDOUR::MeterType visible_meter_type;
|
||||||
uint32_t midi_count;
|
uint32_t midi_count;
|
||||||
uint32_t meter_count;
|
uint32_t meter_count;
|
||||||
|
Loading…
Reference in New Issue
Block a user