gui/timeosd: rewrite based on infoclock implementation

Origin commit data
------------------
Commit: 1c53781218
Author: martii <m4rtii@gmx.de>
Date: 2013-12-17 (Tue, 17 Dec 2013)
This commit is contained in:
martii
2013-12-17 00:11:43 +01:00
committed by vanhofen
parent 3d56332168
commit 8ce5ae5e9b
7 changed files with 145 additions and 138 deletions

View File

@@ -2,62 +2,59 @@
Neutrino-GUI - DBoxII-Project
TimeOSD by Zwen
Homepage: http://dbox.cyberphoria.org/
License: GPL
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef __timeosd__
#define __timeosd__
#include <time.h>
#include <driver/framebuffer.h>
#include <gui/components/cc.h>
#include <time.h>
class CTimeOSD
class CTimeOSD : public CComponentsFrmClock
{
public:
enum mode
{
MODE_ASC,
MODE_DESC
MODE_DESC,
MODE_BAR,
MODE_HIDE
};
private:
CFrameBuffer *frameBuffer;
CProgressBar *timescale;
time_t m_time_show;
bool visible;
int m_xstart,m_xend,m_y,m_height, m_width, t1;
CProgressBar timescale;
mode m_mode;
void GetDimensions();
time_t m_time_show;
void Init();
void initTimeString();
void updatePos(int position, int duration);
public:
CTimeOSD();
~CTimeOSD();
void show(time_t time_show);
void update(time_t time_show);
void updatePos(short runningPercent);
void show(time_t time_show, bool force = true);
void hide();
bool IsVisible() {return visible;}
void SetMode(mode m) { m_mode = m;}
mode GetMode() { return m_mode;}
bool IsVisible() {return m_mode != MODE_HIDE;}
void update(int position, int duration);
void switchMode(int position, int duration);
};