summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2011-07-01 13:26:54 (GMT)
committer Jaromil <jaromil@dyne.org>2011-07-01 13:26:54 (GMT)
commitd1402ab25d2f3d06228333afec02a3427f6e504c (patch)
tree044c3dc2081a1ed10cc588ae345e6d6a5888d852
parentec036c8ec18b884a3edeebbb8b714ac65452f8c4 (diff)
fixed send of sequence of commands in one run0.4
documentation for release
-rw-r--r--ChangeLog11
-rw-r--r--README2
-rw-r--r--TODO.org2
-rw-r--r--configure.ac2
-rw-r--r--src/cmdline.c45
-rw-r--r--src/parsers.c1
6 files changed, 48 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 64ef896..0b647ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,16 @@
-24 May 2011 - Seek capability
+0.4 - 01 Jul 2011 - URLs and usability
+ Now load also works for http urls
+ If no command specified, load and play argument
+ Possibility to pipe ad-hoc XML from stdin
+
+0.3 - 24 May 2011 - Seek capability
Added 'jump' command to seek to REL_TIME
Included miniunpnc statically
-19 April 2011 - Device detection
+0.2 - 19 April 2011 - Device detection
Possibility to detect UPNP root devices on the same network
Optional linking to miniupnpc
-12 April 2011 - Initial release
+0.1 - 12 April 2011 - Initial release
Basic functionalities: load, play, stop, pause
No dependencies
diff --git a/README b/README
index 72494bf..e7c051b 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
_
/\\ /|_) _ ._ _ __|_ _
-/--\\/ | \(/_| | |(_)|_(/_ .. v0.3
+/--\\/ | \(/_| | |(_)|_(/_ .. v0.4
Small tool to send AVTransport commands to UPNP media services
diff --git a/TODO.org b/TODO.org
index b3d2f9f..74a3207 100644
--- a/TODO.org
+++ b/TODO.org
@@ -3,9 +3,9 @@
* Release 1.0 :20%:
-** TODO [#A] HTTP streaming URLs load
** TODO [#C] Use a select() call on socket
** TODO [#C] Monitor GetTransportState for results
+** DONE [#A] HTTP streaming URLs load
** DONE [#B] Realize how seek can work
** DONE [#B] Auto detection of devices and ports :miniupnpc:
diff --git a/configure.ac b/configure.ac
index f7fe746..0ea8769 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,7 @@ dnl ==============================================================
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
-AC_INIT([avremote],[0.3.0],[jaromil@nimk.nl],[AVRemote])
+AC_INIT([avremote],[0.4.0],[jaromil@nimk.nl],[AVRemote])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
diff --git a/src/cmdline.c b/src/cmdline.c
index da46ad4..dfeeddc 100644
--- a/src/cmdline.c
+++ b/src/cmdline.c
@@ -70,7 +70,7 @@ void cmdline(int argc, char **argv) {
" This is free software: you are free to change and redistribute it.\n"
" The latest AVTransport sourcecode is published on <%s>\n"
"\n"
- "Syntax: avremote [options] command [file]\n"
+ "Syntax: avremote [options] [command] [args...]\n"
"\n"
"Commands:\n"
"\n"
@@ -83,6 +83,8 @@ void cmdline(int argc, char **argv) {
" get get the current status of the device\n"
" jump seek to a position in time (00:00:00)\n"
"\n"
+ " none means load and play URL, or use - to read xml from stdin\n"
+ "\n"
"Options:\n"
"\n"
" -s network address or hostname of the media server\n"
@@ -139,7 +141,7 @@ void cmdline(int argc, char **argv) {
discover = 1;
} else if(!dry_run) {
// check requires args
- if( !command[0] || command[0]=='-' && !command[1]) pipe_stdin++;
+ if( command[0]=='-' && !command[1]) pipe_stdin++;
}
@@ -214,10 +216,25 @@ int main(int argc, char **argv) {
exit(0);
}
- // command parsing is a cascade switch on single letters
- // this is supposedly faster than strcmp
+ /* command parsing is a cascade switch on single letters
+ this is supposedly faster than strcmp. mapping:
+
+ D iscovery
+ L oad
+ P lay
+ PA use
+ S top
+ G et
+ M ode
+ J ump
+
+ */
switch(command[0]) {
+ case 'd': // discovery
+ // was processed earlier
+ break;
+
case 'l': // load url
render_uri_meta(upnp,filename);
render_upnp(upnp,"SetAVTransportURI", upnp->meta);
@@ -269,11 +286,21 @@ int main(int argc, char **argv) {
break;
default:
- fprintf(stderr,"warning: command not recognized, sending anyway.\n");
- render_upnp(upnp,command,"");
-
- // free_upnp(upnp);
- // exit(1);
+ if(!command[0]) break;
+ fprintf(stderr,"warning: command not recognized, loading and playing as url\n");
+
+ // load
+ render_uri_meta(upnp,command);
+ render_upnp(upnp,"SetAVTransportURI", upnp->meta);
+ send_upnp(upnp);
+ recv_upnp(upnp, 1000);
+
+ // must re-connect socket between commands
+ close(upnp->sockfd);
+ upnp->sockfd = 0;
+ connect_upnp(upnp);
+
+ render_upnp(upnp,"Play","<Speed>1</Speed>");
}
if (dry_run)
diff --git a/src/parsers.c b/src/parsers.c
index f37f0b0..0063c6f 100644
--- a/src/parsers.c
+++ b/src/parsers.c
@@ -70,6 +70,7 @@ void GetTransportInfo(char *res) {
char status[MAX];
char speed[MAX];
char *p;
+
fprintf(stderr,"#\tstate\tstatus\tspeed\n");
p = extract_xml(state, res, "CurrentTransportState");