If we lock, then we prevent the possibility that multiple threads will
attempt to change the art at the same time. We hold the lock until
after the resize for the same reason.
For some reason the loop in get_rand_candidate was exiting earlier than
I thought. For now, I am returning the last ID looked at to fix the
problem. I expect there is a better solution, but this seems to work
until I can clean up the collection system.
Whenever a song changes, we need to clear the path that we tell the
album art image to load. Otherwise, it will show art from the previous
track if none can be found for the current track.
When a cache filler function returns without success, we need to delete
the empty file we create so that it doesn't trigger a false positive the
next time we access it.
This adds two new classes. Image() inherits from a gtk.Image, and adds
set_height(x) to scale an image so it is x pixels high. AlbumArt()
inherits from Image, and will display the album art of the currently
playing song.
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.
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.
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.
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.
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..
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.
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.
I created labels that automatically update whenever a song is changed.
These labels are used for displaying the artist, album, and title of the
currently playing song. They can also be used in the future fir
displaying any attribute of a song.
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.