Commit Graph

3856 Commits

Author SHA1 Message Date
Bryan Schumaker 5a6b321ffe Rework collection saving to work with -dev appending 2010-11-01 08:24:53 -04:00
Bryan Schumaker b408e4b727 Development and stable pickle files
When libsaria.__dev__ == True, we save data to a file with -dev appended
before the extention.
2010-11-01 08:22:38 -04:00
Bryan Schumaker 685bd54bcb Merge branch 'master' of file:///home/bjschuma/public_html/git/ocarina 2010-10-31 17:25:35 -04:00
Bryan Schumaker 6f2d064480 Don't make empty menus
make_menu should only pop up a menu if there are menu items to show.
2010-10-31 17:24:07 -04:00
Bryan Schumaker 025a118290 Fix get_rand_candidate crash
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.
2010-10-31 17:21:12 -04:00
Bryan Schumaker aa9f517959 Walk filtered IDs
We already have a function for walking all song ids.  Collections should
be able to walk the filtered IDs too.
2010-10-31 17:20:20 -04:00
Bryan Schumaker 49328c5200 choose_next() already starts the NEXT event... 2010-10-31 17:19:46 -04:00
Bryan Schumaker 19d1f885cd Information pane remember position
The infopane will remember if it is currently up or down between
sessions.
2010-10-30 16:57:48 -04:00
Bryan Schumaker 81277d83b8 PLUGIN: Pause after current song
This plugin will wait for the NEXT event, and then check if playback
should be paused.
2010-10-30 13:53:18 -04:00
Bryan Schumaker 76eaa3eb16 NEXT event
Rather than call choose_next() directly, we should wrap this in a NEXT
event so that things can respond to it.
2010-10-30 13:52:38 -04:00
Bryan Schumaker 63ee87fa16 Menu direct function call
Menu callback functions should not go through a lambda layer.  Instead,
call the given function directly.
2010-10-30 13:51:48 -04:00
Bryan Schumaker b2c5ad96cb PLUGIN: wm_tweaks.py
This plugin will change the window title and icon whenever a song
changes.
2010-10-30 13:42:45 -04:00
Bryan Schumaker adc3af3779 Menu tweaks
Playlists and libraries now have a right click menu, and a generic
function for making the menus.
2010-10-30 13:40:56 -04:00
Bryan Schumaker 3087eb9954 init_var()
I made an init_var function that matches the init_pref function, only
for runtime variables.
2010-10-30 13:40:06 -04:00
Bryan Schumaker 3de6e94db1 Generic window icon function
I made a function to set the window icon, rather than doing it only when
the window is constructed.
2010-10-30 13:09:15 -04:00
Bryan Schumaker 1136e3f4af Cache path correction
If we look for a cache item that includes the directory seperator
character, then we should replace it with a different character.
2010-10-30 12:54:45 -04:00
Bryan Schumaker c5a606193a Cache dir setup
The cache should use path.saria_dir() to determine the correct path,
rather than setting it directly.
2010-10-30 12:47:41 -04:00
Bryan Schumaker 16e3aac2ed Tab ordering
Switch the order of the library and playlist tabs
2010-10-30 12:46:14 -04:00
Bryan Schumaker 4f771dd6e7 Default album art image
Use images/ocarina.png as the default album art image if none can be
found
2010-10-30 12:22:26 -04:00
Bryan Schumaker 2861e3d3b9 Window icon
The main window sets the image images/ocarina.png as the window manager
icon on startup.
2010-10-30 12:17:54 -04:00
Bryan Schumaker 356244e3be Gstreamer locking
Locking for gstreamer operations may help prevent a double free error I
was getting.
2010-10-30 12:09:28 -04:00
Bryan Schumaker b000bbf808 Basic playlist deduplication
Before adding songs to the playlist, check if the playlist already
contains the song id.
2010-10-28 08:30:46 -04:00
Bryan Schumaker a43bad029c added screenshots of the current ocarina state 2010-10-27 23:26:38 -04:00
Bryan Schumaker 75c7c77e32 ocarina.xcf
I added ocarina.xcf, which will eventually be used as the window icon.
2010-10-27 23:26:09 -04:00
Bryan Schumaker b1534f082d Clear image file
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.
2010-10-27 09:44:44 -04:00
Bryan Schumaker 4f899c4834 Delete empty cache files
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.
2010-10-27 09:09:18 -04:00
Bryan Schumaker ba90106588 ocarina/image.py
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.
2010-10-26 22:45:59 -04:00
Bryan Schumaker 3a81afdc92 last.fm for album art
Whenever a new song is loaded, we check the cache for album art.  If we
don't have art yet, then we place a request to the last.fm to find an
image.
2010-10-26 22:44:09 -04:00
Bryan Schumaker 657d016017 libsaria/web.py
This file contains a url class designed to make it easy to build up a
url and then place a python urllib2 request.
2010-10-26 22:40:00 -04:00
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 3680035ba1 Ocarina import pango
Ocarina should import pango so other modules don't have to.  Anything
that wants to use pango can do this instead:
  import ocarina
  pango = ocarina.pango
2010-10-26 22:35:43 -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 d46eca4823 Id 0 == False
When checking if we have a song id, we should check against None (id ==
None).  Doing "if id" will return False when id is 0.
2010-10-25 08:48:32 -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 03ed1489dc Move forward button
Move the forward button so it is next to the rewind button.
2010-10-24 17:25:31 -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 de68081e74 python2 for saria-test.py
saria-test.py should be run with python2, not python (python is not
pointing to python 3.1)
2010-10-24 17:13:38 -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 af8eb41589 Attr labels
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.
2010-10-23 14:03:03 -04:00
Bryan Schumaker 816d97e3ea Now playing tab
I have replaced the "test" tab with a "now playing" tab that will tell
the artist, album, and title of the current song.
2010-10-23 12:16:50 -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