mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 09:21:18 +02:00
CTimeOSD: use class konform member names
CTimeOSD is inherited from CComponentsForm/Item. Therefore, it is usual to keep the functional layout. Overwritable virtual members should be used with same functionality. kill() is similar with paintBackground() known from CFrameBuffer, hide(bool) do restore saved background and expects a parameter. TODO: It works, but class layout of CTimeOSD is currently not conform with Components, because the functionalities are partially undermined and must be reworked. For Example: timescale and clock object not used as sub objects in a parent form object.
This commit is contained in:
@@ -648,7 +648,7 @@ void CMoviePlayerGui::PlayFile(void)
|
||||
}
|
||||
if (time_forced) {
|
||||
time_forced = false;
|
||||
FileTime.hide();
|
||||
FileTime.kill();
|
||||
}
|
||||
} else if (msg == (neutrino_msg_t) g_settings.mpkey_pause) {
|
||||
if (playstate == CMoviePlayerGui::PAUSE) {
|
||||
@@ -752,7 +752,7 @@ void CMoviePlayerGui::PlayFile(void)
|
||||
//showHelpTS();
|
||||
} else if(timeshift && (msg == CRCInput::RC_text || msg == CRCInput::RC_epg || msg == NeutrinoMessages::SHOW_EPG)) {
|
||||
bool restore = FileTime.IsVisible();
|
||||
FileTime.hide();
|
||||
FileTime.kill();
|
||||
|
||||
if( msg == CRCInput::RC_epg )
|
||||
g_EventList->exec(CNeutrinoApp::getInstance()->channelList->getActiveChannel_ChannelID(), CNeutrinoApp::getInstance()->channelList->getActiveChannelName());
|
||||
@@ -833,7 +833,7 @@ void CMoviePlayerGui::PlayFile(void)
|
||||
}
|
||||
}
|
||||
|
||||
FileTime.hide();
|
||||
FileTime.kill();
|
||||
clearSubtitle();
|
||||
|
||||
playback->SetSpeed(1);
|
||||
|
@@ -63,10 +63,8 @@ void CTimeOSD::Init()
|
||||
int x_old = x, y_old = y, width_old = width, height_old = height;
|
||||
CVolumeHelper::getInstance()->refresh(cl_font);
|
||||
CVolumeHelper::getInstance()->getTimeDimensions(&x, &y, &width, &height);
|
||||
if ((x_old != x) || (y_old != y) || (width_old != width) || (height_old != height)) {
|
||||
cleanCCForm();
|
||||
clearCCItems();
|
||||
}
|
||||
if ((x_old != x) || (y_old != y) || (width_old != width) || (height_old != height))
|
||||
clear();
|
||||
|
||||
// set corner radius depending on clock height
|
||||
corner_rad = (g_settings.rounded_corners) ? std::max(height/10, CORNER_RADIUS_SMALL) : 0;
|
||||
@@ -74,10 +72,13 @@ void CTimeOSD::Init()
|
||||
initCCLockItems();
|
||||
}
|
||||
|
||||
#if 0 //if hide() or kill() required, it's recommended to use it separately
|
||||
CTimeOSD::~CTimeOSD()
|
||||
{
|
||||
hide();
|
||||
CComponents::kill();
|
||||
clear();
|
||||
}
|
||||
#endif
|
||||
|
||||
void CTimeOSD::initTimeString()
|
||||
{
|
||||
@@ -134,12 +135,10 @@ void CTimeOSD::switchMode(int position, int duration)
|
||||
break;
|
||||
case MODE_DESC:
|
||||
m_mode = MODE_BAR;
|
||||
kill();
|
||||
CComponents::kill();
|
||||
break;
|
||||
case MODE_BAR:
|
||||
m_mode = MODE_HIDE;
|
||||
timescale.kill();
|
||||
timescale.reset();
|
||||
KillAndResetTimescale();
|
||||
frameBuffer->blit();
|
||||
return;
|
||||
default:
|
||||
@@ -149,13 +148,18 @@ void CTimeOSD::switchMode(int position, int duration)
|
||||
update(position, duration);
|
||||
}
|
||||
|
||||
void CTimeOSD::hide(void)
|
||||
void CTimeOSD::kill()
|
||||
{
|
||||
if (m_mode != MODE_HIDE) {
|
||||
m_mode = MODE_HIDE;
|
||||
timescale.kill();
|
||||
timescale.reset();
|
||||
kill();
|
||||
KillAndResetTimescale();
|
||||
CComponents::kill();
|
||||
frameBuffer->blit();
|
||||
}
|
||||
}
|
||||
|
||||
void CTimeOSD::KillAndResetTimescale()
|
||||
{
|
||||
m_mode = MODE_HIDE;
|
||||
timescale.kill();
|
||||
timescale.reset();
|
||||
}
|
||||
|
@@ -48,12 +48,13 @@ class CTimeOSD : public CComponentsFrmClock
|
||||
void Init();
|
||||
void initTimeString();
|
||||
void updatePos(int position, int duration);
|
||||
void KillAndResetTimescale();
|
||||
|
||||
public:
|
||||
CTimeOSD();
|
||||
~CTimeOSD();
|
||||
// ~CTimeOSD(); is inherited
|
||||
void show(time_t time_show, bool force = true);
|
||||
void hide();
|
||||
void kill();
|
||||
bool IsVisible() {return m_mode != MODE_HIDE;}
|
||||
void update(int position, int duration);
|
||||
void switchMode(int position, int duration);
|
||||
|
Reference in New Issue
Block a user