Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.83 KB | None | 0 0
  1. void audioChangeSrc(int ch, const signed char *src, unsigned int len, unsigned int loop_end, unsigned int loop_len)
  2. {
  3.     if (loop_len >= 4) /* 2 is the same as no loop on Amiga */
  4.     {
  5.         if (v[ch].index > (signed)loop_end)
  6.         {
  7.             v[ch].index -= loop_len;
  8.         }
  9.  
  10.         v[ch].loop_end = loop_end;
  11.         v[ch].loop_len = loop_len;
  12.     }
  13.     else
  14.     {
  15.         if (v[ch].index > (signed)len)
  16.         {
  17.             v[ch].index = 0;
  18.         }
  19.  
  20.         v[ch].loop_end = 0;
  21.         v[ch].loop_len = 0;
  22.     }
  23.  
  24.     v[ch].data = src;
  25.     v[ch].len = len;
  26.  
  27.     if (v[ch].frac > v[ch].rate)
  28.     {
  29.         v[ch].frac = v[ch].rate;
  30.     }
  31.  
  32.     return;
  33. }
  34.  
  35. void audioSetSource(int ch, const signed char *src, unsigned int len, unsigned int loop_end, unsigned int loop_len)
  36. {
  37.     v[ch].data  = src;
  38.     v[ch].len   = len;
  39.     v[ch].index = 0;
  40.     v[ch].frac  = 0;
  41.     v[ch].loop_end = loop_end;
  42.     v[ch].loop_len = loop_len;
  43.  
  44.     return;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement