diff options
author | Karl Melscher <kamel5@gmx.net> | 2018-03-07 15:38:31 +0100 |
---|---|---|
committer | Karl Melscher <kamel5@gmx.net> | 2018-03-07 15:38:31 +0100 |
commit | 969a49771925f064488c51189c3b5f78f7aa404f (patch) | |
tree | 5a065d4c7b7f233186fe2da687b843873b238011 /lcarsng.c | |
parent | 2c46b06914bb06569f1990afce29e82a3c9f6626 (diff) | |
download | skin-lcarsng-969a49771925f064488c51189c3b5f78f7aa404f.tar.gz skin-lcarsng-969a49771925f064488c51189c3b5f78f7aa404f.tar.bz2 |
Blinking Rec Icon
Diffstat (limited to 'lcarsng.c')
-rw-r--r-- | lcarsng.c | 48 |
1 files changed, 42 insertions, 6 deletions
@@ -376,6 +376,8 @@ private: void DrawSeen(int Current, int Total); void DrawDevice(void); void DrawSignal(void); + void DrawBlinkingRec(void); + uint64_t Blink = cTimeMs::Now(); public: cLCARSNGDisplayChannel(bool WithInfo); virtual ~cLCARSNGDisplayChannel(); @@ -546,6 +548,24 @@ void cLCARSNGDisplayChannel::DrawSignal(void) } } +void cLCARSNGDisplayChannel::DrawBlinkingRec(void) +{ + bool rec = cRecordControls::Active(); + bool On; + int x = xc13; + if (rec) { + if (cTimeMs::Now() - Blink > 1000) { + On = false; + if (cTimeMs::Now() - Blink > 2000) + Blink = cTimeMs::Now(); + } + else + On = true; + x -= bmRecording.Width() + SymbolSpacing; + osd->DrawBitmap(x, yc11 + (yc12 - yc11 - bmRecording.Height()) / 2, bmRecording, Theme.Color(rec ? On ? clrChannelSymbolRecFg : clrChannelSymbolOff : clrChannelSymbolOff), rec ? On ? Theme.Color(clrChannelSymbolRecBg) : frameColor : frameColor); + } +} + void cLCARSNGDisplayChannel::SetChannel(const cChannel *Channel, int Number) { int x = xc13; @@ -673,6 +693,7 @@ void cLCARSNGDisplayChannel::Flush(void) DrawTrack(); DrawDevice(); DrawSignal(); + DrawBlinkingRec(); int Current = 0; int Total = 0; if (present) { @@ -1978,6 +1999,8 @@ private: static cBitmap bmTeletext, bmRadio, bmAudio, bmDolbyDigital, bmEncrypted, bmRecording; void DrawDate(void); void DrawTrack(void); + void DrawBlinkingRec(void); + uint64_t Blink = cTimeMs::Now(); public: cLCARSNGDisplayReplay(bool ModeOnly); virtual ~cLCARSNGDisplayReplay(); @@ -2088,16 +2111,28 @@ void cLCARSNGDisplayReplay::DrawTrack(void) } } +void cLCARSNGDisplayReplay::DrawBlinkingRec(void) +{ + bool rec = cRecordControls::Active(); + bool On; + int x = xp13; + if (rec) { + if (cTimeMs::Now() - Blink > 1000) { + On = false; + if (cTimeMs::Now() - Blink > 2000) + Blink = cTimeMs::Now(); + } + else + On = true; + x -= bmRecording.Width() + SymbolSpacing; + osd->DrawBitmap(x, yp08 + (yp09 - yp08 - bmRecording.Height()) / 2, bmRecording, Theme.Color(rec ? On ? clrChannelSymbolRecFg : clrChannelSymbolOff : clrChannelSymbolOff), rec ? On ? Theme.Color(clrChannelSymbolRecBg) : frameColor : frameColor); + } +} + void cLCARSNGDisplayReplay::SetRecording(const cRecording *Recording) { const cRecordingInfo *RecordingInfo = Recording->Info(); int x = xp13; - int xi = x - SymbolSpacing - - bmRecording.Width() - SymbolSpacing - - bmEncrypted.Width() - SymbolSpacing - - bmDolbyDigital.Width() - SymbolSpacing - - bmAudio.Width() - SymbolSpacing - - max(bmTeletext.Width(), bmRadio.Width()) - SymbolSpacing; osd->DrawRectangle(xp12, yp08, xp13 - 1, yp09 - 1, frameColor); bool rec = cRecordControls::Active(); @@ -2171,6 +2206,7 @@ void cLCARSNGDisplayReplay::Flush(void) if (!modeOnly) { DrawDate(); DrawTrack(); + DrawBlinkingRec(); } osd->Flush(); // cDevice::PrimaryDevice()->ScaleVideo(videoWindowRect); |