예제 #1
0
void GOrgueMidiRecorder::Clear()
{
	m_Mappings.clear();
	m_Preconfig.clear();
	m_NextChannel = 1;
	m_NextNRPN = 0;

	GOrgueMidiEvent e;
	e.SetMidiType(MIDI_SYSEX_GO_CLEAR);
	e.SetTime(wxGetLocalTimeMillis());
	SendEvent(e);
}
예제 #2
0
void GOrgueMidiRecorder::SendMidiRecorderMessage(GOrgueMidiEvent& e)
{
	if (!m_OutputDevice && !IsRecording())
		return;
	if (!SetupMapping(e.GetDevice(), e.GetMidiType() == MIDI_NRPN))
		return;

	e.SetTime(wxGetLocalTimeMillis());
	e.SetChannel(m_Mappings[e.GetDevice()].channel);
	if (e.GetMidiType() == MIDI_NRPN)
		e.SetKey(m_Mappings[e.GetDevice()].key);

	SendEvent(e);
}
예제 #3
0
void GOrgueMidiInPort::Receive(const std::vector<unsigned char> msg)
{
	if (!IsActive())
		return;

	GOrgueMidiEvent e;
	e.FromMidi(msg, m_midi->GetMidiMap());
	if (e.GetMidiType() == MIDI_NONE)
		return;
	e.SetDevice(GetID());
	e.SetTime(wxGetLocalTimeMillis());

	if (!m_merger.Process(e))
		return;

	/* Compat stuff */
	if (e.GetChannel() != -1)
		e.SetChannel(((e.GetChannel() - 1 + m_ChannelShift) & 0x0F) + 1);

	m_midi->Recv(e);
}