Changeset 2465:da69393d4373 in roaraudio


Ignore:
Timestamp:
08/21/09 19:59:26 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

function to find a note by note object

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/ssynth.c

    r2464 r2465  
    113113 
    114114int ssynth_note_find(struct roar_note_octave * note) { 
     115 struct roar_note_octave * cn; 
     116 int i; 
     117 
     118 for (i = 0; i < SSYNTH_NOTES_MAX; i++) { 
     119  if ( g_ssynth.notes[i].stage == SSYNTH_STAGE_UNUSED ) 
     120   continue; 
     121 
     122  cn = &(g_ssynth.notes[i].note); 
     123 
     124  if ( !(note->note == cn->note && note->octave == cn->octave) ) 
     125   continue; 
     126 
     127  return i; 
     128 } 
     129 
    115130 return -1; 
    116131} 
Note: See TracChangeset for help on using the changeset viewer.