kopia lustrzana https://gitlab.com/eliggett/wfview
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
rodzic
decdfe370b
commit
274cc65dbf
13
meter.cpp
13
meter.cpp
|
@ -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;
|
||||
|
|
1
meter.h
1
meter.h
|
@ -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();
|
||||
|
||||
|
|
26
wfmain.cpp
26
wfmain.cpp
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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">
|
||||
|
|
Ładowanie…
Reference in New Issue