--- channels.c.cfilter	2005-03-20 20:02:45.383846604 +0100
+++ channels.c	2005-03-20 20:04:41.554758434 +0100
@@ -812,6 +812,15 @@
   return fprintf(f, "%s", *ToText()) > 0;
 }
 
+bool cChannel::Filtered(void)
+{
+  switch(Setup.ChannelFilter) {
+    case 1:    return (groupSep || vpid != 0);
+    case 2:    return (groupSep || vpid == 0);
+    default:   return true;
+  } 
+}
+
 // -- cChannels --------------------------------------------------------------
 
 cChannels Channels;
--- channels.h.cfilter	2005-03-20 20:02:45.402840856 +0100
+++ channels.h	2005-03-20 20:04:41.574752437 +0100
@@ -192,6 +192,7 @@
   void SetLinkChannels(cLinkChannels *LinkChannels);
   void SetRefChannel(cChannel *RefChannel);
   void SetGroupSep(bool Sep = true);
+  bool Filtered(void);
   };
 
 class cChannels : public cRwLock, public cConfig<cChannel> {
--- config.c.cfilter	2005-02-20 13:52:59.000000000 +0100
+++ config.c	2005-03-20 20:04:41.628736245 +0100
@@ -301,6 +301,7 @@
   CurrentChannel = -1;
   CurrentVolume = MAXVOLUME;
   CurrentDolby = 0;
+  ChannelFilter = 0;
 }
 
 cSetup& cSetup::operator= (const cSetup &s)
@@ -458,6 +459,7 @@
   else if (!strcasecmp(Name, "CurrentChannel"))      CurrentChannel     = atoi(Value);
   else if (!strcasecmp(Name, "CurrentVolume"))       CurrentVolume      = atoi(Value);
   else if (!strcasecmp(Name, "CurrentDolby"))        CurrentDolby       = atoi(Value);
+  else if (!strcasecmp(Name, "ChannelFilter"))       ChannelFilter      = atoi(Value);
   else
      return false;
   return true;
@@ -522,6 +524,7 @@
   Store("CurrentChannel",     CurrentChannel);
   Store("CurrentVolume",      CurrentVolume);
   Store("CurrentDolby",       CurrentDolby);
+  Store("ChannelFilter",      ChannelFilter);
 
   Sort();
 
--- config.h.cfilter	2005-03-05 16:44:35.000000000 +0100
+++ config.h	2005-03-20 20:04:41.645731148 +0100
@@ -255,6 +255,7 @@
   int CurrentChannel;
   int CurrentVolume;
   int CurrentDolby;
+  int ChannelFilter;
   int __EndData__;
   cSetup(void);
   cSetup& operator= (const cSetup &s);
--- device.c.cfilter	2005-02-27 14:55:15.000000000 +0100
+++ device.c	2005-03-20 20:04:41.663725751 +0100
@@ -530,7 +530,7 @@
      cChannel *channel;
      while ((channel = Channels.GetByNumber(n, Direction)) != NULL) {
            // try only channels which are currently available
-           if (PrimaryDevice()->ProvidesChannel(channel, Setup.PrimaryLimit) || PrimaryDevice()->CanReplay() && GetDevice(channel, 0))
+           if (channel->Filtered() && (PrimaryDevice()->ProvidesChannel(channel, Setup.PrimaryLimit) || PrimaryDevice()->CanReplay() && GetDevice(channel, 0)))
               break;
            n = channel->Number() + Direction;
            }
--- i18n.c.cfilter	2005-03-12 11:43:16.000000000 +0100
+++ i18n.c	2005-03-20 20:18:11.845873246 +0100
@@ -3934,6 +3934,63 @@
     "Kanalivahetuse ooteaeg (s)",
     "Zap timeout (s)",
   },
+  { "Setup.Miscellaneous$Filter channels",
+    "",// TODO
+    "",// TODO
+    "Filtra canali",
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "Filtra canales",
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "Filtra canals",
+    "",// TODO
+    "",// hrv TODO
+  },
+  { "Tv only",
+    "",// TODO
+    "",// TODO
+    "Solo Tv",
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "S�lo Tv",
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "Nom�s Tv",
+    "",// TODO
+    "",// hrv TODO
+  },
+  { "Radio only",
+    "",// TODO
+    "",// TODO
+    "Solo Radio",
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "S�lo Radio",
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "Nom�s Radio",
+    "",// TODO
+    "",// hrv TODO
+  },
   // The days of the week:
   { "MTWTFSS",
     "MDMDFSS",
--- menu.c.cfilter	2005-03-20 16:14:51.000000000 +0100
+++ menu.c	2005-03-20 20:12:27.052996484 +0100
@@ -418,7 +418,7 @@
   cMenuChannelItem *currentItem = NULL;
   Clear();
   for (cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) {
-      if (!channel->GroupSep() || cMenuChannelItem::SortMode() == cMenuChannelItem::csmNumber && *channel->Name()) {
+      if ((!channel->GroupSep() || cMenuChannelItem::SortMode() == cMenuChannelItem::csmNumber && *channel->Name()) && ( channel == currentChannel || channel->Filtered() )) {
          cMenuChannelItem *item = new cMenuChannelItem(channel);
          Add(item);
          if (channel == currentChannel)
@@ -429,6 +429,16 @@
      Sort();
   SetCurrent(currentItem);
   SetHelp(tr("Edit"), tr("New"), tr("Delete"), cMenuChannelItem::SortMode() == cMenuChannelItem::csmNumber ? tr("Mark") : NULL);
+  char *buffer = NULL;
+  switch(::Setup.ChannelFilter) {
+    case 1: asprintf(&buffer, "%s (%s)", tr("Channels"),tr("Tv only"));
+            break;
+    case 2: asprintf(&buffer, "%s (%s)", tr("Channels"),tr("Radio only"));
+            break;
+    default:  asprintf(&buffer, "%s", tr("Channels"));        
+  }
+  SetTitle(buffer);
+  free(buffer);
   Display();
 }
 
@@ -534,6 +544,10 @@
               case k0:      cMenuChannelItem::IncSortMode();
                             Setup();
                             break;
+              case k1:      ::Setup.ChannelFilter++;
+                            if (::Setup.ChannelFilter>2) ::Setup.ChannelFilter=0;
+                            Setup();
+                            break;           
               case kOk:     return Switch();
               case kRed:    return Edit();
               case kGreen:  return New();
@@ -2203,6 +2217,8 @@
 // --- cMenuSetupMisc --------------------------------------------------------
 
 class cMenuSetupMisc : public cMenuSetupBase {
+private:
+  const char *channelFilterTexts[3];
 public:
   cMenuSetupMisc(void);
   };
@@ -2210,10 +2226,14 @@
 cMenuSetupMisc::cMenuSetupMisc(void)
 {
   SetSection(tr("Miscellaneous"));
+  channelFilterTexts[0] = tr("no");
+  channelFilterTexts[1] = tr("Tv only");
+  channelFilterTexts[2] = tr("Radio only");
   Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Min. event timeout (min)"),   &data.MinEventTimeout));
   Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Min. user inactivity (min)"), &data.MinUserInactivity));
   Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$SVDRP timeout (s)"),          &data.SVDRPTimeout));
   Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Zap timeout (s)"),            &data.ZapTimeout));
+  Add(new cMenuEditStraItem(tr("Setup.Miscellaneous$Filter channels"),             &data.ChannelFilter, 3, channelFilterTexts));;    
 }
 
 // --- cMenuSetupPluginItem --------------------------------------------------
