[541] | 1 | /*
|
---|
| 2 | * This file is part of uniaud.dll.
|
---|
| 3 | *
|
---|
| 4 | * Copyright (c) 2010 Mensys BV
|
---|
| 5 | * Copyright (c) 2007 Vlad Stelmahovsky aka Vladest
|
---|
| 6 | *
|
---|
| 7 | * This library is free software: you can redistribute it and/or modify
|
---|
| 8 | * it under the terms of the GNU Lesser General Public License as
|
---|
| 9 | * published by the Free Software Foundation, either version 3 of
|
---|
| 10 | * the License, or (at your option) any later version.
|
---|
| 11 | *
|
---|
| 12 | * This library is distributed in the hope that it will be useful,
|
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 15 | * GNU Lesser General Public License for more details.
|
---|
| 16 | *
|
---|
| 17 | * You should have received a copy of the GNU Lesser General Public
|
---|
| 18 | * License and the GNU General Public License along with this library.
|
---|
| 19 | * If not, see <http://www.gnu.org/licenses/>.
|
---|
| 20 | */
|
---|
| 21 | #ifndef __UNIAUD_INTERNAL__
|
---|
| 22 | #define __UNIAUD_INTERNAL__
|
---|
| 23 |
|
---|
| 24 | #include "uniaud.h"
|
---|
| 25 | #include "unidef.h"
|
---|
| 26 |
|
---|
| 27 | //IOCTL commands
|
---|
| 28 | #define CAT_IOCTL_OSS32 0x92
|
---|
| 29 | #define IOCTL_OSS32_ATTACH 0x40
|
---|
| 30 | #define IOCTL_OSS32_VERSION 0x41
|
---|
| 31 | #define IOCTL_OSS32_GET_PCM_NUM 0x42
|
---|
| 32 | #define IOCTL_OSS32_PCM_CAPS 0x43
|
---|
| 33 | #define IOCTL_OSS32_SET_PCM 0x44
|
---|
| 34 | #define IOCTL_OSS32_GET_PCM 0x45
|
---|
| 35 | #define IOCTL_OSS32_CARDS_NUM 0x48
|
---|
| 36 | #define IOCTL_OSS32_CARD_INFO 0x49
|
---|
| 37 | #define IOCTL_OSS32_GET_POWER_STATE 0x4A
|
---|
| 38 | #define IOCTL_OSS32_SET_POWER_STATE 0x4B
|
---|
| 39 | #define IOCTL_OSS32_GET_CNTRLS_NUM 0x50
|
---|
| 40 | #define IOCTL_OSS32_GET_CNTRLS 0x51
|
---|
| 41 | #define IOCTL_OSS32_CNTRL_INFO 0x52
|
---|
| 42 | #define IOCTL_OSS32_CNTRL_GET 0x53
|
---|
| 43 | #define IOCTL_OSS32_CNTRL_PUT 0x54
|
---|
| 44 | #define IOCTL_OSS32_CNTRL_WAIT 0x55
|
---|
| 45 |
|
---|
| 46 | #define IOCTL_OSS32_PCM_OPEN 0x60
|
---|
| 47 | #define IOCTL_OSS32_PCM_CLOSE 0x61
|
---|
| 48 | #define IOCTL_OSS32_PCM_READ 0x62
|
---|
| 49 | #define IOCTL_OSS32_PCM_WRITE 0x63
|
---|
| 50 | #define IOCTL_OSS32_PCM_PAUSE 0x64
|
---|
| 51 | #define IOCTL_OSS32_PCM_RESUME 0x65
|
---|
| 52 | #define IOCTL_OSS32_PCM_DROP 0x66
|
---|
| 53 | #define IOCTL_OSS32_PCM_DRAIN 0x67
|
---|
| 54 | #define IOCTL_OSS32_PCM_STATUS 0x68
|
---|
| 55 | #define IOCTL_OSS32_PCM_REFINEHWPARAMS 0x69
|
---|
| 56 | #define IOCTL_OSS32_PCM_SETHWPARAMS 0x70
|
---|
| 57 | #define IOCTL_OSS32_PCM_SETSWPARAMS 0x71
|
---|
| 58 | #define IOCTL_OSS32_PCM_PREPARE 0x72
|
---|
| 59 | #define IOCTL_OSS32_PCM_WAIT_INT 0x73
|
---|
| 60 | #define IOCTL_OSS32_PCM_START 0x74
|
---|
| 61 |
|
---|
| 62 | #define IOCTL_OSS32_PCM_CLOSE_ALL 0x1F
|
---|
| 63 | #define IOCTL_OSS32_PCM_CLOSE_16 0x1F+1
|
---|
| 64 |
|
---|
| 65 | typedef struct UniaudCardInstance {
|
---|
| 66 | UniaudCardInfo *CardInfo; // card info
|
---|
| 67 | UniaudControl *ctls_list; // controls list
|
---|
| 68 | int ctls_num; // number of controls
|
---|
| 69 | int access_flag; // access flag (exclusive or shared)
|
---|
| 70 | int opened_flag; // opened flag (increment by 1 on each open)
|
---|
| 71 | } UniaudCardInstance;
|
---|
| 72 |
|
---|
| 73 |
|
---|
| 74 | extern UniaudCardInstance UniInst[MAX_CARDS];
|
---|
| 75 |
|
---|
| 76 | extern int cards_num;
|
---|
| 77 | extern int DebugMode;
|
---|
| 78 |
|
---|
| 79 | int DriverOpen(void);
|
---|
| 80 |
|
---|
| 81 | /*
|
---|
| 82 | * structure passed to pcm open ioctl
|
---|
| 83 | */
|
---|
| 84 | #pragma pack (1)
|
---|
| 85 | typedef struct ioctl_pcm {
|
---|
| 86 | ULONG deviceid; // card number
|
---|
| 87 | ULONG streamtype; // type of stream (play or record)
|
---|
| 88 | ULONG pcm; // pcm instance
|
---|
| 89 | int size; // data size
|
---|
| 90 | ULONG ret; // return code
|
---|
| 91 | } ioctl_pcm;
|
---|
| 92 | #pragma pack ()
|
---|
[578] | 93 |
|
---|
| 94 | int _uniaud_pcm_prepare(uniaud_pcm *pcm);
|
---|
| 95 | int _uniaud_pcm_start(uniaud_pcm *pcm);
|
---|
| 96 | int _uniaud_pcm_drop(uniaud_pcm *pcm);
|
---|
| 97 | int _uniaud_pcm_pause(uniaud_pcm *pcm);
|
---|
| 98 | int _uniaud_pcm_resume(uniaud_pcm *pcm);
|
---|
| 99 | int _uniaud_pcm_close(uniaud_pcm *pcm);
|
---|
| 100 | int _uniaud_pcm_wait(uniaud_pcm *pcm, int timeout);
|
---|
| 101 | int _uniaud_pcm_write(uniaud_pcm *pcm, char* buffer, int size);
|
---|
| 102 | int _uniaud_pcm_open(int card_id, int type, int pcm_instance, int access_flag,
|
---|
| 103 | int sample_rate, int channels, int pcm_format, uniaud_pcm **pcm);
|
---|
| 104 | int _uniaud_mixer_get_ctls_number(int card_id);
|
---|
| 105 | UniaudControl * _uniaud_mixer_get_ctl_list(int card_id);
|
---|
| 106 | int mm_support(void);
|
---|
| 107 |
|
---|
[541] | 108 | #endif // __UNIAUD_INTERNAL__
|
---|