]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Removed card type from devices info. Added card number to devices info. Completed...
authorAbramo Bagnara <abramo@alsa-project.org>
Wed, 31 Jan 2001 17:26:56 +0000 (17:26 +0000)
committerAbramo Bagnara <abramo@alsa-project.org>
Wed, 31 Jan 2001 17:26:56 +0000 (17:26 +0000)
58 files changed:
aserver/aserver.c
include/aserver.h
include/local.h
include/pcm.h
src/conf.c
src/control/bag.c
src/control/cards.c
src/control/control.c
src/control/control_hw.c
src/control/control_local.h
src/control/control_shm.c
src/control/controls.c
src/control/defaults.c
src/error.c
src/hwdep/hwdep.c
src/input.c
src/instr/fm.c
src/instr/iwffff.c
src/instr/simple.c
src/mixer/mixer.c
src/mixer/mixer_local.h
src/mixer/simple.c
src/output.c
src/pcm/interval.c
src/pcm/interval.h
src/pcm/interval_inline.h
src/pcm/mask.c
src/pcm/mask.h
src/pcm/mask_inline.h
src/pcm/pcm.c
src/pcm/pcm_adpcm.c
src/pcm/pcm_alaw.c
src/pcm/pcm_copy.c
src/pcm/pcm_file.c
src/pcm/pcm_hw.c
src/pcm/pcm_linear.c
src/pcm/pcm_local.h
src/pcm/pcm_mmap.c
src/pcm/pcm_mulaw.c
src/pcm/pcm_multi.c
src/pcm/pcm_null.c
src/pcm/pcm_params.c
src/pcm/pcm_plug.c
src/pcm/pcm_plugin.c
src/pcm/pcm_plugin.h
src/pcm/pcm_rate.c
src/pcm/pcm_route.c
src/pcm/pcm_share.c
src/pcm/pcm_shm.c
src/rawmidi/rawmidi.c
src/rawmidi/rawmidi_hw.c
src/rawmidi/rawmidi_local.h
src/seq/seq.c
src/seq/seq_hw.c
src/seq/seq_local.h
src/seq/seq_midi_event.c
src/seq/seqmid.c
src/timer/timer.c

index 5cdc3d79b78c0204a1f5a30670a5677b885f827f..8a2c41d1578433dfcadb81149714e79fa10a47b6 100644 (file)
@@ -34,7 +34,6 @@
 #include <netdb.h>
 #include <limits.h>
 
-#include "asoundlib.h"
 #include "aserver.h"
 #include "list.h"
 
@@ -373,9 +372,6 @@ int pcm_shm_cmd(client_t *client)
        ctrl->cmd = 0;
        pcm = client->device.pcm.handle;
        switch (cmd) {
-       case SND_PCM_IOCTL_CARD:
-               ctrl->result = snd_pcm_card(pcm);
-               break;
        case SND_PCM_IOCTL_ASYNC:
                ctrl->result = snd_pcm_async(pcm, ctrl->u.async.sig, ctrl->u.async.pid);
                break;
@@ -630,9 +626,6 @@ int ctl_shm_cmd(client_t *client)
        case SND_CTL_IOCTL_CLOSE:
                client->ops->close(client);
                break;
-       case SND_CTL_IOCTL_CARD:
-               ctrl->result = snd_ctl_card(ctl);
-               break;
        case SND_CTL_IOCTL_POLL_DESCRIPTOR:
                ctrl->result = 0;
                return shm_ack_fd(client, snd_ctl_poll_descriptor(ctl));
index cfd0309e5e11816e9d67d2de3eb87097ce86104f..4ad4f91d558b74dd1eaf7fad70e762804e1dd61d 100644 (file)
  *
  */
   
-
 #include "../src/pcm/pcm_local.h"
 
-#define SND_PCM_IOCTL_CARD             _IO ('A', 0xf0)
 #define SND_PCM_IOCTL_STATE            _IO ('A', 0xf1)
 #define SND_PCM_IOCTL_MMAP             _IO ('A', 0xf2)
 #define SND_PCM_IOCTL_MUNMAP           _IO ('A', 0xf3)
@@ -68,7 +66,6 @@ typedef struct {
 
 #define PCM_SHM_SIZE sizeof(snd_pcm_shm_ctrl_t)
                
-#define SND_CTL_IOCTL_CARD             _IO ('U', 0xf0)
 #define SND_CTL_IOCTL_READ             _IOR('U', 0xf1, snd_ctl_event_t)
 #define SND_CTL_IOCTL_CLOSE            _IO ('U', 0xf2)
 #define SND_CTL_IOCTL_POLL_DESCRIPTOR  _IO ('U', 0xf3)
index 0c890047171c0db54e9a77f212661dd4a4052ee5..f2d0c1b1cb205207f2847fbf72963d30307bab97 100644 (file)
@@ -19,6 +19,8 @@
  *
  */
 
+#include "asoundlib.h"
+
 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
 #define ERR(...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, 0, __VA_ARGS__)
 #define SYSERR(...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, errno, __VA_ARGS__)
index 3b0f506d95df1a122af1665d7e258da9462b5ceb..3d6d9f199ac020cc1fc2bd0c87258f13016eef0c 100644 (file)
@@ -22,12 +22,10 @@ typedef sndrv_pcm_uframes_t snd_pcm_uframes_t;
 typedef sndrv_pcm_sframes_t snd_pcm_sframes_t;
 typedef struct timeval snd_timestamp_t;
 
-typedef struct sndrv_interval snd_interval_t;
-typedef struct sndrv_pcm_info snd_pcm_info_t;
-typedef struct sndrv_pcm_hw_params snd_pcm_hw_params_t;
-typedef struct sndrv_pcm_sw_params snd_pcm_sw_params_t;
-typedef struct sndrv_pcm_hw_channel_info snd_pcm_hw_channel_info_t;
-typedef struct sndrv_pcm_status snd_pcm_status_t;
+typedef struct _snd_pcm_info snd_pcm_info_t;
+typedef struct _snd_pcm_hw_params snd_pcm_hw_params_t;
+typedef struct _snd_pcm_sw_params snd_pcm_sw_params_t;
+typedef struct _snd_pcm_status snd_pcm_status_t;
 #define SND_PCM_CLASS_GENERIC SNDRV_PCM_CLASS_GENERIC
 #define SND_PCM_CLASS_MULTI SNDRV_PCM_CLASS_MULTI
 #define SND_PCM_CLASS_MODEM SNDRV_PCM_CLASS_MODEM
@@ -153,6 +151,7 @@ typedef struct sndrv_pcm_status snd_pcm_status_t;
 #define SND_PCM_NONBLOCK               0x0001
 #define SND_PCM_ASYNC                  0x0002
 
+typedef struct _snd_mask snd_mask_t;
 typedef struct _snd_pcm snd_pcm_t;
 
 typedef enum _snd_pcm_type {
@@ -198,7 +197,6 @@ snd_pcm_sframes_t snd_pcm_readv(snd_pcm_t *pcm, const struct iovec *vector, int
 
 snd_pcm_type_t snd_pcm_type(snd_pcm_t *pcm);
 int snd_pcm_close(snd_pcm_t *pcm);
-int snd_pcm_card(snd_pcm_t *pcm);
 int snd_pcm_poll_descriptor(snd_pcm_t *pcm);
 int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock);
 int snd_pcm_async(snd_pcm_t *pcm, int sig, pid_t pid);
@@ -207,9 +205,9 @@ int snd_pcm_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
 int snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
 int snd_pcm_hw_free(snd_pcm_t *pcm);
 int snd_pcm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
-int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status);
 int snd_pcm_prepare(snd_pcm_t *pcm);
 int snd_pcm_reset(snd_pcm_t *pcm);
+int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status);
 int snd_pcm_start(snd_pcm_t *pcm);
 int snd_pcm_drop(snd_pcm_t *pcm);
 int snd_pcm_drain(snd_pcm_t *pcm);
@@ -226,7 +224,6 @@ int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, snd_output_t *out);
 int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out);
 int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out);
 int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out);
-int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out);
 int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
 int snd_pcm_unlink(snd_pcm_t *pcm);
 
@@ -234,20 +231,24 @@ int snd_pcm_wait(snd_pcm_t *pcm, int timeout);
 snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm);
 int snd_pcm_set_avail_min(snd_pcm_t *pcm, snd_pcm_uframes_t size);
 
-typedef struct _snd_mask snd_mask_t;
+
+/* Mask */
 size_t snd_mask_sizeof();
+#define snd_mask_alloca(maskp) ({(*maskp) = alloca(snd_mask_sizeof()); 0;})
+int snd_mask_malloc(snd_mask_t **maskp);
+void snd_mask_free(snd_mask_t *mask);
 void snd_mask_none(snd_mask_t *mask);
 void snd_mask_any(snd_mask_t *mask);
-void snd_mask_load(snd_mask_t *mask, unsigned int msk);
-int snd_mask_empty(const snd_mask_t *mask);
 void snd_mask_set(snd_mask_t *mask, unsigned int val);
 void snd_mask_reset(snd_mask_t *mask, unsigned int val);
-void snd_mask_copy(snd_mask_t *mask, const snd_mask_t *v);
-int snd_mask_test(const snd_mask_t *mask, unsigned int val);
-void snd_mask_intersect(snd_mask_t *mask, const snd_mask_t *v);
-void snd_mask_union(snd_mask_t *mask, const snd_mask_t *v);
-int snd_mask_eq(const snd_mask_t *a, const snd_mask_t *b);
-int snd_mask_single(const snd_mask_t *mask);
+void snd_mask_copy(snd_mask_t *dst, const snd_mask_t *src);
+
+/* HW params */
+size_t snd_pcm_hw_params_sizeof();
+#define snd_pcm_hw_params_alloca(paramsp) ({(*paramsp) = alloca(snd_pcm_hw_params_sizeof()); 0;})
+int snd_pcm_hw_params_malloc(snd_pcm_hw_params_t **paramsp);
+int snd_pcm_hw_params_free(snd_pcm_hw_params_t *params);
+void snd_pcm_hw_params_copy(snd_pcm_hw_params_t *dst, const snd_pcm_hw_params_t *src);
 
 int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
 int snd_pcm_hw_param_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
@@ -288,14 +289,10 @@ int snd_pcm_hw_param_minmax_try(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
                                unsigned int *max, int *maxdir);
 int snd_pcm_hw_param_set_try(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
                             snd_pcm_hw_param_t var, unsigned int val, int dir);
-int snd_pcm_hw_param_snd_mask_try(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
+int snd_pcm_hw_param_mask_try(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
                              snd_pcm_hw_param_t var, const snd_mask_t *mask);
 int snd_pcm_hw_param_value(const snd_pcm_hw_params_t *params,
                           snd_pcm_hw_param_t var, int *dir);
-const snd_mask_t *snd_pcm_hw_param_value_mask(const snd_pcm_hw_params_t *params,
-                                         snd_pcm_hw_param_t var);
-const snd_interval_t *snd_pcm_hw_param_value_interval(const snd_pcm_hw_params_t *params,
-                                                 snd_pcm_hw_param_t var);
 unsigned int snd_pcm_hw_param_value_min(const snd_pcm_hw_params_t *params,
                                        snd_pcm_hw_param_t var, int *dir);
 unsigned int snd_pcm_hw_param_value_max(const snd_pcm_hw_params_t *params,
@@ -341,6 +338,7 @@ int snd_pcm_hw_strategy_simple_choices(snd_pcm_hw_strategy_t *strategy, int orde
                                       unsigned int count,
                                       snd_pcm_hw_strategy_simple_choices_list_t *choices);
 
+/* SW params */
 typedef enum _snd_pcm_sw_param {
        SND_PCM_SW_PARAM_START_MODE,
        SND_PCM_SW_PARAM_XRUN_MODE,
@@ -354,12 +352,56 @@ typedef enum _snd_pcm_sw_param {
        SND_PCM_SW_PARAM_LAST = SND_PCM_SW_PARAM_SILENCE_SIZE,
 } snd_pcm_sw_param_t;
 
+size_t snd_pcm_sw_params_sizeof();
+#define snd_pcm_sw_params_alloca(paramsp) ({(*paramsp) = alloca(snd_pcm_sw_params_sizeof()); 0;})
+int snd_pcm_sw_params_malloc(snd_pcm_sw_params_t **paramsp);
+int snd_pcm_sw_params_free(snd_pcm_sw_params_t *params);
+void snd_pcm_sw_params_copy(snd_pcm_sw_params_t *dst, const snd_pcm_sw_params_t *src);
+
 int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
 int snd_pcm_sw_param_set(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_sw_param_t var, unsigned int val);
 int snd_pcm_sw_param_near(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_sw_param_t var, unsigned int val);
 int snd_pcm_sw_param_value(snd_pcm_sw_params_t *params, snd_pcm_sw_param_t var);
 int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, snd_output_t *out);
 
+/* Info */
+size_t snd_pcm_info_sizeof();
+#define snd_pcm_info_alloca(infop) ({(*infop) = alloca(snd_pcm_info_sizeof()); 0;})
+int snd_pcm_info_malloc(snd_pcm_info_t **infop);
+int snd_pcm_info_free(snd_pcm_info_t *info);
+void snd_pcm_info_copy(snd_pcm_info_t *dst, const snd_pcm_info_t *src);
+void snd_pcm_info_set_device(snd_pcm_info_t *info, unsigned int device);
+void snd_pcm_info_set_subdevice(snd_pcm_info_t *info, unsigned int subdevice);
+void snd_pcm_info_set_stream(snd_pcm_info_t *info, snd_pcm_stream_t stream);
+int snd_pcm_info_card(snd_pcm_info_t *info);
+unsigned int snd_pcm_info_device(snd_pcm_info_t *info);
+unsigned int snd_pcm_info_subdevice(snd_pcm_info_t *info);
+snd_pcm_stream_t snd_pcm_info_stream(snd_pcm_info_t *info);
+const char *snd_pcm_info_device_id(snd_pcm_info_t *info);
+const char *snd_pcm_info_device_name(snd_pcm_info_t *info);
+const char *snd_pcm_info_subdevice_name(snd_pcm_info_t *info);
+snd_pcm_class_t snd_pcm_info_device_class(snd_pcm_info_t *info);
+snd_pcm_subclass_t snd_pcm_info_device_subclass(snd_pcm_info_t *info);
+unsigned int snd_pcm_info_subdevices_count(snd_pcm_info_t *info);
+unsigned int snd_pcm_info_subdevices_avail(snd_pcm_info_t *info);
+
+/* Status */
+size_t snd_pcm_status_sizeof();
+#define snd_pcm_status_alloca(statusp) ({(*statusp) = alloca(snd_pcm_status_sizeof()); 0;})
+int snd_pcm_status_malloc(snd_pcm_status_t **statusp);
+int snd_pcm_status_free(snd_pcm_status_t *status);
+void snd_pcm_status_copy(snd_pcm_status_t *dst, const snd_pcm_status_t *src);
+
+snd_pcm_state_t snd_pcm_status_state(snd_pcm_status_t *status);
+int snd_pcm_status_delay(snd_pcm_status_t *status);
+int snd_pcm_status_avail(snd_pcm_status_t *status);
+int snd_pcm_status_avail_max(snd_pcm_status_t *status);
+void snd_pcm_status_tstamp(snd_pcm_status_t *status,
+                          snd_timestamp_t *tstamp);
+void snd_pcm_status_trigger_tstamp(snd_pcm_status_t *status,
+                                  snd_timestamp_t *tstamp);
+int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out);
+
 /* mmap */
 const snd_pcm_channel_area_t *snd_pcm_mmap_areas(snd_pcm_t *pcm);
 const snd_pcm_channel_area_t *snd_pcm_mmap_running_areas(snd_pcm_t *pcm);
@@ -389,11 +431,11 @@ int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_channel, snd_pcm_ufra
                         unsigned int samples, int format);
 int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
                          unsigned int channels, snd_pcm_uframes_t frames, int format);
