Exemple #1
0
void CtrlrPanel::sendMidiProgramChange()
{
	if (getRestoreState())
		return;

	const int midiCh	= (int)getProperty(Ids::panelMidiOutputChannelDevice,1);
	const int program	= (int)getProperty(Ids::panelMidiProgram);
	const int bankLsb	= (int)getProperty(Ids::panelMidiBankLsb);
	const int bankMsb	= (int)getProperty(Ids::panelMidiBankMsb);

	sendMidi (MidiMessage::controllerEvent (midiCh, 0, bankMsb));
	sendMidi (MidiMessage::controllerEvent (midiCh, 32, bankLsb));
	sendMidi (MidiMessage::programChange(midiCh,program));

	if (luaPanelProgramChangedCbk && !luaPanelProgramChangedCbk.wasObjectDeleted())
	{
		if (luaPanelProgramChangedCbk->isValid())
		{
			getCtrlrLuaManager().getMethodManager().call (luaPanelProgramChangedCbk, program, bankLsb, bankMsb);
		}
	}
}
Exemple #2
0
void OutputRouter::send(int address, OutputEvent event) {
    if (!(address >= 0 && address < MAX_OUTPUTS) || output[address].used == false) {
        ofLogError("OutputRouter") << "Output " << address << " is not installed";
        return;
    }
    switch (output[address].type) {
        case OUTPUT_TYPE_DUMMY:
            sendDummy(output[address], event);
            break;
        case OUTPUT_TYPE_MIDI:
            sendMidi(output[address], event);
            break;
    }
    peak[address] = 55;
}