mixer_oss.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef __SOUND_MIXER_OSS_H
  2. #define __SOUND_MIXER_OSS_H
  3. /*
  4. * OSS MIXER API
  5. * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
  6. *
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. *
  22. */
  23. #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
  24. typedef struct _snd_oss_mixer_slot snd_mixer_oss_slot_t;
  25. typedef struct _snd_oss_file snd_mixer_oss_file_t;
  26. typedef int (*snd_mixer_oss_get_volume_t)(snd_mixer_oss_file_t *fmixer, snd_mixer_oss_slot_t *chn, int *left, int *right);
  27. typedef int (*snd_mixer_oss_put_volume_t)(snd_mixer_oss_file_t *fmixer, snd_mixer_oss_slot_t *chn, int left, int right);
  28. typedef int (*snd_mixer_oss_get_recsrc_t)(snd_mixer_oss_file_t *fmixer, snd_mixer_oss_slot_t *chn, int *active);
  29. typedef int (*snd_mixer_oss_put_recsrc_t)(snd_mixer_oss_file_t *fmixer, snd_mixer_oss_slot_t *chn, int active);
  30. typedef int (*snd_mixer_oss_get_recsrce_t)(snd_mixer_oss_file_t *fmixer, unsigned int *active_index);
  31. typedef int (*snd_mixer_oss_put_recsrce_t)(snd_mixer_oss_file_t *fmixer, unsigned int active_index);
  32. #define SNDRV_OSS_MAX_MIXERS 32
  33. struct _snd_oss_mixer_slot {
  34. int number;
  35. unsigned int stereo: 1;
  36. snd_mixer_oss_get_volume_t get_volume;
  37. snd_mixer_oss_put_volume_t put_volume;
  38. snd_mixer_oss_get_recsrc_t get_recsrc;
  39. snd_mixer_oss_put_recsrc_t put_recsrc;
  40. unsigned long private_value;
  41. void *private_data;
  42. void (*private_free)(snd_mixer_oss_slot_t *slot);
  43. int volume[2];
  44. };
  45. struct _snd_oss_mixer {
  46. snd_card_t *card;
  47. char id[16];
  48. char name[32];
  49. snd_mixer_oss_slot_t slots[SNDRV_OSS_MAX_MIXERS]; /* OSS mixer slots */
  50. unsigned int mask_recsrc; /* exclusive recsrc mask */
  51. snd_mixer_oss_get_recsrce_t get_recsrc;
  52. snd_mixer_oss_put_recsrce_t put_recsrc;
  53. void *private_data_recsrc;
  54. void (*private_free_recsrc)(snd_mixer_oss_t *mixer);
  55. struct semaphore reg_mutex;
  56. snd_info_entry_t *proc_entry;
  57. int oss_dev_alloc;
  58. /* --- */
  59. int oss_recsrc;
  60. };
  61. struct _snd_oss_file {
  62. snd_card_t *card;
  63. snd_mixer_oss_t *mixer;
  64. };
  65. #endif /* CONFIG_SND_MIXER_OSS */
  66. #endif /* __SOUND_MIXER_OSS_H */