Commit Graph

908 Commits

Author SHA1 Message Date
Bryan Schumaker
b4eb7c15c5 libsaria: Remove unused playlist functions
I have more generic play_id() and load_id() functions now, so the
playlist specific implementations haven't been used in a long time.  I
don't think I need them anymore.
2011-05-15 10:50:39 -04:00
Bryan Schumaker
b56fb6768f libsaria: Track current file in audio
I use this for determining the pipeline state.  get_property() wasn't
working as well as I hoped it would.
2011-05-15 10:43:57 -04:00
Bryan Schumaker
5a781479cd libsaria: Move rand_next() to playlist's next.py
This keeps code for picking the next song in one place.  I also cleaned
up rand_next() while I was at it.
2011-05-15 10:30:22 -04:00
Bryan Schumaker
898f843ee0 libsaria: Check that sources have an id before looking up a file
If next() in libsaria.sources doesn't get an id from the queue or
playlist, then we shouldn't try to look up a filepath.  We return None
instead.
2011-05-15 10:28:24 -04:00
Bryan Schumaker
e3af5800b0 libsaria: Check that next() returns a file
If next doesn't return a file, we shouldn't try to load something.  That
would just be silly.
2011-05-15 10:26:38 -04:00
Bryan Schumaker
67369e88a7 libsaria: Don't change audio pipeline state if no file loaded
I only want to change to gst.STATE_PLAYING or gst.STATE_PAUSED if the
pipeline currently has a file loaded.  Not doing this can cause an
exception in position() when get_state() returns gst.STATE_READY instead
of gst.STATE_NULL.
2011-05-15 10:23:24 -04:00
Bryan Schumaker
0f78c7b80c libsaria: Add idea to playlist
I want one file to grab the lock and another with functions to call with
the lock held.
2011-05-14 08:29:55 -04:00
Bryan Schumaker
a3af3d053d libsaria: New sequential next function for playlist
The new function exists in its own file to keep things simpler.  Based
on the current song id, it finds the index in the playlist and returns
the next visible song.
2011-05-14 08:15:05 -04:00
Bryan Schumaker
0a1160f618 libsaria: Rename playlist's next() function
This is to prepare for creating a new file "next.py" dedicated to
choosing the next song.  I also use this as an opportunity to pass the
current song id to the next function.
2011-05-14 07:48:11 -04:00
Bryan Schumaker
a950f06e10 libsaria: Don't always keep a set of visible songs
If the playlist isn't filtered there isn't much of a point in keeping
around a set of visible songs.
2011-05-13 22:54:27 -04:00
Bryan Schumaker
9056daae93 libsaria: Remove playlist startup() function
I should be able to do this on import, so it doesn't need its own
function.
2011-05-13 08:27:59 -04:00
Bryan Schumaker
202e75430e libsaria: Add comment to playlist save()
The lock should be held while saving.  Save should normally be called by
a function that already holds the lock, though.
2011-05-13 08:19:50 -04:00
Bryan Schumaker
ad7f780671 libsaria: Load playlist on import
I was doing this during startup already, so I might as well do it here.
2011-05-13 08:07:47 -04:00
Bryan Schumaker
194b436886 libsaria: Clean up playlist init
I removed some code that really didn't need to be used.  I also moved
around some of the imports to make the file easier to follow.
2011-05-13 08:03:00 -04:00
Bryan Schumaker
e6a7b94c57 libsaria: Always get attributes from library
Attributes are stored in the library, so it makes sense to get them
there.
2011-05-13 08:00:00 -04:00
Bryan Schumaker
25f4410970 ocarina: I don't need to call save after resetting playlist
Saving is done automatically as part of the reset now, so there is no
need to call save() here any more.
2011-05-12 22:36:17 -04:00
Bryan Schumaker
132a66271c libsaria: Move playlist load, save, and reset functions
I moved them to playlist.py so they can grab the lock and safely do
stuff.  I save after adding or removing song ids.  I also save after
resetting the playlist.
2011-05-12 22:34:36 -04:00
Bryan Schumaker
64c6677263 ocarina: Use new list_playlist() function 2011-05-12 08:26:17 -04:00
Bryan Schumaker
8b51871225 libsaria: Playlist uses new list functions
They were built in to the sources/ layer in 4.6.  It makes sense to use
them for the playlist.
2011-05-12 08:25:44 -04:00
Bryan Schumaker
2afabfcf21 libsaria: remove ids from playlist (improved!)
I moved this to my new file.  I grab the lock, remove each id, and then
unlock.
2011-05-12 08:11:35 -04:00
Bryan Schumaker
8bd914802e libsaria: Move playlist's list to new file
It will be easier to work with from a new file, especially after I put
in functions for doing basic operations on it.
2011-05-11 23:05:47 -04:00
Bryan Schumaker
e2be97165e libsaria: Move playlist to new directory
This will help me manage it better.  My next task is to explode it into
multiple files.
2011-05-11 22:43:32 -04:00
Bryan Schumaker
a973ef196f makefile: Remove ocarina.py as part of clean
It's automatically generated during the make process, so it should be
removed during `make clean`.  I also want to run a `make clean` before
doing an update.
2011-05-11 22:34:31 -04:00
Bryan Schumaker
1ed7e58c99 libsaria: Remove old tests
These files were created for developing small components during initial
design.  I haven't used them in a long time, and most are probably
obsolete by now.
2011-05-11 22:31:28 -04:00
Bryan Schumaker
43b162d007 libsaria: Bump version
I am now developing Ocarina 4.7
2011-05-11 22:31:28 -04:00
Bryan Schumaker
4e3d98ab61 Ocarina 4.6 2011-05-11 22:19:00 -04:00
Bryan Schumaker
412153013b ocarina: Remove reference to thread.py
I removed the file a while ago, so this shouldn't be here.
2011-05-11 22:18:22 -04:00
Bryan Schumaker
83d8c18772 libsaria: I missed some references to thread.py
These should be removed.  I don't know how I missed this up until this
point
2011-05-11 22:18:01 -04:00
Bryan Schumaker
7a26110750 ocarina: Set and resize images atomically
Doing this all in one step prevents multiple threads from clashing with
each other.  I also add in clearing the old image before setting a new
one.
2011-05-11 21:46:15 -04:00
Bryan Schumaker
86f4aca8f3 libsaria: Remove old threads.py module
Everything in here can easily be duplicated with one line of python
code.  Keeping this file does a good job at increasing complexity.
2011-05-08 10:58:41 -04:00
Bryan Schumaker
217156d322 ocarina: Gtk locking around album art resize
I only want one thread modifying album art at a time, so I need to use
threads_enter() and threads_leave() here.
2011-05-08 10:33:01 -04:00
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