From 2e84a632f58ba76d59477d1a54330a5ebfcc3881 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 24 Feb 2013 15:25:36 +0100 Subject: [PATCH] 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 --- src/zapit/include/zapit/frontend_c.h | 7 ++++++- src/zapit/src/femanager.cpp | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/zapit/include/zapit/frontend_c.h b/src/zapit/include/zapit/frontend_c.h index 5993251ab..55fdf32b1 100644 --- a/src/zapit/include/zapit/frontend_c.h +++ b/src/zapit/include/zapit/frontend_c.h @@ -4,6 +4,7 @@ * (C) 2002-2003 Andreas Oberritter * * 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 * it under the terms of the GNU General Public License as published by @@ -122,6 +123,7 @@ class CFrontend TP_params currentTransponder; bool slave; int fenumber; + int feindex; /* the index (starts with 0) of this FE, not always the same as fenumber */ bool standby; bool buildProperties(const FrontendParameters*, struct dtv_properties &); @@ -226,7 +228,10 @@ class CFrontend bool Locked() { return usecount; }; satellite_map_t & getSatellites() { return satellites; } 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); }; #endif /* __zapit_frontend_h__ */ diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp index d1da080cc..330b1b0a2 100644 --- a/src/zapit/src/femanager.cpp +++ b/src/zapit/src/femanager.cpp @@ -2,7 +2,7 @@ Neutrino-GUI - DBoxII-Project Copyright (C) 2011 CoolStream International Ltd - Copyright (C) 2012 Stefan Seyfried + Copyright (C) 2012,2013 Stefan Seyfried License: GPLv2 @@ -59,6 +59,7 @@ bool CFEManager::Init() CFrontend * fe; unsigned short fekey; + int idx = 0; other_fe.clear(); for(int i = 0; i < MAX_ADAPTERS; i++) { for(int j = 0; j < MAX_FE; j++) { @@ -72,6 +73,7 @@ bool CFEManager::Init() INFO("add fe %d", fe->fenumber); if(livefe == NULL) livefe = fe; + fe->setIndex(idx++); } else { /* neutrino can not yet handle differing mixed frontend types... */ INFO("not adding fe %d of different type", fe->fenumber);