core: Create a single init() function

Initialize everything from the core/ layer, that way lib/ doesn't need
to know the correct order.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2014-06-29 10:36:00 -04:00
parent 77616aa8d2
commit b516afe832
3 changed files with 35 additions and 11 deletions

19
core/core.cpp Normal file
View File

@ -0,0 +1,19 @@
/*
* Copyright 2014 (c) Anna Schumaker.
*/
#include <core/audio.h>
#include <core/core.h>
#include <core/deck.h>
#include <core/library.h>
#include <core/playlist.h>
#include <core/tags.h>
void core :: init(int *argc, char ***argv)
{
tagdb :: init();
library :: init();
playlist :: init();
deck :: init();
audio :: init(argc, argv);
}

14
include/core/core.h Normal file
View File

@ -0,0 +1,14 @@
/*
* Copyright 2014 (c) Anna Schumaker.
*/
#ifndef OCARINA_CORE_CORE_H
#define OCARINA_CORE_CORE_H
namespace core
{
void init(int *, char ***);
}
#endif /* OCARINA_CORE_CORE_H */

View File

@ -1,12 +1,7 @@
/*
* Copyright 2014 (c) Anna Schumaker.
*/
#include <core/audio.h>
#include <core/deck.h>
#include <core/library.h>
#include <core/playlist.h>
#include <core/print.h>
#include <core/tags.h>
#include <core/core.h>
#include <lib/lib.h>
#include <gtkmm.h>
@ -29,11 +24,7 @@ void lib :: init(int *argc, char ***argv, const std::string &gtk_xml)
if (!builder->add_from_file(lib :: share_file(gtk_xml)))
exit(1);
tagdb :: init();
library :: init();
playlist :: init();
deck :: init();
audio :: init(argc, argv);
core :: init(argc, argv);
}
const std::string lib :: share_file(const std::string &f)