Commit Graph

31 Commits

Author SHA1 Message Date
Anna Schumaker c2178bc265 core: Cut back on hardcoded dbe_index uses
The dbe_index of a given database item might change in the future, so we
can't rely on it everywhere.  Let's just use it for saving and loading
files, with the expectation that changes will happen sometime after
startup.

Implements #69: Reduce use of dbe_index in Ocarina code
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-11 10:50:45 -04:00
Anna Schumaker a70b27779f core/tags/artist: Add artist_match_token() function
This is called to check if any string in an artist's token list is
prefixed by the given string.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-29 07:33:00 -04:00
Anna Schumaker b643b532d7 core/tags/artist: Convert lowercased string into tokens
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-29 07:32:59 -04:00
Anna Schumaker 20e0a85a5d core/tags/artist: Add an artist_db_get() function
This will be called to scan the artist database when setting up
playlists.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker b3922cc731 core/tags/artist: Add an artist_lookup() function
For looking up artist tags without allocating a new one.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker e41f554b2e core/tags/artist: Add a pointer to store a playlist
Similar to the library tag, this is a void pointer that should only be
used by the playlist layer.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 92a53d90b4 core/database: Move database out of containers/ subdirectory
It doesn't make sense to have a subdirectory with a single file.  Let's
move it back to core/

Implements #45: Move database into core/
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:06:01 -04:00
Anna Schumaker c34f0c160d core/containers: Move database into the containers/ directory
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-15 15:10:44 -05:00
Anna Schumaker 6d9c89392e core/tags/artist: Convert file to C 2016-01-11 09:35:59 -05:00
Anna Schumaker c07d1e9024 core/tags/artist: Replace std:string with gchar *
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-11 09:35:59 -05:00
Anna Schumaker d404579297 core/tags/artist: Replace constructor with a backwards pointer
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-11 09:35:59 -05:00
Anna Schumaker 877d9ac1d7 core/database: Convert file to C
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:48:19 -05:00
Anna Schumaker 4a4529b158 core/database: Replace std::map with a glib hash table
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:48:19 -05:00
Anna Schumaker 1c22ecfda4 core/database: De-templatize the database
We now have an interface for controlling everything through struct
db_entry, so let's just have the database store a db_entry directly.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:48:18 -05:00
Anna Schumaker 1bef380ba7 core/database: Introduce the dbe_key() database operation
And store the result in the db_entry struct for use later.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:48:18 -05:00
Anna Schumaker f51852f62e core/database: Introduce the dbe_write() database operation
For writing database entries to disk.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:48:18 -05:00
Anna Schumaker 2da33f1c75 core/database: Introduce the dbe_read() database operation
This function allocates and returns a new database entry using
information read from a file.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:48:18 -05:00
Anna Schumaker 049156a523 core/database: Introduce the dbe_alloc() database operation
For allocating new database items from a given key.  Tracks do not need
this function since we have special handling for creation and insertion.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:48:18 -05:00
Anna Schumaker ab1572ed34 core/database: Add operations vector
I intend to replace C++ inheritance with this struct of function
pointers.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:48:18 -05:00
Anna Schumaker 3eb27debfb core/database: Convert DatabaseEntry class into a struct
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:48:18 -05:00
Anna Schumaker fe3d7867d1 core/tags/artist: Directly inherit from DatabaseEntry
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker 405ff0cf88 core/tags/artist: Move artist_db_init() out of the tags namespace
And add the function artist_db_deinit().

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker 52886c926e core/tags/artist: Move artist_find() out of the tags namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker 81518dce47 core/tags/artist: Move artist_get() out of the tags namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker 2c5c0aa7e0 core/tags/artist: Convert Artist class to a struct
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05: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 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 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 a1432a66e1 Artist: Update documentation
I add more details and remove this section of the DESIGN file.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-03 13:03:06 -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 aa758481eb tags: Move artist tag to a new header file
I created a new directory for tag related code.  This keeps the core/
directory cleaner and prevents file name collisions between the library
layer and the library tag.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-03 13:02:47 -05:00