gui/channellist.cpp: add 'force' arg to zap functions, to trigger zap

This commit is contained in:
[CST] Focus
2013-03-13 18:54:30 +04:00
parent 2b919d5a32
commit c60b8fc741
2 changed files with 9 additions and 9 deletions

View File

@@ -1150,12 +1150,12 @@ void CChannelList::setSelected( int nChannelNr)
} }
// -- Zap to channel with channel_id // -- Zap to channel with channel_id
bool CChannelList::zapTo_ChannelID(const t_channel_id channel_id) bool CChannelList::zapTo_ChannelID(const t_channel_id channel_id, bool force)
{ {
printf("**************************** CChannelList::zapTo_ChannelID %" PRIx64 "\n", channel_id); printf("**************************** CChannelList::zapTo_ChannelID %" PRIx64 "\n", channel_id);
for (unsigned int i = 0; i < chanlist.size(); i++) { for (unsigned int i = 0; i < chanlist.size(); i++) {
if (chanlist[i]->channel_id == channel_id) { if (chanlist[i]->channel_id == channel_id) {
zapTo(i); zapTo(i, force);
return true; return true;
} }
} }
@@ -1173,7 +1173,7 @@ bool CChannelList::showEmptyError()
/* forceStoreToLastChannels defaults to false */ /* forceStoreToLastChannels defaults to false */
/* TODO make this private to call only from "current" list, where selected/pos not means channel number */ /* TODO make this private to call only from "current" list, where selected/pos not means channel number */
void CChannelList::zapTo(int pos, bool /* forceStoreToLastChannels */) void CChannelList::zapTo(int pos, bool force)
{ {
if(showEmptyError()) if(showEmptyError())
return; return;
@@ -1183,7 +1183,7 @@ void CChannelList::zapTo(int pos, bool /* forceStoreToLastChannels */)
} }
CZapitChannel* chan = chanlist[pos]; CZapitChannel* chan = chanlist[pos];
zapToChannel(chan); zapToChannel(chan, force);
tuned = pos; tuned = pos;
if(new_zap_mode == 2 /* active */) if(new_zap_mode == 2 /* active */)
selected_in_new_mode = pos; selected_in_new_mode = pos;
@@ -1192,7 +1192,7 @@ void CChannelList::zapTo(int pos, bool /* forceStoreToLastChannels */)
} }
/* to replace zapTo_ChannelID and zapTo from "whole" list ? */ /* to replace zapTo_ChannelID and zapTo from "whole" list ? */
void CChannelList::zapToChannel(CZapitChannel *channel) void CChannelList::zapToChannel(CZapitChannel *channel, bool force)
{ {
if(showEmptyError()) if(showEmptyError())
return; return;
@@ -1210,7 +1210,7 @@ void CChannelList::zapToChannel(CZapitChannel *channel)
if(tuned < chanlist.size()) if(tuned < chanlist.size())
selected_chid = chanlist[tuned]->getChannelID(); selected_chid = chanlist[tuned]->getChannelID();
if(selected_chid != channel->getChannelID()) { if(force || (selected_chid != channel->getChannelID())) {
if ((g_settings.radiotext_enable) && ((CNeutrinoApp::getInstance()->getMode()) == NeutrinoMessages::mode_radio) && (g_Radiotext)) if ((g_settings.radiotext_enable) && ((CNeutrinoApp::getInstance()->getMode()) == NeutrinoMessages::mode_radio) && (g_Radiotext))
{ {
// stop radiotext PES decoding before zapping // stop radiotext PES decoding before zapping

View File

@@ -148,10 +148,10 @@ public:
t_channel_id getActiveChannel_ChannelID(void) const; t_channel_id getActiveChannel_ChannelID(void) const;
CZapitChannel* getActiveChannel (void) const; CZapitChannel* getActiveChannel (void) const;
void zapTo(int pos, bool forceStoreToLastChannels = false); void zapTo(int pos, bool force = false);
void zapToChannel(CZapitChannel *channel); void zapToChannel(CZapitChannel *channel, bool force = false);
void virtual_zap_mode(bool up); void virtual_zap_mode(bool up);
bool zapTo_ChannelID(const t_channel_id channel_id); bool zapTo_ChannelID(const t_channel_id channel_id, bool force = false);
bool adjustToChannelID(const t_channel_id channel_id, bool bToo = true); bool adjustToChannelID(const t_channel_id channel_id, bool bToo = true);
bool showInfo(int pos, int epgpos = 0); bool showInfo(int pos, int epgpos = 0);
void updateEvents(unsigned int from, unsigned int to); void updateEvents(unsigned int from, unsigned int to);