2
* arch-tag: Interface to audio backend
4
* Copyright (C) 2003 Jorn Baayen <jorn@nl.linux.org>
5
* Copyright (C) 2003 Colin Walters <walters@verbum.org>
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
26
#include <glib-object.h>
27
#include "rb-metadata.h"
33
RB_PLAYER_ERROR_NO_AUDIO,
34
RB_PLAYER_ERROR_GENERAL,
35
RB_PLAYER_ERROR_INTERNAL
38
#define RB_PLAYER_ERROR rb_player_error_quark ()
40
GQuark rb_player_error_quark (void);
42
#define RB_TYPE_PLAYER (rb_player_get_type ())
43
#define RB_PLAYER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), RB_TYPE_PLAYER, RBPlayer))
44
#define RB_IS_PLAYER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), RB_TYPE_PLAYER))
45
#define RB_PLAYER_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), RB_TYPE_PLAYER, RBPlayerIface))
47
typedef struct _RBPlayer RBPlayer;
51
GTypeInterface g_iface;
53
/* virtual functions */
54
gboolean (*open) (RBPlayer *player,
57
gboolean (*opened) (RBPlayer *player);
58
gboolean (*close) (RBPlayer *player,
61
gboolean (*play) (RBPlayer *player,
63
void (*pause) (RBPlayer *player);
64
gboolean (*playing) (RBPlayer *player);
66
void (*set_volume) (RBPlayer *player,
68
float (*get_volume) (RBPlayer *player);
69
void (*set_replaygain) (RBPlayer *player,
75
gboolean (*seekable) (RBPlayer *player);
76
void (*set_time) (RBPlayer *player,
78
long (*get_time) (RBPlayer *player);
81
void (*eos) (RBPlayer *player);
82
void (*info) (RBPlayer *player,
83
RBMetaDataField field,
85
void (*buffering) (RBPlayer *player,
87
void (*error) (RBPlayer *player,
89
void (*tick) (RBPlayer *player,
93
GType rb_player_get_type (void);
94
RBPlayer * rb_player_new (GError **error);
96
gboolean rb_player_open (RBPlayer *player,
99
gboolean rb_player_opened (RBPlayer *player);
100
gboolean rb_player_close (RBPlayer *player, GError **error);
102
gboolean rb_player_play (RBPlayer *player, GError **error);
103
void rb_player_pause (RBPlayer *player);
104
gboolean rb_player_playing (RBPlayer *player);
106
void rb_player_set_volume (RBPlayer *player, float volume);
107
float rb_player_get_volume (RBPlayer *player);
108
void rb_player_set_replaygain (RBPlayer *player,
109
double track_gain, double track_peak,
110
double album_gain, double album_peak);
112
gboolean rb_player_seekable (RBPlayer *player);
113
void rb_player_set_time (RBPlayer *player, long time);
114
long rb_player_get_time (RBPlayer *player);
117
/* only to be used by subclasses */
118
void _rb_player_emit_eos (RBPlayer *player);
119
void _rb_player_emit_info (RBPlayer *player, RBMetaDataField field, GValue *value);
120
void _rb_player_emit_buffering (RBPlayer *player, guint progress);
121
void _rb_player_emit_error (RBPlayer *player, GError *error);
122
void _rb_player_emit_tick (RBPlayer *player, long elapsed);
126
#endif /* __RB_PLAYER_H */