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:
parent
77616aa8d2
commit
b516afe832
|
@ -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);
|
||||
}
|
|
@ -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 */
|
13
lib/lib.cpp
13
lib/lib.cpp
|
@ -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 >k_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)
|
||||
|
|
Loading…
Reference in New Issue