mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
spark_led: use ShowIcon() instead of querying neutrino
This commit is contained in:
@@ -40,7 +40,6 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <driver/netfile.h>
|
|
||||||
|
|
||||||
#include <driver/audioplay.h> // for ShoutcastCallback()
|
#include <driver/audioplay.h> // for ShoutcastCallback()
|
||||||
|
|
||||||
@@ -48,6 +47,8 @@
|
|||||||
#include <neutrino.h>
|
#include <neutrino.h>
|
||||||
#include <zapit/client/zapittools.h>
|
#include <zapit/client/zapittools.h>
|
||||||
|
|
||||||
|
#include <driver/netfile.h>
|
||||||
|
|
||||||
unsigned int CBaseDec::mSamplerate=0;
|
unsigned int CBaseDec::mSamplerate=0;
|
||||||
|
|
||||||
void ShoutcastCallback(void *arg)
|
void ShoutcastCallback(void *arg)
|
||||||
|
@@ -44,6 +44,8 @@ static bool muted = false;
|
|||||||
static bool showclock = true;
|
static bool showclock = true;
|
||||||
static time_t last_display = 0;
|
static time_t last_display = 0;
|
||||||
static char display_text[64] = { 0 };
|
static char display_text[64] = { 0 };
|
||||||
|
static bool led_r = false;
|
||||||
|
static bool led_g = false;
|
||||||
|
|
||||||
static inline int dev_open()
|
static inline int dev_open()
|
||||||
{
|
{
|
||||||
@@ -145,7 +147,8 @@ printf("spark_led:%s red:%d green:%d\n", __func__, red, green);
|
|||||||
|
|
||||||
void CLCD::showTime(bool force)
|
void CLCD::showTime(bool force)
|
||||||
{
|
{
|
||||||
static bool redled = false;
|
static bool blink = false;
|
||||||
|
int red = -1, green = -1;
|
||||||
|
|
||||||
if (mode == MODE_SHUTDOWN)
|
if (mode == MODE_SHUTDOWN)
|
||||||
{
|
{
|
||||||
@@ -175,16 +178,14 @@ void CLCD::showTime(bool force)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CNeutrinoApp::getInstance()->recordingstatus)
|
if (led_r)
|
||||||
{
|
red = blink;
|
||||||
redled = !redled;
|
blink = !blink;
|
||||||
setled(redled, -1);
|
if (led_g)
|
||||||
}
|
green = blink;
|
||||||
else if (redled)
|
|
||||||
{
|
if (led_r || led_g)
|
||||||
redled = false;
|
setled(red, green);
|
||||||
setled(redled, -1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLCD::showRCLock(int)
|
void CLCD::showRCLock(int)
|
||||||
@@ -338,8 +339,21 @@ void CLCD::Clear()
|
|||||||
printf("spark_led:%s\n", __func__);
|
printf("spark_led:%s\n", __func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLCD::ShowIcon(vfd_icon, bool)
|
void CLCD::ShowIcon(vfd_icon i, bool on)
|
||||||
{
|
{
|
||||||
|
switch (i)
|
||||||
|
{
|
||||||
|
case VFD_ICON_CAM1:
|
||||||
|
led_r = on;
|
||||||
|
setled(led_r, -1); /* switch instant on / switch off if disabling */
|
||||||
|
break;
|
||||||
|
case VFD_ICON_PLAY:
|
||||||
|
led_g = on;
|
||||||
|
setled(-1, led_g);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLCD::setEPGTitle(const std::string)
|
void CLCD::setEPGTitle(const std::string)
|
||||||
|
Reference in New Issue
Block a user