frontend: add a "frontend index", set by femanager

this allows to easily find the "first" or "second" tuner, which
fixes the tuner number display in the infobar
This commit is contained in:
Stefan Seyfried
2013-02-24 15:25:36 +01:00
parent b1b7bfef74
commit 2e84a632f5
2 changed files with 9 additions and 2 deletions

View File

@@ -4,6 +4,7 @@
* (C) 2002-2003 Andreas Oberritter <obi@tuxbox.org> * (C) 2002-2003 Andreas Oberritter <obi@tuxbox.org>
* *
* Copyright (C) 2011 CoolStream International Ltd * Copyright (C) 2011 CoolStream International Ltd
* Copyright (C) 2009,2010,2012,2013 Stefan Seyfried
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -122,6 +123,7 @@ class CFrontend
TP_params currentTransponder; TP_params currentTransponder;
bool slave; bool slave;
int fenumber; int fenumber;
int feindex; /* the index (starts with 0) of this FE, not always the same as fenumber */
bool standby; bool standby;
bool buildProperties(const FrontendParameters*, struct dtv_properties &); bool buildProperties(const FrontendParameters*, struct dtv_properties &);
@@ -226,7 +228,10 @@ class CFrontend
bool Locked() { return usecount; }; bool Locked() { return usecount; };
satellite_map_t & getSatellites() { return satellites; } satellite_map_t & getSatellites() { return satellites; }
void setSatellites(satellite_map_t satmap) { satellites = satmap; } void setSatellites(satellite_map_t satmap) { satellites = satmap; }
int getNumber() { return fenumber; }; /* getNumber is now only used for displaying the tuner ID in the infobar,
* which wants the index. If the fenumber is needed, call "getNumber(true)" */
int getNumber(bool real = false) { return real?fenumber:feindex; }
void setIndex(int i) { feindex = i; };
static void getDelSys(uint8_t type, int f, int m, char * &fec, char * &sys, char * &mod); static void getDelSys(uint8_t type, int f, int m, char * &fec, char * &sys, char * &mod);
}; };
#endif /* __zapit_frontend_h__ */ #endif /* __zapit_frontend_h__ */

View File

@@ -2,7 +2,7 @@
Neutrino-GUI - DBoxII-Project Neutrino-GUI - DBoxII-Project
Copyright (C) 2011 CoolStream International Ltd Copyright (C) 2011 CoolStream International Ltd
Copyright (C) 2012 Stefan Seyfried Copyright (C) 2012,2013 Stefan Seyfried
License: GPLv2 License: GPLv2
@@ -59,6 +59,7 @@ bool CFEManager::Init()
CFrontend * fe; CFrontend * fe;
unsigned short fekey; unsigned short fekey;
int idx = 0;
other_fe.clear(); other_fe.clear();
for(int i = 0; i < MAX_ADAPTERS; i++) { for(int i = 0; i < MAX_ADAPTERS; i++) {
for(int j = 0; j < MAX_FE; j++) { for(int j = 0; j < MAX_FE; j++) {
@@ -72,6 +73,7 @@ bool CFEManager::Init()
INFO("add fe %d", fe->fenumber); INFO("add fe %d", fe->fenumber);
if(livefe == NULL) if(livefe == NULL)
livefe = fe; livefe = fe;
fe->setIndex(idx++);
} else { } else {
/* neutrino can not yet handle differing mixed frontend types... */ /* neutrino can not yet handle differing mixed frontend types... */
INFO("not adding fe %d of different type", fe->fenumber); INFO("not adding fe %d of different type", fe->fenumber);