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>
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>
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>
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>
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>
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>
The new constructor covers these cases without needing to do taglib
stuff inside the Track class.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
I transfer everything from my DESIGN file into doxygen, and then remove
the section from DESIGN.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
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>
I added a little more detail about how this function works. This lets
me remove this section from the DESIGN file.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
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>
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>
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>
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>
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>