1 // ****************************************************************************
5 // Implementation file for the CEchoGals driver class (midi functions).
7 // Set editor tabs to 3 for your viewing pleasure.
9 // ----------------------------------------------------------------------------
11 // This file is part of Echo Digital Audio's generic driver library.
12 // Copyright Echo Digital Audio Corporation (c) 1998 - 2005
13 // All rights reserved
16 // This library is free software; you can redistribute it and/or
17 // modify it under the terms of the GNU Lesser General Public
18 // License as published by the Free Software Foundation; either
19 // version 2.1 of the License, or (at your option) any later version.
21 // This library is distributed in the hope that it will be useful,
22 // but WITHOUT ANY WARRANTY; without even the implied warranty of
23 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 // Lesser General Public License for more details.
26 // You should have received a copy of the GNU Lesser General Public
27 // License along with this library; if not, write to the Free Software
28 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 // ****************************************************************************
32 #include "CEchoGals.h"
37 /****************************************************************************
41 ****************************************************************************/
43 //===========================================================================
45 // Write a bunch of MIDI data to the MIDI output
47 // The DSP only buffers up 64 bytes internally for MIDI output; if you try
48 // to send more than the DSP can handle, the actual count sent will be returned
49 // to you. ECHOSTATUS_BUSY is returned if the DSP is still processing the
50 // last driver command.
52 //===========================================================================
54 ECHOSTATUS
CEchoGals::WriteMidi
61 return GetDspCommObject()->WriteMidi( pBuffer
,
64 } // ECHOSTATUS CLayla24::WriteMidi
69 /****************************************************************************
73 ****************************************************************************/
76 //===========================================================================
78 // Read a single MIDI byte from the circular MIDI input buffer
80 //===========================================================================
82 ECHOSTATUS
CEchoGals::ReadMidiByte
84 ECHOGALS_MIDI_IN_CONTEXT
*pContext
,
90 return m_MidiIn
.GetMidi(pContext
,dwMidiData
,llTimestamp
);
95 //===========================================================================
97 // Open and enable the MIDI input
99 // The context struct should be set to zero before calling OpenMidiInput
101 //===========================================================================
103 ECHOSTATUS
CEchoGals::OpenMidiInput(ECHOGALS_MIDI_IN_CONTEXT
*pContext
)
106 return m_MidiIn
.Arm(pContext
);
111 //===========================================================================
113 // Close and disable the MIDI input
115 //===========================================================================
117 ECHOSTATUS
CEchoGals::CloseMidiInput(ECHOGALS_MIDI_IN_CONTEXT
*pContext
)
119 return m_MidiIn
.Disarm(pContext
);
123 //===========================================================================
125 // Reset the MIDI input, but leave it open and enabled
127 //===========================================================================
129 ECHOSTATUS
CEchoGals::ResetMidiInput(ECHOGALS_MIDI_IN_CONTEXT
*pContext
)
131 m_MidiIn
.Reset(pContext
);
133 return ECHOSTATUS_OK
;
138 #endif // MIDI_SUPPORT