Merge branch 'master' into pu/fb-modules

Origin commit data
------------------
Commit: 0cb26e6e98
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2017-02-12 (Sun, 12 Feb 2017)
This commit is contained in:
Michael Liebmann
2017-02-12 09:24:08 +01:00
32 changed files with 112 additions and 99 deletions

View File

@@ -94,7 +94,7 @@ const CMenuOptionChooser::keyval AUDIOMENU_ANALOGOUT_OPTIONS[AUDIOMENU_ANALOGOUT
{ 2, LOCALE_AUDIOMENU_MONORIGHT }
};
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
#define AUDIOMENU_SRS_OPTION_COUNT 3
#else
#define AUDIOMENU_SRS_OPTION_COUNT 2
@@ -103,7 +103,7 @@ const CMenuOptionChooser::keyval AUDIOMENU_SRS_OPTIONS[AUDIOMENU_SRS_OPTION_COUN
{
{ 0 , LOCALE_AUDIO_SRS_ALGO_LIGHT },
{ 1 , LOCALE_AUDIO_SRS_ALGO_NORMAL },
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
{ 2 , LOCALE_AUDIO_SRS_ALGO_HEAVY }
#endif
};
@@ -229,7 +229,7 @@ int CAudioSetup::showAudioSetup()
audioSettings->addItem(GenericMenuSeparatorLine);
audioSettings->addItem(as_oj_srsonoff);
audioSettings->addItem(as_oj_algo);
#ifndef BOXMODEL_APOLLO
#ifndef BOXMODEL_CS_HD2
audioSettings->addItem(as_oj_noise);
#endif
audioSettings->addItem(as_oj_volrev);
@@ -246,7 +246,7 @@ int CAudioSetup::showAudioSetup()
int res = audioSettings->exec(NULL, "");
selected = audioSettings->getSelected();
delete audioSettings;
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
delete as_oj_noise;
#endif
if (!g_settings.easymenu)

View File

@@ -108,7 +108,7 @@ int CCAMMenuHandler::doMainMenu()
CMenuWidget* cammenu = new CMenuWidget(LOCALE_CI_SETTINGS, NEUTRINO_ICON_SETTINGS);
cammenu->addIntroItems();
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
int fecount = CFEManager::getInstance()->getFrontendCount();
char fename[fecount+1][255];
#endif
@@ -120,7 +120,7 @@ int CCAMMenuHandler::doMainMenu()
cammenu->addItem( new CMenuOptionChooser(LOCALE_CI_IGNORE_MSG, &g_settings.ci_ignore_messages, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
cammenu->addItem( new CMenuOptionChooser(LOCALE_CI_SAVE_PINCODE, &g_settings.ci_save_pincode, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this));
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
CMenuOptionChooser::keyval_ext feselect[fecount+1];
feselect[0].key = -1;
feselect[0].value = NONEXISTANT_LOCALE;

View File

@@ -222,7 +222,7 @@ void CComponentsPicture::initCCItem()
{
float h_ratio = float(height)*100/(float)dy;
width = int(h_ratio*(float)dx/100);
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
if (do_scale && (width > 10 || height > 10))
width = GetWidth4FB_HW_ACC(x+fr_thickness, width-2*fr_thickness)+2*fr_thickness;
#endif

View File

@@ -1789,7 +1789,7 @@ void CMoviePlayerGui::addAudioFormat(int count, std::string &apidtitle, bool& en
case 6: /*DTS*/
if (apidtitle.find("DTS") == std::string::npos)
apidtitle.append(" (DTS)");
#ifndef BOXMODEL_APOLLO
#ifndef BOXMODEL_CS_HD2
enabled = false;
#endif
break;

View File

@@ -90,7 +90,7 @@ extern int allow_flash;
#define FILEBROWSER_UPDATE_FILTER "img"
#define MTD_OF_WHOLE_IMAGE 0
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
#define MTD_DEVICE_OF_UPDATE_PART "/dev/mtd0"
#else
#define MTD_DEVICE_OF_UPDATE_PART "/dev/mtd3"
@@ -321,7 +321,7 @@ bool CFlashUpdate::selectHttpImage(void)
newVersion = versions[selected];
file_md5 = md5s[selected];
fileType = fileTypes[selected];
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
if(fileType < '3') {
int esize = CMTDInfo::getInstance()->getMTDEraseSize(sysfs);
printf("[update] erase size is %x\n", esize);
@@ -556,7 +556,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
#endif
if(fileType < '3') {
//flash it...
#ifndef BOXMODEL_APOLLO
#ifndef BOXMODEL_CS_HD2
if (g_settings.apply_settings) {
if (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_APPLY_SETTINGS), CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) == CMsgBox::mbrYes)
if (!CExtUpdate::getInstance()->applySettings(filename, CExtUpdate::MODE_SOFTUPDATE)) {
@@ -624,7 +624,7 @@ CFlashExpert::CFlashExpert()
{
selectedMTD = -1;
width = 40;
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
forceOtherFilename = false;
otherFilename = "";
createimage_other = 0;
@@ -641,7 +641,7 @@ CFlashExpert* CFlashExpert::getInstance()
bool CFlashExpert::checkSize(int mtd, std::string &backupFile)
{
#ifndef BOXMODEL_APOLLO
#ifndef BOXMODEL_CS_HD2
if (mtd < 0) return false;
#endif
char errMsg[1024] = {0};
@@ -655,7 +655,7 @@ bool CFlashExpert::checkSize(int mtd, std::string &backupFile)
uint64_t btotal = 0, bused = 0;
long bsize = 0;
uint64_t backupRequiredSize = 0;
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
if (mtd == -1) { // check disk space for image creation
if (!get_fs_usage("/", btotal, bused, &bsize)) {
snprintf(errMsg, sizeof(errMsg)-1, g_Locale->getText(LOCALE_FLASHUPDATE_READ_VOLUME_ERROR), "root0");
@@ -691,7 +691,7 @@ bool CFlashExpert::checkSize(int mtd, std::string &backupFile)
return true;
}
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
bool CFlashExpert::readDevtableFile(std::string &devtableFile, CMkfsJFFS2::v_devtable_t &v_devtable)
{
FILE *fd = fopen(devtableFile.c_str(), "r");
@@ -775,7 +775,7 @@ void CFlashExpert::readmtd(int preadmtd)
netGetHostname(hostName);
std::string timeStr = getNowTimeStr("_%Y%m%d_%H%M");
std::string tankStr = "";
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
int eSize = CMTDInfo::getInstance()->getMTDEraseSize(CMTDInfo::getInstance()->findMTDsystem());
if (preadmtd == 0) {
if (createimage_other == 0) {
@@ -793,7 +793,7 @@ void CFlashExpert::readmtd(int preadmtd)
else
filename = (std::string)g_settings.update_dir + "/" + mtdInfo->getMTDName(preadmtd) + timeStr + tankStr + ".img";
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
std::string title = " (" + CMTDInfo::getInstance()->getMTDName(preadmtd) + ")";
std::string mountp = getJFFS2MountPoint(preadmtd);
if (preadmtd == 0) {
@@ -817,7 +817,7 @@ void CFlashExpert::readmtd(int preadmtd)
}
bool skipCheck = false;
#ifndef BOXMODEL_APOLLO
#ifndef BOXMODEL_CS_HD2
if ((std::string)g_settings.update_dir == "/tmp")
skipCheck = true;
#else
@@ -845,7 +845,7 @@ void CFlashExpert::readmtd(int preadmtd)
sprintf(message, g_Locale->getText(LOCALE_FLASHUPDATE_SAVESUCCESS), filename.c_str());
sleep(1);
hide();
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
if (!forceOtherFilename)
ShowHint(LOCALE_MESSAGEBOX_INFO, message);
#else
@@ -907,7 +907,7 @@ int CFlashExpert::showMTDSelector(const std::string & actionkey)
for(int lx=0;lx<mtdInfo->getMTDCount();lx++) {
char sActionKey[20];
bool enabled = true;
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
// disable write uboot / uldr / env
if ((actionkey == "writemtd") && (lx == mtdInfo->findMTDNumberFromName("u-boot") ||
lx == mtdInfo->findMTDNumberFromName("uldr") ||
@@ -930,7 +930,7 @@ int CFlashExpert::showMTDSelector(const std::string & actionkey)
sprintf(sActionKey, "%s%d", actionkey.c_str(), lx);
mtdselector->addItem(new CMenuForwarder(mtdInfo->getMTDName(lx).c_str(), enabled, NULL, this, sActionKey, CRCInput::convertDigitToKey(shortcut++)));
}
#ifndef BOXMODEL_APOLLO
#ifndef BOXMODEL_CS_HD2
if (actionkey == "writemtd")
mtdselector->addItem(new CMenuForwarder("systemFS with settings", true, NULL, this, "writemtd10", CRCInput::convertDigitToKey(shortcut++)));
#endif
@@ -1019,7 +1019,7 @@ int CFlashExpert::exec(CMenuTarget* parent, const std::string & actionKey)
return res;
}
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
CFlashExpertSetup::CFlashExpertSetup()
{
width = 40;
@@ -1187,4 +1187,4 @@ g_settings.flashupdate_createimage_add_spare = 0;
cfe->createimage_other = 0;
return res;
}
#endif // BOXMODEL_APOLLO
#endif // BOXMODEL_CS_HD2

View File

@@ -38,7 +38,8 @@
#include <gui/widget/progresswindow.h>
#ifdef BOXMODEL_APOLLO
#include <driver/framebuffer.h>
#ifdef BOXMODEL_CS_HD2
#include <system/mtdutils/mkfs.jffs2.h>
#endif
@@ -80,13 +81,13 @@ class CFlashExpert : public CProgressWindow
int showFileSelector(const std::string & actionkey);
bool checkSize(int mtd, std::string &backupFile);
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
bool readDevtableFile(std::string &devtableFile, CMkfsJFFS2::v_devtable_t &v_devtable);
void readmtdJFFS2(std::string &filename, std::string title="", std::string path="/", bool makeDevTable=true);
#endif
public:
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
bool forceOtherFilename;
std::string otherFilename;
int createimage_other;
@@ -99,7 +100,7 @@ class CFlashExpert : public CProgressWindow
};
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
class CFlashExpertSetup : public CMenuTarget
{
private:
@@ -114,6 +115,6 @@ class CFlashExpertSetup : public CMenuTarget
int exec(CMenuTarget* parent, const std::string &actionKey);
};
#endif // BOXMODEL_APOLLO
#endif // BOXMODEL_CS_HD2
#endif

View File

@@ -233,7 +233,7 @@ bool CExtUpdate::applySettings()
if (mtdFilename.empty())
return ErrorReset(0, "error system mtd not found");
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
uint64_t mtdSize = 65536*1024; // FIXME hack, mtd size more than free RAM
#else
uint64_t mtdSize = mtdInfo->getMTDSize(mtdFilename);

View File

@@ -124,7 +124,7 @@ int CSoftwareUpdate::showSoftwareUpdate()
#endif
}
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
softUpdate.addItem(GenericMenuSeparatorLine);
if (g_settings.easymenu)

View File

@@ -131,7 +131,7 @@ int CUpdateSettings::initMenu()
CMenuOptionChooser *name_backup = new CMenuOptionChooser(LOCALE_FLASHUPDATE_NAMEMODE2, &g_settings.softupdate_name_mode_backup, SOFTUPDATE_NAME_MODE2_OPTIONS, SOFTUPDATE_NAME_MODE2_OPTION_COUNT, true);
// name_backup->setHint("", LOCALE_MENU_HINT_XXX);
#ifndef BOXMODEL_APOLLO
#ifndef BOXMODEL_CS_HD2
CMenuOptionChooser *apply_settings = new CMenuOptionChooser(LOCALE_FLASHUPDATE_MENU_APPLY_SETTINGS, &g_settings.apply_settings, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, OnOffNotifier);
// apply_settings->setHint("", LOCALE_MENU_HINT_XXX);
@@ -152,7 +152,7 @@ int CUpdateSettings::initMenu()
w_upsettings.addItem(fw_update_dir);
w_upsettings.addItem(fw_url);
w_upsettings.addItem(name_backup);
#ifndef BOXMODEL_APOLLO
#ifndef BOXMODEL_CS_HD2
w_upsettings.addItem(GenericMenuSeparatorLine);
w_upsettings.addItem(apply_settings);
w_upsettings.addItem(name_apply);

View File

@@ -105,7 +105,7 @@ int CVideoSettings::exec(CMenuTarget* parent, const std::string &/*actionKey*/)
const CMenuOptionChooser::keyval VIDEOMENU_43MODE_OPTIONS[] =
{
{ DISPLAY_AR_MODE_PANSCAN, LOCALE_VIDEOMENU_PANSCAN },
#ifndef BOXMODEL_APOLLO
#ifndef BOXMODEL_CS_HD2
{ DISPLAY_AR_MODE_PANSCAN2, LOCALE_VIDEOMENU_PANSCAN2 },
#endif
{ DISPLAY_AR_MODE_LETTERBOX, LOCALE_VIDEOMENU_LETTERBOX },
@@ -197,7 +197,7 @@ CMenuOptionChooser::keyval_ext VIDEOMENU_VIDEOMODE_OPTIONS[VIDEOMENU_VIDEOMODE_O
{ VIDEO_STD_576P, NONEXISTANT_LOCALE, "576p" },
{ VIDEO_STD_720P50, NONEXISTANT_LOCALE, "720p 50Hz" },
{ VIDEO_STD_1080I50, NONEXISTANT_LOCALE, "1080i 50Hz" },
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
{ VIDEO_STD_1080P50, NONEXISTANT_LOCALE, "1080p 50Hz" },
#endif
{ VIDEO_STD_1080P24, NONEXISTANT_LOCALE, "1080p 24Hz" },
@@ -206,7 +206,7 @@ CMenuOptionChooser::keyval_ext VIDEOMENU_VIDEOMODE_OPTIONS[VIDEOMENU_VIDEOMODE_O
{ VIDEO_STD_480P, NONEXISTANT_LOCALE, "480p" },
{ VIDEO_STD_720P60, NONEXISTANT_LOCALE, "720p 60Hz" },
{ VIDEO_STD_1080I60, NONEXISTANT_LOCALE, "1080i 60Hz" },
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
{ VIDEO_STD_1080P60, NONEXISTANT_LOCALE, "1080p 60Hz" },
{ VIDEO_STD_1080P2397, NONEXISTANT_LOCALE, "1080p 23.97Hz"},
{ VIDEO_STD_1080P2997, NONEXISTANT_LOCALE, "1080p 29.97Hz"},
@@ -249,7 +249,7 @@ int CVideoSettings::showVideoSetup()
}
else if (system_rev > 0x06)
{
#if defined(BOXMODEL_APOLLO) && defined(ANALOG_MODE)
#if defined(BOXMODEL_CS_HD2) && defined(ANALOG_MODE)
vs_analg_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_ANALOG_MODE, &g_settings.analog_mode1, VIDEOMENU_VIDEOSIGNAL_HD2_OPTIONS, VIDEOMENU_VIDEOSIGNAL_HD2_OPTION_COUNT, true, this);
vs_analg_ch->setHint("", LOCALE_MENU_HINT_VIDEO_ANALOG_MODE);
#else
@@ -277,7 +277,7 @@ int CVideoSettings::showVideoSetup()
CMenuOptionChooser * vs_dbdropt_ch = NULL;
CMenuForwarder * vs_videomodes_fw = NULL;
CMenuWidget videomodes(LOCALE_MAINSETTINGS_VIDEO, NEUTRINO_ICON_SETTINGS);
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
CMenuForwarder * vs_automodes_fw = NULL;
CMenuWidget automodes(LOCALE_MAINSETTINGS_VIDEO, NEUTRINO_ICON_SETTINGS);
#endif
@@ -296,7 +296,7 @@ int CVideoSettings::showVideoSetup()
vs_videomodes_fw = new CMenuForwarder(LOCALE_VIDEOMENU_ENABLED_MODES, true, NULL, &videomodes, NULL, CRCInput::RC_red);
vs_videomodes_fw->setHint("", LOCALE_MENU_HINT_VIDEO_MODES);
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
automodes.addIntroItems(LOCALE_VIDEOMENU_ENABLED_MODES_AUTO);
for (int i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT - 1; i++)
@@ -325,12 +325,12 @@ int CVideoSettings::showVideoSetup()
if (!g_settings.easymenu) {
videosetup->addItem(vs_dbdropt_ch); //dbdr options
videosetup->addItem(vs_videomodes_fw); //video modes submenue
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
videosetup->addItem(vs_automodes_fw); //video auto modes submenue
#endif
}
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
if (!g_settings.easymenu) {
/* values are from -128 to 127, but brightness really no sense after +/- 40. changeNotify multiply contrast and saturation to 3 */
CMenuOptionNumberChooser * bcont = new CMenuOptionNumberChooser(LOCALE_VIDEOMENU_BRIGHTNESS, &g_settings.brightness, true, -42, 42, this);
@@ -373,7 +373,7 @@ void CVideoSettings::setVideoSettings()
videoDecoder->SetVideoMode((analog_mode_t) g_settings.analog_mode1);
videoDecoder->SetVideoMode((analog_mode_t) g_settings.analog_mode2);
#endif
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
changeNotify(LOCALE_VIDEOMENU_ANALOG_MODE, NULL);
#else
unsigned int system_rev = cs_get_revision();
@@ -398,7 +398,7 @@ void CVideoSettings::setVideoSettings()
videoDecoder->SetDBDR(g_settings.video_dbdr);
CAutoModeNotifier anotify;
anotify.changeNotify(NONEXISTANT_LOCALE, 0);
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
changeNotify(LOCALE_VIDEOMENU_BRIGHTNESS, NULL);
changeNotify(LOCALE_VIDEOMENU_CONTRAST, NULL);
changeNotify(LOCALE_VIDEOMENU_SATURATION, NULL);
@@ -472,7 +472,7 @@ bool CVideoSettings::changeNotify(const neutrino_locale_t OptionName, void * /*
setupVideoSystem(true/*ask*/);
return true;
}
#ifdef BOXMODEL_APOLLO
#ifdef BOXMODEL_CS_HD2
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_BRIGHTNESS))
{
videoDecoder->SetControl(VIDEO_CONTROL_BRIGHTNESS, g_settings.brightness);