| @@ -1,7 +1,5 @@ | |||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | |||
| <?fileVersion 4.0.0?> | |||
| <cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> | |||
| <?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> | |||
| <storageModule moduleId="org.eclipse.cdt.core.settings"> | |||
| <cconfiguration id="com.qnx.qcc.toolChain.1426688628"> | |||
| <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.toolChain.1426688628" moduleId="org.eclipse.cdt.core.settings" name="Default"> | |||
| @@ -46,6 +44,7 @@ | |||
| <listOptionValue builtIn="false" value=""${workspace_loc:/jack2/qnx}""/> | |||
| <listOptionValue builtIn="false" value=""${workspace_loc:/jack2/qnx/ioaudio}""/> | |||
| <listOptionValue builtIn="false" value=""${workspace_loc:/QNX Headers/usr_include}""/> | |||
| <listOptionValue builtIn="false" value=""${workspace_loc:/QNX Headers/usr_include/c++/4.7.3}""/> | |||
| </option> | |||
| <option id="gnu.cpp.compiler.option.preprocessor.def.1801463510" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols"> | |||
| <listOptionValue builtIn="false" value="__INT_BITS__=32"/> | |||
| @@ -0,0 +1,24 @@ | |||
| /* | |||
| * JackTime.h | |||
| * | |||
| * Created on: Jan 8, 2016 | |||
| * Author: coopera | |||
| */ | |||
| #ifndef JACKTIME_H_ | |||
| #define JACKTIME_H_ | |||
| #ifdef __cplusplus | |||
| extern "C" | |||
| { | |||
| #endif | |||
| jack_time_t jack_get_microseconds( | |||
| void ); | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* JACKTIME_H_ */ | |||
| @@ -26,6 +26,11 @@ | |||
| #include "jslist.h" | |||
| #include "driver_interface.h" | |||
| #ifdef __cplusplus | |||
| extern "C" | |||
| { | |||
| #endif | |||
| typedef float gain_t; | |||
| typedef long channel_t; | |||
| @@ -297,4 +302,8 @@ jack_driver_nt_t; | |||
| void jack_driver_nt_init (jack_driver_nt_t * driver); | |||
| void jack_driver_nt_finish (jack_driver_nt_t * driver); | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* __jack_driver_h__ */ | |||
| @@ -1,22 +1,22 @@ | |||
| /* | |||
| Copyright (C) 2001 Paul Davis | |||
| Copyright (C) 2004 Grame | |||
| Copyright (C) 2001 Paul Davis | |||
| Copyright (C) 2004 Grame | |||
| This program is free software; you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| the Free Software Foundation; either version 2 of the License, or | |||
| (at your option) any later version. | |||
| This program is free software; you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| the Free Software Foundation; either version 2 of the License, or | |||
| (at your option) any later version. | |||
| This program is distributed in the hope that it will be useful, | |||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
| GNU General Public License for more details. | |||
| This program is distributed in the hope that it will be useful, | |||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
| GNU General Public License for more details. | |||
| You should have received a copy of the GNU General Public License | |||
| along with this program; if not, write to the Free Software | |||
| Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
| You should have received a copy of the GNU General Public License | |||
| along with this program; if not, write to the Free Software | |||
| Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
| */ | |||
| */ | |||
| #ifndef __JackIoAudioDriver__ | |||
| #define __JackIoAudioDriver__ | |||
| @@ -24,33 +24,70 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
| #include "JackAudioDriver.h" | |||
| #include "JackThreadedDriver.h" | |||
| #include "JackTime.h" | |||
| #include "ioaudio_backend.h" | |||
| #include "driver.h" | |||
| #include "memops.h" | |||
| namespace Jack | |||
| typedef struct _ioaudio_driver_args | |||
| { | |||
| char* device; | |||
| bool capture; | |||
| const char* capture_pcm_name; | |||
| size_t user_capture_nchnls; | |||
| bool playback; | |||
| const char* playback_pcm_name; | |||
| size_t user_playback_nchnls; | |||
| size_t srate; | |||
| size_t frames_per_interrupt; | |||
| size_t user_nperiods; | |||
| DitherAlgorithm dither; | |||
| bool hw_monitoring; | |||
| bool hw_metering; | |||
| bool duplex; | |||
| bool soft_mode; | |||
| bool monitor; | |||
| bool shorts_first; | |||
| size_t systemic_input_latency; | |||
| size_t systemic_output_latency; | |||
| const char* midi_driver; | |||
| } ioaudio_driver_args_t; | |||
| /*! | |||
| \brief The IoAudio driver. | |||
| */ | |||
| class JackIoAudioDriver : public JackAudioDriver | |||
| namespace Jack | |||
| { | |||
| private: | |||
| struct ioaudio_driver_t; | |||
| jack_driver_t* fDriver; | |||
| /*! | |||
| \brief The IoAudio driver. | |||
| */ | |||
| void UpdateLatencies(); | |||
| class JackIoAudioDriver: public JackAudioDriver | |||
| { | |||
| public: | |||
| JackIoAudioDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table) | |||
| : JackAudioDriver(name, alias, engine, table),fDriver(NULL) | |||
| {} | |||
| JackIoAudioDriver( | |||
| const char* name, | |||
| const char* alias, | |||
| JackLockedEngine* engine, | |||
| JackSynchro* table ) : | |||
| JackAudioDriver( name, | |||
| alias, | |||
| engine, | |||
| table ), | |||
| fDriver( NULL ) | |||
| { | |||
| } | |||
| virtual ~JackIoAudioDriver() | |||
| {} | |||
| { | |||
| } | |||
| int Open(ioaudio_driver_args_t args); | |||
| int Open( | |||
| ioaudio_driver_args_t args ); | |||
| int Close(); | |||
| int Attach(); | |||
| @@ -65,30 +102,125 @@ class JackIoAudioDriver : public JackAudioDriver | |||
| // BufferSize can be changed | |||
| bool IsFixedBufferSize() | |||
| { | |||
| return false; | |||
| return false; | |||
| } | |||
| int SetBufferSize(jack_nframes_t buffer_size); | |||
| int SetBufferSize( | |||
| jack_nframes_t buffer_size ); | |||
| void ReadInputAux(jack_nframes_t orig_nframes, ssize_t contiguous, ssize_t nread); | |||
| void ReadInputAux( | |||
| jack_nframes_t orig_nframes, | |||
| ssize_t contiguous, | |||
| ssize_t nread ); | |||
| void MonitorInputAux(); | |||
| void ClearOutputAux(); | |||
| void WriteOutputAux(jack_nframes_t orig_nframes, ssize_t contiguous, ssize_t nwritten); | |||
| void SetTimetAux(jack_time_t time); | |||
| // JACK API emulation for the midi driver | |||
| int is_realtime() const; | |||
| int create_thread(pthread_t *thread, int prio, int rt, void *(*start_func)(void*), void *arg); | |||
| jack_port_id_t port_register(const char *port_name, const char *port_type, unsigned long flags, unsigned long buffer_size); | |||
| int port_unregister(jack_port_id_t port_index); | |||
| void* port_get_buffer(int port, jack_nframes_t nframes); | |||
| int port_set_alias(int port, const char* name); | |||
| jack_nframes_t get_sample_rate() const; | |||
| jack_nframes_t frame_time() const; | |||
| jack_nframes_t last_frame_time() const; | |||
| }; | |||
| void WriteOutputAux( | |||
| jack_nframes_t orig_nframes, | |||
| ssize_t contiguous, | |||
| ssize_t nwritten ); | |||
| // void SetTimetAux( | |||
| // jack_time_t time ); | |||
| private: | |||
| ioaudio_driver_args_t fArgs; | |||
| ioaudio_driver_t* fDriver; | |||
| void UpdateLatencies(); | |||
| ssize_t capture_sample_bytes(); | |||
| ssize_t capture_frame_bytes(); | |||
| ssize_t capture_frag_bytes(); | |||
| ssize_t capture_frag_frames(); | |||
| ssize_t playback_sample_bytes(); | |||
| ssize_t playback_frame_bytes(); | |||
| ssize_t playback_frag_bytes(); | |||
| ssize_t playback_frag_frames(); | |||
| void | |||
| create( | |||
| char *name, | |||
| jack_client_t *client ); | |||
| void | |||
| destroy(); | |||
| int | |||
| start(); | |||
| int | |||
| stop(); | |||
| jack_nframes_t | |||
| wait( | |||
| int *status, | |||
| float *delayed_usecs ); | |||
| int | |||
| read( | |||
| jack_nframes_t nframes ); | |||
| void silence_untouched_channels( | |||
| jack_nframes_t nframes ); | |||
| int | |||
| reset_parameters(); | |||
| void mark_channel_done( | |||
| int chn ); | |||
| void silence_on_channel( | |||
| int chn, | |||
| jack_nframes_t nframes ); | |||
| void silence_on_channel_no_mark( | |||
| int chn, | |||
| jack_nframes_t nframes ); | |||
| // void read_from_channel( | |||
| // int chn, | |||
| // jack_default_audio_sample_t *buf, | |||
| // jack_nframes_t nsamples ); | |||
| // void write_to_channel( | |||
| // int chn, | |||
| // jack_default_audio_sample_t *buf, | |||
| // jack_nframes_t nsamples ); | |||
| void release_channel_dependent_memory(); | |||
| int check_capabilities( | |||
| const char *devicename, | |||
| int mode ); | |||
| int check_card_type(); | |||
| int generic_hardware(); | |||
| int hw_specific(); | |||
| void setup_io_function_pointers(); | |||
| int configure_stream( | |||
| const char *device_name, | |||
| const char *stream_name, | |||
| snd_pcm_t *handle, | |||
| snd_pcm_channel_params_t *params, | |||
| unsigned int *nperiodsp ); | |||
| int set_parameters(); | |||
| int get_channel_addresses( | |||
| size_t *capture_avail, | |||
| size_t *playback_avail, | |||
| size_t *capture_offset, | |||
| size_t *playback_offset ); | |||
| int restart(); | |||
| int xrun_recovery( | |||
| float *delayed_usecs ); | |||
| }; | |||
| } // end of namespace | |||
| @@ -1,37 +0,0 @@ | |||
| /* | |||
| Copyright (C) 2001 Paul Davis | |||
| This program is free software; you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| the Free Software Foundation; either version 2 of the License, or | |||
| (at your option) any later version. | |||
| This program is distributed in the hope that it will be useful, | |||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
| GNU General Public License for more details. | |||
| You should have received a copy of the GNU General Public License | |||
| along with this program; if not, write to the Free Software | |||
| Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
| $Id: generic.h,v 1.3 2005/11/23 11:24:29 letz Exp $ | |||
| */ | |||
| #ifndef __jack_generic_h__ | |||
| #define __jack_generic_h__ | |||
| #ifdef __cplusplus | |||
| extern "C" | |||
| { | |||
| #endif | |||
| jack_hardware_t * | |||
| jack_ioaudio_generic_hw_new (ioaudio_driver_t *driver); | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* __jack_generic_h__*/ | |||
| @@ -1,56 +0,0 @@ | |||
| /* | |||
| Copyright (C) 2001 Paul Davis | |||
| This program is free software; you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| the Free Software Foundation; either version 2 of the License, or | |||
| (at your option) any later version. | |||
| This program is distributed in the hope that it will be useful, | |||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
| GNU General Public License for more details. | |||
| You should have received a copy of the GNU General Public License | |||
| along with this program; if not, write to the Free Software | |||
| Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
| $Id: generic_hw.c,v 1.2 2005/08/29 10:36:28 letz Exp $ | |||
| */ | |||
| #include "hardware.h" | |||
| #include "ioaudio_backend.h" | |||
| static int generic_set_input_monitor_mask (jack_hardware_t *hw, unsigned long mask) | |||
| { | |||
| return -1; | |||
| } | |||
| static int generic_change_sample_clock (jack_hardware_t *hw, SampleClockMode mode) | |||
| { | |||
| return -1; | |||
| } | |||
| static void | |||
| generic_release (jack_hardware_t *hw) | |||
| { | |||
| return; | |||
| } | |||
| jack_hardware_t * | |||
| jack_ioaudio_generic_hw_new (ioaudio_driver_t *driver) | |||
| { | |||
| jack_hardware_t *hw; | |||
| hw = (jack_hardware_t *) malloc (sizeof (jack_hardware_t)); | |||
| hw->capabilities = 0; | |||
| hw->input_monitor_mask = 0; | |||
| hw->set_input_monitor_mask = generic_set_input_monitor_mask; | |||
| hw->change_sample_clock = generic_change_sample_clock; | |||
| hw->release = generic_release; | |||
| return hw; | |||
| } | |||
| @@ -1,75 +1,74 @@ | |||
| /* | |||
| Copyright (C) 2001 Paul Davis | |||
| Copyright (C) 2001 Paul Davis | |||
| This program is free software; you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| the Free Software Foundation; either version 2 of the License, or | |||
| (at your option) any later version. | |||
| This program is free software; you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| the Free Software Foundation; either version 2 of the License, or | |||
| (at your option) any later version. | |||
| This program is distributed in the hope that it will be useful, | |||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
| GNU General Public License for more details. | |||
| This program is distributed in the hope that it will be useful, | |||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
| GNU General Public License for more details. | |||
| You should have received a copy of the GNU General Public License | |||
| along with this program; if not, write to the Free Software | |||
| Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
| You should have received a copy of the GNU General Public License | |||
| along with this program; if not, write to the Free Software | |||
| Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
| $Id: hardware.h,v 1.3 2005/11/23 11:24:29 letz Exp $ | |||
| */ | |||
| $Id: hardware.h,v 1.3 2005/11/23 11:24:29 letz Exp $ | |||
| */ | |||
| #ifndef __jack_hardware_h__ | |||
| #define __jack_hardware_h__ | |||
| #include "types.h" | |||
| typedef enum { | |||
| enum SampleClockMode | |||
| { | |||
| AutoSync, | |||
| WordClock, | |||
| ClockMaster | |||
| } SampleClockMode; | |||
| }; | |||
| typedef enum { | |||
| enum Capabilities | |||
| { | |||
| Cap_None = 0x0, | |||
| Cap_HardwareMonitoring = 0x1, | |||
| Cap_AutoSync = 0x2, | |||
| Cap_WordClock = 0x4, | |||
| Cap_ClockMaster = 0x8, | |||
| Cap_ClockLockReporting = 0x10, | |||
| Cap_HardwareMetering = 0x20 | |||
| } Capabilities; | |||
| struct _jack_hardware; | |||
| }; | |||
| typedef void (*JackHardwareReleaseFunction)(struct _jack_hardware *); | |||
| typedef int (*JackHardwareSetInputMonitorMaskFunction)(struct _jack_hardware *, unsigned long); | |||
| typedef int (*JackHardwareChangeSampleClockFunction)(struct _jack_hardware *, SampleClockMode); | |||
| typedef double (*JackHardwareGetHardwarePeak)(jack_port_t *port, jack_nframes_t frames); | |||
| typedef double (*JackHardwareGetHardwarePower)(jack_port_t *port, jack_nframes_t frames); | |||
| typedef struct _jack_hardware | |||
| struct jack_hardware_t | |||
| { | |||
| unsigned long capabilities; | |||
| Capabilities capabilities; | |||
| unsigned long input_monitor_mask; | |||
| JackHardwareChangeSampleClockFunction change_sample_clock; | |||
| JackHardwareSetInputMonitorMaskFunction set_input_monitor_mask; | |||
| JackHardwareReleaseFunction release; | |||
| JackHardwareGetHardwarePeak get_hardware_peak; | |||
| JackHardwareGetHardwarePower get_hardware_power; | |||
| void *private_hw; | |||
| } | |||
| jack_hardware_t; | |||
| #ifdef __cplusplus | |||
| extern "C" | |||
| { | |||
| #endif | |||
| jack_hardware_t() : | |||
| capabilities( Cap_None ), | |||
| input_monitor_mask( 0 ) | |||
| { | |||
| } | |||
| virtual void release() = 0; | |||
| virtual int set_input_monitor_mask( | |||
| unsigned long ) = 0; | |||
| virtual int change_sample_clock( | |||
| SampleClockMode ) = 0; | |||
| jack_hardware_t * jack_hardware_new (); | |||
| virtual double get_hardware_peak( | |||
| jack_port_t *port, | |||
| jack_nframes_t frames ) = 0; | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| virtual double get_hardware_power( | |||
| jack_port_t *port, | |||
| jack_nframes_t frames ) = 0; | |||
| }; | |||
| #endif /* __jack_hardware_h__ */ | |||
| @@ -1,386 +0,0 @@ | |||
| /* | |||
| Copyright (C) 2001 Paul Davis | |||
| This program is free software; you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| the Free Software Foundation; either version 2 of the License, or | |||
| (at your option) any later version. | |||
| This program is distributed in the hope that it will be useful, | |||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
| GNU General Public License for more details. | |||
| You should have received a copy of the GNU General Public License | |||
| along with this program; if not, write to the Free Software | |||
| Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
| $Id: ioaudio_driver.h 945 2006-05-04 15:14:45Z pbd $ | |||
| */ | |||
| #ifndef __jack_ioaudio_driver_h__ | |||
| #define __jack_ioaudio_driver_h__ | |||
| #include <sys/asoundlib.h> | |||
| #include <sys/poll.h> | |||
| #include "bitset.h" | |||
| #if __BYTE_ORDER == __LITTLE_ENDIAN | |||
| #define IS_LE 0 | |||
| #define IS_BE 1 | |||
| #elif __BYTE_ORDER == __BIG_ENDIAN | |||
| #define IS_LE 1 | |||
| #define IS_BE 0 | |||
| #endif | |||
| #define TRUE 1 | |||
| #define FALSE 0 | |||
| #include "types.h" | |||
| #include "hardware.h" | |||
| #include "driver.h" | |||
| #include "memops.h" | |||
| //#include "ioaudio_midi.h" | |||
| #ifdef __cplusplus | |||
| extern "C" | |||
| { | |||
| #endif | |||
| typedef void (*ReadCopyFunction)( | |||
| jack_default_audio_sample_t *dst, | |||
| char *src, | |||
| unsigned long src_bytes, | |||
| unsigned long src_skip_bytes ); | |||
| typedef void (*WriteCopyFunction)( | |||
| char *dst, | |||
| jack_default_audio_sample_t *src, | |||
| unsigned long src_bytes, | |||
| unsigned long dst_skip_bytes, | |||
| dither_state_t *state ); | |||
| typedef struct _ioaudio_driver_args | |||
| { | |||
| char* device; | |||
| char capture; | |||
| const char* capture_pcm_name; | |||
| size_t user_capture_nchnls; | |||
| char playback; | |||
| const char* playback_pcm_name; | |||
| size_t user_playback_nchnls; | |||
| size_t srate; | |||
| size_t frames_per_interrupt; | |||
| size_t user_nperiods; | |||
| DitherAlgorithm dither; | |||
| char hw_monitoring; | |||
| char hw_metering; | |||
| char duplex; | |||
| char soft_mode; | |||
| char monitor; | |||
| char shorts_first; | |||
| size_t systemic_input_latency; | |||
| size_t systemic_output_latency; | |||
| const char* midi_driver; | |||
| } ioaudio_driver_args_t; | |||
| typedef struct _ioaudio_driver | |||
| { | |||
| JACK_DRIVER_NT_DECL | |||
| int poll_timeout_msecs; | |||
| jack_time_t poll_last; | |||
| jack_time_t poll_next; | |||
| char **playback_addr; | |||
| char **capture_addr; | |||
| struct pollfd pfd[SND_PCM_CHANNEL_MAX]; | |||
| unsigned long interleave_unit; | |||
| unsigned long *capture_interleave_skip; | |||
| unsigned long *playback_interleave_skip; | |||
| channel_t max_nchannels; | |||
| channel_t user_nchannels; | |||
| int user_capture_nchnls; | |||
| int user_playback_nchnls; | |||
| jack_nframes_t frame_rate; | |||
| jack_nframes_t frames_per_cycle; | |||
| jack_nframes_t capture_frame_latency; | |||
| jack_nframes_t playback_frame_latency; | |||
| unsigned long *silent; | |||
| char *ioaudio_name_playback; | |||
| char *ioaudio_name_capture; | |||
| char *ioaudio_driver; | |||
| bitset_t channels_not_done; | |||
| bitset_t channels_done; | |||
| float max_sample_val; | |||
| unsigned long user_nperiods; | |||
| unsigned int playback_nperiods; | |||
| unsigned int capture_nperiods; | |||
| unsigned long last_mask; | |||
| snd_ctl_t *ctl_handle; | |||
| snd_pcm_t *playback_handle; | |||
| snd_pcm_channel_params_t playback_params; | |||
| snd_pcm_channel_setup_t playback_setup; | |||
| snd_pcm_mmap_control_t *playback_mmap; | |||
| void *playback_buffer; | |||
| snd_pcm_t *capture_handle; | |||
| snd_pcm_channel_params_t capture_params; | |||
| snd_pcm_channel_setup_t capture_setup; | |||
| snd_pcm_mmap_control_t *capture_mmap; | |||
| void *capture_buffer; | |||
| jack_hardware_t *hw; | |||
| ClockSyncStatus *clock_sync_data; | |||
| jack_client_t *client; | |||
| JSList *capture_ports; | |||
| JSList *playback_ports; | |||
| JSList *monitor_ports; | |||
| unsigned long input_monitor_mask; | |||
| char soft_mode; | |||
| char hw_monitoring; | |||
| char hw_metering; | |||
| char all_monitor_in; | |||
| char capture_and_playback_not_synced; | |||
| char with_monitor_ports; | |||
| char has_clock_sync_reporting; | |||
| char has_hw_monitoring; | |||
| char has_hw_metering; | |||
| char quirk_bswap; | |||
| ReadCopyFunction read_via_copy; | |||
| WriteCopyFunction write_via_copy; | |||
| int dither; | |||
| dither_state_t *dither_state; | |||
| SampleClockMode clock_mode; | |||
| JSList *clock_sync_listeners; | |||
| pthread_mutex_t clock_sync_lock; | |||
| unsigned long next_clock_sync_listener_id; | |||
| int running; | |||
| int run; | |||
| int poll_late; | |||
| int xrun_count; | |||
| int process_count; | |||
| // ioaudio_midi_t *midi; | |||
| char *midi; | |||
| int xrun_recovery; | |||
| } ioaudio_driver_t; | |||
| static inline void | |||
| ioaudio_driver_mark_channel_done( | |||
| ioaudio_driver_t *driver, | |||
| channel_t chn ) | |||
| { | |||
| bitset_remove( driver->channels_not_done, | |||
| chn ); | |||
| driver->silent[chn] = 0; | |||
| } | |||
| static inline void | |||
| ioaudio_driver_silence_on_channel( | |||
| ioaudio_driver_t *driver, | |||
| channel_t chn, | |||
| jack_nframes_t nframes ) | |||
| { | |||
| if( driver->playback_setup.format.interleave ) | |||
| { | |||
| memset_interleave | |||
| ( driver->playback_addr[chn], | |||
| 0, | |||
| snd_pcm_format_size( | |||
| driver->playback_setup.format.format, | |||
| nframes ), | |||
| driver->interleave_unit, | |||
| driver->playback_interleave_skip[chn] ); | |||
| } | |||
| else | |||
| { | |||
| memset( driver->playback_addr[chn], | |||
| 0, | |||
| snd_pcm_format_size( | |||
| driver->playback_setup.format.format, | |||
| nframes ) ); | |||
| } | |||
| ioaudio_driver_mark_channel_done( driver, | |||
| chn ); | |||
| } | |||
| static inline void | |||
| ioaudio_driver_silence_on_channel_no_mark( | |||
| ioaudio_driver_t *driver, | |||
| channel_t chn, | |||
| jack_nframes_t nframes ) | |||
| { | |||
| if( driver->playback_setup.format.interleave ) | |||
| { | |||
| memset_interleave | |||
| ( driver->playback_addr[chn], | |||
| 0, | |||
| snd_pcm_format_size( | |||
| driver->playback_setup.format.format, | |||
| nframes ), | |||
| driver->interleave_unit, | |||
| driver->playback_interleave_skip[chn] ); | |||
| } | |||
| else | |||
| { | |||
| memset( driver->playback_addr[chn], | |||
| 0, | |||
| snd_pcm_format_size( | |||
| driver->playback_setup.format.format, | |||
| nframes ) ); | |||
| } | |||
| } | |||
| static inline void | |||
| ioaudio_driver_read_from_channel( | |||
| ioaudio_driver_t *driver, | |||
| channel_t channel, | |||
| jack_default_audio_sample_t *buf, | |||
| jack_nframes_t nsamples ) | |||
| { | |||
| driver->read_via_copy( buf, | |||
| driver->capture_addr[channel], | |||
| nsamples, | |||
| driver->capture_interleave_skip[channel] ); | |||
| } | |||
| static inline void | |||
| ioaudio_driver_write_to_channel( | |||
| ioaudio_driver_t *driver, | |||
| channel_t channel, | |||
| jack_default_audio_sample_t *buf, | |||
| jack_nframes_t nsamples ) | |||
| { | |||
| driver->write_via_copy( driver->playback_addr[channel], | |||
| buf, | |||
| nsamples, | |||
| driver->playback_interleave_skip[channel], | |||
| driver->dither_state + channel ); | |||
| ioaudio_driver_mark_channel_done( driver, | |||
| channel ); | |||
| } | |||
| void ioaudio_driver_silence_untouched_channels( | |||
| ioaudio_driver_t *driver, | |||
| jack_nframes_t nframes ); | |||
| void ioaudio_driver_set_clock_sync_status( | |||
| ioaudio_driver_t *driver, | |||
| channel_t chn, | |||
| ClockSyncStatus status ); | |||
| int ioaudio_driver_listen_for_clock_sync_status( | |||
| ioaudio_driver_t *, | |||
| ClockSyncListenerFunction, | |||
| void *arg ); | |||
| int ioaudio_driver_stop_listen_for_clock_sync_status( | |||
| ioaudio_driver_t *, | |||
| unsigned int ); | |||
| void ioaudio_driver_clock_sync_notify( | |||
| ioaudio_driver_t *, | |||
| channel_t chn, | |||
| ClockSyncStatus ); | |||
| int | |||
| ioaudio_driver_reset_parameters( | |||
| ioaudio_driver_t *driver, | |||
| jack_nframes_t frames_per_cycle, | |||
| jack_nframes_t user_nperiods, | |||
| jack_nframes_t rate ); | |||
| jack_driver_t * | |||
| ioaudio_driver_new( | |||
| char *name, | |||
| jack_client_t *client, | |||
| ioaudio_driver_args_t args | |||
| ); | |||
| // jack_driver_t * | |||
| // ioaudio_driver_new( | |||
| // char *name, | |||
| // char *playback_ioaudio_device, | |||
| // char *capture_ioaudio_device, | |||
| // jack_client_t *client, | |||
| // jack_nframes_t frames_per_cycle, | |||
| // jack_nframes_t user_nperiods, | |||
| // jack_nframes_t rate, | |||
| // int hw_monitoring, | |||
| // int hw_metering, | |||
| // int capturing, | |||
| // int playing, | |||
| // DitherAlgorithm dither, | |||
| // int soft_mode, | |||
| // int monitor, | |||
| // int user_capture_nchnls, | |||
| // int user_playback_nchnls, | |||
| // int shorts_first, | |||
| // jack_nframes_t capture_latency, | |||
| // jack_nframes_t playback_latency /*, | |||
| // ioaudio_midi_t *midi_driver */ | |||
| // ); | |||
| void | |||
| ioaudio_driver_delete( | |||
| ioaudio_driver_t *driver ); | |||
| int | |||
| ioaudio_driver_start( | |||
| ioaudio_driver_t *driver ); | |||
| int | |||
| ioaudio_driver_stop( | |||
| ioaudio_driver_t *driver ); | |||
| jack_nframes_t | |||
| ioaudio_driver_wait( | |||
| ioaudio_driver_t *driver, | |||
| int extra_fd, | |||
| int *status, | |||
| float | |||
| *delayed_usecs ); | |||
| int | |||
| ioaudio_driver_read( | |||
| ioaudio_driver_t *driver, | |||
| jack_nframes_t nframes ); | |||
| int | |||
| ioaudio_driver_write( | |||
| ioaudio_driver_t* driver, | |||
| jack_nframes_t nframes ); | |||
| jack_time_t jack_get_microseconds( | |||
| void ); | |||
| // Code implemented in JackioaudioDriver.cpp | |||
| void ReadInput( | |||
| jack_nframes_t orig_nframes, | |||
| ssize_t contiguous, | |||
| ssize_t nread ); | |||
| void MonitorInput(); | |||
| void ClearOutput(); | |||
| void WriteOutput( | |||
| jack_nframes_t orig_nframes, | |||
| ssize_t contiguous, | |||
| ssize_t nwritten ); | |||
| void SetTime( | |||
| jack_time_t time ); | |||
| int Restart(); | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* __jack_ioaudio_driver_h__ */ | |||
| @@ -44,8 +44,8 @@ def build(bld): | |||
| ioaudio_driver_src = [ | |||
| '../common/memops.c', | |||
| 'ioaudio/generic_hw.c', | |||
| 'ioaudio/ioaudio_backend.c', | |||
| #'ioaudio/generic_hw.c', | |||
| #'ioaudio/ioaudio_backend.c', | |||
| 'ioaudio/JackIoAudioDriver.cpp', | |||
| ] | |||
| create_jack_driver_obj(bld, 'ioaudio', ioaudio_driver_src, ['IOAUDIO', 'PTHREAD']) | |||