2008-04-07 15:57:20 +00:00
|
|
|
|
/*
|
|
|
|
|
* tvheadend, AJAX / HTML user interface
|
|
|
|
|
* Copyright (C) 2008 Andreas <EFBFBD>man
|
|
|
|
|
*
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#define _GNU_SOURCE
|
|
|
|
|
|
|
|
|
|
#include <pthread.h>
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
#include <linux/dvb/frontend.h>
|
|
|
|
|
|
|
|
|
|
#include "tvhead.h"
|
|
|
|
|
#include "http.h"
|
|
|
|
|
#include "ajaxui.h"
|
|
|
|
|
#include "channels.h"
|
|
|
|
|
#include "dvb.h"
|
|
|
|
|
#include "dvb_support.h"
|
|
|
|
|
#include "dvb_muxconfig.h"
|
|
|
|
|
#include "psi.h"
|
|
|
|
|
#include "transports.h"
|
|
|
|
|
|
2008-04-17 15:03:50 +00:00
|
|
|
|
#include "ajaxui_mailbox.h"
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
add_option(tcp_queue_t *tq, int bol, const char *name)
|
|
|
|
|
{
|
|
|
|
|
if(bol)
|
|
|
|
|
tcp_qprintf(tq, "<option>%s</option>", name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
tdmi_displayname(th_dvb_mux_instance_t *tdmi, char *buf, size_t len)
|
|
|
|
|
{
|
|
|
|
|
int f = tdmi->tdmi_fe_params->frequency;
|
|
|
|
|
|
2008-04-20 13:38:10 +00:00
|
|
|
|
if(tdmi->tdmi_adapter->tda_type == FE_QPSK) {
|
2008-04-07 15:57:20 +00:00
|
|
|
|
snprintf(buf, len, "%d kHz %s", f,
|
|
|
|
|
dvb_polarisation_to_str(tdmi->tdmi_polarisation));
|
|
|
|
|
} else {
|
|
|
|
|
snprintf(buf, len, "%d kHz", f / 1000);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Adapter summary
|
|
|
|
|
*/
|
|
|
|
|
static int
|
2008-04-14 18:59:31 +00:00
|
|
|
|
ajax_adaptersummary(http_connection_t *hc, http_reply_t *hr,
|
|
|
|
|
const char *remain, void *opaque)
|
2008-04-07 15:57:20 +00:00
|
|
|
|
{
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_queue_t *tq = &hr->hr_tq;
|
2008-04-07 15:57:20 +00:00
|
|
|
|
th_dvb_adapter_t *tda;
|
|
|
|
|
char dispname[20];
|
|
|
|
|
|
|
|
|
|
if(remain == NULL || (tda = dvb_adapter_find_by_identifier(remain)) == NULL)
|
|
|
|
|
return HTTP_STATUS_NOT_FOUND;
|
|
|
|
|
|
|
|
|
|
snprintf(dispname, sizeof(dispname), "%s", tda->tda_displayname);
|
|
|
|
|
strcpy(dispname + sizeof(dispname) - 4, "...");
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
ajax_box_begin(tq, AJAX_BOX_SIDEBOX, NULL, NULL, dispname);
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
2008-04-17 15:03:50 +00:00
|
|
|
|
tcp_qprintf(tq, "<div class=\"infoprefix\">Device:</div>"
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"<div>%s</div>",
|
2008-04-20 13:38:10 +00:00
|
|
|
|
tda->tda_rootpath ?: "<b><i>Not present</i></b>");
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq, "<div class=\"infoprefix\">Type:</div>"
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"<div>%s</div>",
|
2008-04-20 13:38:10 +00:00
|
|
|
|
dvb_adaptertype_to_str(tda->tda_type));
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq, "<div style=\"text-align: center\">"
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"<a href=\"javascript:void(0);\" "
|
|
|
|
|
"onClick=\"new Ajax.Updater('dvbadaptereditor', "
|
|
|
|
|
"'/ajax/dvbadaptereditor/%s', "
|
|
|
|
|
"{method: 'get', evalScripts: true})\""
|
|
|
|
|
"\">Edit</a></div>", tda->tda_identifier);
|
2008-04-14 18:59:31 +00:00
|
|
|
|
ajax_box_end(tq, AJAX_BOX_SIDEBOX);
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
http_output_html(hc, hr);
|
2008-04-07 15:57:20 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* DVB configuration
|
|
|
|
|
*/
|
|
|
|
|
int
|
2008-04-14 18:59:31 +00:00
|
|
|
|
ajax_config_dvb_tab(http_connection_t *hc, http_reply_t *hr)
|
2008-04-07 15:57:20 +00:00
|
|
|
|
{
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_queue_t *tq = &hr->hr_tq;
|
2008-04-07 15:57:20 +00:00
|
|
|
|
th_dvb_adapter_t *tda;
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq, "<div style=\"overflow: auto; width: 100%\">");
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
2008-04-20 13:38:10 +00:00
|
|
|
|
TAILQ_FOREACH(tda, &dvb_adapters, tda_global_link) {
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq, "<div id=\"summary_%s\" "
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"style=\"float:left; width: 250px\"></div>",
|
|
|
|
|
tda->tda_identifier);
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
ajax_js(tq, "new Ajax.Updater('summary_%s', "
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"'/ajax/dvbadaptersummary/%s', {method: 'get'})",
|
|
|
|
|
tda->tda_identifier, tda->tda_identifier);
|
|
|
|
|
|
|
|
|
|
}
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq, "</div>");
|
|
|
|
|
tcp_qprintf(tq, "<div id=\"dvbadaptereditor\"></div>");
|
|
|
|
|
http_output_html(hc, hr);
|
2008-04-07 15:57:20 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2008-04-20 13:38:10 +00:00
|
|
|
|
* Generate the 'add new...' mux link if the adapter has backing hardware
|
2008-04-07 15:57:20 +00:00
|
|
|
|
*
|
|
|
|
|
* if result is set we add a fade out of a result from a previous op
|
|
|
|
|
*/
|
|
|
|
|
static void
|
|
|
|
|
dvb_make_add_link(tcp_queue_t *tq, th_dvb_adapter_t *tda, const char *result)
|
|
|
|
|
{
|
2008-04-20 13:38:10 +00:00
|
|
|
|
if(tda->tda_fe_info != NULL) {
|
|
|
|
|
tcp_qprintf(tq,
|
|
|
|
|
"<p><a href=\"javascript:void(0);\" "
|
|
|
|
|
"onClick=\"new Ajax.Updater('addmux', "
|
|
|
|
|
"'/ajax/dvbadapteraddmux/%s', {method: 'get'})\""
|
|
|
|
|
">Add new...</a></p>", tda->tda_identifier);
|
|
|
|
|
}
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
|
|
|
|
if(result) {
|
|
|
|
|
tcp_qprintf(tq, "<div id=\"result\">%s</div>", result);
|
|
|
|
|
ajax_js(tq, "Effect.Fade('result')");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* DVB adapter editor pane
|
|
|
|
|
*/
|
|
|
|
|
static int
|
2008-04-14 18:59:31 +00:00
|
|
|
|
ajax_adaptereditor(http_connection_t *hc, http_reply_t *hr,
|
|
|
|
|
const char *remain, void *opaque)
|
2008-04-07 15:57:20 +00:00
|
|
|
|
{
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_queue_t *tq = &hr->hr_tq;
|
2008-04-07 15:57:20 +00:00
|
|
|
|
th_dvb_adapter_t *tda;
|
|
|
|
|
float a, b, c;
|
|
|
|
|
|
|
|
|
|
if(remain == NULL || (tda = dvb_adapter_find_by_identifier(remain)) == NULL)
|
|
|
|
|
return HTTP_STATUS_NOT_FOUND;
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
ajax_box_begin(tq, AJAX_BOX_FILLED, NULL, NULL, NULL);
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq,
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"<div style=\"text-align: center; font-weight: bold\">%s</div>",
|
|
|
|
|
tda->tda_displayname);
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
ajax_box_end(tq, AJAX_BOX_FILLED);
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
|
|
|
|
/* Type */
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq, "<div class=\"infoprefixwide\">Model:</div>"
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"<div>%s (%s)</div>",
|
2008-04-20 13:38:10 +00:00
|
|
|
|
tda->tda_fe_info ? tda->tda_fe_info->name : "<Unknown>",
|
|
|
|
|
dvb_adaptertype_to_str(tda->tda_type));
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
|
|
|
|
|
2008-04-20 13:38:10 +00:00
|
|
|
|
if(tda->tda_fe_info != NULL) {
|
|
|
|
|
switch(tda->tda_type) {
|
|
|
|
|
case FE_QPSK:
|
|
|
|
|
a = tda->tda_fe_info->frequency_min;
|
|
|
|
|
b = tda->tda_fe_info->frequency_max;
|
|
|
|
|
c = tda->tda_fe_info->frequency_stepsize;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
a = tda->tda_fe_info->frequency_min / 1000.0f;
|
|
|
|
|
b = tda->tda_fe_info->frequency_max / 1000.0f;
|
|
|
|
|
c = tda->tda_fe_info->frequency_stepsize / 1000.0f;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tcp_qprintf(tq, "<div class=\"infoprefixwide\">Freq. Range:</div>"
|
|
|
|
|
"<div>%.2f - %.2f kHz, in steps of %.2f kHz</div>",
|
|
|
|
|
a, b, c);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(tda->tda_fe_info->symbol_rate_min) {
|
|
|
|
|
tcp_qprintf(tq, "<div class=\"infoprefixwide\">Symbolrate:</div>"
|
|
|
|
|
"<div>%d - %d BAUD</div>",
|
|
|
|
|
tda->tda_fe_info->symbol_rate_min,
|
|
|
|
|
tda->tda_fe_info->symbol_rate_max);
|
|
|
|
|
}
|
|
|
|
|
/* Capabilities */
|
|
|
|
|
// tcp_qprintf(tq, "<div class=\"infoprefixwide\">Capabilities:</div>");
|
2008-04-07 15:57:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq, "<div style=\"float: left; width:45%\">");
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
ajax_box_begin(tq, AJAX_BOX_SIDEBOX, NULL, NULL, "Multiplexes");
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
2008-04-16 16:19:34 +00:00
|
|
|
|
tcp_qprintf(tq, "<div id=\"dvbmuxlist_%s\"></div>",
|
2008-04-07 15:57:20 +00:00
|
|
|
|
tda->tda_identifier);
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
ajax_js(tq,
|
2008-04-16 16:19:34 +00:00
|
|
|
|
"new Ajax.Updater('dvbmuxlist_%s', "
|
2008-04-16 05:23:03 +00:00
|
|
|
|
"'/ajax/dvbadaptermuxlist/%s', {method: 'get', evalScripts: true})",
|
2008-04-07 15:57:20 +00:00
|
|
|
|
tda->tda_identifier, tda->tda_identifier);
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq, "<hr><div id=\"addmux\">");
|
|
|
|
|
dvb_make_add_link(tq, tda, NULL);
|
|
|
|
|
tcp_qprintf(tq, "</div>");
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
ajax_box_end(tq, AJAX_BOX_SIDEBOX);
|
|
|
|
|
tcp_qprintf(tq, "</div>");
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
|
|
|
|
/* Div for displaying services */
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq, "<div id=\"servicepane\" "
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"style=\"float: left; width:55%\">");
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq, "</div>");
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
http_output_html(hc, hr);
|
2008-04-07 15:57:20 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* DVB adapter add mux
|
|
|
|
|
*/
|
|
|
|
|
static int
|
2008-04-14 18:59:31 +00:00
|
|
|
|
ajax_adapteraddmux(http_connection_t *hc, http_reply_t *hr,
|
|
|
|
|
const char *remain, void *opaque)
|
2008-04-07 15:57:20 +00:00
|
|
|
|
{
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_queue_t *tq = &hr->hr_tq;
|
2008-04-07 15:57:20 +00:00
|
|
|
|
th_dvb_adapter_t *tda;
|
|
|
|
|
int caps;
|
|
|
|
|
int fetype;
|
|
|
|
|
char params[400];
|
|
|
|
|
|
|
|
|
|
if(remain == NULL || (tda = dvb_adapter_find_by_identifier(remain)) == NULL)
|
|
|
|
|
return HTTP_STATUS_NOT_FOUND;
|
|
|
|
|
|
2008-04-20 13:38:10 +00:00
|
|
|
|
if(tda->tda_fe_info == NULL)
|
|
|
|
|
return HTTP_STATUS_BAD_REQUEST;
|
|
|
|
|
|
2008-04-07 15:57:20 +00:00
|
|
|
|
caps = tda->tda_fe_info->caps;
|
|
|
|
|
fetype = tda->tda_fe_info->type;
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq, "<div style=\"text-align: center; font-weight: bold\">"
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"Add new %s mux</div>",
|
|
|
|
|
dvb_adaptertype_to_str(tda->tda_fe_info->type));
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq,
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"<div class=\"infoprefixwidefat\">Frequency (%s):</div>"
|
|
|
|
|
"<div>"
|
|
|
|
|
"<input class=\"textinput\" type=\"text\" id=\"freq\">"
|
|
|
|
|
"</div>",
|
|
|
|
|
fetype == FE_QPSK ? "kHz" : "Hz");
|
|
|
|
|
|
|
|
|
|
snprintf(params, sizeof(params),
|
|
|
|
|
"freq: $F('freq')");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Symbolrate */
|
|
|
|
|
|
|
|
|
|
if(fetype == FE_QAM || fetype == FE_QPSK) {
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq,
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"<div class=\"infoprefixwidefat\">Symbolrate:</div>"
|
|
|
|
|
"<div>"
|
|
|
|
|
"<input class=\"textinput\" type=\"text\" id=\"symrate\">"
|
|
|
|
|
"</div>");
|
|
|
|
|
|
|
|
|
|
snprintf(params + strlen(params), sizeof(params) - strlen(params),
|
|
|
|
|
", symrate: $F('symrate')");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Bandwidth */
|
|
|
|
|
|
|
|
|
|
if(fetype == FE_OFDM) {
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq,
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"<div class=\"infoprefixwidefat\">Bandwidth:</div>"
|
|
|
|
|
"<div><select id=\"bw\" class=\"textinput\">");
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
add_option(tq, caps & FE_CAN_BANDWIDTH_AUTO, "AUTO");
|
|
|
|
|
add_option(tq, 1 , "8MHz");
|
|
|
|
|
add_option(tq, 1 , "7MHz");
|
|
|
|
|
add_option(tq, 1 , "6MHz");
|
|
|
|
|
tcp_qprintf(tq, "</select></div>");
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
|
|
|
|
snprintf(params + strlen(params), sizeof(params) - strlen(params),
|
|
|
|
|
", bw: $F('bw')");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Constellation */
|
|
|
|
|
|
|
|
|
|
if(fetype == FE_QAM || fetype == FE_OFDM) {
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq,
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"<div class=\"infoprefixwidefat\">Constellation:</div>"
|
|
|
|
|
"<div><select id=\"const\" class=\"textinput\">");
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
add_option(tq, caps & FE_CAN_QAM_AUTO, "AUTO");
|
|
|
|
|
add_option(tq, caps & FE_CAN_QPSK, "QPSK");
|
|
|
|
|
add_option(tq, caps & FE_CAN_QAM_16, "QAM16");
|
|
|
|
|
add_option(tq, caps & FE_CAN_QAM_32, "QAM32");
|
|
|
|
|
add_option(tq, caps & FE_CAN_QAM_64, "QAM64");
|
|
|
|
|
add_option(tq, caps & FE_CAN_QAM_128, "QAM128");
|
|
|
|
|
add_option(tq, caps & FE_CAN_QAM_256, "QAM256");
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq, "</select></div>");
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
|
|
|
|
snprintf(params + strlen(params), sizeof(params) - strlen(params),
|
|
|
|
|
", const: $F('const')");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* FEC */
|
|
|
|
|
|
|
|
|
|
if(fetype == FE_QAM || fetype == FE_QPSK) {
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq,
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"<div class=\"infoprefixwidefat\">FEC:</div>"
|
|
|
|
|
"<div><select id=\"fec\" class=\"textinput\">");
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_AUTO, "AUTO");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_1_2, "1/2");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_2_3, "2/3");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_3_4, "3/4");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_4_5, "4/5");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_5_6, "5/6");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_6_7, "6/7");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_7_8, "7/8");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_8_9, "8/9");
|
|
|
|
|
tcp_qprintf(tq, "</select></div>");
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
|
|
|
|
snprintf(params + strlen(params), sizeof(params) - strlen(params),
|
|
|
|
|
", fec: $F('fec')");
|
|
|
|
|
}
|
|
|
|
|
|
2008-04-09 10:01:31 +00:00
|
|
|
|
if(fetype == FE_QPSK) {
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq,
|
2008-04-09 10:01:31 +00:00
|
|
|
|
"<div class=\"infoprefixwidefat\">Polarisation:</div>"
|
|
|
|
|
"<div><select id=\"pol\" class=\"textinput\">");
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
add_option(tq, 1, "Vertical");
|
|
|
|
|
add_option(tq, 1, "Horizontal");
|
|
|
|
|
tcp_qprintf(tq, "</select></div>");
|
2008-04-09 10:01:31 +00:00
|
|
|
|
|
|
|
|
|
snprintf(params + strlen(params), sizeof(params) - strlen(params),
|
|
|
|
|
", pol: $F('pol')");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
|
|
|
|
if(fetype == FE_OFDM) {
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq,
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"<div class=\"infoprefixwidefat\">Transmission mode:</div>"
|
|
|
|
|
"<div><select id=\"tmode\" class=\"textinput\">");
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
add_option(tq, caps & FE_CAN_TRANSMISSION_MODE_AUTO, "AUTO");
|
|
|
|
|
add_option(tq, 1 , "2k");
|
|
|
|
|
add_option(tq, 1 , "8k");
|
|
|
|
|
tcp_qprintf(tq, "</select></div>");
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
|
|
|
|
snprintf(params + strlen(params), sizeof(params) - strlen(params),
|
|
|
|
|
", tmode: $F('tmode')");
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq,
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"<div class=\"infoprefixwidefat\">Guard interval:</div>"
|
|
|
|
|
"<div><select id=\"guard\" class=\"textinput\">");
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
add_option(tq, caps & FE_CAN_GUARD_INTERVAL_AUTO, "AUTO");
|
|
|
|
|
add_option(tq, 1 , "1/32");
|
|
|
|
|
add_option(tq, 1 , "1/16");
|
|
|
|
|
add_option(tq, 1 , "1/8");
|
|
|
|
|
add_option(tq, 1 , "1/4");
|
|
|
|
|
tcp_qprintf(tq, "</select></div>");
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
|
|
|
|
snprintf(params + strlen(params), sizeof(params) - strlen(params),
|
|
|
|
|
", guard: $F('guard')");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq,
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"<div class=\"infoprefixwidefat\">Hierarchy:</div>"
|
|
|
|
|
"<div><select id=\"hier\" class=\"textinput\">");
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
add_option(tq, caps & FE_CAN_HIERARCHY_AUTO, "AUTO");
|
|
|
|
|
add_option(tq, 1 , "1");
|
|
|
|
|
add_option(tq, 1 , "2");
|
|
|
|
|
add_option(tq, 1 , "4");
|
|
|
|
|
add_option(tq, 1 , "NONE");
|
|
|
|
|
tcp_qprintf(tq, "</select></div>");
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
snprintf(params + strlen(params), sizeof(params) - strlen(params),
|
|
|
|
|
", hier: $F('hier')");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq,
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"<div class=\"infoprefixwidefat\">FEC Hi:</div>"
|
|
|
|
|
"<div><select id=\"fechi\" class=\"textinput\">");
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_AUTO, "AUTO");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_1_2, "1/2");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_2_3, "2/3");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_3_4, "3/4");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_4_5, "4/5");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_5_6, "5/6");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_6_7, "6/7");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_7_8, "7/8");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_8_9, "8/9");
|
|
|
|
|
tcp_qprintf(tq, "</select></div>");
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
|
|
|
|
snprintf(params + strlen(params), sizeof(params) - strlen(params),
|
|
|
|
|
", fechi: $F('fechi')");
|
|
|
|
|
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq,
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"<div class=\"infoprefixwidefat\">FEC Low:</div>"
|
|
|
|
|
"<div><select id=\"feclo\" class=\"textinput\">");
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_AUTO, "AUTO");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_1_2, "1/2");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_2_3, "2/3");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_3_4, "3/4");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_4_5, "4/5");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_5_6, "5/6");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_6_7, "6/7");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_7_8, "7/8");
|
|
|
|
|
add_option(tq, caps & FE_CAN_FEC_8_9, "8/9");
|
|
|
|
|
tcp_qprintf(tq, "</select></div>");
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
|
|
|
|
snprintf(params + strlen(params), sizeof(params) - strlen(params),
|
|
|
|
|
", feclo: $F('feclo')");
|
|
|
|
|
}
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq,
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"<div style=\"text-align: center\">"
|
|
|
|
|
"<input type=\"button\" value=\"Create\" "
|
|
|
|
|
"onClick=\"new Ajax.Updater('addmux', "
|
|
|
|
|
"'/ajax/dvbadaptercreatemux/%s', "
|
|
|
|
|
"{evalScripts: true, parameters: {%s}})"
|
|
|
|
|
"\">"
|
|
|
|
|
"</div>", tda->tda_identifier, params);
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
http_output_html(hc, hr);
|
2008-04-07 15:57:20 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
static int
|
2008-04-14 18:59:31 +00:00
|
|
|
|
ajax_adaptercreatemux_fail(http_connection_t *hc, http_reply_t *hr,
|
|
|
|
|
th_dvb_adapter_t *tda, const char *errmsg)
|
2008-04-07 15:57:20 +00:00
|
|
|
|
{
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_queue_t *tq = &hr->hr_tq;
|
|
|
|
|
dvb_make_add_link(tq, tda, errmsg);
|
|
|
|
|
http_output_html(hc, hr);
|
2008-04-07 15:57:20 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* DVB adapter create mux (come here on POST after addmux query)
|
|
|
|
|
*/
|
|
|
|
|
static int
|
2008-04-14 18:59:31 +00:00
|
|
|
|
ajax_adaptercreatemux(http_connection_t *hc, http_reply_t *hr,
|
|
|
|
|
const char *remain, void *opaque)
|
2008-04-07 15:57:20 +00:00
|
|
|
|
{
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_queue_t *tq;
|
2008-04-07 15:57:20 +00:00
|
|
|
|
th_dvb_adapter_t *tda;
|
|
|
|
|
const char *v;
|
|
|
|
|
|
|
|
|
|
if(remain == NULL || (tda = dvb_adapter_find_by_identifier(remain)) == NULL)
|
|
|
|
|
return HTTP_STATUS_NOT_FOUND;
|
|
|
|
|
|
|
|
|
|
v = dvb_mux_create_str(tda,
|
2008-04-19 14:11:21 +00:00
|
|
|
|
"65535",
|
2008-04-19 20:19:38 +00:00
|
|
|
|
NULL,
|
2008-04-07 15:57:20 +00:00
|
|
|
|
http_arg_get(&hc->hc_req_args, "freq"),
|
|
|
|
|
http_arg_get(&hc->hc_req_args, "symrate"),
|
|
|
|
|
http_arg_get(&hc->hc_req_args, "const"),
|
|
|
|
|
http_arg_get(&hc->hc_req_args, "fec"),
|
|
|
|
|
http_arg_get(&hc->hc_req_args, "fechi"),
|
|
|
|
|
http_arg_get(&hc->hc_req_args, "feclo"),
|
|
|
|
|
http_arg_get(&hc->hc_req_args, "bw"),
|
|
|
|
|
http_arg_get(&hc->hc_req_args, "tmode"),
|
|
|
|
|
http_arg_get(&hc->hc_req_args, "guard"),
|
|
|
|
|
http_arg_get(&hc->hc_req_args, "hier"),
|
|
|
|
|
http_arg_get(&hc->hc_req_args, "pol"),
|
|
|
|
|
http_arg_get(&hc->hc_req_args, "port"), 1);
|
|
|
|
|
|
|
|
|
|
if(v != NULL)
|
2008-04-14 18:59:31 +00:00
|
|
|
|
return ajax_adaptercreatemux_fail(hc, hr, tda, v);
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tq = &hr->hr_tq;
|
|
|
|
|
dvb_make_add_link(tq, tda, "Successfully created");
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
ajax_js(tq,
|
2008-04-16 16:19:34 +00:00
|
|
|
|
"new Ajax.Updater('dvbmuxlist_%s', "
|
2008-04-16 05:23:03 +00:00
|
|
|
|
"'/ajax/dvbadaptermuxlist/%s', {method: 'get', evalScripts: true})",
|
2008-04-07 15:57:20 +00:00
|
|
|
|
tda->tda_identifier, tda->tda_identifier);
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
http_output_html(hc, hr);
|
2008-04-07 15:57:20 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return a list of all muxes on the given adapter
|
|
|
|
|
*/
|
|
|
|
|
static int
|
2008-04-14 18:59:31 +00:00
|
|
|
|
ajax_adaptermuxlist(http_connection_t *hc, http_reply_t *hr,
|
|
|
|
|
const char *remain, void *opaque)
|
2008-04-07 15:57:20 +00:00
|
|
|
|
{
|
2008-04-21 16:44:59 +00:00
|
|
|
|
ajax_table_t ta;
|
2008-04-07 15:57:20 +00:00
|
|
|
|
th_dvb_mux_instance_t *tdmi;
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_queue_t *tq = &hr->hr_tq;
|
2008-04-07 15:57:20 +00:00
|
|
|
|
th_dvb_adapter_t *tda;
|
2008-04-21 16:44:59 +00:00
|
|
|
|
char buf[50];
|
2008-04-09 15:54:55 +00:00
|
|
|
|
int fetype, n, m;
|
2008-04-07 15:57:20 +00:00
|
|
|
|
th_transport_t *t;
|
2008-04-09 15:31:07 +00:00
|
|
|
|
int nmuxes = 0;
|
2008-04-21 19:25:04 +00:00
|
|
|
|
char **selvector;
|
2008-04-09 15:31:07 +00:00
|
|
|
|
|
2008-04-07 15:57:20 +00:00
|
|
|
|
if(remain == NULL || (tda = dvb_adapter_find_by_identifier(remain)) == NULL)
|
|
|
|
|
return HTTP_STATUS_NOT_FOUND;
|
|
|
|
|
|
2008-04-20 13:38:10 +00:00
|
|
|
|
fetype = tda->tda_type;
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
2008-04-09 15:31:07 +00:00
|
|
|
|
/* List of muxes */
|
|
|
|
|
|
|
|
|
|
LIST_FOREACH(tdmi, &tda->tda_muxes, tdmi_adapter_link)
|
|
|
|
|
nmuxes++;
|
|
|
|
|
|
|
|
|
|
if(nmuxes == 0) {
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_qprintf(tq, "<div style=\"text-align: center\">"
|
2008-04-07 15:57:20 +00:00
|
|
|
|
"No muxes configured</div>");
|
2008-04-21 16:44:59 +00:00
|
|
|
|
} else {
|
2008-04-16 05:23:03 +00:00
|
|
|
|
|
2008-04-21 19:25:04 +00:00
|
|
|
|
|
|
|
|
|
selvector = alloca(sizeof(char *) * (nmuxes + 1));
|
|
|
|
|
n = 0;
|
|
|
|
|
LIST_FOREACH(tdmi, &tda->tda_muxes, tdmi_adapter_link)
|
|
|
|
|
selvector[n++] = tdmi->tdmi_identifier;
|
|
|
|
|
selvector[n] = NULL;
|
|
|
|
|
|
|
|
|
|
ajax_generate_select_functions(tq, "mux", selvector);
|
|
|
|
|
|
2008-04-21 16:44:59 +00:00
|
|
|
|
ajax_table_top(&ta, hc, tq,
|
|
|
|
|
(const char *[])
|
2008-04-21 19:25:04 +00:00
|
|
|
|
{"Freq", "Status", "State", "Name", "Services", "", NULL},
|
2008-04-21 16:44:59 +00:00
|
|
|
|
(int[])
|
2008-04-21 19:25:04 +00:00
|
|
|
|
{16,12,8,16,8,2});
|
2008-04-21 16:44:59 +00:00
|
|
|
|
|
|
|
|
|
LIST_FOREACH(tdmi, &tda->tda_muxes, tdmi_adapter_link) {
|
|
|
|
|
|
|
|
|
|
tdmi_displayname(tdmi, buf, sizeof(buf));
|
|
|
|
|
|
|
|
|
|
ajax_table_row_start(&ta, tdmi->tdmi_identifier);
|
|
|
|
|
|
|
|
|
|
ajax_table_cell(&ta, NULL,
|
|
|
|
|
"<a href=\"javascript:void(0);\" "
|
|
|
|
|
"onClick=\"new Ajax.Updater('servicepane', "
|
|
|
|
|
"'/ajax/dvbmuxeditor/%s', "
|
|
|
|
|
"{method: 'get', evalScripts: true})\""
|
|
|
|
|
">%s</a>",
|
|
|
|
|
tdmi->tdmi_identifier, buf);
|
|
|
|
|
|
|
|
|
|
ajax_table_cell(&ta, "status", "%s", dvb_mux_status(tdmi));
|
|
|
|
|
ajax_table_cell(&ta, "state", "%s", dvb_mux_state(tdmi));
|
2008-04-21 19:25:04 +00:00
|
|
|
|
ajax_table_cell(&ta, "name", "%s", tdmi->tdmi_network ?: "Unknown");
|
2008-04-21 16:44:59 +00:00
|
|
|
|
|
|
|
|
|
n = m = 0;
|
|
|
|
|
LIST_FOREACH(t, &tdmi->tdmi_transports, tht_mux_link) {
|
|
|
|
|
n++;
|
|
|
|
|
if(transport_is_available(t))
|
|
|
|
|
m++;
|
|
|
|
|
}
|
|
|
|
|
ajax_table_cell(&ta, "nsvc", "%d / %d", m, n);
|
2008-04-21 19:25:04 +00:00
|
|
|
|
ajax_table_cell_checkbox(&ta);
|
2008-04-07 15:57:20 +00:00
|
|
|
|
}
|
2008-04-21 16:44:59 +00:00
|
|
|
|
ajax_table_bottom(&ta);
|
2008-04-21 19:25:04 +00:00
|
|
|
|
tcp_qprintf(tq, "<hr><div style=\"overflow: auto; width: 100%\">");
|
|
|
|
|
tcp_qprintf(tq, "<div class=\"infoprefix\">Select:</div><div>");
|
|
|
|
|
ajax_a_jsfuncf(tq, "All", "mux_sel_all();");
|
|
|
|
|
tcp_qprintf(tq, " / ");
|
|
|
|
|
ajax_a_jsfuncf(tq, "None", "mux_sel_none();");
|
|
|
|
|
tcp_qprintf(tq, " / ");
|
|
|
|
|
ajax_a_jsfuncf(tq, "Invert", "mux_sel_invert();");
|
|
|
|
|
tcp_qprintf(tq, "</div></div>\r\n");
|
|
|
|
|
|
|
|
|
|
tcp_qprintf(tq, "<div style=\"overflow: auto; width: 100%\">");
|
|
|
|
|
tcp_qprintf(tq, "<div class=\"infoprefix\"> </div><div>");
|
|
|
|
|
ajax_a_jsfuncf(tq, "Delete selected",
|
|
|
|
|
"mux_sel_do('dvbadapterdelmux/%s', '', '', true)",
|
|
|
|
|
tda->tda_identifier);
|
|
|
|
|
tcp_qprintf(tq, "</div></div>\r\n");
|
|
|
|
|
|
|
|
|
|
|
2008-04-07 15:57:20 +00:00
|
|
|
|
}
|
2008-04-14 18:59:31 +00:00
|
|
|
|
http_output_html(hc, hr);
|
2008-04-07 15:57:20 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2008-04-07 21:00:12 +00:00
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
static int
|
|
|
|
|
dvbsvccmp(th_transport_t *a, th_transport_t *b)
|
|
|
|
|
{
|
|
|
|
|
return a->tht_dvb_service_id - b->tht_dvb_service_id;
|
|
|
|
|
}
|
|
|
|
|
|
2008-04-07 15:57:20 +00:00
|
|
|
|
/**
|
|
|
|
|
* Display detailes about a mux
|
|
|
|
|
*/
|
|
|
|
|
static int
|
2008-04-14 18:59:31 +00:00
|
|
|
|
ajax_dvbmuxeditor(http_connection_t *hc, http_reply_t *hr,
|
|
|
|
|
const char *remain, void *opaque)
|
2008-04-07 15:57:20 +00:00
|
|
|
|
{
|
|
|
|
|
th_dvb_mux_instance_t *tdmi;
|
2008-04-14 18:59:31 +00:00
|
|
|
|
tcp_queue_t *tq = &hr->hr_tq;
|
2008-04-07 15:57:20 +00:00
|
|
|
|
char buf[1000];
|
|
|
|
|
th_transport_t *t;
|
|
|
|
|
struct th_transport_list head;
|
2008-04-09 19:31:20 +00:00
|
|
|
|
int n = 0;
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
|
|
|
|
if(remain == NULL || (tdmi = dvb_mux_find_by_identifier(remain)) == NULL)
|
|
|
|
|
return HTTP_STATUS_NOT_FOUND;
|
|
|
|
|
|
|
|
|
|
tdmi_displayname(tdmi, buf, sizeof(buf));
|
|
|
|
|
|
|
|
|
|
LIST_INIT(&head);
|
|
|
|
|
|
|
|
|
|
LIST_FOREACH(t, &tdmi->tdmi_transports, tht_mux_link) {
|
2008-04-09 19:31:20 +00:00
|
|
|
|
if(transport_is_available(t)) {
|
2008-04-09 15:54:55 +00:00
|
|
|
|
LIST_INSERT_SORTED(&head, t, tht_tmp_link, dvbsvccmp);
|
2008-04-09 19:31:20 +00:00
|
|
|
|
n++;
|
|
|
|
|
}
|
2008-04-07 15:57:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
ajax_box_begin(tq, AJAX_BOX_SIDEBOX, NULL, NULL, buf);
|
|
|
|
|
ajax_transport_build_list(hc, tq, &head, n);
|
|
|
|
|
ajax_box_end(tq, AJAX_BOX_SIDEBOX);
|
2008-04-07 15:57:20 +00:00
|
|
|
|
|
2008-04-14 18:59:31 +00:00
|
|
|
|
http_output_html(hc, hr);
|
2008-04-07 15:57:20 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2008-04-21 17:29:11 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Delete all muxes on an adapter
|
|
|
|
|
*/
|
|
|
|
|
static int
|
2008-04-21 19:25:04 +00:00
|
|
|
|
ajax_adapterdelmux(http_connection_t *hc, http_reply_t *hr,
|
|
|
|
|
const char *remain, void *opaque)
|
2008-04-21 17:29:11 +00:00
|
|
|
|
{
|
|
|
|
|
th_dvb_adapter_t *tda;
|
|
|
|
|
th_dvb_mux_instance_t *tdmi;
|
|
|
|
|
tcp_queue_t *tq = &hr->hr_tq;
|
2008-04-21 19:25:04 +00:00
|
|
|
|
http_arg_t *ra;
|
2008-04-21 17:29:11 +00:00
|
|
|
|
|
|
|
|
|
if(remain == NULL || (tda = dvb_adapter_find_by_identifier(remain)) == NULL)
|
|
|
|
|
return HTTP_STATUS_NOT_FOUND;
|
|
|
|
|
|
2008-04-21 19:25:04 +00:00
|
|
|
|
TAILQ_FOREACH(ra, &hc->hc_req_args, link) {
|
|
|
|
|
if(strcmp(ra->val, "selected"))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if((tdmi = dvb_mux_find_by_identifier(ra->key)) == NULL)
|
|
|
|
|
continue;
|
|
|
|
|
|
2008-04-21 17:29:11 +00:00
|
|
|
|
dvb_mux_destroy(tdmi);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tcp_qprintf(tq,
|
|
|
|
|
"new Ajax.Updater('dvbadaptereditor', "
|
|
|
|
|
"'/ajax/dvbadaptereditor/%s', "
|
|
|
|
|
"{method: 'get', evalScripts: true});",
|
|
|
|
|
tda->tda_identifier);
|
|
|
|
|
|
|
|
|
|
http_output(hc, hr, "text/javascript; charset=UTF8", NULL, 0);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2008-04-07 15:57:20 +00:00
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
ajax_config_dvb_init(void)
|
|
|
|
|
{
|
|
|
|
|
http_path_add("/ajax/dvbadaptermuxlist" , NULL, ajax_adaptermuxlist);
|
|
|
|
|
http_path_add("/ajax/dvbadaptersummary" , NULL, ajax_adaptersummary);
|
|
|
|
|
http_path_add("/ajax/dvbadaptereditor", NULL, ajax_adaptereditor);
|
|
|
|
|
http_path_add("/ajax/dvbadapteraddmux", NULL, ajax_adapteraddmux);
|
2008-04-21 19:25:04 +00:00
|
|
|
|
http_path_add("/ajax/dvbadapterdelmux", NULL, ajax_adapterdelmux);
|
2008-04-07 15:57:20 +00:00
|
|
|
|
http_path_add("/ajax/dvbadaptercreatemux", NULL, ajax_adaptercreatemux);
|
|
|
|
|
http_path_add("/ajax/dvbmuxeditor", NULL, ajax_dvbmuxeditor);
|
|
|
|
|
|
|
|
|
|
}
|