Commit Graph

60 Commits

Author SHA1 Message Date
Bryan Schumaker
e3327093ad libsaria/xm.py
xm.py contains helpful xml parsing functions that we can use for
decoding last.fm requests.
2010-10-26 22:39:04 -04:00
Bryan Schumaker
3b92b00d87 Cache should check for success of func()
We return after checking if the fetcher function succeeds.  To do this
properly, we should store the value we get so that the cached file can
be closed before returning.
2010-10-26 22:33:28 -04:00
Bryan Schumaker
b204743e1b Print iterations
For now, print the number of iterations it takes to choose a song at
random.
2010-10-26 22:30:01 -04:00
Bryan Schumaker
5cf837aee2 Library update
I no longer reset the library before scanning.  This allows me to do a
basic form of updating.  Unfortunately, I have to manually select the
same directory to update it.  Eventually I should find a way of
automating library updates.
2010-10-25 21:58:18 -04:00
Bryan Schumaker
c35f210369 Playlist random improvements
I now keep track of the last 15 songs played.  If a song with the same
(artist, title) as one of the songs in the list attempts to play, we
skip it.

Songs with a negative score have a (20 * score) + 100 per cent chance of
playing.  When score is -5, the song should never play.

I used to try to find a song 5 times before giving up and playing the
song with the current id.  I have upped the threshold to 15.
2010-10-25 20:33:22 -04:00
Bryan Schumaker
43eab40b01 Uninvite functions on error
If a function responding to an event has an unhandled exception, we
print a message telling what went wrong and that the function has been
uninvited.  However, I never actually uninvite the function from the
event.  I have now added in a call to uninvite() before printing the
message.
2010-10-25 09:48:24 -04:00
Bryan Schumaker
b69e790186 Cache attempt to close file
Attempt to close the file passed to the get callback function.  Closing
is the right thing to do, but it is possible that the user will close it
before returning..
2010-10-25 09:08:14 -04:00
Bryan Schumaker
5c842def01 Generic cache
I have created a generic cache to hold information outside of the
library.  This could include album art or an artist bio.
2010-10-24 17:26:53 -04:00
Bryan Schumaker
4f371987a0 Version strings
Libsaria and Ocarina have a __vers__ variable.  This contains a string
with the official version (eg. "Ocarina 4.1-dev" or "Libsaria 1.1").
"-dev" means that there have been changes since the last official
version.
2010-10-24 17:22:24 -04:00
Bryan Schumaker
3671b01e84 universal_open bug
After installing a plugin, universal_open() should return rather than
continue on.
2010-10-24 17:12:01 -04:00
Bryan Schumaker
b7efda1d80 Added version variables
libsaria is now known as libsaria version 1.1.
ocarina  is now known as ocarina  version 4.1.
Both are still under development (__dev__ == True)
2010-10-23 20:17:25 -04:00
Bryan Schumaker
9603e4cef0 Forward / Rewind buttons
I have created forward and rewind buttons to draw on the info bar.  In
addition, I have created seek_sec() to seek the song by X seconds.
Right now, the seek buttons add +/- 5 seconds to the current position.
2010-10-23 15:53:52 -04:00
Bryan Schumaker
f982fab96a More attribute labels
Year, count, length, and length2 labels have been created.  The length2
label adds a "/" before displaying the length of the current song.
2010-10-23 15:35:16 -04:00
Bryan Schumaker
50f7e1203d Score system
The score system will help determine what users do and don't like.  When
the user chooses a song or listens to > 75% of a song, we increment the
score.  If the user selects a different song in the first 1/3 of
playback then we decrement the score.

Songs with a score >= 0 will always be played.  Songs with a score < 0
have a 50% chance of playing.
2010-10-21 17:11:33 -04:00
Bryan Schumaker
5835f55eb2 Track play count
The play count is incremented under two conditions.  1) The track
finishes playing. 2) The user skips to the next track, but the current
track has played more than 75%
2010-10-21 12:43:59 -04:00
Bryan Schumaker
6d7b08f921 Random
- Made a random check button to toggle the random preference
- Playlists pick a random song from what is visible
2010-10-21 08:47:10 -04:00
Bryan Schumaker
f1fc5caf07 Bugfixes
data.py: Return after deciding to scan a new library

