Anna Schumaker
afb2653f65
core/queue: queue_remove_all() returns count of tracks removed
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker
378ff72307
Remove core/containers/queue
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker
db01ed3208
core/queue: Use a GQueue directly
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker
2b426cff48
core/queue: Switch over to using struct queue_iter
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker
9835235acd
core/queue: Implement a new queue_iter
...
I plan to remove the containers/queue implementation, so we need a new
iterator for queue access.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker
6bb08ddbaa
core/queue: Call g_queue_*() functions directly
...
This is a first step to removing core/containers/queue
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker
e8d7576704
core/containers/set: Return status of set_insert() and set_remove()
...
I use this status indicator in the playlist code fairly often, so let's
return it directly rather than needing to code around it.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker
5a30a63904
core/string: Add string_match() function
...
This function is used to determine if both strings exist and have the
same contents.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker
e30f7f8115
core/tags/album: Add support for importing album artwork
...
This is needed so the user can manually set album artwork in the cases
where either we don't fetch the right image or no image is found.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-12 14:36:40 -04:00
Anna Schumaker
80d921343d
core/file: Add support for importing a file into the cache
...
This will be needed to allow the user to manually set album art from a
downloaded file.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-12 14:16:46 -04:00
Anna Schumaker
d0dddeacdb
core/tags/album: Add album_artwork_path() function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
d79eb2c9b8
core/tags/album: Add album_artwork_exists() function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
0d9b7baff6
core/tags/album: Add a pointer to the struct artist
...
This is needed for album art fetching to get more accurate results for
our MusicBrainz query.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
97c8f80393
core/idle: Add a way to reschedule idle tasks
...
This will be needed to reschedule MusicBrainz requests if the server is
busy.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
6b52775e58
core/idle: Add support for running idle tasks in a new thread
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
6a44f9e1a1
core/idle: Add idle_sync_t enum
...
I intend to use this to select between sync and async idle tasks.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
a6bfbbb1c6
core/file: Add file_remove() function
...
I plan to use this for upgrades to remove obsolete files.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
0344a2088d
core/file: Add cache_file_write() function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
9db9df619f
core/file: Add cache_file_close() function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
e137eb0108
core/file: Add cache_file_open() function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
3723dff87d
core/file: Add cache_file_exists() function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
79ecaa11fb
core/file: Add cache_file_write_path() function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
5dcf681e48
core/file: Add cache_file_path() function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
b5e13af30c
core/file: Add cache_file_init() function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
12949651f7
core/file: Add struct cache_file
...
I want to reuse as much file code as I can for cache files, but I need a
new struct since data and cache files track different properties.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
9e0f017e61
core/file: Build in minimum version checks
...
I don't think it makes sense that callers of file_open() are expected to
check the file version after opening. This should be something handled
by the file code so we can print a consistent error message.
Implements issue #5 : Better file versioning
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
ee4f0d4c89
core/file: Writes go to a temporary file first
...
And then rename the temporary file when closed. This protects users
data in case Ocarina gets killed.
Implements issue #31 : Make file writes seem atomic
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
224290d4eb
core/file: file->f_name can be a pointer
...
I'm only setting this to a static string, so it doesn't make sense to
store this as a char array. Let's use a string pointer instead.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
427319b72e
core/file: Move OCARINA_NAME configuration into version.h
...
I'm going to use this for saving album art to the right place. I moved
it into an include file to avoid duplicating code.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
98faba93d1
core/string: Add a string_length() function
...
This is a wrapper around strlen(), but checks for a NULL pointer first.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker
4998b0867b
core/tags/track: Find the average play count of tracks
...
This function returns the average count of tracks that have been played,
and not the average count of all tracks.
Implements #29 : Efficiently calculate average play count of tracks
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:11:06 -04:00
Anna Schumaker
1973d15605
core/tags/track: Count the total number of tracks played
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:10:52 -04:00
Anna Schumaker
a97ec66e7f
core/tags/track: Count the number of unplayed tracks
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:10:47 -04:00
Anna Schumaker
d825e2d481
core: Remove random functions
...
I no longer need these now that the queue is using the glib
g_random_int_range() function.
Implements #32 : Remove custom RNG code
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:10:30 -04:00
Anna Schumaker
0bcfa06bfb
core/containers/database: Add a function for loading databases when idle
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:06:57 -04:00
Anna Schumaker
a89aa5a201
core/audio: Trigger queue updates when changing tracks
...
I need to do this for temporary queues in addition to the collection for
bolding to work properly.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-07 09:01:13 -04:00
Anna Schumaker
aee4764a2c
core/queue: Add queue_erase() and qop_erase()
...
This function is similar to queue_remove(), except the remove can be
prevented if qop_erase() returns false.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker
8d2b0caf6c
core/tempq: Store queue operations passed to tempq_init()
...
We don't need different operations for each queue. If we store this
then a higher layer doesn't need to keep passing the same structure over
and over again.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker
5bc9f65cd9
core/tempq: Add tempq_index() function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-13 16:36:44 -04:00
Anna Schumaker
5419711409
core/queue: Add qop_deinit() queue operation
...
This function is used to notify a higher layer that a queue is being
deinitialized. The higher layer should then clean up any state
associated with that queue.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-13 16:36:44 -04:00
Anna Schumaker
8bb7a20ff4
core/queue: Add qop_init() queue operation
...
This function is used to notify a higher layer that a queue has been
initialized. That higher layer can return a pointer to be attached to
the "private data" field of the queue.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-13 16:36:44 -04:00
Anna Schumaker
13dadd25ef
core/audio: Remove audio_stop() function
...
It has no users now that the stop button has been removed.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-10 11:15:35 -04:00
Anna Schumaker
50a7c83d61
gui/audio: Convert gst.cpp to audio.c
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 13:16:10 -04:00
Anna Schumaker
711eb67f44
core/queue: Fix queue random and selection test
...
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>
2016-03-28 08:03:21 -04:00
Anna Schumaker
0cf5187867
core/audio: Add on_state_change() audio operation
...
Called to notify when playback state has changed.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker
ed5f035855
core/audio: Rename audio_get_player() to test_audio_player()
...
Also, let's only have this function when CONFIG_TESTING is enabled.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker
2586348921
core/audio: Convert file to C
...
I also convert core/core.c so the audio test can be converted at the
same time.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker
a59a71eb38
core/core: Move core_deinit() out of the core namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker
04291f4296
core/core: Move core_init() out of the core namespace
...
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
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
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
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
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
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
Anna Schumaker
8c8ab2a9eb
core/idle: Add idle_cancel() function
...
This function is used to cancel all idle tasks and free the memory
allocated for them. This needs to be called when Ocarina is shutting
down to prevent a possible hang with the gtk idle callback continuing to
process tasks.
Fixes #30 : Closing Ocarina should cancel idle tasks
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-01 08:27:13 -05:00
Anna Schumaker
b3592e40c0
core/playlist: Rename PL_BANNED -> PL_HIDDEN
...
"Banning" a track is a bit harsh. Let's talking about hiding tracks
instead, so that it sounds friendlier.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-29 13:22:31 -05:00
Anna Schumaker
fef3ef3353
core: Initialize the playlist before the collection
...
I think it makes more sense to have the collection manage if banned
tracks are displayed or not, rather than doing this from the playlist
layer.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker
beda9bfa3f
core/collection: Add functions to ban and unban tracks
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker
3b5bbf14af
core/playlist: playlist_remove() can return a boolean
...
The collection will be using this soon to tell if a track was
successfully unbanned.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker
20825613e9
core/playlist: playlist_add() can return a boolean
...
There is at least one place in the gui where it needs to know if a track
was actually added to a playlist. Adding a return value is the best way
to know what happened.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker
02c82c182e
core/playlist: Convert file to C
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker
b7a4bb3872
core/playlist: Use playlist_t enum to access playlists
...
Using strings is pretty tedious, so let's restrict restrict playlist
access to known values.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker
88f6fc526c
core/playlist: Add a function to remove banned tracks
...
This replaces the get_tracks() function.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker
4e6028cf6e
core/playlist: Move playlist_remove() out of the playlist namespace
...
I also remove redundant unit tests.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker
0e3d6251d3
core/playlist: Move playlist_add() out of the playlist namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker
82ed2f2dc0
core/playlist: Move playlist_get_queue() out of the playlist namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker
6f0b95608a
core/playlist: Move playlist_select() out of the playlist namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker
1d3a762936
core/playlist: Move playlist_has() out of the playlist namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker
1f5ce9e0d1
core/playlist: Add playlist_deinit() function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker
b1c5d42387
core/playlist: Move playlist_init() out of the playlist namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker
7065b6312e
core/collection: Convert file to C
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-12 09:47:16 -05:00
Anna Schumaker
f413d14720
core/collection: Move collection_save() out of the collection namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-12 09:37:26 -05:00
Anna Schumaker
295a4424ed
core/collection: Move collection_get_queue() out of the collection
...
namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-12 09:37:26 -05:00
Anna Schumaker
89ce6d725c
core/collection: Add collection_deinit()
...
To clean up the collection queue.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-12 09:37:26 -05:00
Anna Schumaker
62f0606cd6
core/collection: move collection_set_enabled() out of the collection
...
namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-12 09:37:26 -05:00
Anna Schumaker
8a1f5403d0
core/collection: Move collection_update() out of the collection namespace
...
And bring collection_update_all() along with it.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-12 09:37:26 -05:00
Anna Schumaker
0cb16f5c64
core/collection: Move collection_remove() out of the collection
...
namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-12 09:37:26 -05:00
Anna Schumaker
6e39e17060
core/collection: Move collection_add() out of the collection namespace
...
This patch breaks later tests, since I needed to remove the old ogg
files. This will be fixed in a few more patches.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-12 09:37:26 -05:00
Anna Schumaker
3204fc0e44
core/collection: Move collection_init() out of the collection namespace
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-12 09:37:26 -05:00
Anna Schumaker
e47540a84e
core/queue: Add queue_clear()
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 10:12:09 -05:00
Anna Schumaker
cc164fc4ee
core/queue: Add queue_deinit()
...
To clean up a queue when we're done with it.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 10:12:00 -05:00
Anna Schumaker
9701da5392
core/queue: Add a function to resort the queue
...
This can be combined with the Q_ADD_FRONT flag for efficient bulk
insertions.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
0b84b6180c
core/queue: Convert file to C
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
799a8d34b5
core/queue: Convert q_sort to a GSList
...
I needed to bump the track comparison fields by one so I can use signed
values to indicate sort order. I updated core/library.cpp to add and
subtract one as needed.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
6fa78dbf3a
core/queue: Convert q_cur into a queue iterator
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
8fb64015b4
core/queue: Replace vector with struct _queue
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
0a331a44f5
core/queue: Replace on_track_updated() with qop_updated()
...
This patch also removes the now-unused queue notifier class.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
da0c96ac51
core/queue: Replace on_track_removed() with qop_removed()
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
df06b444cf
core/queue: Replace on_track_added() with qop_added()
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
daa09becf7
core/queue: Remove queue destructor
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
6aab58629e
core/queue: Move read() and write() into TempQueues
...
These functions are only used by temporary queues, and the collection
queue has its own save function.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
acc78a6667
core/queue: Move queue_remove_all() out of the queue struct
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
ea00b406e5
core/queue: Move queue_remove() out of the queue struct
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
d5e34b76d4
core/queue: Add Q_ADD_FRONT flag
...
This tells the queue to always add tracks at the front.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
8fe85b9782
core/queue: Move queue_add() out of the queue struct
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
4c4d0ab6ce
core/queue: Move queue_sort() out of the queue struct
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
13723856fc
core/queue: Move queue_{set|unset}_flag() out of the queue struct
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
be5d028fcf
core/deck: Wire up the qop_save() function
...
So temporary queues can save when flags change or when sorted.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
9451a41ff1
core/collection: Wire up the qop_save() operation
...
This will be triggered both when queue flags are changed and when the
queue is sorted.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
ce55ef2421
core/queue: Add queue operations vector
...
And a function to help with saving queues. This patch also adds the
Q_SAVE_FLAGS and Q_SAVE_SORT queue flags to control if the queue should
be saved when flags are changed or when the queue is sorted.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
b3a8fa293b
core/queue: Move queue_has_flag() out of the queue struct
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
3e5bef5f3c
core/queue: Move queue_updated() out of the queue struct
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
ff0c2a09a8
core/queue: Move queue_at() out of the queue struct
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
c259177dde
core/queue: Move queue_size() out of the queue struct
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
331e56716a
core/queue: Move queue_next() out of the queue struct
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
6bd625f65b
core/queue: Move queue_selected() out of the queue struct
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
d6ae61d915
core/queue: Remove queue :: set_notifier()
...
Let's just set the q_notify variable directly, rather than going through
a function.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
a721a95604
core/queue: Remove queue :: length()
...
Let's just access the q_length variable directly.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
281947aded
core/queue: Convert from class to struct
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker
b586461104
core/containers/queue: Add _q_clear() function
...
This is used to clean up the items on a queue, and should be called to
prevent memory leaks.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-25 08:08:28 -05:00
Anna Schumaker
4e8a63cc36
core/tags/track: Expand track_compare() to compare by different fields
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-15 15:10:44 -05:00
Anna Schumaker
08c7323dfc
core/tags/track: Move comparison fields into track.h
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-15 15:10:44 -05:00
Anna Schumaker
9a16a18b9f
core/tags/album: Add an album_compare_year() function
...
With special handling for albums with the same year but different names.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-15 15:10:44 -05:00
Anna Schumaker
f44710f7ae
core/containers/queue: Add _q_add_sorted() function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-15 15:10:44 -05:00
Anna Schumaker
b36869ff93
core/containers/queue: Add _q_sort() function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-15 15:10:44 -05:00
Anna Schumaker
b7e4a1de23
core/containers/queue: Add _q_remove_it() function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-15 15:10:44 -05:00
Anna Schumaker
e87e37414d
core/containers/queue: Add _q_for_each() function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-15 15:10:44 -05:00
Anna Schumaker
f26b50bdf8
core/containers/queue: Add _q_iter_set() and _q_iter_val()
...
This patch implements basic queue iterator functions for accessing
specific positions on the queue.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-15 15:10:44 -05:00
Anna Schumaker
1fefbb6b4a
core/containers/queue: Add _q_add_head() function
...
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-15 15:10:44 -05:00