Adding level meter support, but WIP

parent 1c9a9b67
......@@ -176,6 +176,8 @@ void RedstartWindow::ConnectSignalsAndSlots()
connect( ui->comboBox_core_settings_log_level, SIGNAL( currentIndexChanged( int ) ), this, SLOT( CoreChangeLogLevel( int ) ) );
connect( &m_qSporadicTimer, SIGNAL( timeout() ), this, SLOT( SporadicTimeout() ) );
connect( &m_qSporadicTimer, SIGNAL( timeout() ), ui->graphicsView_input_levels, SLOT( UpdateLevels() ) );
connect( &m_qSporadicTimer, SIGNAL( timeout() ), ui->graphicsView_output_levels, SLOT( UpdateLevels() ) );
}
......@@ -391,7 +393,12 @@ void RedstartWindow::HandleVAEvent( const CVAEvent* pEvent )
//ui->statusBar->showMessage( pEvent->sParam.c_str() );
break;
case CVAEvent::MEASURES_UPDATE:
UpdateMeasures( pEvent->vfInputRMSs, pEvent->vfInputPeaks, pEvent->vfOutputRMSs, pEvent->vfOutputPeaks );
if( pEvent->sParam == "RenderingModule" )
; // @todo update rendering module GUI for sObjectID
else if( pEvent->sParam == "ReproductionModule" )
; // @todo update reproduction module GUI for sObjectID
else if( pEvent->sParam.empty() )
UpdateMeasures( pEvent->vfInputRMSs, pEvent->vfInputPeaks, pEvent->vfOutputRMSs, pEvent->vfOutputPeaks ); // Core i/o
break;
}
......@@ -426,7 +433,21 @@ void RedstartWindow::HandleVAEvent( const CVAEvent* pEvent )
void RedstartWindow::UpdateMeasures( const std::vector< float >& vfInputRMSs, const std::vector< float >& vfInputPeaks, const std::vector< float >& vfOutputRMSs, const std::vector< float >& vfOutputPeaks )
{
// @todo feed level meters
int iNumInputChannels = (int) vfInputRMSs.size();
assert( vfInputRMSs.size() == vfInputPeaks.size() );
if( ui->graphicsView_input_levels->GetNumChannels() != iNumInputChannels )
ui->graphicsView_input_levels->SetNumChannels( iNumInputChannels );
ui->graphicsView_input_levels->SetRMSs( vfInputRMSs );
ui->graphicsView_input_levels->SetPeaks( vfInputPeaks );
int iNumOutputChannels = ( int ) vfOutputRMSs.size();
assert( vfOutputRMSs.size() == vfOutputPeaks.size() );
if( ui->graphicsView_output_levels->GetNumChannels() != iNumOutputChannels )
ui->graphicsView_output_levels->SetNumChannels( iNumOutputChannels );
ui->graphicsView_output_levels->SetRMSs( vfInputRMSs );
ui->graphicsView_output_levels->SetPeaks( vfInputPeaks );
}
void RedstartWindow::AcquireAsioDevices()
......
......@@ -651,7 +651,7 @@ background-color: rgb(208, 255, 188);</string>
</widget>
</item>
<item row="1" column="1">
<widget class="QGraphicsView" name="graphicsView_output_levels">
<widget class="CITAQtWLevelMeter" name="graphicsView_output_levels">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
......@@ -714,7 +714,7 @@ background-color: rgb(208, 255, 188);</string>
</widget>
</item>
<item row="1" column="0">
<widget class="QGraphicsView" name="graphicsView_input_levels">
<widget class="CITAQtWLevelMeter" name="graphicsView_input_levels">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
......@@ -1287,6 +1287,11 @@ background-color: rgb(208, 255, 188);</string>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>CITAQtWLevelMeter</class>
<extends>QGraphicsView</extends>
<header location="global">ITAQtWLevelMeter.h</header>
</customwidget>
<customwidget>
<class>RedstartSessionListView</class>
<extends>QListView</extends>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment