Commit Graph

738 Commits

Author SHA1 Message Date
Anna Schumaker 1a3735251d core/string: Move string_lowercase() out of "string" namespace
And refactor to use glib string functions while we're at it.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-10-07 09:54:16 -04:00
Anna Schumaker 83fe822dc7 core/string: Move sec2str_detailed() out of "string" namespace
I also take the opportunity to rename the function to
string_sec2str_long().

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-10-07 09:46:30 -04:00
Anna Schumaker 18b83f5c26 core/string: Refactor sec2str_detailed()
I only need one function to perform the entire conversion using
g_strdup_printf().  This helps to simplify the code before switching
over to C.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-10-07 09:41:17 -04:00
Anna Schumaker a314ee03ca core/string: Move sec2str() out of "string" namespace
And I replace it with a simple call to g_strdup_printf() that does the
exact same thing.  Note that callers are now required to free the
returned string with g_free().

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-10-07 09:33:50 -04:00
Anna Schumaker 82d1da491b core/string: Remove string :: utos()
I replace it with calls to g_strdup_printf().  This has the additional
benefit that I can do uint conversions at the same time as other
formatting options, so this seems like a win.  The only downside is that
I have to manually free the memory that glib allocates, but that's easy
enough.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-10-07 09:31:28 -04:00
Anna Schumaker cfca7fccb0 tests/core: Update random test to the new framework
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-10-07 08:26:29 -04:00
Anna Schumaker da8131aa6d tests/core: Update file test to new testing framework
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-10-07 08:26:27 -04:00
Anna Schumaker ead1397b31 Remove Doxygen tags
I wasn't actually using Doxygen for anything, so it's probably best just
to remove it.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-09-02 14:24:42 -04:00
Anna Schumaker ec4d3b945e audio: Fix seeking on ARM
The on_seek() function needs to take an int64_t to avoid truncating on
ARM.

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2015-04-14 09:05:09 -04:00
Anna Schumaker 657ce8f0f4 audio: Ensure position and duration results are 64 bits
A long int is shorter on ARM than x86, which could cause position and
duration values to get truncated.  Additionally, quering gstreamer with
a long int causes a compile error on ARM.  Let's just do the right thing
and make this value an int64_t.

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2015-04-14 09:05:05 -04:00
Anna Schumaker eabb5ef856 queue: Remove Q_NOTIFY_REMOVE flag
It no longer has any meaning.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-09 09:27:46 -04:00
Anna Schumaker 9180545bc2 queue: Remove on_remove() notification
I no longer need it to pass queue-removed messages to the gui.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-09 09:26:36 -04:00
Anna Schumaker c80468a739 callback: Remove all references to callbacks
Callbacks have no remaining users and can safely be removed :)

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-04 10:21:31 -04:00
Anna Schumaker 116d1cd28f deck: Make sure that Q_NOTIFY_REMOVE is set
TempQueues need this to tell the GUI when they have been removed.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-04 10:20:53 -04:00
Anna Schumaker e8b68b84eb queue: Add an on_remove() notification to the QNotifier class
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-04 10:20:49 -04:00
Anna Schumaker c068cbb736 callbacks: Remove on_pq_track_changed()
It's been replaced with a function int he QNotifier class.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-03 21:03:05 -04:00
Anna Schumaker b95bbe6ad4 queue: Create an on_track_updated() callback
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-03 20:55:07 -04:00
Anna Schumaker 8cc48aa799 callbacks: Remove on_pq_track_deleted()
It's been replaced with a function in the QNotifier class.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-03 12:29:41 -04:00
Anna Schumaker 9eef2ad35d queue: Create an on_track_removed() notification
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-03 12:24:37 -04:00
Anna Schumaker 89a13ff6f7 callback: Remove on_queue_track_add() callback
It no longer has any users.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-03 12:20:07 -04:00
Anna Schumaker 91fc9436a5 queue: Give notifiers an "on_track_added()" function
So they can tell GUIs that something has been added.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-03 12:19:08 -04:00
Anna Schumaker c5598293d6 queue: Create a notifier class
This class will be used to push queue changes directly to the GUI.
Currently changes get mapped through the old callbacks system, which can
lead to several inefficiencies because the GUI has to look up each queue
structure in a list.

This patch implements a basic QNotifier class and provides a function
for setting a Queue's notifier.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-03 12:16:40 -04:00
Anna Schumaker 75d39cbd85 playlist: Add a "least played tracks" playlist
This playlist will look for any track with a below average playcount.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-02-06 15:33:42 -05:00
Anna Schumaker 0997ffff99 playlist: Add a "most played tracks" playlist
This playlist will look for any track with an above average play count.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-02-06 15:10:38 -05:00
Anna Schumaker 64291ff02c playlist: Add an "unplayed tracks" dynamic playlist
Unplayed tracks is a dynamic playlist generated whenever we are asked to
select the "Unplayed" playlist.  Note that dynamic playlists aren't
hooked up to the other playlist functions (has, add, del, or
get_tracks).  This is to avoid adding them to the index and potentially
writing out to disk.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-02-06 14:33:57 -05:00
Anna Schumaker 93c9877d57 playlist: Allow selecting same playlist again
This will go unnoticed for Favorites and Banned playlists, but will
allow dynamic playlists to be refreshed without switching to a different
playlist first.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-02-06 14:15:06 -05:00
Anna Schumaker d0fb9b2155 playlist: Give PlaylistQueues a clear() function
This is used to clear the queue before populating it with a different
playlist.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-02-06 14:12:28 -05:00
Anna Schumaker f7eb34c2af string: Make _time_detail() static
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-30 10:54:40 -05:00
Anna Schumaker 3f423fb3ae filter: Use string :: lowercase() for searching
This is a much simpler way of doing things.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-30 10:54:39 -05:00
Anna Schumaker 7e58a4fef8 filter: Simplify adding words to the filter
I can use the lowercase text from string :: lowercase() and take a
single pass over a single string (rather than iterating through a list
of strings).

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-30 10:54:38 -05:00
Anna Schumaker 6c4dc5b1db filter: Remove lowercase() function
And switch everything over to using the new implementation.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-30 09:35:55 -05:00
Anna Schumaker 7733e24c07 string: Add a lowercase() function
This function strips out special characters and returns the lowercase
version of the string.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-30 09:32:50 -05:00
Anna Schumaker cc6f4c9293 string: Add a function for creating a detailed time string
I use this to display the total running time of queues in the gui.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-29 08:27:25 -05:00
Anna Schumaker ed43fd3689 More utos() cleanups
I found a few other places where I can use utos() instead of
stringstreams.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-27 14:03:12 -05:00
Anna Schumaker 12260a3de9 string: Add a function for converting seconds to string
This is used to get a string representation of the number of seconds
passed in.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-27 09:23:14 -05:00
Anna Schumaker 6c6437c2bd string: Create a utos() function
This function converts unsigned ints into strings.  This allows me to
replace several almost identical functions with one function call.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-27 08:37:27 -05:00
Anna Schumaker 27c7dc91d8 queue: Fix up sorting
If years are equal then sort by album name.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-13 10:08:53 -05:00
Anna Schumaker 694d3f0316 build: Add gstreamer package from gui/Sconscript
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-02 10:31:14 -05:00
Anna Schumaker f84a1dd891 audio: Shuffle around the code a bit
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 16:05:01 -05:00
Anna Schumaker 21f3f7c828 Audio: Remove the _load_track_default() function
There are only two callers, and removing it makes the code more
obvious.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 15:58:29 -05:00
Anna Schumaker 92d264d4ac audio: Move Driver into audio.h
I also rename from Driver -> AudioDriver.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 15:48:07 -05:00
Anna Schumaker acac350879 audio: Remove on_pause_count_changed callback
The UI should handle this directly on end-of-stream messages.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 15:44:40 -05:00
Anna Schumaker b633f3fa0c gst: Update the "now playing" fields through the GST driver
This lets me remove the on_track_loaded() callback function by handling
this event directly.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 12:05:22 -05:00
Anna Schumaker d7113cb124 driver: Pass Tracks to the load() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 12:01:38 -05:00
Anna Schumaker a4ad0aa79b driver: Fold eos() into the driver
With this patch I no longer need a Driver :: init() function to handle
picking the next track.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 11:04:14 -05:00
Anna Schumaker e866ea2574 audio: Make audio functions more consistent
Sometimes I would check for cur_track, other times !cur_track.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 10:30:22 -05:00
Anna Schumaker fd2a251c14 audio: Initialize GST from the gui layer
This means I no longer need to pass argc and argv parameters to core/,
so I can eventually work towards removing the Driver :: init() function.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 10:16:44 -05:00
Anna Schumaker e7a8ad54bd Audio: Remove the driver on_error() callback function
This was used to get around layering issues with the gstreamer driver.
Now that the gstreamer implementation is in the gui code we can have it
call audio::next() directly.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-19 17:26:39 -05:00
Anna Schumaker b9d4c6749d audio: Move the get_driver() function into the audio namespace
It's already in the audio.cpp file, so just reshuffle things a little
bit.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-19 14:54:12 -05:00
Anna Schumaker f20898b79c driver: Merge code with audio.cpp
The driver is intended to be a small class, so put it in the audio code
now and we'll clean it up in future patches.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-19 14:37:56 -05:00
Anna Schumaker 1d2b52cc98 driver: Move the GST driver into the gui
This is a straight copy-and-paste of the header file and the code
implementing it.  I intent to clean this up with future patches.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-19 14:25:59 -05:00
Anna Schumaker c12dbae73a driver: Track current driver with a pointer
This will let me implement drivers outside of this file allowing for
easier customization.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-19 14:20:30 -05:00
Anna Schumaker 326865f6be driver: Update doxygen documentation
This lets me remove the Audio Driver section of the DESIGN document.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-19 13:37:44 -05:00
Anna Schumaker 31a405d3c6 deck: Update doxygen documentation
Also remove the deck section of the DESIGN document.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-12 08:25:53 -05:00
Anna Schumaker 0758f08642 Queue: Remove _del_at
I merged it with _del(index) since they are for exactly the same thing.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-09 08:50:03 -05:00
Anna Schumaker 39eb22f05c Queue: Update doxygen documentation
I also remove the related section of the DESIGN document.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-09 08:40:14 -05:00
Anna Schumaker a1b6955a1d Queue: Clean up queue flags
Reformat the doxygen comments and remove the unused Q_FLAG_MASK
constant.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-07 09:58:47 -05:00
Anna Schumaker 30b2ba0fff Track: Doxygen documentation updates
This patch fixes up formatting a little bit and removes the Track
section of the DESIGN document.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker e7e36caa3a tagdb: Remove tagdb
This shifts the taglib code into library.cpp.  I also remove the tagdb
section of the DESIGN document.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker c7fe5b18d5 tagdb: Rip out most tagdb functions
Most of this are a straight replacement with the new versions in
tags/track.cpp.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker 2394e46fb7 Track: Re-enable filtering
This has been disabled for some time.  I added a test for adding track
indexes to the filter upon creation, but it doesn't properly test adding
to the filter when reading from disk.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker 09bf458d7a Track: Rename functional test to locale test
This code is really testing date and locale handling, so this patch
renames the function to match what it actually does.  While I'm at it, I
also introduce some cleanups.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker 4224d89813 Track: Add a function for finding track_db size
This returns the actual size of the database, so be careful when using
it!  The intent of this function is to allow some kind of iteration when
loading databases.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker 45c83ed2fd Track: Add a function for removing all tracks from a given library
This function will be called when doing library removals.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker 9dfec9934c Track: Add a function for removing specific tracks from the track_db
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker d5fc2a4de0 Track: Add a function for saving the track_db
The track_db doesn't have autosaving enabled for performance reasons.
This lets us add several tracks to the database between saves, but it
also means we need to provide a commit() function.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker 83cc81c934 Track: Add a function to look up Track tags by index
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker a30f5ef794 Track: Create an add_track() function
We return a new Track tag or NULL if we have already tagged this track.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker d7ceadafb3 Track: Implement a copy constructor
This keeps library size accurate when adding new tracks to the track_db.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker 44aac0dcec Generic: Create a copy constructor
Track tags need a copy constructor to keep library size accurate, so
create one here.
2014-12-04 08:31:52 -05:00
Anna Schumaker 4edbd69fa7 Track: Change constructor to take relative paths
I'm going to need to split this value earlier to do a unique lookup when
inserting, so the constructor can take the relative path to make things
easier.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker 2578cdadfe Track: Move read and write code into tags/track.cpp
Sadly, this patch disables filtering for tracks.  This will be reenabled
sometime soon!

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker 50a627412f Track: Move less_than() function into the queue code
The track provides ways of accessing these fields, but I want the queue
to decide how to sort.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker b5a529795d Track: Add a function for comparing two dates
I don't want to expose the date structure outside of the track class, so
I'll provide a comparison function instead.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker de1b5fcef3 Track: Remove old constructor and tag() function
The new constructor covers these cases without needing to do taglib
stuff inside the Track class.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker a2b3ca1292 Track: Make last played date private
This patch creates a new structure to track the last played date, which
can be expanded into a class at some future point.  Additionally, I use
strftime() to calculate the current date based on the user's current
locale settings.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 6daa26f0d6 Track: Make filepath private
I don't want anybody outside of this class changing the value, so it
shouldn't be public.  I also change the primary key to use library index
instead of the full filepath while I'm at it.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker cdd20da5c0 Track: Convert length_str into a function
I don't think this value needs to be stored anywhere in the Track class
since it's fairly easy to calculate.  Let's convert it into a function
for now and reevaluate later!

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 2540a6aa7a Track: Use GenericTag's _name and _lowercase fields
This lets me remove the duplicate title and title_lowercase fields from
the Track tag.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 1fdee864a2 Track: Hide length from the public
I provide an accessor function to keep this value from ever getting
changed outside of the Track class.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker eb23127f6d Track: Hide the play count from the public
I provide an accessor function to keep this value from getting changed
outside of this class.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 468a4e79d5 Track: Hide the track number from the public
I provide an accessor function to keep this value from ever getting
changed.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 91f6f54b4e Track: Add a test for the Track destructor
We want to make sure that the _library size is decremented whenever a
track is removed or destroyed.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 2dfa9bf168 Track: Hide the genre tag from the public
And set it using the new constructor.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker c6029f13f2 Track: Hide the album tag from the public
And set it using the new constructor.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 0a6ace3c14 Track: Hide the artist tag from the public
Also set it using our new constructor.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 6149c928d2 Track: Begin a new Track constructor
I want to provide the Library, Artist, Album, and Genre tags to the
Track on construction to (hopefully) eliminate the Track::tag()
function.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 37613573e4 Track: Hide the library field from the public
And provide an accessor function.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 7e52c9b364 Track: Move the default constructor to a new cpp file
I also use this opportunity to create a new default constructor test for
the Track tag.  This patch also disables the tags test since the tagdb
will be going away soon.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker cbcd9c594d GenericTag: Add a function for comparing tag names
I was only ever comparing the lowercase version of the name, so this
should be done in a single place (the GenericTag) to make maintenance
easier.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker f433ced9cb Library: Add functions for looking up or creating Library tags
This patch moves the library_db into tags/library.cpp, where it can be
effectively managed by the Library tag.  For this to work, I need to add
some extra functions to the tags namespace to:

	- Create new Library tags,
	- Find tags by index,
	- Remove the Library at a specific index, and
	- Find the actual size of the library_db.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 8545837672 Genre: Add functions for looking up or creating Genre tags
