1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
3
* Copyright (C) 2008 William Jon McCann
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.
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.
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.
28
#include <glib/gi18n-lib.h>
30
#include <pulse/pulseaudio.h>
32
#include "gvc-mixer-source-output.h"
34
#define GVC_MIXER_SOURCE_OUTPUT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GVC_TYPE_MIXER_SOURCE_OUTPUT, GvcMixerSourceOutputPrivate))
36
struct GvcMixerSourceOutputPrivate
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);
45
G_DEFINE_TYPE (GvcMixerSourceOutput, gvc_mixer_source_output, GVC_TYPE_MIXER_STREAM)
48
gvc_mixer_source_output_push_volume (GvcMixerStream *stream, gpointer *op)
56
gvc_mixer_source_output_change_is_muted (GvcMixerStream *stream,
64
gvc_mixer_source_output_constructor (GType type,
65
guint n_construct_properties,
66
GObjectConstructParam *construct_params)
69
GvcMixerSourceOutput *self;
71
object = G_OBJECT_CLASS (gvc_mixer_source_output_parent_class)->constructor (type, n_construct_properties, construct_params);
73
self = GVC_MIXER_SOURCE_OUTPUT (object);
79
gvc_mixer_source_output_class_init (GvcMixerSourceOutputClass *klass)
81
GObjectClass *object_class = G_OBJECT_CLASS (klass);
82
GvcMixerStreamClass *stream_class = GVC_MIXER_STREAM_CLASS (klass);
84
object_class->constructor = gvc_mixer_source_output_constructor;
85
object_class->finalize = gvc_mixer_source_output_finalize;
87
stream_class->push_volume = gvc_mixer_source_output_push_volume;
88
stream_class->change_is_muted = gvc_mixer_source_output_change_is_muted;
90
g_type_class_add_private (klass, sizeof (GvcMixerSourceOutputPrivate));
94
gvc_mixer_source_output_init (GvcMixerSourceOutput *source_output)
96
source_output->priv = GVC_MIXER_SOURCE_OUTPUT_GET_PRIVATE (source_output);
101
gvc_mixer_source_output_finalize (GObject *object)
103
GvcMixerSourceOutput *mixer_source_output;
105
g_return_if_fail (object != NULL);
106
g_return_if_fail (GVC_IS_MIXER_SOURCE_OUTPUT (object));
108
mixer_source_output = GVC_MIXER_SOURCE_OUTPUT (object);
110
g_return_if_fail (mixer_source_output->priv != NULL);
111
G_OBJECT_CLASS (gvc_mixer_source_output_parent_class)->finalize (object);
115
gvc_mixer_source_output_new (pa_context *context,
117
GvcChannelMap *channel_map)
121
object = g_object_new (GVC_TYPE_MIXER_SOURCE_OUTPUT,
122
"pa-context", context,
124
"channel-map", channel_map,
127
return GVC_MIXER_STREAM (object);