
#ifndef __GST_OPENAL_SRC_H__
#define __GST_OPENAL_SRC_H__

#include <gst/gst.h>
#include <gst/audio/gstaudiosrc.h>

// OpenAL
#include <al.h>
#include <alc.h>

G_BEGIN_DECLS

/* #defines don't like whitespacey bits */
#define GST_TYPE_OPENAL_SRC \
  (gst_openal_src_get_type())
#define GST_OPENAL_SRC(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OPENAL_SRC,GstOpenalSrc))
#define GST_OPENAL_SRC_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OPENAL_SRC,GstOpenalSrcClass))
#define GST_IS_OPENAL_SRC(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OPENAL_SRC))
#define GST_IS_OPENAL_SRC_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OPENAL_SRC))

typedef struct _GstOpenalSrc      GstOpenalSrc;
typedef struct _GstOpenalSrcClass GstOpenalSrcClass;

/**
	Definition of structure storing data for this element.
**/
struct _GstOpenalSrc {
	/// element base instance of this object
	GstAudioSrc element;
	/// source pad
	GstPad *srcpad;
	/// Is silent
	gboolean silent;
	/// readable name of device
	gchar *deviceName;
	/// name of device to open, default is a NULL pointer to get default device
	gchar *device;
	/// OpenAL device
	ALCdevice *deviceHandle;
	/// Bytes per sample
	guint bytes_per_sample;
};

/**
	Standard definition defining a class for this element.
**/
struct _GstOpenalSrcClass {
	/// Parent source class of this class
	GstAudioSrcClass parent_class;
};

GType gst_openal_src_get_type (void);

G_END_DECLS

#endif /* __GST_OPENAL_SRC_H__ */
