Просмотр исходного кода

cmMidiFile.c : Changed printf() format specifiers for atick and amicro to 'llu' because they are now of type long long.

master
kevin 8 лет назад
Родитель
Сommit
e629fb7cd6
1 измененных файлов: 6 добавлений и 32 удалений
  1. 6
    32
      cmMidiFile.c

+ 6
- 32
cmMidiFile.c Просмотреть файл

@@ -463,12 +463,10 @@ void _cmMidiFileSetAccumulateTicks( _cmMidiFile_t* p )
463 463
 
464 464
 void _cmMidiFileSetAbsoluteTime( _cmMidiFile_t* mfp )
465 465
 {
466
-  double   microsPerQN   = 60000000/120; // default tempo;
467
-  double   amicro        = 0;
468
-  double   microsPerTick = microsPerQN / mfp->ticksPerQN;
469
-  //double   maxDMicro     = 60000000;
470
-  //bool     fl            = false;
471
-  unsigned i;
466
+  double             microsPerQN   = 60000000/120; // default tempo;
467
+  double             microsPerTick = microsPerQN / mfp->ticksPerQN;
468
+  unsigned long long amicro        = 0;
469
+  unsigned           i;
472 470
 
473 471
   for(i=0; i<mfp->msgN; ++i)
474 472
   {
@@ -482,32 +480,8 @@ void _cmMidiFileSetAbsoluteTime( _cmMidiFile_t* mfp )
482 480
       dtick = mp->atick -  mfp->msgV[i-1]->atick;
483 481
     }
484 482
 
485
-    /*
486
-    // if this is the first msg with a dtick greater than zero
487
-    if( fl && mfp->msgV[i]->dtick > 0  )
488
-    {
489
-      fl = false;
490
-
491
-      // if this mesg has a large offset
492
-      if( microsPerTick * dtick > maxDMicro )
493
-      {
494
-        cmErrWarnMsg(&mfp->err,kLargeDeltaTickMfRC,"An initial message delta time of %f seconds was decreased to %f seconds in '%s'.",(double)microsPerTick * dtick/1000000.0,(double)maxDMicro/1000000.0,cmStringNullGuard(mfp->fn));        
495
-
496
-        // change the dtick to 1 (so it will still be the first msg w/ a non-zero dtick)
497
-        mfp->msgV[i]->dtick = 1; 
498
-
499
-        // dtick changed so the aticks need to be recalculated
500
-        _cmMidiFileSetAccumulateTicks(mfp);
501
-    
502
-        // call this function recursively
503
-        return _cmMidiFileSetAbsoluteTime(mfp);
504
-
505
-      }
506
-    }
507
-    */
508
-    
509 483
     amicro     += microsPerTick * dtick;
510
-    mp->amicro  = round(amicro);
484
+    mp->amicro  = amicro;
511 485
     
512 486
     
513 487
     // track tempo changes
@@ -1420,7 +1394,7 @@ void _cmMidiFilePrintHdr( const _cmMidiFile_t* mfp, cmRpt_t* rpt )
1420 1394
 
1421 1395
 void _cmMidiFilePrintMsg( cmRpt_t* rpt, const cmMidiTrackMsg_t* tmp )
1422 1396
 {
1423
-  cmRptPrintf(rpt,"%5i %10u %10u %10u %10u : ",
1397
+  cmRptPrintf(rpt,"%5i %10u %10llu %10llu : ",
1424 1398
     tmp->uid,
1425 1399
     tmp->dtick,
1426 1400
     tmp->atick,

Загрузка…
Отмена
Сохранить