Repository navigation
Backend Design
monodeldiablo edited this page Sep 13, 2010
·
3 revisions
hum-player is a DBus service that implements an interface for playlist management and playback. It is (to the best of my knowledge) stable and robust. hum-player’s API is outlined below:
All hum-player methods are located under the /org/washedup/Hum object path, as part of the org.washedup.Hum interface.
-
Quit()– Frees resources and shuts down thehum-playerback end, notifying clients with theExiting()signal first.
-
AddTrack(String uri, Int32 position)– Adds the track aturito the playlist in positionposition. Ifpositionis-1, the track is appended to the end of the playlist. -
RemoveTrack(Int32 position)– Removes the track atposition. -
ClearPlaylist()– Removes all tracks from the playlist.
-
GetPlaylist() -> (Array of [String] uris)– Returns the list, in order, of URIs in the playlist. -
GetCurrentTrack() -> (Int32 position)– Returns the currently active track number. -
GetCurrentUri() -> (String uri)– Returns the currently active URI.
-
Play(Int32 position)– Plays the track atposition. Ifpositionis-1, plays the currently active track. -
Pause()– Pauses the currently playing track. -
Previous()– Changes the current track to the track previous. If the current track is the first track, makes the last track in the list the current track (ifGetRepeat()istrue). -
Next()– Changes the current track to the next track. If the current track is the last track, makes the first track in the playlist the current track (ifGetRepeat ()istrue). -
Seek(Int64 usec)– Seeks the currently playing track tousecmicroseconds. -
Stop()– Stops the currently playing track and sets the first track in the playlist to be the current track.
-
GetProgress() -> (Int64 usec)– Returns the current playback position of the current track.
-
SetRepeat(Boolean do_repeat)– Sets the playlist to loop continuously. -
SetShuffle(Boolean do_shuffle)– Sets the playlist to randomly select tracks for playback. -
SetVolume(Int32 level)– Sets the playback volume (NOTE! This is currently non-functional).
-
GetPlaybackStatus() -> (String status)– Returns the current GStreamer playback state (one ofNULL,READY,PLAYING, orPAUSED). -
GetRepeat() -> (Boolean do_repeat)– Returns the current playlist loop setting. -
GetShuffle() -> (Boolean do_shuffle)– Returns the current playlist shuffle setting. -
GetVolume() - (Int32 level)– Returns the current volume setting (NOTE! This is currently non-functional).
-
Exiting()– Notifies clients that the service is shutting down.
-
TrackAdded(String uri, Int32 position)– Indicates that a new track with URI ofurihas been added to the playlist atposition. -
TrackRemoved(Int32 position)– Indicates that the track atpositionhas been removed from the playlist. -
PlaylistCleared()– Indicates that the playlist has been cleared of all tracks.
-
PlayingTrack(Int32 position)– Indicates that the track atpositionhas begun playing. -
PausedPlayback()– Indicates that playback for the current track has been paused. -
Seeked(Int64 usec)– Indicates that the current track has been seeked tousec. -
StoppedPlayback()– Indicates that playback has been stopped and the current track reset to the first in the playlist.
-
RepeatToggled(Boolean do_repeat)– Indicates that the playlist loop setting has been changed. -
ShuffleToggled(Boolean do_shuffle)– Indicates that the playlist shuffle setting has been changed.