コード例 #1
0
void GOrgueMidiRecorder::SendEvent(GOrgueMidiEvent& e)
{
	e.SetDevice(m_OutputDevice);
	if (m_OutputDevice)
		m_organfile->SendMidiMessage(e);
	if (IsRecording())
		WriteEvent(e);
}
コード例 #2
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);
}