- infoviewer: when current channel is not recorded and/or timeshifted show gray recording and/or timeshift icon instead of red ones

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1637 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
striper
2011-08-28 18:03:01 +00:00
parent b1ed1d2c97
commit 26b675e4f1
5 changed files with 37 additions and 11 deletions

View File

@@ -2,7 +2,7 @@ installdir = $(DATADIR)/neutrino/icons
install_DATA = \ install_DATA = \
0.png 1.png 2.png 3.png 4.png 5.png 6.png 7.png 8.png 9.png \ 0.png 1.png 2.png 3.png 4.png 5.png 6.png 7.png 8.png 9.png \
audio.png 16_9.png 16_9_gray.png ats.png \ audio.png 16_9.png 16_9_gray.png ats.png ats_gray.png \
language.png bayrisch.png ch-baslerdeutsch.png ch-berndeutsch.png czech.png deutsch.png dutch.png bosanski.png \ language.png bayrisch.png ch-baslerdeutsch.png ch-berndeutsch.png czech.png deutsch.png dutch.png bosanski.png \
ellinika.png english.png francais.png french.png hungarian.png italiano.png norsk.png \ ellinika.png english.png francais.png french.png hungarian.png italiano.png norsk.png \
polski.png portugues.png romania.png russkij.png nederlands.png slovak.png suomi.png svenska.png \ polski.png portugues.png romania.png russkij.png nederlands.png slovak.png suomi.png svenska.png \
@@ -19,7 +19,7 @@ install_DATA = \
mp3.png mute.png mute_small.png mute_zap_gray.png mute_zap_green.png \ mp3.png mute.png mute_small.png mute_zap_gray.png mute_zap_green.png \
network.png not_mounted.png notyet.png numericpad.png ok.png power.png \ network.png not_mounted.png notyet.png numericpad.png ok.png power.png \
radar_red.pal radar.pal radar0.raw radar1.raw radar2.raw radar3.raw radar4.raw \ radar_red.pal radar.pal radar0.raw radar1.raw radar2.raw radar3.raw radar4.raw \
radar5.raw radar6.raw radar7.raw radar8.raw radar9.raw movieplayer.raw rec.png recording.png \ radar5.raw radar6.raw radar7.raw radar8.raw radar9.raw movieplayer.raw rec.png rec_gray.png recording.png \
res_1920.png res_1280.png res_1440.png res_1080.png res_720.png res_704.png res_576.png \ res_1920.png res_1280.png res_1440.png res_1080.png res_720.png res_704.png res_576.png \
res_528.png res_544.png res_480.png res_382.png res_352.png res_288.png res_000.png \ res_528.png res_544.png res_480.png res_382.png res_352.png res_288.png res_000.png \
res_hd.png res_sd.png \ res_hd.png res_sd.png \

View File

@@ -670,6 +670,19 @@ CRecordInstance * CRecordManager::FindInstance(t_channel_id channel_id)
return NULL; return NULL;
} }
bool CRecordManager::IsTimeshift(t_channel_id channel_id)
{
bool ret;
mutex.lock();
CRecordInstance * inst = FindInstance(channel_id);
mutex.unlock();
if(inst && inst->Timeshift())
ret = true;
else
ret = false;
return ret;
}
MI_MOVIE_INFO * CRecordManager::GetMovieInfo(t_channel_id channel_id) MI_MOVIE_INFO * CRecordManager::GetMovieInfo(t_channel_id channel_id)
{ {
//FIXME copy MI_MOVIE_INFO ? //FIXME copy MI_MOVIE_INFO ?

View File

@@ -192,5 +192,6 @@ class CRecordManager : public CMenuTarget, public CChangeObserver
bool doGuiRecord(); bool doGuiRecord();
bool changeNotify(const neutrino_locale_t OptionName, void * /*data*/); bool changeNotify(const neutrino_locale_t OptionName, void * /*data*/);
int GetRecmapSize() { return recmap.size(); }; int GetRecmapSize() { return recmap.size(); };
bool IsTimeshift(t_channel_id channel_id);
}; };
#endif #endif

View File

