Skip to content
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:

Methods

All hum-player methods are located under the /org/washedup/Hum object path, as part of the org.washedup.Hum interface.

Service Management

  • Quit() – Frees resources and shuts down the hum-player back end, notifying clients with the Exiting() signal first.

Playlist Management

  • AddTrack(String uri, Int32 position) – Adds the track at uri to the playlist in position position. If position is -1, the track is appended to the end of the playlist.
  • RemoveTrack(Int32 position) – Removes the track at position.
  • ClearPlaylist() – Removes all tracks from the playlist.

Playlist Inspection

  • 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.

Playback Management

  • Play(Int32 position) – Plays the track at position. If position is -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 (if GetRepeat() is true).
  • 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 (if GetRepeat () is true).
  • Seek(Int64 usec) – Seeks the currently playing track to usec microseconds.
  • Stop() – Stops the currently playing track and sets the first track in the playlist to be the current track.

Playback Inspection

  • GetProgress() -> (Int64 usec) – Returns the current playback position of the current track.

Playback State Management

  • 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).

Playback State Inspeaction

  • GetPlaybackStatus() -> (String status) – Returns the current GStreamer playback state (one of NULL, READY, PLAYING, or PAUSED).
  • 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).

Signals

Service Information

  • Exiting() – Notifies clients that the service is shutting down.

Playlist Information

  • TrackAdded(String uri, Int32 position) – Indicates that a new track with URI of uri has been added to the playlist at position.
  • TrackRemoved(Int32 position) – Indicates that the track at position has been removed from the playlist.
  • PlaylistCleared() – Indicates that the playlist has been cleared of all tracks.

Playback Information

  • PlayingTrack(Int32 position) – Indicates that the track at position has begun playing.
  • PausedPlayback() – Indicates that playback for the current track has been paused.
  • Seeked(Int64 usec) – Indicates that the current track has been seeked to usec.
  • StoppedPlayback() – Indicates that playback has been stopped and the current track reset to the first in the playlist.

Playback State Information

  • 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.