The settings layer will track various configuration options set by the
user. This belongs in the gui, and not core, because it controls
settings specific to this gui implementation.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
It's better to have a single function loading tracks and adding them to
the history queue.
Fixes#2: Initial track not added to history
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
6.4.8 changed how random tracks are selected, but never updated the unit
test. This patch fixes the unit test, and makes a few changes to make
sure the right tracks are getting selected.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
The GUI needed an extra function to do this manually, which means it's
something that core should do instead.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This replaces the is_playing() function of the AudioDriver class. I can
also make the GUIs GstDriver static.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
Dividing queue size by 3 seems to give a better distribution of tracks,
but only for a large set of tracks (such as the entire collection).
let's skip the division if the queue only has a small number of tracks.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
If the library isn't valid, then we shouldn't try to pick another track
until the user fixes things.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I was assuming that my disk returns -EIO when it enters its failed
state, but it really seems to be return -ENOENT. Let's have this code
check for any error, rather than one specific one.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I'm seeing Ocarina crash when a tempq finishes and gets removed. For
now, let's only have the gui handle queue clearing if tracks were
actually removed.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I had the condition reversed for enabling random on temporary queues, so
the flag was getting set whenever I didn't want it.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
One of my disks frequently returns this error, and has wiped out my
track database on more than one occasion. Let's handle this error by
disabling the library until the user tells us it is safe to use again.
Fixes#33: Handle music directories disappearing better
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
The first thing queue_deinit() does is clear the queue, so calling
tempq_save() here will overwrite any tempq state currently on disk.
This seems reasonable at first, but ends up erasing any temporary queues
during Ocarina shutdown.
Fixes#34: Temporary queues not saving
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
We were returning right away if the file version check fails, without
closing the file. This could cause future reads or writes to fail to
open.
Fixes#25: File version checking doesn't look quite right
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>