本文整理汇总了C++中MidiMessage::isMidiMachineControlMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ MidiMessage::isMidiMachineControlMessage方法的具体用法?C++ MidiMessage::isMidiMachineControlMessage怎么用?C++ MidiMessage::isMidiMachineControlMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MidiMessage
的用法示例。
在下文中一共展示了MidiMessage::isMidiMachineControlMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: timerCallback
//.........这里部分代码省略.........
{
midiLine += "PROGRAM CHANGE: ";
midiLine += String (msg.getProgramChangeNumber());
midiLine += " (";
midiLine += MidiMessage::getGMInstrumentName (msg.getProgramChangeNumber());
midiLine += ")";
}
else if (msg.isController())
{
midiLine += "CC: #";
midiLine += String (msg.getControllerNumber());
midiLine += " (";
midiLine += MidiMessage::getControllerName (msg.getControllerNumber());
midiLine += ") = ";
midiLine += String (msg.getControllerValue());
}
else if (msg.isTimeSignatureMetaEvent ())
{
int newNumerator, newDenominator;
msg.getTimeSignatureInfo (newNumerator, newDenominator);
midiLine += "TIME SIGNATURE: ";
midiLine += String (newNumerator);
midiLine += " / ";
midiLine += String (newDenominator);
}
else if (msg.isTempoMetaEvent ())
{
midiLine += "TEMPO: ";
midiLine += String (msg.getTempoSecondsPerQuarterNote ());
//midiLine += " ";
//midiLine += String (msg.getTempoMetaEventTickLength (ticksPerQuarterNote));
}
else if (msg.isMidiMachineControlMessage())
{
midiLine += "MIDI CONTROL: ";
switch (msg.getMidiMachineControlCommand())
{
case MidiMessage::mmc_stop: midiLine += "stop"; break;
case MidiMessage::mmc_play: midiLine += "play"; break;
case MidiMessage::mmc_deferredplay: midiLine += "deferredplay"; break;
case MidiMessage::mmc_fastforward: midiLine += "fastforward"; break;
case MidiMessage::mmc_rewind: midiLine += "rewind"; break;
case MidiMessage::mmc_recordStart: midiLine += "recordStart"; break;
case MidiMessage::mmc_recordStop: midiLine += "recordStop"; break;
case MidiMessage::mmc_pause: midiLine += "pause"; break;
}
}
else if (msg.isMidiStart ())
{
midiLine += "MIDI START: ";
}
else if (msg.isMidiContinue ())
{
midiLine += "MIDI CONTINUE: ";
}
else if (msg.isMidiStop ())
{
midiLine += "MIDI STOP: ";
}
else if (msg.isSongPositionPointer ())
{
midiLine += "SONG POSITION: ";
midiLine += String (msg.getSongPositionPointerMidiBeat ());
}
示例2: midiCcReceived
//------------------------------------------------------------------------------
void MidiMappingManager::midiCcReceived(const MidiMessage& message,
double secondsSinceStart)
{
if(message.isController())
{
multimap<int, MidiMapping *>::iterator it;
multimap<int, MidiAppMapping *>::iterator it2;
int cc = message.getControllerNumber();
int value = message.getControllerValue();
//Check if it matches any MidiMappings.
for(it=mappings.lower_bound(cc);
it!=mappings.upper_bound(cc);
++it)
{
it->second->ccReceived(value);
}
if(value > 64)
{
//Check if it matches any MidiAppMappings.
for(it2=appMappings.lower_bound(cc);
it2!=appMappings.upper_bound(cc);
++it2)
{
CommandID id = it2->second->getId();
MainPanel *panel = dynamic_cast<MainPanel *>(appManager->getFirstCommandTarget(MainPanel::TransportPlay));
if(panel)
{
if(id != MainPanel::TransportTapTempo)
panel->invokeCommandFromOtherThread(id);
else
{
double tempo = tapHelper.updateTempo(secondsSinceStart);
if(tempo > 0.0)
panel->updateTempoFromOtherThread(tempo);
}
}
}
}
}
else if(message.isMidiMachineControlMessage())
{
if(PropertiesSingleton::getInstance().getUserSettings()->getBoolValue(L"mmcTransport", false))
{
CommandID id = -1;
MainPanel *panel = dynamic_cast<MainPanel *>(appManager->getFirstCommandTarget(MainPanel::TransportPlay));
switch(message.getMidiMachineControlCommand())
{
case MidiMessage::mmc_stop:
id = MainPanel::TransportPlay;
break;
case MidiMessage::mmc_play:
id = MainPanel::TransportPlay;
break;
case MidiMessage::mmc_rewind:
id = MainPanel::TransportRtz;
break;
case MidiMessage::mmc_pause:
id = MainPanel::TransportPlay;
break;
default:
break;
}
if((id > -1) && panel)
panel->invokeCommandFromOtherThread(id);
}
}
else if(message.isProgramChange())
{
if(PropertiesSingleton::getInstance().getUserSettings()->getBoolValue(L"midiProgramChange", false))
{
int newPatch;
MainPanel *panel = dynamic_cast<MainPanel *>(appManager->getFirstCommandTarget(MainPanel::TransportPlay));
newPatch = message.getProgramChangeNumber();
if(panel)
panel->switchPatchFromProgramChange(newPatch);
}
}
}
示例3: messageTypeChanged
void stepQuickEdit::messageTypeChanged()
{
MidiMessage *m = 0;
MidiBuffer *mB = 0;
if (editorComponent)
{
deleteAndZero (editorComponent);
}
if (midiMessage == 0)
{
return;
}
m = midiMessage->getMidiMessage();
if (m)
{
if (m->isNoteOn())
{
addAndMakeVisible (editorComponent = new stepEditNote(midiMessage));
typeCombo->setSelectedId (noteOn, true);
}
else if (m->isProgramChange())
{
typeCombo->setSelectedId (ProgramChange, true);
}
else if (m->isController())
{
addAndMakeVisible (editorComponent = new stepEditController(midiMessage));
typeCombo->setSelectedId (Controller, true);
}
else if (m->isMidiMachineControlMessage())
{
typeCombo->setSelectedId (MMC, true);
}
else if (m->isSysEx())
{
addAndMakeVisible (editorComponent = new stepEditSysex(midiMessage));
typeCombo->setSelectedId (SysEx, true);
}
resized();
}
mB = midiMessage->getMidiBuffer();
if (mB == 0)
return;
if (!m && mB)
{
MidiBuffer::Iterator i(*mB);
int len;
MidiMessage message (0xf4, 0.0);
if (i.getNextEvent (message, len))
{
uint8 *data = message.getRawData();
if (*data == 0xb0)
{
addAndMakeVisible (editorComponent = new stepEditController(midiMessage));
typeCombo->setSelectedId (Controller, true);
}
if (*data == 0xf0)
{
addAndMakeVisible (editorComponent = new stepEditSysex(midiMessage));
typeCombo->setSelectedId (SysEx, true);
}
resized();
}
}
}