Anna Schumaker
7fbef057bf
I'll use this when testing gui album art to enable fetching the artwork. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
45 lines
792 B
C
45 lines
792 B
C
/*
|
|
* Copyright 2014 (c) Anna Schumaker.
|
|
*/
|
|
#include <core/audio.h>
|
|
#include <core/core.h>
|
|
#include <core/idle.h>
|
|
#include <core/playlist.h>
|
|
#include <core/settings.h>
|
|
#include <core/tags/tags.h>
|
|
|
|
|
|
static bool core_defragment(void *data)
|
|
{
|
|
if (tags_defragment()) {
|
|
playlist_save();
|
|
audio_save();
|
|
}
|
|
return true;
|
|
}
|
|
|
|
void core_init(int *argc, char ***argv, struct core_init_data *init)
|
|
{
|
|
#ifdef CONFIG_TESTING
|
|
if (init->idle_async == false)
|
|
idle_init_sync();
|
|
else
|
|
#endif /* CONFIG_TESTING */
|
|
idle_init();
|
|
settings_init();
|
|
tags_init();
|
|
playlist_init(init->playlist_ops);
|
|
audio_init(argc, argv, init->audio_ops);
|
|
|
|
idle_schedule(IDLE_SYNC, core_defragment, NULL);
|
|
}
|
|
|
|
void core_deinit()
|
|
{
|
|
audio_deinit();
|
|
playlist_deinit();
|
|
tags_deinit();
|
|
settings_deinit();
|
|
idle_deinit();
|
|
}
|