[3133] | 1 | //roar.h: |
---|
| 2 | |
---|
| 3 | /* |
---|
[5381] | 4 | * Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2010-2012 |
---|
[5196] | 5 | * Copyright (C) Hans-Kristian 'maister' Arntzen - 2010-2011 |
---|
[3133] | 6 | * |
---|
| 7 | * This file is part of libroar a part of RoarAudio, |
---|
| 8 | * a cross-platform sound system for both, home and professional use. |
---|
| 9 | * See README for details. |
---|
| 10 | * |
---|
| 11 | * This file is free software; you can redistribute it and/or modify |
---|
| 12 | * it under the terms of the GNU General Public License version 3 |
---|
| 13 | * as published by the Free Software Foundation. |
---|
| 14 | * |
---|
| 15 | * libroar is distributed in the hope that it will be useful, |
---|
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 18 | * GNU General Public License for more details. |
---|
| 19 | * |
---|
| 20 | * You should have received a copy of the GNU General Public License |
---|
| 21 | * along with this software; see the file COPYING. If not, write to |
---|
[3517] | 22 | * the Free Software Foundation, 51 Franklin Street, Fifth Floor, |
---|
| 23 | * Boston, MA 02110-1301, USA. |
---|
[3133] | 24 | * |
---|
| 25 | * NOTE for everyone want's to change something and send patches: |
---|
| 26 | * read README and HACKING! There a addition information on |
---|
| 27 | * the license of this document you need to read before you send |
---|
| 28 | * any patches. |
---|
| 29 | * |
---|
[4167] | 30 | * NOTE for uses of non-GPL (LGPL,...) software using libesd, libartsc |
---|
| 31 | * or libpulse*: |
---|
| 32 | * The libs libroaresd, libroararts and libroarpulse link this lib |
---|
| 33 | * and are therefore GPL. Because of this it may be illigal to use |
---|
| 34 | * them with any software that uses libesd, libartsc or libpulse*. |
---|
[3133] | 35 | */ |
---|
| 36 | |
---|
| 37 | #ifndef _ROARAUDIO_PLUGINS_ALSA_ROAR_H_ |
---|
| 38 | #define _ROARAUDIO_PLUGINS_ALSA_ROAR_H_ |
---|
| 39 | |
---|
| 40 | #include <roaraudio.h> |
---|
[3134] | 41 | #include <errno.h> |
---|
| 42 | #include <alsa/asoundlib.h> |
---|
[3135] | 43 | #include <alsa/global.h> |
---|
[3134] | 44 | #include <alsa/pcm_external.h> |
---|
| 45 | #include <alsa/control_external.h> |
---|
[4167] | 46 | #include <pthread.h> |
---|
| 47 | #include <time.h> |
---|
[3134] | 48 | |
---|
| 49 | #define _as(x) (sizeof((x))/sizeof(*(x))) |
---|
| 50 | |
---|
| 51 | struct roar_alsa { |
---|
| 52 | struct roar_connection con; |
---|
| 53 | }; |
---|
| 54 | |
---|
| 55 | struct roar_alsa_pcm { |
---|
| 56 | snd_pcm_ioplug_t io; |
---|
| 57 | struct roar_alsa roar; |
---|
| 58 | struct roar_audio_info info; |
---|
[5174] | 59 | roar_vs_t * vss; |
---|
[5168] | 60 | int stream_role; |
---|
[3134] | 61 | int stream_opened; |
---|
[5196] | 62 | size_t bufsize; |
---|
[4167] | 63 | size_t last_ptr; |
---|
[3134] | 64 | }; |
---|
[3133] | 65 | |
---|
[5263] | 66 | struct roar_mixerstream { |
---|
| 67 | int id; |
---|
| 68 | char name[32]; |
---|
| 69 | unsigned int channels; |
---|
| 70 | }; |
---|
| 71 | |
---|
| 72 | #define MAX_STREAMS 16 |
---|
| 73 | |
---|
| 74 | struct roar_alsa_ctl { |
---|
| 75 | snd_ctl_ext_t ext; |
---|
| 76 | struct roar_alsa roar; |
---|
| 77 | struct roar_mixerstream streams[MAX_STREAMS]; |
---|
| 78 | }; |
---|
| 79 | |
---|
[5157] | 80 | void roar_plugin_reset(struct roar_alsa_pcm * self); |
---|
| 81 | void* roar_plugin_thread (void * thread_data); |
---|
| 82 | size_t roar_plugin_write(struct roar_alsa_pcm * self, const char * buf, size_t size); |
---|
| 83 | void roar_plugin_drain(struct roar_alsa_pcm * self); |
---|
[4167] | 84 | |
---|
[3133] | 85 | #endif |
---|
| 86 | |
---|
| 87 | //ll |
---|