<string id="2100">Script failed! : %s</string>
- <string id="4501">LCD type</string>
+ <string id="4501">Enable LCD</string>
<string id="10000">Home</string>
<string id="10001">Programs</string>
<lcd>
+ <!-- set this to video,music to disable the LCD on playback of music and video-->
+ <disableonplay>video</disableonplay>
<navigation>
<line>$INFO[System.CurrentWindow]</line>
<line>$INFO[System.CurrentControl]</line>
void CApplication::DimLCDOnPlayback(bool dim)
{
#ifdef HAS_LCD
- if(g_lcd && dim && (g_guiSettings.GetInt("lcd.disableonplayback") != LED_PLAYBACK_OFF) && (g_guiSettings.GetInt("lcd.type") != LCD_TYPE_NONE))
+ if (g_lcd)
{
- if ( (IsPlayingVideo()) && g_guiSettings.GetInt("lcd.disableonplayback") == LED_PLAYBACK_VIDEO)
- g_lcd->SetBackLight(0);
- if ( (IsPlayingAudio()) && g_guiSettings.GetInt("lcd.disableonplayback") == LED_PLAYBACK_MUSIC)
- g_lcd->SetBackLight(0);
- if ( ((IsPlayingVideo() || IsPlayingAudio())) && g_guiSettings.GetInt("lcd.disableonplayback") == LED_PLAYBACK_VIDEO_MUSIC)
- g_lcd->SetBackLight(0);
+ if (dim)
+ g_lcd->DisableOnPlayback(IsPlayingVideo(), IsPlayingAudio());
+ else
+ g_lcd->SetBackLight(1);
}
- else if(!dim)
- g_lcd->SetBackLight(1);
#endif
}
#ifdef HAS_LCD
static long lTickCount = 0;
- if (!g_lcd || g_guiSettings.GetInt("lcd.type") == LCD_TYPE_NONE)
+ if (!g_lcd || !g_guiSettings.GetBool("system.haslcd"))
return ;
long lTimeOut = 1000;
if ( m_iPlaySpeed != 1)
if(IsPaused() != m_bIsPaused)
{
#ifdef HAS_LCD
- if(g_guiSettings.GetBool("lcd.enableonpaused"))
- DimLCDOnPlayback(m_bIsPaused);
+ DimLCDOnPlayback(m_bIsPaused);
#endif
m_bIsPaused = IsPaused();
}
#if defined(_LINUX) && !defined(__APPLE__)
AddInt(5, "system.powerbuttonaction", 13015, POWERSTATE_NONE, 0, 1, 5, SPIN_CONTROL_TEXT);
#endif
-
-#ifdef HAS_LCD
- AddCategory(4, "lcd", 448);
- AddInt(2, "lcd.type", 4501, LCD_TYPE_NONE, LCD_TYPE_NONE, 1, LCD_TYPE_LCDPROC, SPIN_CONTROL_TEXT);
- AddInt(7, "lcd.disableonplayback", 20310, LED_PLAYBACK_OFF, LED_PLAYBACK_OFF, 1, LED_PLAYBACK_VIDEO_MUSIC, SPIN_CONTROL_TEXT);
- AddBool(8, "lcd.enableonpaused", 20312, true);
-#endif
+ AddBool(6, "system.haslcd", 4501, false);
#ifdef __APPLE__
AddCategory(4, "appleremote", 13600);
pControl->AddLabel(g_localizeStrings.Get(603), CDDARIP_QUALITY_EXTREME);
pControl->SetValue(pSettingInt->GetData());
}
- else if (strSetting.Equals("lcd.type"))
- {
- CSettingInt *pSettingInt = (CSettingInt*)pSetting;
- CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(GetSetting(strSetting)->GetID());
- pControl->AddLabel(g_localizeStrings.Get(351), LCD_TYPE_NONE);
- pControl->AddLabel("LCDproc", LCD_TYPE_LCDPROC);
- pControl->SetValue(pSettingInt->GetData());
- }
else if (strSetting.Equals("harddisk.aamlevel"))
{
CSettingInt *pSettingInt = (CSettingInt*)pSetting;
pControl->SetValue(pSettingInt->GetData());
}
#endif
- else if (strSetting.Equals("system.ledcolour"))
- {
- CSettingInt *pSettingInt = (CSettingInt*)pSetting;
- CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(GetSetting(strSetting)->GetID());
- pControl->AddLabel(g_localizeStrings.Get(13340), LED_COLOUR_NO_CHANGE);
- pControl->AddLabel(g_localizeStrings.Get(13341), LED_COLOUR_GREEN);
- pControl->AddLabel(g_localizeStrings.Get(13342), LED_COLOUR_ORANGE);
- pControl->AddLabel(g_localizeStrings.Get(13343), LED_COLOUR_RED);
- pControl->AddLabel(g_localizeStrings.Get(13344), LED_COLOUR_CYCLE);
- pControl->AddLabel(g_localizeStrings.Get(351), LED_COLOUR_OFF);
- pControl->SetValue(pSettingInt->GetData());
- }
- else if (strSetting.Equals("system.leddisableonplayback") || strSetting.Equals("lcd.disableonplayback"))
- {
- CSettingInt *pSettingInt = (CSettingInt*)pSetting;
- CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(GetSetting(strSetting)->GetID());
- pControl->AddLabel(g_localizeStrings.Get(106), LED_PLAYBACK_OFF); // No
- pControl->AddLabel(g_localizeStrings.Get(13002), LED_PLAYBACK_VIDEO); // Video Only
- pControl->AddLabel(g_localizeStrings.Get(475), LED_PLAYBACK_MUSIC); // Music Only
- pControl->AddLabel(g_localizeStrings.Get(476), LED_PLAYBACK_VIDEO_MUSIC); // Video & Music
- pControl->SetValue(pSettingInt->GetData());
- }
else if (strSetting.Equals("videoplayer.rendermethod"))
{
CSettingInt *pSettingInt = (CSettingInt*)pSetting;
else
g_guiSettings.SetString("weather.plugin", pControl->GetCurrentLabel());
}
- else if (strSetting.Equals("system.leddisableonplayback"))
- {
- CGUIControl *pControl = (CGUIControl *)GetControl(GetSetting(strSetting)->GetID());
- // LED_COLOUR_NO_CHANGE: we can't disable the LED on playback,
- // we have no previos reference LED COLOUR, to set the LED colour back
- pControl->SetEnabled(g_guiSettings.GetInt("system.ledcolour") != LED_COLOUR_NO_CHANGE && g_guiSettings.GetInt("system.ledcolour") != LED_COLOUR_OFF);
- }
else if (strSetting.Equals("musicfiles.trackformat"))
{
if (m_strOldTrackFormat != g_guiSettings.GetString("musicfiles.trackformat"))
if (pControl && g_guiSettings.GetString(strSetting, false).IsEmpty())
pControl->SetLabel2("");
}
- else if (strSetting.Equals("lcd.enableonpaused"))
- {
- CGUIControl *pControl = (CGUIControl *)GetControl(pSettingControl->GetID());
- if (pControl) pControl->SetEnabled(g_guiSettings.GetInt("lcd.disableonplayback") != LED_PLAYBACK_OFF && g_guiSettings.GetInt("lcd.type") != LCD_TYPE_NONE);
- }
- else if (strSetting.Equals("system.ledenableonpaused"))
- {
- // LED_COLOUR_NO_CHANGE: we can't enable LED on paused,
- // we have no previos reference LED COLOUR, to set the LED colour back
- CGUIControl *pControl = (CGUIControl *)GetControl(pSettingControl->GetID());
- if (pControl) pControl->SetEnabled(g_guiSettings.GetInt("system.leddisableonplayback") != LED_PLAYBACK_OFF && g_guiSettings.GetInt("system.ledcolour") != LED_COLOUR_OFF && g_guiSettings.GetInt("system.ledcolour") != LED_COLOUR_NO_CHANGE);
- }
else if (strSetting.Equals("lookandfeel.enablemouse"))
{
}
}
#endif
#ifdef HAS_LCD
- else if (strSetting.Equals("lcd.type"))
+ else if (strSetting.Equals("system.haslcd"))
{
-#ifdef _LINUX
g_lcd->Stop();
CLCDFactory factory;
delete g_lcd;
g_lcd = factory.Create();
-#endif
g_lcd->Initialize();
}
#endif
void XLCDproc::Initialize()
{
- if (g_guiSettings.GetInt("lcd.type") == LCD_TYPE_NONE)
+ if (!g_guiSettings.GetBool("system.haslcd"))
return ;//nothing to do
// don't try to initialize too often
#include "Settings.h"
#include "CharsetConverter.h"
#include "log.h"
+#include "XMLUtils.h"
using namespace std;
{
//0 = HD44780, 1=KS0073
- unsigned int iLCDContr = g_guiSettings.GetInt("lcd.type") == LCD_TYPE_LCD_KS0073 ? 1 : 0;
+ unsigned int iLCDContr = 0;
//the timeline is using blocks
//a block is used at address 0xA0, smallBlocks at address 0xAC-0xAF
return;
}
+ // load our settings
+ CStdString disableOnPlay;
+ XMLUtils::GetString(element, "disableonplay", disableOnPlay);
+ if (disableOnPlay.Find("video") != CStdString::npos)
+ m_disableOnPlay |= DISABLE_ON_PLAY_VIDEO;
+ if (disableOnPlay.Find("music") != CStdString::npos)
+ m_disableOnPlay |= DISABLE_ON_PLAY_MUSIC;
+
TiXmlElement *mode = element->FirstChildElement();
while (mode)
{
void ILCD::Reset()
{
+ m_disableOnPlay = DISABLE_ON_PLAY_NONE;
for (unsigned int i = 0; i < LCD_MODE_MAX; i++)
m_lcdMode[i].clear();
}
while (outLine < 4)
SetLine(outLine++, "");
}
+
+void ILCD::DisableOnPlayback(bool playingVideo, bool playingAudio)
+{
+ if ((playingVideo && (m_disableOnPlay & DISABLE_ON_PLAY_VIDEO)) ||
+ (playingAudio && (m_disableOnPlay & DISABLE_ON_PLAY_MUSIC)))
+ SetBackLight(0);
+}
virtual void SetBackLight(int iLight) = 0;
virtual void SetContrast(int iContrast) = 0;
virtual void SetLine(int iLine, const CStdString& strLine) = 0;
+ virtual void DisableOnPlayback(bool playingVideo, bool playingMusic);
CStdString GetProgressBar(double tCurrent, double tTotal);
void SetCharset( UINT nCharset );
CStdString GetBigDigit( UINT _nCharset, int _nDigit, UINT _nLine, UINT _nMinSize, UINT _nMaxSize, bool _bSpacePadding );
unsigned char GetLCDCharsetCharacter( UINT _nCharacter, int _nCharset=-1);
void LoadMode(TiXmlNode *node, LCD_MODE mode);
private:
+ enum DISABLE_ON_PLAY { DISABLE_ON_PLAY_NONE = 0, DISABLE_ON_PLAY_VIDEO = 1, DISABLE_ON_PLAY_MUSIC = 2 };
+ int m_disableOnPlay;
+
std::vector<CGUIInfoLabel> m_lcdMode[LCD_MODE_MAX];
UINT m_eCurrentCharset;
};