ocarina/core/core.c
Anna Schumaker 779969f28b core/idle: Let tests run without the thread pool
The thread pool is used to fetch album art in the background, but this
can slow down most tests that aren't interested in album art.  Adding a
(testing-only) function for running without the thread pool speeds
things up a bit.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-28 16:17:43 -04:00

42 lines
819 B
C

/*
* Copyright 2014 (c) Anna Schumaker.
*/
#include <core/audio.h>
#include <core/core.h>
#include <core/collection.h>
#include <core/filter.h>
#include <core/history.h>
#include <core/idle.h>
#include <core/playlist.h>
#include <core/tags/tags.h>
#include <core/tempq.h>
void core_init(int *argc, char ***argv, struct core_init_data *init)
{
#ifdef CONFIG_TESTING
idle_init_sync();
#else
idle_init();
#endif /* CONFIG_TESTING */
filter_init();
tags_init();
playlist_init(init->playlist_ops);
collection_init(init->collection_ops);
history_init(init->history_ops);
tempq_init(init->tempq_ops);
audio_init(argc, argv, init->audio_ops);
}
void core_deinit()
{
audio_deinit();
tempq_deinit();
history_deinit();
collection_deinit();
playlist_deinit();
tags_deinit();
filter_deinit();
idle_deinit();
}