From 41f783201cdce585bde42f5c78e415f40b3ffbe8 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 26 Feb 2011 16:13:46 +0000 Subject: [PATCH] neutrino: consolidate fan detection in one place git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1217 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/07ea7e9c6379181c115840cd53f898c15a77c5d3 Author: Stefan Seyfried Date: 2011-02-26 (Sat, 26 Feb 2011) ------------------ This commit was generated by Migit --- src/gui/miscsettings_menu.cpp | 2 +- src/neutrino.cpp | 12 ++++++++---- src/system/settings.h | 1 + 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 58e749712..4df3e1af7 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -234,7 +234,7 @@ void CMiscMenue::showMiscSettingsMenuGeneral(CMenuWidget *ms_general) ms_general->addItem(new CMenuOptionChooser(LOCALE_EXTRA_CACHE_TXT, (int *)&g_settings.cacheTXT, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); //fan speed - if (g_info.delivery_system == DVB_S && (cs_get_revision() < 8)) + if (g_info.has_fan) { CFanControlNotifier *fanNotifier = new CFanControlNotifier(); //don't show fan speed settings on cable box and NEO diff --git a/src/neutrino.cpp b/src/neutrino.cpp index a9feb809d..429f94077 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2145,9 +2145,13 @@ int CNeutrinoApp::run(int argc, char **argv) #endif g_Zapit = new CZapitClient; - if (!scanSettings.loadSettings(NEUTRINO_SCAN_SETTINGS_FILE, (g_info.delivery_system = g_Zapit->getDeliverySystem()))) { + g_info.delivery_system = g_Zapit->getDeliverySystem(); + if (!scanSettings.loadSettings(NEUTRINO_SCAN_SETTINGS_FILE, g_info.delivery_system)) { dprintf(DEBUG_NORMAL, "Loading of scan settings failed. Using defaults.\n"); } + /* only SAT-hd1 before rev 8 has fan, rev 1 is TD (compat hack) */ + g_info.has_fan = (cs_get_revision() > 1 && cs_get_revision() < 8 && g_info.delivery_system == DVB_S); + dprintf(DEBUG_NORMAL, "g_info.has_fan: %d\n", g_info.has_fan); CVFD::getInstance()->showVolume(g_settings.current_volume); @@ -3602,7 +3606,7 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) if (g_RCInput != NULL) delete g_RCInput; //fan speed - if (g_info.delivery_system == DVB_S && (cs_get_revision() < 8)) { + if (g_info.has_fan) { int fspeed = 0; CFanControlNotifier * funNotifier= new CFanControlNotifier(); funNotifier->changeNotify(NONEXISTANT_LOCALE, (void *) &fspeed); @@ -3935,7 +3939,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff ) lastMode = mode; mode = mode_standby; //fan speed - if (g_info.delivery_system == DVB_S && (cs_get_revision() < 8)) { + if (g_info.has_fan) { int fspeed = 1; CFanControlNotifier * funNotifier= new CFanControlNotifier(); funNotifier->changeNotify(NONEXISTANT_LOCALE, (void *) &fspeed); @@ -3958,7 +3962,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff ) } frameBuffer->setActive(true); //fan speed - if (g_info.delivery_system == DVB_S && (cs_get_revision() < 8)) { + if (g_info.has_fan) { CFanControlNotifier * funNotifier= new CFanControlNotifier(); funNotifier->changeNotify(NONEXISTANT_LOCALE, (void*) &g_settings.fan_speed); delete funNotifier; diff --git a/src/system/settings.h b/src/system/settings.h index da9a5f284..9523f093f 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -541,6 +541,7 @@ struct SglobalInfo { unsigned char box_Type; delivery_system_t delivery_system; + bool has_fan; }; const int RECORDING_OFF = 0;