Gui progress

parent 84d98645
......@@ -35,7 +35,6 @@ public:
this->setModel( m_pModel );
SetDefaults();
//setEditTriggers( QAbstractItemView::NoEditTriggers );
//setSelectionMode( QAbstractItemView::SingleSelection );
};
......@@ -43,52 +42,19 @@ public:
inline void SetDefaults()
{
m_pModel->setHorizontalHeaderLabels( QStringList() << "Key" << "Value" << "Type" );
resizeColumnToContents( 1 );
};
void SetStruct( const CVAStruct& oStruct )
{
m_pModel->clear();
SetDefaults();
BuildStandardItemFromVAStruct( oStruct, m_pModel->invisibleRootItem() );
expandAll();
resizeColumnToContents( 0 );
resizeColumnToContents( 1 );
resizeColumnToContents( 2 );
return;
CVAStruct oMyStruct;
oMyStruct[ "hi" ] = "wo!?!";
//rootNode->appendRow( BuildStandardItemFromVAStruct( oMyStruct ) );
//return;
QList<QStandardItem *> qlDescriptors;
qlDescriptors << new QStandardItem( "Name" );
qlDescriptors << new QStandardItem( "Talkthrough" );
qlDescriptors << new QStandardItem( "String" );
m_pModel->invisibleRootItem()->appendRow( qlDescriptors );
QList<QStandardItem *> qlDescriptor2;
qlDescriptor2 << new QStandardItem( "weiteres" );
m_pModel->invisibleRootItem()->appendRow( qlDescriptor2 );
QList<QStandardItem *> qlDescriptor3;
qlDescriptor3 << new QStandardItem( "direction" );
qlDescriptor2.first()->appendRow( qlDescriptor3 );
QList<QStandardItem *> qlDescriptor4;
qlDescriptor4 << new QStandardItem( "x" );
qlDescriptor4 << new QStandardItem( "1.0" );
qlDescriptor4 << new QStandardItem( "Double" );
QList<QStandardItem *> qlDescriptor5;
qlDescriptor5 << new QStandardItem( "y" );
qlDescriptor5 << new QStandardItem( "1.0" );
qlDescriptor5 << new QStandardItem( "Double" );
qlDescriptor3.first()->appendRow( qlDescriptor4 );
qlDescriptor3.first()->appendRow( qlDescriptor5 );
};
inline ~RedstartSessionDetailsTreeView() {};
......
......@@ -232,6 +232,45 @@ void RedstartWindow::RestoreWindowSize()
restoreState( m_qSettings.value( "Redstart/gui/WindowState" ).toByteArray() );
}
void RedstartWindow::HandleVAEvent( const CVAEvent* pEvent )
{
// Handle pushable events
switch( pEvent->iEventType )
{
case CVAEvent::VA_EVENT_PROGRESS_UPDATE:
ui->statusBar->showMessage( pEvent->sParam.c_str() );
break;
case CVAEvent::VA_EVENT_MEASURES_UPDATE:
UpdateMeasures( pEvent->vfInputRMSs, pEvent->vfInputPeaks, pEvent->vfOutputRMSs, pEvent->vfOutputPeaks );
break;
}
// Don't handle events that have been triggered from this interface connection
if( pEvent->pSender == m_pVAInterface )
return;
switch( pEvent->iEventType )
{
case CVAEvent::VA_EVENT_INPUT_GAIN_CHANGED:
ui->dial_core_control_input_gain->setValue( pEvent->dVolume );
break;
case CVAEvent::VA_EVENT_OUTPUT_GAIN_CHANGED:
ui->dial_core_control_output_gain->setValue( pEvent->dVolume );
break;
case CVAEvent::VA_EVENT_INPUT_MUTING_CHANGED:
ui->checkBox_core_control_input_mute->setChecked( pEvent->bMuted );
break;
case CVAEvent::VA_EVENT_OUTPUT_MUTING_CHANGED:
ui->checkBox_core_control_output_mute->setChecked( pEvent->bMuted );
break;
}
}
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
}
void RedstartWindow::AcquireAsioDevices()
{
std::vector< CAudioDeviceSpecs > voAudioDevices = m_voAudioDevices;
......@@ -436,7 +475,7 @@ void RedstartWindow::on_pushButton_start_stop_clicked()
m_pVAInterface->Initialize();
// @todo attach event handler
//m_pVAInterface->AttachEventHandler( this );
m_pVAInterface->AttachEventHandler( this );
m_pVANetServer->SetCoreInstance( m_pVAInterface );
......
......@@ -19,6 +19,8 @@
#include "RedstartSessionList.h"
#include <VAEvent.h>
#include <ITAPortaudioInterface.h>
#ifdef WIN32
#include <ITAAsioInterface.h>
......@@ -36,7 +38,7 @@ namespace Ui
class RedstartWindow;
}
class RedstartWindow : public QMainWindow
class RedstartWindow : public QMainWindow, public IVAEventHandler
{
Q_OBJECT
......@@ -149,6 +151,8 @@ private:
void RestoreWindowSize();
void HandleVAEvent( const CVAEvent* );
private:
Ui::RedstartWindow* ui;
......@@ -164,6 +168,7 @@ private:
void LoadConfiguration();
void StoreConfiguration();
void UpdateMeasures( const std::vector< float >& vfInputRMSs, const std::vector< float >& vfInputPeaks, const std::vector< float >& vfOutputRMSs, const std::vector< float >& vfOutputPeaks );
void PopulateAudioDevices();
void AcquireAsioDevices();
void AcquirePortaudioDevices();
......
This diff is collapsed.
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