Commit Graph

3856 Commits

Author SHA1 Message Date
Anna Schumaker 0e523ed279 core/playlist: playlist_has() takes a playlist pointer
Rather than going through a lookup step.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-28 09:40:02 -04:00
Anna Schumaker 3364d4733e core/playlist: playlist_remove() uses a playlist-level function pointer
Rather than going through playlist-type operations.  Additionally, I
take this opportunity to change playlist_remove() to take a playlist
struct directly.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-28 09:40:02 -04:00
Anna Schumaker 1b9cdf5a5c core/playlist: playlist_add() uses a playlist-level function pointer
Rather than going through playlist-type operations.  Additionally, I
take this opportunity to change playlist_add() to take a playlist struct
directly.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-28 09:40:02 -04:00
Anna Schumaker 066027ecb6 core/playlist: playlist_delete() uses a playlist-level function pointer
Rather than going through the playlist-type operations.  Additionally, I
take this opportunity to change playlist_delete() to take a playlist
struct directly.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-28 09:40:02 -04:00
Anna Schumaker ca5f0701e9 core/playlist: playlist_new() returns a playlist pointer
This is much more useful than a boolean status, since we can use the
playlist pointer right away.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-28 09:40:02 -04:00
Anna Schumaker 846f7df9c1 gui/sidebar: Add a gui_sidebar_iter_playlist() function
It's frequently useful to get the playlist directly, rather than looking
up type and name first.  Let's add a function to do just that!

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-28 09:40:02 -04:00
Anna Schumaker 4d68ce8ce6 gui/playlists/library: Return a new playlist pointer
This pointer can be used immediately by testing code instead of simply
looking at the return status.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-28 09:40:02 -04:00
Anna Schumaker 249de0da21 core/playlists/system: Add tests for new tracks and deleting tracks
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-28 09:40:02 -04:00
Anna Schumaker 58cd43c330 core/database: Pass database index when allocating dbes
This is useful for user playlists so they can store their playlist-id
directly, letting us remove the entire playlist_get_id() function.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-28 09:40:02 -04:00
Anna Schumaker 9b4a1785a1 core/queue: Remove Q_ADD_FRONT flag
And replace its use with a queue_add_front() function instead.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-28 09:40:02 -04:00
Anna Schumaker c59b097638 core/queue: Remove Q_ENABLED flag
Queues are always enabled now that we can select different playlists as
the default.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-28 09:40:02 -04:00
Anna Schumaker 7e3e4194f3 core/queue: Remove Q_NO_SORT
This flag was only used by the History playlist, but we have a noop
function to handle this instead.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-28 09:40:02 -04:00
Anna Schumaker 186367afe0 core/queue: Remove qop_save()
This callback is no longer used now that saving happens in the playlist
layer.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-28 09:40:02 -04:00
Anna Schumaker 62e494f2af core/queue: Remove Q_SAVE_FLAGS and Q_SAVE_SORT
These flags are unused now that the playlist layer handles saving.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-28 09:40:02 -04:00
Anna Schumaker 15ceda1194 Ocarina 6.5.3
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-28 09:38:17 -04:00
Anna Schumaker 638caeaa91 gui/sidebar: Set the playlist before changing the random button
Otherwise we could end up changing the random setting on the previous
playlist when displaying a new one.

