Changeset 362

Show
Ignore:
Timestamp:
02/20/06 09:52:57 (3 years ago)
Author:
kickback
Message:

sweep-jack-testing:src/driver_jack.c: removed alsa names and comments.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sweep/branches/sweep-jack-testing/src/driver_jack.c

    r293 r362  
    2020 
    2121/* 
    22  * ALSA 0.6 support by Paul Davis 
    23  * ALSA 0.9 updates by Zenaan Harkness 
     22 * jack driver by Torben Hohn 2006 
    2423 */ 
    2524 
     
    5958} sw_jack_handle_t; 
    6059 
    61 //void print_pcm_state (snd_pcm_t * pcm) 
    62 //{ 
    63 //  switch (snd_pcm_state(pcm)) { 
    64 //    case SND_PCM_STATE_OPEN: 
    65 //      fprintf (stderr, "sweep: print_pcm_state: state is OPEN\n"); 
    66 //      break; 
    67 //    case SND_PCM_STATE_SETUP: 
    68 //      fprintf (stderr, "sweep: print_pcm_state: state is SETUP\n"); 
    69 //      break; 
    70 //    case SND_PCM_STATE_PREPARED: 
    71 //      fprintf (stderr, "sweep: print_pcm_state: state is PREPARED\n"); 
    72 //      break; 
    73 //    case SND_PCM_STATE_RUNNING: 
    74 //      fprintf (stderr, "sweep: print_pcm_state: state is RUNNING\n"); 
    75 //      break; 
    76 //    case SND_PCM_STATE_XRUN: 
    77 //      fprintf (stderr, "sweep: print_pcm_state: state is XRUN\n"); 
    78 //      break; 
    79 //    case SND_PCM_STATE_DRAINING: 
    80 //      fprintf (stderr, "sweep: print_pcm_state: state is DRAINING\n"); 
    81 //      break; 
    82 //    case SND_PCM_STATE_PAUSED: 
    83 //      fprintf (stderr, "sweep: print_pcm_state: state is PAUSED\n"); 
    84 //      break; 
    85 //    case SND_PCM_STATE_SUSPENDED: 
    86 //      fprintf (stderr, "sweep: print_pcm_state: state is SUSPENDED\n"); 
    87 //      break; 
    88 //    default: 
    89 //      fprintf (stderr, "sweep: print_pcm_state: state is unknown! THIS SHOULD NEVER HAPPEN!\n"); 
    90 //  } 
    91 //} 
    92  
    9360static GList * 
    94 alsa_get_names (void) 
     61jack_get_names (void) 
    9562{ 
    9663  GList * names = NULL; 
    97   //char * name; 
    98  
    99 //  if ((name = getenv ("SWEEP_ALSA_PCM")) != 0) { 
    100 //    names = g_list_append (names, name); 
    101 //  } 
    102  
    103   /* The standard command line options for this are -D or --device. 
    104    * The default fallback should be plughw. 
    105    */ 
    106 //  names = g_list_append (names, "plughw:0,0"); 
    107 //  names = g_list_append (names, "plughw:0,1"); 
    108 //  names = g_list_append (names, "plughw:1,0"); 
    10964  names = g_list_append (names, "alsa_playback"); 
    11065 
     
    11368 
    11469static sw_handle * 
    115 alsa_device_open (int monitoring, int flags) 
     70jack_device_open (int monitoring, int flags) 
    11671{ 
    11772  //int err; 
     
    155110  // FIXME: check the ports.... 
    156111 
    157  
    158112  handle = g_malloc0 (sizeof (sw_handle)); 
    159113 
     
    161115  handle->custom_data = jack_data; 
    162116 
    163    
    164  
    165117  return handle; 
    166  
    167 
    168  
    169   // /src/alsa/alsaplayer-0.99.72/output/alsa-final/alsa.c 
    170   // /src/alsa/alsa-lib-0.9.0rc3/test/pcm.c 
    171 static void 
    172 alsa_device_setup (sw_handle * handle, sw_format * format) 
     118
     119 
     120static void 
     121jack_device_setup (sw_handle * handle, sw_format * format) 
    173122{ 
    174123  //int err; 
     
    195144 
    196145static int 
    197 alsa_device_wait (sw_handle * handle) 
    198 
     146jack_device_wait (sw_handle * handle) 
     147
     148        return -1; 
    199149} 
    200150 
     
    202152 
    203153static ssize_t 
    204 alsa_device_read (sw_handle * handle, sw_audio_t * buf, size_t count) 
     154jack_device_read (sw_handle * handle, sw_audio_t * buf, size_t count) 
    205155{ 
    206156  sw_jack_handle_t * pcm_handle = (sw_jack_handle_t *)handle->custom_data; 
     
    219169 
    220170static ssize_t 
    221 alsa_device_write (sw_handle * handle, sw_audio_t * buf, size_t count, 
     171jack_device_write (sw_handle * handle, sw_audio_t * buf, size_t count, 
    222172    sw_framecount_t offset) 
    223173{ 
     
    237187 
    238188sw_framecount_t 
    239 alsa_device_offset (sw_handle * handle) 
    240 
    241   /*printf ("sweep: alsa_offset\n");*/ 
     189jack_device_offset (sw_handle * handle) 
     190
    242191  return -1; 
    243192} 
    244193 
    245194static void 
    246 alsa_device_reset (sw_handle * handle) 
    247 
    248   /*printf ("sweep: alsa_reset\n");*/ 
    249 
    250  
    251 static void 
    252 alsa_device_flush (sw_handle * handle) 
    253 
    254   /*printf ("sweep: alsa_flush\n");*/ 
    255 
    256  
    257 /* 
    258  * alsa lib provides: 
    259  * int snd_pcm_drop (snd_pcm_t *pcm) // Stop a PCM dropping pending frames. 
    260  * int snd_pcm_drain (snd_pcm_t *pcm) // Stop a PCM preserving pending frames.  
    261  */ 
    262 static void 
    263 alsa_device_drain (sw_handle * handle) 
    264 
    265 
    266  
    267 static void 
    268 alsa_device_close (sw_handle * handle) 
    269 
    270 //  snd_pcm_t * pcm_handle = (snd_pcm_t *)handle->custom_data; 
    271 //  
    272 //  snd_pcm_close (pcm_handle); 
     195jack_device_reset (sw_handle * handle) 
     196
     197
     198 
     199static void 
     200jack_device_flush (sw_handle * handle) 
     201
     202
     203 
     204static void 
     205jack_device_drain (sw_handle * handle) 
     206
     207
     208 
     209static void 
     210jack_device_close (sw_handle * handle) 
     211
     212 
    273213} 
    274214 
    275215static sw_driver _driver_jack = { 
    276   alsa_get_names, 
    277   alsa_device_open, 
    278   alsa_device_setup, 
    279   alsa_device_wait, 
    280   alsa_device_read, 
    281   alsa_device_write, 
    282   alsa_device_offset, 
    283   alsa_device_reset, 
    284   alsa_device_flush, 
    285   alsa_device_drain, 
    286   alsa_device_close 
     216  jack_get_names, 
     217  jack_device_open, 
     218  jack_device_setup, 
     219  jack_device_wait, 
     220  jack_device_read, 
     221  jack_device_write, 
     222  jack_device_offset, 
     223  jack_device_reset, 
     224  jack_device_flush, 
     225  jack_device_drain, 
     226  jack_device_close 
    287227}; 
    288228