From 589669126e46bb3592735c84d7c749e627d34b1c Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Sat, 21 Sep 2013 22:00:07 +0100 Subject: [PATCH] webui: add default options to various structures for better UI --- src/channels.c | 2 + src/input/mpegts/linuxdvb/linuxdvb_mux.c | 47 +++++++++++--------- src/input/mpegts/linuxdvb/linuxdvb_satconf.c | 4 ++ src/input/mpegts/mpegts_input.c | 1 + src/input/mpegts/mpegts_mux.c | 3 +- src/input/mpegts/mpegts_network.c | 3 ++ src/input/mpegts/mpegts_service.c | 7 +-- 7 files changed, 41 insertions(+), 26 deletions(-) diff --git a/src/channels.c b/src/channels.c index 936576f8..25ae315b 100644 --- a/src/channels.c +++ b/src/channels.c @@ -229,12 +229,14 @@ const idclass_t channel_class = { .id = "dvr_pre_time", .name = "DVR Pre", // TODO: better text? .off = offsetof(channel_t, ch_dvr_extra_time_pre), + .opts = PO_ADVANCED }, { .type = PT_INT, .id = "dvr_pst_time", .name = "DVR Post", // TODO: better text? .off = offsetof(channel_t, ch_dvr_extra_time_post), + .opts = PO_ADVANCED }, { .type = PT_STR, diff --git a/src/input/mpegts/linuxdvb/linuxdvb_mux.c b/src/input/mpegts/linuxdvb/linuxdvb_mux.c index 1d057a92..3de89e77 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_mux.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_mux.c @@ -70,13 +70,14 @@ linuxdvb_mux_##c##_class_##l##_enum (void *o)\ htsmsg_add_str(m, NULL, dvb_##l##2str(t[i]));\ return m;\ } -#define MUX_PROP_STR(_id, _name, t, l)\ - .type = PT_STR,\ - .id = _id,\ - .name = _name,\ - .get = linuxdvb_mux_##t##_class_##l##_get,\ - .set = linuxdvb_mux_##t##_class_##l##_set,\ - .list = linuxdvb_mux_##t##_class_##l##_enum +#define MUX_PROP_STR(_id, _name, t, l, d)\ + .type = PT_STR,\ + .id = _id,\ + .name = _name,\ + .get = linuxdvb_mux_##t##_class_##l##_get,\ + .set = linuxdvb_mux_##t##_class_##l##_set,\ + .list = linuxdvb_mux_##t##_class_##l##_enum,\ + .def.s = d static const void * linuxdvb_mux_class_delsys_get (void *o) @@ -183,7 +184,7 @@ const idclass_t linuxdvb_mux_dvbt_class = .ic_caption = "Linux DVB-T Multiplex", .ic_properties = (const property_t[]){ { - MUX_PROP_STR("delsys", "Delivery System", dvbt, delsys), + MUX_PROP_STR("delsys", "Delivery System", dvbt, delsys, "DVBT"), }, { .type = PT_U32, @@ -193,25 +194,25 @@ const idclass_t linuxdvb_mux_dvbt_class = .off = offsetof(linuxdvb_mux_t, lm_tuning.dmc_fe_params.frequency), }, { - MUX_PROP_STR("bandwidth", "Bandwidth", dvbt, bw) + MUX_PROP_STR("bandwidth", "Bandwidth", dvbt, bw, "AUTO") }, { - MUX_PROP_STR("constellation", "Constellation", dvbt, qam) + MUX_PROP_STR("constellation", "Constellation", dvbt, qam, "AUTO") }, { - MUX_PROP_STR("transmission_mode", "Transmission Mode", dvbt, mode) + MUX_PROP_STR("transmission_mode", "Transmission Mode", dvbt, mode, "AUTO") }, { - MUX_PROP_STR("guard_interval", "Guard Interval", dvbt, guard) + MUX_PROP_STR("guard_interval", "Guard Interval", dvbt, guard, "AUTO") }, { - MUX_PROP_STR("hierarchy", "Hierarchy", dvbt, hier), + MUX_PROP_STR("hierarchy", "Hierarchy", dvbt, hier, "AUTO"), }, { - MUX_PROP_STR("fec_hi", "FEC High", dvbt, fechi), + MUX_PROP_STR("fec_hi", "FEC High", dvbt, fechi, "AUTO"), }, { - MUX_PROP_STR("fec_lo", "FEC Low", dvbt, feclo), + MUX_PROP_STR("fec_lo", "FEC Low", dvbt, feclo, "AUTO"), }, {} } @@ -250,7 +251,7 @@ const idclass_t linuxdvb_mux_dvbc_class = .ic_caption = "Linux DVB-C Multiplex", .ic_properties = (const property_t[]){ { - MUX_PROP_STR("delsys", "Delivery System", dvbc, delsys), + MUX_PROP_STR("delsys", "Delivery System", dvbc, delsys, "DVBC_ANNEX_AC"), }, { .type = PT_U32, @@ -267,10 +268,10 @@ const idclass_t linuxdvb_mux_dvbc_class = .off = offsetof(linuxdvb_mux_t, lm_tuning.dmc_fe_params.u.qam.symbol_rate), }, { - MUX_PROP_STR("constellation", "Constellation", dvbc, qam) + MUX_PROP_STR("constellation", "Constellation", dvbc, qam, "AUTO") }, { - MUX_PROP_STR("fec", "FEC", dvbc, fec) + MUX_PROP_STR("fec", "FEC", dvbc, fec, "AUTO") }, {} } @@ -388,7 +389,7 @@ const idclass_t linuxdvb_mux_dvbs_class = .ic_caption = "Linux DVB-S Multiplex", .ic_properties = (const property_t[]){ { - MUX_PROP_STR("delsys", "Delivery System", dvbs, delsys), + MUX_PROP_STR("delsys", "Delivery System", dvbs, delsys, "DVBS"), }, { .type = PT_U32, @@ -405,7 +406,7 @@ const idclass_t linuxdvb_mux_dvbs_class = .off = offsetof(linuxdvb_mux_t, lm_tuning.dmc_fe_params.u.qpsk.symbol_rate), }, { - MUX_PROP_STR("polarisation", "Polarisation", dvbs, polarity) + MUX_PROP_STR("polarisation", "Polarisation", dvbs, polarity, NULL) }, { .type = PT_STR, @@ -414,9 +415,10 @@ const idclass_t linuxdvb_mux_dvbs_class = .set = linuxdvb_mux_dvbs_class_modulation_set, .get = linuxdvb_mux_dvbs_class_modulation_get, .list = linuxdvb_mux_dvbs_class_modulation_list, + .def.s = "AUTO", }, { - MUX_PROP_STR("fec", "FEC", dvbs, fec) + MUX_PROP_STR("fec", "FEC", dvbs, fec, "AUTO") }, #if DVB_VER_ATLEAST(5,0) { @@ -426,6 +428,7 @@ const idclass_t linuxdvb_mux_dvbs_class = .set = linuxdvb_mux_dvbs_class_rolloff_set, .get = linuxdvb_mux_dvbs_class_rolloff_get, .list = linuxdvb_mux_dvbs_class_rolloff_list, + .def.s = "AUTO" }, #endif {} @@ -450,7 +453,7 @@ const idclass_t linuxdvb_mux_atsc_class = .ic_caption = "Linux ATSC Multiplex", .ic_properties = (const property_t[]){ { - MUX_PROP_STR("delsys", "Delivery System", atsc, delsys), + MUX_PROP_STR("delsys", "Delivery System", atsc, delsys, "ATSC"), }, {} } diff --git a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c index e9793222..38ccddb7 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c @@ -304,6 +304,7 @@ const idclass_t linuxdvb_satconf_class = .id = "diseqc_repeats", .name = "DiseqC repeats", .off = offsetof(linuxdvb_satconf_t, ls_diseqc_repeats), + .def.i = 0 }, { .type = PT_STR, @@ -312,6 +313,7 @@ const idclass_t linuxdvb_satconf_class = .set = linuxdvb_satconf_class_lnbtype_set, .get = linuxdvb_satconf_class_lnbtype_get, .list = linuxdvb_lnb_list, + .def.s = "Universal", }, { .type = PT_STR, @@ -320,6 +322,7 @@ const idclass_t linuxdvb_satconf_class = .set = linuxdvb_satconf_class_switchtype_set, .get = linuxdvb_satconf_class_switchtype_get, .list = linuxdvb_switch_list, + .def.s = "None", }, { .type = PT_STR, @@ -328,6 +331,7 @@ const idclass_t linuxdvb_satconf_class = .set = linuxdvb_satconf_class_rotortype_set, .get = linuxdvb_satconf_class_rotortype_get, .list = linuxdvb_rotor_list, + .def.s = "None", }, {} } diff --git a/src/input/mpegts/mpegts_input.c b/src/input/mpegts/mpegts_input.c index aa5b7d22..df519113 100644 --- a/src/input/mpegts/mpegts_input.c +++ b/src/input/mpegts/mpegts_input.c @@ -49,6 +49,7 @@ const idclass_t mpegts_input_class = .id = "enabled", .name = "Enabled", .off = offsetof(mpegts_input_t, mi_enabled), + .def.i = 1, }, { .type = PT_STR, diff --git a/src/input/mpegts/mpegts_mux.c b/src/input/mpegts/mpegts_mux.c index c994cfb1..02da69a2 100644 --- a/src/input/mpegts/mpegts_mux.c +++ b/src/input/mpegts/mpegts_mux.c @@ -176,6 +176,7 @@ const idclass_t mpegts_mux_class = .id = "enabled", .name = "Enabled", .off = offsetof(mpegts_mux_t, mm_enabled), + .def.i = 1, }, { .type = PT_STR, @@ -209,7 +210,7 @@ const idclass_t mpegts_mux_class = .type = PT_STR, .id = "cridauth", .name = "CRID Authority", - .opts = PO_RDONLY, + .opts = PO_RDONLY | PO_HIDDEN, .off = offsetof(mpegts_mux_t, mm_crid_authority), }, { diff --git a/src/input/mpegts/mpegts_network.c b/src/input/mpegts/mpegts_network.c index 86f1ea52..5777a5bb 100644 --- a/src/input/mpegts/mpegts_network.c +++ b/src/input/mpegts/mpegts_network.c @@ -110,6 +110,7 @@ const idclass_t mpegts_network_class = .type = PT_U16, .id = "nid", .name = "Network ID (limit scanning)", + .opts = PO_ADVANCED, .off = offsetof(mpegts_network_t, mn_nid), }, { @@ -117,12 +118,14 @@ const idclass_t mpegts_network_class = .id = "autodiscovery", .name = "Network Discovery", .off = offsetof(mpegts_network_t, mn_autodiscovery), + .def.i = 1 }, { .type = PT_BOOL, .id = "skipinitscan", .name = "Skip Initial Scan", .off = offsetof(mpegts_network_t, mn_skipinitscan), + .def.i = 1 }, { .type = PT_INT, diff --git a/src/input/mpegts/mpegts_service.c b/src/input/mpegts/mpegts_service.c index f916dd7c..e9edff34 100644 --- a/src/input/mpegts/mpegts_service.c +++ b/src/input/mpegts/mpegts_service.c @@ -79,21 +79,21 @@ const idclass_t mpegts_service_class = .type = PT_STR, .id = "provider", .name = "Provider", - .opts = PO_RDONLY, + .opts = PO_RDONLY | PO_HIDDEN, .off = offsetof(mpegts_service_t, s_dvb_provider), }, { .type = PT_STR, .id = "cridauth", .name = "CRID Authority", - .opts = PO_RDONLY, + .opts = PO_RDONLY | PO_HIDDEN, .off = offsetof(mpegts_service_t, s_dvb_cridauth), }, { .type = PT_U16, .id = "dvb_servicetype", .name = "Service Type", - .opts = PO_RDONLY, + .opts = PO_RDONLY || PO_HIDDEN, .off = offsetof(mpegts_service_t, s_dvb_servicetype), }, { @@ -101,6 +101,7 @@ const idclass_t mpegts_service_class = .id = "charset", .name = "Character Set", .off = offsetof(mpegts_service_t, s_dvb_charset), + .opts = PO_ADVANCED, }, {}, }