cwIo.h,cpp : Updates to include cwMidiDevice input device buffer.
Added hardwareReport(). Updates to account for change to midi::cbFunc_t.
This commit is contained in:
parent
374d3ad8a8
commit
c4d518db47
37
cwIo.cpp
37
cwIo.cpp
@ -611,7 +611,7 @@ namespace cw
|
||||
//
|
||||
// MIDI
|
||||
//
|
||||
void _midiCallback( const midi::packet_t* pktArray, unsigned pktCnt )
|
||||
void _midiCallback( void* cbArg, const midi::packet_t* pktArray, unsigned pktCnt )
|
||||
{
|
||||
unsigned i;
|
||||
for(i=0; i<pktCnt; ++i)
|
||||
@ -619,7 +619,7 @@ namespace cw
|
||||
msg_t m;
|
||||
midi_msg_t mm;
|
||||
const midi::packet_t* pkt = pktArray + i;
|
||||
io_t* p = reinterpret_cast<io_t*>(pkt->cbArg);
|
||||
io_t* p = reinterpret_cast<io_t*>(cbArg);
|
||||
rc_t rc = kOkRC;
|
||||
|
||||
|
||||
@ -2114,10 +2114,12 @@ namespace cw
|
||||
rc = cwLogError(rc,"Audio device configuration failed.");
|
||||
goto errLabel;
|
||||
}
|
||||
|
||||
audio::device::report( p->audioH );
|
||||
|
||||
errLabel:
|
||||
|
||||
if( rc != kOkRC && p->audioH.isValid() )
|
||||
audio::device::report( p->audioH );
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -2495,6 +2497,15 @@ void cw::io::report( handle_t h )
|
||||
printf("audio: %s\n", cwStringNullGuard(audioDeviceName(h,i)));
|
||||
}
|
||||
|
||||
|
||||
void cw::io::hardwareReport( handle_t h )
|
||||
{
|
||||
io_t* p = _handleToPtr(h);
|
||||
audio::device::report( p->audioH );
|
||||
midi::device::report(p->midiH);
|
||||
}
|
||||
|
||||
|
||||
void cw::io::realTimeReport( handle_t h )
|
||||
{
|
||||
io_t* p = _handleToPtr(h);
|
||||
@ -2749,6 +2760,24 @@ cw::rc_t cw::io::midiDeviceSend( handle_t h, unsigned devIdx, unsigned portIdx,
|
||||
return midi::device::send( p->midiH, devIdx, portIdx, status, d0, d1 );
|
||||
}
|
||||
|
||||
unsigned cw::io::midiDeviceMaxBufferMsgCount( handle_t h )
|
||||
{
|
||||
io_t* p = _handleToPtr(h);
|
||||
return midi::device::maxBufferMsgCount(p->midiH );
|
||||
}
|
||||
|
||||
const cw::midi::ch_msg_t* cw::io::midiDeviceBuffer( handle_t h, unsigned& msgCntRef )
|
||||
{
|
||||
io_t* p = _handleToPtr(h);
|
||||
return midi::device::getBuffer(p->midiH, msgCntRef );
|
||||
}
|
||||
|
||||
cw::rc_t cw::io::midiDeviceClearBuffer( handle_t h, unsigned msgCnt )
|
||||
{
|
||||
io_t* p = _handleToPtr(h);
|
||||
return midi::device::clearBuffer(p->midiH, msgCnt );
|
||||
}
|
||||
|
||||
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 );
|
||||
|
7
cwIo.h
7
cwIo.h
@ -172,7 +172,9 @@ namespace cw
|
||||
|
||||
bool isShuttingDown( handle_t h );
|
||||
void report( handle_t h );
|
||||
void hardwareReport( handle_t h );
|
||||
void realTimeReport( handle_t h );
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
//
|
||||
@ -229,6 +231,11 @@ 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 );
|
||||
|
||||
unsigned midiDeviceMaxBufferMsgCount( handle_t h );
|
||||
const midi::ch_msg_t* midiDeviceBuffer( handle_t h, unsigned& msgCntRef );
|
||||
rc_t midiDeviceClearBuffer( handle_t h, unsigned msgCnt );
|
||||
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user