VChannelList::VChannelList(ULONG type)
{
+ viewman = ViewMan::getInstance();
create(570, 420);
if (Video::getInstance()->getFormat() == Video::PAL)
{
sl.hintSetCurrent(chan->index);
sl.draw();
doShowingBar();
- ViewMan::getInstance()->updateView(this);
+ viewman->updateView(this);
}
void VChannelList::draw()
sl.draw();
doShowingBar();
- ViewMan::getInstance()->updateView(this);
+ viewman->updateView(this);
return 2;
}
case Remote::DF_DOWN:
sl.draw();
doShowingBar();
- ViewMan::getInstance()->updateView(this);
+ viewman->updateView(this);
return 2;
}
case Remote::SKIPBACK:
sl.draw();
doShowingBar();
- ViewMan::getInstance()->updateView(this);
+ viewman->updateView(this);
return 2;
}
case Remote::SKIPFORWARD:
sl.draw();
doShowingBar();
- ViewMan::getInstance()->updateView(this);
+ viewman->updateView(this);
+ return 2;
+ }
+ case Remote::ZERO:
+ case Remote::ONE:
+ case Remote::TWO:
+ case Remote::THREE:
+ case Remote::FOUR:
+ case Remote::FIVE:
+ case Remote::SIX:
+ case Remote::SEVEN:
+ case Remote::EIGHT:
+ case Remote::NINE:
+ {
+ VChannelSelect* v = new VChannelSelect(this, command);
+ v->draw();
+ viewman->add(v);
+ viewman->updateView(v);
return 2;
}
case Remote::OK:
VVideoLive* v = new VVideoLive(chanList, chan->type, this);
v->draw();
- ViewMan::getInstance()->add(v);
- ViewMan::getInstance()->updateView(v);
+ viewman->add(v);
+ viewman->updateView(v);
v->channelChange(VVideoLive::NUMBER, chan->number);
{
sl.draw();
doShowingBar();
- ViewMan::getInstance()->updateView(this);
+ viewman->updateView(this);
}
}
else if (m->message == Message::MOUSE_LBDOWN)
{
if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
- ViewMan::getInstance()->handleCommand(Remote::OK); //simulate OK press
+ viewman->handleCommand(Remote::OK); //simulate OK press
}
else
{ //check if press is outside this view! then simulate cancel
int y=(m->parameter&0xFFFF)-getScreenY();
if (x<0 || y <0 || x>getWidth() || y>getHeight())
{
- ViewMan::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
+ viewman->handleCommand(Remote::BACK); //simulate cancel press
+ }
+ }
+ }
+ else if (m->message == Message::CHANNEL_CHANGE)
+ {
+ bool isinlist = false;
+
+ for (UINT i = 0; i < chanList->size(); i++)
+ {
+ if ((*chanList)[i]->number == m->parameter)
+ {
+ isinlist = true;
+ break;
}
}
+ if (!isinlist) return;
+
+ VVideoLive* v = new VVideoLive(chanList, VDR::VIDEO, this); // FIXME - what's wrong with it?
+
+ v->draw();
+ viewman->add(v);
+ viewman->updateView(v);
+ v->channelChange(VVideoLive::NUMBER, m->parameter);
}
}
// this class only works as it does because the remote command
// values for the numbers are the numbers themselves !
-VChannelSelect::VChannelSelect(VVideoLive* v, int command)
+VChannelSelect::VChannelSelect(View* v, int command)
{
create(53, 30);
setScreenPos(80, 60);
third = command;
numGot = 1;
- videoLive = v;
+ parent = v;
}
VChannelSelect::~VChannelSelect()
{
Message* m = new Message();
m->from = this;
- m->to = videoLive;
+ m->to = parent;
m->message = Message::CHANNEL_CHANGE;
m->parameter = (first * 100) + (second * 10) + third;
Command::getInstance()->postMessageNoLock(m);
m = new Message(); // Must be done after this view deleted
m->from = this;
- m->to = videoLive;
+ m->to = parent;
m->message = Message::CHANNEL_CHANGE;
m->parameter = newChannel;
Command::getInstance()->postMessageFromOuterSpace(m);