Changeset 506

Show
Ignore:
Timestamp:
09/27/07 04:24:25 (1 year ago)
Author:
kickback
Message:

sweep-jack-testing: extend driver api for callback operation and push jack elements back into driver_jack.c.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sweep/branches/sweep-jack-testing/configure.ac

    r505 r506  
    328328     [ ac_enable_alsa=no ]) 
    329329 
    330 if test "x${ac_enable_alsa}" != xno ; then 
     330if test "x${ac_enable_alsa}" != xno && test "x${ac_enable_jack_playback}" = xno; then 
    331331 
    332332  PKG_CHECK_MODULES(ALSA, alsa >= 1.0.0, 
  • sweep/branches/sweep-jack-testing/src/driver.c

    r505 r506  
    752752} 
    753753 
     754gboolean 
     755device_has_callback_driver(void) 
     756{ 
     757  if (pref->is_callback_driver == NULL) 
     758    return FALSE; 
     759  else 
     760    return pref->is_callback_driver();     
     761} 
     762 
     763sw_callback_data_t * 
     764driver_get_callback_data (void) 
     765{ 
     766    if (pref->get_callback_data) 
     767        return pref->get_callback_data(); 
     768    else 
     769        return NULL; 
     770} 
     771 
     772 
    754773void 
    755774init_devices (void) 
     
    764783  pref = driver_jack; 
    765784#endif 
     785     
     786    pref = driver_jack; 
    766787  play_mutex = g_mutex_new (); 
    767788         
  • sweep/branches/sweep-jack-testing/src/driver.h

    r505 r506  
    3030typedef struct _sw_handle sw_handle; 
    3131typedef struct _sw_driver sw_driver; 
     32typedef  struct _sw_callback_data_t sw_callback_data_t; 
    3233 
    3334struct _sw_handle { 
     
    3738  int driver_rate; 
    3839  void * custom_data; 
     40}; 
     41 
     42struct _sw_callback_data_t { 
     43  sw_framecount_t count; 
     44  int inactive_writes; 
     45  GList * gl; 
     46  sw_head * head; 
     47  sw_format * f; 
     48  int max_driver_chans; 
     49 
     50  gboolean use_monitor; 
     51 
     52#ifdef RECORD_DEMO_FILES 
     53  gchar * filename; 
     54  SNDFILE * sndfile; 
     55  SF_INFO sfinfo; 
     56#endif 
     57 
    3958}; 
    4059 
     
    5372  void (*drain) (sw_handle * handle); 
    5473  void (*close) (sw_handle * handle); 
    55    
     74  /* FIXME simple boolean instead ? */ 
     75  gboolean (*is_callback_driver) (void); 
     76  /* FIXME this may not be necessary. look at it again later */  
     77  sw_callback_data_t * (*get_callback_data) (void); 
     78  /* FIXME specify prefix only and use macro to generate keys? */ 
    5679  char * primary_device_key; 
    5780  char * monitor_device_key; 
     
    130153device_close (sw_handle * handle); 
    131154 
     155gboolean 
     156device_has_callback_driver(void); 
     157 
     158sw_callback_data_t * 
     159driver_get_callback_data (void); 
     160 
    132161void 
    133162init_devices (void); 
  • sweep/branches/sweep-jack-testing/src/driver_alsa.c

    r505 r506  
    459459  alsa_device_drain, 
    460460  alsa_device_close, 
     461  NULL, 
     462  NULL, 
    461463  "alsa_primary_device", 
    462464  "alsa_monitor_device", 
     
    467469 
    468470static sw_driver _driver_alsa = { 
    469   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 
     471  NULL, 
     472  NULL, 
     473  NULL, 
     474  NULL, 
     475  NULL, 
     476  NULL, 
     477  NULL, 
     478  NULL, 
     479  NULL, 
     480  NULL, 
     481  NULL, 
     482  NULL, 
     483  NULL, 
     484  NULL, 
     485  NULL, 
     486  NULL, 
     487  NULL 
    470488}; 
    471489 
  • sweep/branches/sweep-jack-testing/src/driver_jack.c

    r369 r506  
    4747#include "play.h" 
    4848#include "preferences.h" 
    49 #include "driver_jack.h" 
    5049 
    5150#ifdef DRIVER_JACK 
     
    5352#include <jack/jack.h> 
    5453 
    55 jack_process_data_t *process_data = NULL; 
     54sw_callback_data_t *process_data = NULL; 
    5655 
    5756jack_client_t *jack_client = NULL; 
     
    6160    jack_port_t *port_l, *port_r; 
    6261} sw_jack_handle_t; 
     62 
     63static int 
     64jack_process_callback (jack_nframes_t nframes, void *data); 
    6365 
    6466static GList * 
     
    8486  gint rate; 
    8587  gint use_monitor; 
    86  
    87   jack_client = jack_client_new( "sweep" ); 
    88  
    89   if (jack_client == NULL) { 
    90  
    91   // popup_msgbox("Error", MSGBOX_OK, 120000, MSGBOX_OK, 
    92     //           "Could not open Jack Client"); 
    93     return 1; /* do something with this later. like offer to try again */ 
     88  if (process_data == NULL) { 
     89      process_data = g_new0(sw_callback_data_t, 1); 
     90      jack_client = jack_client_new( "sweep" ); 
     91 
     92      if (jack_client == NULL) { 
     93 
     94      // popup_msgbox("Error", MSGBOX_OK, 120000, MSGBOX_OK, 
     95        //               "Could not open Jack Client"); 
     96        return 1; /* do something with this later. like offer to try again */ 
     97      } 
     98      rate =  (gint) jack_get_sample_rate(jack_client); 
     99 
     100      /*  
     101         * register a pair of input, output and conditionally, monitor ports.  
     102         * the port names could easily be made configurable. 
     103         */ 
     104        if (!handle_in) { 
     105        jack_data_in = g_malloc0 (sizeof (sw_jack_handle_t)); 
     106        jack_data_in->port_l = jack_port_register (jack_client, "input_left", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); 
     107        jack_data_in->port_r = jack_port_register (jack_client, "input_right", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); 
     108        handle_in = g_malloc0 (sizeof (sw_handle)); 
     109        handle_in->driver_flags = O_RDONLY; 
     110        handle_in->custom_data = jack_data_in; 
     111        handle_in->driver_rate = rate; 
     112        handle_in->driver_channels = channels; 
     113      } 
     114      if (!handle_out){ 
     115        jack_data_out = g_malloc0 (sizeof (sw_jack_handle_t)); 
     116        jack_data_out->port_l = jack_port_register (jack_client, "output_left", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); 
     117        jack_data_out->port_r = jack_port_register (jack_client, "output_right", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); 
     118        handle_out = g_malloc0 (sizeof (sw_handle)); 
     119        handle_out->driver_flags = O_WRONLY; 
     120        handle_out->custom_data = jack_data_out; 
     121        handle_out->driver_rate = rate; 
     122        handle_out->driver_channels = channels; 
     123      } 
     124 
     125      use_monitor =  monitor_active(); 
     126 
     127      if (!handle_monitor && use_monitor){ 
     128        jack_data_monitor = g_malloc0 (sizeof (sw_jack_handle_t)); 
     129        jack_data_monitor->port_l = jack_port_register (jack_client, "monitor_left", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); 
     130        jack_data_monitor->port_r = jack_port_register (jack_client, "monitor_right", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); 
     131        handle_monitor = g_malloc0 (sizeof (sw_handle)); 
     132        handle_monitor->driver_flags = O_WRONLY; 
     133        handle_monitor->custom_data = jack_data_monitor; 
     134        handle_monitor->driver_rate = rate; 
     135        handle_monitor->driver_channels = channels; 
     136      }  
     137      else if (handle_monitor && !use_monitor){ 
     138 
     139        /* FIXME: remove unwanted monitor ports if they exist. */ 
     140      } 
     141      // FIXME: check the ports.... 
     142 
     143      jack_set_process_callback( jack_client, jack_process_callback, process_data );  
     144      jack_activate( jack_client );  
     145      return 0;  
    94146  } 
    95   rate =  (gint) jack_get_sample_rate(jack_client); 
    96  
    97   /*  
    98          * register a pair of input, output and conditionally, monitor ports.  
    99          * the port names could easily be made configurable. 
    100          */ 
    101         if (!handle_in) { 
    102     jack_data_in = g_malloc0 (sizeof (sw_jack_handle_t)); 
    103     jack_data_in->port_l = jack_port_register (jack_client, "input_left", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); 
    104     jack_data_in->port_r = jack_port_register (jack_client, "input_right", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); 
    105     handle_in = g_malloc0 (sizeof (sw_handle)); 
    106     handle_in->driver_flags = O_RDONLY; 
    107     handle_in->custom_data = jack_data_in; 
    108     handle_in->driver_rate = rate; 
    109     handle_in->driver_channels = channels; 
    110   } 
    111   if (!handle_out){ 
    112     jack_data_out = g_malloc0 (sizeof (sw_jack_handle_t)); 
    113     jack_data_out->port_l = jack_port_register (jack_client, "output_left", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); 
    114     jack_data_out->port_r = jack_port_register (jack_client, "output_right", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); 
    115     handle_out = g_malloc0 (sizeof (sw_handle)); 
    116     handle_out->driver_flags = O_WRONLY; 
    117     handle_out->custom_data = jack_data_out; 
    118     handle_out->driver_rate = rate; 
    119     handle_out->driver_channels = channels; 
    120   } 
    121  
    122   use_monitor =  monitor_active(); 
    123  
    124   if (!handle_monitor && use_monitor){ 
    125     jack_data_monitor = g_malloc0 (sizeof (sw_jack_handle_t)); 
    126     jack_data_monitor->port_l = jack_port_register (jack_client, "monitor_left", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); 
    127     jack_data_monitor->port_r = jack_port_register (jack_client, "monitor_right", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); 
    128     handle_monitor = g_malloc0 (sizeof (sw_handle)); 
    129     handle_monitor->driver_flags = O_WRONLY; 
    130     handle_monitor->custom_data = jack_data_monitor; 
    131     handle_monitor->driver_rate = rate; 
    132     handle_monitor->driver_channels = channels; 
    133   }  
    134   else if (handle_monitor && !use_monitor){ 
    135  
    136     /* FIXME: remove unwanted monitor ports if they exist. */ 
    137   } 
    138   // FIXME: check the ports.... 
    139   if (process_data == NULL) { 
    140      process_data =  g_malloc0( sizeof( jack_process_data_t ) ); 
    141      jack_set_process_callback( jack_client, process_callback, process_data );  
    142      jack_activate( jack_client );  
    143   } 
    144   return 0;  
     147  return 0; 
    145148} 
    146149 
     
    269272} 
    270273 
     274static int 
     275jack_process_callback (jack_nframes_t nframes, void *data) 
     276{ 
     277    return sweep_playback_callback (nframes, data);     
     278} 
     279 
     280gboolean 
     281jack_is_callback_driver (void) 
     282{ 
     283    return TRUE; 
     284} 
     285 
     286sw_callback_data_t * 
     287jack_get_callback_data (void) 
     288{ 
     289    return process_data; 
     290} 
     291 
     292 
    271293static sw_driver _driver_jack = { 
    272294  jack_get_names, 
     
    281303  jack_device_flush, 
    282304  jack_device_drain, 
    283   jack_device_close 
     305  jack_device_close, 
     306  jack_is_callback_driver, 
     307  jack_get_callback_data 
    284308}; 
    285309 
  • sweep/branches/sweep-jack-testing/src/driver_oss.c

    r505 r506  
    446446  drain_dev_dsp, 
    447447  close_dev_dsp, 
     448    NULL, 
     449    NULL, 
    448450  "oss_primary_device", 
    449451  "oss_monitor_device", 
     
    454456 
    455457static sw_driver _driver_oss = { 
    456   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
     458  NULL, 
     459  NULL, 
     460  NULL, 
     461  NULL, 
     462  NULL, 
     463  NULL, 
     464  NULL, 
     465  NULL, 
     466  NULL, 
     467  NULL, 
     468  NULL, 
     469  NULL, 
     470  NULL, 
     471  NULL, 
     472  NULL, 
     473  NULL, 
     474  NULL 
    457475}; 
    458476 
  • sweep/branches/sweep-jack-testing/src/driver_solaris.c

    r505 r506  
    116116 
    117117static sw_driver _driver_solaris = { 
    118   NULL, /* config */ 
     118    NULL, /* config */ 
    119119  open_dev_audio, 
    120120        NULL, /* device_startup unused in this driver */ 
    121121  setup_dev_audio, 
    122   NULL, 
     122    NULL, 
    123123  write_dev_audio, 
    124124  reset_dev_audio, 
     
    126126  drain_dev_audio, 
    127127  close_dev_audio, 
     128    NULL, 
     129    NULL, 
    128130  "solaris_primary_device", 
    129131  "solaris_monitor_device", 
     
    134136 
    135137static sw_driver _driver_solaris = { 
    136   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 
     138  NULL, 
     139  NULL, 
     140  NULL, 
     141  NULL, 
     142  NULL, 
     143  NULL, 
     144  NULL, 
     145  NULL, 
     146  NULL, 
     147  NULL, 
     148  NULL, 
     149  NULL, 
     150  NULL, 
     151  NULL, 
     152  NULL, 
     153  NULL, 
     154  NULL 
    137155}; 
    138156 
  • sweep/branches/sweep-jack-testing/src/play.c

    r505 r506  
    3838#include <pthread.h> 
    3939 
    40 #ifdef DRIVER_JACK 
    41 #include "jack/jack.h" 
    42 #endif 
    43  
    4440#ifdef RECORD_DEMO_FILES 
    4541#include <sndfile.h> 
     
    6157#include "preferences.h" 
    6258#include "sample-display.h" 
    63 #include "driver_jack.h" 
    6459 
    6560/*#define DEBUG*/ 
     
    8681static int pbuf_chans = 0, devbuf_chans = 0; 
    8782 
    88 #ifdef DRIVER_JACK 
    89 extern jack_process_data_t *process_data; 
    90 #endif 
     83 
    9184/* 
    9285 * update_playmarker () 
     
    942935} 
    943936 
    944 #ifdef DRIVER_JACK 
    945  
    946  
    947  
    948 int process_callback( jack_nframes_t nframes, void *data ) { 
    949     struct jack_process_data *jack_data = data; 
     937int sweep_playback_callback( guint32 nframes, void *data ) { 
     938    sw_callback_data_t *cb_data = data; 
    950939 
    951940    if (!main_handle) return 0;  
     
    953942      //jack_data->inactive_writes++; 
    954943    } else { 
    955       jack_data->inactive_writes = 0; 
     944      cb_data->inactive_writes = 0; 
    956945    } 
    957946 
    958947    g_mutex_lock (play_mutex); 
    959     if (jack_data->use_monitor) { 
     948    if (cb_data->use_monitor) { 
    960949      prepare_to_play_heads (active_monitor_heads, monitor_handle); 
    961950      prepare_to_play_heads (active_main_heads, main_handle); 
     
    966955    g_mutex_unlock (play_mutex); 
    967956 
    968     if (jack_data->use_monitor) { 
    969       jack_data->count = nframes * monitor_handle->driver_channels; 
    970       memset (devbuf, 0, jack_data->count * sizeof (sw_audio_t)); 
     957    if (cb_data->use_monitor) { 
     958      cb_data->count = nframes * monitor_handle->driver_channels; 
     959      memset (devbuf, 0, cb_data->count * sizeof (sw_audio_t)); 
    971960      play_heads (&active_monitor_heads, monitor_handle, nframes); 
    972       device_write (monitor_handle, devbuf, jack_data->count, -1 /* offset reference */);   
     961      device_write (monitor_handle, devbuf, cb_data->count, -1 /* offset reference */);   
    973962/* should the main device still play when the monitor is toggled? */ 
    974       jack_data->count = nframes * main_handle->driver_channels; 
    975       memset (devbuf, 0, jack_data->count * sizeof (sw_audio_t)); 
     963      cb_data->count = nframes * main_handle->driver_channels; 
     964      memset (devbuf, 0, cb_data->count * sizeof (sw_audio_t)); 
    976965      play_heads (&active_main_heads, main_handle, nframes);  
    977       device_write (main_handle, devbuf, jack_data->count, -1 /* offset reference */);  
     966      device_write (main_handle, devbuf, cb_data->count, -1 /* offset reference */);  
    978967    } else { 
    979       jack_data->count = nframes * main_handle->driver_channels; 
    980       memset (devbuf, 0, jack_data->count * sizeof (sw_audio_t)); 
     968      cb_data->count = nframes * main_handle->driver_channels; 
     969      memset (devbuf, 0, cb_data->count * sizeof (sw_audio_t)); 
    981970      play_heads (&active_monitor_heads, main_handle, nframes); 
    982971      play_heads (&active_main_heads, main_handle, nframes); 
    983       device_write (main_handle, devbuf, jack_data->count, -1 /* offset reference */);   
     972      device_write (main_handle, devbuf, cb_data->count, -1 /* offset reference */);   
    984973    } 
    985974 
    986975#ifdef RECORD_DEMO_FILES 
    987976    if (sndfile) 
    988       sf_writef_float (jack_data->sndfile, devbuf, jack_data->count / main_handle->driver_channels); 
     977      sf_writef_float (cb_data->sndfile, devbuf, cb_data->count / main_handle->driver_channels); 
    989978#endif 
    990979 
     
    1000989} 
    1001990 
    1002 static void init_play_thread() { 
     991/* if we remerge this and sweep_playback_callback() then 
     992 * we don't need to fetch the process data somehow. 
     993 * however, i don't know whether this was broken out for a good reason. 
     994 * (not realtime safe perhaps?) 
     995 */ 
     996 
     997static void init_playback_callback(void) { 
    1003998  if (!active_main_heads && !active_monitor_heads) return; 
    1004  
    1005   process_data->use_monitor = (monitor_handle != NULL); 
    1006  
    1007   if (process_data->use_monitor) { 
    1008     if ((process_data->gl = active_monitor_heads)) { 
    1009       process_data->head = (sw_head *)process_data->gl->data; 
    1010       process_data->f = process_data->head->sample->sounddata->format; 
     999     
     1000  sw_callback_data_t *callback_data = driver_get_callback_data(); 
     1001  if (callback_data == NULL) 
     1002        return; 
     1003 
     1004  callback_data->use_monitor = (monitor_handle != NULL); 
     1005 
     1006  if (callback_data->use_monitor) { 
     1007    if ((callback_data->gl = active_monitor_heads)) { 
     1008      callback_data->head = (sw_head *)callback_data->gl->data; 
     1009      callback_data->f = callback_data->head->sample->sounddata->format; 
    10111010       
    1012       device_setup (monitor_handle, process_data->f); 
    1013     } else if ((process_data->gl = active_main_heads)) { 
    1014       process_data->head = (sw_head *)process_data->gl->data; 
    1015       process_data->f = process_data->head->sample->sounddata->format; 
     1011      device_setup (monitor_handle, callback_data->f); 
     1012    } else if ((callback_data->gl = active_main_heads)) { 
     1013      callback_data->head = (sw_head *)callback_data->gl->data; 
     1014      callback_data->f = callback_data->head->sample->sounddata->format; 
    10161015       
    1017       device_setup (monitor_handle, process_data->f); 
    1018     } 
    1019   } 
    1020  
    1021   if ((process_data->gl = active_main_heads)) { 
    1022     process_data->head = (sw_head *)process_data->gl->data; 
    1023     process_data->f = process_data->head->sample->sounddata->format; 
    1024  
    1025     device_setup (main_handle, process_data->f); 
     1016      device_setup (monitor_handle, callback_data->f); 
     1017    } 
     1018  } 
     1019 
     1020  if ((callback_data->gl = active_main_heads)) { 
     1021    callback_data->head = (sw_head *)callback_data->gl->data; 
     1022    callback_data->f = callback_data->head->sample->sounddata->format; 
     1023 
     1024    device_setup (main_handle, callback_data->f); 
    10261025 
    10271026#ifdef RECORD_DEMO_FILES     
    1028     process_data->filename = generate_demo_filename (); 
    1029     process_data->sfinfo.samplerate = process_data->f->rate; 
    1030     process_data->sfinfo.channels = handle->driver_channels; 
    1031     process_data->sfinfo.format = SF_FORMAT_AU | SF_FORMAT_FLOAT | SF_ENDIAN_CPU; 
    1032     process_data->sndfile = sf_open (process_data->filename, SFM_WRITE, &sfinfo); 
    1033     if (process_data->sndfile == NULL) sf_perror (NULL); 
    1034     else printf ("Writing to %s\n", process_data->filename); 
    1035 #endif 
    1036   } else if ((process_data->gl = active_monitor_heads)) { 
    1037     process_data->head = (sw_head *)process_data->gl->data; 
    1038     process_data->f = process_data->head->sample->sounddata->format; 
    1039  
    1040     device_setup (main_handle, process_data->f); 
     1027    callback_data->filename = generate_demo_filename (); 
     1028    callback_data->sfinfo.samplerate = callback_data->f->rate; 
     1029    callback_data->sfinfo.channels = handle->driver_channels; 
     1030    callback_data->sfinfo.format = SF_FORMAT_AU | SF_FORMAT_FLOAT | SF_ENDIAN_CPU; 
     1031    callback_data->sndfile = sf_open (callback_data->filename, SFM_WRITE, &sfinfo); 
     1032    if (callback_data->sndfile == NULL) sf_perror (NULL); 
     1033    else printf ("Writing to %s\n", callback_data->filename); 
     1034#endif 
     1035  } else if ((callback_data->gl = active_monitor_heads)) { 
     1036    callback_data->head = (sw_head *)callback_data->gl->data; 
     1037    callback_data->f = callback_data->head->sample->sounddata->format; 
     1038 
     1039    device_setup (main_handle, callback_data->f); 
    10411040  } else { 
    10421041    return; 
    10431042  } 
    10441043 
    1045   if (process_data->use_monitor) { 
    1046     process_data->max_driver_chans = MAX (main_handle->driver_channels, 
     1044  if (callback_data->use_monitor) { 
     1045    callback_data->max_driver_chans = MAX (main_handle->driver_channels, 
    10471046                            monitor_handle->driver_channels); 
    10481047  } else { 
    1049     process_data->max_driver_chans = main_handle->driver_channels; 
    1050   } 
    1051  
    1052   if (process_data->max_driver_chans > devbuf_chans) { 
     1048    callback_data->max_driver_chans = main_handle->driver_channels; 
     1049  } 
     1050 
     1051  if (callback_data->max_driver_chans > devbuf_chans) { 
    10531052    devbuf = g_realloc (devbuf, 
    1054                         MAX_PSIZ * process_data->max_driver_chans * sizeof (sw_audio_t)); 
    1055     devbuf_chans = process_data->max_driver_chans; 
     1053                        MAX_PSIZ * callback_data->max_driver_chans * sizeof (sw_audio_t)); 
     1054    devbuf_chans = callback_data->max_driver_chans; 
    10561055  } 
    10571056 
     
    10621061{ 
    10631062  sw_handle * h; 
    1064   if (player_thread == -1) { 
     1063 
     1064  if (player_thread == (pthread_t) -1) { 
    10651065    if ((h = device_open (0, O_WRONLY)) != NULL) { 
    10661066      main_handle = h; 
     
    10701070        monitor_handle = NULL; 
    10711071      } 
    1072  
    1073       init_play_thread(); 
    1074       player_thread = 0; 
     1072       
     1073        
     1074      if (device_has_callback_driver()) { 
     1075        init_playback_callback(); 
     1076        player_thread = (pthread_t) 0; 
     1077      } else { 
     1078        pthread_create (&player_thread, 
     1079                        NULL, 
     1080                        (void *) (*play_active_heads), 
     1081                        NULL); 
     1082      }             
    10751083      return TRUE; 
    10761084    } else { 
     
    10781086    } 
    10791087  } 
    1080 } 
    1081  
    1082 #else 
    1083  
    1084 static gboolean 
    1085 ensure_playing (void) 
    1086 { 
    1087   sw_handle * h; 
    1088   if (player_thread == (pthread_t) -1) { 
    1089     if ((h = device_open (0, O_WRONLY)) != NULL) { 
    1090       main_handle = h; 
    1091       if (monitor_active() == TRUE) { 
    1092         monitor_handle = device_open (1, O_WRONLY); 
    1093       } else { 
    1094         monitor_handle = NULL; 
    1095       } 
    1096  
    1097       pthread_create (&player_thread, NULL, (void *) (*play_active_heads), 
    1098           NULL); 
    1099       return TRUE; 
    1100     } else { 
    1101       return FALSE; 
    1102     } 
    1103   } 
    1104  
    11051088  return TRUE; 
    11061089} 
    1107 #endif 
     1090 
    11081091 
    11091092void 
  • sweep/branches/sweep-jack-testing/src/play.h

    r505 r506  
    2323 
    2424#include "sweep_app.h" 
    25 #ifdef DRIVER_JACK 
     25 
    2626int 
    27 process_callback(jack_nframes_t nframes, void *data); 
    28  
    29 #include <jack/jack.h> 
    30 #endif 
     27sweep_playback_callback(guint32 nframes, void *data); 
    3128 
    3229void