plai Reference Manual

0.9

Generated by Doxygen 1.5.1

Tue May 15 11:08:56 2007

Contents

1 plai Namespace Index  1
1.1 plai Namespace List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 plai Class Index  3
2.1 plai Class List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3 plai File Index  5
3.1 plai File List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4 plai Namespace Documentation  7
4.1 plai Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.2 plai::__init__Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.3 plai::collectiontree Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.4 plai::config Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.5 plai::lyrics Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.6 plai::main Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.7 plai::player Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.8 plai::playlist Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.9 plai::popup Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.10 plai::track Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.11 plai::trayicon Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.12 plai::utility Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5 plai Class Documentation  19
5.1 CollectionTree Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.2 GreyedOut Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.3 Player Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.4 Playlist Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.5 Track Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.6 TrayIcon Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

6 plai File Documentation  41
6.1 __init__.py File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.2 collectiontree.py File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
6.3 config.py File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.4 lyrics.py File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.5 main.py File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6.6 player.py File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
6.7 playlist.py File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.8 popup.py File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6.9 track.py File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.10 trayicon.py File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.11 utility.py File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

Chapter 1

plai Namespace Index

1.1 plai Namespace List

Here is a list of all namespaces with brief descriptions:

plai . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
plai::__init__. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
plai::collectiontree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
plai::config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
plai::lyrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
plai::main . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
plai::player . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
plai::playlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
plai::popup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
plai::track . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
plai::trayicon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
plai::utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

2  plai Namespace Index

Chapter 2

plai Class Index

2.1 plai Class List

Here are the classes, structs, unions and interfaces with brief descriptions:

CollectionTree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
GreyedOut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Player . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Playlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Track . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
TrayIcon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

4  plai Class Index

Chapter 3

plai File Index

3.1 plai File List

Here is a list of all files with brief descriptions:

__init__.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
collectiontree.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
config.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
lyrics.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
main.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
player.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
playlist.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
popup.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
track.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
trayicon.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
utility.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

6  plai File Index

Chapter 4

plai Namespace Documentation

4.1 plai Namespace Reference

Namespaces

• namespace __init__

• namespace collectiontree

• namespace config

• namespace lyrics

• namespace main

• namespace player

• namespace playlist

• namespace popup

• namespace track

• namespace trayicon

• namespace utility

8  plai Namespace Documentation

4.2 plai::__init__Namespace Reference

Generated on Tue May 15 11:08:56 2007 for plai by Doxygen

4.3 plai::collectiontree Namespace Reference

Classes

• class CollectionTree

4.4 plai::config Namespace Reference

Variables

• string gladefname = ’/usr/share/plai/player.glade’

• string gladelyricsfname = ’/usr/share/plai/lyrics.glade’

• string gladeplaylistfname = ’/usr/share/plai/playlist.glade’

• string gladepopupmenufname = ’/usr/share/plai/popupmenu.glade’

• int notebooktitletimeout = 2000

• tuple picklefname = os.path.expanduser(’∼/.plai/playlist.pickle’)

• tuple sqlfname = os.path.expanduser(’∼/.plai/collection.sqlite3’)

4.4.1 Variable Documentation

4.4.1.1 string gladefname = ’/usr/share/plai/player.glade’ [static] Definition at line 5 of file config.py.

4.4.1.2 string gladelyricsfname = ’/usr/share/plai/lyrics.glade’ [static] Definition at line 8 of file config.py.

4.4.1.3 string gladeplaylistfname = ’/usr/share/plai/playlist.glade’ [static] Definition at line 6 of file config.py.

4.4.1.4 string gladepopupmenufname = ’/usr/share/plai/popupmenu.glade’ [static] Definition at line 7 of file config.py.

4.4.1.5 int notebooktitletimeout = 2000 [static] Definition at line 13 of file config.py.

4.4.1.6 tuple picklefname = os.path.expanduser(’∼/.plai/playlist.pickle’) [static] Definition at line 10 of file config.py.

4.4.1.7 tuple sqlfname = os.path.expanduser(’∼/.plai/collection.sqlite3’) [static] Definition at line 9 of file config.py.

