1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
/* mpris-controller-v2.c generated by valac, the Vala compiler
* generated from mpris-controller-v2.vala, do not modify */
/*
This service primarily controls PulseAudio and is driven by the sound indicator menu on the panel.
Copyright 2010 Canonical Ltd.
Authors:
Conor Curran <conor.curran@canonical.com>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License version 3, as published
by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranties of
MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <glib.h>
#include <glib-object.h>
#include <dbus/dbus-glib-lowlevel.h>
#include <dbus/dbus-glib.h>
#include <stdlib.h>
#include <string.h>
#define TYPE_MPRIS_CONTROLLER (mpris_controller_get_type ())
#define MPRIS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_CONTROLLER, MprisController))
#define MPRIS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS_CONTROLLER, MprisControllerClass))
#define IS_MPRIS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_CONTROLLER))
#define IS_MPRIS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS_CONTROLLER))
#define MPRIS_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS_CONTROLLER, MprisControllerClass))
typedef struct _MprisController MprisController;
typedef struct _MprisControllerClass MprisControllerClass;
typedef struct _MprisControllerPrivate MprisControllerPrivate;
#define TYPE_MPRIS_CONTROLLER_V2 (mpris_controller_v2_get_type ())
#define MPRIS_CONTROLLER_V2(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_CONTROLLER_V2, MprisControllerV2))
#define MPRIS_CONTROLLER_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS_CONTROLLER_V2, MprisControllerV2Class))
#define IS_MPRIS_CONTROLLER_V2(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_CONTROLLER_V2))
#define IS_MPRIS_CONTROLLER_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS_CONTROLLER_V2))
#define MPRIS_CONTROLLER_V2_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS_CONTROLLER_V2, MprisControllerV2Class))
typedef struct _MprisControllerV2 MprisControllerV2;
typedef struct _MprisControllerV2Class MprisControllerV2Class;
typedef struct _MprisControllerV2Private MprisControllerV2Private;
#define TYPE_PLAYER_CONTROLLER (player_controller_get_type ())
#define PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_CONTROLLER, PlayerController))
#define PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
#define IS_PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_CONTROLLER))
#define IS_PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_CONTROLLER))
#define PLAYER_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
typedef struct _PlayerController PlayerController;
typedef struct _PlayerControllerClass PlayerControllerClass;
struct _MprisController {
GObject parent_instance;
MprisControllerPrivate * priv;
DBusGProxy* mpris_player;
};
struct _MprisControllerClass {
GObjectClass parent_class;
};
struct _MprisControllerV2 {
MprisController parent_instance;
MprisControllerV2Private * priv;
};
struct _MprisControllerV2Class {
MprisControllerClass parent_class;
};
static gpointer mpris_controller_v2_parent_class = NULL;
GType mpris_controller_get_type (void);
GType mpris_controller_v2_get_type (void);
enum {
MPRIS_CONTROLLER_V2_DUMMY_PROPERTY
};
GType player_controller_get_type (void);
MprisController* mpris_controller_new (const char* name, PlayerController* controller, const char* mpris_interface);
MprisController* mpris_controller_construct (GType object_type, const char* name, PlayerController* controller, const char* mpris_interface);
MprisControllerV2* mpris_controller_v2_new (const char* name, PlayerController* controller);
MprisControllerV2* mpris_controller_v2_construct (GType object_type, const char* name, PlayerController* controller);
MprisControllerV2* mpris_controller_v2_construct (GType object_type, const char* name, PlayerController* controller) {
MprisControllerV2 * self;
g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (controller != NULL, NULL);
self = (MprisControllerV2*) mpris_controller_construct (object_type, name, controller, "org.mpris.MediaPlayer.Player");
return self;
}
MprisControllerV2* mpris_controller_v2_new (const char* name, PlayerController* controller) {
return mpris_controller_v2_construct (TYPE_MPRIS_CONTROLLER_V2, name, controller);
}
static void mpris_controller_v2_class_init (MprisControllerV2Class * klass) {
mpris_controller_v2_parent_class = g_type_class_peek_parent (klass);
}
static void mpris_controller_v2_instance_init (MprisControllerV2 * self) {
}
GType mpris_controller_v2_get_type (void) {
static volatile gsize mpris_controller_v2_type_id__volatile = 0;
if (g_once_init_enter (&mpris_controller_v2_type_id__volatile)) {
static const GTypeInfo g_define_type_info = { sizeof (MprisControllerV2Class), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) mpris_controller_v2_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MprisControllerV2), 0, (GInstanceInitFunc) mpris_controller_v2_instance_init, NULL };
GType mpris_controller_v2_type_id;
mpris_controller_v2_type_id = g_type_register_static (TYPE_MPRIS_CONTROLLER, "MprisControllerV2", &g_define_type_info, 0);
g_once_init_leave (&mpris_controller_v2_type_id__volatile, mpris_controller_v2_type_id);
}
return mpris_controller_v2_type_id__volatile;
}
|