Mercurial > audlegacy
annotate Plugins/Output/CoreAudio/coreaudio.h @ 1637:5261e37b4d55 trunk
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
author | nenolod |
---|---|
date | Thu, 07 Sep 2006 11:32:59 -0700 |
parents | |
children |
rev | line source |
---|---|
1637
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
1 /* XMMS - Cross-platform multimedia player |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
2 * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
3 * |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
4 * This program is free software; you can redistribute it and/or modify |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
6 * the Free Software Foundation; either version 2 of the License, or |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
7 * (at your option) any later version. |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
8 * |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
9 * This program is distributed in the hope that it will be useful, |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
12 * GNU General Public License for more details. |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
13 * |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
14 * You should have received a copy of the GNU General Public License |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
15 * along with this program; if not, write to the Free Software |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
17 */ |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
18 #ifndef OSX_H |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
19 #define OSX_H |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
20 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
21 #include "config.h" |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
22 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
23 #include <gtk/gtk.h> |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
24 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
25 #include <sys/types.h> |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
26 #include <sys/ioctl.h> |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
27 #include <sys/stat.h> |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
28 #include <sys/time.h> |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
29 #ifdef HAVE_SYS_SOUNDCARD_H |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
30 #include <sys/soundcard.h> |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
31 #elif defined(HAVE_MACHINE_SOUNDCARD_H) |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
32 #include <machine/soundcard.h> |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
33 #endif |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
34 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
35 #include <fcntl.h> |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
36 #include <unistd.h> |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
37 #include <pthread.h> |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
38 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
39 #include <stdlib.h> |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
40 #include <stdio.h> |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
41 #include <string.h> |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
42 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
43 #include "audacious/plugin.h" |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
44 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
45 #ifdef WORDS_BIGENDIAN |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
46 # define IS_BIG_ENDIAN TRUE |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
47 #else |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
48 # define IS_BIG_ENDIAN FALSE |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
49 #endif |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
50 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
51 #define OUTPUT_BUFSIZE (4096 * 8) |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
52 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
53 extern OutputPlugin op; |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
54 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
55 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
56 struct format_info |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
57 { |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
58 union |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
59 { |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
60 AFormat xmms; |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
61 int osx; |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
62 } format; |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
63 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
64 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
65 int frequency; |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
66 int channels; |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
67 int bps; |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
68 }; |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
69 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
70 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
71 typedef struct |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
72 { |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
73 gint audio_device; |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
74 gint mixer_device; |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
75 gint buffer_size; |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
76 gint prebuffer; |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
77 gboolean use_master; |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
78 gboolean use_alt_audio_device, use_alt_mixer_device; |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
79 gchar *alt_audio_device, *alt_mixer_device; |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
80 } |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
81 OSXConfig; |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
82 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
83 extern OSXConfig osx_cfg; |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
84 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
85 void osx_init(void); |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
86 void osx_about(void); |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
87 void osx_configure(void); |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
88 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
89 void osx_get_volume(int *l, int *r); |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
90 void osx_set_volume(int l, int r); |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
91 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
92 int osx_playing(void); |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
93 int osx_free(void); |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
94 void osx_write(void *ptr, int length); |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
95 void osx_close(void); |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
96 void osx_flush(int time); |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
97 void osx_pause(short p); |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
98 int osx_open(AFormat fmt, int rate, int nch); |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
99 int osx_get_output_time(void); |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
100 int osx_get_written_time(void); |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
101 void osx_set_audio_params(void); |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
102 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
103 void* osx_get_convert_buffer(size_t size); |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
104 int (*osx_get_convert_func(int output, int input))(void **, int); |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
105 |
5261e37b4d55
[svn] - fully working CoreAudio plugin, based on the OSS plugin and an incomplete xmms coreaudio plugin (fink)
nenolod
parents:
diff
changeset
|
106 #endif |