[2773] | 1 | //driver_wmm.h: |
---|
| 2 | |
---|
| 3 | /* |
---|
| 4 | * Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2009 |
---|
| 5 | * |
---|
| 6 | * This file is part of roard a part of RoarAudio, |
---|
| 7 | * a cross-platform sound system for both, home and professional use. |
---|
| 8 | * See README for details. |
---|
| 9 | * |
---|
| 10 | * This file is free software; you can redistribute it and/or modify |
---|
| 11 | * it under the terms of the GNU General Public License version 3 |
---|
| 12 | * as published by the Free Software Foundation. |
---|
| 13 | * |
---|
| 14 | * RoarAudio is distributed in the hope that it will be useful, |
---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 17 | * GNU General Public License for more details. |
---|
| 18 | * |
---|
| 19 | * You should have received a copy of the GNU General Public License |
---|
| 20 | * along with this software; see the file COPYING. If not, write to |
---|
[3517] | 21 | * the Free Software Foundation, 51 Franklin Street, Fifth Floor, |
---|
| 22 | * Boston, MA 02110-1301, USA. |
---|
[2773] | 23 | * |
---|
| 24 | */ |
---|
| 25 | |
---|
| 26 | #ifndef _DRIVER_WMM_H_ |
---|
| 27 | #define _DRIVER_WMM_H_ |
---|
| 28 | |
---|
| 29 | #include <roaraudio.h> |
---|
| 30 | |
---|
[2799] | 31 | #ifdef ROAR_HAVE_LIBWINMM |
---|
| 32 | |
---|
[2774] | 33 | struct driver_wmm { |
---|
| 34 | UINT id; /* device id */ |
---|
| 35 | HWAVEOUT hwo; /* waveout handler */ |
---|
| 36 | WAVEOUTCAPS caps; /* device caps */ |
---|
| 37 | WAVEFORMATEX wavefmt; /* sample format */ |
---|
| 38 | |
---|
| 39 | int opened; /* device has been opened */ |
---|
| 40 | int prepared; /* waveheaders have been prepared */ |
---|
| 41 | int blocks; /* number of blocks (wave headers) */ |
---|
| 42 | int splPerBlock; /* sample per blocks. */ |
---|
| 43 | int msPerBlock; /* millisecond per block (approx.) */ |
---|
| 44 | |
---|
[2778] | 45 | void * bigbuffer; /* Allocated buffer for waveheaders and sound data */ |
---|
| 46 | struct { |
---|
| 47 | WAVEHDR wh; /* waveheader */ |
---|
| 48 | char * data; /* sample data ptr */ |
---|
| 49 | int idx; /* index of this header */ |
---|
| 50 | int count; /* current byte count */ |
---|
| 51 | int length; /* size of data */ |
---|
| 52 | int sent; /* set when header is sent to device */ |
---|
| 53 | } * wh; /* Pointer to waveheaders in bigbuffer */ |
---|
| 54 | BYTE * spl; /* Pointer to sound data in bigbuffer */ |
---|
| 55 | |
---|
| 56 | int sent_blocks; /* Number of waveheader sent (not ack). */ |
---|
| 57 | int full_blocks; /* Number of waveheader full (ready to send). */ |
---|
| 58 | int widx; /* Index to the block being currently filled. */ |
---|
| 59 | int ridx; /* Index to the block being sent. */ |
---|
[2774] | 60 | }; |
---|
| 61 | |
---|
| 62 | int driver_wmm_open_vio(struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream); |
---|
| 63 | int driver_wmm_close_vio(struct roar_vio_calls * vio); |
---|
| 64 | ssize_t driver_wmm_write(struct roar_vio_calls * vio, void *buf, size_t count); |
---|
| 65 | |
---|
[2773] | 66 | #endif |
---|
| 67 | |
---|
[2799] | 68 | #endif |
---|
| 69 | |
---|
[2773] | 70 | //ll |
---|