Commit Graph

374 Commits

Author SHA1 Message Date
Bryan Schumaker
445b3a79bc ocarina: Don't do gtk locking anymore
I added this to help with setting album art in other threads.  Now that
I'm forcing this to the main thread, I don't think I need it anymore.
2011-06-18 10:11:02 -04:00
Bryan Schumaker
38f1d6ec8c ocarina: Only set album art once
When we receive a new image, we should check if it is the same as the
current image.  If it is, we don't need to change anything!
2011-06-18 10:01:10 -04:00
Bryan Schumaker
6773d9837e ocarina: Set album art in the main thread
I use a gobject signal to force setting album art in the main loop.
In theory, this should cut down on the number of crashes I see when
album art is fetched.
2011-06-18 09:23:50 -04:00
Bryan Schumaker
66d4d4979f ocarina: Set album art from on_load() attrs
It's available here, so I might as well.  Hopefully this will cut down
on the number of crashes I get, too...
2011-06-17 23:44:28 -04:00
Bryan Schumaker
5fcb590f53 ocarina: Pass attributes throughout the gui
This avoids repeated calls to the get_attrs() function at every step.
2011-06-17 20:03:13 -04:00
Bryan Schumaker
645b70b33c libsaria: Introduce libsaria.sources.all_attrs()
This patch introduces a new function "all_attrs()" which will return a
dictionary containing all the attributes for the current song.  To help
the gui, I pass this dictionary during an on_load() callback.
2011-06-17 19:47:04 -04:00
Bryan Schumaker
63574a17c6 ocarina: Need to import export code
Otherwise I can't save playlists, since the functions won't be
available.
2011-05-29 18:23:26 -04:00
Bryan Schumaker
466b0a2c5b ocarina: Better way to scroll to current song
I should use get_attrs() and then use the first result in the list,
rather than using the cur_id variable.  cur_id is not set in the case of
loading a file.
2011-05-28 15:50:57 -04:00
Bryan Schumaker
1bb0480c65 ocarina: Use libsaria.sources.cur_id for scrolling
I was using a get_attrs() call for finding the current song id.  This
information is available directly through libsaria.sources, though.  I
think it will be easier to just use the cur_id variable.
2011-05-28 15:31:59 -04:00
Bryan Schumaker
7c39b9ccd1 ocarina: Fix now playing label order
I initially had length and play count switched.
2011-05-26 09:02:44 -04:00
Bryan Schumaker
2f6313fe95 ocarina: Add track number to gui
It's helpful to see, especially since it shows how everything is sorted.
2011-05-25 23:05:05 -04:00
Bryan Schumaker
e8f633c863 ocarina: Single list attrs
I was recreating this list once for each of playlist, library and queue.
I expect it is easier to manage from a single location.
2011-05-25 23:01:17 -04:00
Bryan Schumaker
fffc7f8816 ocarina: Fix setting album art
get_attrs() now returns a list, so the on_get_art() callback function
needs to be updated.
2011-05-25 20:58:27 -04:00
Bryan Schumaker
ae2fc30da8 ocarina: Remove export button
I don't plan on changing the library anytime soon, so there is no need
to export it to an xml file.
2011-05-23 10:02:43 -04:00
Bryan Schumaker
43f37c93a7 ocarina: Do filtering in the listview
Each source was doing the exact same thing for filtering now that I have
a generic is_visible() function.  There is no need for each source to
implement this.
2011-05-22 09:43:27 -04:00
Bryan Schumaker
4f8f4d3ce3 ocarina: Use new filtering functions
I set this up through callbacks.  It should filter all sources at once,
rather than just the current page.
2011-05-22 09:27:26 -04:00
Bryan Schumaker
ac0f23ab80 ocarina: Remove oldlibrary code
The new library covers everything, so this is no longer needed.
2011-05-21 22:34:39 -04:00
Bryan Schumaker
ad12bf6500 ocarina: Filter the library
I call the new libsaria.sources.filter() function and test ids using
libsaria.sources.is_visible().
2011-05-21 22:06:37 -04:00
Bryan Schumaker
c357a35313 ocarina: Reset library and right click menu
I added these based on the old library functions.  It seems to be
working so far!
2011-05-21 15:43:29 -04:00
Bryan Schumaker
2587ae0954 ocarina: Fill new library
I make the list of songs visible, I also update the number of songs.
Finally, I respond to the library_updated() callback when songs are
added / removed from the library.
2011-05-21 08:20:44 -04:00
Bryan Schumaker
e3450d31ff ocarina: Add new library page
Right now, it just adds a new page to the window.  I'll add more as I
go.
2011-05-20 21:42:57 -04:00
Bryan Schumaker
c3dbd8167d ocarina: Rename library.py -> oldlibrary.py
This reflects my recent libsaria change.  I'm keeping around my old
library code for now.  The new library will gradually be introduced
through several patches ending with the removal of the old library.
2011-05-20 21:29:30 -04:00
Bryan Schumaker
531ceb2c17 libsaria: Rename library.py to oldlibrary.py
I want to preserve the old library as I slowly introduce the new one.
This should help.
2011-05-20 21:22:21 -04:00
Bryan Schumaker
3301439e88 ocarina: Get gtk lock around gtk.main()
The internet suggests that this may help with the random crashes I
sometimes get.  We'll see.
2011-05-15 15:58:37 -04:00
Bryan Schumaker
b373a88618 ocarina: Page showing and hiding improvements
When hiding a page I want to switch to page n - 1, but gtk was moving me
to n + 1.  I also added a function to show, and optionally switch to, a
page.
2011-05-15 11:36:26 -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
64c6677263 ocarina: Use new list_playlist() function 2011-05-12 08:26:17 -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
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
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
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
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
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
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
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
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
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
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
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
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
Bryan Schumaker
6cb857d988 ocarina: Switch over to new preferences methods
I removed the old methods, so I need to use the new methods for ocarina
to start up.  This patch switches everything over.

NOTE: As of this patch, ocarina should work again.
2011-05-01 12:46:16 -04:00