I converted the test to the new framework, and I introduced a new
"test.h" file in the source directory to help with mixing C and C++
code.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
The version test is fairly simple, since it only tests the values set in
a single header file. The remaining tests will be more challenging,
since I'll have to modify core code and the test at the same time.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I commented out most of the file and directory modification code while I
was at it. I'll re-add these as I convert more files to C.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I want to make the scons files simpler, so I have decided to drop down
to only one test environment. This patch disables
tests/core/Sconscript, but I'll add this back in as I make other changes
throughout the codebase.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
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>
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>
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>
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>
I move the code into a new cpp file, so it is no longer a header-only
library. I also take the chance to add a for-each function for testing
iterators.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
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>
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>
It's not used anywhere else except during this one test, so move it out
of the global include files.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
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>
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 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>
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>
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 want to test basic reading and writing before running the functional
test, since the functional test will eventually trigger database
commits.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This makes the code a little bit cleaner, since we don't need to keep
doing lookups for each test run.
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>
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>
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>
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 tests all the basic things that the tag does: storing values and
reading / writing from file.
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 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>
My old testing system was rather convoluted. This patch makes the
Sconscript file easier to follow.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This issue was solved in Ocarina 6.1.3, but I didn't add a unit test for
it. This patch adds a test.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
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>
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>
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>
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>
o_collection_* was easily confused with widgets on the collection tab,
so I renamed everything to be less confusing.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This will provide an interface for accessing widgets, and make it easier
to swap out different builder files.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I replace the /proc/self/exe method with a simple hard-coded string.
This means that binaries run from the source directory need to be run
from the root of the source directory.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This just checks that the deck was initialized. To really be complete,
it should really check that ALL core libraries are initialized.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I move all of the core tests into the core/ directory to keep them
together. Gui unit tests will be put in new directories.
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>
This patch reworks the unit test using the TestDriver audio driver. I
also recode the audio layer to match the design and drastically clean up
the code.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This can only be hit when the tagdb has no tracks in it, since you can't
add a NULL pointer to the recent queue.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This would have to happen eventually. Might as well do it now!
I also updated the TestDriver test to match the changes I had to make.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
The driver is used to select between gstreamer playback and a fake
playback mode used only when testing.
Currently the GSTDriver has empty functions. It will be implemented as
the audio.cpp file is updated.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
TempQueues create a way to trigger deck :: write() whenever a queue
changes. This means higher layers don't need to remember to save after
changes!
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I update the unit test and redo much of the code to be cleaner and make
more sense. One big improvement is that the recently played queue will
now be managed by the deck.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
Keeping separate directories for all of these files isn't the most
obvious way to do things. Instead, move everything into the same
directory.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I'm about to bump the version number for the deck layer, so it makes
senes that different files need different version numbers.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
Lots of changes here! I switched from using track and library ids to
passing pointers, renamed some functions, and made the code much
cleaner.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This function is called to increment play count and set "date last
played" variables. Moving this into the Track class lets me remove an
internal callback and a few other unnecessary functions.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I updated the code to better match how I use playlists and to make sure
that everything is tested.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I now have a single function rather than 4 individual functions. The
code is cleaner, and I've added it to the unit test.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
It should take a Track pointer, rather than a track_id. This makes the
code easier to work with.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
... and just into the tests/ directory. I also reworked the Sconscript
to compile everything using only the lib/ files that are needed.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This might have made more sense for an earlier version of the
DatabaseEntry class, but as far as I can tell this test only checks code
that exists inside this file. This means I can removed it without
reducing code coverage.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
Looks like I missed updating a few places in the File class. I do that
now, and I also began updating the unit test to the new system.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
Add in several new features like:
- Don't exit until the specific test function completes.
- Make it easier to run named tests from C++.
- Use a macro to find line number when calling test :: equal().
- Use a macro to do basic setup and cleanup between test functions.
Also update the version test while I'm at it.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I remove the "on_queue_changed" callback in the flag handler functions,
so changes won't trigger a save until I can update later layers.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This makes testing easier, since I'll only see the test I need and not
everything that runs before it.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
So far I have renamed variables, changed a few functions, and updated
all the code that was affected.
Oh, I also started a new unit test.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I only needed this to make the jump from Ocarina 5.10 -> Ocarina 6.0.
It's not needed anymore, now that 6.0 is out.
Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
This should offer a performance increase since the item to insert will
only be copied if it is not already in the database.
Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
Inserting into a vector can sometimes cause the entire vector to
reallocate itself. The insert() function returns a pointer to the
caller, so this reallocation could invalidate the returned pointer.
This is not what we want.
Instead, store pointers to the data in the vector. C++ provides a
default copy constructor that can be used to allocate a new item before
inserting. By doing it this way callers won't have to allocate memory
themselves. In addition, I will no longer need to keep a valid bit
since we can simply check for a NULL entry in the database.
Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
This gives me the item directly, which is usually what I want when I
call these functions. Save iterators for iterating.
Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
I properly initialize variables, and I created supporting databases that
will be used to look up artist, album, genre and library information.
Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
Rather than returning an index into the database, instead return an
iterator pointing at the item we just inserted.
Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
I only had config so I could easily refer to the original Sconstruct. I
don't need that anymore =)
Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
I found that databases were always decrementing _size when remove() was
called. This patch fixes the bug by checking if the entry is valid
before removal.
Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
This will let me set up a Track class that has pointers to the
corresponding artist, album and genre information without needing to
know their IDs directly. Having this information available means I
won't need to keep a "join struct" when doing lookups - instead I can
return a pointer to a Track class that already knows everything.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I didn't have any changes to make to the IdleQueue itself, but I did
need to update the unit test and reword a few things in the design.
Signed-off-by: Anna Schuamker <schumaker.anna@gmail.com>
- filter :: add() now returns the lowercased text
- Don't cache lowercased strings
- Remove functions depending on CONFIG_TEST
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I updated the design and rewrote the unit tests. This creates something
more consistent with how I ended up using the index.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I add:
- Autosaving option
- Real iterators
- Better accessor functions
The new design and unit test also allows me to remove the 300,000+ line
"database.good" file that the old tests were based on.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
Needing to use throw / catch was getting in the way. Instead, check for
a boolean return value.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I changed primary_key() into a function since it is only called once,
and there is no point in using more mmemory than I need to. I also
created a basic unit test for everything that database entries are
supposed to do.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I'm taking a break from gui code to clean up the build system and update
my unit tests. This patch updates how code is built, and reworks my
"print" test to test version number instead.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
Start on the collection page. I eventually want to display the first
enable playqueue, though.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This prevents an error message (and possible corruption) by continuing
with the open() function even if the file doesn't exist.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This was a bug I discovered when double clicking on paths in the
collection manager to change the path in the FileChooserWidget.
Before this patch, strings could be read as:
<string> /home/anna/Music</string>
Now, the same string will be read as:
<string>/home/anna/Music</string>
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I implemented an entire Gtk::TreeModel in this commit, plus some minor
supporting code in the library to look up playlist entries by index.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
The signal connections for these features are really difficult to test
programmatically, but I can test the effects by calling each function
directly.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This allows a user to explore what has been added in each of their
library paths. Right now I filter for directories only, but it may be a
good idea to change this in the future.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
Gstreamer includes <errno.h>, which already defines several of these
symbols. I rename them to avoid namespace collisions. Perhaps a better
solution would be to use the errno.h definitions directly?
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This is used for the recently played playqueue to iterate backwards when
the previous() function is called.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This returns a pointer to the library :: Library structure requested.
The gui will use this to display information about each path.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I track the size of each library path for display purposes. I also had
to add in a check for if a new track already exists in the db before
tagging it so updating a library should be much faster now.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
The legacy file type will only be used for importing old libraries, so
point things to this directory on construction.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
- Combine Artist and Genre struct
- Add in exceptions, rather than boolean returns
- Update the library through idle tasks
I have not implemented importing Ocarina 5.11 libraries yet.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I changed the two playlists that are supported, added in exception
handling, and removed the list() function since I will always know the
names of playlists. I also rename everything to "playlist" from
"group".
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This function will convert the provided text to lowercase. This really
isn't a filter function, but the filter already implements a lowercase
cache that should be useful.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I had been returning success / failed boolean values for various
operations. I think it's better to throw an exception in these
"exceptional" circumstances since error values can give more information
about why a function failed.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This patch implements the pause-after-N-tracks feature. I also included
various improvements to the audio code.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
- Seek(), position() and duration() functions are implemented
- There are bugs in the test program :(
- Clean up next()
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
The read and write functions will be called by a higher up layer, so I
need to open the file manually in the test.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I make sure to remove empty playlists from the deck and throw an error
if there are no playable tracks on the deck.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
The file will be passed in by the deck layer, since it stores multiple
files. I just fake up a file in test_2() that is used for storing the
playlist.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I recreate the directory deleted in test 6c and make sure everything is
added back to the database in new rows.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I scan the track database and remove files that no longer exist. I
don't yet add in new tracks found in the directories.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This patch updates the design so indexes are built upon databases using
a special IndexEntry. I also updated the tests/index/ test to match
the new system, but I have not updated filter or group tests yet.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I require entries to have a "primary key" that is stored in a map to
make it easy to find database rows by key.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
If the id is valid, I fill out a song structure and return true.
If the id is invalid, I return false.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This is each song's track number, play count, and anything else specific
to a single file. After updating, save all the changed databases.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I don't build up a complete set of databases yet, but I do create the
Artist name database to use later.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
Eventually these functions may have to become idle tasks, but for now I
write to disk whenever the library_db is changed and then read from disk
by calling the init() function.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I can add and remove root-level directories from the library database.
I do not save the database when modified, and I don't yet run an update
on all the files.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
- Check if we are finding the "last" iterator in an empty database
- Better print() descriptions
- Print test return codes that aren't 0 to help find segfaults
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
It doesn't make sense to need to set this value outside of the database
code like I had been doing. So when a new row is inserted mark it as
valid right away.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This function is used in debug mode to print the current status of the
index. I also created a print_keys() function to only list the keys.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
Other tests may need to print out a database. To make this easier I've
added a print() function to the base database class. This function will
only exist when CONFIG.TEST == True, so don't use it outside of testing!
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
Rather than setting up all variables twice, just call reset() to
initialize everything. *BONUS* Reset can be used to initialize the
value of CONFIG.TEST!
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I was using my own cpp file to remove old test data to start with a
clean slate. I've decided it's easier to just remove the files before
running tests if they exist.
I also use this patch to update the test design and add an idea for the
future.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
For some reason I turned the file test into three separate files. All
other tests were in a single source file, so I updated file tests to
match.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
"basic" doesn't really fit the description for what I'm testing here. I
was expecting to do a series of unrelated tests, but all I'm really
doing it testing the print function.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
The library will need databases that have unique values (such as the
artist or album tables). This patch adds support for that in my
existing database code.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I assign tags to the 1, 10, 60, and 600 second long ogg files as they
are copied to the new library directory. This is much faster than
generating sound files on the fly, but it makes this commit 2.5MB in
size...
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
The idle queue is used to schedule tasks ... later. This code was
mostly adoted from a reference TDD experiment by Josh Larson
(themutatedshrimp@gmail.com). Thanks Josh!
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I only handle the "All Music", "Library" and "Banned" groups at the
moment but I'll eventually add in more features (in future versions).
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I have everything except for save() and load() written. My unittest is
fairly comprehensive and tests everything implemented so far, so with
any luck putting in save() and load() features will go quickly.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I had planned on using the stream operator for my database class but
this created some crazy compiler error that I was having difficulty
figuring out. I decided to take the easy route for now and instead
create read() and write() functions that do exactly the same thing.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
Items will be marked "invalid" rather than directly removed from the
database. This make it easier, since I won't need to reassign IDs to
every database item after the removed one.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
A database may have invalid rows. If this is the case, then the next()
function needs to return the id of the next valid row. I'm aware that
this could get horribly inefficient on large DBs with many invalid rows.
I don't expect people to delete large chunks of music all at once, but a
defragment tool is on my "todo" list for a future Ocarina version.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I've been excited about this! I think it'll be a better design than
what I had for Ocarina 5.x.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I changed print to compile in the dprint() function when the testing
flag is enabled. This allows tests to have the same output regardless
of debugging status.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
- Don't be verbose when removing files.
- Reverse diff order so output makes more sense.
- Only strip whitespace from the end of lines.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
- Inherit from fstream to gain access to << and >> operators.
- Make the file version accessable to the outside world.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
- Support OPEN_READ and OPEN_WRITE
- Update the design to accomidate for error checking
- Add lib/test.cpp containing basic functions that can be used for
testing
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
The class resolves the path to the ocarina directory based on the file
hint provided. NOTE: compile-debug.good and compile.good resolve paths
to my home directory. Other users will need to change the values for
the test to pass.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
The class is in charge of resetting fields at will, and will be able to
maintain everything easier than if I were to do it by hand.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I was using a debug and a release environment for programs, that way
both versions of tests could be checked. Instead, it'll be simpler to
only use a single environment and then control debug information using
CONFIG_DEBUG.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I store release and debug options in a list so that env.Replace() can be
used to set, modify, and restore values.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This lets me pull code out of the generic Sconstruct, so it can't be
bad! I also removed the test directory since I never made unit tests.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I want these to help check for memory leaks and other problems. Maybe
one day I can run them through Jenkins!
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
These files were created for developing small components during initial
design. I haven't used them in a long time, and most are probably
obsolete by now.
This patch adds a double-linked tree class for use in storing the
library. This class can walk backwards from a leaf node when
walk_backwards is called.
I can now backup the library to an xml file. This will be useful for
library updates in the future. The plan is to eventually backport this
feature to Ocarina 4.1 (To make the 4.1 -> 4.2 transition easier)
Libsaria events now support starting specific callback functions in a
background thread. This replaces starting a specific event in the
background.
I have a library tab that is added to the main window through use of the
ocarina.add_tab function.
I have new tests for walking the tree and running multiple threads with
locks.
I've begun work on a generic collection class for the library, playlist,
and queue. Tagpy functions have been merged into the
libsaria.collections.__init__.py file to make things easier.
I have reworked the gstreamer functions from Ocarina 4.0 and combined
everything into one file. I have also created an audio test that plays
a song from my library.
I combined various parts of the Ocarina 4.0 event system into one file.
The new event file has threading abilities built in, so I no longer need
an external file for that
I revised the Ocarina 4.0 map class so it will hopefully have better
performance. I also began working on a new testing system so testing
specific changes should be easier than with Ocarina 4.0