From c60b8fc741591585cb2b28d229d66ffa01c24404 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 13 Mar 2013 18:54:30 +0400 Subject: [PATCH] gui/channellist.cpp: add 'force' arg to zap functions, to trigger zap --- src/gui/channellist.cpp | 12 ++++++------ src/gui/channellist.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 8ab76dd67..797a28fa4 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1150,12 +1150,12 @@ void CChannelList::setSelected( int nChannelNr) } // -- 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); for (unsigned int i = 0; i < chanlist.size(); i++) { if (chanlist[i]->channel_id == channel_id) { - zapTo(i); + zapTo(i, force); return true; } } @@ -1173,7 +1173,7 @@ bool CChannelList::showEmptyError() /* forceStoreToLastChannels defaults to false */ /* 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()) return; @@ -1183,7 +1183,7 @@ void CChannelList::zapTo(int pos, bool /* forceStoreToLastChannels */) } CZapitChannel* chan = chanlist[pos]; - zapToChannel(chan); + zapToChannel(chan, force); tuned = pos; if(new_zap_mode == 2 /* active */) 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 ? */ -void CChannelList::zapToChannel(CZapitChannel *channel) +void CChannelList::zapToChannel(CZapitChannel *channel, bool force) { if(showEmptyError()) return; @@ -1210,7 +1210,7 @@ void CChannelList::zapToChannel(CZapitChannel *channel) if(tuned < chanlist.size()) 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)) { // stop radiotext PES decoding before zapping diff --git a/src/gui/channellist.h b/src/gui/channellist.h index ea9688cec..43bb9ce6b 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -148,10 +148,10 @@ public: t_channel_id getActiveChannel_ChannelID(void) const; CZapitChannel* getActiveChannel (void) const; - void zapTo(int pos, bool forceStoreToLastChannels = false); - void zapToChannel(CZapitChannel *channel); + void zapTo(int pos, bool force = false); + void zapToChannel(CZapitChannel *channel, bool force = false); 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 showInfo(int pos, int epgpos = 0); void updateEvents(unsigned int from, unsigned int to);