~ubuntu-branches/ubuntu/trusty/unity-control-center/trusty

« back to all changes in this revision

Viewing changes to panels/sound/gvc-mixer-control.h

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2014-01-08 16:29:18 UTC
  • Revision ID: package-import@ubuntu.com-20140108162918-g29dd08tr913y2qh
Tags: upstream-14.04.0
ImportĀ upstreamĀ versionĀ 14.04.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
 
2
 *
 
3
 * Copyright (C) 2008 Red Hat, Inc.
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License as published by
 
7
 * the Free Software Foundation; either version 2 of the License, or
 
8
 * (at your option) any later version.
 
9
 *
 
10
 * This program 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
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
18
 *
 
19
 */
 
20
 
 
21
#ifndef __GVC_MIXER_CONTROL_H
 
22
#define __GVC_MIXER_CONTROL_H
 
23
 
 
24
#include <glib-object.h>
 
25
#include "gvc-mixer-stream.h"
 
26
#include "gvc-mixer-card.h"
 
27
#include "gvc-mixer-ui-device.h"
 
28
 
 
29
G_BEGIN_DECLS
 
30
 
 
31
typedef enum
 
32
{
 
33
        GVC_STATE_CLOSED,
 
34
        GVC_STATE_READY,
 
35
        GVC_STATE_CONNECTING,
 
36
        GVC_STATE_FAILED
 
37
} GvcMixerControlState;
 
38
 
 
39
#define GVC_TYPE_MIXER_CONTROL         (gvc_mixer_control_get_type ())
 
40
#define GVC_MIXER_CONTROL(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GVC_TYPE_MIXER_CONTROL, GvcMixerControl))
 
41
#define GVC_MIXER_CONTROL_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), GVC_TYPE_MIXER_CONTROL, GvcMixerControlClass))
 
42
#define GVC_IS_MIXER_CONTROL(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GVC_TYPE_MIXER_CONTROL))
 
43
#define GVC_IS_MIXER_CONTROL_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GVC_TYPE_MIXER_CONTROL))
 
44
#define GVC_MIXER_CONTROL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GVC_TYPE_MIXER_CONTROL, GvcMixerControlClass))
 
45
 
 
46
typedef struct GvcMixerControlPrivate GvcMixerControlPrivate;
 
47
 
 
48
typedef struct
 
49
{
 
50
        GObject                 parent;
 
51
        GvcMixerControlPrivate *priv;
 
52
} GvcMixerControl;
 
53
 
 
54
typedef struct
 
55
{
 
56
        GObjectClass            parent_class;
 
57
 
 
58
        void (*state_changed)          (GvcMixerControl      *control,
 
59
                                        GvcMixerControlState  new_state);
 
60
        void (*stream_added)           (GvcMixerControl *control,
 
61
                                        guint            id);
 
62
        void (*stream_removed)         (GvcMixerControl *control,
 
63
                                        guint            id);
 
64
        void (*card_added)             (GvcMixerControl *control,
 
65
                                        guint            id);
 
66
        void (*card_removed)           (GvcMixerControl *control,
 
67
                                        guint            id);
 
68
        void (*default_sink_changed)   (GvcMixerControl *control,
 
69
                                        guint            id);
 
70
        void (*default_source_changed) (GvcMixerControl *control,
 
71
                                        guint            id);
 
72
        void (*active_output_update)   (GvcMixerControl *control,
 
73
                                        guint            id);
 
74
        void (*active_input_update)    (GvcMixerControl *control,
 
75
                                        guint            id);
 
76
        void (*output_added)           (GvcMixerControl *control,
 
77
                                        guint            id);
 
78
        void (*input_added)            (GvcMixerControl *control,
 
79
                                        guint            id);
 
80
        void (*output_removed)         (GvcMixerControl *control,
 
81
                                        guint            id);
 
82
        void (*input_removed)          (GvcMixerControl *control,
 
83
                                        guint            id);
 
84
} GvcMixerControlClass;
 
85
 
 
86
GType               gvc_mixer_control_get_type            (void);
 
87
 
 
88
GvcMixerControl *   gvc_mixer_control_new                 (const char *name);
 
89
 
 
90
gboolean            gvc_mixer_control_open                (GvcMixerControl *control);
 
91
gboolean            gvc_mixer_control_close               (GvcMixerControl *control);
 
92
 
 
93
GSList *            gvc_mixer_control_get_cards           (GvcMixerControl *control);
 
94
GSList *            gvc_mixer_control_get_streams         (GvcMixerControl *control);
 
95
GSList *            gvc_mixer_control_get_sinks           (GvcMixerControl *control);
 
96
GSList *            gvc_mixer_control_get_sources         (GvcMixerControl *control);
 
97
GSList *            gvc_mixer_control_get_sink_inputs     (GvcMixerControl *control);
 
98
GSList *            gvc_mixer_control_get_source_outputs  (GvcMixerControl *control);
 
99
 
 
100
GvcMixerStream *        gvc_mixer_control_lookup_stream_id          (GvcMixerControl *control,
 
101
                                                                     guint            id);
 
102
GvcMixerCard   *        gvc_mixer_control_lookup_card_id            (GvcMixerControl *control,
 
103
                                                                     guint            id);
 
104
GvcMixerUIDevice *      gvc_mixer_control_lookup_output_id          (GvcMixerControl *control,
 
105
                                                                     guint            id);
 
106
GvcMixerUIDevice *      gvc_mixer_control_lookup_input_id           (GvcMixerControl *control,
 
107
                                                                     guint            id);
 
108
GvcMixerUIDevice *      gvc_mixer_control_lookup_device_from_stream (GvcMixerControl *control,
 
109
                                                                     GvcMixerStream *stream);
 
110
 
 
111
GvcMixerStream *        gvc_mixer_control_get_default_sink     (GvcMixerControl *control);
 
112
GvcMixerStream *        gvc_mixer_control_get_default_source   (GvcMixerControl *control);
 
113
GvcMixerStream *        gvc_mixer_control_get_event_sink_input (GvcMixerControl *control);
 
114
 
 
115
gboolean                gvc_mixer_control_set_default_sink     (GvcMixerControl *control,
 
116
                                                                GvcMixerStream  *stream);
 
117
gboolean                gvc_mixer_control_set_default_source   (GvcMixerControl *control,
 
118
                                                                GvcMixerStream  *stream);
 
119
 
 
120
gdouble                 gvc_mixer_control_get_vol_max_norm                  (GvcMixerControl *control);
 
121
gdouble                 gvc_mixer_control_get_vol_max_amplified             (GvcMixerControl *control);
 
122
void                    gvc_mixer_control_change_output                     (GvcMixerControl *control,
 
123
                                                                             GvcMixerUIDevice* output);
 
124
void                    gvc_mixer_control_change_input                      (GvcMixerControl *control,
 
125
                                                                             GvcMixerUIDevice* input);
 
126
GvcMixerStream*         gvc_mixer_control_get_stream_from_device            (GvcMixerControl *control,
 
127
                                                                             GvcMixerUIDevice *dev);
 
128
gboolean                gvc_mixer_control_change_profile_on_selected_device (GvcMixerControl *control,
 
129
                                                                             GvcMixerUIDevice *device,
 
130
                                                                             const gchar* profile);
 
131
 
 
132
GvcMixerControlState gvc_mixer_control_get_state            (GvcMixerControl *control);
 
133
 
 
134
G_END_DECLS
 
135
 
 
136
#endif /* __GVC_MIXER_CONTROL_H */