Index: /titan/titan/httpd.h
===================================================================
--- /titan/titan/httpd.h (revision 30202)
+++ /titan/titan/httpd.h (revision 30203)
@@ -302,6 +302,8 @@
else if(ostrcmp(query, "getserviceinfo") == 0)
buf = webgetserviceinfo(fmt);
- else if(ostrcmp(query, "getstreaming") == 0)
- buf = webgetstreaming(fmt);
+ else if(ostrcmp(query, "getstreaming") == 0 && param != NULL)
+ buf = webgetstreaming(param, fmt);
+ else if(ostrcmp(query, "getstreamingchoices") == 0)
+ buf = webgetstreamingchoices(fmt);
else if(ostrcmp(query, "getnewsletter") == 0 && param != NULL)
buf = webgetnewsletter(param, fmt);
Index: /titan/titan/httpdfunc.h
===================================================================
--- /titan/titan/httpdfunc.h (revision 30202)
+++ /titan/titan/httpdfunc.h (revision 30203)
@@ -5048,37 +5048,4 @@
}
-char* webgetstreaming(int fmt)
-{
- char* buf = NULL, *tmpstr = NULL;
-
- if(fmt == 0)
- {
- buf = ostrcat(buf, "
", 1, 0);
- buf = ostrcat(buf, "", 1, 0);
- buf = ostrcat(buf, "", 1, 0);
- buf = ostrcat(buf, "
", 1, 0);
- buf = ostrcat(buf, "", 1, 0);
- buf = ostrcat(buf, _("Streaming"), 1, 0);
- buf = ostrcat(buf, "
", 1, 0);
- buf = ostrcat(buf, "
", 1, 0);
- }
-
-// tmpstr = getabout();
-// readnewsletter();
- tmpstr = readfiletomem("/tmp/streaming.txt", 0);
- tmpstr = ostrcat(tmpstr, "\ncomming soon...\n", 1, 0);
-
- tmpstr = string_replace_all("\n", "
\n", tmpstr, 1);
-
- buf = ostrcat(buf, tmpstr, 1, 1);
-
- if(fmt == 0)
- {
- buf = ostrcat(buf, "", 1, 0);
- }
-
- return buf;
-}
-
char* webgetnewsletterchoices(int fmt)
{
@@ -5186,3 +5153,114 @@
}
+char* webgetstreamingchoices(int fmt)
+{
+ char* buf = NULL, *tmpstr = NULL;
+
+ if(fmt == 0)
+ {
+ buf = ostrcat(buf, "", 1, 0);
+ buf = ostrcat(buf, "", 1, 0);
+ buf = ostrcat(buf, "", 1, 0);
+ buf = ostrcat(buf, "
", 1, 0);
+ buf = ostrcat(buf, "", 1, 0);
+ buf = ostrcat(buf, _("Streaming"), 1, 0);
+ buf = ostrcat(buf, "
", 1, 0);
+ buf = ostrcat(buf, "
\n", 1, 0);
+ }
+
+
+ int count = 0;
+ struct service* servicenode = service;
+
+ while(servicenode != NULL)
+ {
+ if(servicenode->type == RECORDSTREAM && servicenode->recname != NULL)
+ {
+ buf = ostrcat(buf, "recname);
+ buf = ostrcat(buf, tmpstr, 1, 1);
+ buf = ostrcat(buf, " target=main>", 1, 0);
+ buf = ostrcat(buf, _("stop"), 1, 0);
+ buf = ostrcat(buf, " - ", 1, 0);
+ buf = ostrcat(buf, servicenode->recname, 1, 0);
+ buf = ostrcat(buf, " (", 1, 0);
+ if(servicenode->channel != NULL && servicenode->channel->name != NULL)
+ buf = ostrcat(buf, servicenode->channel->name, 1, 0);
+ else
+ buf = ostrcat(buf, _("unknown"), 1, 0);
+ buf = ostrcat(buf, ")", 1, 0);
+ buf = ostrcat(buf, "\n", 1, 0);
+ buf = ostrcat(buf, "\n", 1, 0);
+ count++;
+ }
+ servicenode = servicenode->next;
+ }
+
+ if(count == 0)
+ buf = ostrcat(buf, _("No Live Stream running"), 1, 0);
+
+ if(fmt == 0)
+ {
+ buf = ostrcat(buf, "", 1, 0);
+ }
+
+ return buf;
+}
+
+char* webgetstreaming(char* param, int fmt)
+{
+ char* buf = NULL, *tmpstr = NULL;
+
+// if(fmt == 0)
+// {
+ buf = ostrcat(buf, "", 1, 0);
+ buf = ostrcat(buf, "", 1, 0);
+ buf = ostrcat(buf, "", 1, 0);
+// }
+
+ htmldecode(param, param);
+
+ struct service* servicenode = service;
+ while(servicenode != NULL)
+ {
+ if(servicenode->recname != NULL && ostrcmp(servicenode->recname, param) == 0)
+ {
+ tmpstr = ostrcat(tmpstr, _("stop"), 1, 0);
+ tmpstr = ostrcat(tmpstr, " ", 1, 0);
+ tmpstr = ostrcat(tmpstr, servicenode->recname, 1, 0);
+ tmpstr = ostrcat(tmpstr, " (", 1, 0);
+ if(servicenode->channel != NULL && servicenode->channel->name != NULL)
+ tmpstr = ostrcat(tmpstr, servicenode->channel->name, 1, 0);
+ else
+ tmpstr = ostrcat(tmpstr, _("unknown"), 1, 0);
+ tmpstr = ostrcat(tmpstr, ")", 1, 0);
+ break;
+ }
+ servicenode = servicenode->next;
+ }
+
+// if(fmt == 0)
+// {
+ buf = ostrcat(buf, "
", 1, 0);
+ buf = ostrcat(buf, "", 1, 0);
+ buf = ostrcat(buf, tmpstr, 1, 1);
+ buf = ostrcat(buf, "
", 1, 0);
+ buf = ostrcat(buf, "
", 1, 0);
+// }
+
+ servicenode = getrecordbyname(param, RECORDSTREAM);
+ if(servicenode != NULL)
+ {
+ servicenode->recendtime = 1;
+ buf = ostrcat(buf, _("Streaming succesfull stopped."), 1, 0);
+ }
+ else
+ buf = ostrcat(buf, _("ERROR, Streaming can not be stopped."), 1, 0);
+
+// if(fmt == 0)
+ buf = ostrcat(buf, "", 1, 0);
+
+ return buf;
+}
+
#endif