Commit Graph

131 Commits

Author SHA1 Message Date
Anna Schumaker ead1397b31 Remove Doxygen tags
I wasn't actually using Doxygen for anything, so it's probably best just
to remove it.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-09-02 14:24:42 -04:00
Anna Schumaker ec4d3b945e audio: Fix seeking on ARM
The on_seek() function needs to take an int64_t to avoid truncating on
ARM.

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2015-04-14 09:05:09 -04:00
Anna Schumaker 657ce8f0f4 audio: Ensure position and duration results are 64 bits
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>
2015-04-14 09:05:05 -04:00
Anna Schumaker eabb5ef856 queue: Remove Q_NOTIFY_REMOVE flag
It no longer has any meaning.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-09 09:27:46 -04:00
Anna Schumaker 9180545bc2 queue: Remove on_remove() notification
I no longer need it to pass queue-removed messages to the gui.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-09 09:26:36 -04:00
Anna Schumaker c80468a739 callback: Remove all references to callbacks
Callbacks have no remaining users and can safely be removed :)

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-04 10:21:31 -04:00
Anna Schumaker 116d1cd28f deck: Make sure that Q_NOTIFY_REMOVE is set
TempQueues need this to tell the GUI when they have been removed.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-04 10:20:53 -04:00
Anna Schumaker e8b68b84eb queue: Add an on_remove() notification to the QNotifier class
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-04 10:20:49 -04:00
Anna Schumaker c068cbb736 callbacks: Remove on_pq_track_changed()
It's been replaced with a function int he QNotifier class.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-03 21:03:05 -04:00
Anna Schumaker b95bbe6ad4 queue: Create an on_track_updated() callback
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-03 20:55:07 -04:00
Anna Schumaker 8cc48aa799 callbacks: Remove on_pq_track_deleted()
It's been replaced with a function in the QNotifier class.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-03 12:29:41 -04:00
Anna Schumaker 9eef2ad35d queue: Create an on_track_removed() notification
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-03 12:24:37 -04:00
Anna Schumaker 89a13ff6f7 callback: Remove on_queue_track_add() callback
It no longer has any users.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-03 12:20:07 -04:00
Anna Schumaker 91fc9436a5 queue: Give notifiers an "on_track_added()" function
So they can tell GUIs that something has been added.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-03 12:19:08 -04:00
Anna Schumaker c5598293d6 queue: Create a notifier class
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>
2015-04-03 12:16:40 -04:00
Anna Schumaker 75d39cbd85 playlist: Add a "least played tracks" playlist
This playlist will look for any track with a below average playcount.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-02-06 15:33:42 -05:00
Anna Schumaker 0997ffff99 playlist: Add a "most played tracks" playlist
This playlist will look for any track with an above average play count.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-02-06 15:10:38 -05:00
Anna Schumaker 64291ff02c playlist: Add an "unplayed tracks" dynamic playlist
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>
2015-02-06 14:33:57 -05:00
Anna Schumaker 93c9877d57 playlist: Allow selecting same playlist again
This will go unnoticed for Favorites and Banned playlists, but will
allow dynamic playlists to be refreshed without switching to a different
playlist first.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-02-06 14:15:06 -05:00
Anna Schumaker d0fb9b2155 playlist: Give PlaylistQueues a clear() function
This is used to clear the queue before populating it with a different
playlist.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-02-06 14:12:28 -05:00
Anna Schumaker f7eb34c2af string: Make _time_detail() static
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-30 10:54:40 -05:00
Anna Schumaker 3f423fb3ae filter: Use string :: lowercase() for searching
This is a much simpler way of doing things.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-30 10:54:39 -05:00
Anna Schumaker 7e58a4fef8 filter: Simplify adding words to the filter
I can use the lowercase text from string :: lowercase() and take a
single pass over a single string (rather than iterating through a list
of strings).

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-30 10:54:38 -05:00
Anna Schumaker 6c4dc5b1db filter: Remove lowercase() function
And switch everything over to using the new implementation.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-30 09:35:55 -05:00
Anna Schumaker 7733e24c07 string: Add a lowercase() function
This function strips out special characters and returns the lowercase
version of the string.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-30 09:32:50 -05:00
Anna Schumaker cc6f4c9293 string: Add a function for creating a detailed time string
I use this to display the total running time of queues in the gui.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-29 08:27:25 -05:00
Anna Schumaker ed43fd3689 More utos() cleanups
I found a few other places where I can use utos() instead of
stringstreams.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-27 14:03:12 -05:00
Anna Schumaker 12260a3de9 string: Add a function for converting seconds to string
This is used to get a string representation of the number of seconds
passed in.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-27 09:23:14 -05:00
Anna Schumaker 6c6437c2bd string: Create a utos() function
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>
2015-01-27 08:37:27 -05:00
Anna Schumaker 27c7dc91d8 queue: Fix up sorting
If years are equal then sort by album name.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-13 10:08:53 -05:00
Anna Schumaker 694d3f0316 build: Add gstreamer package from gui/Sconscript
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-02 10:31:14 -05:00
Anna Schumaker f84a1dd891 audio: Shuffle around the code a bit
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 16:05:01 -05:00
Anna Schumaker 21f3f7c828 Audio: Remove the _load_track_default() function
There are only two callers, and removing it makes the code more
obvious.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 15:58:29 -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 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 e866ea2574 audio: Make audio functions more consistent
Sometimes I would check for cur_track, other times !cur_track.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 10:30:22 -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 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 f20898b79c driver: Merge code with audio.cpp
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>
2014-12-19 14:37:56 -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 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 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 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