Thanks to the following people for their contributions to VOMP:
+Mark Calderbank
+ Demuxer
+ GUI box splitting algorithm
+
Dave Pickles
VDR 1.3 compatibility
Options view code cleanup
gap = tgap;
}
-void Box::show()
-{
- blt(area);
-}
-
void Box::blt(Region& r)
{
Log::getInstance()->log("Box", Log::DEBUG, "Show region %p %u %u %u %u", surface, r.x, r.y, r.w, r.h);
void setSurfaceOffset(UINT x, UINT y);
void setGap(UINT gap);
- void show(); // Obselete
void blt(Region& r); // For use only by ViewMan
virtual void draw();
}
case Message::STREAM_END:
{
- // post a message to ViewMan and then run the viewman message queue
- Message* m2 = new Message();
- m2->message = Message::STREAM_END;
- m2->to = VVideoLive::getInstance();
- viewman->postMessage(m2);
- handleCommand(Remote::NA_NONE);
+ VVideoLive::getInstance()->streamEnd();
break;
}
case Message::VDR_CONNECTED:
void Command::sig1()
{
#ifdef DEV
- Message* m = new Message();
+ Message* m = new Message(); // break into master mutex
m->message = Message::SCREENSHOT;
m->to = this;
postMessage(m);
#include <stdio.h>
#include "defines.h"
-class View;
+// Usage of messages is more dubious now that the single master mutex lock
+// protects all gui actions. Reason(s) for usage:
+// 1. View A wants something to be done by View B *after* View A has been deleted
+// 2. A thread wants its object/view deleting *after* the thread has exited
+
+// Put a justification line after call to Message* m = new Message() line
+// So that the sources can be grepped for proper message useage
class Message
{
const static ULONG STOP_PLAYBACK = 9;
const static ULONG SERVER_SELECTED = 10;
const static ULONG VDR_CONNECTED = 11;
- const static ULONG REDRAW_DATA = 12;
- const static ULONG ADD_VIEW = 13;
- const static ULONG CHANNEL_UP = 14;
- const static ULONG CHANNEL_DOWN = 15;
- const static ULONG STREAM_END = 16;
- const static ULONG CHILD_CLOSE = 17;
- const static ULONG REDRAW_LANG = 18;
- const static ULONG TIMER = 19;
- const static ULONG EPG = 20;
- const static ULONG EPG_CLOSE = 21;
+ const static ULONG ADD_VIEW = 12;
+ const static ULONG STREAM_END = 13;
+ const static ULONG REDRAW_LANG = 14;
+ const static ULONG TIMER = 15;
+ const static ULONG EPG = 16;
+ const static ULONG EPG_CLOSE = 17;
};
#endif
// end of recording
Log::getInstance()->log("Player", Log::DEBUG, "Recording playback ends");
- Message* m = new Message();
+ Message* m = new Message(); // Must be done after this thread finishes, and must break into master mutex
if (streamLength) m->message = Message::STOP_PLAYBACK; // recording
else m->message = Message::STREAM_END; // live
Log::getInstance()->log("Player", Log::DEBUG, "Posting message to %p...", commandMessageQueue);
\r
\r
//logger->log("Timers", Log::DEBUG, "about to un-LOCK -TIMERS- MUTEX (1)");\r
- threadWaitForSignalTimed(&nextTime); // FIXME does this work if the time is in the past?\r
+ threadWaitForSignalTimed(&nextTime);\r
//logger->log("Timers", Log::DEBUG, "LOCKED -TIMERS- MUTEX 5");\r
\r
// unlocks in the wait\r
// send this timer to the timer receiver, via the command message queue\r
// so that the gui mutex is locked when it happens\r
\r
- Message* m = new Message();\r
+ Message* m = new Message(); // Timer call, must be injected into master mutex (this is generated outside the mutex)\r
m->from = this;\r
m->to = nextTimer->client;\r
m->message = Message::TIMER;\r
#include "command.h"\r
#include "timerreceiver.h"\r
\r
-// FIXME - ensure all objects that call settimer call cancel timer if they are being deleted\r
-\r
/*\r
\r
Timers documentation\r
if (numGot == 3)
{
- Message* m = new Message();
- m->from = this;
- m->to = ViewMan::getInstance();
- m->message = Message::CLOSE_ME;
- ViewMan::getInstance()->postMessage(m);
-
// Is there valid data?
if ((first > 0) || (second > 0) || (third > 0))
{
- m = new Message();
+ Message* m = new Message();
m->from = this;
m->to = videoLive;
m->message = Message::CHANNEL_CHANGE;
m->parameter = (first * 100) + (second * 10) + third;
ViewMan::getInstance()->postMessage(m);
}
+
+ return 4;
}
return 2;
Log::getInstance()->log("VChannelSelect", Log::DEBUG, "Timer call");
// Close me
- Message* m = new Message();
+ Message* m = new Message(); // Delete self
m->from = this;
m->to = ViewMan::getInstance();
m->message = Message::CLOSE_ME;
newChannel += third;
}
- m = new Message();
+ m = new Message(); // Must be done after this view deleted
m->from = this;
m->to = videoLive;
m->message = Message::CHANNEL_CHANGE;
else
{
selectedServer = -1;
- VServerSelect* vs = new VServerSelect(&serverIPs);
- vs->setParent(this);
+ VServerSelect* vs = new VServerSelect(&serverIPs, this);
vs->draw();
viewman->add(vs); // FIXME - do this better - perhaps post message to Command
// Otherwise it will be using ViewMan without the Command mutex locked
} while(!success);
- Message* m = new Message();
+ Message* m = new Message(); // Must be done after this thread ends
m->from = this;
m->message = Message::VDR_CONNECTED;
Command::getInstance()->postMessage(m);
case Remote::GO:\r
case Remote::OK:\r
{ // select programme and display menu TODO currently just changes to selected channel\r
- Message* m = new Message();\r
- m->from = this;\r
- m->to = videoLive;\r
- m->message = Message::CHANNEL_CHANGE;\r
- m->parameter = (*chanList)[chanListbox.getCurrentOption()]->number;\r
- ViewMan::getInstance()->postMessage(m);\r
+ videoLive->channelChange(VVideoLive::NUMBER, (*chanList)[chanListbox.getCurrentOption()]->number);
+
if(command == Remote::GO)\r
return 2;\r
// GO just changes channel in preview, PLAY changes channel and returns to normal TV\r
// return to normal TV mode\r
if (videoLive) // ptr check done in case being tested from videorec\r
{\r
- Message* m = new Message();
+ Message* m = new Message(); // Must be done after this view deleted
m->from = this;
m->to = videoLive;
m->message = Message::EPG_CLOSE;
}
return 4;\r
}\r
- case Remote::CHANNELUP:\r
- {\r
- // change up channel on live TV\r
- Message* m = new Message();\r
- m->from = this;\r
- m->to = videoLive;\r
- m->message = Message::CHANNEL_UP;\r
- ViewMan::getInstance()->postMessage(m);\r
- return 2;\r
- }\r
- case Remote::CHANNELDOWN:\r
- { // change down channel on live TV\r
- Message* m = new Message();\r
- m->from = this;\r
- m->to = videoLive;\r
- m->message = Message::CHANNEL_DOWN;\r
- ViewMan::getInstance()->postMessage(m);\r
- return 2;\r
- }\r
+ case Remote::CHANNELUP:
+ {
+ videoLive->channelChange(VVideoLive::OFFSET, VVideoLive::UP);
+ return 2;
+ }
+ case Remote::CHANNELDOWN:
+ {
+ videoLive->channelChange(VVideoLive::OFFSET, VVideoLive::DOWN);
+ return 2;
+ }
}\r
// stop command getting to any more views\r
return 1;\r
View::View()
{
- delSec = 0;
- delNSec = 0;
- seconds = 0;
-
titleBarOn = 0;
borderOn = 0;
{
borderOn = on;
}
-
-void View::setParent(View* tParent)
-{
- parent = tParent;
-}
virtual void draw();
virtual int handleCommand(int command);
+ virtual void processMessage(Message* m);
void setBorderOn(UCHAR on);
void setTitleBarOn(UCHAR on);
void setTitleText(char* title);
void setBackgroundColour(Colour& colour);
void setTitleBarColour(Colour& colour);
- void setParent(View* parent);
-
- // For use by ViewMan
- long delSec;
- long delNSec;
- int seconds;
- //
-
- virtual void processMessage(Message* m);
private:
static char numViews;
protected:
Colour titleBarColour;
- View* parent;
};
#endif
VLiveBanner* VLiveBanner::instance = NULL;
-VLiveBanner::VLiveBanner(View* tparent, Channel* channel, bool bannerTakesCommands)
+VLiveBanner::VLiveBanner(VVideoLive* tvvideoLive, Channel* channel, bool bannerTakesCommands)
{
instance = this;
eventList = NULL;
- parent = tparent;
+ vvideoLive = tvvideoLive;
takeCommands = bannerTakesCommands;
clockRegion.x = 440;
{
// cancel timer so this view is still here later
Timers::getInstance()->cancelTimer(this, 1); // if it exists
-
- Message* m = new Message();
- m->from = this;
- m->to = parent;
- m->message = Message::CHANNEL_UP;
- ViewMan::getInstance()->postMessage(m);
+ vvideoLive->channelChange(VVideoLive::OFFSET, VVideoLive::UP);
return 2;
}
case Remote::CHANNELDOWN:
{
// cancel timer so this view is still here later
Timers::getInstance()->cancelTimer(this, 1); // if it exists
-
- Message* m = new Message();
- m->from = this;
- m->to = parent;
- m->message = Message::CHANNEL_DOWN;
- ViewMan::getInstance()->postMessage(m);
+ vvideoLive->channelChange(VVideoLive::OFFSET, VVideoLive::DOWN);
return 2;
}
case Remote::GREEN:
{
// full epg
Timers::getInstance()->cancelTimer(this, 1); // if it exists
- Message* m = new Message();
+ Message* m = new Message(); // Must be done after this view deleted
m->message = Message::EPG;
- m->to = parent;
+ m->to = vvideoLive;
m->from = this;
ViewMan::getInstance()->postMessage(m);
return 4;
if (clientReference == 1)
{
// delete me!
- Message* m = new Message();
+ Message* m = new Message(); // Delete self
m->message = Message::CLOSE_ME;
m->to = ViewMan::getInstance();
m->from = this;
#include "i18n.h"
#include "timerreceiver.h"
#include "timers.h"
+//#include "vvideolive.h"
+
+class VVideoLive;
class VLiveBanner : public View, public TimerReceiver
{
public:
- VLiveBanner(View* parent, Channel* channel, bool bannerTakesCommands);
+ VLiveBanner(VVideoLive* tvvideoLive, Channel* channel, bool bannerTakesCommands);
~VLiveBanner();
static VLiveBanner* getInstance();
void delData();
private:
static VLiveBanner* instance;
- View* parent;
+ VVideoLive* vvideoLive;
WSelectList sl;
Channel* currentChannel;
EventList* eventList;
void VMute::timercall(int clientReference)
{
// delete me!
- Message* m = new Message();
+ Message* m = new Message(); // Delete self
m->message = Message::CLOSE_ME;
m->to = ViewMan::getInstance();
m->from = this;
#include "voptions.h"
-VOptions::VOptions()
+VOptions::VOptions(VWelcome* tvwelcome)
{
+ vwelcome = tvwelcome;
viewman = ViewMan::getInstance();
create(530, 85+(NUM_OPTIONS*30));
if (result[1] != optionsAtStart[1])
{
I18n::initialize();
- Message *m = new Message();
- m->to = VWelcome::getInstance();
- m->message = Message::REDRAW_LANG;
- viewman->postMessage(m);
+ vwelcome->redrawLang();
}
if (result[2] != optionsAtStart[2])
{"VDR-Pri 0=OK !See forums!","General", "Live priority", 21, 0, options6 }
};
+class VWelcome;
+
class VOptions : public View
{
public:
- VOptions();
+ VOptions(VWelcome* tvwelcome);
~VOptions();
int handleCommand(int command);
VDR* vdr;
int* optionsAtStart;
ViewMan* viewman;
+ VWelcome* vwelcome;
};
#endif
#include "vquestion.h"
-VQuestion::VQuestion()
+VQuestion::VQuestion(void* treplyTo)
{
+ replyTo = treplyTo;
mainText = NULL;
selectedOption = NO;
{
if (selectedOption != YES) return 4;
- Message* m = new Message();
+ Message* m = new Message(); // Question/answer mech
m->from = this;
- m->to = parent;
+ m->to = replyTo;
m->message = Message::QUESTION_YES;
ViewMan::getInstance()->postMessage(m);
class VQuestion : public View
{
public:
- VQuestion();
+ VQuestion(void* replyTo);
~VQuestion();
void setDefault(UCHAR option);
void setMainText(char* title);
const static UCHAR YES = 1;
private:
+ void* replyTo;
char* mainText;
void swap();
#include "vrecordinglist.h"
-VRecordingList::VRecordingList(VRecordingList* tparent)
+VRecordingList::VRecordingList(VRecordingList* tparent, Directory* tdir)
{
myParent = tparent;
- dataInvalid = 0;
viewman = ViewMan::getInstance();
+ recDir = tdir;
create(570, 420);
if (Video::getInstance()->getFormat() == Video::PAL)
VRecordingList::~VRecordingList()
{
- // if this is a child window, inform the parent of our destruct
if (myParent)
{
- Message* m = new Message();
- m->to = myParent;
- m->message = Message::CHILD_CLOSE;
- viewman->postMessage(m);
+ // if this is a sub, there can only be recordings. if there are none left, get this dir deleted by parent
+ if (recDir->getNumRecordings() == 0) myParent->zeroCheck();
+ // recDir is now deleted if it was empty
}
-
- // only delete the list if this is not a sub dir window
- if (recDir->isRoot)
+ else
{
+ // only delete the list if this is not a sub dir window
delete recDir;
}
}
-void VRecordingList::setDir(Directory* tdir)
+void VRecordingList::zeroCheck()
{
- recDir = tdir;
-
- drawData();
-
- char title[300];
- if (!recDir->isRoot)
- {
- snprintf(title, 299, tr("Recordings - %s"), recDir->name);
- setTitleText(title);
- }
- else
+ // go through to delete 1 empty dir if necessary (there will only ever be 1)
+ Directory* dir;
+ DirectoryList::iterator i;
+ for (i = recDir->dirList.begin(); i != recDir->dirList.end(); i++)
{
- setTitleText(tr("Recordings"));
+ dir = *i;
+ if (dir->getNumRecordings() == 0)
+ {
+ delete dir;
+ recDir->dirList.erase(i);
+ break;
+ }
}
+ drawData();
+ viewman->updateView(this);
}
void VRecordingList::drawData()
{
+ int saveIndex = sl.getCurrentOption();
+ int saveTop = sl.getTopOption();
+
sl.clear();
sl.addColumn(0);
sl.addColumn(110);
Directory* dir;
DirectoryList::iterator i;
-
- if (dataInvalid == 2) // special case, a child list has closed, check for 0 dir entries
- {
-
- // First go through to delete 1 empty dir if necessary
-
- for (i = recDir->dirList.begin(); i != recDir->dirList.end(); i++)
- {
- dir = *i;
- if (dir->getNumRecordings() == 0)
- {
- delete dir;
- recDir->dirList.erase(i);
- break;
- }
- }
- }
-
- // Then go through again to draw data. Don't merge these two loops!
-
for (i = recDir->dirList.begin(); i != recDir->dirList.end(); i++)
{
dir = *i;
// FIXME convert the whole program to time_t's
-
Recording* rec;
for (UINT j = 0; j < recDir->recList.size(); j++)
{
first = 0;
}
- dataInvalid = 0;
+ sl.hintSetCurrent(saveIndex);
+ sl.hintSetTop(saveTop);
+ sl.draw();
}
void VRecordingList::draw()
{
- View::draw();
+ char title[300];
+ if (myParent)
+ {
+ snprintf(title, 299, tr("Recordings - %s"), recDir->name);
+ setTitleText(title);
+ }
+ else
+ {
+ setTitleText(tr("Recordings"));
+ }
- if (dataInvalid) drawData();
+ View::draw();
- sl.draw();
+ char freeSpace[50];
+ int gigFree = Directory::freeSpace / 1024;
+ snprintf(freeSpace, 49, tr("%lu%% used, %iGB free"), Directory::usedPercent, gigFree);
+ drawTextRJ(freeSpace, 560, 5, Colour::LIGHTTEXT);
- // Put the status stuff at the bottom
+ // Symbols
WSymbol w;
w.setSurface(surface);
w.setSurfaceOffset(150, 385);
w.draw();
- // FIXME Right justify this!
- drawText(tr("[ok] = menu"), 450, 385, Colour::LIGHTTEXT);
+ drawTextRJ("[ok] = menu", 560, 385, Colour::LIGHTTEXT);
- doShowingBar();
+ // All static stuff done
- char freeSpace[50];
- int gigFree = Directory::freeSpace / 1024;
- snprintf(freeSpace, 49, tr("%lu%% used, %iGB free"), Directory::usedPercent, gigFree);
- drawTextRJ(freeSpace, 560, 5, Colour::LIGHTTEXT);
+ drawData();
+ sl.draw();
+ doShowingBar();
}
void VRecordingList::doShowingBar()
int topOption = sl.getTopOption() + 1;
if (sl.getNumOptions() == 0) topOption = 0;
+ rectangle(220, 385, 180, 25, Colour::VIEWBACKGROUND);
char showing[200];
sprintf(showing, tr("%i to %i of %i"), topOption, sl.getBottomOption(), sl.getNumOptions());
-
-// Box b;
-// b.setSurfaceOffset(220, 385);
-// b.setDimensions(160, 25);
-// b.fillColour(Colour::VIEWBACKGROUND);
-// b.drawText(showing, 0, 0, Colour::LIGHTTEXT);
-
- rectangle(220, 385, 220+160, 385+25, Colour::VIEWBACKGROUND);
drawText(showing, 220, 385, Colour::LIGHTTEXT);
}
-
-
void VRecordingList::processMessage(Message* m)
{
Log::getInstance()->log("VRecordingList", Log::DEBUG, "Got message value %lu", m->message);
doResume();
return;
}
-
- if (m->message == Message::REDRAW_DATA)
- {
- dataInvalid = 1;
- draw();
- return;
- }
-
- if (m->message == Message::CHILD_CLOSE)
- {
- dataInvalid = 2;
- draw();
- show();
- return;
- }
}
void VRecordingList::doDeleteSelected()
{
+ Log::getInstance()->log("VRecordingList", Log::DEBUG, "Parent = %p, isRoot = %i", myParent, recDir->isRoot);
Recording* toDelete = getCurrentOptionRecording();
- int saveIndex;
- int saveTop;
-
if (toDelete)
{
- saveIndex = toDelete->index;
- saveTop = sl.getTopOption();
Log::getInstance()->log("VRecordingList", Log::DEBUG, "FOUND: %i %s %s", toDelete->index, toDelete->getProgName(), toDelete->fileName);
VDR* vdr = VDR::getInstance();
}
}
- sl.clear();
- setDir(recDir);
- sl.hintSetCurrent(saveIndex);
- sl.hintSetTop(saveTop);
- draw();
- }
+ drawData();
+ viewman->updateView(this);
- if (myParent) // if this is not root send a message to parent to say redraw data
- { // FIXME not really necessary any more ?
- Message* m1 = new Message();
- m1->to = myParent;
- m1->message = Message::REDRAW_DATA;
- viewman->postMessage(m1);
+ if (myParent) myParent->drawData(); // if this is not root get parent to redraw data
}
- show();
+ Log::getInstance()->log("VRecordingList", Log::DEBUG, "Parent = %p, isRoot = %i", myParent, recDir->isRoot);
}
int VRecordingList::doPlay()
curDir = recDir->dirList[i];
if (curDir->index == sl.getCurrentOption())
{
- VRecordingList* sub = new VRecordingList(this);
- sub->setDir(curDir);
- viewman->add(sub);
-
+ VRecordingList* sub = new VRecordingList(this, curDir);
sub->draw();
- sub->show();
-
+ viewman->add(sub);
+ viewman->updateView(sub);
return 2;
}
}
VRecordingMenu* v = new VRecordingMenu();
v->setParent(this);
v->setRecording(current);
- viewman->add(v);
v->draw();
- v->show();
+ viewman->add(v);
+ viewman->updateView(v);
return 2;
}
// should not get to here
class VRecordingList : public View
{
public:
- VRecordingList(VRecordingList* parent);
+ VRecordingList(VRecordingList* parent, Directory* dir);
~VRecordingList();
- void setDir(Directory* dir);
- void drawData();
-
int handleCommand(int command);
void processMessage(Message* m);
void draw();
+ void drawData();
+ void zeroCheck();
+
private:
VRecordingList* myParent;
Directory* recDir;
ViewMan* viewman;
WSelectList sl;
- int dataInvalid;
void doShowingBar();
void doDeleteSelected();
{
if (sl.getCurrentOption() == 0)
{
- Message* m = new Message();
+ Message* m = new Message(); // Must be done after this view deleted
m->from = this;
m->to = vRecList;
m->message = Message::PLAY_SELECTED_RECORDING;
if (sl.getCurrentOption() == 1)
{
- Message* m = new Message();
+ Message* m = new Message(); // Must be done after this view deleted
m->from = this;
m->to = vRecList;
m->message = Message::RESUME_SELECTED_RECORDING;
}
else if (sl.getCurrentOption() == 3)
{
- VQuestion* v = new VQuestion();
+ VQuestion* v = new VQuestion(this);
v->create(260, 180);
- v->setParent(this);
v->setBackgroundColour(Colour::VIEWBACKGROUND);
v->setTitleBarColour(Colour::DANGER);
v->setTitleBarOn(1);
{
if (sl.getCurrentOption() == 3)
{
- Message* m2 = new Message();
+ Message* m2 = new Message(); // Delete self
m2->from = this;
m2->to = ViewMan::getInstance();
m2->message = Message::CLOSE_ME;
ViewMan::getInstance()->postMessage(m2);
- m2 = new Message();
+ m2 = new Message(); // OK. Want this to delete before this message does its job
m2->from = this;
m2->to = vRecList;
m2->message = Message::DELETE_SELECTED_RECORDING;
#include "vserverselect.h"
-VServerSelect::VServerSelect(std::vector<char*>* serverIPs)
+VServerSelect::VServerSelect(std::vector<char*>* serverIPs, void* treplyTo)
{
// I tried the whole passing using a reference here, but
// the program segfaulted when settitletext tried to new
{
sl.addOption((*serverIPs)[k], 0);
}
+
+ replyTo = treplyTo;
}
VServerSelect::~VServerSelect()
}
case Remote::OK:
{
- Message* m = new Message();
- m->to = parent;
+ Message* m = new Message(); // Question/Answer mech. Better being messages
+ m->to = replyTo;
m->message = Message::SERVER_SELECTED;
m->parameter = sl.getCurrentOption();
ViewMan::getInstance()->postMessage(m);
class VServerSelect : public View
{
public:
- VServerSelect(std::vector<char*>* tserverIPs);
+ VServerSelect(std::vector<char*>* tserverIPs, void* replyTo);
~VServerSelect();
int handleCommand(int command);
private:
WSelectList sl;
+ void* replyTo;
};
#endif
VEpg* vepg = VEpg::getInstance();
if(vepg) vepg->setCurrentChannel((*chanList)[currentChannel]->name);
+
+ VLiveBanner* vlb = VLiveBanner::getInstance();
+ if (vlb)
+ {
+ vlb->setChannel((*chanList)[currentChannel]);
+ vlb->draw();
+ viewman->updateView(vlb);
+ }
+
play();
}
+void VVideoLive::streamEnd()
+{
+ Log::getInstance()->log("VVideoLive", Log::DEBUG, "streamEnd");
+ stop();
+ showUnavailable(1);
+}
+
void VVideoLive::processMessage(Message* m)
{
if (m->message == Message::CHANNEL_CHANGE)
{
channelChange(NUMBER, m->parameter);
}
- else if (m->message == Message::CHANNEL_UP)
- {
- // this message is from vlivebanner
- channelChange(OFFSET, UP);
- if(!VEpg::getInstance())
- {
- VLiveBanner* vlb = VLiveBanner::getInstance(); // guaranteed to be one
- vlb->setChannel((*chanList)[currentChannel]);
- vlb->draw();
- viewman->updateView(vlb);
- }
- }
- else if (m->message == Message::CHANNEL_DOWN)
- {
- // this message is from vlivebanner
- channelChange(OFFSET, DOWN);
- if(!VEpg::getInstance())
- {
- VLiveBanner* vlb = VLiveBanner::getInstance(); // guaranteed to be one
- vlb->setChannel((*chanList)[currentChannel]);
- vlb->draw();
- viewman->updateView(vlb);
- }
- }
- else if (m->message == Message::STREAM_END)
- {
- Log::getInstance()->log("VVideoLive", Log::DEBUG, "streamEnd");
- stop();
- showUnavailable(1);
- }
else if (m->message == Message::EPG)
{
Log::getInstance()->log("VVideoLive", Log::DEBUG, "EPG requested from live banner");
void draw();
int handleCommand(int command);
void processMessage(Message* m);
+ void streamEnd(); // from command
void channelChange(UCHAR changeType, UINT newData);
// changeType = INDEX = (newData is a channel index in the list)
void VVolume::timercall(int clientReference)
{
// delete me!
- Message* m = new Message();
+ Message* m = new Message(); // Delete self
m->message = Message::CLOSE_ME;
m->to = ViewMan::getInstance();
m->from = this;
#include "vwelcome.h"
-VWelcome* VWelcome::instance = NULL;
-
VWelcome::VWelcome()
{
- instance = this;
viewman = ViewMan::getInstance();
clockRegion.x = 400;
VWelcome::~VWelcome()
{
Timers::getInstance()->cancelTimer(this, 1);
- instance = NULL;
-}
-
-VWelcome* VWelcome::getInstance()
-{
- return instance;
}
void VWelcome::setup()
}
case Remote::FIVE:
{
- Message* m = new Message();
+ Message* m = new Message(); // Must be done after this view deleted
m->message = Message::STANDBY;
Command::getInstance()->postMessage(m);
return 4;
}
else if (option == 4)
{
- Message* m = new Message();
+ Message* m = new Message(); // Must be done after this view deleted
m->message = Message::STANDBY;
Command::getInstance()->postMessage(m);
return 4;
return 1;
}
-
void VWelcome::doChannelsList()
{
ChannelList* chanList = VDR::getInstance()->getChannelsList(VDR::VIDEO);
vchan->draw();
viewman->add(vchan);
viewman->updateView(vchan);
-
-
-// Message* m = new Message();
-// m->from = this;
-// m->to = ViewMan::getInstance();
-// m->message = Message::SWAP_ME_FOR;
-// m->parameter = (ULONG)vchan;
-// ViewMan::getInstance()->postMessage(m);
}
}
if (recDir)
{
- VRecordingList* vrec = new VRecordingList(NULL);
- vrec->setDir(recDir);
+ VRecordingList* vrec = new VRecordingList(NULL, recDir);
vrec->draw();
viewman->add(vrec);
void VWelcome::doOptions()
{
- VOptions* voptions = new VOptions();
+ VOptions* voptions = new VOptions(this);
voptions->draw();
viewman->add(voptions);
viewman->updateView(voptions);
}
-void VWelcome::processMessage(Message* m)
+void VWelcome::redrawLang()
{
- if (m->message == Message::REDRAW_LANG)
- {
- Log::getInstance()->log("VWelcome", Log::DEBUG, "Got redraw lang message");
- setup();
- draw();
- viewman->updateView(this);
- }
+ Log::getInstance()->log("VWelcome", Log::DEBUG, "Got redraw lang message");
+ setup();
+ draw();
}
public:
VWelcome();
~VWelcome();
- static VWelcome* getInstance();
void setup();
int handleCommand(int command);
- void processMessage(Message* m);
void draw();
void timercall(int clientReference);
+ void redrawLang();
private:
- static VWelcome* instance;
WSelectList sl;
WJpeg jpeg;