-int snd_pcm_area_copy(const snd_pcm_channel_area_t *src_channel, snd_pcm_uframes_t src_offset,
-                     const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
+int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
+                     const snd_pcm_channel_area_t *src_channel, snd_pcm_uframes_t src_offset,
                      unsigned int samples, int format);
-int snd_pcm_areas_copy(const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset,
-                      const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
+int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
+                      const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset,
                       unsigned int channels, snd_pcm_uframes_t frames, int format);
 
 snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes);
index 17e5daacd5ead9c80cf8f7b2c60cb8079f3f5f13..da217f458a508ba92efa7660230bed9649d52280 100644 (file)
@@ -23,7 +23,6 @@
 #include <errno.h>
 #include <stdarg.h>
 #include <sys/stat.h>
-#include "asoundlib.h"
 #include "local.h"
 #include "list.h"
 
index ad6f55af165af6e1decd7dc9cc98edc4e33704f0..88d0387b40c4ed2eb1452df6d7d415b7a3fdb8e8 100644 (file)
@@ -29,7 +29,6 @@
 #include <assert.h>
 #define __USE_GNU
 #include <search.h>
-#include "asoundlib.h"
 #include "control_local.h"
 
 int snd_ctl_hbag_create(void **bag)
index ef89ecd6d4d36a7eaa443c50400b5479c055d502..3a3742e8680ac760b98dc067971621a1900691ef 100644 (file)
@@ -28,7 +28,6 @@
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include "control_local.h"
-#include "asoundlib.h"
 
 #define SND_FILE_CONTROL       "/dev/snd/controlC%i"
 #define SND_FILE_LOAD          "/dev/aloadC%i"
index 49b0c462f0842a95c63e9459afb6dac01df416db..0612c314478a74c2a864f9f06b17b9af382b0f38 100644 (file)
@@ -28,7 +28,6 @@
 #include <fcntl.h>
 #include <assert.h>
 #include <dlfcn.h>
-#include "asoundlib.h"
 #include "control_local.h"
 
 snd_ctl_type_t snd_ctl_type(snd_ctl_t *ctl)
@@ -45,12 +44,6 @@ int snd_ctl_close(snd_ctl_t *ctl)
        return res;
 }
 
-int snd_ctl_card(snd_ctl_t *ctl)
-{
-       assert(ctl);
-       return ctl->ops->card(ctl);
-}
-
 int snd_ctl_poll_descriptor(snd_ctl_t *ctl)
 {
        assert(ctl);
index 394e5e9acfdc1d4502c9122bc6d3899b57f767ff..bd0552e0f0b365fbb6e5f077f738997ffdedb310 100644 (file)
@@ -28,7 +28,6 @@
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <assert.h>
-#include "asoundlib.h"
 #include "control_local.h"
 
 #define SNDRV_FILE_CONTROL     "/dev/snd/controlC%i"
@@ -48,12 +47,6 @@ static int snd_ctl_hw_close(snd_ctl_t *handle)
        return res;
 }
 
