/* GStreamer OSS4 audio source
 * Copyright (C) 2007-2008 Tim-Philipp Müller <tim centricular net>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifndef GST_OSS4_SOURCE_H
#define GST_OSS4_SOURCE_H

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

G_BEGIN_DECLS

#define GST_TYPE_OSS4_SOURCE            (gst_oss4_source_get_type())
#define GST_OSS4_SOURCE(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OSS4_SOURCE,GstOss4Source))
#define GST_OSS4_SOURCE_CAST(obj)       ((GstOss4Source *)(obj))
#define GST_OSS4_SOURCE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OSS4_SOURCE,GstOss4SourceClass))
#define GST_IS_OSS4_SOURCE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OSS4_SOURCE))
#define GST_IS_OSS4_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OSS4_SOURCE))

typedef struct _GstOss4Source GstOss4Source;
typedef struct _GstOss4SourceClass GstOss4SourceClass;

struct _GstOss4Source {
  GstAudioSrc     audiosrc;

  gchar         * device;             /* NULL if none was set      */
  gchar         * open_device;        /* the device we opened      */
  gchar         * device_name;        /* set if the device is open */
  gint            fd;                 /* -1 if not open            */
  gint            bytes_per_sample;

  GstCaps       * probed_caps;

  /* property probe interface */
  GList         * property_probe_list;

  /* mixer interface */
  GList         * tracks;
  gboolean        tracks_static;  /* FALSE if the list of inputs may change */
};

struct _GstOss4SourceClass {
  GstAudioSrcClass audiosrc_class;
};

GType  gst_oss4_source_get_type (void);

/* our mixer track for input selection */
#define GST_TYPE_OSS4_SOURCE_INPUT            (gst_oss4_source_input_get_type())
#define GST_OSS4_SOURCE_INPUT(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OSS4_SOURCE_INPUT,GstOss4SourceInput))
#define GST_OSS4_SOURCE_INPUT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OSS4_SOURCE_INPUT,GstOss4SourceInputClass))
#define GST_IS_OSS4_SOURCE_INPUT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OSS4_SOURCE_INPUT))
#define GST_IS_OSS4_SOURCE_INPUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OSS4_SOURCE_INPUT))

typedef struct _GstOss4SourceInput GstOss4SourceInput;
typedef struct _GstOss4SourceInputClass GstOss4SourceInputClass;

struct _GstOss4SourceInput {
  GstMixerTrack mixer_track;

  int           route; /* number for SNDCTL_DSP_SET_RECSRC etc. */
};

struct _GstOss4SourceInputClass {
  GstMixerTrackClass mixer_track_class;
};

GType  gst_oss4_source_input_get_type (void);

G_END_DECLS

#endif /* GST_OSS4_SOURCE_H */

