Setting VA core output stream to be shown in plain text edit widget

parent 2a89c864
......@@ -33,7 +33,7 @@ class RedstartCoreOutputPlainTextEdit : public QPlainTextEdit
virtual int_type overflow( int_type c )
{
if( c != EOF )
if( c != EOF && c != '\n' )
m_pParent->write( ( char ) c );
else
m_pParent->append();
......@@ -86,6 +86,7 @@ public:
inline void append()
{
appendPlainText( m_sLine );
m_sLine.clear();
};
inline void write( char c )
......
......@@ -235,6 +235,7 @@ void RedstartWindow::PostCoreStart()
ui->menuRun->setEnabled( true );
ui->groupBox_core_control->setEnabled( true );
ui->groupBox_level_meters->setEnabled( true );
ui->groupBox_output->setEnabled( true );
CVAVersionInfo oVersion;
m_pVAInterface->GetVersionInfo( &oVersion );
......@@ -244,8 +245,18 @@ void RedstartWindow::PostCoreStart()
oArgs[ "getloglevel" ] = true;
const CVAStruct oReturn = m_pVAInterface->CallModule( "VACore", oArgs );
const int iCurrentLogLevel = oReturn[ "loglevel" ];
ui->comboBox_core_settings_log_level->setCurrentIndex( iCurrentLogLevel );
CVAStruct oSearchPaths = m_pVAInterface->GetSearchPaths();
QStringList sPathList;
CVAStruct::const_iterator cit = oSearchPaths.Begin();
while( cit != oSearchPaths.End() )
{
const CVAStructValue& oValue( cit++->second );
if( oValue.IsString() )
sPathList << std::string( oValue ).c_str();
}
ui->listView_paths; // @todo
}
void RedstartWindow::PostCoreStop()
......@@ -262,6 +273,21 @@ void RedstartWindow::PostCoreStop()
ui->menuRun->setEnabled( false );
ui->groupBox_core_control->setEnabled( false );
ui->groupBox_level_meters->setEnabled( false );
ui->groupBox_output->setEnabled( false );
// Clear
ui->lineEdit_core_settings_version->clear();
ui->listView_paths->reset();
// Reset elements
bool bPreserveCoreControlValues = m_qSettings.value( "PreserveCoreControlValues", true ).toBool(); // @todo control this setting via preferences dialog
if( !bPreserveCoreControlValues )
{
emit InputSignalChangedDecibel( 0.0f );
emit OutputSignalChangedDecibel( 0.0f );
emit InputIsMutedChanged( false );
emit OutputIsMutedChanged( false );
}
}
void RedstartWindow::RestoreWindowSize()
......@@ -285,8 +311,8 @@ void RedstartWindow::HandleVAEvent( const CVAEvent* pEvent )
/* Don't handle events that have been triggered from this interface connection
if( pEvent->pSender == m_pVAInterface )
return;
*/
return;
*/
switch( pEvent->iEventType )
{
......@@ -511,11 +537,10 @@ void RedstartWindow::on_pushButton_start_stop_clicked()
oVAConfigArgs[ "Paths" ][ "redstart_data_dev" ] = "../VACore/data";
m_pVAInterface = VACore::CreateCoreInstance( oVAConfigArgs );
m_pVAInterface->Initialize();
m_pVAInterface->SetOutputStream( ui->plainTextEdit_core_output->GetOutputStream() );
m_pVAInterface->Initialize();
m_pVAInterface->AttachEventHandler( this );
m_pVAInterface->SetDebugStream( ui->plainTextEdit_core_output->GetOutputStream() );
m_pVANetServer->SetCoreInstance( m_pVAInterface );
bool bOK;
......@@ -955,5 +980,5 @@ void RedstartWindow::on_actionRunSimpleExample_triggered()
void RedstartWindow::on_pushButton_core_control_reset_clicked()
{
if( m_pVAInterface )
m_pVAInterface->Reset();
m_pVAInterface->Reset();
}
......@@ -71,8 +71,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1012</width>
<height>671</height>
<width>1015</width>
<height>709</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5" stretch="1,0,0,0,1">
......@@ -886,6 +886,7 @@ background-color: rgb(208, 255, 188);</string>
</property>
<addaction name="actionRunSimpleExample"/>
<addaction name="actionCirculating_source"/>
<addaction name="actionExperimental_BRIR_switching"/>
</widget>
<widget class="QMenu" name="menuHelp">
<property name="title">
......@@ -1102,7 +1103,7 @@ background-color: rgb(208, 255, 188);</string>
</action>
<action name="actionCirculating_source">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="text">
<string>Circulating source</string>
......@@ -1130,6 +1131,11 @@ background-color: rgb(208, 255, 188);</string>
<string>N, D</string>
</property>
</action>
<action name="actionExperimental_BRIR_switching">
<property name="text">
<string>Experimental BRIR switching</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
......
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