Browse Source

cmMidiFilePlay.c : Updates to use amicro instead of dtick in MIDI msg.

master
kevin 9 years ago
parent
commit
136cb97800
1 changed files with 4 additions and 16 deletions
  1. 4
    16
      cmMidiFilePlay.c

+ 4
- 16
cmMidiFilePlay.c View File

@@ -148,9 +148,6 @@ cmMfpRC_t cmMfpLoadHandle( cmMfpH_t h, cmMidiFileH_t mfH )
148 148
   p->mtime      = 0;
149 149
   p->closeFileFl= false;
150 150
 
151
-  //if( p->msgIdx > 0 )
152
-  //  p->mtime = p->msgV[0]->tick * p->microsPerTick;
153
-
154 151
   return kOkMfpRC;
155 152
 }
156 153
 
@@ -213,21 +210,15 @@ cmMfpRC_t cmMfpClock(  cmMfpH_t h, unsigned dusecs )
213 210
   // sent and the end of the time window for this mfpClock() cycle
214 211
   p->etime += dusecs;
215 212
 
216
-  //printf("init e:%i d:%i\n",p->etime, p->mtime);
217
-
218 213
   // if the elapsed time (etime) since the last msg is greater or equal
219 214
   // to the delta time to the next msg (mtime)
220 215
   while( p->etime >= p->mtime )
221 216
   {      
222
-    //printf("e:%i d:%i\n",p->etime, p->mtime);
223 217
 
224
-    if( mp->status == kMetaStId && mp->metaId == kTempoMdId )
225
-      _cmMfpUpdateMicrosPerTick(p,mp->u.iVal );
226
-    
227
-    
218
+    // send the current message
228 219
     p->cbFunc( p->userCbPtr, p->mtime, mp );
229 220
 
230
-    unsigned atick0 = mp->atick;
221
+    unsigned amicro = mp->amicro;
231 222
     
232 223
     ++(p->msgIdx);
233 224
 
@@ -235,18 +226,15 @@ cmMfpRC_t cmMfpClock(  cmMfpH_t h, unsigned dusecs )
235 226
       break;
236 227
 
237 228
     // get the next msg to send
238
-    mp        = p->msgV[p->msgIdx];
229
+    mp   = p->msgV[p->msgIdx];
239 230
 
240
-    assert( mp->atick >= atick0 );
241
-    unsigned dtick = mp->atick - atick0;
242 231
 
243 232
     // we probably went past the actual mtime - so update etime
244 233
     // with the delta usecs from the msg just sent and the current time
245 234
     p->etime -= p->mtime;
246 235
 
247 236
     // calc the delta usecs from the message just sent to the next msg to send
248
-    //p->mtime  = (mp->tick - p->msgV[p->msgIdx-1]->tick) * p->microsPerTick;
249
-    p->mtime  = dtick * p->microsPerTick;
237
+    p->mtime  = mp->amicro - amicro;
250 238
 
251 239
   }
252 240
 

Loading…
Cancel
Save