cwIo : Added MIDI file device interface.

This commit is contained in:
kevin 2024-02-21 07:50:52 -05:00
parent e3ff4828b0
commit 68e36aad6b
2 changed files with 51 additions and 0 deletions

View File

@ -2703,6 +2703,48 @@ cw::rc_t cw::io::midiDeviceSend( handle_t h, unsigned devIdx, unsigned portIdx,
return midi::device::send( p->midiH, devIdx, portIdx, status, d0, d1 );
}
cw::rc_t cw::io::midiOpenMidiFile( handle_t h, unsigned devIdx, unsigned portIdx, const char* fname )
{
return midi::device::openMidiFile( _handleToPtr(h)->midiH, devIdx, portIdx, fname );
}
cw::rc_t cw::io::midiLoadMsgPacket( handle_t h, const midi::packet_t& pkt )
{
return midi::device::loadMsgPacket( _handleToPtr(h)->midiH, pkt );
}
unsigned cw::io::midiMsgCount( handle_t h, unsigned devIdx, unsigned portIdx )
{
return midi::device::msgCount( _handleToPtr(h)->midiH, devIdx, portIdx );
}
cw::rc_t cw::io::midiSeekToMsg( handle_t h, unsigned devIdx, unsigned portIdx, unsigned msgIdx )
{
return midi::device::seekToMsg( _handleToPtr(h)->midiH, devIdx, portIdx, msgIdx );
}
cw::rc_t cw::io::midiSetEndMsg( handle_t h, unsigned devIdx, unsigned portIdx, unsigned msgIdx )
{
return midi::device::setEndMsg( _handleToPtr(h)->midiH, devIdx, portIdx, msgIdx );
}
cw::rc_t cw::io::midiFileStart( handle_t h )
{
return midi::device::start( _handleToPtr(h)->midiH );
}
cw::rc_t cw::io::midiFileStop( handle_t h )
{
return midi::device::stop( _handleToPtr(h)->midiH );
}
cw::rc_t cw::io::midiFilePause( handle_t h, bool pauseFl )
{
return midi::device::pause( _handleToPtr(h)->midiH, pauseFl );
}
//----------------------------------------------------------------------------------------------------------
//
// Audio

9
cwIo.h
View File

@ -228,6 +228,15 @@ namespace cw
const char* midiDevicePortName( handle_t h, unsigned devIdx, bool inputFl, unsigned portIdx );
unsigned midiDevicePortIndex( handle_t h, unsigned devIdx, bool inputFl, const char* portName );
rc_t midiDeviceSend( handle_t h, unsigned devIdx, unsigned portIdx, uint8_t status, uint8_t d0, uint8_t d1 );
rc_t midiOpenMidiFile( handle_t h, unsigned devIdx, unsigned portIdx, const char* fname );
rc_t midiLoadMsgPacket( handle_t h, const midi::packet_t& pkt ); // Note: Set devIdx/portIdx via pkt.devIdx/pkt.portIdx
unsigned midiMsgCount( handle_t h, unsigned devIdx, unsigned portIdx );
rc_t midiSeekToMsg( handle_t h, unsigned devIdx, unsigned portIdx, unsigned msgIdx );
rc_t midiSetEndMsg( handle_t h, unsigned devIdx, unsigned portidx, unsigned msgIdx );
rc_t midiFileStart( handle_t h );
rc_t midiFileStop( handle_t h );
rc_t midiFilePause( handle_t h, bool pauseFl );
//----------------------------------------------------------------------------------------------------------