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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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_class_init (GvcMixerSourceOutputClass *klass)
66
GObjectClass *object_class = G_OBJECT_CLASS (klass);
67
GvcMixerStreamClass *stream_class = GVC_MIXER_STREAM_CLASS (klass);
69
object_class->finalize = gvc_mixer_source_output_finalize;
71
stream_class->push_volume = gvc_mixer_source_output_push_volume;
72
stream_class->change_is_muted = gvc_mixer_source_output_change_is_muted;
74
g_type_class_add_private (klass, sizeof (GvcMixerSourceOutputPrivate));
78
gvc_mixer_source_output_init (GvcMixerSourceOutput *source_output)
80
source_output->priv = GVC_MIXER_SOURCE_OUTPUT_GET_PRIVATE (source_output);
85
gvc_mixer_source_output_finalize (GObject *object)
87
GvcMixerSourceOutput *mixer_source_output;
89
g_return_if_fail (object != NULL);
90
g_return_if_fail (GVC_IS_MIXER_SOURCE_OUTPUT (object));
92
mixer_source_output = GVC_MIXER_SOURCE_OUTPUT (object);
94
g_return_if_fail (mixer_source_output->priv != NULL);
95
G_OBJECT_CLASS (gvc_mixer_source_output_parent_class)->finalize (object);
99
* gvc_mixer_source_output_new: (skip)
108
gvc_mixer_source_output_new (pa_context *context,
110
GvcChannelMap *channel_map)
114
object = g_object_new (GVC_TYPE_MIXER_SOURCE_OUTPUT,
115
"pa-context", context,
117
"channel-map", channel_map,
120
return GVC_MIXER_STREAM (object);