Commit Graph

152 Commits

Author SHA1 Message Date
Anna Schumaker 1b34a9a8a0 index: Update the index design
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>
2014-04-06 19:57:05 -04:00
Anna Schumaker fc8dc9d55e database: Design and test updates
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>
2014-04-06 19:57:05 -04:00
Anna Schumaker b251f27bb5 file: Don't use throw / catch to report errors
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>
2014-04-06 19:57:05 -04:00
Anna Schumaker 959cac0fe1 Database: Update design for database entries
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>
2014-04-06 19:57:05 -04:00
Anna Schumaker 0386b24309 Small file test cleanup
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker 972eb3c2aa tests: Only enable CONFIG_TEST if we are building tests
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker c263e0e524 tests: Change executable names
Make them end with .run so my .gitignore will pick them up.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker 336024bae9 file: Update design and create a new unit test
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker 3359cbae6f version: Update version test
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker 871914ea90 Clean up the build system
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>
2014-04-06 19:57:03 -04:00
Anna Schumaker a74cd5e6d1 tests: Update tests for recent deck change
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:02 -04:00
Anna Schumaker 37a776ef24 playqueue test fixes
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:02 -04:00
Anna Schumaker 8dbb4684c7 deck: Update test after sorting changes
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:01 -04:00
Anna Schumaker cde7e5d96c gui: Change default page
Start on the collection page.  I eventually want to display the first
enable playqueue, though.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:00 -04:00
Anna Schumaker a98443872c deck: Save the deck whenever a queue changes
I read in the saved file when init() is called.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:00 -04:00
Anna Schumaker aa40f1dfd5 gui: Create a history tab
Used to show tracks that have recently played.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:00 -04:00
Anna Schumaker 05148ba832 gui: Add UI controls for changing pause status
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:59 -04:00
Anna Schumaker c346a5860a gui: Implement control buttons
Play, pause, stop and so on.  I also update labels and progress bars
during playback.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:59 -04:00
Anna Schumaker 0f11ba0ee6 gui: Create a new test for the Collection tab
This is a bit cleaner that having one giant switch-statement based test.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:59 -04:00
Anna Schumaker 078cb546f5 deck: Initialize deck before library during testing
To properly set up callbacks.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:59 -04:00
Anna Schumaker e94063473e database: Check if files exist before opening
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>
2014-04-06 19:56:59 -04:00
Anna Schumaker 36b76dcfc3 tests: Exit on test failure
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:58 -04:00
Anna Schumaker 22cb20d4ce audio: Change state to NULL before quitting
This prevents a possible hang when de-initializing gstreamer.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:58 -04:00
Anna Schumaker aa21ab5602 file: Strip leading whitespace when reading strings
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>
2014-04-06 19:56:58 -04:00
Anna Schumaker 3d1e8872d3 gui: Create a common ocarina_init()
To initialize the needed backend modules, shared by normal main() and
testing main().

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:58 -04:00
Anna Schumaker 2ecb37f6dc Everything for a custom Gtk::TreeModel
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>
2014-04-06 19:56:58 -04:00
Anna Schumaker a0067c4542 gui: Respond to playqueue changed callbacks
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:58 -04:00
Anna Schumaker 2724b90281 gui: Add initial extra notebook tab
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:58 -04:00
Anna Schumaker f80203c5fe gui: Delete and disable library paths
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>
2014-04-06 19:56:58 -04:00
Anna Schumaker f51ba3e3ec library: Create a function for enabling and disabling paths
I also update the deck tests, since this is where changes will show up.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:58 -04:00
Anna Schumaker a077b8cbad gui: Change directory on row double click
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>
2014-04-06 19:56:58 -04:00
Anna Schumaker 74da7beba1 deck: Add a library playqueue
When no songs are on the deck a track will be played from the library.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:58 -04:00
Anna Schumaker 2535a2fe56 playqueue: Add a way to delete rows by track_id
This will be used to delete tracks that no longer exist in the library.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:58 -04:00
Anna Schumaker c2e7772ebe callbacks: Add initial callbacks
This patch adds library callbacks for adding a new path and for updating
tracks in a path.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:58 -04:00
Anna Schumaker 11704b2bfa gui: Add some collection manager tests
Test ok, update, and import buttons in a Glib::timeout based simulator.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:58 -04:00
Anna Schumaker eff294a7c7 library: Added an update_all() function
To update all paths in a library.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:58 -04:00
Anna Schumaker becf7f94bc gui: Begin implementing the gui
This adds the ocarina6.glade file and code for clicking the library
import button.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:58 -04:00
Anna Schumaker bb7c3b334a audio: Update expected output file
Somehow I missed this during my updates earlier.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:58 -04:00
Anna Schumaker c39a9058f4 tests: Update the Sconscript file
I reordered all the tests and adjusted for the subsystem renaming.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker 5c5e4a1a66 audio: Implement the previous() function
To iterate backwards through the list of recently played songs.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker bd2aaf73d1 audio: Updates for spec changes
This is mostly to add in checks for try / catch style error handling.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker 360ebed1fa errors: Rename error codes
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>
2014-04-06 19:56:57 -04:00
Anna Schumaker 1d559865c8 deck: Updates for the playlist -> playqueue renaming
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker 8e363fe7b2 playqueue: Add a function for resetting the current pointer
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>
2014-04-06 19:56:57 -04:00
Anna Schumaker e889ca538f playqueue: Implement length tracking
I use this to know the running time of the playqueue, which will be
displayed on the GUI.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker 82a57ec2b5 playqueue: Updates for my recent renaiming
Rename everything from playlist -> playqueue.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker 5dd5ec6db0 library: Add a lookup_path() function
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>
2014-04-06 19:56:57 -04:00
Anna Schumaker fa51433b94 library: Track the size of each path
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>
2014-04-06 19:56:57 -04:00
Anna Schumaker a2665d4e41 library: Implement importing old libraries
This adds backwards-compatibility for Ocarina 5.11 libraries.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker 94fdfda9fb file: Point FILE_TYPE_LEGACY to ~/.ocarina/library/
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>
2014-04-06 19:56:57 -04:00