From b516afe83289f570764710700ab5680835313ee5 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Sun, 29 Jun 2014 10:36:00 -0400 Subject: [PATCH] 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 --- core/core.cpp | 19 +++++++++++++++++++ include/core/core.h | 14 ++++++++++++++ lib/lib.cpp | 13 ++----------- 3 files changed, 35 insertions(+), 11 deletions(-) create mode 100644 core/core.cpp create mode 100644 include/core/core.h diff --git a/core/core.cpp b/core/core.cpp new file mode 100644 index 00000000..fcc627ff --- /dev/null +++ b/core/core.cpp @@ -0,0 +1,19 @@ +/* + * Copyright 2014 (c) Anna Schumaker. + */ +#include +#include +#include +#include +#include +#include + + +void core :: init(int *argc, char ***argv) +{ + tagdb :: init(); + library :: init(); + playlist :: init(); + deck :: init(); + audio :: init(argc, argv); +} diff --git a/include/core/core.h b/include/core/core.h new file mode 100644 index 00000000..a5c8ce48 --- /dev/null +++ b/include/core/core.h @@ -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 */ diff --git a/lib/lib.cpp b/lib/lib.cpp index bfc5bcea..2631acfa 100644 --- a/lib/lib.cpp +++ b/lib/lib.cpp @@ -1,12 +1,7 @@ /* * Copyright 2014 (c) Anna Schumaker. */ -#include -#include -#include -#include -#include -#include +#include #include #include @@ -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)