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
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
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
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
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
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
Bryan Schumaker
8debb4a508
libsaria: Began library scanning routines
...
I can add a new path to a dictionary, but I don't do any actual scanning
yet. Instead, I just print out each path in the library.
2011-05-21 07:16:00 -04:00
Bryan Schumaker
39c9a7cca8
libsaria: Added new library directory
...
I'm going to let everything expand across several directories. It'll be
neater this way.
2011-05-20 21:43:35 -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
0d75d4f7d9
Began Ocarina 4.8
2011-05-20 20:50:30 -04:00
Bryan Schumaker
dd040252a4
Ocarina 4.7
2011-05-20 08:24:13 -04:00
Bryan Schumaker
6d01a1cbc8
libsaria: Fix playlist filtering
...
The variables "filtered" and "visible" are global, so we need to tell
the function that it shouldn't create local variables.
2011-05-16 12:04:28 -04:00
Bryan Schumaker
e0dd940671
libsaria: Don't write empty text to client
2011-05-15 15:58:21 -04:00
Bryan Schumaker
c02bffb652
libsaria: Web server controls playback
...
I can choose songs to play by clicking rows in an html table. I also
write text to the client as it becomes available, rather than doing it
all at once.
2011-05-15 15:39:14 -04:00
Bryan Schumaker
7ffd4e14fd
libsaria: Added RPC pages
...
For now, I can play and pause. I'll eventually add more operations to
the list.
2011-05-15 13:49:02 -04:00
Bryan Schumaker
2a6b04e328
libsaria: Began new web server
...
The new web server will be built in to libsaria, rather than existing as
a plugin. This allows me to break it into multiple files for easier
use. For now, the server is only active when version.__dev__ == True.
2011-05-15 13:41:47 -04:00
Bryan Schumaker
93a785dafa
libsaria: list_source() takes a function pointer
...
I was taking a flag that I used to determine which list func to call. I
think it is simpler to take a function pointer passed from either
list_playlist() or list_queue()
2011-05-15 11:36:07 -04:00
Bryan Schumaker
76975ecead
libsaria: Fix spacing in playlist
2011-05-15 11:02:14 -04:00
Bryan Schumaker
32a1e96af0
libsaria: Remove unused global statements and imports
...
With my recent cleanups, I don't need these statements anymore. To do
this, I also had to move tracking recent songs to next.py
2011-05-15 10:59:31 -04:00
Bryan Schumaker
6d5ca5d416
libsaria: Rename queue and playlist list functions
...
I rename them from list() to list_ids() so that it doesn't clobbel the
list constructor.
2011-05-15 10:53:31 -04:00
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
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
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
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
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
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
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
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
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
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
Bryan Schumaker
9f0d8efbb7
libsaria: playlist uses correct prefs.get() function
...
I forgot to change it over from get_pref()
2011-05-01 12:46:16 -04:00
Bryan Schumaker
3dc0b208cf
libsaria: Integrate new preferences and storage code
...
This patch re-enables most of the libsaria startup procedures. To allow
this, I had to switch over to the new preferences and object storage
code I recently came up with.
2011-05-01 12:46:16 -04:00
Bryan Schumaker
063869c7ca
libsaria: Remove old file management code
...
I have new code for loading / saving objects, so I can remove the old
stuff.
2011-05-01 12:46:16 -04:00
Bryan Schumaker
5199a26006
libsaria: Remove old preferences code
...
I don't need it anymore with the new code.
2011-05-01 12:46:16 -04:00
Bryan Schumaker
457bea2ff3
libsaria: New preferences functions
...
The new preferences code is much easier to work with. Rather than
inheriting from a complicated tree class, I just set values in a python
dictionary directly.
2011-05-01 12:46:16 -04:00
Bryan Schumaker
af5947b088
libsaria: Save and load python objects
...
I do this using cPickle. load_obj() takes a default constructor
function in case the object cannot be created.
2011-05-01 12:46:16 -04:00
Bryan Schumaker
1921e78e55
libsaria: Comment out most code, begin new preferences
...
I commented out most of the code in libsaria/__init__.py to make it
easier to clean up. I also began work on libsaria/prefs.py for managing
preferences.
NOTE: For the next several commits, the best way to test changes is by
importing libsaria through the python interpreter. Trying to run
ocarina will probably fail.
2011-05-01 12:46:16 -04:00
Bryan Schumaker
d2d894a2e4
libsaria: Bump minor version, mark dev as True
...
This means I am beginning v4.5
2011-05-01 12:46:16 -04:00
Bryan Schumaker
fb24a0cb32
libsaria: Mark __dev__ as False
2011-05-01 12:28:38 -04:00
Bryan Schumaker
7e83108c6a
ocarina: Show attrs for song loaded on startup
...
I was annoyed that this wasn't happening.
2011-05-01 12:28:28 -04:00
Bryan Schumaker
3bc5c05ab1
libsaria: disable plugins
...
With my recent changes, my old plugins are incompatible. I'm going to
come up with a new system in a few releases, so I'm going to wait until
then.
2011-05-01 12:28:19 -04:00
Bryan Schumaker
dc8a69bc0d
ocarina: Refresh library after loading
...
To show changes. I also use the v1.3 decoder function to decode
exported libraries.
2011-05-01 12:27:30 -04:00
Bryan Schumaker
3d1b8773d5
ocarina: Added album art
...
I put it on the now playing page for now. Eventually I'll put it in
other places, too.
2011-05-01 12:19:49 -04:00
Bryan Schumaker
bce7651be5
ocarina: Set text on footer labels
...
This sets (title, album), position and duration values
2011-05-01 12:12:02 -04:00
Bryan Schumaker
a8421b8226
libsaria: Fix removing songs from queue
...
If I'm going to attempt to remove the song id from the queue whenever a
song song is loaded, I need to check if the song is in the queue before
trying to remove it.
2011-05-01 12:11:24 -04:00
Bryan Schumaker
f5eed60d78
ocarina: Play double clicked songs
...
Otherwise, what's the point of a gui?
2011-05-01 12:10:28 -04:00
Bryan Schumaker
9a1a0471c5
ocarina: Re-added queue
...
Once again, using Ocarina-5.0 concepts (such as hiding the tab when the
queue is empty)
2011-05-01 12:09:47 -04:00
Bryan Schumaker
13a74e47c3
Ocarina: Remove from playlist
...
I can remove multiple songs from the playlist now.
2011-05-01 12:09:32 -04:00
Bryan Schumaker
bcd42cfea4
Ocarina: Add songs to playlist
...
Using a right click menu from the library
2011-05-01 12:09:09 -04:00
Bryan Schumaker
33b7f1ba0e
Ocarina: Re-added playlist tab
...
The new tab uses my ocarina 5.0 concepts
2011-05-01 12:08:52 -04:00
Bryan Schumaker
f902c11f9a
ocarina: Filter the library again
...
This time, I use concepts I played with for Ocarina 5.0
2011-05-01 12:07:56 -04:00
Bryan Schumaker
9c6db9ba9b
ocarina: New listview code
...
I can fill in the listview from the library.
2011-05-01 12:07:23 -04:00
Bryan Schumaker
212a846d8c
libsaria: Cache removes path if it exists
...
I wasn't checking if the path exists before removing it, and this caused
an error. Checking before removing is simple enough, though...
2011-05-01 11:59:29 -04:00
Bryan Schumaker
23cd4da304
Track version in libsaria
...
Tracking two different versions for Ocarina and libsaria was too much
work. From now on, Ocarina and libsaria will have the same version.
Ocarina's version string will be set based on libsaria.
2011-05-01 11:40:09 -04:00
Bryan Schumaker
cd914936f3
Bump minor version and mark development as True
2011-05-01 11:39:41 -04:00
Bryan Schumaker
5903d085b2
Current version is 4.3.3
2011-05-01 11:05:55 -04:00
Bryan Schumaker
50cded315e
bump bug version
2011-05-01 11:05:55 -04:00
Bryan Schumaker
47f33a3f8f
libsaria: Don't save on preference initialization
...
When a preference is initially created, it should be set to a default
value. If it is set to a default value, then we don't need to save it
immediately. Let's wait until it changes before actually doing a
save...
2011-05-01 11:05:55 -04:00
Bryan Schumaker
802513c726
libsaria: Don't immediately enable preference saving
...
We shouldn't need to save preferences during startup because at this
point only the initial values have been set. If nothing is changed,
then nothing needs to be saved and we can save some time. This should
also prevent any problems caused by crashing during a save.
2011-05-01 11:05:55 -04:00
Bryan Schumaker
e812fbaee0
Don't filter when there are no terms
...
If there are no terms to filter on, we should return a set of all items.
This will show all songs when a space has been entered into the filter
bar.
2011-05-01 11:05:54 -04:00
Bryan Schumaker
5f10a01bcb
Always clear pause_after
...
Always clearing this ensures that we don't keep pausing after playback
is resumed.
2011-05-01 11:05:54 -04:00
Bryan Schumaker
6201f707cb
Mark __dev__ as False
...
4.3 is almost done!
2010-12-30 11:26:20 -05:00
Bryan Schumaker
6fc6bb60f6
Set play button status correctly when stopped
...
The stop function needs to return True if it is successful.
2010-12-27 19:09:07 -05:00
Bryan Schumaker
ef5be29197
web: better controls
...
I split out the web controls to a new file, and can set the status of
the play button correctly when the page is loaded. Finally, the
set_play_button() function is called on a timer so changes on the
application will be reflected on the web page eventually.
2010-12-27 19:00:27 -05:00
Bryan Schumaker
0c636bfd56
Clean up universal_open()
...
The cleaned up version chooses what function to call based on file
extention. I use map.get() to pick a function, and use the open_music()
function as the default.
2010-12-27 12:06:22 -05:00
Bryan Schumaker
0b8bc2d7fc
Fix choosing random song when playlist is filtered
...
I was setting cur_index based on the index into the visible set, rather
than the index into the entire song list.
2010-12-23 09:53:30 -05:00
Bryan Schumaker
1c4621a79a
Set random directly
...
This makes much more sense than toggling it. Toggling caused an
inconsistent state during testing.
2010-12-23 09:51:09 -05:00
Bryan Schumaker
270d33d5ec
Reset playlist before loading xspf file
...
Loading an xspf file should replace the current playlist, rather than
add to it.
2010-12-18 16:45:48 -05:00
Bryan Schumaker
aa0f832356
Refresh the playlist after loading
...
After we load an xspf file, we should refresh the playlist to reflect
changes.
2010-12-18 16:44:18 -05:00
Bryan Schumaker
da99d4b349
Load xspf playlists
...
This patch adds loading of xspf playlists
2010-12-18 16:39:17 -05:00
Bryan Schumaker
77f065b703
Export playlist to xspf
...
This patch adds support for saving a playlist as an xspf xml file. I
only use the <location> tag to keep it simple.
2010-12-18 16:22:06 -05:00
Bryan Schumaker
da1a5413a4
Library source subdirectory filtering
...
When we add a path to the sources list, we should remove all paths that
are a subdirectory of the new path.
2010-12-18 15:35:51 -05:00
Bryan Schumaker
8d423629be
Add fewer library sources
...
If we are being asked to add a path that is a subdirectory of a current
library source then we shouldn't add it.
2010-12-18 15:28:53 -05:00
Bryan Schumaker
66a3344121
Controls pref initialization
...
The preferences variable should be initialized earlier to avoid an error
during startup.
2010-12-18 15:06:18 -05:00
Bryan Schumaker
3c2f40c69e
Move backup.py -> export.py, import v1.3 library
...
The move was supposed to be in the previous patch ... oops.
This one also adds in importing a v1.3 library xml file.
2010-12-18 15:03:24 -05:00
Bryan Schumaker
f869b17e2f
Rename backup functions
...
Backup has been renamed to export
Restore has been renamed to import_xml
2010-12-18 14:52:31 -05:00
Bryan Schumaker
c08655c1fa
More reformatting and comments
2010-12-18 14:49:35 -05:00
Bryan Schumaker
c49a39ad46
Encode v1.3 library
...
This patch changes the encode functions to export a v1.3 library
2010-12-18 14:46:31 -05:00
Bryan Schumaker
cafc19fbed
Don't set score when importing library
...
The score system has been replaced with a like / dislike system. Score
is no longer an attribute that can be set.
2010-12-18 14:36:21 -05:00
Bryan Schumaker
8349efe8c7
Library export formatting changes
...
This patch rearranges the decode functions to put decoders for a single
version together. I also removed some extra whitespace and clearly
labeled the decoding sections.
2010-12-18 14:33:17 -05:00
Bryan Schumaker
0eb3a15783
Add functions for controlling "like"
...
This patch adds a function for getting the "like" status of the current
song. It also changes the "set_like" function to use an event, rather
than just setting it.
2010-12-18 11:03:25 -05:00
Bryan Schumaker
f55cb44a64
Fix set_attr()
...
First, set_attr() needs to find the id of the current song. Second, we
should save after changing attributes.
2010-12-18 11:02:32 -05:00
Bryan Schumaker
076e89783a
Add save() to the Source class
...
This will allow us to save any changes made to the Source()
2010-12-18 11:01:44 -05:00
Bryan Schumaker
401241ac47
Track recent songs for sequential next too
...
Why was I only adding recent songs to the list when picking a random
song? It really doesn't make any sense. This patch tracks recent songs
any time next() is called in the playlist.
2010-12-18 09:36:01 -05:00
Bryan Schumaker
2d0643dd7b
Just skip songs the user doesn't like
...
If the user doesn't like a song, we shouldn't have a 25% chance of
playing the song anyway. We should just pick a different song.
2010-12-18 09:27:01 -05:00
Bryan Schumaker
0bcb444317
Remove score field
...
This patch removes the score field from the Track() class
2010-12-17 23:37:06 -05:00
Bryan Schumaker
7c2778614d
Added control to set like value
...
First, this patch adds a function for setting attributes for the current
file. Second, it adds a function for specifically setting the "like"
attribute.
2010-12-17 23:33:05 -05:00
Bryan Schumaker
d91c099723
Added set_attr to the Source() class
...
Having access to the set_attr function should allow us to change
attributes for the current track easily.
2010-12-17 23:28:55 -05:00
Bryan Schumaker
0c254aa957
Remove score changing code
...
I am switching to a like / dislike system, so I don't need to worry
about scores anymore.
2010-12-17 23:18:19 -05:00
Bryan Schumaker
6449b6badb
Skip songs based on like, rather than score
...
I think I can get a better guess for what users like based on what they
tell me, rather than trying to analyze their playback habits.
2010-12-17 23:15:19 -05:00
Bryan Schumaker
da6b0fd3eb
Add "like" field to the Track() class
...
This will allow the users to tell us if they do or don't like a song.
Songs default to None for unrated songs.
2010-12-17 23:06:46 -05:00
Bryan Schumaker
4e5995ec64
Added pause_after control to libsaria
...
This gives me a chance to remove it as a plugin. I noticed that
sometimes I would hear a fraction of a second of music before the
pausing started. This should fix that.
2010-12-17 23:00:45 -05:00
Bryan Schumaker
b5fef6ba3c
Check if cur_source is None
...
We should do this before attempting to return an ID...
2010-12-17 08:31:22 -05:00
Bryan Schumaker
3abc80bdc4
Add seeking to controls
...
Seeking should be part of controls, rather than existing independently
as part of the audio package. This patch moves the seeking functions,
and removes the need to pass a specific number of seconds.
2010-12-16 22:08:26 -05:00
Bryan Schumaker
b6c9c12ea9
Remove datetime module import
...
This was added to test timing changes for my recent pickle improvements.
2010-12-16 11:02:32 -05:00
Bryan Schumaker
84eb73d2a2
Pickling improvements
...
By using pickle correctly, I can now load in files significantly faster
than the old way. Library loading times have gone from about 3 seconds
to 0.25 seconds. I like this.
2010-12-16 09:29:06 -05:00
Bryan Schumaker
677240eabe
Added toggle_play()
...
This function will call play() if audio is currently paused. It will
call pause() all other times.
2010-12-15 22:26:45 -05:00
Bryan Schumaker
588a2bfb7a
Update library in background
...
This patch adds a function for updating the entire library in the
background.
2010-12-14 20:37:15 -05:00
Bryan Schumaker
646fc59c5c
Save playlist after choosing next
2010-12-12 14:47:19 -05:00
Bryan Schumaker
6fc8415838
next() selects from queue
...
We check the queue for a song first, then go to the playlist.
2010-12-12 14:45:30 -05:00
Bryan Schumaker
4acb972583
Play songs in the queue
...
Selecting songs in the queue will play the song and remove it from the
queue.
2010-12-12 14:28:19 -05:00
Bryan Schumaker
f47aa206d1
Remove songs from queue
...
I can now remove songs from the queue. Additionally, I only add songs
to the queue if they are not already in it.
2010-12-12 14:20:12 -05:00
Bryan Schumaker
c7c81c1b03
Queue reset
...
I can now reset the queue to an empty state.
2010-12-12 14:13:18 -05:00
Bryan Schumaker
e7bab2fc94
Queue filtering
...
The queue can now be filtered using the default text entry.
2010-12-12 14:04:36 -05:00
Bryan Schumaker
e997d4df33
Fill queue page
...
This patch shows what songs are currently in the queue.
2010-12-12 13:57:26 -05:00
Bryan Schumaker
1e3c48bbf1
Add songs to the Queue
...
I can add songs from both the library and the playlist to the queue
2010-12-12 13:54:38 -05:00
Bryan Schumaker
25dcd0619c
Added framework for Queue
...
This patch adds the queue as a tab on the main window. I also added the
libsaria queue functions, but right now the don't do anything.
2010-12-12 13:46:49 -05:00
Bryan Schumaker
d01d75cbe5
Find artwork using new get_attrs()
...
Using the new get_attrs() function makes things easier, and allows us to
find artwork for songs played that aren't in the library.
2010-12-12 08:55:30 -05:00
Bryan Schumaker
4a3e6184ab
get_attrs uses list.append()
...
Appending to the list should be slightly faster than using +=
2010-12-11 21:54:36 -05:00
Bryan Schumaker
6957cc96f6
Clean up playlist
...
Removed extra spaces and old, commented out code
2010-12-09 08:11:31 -05:00
Bryan Schumaker
a233861cfd
Playlist with generic init function
...
The playlist is now initialized using the generic init function.
2010-12-09 08:10:42 -05:00
Bryan Schumaker
9acd22b402
Library with generic init function
...
The library is now initialized with the generic init function.
2010-12-09 08:09:37 -05:00
Bryan Schumaker
9785796642
Add generic init function
...
The generic init function will start a new thread and call the user
given init function with the user given callback function.
2010-12-09 08:07:53 -05:00
Bryan Schumaker
47927bf9d3
File source attrs added
...
I added length and year attributes
2010-12-08 07:59:20 -05:00
Bryan Schumaker
4749c49e16
Use the file source
...
When opening a file, we should use the file source instead of directly
loading it.
2010-12-07 20:47:32 -05:00
Bryan Schumaker
5fc2628160
Add file source
...
The file source is used to play and get attributes for files on disk
that the user wants us to play.
2010-12-07 20:46:42 -05:00
Bryan Schumaker
e2fa7fff78
Don't have named sources
...
I don't use the named of each source any more. It can be removed.
2010-12-07 20:45:30 -05:00
Bryan Schumaker
4af08350e2
cur_source no longer a string
...
It is now a pointer to the current source instance for faster access (no
dictionary lookup needed)
2010-12-07 20:10:33 -05:00
Bryan Schumaker
1089b85e88
Get_attrs current source
...
The generic get_attrs() function now works correctly. I had to
introduce a "get_cur_id()" function for each source to get this working.
2010-12-07 08:07:10 -05:00
Bryan Schumaker
9cef85a0e9
Remove play_selected_id
...
Nothing uses this function so it should be removed
2010-12-05 17:16:04 -05:00
Bryan Schumaker
265e063fe0
Remove lib_get_cur_id()
...
Nothing using this function, so it should be removed
2010-12-05 17:15:35 -05:00
Bryan Schumaker
f063da5b56
Began work on virtual sources
...
Virtual sources should make it easier to do things with the current song
without having to know anything about it (such as a song id or file
path).
2010-12-05 17:11:41 -05:00
Bryan Schumaker
a32315e1e5
Remove libsaria.sources.play_id
...
Nothing uses this function. Time to remove it
2010-12-05 13:50:24 -05:00
Bryan Schumaker
b6dba32e47
Rename file2id in backup
...
It is easier to use file_id
2010-12-05 13:42:23 -05:00
Bryan Schumaker
3eeb35d81c
Stop using file_to_id
...
We should now use file_id located in libsaria.path
2010-12-05 13:40:39 -05:00
Bryan Schumaker
fbfc5738c6
Bump version numbers
...
We are now developing Ocarina 4.3!
2010-12-05 13:40:15 -05:00
Bryan Schumaker
fff834a14c
Find file_id for a given path
...
Finding the id of a file shouldn't be the job of the library. Instead,
it should exist as part of the path minipulation code.
2010-12-05 13:29:10 -05:00
Bryan Schumaker
9646d256ff
Remove plist_refresh()
2010-12-05 13:18:29 -05:00
Bryan Schumaker
3e0b8de257
Rename library.sources
...
I think that "locations" is a better name than "sources". Also, it
avoids the confusion of library sources and current track sources.
2010-12-05 13:11:31 -05:00
Bryan Schumaker
7638fea8de
Bump versions
...
Bump the minimum version required for plugins. Also marked __dev__ =
False in Ocarina and Libsaria
2010-12-05 12:54:32 -05:00
Bryan Schumaker
c3dcb1c44c
Comment out unused library attributes
...
I don't use these right now, but I may in the future. For now, I will
just comment them out.
2010-12-04 13:39:33 -05:00
Bryan Schumaker
b64055d9b4
Don't load a song on empty playlist
...
If the playlist's cur_index is < 0, then we should not try to load a
song.
2010-12-04 13:38:40 -05:00