mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
adzap: allow user-definable zap back time > 9 min
Origin commit data
------------------
Branch: ni/coolstream
Commit: ca6d1f69ee
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-03-01 (Tue, 01 Mar 2016)
Origin message was:
------------------
- adzap: allow user-definable zap back time > 9 min
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -62,7 +62,7 @@ CAdZapMenu *CAdZapMenu::getInstance()
|
||||
CAdZapMenu::CAdZapMenu()
|
||||
{
|
||||
frameBuffer = CFrameBuffer::getInstance();
|
||||
width = 40;
|
||||
width = 35;
|
||||
|
||||
sem_init(&sem, 0, 0);
|
||||
|
||||
@@ -289,6 +289,7 @@ int CAdZapMenu::exec(CMenuTarget *parent, const std::string & actionKey)
|
||||
g_settings.adzap_zapBackPeriod = actionKey[0] - '0';
|
||||
for (int shortcut = 1; shortcut < 10; shortcut++)
|
||||
forwarders[shortcut - 1]->setMarked(shortcut == g_settings.adzap_zapBackPeriod);
|
||||
nc->setMarked(false);
|
||||
g_settings.adzap_zapBackPeriod *= 60;
|
||||
return menu_return::RETURN_REPAINT;
|
||||
}
|
||||
@@ -331,9 +332,27 @@ void CAdZapMenu::ShowMenu()
|
||||
minute = LOCALE_ADZAP_MINUTES;
|
||||
}
|
||||
|
||||
menu->addItem(GenericMenuSeparator);
|
||||
|
||||
int zapBackPeriod = g_settings.adzap_zapBackPeriod / 60;
|
||||
nc = new CMenuOptionNumberChooser(minute, &zapBackPeriod, true, 10, 120, this, CRCInput::RC_0);
|
||||
nc->setMarked(g_settings.adzap_zapBackPeriod / 60 > 9);
|
||||
nc->setHint(NEUTRINO_ICON_HINT_ADZAP, "");
|
||||
menu->addItem(nc);
|
||||
|
||||
menu->setFooter(CAdZapMenuFooterButtons, CAdZapMenuFooterButtonCount - (show_monitor ? 0 : 1));
|
||||
menu->exec(NULL, "");
|
||||
menu->hide();
|
||||
delete menu;
|
||||
Update();
|
||||
}
|
||||
|
||||
bool CAdZapMenu::changeNotify(const neutrino_locale_t, void * data)
|
||||
{
|
||||
int z = (*(int *)data);
|
||||
g_settings.adzap_zapBackPeriod = z * 60;
|
||||
for (int shortcut = 1; shortcut < 10; shortcut++)
|
||||
forwarders[shortcut - 1]->setMarked(false);
|
||||
nc->setMarked(true);
|
||||
return false;
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@
|
||||
#include <string>
|
||||
#include <semaphore.h>
|
||||
|
||||
class CAdZapMenu: public CMenuTarget
|
||||
class CAdZapMenu: public CMenuTarget, CChangeObserver
|
||||
{
|
||||
private:
|
||||
CFrameBuffer * frameBuffer;
|
||||
@@ -43,6 +43,7 @@ class CAdZapMenu: public CMenuTarget
|
||||
struct timespec zapBackTime;
|
||||
std::string channelName;
|
||||
CMenuForwarder *forwarders[9];
|
||||
CMenuOptionNumberChooser *nc;
|
||||
CChannelEventList evtlist;
|
||||
struct timespec monitorLifeTime;
|
||||
t_channel_id channelId;
|
||||
@@ -57,6 +58,7 @@ class CAdZapMenu: public CMenuTarget
|
||||
public:
|
||||
static CAdZapMenu *getInstance();
|
||||
int exec(CMenuTarget * parent, const std::string & actionKey);
|
||||
bool changeNotify(const neutrino_locale_t, void * data);
|
||||
bool isActive() { return (armed || monitor); };
|
||||
};
|
||||
#endif // __adzap__
|
||||
|
@@ -784,10 +784,10 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
|
||||
case CRCInput::RC_page_up:
|
||||
if(isCurrentEPG(channel_id)){
|
||||
int zapBackPeriod = g_settings.adzap_zapBackPeriod / 60;
|
||||
if (zapBackPeriod < 9)
|
||||
if (zapBackPeriod < 120)
|
||||
zapBackPeriod++;
|
||||
if (zapBackPeriod > 9)
|
||||
zapBackPeriod = 9;
|
||||
if (zapBackPeriod > 120)
|
||||
zapBackPeriod = 120;
|
||||
g_settings.adzap_zapBackPeriod = zapBackPeriod * 60;
|
||||
showTimerEventBar(true, true);
|
||||
}
|
||||
|
Reference in New Issue
Block a user