We can only rename user-created playlists, so let's not even show this
option for the other playlist types.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Normally GTK will take care of this, but we'll need it for the
right-click menu so we might as well implement it.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This gives me a function that I can reuse in the sidebar right-click
menu, and it cleans up the main keypress handler so more keys can be
added.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This seems like a useful function to have, and we already need it for
deleting playlists. Let's make it a real function so we don't need to
duplicate code.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Enabling this option resolves several "Negative content width" warnings
that I was seeing. Normally I'd just ignore them, but these were
generating SIGTRAP during testing and causing the tests to fail
unnecessarily.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
If multiple paths are passed, then only load the first one to keep
things simple.
Implements #102: Allow outside tracks
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
If a matching track isn't found in the track database, then use the new
track_alloc_external() function to allocate an external track with the
correct tags.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
There might be rare occasions where users want to play a track that
exists outside their music library. This patch adds support for
allocating and freeing these external tracks without adding them to the
track database.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I'm struggling to come up with a good way to combine code for this with
code for track_add(), since the lookup mechanism is basically the same.
I'll keep them separate for now and think on it some more.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
It's possible that the user may pass us a subdirectory of a path that
has already been added to the library. We can use this to prevent
double-adding tracks if the user does this. Additionally, this function
can be used to help look up tracks using only a filepath.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I want to use this to prevent users from adding a subdirectory of a path
that has already been added to the library.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Let's just do everything inline and cut out the extra function calls to
make the code simpler. I also created functions to help tests send EOS
or error messages.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
And use these to trigger the state changed callback. Additionally, this
callback can now be used by tests to determine when we're done seeking.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We only play local music, so we know that we're using a file and we
don't need a uridecodebin to figure it out for us.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Add some whitespace to make it easier to follow what everything is. I
also rename audio_bus to audio_old_id to make it easier to add in a new
audio bus. Additionally, I changed test_audio_player() to
test_old_player() to make room for the new pipeline.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I want to run a main loop during the audio tests, which aren't in gui/.
Let's rename this file to make me feel better about using it :)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
A single middle click could happen by accident, especially if the user
has a touchpad. A double click is more likely to be deliberate.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Instead, watch for a middle click and set the editable state manually
from there. This fixes a bug where double clicking on a user playlist
put us in editing mode instead of selecting the playlist for playback.
Fixes#110: Cannot select user playlists
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I want to be able to change this when the user middle-clicks a row, so
let's start by adding in some support functions.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
If we don't, then the Collection playlist will include hidden tracks
when it initializes.
Fixes#109: Hidden tracks showing up in Collection
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We use this to set the playlist name in the provided GtkEntry, clearing
out the number of tracks
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The GtkTreeView editing callbacks give me a path string that I'll need
to convert into an iterator to find the edited playlist.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Once we change the name of a playlist, we won't be able to find it in
the sidebar model. So let's add a way to update an iterator by passing
the playlist to use for updating.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Users may make typos in naming playlists, or they might think up better
names for playlists later. Let's be friendly and give users a way to
change playlist names if desired.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This saves ~75MB in my testing, and can be a useful memory savor for the
case where all album art has been downloaded.
Implements #96: Allocate g_thread_pool as needed
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This way we don't need to keep including the same core libraries in
almost every file.
Implements #83: Include useful headers in core/core.h
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The core_init_data only held three items, most of which don't get set
during testing. Removing this struct means several tests no longer need
to define a "dummy" initdata object to pass around during init.
Implements #92: Remove core_init_data
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
And make them optional, that way tests don't need to keep creating fake
callbacks if they don't need anything from the audio layer.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Passing this option tells Ocarina that it should only process
synchronous idle tasks, such as library or playlist updates. This
effectively disables album art fetching (and any async jobs we add in
the future).
Implements #91: Add --no-fetch option
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Rather than offering two init functions for testing. This lets the UI
select if they want async idle tasks (like Album Art fetching).
Implements #90: Give idle_init an async flag
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Users might not remember any sorting or random settings from the last
time they queued tracks, so saving these values could result in
selecting tracks in an unexpected order. Fix this by resetting the
queued tracks options whenever the playlist is emptied.
Fixes#108: Unset random and sorting when finishing queued tracks
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
These fields were working fine for statically initialized playlists, but
they get set to garbage values when g_malloc()-ing a playlist. Let's
make sure they get initialized properly with the rest of the playlist.
Fixes#107: Initialize all values in playlist_generic_init()
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>