2003-10-10 12:47:41 +00:00
|
|
|
/* GStreamer Tuner
|
|
|
|
* Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
|
|
|
|
*
|
|
|
|
* tuner.h: tuner interface design
|
|
|
|
*
|
|
|
|
* 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_TUNER_H__
|
|
|
|
#define __GST_TUNER_H__
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
2005-06-30 11:58:40 +00:00
|
|
|
#include <gst/interfaces/tunernorm.h>
|
|
|
|
#include <gst/interfaces/tunerchannel.h>
|
|
|
|
#include <gst/interfaces/interfaces-enumtypes.h>
|
2003-10-10 12:47:41 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2011-06-26 20:46:08 +00:00
|
|
|
/* FIXME 0.11: remove all CLASS bits, this is an interface */
|
|
|
|
|
2003-10-10 12:47:41 +00:00
|
|
|
#define GST_TYPE_TUNER \
|
|
|
|
(gst_tuner_get_type ())
|
|
|
|
#define GST_TUNER(obj) \
|
2011-06-26 20:46:08 +00:00
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TUNER, GstTuner))
|
2003-10-10 12:47:41 +00:00
|
|
|
#define GST_IS_TUNER(obj) \
|
2011-06-26 20:46:08 +00:00
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TUNER))
|
2011-10-21 12:37:31 +00:00
|
|
|
#define GST_TUNER_GET_INTERFACE(inst) \
|
|
|
|
(G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_TUNER, GstTunerInterface))
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2003-10-10 12:47:41 +00:00
|
|
|
typedef struct _GstTuner GstTuner;
|
2011-10-21 12:37:31 +00:00
|
|
|
typedef struct _GstTunerInterface GstTunerInterface;
|
2003-10-10 12:47:41 +00:00
|
|
|
|
2011-05-23 19:58:22 +00:00
|
|
|
/**
|
2011-10-21 12:37:31 +00:00
|
|
|
* GstTunerInterface:
|
2011-05-23 19:58:22 +00:00
|
|
|
* @klass: the parent interface
|
|
|
|
* @list_channels: list available channels
|
|
|
|
* @set_channel: set to a channel
|
|
|
|
* @get_channel: return the current channel
|
|
|
|
* @list_norms: list available norms
|
|
|
|
* @set_norm: set a norm
|
|
|
|
* @get_norm: return the current norm
|
|
|
|
* @set_frequency: set the frequency
|
|
|
|
* @get_frequency: return the current frequency
|
|
|
|
* @signal_strength: get the signal strength
|
|
|
|
* @channel_changed: default handler for channel changed notification
|
|
|
|
* @norm_changed: default handler for norm changed notification
|
|
|
|
* @frequency_changed: default handler for frequency changed notification
|
|
|
|
* @signal_changed: default handler for signal-strength changed notification
|
|
|
|
*
|
|
|
|
* Tuner interface.
|
|
|
|
*/
|
2011-10-21 12:37:31 +00:00
|
|
|
struct _GstTunerInterface {
|
2003-10-10 12:47:41 +00:00
|
|
|
GTypeInterface klass;
|
|
|
|
|
|
|
|
/* virtual functions */
|
2004-03-15 16:32:55 +00:00
|
|
|
const GList * (* list_channels) (GstTuner *tuner);
|
|
|
|
void (* set_channel) (GstTuner *tuner,
|
2005-12-06 19:42:02 +00:00
|
|
|
GstTunerChannel *channel);
|
2004-03-15 16:32:55 +00:00
|
|
|
GstTunerChannel *
|
2005-12-06 19:42:02 +00:00
|
|
|
(* get_channel) (GstTuner *tuner);
|
2004-03-15 16:32:55 +00:00
|
|
|
|
|
|
|
const GList * (* list_norms) (GstTuner *tuner);
|
|
|
|
void (* set_norm) (GstTuner *tuner,
|
2005-12-06 19:42:02 +00:00
|
|
|
GstTunerNorm *norm);
|
2004-03-15 16:32:55 +00:00
|
|
|
GstTunerNorm *(* get_norm) (GstTuner *tuner);
|
|
|
|
|
|
|
|
void (* set_frequency) (GstTuner *tuner,
|
2005-12-06 19:42:02 +00:00
|
|
|
GstTunerChannel *channel,
|
|
|
|
gulong frequency);
|
2004-03-15 16:32:55 +00:00
|
|
|
gulong (* get_frequency) (GstTuner *tuner,
|
2005-12-06 19:42:02 +00:00
|
|
|
GstTunerChannel *channel);
|
|
|
|
gint (* signal_strength) (GstTuner *tuner,
|
|
|
|
GstTunerChannel *channel);
|
2003-12-07 12:11:30 +00:00
|
|
|
|
|
|
|
/* signals */
|
2004-03-15 16:32:55 +00:00
|
|
|
void (*channel_changed) (GstTuner *tuner,
|
2005-12-06 19:42:02 +00:00
|
|
|
GstTunerChannel *channel);
|
2004-03-15 16:32:55 +00:00
|
|
|
void (*norm_changed) (GstTuner *tuner,
|
2005-12-06 19:42:02 +00:00
|
|
|
GstTunerNorm *norm);
|
2004-03-15 16:32:55 +00:00
|
|
|
void (*frequency_changed) (GstTuner *tuner,
|
2005-12-06 19:42:02 +00:00
|
|
|
GstTunerChannel *channel,
|
|
|
|
gulong frequency);
|
2004-03-15 16:32:55 +00:00
|
|
|
void (*signal_changed) (GstTuner *tuner,
|
2005-12-06 19:42:02 +00:00
|
|
|
GstTunerChannel *channel,
|
|
|
|
gint signal);
|
2003-12-07 12:11:30 +00:00
|
|
|
|
2011-05-23 19:58:22 +00:00
|
|
|
/*< private >*/
|
2003-12-09 10:02:08 +00:00
|
|
|
gpointer _gst_reserved[GST_PADDING];
|
2009-05-06 15:59:13 +00:00
|
|
|
};
|
2003-10-10 12:47:41 +00:00
|
|
|
|
2005-12-06 19:42:02 +00:00
|
|
|
GType gst_tuner_get_type (void);
|
2003-10-10 12:47:41 +00:00
|
|
|
|
|
|
|
/* virtual class function wrappers */
|
2005-12-06 19:42:02 +00:00
|
|
|
const GList * gst_tuner_list_channels (GstTuner *tuner);
|
|
|
|
void gst_tuner_set_channel (GstTuner *tuner,
|
|
|
|
GstTunerChannel *channel);
|
2004-03-15 16:32:55 +00:00
|
|
|
GstTunerChannel *
|
2005-12-06 19:42:02 +00:00
|
|
|
gst_tuner_get_channel (GstTuner *tuner);
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2005-12-06 19:42:02 +00:00
|
|
|
const GList * gst_tuner_list_norms (GstTuner *tuner);
|
|
|
|
void gst_tuner_set_norm (GstTuner *tuner,
|
|
|
|
GstTunerNorm *norm);
|
|
|
|
GstTunerNorm * gst_tuner_get_norm (GstTuner *tuner);
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2005-12-06 19:42:02 +00:00
|
|
|
void gst_tuner_set_frequency (GstTuner *tuner,
|
|
|
|
GstTunerChannel *channel,
|
|
|
|
gulong frequency);
|
|
|
|
gulong gst_tuner_get_frequency (GstTuner *tuner,
|
|
|
|
GstTunerChannel *channel);
|
|
|
|
gint gst_tuner_signal_strength (GstTuner *tuner,
|
|
|
|
GstTunerChannel *channel);
|
2003-10-10 12:47:41 +00:00
|
|
|
|
2004-01-12 02:11:03 +00:00
|
|
|
/* helper functions */
|
2005-12-06 19:42:02 +00:00
|
|
|
GstTunerNorm * gst_tuner_find_norm_by_name (GstTuner *tuner,
|
|
|
|
gchar *norm);
|
|
|
|
GstTunerChannel *gst_tuner_find_channel_by_name (GstTuner *tuner,
|
|
|
|
gchar *channel);
|
2004-01-12 02:11:03 +00:00
|
|
|
|
2003-12-07 12:11:30 +00:00
|
|
|
/* trigger signals */
|
2005-12-06 19:42:02 +00:00
|
|
|
void gst_tuner_channel_changed (GstTuner *tuner,
|
|
|
|
GstTunerChannel *channel);
|
|
|
|
void gst_tuner_norm_changed (GstTuner *tuner,
|
|
|
|
GstTunerNorm *norm);
|
|
|
|
void gst_tuner_frequency_changed (GstTuner *tuner,
|
|
|
|
GstTunerChannel *channel,
|
|
|
|
gulong frequency);
|
|
|
|
void gst_tuner_signal_changed (GstTuner *tuner,
|
|
|
|
GstTunerChannel *channel,
|
|
|
|
gint signal);
|
2003-12-07 12:11:30 +00:00
|
|
|
|
2003-10-10 12:47:41 +00:00
|
|
|
G_END_DECLS
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2003-10-10 12:47:41 +00:00
|
|
|
#endif /* __GST_TUNER_H__ */
|