Commit Graph

1027 Commits

Author SHA1 Message Date
Bryan Schumaker
0862c57b6a ocarina: Clean up image resize function
I now wrap the entire resize operation in a try / except block.
Hopefully this will help to catch some errors.  I also cleaned up my
"return early" conditions.
2011-05-08 10:24:10 -04:00
Bryan Schumaker
22168d2998 libsaria: Remove old init_src() function
I don't even remember the last time this was used.  Why bother keeping
it around?
2011-05-08 10:15:02 -04:00
Bryan Schumaker
3ceb62c0de libsaria: Remove old walk_queue() function
I've replaced it with a more generic function that should be able to
handle the library and playlist, too (yay for code reuse!).
2011-05-08 10:10:43 -04:00
Bryan Schumaker
b43725bbe8 ocarina: Use new list_queue() for filling queue
I might as well use the new function so I can remove the old
walk_queue() function.
2011-05-08 09:57:57 -04:00
Bryan Schumaker
d30eaeea50 libsaria: Generic list_source() function
This function will loop over the entire source and collect attributes
for each id.  The resulting list will be returned to the caller.  I also
added a list_queue() function so the user doesn't need to pass the QUEUE
flag.
2011-05-08 09:56:11 -04:00
Bryan Schumaker
5c056191f2 libsaria: Filter queue
Filtering lists makes it easier to find specific songs.
2011-05-07 22:31:11 -04:00
Bryan Schumaker
c9a57bf4be libsaria: Initialize queue on import
I don't actually need to have an init() function.  Everything can be
done on import, so everything should be done on import.
2011-05-07 22:06:02 -04:00
Bryan Schumaker
186830e268 libsaria: Remove unused queue save function
I never actually used this... I may enable saving the queue later, but
it's not important now.
2011-05-07 21:52:59 -04:00
Bryan Schumaker
45f293c6fa ocarina: Refresh queue when changed
I want the gui to be consistent with the internal state of the queue.
2011-05-07 18:53:01 -04:00
Bryan Schumaker
5d336d4815 libsaria: Added queue_changed callback
This callback is used when ids are either added or removed from the
queue.
2011-05-07 18:52:24 -04:00
Bryan Schumaker
93f2f6b918 libsaria: Remove unused queue functions
These haven't been used in a long, long time.  I don't even know why
they're still there.
2011-05-07 18:49:17 -04:00
Bryan Schumaker
0908588325 libsaria: Generic next() in sources
The sources module should choose between picking the next song from the
playlist or the queue.  It should also be in charge of tracking the
current song id.
2011-05-07 18:15:35 -04:00
Bryan Schumaker
d99e7a4955 libsaria: Do locking in queue.py
Now I don't need to worry about forgetting to get the lock somewhere
else.
2011-05-07 18:13:31 -04:00
Bryan Schumaker
2c185dec83 libsaria: Move actual queue to new file
I pulled out the queue and put it in a new file.  I also created simple
add, remove, pop and reset functions.
2011-05-07 17:56:07 -04:00
Bryan Schumaker
c35b452ec3 libsaria: Move queue to subdirectory
I am going to explode queue.py into multiple files, so a subdirectory
will help keep manage everything.
2011-05-07 17:29:40 -04:00
Bryan Schumaker
3fd94e4ddd libsaria: Set cache basedir when storage imported
I want to set this once, so I don't need to keep looking it up.
2011-05-07 17:15:06 -04:00
Bryan Schumaker
e2233e4106 libsaria: Remove old cache code
I've replaced it with a cache implemented in libsaria/storage.  The new
cache should be easier to use (or at least easier to maintain and
understand).
2011-05-07 17:10:20 -04:00
Bryan Schumaker
bafdc6ef20 libsaria: Manually set artwork through a copy_in_file() function
I created this function in the cache to make a generic way to copy
outside files into the cache tree.  It makes sense to do this in the
cache, since I want to keep everything self-contained.
2011-05-07 16:49:41 -04:00
Bryan Schumaker
2a78d870ee libsaria: Set artwork from a local file
I set it in the new cache, rather than using the old one.
2011-05-07 16:45:04 -04:00
Bryan Schumaker
0f1b5550aa libsaria: Change cache_func() argument order
I want to pass the file object last, I just think it looks better.
2011-05-07 15:58:33 -04:00
Bryan Schumaker
797063c492 libsaria: Fill cache in new function
This keeps things easy to read
2011-05-07 15:58:33 -04:00
Bryan Schumaker
a7c7b85fdb libsaria: Get album art through new cache
I am working on replacing my old cache functions with something easier
to use.  I can now get album art out of the new cache.
2011-05-07 15:58:33 -04:00
Bryan Schumaker
904b475363 libsaria: Began new cache functions
I think the new cache will be more generic, and should work for just
about anything.  We'll see.
2011-05-07 15:58:33 -04:00
Bryan Schumaker
c1a2d74f7c libsaria: Move version information to new file
A bit of separation is good here, and it should help with managing the
code.
2011-05-07 15:58:33 -04:00
Bryan Schumaker
40084f4c68 Ocarina 4.5.1 2011-05-07 15:56:47 -04:00
Bryan Schumaker
41e08fe248 Ocarina: Start through a function call
I was starting Ocarina through "import ocarina" in the launcher.  This
was apparently a bad idea, since the import lock will never be released.
This lock prevents other threads from importing modules, so when I tried
to use urllib2 to download album art the call blocked until after I
closed Ocarina.
2011-05-07 15:54:26 -04:00
Bryan Schumaker
4d2558a693 Ocarina 4.5 2011-05-06 22:21:20 -04:00
Bryan Schumaker
b06b11cafc libsaria: Set volume during startup
This restores the volume to the level during the last session.  Before
this, it was defaulting to max volume.
2011-05-01 12:46:17 -04:00
Bryan Schumaker
975b153bea libsaria: Remove event.py
I've been looking forward to this.  The last several commits have
replaced the generic event system with a hardcoded callback system.
This should be more efficient, easier to understand, and easier to
follow.  I feel it is a better solution.
2011-05-01 12:46:17 -04:00
Bryan Schumaker
78f6d4b76b libsaria: Manually parse user input on startup
I was doing this through an event after loading the library.  Now I call
the function manually on startup.
2011-05-01 12:46:17 -04:00
Bryan Schumaker
e64f93ef39 libsaria: New library source callback
Triggered upon scanning a new path to add to the library.
2011-05-01 12:46:17 -04:00
Bryan Schumaker
bc54ef0a98 libsaria: Add a load_playlist() callback
Called when playlists are loaded from file.
2011-05-01 12:46:17 -04:00
Bryan Schumaker
96b237631e libsaria: Remove POSTSETART event
Nothing was listening for it, and I am removing the event system soon
anyway
2011-05-01 12:46:17 -04:00
Bryan Schumaker
a6bd531aee ocarina: Fetch image during load
I also set absolute sizes for album art.  Scaling to size 1 was causing
scale_simple() to block forever.
2011-05-01 12:46:17 -04:00
Bryan Schumaker
d0198cdd1a libsaria: Get artwork when songs are loaded
I may change this to something that has to be requested by the front
end, rather than always fetching it.  We'll see.
2011-05-01 12:46:17 -04:00
Bryan Schumaker
889e17fab9 libsaria: Remove event system from controls
This is a big step forward for reving the event system entirely.
2011-05-01 12:46:17 -04:00
Bryan Schumaker
34dcb7998f libsaria: Add in absolute seeking by percentage
I give a percentage and gstreamer will seek to that position in the
song.
2011-05-01 12:46:17 -04:00
Bryan Schumaker
90901846e4 libsaria: Find string representing song pos based on prcnt
I can pass a percentage to get_time_at() and it will return a string
representing the time at that spot in the audio stream.
2011-05-01 12:46:17 -04:00
Bryan Schumaker
3cb39f3fcd libsaria: Fix seeking through gui buttons 2011-05-01 12:46:16 -04:00
Bryan Schumaker
e59243e51b libsaria: Set volume callback 2011-05-01 12:46:16 -04:00
Bryan Schumaker
99771a34fb libsaria: on_like() callback
This replaces the LIKE event for setting if the user likes the current
song.
2011-05-01 12:46:16 -04:00
Bryan Schumaker
69481ffa70 libsaria: Shut down gstreamer on exit
This gives gstreamer a chance to clean up while exiting.
2011-05-01 12:46:16 -04:00
Bryan Schumaker
6e6705736e libsaria: Add a load_file() callback 2011-05-01 12:46:16 -04:00
Bryan Schumaker
4e66cca423 libsaria: Set volume using new preferences
I somehow missed this earlier...
2011-05-01 12:46:16 -04:00
Bryan Schumaker
6c73a9c43a libsaria: Remove STOP event
I can double up on the pause callback in place of a stop callback.
2011-05-01 12:46:16 -04:00
Bryan Schumaker
7879c53fe7 libsaria: Created pause callback
This replaces the (PRE, POST)PAUSE events
2011-05-01 12:46:16 -04:00
Bryan Schumaker
b562fff0ed libsaria: Began implementing better callback system
The event system was evil, hard to use, and hard to follow.  This patch
is the beginning of a new, more straightforward system.
2011-05-01 12:46:16 -04:00
Bryan Schumaker
6855fb6b2d libsaria: Remove unused module list
I had a list of modules defined as __all__, but I don't think anything
used it.  It was time for it to go.
2011-05-01 12:46:16 -04:00
Bryan Schumaker
fca5fd1bae libsaria: Remove old audio code
I had commented it out while introducing the new stuff.  I should be
able to safely remove it now.
2011-05-01 12:46:16 -04:00
Bryan Schumaker
8574cda529 libsaria: Ported over Ocarina 5.0 audio functions
The new audio code I developed makes more sense and should be easier to
work with.  It makes sense to port it over.
2011-05-01 12:46:16 -04:00