Player Class Reference

List of all members.

Public Member Functions

def __init__
def AppendSearchSelectionToPlaylist
def GetCurrentPlaylist
def GetCurrentTrack
def GetPageLabel
def GetPlayingPlaylist
def GetSongPosAndLength
def GetState
def GotoNextTrack
def IsPaused
def Pause
def RefreshSearch
def RegisterForNotifications
def SaveState
def SetState
def StartPlaying
def UnPause

Private Member Functions

def _onAdd
def _onBus
def _onCloseTab
def _onNew
def _onNotebookKey
def _onPause
def _onPlaylistActivate
def _onQuit
def _onRemove
def _onSearch
def _onSearchActivate
def _onSeek
def _onShuffle
def _onTimer
def _onVolume
def _SendNotification

Private Attributes

 _lasttypingtime
 _mainwin
 _notebook
 _pausebutton
 _playbin
 _playingplaylist
 _searchbox
 _searchresults
 _songprogress
 _tonotify
 _volslider

Detailed Description

The main player. Handles the collection tree and playlists. Manages
GUI not associated with these.

Definition at line 15 of file player.py.


Member Function Documentation

def __init__ (   self  ) 

Definition at line 17 of file player.py.

def _onAdd (   self,
  widget 
) [private]

Callback for Add button.

Definition at line 210 of file player.py.

def _onBus (   self,
  bus,
  msg,
  data 
) [private]

Callback. Handles messages from the gstreamer bus.
Responds to EOS by proceeding to next track.

Definition at line 148 of file player.py.

def _onCloseTab (   self,
  widget 
) [private]

Callback for notebook page close buttons.
Removes the tab in whose title 'widget' is.

Definition at line 345 of file player.py.

def _onNew (   self,
  widget 
) [private]

Callback for the New button. Adds a new notebook page,
and adds the playlist object as data on the page.

Definition at line 323 of file player.py.

def _onNotebookKey (   self,
  widget,
  event 
) [private]

Private callback for typing in the notebook. Modified the current
page's title.

Definition at line 363 of file player.py.

def _onPause (   self,
  widget 
) [private]

Callback for the Pause button. Toggles whether the current song
is paused based on what the button says.

Definition at line 236 of file player.py.

def _onPlaylistActivate (   self,
  widget,
  path,
  column 
) [private]

Callback. Skips to the selected item in the current playlist.

Definition at line 187 of file player.py.

def _onQuit (   self,
  widget 
) [private]

Callback for the close button. Saves state and calls gtk.main_quit().

Definition at line 258 of file player.py.

def _onRemove (   self,
  widget 
) [private]

Callback for the Remove button. Removes the selected tracks
from the current playlist.

Definition at line 292 of file player.py.

def _onSearch (   self,
  widget 
) [private]

Private callback.

Definition at line 163 of file player.py.

def _onSearchActivate (   self,
  widget,
  path,
  column 
) [private]

Callback. Appends selected search results to the current playlist
and starts playing the first.

Definition at line 195 of file player.py.

def _onSeek (   self,
  widget,
  event 
) [private]

Callback for clicking on the song progress bar. Seeks to 
the position in the stream that the user clicked.

Definition at line 301 of file player.py.

def _onShuffle (   self,
  widget 
) [private]

Callback for the Shuffle button. Shuffle the current playlist.

Definition at line 312 of file player.py.

def _onTimer (   self,
  data 
) [private]

Callback. Every second update the progress bar.

Definition at line 278 of file player.py.

def _onVolume (   self,
  widget 
) [private]

Callback for the volume slider. Sets the gstreamer volume
to what the slider says.

Definition at line 245 of file player.py.

def _SendNotification (   self  )  [private]

Private. Dispatch notifications. Call me whenever you change
player state and think someone might be interested.

Definition at line 65 of file player.py.

def AppendSearchSelectionToPlaylist (   self  ) 

Appends the selected search results to the current playlist.
Return an iterator to the first track appended.

Definition at line 202 of file player.py.

def GetCurrentPlaylist (   self  ) 

Returns the Playlist object associated with the currently focussed tab.

Definition at line 339 of file player.py.

def GetCurrentTrack (   self  ) 

Returns the current track or None if there isn't one.

Definition at line 317 of file player.py.

def GetPageLabel (   self,
  page 
)

Returns the gtk.Label for 'page' or None.

Definition at line 358 of file player.py.

def GetPlayingPlaylist (   self  ) 

Returns the playlist containing the currently playing song.

Definition at line 132 of file player.py.

def GetSongPosAndLength (   self  ) 

Returns the position in and length of the current track
in seconds as a tuple.

Definition at line 265 of file player.py.

def GetState (   self  ) 

Returns a representation of the player state suitable for giving
to SetState() thus allowing persistance.
Format is (currenttab,[(label,playliststate)],volume).
TODO - make the bits that peek at private Playlist stuff be a function on Playlist.

Definition at line 71 of file player.py.

def GotoNextTrack (   self  ) 

Move to the next track in the current playlist and start playing it
if possible. Otherwise pause the player.

Definition at line 137 of file player.py.

def IsPaused (   self  ) 

Returns True if the current track is paused.

Definition at line 231 of file player.py.

def Pause (   self  ) 

Pause the currently playing track.

Definition at line 215 of file player.py.

def RefreshSearch (   self  ) 

Refreshes the search results tree using whatever
   is in the search box.

Definition at line 169 of file player.py.

def RegisterForNotifications (   self,
  func 
)

Add a function to the list to call when the state changes.

Definition at line 60 of file player.py.

def SaveState (   self  ) 

Writes out GetState() to 'config.picklefname'

Definition at line 251 of file player.py.

def SetState (   self,
  state 
)

Sets the player state to that represented by 'state' as
produced by GetState().

Definition at line 94 of file player.py.

def StartPlaying (   self  ) 

Starts playing the current track if it exists.

Definition at line 175 of file player.py.

def UnPause (   self  ) 

Resume the currently playing track.

Definition at line 223 of file player.py.


Member Data Documentation

_lasttypingtime [private]

Definition at line 51 of file player.py.

_mainwin [private]

Definition at line 53 of file player.py.

_notebook [private]

Definition at line 33 of file player.py.

_pausebutton [private]

Definition at line 35 of file player.py.

_playbin [private]

Definition at line 43 of file player.py.

_playingplaylist [private]

Definition at line 49 of file player.py.

_searchbox [private]

Definition at line 36 of file player.py.

_searchresults [private]

Definition at line 39 of file player.py.

_songprogress [private]

Definition at line 37 of file player.py.

_tonotify [private]

Definition at line 47 of file player.py.

_volslider [private]

Definition at line 34 of file player.py.


The documentation for this class was generated from the following file:
Generated on Mon Aug 6 21:24:45 2007 for plai by  doxygen 1.5.1