spark_led: use ShowIcon() instead of querying neutrino

This commit is contained in:
Stefan Seyfried
2012-04-22 21:14:11 +02:00
parent f06731810e
commit c230016e17
2 changed files with 28 additions and 13 deletions

View File

@@ -40,7 +40,6 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <driver/netfile.h>
#include <driver/audioplay.h> // for ShoutcastCallback()
@@ -48,6 +47,8 @@
#include <neutrino.h>
#include <zapit/client/zapittools.h>
#include <driver/netfile.h>
unsigned int CBaseDec::mSamplerate=0;
void ShoutcastCallback(void *arg)

View File

@@ -44,6 +44,8 @@ static bool muted = false;
static bool showclock = true;
static time_t last_display = 0;
static char display_text[64] = { 0 };
static bool led_r = false;
static bool led_g = false;
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)
{
static bool redled = false;
static bool blink = false;
int red = -1, green = -1;
if (mode == MODE_SHUTDOWN)
{
@@ -175,16 +178,14 @@ void CLCD::showTime(bool force)
}
}
if (CNeutrinoApp::getInstance()->recordingstatus)
{
redled = !redled;
setled(redled, -1);
}
else if (redled)
{
redled = false;
setled(redled, -1);
}
if (led_r)
red = blink;
blink = !blink;
if (led_g)
green = blink;
if (led_r || led_g)
setled(red, green);
}
void CLCD::showRCLock(int)
@@ -338,8 +339,21 @@ void CLCD::Clear()
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)