Skip to content

Commit

Permalink
Turn on the user controller LED when a controller is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
Hussam Eddin Alhomsi committed Apr 15, 2018
1 parent eb14417 commit 2a03050
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions include/ControllerConnectionDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public slots:
void selectController();
void midiToggled();
void userToggled();
void userSelected();
void autoDetectToggled();
void enableAutoDetect( QAction * _a );

Expand Down
18 changes: 14 additions & 4 deletions src/gui/ControllerConnectionDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,16 @@ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent,

m_userController = new ComboBox( m_userGroupBox, "Controller" );
m_userController->setGeometry( 10, 24, 200, 22 );

for( int i = 0; i < Engine::getSong()->controllers().size(); ++i )
{
Controller * c = Engine::getSong()->controllers().at( i );
m_userController->model()->addItem( c->name() );
}

connect( m_userController->model(), SIGNAL( dataUnchanged() ),
this, SLOT( userSelected() ) );
connect( m_userController->model(), SIGNAL( dataChanged() ),
this, SLOT( userSelected() ) );


// Mapping functions
m_mappingBox = new TabWidget( tr( "MAPPING FUNCTION" ), this );
Expand Down Expand Up @@ -383,15 +386,22 @@ void ControllerConnectionDialog::midiToggled()



void ControllerConnectionDialog::userSelected()
{
m_userGroupBox->model()->setValue( 1 );
userToggled();
}




void ControllerConnectionDialog::userToggled()
{
int enabled = m_userGroupBox->model()->value();
if( enabled != 0 && m_midiGroupBox->model()->value() != 0 )
{
m_midiGroupBox->model()->setValue( 0 );
}

m_userController->setEnabled( enabled );
}


Expand Down

0 comments on commit 2a03050

Please sign in to comment.