~indicator-applet-developers/indicator-sound/trunk.16.04

« back to all changes in this revision

Viewing changes to src/sound-service.h

  • Committer: Conor Curran
  • Date: 2010-01-27 13:21:02 UTC
  • Revision ID: conor.curran@canonical.com-20100127132102-xc5w5ob5kei1iblb
copied contents from lp:~cjcurran/wasilla/soundmenu without the noise

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __INCLUDE_SOUND_SERVICE_H__
 
2
#define __INCLUDE_SOUND_SERVICE_H__
 
3
 
 
4
/*
 
5
This service primarily controls PulseAudio and is driven by the sound indicator menu on the panel.
 
6
Copyright 2010 Canonical Ltd.
 
7
 
 
8
Authors:
 
9
    Conor Curran <conor.curran@canonical.com>
 
10
    Ted Gould <ted@canonical.com>
 
11
    Christoph Korn <c_korn@gmx.de>
 
12
    Cody Russell <crussell@canonical.com>
 
13
 
 
14
This program is free software: you can redistribute it and/or modify it 
 
15
under the terms of the GNU General Public License version 3, as published 
 
16
by the Free Software Foundation.
 
17
 
 
18
This program is distributed in the hope that it will be useful, but 
 
19
WITHOUT ANY WARRANTY; without even the implied warranties of 
 
20
MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 
 
21
PURPOSE.  See the GNU General Public License for more details.
 
22
 
 
23
You should have received a copy of the GNU General Public License along 
 
24
with this program.  If not, see <http://www.gnu.org/licenses/>.
 
25
*/
 
26
 
 
27
#include <config.h>
 
28
#include <unistd.h>
 
29
#include <glib/gi18n.h>
 
30
 
 
31
#include <dbus/dbus-glib.h>
 
32
#include <dbus/dbus-glib-bindings.h>
 
33
 
 
34
#include <libdbusmenu-glib/server.h>
 
35
#include <libdbusmenu-glib/menuitem.h>
 
36
#include <libdbusmenu-glib/client.h>
 
37
 
 
38
#include <libindicator/indicator-service.h>
 
39
 
 
40
#include <pulse/pulseaudio.h>
 
41
#include <pulse/glib-mainloop.h>
 
42
#include <pulse/error.h>
 
43
#include <pulse/gccmacro.h>
 
44
 
 
45
#include "dbus-shared-names.h"
 
46
 
 
47
// GTK + DBUS
 
48
static GMainLoop * mainloop = NULL;
 
49
static DbusmenuMenuitem * root_menuitem = NULL;
 
50
static DbusmenuMenuitem * mute_all_menuitem = NULL;
 
51
static SoundServiceDbus * dbus_interface = NULL;
 
52
 
 
53
// PULSEAUDIO
 
54
static pa_context *pulse_context = NULL;
 
55
static pa_glib_mainloop *pa_main_loop = NULL;
 
56
static GPtrArray* sink_list = NULL;
 
57
static gboolean sink_available = TRUE;
 
58
 
 
59
static void context_state_callback(pa_context *c, void *userdata);
 
60
static gboolean idle_routine (gpointer data);
 
61
static void rebuild_sound_menu(DbusmenuMenuitem *root, SoundServiceDbus *service);
 
62
 
 
63
static gboolean all_muted = FALSE;
 
64
static void set_global_mute();
 
65
 
 
66
// ENTRY AND EXIT POINTS
 
67
void service_shutdown(IndicatorService * service, gpointer user_data);
 
68
int main (int argc, char ** argv);
 
69
 
 
70
#endif
 
71