core/audio: Expose the audio_save() function

This will be used to re-save the current track after defragmenting the
track database.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2016-08-12 16:16:02 -04:00
parent f726b6994c
commit 939ebeac13
2 changed files with 10 additions and 6 deletions

View File

@ -15,11 +15,6 @@ static int audio_pause_count = -1;
static guint audio_bus = 0;
static void __audio_save()
{
settings_set(SETTINGS_TRACK, track_index(audio_track));
}
static bool __audio_change_state(GstState state)
{
GstStateChangeReturn ret = GST_STATE_CHANGE_FAILURE;
@ -55,7 +50,7 @@ static struct track *__audio_load_basic(struct track *track, GstState state)
queue_updated(playlist_get_queue(PL_SYSTEM, "Collection"), prev);
queue_updated(playlist_get_queue(PL_SYSTEM, "Collection"), audio_track);
__audio_save();
audio_save();
g_free(uri);
g_free(path);
return track;
@ -132,6 +127,12 @@ void audio_deinit()
gst_deinit();
}
void audio_save()
{
if (audio_track)
settings_set(SETTINGS_TRACK, track_index(audio_track));
}
bool audio_load(struct track *track)
{
if (track == audio_track)

View File

@ -29,6 +29,9 @@ void audio_init(int *, char ***, struct audio_ops *);
/* Called to deinitialize the audio manager. */
void audio_deinit();
/* Called to force-save the current track. */
void audio_save();
/* Called to load a track for playback. */
bool audio_load(struct track *);