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>
If we have two albums by the same artist in the same year (such as a CD1
or CD2 postfix), then we'll end up mixing them together when sorting.
Fix this by changing the default sort order to
Artist -> Year -> Album -> Track Number
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>
We have to disable the up and down buttons when typing in the entry in
case the user decides to type a minus or plus sign.
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>
Otherwise we might crash when we attempt to look at ar_tokens[0].
Reported-by: Josh Larson <themutatedshrimp@gmail.com>
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>
I eventually want to make these fields const in the file code, so we
need a different way to manage and eventually free these strings.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
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>