The genre_db should really be controlled from within the Genre tag,
so this patch adds functions to find or create Genre tags to the tags
namespace.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 7d3e9a3d28 Album: Add functions for looking up or creating Album tags
The album_db should really be controlled from within the Album tag, so
this patch adds functions to find or create Album tags to the tags
namespace.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker bac54857fd Artist: Add functions for looking up or creating Artist tags
The artist_db should really be controlled from within the Artist tag, so
this patch creates a new tags namespace containing functions that will
find or create tags as they are requested.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker d88f008728 Library: Update documentation for the Library tag
I also take the chance to remove the corresponding section of the DESIGN
file.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker ce8b3ada03 Library: Rename count -> _size
Also make it private and provide accessor functions.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 754d45efd0 Library: Make _enabled private
I added in accessor functions to get and set this value.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 01e514736e Library Tag: Make root_path private
And just change the name of the variable to "_path".

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 4d6cb81f77 Library: Move the Library tag into a new file
No code or documentation changes yet, just split things out for now.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 1e6bcf7451 Genre: Move Genre tag into a new file
- This tag now inherits from GenericTag.
- Add a Genre-specific unit test.
- Remove the genre tag section of the DESIGN file.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 2d9d87afc9 Album: Move Album tag into a new file
Also make it inherit from the GenericTag base class.  Also also, add a
unit test specific to Album tags.  Finally, I remove the corresponding
section of the DESIGN file since it is no longer needed.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:49 -05:00
Anna Schumaker a9fc53964c Artist: The ArtistTag should inherit from GenericTag
The GenericTag class provides most of the implementation, so use it!

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-03 13:03:11 -05:00
Anna Schumaker fb4f523206 GenericTag: Create a generic tag that other tag classes can use
This implements the basics so I don't need to keep reimplementing
everything.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-03 13:03:10 -05:00
Anna Schumaker b3d904c128 Artist: Move artist tag code into a new directory
core/tags.cpp was WAY too big, so I moved this code into a new file in
its own directory.  I also created a new unit test just for testing the
Artist tag.

