Skip to content

Commit

Permalink
Added Media
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Young authored and Luke Young committed Feb 13, 2012
1 parent eb2a60a commit 4ba1ec2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/index.js
Expand Up @@ -10,6 +10,8 @@ iOS.apps = require("./apps.js");
//Device
iOS.device = require("./device.js");

//Media
iOS.media = require("./media.js");

//Expose the methods
module.exports = iOS;
module.exports = iOS;
31 changes: 31 additions & 0 deletions lib/media.js
@@ -0,0 +1,31 @@
//Require exec from child processes
var exec = require('child_process').exec;
//Require spwan from child processes
var spawn = require('child_process').spawn;
//Require join from path
var join = require('path').join;

var media = {};

media.toggle = function(cb){
exec(join(__dirname, '..', 'compiled','sbmedia')+" -t", function (error, stdout, stderr) {
//callback
cb(error);
});
}

media.prev = function(cb){
exec(join(__dirname, '..', 'compiled','sbmedia')+" -p", function (error, stdout, stderr) {
//callback
cb(error);
});
}

media.next = function(cb){
exec(join(__dirname, '..', 'compiled','sbmedia')+" -n", function (error, stdout, stderr) {
//callback
cb(error);
});
}

module.exports = media;

0 comments on commit 4ba1ec2

Please sign in to comment.