}
else if (changeType == NUMBER)
{
- newChannel = channelIndexFromNumber(newData);
+ UINT i;
+ for(i = 0; i < chanList->size(); i++)
+ {
+ if ((*chanList)[i]->number == (UINT)newData)
+ {
+ newChannel = i;
+ break;
+ }
+ }
+
+ if (i == chanList->size())
+ {
+ doNoSuchChannel();
+ return;
+ }
}
else if (changeType == OFFSET)
{
viewman->postMessage(m);
}
+void VVideoLive::doNoSuchChannel()
+{
+ Log::getInstance()->log("VVideoLive", Log::ERR, "No such channel");
+ // FIXME do gui for this
+}
+
void VVideoLive::showUnavailable(int active)
{
if (active == unavailable) return;
return currentChannel - 1;
}
-UINT VVideoLive::channelIndexFromNumber(int number)
-{
- for(UINT i = 0; i < chanList->size(); i++)
- {
- if ((*chanList)[i]->number == (UINT)number) return i;
- }
- return 0;
-}
-
-UINT VVideoLive::getCurrentChannelIndex()
-{
- return channelIndexFromNumber(currentChannel);
-}
-
void VVideoLive::showEPG()
{
if (unavailable) showUnavailable(0);
void play(int noShowVLB = 0);
void stop(int noRemoveVLB = 0);
- UINT getCurrentChannelIndex();
void setEpgMode(bool mode);
const static UCHAR INDEX = 1;
VDR* vdr;
Player* player;
ChannelList* chanList;
- UINT currentChannel;
- UINT previousChannel;
+ UINT currentChannel; // index in list
+ UINT previousChannel; // index in list
int unavailable;
VInfo* unavailableView;
ULONG streamType;
UINT downChannel();
void doBanner(bool takesCommands);
void showUnavailable(int active);
- UINT channelIndexFromNumber(int number);
VEpg* vepg;
int xpos;
bool epgmode;
void showEPG();
+ void doNoSuchChannel();
int videoMode;
};