2 * arch-tag: Header for object implementing main playback logic
4 * Copyright (C) 2002 Jorn Baayen <jorn@nl.linux.org>
5 * Copyright (C) 2003,2004 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.
23 #include <gtk/gtkhbox.h>
24 #include <gtk/gtkuimanager.h>
25 #include <gtk/gtkactiongroup.h>
27 #include "rb-source.h"
30 #ifndef __RB_SHELL_PLAYER_H
31 #define __RB_SHELL_PLAYER_H
35 #define RB_TYPE_SHELL_PLAYER (rb_shell_player_get_type ())
36 #define RB_SHELL_PLAYER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), RB_TYPE_SHELL_PLAYER, RBShellPlayer))
37 #define RB_SHELL_PLAYER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), RB_TYPE_SHELL_PLAYER, RBShellPlayerClass))
38 #define RB_IS_SHELL_PLAYER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), RB_TYPE_SHELL_PLAYER))
39 #define RB_IS_SHELL_PLAYER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), RB_TYPE_SHELL_PLAYER))
40 #define RB_SHELL_PLAYER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), RB_TYPE_SHELL_PLAYER, RBShellPlayerClass))
44 RB_SHELL_PLAYER_ERROR_PLAYLIST_PARSE_ERROR
,
45 RB_SHELL_PLAYER_ERROR_END_OF_PLAYLIST
,
46 RB_SHELL_PLAYER_ERROR_NOT_PLAYING
,
47 RB_SHELL_PLAYER_ERROR_NOT_SEEKABLE
,
50 GType
rb_shell_player_error_get_type (void);
51 #define RB_TYPE_SHELL_PLAYER_ERROR (rb_shell_player_error_get_type())
53 #define RB_SHELL_PLAYER_ERROR rb_shell_player_error_quark ()
55 GQuark
rb_shell_player_error_quark (void);
57 typedef struct RBShellPlayerPrivate RBShellPlayerPrivate
;
63 RBShellPlayerPrivate
*priv
;
68 GtkHBoxClass parent_class
;
70 void (*window_title_changed
) (RBShellPlayer
*player
, const char *window_title
);
71 void (*elapsed_changed
) (RBShellPlayer
*player
, guint elapsed
);
72 void (*playing_changed
) (RBShellPlayer
*player
, gboolean playing
);
73 void (*playing_source_changed
) (RBShellPlayer
*player
, RBSource
*source
);
74 void (*playing_uri_changed
) (RBShellPlayer
*player
, const char *uri
);
75 void (*playing_song_changed
) (RBShellPlayer
*player
, RhythmDBEntry
*entry
);
76 void (*playing_song_property_changed
) (RBShellPlayer
*player
,
83 GType
rb_shell_player_get_type (void);
85 RBShellPlayer
* rb_shell_player_new (RhythmDB
*db
,
87 GtkActionGroup
*actiongroup
);
89 void rb_shell_player_set_selected_source (RBShellPlayer
*shell_player
,
91 void rb_shell_player_set_playing_source (RBShellPlayer
*player
,
94 RBSource
* rb_shell_player_get_playing_source (RBShellPlayer
*shell_player
);
95 RBSource
* rb_shell_player_get_active_source (RBShellPlayer
*shell_player
);
97 void rb_shell_player_jump_to_current (RBShellPlayer
*player
);
99 void rb_shell_player_play_entry (RBShellPlayer
*player
,
100 RhythmDBEntry
*entry
,
102 gboolean
rb_shell_player_play (RBShellPlayer
*player
, GError
**error
);
103 gboolean
rb_shell_player_pause (RBShellPlayer
*player
, GError
**error
);
104 gboolean
rb_shell_player_playpause (RBShellPlayer
*player
, gboolean unused
, GError
**error
);
105 void rb_shell_player_stop (RBShellPlayer
*player
);
106 gboolean
rb_shell_player_do_previous (RBShellPlayer
*player
, GError
**error
);
107 gboolean
rb_shell_player_do_next (RBShellPlayer
*player
, GError
**error
);
109 char * rb_shell_player_get_playing_time_string (RBShellPlayer
*player
);
110 gboolean
rb_shell_player_get_playing_time(RBShellPlayer
*player
,
113 gboolean
rb_shell_player_set_playing_time(RBShellPlayer
*player
,
116 void rb_shell_player_seek (RBShellPlayer
*player
, long offset
);
117 long rb_shell_player_get_playing_song_duration (RBShellPlayer
*player
);
119 gboolean
rb_shell_player_get_playing (RBShellPlayer
*shell_player
,
123 gboolean
rb_shell_player_get_playing_path(RBShellPlayer
*shell_player
,
127 void rb_shell_player_set_playback_state(RBShellPlayer
*player
,
128 gboolean shuffle
, gboolean repeat
);
130 gboolean
rb_shell_player_get_playback_state(RBShellPlayer
*player
,
134 RhythmDBEntry
* rb_shell_player_get_playing_entry (RBShellPlayer
*player
);
136 void rb_shell_player_toggle_mute (RBShellPlayer
*player
);
138 gboolean
rb_shell_player_set_volume (RBShellPlayer
*player
,
142 gboolean
rb_shell_player_get_volume (RBShellPlayer
*player
,
146 gboolean
rb_shell_player_set_volume_relative (RBShellPlayer
*player
,
150 gboolean
rb_shell_player_set_mute (RBShellPlayer
*player
,
154 gboolean
rb_shell_player_get_mute (RBShellPlayer
*player
,
160 #endif /* __RB_SHELL_PLAYER_H */