137 QPushButton *midiSenseButton =
new QPushButton(
this);
138 midiSenseButton->setObjectName(
"MidiSenseButton" );
140 midiSenseButton->setIconSize( QSize( 13, 13 ) );
141 midiSenseButton->setToolTip( tr(
"press button to record midi event") );
143 QSignalMapper *signalMapper =
new QSignalMapper(
this);
145 connect(midiSenseButton, SIGNAL( clicked()), signalMapper, SLOT( map() ));
146 signalMapper->setMapping( midiSenseButton, oldRowCount );
147 connect( signalMapper, SIGNAL(mapped(
int ) ),
this, SLOT(
midiSensePressed(
int) ) );
148 setCellWidget( oldRowCount, 0, midiSenseButton );
155 eventBox->setCurrentIndex( eventBox->findText(eventString) );
156 connect( eventBox , SIGNAL( currentIndexChanged(
int ) ) ,
this , SLOT(
updateTable() ) );
157 connect( eventBox , SIGNAL( currentIndexChanged(
int ) ),
159 setCellWidget( oldRowCount, 1, eventBox );
164 setCellWidget( oldRowCount , 2, eventParameterSpinner );
165 eventParameterSpinner->setMaximum( 999 );
166 eventParameterSpinner->
setValue( eventParameter );
167 connect( eventParameterSpinner, SIGNAL( valueChanged(
double ) ),
173 actionBox->insertItems( oldRowCount, pActionHandler->
getActionList());
174 actionBox->setCurrentIndex ( actionBox->findText( pAction->getType() ) );
175 connect( actionBox , SIGNAL( currentIndexChanged(
int ) ) ,
this , SLOT(
updateTable() ) );
176 connect( actionBox , SIGNAL( currentIndexChanged(
int ) ),
178 setCellWidget( oldRowCount , 3, actionBox );
183 setCellWidget( oldRowCount , 4, actionParameterSpinner1 );
184 actionParameterSpinner1->setMaximum( 999 );
185 actionParameterSpinner1->
setValue( pAction->getParameter1().toInt(&ok,10) );
186 actionParameterSpinner1->hide();
187 connect( actionParameterSpinner1, SIGNAL( valueChanged(
double ) ),
192 setCellWidget( oldRowCount , 5, actionParameterSpinner2 );
194 actionParameterSpinner2->
setValue( pAction->getParameter2().toInt(&ok,10) );
195 actionParameterSpinner2->hide();
196 connect( actionParameterSpinner2, SIGNAL( valueChanged(
double ) ),
201 setCellWidget( oldRowCount , 6, actionParameterSpinner3 );
203 actionParameterSpinner3->
setValue( pAction->getParameter3().toInt(&ok,10) );
204 actionParameterSpinner3->hide();
205 connect( actionParameterSpinner3, SIGNAL( valueChanged(
double ) ),
214 items <<
"" << tr(
"Incoming Event") << tr(
"Event Para.")
215 << tr(
"Action") << tr(
"Para. 1") << tr(
"Para. 2") << tr(
"Para. 3");
220 verticalHeader()->hide();
222 setHorizontalHeaderLabels( items );
223 horizontalHeader()->setStretchLastSection(
true);
233 for (
const auto& [ssMmcType, ppAction] : pMidiMap->
getMMCActionMap() ) {
234 if ( ppAction !=
nullptr && ! ppAction->isNull() ) {
240 if ( ppAction !=
nullptr && ! ppAction->isNull() ) {
248 for (
const auto& [nnParam, ppAction] : pMidiMap->
getCCActionMap() ) {
249 if ( ppAction !=
nullptr && ! ppAction->isNull() ) {
257 for (
const auto& ppAction : pMidiMap->
getPCActions() ) {
258 if ( ppAction !=
nullptr && ! ppAction->isNull() ) {
265 std::shared_ptr<Action> pAction = std::make_shared<Action>();
278 LCDCombo * actionCombo =
dynamic_cast <LCDCombo *
> ( cellWidget( row, 3 ) );
283 if( !eventCombo->currentText().isEmpty() && !actionCombo->currentText().isEmpty() ){
284 const QString sEventString = eventCombo->currentText();
287 const QString actionString = actionCombo->currentText();
289 std::shared_ptr<Action> pAction = std::make_shared<Action>( actionString );
291 if( actionSpinner1->cleanText() !=
""){
292 pAction->setParameter1( actionSpinner1->cleanText() );
294 if( actionSpinner2->cleanText() !=
""){
295 pAction->setParameter2( actionSpinner2->cleanText() );
297 if( actionSpinner3->cleanText() !=
""){
298 pAction->setParameter3( actionSpinner3->cleanText() );
331 if ( pEventCombo ==
nullptr || pActionCombo ==
nullptr ) {
335 if( pActionCombo->currentText().isEmpty() &&
336 pEventCombo->currentText().isEmpty() && nRow !=
m_nRowCount - 1 ) {
346 const QString sEventString = pEventCombo->currentText();
351 pEventParameterSpinner->show();
352 pEventParameterSpinner->setMinimum( 0 );
353 pEventParameterSpinner->setMaximum( 127 );
357 pEventParameterSpinner->show();
366 pEventParameterSpinner->hide();
369 QString sActionType = pActionCombo->currentText();
374 pActionSpinner1->hide();
375 pActionSpinner2->hide();
376 pActionSpinner3->hide();
380 if ( nParameterNumber != -1 ) {
381 if ( nParameterNumber < 3 ) {
382 pActionSpinner3->hide();
384 pActionSpinner3->show();
386 if ( nParameterNumber < 2 ) {
387 pActionSpinner2->hide();
389 pActionSpinner2->show();
391 if ( nParameterNumber < 1 ) {
392 pActionSpinner1->hide();
394 pActionSpinner1->show();
397 ERRORLOG( QString(
"Unable to find MIDI action [%1]" ).arg( sActionType ) );
402 if ( sActionType ==
"SELECT_NEXT_PATTERN_RELATIVE" ) {
403 pActionSpinner1->setMinimum( -1 * pActionSpinner1->maximum() );