Anna Schumaker
03196c3efa
core/audio: Set up the gstreamer bus for the gui
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker
1d76990fd1
core/audio: Add audio_error() to handle error messages
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker
a5556ac10a
core/audio: Move audio_eos() out of the AudioDriver
...
This change lets me remove the AudioDriver, too.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker
276c56406a
core/audio: Move audio_pause_after() out of the audio namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker
d18d3dd214
core/audio: Move audio_prev() out of the audio namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker
3f25369444
core/audio: Move audio_next() out of the audio namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker
7765c2bf57
core/audio: Remove unused on_error() AudioDriver function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker
2511db3a08
core/audio: Add audio_cur_state() function
...
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>
2016-03-28 08:01:30 -04:00
Anna Schumaker
0a1a9f1394
core/audio: Move audio_cur_track() out of the audio namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker
d1d722a163
core/audio: Move audio_stop() out of the audio namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker
e1abe94b28
core/audio: Move audio_duration() out of the audio namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker
20bb01ef4e
core/audio: Move audio_position() out of the audio namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker
566ef3bb50
core/audio: Move audio_seek() out of the audio namespace
2016-03-28 08:01:30 -04:00
Anna Schumaker
9097bd0ffc
core/audio: Move audio_pause() out of the audio namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:29 -04:00
Anna Schumaker
16c4c23a42
core/audio: Move audio_play() out of the audio namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:29 -04:00
Anna Schumaker
e5c3d8f02e
core/audio: Move audio_load() out of the audio namespace
...
And add the on_load() audio operation.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:29 -04:00
Anna Schumaker
e0c89556ed
core/audio: Add audio_deinit() function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:29 -04:00
Anna Schumaker
d9540b29d6
core/audio: Move audio_init() out of the audio namespace
...
I also move the gstreamer playbin back into core/
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:29 -04:00
Anna Schumaker
b7bd7622b3
Ocarina 6.4.8
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-25 15:12:11 -04:00
Anna Schumaker
4323461bc6
core/queue: Adjust random track selection
...
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>
2016-03-23 11:36:42 -04:00
Anna Schumaker
6358124ce8
gui: Check the return code from collection_check_library()
...
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>
2016-03-23 09:58:17 -04:00
Anna Schumaker
aad90782ba
core/collection: Clean up error handling code
...
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>
2016-03-23 09:42:05 -04:00
Anna Schumaker
08bf842767
gui: Don't update gui if zero tracks were cleared
...
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>
2016-03-22 16:04:25 -04:00
Anna Schumaker
76985c8842
gui: Fix setting Q_RANDOM flag
...
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>
2016-03-22 09:36:32 -04:00
Anna Schumaker
5979d1dcaf
core/collection: Handle -EIO errors coming from the filesystem
...
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>
2016-03-21 08:36:48 -04:00
Anna Schumaker
2dd4f93bd0
gui: Don't call tempq_save() in the qop_cleared() handler
...
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>
2016-03-17 12:17:11 -04:00
Anna Schumaker
fea5da5c10
tempq: Close file if version check fails
...
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>
2016-03-17 11:48:04 -04:00
Anna Schumaker
7ff3dc92a0
Ocarina 6.4.8-rc
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 11:04:47 -05:00
Anna Schumaker
a248f8ebf7
core/tempq: Add a test for moving a NULL queue
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
06ea2d8c0e
core/tempq: Add a deinit() / init() loop to test_next()
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
882ee6e1e7
core/tempq: Convert file to C
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
187c56f328
core/tempq: Clean up reading and writing queues
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
5c92d0771f
core/tempq: Clean up tempq alloc and free
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
15f5b8fc87
core/tempq: Switch STL list for glib GSList
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
17981f4393
core/tempq: Switch queue list to store a queue pointer
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
27eab88b9c
core/tempq: Remove unused TempQueue class
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
9633806c2d
core/tempq: Merge TempQueue :: read() with tempq_init()
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
2102b1bfc9
core/tempq: Move tempq_save() out of the deck namespace
...
And remove the deck :: write() and TempQueue :: write() functions while
we're at it.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
b919843717
core/tempq: Add tempq_deinit() function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
b3d95a06d4
core/tempq: Move tempq_next() out of the deck namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
ecda136015
core/tempq: Move tempq_move() out of the deck namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
c22b93b2cf
core/tempq: Move tempq_get() out of the deck namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
6bdc481cb4
core/tempq: Make __tempq_index() private
...
It has no users outside of unit tests.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
06d62240bb
core/tempq: Move tempq_free() out of the deck namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
bce2ba33f7
core/tempq: Move tempq_alloc() out of the deck namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
8c7550d5c3
core/tempq: Move tempq_init() out of the deck namespace
...
I also take this opportunity to drop support for upgrading from file
format 0. I've had several releases since this format was supported, so
this should be safe to do.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
51379c7e8c
core/history: Add history_prev() function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
c125b3893e
core/history: Add history_add() function
...
I decided that having a uniqueue history queue doesn't really get me
anything, so I dropped that portion of the behavior.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
75c039f22d
core/history: Add history_init() and history_deinit() functions
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker
77d4815eb6
core/history: Move history queue into a new file
...
I think managing this separately from temporary queues will make the
code simpler.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00