From 96e3f7b0a4956a6df797ff513fc59c5de55cdae3 Mon Sep 17 00:00:00 2001 From: Sascha InuSasha Kuehndel Date: Wed, 8 Jan 2014 21:31:01 +0100 Subject: [PATCH] EN50494: convert fields for id and pin to a drop down box, on gui --- src/input/mpegts/linuxdvb/linuxdvb_en50494.c | 36 -------------------- src/input/mpegts/linuxdvb/linuxdvb_satconf.c | 35 ++++++++++++++++--- 2 files changed, 31 insertions(+), 40 deletions(-) diff --git a/src/input/mpegts/linuxdvb/linuxdvb_en50494.c b/src/input/mpegts/linuxdvb/linuxdvb_en50494.c index 8256874e..bdaa3bab 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_en50494.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_en50494.c @@ -80,39 +80,6 @@ linuxdvb_en50494_class_get_title ( idnode_t *o ) return buf; } -static htsmsg_t * -linuxdvb_en50494_class_position_list ( void *o ) -{ - htsmsg_t *m = htsmsg_create_list(); - htsmsg_add_u32(m, NULL, LINUXDVB_EN50494_SAT_A); - htsmsg_add_u32(m, NULL, LINUXDVB_EN50494_SAT_B); - return m; -} - -static htsmsg_t * -linuxdvb_en50494_class_id_list ( void *o ) -{ - uint32_t i; - - htsmsg_t *m = htsmsg_create_list(); - for (i = 0; i < 8; i++) { - htsmsg_add_u32(m, NULL, i); - } - return m; -} - -static htsmsg_t * -linuxdvb_en50494_class_pin_list ( void *o ) -{ - int32_t i; - - htsmsg_t *m = htsmsg_create_list(); - for (i = -1; i < 256; i++) { - htsmsg_add_s32(m, NULL, i); - } - return m; -} - extern const idclass_t linuxdvb_diseqc_class; const idclass_t linuxdvb_en50494_class = { @@ -126,7 +93,6 @@ const idclass_t linuxdvb_en50494_class = .id = "position", .name = "Position", .off = offsetof(linuxdvb_en50494_t, le_position), - .list = linuxdvb_en50494_class_position_list }, { .type = PT_U16, @@ -139,14 +105,12 @@ const idclass_t linuxdvb_en50494_class = .id = "id", .name = "ID", .off = offsetof(linuxdvb_en50494_t, le_id), - .list = linuxdvb_en50494_class_id_list }, { .type = PT_U16, .id = "pin", .name = "Pin", .off = offsetof(linuxdvb_en50494_t, le_pin), - .list = linuxdvb_en50494_class_pin_list }, {} } diff --git a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c index d7aa8c5a..0cfdc0b9 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c @@ -163,6 +163,18 @@ linuxdvb_satconf_class_orbitalpos_set return 1; } +static htsmsg_t * +linuxdvb_satconf_class_en50494_id_list ( void *o ) +{ + uint32_t i; + + htsmsg_t *m = htsmsg_create_list(); + for (i = 0; i < 8; i++) { + htsmsg_add_u32(m, NULL, i); + } + return m; +} + static const void * linuxdvb_satconf_class_en50494_id_get ( void *p ) { @@ -235,6 +247,21 @@ linuxdvb_satconf_class_en50494_freq_set return 0; } +/* TODO: Value 256 should shown as "no Pin", and have to set on top" */ +static htsmsg_t * +linuxdvb_satconf_class_en50494_pin_list ( void *o ) +{ + int32_t i; + + htsmsg_t *m = htsmsg_create_list(); + for (i = 0; i < 256; i++) { + htsmsg_add_u32(m, NULL, i); + } + htsmsg_add_u32(m, NULL, 256); + return m; +} + + static const void * linuxdvb_satconf_class_en50494_pin_get ( void *p ) { @@ -440,8 +467,8 @@ const idclass_t linuxdvb_satconf_en50494_class = .name = "ID (0-7)", .get = linuxdvb_satconf_class_en50494_id_get, .set = linuxdvb_satconf_class_en50494_id_set, + .list = linuxdvb_satconf_class_en50494_id_list, .opts = PO_NOSAVE, - // TODO: add id list }, { .type = PT_U16, @@ -454,11 +481,11 @@ const idclass_t linuxdvb_satconf_en50494_class = { .type = PT_U16, .id = "pin", - .name = "PIN (0-255, 256 for no pin)", + .name = "Pin (256 for no pin)", .get = linuxdvb_satconf_class_en50494_pin_get, .set = linuxdvb_satconf_class_en50494_pin_set, + .list = linuxdvb_satconf_class_en50494_pin_list, .opts = PO_NOSAVE, - // TODO: add pin list }, {} } @@ -871,7 +898,7 @@ const idclass_t linuxdvb_satconf_ele_class = .name = "Network", .get = linuxdvb_satconf_ele_class_network_get, .set = linuxdvb_satconf_ele_class_network_set, - .list = linuxdvb_satconf_ele_class_network_enum, + .list = linuxdvb_satconf_ele_class_network_enum, .rend = linuxdvb_satconf_ele_class_network_rend, }, {