1 /* -*- Mode: C; c-basic-offset: 4 -*- */
3 Copyright (C) 2002 Andy Wingo <wingo@pobox.com>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with this library; if not, write to the Free
17 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __GST_JACK_H__
21 #define __GST_JACK_H__
23 #include <jack/jack.h>
25 #include <gst/bytestream/bytestream.h>
27 //#define JACK_DEBUG(str, a...) g_message (str, ##a)
28 #define JACK_DEBUG(str, a...)
30 #define GST_JACK(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, GST_TYPE_JACK, GstJack)
31 #define GST_JACK_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, GST_TYPE_JACK, GstJackClass)
32 #define GST_IS_JACK(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, GST_TYPE_JACK)
33 #define GST_IS_JACK_CLASS(klass) G_TYPE_CHECK_CLASS_TYPE(klass, GST_TYPE_JACK)
34 #define GST_TYPE_JACK gst_jack_get_type()
36 #define GST_JACK_SINK(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, GST_TYPE_JACK_SINK, GstJack)
37 #define GST_JACK_SINK_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, GST_TYPE_JACK_SINK, GstJackClass)
38 #define GST_IS_JACK_SINK(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, GST_TYPE_JACK_SINK)
39 #define GST_IS_JACK_SINK_CLASS(klass) G_TYPE_CHECK_CLASS_TYPE(klass, GST_TYPE_JACK_SINK)
40 #define GST_TYPE_JACK_SINK gst_jack_sink_get_type()
42 #define GST_JACK_SRC(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, GST_TYPE_JACK_SRC, GstJack)
43 #define GST_JACK_SRC_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, GST_TYPE_JACK_SRC, GstJackClass)
44 #define GST_IS_JACK_SRC(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, GST_TYPE_JACK_SRC)
45 #define GST_IS_JACK_SRC_CLASS(klass) G_TYPE_CHECK_CLASS_TYPE(klass, GST_TYPE_JACK_SRC)
46 #define GST_TYPE_JACK_SRC gst_jack_src_get_type()
48 #define GST_JACK_BIN(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, GST_TYPE_JACK_BIN, GstJackBin)
49 #define GST_JACK_BIN_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, GST_TYPE_JACK_BIN, GstJackClass)
50 #define GST_IS_JACK_BIN(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, GST_TYPE_JACK_BIN)
51 #define GST_IS_JACK_BIN_CLASS(klass) G_TYPE_CHECK_CLASS_TYPE(klass, GST_TYPE_JACK_BIN)
52 #define GST_TYPE_JACK_BIN gst_jack_bin_get_type()
54 #define GST_JACK_PAD(l) ((GstJackPad*)l->data) /* l is a GList */
57 typedef struct _GstJack GstJack;
58 typedef struct _GstJackClass GstJackClass;
59 typedef struct _GstJackBin GstJackBin;
60 typedef struct _GstJackBinClass GstJackBinClass;
61 typedef GstJack GstJackSink;
62 typedef GstJackClass GstJackSinkClass;
63 typedef GstJack GstJackSrc;
64 typedef GstJackClass GstJackSrcClass;
68 GST_JACK_OPEN = (GST_BIN_FLAG_LAST << 0),
69 GST_JACK_ACTIVE = (GST_BIN_FLAG_LAST << 1),
70 GST_JACK_FLAG_LAST = (GST_BIN_FLAG_LAST << 3)
74 typedef jack_default_audio_sample_t sample_t;
80 const gchar *peer_name;
87 /* list of GstJackPads */
91 GstPadDirection direction;
93 gchar *port_name_prefix;
98 struct _GstJackClass {
99 GstElementClass parent_class;
105 jack_client_t *client;
106 gint default_new_port_number;
108 /* lists of GstJackPads */
115 jack_nframes_t nframes;
118 struct _GstJackBinClass {
119 GstBinClass parent_class;
123 GType gst_jack_get_type (void);
124 GType gst_jack_bin_get_type (void);
125 GType gst_jack_sink_get_type (void);
126 GType gst_jack_src_get_type (void);
129 #endif /* __GST_JACK_H__ */