Tizen 2.0 Release
[platform/upstream/libremix.git] / include / remix / remix.h
1 /*
2  * libremix -- An audio mixing and sequencing library.
3  *
4  * Copyright (C) 2001 Commonwealth Scientific and Industrial Research
5  * Organisation (CSIRO), Australia.
6  * Copyright (C) 2003 Conrad Parker
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library 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 GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  *
22  */
23
24 /** \file
25  * Base types and public interfaces to libremix
26  *
27  */
28
29 /*
30  * Conrad Parker <conrad@metadecks.org>, August 2001
31  */
32
33 #ifndef __REMIX_H__
34 #define __REMIX_H__
35
36 /** \mainpage
37  *
38  * \section Introduction
39  *
40  * Remix is an audio sequencing and mixing library that provides a
41  * multichannel, sparse audio data container (streams), a structured mixing
42  * abstraction (decks), and widely useful means of generating control data
43  * (via envelopes) and of caching audio data.
44  *
45  * \subsection contents Contents
46  *
47  * - \link remix_deck.h Decks \endlink:
48  * The Remix hierarchical mixing abstraction
49  *
50  * - \link remix_stream.h Streams \endlink:
51  * The multichannel PCM stream abstraction
52  *
53  * - \link remix.h remix.h \endlink:
54  * Documentation of the Remix C API
55  *
56  * - \link examples Examples \endlink:
57  * Annotated example programs
58  *
59  * - \link configuration Configuration \endlink:
60  * Customizing libremix.
61  *
62  * - \link building Building \endlink:
63  * Information related to building software that uses libremix.
64  *
65  * \section licensing Licensing
66  *
67  * libremix is provided under the
68  * \link lgpl GNU Lesser General Public License \endlink.
69  *
70  */
71
72 /** \defgroup lgpl Licensing
73  * \section lgpl GNU Lesser General Public License
74  *
75  * \include COPYING
76  */
77
78 /** \defgroup configuration Configuration
79  * \section ./configure ./configure
80  *
81  * It is possible to customize the functionality of libremix
82  * by using various ./configure flags when
83  * building it from source.
84  *
85  * For general information about using ./configure, see the file
86  * \link install INSTALL \endlink
87  */
88
89 /** \defgroup install Installation
90  * \section install INSTALL
91  *
92  * \include INSTALL
93  */
94
95 /** \defgroup building Building against libremix
96  *
97  *
98  * \section autoconf Using GNU autoconf
99  *
100  * If you are using GNU autoconf, you do not need to call pkg-config
101  * directly. Use the following macro to determine if libremix is
102  * available:
103  *
104  <pre>
105  PKG_CHECK_MODULES(REMIX, remix >= 0.2.0,
106                    HAVE_REMIX="yes", HAVE_REMIX="no")
107  if test "x$HAVE_REMIX" = "xyes" ; then
108    AC_SUBST(REMIX_CFLAGS)
109    AC_SUBST(REMIX_LIBS)
110  fi
111  </pre>
112  *
113  * If libremix is found, HAVE_REMIX will be set to "yes", and
114  * the autoconf variables REMIX_CFLAGS and REMIX_LIBS will
115  * be set appropriately.
116  *
117  * \section pkg-config Determining compiler options with pkg-config
118  *
119  * If you are not using GNU autoconf in your project, you can use the
120  * pkg-config tool directly to determine the correct compiler options.
121  *
122  <pre>
123  REMIX_CFLAGS=`pkg-config --cflags remix`
124
125  REMIX_LIBS=`pkg-config --libs remix`
126  </pre>
127  *
128  */
129
130 /** \defgroup examples Example programs
131  *
132  * Example programs are fun for all the family.
133  *
134  * Here's some examples.
135  * - \link noisedemo Noise demo \endlink
136  * - \link squaredemo Square demo \endlink
137  * - \link sndfiledemo Sndfile demo \endlink
138  */
139
140 /** \defgroup noisedemo Noise demo
141  *
142  * Plays a sequence of short bursts of whitenoise.
143  *
144  * \include noisedemo.c noisedemo.c
145  */
146
147 /** \defgroup squaredemo Square demo
148  *
149  * Plays a polyphonic sequence of musical notes generated by a builtin
150  * square wave synthesizer.
151  *
152  * \include squaredemo.c squaredemo.c
153  */
154
155 /** \defgroup sndfiledemo Sndfile demo
156  *
157  * Plays a sequence of notes using sound files from disk.
158  *
159  * \include sndfiledemo.c sndfiledemo.c
160  */
161
162 #include <remix/remix_types.h>
163
164 #if defined(__cplusplus)
165 extern "C" {
166 #endif
167
168 extern CDSet * REMIX_MONO;
169 extern CDSet * REMIX_STEREO;
170
171
172 /* RemixEnv */
173 RemixEnv * remix_init (void);
174 RemixEnv * remix_init_clone (RemixEnv * env);
175 void remix_purge (RemixEnv * env);
176 RemixError remix_last_error (RemixEnv * env);
177 char * remix_error_string (RemixEnv * env, RemixError error);
178 RemixSamplerate remix_set_samplerate (RemixEnv * env, RemixSamplerate samplerate);
179 RemixSamplerate remix_get_samplerate (RemixEnv * env);
180 RemixTempo remix_set_tempo (RemixEnv * env, RemixTempo tempo);
181 RemixTempo remix_get_tempo (RemixEnv * env);
182 CDSet * remix_set_channels (RemixEnv * env, CDSet * channelset);
183 CDSet * remix_get_channels (RemixEnv * env);
184
185 #if 0
186   /* XXX */
187 /* Sources: Plugins, Samples etc. */
188 CDList * remix_open (SOUNDRENDER env, char * filename);
189 void remix_close (SOUNDRENDER env, RemixPlugin plugin);
190 #endif
191
192 /* Base objects */
193
194 RemixPlugin * remix_find_plugin (RemixEnv * env, char * identifier);
195
196 RemixBase * remix_new (RemixEnv * env, RemixPlugin * plugin, CDSet * parameters);
197 CDSet * remix_suggest (RemixEnv * env, RemixPlugin * plugin, CDSet * parameters);
198
199 int remix_get_init_parameter_key (RemixEnv * env, RemixPlugin * plugin, char * name);
200 int remix_get_parameter_key (RemixEnv * env, RemixBase * base, char * name);
201
202 RemixParameter remix_set_parameter (RemixEnv * env, RemixBase * base, int key,
203                                   RemixParameter parameter);
204 RemixParameter remix_get_parameter (RemixEnv * env, RemixBase * base, int key);
205 RemixParameterType remix_get_parameter_type (RemixEnv * env, RemixBase * base, int key);
206
207
208 RemixBase * remix_clone_subclass (RemixEnv * env, RemixBase * base);
209 int remix_destroy (RemixEnv * env, RemixBase * base);
210 int remix_destroy_list (RemixEnv * env, CDList * list);
211 RemixBase * remix_prepare (RemixEnv * env, RemixBase * base);
212 RemixCount remix_process (RemixEnv * env, RemixBase * base, RemixCount count,
213                     RemixStream * input, RemixStream * output);
214 RemixCount remix_length (RemixEnv * env, RemixBase * base);
215 RemixCount remix_seek (RemixEnv * env, RemixBase * base, RemixCount offset, int whence);
216 RemixCount remix_tell (RemixEnv * env, RemixBase * base);
217 int remix_flush (RemixEnv * env, RemixBase * base);
218
219 RemixCount remix_set_mixlength (RemixEnv * env, RemixCount mixlength);
220 RemixCount remix_get_mixlength (RemixEnv * env);
221
222
223 int remix_is_writeable (RemixEnv * env, RemixBase * base);
224 int remix_is_seekable (RemixEnv * env, RemixBase * base);
225 int remix_is_cacheable (RemixEnv * env, RemixBase * base);
226 int remix_is_causal (RemixEnv * env, RemixBase * base);
227
228 char * remix_set_name (RemixEnv * env, RemixBase * base, char * name);
229 char * remix_get_name (RemixEnv * env, RemixBase * base);
230
231 #include <remix/remix_deck.h>
232 #include <remix/remix_envelope.h>
233 #include <remix/remix_stream.h>
234
235 /* SquareTone */
236 RemixBase * remix_squaretone_new (RemixEnv * env, float frequency);
237 float remix_squaretone_set_frequency (RemixEnv * env,
238                                       RemixBase * squaretone,
239                                       float frequency);
240 float remix_squaretone_get_frequency (RemixEnv * env,
241                                       RemixBase * squaretone);
242
243 /* Monitor */
244 RemixMonitor * remix_monitor_new (RemixEnv * env);
245
246 /* Scrubby */
247 RemixBase * remix_scrubby_new (RemixEnv * env);
248 RemixBase * remix_scrubby_set_source (RemixEnv * env, RemixBase * scrubby,
249                                       RemixBase * source);
250 RemixBase * remix_scrubby_get_source (RemixEnv * env, RemixBase * scrubby);
251 int remix_scrubby_set_direction (RemixEnv * env, RemixBase * scrubby, int direction);
252 int remix_scrubby_get_direction (RemixEnv * env, RemixBase * scrubby);
253
254 #include <remix/remix_time.h>
255
256 #include <remix/remix_meta.h>
257
258 #if defined(__cplusplus)
259 }
260 #endif
261
262 #endif /* __REMIX_H__ */