@@ -288,9 +288,19 @@ void CInfoViewer::paintTime (bool show_dot, bool firstPaint)
void CInfoViewer::showRecordIcon (const bool show) void CInfoViewer::showRecordIcon (const bool show)
{ {
recordModeActive = CRecordManager::getInstance()->RecordingStatus() || CRecordManager::getInstance()->Timeshift();
if (recordModeActive) {
CRecordManager * crm = CRecordManager::getInstance(); CRecordManager * crm = CRecordManager::getInstance();
recordModeActive = crm->RecordingStatus() || crm->Timeshift();
if (recordModeActive)
{
std::string Icon_Rec = NEUTRINO_ICON_REC_GRAY, Icon_Ts = NEUTRINO_ICON_AUTO_SHIFT_GRAY;
t_channel_id cci = g_RemoteControl->current_channel_id;
bool status_ts = crm->IsTimeshift(cci);
bool status_rec = crm->RecordingStatus(cci) && !status_ts;
if (status_ts)
Icon_Ts = NEUTRINO_ICON_AUTO_SHIFT;
if (status_rec)
Icon_Rec = NEUTRINO_ICON_REC;
int records = crm->GetRecmapSize(); int records = crm->GetRecmapSize();
bool modus_rec = crm->RecordingStatus() && !crm->Timeshift(); bool modus_rec = crm->RecordingStatus() && !crm->Timeshift();
bool modus_ts = crm->Timeshift() && (records == 1); bool modus_ts = crm->Timeshift() && (records == 1);
@@ -301,8 +311,8 @@ void CInfoViewer::showRecordIcon (const bool show)
const int ChanName_X = BoxStartX + ChanWidth + SHADOW_OFFSET; const int ChanName_X = BoxStartX + ChanWidth + SHADOW_OFFSET;
const int icon_space = 3, box_posY = 12; const int icon_space = 3, box_posY = 12;
int box_len = 0, rec_icon_posX = 0, ts_icon_posX = 0; int box_len = 0, rec_icon_posX = 0, ts_icon_posX = 0;
frameBuffer->getIconSize(NEUTRINO_ICON_REC, &rec_icon_w, &rec_icon_h); frameBuffer->getIconSize(Icon_Rec.c_str(), &rec_icon_w, &rec_icon_h);
frameBuffer->getIconSize(NEUTRINO_ICON_AUTO_SHIFT, &ts_icon_w, &ts_icon_h); frameBuffer->getIconSize(Icon_Ts.c_str(), &ts_icon_w, &ts_icon_h);
int chanH = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight () int chanH = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight ()
* (g_settings.screen_yres / 100); * (g_settings.screen_yres / 100);
if (chanH < rec_icon_h) if (chanH < rec_icon_h)
@@ -335,19 +345,19 @@ void CInfoViewer::showRecordIcon (const bool show)
frameBuffer->paintBoxRel(box_posX + SHADOW_OFFSET, BoxStartY + box_posY + SHADOW_OFFSET, box_len, chanH, COL_INFOBAR_SHADOW_PLUS_0, radius); frameBuffer->paintBoxRel(box_posX + SHADOW_OFFSET, BoxStartY + box_posY + SHADOW_OFFSET, box_len, chanH, COL_INFOBAR_SHADOW_PLUS_0, radius);
frameBuffer->paintBoxRel(box_posX, BoxStartY + box_posY , box_len, chanH, COL_INFOBAR_PLUS_0, radius); frameBuffer->paintBoxRel(box_posX, BoxStartY + box_posY , box_len, chanH, COL_INFOBAR_PLUS_0, radius);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString (rec_icon_posX + rec_icon_w + icon_space, BoxStartY + box_posY + chanH, box_len, records_msg, COL_INFOBAR, 0, true); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString (rec_icon_posX + rec_icon_w + icon_space, BoxStartY + box_posY + chanH, box_len, records_msg, COL_INFOBAR, 0, true);
frameBuffer->paintIcon (NEUTRINO_ICON_REC, rec_icon_posX, BoxStartY + box_posY + (chanH - rec_icon_h)/2); frameBuffer->paintIcon(Icon_Rec, rec_icon_posX, BoxStartY + box_posY + (chanH - rec_icon_h)/2);
}else if (modus_ts) }else if (modus_ts)
{ {
frameBuffer->paintBoxRel(box_posX + SHADOW_OFFSET, BoxStartY + box_posY + SHADOW_OFFSET, box_len, chanH, COL_INFOBAR_SHADOW_PLUS_0, radius); frameBuffer->paintBoxRel(box_posX + SHADOW_OFFSET, BoxStartY + box_posY + SHADOW_OFFSET, box_len, chanH, COL_INFOBAR_SHADOW_PLUS_0, radius);
frameBuffer->paintBoxRel(box_posX, BoxStartY + box_posY , box_len, chanH, COL_INFOBAR_PLUS_0, radius); frameBuffer->paintBoxRel(box_posX, BoxStartY + box_posY , box_len, chanH, COL_INFOBAR_PLUS_0, radius);
frameBuffer->paintIcon(NEUTRINO_ICON_AUTO_SHIFT, ts_icon_posX, BoxStartY + box_posY + (chanH - ts_icon_h)/2); frameBuffer->paintIcon(Icon_Ts, ts_icon_posX, BoxStartY + box_posY + (chanH - ts_icon_h)/2);
}else if (modus_ts_rec) }else if (modus_ts_rec)
{ {
frameBuffer->paintBoxRel(box_posX + SHADOW_OFFSET, BoxStartY + box_posY + SHADOW_OFFSET, box_len, chanH, COL_INFOBAR_SHADOW_PLUS_0, radius); frameBuffer->paintBoxRel(box_posX + SHADOW_OFFSET, BoxStartY + box_posY + SHADOW_OFFSET, box_len, chanH, COL_INFOBAR_SHADOW_PLUS_0, radius);
frameBuffer->paintBoxRel(box_posX, BoxStartY + box_posY , box_len, chanH, COL_INFOBAR_PLUS_0, radius); frameBuffer->paintBoxRel(box_posX, BoxStartY + box_posY , box_len, chanH, COL_INFOBAR_PLUS_0, radius);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rec_icon_posX + rec_icon_w + icon_space, BoxStartY + box_posY + chanH, box_len, records_msg, COL_INFOBAR, 0, true); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rec_icon_posX + rec_icon_w + icon_space, BoxStartY + box_posY + chanH, box_len, records_msg, COL_INFOBAR, 0, true);
frameBuffer->paintIcon(NEUTRINO_ICON_REC, rec_icon_posX, BoxStartY + box_posY + (chanH - rec_icon_h)/2); frameBuffer->paintIcon(Icon_Rec, rec_icon_posX, BoxStartY + box_posY + (chanH - rec_icon_h)/2);
frameBuffer->paintIcon(NEUTRINO_ICON_AUTO_SHIFT, ts_icon_posX, BoxStartY + box_posY + (chanH - ts_icon_h)/2); frameBuffer->paintIcon(Icon_Ts, ts_icon_posX, BoxStartY + box_posY + (chanH - ts_icon_h)/2);
} }
}else }else
{ {

View File

@@ -96,6 +96,7 @@
#define NEUTRINO_ICON_RADIOMODE "radiomode" #define NEUTRINO_ICON_RADIOMODE "radiomode"
#define NEUTRINO_ICON_RECORDING "recording" #define NEUTRINO_ICON_RECORDING "recording"
#define NEUTRINO_ICON_REC "rec" #define NEUTRINO_ICON_REC "rec"
#define NEUTRINO_ICON_REC_GRAY "rec_gray"
#define NEUTRINO_ICON_SETTINGS "settings" #define NEUTRINO_ICON_SETTINGS "settings"
#define NEUTRINO_ICON_SHELL "shell" #define NEUTRINO_ICON_SHELL "shell"
#define NEUTRINO_ICON_STREAMING "streaming" #define NEUTRINO_ICON_STREAMING "streaming"
@@ -115,6 +116,7 @@
#define NEUTRINO_ICON_SUBT "subt" #define NEUTRINO_ICON_SUBT "subt"
#define NEUTRINO_ICON_SUBT_GREY "subt_gray" #define NEUTRINO_ICON_SUBT_GREY "subt_gray"
#define NEUTRINO_ICON_AUTO_SHIFT "ats" #define NEUTRINO_ICON_AUTO_SHIFT "ats"
#define NEUTRINO_ICON_AUTO_SHIFT_GRAY "ats_gray"
#define NEUTRINO_ICON_NUMERIC_PAD "numericpad" #define NEUTRINO_ICON_NUMERIC_PAD "numericpad"
#define NEUTRINO_ICON_SCRAMBLED "ca" #define NEUTRINO_ICON_SCRAMBLED "ca"
#define NEUTRINO_ICON_SCRAMBLED2 "ca2" #define NEUTRINO_ICON_SCRAMBLED2 "ca2"