65 lines
1.0 KiB
C++
65 lines
1.0 KiB
C++
// Copyright (c) 2011 Bryan Schumaker.
|
|
#include <libsaria.h>
|
|
#include <library.h>
|
|
#include <notify.h>
|
|
#include <format.h>
|
|
#include <prefs.h>
|
|
#include <print.h>
|
|
#include <audio.h>
|
|
#include <track.h>
|
|
#include <deck.h>
|
|
#include <idle.h>
|
|
#include <fs.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
static libsaria::Track outside_track;
|
|
static libsaria::initdata *app_data;
|
|
|
|
namespace libsaria
|
|
{
|
|
|
|
void init(struct initdata *init)
|
|
{
|
|
app_data = init;
|
|
srand( time(NULL) );
|
|
println("Initializing libsaria");
|
|
|
|
app::init();
|
|
prefs::init();
|
|
|
|
audio::init(init->argc, init->argv);
|
|
libsaria::library::init();
|
|
libsaria::deck::init();
|
|
|
|
app::open_pipe();
|
|
}
|
|
|
|
void quit()
|
|
{
|
|
println("Quitting libsaria");
|
|
app::close_pipe();
|
|
library::quit();
|
|
audio::quit();
|
|
print_format_stats();
|
|
}
|
|
|
|
void play_outside_song(string &filepath)
|
|
{
|
|
try {
|
|
outside_track = Track(filepath);
|
|
} catch (string message) {
|
|
println(message);
|
|
return;
|
|
}
|
|
outside_track.load(true);
|
|
}
|
|
|
|
void notify(notify_t event, void *data)
|
|
{
|
|
if (app_data->on_notify)
|
|
app_data->on_notify(event, data);
|
|
}
|
|
|
|
};
|