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>
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>
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>
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>
In most cases this function just triggers a UI update, but system
playlists have a little extra bookkeeping to do to remove the track from
the Queued Tracks playlist.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This lets us call playlist_played() whenever we change tracks to send UI
updates once, rather than using multiple updates to change playcount and
now-playing status.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is used to notify when tracks have been played so dynamic playlists
can be updated, and so the model can display the correct playcount.
The old system playlist tests are mostly unnecessary at this point, so I
remove them as part of this patch.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I think "lookup" is a better name for this function, since it's similar
to performing a dictionary lookup.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
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>
This makes file versioning way easier, since every file will have the
same version. I'll still need to manage minimum-supported versions, but
that shouldn't be too difficult going forward.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The settings code is designed to map strings to unsigned integers, which
is exactly what we do here. This lets us cut out an extra file access,
which is always a plus. We remove the audio file after upgrading to
prevent reading it multiple times.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
The dbe_index of a given database item might change in the future, so we
can't rely on it everywhere. Let's just use it for saving and loading
files, with the expectation that changes will happen sometime after
startup.
Implements #69: Reduce use of dbe_index in Ocarina code
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I'm going to use this to distinguish between various playlist types that
are about to be added. Let's update the playlist functions first, and
then add more types in a future patch.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I don't think it makes sense that callers of file_open() are expected to
check the file version after opening. This should be something handled
by the file code so we can print a consistent error message.
Implements issue #5: Better file versioning
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
Let's save this disk access for when we're idle.
Implements #11: Load initial track through an idle task
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I need to do this for temporary queues in addition to the collection for
bolding to work properly.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
It's better to have a single function loading tracks and adding them to
the history queue.
Fixes#2: Initial track not added to history
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
The GUI needed an extra function to do this manually, which means it's
something that core should do instead.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>