diff --git a/include/piano.h b/include/piano.h index aa095652e..67e64bd3f 100644 --- a/include/piano.h +++ b/include/piano.h @@ -104,6 +104,10 @@ private: private slots: void pianoScrolled( int _new_pos ); +signals: + void keyPressed( int ); + void baseNoteChanged( void ); + } ; diff --git a/src/core/piano.cpp b/src/core/piano.cpp index 6013a5823..6f83816ba 100644 --- a/src/core/piano.cpp +++ b/src/core/piano.cpp @@ -550,6 +550,8 @@ void PianoView::mousePressEvent( QMouseEvent * _me ) midiTime() ); m_piano->m_pressedKeys[key_num] = true; m_lastKey = key_num; + + emit keyPressed( key_num ); } else { @@ -567,6 +569,8 @@ void PianoView::mousePressEvent( QMouseEvent * _me ) m_piano->m_midiEvProc-> baseNoteModel()-> setInitValue( (float) key_num ); + + emit baseNoteChanged(); } } diff --git a/src/gui/setup_dialog_mcl.cpp b/src/gui/setup_dialog_mcl.cpp index 70b092695..bb3557bf5 100644 --- a/src/gui/setup_dialog_mcl.cpp +++ b/src/gui/setup_dialog_mcl.cpp @@ -89,7 +89,7 @@ setupDialogMCL::setupDialogMCL( setupDialog * _parent ) : m_actionKeyGroupBox->setFixedHeight( 160 ); m_actionKeyGroupBox->ledButton()->setChecked( m_keysActive ); connect( m_actionKeyGroupBox->ledButton(), SIGNAL( clicked() ), - this, SLOT( clickedKeyBox( ) ) ); + this, SLOT( clickedKeyBox( void ) ) ); // controller group m_actionControllerGroupBox = new groupBox( tr( "MIDI CONTROLLER" ), @@ -97,7 +97,7 @@ setupDialogMCL::setupDialogMCL( setupDialog * _parent ) : m_actionControllerGroupBox->setFixedHeight( 100 ); m_actionControllerGroupBox->ledButton()->setChecked( ! m_keysActive ); connect( m_actionControllerGroupBox->ledButton(), SIGNAL( clicked() ), - this, SLOT( clickedControllerBox( ) ) ); + this, SLOT( clickedControllerBox( void ) ) ); // put settings box together QVBoxLayout * settingsLayout = new QVBoxLayout( settings ); @@ -122,6 +122,8 @@ setupDialogMCL::setupDialogMCL( setupDialog * _parent ) : m_actionsKeyBox->addItem( action.name ); } } + connect( m_actionsKeyBox, SIGNAL( currentIndexChanged( int ) ), + this, SLOT( clickedKeyBox( void ) ) ); QWidget * pianoWidget = new QWidget( m_actionKeyGroupBox ); pianoWidget->move( 10, 60 ); @@ -131,6 +133,10 @@ setupDialogMCL::setupDialogMCL( setupDialog * _parent ) : pianoViewWidget->setModel( &m_pianoModel ); m_mep.baseNoteModel()->setValue( 60 ); m_mep.setUpdateBaseNote( true ); + connect( pianoViewWidget, SIGNAL( keyPressed( int ) ), + this, SLOT( clickedKeyBox( void ) ) ); + connect( pianoViewWidget, SIGNAL( baseNoteChanged( void ) ), + this, SLOT( clickedKeyBox( void ) ) ); // populate controller box m_actionsControllerBox = new QComboBox( m_actionControllerGroupBox ); @@ -146,6 +152,8 @@ setupDialogMCL::setupDialogMCL( setupDialog * _parent ) : m_actionsControllerBox->addItem( action.name ); } } + connect( m_actionsControllerBox, SIGNAL( currentIndexChanged( int ) ), + this, SLOT( clickedControllerBox( void ) ) ); m_controllerSbModel = new lcdSpinBoxModel( /* this */ ); m_controllerSbModel->setRange( 0, 127 ); @@ -156,6 +164,8 @@ setupDialogMCL::setupDialogMCL( setupDialog * _parent ) : controllerSb->setModel( m_controllerSbModel ); controllerSb->setLabel( tr( "CONTROLLER" ) ); controllerSb->move( 20, 60 ); + connect( controllerSb, SIGNAL( manualChange( void ) ), + this, SLOT( clickedControllerBox( void ) ) ); // widgets setup done show();