Commit Graph

1026 Commits

Author SHA1 Message Date
Bryan Schumaker
49f7829706 libsaria: Add dynamic attributes
Dynamic attributes are attributes of a track that can change during run
time (like status, playcount, etc).  I only initialize these when they
are first set, and I save after each change.

This patch adds in the dattr framework and the "like" dattr.
2011-05-28 16:04:42 -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
114ac13c7a libsaria: Added TODO idea to playlist
I want to do type checking after loading objects.  This can be done once
during storage.load_obj, rather than after load_obj
2011-05-28 15:40:19 -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
1cbb1fb969 libsaria: Remove more path code 2011-05-26 16:04:07 -04:00
Bryan Schumaker
07c673fa47 libsaria: Remove unused libsaria.path code
I eventually want to get rid of this directory, so removing this code
helps.
2011-05-26 15:55:59 -04:00
Bryan Schumaker
e59a613499 libsaria: Remove Source() class
Nothing uses it anymore, so it can be removed.
2011-05-26 09:25:56 -04:00
Bryan Schumaker
6398b3dd9a libsaria: Find attributes for songs not in library
I use the same Track() class that the library does.  I have to create
an instance of this class each time the function is called, but this is
ok since it is not the case I am trying to optimize for.
2011-05-26 09:18:43 -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
b7a45a3e18 libsaria: Controls need to import libsaria
I don't know why I didn't already do this...
2011-05-26 09:02:06 -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
38b075a701 libsaria: Turn get_attrs_id into a function pointer
I was doing an extra python lookup every time this function was used.
Turning it into a function pointer should cut down on this.
2011-05-25 21:22:23 -04:00
Bryan Schumaker
756c98285b libsaria: Only shutdown server when server exists
I now always call the shutdown() function to close the server.  This
function checks if the server pointer has been set, and if it has it
calls the server's shutdown() function.
2011-05-25 21:09:43 -04:00
Bryan Schumaker
c79677e77a libsaria: Initialize controls on import
This avoids an unnecessary function call, it also makes things easier to
read and maintain.
2011-05-25 21:07:53 -04:00
Bryan Schumaker
d41286c83c libsaria: Import lastfm during import
I was doing this during an init() function.  It should be more efficient
to just do this right away.
2011-05-25 21:00:07 -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
e2c4d78fa8 libsaria: Remove oldlibrary
Nothing uses it anymore, so it can be removed.
2011-05-25 20:50:46 -04:00
Bryan Schumaker
46b7f35224 libsaria: Remove oldlibrary from startup
Now it is no longer being imported anywhere.  I think I can remove it
now...
2011-05-25 20:48:32 -04:00
Bryan Schumaker
6bc6235e01 libsaria: Remove unused import pointers 2011-05-24 08:06:03 -04:00
Bryan Schumaker
9505373198 libsaria: inc_count() in sources
Doesn't do anything yet, but it will eventually (once I start tracking
dynamic attrs)
2011-05-24 08:02:18 -04:00
Bryan Schumaker
6b0ccce530 libsaria: Remove oldlibrary from export code 2011-05-24 07:58:47 -04:00
Bryan Schumaker
d8f47e8d4d libsaria: Remove new_source() functions
I have new functions for creating the library, so this (and associated
callbacks) are no longer needed.
2011-05-23 10:07:19 -04:00
Bryan Schumaker
913ee9f931 libsaria: Remove library export and import
Using export / import functions for library updates can be a pain.  I
don't plan on changing the library file format any time soon, so I don't
need to keep this code around.
2011-05-23 10:04:05 -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
c4629024a6 libsaria: Add ids to queue visible set
When adding songs to the queue, we also need to add the ids to the
visible set if they are visible.  Without this step, we won't have an
easy way of knowing how many IDs are visible.
2011-05-23 09:18:30 -04:00
Bryan Schumaker
d7ba67ee38 libsaria: Remove oldlibrary usage from playlist
The idea is to remove this from everywhere.  The playlist is a good
start.
2011-05-23 09:05:56 -04:00
Bryan Schumaker
de1acd8a23 libsaria: Playlist filtering and next() fixes
I removed the old playlist filtering code, since I now have a generic
way of doing this.  I also fixed the next function to use the revised
get_attrs() function.
2011-05-22 10:14:10 -04:00
Bryan Schumaker
bfeeb7f568 libsaria: Correct library num_visible()
Simply return the length of matching songs in the index.
2011-05-22 09:45:10 -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
39198ff2ce libsaria: Set initial matching ids
This should be initialized to the set of all ids to begin with.  That
way everything will match.
2011-05-22 09:34:30 -04:00
Bryan Schumaker
cb162bfa9f libsaria: Remove callback print statement
This was just to make sure it was being triggered.
2011-05-22 09:28:04 -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
3f8cba6f16 libsaria: Do filtering through sources
This allows me to set filter text and trigger a callback.
2011-05-22 09:24:53 -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
248dd283ff libsaria: Filter library
This reduces the number of visible songs that the user sees on the UI.
2011-05-21 22:28:12 -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
eea3118012 libsaria: Test song visibility through sources
It queries the library, but the playlist and the queue should be able to
use this too.  Then they don't each need to track what is currently
visible.
2011-05-21 22:05:23 -04:00
Bryan Schumaker
f676b5b44d libsaria: Added library index
This makes it easier to search for songs.
2011-05-21 21:40:32 -04:00
Bryan Schumaker
297775896e libsaria: Sources play song id
I find the filepath using the new library, rather than having the
library play the song.  I only really want the library for managing
collected music.  It shouldn't touch music playback at all.
2011-05-21 16:14:08 -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
17d83d8fff libsaria: Reset library
This clears the entire library and creates an empty tag tree.
2011-05-21 15:42:59 -04:00
Bryan Schumaker
c74f9680b2 libsaria: Load saved library on startup
I want to load the library and create a tree representing the entire
library on startup.
2011-05-21 15:27:58 -04:00
Bryan Schumaker
45600e8a2d libsaria: Save library after update
I want to write this out to stable storage so the user doesn't need to
rescan every time they want to listen to music.
2011-05-21 08:26:04 -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
254483dd5b libsaria: Added library getattrs
I search for attributes using the new library first.  If the song isn't
found in the new library, then I fall back on the old library.
2011-05-21 08:19:59 -04:00
Bryan Schumaker
66d5314b6e libsaria: Create tree from library
I do this at runtime, rather than at scan time, to cut down on storage
space required to store the library.
2011-05-21 08:02:04 -04:00
Bryan Schumaker
b1d8ba7653 libsaria: Remove old ids from library
If the song was deleted it should be removed.

This patch also addse in the Track() class that should have been in the
last patch.
2011-05-21 08:01:13 -04:00
Bryan Schumaker
a4988a0b28 libsaria: Add new songs to the library
I scan a directory and collect fileids for each file.  If the fileid
doesn't exist in the library yet, I'll find the tags and add to the
dictionary.
2011-05-21 07:44:11 -04:00
Bryan Schumaker
a1722eafb3 libsaria: Find list of files to add to library
I put them all into a dictionary for use later.
2011-05-21 07:26:30 -04:00