mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 17:31:20 +02:00
- pick graphlcd support from DDT but include it in another way
Conflicts: src/driver/Makefile.am src/driver/nglcd.cpp src/gui/Makefile.am src/gui/bouquetlist.cpp src/gui/channellist.cpp src/gui/osd_setup.cpp src/gui/widget/menue.cpp src/gui/widget/menue.h src/neutrino.cpp src/system/flashtool.cpp src/system/settings.h Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -52,6 +52,11 @@ libneutrino_driver_a_SOURCES += \
|
||||
lcd4l.cpp
|
||||
endif
|
||||
|
||||
if ENABLE_GRAPHLCD
|
||||
libneutrino_driver_a_SOURCES += \
|
||||
nglcd.cpp
|
||||
endif
|
||||
|
||||
if BOXTYPE_COOL
|
||||
libneutrino_driver_a_SOURCES += \
|
||||
fb_accel_cs_hdx.cpp
|
||||
|
@@ -8,3 +8,6 @@
|
||||
#if HAVE_SPARK_HARDWARE || HAVE_AZBOX_HARDWARE || HAVE_GENERIC_HARDWARE || HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
|
||||
#include <driver/simple_display.h>
|
||||
#endif
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
#include <driver/nglcd.h>
|
||||
#endif
|
||||
|
@@ -131,15 +131,24 @@ void nGLCD::LcdAnalogClock(int posx,int posy,int dia)
|
||||
mAngleInRad = ((6 * tm_) * (2*pi_ / 360));
|
||||
mAngleSave = mAngleInRad;
|
||||
mAngleInRad -= pi_/2;
|
||||
|
||||
#if BOXMODEL_VUUNO4KSE
|
||||
mx_ = int((dia * 0.55 * cos(mAngleInRad)));
|
||||
my_ = int((dia * 0.55 * sin(mAngleInRad)));
|
||||
#else
|
||||
mx_ = int((dia * 0.7 * cos(mAngleInRad)));
|
||||
my_ = int((dia * 0.7 * sin(mAngleInRad)));
|
||||
#endif
|
||||
|
||||
hAngleInRad = ((30 * th_)* (2*pi_ / 360));
|
||||
hAngleInRad += mAngleSave / 12;
|
||||
hAngleInRad -= pi_/2;
|
||||
#if BOXMODEL_VUUNO4KSE
|
||||
hx_ = int((dia * 0.25 * cos(hAngleInRad)));
|
||||
hy_ = int((dia * 0.25 * sin(hAngleInRad)));
|
||||
#else
|
||||
hx_ = int((dia * 0.4 * cos(hAngleInRad)));
|
||||
hy_ = int((dia * 0.4 * sin(hAngleInRad)));
|
||||
#endif
|
||||
|
||||
std::string a_clock = "";
|
||||
|
||||
@@ -248,8 +257,8 @@ void nGLCD::Exec() {
|
||||
}
|
||||
|
||||
if (CNeutrinoApp::getInstance()->recordingstatus) {
|
||||
#if BOXMODEL_VUSOLO4K || BOXMODEL_VUDUO4K || BOXMODEL_VUULTIMO4K
|
||||
for (int bx = 0; bx < 6; bx++) {
|
||||
#if BOXMODEL_VUSOLO4K || BOXMODEL_VUDUO4K || BOXMODEL_VUULTIMO4K || BOXMODEL_VUUNO4KSE || BOXMODEL_VUUNO4K
|
||||
for (int bx = 0; bx < 9; bx++) {
|
||||
#else
|
||||
for (int bx = 0; bx < 3; bx++) {
|
||||
#endif
|
||||
@@ -257,8 +266,8 @@ void nGLCD::Exec() {
|
||||
}
|
||||
} else
|
||||
if (CNeutrinoApp::getInstance()->isMuted()) {
|
||||
#if BOXMODEL_VUSOLO4K || BOXMODEL_VUDUO4K || BOXMODEL_VUULTIMO4K
|
||||
for (int bx = 0; bx < 6; bx++) {
|
||||
#if BOXMODEL_VUSOLO4K || BOXMODEL_VUDUO4K || BOXMODEL_VUULTIMO4K || BOXMODEL_VUUNO4KSE || BOXMODEL_VUUNO4K
|
||||
for (int bx = 0; bx < 9; bx++) {
|
||||
#else
|
||||
for (int bx = 0; bx < 3; bx++) {
|
||||
#endif
|
||||
@@ -593,14 +602,14 @@ void nGLCD::Run(void)
|
||||
bitmap->Clear(GLCD::cColor::Black);
|
||||
ts.tv_sec = 0; // don't wait
|
||||
static CFrameBuffer* fb = CFrameBuffer::getInstance();
|
||||
#if !defined BOXMODEL_VUSOLO4K && !defined BOXMODEL_VUDUO4K && !defined BOXMODEL_VUULTIMO4K
|
||||
#if !BOXMODEL_VUSOLO4K && !BOXMODEL_VUDUO4K && !BOXMODEL_VUULTIMO4K && !BOXMODEL_VUUNO4KSE
|
||||
static int fb_width = fb->getScreenWidth(true);
|
||||
#endif
|
||||
static int fb_height = fb->getScreenHeight(true);
|
||||
static uint32_t *fbp = fb->getFrameBufferPointer();
|
||||
int lcd_width = bitmap->Width();
|
||||
int lcd_height = bitmap->Height();
|
||||
#if BOXMODEL_VUSOLO4K || BOXMODEL_VUDUO4K || BOXMODEL_VUULTIMO4K
|
||||
#if BOXMODEL_VUSOLO4K || BOXMODEL_VUDUO4K || BOXMODEL_VUULTIMO4K || BOXMODEL_VUUNO4KSE
|
||||
unsigned int fb_stride = fb->getStride()/4;
|
||||
if (!showImage(fbp, fb_stride, fb_height, 0, 0, lcd_width, lcd_height, false)) {
|
||||
#else
|
||||
|
137
src/driver/nglcd.h
Normal file
137
src/driver/nglcd.h
Normal file
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
nglcd.h -- Neutrino GraphLCD driver
|
||||
|
||||
Copyright (C) 2012-2014 martii
|
||||
|
||||
License: GPL
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
#ifndef __glcd_h__
|
||||
#define __glcd_h__
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <time.h>
|
||||
#include <string>
|
||||
#include <sys/types.h>
|
||||
#include <semaphore.h>
|
||||
#include <zapit/include/zapit/client/zapittypes.h>
|
||||
#include <neutrinoMessages.h>
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#include <glcdgraphics/bitmap.h>
|
||||
#include <glcdgraphics/font.h>
|
||||
#include <glcddrivers/config.h>
|
||||
#include <glcddrivers/driver.h>
|
||||
#include <glcddrivers/drivers.h>
|
||||
#pragma GCC diagnostic warning "-Wunused-parameter"
|
||||
|
||||
class nGLCD
|
||||
{
|
||||
private:
|
||||
GLCD::cDriver * lcd;
|
||||
GLCD::cFont font_channel;
|
||||
GLCD::cFont font_epg;
|
||||
GLCD::cFont font_time;
|
||||
GLCD::cFont font_time_standby;
|
||||
int fontsize_channel;
|
||||
int fontsize_epg;
|
||||
int fontsize_time;
|
||||
int fontsize_time_standby;
|
||||
int percent_channel;
|
||||
int percent_time;
|
||||
int percent_time_standby;
|
||||
int percent_epg;
|
||||
int percent_bar;
|
||||
int percent_logo;
|
||||
int percent_space;
|
||||
GLCD::cBitmap * bitmap;
|
||||
std::string Channel;
|
||||
std::string Epg;
|
||||
std::string stagingChannel;
|
||||
std::string stagingEpg;
|
||||
t_channel_id channel_id;
|
||||
int Scale;
|
||||
time_t now;
|
||||
struct tm *tm;
|
||||
int EpgWidth;
|
||||
int ChannelWidth;
|
||||
int scrollEpgSkip;
|
||||
int scrollChannelSkip;
|
||||
int scrollEpgOffset;
|
||||
int scrollChannelOffset;
|
||||
bool scrollEpgForward;
|
||||
bool scrollChannelForward;
|
||||
bool blitFlag;
|
||||
bool channelLocked;
|
||||
bool doRescan;
|
||||
bool doSuspend;
|
||||
bool doStandby;
|
||||
bool doStandbyTime;
|
||||
bool doExit;
|
||||
bool doScrollChannel;
|
||||
bool doScrollEpg;
|
||||
bool doShowVolume;
|
||||
bool doMirrorOSD;
|
||||
bool fonts_initialized;
|
||||
pthread_t thrGLCD;
|
||||
pthread_mutex_t mutex;
|
||||
sem_t sem;
|
||||
void updateFonts();
|
||||
bool showImage(fb_pixel_t *s,
|
||||
uint32_t sw, uint32_t sh,
|
||||
uint32_t dx, uint32_t dy, uint32_t dw, uint32_t dh,
|
||||
bool transp = false, bool maximize = false);
|
||||
bool showImage(const std::string & filename,
|
||||
uint32_t sw, uint32_t sh,
|
||||
uint32_t dx, uint32_t dy, uint32_t dw, uint32_t dh,
|
||||
bool transp = false, bool maximize = false);
|
||||
bool showImage(uint64_t channel_id, std::string ChannelName,
|
||||
uint32_t dx, uint32_t dy, uint32_t dw, uint32_t dh,
|
||||
bool transp = false, bool maximize = false);
|
||||
bool getBoundingBox(uint32_t *buffer,
|
||||
int width, int height,
|
||||
int &bb_x, int &bb_y, int &bb_width, int &bb_height);
|
||||
void LcdAnalogClock(int posx,int posy,int dia);
|
||||
void Exec();
|
||||
void Run(void);
|
||||
static void* Run(void *);
|
||||
static void Lock();
|
||||
static void Unlock();
|
||||
public:
|
||||
nGLCD();
|
||||
~nGLCD();
|
||||
void DeInit();
|
||||
void Rescan();
|
||||
static nGLCD *getInstance();
|
||||
static void lockChannel(std::string txt, std::string epg = "", int scale = 0);
|
||||
static void unlockChannel();
|
||||
static void MirrorOSD(bool b = true);
|
||||
static void Update();
|
||||
static void Suspend();
|
||||
static void StandbyMode(bool);
|
||||
static void ShowVolume(bool);
|
||||
static void Resume();
|
||||
static void Exit();
|
||||
static void Blit();
|
||||
static void SetBrightness(unsigned int b);
|
||||
void UpdateBrightness();
|
||||
int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data);
|
||||
};
|
||||
#endif
|
||||
#endif
|
@@ -49,7 +49,7 @@
|
||||
#include <system/fsmounter.h>
|
||||
#include <system/helpers.h>
|
||||
|
||||
|
||||
#include <driver/display.h>
|
||||
#include <driver/record.h>
|
||||
#include <driver/radiotext.h>
|
||||
#include <driver/streamts.h>
|
||||
@@ -1088,6 +1088,9 @@ bool CRecordManager::Record(const CTimerd::RecordingInfo * const eventinfo, cons
|
||||
t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID();
|
||||
if(eventinfo->channel_id == live_channel_id)
|
||||
recordingstatus = 1;
|
||||
#endif
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
nGLCD::Update();
|
||||
#endif
|
||||
} else {
|
||||
delete inst;
|
||||
@@ -1290,6 +1293,9 @@ bool CRecordManager::Stop(const CTimerd::RecordingStopInfo * recinfo)
|
||||
if(inst != NULL && recinfo->eventID == inst->GetRecordingId()) {
|
||||
StopInstance(inst, false);
|
||||
ret = true;
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
nGLCD::Update();
|
||||
#endif
|
||||
} else {
|
||||
for(nextmap_iterator_t it = nextmap.begin(); it != nextmap.end(); it++) {
|
||||
if((*it)->eventID == recinfo->eventID) {
|
||||
|
@@ -173,6 +173,9 @@ void CVolume::setVolume(const neutrino_msg_t key)
|
||||
}
|
||||
}
|
||||
g_settings.current_volume = v;
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
nGLCD::ShowVolume(true);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (msg == CRCInput::RC_home)
|
||||
@@ -207,6 +210,9 @@ void CVolume::setVolume(const neutrino_msg_t key)
|
||||
}
|
||||
} while (msg != CRCInput::RC_timeout);
|
||||
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
nGLCD::ShowVolume(false);
|
||||
#endif
|
||||
hideVolscale();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user