wfview now uses the meter's own balistics (average and peak code). This

makes it very easy to meter any parameter 0-255. Meter Type "meterNone"
or other will display data in "raw" format.
audioplugins
Elliott Liggett 2021-07-19 16:56:04 -07:00
rodzic decdfe370b
commit 274cc65dbf
4 zmienionych plików z 15 dodań i 27 usunięć

Wyświetl plik

@ -149,11 +149,9 @@ void meter::paintEvent(QPaintEvent *)
}
void meter::setLevels(int current, int peak, int average)
void meter::setLevel(int current)
{
this->current = current;
this->peak = peak;
this->average = average;
avgLevels[(avgPosition++)%averageBalisticLength] = current;
peakLevels[(peakPosition++)%peakBalisticLength] = current;
@ -184,6 +182,15 @@ void meter::setLevels(int current, int peak, int average)
this->update();
}
void meter::setLevels(int current, int peak, int average)
{
this->current = current;
this->peak = peak;
this->average = average;
this->update();
}
void meter::updateDrawing(int num)
{
fontSize = num;

Wyświetl plik

@ -22,6 +22,7 @@ public slots:
void updateDrawing(int num);
void setLevels(int current, int peak, int average);
void setLevel(int current);
void setMeterType(meterKind type);
meterKind getMeterType();

Wyświetl plik

@ -4533,42 +4533,22 @@ void wfmain::receiveLANGain(unsigned char level)
void wfmain::receiveMeter(meterKind inMeter, unsigned char level)
{
unsigned int peak = 0;
unsigned int sum=0;
unsigned int average=0;
switch(inMeter)
{
case meterS:
SMeterReadings[(smeterPos++)%SMeterReadings.length()] = level;
for(int i=0; i < SMeterReadings.length(); i++)
{
if((unsigned char)SMeterReadings.at(i) > peak)
peak = (unsigned char)SMeterReadings.at(i);
sum += (unsigned char)SMeterReadings.at(i);
}
average = sum / SMeterReadings.length();
ui->meterSPoWidget->setMeterType(meterS);
ui->meterSPoWidget->setLevels(level, peak, average);
ui->meterSPoWidget->setLevel(level);
ui->meterSPoWidget->repaint();
break;
case meterPower:
powerMeterReadings[(powerMeterPos++)%powerMeterReadings.length()] = level;
for(int i=0; i < powerMeterReadings.length(); i++)
{
if((unsigned char)powerMeterReadings.at(i) > peak)
peak = (unsigned char)powerMeterReadings.at(i);
sum += (unsigned char)powerMeterReadings.at(i);
}
average = sum / powerMeterReadings.length();
ui->meterSPoWidget->setMeterType(meterPower);
ui->meterSPoWidget->setLevels(level, peak, average);
ui->meterSPoWidget->setLevel(level);
ui->meterSPoWidget->update();
break;
default:
if(ui->meter2Widget->getMeterType() == inMeter)
{
ui->meter2Widget->setLevels(level, level, level);
ui->meter2Widget->setLevel(level);
}
break;
}

Wyświetl plik

@ -18,7 +18,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>3</number>
<number>1</number>
</property>
<widget class="QWidget" name="mainTab">
<attribute name="title">