2012-05-15 12:00:28 -04:00
|
|
|
// Copyright (c) Bryan Schumaker 2012.
|
|
|
|
#include <libsaria/libsaria.h>
|
|
|
|
#include <libsaria/print.h>
|
|
|
|
#include <libsaria/audio.h>
|
|
|
|
|
|
|
|
#include <fstream>
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
static void run_cmd(ifstream &in, string &file)
|
|
|
|
{
|
|
|
|
string cmd;
|
|
|
|
in >> cmd;
|
|
|
|
|
|
|
|
if (cmd == "play")
|
|
|
|
libsaria::audio::play();
|
2012-05-28 10:51:14 -04:00
|
|
|
else if (cmd == "pause")
|
|
|
|
libsaria::audio::pause();
|
2012-05-15 12:00:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void libsaria::read_piped_file(string &file)
|
|
|
|
{
|
|
|
|
ifstream in;
|
|
|
|
string cmd;
|
|
|
|
|
|
|
|
if (!exists(file))
|
|
|
|
return;
|
|
|
|
|
|
|
|
in.open(file.c_str());
|
|
|
|
run_cmd(in, file);
|
|
|
|
in.close();
|
|
|
|
}
|