~kroq-gar78/ubuntu/precise/gnome-control-center/fix-885947

« back to all changes in this revision

Viewing changes to panels/sound/gvc-mixer-source-output.c

  • Committer: Bazaar Package Importer
  • Author(s): Rodrigo Moya
  • Date: 2011-05-17 10:47:27 UTC
  • mfrom: (0.1.11 experimental) (1.1.45 upstream)
  • Revision ID: james.westby@ubuntu.com-20110517104727-lqel6m8vhfw5jby1
Tags: 1:3.0.1.1-1ubuntu1
* Rebase on Debian, remaining Ubuntu changes:
* debian/control:
  - Build-Depend on hardening-wrapper, dpkg-dev and dh-autoreconf
  - Add dependency on ubuntu-system-service
  - Remove dependency on gnome-icon-theme-symbolic
  - Move dependency on apg, gnome-icon-theme-symbolic and accountsservice to
    be a Recommends: until we get them in main
* debian/rules:
  - Use autoreconf
  - Add binary-post-install rule for gnome-control-center-data
  - Run dh-autoreconf
* debian/gnome-control-center.dirs:
* debian/gnome-control-center.links:
  - Add a link to the control center shell for indicators
* debian/patches/00_disable-nm.patch:
  - Temporary patch to disable building with NetworkManager until we get
    the new one in the archive
* debian/patches/01_git_remove_gettext_calls.patch:
  - Remove calls to AM_GNU_GETTEXT, IT_PROG_INTLTOOL should be enough
* debian/patches/01_git_kill_warning.patch:
  - Kill warning
* debian/patches/50_ubuntu_systemwide_prefs.patch:
  - Ubuntu specific proxy preferences
* debian/patches/51_ubuntu_system_keyboard.patch:
  - Implement the global keyboard spec at https://wiki.ubuntu.com/DefaultKeyboardSettings

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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 void
 
64
gvc_mixer_source_output_class_init (GvcMixerSourceOutputClass *klass)
 
65
{
 
66
        GObjectClass        *object_class = G_OBJECT_CLASS (klass);
 
67
        GvcMixerStreamClass *stream_class = GVC_MIXER_STREAM_CLASS (klass);
 
68
 
 
69
        object_class->finalize = gvc_mixer_source_output_finalize;
 
70
 
 
71
        stream_class->push_volume = gvc_mixer_source_output_push_volume;
 
72
        stream_class->change_is_muted = gvc_mixer_source_output_change_is_muted;
 
73
 
 
74
        g_type_class_add_private (klass, sizeof (GvcMixerSourceOutputPrivate));
 
75
}
 
76
 
 
77
static void
 
78
gvc_mixer_source_output_init (GvcMixerSourceOutput *source_output)
 
79
{
 
80
        source_output->priv = GVC_MIXER_SOURCE_OUTPUT_GET_PRIVATE (source_output);
 
81
 
 
82
}
 
83
 
 
84
static void
 
85
gvc_mixer_source_output_finalize (GObject *object)
 
86
{
 
87
        GvcMixerSourceOutput *mixer_source_output;
 
88
 
 
89
        g_return_if_fail (object != NULL);
 
90
        g_return_if_fail (GVC_IS_MIXER_SOURCE_OUTPUT (object));
 
91
 
 
92
        mixer_source_output = GVC_MIXER_SOURCE_OUTPUT (object);
 
93
 
 
94
        g_return_if_fail (mixer_source_output->priv != NULL);
 
95
        G_OBJECT_CLASS (gvc_mixer_source_output_parent_class)->finalize (object);
 
96
}
 
97
 
 
98
/**
 
99
 * gvc_mixer_source_output_new: (skip)
 
100
 *
 
101
 * @context:
 
102
 * @index:
 
103
 * @channel_map:
 
104
 *
 
105
 * Returns:
 
106
 */
 
107
GvcMixerStream *
 
108
gvc_mixer_source_output_new (pa_context    *context,
 
109
                             guint          index,
 
110
                             GvcChannelMap *channel_map)
 
111
{
 
112
        GObject *object;
 
113
 
 
114
        object = g_object_new (GVC_TYPE_MIXER_SOURCE_OUTPUT,
 
115
                               "pa-context", context,
 
116
                               "index", index,
 
117
                               "channel-map", channel_map,
 
118
                               NULL);
 
119
 
 
120
        return GVC_MIXER_STREAM (object);
 
121
}