VEpg::~VEpg()
{
+ Timers::getInstance()->cancelTimer(this, 1);
+
instance = NULL;
for(UINT listIndex = 0; listIndex < gridRows; listIndex++)
chanName.draw(); // TODO this should be dealt with by vvideolive
progTitle.draw();
progInfo.draw();
+
+ // Set timer to redraw to move the current time bar
+ time_t t, dt;
+ time(&t);
+ dt = 60 - (t % 60);
+ if (dt == 0) dt = 60;
+ dt += t;
+ Timers::getInstance()->setTimerT(this, 1, dt);
}
+void VEpg::timercall(int clientReference)
+{
+ drawData();
+ // Put updateView through master mutex since viewman is not mutex protected
+ Message* m = new Message();
+ m->message = Message::REDRAW;
+ m->to = ViewMan::getInstance();
+ m->from = this;
+ m->parameter = 0;
+ Command::getInstance()->postMessageFromOuterSpace(m);
+}
int VEpg::handleCommand(int command)
{
drawText(timeString, timex + 360, timey, Colour::LIGHTTEXT); // print right time
rectangle(515, timey + Surface::getFontHeight(), 2, 7, Colour(255, 255, 255, 255));
// pointer to selTime
- rectangle(155 + (selTime - ltime) / 20, timey + Surface::getFontHeight(), 2, 7, Colour(255, 50, 50, 255));
+ //rectangle(155 + (selTime - ltime) / 20, timey + Surface::getFontHeight(), 2, 7, Colour(255, 50, 50, 255));
+
+ // current time line
+ time(&t);
+ if ((t >= ltime) && (t < (ltime + 9000)))
+ {
+ rectangle(155 + (t - ltime) / 20, timey + Surface::getFontHeight(), 2, ((Surface::getFontHeight() + 2) * 7) + 7 + 2, Colour::RED);
+ }
// TODO should the above two comditional statements be combined to avoid calling updateEventList() twice?
Event* event;
#include "message.h"
#include "vvideolive.h"
#include "vepgsettimer.h"
+#include "timers.h"
class VVideoLive;
-class VEpg : public View
+class VEpg : public View, public TimerReceiver
{
public:
VEpg(VVideoLive* v, UINT currentChannel = 0);
void draw(); // draw epg view
void setCurrentChannel(char* chname);
void processMessage(Message* m);
+ void timercall(int clientReference);
private:
static VEpg* instance;