mirror of
https://projects.vdr-developer.org/git/vdr-plugin-streamdev.git
synced 2023-10-10 17:16:51 +00:00
Added min/max priority (#508)
Modified Files: Tag: v0_4 HISTORY README i18n.c client/device.c client/setup.c client/setup.h
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: device.c,v 1.18.2.1 2008/04/07 15:07:39 schmirl Exp $
|
||||
* $Id: device.c,v 1.18.2.2 2009/01/29 07:49:05 schmirl Exp $
|
||||
*/
|
||||
|
||||
#include "client/device.h"
|
||||
@@ -91,6 +91,19 @@ bool cStreamdevDevice::ProvidesChannel(const cChannel *Channel, int Priority,
|
||||
|
||||
Dprintf("ProvidesChannel, Channel=%s, Prio=%d\n", Channel->Name(), Priority);
|
||||
|
||||
if (StreamdevClientSetup.MinPriority <= StreamdevClientSetup.MaxPriority)
|
||||
{
|
||||
if (Priority < StreamdevClientSetup.MinPriority ||
|
||||
Priority > StreamdevClientSetup.MaxPriority)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Priority < StreamdevClientSetup.MinPriority &&
|
||||
Priority > StreamdevClientSetup.MaxPriority)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ClientSocket.DataSocket(siLive) != NULL
|
||||
&& TRANSPONDER(Channel, m_Channel))
|
||||
res = true;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: setup.c,v 1.5 2008/04/07 14:50:32 schmirl Exp $
|
||||
* $Id: setup.c,v 1.5.2.1 2009/01/29 07:49:05 schmirl Exp $
|
||||
*/
|
||||
|
||||
#include <vdr/menuitems.h>
|
||||
@@ -16,6 +16,8 @@ cStreamdevClientSetup::cStreamdevClientSetup(void) {
|
||||
StreamFilters = false;
|
||||
SyncEPG = false;
|
||||
HideMenuEntry = false;
|
||||
MinPriority = -1;
|
||||
MaxPriority = MAXPRIORITY;
|
||||
strcpy(RemoteIp, "");
|
||||
}
|
||||
|
||||
@@ -31,6 +33,8 @@ bool cStreamdevClientSetup::SetupParse(const char *Name, const char *Value) {
|
||||
else if (strcmp(Name, "StreamFilters") == 0) StreamFilters = atoi(Value);
|
||||
else if (strcmp(Name, "SyncEPG") == 0) SyncEPG = atoi(Value);
|
||||
else if (strcmp(Name, "HideMenuEntry") == 0) HideMenuEntry = atoi(Value);
|
||||
else if (strcmp(Name, "MinPriority") == 0) HideMenuEntry = atoi(Value);
|
||||
else if (strcmp(Name, "MaxPriority") == 0) HideMenuEntry = atoi(Value);
|
||||
else return false;
|
||||
return true;
|
||||
}
|
||||
@@ -44,6 +48,8 @@ cStreamdevClientMenuSetupPage::cStreamdevClientMenuSetupPage(void) {
|
||||
AddShortEdit(tr("Remote Port"), m_NewSetup.RemotePort);
|
||||
AddBoolEdit (tr("Filter Streaming"), m_NewSetup.StreamFilters);
|
||||
AddBoolEdit (tr("Synchronize EPG"), m_NewSetup.SyncEPG);
|
||||
AddRangeEdit (tr("Minimum Priority"), m_NewSetup.MinPriority, -1, MAXPRIORITY);
|
||||
AddRangeEdit (tr("Maximum Priority"), m_NewSetup.MaxPriority, -1, MAXPRIORITY);
|
||||
SetCurrent(Get(0));
|
||||
}
|
||||
|
||||
@@ -65,6 +71,8 @@ void cStreamdevClientMenuSetupPage::Store(void) {
|
||||
SetupStore("StreamFilters", m_NewSetup.StreamFilters);
|
||||
SetupStore("SyncEPG", m_NewSetup.SyncEPG);
|
||||
SetupStore("HideMenuEntry", m_NewSetup.HideMenuEntry);
|
||||
SetupStore("MinPriority", m_NewSetup.MinPriority);
|
||||
SetupStore("MaxPriority", m_NewSetup.MaxPriority);
|
||||
|
||||
StreamdevClientSetup = m_NewSetup;
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: setup.h,v 1.4 2008/04/07 14:50:32 schmirl Exp $
|
||||
* $Id: setup.h,v 1.4.2.1 2009/01/29 07:49:05 schmirl Exp $
|
||||
*/
|
||||
|
||||
#ifndef VDR_STREAMDEV_SETUPCLIENT_H
|
||||
@@ -18,6 +18,8 @@ struct cStreamdevClientSetup {
|
||||
int StreamFilters;
|
||||
int SyncEPG;
|
||||
int HideMenuEntry;
|
||||
int MinPriority;
|
||||
int MaxPriority;
|
||||
};
|
||||
|
||||
extern cStreamdevClientSetup StreamdevClientSetup;
|
||||
|
Reference in New Issue
Block a user