Fixes #106: Switching playlists clears random setting
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-26 14:25:03 -04:00
Anna Schumaker a7565340d2 Ocarina 6.5.3-rc
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:59:08 -04:00
Anna Schumaker 0b231119d2 gui/artwork: Rework importing album art
And add a test to check that everything is set correctly.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker fc1e917aee gui/artwork: Rework setting album art
I cleaned up several of the functions and added tests for making sure
everything is set correctly.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker bc1c462d36 gui/artwork: Add an accessor function for the artwork image
This patch also adds a unit test checking that the image is initialized
properly.  In addition, I simplify things by changing the image widget
to be a direct child of the GtkButton.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 8fd4e4c637 gui/audio: Add a test for the volume button
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 96e5749e7f gui/audio: Add a test for seeking
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 2a845feb38 gui/audio: Move audio_ops struct towards the top
This keeps all the audio operations together, and matches how we define
operations structs throughout the rest of Ocarina.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker f8c0668e5e gui/audio: Add an accessor function for the pause_after combo box
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 07d735eeee gui/audio: Add accessor functions for control buttons
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 943ab02aa5 gui/audio: Add position and duration label accessor functions
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 869e83b7bd gui/audio: Add accessor functions for audio tags
And begin working on new, cleaner unit test code.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 88bf71ac22 Remove gui/view.c
This code is obsolete now that gui/playlist.c handles keypress and
right-click events on the main treeview.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 3bf99b12eb gui/playlist: Respond to right-clicking the main treeview
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker e660e3f0b2 gui/treeview: Add a "select path at pos" function
This function isn't easy to test without knowledge of screen
coordinates, so I didn't include a unit test this time.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 3ae5e0f535 gui/playlist: Handle key press events on the main treeview
Setting up a unit test for this is almost impossible, so we don't do
that here.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 39bc7492d4 gui/playlist: Clean up file and rewrite unit test
The unit test now checks how we respond to the row-activated signal.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker e7d2fa5c4d gui/treeview: Add a function for listing selected tracks
This will be used by higher layers to add tracks to playlists.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 155b9c3ee6 gui/treeview: Add a test for the row-activated signal
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 7fbef057bf core: Add a field to initdata for enabling async idle tasks
I'll use this when testing gui album art to enable fetching the artwork.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker d373c55320 core/queue: Add a queue_erase_track() function
Used to trigger the erase callback on tracks, rather than indexes.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker f147c30c30 Ocarina 6.5.2
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:56:39 -04:00
Anna Schumaker 1e6ab2e23c gui/playlist: Unbold the previous playlist
Looks like this wasn't happening automatically, so let's be sure to
update the previous playlist's row after selecting a new playlist.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-04 11:27:47 -04:00
Anna Schumaker 83a21863b9 gui/sidebar: Select the current playlist on startup
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-04 11:27:45 -04:00
Anna Schumaker e876f8125f gui/sidebar: Restore expanded rows on startup
Fixes #94: Playlist heading not open by default
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-04 11:27:24 -04:00
Anna Schumaker dc53ae271b gui/sidebar: Store the row expanded setting for later use
I want to use this to track if the user has expanded or collapsed any of
the sidebar rows.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-04 10:04:33 -04:00
Anna Schumaker c9e9e3a340 Ocarina 6.5.2-rc
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-03 10:33:19 -04:00
Anna Schumaker d818688bfd gui/playlist: Update playlist sizes with a function pointer array
This lets us select the appropriate update function directly.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-03 10:33:19 -04:00
Anna Schumaker cebf2069cb gui/playlists/system: Respond to favorite and hide buttons
I also take this opportunity to rename these widgets and add accessor
functions.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-03 10:33:19 -04:00
Anna Schumaker 36f399ecb7 gui/playlists/system: Split into a new file and add a unit test
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-03 10:33:19 -04:00
Anna Schumaker 83db8e4ae7 gui/playlists/user: Add a function for getting a list of playlists
This is used to build a right-click menu with the names of each
playlist.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-03 10:33:19 -04:00
Anna Schumaker ad3e56250e gui/playlists/user: Split into a new file and add a unit test
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-03 10:33:19 -04:00
Anna Schumaker bb673ddb62 gui/playlists/artist: Split into a new file and add a unit test
Putting this code in a new file helps make gui/playlist.c less complex,
and better matches the organization of files in core/

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-03 10:33:19 -04:00
Anna Schumaker 4fee5f85f0 gui/playlists/library: Add a function for updating library paths
Finding the header first makes a lot of sense, and avoids iterating
through every playlist while trying to find the library playlist to
update.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-03 10:33:19 -04:00
Anna Schumaker ab47a7ac88 gui/playlists/library: Add new library paths to the sidebar
... without passing through gui/playlist.c first.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-03 10:33:19 -04:00