~ubuntu-branches/ubuntu/wily/mate-settings-daemon/wily

« back to all changes in this revision

Viewing changes to plugins/media-keys/cut-n-paste/gvc-mixer-source-output.c

  • Committer: Package Import Robot
  • Author(s): John Paul Adrian Glaubitz, Martin Wimpress, John Paul Adrian Glaubitz
  • Date: 2015-08-16 16:35:32 UTC
  • mfrom: (10.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20150816163532-34zcev57w1c1bbv6
Tags: 1.10.1-1
[ Martin Wimpress ]
* debian/rules:
  + Remove obsolete build options.

[ John Paul Adrian Glaubitz ]
* Fix minor typo in debian/control (missing hyphen).
* Upload to unstable.

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 William Jon McCann
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
18
 
 *
19
 
 */
20
 
 
21
 
#include "config.h"
22
 
 
23
 
#include <stdlib.h>
24
 
#include <stdio.h>
25
 
#include <unistd.h>
26
 
 
27
 
#include <glib.h>
28
 
#include <glib/gi18n-lib.h>
29
 
 
30
 
#include <pulse/pulseaudio.h>
31
 
 
32
 
#include "gvc-mixer-source-output.h"
33
 
 
34
 
#define GVC_MIXER_SOURCE_OUTPUT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GVC_TYPE_MIXER_SOURCE_OUTPUT, GvcMixerSourceOutputPrivate))
35
 
 
36
 
struct GvcMixerSourceOutputPrivate
37
 
{
38
 
        gpointer dummy;
39
 
};
40
 
 
41
 
static void     gvc_mixer_source_output_class_init (GvcMixerSourceOutputClass *klass);
42
 
static void     gvc_mixer_source_output_init       (GvcMixerSourceOutput      *mixer_source_output);
43
 
static void     gvc_mixer_source_output_finalize   (GObject            *object);
44
 
 
45
 
G_DEFINE_TYPE (GvcMixerSourceOutput, gvc_mixer_source_output, GVC_TYPE_MIXER_STREAM)
46
 
 
47
 
static gboolean
48
 
gvc_mixer_source_output_push_volume (GvcMixerStream *stream, gpointer *op)
49
 
{
50
 
        /* FIXME: */
51
 
        *op = NULL;
52
 
        return TRUE;
53
 
}
54
 
 
55
 
static gboolean
56
 
gvc_mixer_source_output_change_is_muted (GvcMixerStream *stream,
57
 
                                      gboolean        is_muted)
58
 
{
59
 
        /* FIXME: */
60
 
        return TRUE;
61
 
}
62
 
 
63
 
static GObject *
64
 
gvc_mixer_source_output_constructor (GType                  type,
65
 
                                  guint                  n_construct_properties,
66
 
                                  GObjectConstructParam *construct_params)
67
 
{
68
 
        GObject       *object;
69
 
        GvcMixerSourceOutput *self;
70
 
 
71
 
        object = G_OBJECT_CLASS (gvc_mixer_source_output_parent_class)->constructor (type, n_construct_properties, construct_params);
72
 
 
73
 
        self = GVC_MIXER_SOURCE_OUTPUT (object);
74
 
 
75
 
        return object;
76
 
}
77
 
 
78
 
static void
79
 
gvc_mixer_source_output_class_init (GvcMixerSourceOutputClass *klass)
80
 
{
81
 
        GObjectClass        *object_class = G_OBJECT_CLASS (klass);
82
 
        GvcMixerStreamClass *stream_class = GVC_MIXER_STREAM_CLASS (klass);
83
 
 
84
 
        object_class->constructor = gvc_mixer_source_output_constructor;
85
 
        object_class->finalize = gvc_mixer_source_output_finalize;
86
 
 
87
 
        stream_class->push_volume = gvc_mixer_source_output_push_volume;
88
 
        stream_class->change_is_muted = gvc_mixer_source_output_change_is_muted;
89
 
 
90
 
        g_type_class_add_private (klass, sizeof (GvcMixerSourceOutputPrivate));
91
 
}
92
 
 
93
 
static void
94
 
gvc_mixer_source_output_init (GvcMixerSourceOutput *source_output)
95
 
{
96
 
        source_output->priv = GVC_MIXER_SOURCE_OUTPUT_GET_PRIVATE (source_output);
97
 
 
98
 
}
99
 
 
100
 
static void
101
 
gvc_mixer_source_output_finalize (GObject *object)
102
 
{
103
 
        GvcMixerSourceOutput *mixer_source_output;
104
 
 
105
 
        g_return_if_fail (object != NULL);
106
 
        g_return_if_fail (GVC_IS_MIXER_SOURCE_OUTPUT (object));
107
 
 
108
 
        mixer_source_output = GVC_MIXER_SOURCE_OUTPUT (object);
109
 
 
110
 
        g_return_if_fail (mixer_source_output->priv != NULL);
111
 
        G_OBJECT_CLASS (gvc_mixer_source_output_parent_class)->finalize (object);
112
 
}
113
 
 
114
 
GvcMixerStream *
115
 
gvc_mixer_source_output_new (pa_context    *context,
116
 
                             guint          index,
117
 
                             GvcChannelMap *channel_map)
118
 
{
119
 
        GObject *object;
120
 
 
121
 
        object = g_object_new (GVC_TYPE_MIXER_SOURCE_OUTPUT,
122
 
                               "pa-context", context,
123
 
                               "index", index,
124
 
                               "channel-map", channel_map,
125
 
                               NULL);
126
 
 
127
 
        return GVC_MIXER_STREAM (object);
128
 
}