mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-04 04:11:09 +02:00
Merge branch 'pu/mp' of https://github.com/tuxbox-neutrino/gui-neutrino into ni/mp/tuxbox
Conflicts:
acinclude.m4
src/neutrino.cpp
Origin commit data
------------------
Branch: ni/coolstream
Commit: 7f989a3625
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-03-31 (Fri, 31 Mar 2017)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -339,13 +339,6 @@ AC_ARG_WITH(boxmodel,
|
|||||||
AC_MSG_ERROR([unknown model $withval for boxtype $BOXTYPE])
|
AC_MSG_ERROR([unknown model $withval for boxtype $BOXTYPE])
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
raspi)
|
|
||||||
if test "$BOXTYPE" = "generic"; then
|
|
||||||
BOXMODEL="$withval"
|
|
||||||
else
|
|
||||||
AC_MSG_ERROR([unknown model $withval for boxtype $BOXTYPE])
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
AC_MSG_ERROR([unsupported value $withval for --with-boxmodel])
|
AC_MSG_ERROR([unsupported value $withval for --with-boxmodel])
|
||||||
;;
|
;;
|
||||||
|
@@ -820,6 +820,7 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
int yy = y;
|
int yy = y;
|
||||||
|
bool freeicondata = false;
|
||||||
//printf("CFrameBuffer::paintIcon: load %s\n", filename.c_str());fflush(stdout);
|
//printf("CFrameBuffer::paintIcon: load %s\n", filename.c_str());fflush(stdout);
|
||||||
|
|
||||||
/* we cache and check original name */
|
/* we cache and check original name */
|
||||||
@@ -904,6 +905,8 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in
|
|||||||
cache_size += dsize;
|
cache_size += dsize;
|
||||||
icon_cache.insert(std::pair <std::string, rawIcon> (filename, tmpIcon));
|
icon_cache.insert(std::pair <std::string, rawIcon> (filename, tmpIcon));
|
||||||
//printf("Cached %s, cache size %d\n", newname.c_str(), cache_size);
|
//printf("Cached %s, cache size %d\n", newname.c_str(), cache_size);
|
||||||
|
}else{
|
||||||
|
freeicondata = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
data = it->second.data;
|
data = it->second.data;
|
||||||
@@ -912,9 +915,13 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in
|
|||||||
//printf("paintIcon: already cached %s %d x %d\n", newname.c_str(), width, height);
|
//printf("paintIcon: already cached %s %d x %d\n", newname.c_str(), width, height);
|
||||||
}
|
}
|
||||||
_display:
|
_display:
|
||||||
if(!paint)
|
if(!paint){
|
||||||
|
if(freeicondata){
|
||||||
|
free(data);
|
||||||
|
data = NULL;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
if (h != 0)
|
if (h != 0)
|
||||||
yy += (h - height) / 2;
|
yy += (h - height) / 2;
|
||||||
|
|
||||||
@@ -1383,7 +1390,7 @@ void CFrameBuffer::useBackground(bool ub)
|
|||||||
useBackgroundPaint = ub;
|
useBackgroundPaint = ub;
|
||||||
if(!useBackgroundPaint) {
|
if(!useBackgroundPaint) {
|
||||||
delete[] background;
|
delete[] background;
|
||||||
background=0;
|
background=NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1406,10 +1413,11 @@ void CFrameBuffer::saveBackgroundImage(void)
|
|||||||
|
|
||||||
void CFrameBuffer::restoreBackgroundImage(void)
|
void CFrameBuffer::restoreBackgroundImage(void)
|
||||||
{
|
{
|
||||||
fb_pixel_t * tmp = background;
|
fb_pixel_t * tmp = NULL;
|
||||||
|
|
||||||
if (backupBackground != NULL)
|
if (backupBackground != NULL)
|
||||||
{
|
{
|
||||||
|
tmp = background;
|
||||||
background = backupBackground;
|
background = backupBackground;
|
||||||
backupBackground = NULL;
|
backupBackground = NULL;
|
||||||
}
|
}
|
||||||
|
137
src/neutrino.cpp
137
src/neutrino.cpp
@@ -229,9 +229,6 @@ CNeutrinoFonts * neutrinoFonts = NULL;
|
|||||||
bool parentallocked = false;
|
bool parentallocked = false;
|
||||||
static char **global_argv;
|
static char **global_argv;
|
||||||
|
|
||||||
/* hack until we have real platform abstraction... */
|
|
||||||
static bool can_deepstandby = false;
|
|
||||||
|
|
||||||
extern const char * locale_real_names[]; /* #include <system/locals_intern.h> */
|
extern const char * locale_real_names[]; /* #include <system/locals_intern.h> */
|
||||||
|
|
||||||
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
@@ -2291,7 +2288,6 @@ TIMER_START();
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
g_info.hw_caps = get_hwcaps();
|
g_info.hw_caps = get_hwcaps();
|
||||||
can_deepstandby = g_info.hw_caps->can_shutdown;
|
|
||||||
|
|
||||||
g_Locale = new CLocaleManager;
|
g_Locale = new CLocaleManager;
|
||||||
|
|
||||||
@@ -3911,6 +3907,7 @@ extern bool timer_is_rec;//timermanager.cpp
|
|||||||
|
|
||||||
void CNeutrinoApp::ExitRun(int can_shutdown)
|
void CNeutrinoApp::ExitRun(int can_shutdown)
|
||||||
{
|
{
|
||||||
|
/* can_shutdown is actually our exit code */
|
||||||
printf("[neutrino] %s can_shutdown: %d\n", __func__, can_shutdown);
|
printf("[neutrino] %s can_shutdown: %d\n", __func__, can_shutdown);
|
||||||
|
|
||||||
bool do_shutdown = true;
|
bool do_shutdown = true;
|
||||||
@@ -4048,70 +4045,76 @@ void CNeutrinoApp::ExitRun(int can_shutdown)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#endif
|
delete g_RCInput;
|
||||||
int leds = 0;
|
my_system("/etc/init.d/rcK");
|
||||||
int bright = 0;
|
//fan speed
|
||||||
#if HAVE_COOL_HARDWARE
|
if (g_info.hw_caps->has_fan)
|
||||||
if (can_shutdown) {
|
CFanControlNotifier::setSpeed(0);
|
||||||
leds = 0x40;
|
stop_video();
|
||||||
switch (g_settings.led_deep_mode){
|
Cleanup();
|
||||||
case 0:
|
//_exit(0);
|
||||||
leds = 0x0;//off leds
|
exit(0);
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
leds = 0x60;//on led1 & 2
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
leds = 0x20;//led1 on , 2 off
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
leds = 0x40;//led2 off, 2 on
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (leds && g_settings.led_blink && timer_minutes)
|
|
||||||
leds |= 0x80;
|
|
||||||
}
|
|
||||||
if (cs_get_revision() != 10)
|
|
||||||
bright = g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS];
|
|
||||||
#endif
|
|
||||||
if (timer_minutes || leds)
|
|
||||||
{
|
|
||||||
FILE *f = fopen("/tmp/.timer", "w");
|
|
||||||
if (f)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "timer_wakeup: %ld\n", timer_minutes * 60);
|
|
||||||
fprintf(f, "%ld\n", timer_minutes * 60);
|
|
||||||
fprintf(f, "%d\n", leds);
|
|
||||||
fprintf(f, "%d\n", bright);
|
|
||||||
fclose(f);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
perror("fopen /tmp/.timer");
|
|
||||||
}
|
|
||||||
|
|
||||||
delete g_RCInput;
|
|
||||||
g_RCInput = NULL;
|
|
||||||
//fan speed
|
|
||||||
if (g_info.hw_caps->has_fan) {
|
|
||||||
CFanControlNotifier::setSpeed(0);
|
|
||||||
}
|
|
||||||
//CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_REBOOT));
|
|
||||||
delete CVFD::getInstance();
|
|
||||||
delete SHTDCNT::getInstance();
|
|
||||||
stop_video();
|
|
||||||
|
|
||||||
printf("[neutrino] This is the end. exiting with code %d\n", can_shutdown);
|
|
||||||
Cleanup();
|
|
||||||
#ifdef __sh__
|
|
||||||
/* the sh4 gcc seems to dislike someting about openthreads... */
|
|
||||||
_exit(can_shutdown);
|
|
||||||
#else
|
|
||||||
exit(can_shutdown);
|
|
||||||
#endif
|
|
||||||
#if 0
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
int leds = 0;
|
||||||
|
int bright = 0;
|
||||||
|
#if HAVE_COOL_HARDWARE
|
||||||
|
if (can_shutdown) {
|
||||||
|
leds = 0x40;
|
||||||
|
switch (g_settings.led_deep_mode){
|
||||||
|
case 0:
|
||||||
|
leds = 0x0;//off leds
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
leds = 0x60;//on led1 & 2
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
leds = 0x20;//led1 on , 2 off
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
leds = 0x40;//led2 off, 2 on
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (leds && g_settings.led_blink && timer_minutes)
|
||||||
|
leds |= 0x80;
|
||||||
|
}
|
||||||
|
if (cs_get_revision() != 10)
|
||||||
|
bright = g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS];
|
||||||
|
#endif
|
||||||
|
if (timer_minutes || leds)
|
||||||
|
{
|
||||||
|
FILE *f = fopen("/tmp/.timer", "w");
|
||||||
|
if (f)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "timer_wakeup: %ld\n", timer_minutes * 60);
|
||||||
|
fprintf(f, "%ld\n", timer_minutes * 60);
|
||||||
|
fprintf(f, "%d\n", leds);
|
||||||
|
fprintf(f, "%d\n", bright);
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
perror("fopen /tmp/.timer");
|
||||||
|
}
|
||||||
|
|
||||||
|
delete g_RCInput;
|
||||||
|
g_RCInput = NULL;
|
||||||
|
//fan speed
|
||||||
|
if (g_info.hw_caps->has_fan)
|
||||||
|
CFanControlNotifier::setSpeed(0);
|
||||||
|
//CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_REBOOT));
|
||||||
|
delete CVFD::getInstance();
|
||||||
|
delete SHTDCNT::getInstance();
|
||||||
|
stop_video();
|
||||||
|
|
||||||
|
printf("[neutrino] This is the end. exiting with code %d\n", can_shutdown);
|
||||||
|
Cleanup();
|
||||||
|
#ifdef __sh__
|
||||||
|
/* the sh4 gcc seems to dislike someting about openthreads... */
|
||||||
|
_exit(can_shutdown);
|
||||||
|
#else
|
||||||
|
exit(can_shutdown);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user