mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 07:22:57 +02:00
glcd: remove unnecessary defines; count arrays automatically; fix path to icons
Origin commit data
------------------
Branch: ni/coolstream
Commit: ba17126f8e
Author: vanhofen <vanhofen@gmx.de>
Date: 2020-06-23 (Tue, 23 Jun 2020)
Origin message was:
------------------
- glcd: remove unnecessary defines; count arrays automatically; fix path to icons
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -38,28 +38,29 @@ enum files
|
||||
ANALOG_MIN = 2
|
||||
};
|
||||
|
||||
const char * const file_name[LCD_NUMBER_OF_FILES] =
|
||||
const char * const file_name[] =
|
||||
{
|
||||
"analog_clock",
|
||||
"analog_hour",
|
||||
"analog_min"
|
||||
};
|
||||
#define LCD_NUMBER_OF_FILES (sizeof(file_name)/sizeof(file_name[0]))
|
||||
|
||||
#define NUMBER_OF_PATHS 2
|
||||
const char * const file_path[NUMBER_OF_PATHS] =
|
||||
const char * const file_path[] =
|
||||
{
|
||||
LCDDIR_VAR "/oled/clock/",
|
||||
DATADIR "/oled/clock/"
|
||||
ICONSDIR "/oled/clock/",
|
||||
ICONSDIR_VAR "/oled/clock/"
|
||||
};
|
||||
#define NUMBER_OF_PATHS (sizeof(file_path)/sizeof(file_path[0]))
|
||||
|
||||
static std::string file[LCD_NUMBER_OF_FILES] = {""};
|
||||
|
||||
void InitAnalogClock(void)
|
||||
{
|
||||
for (int i = 0; i < LCD_NUMBER_OF_FILES; i++)
|
||||
for (unsigned int i = 0; i < LCD_NUMBER_OF_FILES; i++)
|
||||
{
|
||||
std::string tmp_file;
|
||||
for (int j = 0; j < NUMBER_OF_PATHS; j++)
|
||||
for (unsigned int j = 0; j < NUMBER_OF_PATHS; j++)
|
||||
{
|
||||
std::string file_jpg = file_path[j];
|
||||
file_jpg += file_name[i];
|
||||
|
@@ -25,10 +25,6 @@
|
||||
|
||||
#include "glcd.h"
|
||||
|
||||
#define LCDDIR_VAR "/usr/share/tuxbox/neutrino/icons"
|
||||
|
||||
#define LCD_NUMBER_OF_FILES 3
|
||||
|
||||
void InitAnalogClock();
|
||||
void RenderClock(int x, int y);
|
||||
void RenderHands(int hour, int min, int sec, int posx, int posy, int hour_size, int min_size, int sec_size);
|
||||
|
@@ -47,7 +47,7 @@ enum digits
|
||||
TIME_DOTS = 10
|
||||
};
|
||||
|
||||
const char * const digit_name[LCD_NUMBER_OF_DIGITS] =
|
||||
const char * const digit_name[] =
|
||||
{
|
||||
"time_zero",
|
||||
"time_one",
|
||||
@@ -61,22 +61,23 @@ const char * const digit_name[LCD_NUMBER_OF_DIGITS] =
|
||||
"time_nine",
|
||||
"time_dots"
|
||||
};
|
||||
#define LCD_NUMBER_OF_DIGITS (sizeof(digit_name)/sizeof(digit_name[0]))
|
||||
|
||||
#define NUMBER_OF_PATHS 2
|
||||
const char * const digit_path[NUMBER_OF_PATHS] =
|
||||
const char * const digit_path[] =
|
||||
{
|
||||
LCDDIR_VAR "/oled/clock/",
|
||||
DATADIR "/oled/clock/"
|
||||
ICONSDIR "/oled/clock/",
|
||||
ICONSDIR_VAR "/oled/clock/"
|
||||
};
|
||||
#define NUMBER_OF_PATHS (sizeof(digit_path)/sizeof(digit_path[0]))
|
||||
|
||||
static std::string digit[LCD_NUMBER_OF_DIGITS] = {""};
|
||||
|
||||
void InitDigitalClock(void)
|
||||
{
|
||||
for (int i = 0; i < LCD_NUMBER_OF_DIGITS; i++)
|
||||
for (unsigned int i = 0; i < LCD_NUMBER_OF_DIGITS; i++)
|
||||
{
|
||||
std::string digit_file;
|
||||
for (int j = 0; j < NUMBER_OF_PATHS; j++)
|
||||
for (unsigned int j = 0; j < NUMBER_OF_PATHS; j++)
|
||||
{
|
||||
std::string file_jpg = digit_path[j];
|
||||
file_jpg += digit_name[i];
|
||||
|
@@ -28,10 +28,6 @@
|
||||
#pragma GCC diagnostic warning "-Wunused-parameter"
|
||||
#include "glcd.h"
|
||||
|
||||
#define LCDDIR_VAR "/usr/share/tuxbox/neutrino/icons"
|
||||
|
||||
#define LCD_NUMBER_OF_DIGITS 11
|
||||
|
||||
void InitDigitalClock();
|
||||
void RenderTimeDigit(int _digit, int x, int y);
|
||||
void RenderDots(int x, int y);
|
||||
|
@@ -42,7 +42,7 @@ enum weathers
|
||||
//WEATHER_UNKNOWN = 10
|
||||
};
|
||||
|
||||
const char * const weather_name[LCD_NUMBER_OF_WEATHERS] =
|
||||
const char * const weather_name[] =
|
||||
{
|
||||
"clear-day",
|
||||
"clear-night",
|
||||
@@ -56,13 +56,14 @@ const char * const weather_name[LCD_NUMBER_OF_WEATHERS] =
|
||||
"wind",
|
||||
//"unknown"
|
||||
};
|
||||
#define LCD_NUMBER_OF_WEATHERS (sizeof(weather_name)/sizeof(weather_name[0]))
|
||||
|
||||
#define NUMBER_OF_PATHS 2
|
||||
const char * const weather_path[NUMBER_OF_PATHS] =
|
||||
const char * const weather_path[] =
|
||||
{
|
||||
LCDDIR_VAR "/oled/weather/",
|
||||
DATADIR "/oled/weather/"
|
||||
ICONSDIR "/oled/weather/",
|
||||
ICONSDIR_VAR "/oled/weather/"
|
||||
};
|
||||
#define NUMBER_OF_PATHS (sizeof(weather_path)/sizeof(weather_path[0]))
|
||||
|
||||
static bool ForceUpdate = true;
|
||||
static bool fonts_initialized = false;
|
||||
@@ -85,10 +86,10 @@ static std::string st_next_wicon = "";
|
||||
|
||||
void InitWeather(void)
|
||||
{
|
||||
for (int i = 0; i < LCD_NUMBER_OF_WEATHERS; i++)
|
||||
for (unsigned int i = 0; i < LCD_NUMBER_OF_WEATHERS; i++)
|
||||
{
|
||||
std::string weather_file;
|
||||
for (int j = 0; j < NUMBER_OF_PATHS; j++)
|
||||
for (unsigned int j = 0; j < NUMBER_OF_PATHS; j++)
|
||||
{
|
||||
std::string file_jpg = weather_path[j];
|
||||
file_jpg += weather_name[i];
|
||||
|
@@ -28,10 +28,6 @@
|
||||
#pragma GCC diagnostic warning "-Wunused-parameter"
|
||||
#include "glcd.h"
|
||||
|
||||
#define LCDDIR_VAR "/usr/share/tuxbox/neutrino/icons"
|
||||
|
||||
#define LCD_NUMBER_OF_WEATHERS 10
|
||||
|
||||
void InitWeather();
|
||||
void WeatherUpdateFonts();
|
||||
int WeatherNameToNumber(std::string name);
|
||||
|
Reference in New Issue
Block a user