libsaria: Recognize a "pause" command

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2012-05-28 10:51:14 -04:00
parent bba2989866
commit 838b2b3d8f
5 changed files with 9 additions and 3 deletions

View File

@ -13,6 +13,8 @@ static void run_cmd(ifstream &in, string &file)
if (cmd == "play")
libsaria::audio::play();
else if (cmd == "pause")
libsaria::audio::pause();
}
void libsaria::read_piped_file(string &file)

3
scripts/%APP-pause Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
. %LIB/functions
write_to_pipe "pause"

View File

@ -1,3 +1,3 @@
#!/bin/bash
. `dirname $0`/../lib/ocarina/functions
. %LIB/functions
write_to_pipe "play"

View File

@ -5,6 +5,8 @@ Import( "env", "DEBUG" )
bin = "../bin/%s"
lib = "../lib/ocarina/%s"
LIBDIR="`dirname $0`/../lib/ocarina/"
def create_script(target, source, env):
dst = str(target[0].rfile())
src = str(source[0].rfile())
@ -12,6 +14,7 @@ def create_script(target, source, env):
f = open(dst, "w");
for line in open(src):
line = line.replace("%APP", "ocarina")
line = line.replace("%LIB", LIBDIR)
line = line.replace("%DEBUG", str(DEBUG))
f.write(line)
f.close()

View File

@ -1,2 +0,0 @@
#!/bin/bash
%%OCARINA%%-write-pipe "pause"