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:
parent
f726b6994c
commit
939ebeac13
13
core/audio.c
13
core/audio.c
|
@ -15,11 +15,6 @@ static int audio_pause_count = -1;
|
||||||
static guint audio_bus = 0;
|
static guint audio_bus = 0;
|
||||||
|
|
||||||
|
|
||||||
static void __audio_save()
|
|
||||||
{
|
|
||||||
settings_set(SETTINGS_TRACK, track_index(audio_track));
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool __audio_change_state(GstState state)
|
static bool __audio_change_state(GstState state)
|
||||||
{
|
{
|
||||||
GstStateChangeReturn ret = GST_STATE_CHANGE_FAILURE;
|
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"), prev);
|
||||||
queue_updated(playlist_get_queue(PL_SYSTEM, "Collection"), audio_track);
|
queue_updated(playlist_get_queue(PL_SYSTEM, "Collection"), audio_track);
|
||||||
|
|
||||||
__audio_save();
|
audio_save();
|
||||||
g_free(uri);
|
g_free(uri);
|
||||||
g_free(path);
|
g_free(path);
|
||||||
return track;
|
return track;
|
||||||
|
@ -132,6 +127,12 @@ void audio_deinit()
|
||||||
gst_deinit();
|
gst_deinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void audio_save()
|
||||||
|
{
|
||||||
|
if (audio_track)
|
||||||
|
settings_set(SETTINGS_TRACK, track_index(audio_track));
|
||||||
|
}
|
||||||
|
|
||||||
bool audio_load(struct track *track)
|
bool audio_load(struct track *track)
|
||||||
{
|
{
|
||||||
if (track == audio_track)
|
if (track == audio_track)
|
||||||
|
|
|
@ -29,6 +29,9 @@ void audio_init(int *, char ***, struct audio_ops *);
|
||||||
/* Called to deinitialize the audio manager. */
|
/* Called to deinitialize the audio manager. */
|
||||||
void audio_deinit();
|
void audio_deinit();
|
||||||
|
|
||||||
|
/* Called to force-save the current track. */
|
||||||
|
void audio_save();
|
||||||
|
|
||||||
|
|
||||||
/* Called to load a track for playback. */
|
/* Called to load a track for playback. */
|
||||||
bool audio_load(struct track *);
|
bool audio_load(struct track *);
|
||||||
|
|
Loading…
Reference in New Issue