libsaria: Added "next" and "prev" commands

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2012-05-28 10:55:49 -04:00
parent 838b2b3d8f
commit e632ff1012
4 changed files with 12 additions and 3 deletions

View File

@ -1,7 +1,8 @@
// Copyright (c) Bryan Schumaker 2012.
#include <libsaria/libsaria.h>
#include <libsaria/print.h>
#include <libsaria/audio.h>
#include <libsaria/print.h>
#include <libsaria/deck.h>
#include <fstream>
using namespace std;
@ -15,6 +16,10 @@ static void run_cmd(ifstream &in, string &file)
libsaria::audio::play();
else if (cmd == "pause")
libsaria::audio::pause();
else if (cmd == "next")
libsaria::deck::next();
else if (cmd == "prev")
libsaria::deck::prev();
}
void libsaria::read_piped_file(string &file)

3
scripts/%APP-next Normal file
View File

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

3
scripts/%APP-prev Normal file
View File

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

View File

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