Generated on Tue May 15 11:08:56 2007 for plai by Doxygen

4.5 plai::lyrics Namespace Reference

Functions

• def _FixHTML

• def GetLyrics

• def LyricsWindow

Variables

• tuple _entity_re = re.compile(r’&(?:(#)(\d+)|([^{∧};]+));’)

4.5.1 Function Documentation

4.5.1.1 def plai::lyrics::_FixHTML ( html) [private]

Turn HTML codepoints etc into single characters.
taken from http://groups.google.com/group/comp.lang.python/browse_frm/thread/9b7bb3f621b4b8e4

Definition at line 14 of file lyrics.py. 4.5.1.2 def plai::lyrics::GetLyrics ( artist, title)

Block and return song lyrics retreived from lyrc.com.ar or None.

Definition at line 26 of file lyrics.py. 4.5.1.3 def plai::lyrics::LyricsWindow ( lyrics, artist, title)

Pops up a window containing 'lyrics' for 'title' by 'artist'.

Definition at line 53 of file lyrics.py.

4.5.2 Variable Documentation

4.5.2.1 tuple _entity_re = re.compile(r’&(?:(#)(\d+)|([^{∧};]+));’) [static] Definition at line 12 of file lyrics.py.

4.6 plai::main Namespace Reference

Functions

• def main

• def SlowInit

4.6.1 Function Documentation

4.6.1.1 def plai::main::main () Definition at line 36 of file main.py.

4.6.1.2 def plai::main::SlowInit ( player, xml) Definition at line 23 of file main.py.

4.7 plai::player Namespace Reference

Classes

• class Player

14  plai Namespace Documentation

4.8 plai::playlist Namespace Reference

Classes

• class Playlist

4.9 plai::popup Namespace Reference

Functions

• def _onProperties

• def ShowPopup

4.9.1 Function Documentation

4.9.1.1 def plai::popup::_onProperties ( widget, track) [private]

Handler for clicking Properties in the context menu. Shows a dialog
with the filename of the track.

Definition at line 25 of file popup.py.

4.9.1.2 def plai::popup::ShowPopup ( event, track)

Creates a popup context menu for 'track'.

Definition at line 6 of file popup.py.

16  plai Namespace Documentation

4.10 plai::track Namespace Reference

Classes

• class Track

4.11 plai::trayicon Namespace Reference

Classes

• class TrayIcon

4.12 plai::utility Namespace Reference

Classes

• class GreyedOut

Functions

• def PrettyPrintTime

• def ReportError

4.12.1 Function Documentation

4.12.1.1 def plai::utility::PrettyPrintTime ( sec)

Utility function. PrettyPrintTime(63)=='1:03'

Definition at line 3 of file utility.py.

4.12.1.2 def plai::utility::ReportError ( majortext, minortext)

Print out error message and display a corresponding dialog to the user.

Definition at line 8 of file utility.py.

Chapter 5

plai Class Documentation

5.1 CollectionTree Class Reference

Public Member Functions

• def __init__

• def GetSelectedTracks

• def RunQuery

Private Member Functions

• def _appendexpanded

• def _DragData

• def _onClick

Private Attributes

• _dblock
• _store
• _view

5.1.1 Detailed Description

The tree on the left side of the window.
Contains tracks grouped by artist then album.

Definition at line 14 of file collectiontree.py.

5.1.2 Member Function Documentation

20  plai Class Documentation

5.1.2.1 def __init__( self, widget)

Pass me a gtk.TreeView to be in.

Definition at line 16 of file collectiontree.py.

5.1.2.2 def _appendexpanded ( self, its, ret) [private]

Helper function called from GetSelectedTracks. Recurses through the tree.

Definition at line 113 of file collectiontree.py.

5.1.2.3 def _DragData ( self, widget, context, sel, info, time) [private]

Callback for drag and drop. Represents the drag data as a pickled
list of Track objects.

Definition at line 136 of file collectiontree.py.

5.1.2.4 def _onClick ( self, widget, event) [private]

Handler for clicks on collection. Responds to right-click by
popping-up the context menu.

Definition at line 142 of file collectiontree.py.

5.1.2.5 def GetSelectedTracks ( self)

Returns a list of track objects representing what is selected.

Definition at line 125 of file collectiontree.py.

5.1.2.6 def RunQuery ( self, text)

Query the database for tracks matching text and display the results.

Definition at line 43 of file collectiontree.py.

5.1.3 Member Data Documentation

5.1.3.1 _dblock [private] Definition at line 36 of file collectiontree.py.

5.1.3.2 _store [private] Definition at line 24 of file collectiontree.py.

Generated on Tue May 15 11:08:56 2007 for plai by Doxygen

5.1 CollectionTree Class Reference  21

5.1.3.3 _view [private] Definition at line 18 of file collectiontree.py. The documentation for this class was generated from the following file:

• collectiontree.py

5.2 GreyedOut Class Reference

Public Member Functions

• def __enter__

• def __exit__

• def __init__

Private Attributes

• _widget

5.2.1 Detailed Description

For use in a with statement to grey out and then restore a widget.
Overengineering is fun.

Definition at line 19 of file utility.py.

5.2.2 Member Function Documentation

5.2.2.1 def __enter__( self) Definition at line 23 of file utility.py.

5.2.2.2 def __exit__( self, type, value, traceback) Definition at line 26 of file utility.py.

5.2.2.3 def __init__( self, widget) Definition at line 21 of file utility.py.

5.2.3 Member Data Documentation

5.2.3.1 _widget [private] Definition at line 22 of file utility.py. The documentation for this class was generated from the following file:

Generated on Tue May 15 11:08:56 2007 for plai by Doxygen

5.2 GreyedOut Class Reference  23

• utility.py

5.3 Player Class Reference

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

5.3 Player Class Reference  25

Private Attributes

• _lasttypingtime
• _notebook
• _playbin
• _playingplaylist
• _searchresults
• _tonotify
• _xml

5.3.1 Detailed Description

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

Definition at line 13 of file player.py.

5.3.2 Member Function Documentation

5.3.2.1 def __init__( self, xml)

Pass me the glade object with my GUI in.

Definition at line 15 of file player.py.

5.3.2.2 def _onAdd ( self, widget) [private]

Callback for Add button.

Definition at line 183 of file player.py.

5.3.2.3 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 121 of file player.py.

5.3.2.4 def _onCloseTab ( self, widget) [private]

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

Definition at line 315 of file player.py.

Generated on Tue May 15 11:08:56 2007 for plai by Doxygen

26  plai Class Documentation

5.3.2.5 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 293 of file player.py.

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

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

Definition at line 326 of file player.py.

5.3.2.7 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 209 of file player.py.

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

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

Definition at line 160 of file player.py.

5.3.2.9 def _onQuit ( self, widget) [private]

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

Definition at line 231 of file player.py.

5.3.2.10 def _onRemove ( self, widget) [private]

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

Definition at line 262 of file player.py.

5.3.2.11 def _onSearch ( self, widget) [private]

Private callback.

Definition at line 136 of file player.py.

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

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

Definition at line 168 of file player.py.

Generated on Tue May 15 11:08:56 2007 for plai by Doxygen

5.3 Player Class Reference  27

5.3.2.13 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 271 of file player.py.

5.3.2.14 def _onShuffle ( self, widget) [private]

Callback for the Shuffle button. Shuffle the current playlist.

Definition at line 282 of file player.py.

5.3.2.15 def _onTimer ( self, data) [private]

Callback. Every second update the progress bar.

Definition at line 248 of file player.py.

5.3.2.16 def _onVolume ( self, widget) [private]

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

Definition at line 218 of file player.py.

5.3.2.17 def _SendNotification ( self) [private]

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

Definition at line 54 of file player.py.

5.3.2.18 def AppendSearchSelectionToPlaylist ( self)

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

Definition at line 175 of file player.py.

5.3.2.19 def GetCurrentPlaylist ( self)

Returns the Playlist object associated with the currently focussed tab.

Definition at line 309 of file player.py.

5.3.2.20 def GetCurrentTrack ( self)

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

Definition at line 287 of file player.py.

Generated on Tue May 15 11:08:56 2007 for plai by Doxygen

28  plai Class Documentation

5.3.2.21 def GetPageLabel ( self, page)

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

Definition at line 321 of file player.py.

5.3.2.22 def GetPlayingPlaylist ( self)

Returns the playlist containing the currently playing song.

Definition at line 108 of file player.py.

5.3.2.23 def GetSongPosAndLength ( self)

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

Definition at line 237 of file player.py.

5.3.2.24 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 60 of file player.py.

5.3.2.25 def GotoNextTrack ( self)

Move to the next track in the current playlist and start playing it.

Definition at line 113 of file player.py.

5.3.2.26 def IsPaused ( self)

Returns True if the current track is paused.

Definition at line 204 of file player.py.

5.3.2.27 def Pause ( self)

Pause the currently playing track.

Definition at line 188 of file player.py.

5.3.2.28 def RefreshSearch ( self)

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

Definition at line 142 of file player.py.

Generated on Tue May 15 11:08:56 2007 for plai by Doxygen

5.3 Player Class Reference  29

5.3.2.29 def RegisterForNotifications ( self, func)

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

Definition at line 49 of file player.py. 5.3.2.30 def SaveState ( self)

Writes out GetState() to 'config.picklefname'

Definition at line 224 of file player.py. 5.3.2.31 def SetState ( self, state)

Sets the player state to that represented by 'state' as
produced by GetState().
TODO - make the bits that peek at private Playlist stuff be a function on Playlist.

Definition at line 83 of file player.py. 5.3.2.32 def StartPlaying ( self)

Starts playing the current track if it exists.

Definition at line 148 of file player.py. 5.3.2.33 def UnPause ( self)

Resume the currently playing track.

Definition at line 196 of file player.py.

5.3.3 Member Data Documentation

5.3.3.1 _lasttypingtime [private] Definition at line 46 of file player.py. 5.3.3.2 _notebook [private] Definition at line 32 of file player.py. 5.3.3.3 _playbin [private] Definition at line 38 of file player.py.

Generated on Tue May 15 11:08:56 2007 for plai by Doxygen

30  plai Class Documentation

5.3.3.4 _playingplaylist [private] Definition at line 44 of file player.py.

5.3.3.5 _searchresults [private] Definition at line 34 of file player.py.

5.3.3.6 _tonotify [private] Definition at line 42 of file player.py.

5.3.3.7 _xml [private] Definition at line 17 of file player.py. The documentation for this class was generated from the following file:

• player.py

5.4 Playlist Class Reference

Public Member Functions

• def __init__

• def AppendTracks

• def GetCurrentTrack

• def GetSelectedTracks

• def GetState

• def GotoNextTrack

• def RemoveSelected

• def ScrollToCurrent

• def SetCurrentTrack

• def SetState

• def Shuffle

Private Member Functions

• def _DragData

• def _DragReceive

• def _FillAndHighlight

• def _onClick

• def _Refresh

Private Attributes

• _curtrackref
• _store
• _view

5.4.1 Detailed Description

One of the playlists in tabs on the right of the window.

Definition at line 8 of file playlist.py.

5.4.2 Member Function Documentation

5.4.2.1 def __init__( self, widget)

Pass me with a gtk.ListView to be in.

Definition at line 10 of file playlist.py.

32  plai Class Documentation

5.4.2.2 def _DragData ( self, widget, context, sel, info, time) [private]

Callback for drag and drop. Provides a pickled list of Track objects.

Definition at line 164 of file playlist.py.

5.4.2.3 def _DragReceive ( self, widget, context, x, y, sel, info, time) [private]

Callback for drag and drop. Expects drag data to be a pickled
list of Track objects, as provided by CollectionTree.DragData()
or by self.DragData().

Definition at line 129 of file playlist.py.

5.4.2.4 def _FillAndHighlight ( self, col, renderer, model, it, data) [private]

Private, for use by the renderer to extract text from the Track object
and draw the current track highlighted.

Definition at line 86 of file playlist.py.

5.4.2.5 def _onClick ( self, widget, event) [private]

Handler for clicks on playlist. Responds to right-click by
popping-up the context menu.

Definition at line 203 of file playlist.py.

5.4.2.6 def _Refresh ( self) [private]

Forces a redraw (GTK doesn't always know we need one).

Definition at line 72 of file playlist.py.

5.4.2.7 def AppendTracks ( self, tracks)

Appends 'tracks' to the playlist. Returns an iterator to
the first Track appended.

Definition at line 112 of file playlist.py.

5.4.2.8 def GetCurrentTrack ( self)

Returns the current (highlighted) Track object if it
exists, None otherwise.

Definition at line 38 of file playlist.py.

Generated on Tue May 15 11:08:56 2007 for plai by Doxygen

5.4 Playlist Class Reference  33

5.4.2.9 def GetSelectedTracks ( self)

Returns a list of Track objects representing the selected tracks.

Definition at line 157 of file playlist.py.

5.4.2.10 def GetState ( self)

Returns a representation of the playlist's state.
Form is currently ([tracks],currentpath).

Definition at line 169 of file playlist.py.

5.4.2.11 def GotoNextTrack ( self)

Moves onto the next track in the playlist, or sets the current
track to None if the current track is the last one.

Definition at line 77 of file playlist.py.

5.4.2.12 def RemoveSelected ( self)

Removes the currently selected tracks from the playlist.
Returns whether the currently playing track was removed.

Definition at line 186 of file playlist.py.

5.4.2.13 def ScrollToCurrent ( self)

Scroll the playlist until the current track is 1/3 of the way down.

Definition at line 105 of file playlist.py.

5.4.2.14 def SetCurrentTrack ( self, it)

Sets the current track to the one pointed to by the gtk iterator 'it'.
'it' may be None.

Definition at line 45 of file playlist.py.

5.4.2.15 def SetState ( self, state)

Initialises playlist to the state returned by GetState().

Definition at line 177 of file playlist.py.

5.4.2.16 def Shuffle ( self)

Removes everything from the playlist and puts it back in a random order.

Definition at line 58 of file playlist.py.

Generated on Tue May 15 11:08:56 2007 for plai by Doxygen

5.4.3 Member Data Documentation

5.4.3.1 _curtrackref [private] Definition at line 26 of file playlist.py.

5.4.3.2 _store [private] Definition at line 13 of file playlist.py.

5.4.3.3 _view [private] Definition at line 12 of file playlist.py. The documentation for this class was generated from the following file:

• playlist.py

5.5 Track Class Reference

Public Member Functions

• def __init__

• def Album

• def Artist

• def Filename

• def Title

Public Attributes

• highlight

Private Attributes

• _album
• _artist
• _fname
• _title

5.5.1 Detailed Description

Stores information about a track, and whether or not it's highlighted.

Definition at line 1 of file track.py.

5.5.2 Member Function Documentation

5.5.2.1 def __init__( self, fname, title, artist, album)

Definition at line 3 of file track.py.

5.5.2.2 def Album ( self)

Definition at line 15 of file track.py.

5.5.2.3 def Artist ( self)

Definition at line 13 of file track.py.

36  plai Class Documentation

5.5.2.4 def Filename ( self) Definition at line 9 of file track.py.

5.5.2.5 def Title ( self) Definition at line 11 of file track.py.

5.5.3 Member Data Documentation

5.5.3.1 _album [private] Definition at line 6 of file track.py.

5.5.3.2 _artist [private] Definition at line 7 of file track.py.

5.5.3.3 _fname [private] Definition at line 5 of file track.py.

5.5.3.4 _title [private] Definition at line 8 of file track.py.

5.5.3.5 highlight

Definition at line 4 of file track.py. The documentation for this class was generated from the following file:

• track.py

5.6 TrayIcon Class Reference

Public Member Functions

• def __init__

Private Member Functions

• def _onActivate

• def _onMenu

• def _onNext

• def _onNotify

• def _onQuit

• def _Update_icon

• def _UpdateTooltip

Private Attributes

• _icon
• _player
• _xml

5.6.1 Detailed Description

Tray icon, providing ability to pause/resume, skip and quit and a
tooltip with track information.

Definition at line 4 of file trayicon.py.

5.6.2 Member Function Documentation

5.6.2.1 def __init__( self, player, xml)

Pass me the player object so I can communicate, and the glade object
with my menu in.

Definition at line 6 of file trayicon.py.

5.6.2.2 def _onActivate ( self, widget) [private]

Callback to handle direct clicks, either pauses or resumes
the current track.

Definition at line 55 of file trayicon.py.

38  plai Class Documentation

5.6.2.3 def _onMenu ( self, widget, button, time) [private]

Callback to create the context menu.

Definition at line 69 of file trayicon.py.

5.6.2.4 def _onNext ( self, widget) [private]

Callback for the 'Next' menu item.

Definition at line 64 of file trayicon.py.

5.6.2.5 def _onNotify ( self) [private]

Private callback. Updates state.

Definition at line 26 of file trayicon.py.

5.6.2.6 def _onQuit ( self, widget) [private]

Callback for the 'Quit' menu item

Definition at line 78 of file trayicon.py.

5.6.2.7 def _Update_icon ( self) [private]

Private. Updates _icon depending whether the player is currently playing
or paused.

Definition at line 32 of file trayicon.py.

5.6.2.8 def _UpdateTooltip ( self) [private]

Private. Updates tooltip text to reflect the current track.

Definition at line 41 of file trayicon.py.

5.6.3 Member Data Documentation

5.6.3.1 _icon [private] Definition at line 11 of file trayicon.py.

5.6.3.2 _player [private] Definition at line 9 of file trayicon.py.

Generated on Tue May 15 11:08:56 2007 for plai by Doxygen

5.6 TrayIcon Class Reference  39

5.6.3.3 _xml [private] Definition at line 10 of file trayicon.py. The documentation for this class was generated from the following file:

• trayicon.py

40  plai Class Documentation

Chapter 6

plai File Documentation

6.1 __init__.py File Reference

Namespaces

• namespace plai::__init__

6.2 collectiontree.py File Reference

Namespaces

• namespace plai::collectiontree

Classes

• class CollectionTree

6.3 config.py File Reference

Namespaces

• namespace plai::config

Variables

• string gladefname = ’/usr/share/plai/player.glade’

• string gladelyricsfname = ’/usr/share/plai/lyrics.glade’

• string gladeplaylistfname = ’/usr/share/plai/playlist.glade’

• string gladepopupmenufname = ’/usr/share/plai/popupmenu.glade’

• int notebooktitletimeout = 2000

• tuple picklefname = os.path.expanduser(’∼/.plai/playlist.pickle’)

• tuple sqlfname = os.path.expanduser(’∼/.plai/collection.sqlite3’)

6.4 lyrics.py File Reference

Namespaces

• namespace plai::lyrics

Functions

• def _FixHTML

• def GetLyrics

• def LyricsWindow

Variables

• tuple _entity_re = re.compile(r’&(?:(#)(\d+)|([^{∧};]+));’)

6.5 main.py File Reference

Namespaces

• namespace plai::main

Functions

• def main

• def SlowInit

6.6 player.py File Reference

Namespaces

• namespace plai::player

Classes

• class Player

6.7 playlist.py File Reference

Namespaces

• namespace plai::playlist

Classes

• class Playlist

6.8 popup.py File Reference

Namespaces

• namespace plai::popup

Functions

• def _onProperties

• def ShowPopup

6.9 track.py File Reference

Namespaces

• namespace plai::track

Classes

• class Track

6.10 trayicon.py File Reference

Namespaces

• namespace plai::trayicon

Classes

• class TrayIcon

6.11 utility.py File Reference

Namespaces

• namespace plai::utility

Classes

• class GreyedOut

Functions

• def PrettyPrintTime

• def ReportError