Commit Graph

845 Commits

Author SHA1 Message Date
Anna Schumaker ea49b374ee gui: Remove gui.cpp
This file doesn't do anything anymore, so move the init functions into
main.cpp and remove the file.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-15 09:40:17 -05:00
Anna Schumaker 4643a5ff22 gui: Move pause count widgets into gst.cpp
These values affect audio playback, so they should go with the other
audio widgets.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-15 09:35:33 -05:00
Anna Schumaker ed88bb08bd gui: Move toggle function to gst code
This lets me remove the controls.cpp and controls.h files.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-14 19:50:26 -05:00
Anna Schumaker 434b278b61 gui: Move position tracking into gst code
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-14 19:50:25 -05:00
Anna Schumaker e539a2d208 gui: Move remaining buttons into gstreamer code
These buttons directly affect audio playback, so let's move them with
the rest of the audio buttons.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-14 19:19:50 -05:00
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 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 6cfd0d5c51 tests: Rework much of the testing library
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>
2015-01-13 09:35:26 -05:00
Anna Schumaker 92d264d4ac audio: Move Driver into audio.h
I also rename from Driver -> AudioDriver.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 15:48:07 -05:00
Anna Schumaker acac350879 audio: Remove on_pause_count_changed callback
The UI should handle this directly on end-of-stream messages.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 15:44:40 -05:00
Anna Schumaker 50147ef070 gui: Handle pause counts from the GSTDriver
I think it makes sense to handle this directly from the driver, rather
than going through a callback.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 15:27:18 -05:00
Anna Schumaker 6a117c762e driver: play() and pause() shouldn't return a boolean
This value is never used in the audio layer so let's stop returning it
from the driver.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 14:32:31 -05:00
Anna Schumaker b633f3fa0c gst: Update the "now playing" fields through the GST driver
This lets me remove the on_track_loaded() callback function by handling
this event directly.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 12:05:22 -05:00
Anna Schumaker d7113cb124 driver: Pass Tracks to the load() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 12:01:38 -05:00
Anna Schumaker a4ad0aa79b driver: Fold eos() into the driver
With this patch I no longer need a Driver :: init() function to handle
picking the next track.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 11:04:14 -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 e7a8ad54bd Audio: Remove the driver on_error() callback function
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>
2014-12-19 17:26:39 -05:00
Anna Schumaker 5b32bb16b4 Audio: Make the TestDriver class completely internal to the audio test
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>
2014-12-19 17:21:32 -05:00
Anna Schumaker b9d4c6749d audio: Move the get_driver() function into the audio namespace
It's already in the audio.cpp file, so just reshuffle things a little
bit.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-19 14:54:12 -05:00
Anna Schumaker 1d2b52cc98 driver: Move the GST driver into the gui
This is a straight copy-and-paste of the header file and the code
implementing it.  I intent to clean this up with future patches.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-19 14:25:59 -05:00
Anna Schumaker c12dbae73a driver: Track current driver with a pointer
This will let me implement drivers outside of this file allowing for
easier customization.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-19 14:20:30 -05:00
Anna Schumaker 4a57b170cd audio: Update doxygen documentation
And remove the Audio section of the DESIGN file.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-19 13:45:55 -05:00
Anna Schumaker 326865f6be driver: Update doxygen documentation
This lets me remove the Audio Driver section of the DESIGN document.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-19 13:37:44 -05:00
Anna Schumaker 31a405d3c6 deck: Update doxygen documentation
Also remove the deck section of the DESIGN document.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-12 08:25:53 -05:00
Anna Schumaker 9cbff6e9a1 Playlist: Update doxygen documentation
I also remove the playlist section of the DESIGN document.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-11 08:23:08 -05:00
Anna Schumaker 7ec7026863 Library: Update doxygen documentation
Also, remove the library section from the DESIGN document.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-10 08:23:53 -05:00
Anna Schumaker 0758f08642 Queue: Remove _del_at
I merged it with _del(index) since they are for exactly the same thing.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-09 08:50:03 -05:00
Anna Schumaker 39eb22f05c Queue: Update doxygen documentation
I also remove the related section of the DESIGN document.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-09 08:40:14 -05:00
Anna Schumaker 6f58813b3c Queue: Clean up doxygen comments for sorting flags
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-07 10:08:21 -05:00
Anna Schumaker a1b6955a1d Queue: Clean up queue flags
Reformat the doxygen comments and remove the unused Q_FLAG_MASK
constant.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-07 09:58:47 -05:00
Anna Schumaker 30b2ba0fff Track: Doxygen documentation updates
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>
2014-12-04 08:31:52 -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 4224d89813 Track: Add a function for finding track_db size
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>
2014-12-04 08:31:52 -05:00
Anna Schumaker 45c83ed2fd Track: Add a function for removing all tracks from a given library
This function will be called when doing library removals.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker 9dfec9934c Track: Add a function for removing specific tracks from the track_db
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker d5fc2a4de0 Track: Add a function for saving the track_db
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>
2014-12-04 08:31:52 -05:00
Anna Schumaker 83cc81c934 Track: Add a function to look up Track tags by index
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker a30f5ef794 Track: Create an add_track() function
We return a new Track tag or NULL if we have already tagged this track.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker d7ceadafb3 Track: Implement a copy constructor
This keeps library size accurate when adding new tracks to the track_db.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker 44aac0dcec Generic: Create a copy constructor
Track tags need a copy constructor to keep library size accurate, so
create one here.
2014-12-04 08:31:52 -05:00
Anna Schumaker 4edbd69fa7 Track: Change constructor to take relative paths
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>
2014-12-04 08:31:52 -05:00
Anna Schumaker 50a627412f Track: Move less_than() function into the queue code
The track provides ways of accessing these fields, but I want the queue
to decide how to sort.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker b5a529795d Track: Add a function for comparing two dates
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>
2014-12-04 08:31:51 -05:00
Anna Schumaker de1b5fcef3 Track: Remove old constructor and tag() function
The new constructor covers these cases without needing to do taglib
stuff inside the Track class.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -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 6daa26f0d6 Track: Make filepath private
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>
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