playlist: refresh during the PREPLISTREFRESH event, not the
POSTPLISTREFRESH event
2010-10-21 07:55:21 -04:00
Bryan Schumaker
bb86a70ae4 Playlist next
The playlist will play the next visible song when the current song ends.
If we have reached the end of the list, we loop back around to the
beginning.
2010-10-20 22:18:41 -04:00
Bryan Schumaker
dc1b6dd4a6 Playlists
I can add songs to a playlist and populate the playlist afterwards (and
on startup).
2010-10-20 21:53:47 -04:00
Bryan Schumaker
02fe6dc8ba Right click menus
I have started a system to create a right click menu on the fly and show
it.  Currently, it only works for the library.  This will be used to
populate the playlist and probably many other things (like plugins!)
2010-10-20 21:11:12 -04:00
Bryan Schumaker
48d0af571c Collection filtering
I moved filtering from the Library lens to the collection base class
2010-10-20 20:21:11 -04:00
Bryan Schumaker
8f370aa3bd Change all volume buttons
All existing volume buttons must be changed when the volume changes, not
just the one receiving the value-changed signal.
2010-10-20 20:08:21 -04:00
Bryan Schumaker
7b8d2288cd Player volume
I can now change the volume using a button in the gui.  Additionally,
the volume is stored between sessions, and the correct value is loaded
when libsaria is initialized.
2010-10-20 20:04:23 -04:00
Bryan Schumaker
9caa247d04 Collection.find_id(): Check if the result is false. If it is, return
None.  Otherwise, return result[0]
2010-10-20 07:59:08 -04:00
Bryan Schumaker
b45117e761 Don't return list[0] when having the library look up an id 2010-10-19 22:30:57 -04:00
Bryan Schumaker
d56f3b2d0a Multiple changes
- Remove google from the web radio plugin
- Change ocarina.py to use python2
- Seek in song using slider
2010-10-18 21:04:39 -04:00
Bryan Schumaker
ff8d599008 removed print statements 2010-10-18 10:59:00 -04:00
Bryan Schumaker
6a2ec62015 Call pause() at end of each stream 2010-10-18 10:49:48 -04:00
Bryan Schumaker
b85f1ac5c4 Formatting changes to the event error message 2010-10-18 10:12:05 -04:00
Bryan Schumaker
98ded4f032 Progress bar slider movement
The progress bar slider updates every half second as a song plays.
2010-10-16 14:21:25 -04:00
Bryan Schumaker
1da55341d4 Fixed loading of random songs
I fixed loading of songs not in the library by correctly implementing
the path walk function in the DLTree class
2010-10-15 23:12:33 -04:00
Bryan Schumaker
45e2b0325f Filtering improvements
When a list is filtered, if the Nth song is selected we should play song
N in the filtered list and not the original list.
2010-10-14 08:16:13 -04:00
Bryan Schumaker
eb7932fad2 Added the beginnings of a progress bar 2010-10-11 20:48:43 -04:00
Bryan Schumaker
6934974d75 Time strings
During scanning I convert the length into a time string ( "h:mm:ss" ).
This is drawn in the gui when a collection list is populated.
2010-10-11 18:22:05 -04:00
Bryan Schumaker
6c6477b677 Index filtering
I have implemented simple filtering over the library.  This will return
a set of visible songs based on the search pattern.
2010-10-10 23:06:54 -04:00
Bryan Schumaker
168025fb60 Collection Indexing
I can now add songs to a collection's index.  The index only works for
unicode string right now (all others must be converted)
2010-10-10 13:45:52 -04:00
Bryan Schumaker
2c27185679 Use new collection structure to populate the library list. 2010-10-08 13:09:42 -04:00
Bryan Schumaker
adcb73dac9 Have a working doubly-linked tree based library.
I have a bit more to do before I support everything the old library did.
Mostly getattr work.
2010-10-06 23:31:36 -04:00
Bryan Schumaker
ab29b2cb2b More work with collections based on doubly linked trees 2010-10-03 19:00:06 -04:00
Bryan Schumaker
31b470e597 Track tags in another double linked tree. Create a record for each
track linking to each tree.  Create a library filter for creating a
library.
2010-10-01 21:33:19 -04:00
Bryan Schumaker
8221411ca2 Double linked trees
I have begun working on doubly-linked trees for use in collections.
2010-10-01 12:32:24 -04:00
Bryan Schumaker
6609e48d5c Play / Pause / Close tabs
I am using tabs in the info pane to act as buttons when the pane is
expanded.  Eventually I want to move this over to an action widget, but
pygtk doesn't support action widgets for notebooks yet.  Hopefully this
will be fixed by the next release.
2010-09-13 19:32:13 -04:00
Bryan Schumaker
4a5085d973 File chooser window
I have created my own file chooser window that can select both files and
directories.  Currently, the "OK" button must be clicked to select
anything.
2010-09-12 19:11:37 -04:00
Bryan Schumaker
2f562bcc81 Buttons
Added a button class, and attached play/pause buttons to the bottom of
the window.
2010-08-30 17:57:08 -04:00
Bryan Schumaker
4d41cbfc30 Playlist borders
Both top and bottom playlist borders are present, but both only have a
placeholder label for now.  Double clicking on a row in the list will
play a song now.
2010-08-25 08:18:57 -04:00
Bryan Schumaker
c5a7508573 Began bottom pane
I only need to create one bottom pane instance now.  When the tabs are
changed, the object will be removed from the old tab and added to the
new one.  This will preserve the state of the pane between tabs.
2010-08-22 12:40:39 -04:00
Bryan Schumaker
8594c3b330 Collection get_attr() and list hover popup
Collections now have a get_attr function.  This function takes a song id
and a string with the requested attribute.  The value of the attribute
is returned.  This is used for generating a hover popup with the
playcount.
2010-08-20 19:37:55 -04:00
Bryan Schumaker
304855c10d Use gtk.ListStore.insert
The append function of a ListStore is extremely slow.  Now I use  the
ListStore insert function, and manually track the size of the list
myself.
2010-08-20 08:27:12 -04:00
Bryan Schumaker
15cc5d22f0 Backend and frontend changes
Libsaria events now support starting specific callback functions in a
background thread.  This replaces starting a specific event in the
background.

I have a library tab that is added to the main window through use of the
ocarina.add_tab function.

I have new tests for walking the tree and running multiple threads with
locks.
2010-08-19 23:02:30 -04:00
Bryan Schumaker
66a8c5169e Web Radio Plugin
The web radio plugin can load pandora and grooveshark.  This happens
when a web radio tab is selected.  After the web document is loaded,
playing music will be paused.
2010-08-15 13:39:31 -04:00