master-timer list of usable channels ?

Message ID 42AF573E.7090602@citd.de
State New
Headers

Commit Message

Matthias Schniedermeyer June 14, 2005, 10:16 p.m. UTC
  Matthias Schniedermeyer wrote:
> Gregoire Favre wrote:
>
>> Would it be possible to tell him to "only" use the channels 1 to 123 for
>> example, as autopid could add some "not usable" channels after those ?
> 
> Currently not.
> I've added a "highest-channel-number"-config-option to my todo-list.

I've taken the time to implemented that feature.

.diff attached.



Bis denn
  

Patch

Index: sample/config
===================================================================
--- sample/config	(revision 203)
+++ sample/config	(working copy)
@@ -19,6 +19,9 @@ 
 #recorddir	= /video
 recorddir	= /video/video0
 
+# Highester channel-number (including) available for recording, 0=no restrictions
+highest_channel_number = 0
+
 # Use fast or "safe" method for sorting the timers in VDR (This option is for sorttimer.pl)
 SortFast	= 1
 
Index: timer.pl
===================================================================
--- timer.pl	(revision 222)
+++ timer.pl	(working copy)
@@ -136,6 +136,12 @@ 
       next;
     }
 
+    # Check if timers is within allowed channel-number-range
+    if ($$rConfig{highest_channel_number} && ($$rChannels{rev}{$channel}{instance}{$num} > $$rConfig{highest_channel_number})) {
+      print "Channel: $channel(" . $$rChannels{rev}{$channel}{short_name} . ") is out of allowed channel-number-range: No. " . $$rChannels{rev}{$channel}{instance}{$num} . "\n" if ($$rConfig{debug} & 64);
+      next;
+    }
+
     foreach $time2 (sort keys %{$$rTimer{$num}}) {
       foreach $channel2 (sort keys %{$$rTimer{$num}{$time2}}) {
 	if (($channel eq $channel2) || $$rConfig{preventdouble}) {
Index: init.pl
===================================================================
--- init.pl	(revision 211)
+++ init.pl	(working copy)
@@ -353,6 +353,7 @@ 
   my $conf = "(" . join ("|", (
 			       "defaultlifetime",
 			       "defaultprio",
+			       "highest_channel_number",
 			       "human_info",
 			       "joinnameifequal",
 			       "jointimers",