diff options
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | README | 3 | ||||
-rw-r--r-- | imon.c | 34 | ||||
-rw-r--r-- | imon.h | 1 | ||||
-rw-r--r-- | po/de_DE.po | 20 | ||||
-rw-r--r-- | po/it_IT.po | 21 | ||||
-rw-r--r-- | setup.c | 57 | ||||
-rw-r--r-- | setup.h | 13 | ||||
-rw-r--r-- | watch.c | 322 |
9 files changed, 315 insertions, 157 deletions
@@ -2,6 +2,7 @@ VDR Plugin 'imonlcd' Revision History ------------------------------------- 2010- +- Allow turn display off at night (Feature #175) - Add render mode "show channel names only" (Feature #426) - Show next timer on lines (Feature #427) - update italian translation provided by Diego Pierotto (Feature #406) @@ -153,7 +153,8 @@ This options are editable at run time. (Menu: Setup > Plugin > imonlcd ... ) * Margin time at wake up (min) - Define a margin time, if wake up on exit mode used. (Default: 5 minutes) - +* Suspend display at night + - Allow turn display off at night, depends selected mode and time frame. Plugin SVDRP commands --------------------- @@ -176,22 +176,32 @@ int ciMonLCD::open(const char* szDevice, eProtocol pro) esyslog("iMonLCD: unable to create framebuffer backing store"); return -1; } - backingstore->SetPixel(0,0);//make dirty - SendCmd(this->cmd_clear_alarm); - SendCmd(this->cmd_display_on); - SendCmd(CMD_INIT); /* unknown, required init command */ - SendCmd(CMD_SET_ICONS); - /* clear the progress-bars on top and bottom of the display */ - SendCmd(CMD_SET_LINES0); - SendCmd(CMD_SET_LINES1); - SendCmd(CMD_SET_LINES2); + if(SendCmdInit()) { + Contrast(theSetup.m_nContrast); + dsyslog("iMonLCD: init() done"); + return 0; + } + return -1; +} - Contrast(theSetup.m_nContrast); +/* + * turning backlight off (confirmed for a Silverstone LCD) (as "cybrmage" at + * mediaportal pointed out, his LCD is an Antec built-in one and turns completely + * off with this command) + */ +bool ciMonLCD::SendCmdInit() { - dsyslog("iMonLCD: init() done"); + backingstore->SetPixel(0,0);//make dirty - return 0; + return SendCmd(this->cmd_clear_alarm) + && SendCmd(this->cmd_display_on) + && SendCmd(CMD_INIT) /* unknown, required init command */ + && SendCmd(CMD_SET_ICONS) + /* clear the progress-bars on top and bottom of the display */ + && SendCmd(CMD_SET_LINES0) + && SendCmd(CMD_SET_LINES1) + && SendCmd(CMD_SET_LINES2); } /* @@ -113,6 +113,7 @@ protected: bool SendCmd(const uint64_t & cmdData); bool SendCmdClock(time_t tAlarm); + bool SendCmdInit(); bool SendCmdShutdown(); bool Contrast(int nContrast); public: diff --git a/po/de_DE.po b/po/de_DE.po index 2c3e895..1833654 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-imonlcd-plugin 0.0.3\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2010-10-09 19:26+0200\n" +"POT-Creation-Date: 2010-10-23 17:53+0200\n" "PO-Revision-Date: 2010-04-18 18:21+0200\n" "Last-Translator: Andreas Brachold <vdr07 AT deltab de>\n" "Language-Team: Andreas Brachold <vdr07 AT deltab de>\n" @@ -75,6 +75,24 @@ msgstr "Ende Modus" msgid "Margin time at wake up (min)" msgstr "Vorlaufzeit zum Aufwachen (min)" +msgid "Never" +msgstr "Niemals" + +msgid "Resume on activities" +msgstr "Reaktivieren bei Aktivität" + +msgid "Only per time" +msgstr "Gemäß der Zeit" + +msgid "Suspend display at night" +msgstr "Nächtliches Aussetzen der Anzeige" + +msgid "Beginning of suspend" +msgstr "Anfangszeit" + +msgid "End time of suspend" +msgstr "Endzeit" + msgid "None active timer" msgstr "Kein aktiver Timer" diff --git a/po/it_IT.po b/po/it_IT.po index 6b8bfe8..30f6279 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-imonlcd-plugin 0.0.1\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2010-10-09 19:26+0200\n" +"POT-Creation-Date: 2010-10-23 18:00+0200\n" "PO-Revision-Date: 2010-08-09 20:18+0100\n" "Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n" "Language-Team: \n" @@ -78,6 +78,25 @@ msgstr "Modalità d'uscita" msgid "Margin time at wake up (min)" msgstr "Margine di tempo al risveglio (min)" +msgid "Never" +msgstr "" + +msgid "Resume on activities" +msgstr "" + +#, fuzzy +msgid "Only per time" +msgstr "Titolo solo" + +msgid "Suspend display at night" +msgstr "" + +msgid "Beginning of suspend" +msgstr "" + +msgid "End time of suspend" +msgstr "" + msgid "None active timer" msgstr "Nessun timer attivo" @@ -33,6 +33,7 @@ #define DEFAULT_TWO_LINE_MODE eRenderMode_SingleLine #define DEFAULT_BIG_FONT_HEIGHT 14 #define DEFAULT_SMALL_FONT_HEIGHT 7 +#define DEFAULT_SUSPEND_MODE eSuspendMode_Never /**< Suspend display never */ /// The one and only Stored setup data cIMonSetup theSetup; @@ -51,6 +52,9 @@ cIMonSetup::cIMonSetup(void) m_nRenderMode = DEFAULT_TWO_LINE_MODE; m_nBigFontHeight = DEFAULT_BIG_FONT_HEIGHT; m_nSmallFontHeight = DEFAULT_SMALL_FONT_HEIGHT; + m_nSuspendMode = DEFAULT_SUSPEND_MODE; + m_nSuspendTimeOn = 2200; + m_nSuspendTimeOff = 800; strncpy(m_szFont,DEFAULT_FONT,sizeof(m_szFont)); } @@ -73,6 +77,9 @@ cIMonSetup& cIMonSetup::operator = (const cIMonSetup& x) m_nRenderMode = x.m_nRenderMode; m_nBigFontHeight = x.m_nBigFontHeight; m_nSmallFontHeight = x.m_nSmallFontHeight; + m_nSuspendMode = x.m_nSuspendMode; + m_nSuspendTimeOn = x.m_nSuspendTimeOn; + m_nSuspendTimeOff = x.m_nSuspendTimeOff; strncpy(m_szFont,x.m_szFont,sizeof(m_szFont)); @@ -196,6 +203,40 @@ bool cIMonSetup::SetupParse(const char *szName, const char *szValue) return true; } + // SuspendMode + if(!strcasecmp(szName, "SuspendMode")) { + int n = atoi(szValue); + if ((n < eSuspendMode_Never) || (n >= eSuspendMode_LASTITEM)) { + esyslog("iMonLCD: SuspendMode must be between %d and %d, using default %d", + eSuspendMode_Never, eSuspendMode_LASTITEM, DEFAULT_SUSPEND_MODE); + n = DEFAULT_SUSPEND_MODE; + } + m_nSuspendMode = n; + return true; + } + // SuspendTimeOn + if(!strcasecmp(szName, "SuspendTimeOn")) { + int n = atoi(szValue); + if ((n < 0) || (n >= 2400)) { + esyslog("iMonLCD: SuspendTimeOn must be between %d and %d, using default %d", + 0, 2359, 0); + n = 0; + } + m_nSuspendTimeOn = n; + return true; + } + // SuspendTimeOff + if(!strcasecmp(szName, "SuspendTimeOff")) { + int n = atoi(szValue); + if ((n < 0) || (n >= 2400)) { + esyslog("iMonLCD: SuspendTimeOff must be between %d and %d, using default %d", + 0, 2359, 0); + n = 0; + } + m_nSuspendTimeOff = n; + return true; + } + //Unknow parameter return false; } @@ -216,6 +257,9 @@ void ciMonMenuSetup::Store(void) SetupStore("SmallFont", theSetup.m_nSmallFontHeight); SetupStore("Wakeup", theSetup.m_nWakeup); SetupStore("TwoLineMode",theSetup.m_nRenderMode); + SetupStore("SuspendMode", theSetup.m_nSuspendTimeOn); + SetupStore("SuspendTimeOn", theSetup.m_nSuspendTimeOn); + SetupStore("SuspendTimeOff", theSetup.m_nSuspendTimeOff); } ciMonMenuSetup::ciMonMenuSetup(ciMonWatch* pDev) @@ -278,6 +322,19 @@ ciMonMenuSetup::ciMonMenuSetup(ciMonWatch* pDev) &m_tmpSetup.m_nHeight, 0, 240)); */ + + static const char * szSuspendMode[eSuspendMode_LASTITEM]; + szSuspendMode[eSuspendMode_Never] = tr("Never"); + szSuspendMode[eSuspendMode_Timed] = tr("Resume on activities"); + szSuspendMode[eSuspendMode_Ever] = tr("Only per time"); + + Add(new cMenuEditStraItem (tr("Suspend display at night"), + &m_tmpSetup.m_nSuspendMode, + memberof(szSuspendMode), szSuspendMode)); + Add(new cMenuEditTimeItem (tr("Beginning of suspend"), + &m_tmpSetup.m_nSuspendTimeOn)); + Add(new cMenuEditTimeItem (tr("End time of suspend"), + &m_tmpSetup.m_nSuspendTimeOff)); } eOSState ciMonMenuSetup::ProcessKey(eKeys nKey) @@ -32,7 +32,14 @@ enum eRenderMode { ,eRenderMode_SingleTopic /**< Render screen at single line, only names */ ,eRenderMode_LASTITEM }; - + +enum eSuspendMode { + eSuspendMode_Never /**< Suspend display never */ + ,eSuspendMode_Timed /**< Suspend display, resume short time */ + ,eSuspendMode_Ever /**< Suspend display ever */ + ,eSuspendMode_LASTITEM +}; + struct cIMonSetup { int m_nOnExit; @@ -50,6 +57,10 @@ struct cIMonSetup int m_nWakeup; int m_nRenderMode; /** enable two line mode */ + int m_nSuspendMode; + int m_nSuspendTimeOn; + int m_nSuspendTimeOff; + cIMonSetup(void); cIMonSetup(const cIMonSetup& x); cIMonSetup& operator = (const cIMonSetup& x); @@ -21,6 +21,7 @@ #include "ffont.h" #include <vdr/tools.h> +#include <vdr/shutdown.h> struct cMutexLooker { cMutex& mutex; @@ -223,6 +224,8 @@ void ciMonWatch::Action(void) int total = 0; cTimeMs runTime; + struct tm tm_r; + bool bLastSuspend = false; for (;!m_bShutdown;++nCnt) { @@ -232,176 +235,213 @@ void ciMonWatch::Action(void) bool bUpdateIcons = false; bool bFlush = false; bool bReDraw = false; + bool bSuspend = false; + if(m_bShutdown) break; else { cMutexLooker m(mutex); - - switch(m_eWatchMode) { - default: - case eLiveTV: nIcons |= eIconTV;break; - case eReplayNormal: nIcons |= eIconDiscSpin | eIconDiscEllispe | eIconTopMovie; break; - case eReplayMusic: nIcons |= eIconDiscSpin | eIconDiscEllispe | eIconTopMusic; break; - case eReplayDVD: nIcons |= eIconDiscSpin | eIconDiscEllispe | eIconTopDVD; break; - case eReplayFile: nIcons |= eIconDiscSpin | eIconDiscEllispe | eIconTopWeb; break; - case eReplayImage: nIcons |= eIconDiscSpin | eIconDiscEllispe | eIconTopPhoto; break; - case eReplayAudioCD: nIcons |= eIconDiscSpin | eIconDiscEllispe | eIconTopDVD; break; + runTime.Set(); + + time_t ts = time(NULL); + if(theSetup.m_nSuspendMode != eSuspendMode_Never + && theSetup.m_nSuspendTimeOff != theSetup.m_nSuspendTimeOn) { + struct tm *now = localtime_r(&ts, &tm_r); + int clock = now->tm_hour * 100 + now->tm_min; + if(theSetup.m_nSuspendTimeOff > theSetup.m_nSuspendTimeOn) { //like 8-20 + bSuspend = (clock >= theSetup.m_nSuspendTimeOn) + && (clock <= theSetup.m_nSuspendTimeOff); + } else { //like 0-8 and 20..24 + bSuspend = (clock >= theSetup.m_nSuspendTimeOn) + || (clock <= theSetup.m_nSuspendTimeOff); + } + if(theSetup.m_nSuspendMode == eSuspendMode_Timed + && !ShutdownHandler.IsUserInactive()) { + bSuspend = false; + } } - - // every second the clock need updates. - if((0 == (nCnt % 5))) { - if (theSetup.m_nRenderMode == eRenderMode_DualLine) { - bReDraw = CurrentTime(); + if(bSuspend != bLastSuspend) { + if(bSuspend) { + SendCmdShutdown(); + } else { + SendCmdInit(); + nLastIcons = -1; + nContrast = -1; + nLastTopProgressBar = -1; + nLastBottomProgressBar = -1; } - if(m_eWatchMode != eLiveTV) { - current = 0; - total = 0; - if (ReplayPosition(current,total) - && theSetup.m_nRenderMode == eRenderMode_DualLine) { - bReDraw |= ReplayTime(current,total); + bFlush = true; + bReDraw = true; + bLastSuspend = bSuspend; + } + + if(!bSuspend) { + // every second the clock need updates. + if((0 == (nCnt % 5))) { + if (theSetup.m_nRenderMode == eRenderMode_DualLine) { + bReDraw |= CurrentTime(); + } + if(m_eWatchMode != eLiveTV) { + current = 0; + total = 0; + if (ReplayPosition(current,total) + && theSetup.m_nRenderMode == eRenderMode_DualLine) { + bReDraw |= ReplayTime(current,total); + } } } - } - bFlush = RenderScreen(bReDraw); - if(m_eWatchMode == eLiveTV) { - if((chFollowingTime - chPresentTime) > 0) { - nBottomProgressBar = (time(NULL) - chPresentTime) * 32 / (chFollowingTime - chPresentTime); - if(nBottomProgressBar > 32) nBottomProgressBar = 32; - if(nBottomProgressBar < 0) nBottomProgressBar = 0; + switch(m_eWatchMode) { + default: + case eLiveTV: nIcons |= eIconTV;break; + case eReplayNormal: nIcons |= eIconDiscSpin | eIconDiscEllispe | eIconTopMovie; break; + case eReplayMusic: nIcons |= eIconDiscSpin | eIconDiscEllispe | eIconTopMusic; break; + case eReplayDVD: nIcons |= eIconDiscSpin | eIconDiscEllispe | eIconTopDVD; break; + case eReplayFile: nIcons |= eIconDiscSpin | eIconDiscEllispe | eIconTopWeb; break; + case eReplayImage: nIcons |= eIconDiscSpin | eIconDiscEllispe | eIconTopPhoto; break; + case eReplayAudioCD: nIcons |= eIconDiscSpin | eIconDiscEllispe | eIconTopDVD; break; + } + + bFlush = RenderScreen(bReDraw); + if(m_eWatchMode == eLiveTV) { + if((chFollowingTime - chPresentTime) > 0) { + nBottomProgressBar = (time(NULL) - chPresentTime) * 32 / (chFollowingTime - chPresentTime); + if(nBottomProgressBar > 32) nBottomProgressBar = 32; + if(nBottomProgressBar < 0) nBottomProgressBar = 0; + } else { + nBottomProgressBar = 0; + } + } else { + if(total) { + nBottomProgressBar = current * 32 / total; + if(nBottomProgressBar > 32) nBottomProgressBar = 32; + if(nBottomProgressBar < 0) nBottomProgressBar = 0; } else { - nBottomProgressBar = 0; + nBottomProgressBar = 0; + } + switch(ReplayMode()) { + case eReplayNone: + case eReplayPaused: + bUpdateIcons = false; + break; + default: + case eReplayPlay: + bUpdateIcons = (0 == (nCnt % 4)); + nIcons |= eIconDiscRunSpin; + break; + case eReplayBackward1: + nIcons |= eIconDiscSpinBackward; + case eReplayForward1: + break; + bUpdateIcons = (0 == (nCnt % 3)); + nIcons |= eIconDiscRunSpin; + case eReplayBackward2: + nIcons |= eIconDiscSpinBackward; + case eReplayForward2: + bUpdateIcons = (0 == (nCnt % 2)); + nIcons |= eIconDiscRunSpin; + break; + case eReplayBackward3: + nIcons |= eIconDiscSpinBackward; + case eReplayForward3: + bUpdateIcons = true; + nIcons |= eIconDiscRunSpin; + break; + } + switch(m_eReplayMode) { + case eReplayModeShuffle: nIcons |= eIconShuffle; break; + case eReplayModeRepeat: nIcons |= eIconRepeat; break; + case eReplayModeRepeatShuffle: nIcons |= eIconShuffle | eIconRepeat; break; + default: break; } - } else { - if(total) { - nBottomProgressBar = current * 32 / total; - if(nBottomProgressBar > 32) nBottomProgressBar = 32; - if(nBottomProgressBar < 0) nBottomProgressBar = 0; - } else { - nBottomProgressBar = 0; } - switch(ReplayMode()) { - case eReplayNone: - case eReplayPaused: - bUpdateIcons = false; - break; - default: - case eReplayPlay: - bUpdateIcons = (0 == (nCnt % 4)); - nIcons |= eIconDiscRunSpin; - break; - case eReplayBackward1: - nIcons |= eIconDiscSpinBackward; - case eReplayForward1: - break; - bUpdateIcons = (0 == (nCnt % 3)); - nIcons |= eIconDiscRunSpin; - case eReplayBackward2: - nIcons |= eIconDiscSpinBackward; - case eReplayForward2: - bUpdateIcons = (0 == (nCnt % 2)); - nIcons |= eIconDiscRunSpin; + + switch(m_eVideoMode) { + case eVideoMPG: nIcons |= eIconBL_MPG; break; + case eVideoDivX: nIcons |= eIconBL_DIVX; break; + case eVideoXviD: nIcons |= eIconBL_XVID; break; + case eVideoWMV: nIcons |= eIconBL_WMV; break; + default: + case eVideoNone: break; + } + + if(m_eAudioMode & eAudioMPG) nIcons |= eIconBM_MPG; + if(m_eAudioMode & eAudioAC3) nIcons |= eIconBM_AC3; + if(m_eAudioMode & eAudioDTS) nIcons |= eIconBM_DTS; + if(m_eAudioMode & eAudioWMA) nIcons |= eIconBR_WMA; + if(m_eAudioMode & eAudioMP3) nIcons |= eIconBR_MP3; + if(m_eAudioMode & eAudioOGG) nIcons |= eIconBR_OGG; + if(m_eAudioMode & eAudioWAV) nIcons |= eIconBR_WAV; + + for(n=0;n<memberof(m_nCardIsRecording);++n) { + if(0 != m_nCardIsRecording[n]) { + nIcons |= eIconRecording; + switch(n) { + case 0: nIcons |= eIconSRC; break; + case 1: nIcons |= eIconSRC1; break; + case 2: nIcons |= eIconSRC2; break; + } + } + } + + if(m_bVolumeMute) { + nIcons |= eIconVolume; + } else { + if(eAudioTrackType == ttNone || (0 == nCnt % 10)) { + eAudioTrackType = cDevice::PrimaryDevice()->GetCurrentAudioTrack(); //Stereo/Dolby + nAudioChannel = cDevice::PrimaryDevice()->GetAudioChannel(); //0-Stereo,1-Left, 2-Right + } + switch(eAudioTrackType) { + default: + break; + case ttAudioFirst ... ttAudioLast: { + switch(nAudioChannel) { + case 1: nIcons |= eIconSpeakerL; break; + case 2: nIcons |= eIconSpeakerR; break; + case 0: + default: nIcons |= eIconSpeakerLR; break; + } break; - case eReplayBackward3: - nIcons |= eIconDiscSpinBackward; - case eReplayForward3: - bUpdateIcons = true; - nIcons |= eIconDiscRunSpin; + } + case ttDolbyFirst ... ttDolbyLast: + nIcons |= eIconSpeaker51; break; - } - switch(m_eReplayMode) { - case eReplayModeShuffle: nIcons |= eIconShuffle; break; - case eReplayModeRepeat: nIcons |= eIconRepeat; break; - case eReplayModeRepeatShuffle: nIcons |= eIconShuffle | eIconRepeat; break; - default: break; + } } } - switch(m_eVideoMode) { - case eVideoMPG: nIcons |= eIconBL_MPG; break; - case eVideoDivX: nIcons |= eIconBL_DIVX; break; - case eVideoXviD: nIcons |= eIconBL_XVID; break; - case eVideoWMV: nIcons |= eIconBL_WMV; break; - default: - case eVideoNone: break; + if(theSetup.m_nContrast != nContrast) { + nContrast = theSetup.m_nContrast; + Contrast(nContrast); } - if(m_eAudioMode & eAudioMPG) nIcons |= eIconBM_MPG; - if(m_eAudioMode & eAudioAC3) nIcons |= eIconBM_AC3; - if(m_eAudioMode & eAudioDTS) nIcons |= eIconBM_DTS; - if(m_eAudioMode & eAudioWMA) nIcons |= eIconBR_WMA; - if(m_eAudioMode & eAudioMP3) nIcons |= eIconBR_MP3; - if(m_eAudioMode & eAudioOGG) nIcons |= eIconBR_OGG; - if(m_eAudioMode & eAudioWAV) nIcons |= eIconBR_WAV; - - for(n=0;n<memberof(m_nCardIsRecording);++n) { - if(0 != m_nCardIsRecording[n]) { - nIcons |= eIconRecording; - switch(n) { - case 0: nIcons |= eIconSRC; break; - case 1: nIcons |= eIconSRC1; break; - case 2: nIcons |= eIconSRC2; break; - } - } + //Force icon state (defined by svdrp) + nIcons &= ~(m_nIconsForceMask); + nIcons |= (m_nIconsForceOn); + nIcons &= ~(m_nIconsForceOff); + if(m_nIconsForceOn & eIconDiscRunSpin) { + bUpdateIcons |= (0 == (nCnt % 4)); + nIcons &= ~(eIconDiscSpinBackward); } - if(m_bVolumeMute) { - nIcons |= eIconVolume; - } else { - if(eAudioTrackType == ttNone || (0 == nCnt % 10)) { - eAudioTrackType = cDevice::PrimaryDevice()->GetCurrentAudioTrack(); //Stereo/Dolby - nAudioChannel = cDevice::PrimaryDevice()->GetAudioChannel(); //0-Stereo,1-Left, 2-Right - } - switch(eAudioTrackType) { - default: - break; - case ttAudioFirst ... ttAudioLast: { - switch(nAudioChannel) { - case 1: nIcons |= eIconSpeakerL; break; - case 2: nIcons |= eIconSpeakerR; break; - case 0: - default: nIcons |= eIconSpeakerLR; break; - } - break; - } - case ttDolbyFirst ... ttDolbyLast: - nIcons |= eIconSpeaker51; - break; - } + if(bUpdateIcons || nIcons != nLastIcons) { + icons(nIcons); + nLastIcons = nIcons; } - } + if(nTopProgressBar != nLastTopProgressBar + || nBottomProgressBar != nLastBottomProgressBar ) { - runTime.Set(); - if(theSetup.m_nContrast != nContrast) { - nContrast = theSetup.m_nContrast; - Contrast(nContrast); - } - - //Force icon state (defined by svdrp) - nIcons &= ~(m_nIconsForceMask); - nIcons |= (m_nIconsForceOn); - nIcons &= ~(m_nIconsForceOff); - if(m_nIconsForceOn & eIconDiscRunSpin) { - bUpdateIcons |= (0 == (nCnt % 4)); - nIcons &= ~(eIconDiscSpinBackward); - } + setLineLength(nTopProgressBar, nBottomProgressBar, nTopProgressBar, nBottomProgressBar); + nLastTopProgressBar = nTopProgressBar; + nLastBottomProgressBar = nBottomProgressBar; - if(bUpdateIcons || nIcons != nLastIcons) { - icons(nIcons); - nLastIcons = nIcons; + } } - if(nTopProgressBar != nLastTopProgressBar - || nBottomProgressBar != nLastBottomProgressBar ) { - - setLineLength(nTopProgressBar, nBottomProgressBar, nTopProgressBar, nBottomProgressBar); - nLastTopProgressBar = nTopProgressBar; - nLastBottomProgressBar = nBottomProgressBar; - } if(bFlush) { flush(); } - int nDelay = 100 - runTime.Elapsed(); + int nDelay = (bSuspend ? 1000 : 100) - runTime.Elapsed(); if(nDelay <= 10) { nDelay = 10; } |