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>