This patch disables the "tags" test since it conflicts with the
tests/core/tags/ directory.  This is okay because the tagdb is gradually
being phased out!

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-03 13:02:49 -05:00
Anna Schumaker 2a65fe8db0 Filter: Add more detailed documentation
Also remove the corresponding section of the DESIGN file.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-11-08 11:26:04 -05:00
Anna Schumaker 158c0acf60 Index: Add more detailed documentation
This lets me remove this section of the DESIGN file.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-11-07 08:14:27 -05:00
Anna Schumaker 2b71ecbeca IndexEntry: Make _values private
I don't want anybody outside of the IndexEntry class to modify the
values in this container.  This patch makes it private and provides
iterator access instead.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-11-06 09:03:51 -05:00
Anna Schumaker e89941af31 IndexEntry: Write more detailed documentation
In addition to documentation updates, I also solve a few warnings that
Doxygen gives me.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-11-04 08:30:54 -05:00
Anna Schumaker 48b25945cc DatabaseEntry: Rename id to _index (and make it private)
This variable should only be set by the Database when a DatabaseItem is
first created.  This means I should hide _index from the rest of the
world to prevent accidental modifications.  I also add an accessor
function for other code that needs to read _index.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-11-02 10:25:41 -05:00
Anna Schumaker 47f6684923 file: Update documentation and various cleanups
I add more detailed documentation matching what was in my DESIGN file.
In addition, I also prefix private File members with an underscore like
I do in other Ocarina classes.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-11-01 21:56:59 -04:00
Anna Schumaker c19985fc7e tags: Add doxygen documentation
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-10-20 21:38:16 -04:00
Anna Schumaker 3d00a83b6a driver: Add doxygen documentation
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-10-20 21:38:09 -04:00
Anna Schumaker 9a5549a264 database: Add doxygen documentation
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-10-17 17:17:12 -04:00
Anna Schumaker 03e190149e index: Add doxygen documentation
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-10-17 16:49:17 -04:00
Anna Schumaker 59ffd5cbdf idle: Add doxygen documentation.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-10-17 09:56:54 -04:00
Anna Schumaker 5f56118c04 queue: Add doxygen documentation
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-10-17 09:42:45 -04:00
Anna Schumaker 7bde6d98aa file: Add doxygen documentation
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-16 08:22:44 -04:00
Anna Schumaker 0626141f7f filter: Add doxygen comments
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-16 08:09:40 -04:00
Anna Schumaker 73264e04ce playlist: Add doxygen comments.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-15 08:27:03 -04:00
Anna Schumaker d0fd103504 library: Add doxygen comments.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-13 10:39:30 -04:00
Anna Schumaker b68198028e deck: Add doxygen comments to deck.h
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-13 10:26:28 -04:00
Anna Schumaker ad48ac7d16 random: Add doxygen information
I updated the Doxyfile to extract static inline functions.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-13 10:00:03 -04:00
Anna Schumaker 97c6c836d3 Add doxygen documentation for callbacks.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-12 16:37:28 -04:00
Anna Schumaker 0a9c6d296b Add doxygen documentation for audio.h, core.h, and version.h
I want to have all of Ocarina documented in the code, rather than in a
difficult-to-maintain DESIGN file.  Let's get going on that!

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-12 16:36:46 -04:00
Anna Schumaker 5c2bd9231d core: Remove on_play() callback
It has no users anymore.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-11 08:01:08 -04:00
Anna Schumaker 1a6b6d9c54 audio: Remove the on_play() callback
There are no more users of this function.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-08 17:26:21 -04:00
Anna Schumaker 412dc67e1f Merge branch 'master' into Ocarina-next
Conflicts:
	Sconstruct
	gui/collection_mgr.cpp
