|
@@ -21,7 +21,6 @@
|
21
|
21
|
|
22
|
22
|
#include "cmMath.h"
|
23
|
23
|
|
24
|
|
-#include <unistd.h> // usleep
|
25
|
24
|
|
26
|
25
|
cmAudioSysH_t cmAudioSysNullHandle = { NULL };
|
27
|
26
|
|
|
@@ -130,13 +129,15 @@ cmAsRC_t _cmAsHostInitNotify( cmAs_t* p )
|
130
|
129
|
const char* inDevLabel = cp->ss.args.inDevIdx == cmInvalidIdx ? "" : cmApDeviceLabel( cp->ss.args.inDevIdx );
|
131
|
130
|
const char* outDevLabel = cp->ss.args.outDevIdx == cmInvalidIdx ? "" : cmApDeviceLabel( cp->ss.args.outDevIdx );
|
132
|
131
|
|
133
|
|
- m.asSubIdx = i;
|
134
|
|
- m.selId = kSsInitSelAsId;
|
135
|
|
- m.asSubCnt = p->ssCnt;
|
136
|
|
- m.inDevIdx = cp->ss.args.inDevIdx;
|
137
|
|
- m.outDevIdx = cp->ss.args.outDevIdx;
|
138
|
|
- m.inChCnt = cp->status.iMeterCnt;
|
139
|
|
- m.outChCnt = cp->status.oMeterCnt;
|
|
132
|
+ m.asSubIdx = i;
|
|
133
|
+ m.selId = kSsInitSelAsId;
|
|
134
|
+ m.asSubCnt = p->ssCnt;
|
|
135
|
+ m.inDevIdx = cp->ss.args.inDevIdx;
|
|
136
|
+ m.outDevIdx = cp->ss.args.outDevIdx;
|
|
137
|
+ m.dspFramesPerCycle = cp->ss.args.dspFramesPerCycle;
|
|
138
|
+ m.srate = cp->ss.args.srate;
|
|
139
|
+ m.inChCnt = cp->status.iMeterCnt;
|
|
140
|
+ m.outChCnt = cp->status.oMeterCnt;
|
140
|
141
|
|
141
|
142
|
unsigned segCnt = 3;
|
142
|
143
|
const void* msgDataPtrArray[] = { &m, inDevLabel, outDevLabel };
|
|
@@ -495,7 +496,7 @@ void _cmAudioSysMidiCallback( const cmMidiPacket_t* pktArray, unsigned pktCnt )
|
495
|
496
|
asH.h = cp->p;
|
496
|
497
|
|
497
|
498
|
unsigned selId = kMidiMsgArraySelAsId;
|
498
|
|
- const void* msgPtrArray[] = { &cp->ctx.asSubIdx, &selId, &pkt->devIdx, &pkt->portIdx, &pkt->msgCnt, pkt->msgArray };
|
|
499
|
+ const void* msgPtrArray[] = { &cp->ctx.asSubIdx, &selId, &pkt->devIdx, &pkt->portIdx, &pkt->msgCnt, pkt->msgArray };
|
499
|
500
|
unsigned msgByteCntArray[] = { sizeof(cp->ctx.asSubIdx), sizeof(selId), sizeof(pkt->devIdx), sizeof(pkt->portIdx), sizeof(pkt->msgCnt), pkt->msgCnt*sizeof(cmMidiMsg) };
|
500
|
501
|
unsigned msgSegCnt = sizeof(msgByteCntArray)/sizeof(unsigned);
|
501
|
502
|
|
|
@@ -578,7 +579,7 @@ cmAsRC_t _cmAudioSysEnable( cmAs_t* p, bool enableFl )
|
578
|
579
|
|
579
|
580
|
}
|
580
|
581
|
|
581
|
|
- cp->enableFl = enableFl;
|
|
582
|
+ cp->enableFl = enableFl;
|
582
|
583
|
}
|
583
|
584
|
return kOkAsRC;
|
584
|
585
|
}
|
|
@@ -610,7 +611,7 @@ cmAsRC_t _cmAudioSysFinalize( cmAs_t* p )
|
610
|
611
|
// cond variable from _cmAsAudioUpdate() otherwise the system may crash
|
611
|
612
|
|
612
|
613
|
while( cp->audCbLock != 0 )
|
613
|
|
- { usleep(100000); }
|
|
614
|
+ { cmSleepUs(100000); }
|
614
|
615
|
|
615
|
616
|
// signal the cond var to cause the thread to run
|
616
|
617
|
if((rc = cmThreadMutexSignalCondVar(cp->engMutexH)) != kOkThRC )
|