-static int snd_ctl_hw_card(snd_ctl_t *handle)
-{
-       snd_ctl_hw_t *hw = handle->private;
-       return hw->card;
-}
-
 static int snd_ctl_hw_poll_descriptor(snd_ctl_t *handle)
 {
        snd_ctl_hw_t *hw = handle->private;
@@ -172,7 +165,6 @@ static int snd_ctl_hw_read(snd_ctl_t *handle, snd_ctl_event_t *event)
 
 snd_ctl_ops_t snd_ctl_hw_ops = {
        close: snd_ctl_hw_close,
-       card: snd_ctl_hw_card,
        poll_descriptor: snd_ctl_hw_poll_descriptor,
        hw_info: snd_ctl_hw_hw_info,
        clist: snd_ctl_hw_clist,
index 9a571decb163433380af7f216d16010a5292f5dc..f4953c970da52845797f017dc8c93d2fbabcff5e 100644 (file)
  */
 
 #include <assert.h>
-#include "asoundlib.h"
 #include "local.h"
 #include "list.h"
 
 typedef struct {
        int (*close)(snd_ctl_t *handle);
-       int (*card)(snd_ctl_t *handle);
        int (*poll_descriptor)(snd_ctl_t *handle);
        int (*hw_info)(snd_ctl_t *handle, snd_ctl_hw_info_t *info);
        int (*clist)(snd_ctl_t *handle, snd_control_list_t *list);
index 673e14d304069ecacb3a7caf6747ecaaa431fa9f..d83eedd9b2d7fadcf40e98f0349af1dcd3b17a80 100644 (file)
@@ -34,8 +34,8 @@
 #include <sys/mman.h>
 #include <netinet/in.h>
 #include <netdb.h>
-#include "control_local.h"
 #include "aserver.h"
+#include "control_local.h"
 
 typedef struct {
        int socket;
@@ -95,14 +95,6 @@ static int snd_ctl_shm_close(snd_ctl_t *ctl)
        return result;
 }
 
-static int snd_ctl_shm_card(snd_ctl_t *ctl)
-{
-       snd_ctl_shm_t *shm = ctl->private;
-       volatile snd_ctl_shm_ctrl_t *ctrl = shm->ctrl;
-       ctrl->cmd = SND_CTL_IOCTL_CARD;
-       return snd_ctl_shm_action(ctl);
-}
-
 static int snd_ctl_shm_poll_descriptor(snd_ctl_t *ctl)
 {
        snd_ctl_shm_t *shm = ctl->private;
@@ -318,7 +310,6 @@ static int snd_ctl_shm_read(snd_ctl_t *ctl, snd_ctl_event_t *event)
 
 snd_ctl_ops_t snd_ctl_shm_ops = {
        close: snd_ctl_shm_close,
-       card: snd_ctl_shm_card,
        poll_descriptor: snd_ctl_shm_poll_descriptor,
        hw_info: snd_ctl_shm_hw_info,
        clist: snd_ctl_shm_clist,
index 727fc6ae5ff67ceff20e5b0b669a6e4c2b32f6b3..a009328b925c7a98df02b41f3263cc5f5a56f375 100644 (file)
@@ -29,7 +29,6 @@
 #include <assert.h>
 #define __USE_GNU
 #include <search.h>
-#include "asoundlib.h"
 #include "control_local.h"
 
 static void snd_ctl_hfree1(snd_hcontrol_t *hcontrol);
index e73e72f89e520dc33dcee56c829abc827e1b07af..18edc17066c86f4b72574cb37762bb900a334ff0 100644 (file)
@@ -22,7 +22,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
-#include "asoundlib.h"
+#include "local.h"
 
 static int defaults_card(const char *env)
 {
index fa799c05f15e484175262c77e64b449632d63162..8eed6d3e533f8dcac331becaecb294ba8e0ec36c 100644 (file)
@@ -25,7 +25,7 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
-#include "asoundlib.h"
+#include "local.h"
 
 static const char *snd_error_codes[] =
 {
index 4829c59c77354cf75ee48de77779e335cb3d209e..24e3e7a5bc42dcd02e0efc151b794bcacfa701ca 100644 (file)
@@ -26,7 +26,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
-#include "asoundlib.h"
+#include "local.h"
 
 #define SNDRV_FILE_HWDEP       "/dev/snd/hwC%iD%i"
 #define SNDRV_HWDEP_VERSION_MAX        SNDRV_PROTOCOL_VERSION(1, 0, 0)
index 2901a86a76ea06376db6c49e25ebb71a3e7acdeb..fc294f7511c6004b343704b75d49c04c67ccce42 100644 (file)
@@ -26,7 +26,6 @@
 #include <unistd.h>
 #include <errno.h>
 #include "local.h"
-#include "asoundlib.h"
 
 typedef struct _snd_input_ops {
        int (*close)(snd_input_t *input);
index 4ce40df60ddc37bb1eceb8b6ed596b4d6dca4d6b..d21b0298c4b9b2d67f0246d865660872636c87b4 100644 (file)
@@ -24,7 +24,7 @@
 #include <errno.h>
 #include <sys/stat.h>
 #include <stdio.h>
-#include "asoundlib.h"
+#include "local.h"
 #include <asm/byteorder.h>
 #include <linux/ainstr_fm.h>
 
index 9b3c179f0a2b4c95c6a7521101a1002e58050065..8714771915c2c7a1c5c51db634f25a8d10ba4431 100644 (file)
@@ -25,7 +25,7 @@
 #include <errno.h>
 #include <sys/stat.h>
 #include <stdio.h>
-#include "asoundlib.h"
+#include "local.h"
 #include <linux/ainstr_iw.h>
 
 /*
index 594e524b9487b98264c7ed7c8a37ae43402b2530..0b1d13e6923e3912c534c601eba1960f0013fae1 100644 (file)
@@ -25,7 +25,7 @@
 #include <errno.h>
 #include <sys/stat.h>
 #include <stdio.h>
-#include "asoundlib.h"
+#include "local.h"
 #include <asm/byteorder.h>
 #include <linux/ainstr_simple.h>
 
index b534ffdb5cc1fc875121f1ffbaff68a4ca1159c0..98049d9db5ed1e9915cbec0a461d406925aac2f0 100644 (file)
@@ -26,7 +26,6 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
-#include "asoundlib.h"
 #include "mixer_local.h"
 
 static void snd_mixer_simple_read_rebuild(snd_ctl_t *ctl_handle, void *private_data);
index a5eb3adb2fd261f36ff417f7298a7721bdd03d34..719084b5574e443cf3eb162b82e5fc74d9293b39 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 #include <assert.h>
-#include "asoundlib.h"
+#include "local.h"
 #include "list.h"
 
 typedef struct _mixer_simple mixer_simple_t;
index b5025d13e2beb3493c035b3f241a9dcc584cc71e..947cbc12c339bc170aaad5cbe8054398f423564b 100644 (file)
@@ -26,7 +26,6 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
-#include "asoundlib.h"
 #include "mixer_local.h"
 
 static struct mixer_name_table {
index f51831d4843b089cb9088a16dc2053cdcc79baa2..3dc44262fc78a4f9e4f0cd0976abe066e10cea4e 100644 (file)
@@ -26,7 +26,6 @@
 #include <unistd.h>
 #include <errno.h>
 #include "local.h"
-#include "asoundlib.h"
 
 typedef struct _snd_output_ops {
        int (*close)(snd_output_t *output);
index 315f558f3b99db450f914daef59294c9ee0745c8..8be7d3d6052b9da7b75f864e0131c1632689eeec 100644 (file)
@@ -26,8 +26,7 @@
 #include <limits.h>
 #include <errno.h>
 #include <assert.h>
-#include "asoundlib.h"
-#include "interval.h"
+#include "pcm_local.h"
 
 static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem)
 {
index 6014ffd2ee480c0eb35672d1fb625c4da06dda21..0cd805b21e4db391086e80790708b85665ed20e8 100644 (file)
@@ -19,7 +19,7 @@
  *
  */
   
-#include <stdio.h>
+typedef struct _snd_interval snd_interval_t;
 
 #ifdef SND_INTERVAL_INLINE
 #include "interval_inline.h"
index eb0245a69ccd9ac268a1d3bcf62242ac01ee7ced..0a26758ebf68048cf5e6cfebfd1ee4d63ba1e8c2 100644 (file)
  */
   
 #ifdef SND_INTERVAL_C
-#define INLINE inline
+#define INTERVAL_INLINE inline
 #else
-#define INLINE extern inline
+#define INTERVAL_INLINE extern inline
 #endif
 
-INLINE void snd_interval_any(snd_interval_t *i)
+INTERVAL_INLINE void snd_interval_any(snd_interval_t *i)
 {
        i->min = 0;
        i->openmin = 0;
@@ -35,59 +35,59 @@ INLINE void snd_interval_any(snd_interval_t *i)
        i->empty = 0;
 }
 
-INLINE void snd_interval_none(snd_interval_t *i)
+INTERVAL_INLINE void snd_interval_none(snd_interval_t *i)
 {
        i->empty = 1;
 }
 
-INLINE int snd_interval_checkempty(const snd_interval_t *i)
+INTERVAL_INLINE int snd_interval_checkempty(const snd_interval_t *i)
 {
        return (i->min > i->max ||
                (i->min == i->max && (i->openmin || i->openmax)));
 }
 
-INLINE int snd_interval_empty(const snd_interval_t *i)
+INTERVAL_INLINE int snd_interval_empty(const snd_interval_t *i)
 {
        return i->empty;
 }
 
-INLINE int snd_interval_single(const snd_interval_t *i)
+INTERVAL_INLINE int snd_interval_single(const snd_interval_t *i)
 {
        assert(!snd_interval_empty(i));
        return (i->min == i->max || 
                (i->min + 1 == i->max && i->openmax));
 }
 
-INLINE int snd_interval_value(const snd_interval_t *i)
+INTERVAL_INLINE int snd_interval_value(const snd_interval_t *i)
 {
        assert(snd_interval_single(i));
        return i->min;
 }
 
-INLINE int snd_interval_min(const snd_interval_t *i)
+INTERVAL_INLINE int snd_interval_min(const snd_interval_t *i)
 {
        assert(!snd_interval_empty(i));
        return i->min;
 }
 
-INLINE int snd_interval_max(const snd_interval_t *i)
+INTERVAL_INLINE int snd_interval_max(const snd_interval_t *i)
 {
        assert(!snd_interval_empty(i));
        return i->max;
 }
 
-INLINE int snd_interval_test(const snd_interval_t *i, unsigned int val)
+INTERVAL_INLINE int snd_interval_test(const snd_interval_t *i, unsigned int val)
 {
        return !((i->min > val || (i->min == val && i->openmin) ||
                  i->max < val || (i->max == val && i->openmax)));
 }
 
-INLINE void snd_interval_copy(snd_interval_t *d, const snd_interval_t *s)
+INTERVAL_INLINE void snd_interval_copy(snd_interval_t *d, const snd_interval_t *s)
 {
        *d = *s;
 }
 
-INLINE int snd_interval_setinteger(snd_interval_t *i)
+INTERVAL_INLINE int snd_interval_setinteger(snd_interval_t *i)
 {
        if (i->integer)
                return 0;
@@ -97,7 +97,7 @@ INLINE int snd_interval_setinteger(snd_interval_t *i)
        return 1;
 }
 
-INLINE void snd_interval_floor(snd_interval_t *i)
+INTERVAL_INLINE void snd_interval_floor(snd_interval_t *i)
 {
        if (i->integer || snd_interval_empty(i))
                return;
@@ -109,7 +109,7 @@ INLINE void snd_interval_floor(snd_interval_t *i)
        i->integer = 1;
 }
 
-INLINE void snd_interval_unfloor(snd_interval_t *i)
+INTERVAL_INLINE void snd_interval_unfloor(snd_interval_t *i)
 {
        if (snd_interval_empty(i))
                return;
@@ -123,13 +123,13 @@ INLINE void snd_interval_unfloor(snd_interval_t *i)
 }
 
 
-INLINE int snd_interval_always_eq(const snd_interval_t *i1, const snd_interval_t *i2)
+INTERVAL_INLINE int snd_interval_always_eq(const snd_interval_t *i1, const snd_interval_t *i2)
 {
        return snd_interval_single(i1) && snd_interval_single(i2) &&
                snd_interval_value(i1) == snd_interval_value(i2);
 }
 
-INLINE int snd_interval_never_eq(const snd_interval_t *i1, const snd_interval_t *i2)
+INTERVAL_INLINE int snd_interval_never_eq(const snd_interval_t *i1, const snd_interval_t *i2)
 {
        
        return (i1->max < i2->min || 
index b650abd85ad81fc0480e997b3e0eff387aac9520..c84da00eb17a03ba7dc387d5fc737be8e1650d30 100644 (file)
@@ -26,6 +26,5 @@
 #include <limits.h>
 #include <errno.h>
 #include <assert.h>
-#include "asoundlib.h"
-#include "mask.h"
+#include "pcm_local.h"
 
index 6a10c9a56521c063c2773dbda0db43cd515fe3cb..1bfefdd547f491d7377c771adf325f85d6e3de6b 100644 (file)
  *
  */
   
-#include <sys/types.h>
-#include <limits.h>
-#include <errno.h>
-#include <assert.h>
-#include "asoundlib.h"
-
 #define SND_MASK_MAX 31
 
 #ifdef SND_MASK_INLINE
index d68db00b6844f1bd0d787ef34b16a20dff8530a9..37eb4a77caa45d85e03560f43445110700e92652 100644 (file)
@@ -23,9 +23,9 @@
 #include <assert.h>
 
 #ifdef SND_MASK_C
-#define INLINE inline
+#define MASK_INLINE inline
 #else
-#define INLINE extern inline
+#define MASK_INLINE extern inline
 #endif
 
 #ifndef MASK_MASK
@@ -38,7 +38,7 @@ struct _snd_mask {
 
 #define snd_mask_bits(mask) ((mask)->bits)
 
-INLINE unsigned int ld2(u_int32_t v)
+MASK_INLINE unsigned int ld2(u_int32_t v)
 {
         unsigned r = 0;
 
@@ -63,7 +63,7 @@ INLINE unsigned int ld2(u_int32_t v)
         return r;
 }
 
-INLINE unsigned int hweight32(u_int32_t v)
+MASK_INLINE unsigned int hweight32(u_int32_t v)
 {
         v = (v & 0x55555555) + ((v >> 1) & 0x55555555);
         v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
@@ -72,116 +72,116 @@ INLINE unsigned int hweight32(u_int32_t v)
         return (v & 0x0000FFFF) + ((v >> 16) & 0x0000FFFF);
 }
 
-INLINE size_t snd_mask_sizeof(void)
+MASK_INLINE size_t snd_mask_sizeof(void)
 {
        return sizeof(snd_mask_t);
 }
 
-INLINE void snd_mask_none(snd_mask_t *mask)
+MASK_INLINE void snd_mask_none(snd_mask_t *mask)
 {
        snd_mask_bits(mask) = 0;
 }
 
-INLINE void snd_mask_any(snd_mask_t *mask)
+MASK_INLINE void snd_mask_any(snd_mask_t *mask)
 {
        snd_mask_bits(mask) = ~0U;
 }
 
-INLINE void snd_mask_load(snd_mask_t *mask, unsigned int msk)
+MASK_INLINE void snd_mask_load(snd_mask_t *mask, unsigned int msk)
 {
        snd_mask_bits(mask) = msk;
 }
 
-INLINE int snd_mask_empty(const snd_mask_t *mask)
+MASK_INLINE int snd_mask_empty(const snd_mask_t *mask)
 {
        return snd_mask_bits(mask) == 0;
 }
 
-INLINE int snd_mask_full(const snd_mask_t *mask)
+MASK_INLINE int snd_mask_full(const snd_mask_t *mask)
 {
        return snd_mask_bits(mask) == ~0U;
 }
 
-INLINE unsigned int snd_mask_count(const snd_mask_t *mask)
+MASK_INLINE unsigned int snd_mask_count(const snd_mask_t *mask)
 {
        return hweight32(snd_mask_bits(mask));
 }
 
-INLINE unsigned int snd_mask_min(const snd_mask_t *mask)
+MASK_INLINE unsigned int snd_mask_min(const snd_mask_t *mask)
 {
        assert(!snd_mask_empty(mask));
        return ffs(snd_mask_bits(mask)) - 1;
 }
 
-INLINE unsigned int snd_mask_max(const snd_mask_t *mask)
+MASK_INLINE unsigned int snd_mask_max(const snd_mask_t *mask)
 {
        assert(!snd_mask_empty(mask));
        return ld2(snd_mask_bits(mask));
 }
 
-INLINE void snd_mask_set(snd_mask_t *mask, unsigned int val)
+MASK_INLINE void snd_mask_set(snd_mask_t *mask, unsigned int val)
 {
        assert(val <= SND_MASK_MAX);
        snd_mask_bits(mask) |= (1U << val);
 }
 
-INLINE void snd_mask_reset(snd_mask_t *mask, unsigned int val)
+MASK_INLINE void snd_mask_reset(snd_mask_t *mask, unsigned int val)
 {
        assert(val <= SND_MASK_MAX);
        snd_mask_bits(mask) &= ~(1U << val);
 }
 
-INLINE void snd_mask_set_range(snd_mask_t *mask, unsigned int from, unsigned int to)
+MASK_INLINE void snd_mask_set_range(snd_mask_t *mask, unsigned int from, unsigned int to)
 {
        assert(to <= SND_MASK_MAX && from <= to);
        snd_mask_bits(mask) |= ((1U << (from - to + 1)) - 1) << from;
 }
 
-INLINE void snd_mask_reset_range(snd_mask_t *mask, unsigned int from, unsigned int to)
+MASK_INLINE void snd_mask_reset_range(snd_mask_t *mask, unsigned int from, unsigned int to)
 {
        assert(to <= SND_MASK_MAX && from <= to);
        snd_mask_bits(mask) &= ~(((1U << (from - to + 1)) - 1) << from);
 }
 
-INLINE void snd_mask_leave(snd_mask_t *mask, unsigned int val)
+MASK_INLINE void snd_mask_leave(snd_mask_t *mask, unsigned int val)
 {
        assert(val <= SND_MASK_MAX);
        snd_mask_bits(mask) &= 1U << val;
 }
 
-INLINE void snd_mask_intersect(snd_mask_t *mask, const snd_mask_t *v)
+MASK_INLINE void snd_mask_intersect(snd_mask_t *mask, const snd_mask_t *v)
 {
        snd_mask_bits(mask) &= snd_mask_bits(v);
 }
 
-INLINE void snd_mask_union(snd_mask_t *mask, const snd_mask_t *v)
+MASK_INLINE void snd_mask_union(snd_mask_t *mask, const snd_mask_t *v)
 {
        snd_mask_bits(mask) |= snd_mask_bits(v);
 }
 
-INLINE int snd_mask_eq(const snd_mask_t *mask, const snd_mask_t *v)
+MASK_INLINE int snd_mask_eq(const snd_mask_t *mask, const snd_mask_t *v)
 {
        return snd_mask_bits(mask) == snd_mask_bits(v);
 }
 
-INLINE void snd_mask_copy(snd_mask_t *mask, const snd_mask_t *v)
+MASK_INLINE void snd_mask_copy(snd_mask_t *mask, const snd_mask_t *v)
 {
        snd_mask_bits(mask) = snd_mask_bits(v);
 }
 
-INLINE int snd_mask_test(const snd_mask_t *mask, unsigned int val)
+MASK_INLINE int snd_mask_test(const snd_mask_t *mask, unsigned int val)
 {
        assert(val <= SND_MASK_MAX);
        return snd_mask_bits(mask) & (1U << val);
 }
 
-INLINE int snd_mask_single(const snd_mask_t *mask)
+MASK_INLINE int snd_mask_single(const snd_mask_t *mask)
 {
        assert(!snd_mask_empty(mask));
        return !(snd_mask_bits(mask) & (snd_mask_bits(mask) - 1));
 }
 
-INLINE int snd_mask_refine(snd_mask_t *mask, const snd_mask_t *v)
+MASK_INLINE int snd_mask_refine(snd_mask_t *mask, const snd_mask_t *v)
 {
        snd_mask_t old;
        assert(!snd_mask_empty(mask));
@@ -192,7 +192,7 @@ INLINE int snd_mask_refine(snd_mask_t *mask, const snd_mask_t *v)
        return !snd_mask_eq(mask, &old);
 }
 
-INLINE int snd_mask_refine_first(snd_mask_t *mask)
+MASK_INLINE int snd_mask_refine_first(snd_mask_t *mask)
 {
        assert(!snd_mask_empty(mask));
        if (snd_mask_single(mask))
@@ -201,7 +201,7 @@ INLINE int snd_mask_refine_first(snd_mask_t *mask)
        return 1;
 }
 
-INLINE int snd_mask_refine_last(snd_mask_t *mask)
+MASK_INLINE int snd_mask_refine_last(snd_mask_t *mask)
 {
        assert(!snd_mask_empty(mask));
        if (snd_mask_single(mask))
@@ -210,7 +210,7 @@ INLINE int snd_mask_refine_last(snd_mask_t *mask)
        return 1;
 }
 
-INLINE int snd_mask_refine_min(snd_mask_t *mask, unsigned int val)
+MASK_INLINE int snd_mask_refine_min(snd_mask_t *mask, unsigned int val)
 {
        assert(!snd_mask_empty(mask));
        if (snd_mask_min(mask) >= val)
@@ -221,7 +221,7 @@ INLINE int snd_mask_refine_min(snd_mask_t *mask, unsigned int val)
        return 1;
 }
 
-INLINE int snd_mask_refine_max(snd_mask_t *mask, unsigned int val)
+MASK_INLINE int snd_mask_refine_max(snd_mask_t *mask, unsigned int val)
 {
        assert(!snd_mask_empty(mask));
        if (snd_mask_max(mask) <= val)
@@ -232,7 +232,7 @@ INLINE int snd_mask_refine_max(snd_mask_t *mask, unsigned int val)
        return 1;
 }
 
-INLINE int snd_mask_refine_set(snd_mask_t *mask, unsigned int val)
+MASK_INLINE int snd_mask_refine_set(snd_mask_t *mask, unsigned int val)
 {
        int changed;
        assert(!snd_mask_empty(mask));
@@ -243,19 +243,19 @@ INLINE int snd_mask_refine_set(snd_mask_t *mask, unsigned int val)
        return changed;
 }
 
-INLINE int snd_mask_value(const snd_mask_t *mask)
+MASK_INLINE int snd_mask_value(const snd_mask_t *mask)
 {
        assert(!snd_mask_empty(mask));
        return snd_mask_min(mask);
 }
 
-INLINE int snd_mask_always_eq(const snd_mask_t *m1, const snd_mask_t *m2)
+MASK_INLINE int snd_mask_always_eq(const snd_mask_t *m1, const snd_mask_t *m2)
 {
        return snd_mask_single(m1) && snd_mask_single(m2) &&
                snd_mask_value(m1) == snd_mask_value(m2);
 }
 
-INLINE int snd_mask_never_eq(const snd_mask_t *m1, const snd_mask_t *m2)
+MASK_INLINE int snd_mask_never_eq(const snd_mask_t *m1, const snd_mask_t *m2)
 {
        return (snd_mask_bits(m1) & snd_mask_bits(m2)) == 0;
 }
index d188e9b76d3581686e8cab1ebed788a786e5496d..c7e629563287a030129cb547c2b23f12c9cb8f8e 100644 (file)
@@ -229,12 +229,6 @@ snd_pcm_sframes_t snd_pcm_readv(snd_pcm_t *pcm, const struct iovec *vector, int
        return snd_pcm_readn(pcm, bufs, vector[0].iov_len);
 }
 
-int snd_pcm_card(snd_pcm_t *pcm)
-{
-       assert(pcm);
-       return pcm->ops->card(pcm->op_arg);
-}
-
 /* FIXME */
 #define snd_pcm_link_descriptor snd_pcm_poll_descriptor
 
@@ -545,12 +539,188 @@ int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out)
        return 0;
 }
 
+size_t snd_pcm_info_sizeof()
+{
+       return sizeof(snd_pcm_info_t);
+}
+
+int snd_pcm_info_malloc(snd_pcm_info_t **infop)
+{
+       assert(infop);
+       *infop = malloc(sizeof(snd_pcm_info_t));
+       if (!*infop)
+               return -ENOMEM;
+       return 0;
+}
+
+int snd_pcm_info_free(snd_pcm_info_t *info)
+{
+       assert(info);
+       free(info);
+}
+
+void snd_pcm_info_copy(snd_pcm_info_t *dst,
+                      const snd_pcm_info_t *src)
+{
+       assert(dst && src);
+       *dst = *src;
+}
+
+void snd_pcm_info_set_device(snd_pcm_info_t *info, unsigned int device)
+{
+       assert(info);
+       info->device = device;
+}
+
+void snd_pcm_info_set_subdevice(snd_pcm_info_t *info, unsigned int subdevice)
+{
+       assert(info);
+       info->subdevice = subdevice;
+}
+
+void snd_pcm_info_set_stream(snd_pcm_info_t *info, snd_pcm_stream_t stream)
+{
+       assert(info);
+       info->stream = stream;
+}
+
+int snd_pcm_info_card(snd_pcm_info_t *info)
+{
+       assert(info);
+       return info->card;
+}
+
+unsigned int snd_pcm_info_device(snd_pcm_info_t *info)
+{
+       assert(info);
+       return info->device;
+}
+
+unsigned int snd_pcm_info_subdevice(snd_pcm_info_t *info)
+{
+       assert(info);
+       return info->subdevice;
+}
+
+snd_pcm_stream_t snd_pcm_info_stream(snd_pcm_info_t *info)
+{
+       assert(info);
+       return info->stream;
+}
+
+const char *snd_pcm_info_device_id(snd_pcm_info_t *info)
+{
+       assert(info);
+       return info->id;
+}
+
+const char *snd_pcm_info_device_name(snd_pcm_info_t *info)
+{
+       assert(info);
+       return info->name;
+}
+
+const char *snd_pcm_info_subdevice_name(snd_pcm_info_t *info)
+{
+       assert(info);
+       return info->subname;
+}
+
+snd_pcm_class_t snd_pcm_info_device_class(snd_pcm_info_t *info)
+{
+       assert(info);
+       return info->class;
+}
+
+snd_pcm_subclass_t snd_pcm_info_device_subclass(snd_pcm_info_t *info)
+{
+       assert(info);
+       return info->subclass;
+}
+
+unsigned int snd_pcm_info_subdevices_count(snd_pcm_info_t *info)
+{
+       assert(info);
+       return info->subdevices_count;
+}
+
+unsigned int snd_pcm_info_subdevices_avail(snd_pcm_info_t *info)
+{
+       assert(info);
+       return info->subdevices_avail;
+}
+
+size_t snd_pcm_status_sizeof()
+{
+       return sizeof(snd_pcm_status_t);
+}
+
+int snd_pcm_status_malloc(snd_pcm_status_t **statusp)
+{
+       assert(statusp);
+       *statusp = malloc(sizeof(snd_pcm_status_t));
+       if (!*statusp)
+               return -ENOMEM;
+       return 0;
+}
+
+int snd_pcm_status_free(snd_pcm_status_t *status)
+{
+       assert(status);
+       free(status);
+}
+
+void snd_pcm_status_copy(snd_pcm_status_t *dst,
+                        const snd_pcm_status_t *src)
+{
+       assert(dst && src);
+       *dst = *src;
+}
+
+snd_pcm_state_t snd_pcm_status_state(snd_pcm_status_t *status)
+{
+       assert(status);
+       return status->state;
+}
+
+int snd_pcm_status_delay(snd_pcm_status_t *status)
+{
+       assert(status);
+       return status->delay;
+}
+
+int snd_pcm_status_avail(snd_pcm_status_t *status)
+{
+       assert(status);
+       return status->avail;
+}
+
+int snd_pcm_status_avail_max(snd_pcm_status_t *status)
+{
+       assert(status);
+       return status->avail_max;
+}
+
+void snd_pcm_status_tstamp(snd_pcm_status_t *status,
+                          snd_timestamp_t *tstamp)
+{
+       assert(status && tstamp);
+       *tstamp = status->tstamp;
+}
+
+void snd_pcm_status_trigger_tstamp(snd_pcm_status_t *status,
+                                 snd_timestamp_t *tstamp)
+{
+       assert(status && tstamp);
+       *tstamp = status->trigger_tstamp;
+}
+
 int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out)
 {
        assert(status);
        snd_output_printf(out, "state       : %s\n", snd_pcm_state_name(status->state));
        snd_output_printf(out, "trigger_time: %ld.%06ld\n",
-               status->trigger_time.tv_sec, status->trigger_time.tv_usec);
+               status->trigger_tstamp.tv_sec, status->trigger_tstamp.tv_usec);
        snd_output_printf(out, "tstamp      : %ld.%06ld\n",
                status->tstamp.tv_sec, status->tstamp.tv_usec);
        snd_output_printf(out, "delay       : %ld\n", (long)status->delay);
@@ -902,8 +1072,8 @@ int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_areas, snd_pcm_ufram
 }
 
 
-int snd_pcm_area_copy(const snd_pcm_channel_area_t *src_area, snd_pcm_uframes_t src_offset,
-                     const snd_pcm_channel_area_t *dst_area, snd_pcm_uframes_t dst_offset,
+int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_area, snd_pcm_uframes_t dst_offset,
+                     const snd_pcm_channel_area_t *src_area, snd_pcm_uframes_t src_offset,
                      unsigned int samples, int format)
 {
        /* FIXME: sub byte resolution and odd dst_offset */
@@ -997,8 +1167,8 @@ int snd_pcm_area_copy(const snd_pcm_channel_area_t *src_area, snd_pcm_uframes_t
        return 0;
 }
 
-int snd_pcm_areas_copy(const snd_pcm_channel_area_t *src_areas, snd_pcm_uframes_t src_offset,
-                      const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset,
+int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset,
+                      const snd_pcm_channel_area_t *src_areas, snd_pcm_uframes_t src_offset,
                       unsigned int channels, snd_pcm_uframes_t frames, int format)
 {
        int width = snd_pcm_format_physical_width(format);
@@ -1032,10 +1202,14 @@ int snd_pcm_areas_copy(const snd_pcm_channel_area_t *src_areas, snd_pcm_uframes_
                        d.addr = dst_start->addr;
                        d.first = dst_start->first;
                        d.step = width;
-                       snd_pcm_area_copy(&s, src_offset * chns, &d, dst_offset * chns, frames * chns, format);
+                       snd_pcm_area_copy(&d, dst_offset * chns,
+                                         &s, src_offset * chns, 
+                                         frames * chns, format);
                        channels -= chns;
                } else {
-                       snd_pcm_area_copy(src_start, src_offset, dst_start, dst_offset, frames, format);
+                       snd_pcm_area_copy(dst_start, dst_offset,
+                                         src_start, src_offset,
+                                         frames, format);
                        src_areas = src_start + 1;
                        dst_areas = dst_start + 1;
                        channels--;
@@ -1216,3 +1390,8 @@ snd_pcm_uframes_t _snd_pcm_mmap_hw_ptr(snd_pcm_t *pcm)
        return *pcm->hw_ptr;
 }
 
+snd_pcm_uframes_t _snd_pcm_boundary(snd_pcm_t *pcm)
+{
+       return pcm->boundary;
+}
+
index 0dde7fbdf5da2e98ad9f298cb8f4f0a85fd48270..f8882844f5853b3aafa5ee308669f3f70abca7a8 100644 (file)
@@ -51,10 +51,10 @@ IMA compatability project proceedings, Vol 2, Issue 2, May 1992.
 #include "pcm_local.h"
 #include "pcm_plugin.h"
 
-typedef void (*adpcm_f)(const snd_pcm_channel_area_t *src_areas,
-                       snd_pcm_uframes_t src_offset,
-                       const snd_pcm_channel_area_t *dst_areas,
+typedef void (*adpcm_f)(const snd_pcm_channel_area_t *dst_areas,
                        snd_pcm_uframes_t dst_offset,
+                       const snd_pcm_channel_area_t *src_areas,
+                       snd_pcm_uframes_t src_offset,
                        unsigned int channels, snd_pcm_uframes_t frames, int getputidx,
                        snd_pcm_adpcm_state_t *states);
 
@@ -190,10 +190,10 @@ static int adpcm_decoder(unsigned char code, snd_pcm_adpcm_state_t * state)
        return (state->pred_val);
 }
 
-void snd_pcm_adpcm_decode(const snd_pcm_channel_area_t *src_areas,
-                         snd_pcm_uframes_t src_offset,
-                         const snd_pcm_channel_area_t *dst_areas,
+void snd_pcm_adpcm_decode(const snd_pcm_channel_area_t *dst_areas,
                          snd_pcm_uframes_t dst_offset,
+                         const snd_pcm_channel_area_t *src_areas,
+                         snd_pcm_uframes_t src_offset,
                          unsigned int channels, snd_pcm_uframes_t frames, int putidx,
                          snd_pcm_adpcm_state_t *states)
 {
@@ -251,10 +251,10 @@ void snd_pcm_adpcm_decode(const snd_pcm_channel_area_t *src_areas,
        }
 }
 
-void snd_pcm_adpcm_encode(const snd_pcm_channel_area_t *src_areas,
-                         snd_pcm_uframes_t src_offset,
-                         const snd_pcm_channel_area_t *dst_areas,
+void snd_pcm_adpcm_encode(const snd_pcm_channel_area_t *dst_areas,
                          snd_pcm_uframes_t dst_offset,
+                         const snd_pcm_channel_area_t *src_areas,
+                         snd_pcm_uframes_t src_offset,
                          unsigned int channels, snd_pcm_uframes_t frames, int getidx,
                          snd_pcm_adpcm_state_t *states)
 {
@@ -473,8 +473,8 @@ static snd_pcm_sframes_t snd_pcm_adpcm_write_areas(snd_pcm_t *pcm,
        assert(size > 0);
        while (xfer < size) {
                snd_pcm_uframes_t frames = snd_pcm_mmap_playback_xfer(slave, size - xfer);
-               adpcm->func(areas, offset, 
-                           snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
+               adpcm->func(snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
+                           areas, offset, 
                            pcm->channels, frames,
                            adpcm->getput_idx, adpcm->states);
                err = snd_pcm_mmap_forward(slave, frames);
@@ -508,8 +508,8 @@ static snd_pcm_sframes_t snd_pcm_adpcm_read_areas(snd_pcm_t *pcm,
        assert(size > 0);
        while (xfer < size) {
                snd_pcm_uframes_t frames = snd_pcm_mmap_capture_xfer(slave, size - xfer);
-               adpcm->func(snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
-                           areas, offset, 
+               adpcm->func(areas, offset, 
+                           snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
                            pcm->channels, frames,
                            adpcm->getput_idx, adpcm->states);
                err = snd_pcm_mmap_forward(slave, frames);
@@ -543,7 +543,6 @@ static void snd_pcm_adpcm_dump(snd_pcm_t *pcm, snd_output_t *out)
 
 snd_pcm_ops_t snd_pcm_adpcm_ops = {
        close: snd_pcm_plugin_close,
-       card: snd_pcm_plugin_card,
        info: snd_pcm_plugin_info,
        hw_refine: snd_pcm_adpcm_hw_refine,
        hw_params: snd_pcm_adpcm_hw_params,
index 8d8d569b2ccc5d20e7fa74c508a396bd6a4ef4a3..90e6e60bff6581bd61dbb07eee866c6b2f9a549c 100644 (file)
 #include "pcm_local.h"
 #include "pcm_plugin.h"
 
-typedef void (*alaw_f)(const snd_pcm_channel_area_t *src_areas,
-                       snd_pcm_uframes_t src_offset,
-                       const snd_pcm_channel_area_t *dst_areas,
-                       snd_pcm_uframes_t dst_offset,
-                       unsigned int channels, snd_pcm_uframes_t frames, int getputidx);
+typedef void (*alaw_f)(const snd_pcm_channel_area_t *dst_areas,
+                      snd_pcm_uframes_t dst_offset,
+                      const snd_pcm_channel_area_t *src_areas,
+                      snd_pcm_uframes_t src_offset,
+                      unsigned int channels, snd_pcm_uframes_t frames, int getputidx);
 
 typedef struct {
        /* This field need to be the first */
@@ -120,10 +120,10 @@ static int alaw_to_s16(unsigned char a_val)
        return ((a_val & 0x80) ? t : -t);
 }
 
-void snd_pcm_alaw_decode(const snd_pcm_channel_area_t *src_areas,
-                        snd_pcm_uframes_t src_offset,
-                        const snd_pcm_channel_area_t *dst_areas,
+void snd_pcm_alaw_decode(const snd_pcm_channel_area_t *dst_areas,
                         snd_pcm_uframes_t dst_offset,
+                        const snd_pcm_channel_area_t *src_areas,
+                        snd_pcm_uframes_t src_offset,
                         unsigned int channels, snd_pcm_uframes_t frames, int putidx)
 {
 #define PUT16_LABELS
@@ -165,10 +165,10 @@ void snd_pcm_alaw_decode(const snd_pcm_channel_area_t *src_areas,
        }
 }
 
-void snd_pcm_alaw_encode(const snd_pcm_channel_area_t *src_areas,
-                        snd_pcm_uframes_t src_offset,
-                        const snd_pcm_channel_area_t *dst_areas,
+void snd_pcm_alaw_encode(const snd_pcm_channel_area_t *dst_areas,
                         snd_pcm_uframes_t dst_offset,
+                        const snd_pcm_channel_area_t *src_areas,
+                        snd_pcm_uframes_t src_offset,
                         unsigned int channels, snd_pcm_uframes_t frames, int getidx)
 {
 #define GET16_LABELS
@@ -348,10 +348,10 @@ static snd_pcm_sframes_t snd_pcm_alaw_write_areas(snd_pcm_t *pcm,
        assert(size > 0);
        while (xfer < size) {
                snd_pcm_uframes_t frames = snd_pcm_mmap_playback_xfer(slave, size - xfer);
-               alaw->func(areas, offset, 
-                           snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
-                           pcm->channels, frames,
-                           alaw->getput_idx);
+               alaw->func(snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
+                          areas, offset, 
+                          pcm->channels, frames,
+                          alaw->getput_idx);
                err = snd_pcm_mmap_forward(slave, frames);
                if (err < 0)
                        break;
@@ -383,8 +383,8 @@ static snd_pcm_sframes_t snd_pcm_alaw_read_areas(snd_pcm_t *pcm,
        assert(size > 0);
        while (xfer < size) {
                snd_pcm_uframes_t frames = snd_pcm_mmap_capture_xfer(slave, size - xfer);
-               alaw->func(snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
-                          areas, offset, 
+               alaw->func(areas, offset, 
+                          snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
                           pcm->channels, frames,
                           alaw->getput_idx);
                err = snd_pcm_mmap_forward(slave, frames);
@@ -418,7 +418,6 @@ static void snd_pcm_alaw_dump(snd_pcm_t *pcm, snd_output_t *out)
 
 snd_pcm_ops_t snd_pcm_alaw_ops = {
        close: snd_pcm_plugin_close,
-       card: snd_pcm_plugin_card,
        info: snd_pcm_plugin_info,
        hw_refine: snd_pcm_alaw_hw_refine,
        hw_params: snd_pcm_alaw_hw_params,
index 0d4f7e7c2462dcf2b6a8927b0b624aff2da2143c..49772f864231b491452d0cb183f43cf1caea59af 100644 (file)
@@ -93,10 +93,10 @@ static int snd_pcm_copy_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
 }
 
 static snd_pcm_sframes_t snd_pcm_copy_write_areas(snd_pcm_t *pcm,
-                                       const snd_pcm_channel_area_t *areas,
-                                       snd_pcm_uframes_t offset,
-                                       snd_pcm_uframes_t size,
-                                       snd_pcm_uframes_t *slave_sizep)
+                                                 const snd_pcm_channel_area_t *areas,
+                                                 snd_pcm_uframes_t offset,
+                                                 snd_pcm_uframes_t size,
+                                                 snd_pcm_uframes_t *slave_sizep)
 {
        snd_pcm_copy_t *copy = pcm->private;
        snd_pcm_t *slave = copy->plug.slave;
@@ -108,8 +108,8 @@ static snd_pcm_sframes_t snd_pcm_copy_write_areas(snd_pcm_t *pcm,
        while (xfer < size) {
                snd_pcm_uframes_t frames = snd_pcm_mmap_playback_xfer(slave, size - xfer);
                
-               snd_pcm_areas_copy(areas, offset, 
-                                  snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
+               snd_pcm_areas_copy(snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
+                                  areas, offset, 
                                   pcm->channels, frames, pcm->format);
                err = snd_pcm_mmap_forward(slave, frames);
                if (err < 0)
@@ -128,10 +128,10 @@ static snd_pcm_sframes_t snd_pcm_copy_write_areas(snd_pcm_t *pcm,
 }
 
 static snd_pcm_sframes_t snd_pcm_copy_read_areas(snd_pcm_t *pcm,
-                                      const snd_pcm_channel_area_t *areas,
-                                      snd_pcm_uframes_t offset,
-                                      snd_pcm_uframes_t size,
-                                      snd_pcm_uframes_t *slave_sizep)
+                                                const snd_pcm_channel_area_t *areas,
+                                                snd_pcm_uframes_t offset,
+                                                snd_pcm_uframes_t size,
+                                                snd_pcm_uframes_t *slave_sizep)
 {
        snd_pcm_copy_t *copy = pcm->private;
        snd_pcm_t *slave = copy->plug.slave;
@@ -142,8 +142,8 @@ static snd_pcm_sframes_t snd_pcm_copy_read_areas(snd_pcm_t *pcm,
        assert(size > 0);
        while (xfer < size) {
                snd_pcm_uframes_t frames = snd_pcm_mmap_capture_xfer(slave, size - xfer);
-               snd_pcm_areas_copy(snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
-                                  areas, offset, 
+               snd_pcm_areas_copy(areas, offset, 
+                                  snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
                                   pcm->channels, frames, pcm->format);
                err = snd_pcm_mmap_forward(slave, frames);
                if (err < 0)
@@ -175,7 +175,6 @@ static void snd_pcm_copy_dump(snd_pcm_t *pcm, snd_output_t *out)
 
 snd_pcm_ops_t snd_pcm_copy_ops = {
        close: snd_pcm_plugin_close,
-       card: snd_pcm_plugin_card,
        info: snd_pcm_plugin_info,
        hw_refine: snd_pcm_copy_hw_refine,
        hw_params: snd_pcm_copy_hw_params,
index 9a6e30eedb95a79b6290b01559dacc557ecaecb4..844abca8cee8b8a623bf39d031bae92893d71f11 100644 (file)
@@ -81,8 +81,8 @@ static void snd_pcm_file_add_frames(snd_pcm_t *pcm,
                        n = cont;
                if (n > avail)
                        n = avail;
-               snd_pcm_areas_copy(areas, offset,
-                                  file->wbuf_areas, file->appl_ptr, 
+               snd_pcm_areas_copy(file->wbuf_areas, file->appl_ptr, 
+                                  areas, offset,
                                   pcm->channels, n, pcm->format);
                frames -= n;
                file->appl_ptr += n;
@@ -109,12 +109,6 @@ static int snd_pcm_file_close(snd_pcm_t *pcm)
        return 0;
 }
 
-static int snd_pcm_file_card(snd_pcm_t *pcm)
-{
-       snd_pcm_file_t *file = pcm->private;
-       return snd_pcm_card(file->slave);
-}
-
 static int snd_pcm_file_nonblock(snd_pcm_t *pcm, int nonblock)
 {
        snd_pcm_file_t *file = pcm->private;
@@ -377,7 +371,6 @@ static void snd_pcm_file_dump(snd_pcm_t *pcm, snd_output_t *out)
 
 snd_pcm_ops_t snd_pcm_file_ops = {
        close: snd_pcm_file_close,
-       card: snd_pcm_file_card,
        info: snd_pcm_file_info,
        hw_refine: snd_pcm_file_hw_refine,
        hw_params: snd_pcm_file_hw_params,
index aaae5d3e5eb736221ea686d902e9854f6ac17c81..58b01af06a9fae23a9da7f85f3c14b393834d4ed 100644 (file)
@@ -109,12 +109,6 @@ static int snd_pcm_hw_async(snd_pcm_t *pcm, int sig, pid_t pid)
        return 0;
 }
 
-static int snd_pcm_hw_card(snd_pcm_t *pcm)
-{
-       snd_pcm_hw_t *hw = pcm->private;
-       return hw->card;
-}
-
 static int snd_pcm_hw_info(snd_pcm_t *pcm, snd_pcm_info_t * info)
 {
        snd_pcm_hw_t *hw = pcm->private;
@@ -184,21 +178,21 @@ static int snd_pcm_hw_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t * params)
 static int snd_pcm_hw_channel_info(snd_pcm_t *pcm, snd_pcm_channel_info_t * info)
 {
        snd_pcm_hw_t *hw = pcm->private;
-       snd_pcm_hw_channel_info_t hw_info;
+       struct sndrv_pcm_channel_info i;
        int fd = hw->fd;
-       hw_info.channel = info->channel;
-       if (ioctl(fd, SNDRV_PCM_IOCTL_CHANNEL_INFO, &hw_info) < 0) {
+       i.channel = info->channel;
+       if (ioctl(fd, SNDRV_PCM_IOCTL_CHANNEL_INFO, &i) < 0) {
                SYSERR("SNDRV_PCM_IOCTL_CHANNEL_INFO failed");
                return -errno;
        }
-       info->channel = hw_info.channel;
+       info->channel = i.channel;
        if (pcm->info & SND_PCM_INFO_MMAP) {
                info->addr = 0;
-               info->first = hw_info.first;
-               info->step = hw_info.step;
+               info->first = i.first;
+               info->step = i.step;
                info->type = SND_PCM_AREA_MMAP;
                info->u.mmap.fd = fd;
-               info->u.mmap.offset = hw_info.offset;
+               info->u.mmap.offset = i.offset;
                return 0;
        }
        return snd_pcm_channel_info_shm(pcm, info, hw->shmid);
@@ -515,7 +509,6 @@ static void snd_pcm_hw_dump(snd_pcm_t *pcm, snd_output_t *out)
 
 snd_pcm_ops_t snd_pcm_hw_ops = {
        close: snd_pcm_hw_close,
-       card: snd_pcm_hw_card,
        info: snd_pcm_hw_info,
        hw_refine: snd_pcm_hw_hw_refine,
        hw_params: snd_pcm_hw_hw_params,
index 94382f0f49defa2e9a37541a8799159bde87f150..5e4ab33915e875f94c15397e3876c281c78167b0 100644 (file)
@@ -87,8 +87,8 @@ int snd_pcm_linear_put_index(int src_format, int dst_format)
        return width * 4 + endian * 2 + sign;
 }
 
-void snd_pcm_linear_convert(const snd_pcm_channel_area_t *src_areas, snd_pcm_uframes_t src_offset,
-                           const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset,
+void snd_pcm_linear_convert(const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset,
+                           const snd_pcm_channel_area_t *src_areas, snd_pcm_uframes_t src_offset,
                            unsigned int channels, snd_pcm_uframes_t frames, int convidx)
 {
 #define CONV_LABELS
@@ -247,8 +247,8 @@ static snd_pcm_sframes_t snd_pcm_linear_write_areas(snd_pcm_t *pcm,
        assert(size > 0);
        while (xfer < size) {
                snd_pcm_uframes_t frames = snd_pcm_mmap_playback_xfer(slave, size - xfer);
-               snd_pcm_linear_convert(areas, offset, 
-                                      snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
+               snd_pcm_linear_convert(snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
+                                      areas, offset, 
                                       pcm->channels, frames, linear->conv_idx);
                err = snd_pcm_mmap_forward(slave, frames);
                if (err < 0)
@@ -281,8 +281,8 @@ static snd_pcm_sframes_t snd_pcm_linear_read_areas(snd_pcm_t *pcm,
        assert(size > 0);
        while (xfer < size) {
                snd_pcm_uframes_t frames = snd_pcm_mmap_capture_xfer(slave, size - xfer);
-               snd_pcm_linear_convert(snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
-                                      areas, offset, 
+               snd_pcm_linear_convert(areas, offset, 
+                                      snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
                                       pcm->channels, frames, linear->conv_idx);
                err = snd_pcm_mmap_forward(slave, frames);
                if (err < 0)
@@ -315,7 +315,6 @@ static void snd_pcm_linear_dump(snd_pcm_t *pcm, snd_output_t *out)
 
 snd_pcm_ops_t snd_pcm_linear_ops = {
        close: snd_pcm_plugin_close,
-       card: snd_pcm_plugin_card,
        info: snd_pcm_plugin_info,
        hw_refine: snd_pcm_linear_hw_refine,
        hw_params: snd_pcm_linear_hw_params,
index b0b624111ed5c231ca9e01dd32624033b79f1040..967b14fbbe2a39a8b273a0806a83d3e3455e2f7f 100644 (file)
  *
  */
 
+#define _snd_interval sndrv_interval
+#define _snd_pcm_info sndrv_pcm_info
+#define _snd_pcm_hw_params sndrv_pcm_hw_params
+#define _snd_pcm_sw_params sndrv_pcm_sw_params
+#define _snd_pcm_status sndrv_pcm_status
+
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <limits.h>
 #include <sys/uio.h>
 #include <errno.h>
-#include "asoundlib.h"
+
 #include "local.h"
 
+#define SND_INTERVAL_INLINE
+#include "interval.h"
+
+#define SND_MASK_INLINE
+#include "mask.h"
+
+
 typedef struct _snd_pcm_channel_info {
        unsigned int channel;
        void *addr;                     /* base address of channel samples */
@@ -49,7 +62,6 @@ typedef struct _snd_pcm_channel_info {
 
 typedef struct {
        int (*close)(snd_pcm_t *pcm);
-       int (*card)(snd_pcm_t *pcm);
        int (*nonblock)(snd_pcm_t *pcm, int nonblock);
        int (*async)(snd_pcm_t *pcm, int sig, pid_t pid);
        int (*info)(snd_pcm_t *pcm, snd_pcm_info_t *info);
@@ -365,6 +377,10 @@ int snd_pcm_hw_param_always_eq(const snd_pcm_hw_params_t *params,
 int snd_pcm_hw_param_never_eq(const snd_pcm_hw_params_t *params,
                              snd_pcm_hw_param_t var,
                              const snd_pcm_hw_params_t *params1);
+const snd_mask_t *snd_pcm_hw_param_value_mask(const snd_pcm_hw_params_t *params,
+                                             snd_pcm_hw_param_t var);
+const snd_interval_t *snd_pcm_hw_param_value_interval(const snd_pcm_hw_params_t *params,
+                                                     snd_pcm_hw_param_t var);
 
 #define SND_PCM_HW_PARBIT_ACCESS       (1 << SND_PCM_HW_PARAM_ACCESS)
 #define SND_PCM_HW_PARBIT_FORMAT       (1 << SND_PCM_HW_PARAM_FORMAT)
index 6c2aa568fb4e352271ebd278b3bfe4f5a0e2c408..af9f551eaaa3fbaeff2e3c42b7a589acbe73d37e 100644 (file)
@@ -146,8 +146,8 @@ snd_pcm_sframes_t snd_pcm_mmap_write_areas(snd_pcm_t *pcm,
        while (xfer < size) {
                snd_pcm_uframes_t frames = snd_pcm_mmap_playback_xfer(pcm, size - xfer);
                snd_pcm_sframes_t err;
-               snd_pcm_areas_copy(areas, offset, 
-                                  snd_pcm_mmap_areas(pcm), snd_pcm_mmap_offset(pcm),
+               snd_pcm_areas_copy(snd_pcm_mmap_areas(pcm), snd_pcm_mmap_offset(pcm),
+                                  areas, offset, 
                                   pcm->channels, 
                                   frames, pcm->format);
                err = snd_pcm_mmap_forward(pcm, frames);
@@ -173,8 +173,8 @@ snd_pcm_sframes_t snd_pcm_mmap_read_areas(snd_pcm_t *pcm,
        while (xfer < size) {
                snd_pcm_uframes_t frames = snd_pcm_mmap_capture_xfer(pcm, size - xfer);
                snd_pcm_sframes_t err;
-               snd_pcm_areas_copy(snd_pcm_mmap_areas(pcm), snd_pcm_mmap_offset(pcm),
-                                  areas, offset, 
+               snd_pcm_areas_copy(areas, offset, 
+                                  snd_pcm_mmap_areas(pcm), snd_pcm_mmap_offset(pcm),
                                   pcm->channels, 
                                   frames, pcm->format);
                err = snd_pcm_mmap_forward(pcm, frames);
index 8ca337f62a56548b3d962ac0a6e280a981896efb..42cae376168e38e414e040ef69994487210f2354 100644 (file)
@@ -137,10 +137,10 @@ static int ulaw_to_s16(unsigned char u_val)
        return ((u_val & 0x80) ? (0x84 - t) : (t - 0x84));
 }
 
-void snd_pcm_mulaw_decode(const snd_pcm_channel_area_t *src_areas,
-                         snd_pcm_uframes_t src_offset,
-                         const snd_pcm_channel_area_t *dst_areas,
+void snd_pcm_mulaw_decode(const snd_pcm_channel_area_t *dst_areas,
                          snd_pcm_uframes_t dst_offset,
+                         const snd_pcm_channel_area_t *src_areas,
+                         snd_pcm_uframes_t src_offset,
                          unsigned int channels, snd_pcm_uframes_t frames, int putidx)
 {
 #define PUT16_LABELS
@@ -182,10 +182,10 @@ void snd_pcm_mulaw_decode(const snd_pcm_channel_area_t *src_areas,
        }
 }
 
-void snd_pcm_mulaw_encode(const snd_pcm_channel_area_t *src_areas,
-                         snd_pcm_uframes_t src_offset,
-                         const snd_pcm_channel_area_t *dst_areas,
+void snd_pcm_mulaw_encode(const snd_pcm_channel_area_t *dst_areas,
                          snd_pcm_uframes_t dst_offset,
+                         const snd_pcm_channel_area_t *src_areas,
+                         snd_pcm_uframes_t src_offset,
                          unsigned int channels, snd_pcm_uframes_t frames, int getidx)
 {
 #define GET16_LABELS
@@ -363,8 +363,8 @@ static snd_pcm_sframes_t snd_pcm_mulaw_write_areas(snd_pcm_t *pcm,
        assert(size > 0);
        while (xfer < size) {
                snd_pcm_uframes_t frames = snd_pcm_mmap_playback_xfer(slave, size - xfer);
-               mulaw->func(areas, offset, 
-                           snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
+               mulaw->func(snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
+                           areas, offset, 
                            pcm->channels, frames,
                            mulaw->getput_idx);
                err = snd_pcm_mmap_forward(slave, frames);
@@ -398,8 +398,8 @@ static snd_pcm_sframes_t snd_pcm_mulaw_read_areas(snd_pcm_t *pcm,
        assert(size > 0);
        while (xfer < size) {
                snd_pcm_uframes_t frames = snd_pcm_mmap_capture_xfer(slave, size - xfer);
-               mulaw->func(snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
-                           areas, offset, 
+               mulaw->func(areas, offset, 
+                           snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
                            pcm->channels, frames,
                            mulaw->getput_idx);
                err = snd_pcm_mmap_forward(slave, frames);
@@ -433,7 +433,6 @@ static void snd_pcm_mulaw_dump(snd_pcm_t *pcm, snd_output_t *out)
 
 snd_pcm_ops_t snd_pcm_mulaw_ops = {
        close: snd_pcm_plugin_close,
-       card: snd_pcm_plugin_card,
        info: snd_pcm_plugin_info,
        hw_refine: snd_pcm_mulaw_hw_refine,
        hw_params: snd_pcm_mulaw_hw_params,
index dcbda540c88e895963ebe7e1c0eb2dd50a6e0175..f82b35874b82e22968f0af4b25ffb7ebd59291b5 100644 (file)
@@ -26,7 +26,6 @@
 #include <errno.h>
 #include <math.h>
 #include "pcm_local.h"
-#include "interval.h"
 
 typedef struct {
        snd_pcm_t *pcm;
@@ -67,14 +66,6 @@ static int snd_pcm_multi_close(snd_pcm_t *pcm)
        return ret;
 }
 
-static int snd_pcm_multi_card(snd_pcm_t *pcm ATTRIBUTE_UNUSED)
-{
-       snd_pcm_multi_t *multi = pcm->private;
-       if (multi->slaves_count != 1)
-               return -ENOENT; /* not available */
-       return snd_pcm_card(multi->slaves[0].pcm);
-}
-
 static int snd_pcm_multi_nonblock(snd_pcm_t *pcm ATTRIBUTE_UNUSED, int nonblock ATTRIBUTE_UNUSED)
 {
        return 0;
@@ -90,12 +81,15 @@ static int snd_pcm_multi_async(snd_pcm_t *pcm, int sig, pid_t pid)
 static int snd_pcm_multi_info(snd_pcm_t *pcm, snd_pcm_info_t *info)
 {
        snd_pcm_multi_t *multi = pcm->private;
-       int err;
-       snd_pcm_t *slave_0 = multi->slaves[0].pcm;
-       /* FIXME */
-       err = snd_pcm_info(slave_0, info);
-       if (err < 0)
-               return err;
+       if (multi->slaves_count == 1)
+               return snd_pcm_info(multi->slaves[0].pcm, info);
+       memset(info, 0, sizeof(*info));
+       info->stream = pcm->stream;
+       info->card = -1;
+       strcpy(info->id, "multi");
+       strcpy(info->name, "multi");
+       strcpy(info->subname, "multi");
+       info->subdevices_count = 1;
        return 0;
 }
 
@@ -483,7 +477,6 @@ static void snd_pcm_multi_dump(snd_pcm_t *pcm, snd_output_t *out)
 
 snd_pcm_ops_t snd_pcm_multi_ops = {
        close: snd_pcm_multi_close,
-       card: snd_pcm_multi_card,
        info: snd_pcm_multi_info,
        hw_refine: snd_pcm_multi_hw_refine,
        hw_params: snd_pcm_multi_hw_params,
index eb16dea4eeed78f6a0d23c57782db59d0ed452bf..b40420e977a23649d1ba4656edf53486009581b7 100644 (file)
@@ -26,7 +26,7 @@
 #include "pcm_plugin.h"
 
 typedef struct {
-       snd_timestamp_t trigger_time;
+       snd_timestamp_t trigger_tstamp;
        int state;
        int shmid;
        snd_pcm_uframes_t appl_ptr;
@@ -42,11 +42,6 @@ static int snd_pcm_null_close(snd_pcm_t *pcm)
        return 0;
 }
 
-static int snd_pcm_null_card(snd_pcm_t *pcm ATTRIBUTE_UNUSED)
-{
-       return -ENOENT; /* not available */
-}
-
 static int snd_pcm_null_nonblock(snd_pcm_t *pcm ATTRIBUTE_UNUSED, int nonblock ATTRIBUTE_UNUSED)
 {
        return 0;
@@ -60,7 +55,12 @@ static int snd_pcm_null_async(snd_pcm_t *pcm ATTRIBUTE_UNUSED, int sig ATTRIBUTE
 static int snd_pcm_null_info(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_info_t * info)
 {
        memset(info, 0, sizeof(*info));
-       /* FIXME */
+       info->stream = pcm->stream;
+       info->card = -1;
+       strcpy(info->id, "null");
+       strcpy(info->name, "null");
+       strcpy(info->subname, "null");
+       info->subdevices_count = 1;
        return 0;
 }
 
@@ -75,7 +75,7 @@ static int snd_pcm_null_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
        snd_pcm_null_t *null = pcm->private;
        memset(status, 0, sizeof(*status));
        status->state = null->state;
-       status->trigger_time = null->trigger_time;
+       status->trigger_tstamp = null->trigger_tstamp;
        gettimeofday(&status->tstamp, 0);
        status->avail = pcm->buffer_size;
        status->avail_max = status->avail;
@@ -287,7 +287,6 @@ static void snd_pcm_null_dump(snd_pcm_t *pcm, snd_output_t *out)
 
 snd_pcm_ops_t snd_pcm_null_ops = {
        close: snd_pcm_null_close,
-       card: snd_pcm_null_card,
        info: snd_pcm_null_info,
        hw_refine: snd_pcm_null_hw_refine,
        hw_params: snd_pcm_null_hw_params,
index 181a7fc07b470113887eb413454012dc6f4c7aec..f5ac6215a64eac85fba836b9b37af9c6a16b9d1a 100644 (file)
  */
   
 #include "pcm_local.h"
-#define SND_INTERVAL_INLINE
-#define SND_MASK_INLINE
-#include "interval.h"
-#include "mask.h"
 
 static inline int hw_is_mask(int var)
 {
@@ -2334,3 +2330,53 @@ int snd_pcm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
        return 0;
 }
 
+size_t snd_pcm_hw_params_sizeof()
+{
+       return sizeof(snd_pcm_hw_params_t);
+}
+
+int snd_pcm_hw_params_malloc(snd_pcm_hw_params_t **paramsp)
+{
+       *paramsp = malloc(sizeof(snd_pcm_hw_params_t));
+       if (!*paramsp)
+               return -ENOMEM;
+       return 0;
+}
+
+int snd_pcm_hw_params_free(snd_pcm_hw_params_t *params)
+{
+       free(params);
+}
+
+
+void snd_pcm_hw_params_copy(snd_pcm_hw_params_t *dst,
+                           const snd_pcm_hw_params_t *src)
+{
+       *dst = *src;
+}
+
+size_t snd_pcm_sw_params_sizeof()
+{
+       return sizeof(snd_pcm_sw_params_t);
+}
+
+int snd_pcm_sw_params_malloc(snd_pcm_sw_params_t **paramsp)
+{
+       *paramsp = malloc(sizeof(snd_pcm_sw_params_t));
+       if (!*paramsp)
+               return -ENOMEM;
+       return 0;
+}
+
+int snd_pcm_sw_params_free(snd_pcm_sw_params_t *params)
+{
+       free(params);
+}
+
+
+void snd_pcm_sw_params_copy(snd_pcm_sw_params_t *dst,
+                           const snd_pcm_sw_params_t *src)
+{
+       *dst = *src;
+}
+
index b1caccec16da54a9b42fef999955463a2259fbc2..746e6a4de15fda9235e656629830a1c9bf8df201 100644 (file)
@@ -21,7 +21,6 @@
   
 #include "pcm_local.h"
 #include "pcm_plugin.h"
-#include "interval.h"
 
 typedef struct {
        snd_pcm_t *req_slave;
@@ -47,12 +46,6 @@ static int snd_pcm_plug_close(snd_pcm_t *pcm)
        return result;
 }
 
-static int snd_pcm_plug_card(snd_pcm_t *pcm)
-{
-       snd_pcm_plug_t *plug = pcm->private;
-       return snd_pcm_card(plug->slave);
-}
-
 static int snd_pcm_plug_nonblock(snd_pcm_t *pcm, int nonblock)
 {
        snd_pcm_plug_t *plug = pcm->private;
@@ -640,7 +633,6 @@ static void snd_pcm_plug_dump(snd_pcm_t *pcm, snd_output_t *out)
 
 snd_pcm_ops_t snd_pcm_plug_ops = {
        close: snd_pcm_plug_close,
-       card: snd_pcm_plug_card,
        info: snd_pcm_plug_info,
        hw_refine: snd_pcm_plug_hw_refine,
        hw_params: snd_pcm_plug_hw_params,
index f86df631f1f9246aac3660c660909445992408f2..d562cf17f8843cfb92fb27118a6a94145dd1505f 100644 (file)
@@ -34,12 +34,6 @@ int snd_pcm_plugin_close(snd_pcm_t *pcm)
        return 0;
 }
 
-int snd_pcm_plugin_card(snd_pcm_t *pcm)
-{
-       snd_pcm_plugin_t *plugin = pcm->private;
-       return snd_pcm_card(plugin->slave);
-}
-
 int snd_pcm_plugin_nonblock(snd_pcm_t *pcm, int nonblock)
 {
        snd_pcm_plugin_t *plugin = pcm->private;
index 66b5b014d931bdddfff7c2e3ed622f1011f1e72d..74c7d1029c6acf983d0c176c99615d9364ef6280 100644 (file)
@@ -118,28 +118,28 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, char *name, int sformat, int srate, snd_
                               (1 << SND_PCM_ACCESS_MMAP_NONINTERLEAVED) | \
                               (1 << SND_PCM_ACCESS_RW_NONINTERLEAVED))
 
-void snd_pcm_linear_convert(const snd_pcm_channel_area_t *src_areas, snd_pcm_uframes_t src_offset,
-                           const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset,
+void snd_pcm_linear_convert(const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset,
+                           const snd_pcm_channel_area_t *src_areas, snd_pcm_uframes_t src_offset,
                            unsigned int channels, snd_pcm_uframes_t frames, int convidx);
-void snd_pcm_alaw_decode(const snd_pcm_channel_area_t *src_areas,
-                        snd_pcm_uframes_t src_offset,
-                        const snd_pcm_channel_area_t *dst_areas,
+void snd_pcm_alaw_decode(const snd_pcm_channel_area_t *dst_areas,
                         snd_pcm_uframes_t dst_offset,
-                        unsigned int channels, snd_pcm_uframes_t frames, int putidx);
-void snd_pcm_alaw_encode(const snd_pcm_channel_area_t *src_areas,
+                        const snd_pcm_channel_area_t *src_areas,
                         snd_pcm_uframes_t src_offset,
-                        const snd_pcm_channel_area_t *dst_areas,
+                        unsigned int channels, snd_pcm_uframes_t frames, int putidx);
+void snd_pcm_alaw_encode(const snd_pcm_channel_area_t *dst_areas,
                         snd_pcm_uframes_t dst_offset,
+                        const snd_pcm_channel_area_t *src_areas,
+                        snd_pcm_uframes_t src_offset,
                         unsigned int channels, snd_pcm_uframes_t frames, int getidx);
-void snd_pcm_mulaw_decode(const snd_pcm_channel_area_t *src_areas,
-                         snd_pcm_uframes_t src_offset,
-                         const snd_pcm_channel_area_t *dst_areas,
+void snd_pcm_mulaw_decode(const snd_pcm_channel_area_t *dst_areas,
                          snd_pcm_uframes_t dst_offset,
-                         unsigned int channels, snd_pcm_uframes_t frames, int putidx);
-void snd_pcm_mulaw_encode(const snd_pcm_channel_area_t *src_areas,
+                         const snd_pcm_channel_area_t *src_areas,
                          snd_pcm_uframes_t src_offset,
-                         const snd_pcm_channel_area_t *dst_areas,
+                         unsigned int channels, snd_pcm_uframes_t frames, int putidx);
+void snd_pcm_mulaw_encode(const snd_pcm_channel_area_t *dst_areas,
                          snd_pcm_uframes_t dst_offset,
+                         const snd_pcm_channel_area_t *src_areas,
+                         snd_pcm_uframes_t src_offset,
                          unsigned int channels, snd_pcm_uframes_t frames, int getidx);
 
 typedef struct _snd_pcm_adpcm_state {
@@ -147,15 +147,15 @@ typedef struct _snd_pcm_adpcm_state {
        int step_idx;           /* Previous StepSize lookup index */
 } snd_pcm_adpcm_state_t;
 
-void snd_pcm_adpcm_decode(const snd_pcm_channel_area_t *src_areas,
-                         snd_pcm_uframes_t src_offset,
-                         const snd_pcm_channel_area_t *dst_areas,
+void snd_pcm_adpcm_decode(const snd_pcm_channel_area_t *dst_areas,
                          snd_pcm_uframes_t dst_offset,
+                         const snd_pcm_channel_area_t *src_areas,
+                         snd_pcm_uframes_t src_offset,
                          unsigned int channels, snd_pcm_uframes_t frames, int putidx,
                          snd_pcm_adpcm_state_t *states);
-void snd_pcm_adpcm_encode(const snd_pcm_channel_area_t *src_areas,
-                         snd_pcm_uframes_t src_offset,
-                         const snd_pcm_channel_area_t *dst_areas,
+void snd_pcm_adpcm_encode(const snd_pcm_channel_area_t *dst_areas,
                          snd_pcm_uframes_t dst_offset,
+                         const snd_pcm_channel_area_t *src_areas,
+                         snd_pcm_uframes_t src_offset,
                          unsigned int channels, snd_pcm_uframes_t frames, int getidx,
                          snd_pcm_adpcm_state_t *states);
index a13350d618016806f0b4a0a3aa24cf82ec48e8c8..0a298dcea523aa6762c1b15f576ad60ffdb8e89c 100644 (file)
@@ -23,7 +23,6 @@
 #include <byteswap.h>
 #include "pcm_local.h"
 #include "pcm_plugin.h"
-#include "interval.h"
 
 #define DIV (1<<16)
 
@@ -33,14 +32,16 @@ typedef struct {
        unsigned int pos;
 } snd_pcm_rate_state_t;
  
-typedef snd_pcm_uframes_t (*rate_f)(const snd_pcm_channel_area_t *src_areas,
-                        snd_pcm_uframes_t src_offset, snd_pcm_uframes_t src_frames,
-                        const snd_pcm_channel_area_t *dst_areas,
-                        snd_pcm_uframes_t dst_offset, snd_pcm_uframes_t *dst_framesp,
-                        unsigned int channels,
-                        int getidx, int putidx,
-                        unsigned int arg,
-                        snd_pcm_rate_state_t *states);
+typedef snd_pcm_uframes_t (*rate_f)(const snd_pcm_channel_area_t *dst_areas,
+                                   snd_pcm_uframes_t dst_offset,
+                                   snd_pcm_uframes_t *dst_framesp,
+                                   const snd_pcm_channel_area_t *src_areas,
+                                   snd_pcm_uframes_t src_offset,
+                                   snd_pcm_uframes_t src_frames,
+                                   unsigned int channels,
+                                   int getidx, int putidx,
+                                   unsigned int arg,
+                                   snd_pcm_rate_state_t *states);
 
 typedef struct {
        /* This field need to be the first */
@@ -54,10 +55,10 @@ typedef struct {
        snd_pcm_rate_state_t *states;
 } snd_pcm_rate_t;
 
-snd_pcm_uframes_t snd_pcm_rate_expand(const snd_pcm_channel_area_t *src_areas,
-                                     snd_pcm_uframes_t src_offset, snd_pcm_uframes_t src_frames,
-                                     const snd_pcm_channel_area_t *dst_areas,
+snd_pcm_uframes_t snd_pcm_rate_expand(const snd_pcm_channel_area_t *dst_areas,
                                      snd_pcm_uframes_t dst_offset, snd_pcm_uframes_t *dst_framesp,
+                                     const snd_pcm_channel_area_t *src_areas,
+                                     snd_pcm_uframes_t src_offset, snd_pcm_uframes_t src_frames,
                                      unsigned int channels,
                                      int getidx, int putidx,
                                      unsigned int get_threshold,
@@ -136,10 +137,10 @@ snd_pcm_uframes_t snd_pcm_rate_expand(const snd_pcm_channel_area_t *src_areas,
        return src_frames1;
 }
 
-snd_pcm_uframes_t snd_pcm_rate_shrink(const snd_pcm_channel_area_t *src_areas,
-                                     snd_pcm_uframes_t src_offset, snd_pcm_uframes_t src_frames,
-                                     const snd_pcm_channel_area_t *dst_areas,
+snd_pcm_uframes_t snd_pcm_rate_shrink(const snd_pcm_channel_area_t *dst_areas,
                                      snd_pcm_uframes_t dst_offset, snd_pcm_uframes_t *dst_framesp,
+                                     const snd_pcm_channel_area_t *src_areas,
+                                     snd_pcm_uframes_t src_offset, snd_pcm_uframes_t src_frames,
                                      unsigned int channels,
                                      int getidx, int putidx,
                                      unsigned int get_increment,
@@ -444,9 +445,9 @@ static snd_pcm_sframes_t snd_pcm_rate_write_areas(snd_pcm_t *pcm,
                snd_pcm_uframes_t src_frames, dst_frames;
                src_frames = client_size - client_xfer;
                dst_frames = snd_pcm_mmap_playback_xfer(slave, slave_size - slave_xfer);
-               src_frames = rate->func(areas, client_offset, src_frames,
-                                       snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
+               src_frames = rate->func(snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
                                        &dst_frames, 
+                                       areas, client_offset, src_frames,
                                        pcm->channels,
                                        rate->get_idx, rate->put_idx,
                                        rate->pitch, rate->states);
@@ -496,9 +497,9 @@ static snd_pcm_sframes_t snd_pcm_rate_read_areas(snd_pcm_t *pcm,
                snd_pcm_uframes_t src_frames, dst_frames;
                dst_frames = client_size - client_xfer;
                src_frames = snd_pcm_mmap_capture_xfer(slave, slave_size - slave_xfer);
-               src_frames = rate->func(snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
+               src_frames = rate->func(areas, client_offset, &dst_frames,
+                                       snd_pcm_mmap_areas(slave), snd_pcm_mmap_offset(slave),
                                        src_frames,
-                                       areas, client_offset, &dst_frames,
                                        pcm->channels,
                                        rate->get_idx, rate->put_idx,
                                        rate->pitch, rate->states);
@@ -564,7 +565,6 @@ static void snd_pcm_rate_dump(snd_pcm_t *pcm, snd_output_t *out)
 
 snd_pcm_ops_t snd_pcm_rate_ops = {
        close: snd_pcm_plugin_close,
-       card: snd_pcm_plugin_card,
        info: snd_pcm_plugin_info,
        hw_refine: snd_pcm_rate_hw_refine,
        hw_params: snd_pcm_rate_hw_params,
index 1a8b22e4d2cfdb1c52196fe5004ae15ae852a368..9d1b20d31e0c72ae59bdb5434cfb9644888e8279 100644 (file)
@@ -55,10 +55,10 @@ typedef struct {
 } snd_pcm_route_params_t;
 
 
-typedef void (*route_f)(const snd_pcm_channel_area_t *src_areas,
-                       snd_pcm_uframes_t src_offset,
-                       const snd_pcm_channel_area_t *dst_area,
+typedef void (*route_f)(const snd_pcm_channel_area_t *dst_area,
                        snd_pcm_uframes_t dst_offset,
+                       const snd_pcm_channel_area_t *src_areas,
+                       snd_pcm_uframes_t src_offset,
                        snd_pcm_uframes_t frames,
                        const snd_pcm_route_ttable_dst_t *ttable,
                        const snd_pcm_route_params_t *params);
@@ -87,10 +87,10 @@ typedef struct {
 } snd_pcm_route_t;
 
 
-void snd_pcm_route_convert1_zero(const snd_pcm_channel_area_t *src_areas ATTRIBUTE_UNUSED,
-                                snd_pcm_uframes_t src_offset ATTRIBUTE_UNUSED,
-                                const snd_pcm_channel_area_t *dst_area,
+void snd_pcm_route_convert1_zero(const snd_pcm_channel_area_t *dst_area,
                                 snd_pcm_uframes_t dst_offset,
+                                const snd_pcm_channel_area_t *src_areas ATTRIBUTE_UNUSED,
+                                snd_pcm_uframes_t src_offset ATTRIBUTE_UNUSED,
                                 snd_pcm_uframes_t frames,
                                 const snd_pcm_route_ttable_dst_t* ttable ATTRIBUTE_UNUSED,
                                 const snd_pcm_route_params_t *params)
@@ -104,10 +104,10 @@ void snd_pcm_route_convert1_zero(const snd_pcm_channel_area_t *src_areas ATTRIBU
 #endif
 }
 
-void snd_pcm_route_convert1_one(const snd_pcm_channel_area_t *src_areas,
-                               snd_pcm_uframes_t src_offset,
-                               const snd_pcm_channel_area_t *dst_area,
+void snd_pcm_route_convert1_one(const snd_pcm_channel_area_t *dst_area,
                                snd_pcm_uframes_t dst_offset,
+                               const snd_pcm_channel_area_t *src_areas,
+                               snd_pcm_uframes_t src_offset,
                                snd_pcm_uframes_t frames,
                                const snd_pcm_route_ttable_dst_t* ttable,
                                const snd_pcm_route_params_t *params)
@@ -126,7 +126,9 @@ void snd_pcm_route_convert1_one(const snd_pcm_channel_area_t *src_areas,
                        break;
        }
        if (srcidx == ttable->nsrcs) {
-               snd_pcm_route_convert1_zero(src_areas, src_offset, dst_area, dst_offset, frames, ttable, params);
+               snd_pcm_route_convert1_zero(dst_area, dst_offset,
+                                           src_areas, src_offset,
+                                           frames, ttable, params);
                return;
        }
        
@@ -149,10 +151,10 @@ void snd_pcm_route_convert1_one(const snd_pcm_channel_area_t *src_areas,
        }
 }
 
-void snd_pcm_route_convert1_many(const snd_pcm_channel_area_t *src_areas,
-                                snd_pcm_uframes_t src_offset,
-                                const snd_pcm_channel_area_t *dst_area,
+void snd_pcm_route_convert1_many(const snd_pcm_channel_area_t *dst_area,
                                 snd_pcm_uframes_t dst_offset,
+                                const snd_pcm_channel_area_t *src_areas,
+                                snd_pcm_uframes_t src_offset,
                                 snd_pcm_uframes_t frames,
                                 const snd_pcm_route_ttable_dst_t* ttable,
                                 const snd_pcm_route_params_t *params)
@@ -224,10 +226,14 @@ void snd_pcm_route_convert1_many(const snd_pcm_channel_area_t *src_areas,
        }
        nsrcs = srcidx1;
        if (nsrcs == 0) {
-               snd_pcm_route_convert1_zero(src_areas, src_offset, dst_area, dst_offset, frames, ttable, params);
+               snd_pcm_route_convert1_zero(dst_area, dst_offset,
+                                           src_areas, src_offset,
+                                           frames, ttable, params);
                return;
        } else if (nsrcs == 1 && src_tt[0].as_int == ROUTE_PLUGIN_RESOLUTION) {
-               snd_pcm_route_convert1_one(src_areas, src_offset, dst_area, dst_offset, frames, ttable, params);
+               snd_pcm_route_convert1_one(dst_area, dst_offset,
+                                          src_areas, src_offset,
+                                          frames, ttable, params);
                return;
        }
 
@@ -382,10 +388,10 @@ void snd_pcm_route_convert1_many(const snd_pcm_channel_area_t *src_areas,
        }
 }
 
-void snd_pcm_route_convert(const snd_pcm_channel_area_t *src_areas,
-                          snd_pcm_uframes_t src_offset,
-                          const snd_pcm_channel_area_t *dst_areas,
+void snd_pcm_route_convert(const snd_pcm_channel_area_t *dst_areas,
                           snd_pcm_uframes_t dst_offset,
+                          const snd_pcm_channel_area_t *src_areas,
+                          snd_pcm_uframes_t src_offset,
                           snd_pcm_uframes_t dst_channels,
                           snd_pcm_uframes_t frames,
                           snd_pcm_route_params_t *params)
@@ -398,9 +404,13 @@ void snd_pcm_route_convert(const snd_pcm_channel_area_t *src_areas,
        dst_area = dst_areas;
        for (dst_channel = 0; dst_channel < dst_channels; ++dst_channel) {
                if (dst_channel >= params->ndsts)
-                       snd_pcm_route_convert1_zero(src_areas, src_offset, dst_area, dst_offset, frames, dstp, params);
+                       snd_pcm_route_convert1_zero(dst_area, dst_offset,
+                                                   src_areas, src_offset,
+                                                   frames, dstp, params);
                else
-                       dstp->func(src_areas, src_offset, dst_area, dst_offset, frames, dstp, params);
+                       dstp->func(dst_area, dst_offset,
+                                  src_areas, src_offset,
+                                  frames, dstp, params);
                dstp++;
                dst_area++;
        }
@@ -674,7 +684,6 @@ static void snd_pcm_route_dump(snd_pcm_t *pcm, snd_output_t *out)
 
 snd_pcm_ops_t snd_pcm_route_ops = {
        close: snd_pcm_route_close,
-       card: snd_pcm_plugin_card,
        info: snd_pcm_plugin_info,
        hw_refine: snd_pcm_route_hw_refine,
        hw_params: snd_pcm_route_hw_params,
index fbd871427a6716b6ef6d367f070de40cdc9724f0..9d189d4e69e5b85174a60d35053a946ed4339970 100644 (file)
@@ -99,7 +99,7 @@ typedef struct {
        int async_sig;
        pid_t async_pid;
        int drain_silenced;
-       struct timeval trigger_time;
+       struct timeval trigger_tstamp;
        int state;
        snd_pcm_uframes_t hw_ptr;
        snd_pcm_uframes_t appl_ptr;
@@ -425,12 +425,6 @@ static void _snd_pcm_share_update(snd_pcm_t *pcm)
        }
 }
 
-static int snd_pcm_share_card(snd_pcm_t *pcm ATTRIBUTE_UNUSED)
-{
-       snd_pcm_share_t *share = pcm->private;
-       return snd_pcm_card(share->slave->pcm);
-}
-
 static int snd_pcm_share_nonblock(snd_pcm_t *pcm ATTRIBUTE_UNUSED, int nonblock ATTRIBUTE_UNUSED)
 {
        return 0;
@@ -693,7 +687,7 @@ static int snd_pcm_share_status(snd_pcm_t *pcm, snd_pcm_status_t *status)
  _notrunning:
        status->delay = sd + d;
        status->state = share->state;
-       status->trigger_time = share->trigger_time;
+       status->trigger_tstamp = share->trigger_tstamp;
  _end:
        Pthread_mutex_unlock(&slave->mutex);
        return err;
@@ -875,8 +869,8 @@ static int snd_pcm_share_start(snd_pcm_t *pcm)
                        snd_pcm_uframes_t cont = pcm->buffer_size - offset;
                        if (cont < frames)
                                frames = cont;
-                       snd_pcm_areas_copy(pcm->stopped_areas, xfer,
-                                          pcm->running_areas, offset,
+                       snd_pcm_areas_copy(pcm->running_areas, offset,
+                                          pcm->stopped_areas, xfer,
                                           pcm->channels, frames,
                                           pcm->format);
                        xfer += frames;
@@ -892,7 +886,7 @@ static int snd_pcm_share_start(snd_pcm_t *pcm)
        }
        slave->running_count++;
        _snd_pcm_share_update(pcm);
-       gettimeofday(&share->trigger_time, 0);
+       gettimeofday(&share->trigger_tstamp, 0);
  _end:
        Pthread_mutex_unlock(&slave->mutex);
        return err;
@@ -976,10 +970,10 @@ static void _snd_pcm_share_stop(snd_pcm_t *pcm, int state)
                /* PCM closing already begun in the main thread */
                return;
        }
-       gettimeofday(&share->trigger_time, 0);
+       gettimeofday(&share->trigger_tstamp, 0);
        if (pcm->stream == SND_PCM_STREAM_CAPTURE) {
-               snd_pcm_areas_copy(pcm->running_areas, 0,
-                                  pcm->stopped_areas, 0,
+               snd_pcm_areas_copy(pcm->stopped_areas, 0,
+                                  pcm->running_areas, 0,
                                   pcm->channels, pcm->buffer_size,
                                   pcm->format);
        } else if (slave->running_count > 1) {
@@ -1145,7 +1139,6 @@ static void snd_pcm_share_dump(snd_pcm_t *pcm, snd_output_t *out)
 
 snd_pcm_ops_t snd_pcm_share_ops = {
        close: snd_pcm_share_close,
-       card: snd_pcm_share_card,
        info: snd_pcm_share_info,
        hw_refine: snd_pcm_share_hw_refine,
        hw_params: snd_pcm_share_hw_params,
index ca00418a4b4b21cbbe8a9092f559770d464bed5c..185b47e63426e28240add626daf1ba99de762efb 100644 (file)
@@ -116,14 +116,6 @@ static int snd_pcm_shm_action_fd(snd_pcm_t *pcm, int *fd)
        return ctrl->result;
 }
 
-static int snd_pcm_shm_card(snd_pcm_t *pcm)
-{
-       snd_pcm_shm_t *shm = pcm->private;
-       volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
-       ctrl->cmd = SND_PCM_IOCTL_CARD;
-       return snd_pcm_shm_action(pcm);
-}
-
 static int snd_pcm_shm_nonblock(snd_pcm_t *pcm ATTRIBUTE_UNUSED, int nonblock ATTRIBUTE_UNUSED)
 {
        return 0;
@@ -491,7 +483,6 @@ static void snd_pcm_shm_dump(snd_pcm_t *pcm, snd_output_t *out)
 
 snd_pcm_ops_t snd_pcm_shm_ops = {
        close: snd_pcm_shm_close,
-       card: snd_pcm_shm_card,
        info: snd_pcm_shm_info,
        hw_refine: snd_pcm_shm_hw_refine,
        hw_params: snd_pcm_shm_hw_params,
index 50d89bdadf7f422a111a82c9f39c709c0c838685..1b2c54cc00ced18049699cc3c3b6bc0005582a6f 100644 (file)
@@ -27,7 +27,6 @@
 #include <errno.h>
 #include <dlfcn.h>
 #include "rawmidi_local.h"
-#include "asoundlib.h"
 
 int snd_rawmidi_close(snd_rawmidi_t *rmidi)
 {
index e9d7fcee63f78ad5f6d01fd207db7d4529d9aafc..d38fd3387d820635d23698e36db18a6c9e75487e 100644 (file)
@@ -29,7 +29,6 @@
 #include <sys/ioctl.h>
 #include "../control/control_local.h"
 #include "rawmidi_local.h"
-#include "asoundlib.h"
 
 #define SNDRV_FILE_RAWMIDI     "/dev/snd/midiC%iD%i"
 #define SNDRV_RAWMIDI_VERSION_MAX      SNDRV_PROTOCOL_VERSION(2, 0, 0)
index 7fa88d332298024c990c8adaefa23c3553b67a5b..3d4d8b8e8b315139bdad499cd80a1c0fed31cb65 100644 (file)
@@ -24,7 +24,6 @@
 #include <stdlib.h>
 #include <limits.h>
 #include <errno.h>
-#include "asoundlib.h"
 #include "local.h"
 
 typedef struct {
index 389faf5dec2f6ded4eac5f69c4dc4846c22606b0..dbae1619ed3ae840c48547edb5f311ba6ed81d17 100644 (file)
@@ -23,7 +23,6 @@
 #include <sys/poll.h>
 #include <dlfcn.h>
 #include "seq_local.h"
-#include "asoundlib.h"
 
 int snd_seq_open(snd_seq_t **seqp, char *name, 
                 int streams, int mode)
index 436a2d4148c15613156df925cc8655552666ec3b..b8b78d3d763ca1a3501e9a0936f0f1b84e3888b1 100644 (file)
@@ -23,7 +23,6 @@
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include "seq_local.h"
-#include "asoundlib.h"
 
 #define SNDRV_FILE_SEQ         "/dev/snd/seq"
 #define SNDRV_FILE_ALOADSEQ    "/dev/aloadSEQ"
index 580be221466d24601af3672ced36e4d8b0bb546a..24f4870753e4936765d837fb824c70915c68e169 100644 (file)
@@ -28,7 +28,6 @@
 #include <stdlib.h>
 #include <limits.h>
 #include <errno.h>
-#include "asoundlib.h"
 #include "local.h"
 
 #define SND_SEQ_OBUF_SIZE      (16*1024)       /* default size */
index 1ef97ca2ce232f4e924f62c479cfea001ae1ecca..eb4513b195d7ee8f5ce4422b8feedfd4d18027f2 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <malloc.h>
 #include <errno.h>
-#include "asoundlib.h"
+#include "local.h"
 
 
 /* midi status */
index 9b9ff89bc6c81f2a73c660d68fcb29b63cb9a5a9..965b8c2e1ff77eb78838d729f26d7f5a120c986f 100644 (file)
@@ -27,7 +27,6 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
-#include "asoundlib.h"
 #include "seq_local.h"
 
 /* direct passing (without queued) */
index 91da9aaf3b1fe077b02064ef8b4d334a7749fb91..5861b2fe48eb23b1fc169b87e3052a0aee5efc1c 100644 (file)
@@ -26,7 +26,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
-#include "asoundlib.h"
+#include "local.h"
 
 #define SNDRV_FILE_TIMER               "/dev/snd/timer"
 #define SNDRV_TIMER_VERSION_MAX        SNDRV_PROTOCOL_VERSION(2, 0, 0)