2 * Copyright (C) 2003-2006 David Schleef <ds@schleef.org>
3 * 2005-2006 Eric Anholt <eric@anholt.net>
4 * 2006-2008 Benjamin Otte <otte@gnome.org>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301 USA
22 #ifndef _SWFDEC_AUDIO_INTERNAL_H_
23 #define _SWFDEC_AUDIO_INTERNAL_H_
25 #include <swfdec/swfdec.h>
26 #include <swfdec/swfdec_audio.h>
27 #include <swfdec/swfdec_bits.h>
28 #include <swfdec/swfdec_sound_matrix.h>
29 #include <swfdec/swfdec_types.h>
33 typedef guint SwfdecAudioFormat
;
34 #define SWFDEC_IS_AUDIO_FORMAT(format) ((format) <= 0xF)
35 #define SWFDEC_AUDIO_FORMAT_INVALID ((SwfdecAudioFormat) -1)
41 SwfdecPlayer
* player
; /* the player that plays us */
42 gboolean added
; /* set to TRUE after the added signal has been emitted */
43 SwfdecActor
* actor
; /* NULL or movieclip that controls our volume */
44 const SwfdecSoundMatrix
* matrix
; /* matrix this audio references or NULL if none */
45 SwfdecSoundMatrix matrix_cache
; /* matrix used by this audio instance */
48 struct _SwfdecAudioClass
{
49 GObjectClass object_class
;
51 gsize (* iterate
) (SwfdecAudio
* audio
,
53 gsize (* render
) (SwfdecAudio
* audio
,
59 void swfdec_audio_add (SwfdecAudio
* audio
,
60 SwfdecPlayer
* player
);
61 void swfdec_audio_remove (SwfdecAudio
* audio
);
62 void swfdec_audio_set_actor (SwfdecAudio
* audio
,
64 void swfdec_audio_set_matrix (SwfdecAudio
* audio
,
65 const SwfdecSoundMatrix
*matrix
);
67 gsize
swfdec_audio_iterate (SwfdecAudio
* audio
,
69 void swfdec_audio_update_matrix (SwfdecAudio
* audio
);
71 SwfdecAudioFormat
swfdec_audio_format_parse (SwfdecBits
* bits
);
72 SwfdecAudioFormat
swfdec_audio_format_new (guint rate
,
75 guint
swfdec_audio_format_get_channels(SwfdecAudioFormat format
);
76 gboolean
swfdec_audio_format_is_16bit (SwfdecAudioFormat format
);
77 guint
swfdec_audio_format_get_rate (SwfdecAudioFormat format
);
78 guint swfdec_audio_format_get_granularity
79 (SwfdecAudioFormat format
);
80 guint swfdec_audio_format_get_bytes_per_sample
81 (SwfdecAudioFormat format
);
82 const char * swfdec_audio_format_to_string (SwfdecAudioFormat format
);