48 lines
943 B
C++
48 lines
943 B
C++
/*
|
|
* 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 <lib/lib.h>
|
|
#include <gtkmm.h>
|
|
|
|
static Glib::RefPtr<Gtk::Builder> builder;
|
|
static std::string share_dir = "";
|
|
|
|
static void setup_share(const std::string &path)
|
|
{
|
|
if (path == "/usr/bin/ocarina")
|
|
share_dir = "/usr/share/ocarina/";
|
|
else
|
|
share_dir = "./share/ocarina/";
|
|
}
|
|
|
|
void lib :: init(int *argc, char ***argv, const std::string >k_xml)
|
|
{
|
|
setup_share((*argv)[0]);
|
|
|
|
builder = Gtk::Builder::create();
|
|
if (!builder->add_from_file(lib :: share_file(gtk_xml)))
|
|
exit(1);
|
|
|
|
tagdb :: init();
|
|
library :: init();
|
|
playlist :: init();
|
|
deck :: init();
|
|
audio :: init(argc, argv);
|
|
}
|
|
|
|
const std::string lib :: share_file(const std::string &f)
|
|
{
|
|
return share_dir + f;
|
|
}
|
|
|
|
Glib::RefPtr<Gtk::Builder> &lib :: get_builder()
|
|
{
|
|
return builder;
|
|
}
|