1 /* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /*
3    Copyright (C) 2010 Red Hat, Inc.
4 
5    This library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Lesser General Public
7    License as published by the Free Software Foundation; either
8    version 2.1 of the License, or (at your option) any later version.
9 
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    Lesser General Public License for more details.
14 
15    You should have received a copy of the GNU Lesser General Public
16    License along with this library; if not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef __SPICE_CLIENT_PLAYBACK_CHANNEL_H__
19 #define __SPICE_CLIENT_PLAYBACK_CHANNEL_H__
20 
21 #if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
22 #warning "Only <spice-client.h> can be included directly"
23 #endif
24 
25 #include "spice-client.h"
26 
27 G_BEGIN_DECLS
28 
29 #define SPICE_TYPE_PLAYBACK_CHANNEL            (spice_playback_channel_get_type())
30 #define SPICE_PLAYBACK_CHANNEL(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), SPICE_TYPE_PLAYBACK_CHANNEL, SpicePlaybackChannel))
31 #define SPICE_PLAYBACK_CHANNEL_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), SPICE_TYPE_PLAYBACK_CHANNEL, SpicePlaybackChannelClass))
32 #define SPICE_IS_PLAYBACK_CHANNEL(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), SPICE_TYPE_PLAYBACK_CHANNEL))
33 #define SPICE_IS_PLAYBACK_CHANNEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), SPICE_TYPE_PLAYBACK_CHANNEL))
34 #define SPICE_PLAYBACK_CHANNEL_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), SPICE_TYPE_PLAYBACK_CHANNEL, SpicePlaybackChannelClass))
35 
36 typedef struct _SpicePlaybackChannel SpicePlaybackChannel;
37 typedef struct _SpicePlaybackChannelClass SpicePlaybackChannelClass;
38 typedef struct _SpicePlaybackChannelPrivate SpicePlaybackChannelPrivate;
39 
40 /**
41  * SpicePlaybackChannel:
42  *
43  * The #SpicePlaybackChannel struct is opaque and should not be accessed directly.
44  */
45 struct _SpicePlaybackChannel {
46     SpiceChannel parent;
47 
48     /*< private >*/
49     SpicePlaybackChannelPrivate *priv;
50     /* Do not add fields to this struct */
51 };
52 
53 /**
54  * SpicePlaybackChannelClass:
55  * @parent_class: Parent class.
56  * @playback_start: Signal class handler for the #SpicePlaybackChannel::playback-start signal.
57  * @playback_data: Signal class handler for the #SpicePlaybackChannel::playback-data signal.
58  * @playback_stop: Signal class handler for the #SpicePlaybackChannel::playback-stop signal.
59  *
60  * Class structure for #SpicePlaybackChannel.
61  */
62 struct _SpicePlaybackChannelClass {
63     SpiceChannelClass parent_class;
64 
65     /* signals */
66     void (*playback_start)(SpicePlaybackChannel *channel,
67                            gint format, gint channels, gint freq);
68     void (*playback_data)(SpicePlaybackChannel *channel, gpointer *data, gint size);
69     void (*playback_stop)(SpicePlaybackChannel *channel);
70 
71     /*< private >*/
72     /* Do not add fields to this struct */
73 };
74 
75 GType           spice_playback_channel_get_type(void);
76 void            spice_playback_channel_set_delay(SpicePlaybackChannel *channel, guint32 delay_ms);
77 
78 G_END_DECLS
79 
80 #endif /* __SPICE_CLIENT_PLAYBACK_CHANNEL_H__ */
81