libsaria: Remove initflags and comment out init() functions
Instead, I pass a string with the name of the application being run. This will be used to have separate applications using libsaria. This commit also comments out most of the libsaria and ocarina init functions until I can revise and clean up everything. Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
9aeae532d3
commit
02740d1feb
|
@ -3,20 +3,9 @@
|
|||
|
||||
#include <libsaria/track.h>
|
||||
|
||||
enum LSInitFlags {
|
||||
LS_INIT_NONE = (0),
|
||||
LS_INIT_PREFS = (1 << 0),
|
||||
LS_INIT_AUDIO = (1 << 1),
|
||||
LS_INIT_LIBRARY = (1 << 2),
|
||||
LS_INIT_STACK = (1 << 3),
|
||||
};
|
||||
|
||||
static const unsigned int LS_INIT_EVERYTHING =
|
||||
LS_INIT_PREFS | LS_INIT_AUDIO | LS_INIT_LIBRARY | LS_INIT_STACK;
|
||||
|
||||
namespace libsaria
|
||||
{
|
||||
void init(unsigned int, int, char **);
|
||||
void init(string, int, char **);
|
||||
void quit();
|
||||
|
||||
libsaria::Track *current_track();
|
||||
|
|
|
@ -11,36 +11,28 @@
|
|||
#include <libsaria/index.h>
|
||||
#include <libsaria/stack.h>
|
||||
|
||||
static unsigned int init_flags;
|
||||
|
||||
namespace libsaria
|
||||
{
|
||||
|
||||
void init(unsigned int flags, int argc, char **argv)
|
||||
void init(string app, int argc, char **argv)
|
||||
{
|
||||
srand( time(NULL) );
|
||||
init_flags = flags;
|
||||
println("Initializing libsaria");
|
||||
|
||||
if (init_flags & LS_INIT_PREFS)
|
||||
libsaria::prefs::load();
|
||||
if (init_flags & LS_INIT_AUDIO)
|
||||
audio::init(argc, argv);
|
||||
/*libsaria::prefs::load();
|
||||
audio::init(argc, argv);
|
||||
|
||||
println("saria dir: %s", get_saria_dir().c_str());
|
||||
make_saria_dir();
|
||||
|
||||
if (init_flags & LS_INIT_LIBRARY)
|
||||
libsaria::library::init();
|
||||
if (init_flags & LS_INIT_STACK)
|
||||
libsaria::stack_init();
|
||||
libsaria::library::init();
|
||||
libsaria::stack_init();*/
|
||||
}
|
||||
|
||||
void quit()
|
||||
{
|
||||
println("Quitting libsaria");
|
||||
if (init_flags & LS_INIT_AUDIO)
|
||||
audio::quit();
|
||||
audio::quit();
|
||||
print_format_stats();
|
||||
index::print_stats();
|
||||
close_pipes();
|
||||
|
|
|
@ -72,8 +72,9 @@ int main(int argc, char **argv)
|
|||
println("Ocarina " + vers_str());
|
||||
set_path_prefix(argv[0]);
|
||||
|
||||
libsaria::init(LS_INIT_EVERYTHING, argc, argv);
|
||||
setup_callbacks();
|
||||
libsaria::init("ocarina", argc, argv);
|
||||
|
||||
/* setup_callbacks();
|
||||
|
||||
g_thread_init(NULL);
|
||||
gdk_threads_init();
|
||||
|
@ -88,6 +89,6 @@ int main(int argc, char **argv)
|
|||
gdk_threads_enter();
|
||||
gtk_main();
|
||||
gdk_threads_leave();
|
||||
libsaria::quit();
|
||||
libsaria::quit();*/
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue