148 QPushButton *midiSenseButton =
new QPushButton(
this);
149 midiSenseButton->setObjectName(
"MidiSenseButton" );
151 midiSenseButton->setIconSize( QSize( 13, 13 ) );
152 midiSenseButton->setToolTip( tr(
"press button to record midi event") );
154 connect( midiSenseButton, &QPushButton::clicked, [=](){
155 for (
int ii = 0; ii < rowCount(); ii++ ) {
156 if ( cellWidget( ii, 0 ) == midiSenseButton ) {
161 ERRORLOG( QString(
"Unable to midiSenseButton of initial row [%1] in MidiTable!" )
162 .arg( oldRowCount ) );
164 setCellWidget( oldRowCount, 0, midiSenseButton );
169 eventBox->setCurrentIndex( eventBox->findText(eventString) );
170 connect( eventBox , SIGNAL( currentIndexChanged(
int ) ) ,
this , SLOT(
updateTable() ) );
171 connect( eventBox , SIGNAL( currentIndexChanged(
int ) ),
173 setCellWidget( oldRowCount, 1, eventBox );
178 setCellWidget( oldRowCount , 2, eventParameterSpinner );
179 eventParameterSpinner->setMaximum( 999 );
180 eventParameterSpinner->
setValue( eventParameter );
181 connect( eventParameterSpinner, SIGNAL( valueChanged(
double ) ),
187 actionBox->insertItems( oldRowCount, pActionHandler->
getActionList());
188 actionBox->setCurrentIndex ( actionBox->findText( pAction->getType() ) );
189 connect( actionBox , SIGNAL( currentIndexChanged(
int ) ) ,
this , SLOT(
updateTable() ) );
190 connect( actionBox , SIGNAL( currentIndexChanged(
int ) ),
192 setCellWidget( oldRowCount , 3, actionBox );
197 setCellWidget( oldRowCount , 4, actionParameterSpinner1 );
198 actionParameterSpinner1->setMaximum( 999 );
199 actionParameterSpinner1->
setValue( pAction->getParameter1().toInt(&ok,10) );
200 actionParameterSpinner1->hide();
201 connect( actionParameterSpinner1, SIGNAL( valueChanged(
double ) ),
206 setCellWidget( oldRowCount , 5, actionParameterSpinner2 );
208 actionParameterSpinner2->
setValue( pAction->getParameter2().toInt(&ok,10) );
209 actionParameterSpinner2->hide();
210 connect( actionParameterSpinner2, SIGNAL( valueChanged(
double ) ),
215 setCellWidget( oldRowCount , 6, actionParameterSpinner3 );
217 actionParameterSpinner3->
setValue( pAction->getParameter3().toInt(&ok,10) );
218 actionParameterSpinner3->hide();
219 connect( actionParameterSpinner3, SIGNAL( valueChanged(
double ) ),
228 items <<
"" << tr(
"Incoming Event") << tr(
"Event Para.")
229 << tr(
"Action") << tr(
"Para. 1") << tr(
"Para. 2") << tr(
"Para. 3");
234 verticalHeader()->hide();
236 setHorizontalHeaderLabels( items );
237 horizontalHeader()->setStretchLastSection(
true);
247 for (
const auto& [ssMmcType, ppAction] : pMidiMap->
getMMCActionMap() ) {
248 if ( ppAction !=
nullptr && ! ppAction->isNull() ) {
254 if ( ppAction !=
nullptr && ! ppAction->isNull() ) {
262 for (
const auto& [nnParam, ppAction] : pMidiMap->
getCCActionMap() ) {
263 if ( ppAction !=
nullptr && ! ppAction->isNull() ) {
271 for (
const auto& ppAction : pMidiMap->
getPCActions() ) {
272 if ( ppAction !=
nullptr && ! ppAction->isNull() ) {
279 std::shared_ptr<Action> pAction = std::make_shared<Action>();
292 LCDCombo * actionCombo =
dynamic_cast <LCDCombo *
> ( cellWidget( row, 3 ) );
297 if( !eventCombo->currentText().isEmpty() && !actionCombo->currentText().isEmpty() ){
298 const QString sEventString = eventCombo->currentText();
301 const QString actionString = actionCombo->currentText();
303 std::shared_ptr<Action> pAction = std::make_shared<Action>( actionString );
305 if( actionSpinner1->cleanText() !=
""){
306 pAction->setParameter1( actionSpinner1->cleanText() );
308 if( actionSpinner2->cleanText() !=
""){
309 pAction->setParameter2( actionSpinner2->cleanText() );
311 if( actionSpinner3->cleanText() !=
""){
312 pAction->setParameter3( actionSpinner3->cleanText() );
345 if ( pEventCombo ==
nullptr || pActionCombo ==
nullptr ) {
349 if( pActionCombo->currentText().isEmpty() &&
350 pEventCombo->currentText().isEmpty() && nRow !=
m_nRowCount - 1 ) {
360 const QString sEventString = pEventCombo->currentText();
365 pEventParameterSpinner->show();
366 pEventParameterSpinner->setMinimum( 0 );
367 pEventParameterSpinner->setMaximum( 127 );
371 pEventParameterSpinner->show();
380 pEventParameterSpinner->hide();
383 QString sActionType = pActionCombo->currentText();
388 pActionSpinner1->hide();
389 pActionSpinner2->hide();
390 pActionSpinner3->hide();
394 if ( nParameterNumber != -1 ) {
395 if ( nParameterNumber < 3 ) {
396 pActionSpinner3->hide();
398 pActionSpinner3->show();
400 if ( nParameterNumber < 2 ) {
401 pActionSpinner2->hide();
403 pActionSpinner2->show();
405 if ( nParameterNumber < 1 ) {
406 pActionSpinner1->hide();
408 pActionSpinner1->show();
411 ERRORLOG( QString(
"Unable to find MIDI action [%1]" ).arg( sActionType ) );
416 if ( sActionType ==
"SELECT_NEXT_PATTERN_RELATIVE" ) {
417 pActionSpinner1->setMinimum( -1 * pActionSpinner1->maximum() );