I was running into a situation where new tracks added to a playlist were
showing up even if they didn't match the current filter text. Let's fix
this by refiltering the current playlist when new tracks are added to
it.
Fixes#114: New tracks added to filtered view
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This will be used for drag and drop, so that we can figure out what
playlist tracks are being added to.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We can just pass 0 to the sorted function to indicate that the playlist
shouldn't be sorted by default. Let's also take this chance to rename
playlist_generic_init_sorted() -> playlist_generic_init()
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The popover is shown whenever the user pauses manually with automatic
pausing enabled. This will give the user a chance to disable pausing if
it is no longer needed.
Implements #113: Cancel "pause after" configuration when user manually pauses
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I set the "linked" property on the hbox to make everything look like a
single widget. I'm doing this on my own to cut out the GtkAdjustment
and to just use the counter in the audio layer in its place.
Additionally, this will give me the ability to use "+" and "-" keyboard
shortcuts to activate the widgets.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This will be needed by the gui to find the current count at any time,
without waiting for a callback.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The readd(), readu(), and readhu() functions are all used to read
various forms of integers. The readl() and readw() are for reading
either lines or individual whitespace-delimited words
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I rename cache_file_write() to file_write(), and implement the
corresponding file_read() for binary data.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I also take this opportunity to add a OPEN_WRITE_BINARY mode to support
writing binary data to files.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This function currently only supports opening files for reading, but it
will soon be expanded to supporting writes as well. To support binary
reads, I add a new OPEN_READ_BINARY open mode.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I'll eventually want to support text and binary files in both locations,
so cache files might need access to this too.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This change means removing cache files is now supported. As a bonus,
we try to remove empty subdirectories to keep down the clutter.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This might also be useful for cache files to track their current state.
To help with accurate tracking, I take this opportunity to add a CLOSED
state that files default to.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I also introduce a "file_operations" struct that will be used in the
future to do slightly different things for cache and data files.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
And rework the init functions at the same time to reflect that data
files can now be placed under a subdirectory.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I'm going to create a unified struct file that should be able to share
code between data and cache files. The first step is to push the old
structure to the side so it can still be used in other places.
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>
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>
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>
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>