2014-08-19 08:08:55 -04:00
Anna Schumaker 8fd5d8173e filter: Clear the result set before filtering
Ocarina was preserving the results set even if there were 0 search
results for the entire search string.  So a search for "walllllll" would
still return results for "wall".

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-08-12 10:23:33 -04:00
Anna Schumaker be72339b2d filter: Check for empty results when filtering
The user could search for a term that isn't stored in the filter index.
This is represented through a NULL pointer returned from the
Index.find() function.  Let's check this pointer before attempting to
dereference it ...

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-08-12 09:59:00 -04:00
Anna Schumaker b516afe832 core: Create a single init() function
Initialize everything from the core/ layer, that way lib/ doesn't need
to know the correct order.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-29 10:36:55 -04:00
Anna Schumaker e274d6399b tags: Fix when library->count is modified
Whenever a Track is destructed, library->count is decremented.  This
means that even if tagging fails we need to increment library->count to
keep this value consistent.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-22 12:59:27 -04:00
Anna Schumaker a74eaaffa6 tags: Check that a Track was tagged correctly
Without this check we could end up creating a Track for a .ini file or
some other non-audio file.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-22 12:35:08 -04:00
Anna Schumaker 5df79d3c08 callbacks: Remove unused queue callback
I now mimic the effects of the "changed" callback with inheritance.
This makes for a cleaner implementation.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-06 14:46:54 -04:00
Anna Schumaker 70254e7aa1 Remove error.h
It's not used by anything anymore.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-06 09:40:14 -04:00
Anna Schumaker bd11a320e3 tags: Correctly find the next iterator location
We need to use Database::next() rather than it++ to skip over deleted
tracks.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-06 09:21:30 -04:00
Anna Schumaker 00ff9cd08f playlist: Fix a null pointer dereference in init()
This happens if we try to use the Banned playlist before it exists in
the database.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-06 08:21:56 -04:00
Anna Schumaker 9e3399b619 deck: Reintroduce deck :: get()
This function turned out to be really useful for the gui.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-05 11:05:19 -04:00
Anna Schumaker 95064e4537 Rename lib/ -> core/
I plan to introduce a new lib/ that sits between the gui and the backend
files (similar to how glibc sits between the kernel and userspace).
This gets the rename out of the way before I change my mind again.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-05 10:21:32 -04:00