2 * Copyright (C) 2005 Sebastien Moutte <sebastien@moutte.net>
3 * Copyright (C) 2007 Pioneers of the Inevitable <songbird@songbirdnest.com>
5 * gstdirectsoundsink.h:
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
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 GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
22 * The development of this code was made possible due to the involvement
23 * of Pioneers of the Inevitable, the creators of the Songbird Music player
28 #ifndef __GST_DIRECTSOUNDSINK_H__
29 #define __GST_DIRECTSOUNDSINK_H__
32 #include <gst/audio/gstaudiosink.h>
33 #include <gst/interfaces/mixer.h>
40 #define GST_TYPE_DIRECTSOUND_SINK (gst_directsound_sink_get_type())
41 #define GST_DIRECTSOUND_SINK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DIRECTSOUND_SINK,GstDirectSoundSink))
42 #define GST_DIRECTSOUND_SINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DIRECTSOUND_SINK,GstDirectSoundSinkClass))
43 #define GST_IS_DIRECTSOUND_SINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DIRECTSOUND_SINK))
44 #define GST_IS_DIRECTSOUND_SINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DIRECTSOUND_SINK))
45 typedef struct _GstDirectSoundSink GstDirectSoundSink;
46 typedef struct _GstDirectSoundSinkClass GstDirectSoundSinkClass;
48 #define GST_DSOUND_LOCK(obj) (g_mutex_lock (obj->dsound_lock))
49 #define GST_DSOUND_UNLOCK(obj) (g_mutex_unlock (obj->dsound_lock))
51 struct _GstDirectSoundSink
55 /* directsound object interface pointer */
58 /* directsound sound object interface pointer */
59 LPDIRECTSOUNDBUFFER pDSBSecondary;
61 /* directSound buffer size */
64 /* offset of the circular buffer where we must write next */
65 guint current_circular_offset;
67 guint bytes_per_sample;
69 /* current volume setup by mixer interface */
72 /* tracks list of our mixer interface implementation */
75 /* lock used to protect writes and resets */
78 gboolean first_buffer_after_reset;
81 struct _GstDirectSoundSinkClass
83 GstAudioSinkClass parent_class;
86 GType gst_directsound_sink_get_type (void);
89 #endif /* __GST_DIRECTSOUNDSINK_H__ */