Browse Source

cmDspKr.c : Added comments to _cmDspAmSync.

master
kevin 11 years ago
parent
commit
19224be46a
1 changed files with 19 additions and 6 deletions
  1. 19
    6
      dsp/cmDspKr.c

+ 19
- 6
dsp/cmDspKr.c View File

1940
 
1940
 
1941
 typedef struct cmDspAmSyncEntry_str
1941
 typedef struct cmDspAmSyncEntry_str
1942
 {
1942
 {
1943
-  const cmChar_t* afn;    
1944
-  const cmChar_t* mfn;     
1943
+  const cmChar_t* afn;  // audio file name  
1944
+  const cmChar_t* mfn;  // midi file name   
1945
   unsigned        asmp; // Audio sample index to sync to MIDI event
1945
   unsigned        asmp; // Audio sample index to sync to MIDI event
1946
   unsigned        mid;  // MIDI event unique id (cmMidiTrackMsg_t.uid)
1946
   unsigned        mid;  // MIDI event unique id (cmMidiTrackMsg_t.uid)
1947
-  int             afi;
1947
+  int             afi;  // 
1948
   int             mfi;
1948
   int             mfi;
1949
-  unsigned        state;
1949
+  unsigned        state; // as incoming msg match this record the state is updated with kXXXAmFl flags 
1950
 } cmDspAmSyncEntry_t;
1950
 } cmDspAmSyncEntry_t;
1951
 
1951
 
1952
 typedef struct
1952
 typedef struct
2057
 
2057
 
2058
           int dframes = r->mfi-r->afi; 
2058
           int dframes = r->mfi-r->afi; 
2059
           cmRptPrintf(ctx->rpt,"0x%x : %s %i %i - %s %i  %i : frm:%i smp:%i sec:%f\n",
2059
           cmRptPrintf(ctx->rpt,"0x%x : %s %i %i - %s %i  %i : frm:%i smp:%i sec:%f\n",
2060
-            r->state,r->afn,r->asmp,r->afi,r->mfn,r->mid,r->mfi,dframes,dframes*fpc,dframes*fpc/srate);
2060
+            r->state,
2061
+            r->afn,
2062
+            r->asmp,
2063
+            r->afi,
2064
+            r->mfn,
2065
+            r->mid,
2066
+            r->mfi,
2067
+            dframes,
2068
+            dframes*fpc,dframes*fpc/srate);
2061
 
2069
 
2062
           r->afi = cmInvalidIdx;
2070
           r->afi = cmInvalidIdx;
2063
           r->mfi = cmInvalidIdx;
2071
           r->mfi = cmInvalidIdx;
2071
 
2079
 
2072
     case kAFnAmId:
2080
     case kAFnAmId:
2073
       {
2081
       {
2082
+        // an audio file name just arrived - set p->acur to point to it
2074
         const cmChar_t* fn = cmDspStrcz(inst, kAFnAmId );
2083
         const cmChar_t* fn = cmDspStrcz(inst, kAFnAmId );
2084
+        
2075
         for(i=0; i<p->arrayCnt; ++i)
2085
         for(i=0; i<p->arrayCnt; ++i)
2076
           if( strcmp(fn,p->array[i].afn) == 0 )
2086
           if( strcmp(fn,p->array[i].afn) == 0 )
2077
           {
2087
           {
2083
 
2093
 
2084
     case kMFnAmId:
2094
     case kMFnAmId:
2085
       {
2095
       {
2096
+        // an midi file name just arrived - set p->mcur to point to it
2086
         const cmChar_t* fn = cmDspStrcz(inst, kMFnAmId );
2097
         const cmChar_t* fn = cmDspStrcz(inst, kMFnAmId );
2087
         for(i=0; i<p->arrayCnt; ++i)
2098
         for(i=0; i<p->arrayCnt; ++i)
2088
           if( strcmp(fn,p->array[i].mfn) == 0 )
2099
           if( strcmp(fn,p->array[i].mfn) == 0 )
2095
 
2106
 
2096
     case kASmpAmId:
2107
     case kASmpAmId:
2097
       {
2108
       {
2109
+        // a audio file sample index has just arrived
2098
         int v = cmDspInt(inst,kASmpAmId); 
2110
         int v = cmDspInt(inst,kASmpAmId); 
2099
-
2111
+        
2112
+        // if a valid audio file has been set
2100
         if( p->acur != NULL )
2113
         if( p->acur != NULL )
2101
           for(i=0; i<p->arrayCnt; ++i)
2114
           for(i=0; i<p->arrayCnt; ++i)
2102
           {
2115
           {

Loading…
Cancel
Save