Commit Graph

236 Commits

Author SHA1 Message Date
Anna Schumaker 9d84fdb8b7 lib: Make QueueModel variables private
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-13 20:34:33 -05:00
Anna Schumaker 4078f9a893 lib: QueueModel stamp cleanups
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-13 20:34:33 -05:00
Anna Schumaker e9e1e4fad8 lib: Clean up QueueModel on_row_*() functions 2015-01-13 20:34:33 -05:00
Anna Schumaker cba07b5957 lib: TreeIter cleanups
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-13 20:34:33 -05:00
Anna Schumaker ad584900fa lib: Clean up QueueModel switch statements
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-13 20:34:33 -05:00
Anna Schumaker 315a169136 lib: Model should use iter_to_id()
This is cleaner than doing the calculation in several places.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-13 20:34:33 -05:00
Anna Schumaker 06853b4f31 lib: Remove unused QueueModel functions
These are only needed if implementing a tree, and not a list.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-13 20:34:33 -05:00
Anna Schumaker cd8c76e1b2 gst: Move play and pause button handling into gst code
I can handle these widgets directly from within the gst driver.  I think
this is easier (and more straightforward) than handling this in a
separate file.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 15:02:17 -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 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 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 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 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 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 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 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 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 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 979de94712 lib: Fix setting share dir
Setting from argv[0] seemed like a good idea at the time, but argv[0]
can change based on how the user calls Ocarina (ocarina, ./ocarina,
/usr/bin/ocarina, ...).  This patch changes back to using the reliable
/proc/self/exe method.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-10-29 18:07:10 -04:00
Anna Schumaker 0b5478c591 lib: Move idle function setup into lib/
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-12 08:07:12 -04:00
Anna Schumaker df0d1496de lib: Create a schedule() function
This lets me clean up some of the code in controls.cpp

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-11 08:01:07 -04:00
Anna Schumaker c9cabb78f1 colmgr: Make sure banned tracks are removed when reenabling a library
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>
2014-08-19 08:57:36 -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 160d2ac3be plist: Move more playlist functions into lib/
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-07-27 11:41:40 -04:00
Anna Schumaker 97a8646977 plist: Move liststore into lib/
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-07-27 11:25:12 -04:00
Anna Schumaker 09af8d81d2 model: Move the custom TreeModel from gui/ to lib/
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-29 10:48:23 -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 76f0b7b55f lib: Move keyval parsing into lib/
I'll eventually add in checks for keypad vs top row number keys.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-22 11:42:01 -04:00
Anna Schumaker 80bed8b956 collection manager: Rename widgets in the glade file
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>
2014-06-22 11:19:05 -04:00
Anna Schumaker dd9f6de62f colmgr: Don't list NULL libraries
This leads to a segmentation fault...

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-22 11:14:54 -04:00
Anna Schumaker 3d067878f2 colmgr: Add a function for updating a specific path
On the gui end, call this function when a row in the "collected paths"
list is double-clicked.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-22 10:14:23 -04:00
Anna Schumaker a5f47e46a8 colmgr: Move some collection manager code into lib/
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-21 12:27:34 -04:00
Anna Schumaker 194a09bed4 lib: Initialize the GtkBuilder from the middle layer
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>
2014-06-15 11:31:04 -04:00
Anna Schumaker 4ed36c79df lib: Add support for looking up files from share/ocarina/
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>
2014-06-15 10:12:55 -04:00
Anna Schumaker 5b3f8b13e0 lib: Initialize core libraries from a new middle layer
My hope is that putting lib/ between core/ and gui/ will help clean up
gui code, since everything will no longer be in a single place.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-14 20:06:07 -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
Anna Schumaker 87af56ba85 Header file roundup
Create include/lib/ and include/gui/.  Move header files into the
appropriate directory.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-04 13:59:42 -04:00
Anna Schumaker 851be80a7d tags: Add artist and album names to the filter
Also decrement library count when deleting tracks.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-04 13:25:06 -04:00
Anna Schumaker c803699215 GSTDriver: Call on_eos() at End Of Stream
We kind of need to do this this to pick the next song ...

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-04 09:34:32 -04:00