summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjaromil <jaromil@949728d9-16ea-0310-a75c-cbdf8430a4b8>2006-02-07 17:02:46 (GMT)
committer jaromil <jaromil@949728d9-16ea-0310-a75c-cbdf8430a4b8>2006-02-07 17:02:46 (GMT)
commit09ebdde9e1a56c6cb83a4b98c1c2d9a22244097c (patch)
tree85e9c97e3549985c44c8d81ea751f53b4fd8db73
parentc96b4426cc3b7faf2cbb6c0e1a98c0c4ae2fd440 (diff)
small addition to the xmlrpc api for interactive playback
git-svn-id: svn://dyne.org/montevideo/ivysync@56 949728d9-16ea-0310-a75c-cbdf8430a4b8
-rw-r--r--README4
-rw-r--r--cmdline.cpp3
-rw-r--r--xmlrpc.cpp23
-rw-r--r--xmlrpc.h14
4 files changed, 39 insertions, 5 deletions
diff --git a/README b/README
index ecc2cf4..2836314 100644
--- a/README
+++ b/README
@@ -91,7 +91,3 @@ Montevideo / Time Based Arts http://montevideo.nl
# You should have received a copy of the GNU Public License along with
# this source code; if not, write to:
# Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-
-
-
diff --git a/cmdline.cpp b/cmdline.cpp
index 58995e0..8b0ce4f 100644
--- a/cmdline.cpp
+++ b/cmdline.cpp
@@ -115,7 +115,7 @@ int cmdline(int argc, char **argv) {
int c;
int res;
- N("IvySync 0.2 / (c)2004-2006 Denis Rojo <jaromil@dyne.org>");
+ N("IvySync 0.3 / (c)2004-2006 Denis Rojo <jaromil@dyne.org>");
do {
res = getopt_long(argc, argv, short_options, long_options, NULL);
@@ -290,6 +290,7 @@ int main(int argc, char **argv) {
new Stop (xmlrpc, &decoders);
new GetPos(xmlrpc, &decoders);
new SetPos(xmlrpc, &decoders);
+ new Open (xmlrpc, &decoders);
// instantiate and launch the threaded daemon
daemonthread = new IvySyncDaemon(xmlrpc);
diff --git a/xmlrpc.cpp b/xmlrpc.cpp
index 75c77ef..225233f 100644
--- a/xmlrpc.cpp
+++ b/xmlrpc.cpp
@@ -69,7 +69,30 @@ SetPos::SetPos(XmlRpcServer* srv, vector<Decoder*> *decoders)
IvySyncPublicMethod(decoders)
{ }
+Open::Open(XmlRpcServer* src, vector<Decoder*> *decoders)
+ : XmlRpcServerMethod("Open", src),
+ IvySyncPublicMethod(decoders)
+{ }
+
+void Open::execute(XmlRpcValue &params, XmlRpcValue &result) {
+ int decnum;
+ char *path;
+
+ if( params.size() != 1) {
+ E("XMLRPC: Open called with invalid number of arguments(%u)",
+ params.size() );
+ return;
+ }
+ // get out the decoder parameter
+ decnum = (int) params[0] -1;
+ Decoder *dec = get_decoder( decnum );
+
+ // get out the path to the file to be opened
+ path = (char*) (std::string(params[1])).c_str();
+ D("Open decoder %u file %s", decnum, path);
+ result = (double) dec->append(path);
+}
void Play::execute(XmlRpcValue &params, XmlRpcValue &result) {
int decnum;
diff --git a/xmlrpc.h b/xmlrpc.h
index ac5b6eb..a5d6fe3 100644
--- a/xmlrpc.h
+++ b/xmlrpc.h
@@ -126,5 +126,19 @@ class SetPos : public XmlRpcServerMethod, IvySyncPublicMethod {
};
+class Open : public XmlRpcServerMethod, IvySyncPublicMethod {
+ public:
+
+ Open(XmlRpcServer* srv, vector<Decoder*> *decoders);
+
+ ~Open() { };
+
+ void execute(XmlRpcValue &params, XmlRpcValue &result);
+
+ std::string help() {
+ return std::string("Open a new file to be played"); }
+
+};
+
#endif