]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
bouquet: add map radio
authorJaroslav Kysela <perex@perex.cz>
Wed, 5 Nov 2014 09:23:30 +0000 (10:23 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sat, 8 Nov 2014 20:05:38 +0000 (21:05 +0100)
src/bouquet.c
src/bouquet.h
src/webui/static/app/cteditor.js

index 0524147ac79e9a7983f33c1e2cc29c1cea2d4a6a..7bd2d43070814b39d1815fdc7063a00bc08e60bc 100644 (file)
@@ -222,7 +222,11 @@ bouquet_map_channel(bouquet_t *bq, service_t *t)
   channel_t *ch = NULL;
   channel_service_mapping_t *csm;
 
-  if (!bq->bq_mapnolcn && service_get_channel_number(t) <= 0)
+  if (!bq->bq_mapradio && service_is_radio(t))
+    return;
+  if (!bq->bq_mapnolcn &&
+      service_get_channel_number(t) <= 0 &&
+      bouquet_get_channel_number(bq, t) <= 0)
     return;
   if (!bq->bq_mapnoname && noname(service_get_channel_name(t)))
     return;
@@ -492,7 +496,8 @@ bouquet_class_mapnolcn_notify ( void *obj )
   if (!bq->bq_mapnolcn && bq->bq_enabled && bq->bq_maptoch) {
     for (z = 0; z < bq->bq_services->is_count; z++) {
       t = (service_t *)bq->bq_services->is_array[z];
-      if (service_get_channel_number(t) <= 0)
+      if (service_get_channel_number(t) <= 0 &&
+          bouquet_get_channel_number(bq, t) <= 0)
         bouquet_unmap_channel(bq, t);
     }
   } else {
@@ -520,6 +525,26 @@ bouquet_class_mapnoname_notify ( void *obj )
   }
 }
 
+static void
+bouquet_class_mapradio_notify ( void *obj )
+{
+  bouquet_t *bq = obj;
+  service_t *t;
+  size_t z;
+
+  if (bq->bq_in_load)
+    return;
+  if (!bq->bq_mapradio && bq->bq_enabled && bq->bq_maptoch) {
+    for (z = 0; z < bq->bq_services->is_count; z++) {
+      t = (service_t *)bq->bq_services->is_array[z];
+      if (service_is_radio(t))
+        bouquet_unmap_channel(bq, t);
+    }
+  } else {
+    bouquet_map_to_channels(bq);
+  }
+}
+
 static void
 bouquet_class_chtag_notify ( void *obj )
 {
@@ -678,6 +703,13 @@ const idclass_t bouquet_class = {
       .off      = offsetof(bouquet_t, bq_mapnoname),
       .notify   = bouquet_class_mapnoname_notify,
     },
+    {
+      .type     = PT_BOOL,
+      .id       = "mapradio",
+      .name     = "Map Radio",
+      .off      = offsetof(bouquet_t, bq_mapradio),
+      .notify   = bouquet_class_mapradio_notify,
+    },
     {
       .type     = PT_BOOL,
       .id       = "chtag",
index 293a97d6b7fc503bef069aa9e4aa91da03c54cac..1ea5e612395ad9d6615bbd4b26ed3edfc28b3730 100644 (file)
@@ -37,6 +37,7 @@ typedef struct bouquet {
   int           bq_maptoch;
   int           bq_mapnolcn;
   int           bq_mapnoname;
+  int           bq_mapradio;
   int           bq_chtag;
   channel_tag_t*bq_chtag_ptr;
   const char   *bq_chtag_waiting;
index 2755c2dc7198a0d8ff19778ff797e301507c30a4..5be943a6ce415e2fb6ff2a5db921afb48c1d839f 100644 (file)
@@ -45,6 +45,7 @@ tvheadend.bouquet = function(panel, index)
             name:           { width: 200 },
             maptoch:        { width: 100 },
             mapnolcn:       { width: 100 },
+            mapradio:       { width: 100 },
             lcn_off:        { width: 100 },
             mapnoname:      { width: 100 },
             chtag:          { width: 100 },