From f7e34c0294b6023f159efee50da52eaf8053cbd3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 28 Apr 2014 10:24:36 +0200 Subject: [PATCH 001/511] deutsch.locale: update Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4afc9ceb5a834f3a52beaa9f050ef27bc7b2676a Author: vanhofen Date: 2014-04-28 (Mon, 28 Apr 2014) Origin message was: ------------------ - deutsch.locale: update ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 0b805f2ed..38141f151 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -631,6 +631,8 @@ hdd_fs_unknown unbekannt hdd_manage Laufwerke verwalten hdd_middle Mittel hdd_mount Mount +hdd_mount_ok Laufwerk bereit +hdd_mount_failed Fehler! Überprüfen Sie ihre Laufwerkseinstellungen. hdd_mount_umount Mount/Unmount hdd_noise Akustikkontrolle (AAM) hdd_not_found Keine Festplatte @@ -639,6 +641,7 @@ hdd_settings Laufwerke hdd_sleep Ausschalten nach... hdd_slow Langsam hdd_umount Unmount +hdd_umounted Laufwerk entfernt hdd_umount_warn Laufwerk aushängen imageinfo.creator Ersteller: imageinfo.date Datum: @@ -1070,6 +1073,7 @@ menu.hint_record_apid_alt Sind weitere Tonspuren verfügbar, dann können diese menu.hint_record_apid_std Schließt bei einer Aufnahme die durch den Sender definierte Tonspur 'Standard' in die Aufnahme ein bzw. aus menu.hint_record_apids Konfigurieren Sie die Tonspuren für die Aufnahme menu.hint_record_apply Hiermit werden die Aufnahmeoptionen übernommen +menu.hint_record_auto_cover Automatisch ein Film-Vorschaubild beim Abspielen erzeugen menu.hint_record_chandir Diese Option speichert Aufnahmen mit dem Namen des Kanals in ein eigenes Verzeichnis menu.hint_record_data Daten-Spuren (Teletext, Untertitel) für die Aufnahme menu.hint_record_data_dvbsub Untertitel-Spur zu Aufnahme hinzufügen @@ -1732,6 +1736,7 @@ recordingmenu.apids Tonspuren recordingmenu.apids_ac3 AC3 Tonspuren aufnehmen recordingmenu.apids_alt Alternative Tonspuren aufn. recordingmenu.apids_std Standard Tonspur aufnehmen +recordingmenu.auto_cover Autom. Film-Vorschaubild recordingmenu.data_pids Daten-Spuren recordingmenu.defdir Aufnahmeverzeichnis recordingmenu.dvbsub_pids Untertitel aufnehmen From c679db64e13ffd8b668bb8b25ec977621559023b Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 29 Apr 2014 13:44:43 +0400 Subject: [PATCH 002/511] gui/hdd_menu.cpp: add mount point mkdir, if mdev not used Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ea9e950fd3921a17b21cc41437093a054555afde Author: [CST] Focus Date: 2014-04-29 (Tue, 29 Apr 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/hdd_menu.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index a91545eeb..3036db88d 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -282,7 +282,9 @@ bool CHDDMenuHandler::mount_dev(std::string name) #ifdef ASSUME_MDEV std::string cmd = std::string("ACTION=add") + " MDEV=" + name + " " + MDEV_MOUNT; #else - std::string cmd = std::string("mount ") + "/dev/" + name + " " + MOUNT_BASE + name; + std::string dst = MOUNT_BASE + name; + safe_mkdir(dst.c_str()); + std::string cmd = std::string("mount ") + "/dev/" + name + " " + dst; #endif printf("CHDDMenuHandler::mount_dev: mount cmd [%s]\n", cmd.c_str()); system(cmd.c_str()); From aafd87fd463cac894bc52a981265ee516582bfbc Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 30 Apr 2014 17:15:25 +0400 Subject: [PATCH 003/511] gui/hdd_menu.cpp: add question and show format menu, if plugged device not mounted Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/55167990b5344b8aaaa865942bf11670333f33e7 Author: [CST] Focus Date: 2014-04-30 (Wed, 30 Apr 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/english.locale | 4 +- src/gui/hdd_menu.cpp | 256 +++++++++++++++++++++---------------- src/gui/hdd_menu.h | 3 + src/neutrinoMessages.h | 3 +- 4 files changed, 156 insertions(+), 110 deletions(-) diff --git a/data/locale/english.locale b/data/locale/english.locale index 938aba407..74d0ecbdd 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -623,7 +623,7 @@ hdd_check_failed HDD-check failed! hdd_check_format_bad Checking of disks with format %s is not supported. hdd_extended_settings Extended HDD-Settings hdd_fast Fast -hdd_format Formating drive... +hdd_format Format device hdd_format_failed Formating failed! Make sure device not in use, reboot and try again hdd_format_warn All data on device will be lost ! Continue with format ? hdd_fs Filesystem used to format @@ -632,7 +632,7 @@ hdd_manage Manage drives hdd_middle Mid hdd_mount Mount hdd_mount_ok Device ready to use. -hdd_mount_failed Failed to mount, check HDD settings menu. +hdd_mount_failed Failed to mount. hdd_mount_umount Mount/Unmount hdd_noise Acoustic-control (AAM) hdd_not_found No HDD found diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index 3036db88d..4d1615324 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -102,6 +102,8 @@ CHDDMenuHandler::CHDDMenuHandler() { width = w_max (58, 10); show_menu = false; + in_menu = false; + lock_refresh = false; } CHDDMenuHandler::~CHDDMenuHandler() @@ -128,40 +130,72 @@ int CHDDMenuHandler::filterDevName(const char * name) int CHDDMenuHandler::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data) { - if(msg != NeutrinoMessages::EVT_HOTPLUG) - return messages_return::unhandled; + if (msg == NeutrinoMessages::EVT_HOTPLUG) { + std::string str((char *) data); + std::map smap; - std::string str((char *) data); - std::map smap; + if (!split_config_string(str, smap)) + return messages_return::handled; - if (!split_config_string(str, smap)) + std::map::iterator it = smap.find("MDEV"); + if (it == smap.end()) + return messages_return::handled; + + std::string dev = it->second; + printf("CHDDMenuHandler::handleMsg: MDEV=%s\n", dev.c_str()); + if (!filterDevName(dev.c_str())) + return messages_return::handled; + + it = smap.find("ACTION"); + if (it == smap.end()) + return messages_return::handled; + + bool added = it->second == "add"; + bool mounted = is_mounted(dev.c_str()); + std::string tmp = dev.substr(0, 2); + + if (added && !mounted && tmp != "sr") { + std::string message = dev + ": " + g_Locale->getText(LOCALE_HDD_MOUNT_FAILED); + message += std::string(" ") + g_Locale->getText(LOCALE_HDD_FORMAT) + std::string(" ?"); + int res = ShowMsg(LOCALE_MESSAGEBOX_INFO, message, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo); + if(res == CMessageBox::mbrYes) { + unsigned char * p = new unsigned char[dev.size() + 1]; + if (p) { + sprintf((char *)p, "%s", dev.c_str()); + g_RCInput->postMsg(NeutrinoMessages::EVT_FORMAT_DRIVE , (neutrino_msg_data_t)p); + return messages_return::handled | messages_return::cancel_all; + } + } + } else { + std::string message = dev + ": " + (added ? + g_Locale->getText(mounted ? LOCALE_HDD_MOUNT_OK : LOCALE_HDD_MOUNT_FAILED) + : g_Locale->getText(LOCALE_HDD_UMOUNTED)); + ShowHint(LOCALE_MESSAGEBOX_INFO, message.c_str()); + } + if (in_menu && !lock_refresh) { + show_menu = true; + return messages_return::handled | messages_return::cancel_all; + } + lock_refresh = false; return messages_return::handled; - - std::map::iterator it = smap.find("MDEV"); - if (it == smap.end()) + } + else if (msg == NeutrinoMessages::EVT_FORMAT_DRIVE) { + std::string dev((char *) data); + printf("NeutrinoMessages::EVT_FORMAT_DRIVE: [%s]\n", dev.c_str()); + check_dev_tools(); + getBlkIds(); + scanDevices(); + for (std::map::iterator it = devtitle.begin(); it != devtitle.end(); ++it) { + if (dev.substr(0, it->first.size()) == it->first) { + showDeviceMenu(it->first); + break; + } + } + hdd_list.clear(); + devtitle.clear(); return messages_return::handled; - - std::string dev = it->second; - - it = smap.find("ACTION"); - if (it == smap.end()) - return messages_return::handled; - - bool added = it->second == "add"; - - printf("CHDDMenuHandler::handleMsg: %s MDEV=%s\n", it->second.c_str(), dev.c_str()); - - if (!filterDevName(dev.c_str())) - return messages_return::handled; - - bool mounted = is_mounted(dev.c_str()); - std::string message = dev + ": " + (added ? - g_Locale->getText(mounted ? LOCALE_HDD_MOUNT_OK : LOCALE_HDD_MOUNT_FAILED) - : g_Locale->getText(LOCALE_HDD_UMOUNTED)); - - ShowHint(LOCALE_MESSAGEBOX_INFO, message.c_str()); - - return messages_return::handled; + } + return messages_return::unhandled; } bool CHDDMenuHandler::is_mounted(const char *dev) @@ -201,7 +235,6 @@ void CHDDMenuHandler::getBlkIds() hdd_list.clear(); char buff[512]; while (fgets(buff, sizeof(buff), f)) { - std::string ret = buff; std::string search = "TYPE=\""; size_t pos = ret.find(search); @@ -288,6 +321,7 @@ bool CHDDMenuHandler::mount_dev(std::string name) #endif printf("CHDDMenuHandler::mount_dev: mount cmd [%s]\n", cmd.c_str()); system(cmd.c_str()); + lock_refresh = true; return is_mounted(name.c_str()); } @@ -307,6 +341,7 @@ bool CHDDMenuHandler::umount_dev(std::string name) std::string eject = std::string(EJECT_BIN) + " /dev/" + name; system(eject.c_str()); } + lock_refresh = true; return !is_mounted(name.c_str()); } @@ -340,8 +375,7 @@ bool CHDDMenuHandler::add_dev(std::string dev, std::string part) } return false; } -#endif -#ifdef ASSUME_MDEV + bool CHDDMenuHandler::waitfordev(std::string dev, int maxwait) { int ret = true; @@ -468,67 +502,32 @@ int CHDDMenuHandler::showDeviceMenu(std::string dev) mf->setHint("", LOCALE_MENU_HINT_HDD_FORMAT); hddmenu->addItem(mf); - int res = hddmenu->exec(NULL, ""); delete hddmenu; return res; } -int CHDDMenuHandler::doMenu() +bool CHDDMenuHandler::scanDevices() { struct dirent **namelist; - int ret; struct stat s; int root_dev = -1; - check_dev_tools(); -_show_menu: - bool hdd_found = false; int n = scandir("/sys/block", &namelist, my_filter, alphasort); - if (n < 0) { - perror("CHDDMenuHandler::doMenu: scandir(\"/sys/block\") failed"); - return menu_return::RETURN_REPAINT; + perror("CHDDMenuHandler::scanDevices: scandir(\"/sys/block\") failed"); + return false; } - - CMenuWidget* hddmenu = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_DRIVESETUP); - - hddmenu->addIntroItems(LOCALE_HDD_SETTINGS, LOCALE_HDD_EXTENDED_SETTINGS); - - CHDDDestExec hddexec; - CMenuForwarder * mf = new CMenuForwarder(LOCALE_HDD_ACTIVATE, true, "", &hddexec, NULL, CRCInput::RC_red,NEUTRINO_ICON_BUTTON_RED); - mf->setHint("", LOCALE_MENU_HINT_HDD_APPLY); - hddmenu->addItem(mf); - - CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_HDD_SLEEP, &g_settings.hdd_sleep, HDD_SLEEP_OPTIONS, HDD_SLEEP_OPTION_COUNT, true); - mc->setHint("", LOCALE_MENU_HINT_HDD_SLEEP); - hddmenu->addItem(mc); - - const char hdparm[] = "/sbin/hdparm"; - struct stat stat_buf; - bool have_nonbb_hdparm = !::lstat(hdparm, &stat_buf) && !S_ISLNK(stat_buf.st_mode); - if (have_nonbb_hdparm) { - mc = new CMenuOptionChooser(LOCALE_HDD_NOISE, &g_settings.hdd_noise, HDD_NOISE_OPTIONS, HDD_NOISE_OPTION_COUNT, true); - mc->setHint("", LOCALE_MENU_HINT_HDD_NOISE); - hddmenu->addItem(mc); - } - - hddmenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_HDD_MANAGE)); - - ret = stat("/", &s); - if (ret != -1) + if (stat("/", &s) != -1) root_dev = (s.st_dev & 0x0ffc0); /* hda = 0x0300, hdb = 0x0340 */ printf("HDD: root_dev: 0x%04x\n", root_dev); - getBlkIds(); - for(int i = 0; i < n;i++) { char str[256]; char vendor[128] = { 0 }; char model[128] = { 0 }; int64_t bytes = 0; int64_t megabytes; - int removable = 0; bool isroot = false; printf("HDD: checking /sys/block/%s\n", namelist[i]->d_name); @@ -538,7 +537,7 @@ _show_menu: if (ioctl(fd, BLKGETSIZE64, &bytes)) perror("BLKGETSIZE64"); - ret = fstat(fd, &s); + int ret = fstat(fd, &s); if (ret != -1) { if ((int)(s.st_rdev & 0x0ffc0) == root_dev) { isroot = true; @@ -550,6 +549,8 @@ _show_menu: } else { printf("Cant open %s\n", str); } + if (isroot) + continue; megabytes = bytes/1000000; @@ -576,7 +577,8 @@ _show_menu: fscanf(f, "%s", model); fclose(f); } - +#if 0 + int removable = 0; snprintf(str, sizeof(str), "/sys/block/%s/removable", namelist[i]->d_name); f = fopen(str, "r"); if(!f) { @@ -585,7 +587,7 @@ _show_menu: } fscanf(f, "%d", &removable); fclose(f); - +#endif std::string dev = std::string(namelist[i]->d_name).substr(0, 2); std::string fmt = getFmtType(namelist[i]->d_name); /* epmty cdrom do not appear in blkid output */ @@ -598,24 +600,62 @@ _show_menu: hdd_list.push_back(hdd); } - bool enabled = !CNeutrinoApp::getInstance()->recordingstatus && !isroot && dev != "sr"; - snprintf(str, sizeof(str), "%s %s %ld %s", vendor, model, (long)(megabytes < 10000 ? megabytes : megabytes/1000), megabytes < 10000 ? "MB" : "GB"); printf("HDD: %s\n", str); devtitle[namelist[i]->d_name] = str; - std::string key = "d" + std::string(namelist[i]->d_name); - mf = new CMenuForwarder(namelist[i]->d_name, enabled, devtitle[namelist[i]->d_name], this, key.c_str()); - mf->setHint("", LOCALE_MENU_HINT_HDD_TOOLS); - hddmenu->addItem(mf); - - hdd_found = true; free(namelist[i]); } if (n >= 0) free(namelist); + return !devtitle.empty(); +} - if(!hdd_found) { +int CHDDMenuHandler::doMenu() +{ + show_menu = false; + in_menu = true; + + check_dev_tools(); + +_show_menu: + getBlkIds(); + scanDevices(); + + CMenuWidget* hddmenu = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_DRIVESETUP); + + hddmenu->addIntroItems(LOCALE_HDD_SETTINGS, LOCALE_HDD_EXTENDED_SETTINGS); + + CHDDDestExec hddexec; + CMenuForwarder * mf = new CMenuForwarder(LOCALE_HDD_ACTIVATE, true, "", &hddexec, NULL, CRCInput::RC_red,NEUTRINO_ICON_BUTTON_RED); + mf->setHint("", LOCALE_MENU_HINT_HDD_APPLY); + hddmenu->addItem(mf); + + CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_HDD_SLEEP, &g_settings.hdd_sleep, HDD_SLEEP_OPTIONS, HDD_SLEEP_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_HDD_SLEEP); + hddmenu->addItem(mc); + + const char hdparm[] = "/sbin/hdparm"; + struct stat stat_buf; + bool have_nonbb_hdparm = !::lstat(hdparm, &stat_buf) && !S_ISLNK(stat_buf.st_mode); + if (have_nonbb_hdparm) { + mc = new CMenuOptionChooser(LOCALE_HDD_NOISE, &g_settings.hdd_noise, HDD_NOISE_OPTIONS, HDD_NOISE_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_HDD_NOISE); + hddmenu->addItem(mc); + } + + hddmenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_HDD_MANAGE)); + + for (std::map::iterator it = devtitle.begin(); it != devtitle.end(); ++it) { + std::string dev = it->first.substr(0, 2); + bool enabled = !CNeutrinoApp::getInstance()->recordingstatus && dev != "sr"; + std::string key = "d" + it->first; + mf = new CMenuForwarder(it->first, enabled, it->second, this, key.c_str()); + mf->setHint("", LOCALE_MENU_HINT_HDD_TOOLS); + hddmenu->addItem(mf); + } + + if(devtitle.empty()) { //if no drives found, select 'back' if (hddmenu->getSelected() != -1) hddmenu->setSelected(2); @@ -636,7 +676,7 @@ _show_menu: } } - ret = hddmenu->exec(NULL, ""); + int ret = hddmenu->exec(NULL, ""); delete hddmenu; hdd_list.clear(); @@ -645,6 +685,7 @@ _show_menu: show_menu = false; goto _show_menu; } + in_menu = false; return ret; } @@ -681,7 +722,7 @@ int CHDDMenuHandler::formatDevice(std::string dev) std::string mkfscmd = devtool->mkfs + " " + devtool->mkfs_options + " " + partname; printf("mkfs cmd: [%s]\n", mkfscmd.c_str()); - res = ShowMsg ( LOCALE_HDD_FORMAT, g_Locale->getText(LOCALE_HDD_FORMAT_WARN), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo ); + res = ShowMsg(LOCALE_HDD_FORMAT, g_Locale->getText(LOCALE_HDD_FORMAT_WARN), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo ); if(res != CMessageBox::mbrYes) return menu_return::RETURN_REPAINT; @@ -689,7 +730,6 @@ int CHDDMenuHandler::formatDevice(std::string dev) res = umount_all(dev); printf("CHDDMenuHandler::formatDevice: umount res %d\n", res); - system("df"); // FIXME: debug if(!res) { showError(LOCALE_HDD_UMOUNT_WARN); @@ -728,6 +768,7 @@ int CHDDMenuHandler::formatDevice(std::string dev) f = popen(cmd, "w"); if (!f) { showError(LOCALE_HDD_FORMAT_FAILED); + res = -1; goto _remount; } show_menu = true; @@ -737,7 +778,7 @@ int CHDDMenuHandler::formatDevice(std::string dev) printf("CHDDMenuHandler::formatDevice: (s)fdisk res: %d\n", res); if (res) { showError(LOCALE_HDD_FORMAT_FAILED); - goto _return; + goto _remount; } sleep(2); #ifdef ASSUME_MDEV @@ -749,6 +790,7 @@ int CHDDMenuHandler::formatDevice(std::string dev) f = popen(mkfscmd.c_str(), "r"); if (!f) { showError(LOCALE_HDD_FORMAT_FAILED); + res = -1; goto _remount; } @@ -818,7 +860,7 @@ int CHDDMenuHandler::formatDevice(std::string dev) progress->showGlobalStatus(100); if (res) { showError(LOCALE_HDD_FORMAT_FAILED); - goto _return; + goto _remount; } sleep(2); @@ -833,7 +875,6 @@ _remount: progress->hide(); delete progress; - //getBlkIds(); #ifdef ASSUME_MDEV unlink("/tmp/.nomdevmount"); #else @@ -843,24 +884,25 @@ _remount: fclose(f); } #endif - res = mount_dev(devpart); - system("df"); // FIXME: debug + if (!res) { + res = mount_dev(devpart); - if(res) { - std::string dst = MOUNT_BASE + devpart; - snprintf(cmd, sizeof(cmd), "%s/movies", dst.c_str()); - safe_mkdir(cmd); - snprintf(cmd, sizeof(cmd), "%s/pictures", dst.c_str()); - safe_mkdir(cmd); - snprintf(cmd, sizeof(cmd), "%s/epg", dst.c_str()); - safe_mkdir(cmd); - snprintf(cmd, sizeof(cmd), "%s/music", dst.c_str()); - safe_mkdir(cmd); - snprintf(cmd, sizeof(cmd), "%s/logos", dst.c_str()); - safe_mkdir(cmd); - snprintf(cmd, sizeof(cmd), "%s/plugins", dst.c_str()); - safe_mkdir(cmd); - sync(); + if(res) { + std::string dst = MOUNT_BASE + devpart; + snprintf(cmd, sizeof(cmd), "%s/movies", dst.c_str()); + safe_mkdir(cmd); + snprintf(cmd, sizeof(cmd), "%s/pictures", dst.c_str()); + safe_mkdir(cmd); + snprintf(cmd, sizeof(cmd), "%s/epg", dst.c_str()); + safe_mkdir(cmd); + snprintf(cmd, sizeof(cmd), "%s/music", dst.c_str()); + safe_mkdir(cmd); + snprintf(cmd, sizeof(cmd), "%s/logos", dst.c_str()); + safe_mkdir(cmd); + snprintf(cmd, sizeof(cmd), "%s/plugins", dst.c_str()); + safe_mkdir(cmd); + sync(); + } } _return: if (!srun) my_system(1, "smbd"); diff --git a/src/gui/hdd_menu.h b/src/gui/hdd_menu.h index 97cc6b447..9a244394a 100644 --- a/src/gui/hdd_menu.h +++ b/src/gui/hdd_menu.h @@ -53,6 +53,8 @@ class CHDDMenuHandler : public CMenuTarget std::string mount; std::string umount; bool show_menu; + bool in_menu; + bool lock_refresh; std::map devtitle; struct hdd_s { std::string devname; @@ -88,6 +90,7 @@ class CHDDMenuHandler : public CMenuTarget int checkDevice(std::string dev); int formatDevice(std::string dev); void showError(neutrino_locale_t err); + bool scanDevices(); CHDDMenuHandler(); public: diff --git a/src/neutrinoMessages.h b/src/neutrinoMessages.h index a6a72efac..aa8996d3c 100644 --- a/src/neutrinoMessages.h +++ b/src/neutrinoMessages.h @@ -160,7 +160,8 @@ struct NeutrinoMessages { EVT_EIT_COMPLETE = CRCInput::RC_WithData + 24, /* data: (t_channel_id *) */ EVT_BACK_ZAP_COMPLETE = CRCInput::RC_WithData + 25, /* data: (t_channel_id *) */ - EVT_HOTPLUG = CRCInput::RC_WithData + 26 /* data: char */ + EVT_HOTPLUG = CRCInput::RC_WithData + 26, /* data: char */ + EVT_FORMAT_DRIVE = CRCInput::RC_WithData + 27 /* data: char */ }; enum { From c5e8e2fe812b6d9ca7bcd246d2b9695ab1f6aa2c Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 1 May 2014 17:30:50 +0400 Subject: [PATCH 004/511] gui/record_setup.cpp: avoid set empty timeshift dir Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/858fbd217edc6b7e4bcdea04a4470ddedfe6aca5 Author: [CST] Focus Date: 2014-05-01 (Thu, 01 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/record_setup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index 3b6b19c7f..905ae232c 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -97,8 +97,8 @@ int CRecordSetup::exec(CMenuTarget* parent, const std::string &actionKey) timeshiftDir = g_settings.network_nfs_recordingdir + "/.timeshift"; safe_mkdir(timeshiftDir.c_str()); printf("New timeshift dir: %s\n", timeshiftDir.c_str()); + CRecordManager::getInstance()->SetTimeshiftDirectory(timeshiftDir); } - CRecordManager::getInstance()->SetTimeshiftDirectory(timeshiftDir); } return res; } From 9cb877726e53a643102f9765f8c366df2a66b38d Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 1 May 2014 17:31:29 +0400 Subject: [PATCH 005/511] gui/widget/menue.cpp: show right-side item icon for inactive items, too Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4d0cacbd614e00203a51f2617d9af63422392f7d Author: [CST] Focus Date: 2014-05-01 (Thu, 01 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index c04adfa95..8e8b41780 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -287,7 +287,7 @@ void CMenuItem::paintItemButton(const bool select_mode, const int &item_height, { frameBuffer->getIconSize(iconName_Info_right.c_str(), &icon_w, &icon_h); - if (active && icon_w>0 && icon_h>0) + if (/* active && */ icon_w>0 && icon_h>0) icon_painted = frameBuffer->paintIcon(iconName_Info_right, dx + icon_start_x - (icon_w + 20), y+ ((item_height/2- icon_h/2)) ); } } From d7916224b17a256730c07f46b91bc922fdba24ff Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 1 May 2014 17:48:51 +0400 Subject: [PATCH 006/511] gui/record_setup.cpp: now, with mount/umount menu, disable directory switch, if record is running Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bbf0a95542b326d1c3f6bfdfc961cf662f78eb70 Author: [CST] Focus Date: 2014-05-01 (Thu, 01 May 2014) ------------------ This commit was generated by Migit --- src/gui/record_setup.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index 905ae232c..924a7e007 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -201,12 +201,13 @@ int CRecordSetup::showRecordSetup() recordingSettings->addItem(mf); } + bool recstatus = CNeutrinoApp::getInstance()->recordingstatus; //record dir CMenuForwarder* fRecDir; if (g_settings.easymenu) - fRecDir = new CMenuForwarder(LOCALE_RECORDINGMENU_DEFDIR, true, g_settings.network_nfs_recordingdir, this, "recordingdir", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW); + fRecDir = new CMenuForwarder(LOCALE_RECORDINGMENU_DEFDIR, !recstatus, g_settings.network_nfs_recordingdir, this, "recordingdir", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW); else - fRecDir = new CMenuForwarder(LOCALE_RECORDINGMENU_DEFDIR, true, g_settings.network_nfs_recordingdir, this, "recordingdir"); + fRecDir = new CMenuForwarder(LOCALE_RECORDINGMENU_DEFDIR, !recstatus, g_settings.network_nfs_recordingdir, this, "recordingdir"); fRecDir->setHint("", LOCALE_MENU_HINT_RECORD_DIR); recordingSettings->addItem(fRecDir); @@ -376,7 +377,8 @@ void CRecordSetup::showRecordTimeShiftSetup(CMenuWidget *menu_ts) menu_ts->addIntroItems(LOCALE_RECORDINGMENU_TIMESHIFT); //timeshift dir - CMenuForwarder* fTsDir = new CMenuForwarder(LOCALE_RECORDINGMENU_TSDIR, true, g_settings.timeshiftdir, this, "timeshiftdir"); + bool recstatus = CNeutrinoApp::getInstance()->recordingstatus; + CMenuForwarder* fTsDir = new CMenuForwarder(LOCALE_RECORDINGMENU_TSDIR, !recstatus, g_settings.timeshiftdir, this, "timeshiftdir"); fTsDir->setHint("", LOCALE_MENU_HINT_RECORD_TDIR); menu_ts->addItem(fTsDir); From cab1cb8912079fd566a7f6f3a05dec976879b851 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 1 May 2014 19:03:09 +0400 Subject: [PATCH 007/511] gui/hdd_menu.cpp: add question to set record directory to formatted drive; mark partition used for recording with icon, disable umount Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bbcd7330a8cb577900a1fe66e5f6a321aab4f1d6 Author: [CST] Focus Date: 2014-05-01 (Thu, 01 May 2014) ------------------ This commit was generated by Migit --- data/locale/english.locale | 1 + src/gui/hdd_menu.cpp | 201 +++++++++++++++++++++++-------------- src/gui/hdd_menu.h | 3 +- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 5 files changed, 133 insertions(+), 74 deletions(-) diff --git a/data/locale/english.locale b/data/locale/english.locale index 74d0ecbdd..fc3ba48e2 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -638,6 +638,7 @@ hdd_noise Acoustic-control (AAM) hdd_not_found No HDD found hdd_removable_device Removable device hdd_settings Hard Disk Drive/USB +hdd_set_recdir Use device for recording ? hdd_sleep Switch off after... hdd_slow Slow hdd_umount Unmount diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index 4d1615324..bee9c69bd 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -55,6 +55,7 @@ #include #include +#include #define BLKID_BIN "/sbin/blkid" #define EJECT_BIN "/bin/eject" @@ -128,76 +129,6 @@ int CHDDMenuHandler::filterDevName(const char * name) return 0; } -int CHDDMenuHandler::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data) -{ - if (msg == NeutrinoMessages::EVT_HOTPLUG) { - std::string str((char *) data); - std::map smap; - - if (!split_config_string(str, smap)) - return messages_return::handled; - - std::map::iterator it = smap.find("MDEV"); - if (it == smap.end()) - return messages_return::handled; - - std::string dev = it->second; - printf("CHDDMenuHandler::handleMsg: MDEV=%s\n", dev.c_str()); - if (!filterDevName(dev.c_str())) - return messages_return::handled; - - it = smap.find("ACTION"); - if (it == smap.end()) - return messages_return::handled; - - bool added = it->second == "add"; - bool mounted = is_mounted(dev.c_str()); - std::string tmp = dev.substr(0, 2); - - if (added && !mounted && tmp != "sr") { - std::string message = dev + ": " + g_Locale->getText(LOCALE_HDD_MOUNT_FAILED); - message += std::string(" ") + g_Locale->getText(LOCALE_HDD_FORMAT) + std::string(" ?"); - int res = ShowMsg(LOCALE_MESSAGEBOX_INFO, message, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo); - if(res == CMessageBox::mbrYes) { - unsigned char * p = new unsigned char[dev.size() + 1]; - if (p) { - sprintf((char *)p, "%s", dev.c_str()); - g_RCInput->postMsg(NeutrinoMessages::EVT_FORMAT_DRIVE , (neutrino_msg_data_t)p); - return messages_return::handled | messages_return::cancel_all; - } - } - } else { - std::string message = dev + ": " + (added ? - g_Locale->getText(mounted ? LOCALE_HDD_MOUNT_OK : LOCALE_HDD_MOUNT_FAILED) - : g_Locale->getText(LOCALE_HDD_UMOUNTED)); - ShowHint(LOCALE_MESSAGEBOX_INFO, message.c_str()); - } - if (in_menu && !lock_refresh) { - show_menu = true; - return messages_return::handled | messages_return::cancel_all; - } - lock_refresh = false; - return messages_return::handled; - } - else if (msg == NeutrinoMessages::EVT_FORMAT_DRIVE) { - std::string dev((char *) data); - printf("NeutrinoMessages::EVT_FORMAT_DRIVE: [%s]\n", dev.c_str()); - check_dev_tools(); - getBlkIds(); - scanDevices(); - for (std::map::iterator it = devtitle.begin(); it != devtitle.end(); ++it) { - if (dev.substr(0, it->first.size()) == it->first) { - showDeviceMenu(it->first); - break; - } - } - hdd_list.clear(); - devtitle.clear(); - return messages_return::handled; - } - return messages_return::unhandled; -} - bool CHDDMenuHandler::is_mounted(const char *dev) { bool res = false; @@ -401,6 +332,100 @@ bool CHDDMenuHandler::waitfordev(std::string dev, int maxwait) } #endif +void CHDDMenuHandler::showHint(std::string &message) +{ + CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, message.c_str()); + hintBox->paint(); + + uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(3); + neutrino_msg_t msg; + neutrino_msg_data_t data; + + while(true) { + g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd); + + if ((msg == CRCInput::RC_timeout) || (msg < CRCInput::RC_MaxRC)) + break; + else if (msg == NeutrinoMessages::EVT_HOTPLUG) { + g_RCInput->postMsg(msg, data); + break; + } + else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) + break; + } + delete hintBox; +} + +int CHDDMenuHandler::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data) +{ + if (msg == NeutrinoMessages::EVT_HOTPLUG) { + std::string str((char *) data); + std::map smap; + + if (!split_config_string(str, smap)) + return messages_return::handled; + + std::map::iterator it = smap.find("MDEV"); + if (it == smap.end()) + return messages_return::handled; + + std::string dev = it->second; + printf("CHDDMenuHandler::handleMsg: MDEV=%s\n", dev.c_str()); + if (!filterDevName(dev.c_str())) + return messages_return::handled; + + it = smap.find("ACTION"); + if (it == smap.end()) + return messages_return::handled; + + bool added = it->second == "add"; + bool mounted = is_mounted(dev.c_str()); + std::string tmp = dev.substr(0, 2); + + if (added && !mounted && tmp != "sr") { + std::string message = dev + ": " + g_Locale->getText(LOCALE_HDD_MOUNT_FAILED); + message += std::string(" ") + g_Locale->getText(LOCALE_HDD_FORMAT) + std::string(" ?"); + int res = ShowMsg(LOCALE_MESSAGEBOX_INFO, message, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo); + if(res == CMessageBox::mbrYes) { + unsigned char * p = new unsigned char[dev.size() + 1]; + if (p) { + sprintf((char *)p, "%s", dev.c_str()); + g_RCInput->postMsg(NeutrinoMessages::EVT_FORMAT_DRIVE , (neutrino_msg_data_t)p); + return messages_return::handled | messages_return::cancel_all; + } + } + } else { + std::string message = dev + ": " + (added ? + g_Locale->getText(mounted ? LOCALE_HDD_MOUNT_OK : LOCALE_HDD_MOUNT_FAILED) + : g_Locale->getText(LOCALE_HDD_UMOUNTED)); + showHint(message); + } + if (in_menu && !lock_refresh) { + show_menu = true; + return messages_return::handled | messages_return::cancel_all; + } + lock_refresh = false; + return messages_return::handled; + } + else if (msg == NeutrinoMessages::EVT_FORMAT_DRIVE) { + std::string dev((char *) data); + printf("NeutrinoMessages::EVT_FORMAT_DRIVE: [%s]\n", dev.c_str()); + check_dev_tools(); + getBlkIds(); + scanDevices(); + for (std::map::iterator it = devtitle.begin(); it != devtitle.end(); ++it) { + if (dev.substr(0, it->first.size()) == it->first) { + showDeviceMenu(it->first); + break; + } + } + hdd_list.clear(); + devtitle.clear(); + return messages_return::handled; + } + return messages_return::unhandled; +} + int CHDDMenuHandler::exec(CMenuTarget* parent, const std::string &actionkey) { if (parent) @@ -435,7 +460,26 @@ int CHDDMenuHandler::exec(CMenuTarget* parent, const std::string &actionkey) return checkDevice(dev); } else if (actionkey[0] == 'f') { - return formatDevice(dev); + int ret = formatDevice(dev); + std::string devname = "/dev/" + dev + getDefaultPart(dev); + if (show_menu && is_mounted(devname.c_str())) { + bool old_menu = in_menu; + in_menu = false; + int res = ShowMsg(LOCALE_RECORDINGMENU_DEFDIR, LOCALE_HDD_SET_RECDIR, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo); + if(res == CMessageBox::mbrYes) { + g_settings.network_nfs_recordingdir = std::string(MOUNT_BASE) + "/" + dev + getDefaultPart(dev) + "/movies"; + CRecordManager::getInstance()->SetDirectory(g_settings.network_nfs_recordingdir); + if(g_settings.timeshiftdir.empty()) + { + std::string timeshiftDir = g_settings.network_nfs_recordingdir + "/.timeshift"; + safe_mkdir(timeshiftDir.c_str()); + printf("New timeshift dir: %s\n", timeshiftDir.c_str()); + CRecordManager::getInstance()->SetTimeshiftDirectory(timeshiftDir); + } + } + in_menu = old_menu; + } + return ret; } return menu_return::RETURN_REPAINT; } @@ -663,15 +707,26 @@ _show_menu: } if (!hdd_list.empty()) { + struct stat rec_st; + memset(&rec_st, 0, sizeof(rec_st)); + stat(g_settings.network_nfs_recordingdir.c_str(), &rec_st); + sort(hdd_list.begin(), hdd_list.end(), cmp_hdd_by_name()); mount = g_Locale->getText(LOCALE_HDD_MOUNT); umount = g_Locale->getText(LOCALE_HDD_UMOUNT); int shortcut = 1; hddmenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_HDD_MOUNT_UMOUNT)); for (std::vector::iterator it = hdd_list.begin(); it != hdd_list.end(); ++it) { + const char * rec_icon = NULL; + if (it->mounted) { + std::string dst = MOUNT_BASE + it->devname; + if (!stat(dst.c_str(), &stat_buf) && rec_st.st_dev == stat_buf.st_dev) + rec_icon = CNeutrinoApp::getInstance()->recordingstatus ? NEUTRINO_ICON_REC : NEUTRINO_ICON_REC_GRAY; + } std::string key = "m" + it->devname; - it->cmf = new CMenuForwarder(it->desc, true, it->mounted ? umount : mount , this, - key.c_str(), CRCInput::convertDigitToKey(shortcut++)); + bool enabled = !rec_icon || !CNeutrinoApp::getInstance()->recordingstatus; + it->cmf = new CMenuForwarder(it->desc, enabled, it->mounted ? umount : mount , this, + key.c_str(), CRCInput::convertDigitToKey(shortcut++), NULL, rec_icon); hddmenu->addItem(it->cmf); } } diff --git a/src/gui/hdd_menu.h b/src/gui/hdd_menu.h index 9a244394a..d073da013 100644 --- a/src/gui/hdd_menu.h +++ b/src/gui/hdd_menu.h @@ -25,8 +25,8 @@ #ifndef __hdd_menu__ #define __hdd_menu__ - #include "widget/menue.h" +#include using namespace std; @@ -91,6 +91,7 @@ class CHDDMenuHandler : public CMenuTarget int formatDevice(std::string dev); void showError(neutrino_locale_t err); bool scanDevices(); + void showHint(std::string &messsage); CHDDMenuHandler(); public: diff --git a/src/system/locals.h b/src/system/locals.h index aeca005f0..7e9e0bcd9 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -665,6 +665,7 @@ typedef enum LOCALE_HDD_NOT_FOUND, LOCALE_HDD_REMOVABLE_DEVICE, LOCALE_HDD_SETTINGS, + LOCALE_HDD_SET_RECDIR, LOCALE_HDD_SLEEP, LOCALE_HDD_SLOW, LOCALE_HDD_UMOUNT, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 8402a72fe..e85613acc 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -665,6 +665,7 @@ const char * locale_real_names[] = "hdd_not_found", "hdd_removable_device", "hdd_settings", + "hdd_set_recdir", "hdd_sleep", "hdd_slow", "hdd_umount", From e99e849b6ca390d54d0ef16b62fdf121ac5f35e5 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 1 May 2014 22:27:09 +0200 Subject: [PATCH 008/511] add sort option for channellist editor Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/292c6268463c7bc95074fc33d0224e8042bc610e Author: Jacek Jendrzej Date: 2014-05-01 (Thu, 01 May 2014) Origin message was: ------------------ -add sort option for channellist editor ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/bedit/bouqueteditor_chanselect.cpp | 58 +++++++++++++++++++++- src/gui/bedit/bouqueteditor_chanselect.h | 4 ++ 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index f3a02fde3..c330a55cb 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -70,6 +70,7 @@ CBEChannelSelectWidget::CBEChannelSelectWidget(const std::string & Caption, unsi ButtonHeight = std::max(footerHeight, icol_h+4); liststart = 0; + channellist_sort_mode = SORT_ALPHA; bouquetChannels = NULL; dline = NULL; ibox = new CComponentsInfoBox(); @@ -160,6 +161,37 @@ void CBEChannelSelectWidget::onOkKeyPressed() paintItem( selected, selected - liststart, false); g_RCInput->postMsg( CRCInput::RC_down, 0 ); } +void CBEChannelSelectWidget::onRedKeyPressed() +{ + if (selected >= Channels.size()) + return; + setModified(); + + channellist_sort_mode++; + if(channellist_sort_mode > SORT_END) + channellist_sort_mode = 0; + switch(channellist_sort_mode) + { + case SORT_ALPHA: + sort(Channels.begin(), Channels.end(), CmpChannelByChName()); + break; + case SORT_FREQ: + sort(Channels.begin(), Channels.end(), CmpChannelByFreq()); + break; + case SORT_SAT: + sort(Channels.begin(), Channels.end(), CmpChannelBySat()); + break; + case SORT_CH_NUMBER: + sort(Channels.begin(), Channels.end(), CmpChannelByChNum()); + break; + default: + sort(Channels.begin(), Channels.end(), CmpChannelByChName()); + break; + } + paintFoot(); + paint(); +} + #include int CBEChannelSelectWidget::exec(CMenuTarget* parent, const std::string & actionKey) { @@ -189,14 +221,36 @@ int CBEChannelSelectWidget::exec(CMenuTarget* parent, const std::string & action const struct button_label CBEChannelSelectButtons[] = { + { NEUTRINO_ICON_BUTTON_RED, LOCALE_CHANNELLIST_FOOT_SORT_ALPHA}, { NEUTRINO_ICON_BUTTON_OKAY, LOCALE_BOUQUETEDITOR_SWITCH }, { NEUTRINO_ICON_BUTTON_HOME, LOCALE_BOUQUETEDITOR_RETURN } }; void CBEChannelSelectWidget::paintFoot() { - ::paintButtons(x, y + (height-footerHeight), width, 2, CBEChannelSelectButtons, width, footerHeight); - + const short numbuttons = sizeof(CBEChannelSelectButtons)/sizeof(CBEChannelSelectButtons[0]); + struct button_label Button[numbuttons]; + for (int i = 0; i < numbuttons; i++) { + Button[i] = CBEChannelSelectButtons[i]; + } + switch (channellist_sort_mode) { + case SORT_ALPHA: + Button[0].locale = LOCALE_CHANNELLIST_FOOT_SORT_ALPHA; + break; + case SORT_FREQ: + Button[0].locale = LOCALE_CHANNELLIST_FOOT_SORT_FREQ; + break; + case SORT_SAT: + Button[0].locale = LOCALE_CHANNELLIST_FOOT_SORT_SAT; + break; + case SORT_CH_NUMBER: + Button[0].locale = LOCALE_CHANNELLIST_FOOT_SORT_CHNUM; + break; + default: + Button[0].locale = LOCALE_CHANNELLIST_FOOT_SORT_ALPHA; + break; + } + ::paintButtons(x, y + (height-footerHeight), width, numbuttons, Button, width, footerHeight); #if 0 frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 3* ButtonWidth+ 8, y+height+1); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 3* ButtonWidth+ 38, y+height+24 - 2, width, g_Locale->getText(LOCALE_BOUQUETEDITOR_SWITCH), COL_INFOBAR_TEXT, 0, true); // UTF-8 diff --git a/src/gui/bedit/bouqueteditor_chanselect.h b/src/gui/bedit/bouqueteditor_chanselect.h index 729c3d7af..43bc6601e 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.h +++ b/src/gui/bedit/bouqueteditor_chanselect.h @@ -46,6 +46,8 @@ class CBEChannelSelectWidget : public CListBox private: unsigned int bouquet; + short int channellist_sort_mode; + enum{SORT_ALPHA,SORT_FREQ,SORT_SAT,SORT_CH_NUMBER, SORT_END}; CZapitClient::channelsMode mode; bool isChannelInBouquet( int index); CComponentsDetailLine *dline; @@ -57,6 +59,8 @@ class CBEChannelSelectWidget : public CListBox void initItem2DetailsLine (int pos, int ch_index); void paintFoot(); void onOkKeyPressed(); + void onRedKeyPressed(); + int footerHeight; int info_height; From 6d40f0181219dc46519d7b50c9ab641840fe46ac Mon Sep 17 00:00:00 2001 From: BPanther Date: Fri, 2 May 2014 08:16:06 +0200 Subject: [PATCH 009/511] missing lua ifdef Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fe3379ddb771b6ef013f4ecc10607797bebf0807 Author: BPanther Date: 2014-05-02 (Fri, 02 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/user_menue.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 1149754df..81e021a2e 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -464,7 +464,9 @@ bool CUserMenu::showUserMenu(int button) if (games) delete games; if (tools) delete tools; if (scripts) delete scripts; +#if ENABLE_LUA if (lua) delete lua; +#endif if (menu) delete menu; InfoClock->enableInfoClock(true); From 81f0c766e1d4fb530424c24521694ec46ab2a740 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 2 May 2014 08:16:12 +0200 Subject: [PATCH 010/511] Fix sort order in locales & update deutsch.locale Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5c5b2b9a433f3b714087f068a0c1522d030aa2c4 Author: Michael Liebmann Date: 2014-05-02 (Fri, 02 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 7 ++++--- data/locale/english.locale | 6 +++--- src/system/locals.h | 6 +++--- src/system/locals_intern.h | 6 +++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 38141f151..7a4ccdf1a 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -623,7 +623,7 @@ hdd_check_failed Festplattenprüfung fehlgeschlagen hdd_check_format_bad Überprüfung von Datenträgern mit Format %s wird nicht unterstützt. hdd_extended_settings Erweiterte Festplatteneinstellungen hdd_fast Schnell -hdd_format Formatiere Festplatte +hdd_format Formatiere Datenträger hdd_format_failed Formatierung fehlgeschlagen! Stellen Sie sicher, dass der Datenträger nicht in Verwendung ist und versuchen Sie es erneut. hdd_format_warn Alle Daten auf dem Datenträger werden gelöscht! Formatierung starten? hdd_fs Dateisystem zum formatieren @@ -631,18 +631,19 @@ hdd_fs_unknown unbekannt hdd_manage Laufwerke verwalten hdd_middle Mittel hdd_mount Mount -hdd_mount_ok Laufwerk bereit hdd_mount_failed Fehler! Überprüfen Sie ihre Laufwerkseinstellungen. +hdd_mount_ok Laufwerk bereit hdd_mount_umount Mount/Unmount hdd_noise Akustikkontrolle (AAM) hdd_not_found Keine Festplatte hdd_removable_device Wechseldatenträger +hdd_set_recdir Diesen Datenträger für die Aufnahme nutzen? hdd_settings Laufwerke hdd_sleep Ausschalten nach... hdd_slow Langsam hdd_umount Unmount -hdd_umounted Laufwerk entfernt hdd_umount_warn Laufwerk aushängen +hdd_umounted Laufwerk entfernt imageinfo.creator Ersteller: imageinfo.date Datum: imageinfo.dokumentation Dokus: diff --git a/data/locale/english.locale b/data/locale/english.locale index fc3ba48e2..79e006cee 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -631,19 +631,19 @@ hdd_fs_unknown unknown hdd_manage Manage drives hdd_middle Mid hdd_mount Mount -hdd_mount_ok Device ready to use. hdd_mount_failed Failed to mount. +hdd_mount_ok Device ready to use. hdd_mount_umount Mount/Unmount hdd_noise Acoustic-control (AAM) hdd_not_found No HDD found hdd_removable_device Removable device -hdd_settings Hard Disk Drive/USB hdd_set_recdir Use device for recording ? +hdd_settings Hard Disk Drive/USB hdd_sleep Switch off after... hdd_slow Slow hdd_umount Unmount -hdd_umounted Device removed hdd_umount_warn unmount device +hdd_umounted Device removed imageinfo.creator Creator: imageinfo.date Date: imageinfo.dokumentation Docs: diff --git a/src/system/locals.h b/src/system/locals.h index 7e9e0bcd9..79090365b 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -658,19 +658,19 @@ typedef enum LOCALE_HDD_MANAGE, LOCALE_HDD_MIDDLE, LOCALE_HDD_MOUNT, - LOCALE_HDD_MOUNT_OK, LOCALE_HDD_MOUNT_FAILED, + LOCALE_HDD_MOUNT_OK, LOCALE_HDD_MOUNT_UMOUNT, LOCALE_HDD_NOISE, LOCALE_HDD_NOT_FOUND, LOCALE_HDD_REMOVABLE_DEVICE, - LOCALE_HDD_SETTINGS, LOCALE_HDD_SET_RECDIR, + LOCALE_HDD_SETTINGS, LOCALE_HDD_SLEEP, LOCALE_HDD_SLOW, LOCALE_HDD_UMOUNT, - LOCALE_HDD_UMOUNTED, LOCALE_HDD_UMOUNT_WARN, + LOCALE_HDD_UMOUNTED, LOCALE_IMAGEINFO_CREATOR, LOCALE_IMAGEINFO_DATE, LOCALE_IMAGEINFO_DOKUMENTATION, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index e85613acc..9a17e0083 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -658,19 +658,19 @@ const char * locale_real_names[] = "hdd_manage", "hdd_middle", "hdd_mount", - "hdd_mount_ok", "hdd_mount_failed", + "hdd_mount_ok", "hdd_mount_umount", "hdd_noise", "hdd_not_found", "hdd_removable_device", - "hdd_settings", "hdd_set_recdir", + "hdd_settings", "hdd_sleep", "hdd_slow", "hdd_umount", - "hdd_umounted", "hdd_umount_warn", + "hdd_umounted", "imageinfo.creator", "imageinfo.date", "imageinfo.dokumentation", From 938f19d73919ca28c7e26c19fd27104e6cb99798 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Fri, 2 May 2014 08:16:23 +0200 Subject: [PATCH 011/511] rcinput: fix invalid narrowing cast Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/33d2fb319ac3cd80adae0bf28023efa16ba3b8ea Author: Stefan Seyfried Date: 2014-05-02 (Fri, 02 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/rcinput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index a867b66d9..0c89de40d 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1167,7 +1167,7 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 } else if (emsg.initiatorID == CEventServer::INITID_NEUTRINO) { - printf("CRCInput::getMsg_us: INITID_NEUTRINO: msg %x size %d data %x\n", (int) emsg.eventID, emsg.dataSize, (int) p); + printf("CRCInput::getMsg_us: INITID_NEUTRINO: msg %x size %d data %p\n", (int) emsg.eventID, emsg.dataSize, p); if (emsg.eventID == NeutrinoMessages::EVT_HOTPLUG) { printf("EVT_HOTPLUG: [%s]\n", (char *) p); *msg = emsg.eventID; From d5e2da42ef871450340f80e0ad1b1b397fc6bb07 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Fri, 2 May 2014 08:16:29 +0200 Subject: [PATCH 012/511] luainstance: fix wrong integer type usage Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/caa5d5c327b675291bf8c37492d39ac7e13e8e69 Author: Stefan Seyfried Date: 2014-05-02 (Fri, 02 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/luainstance.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index bf427b0c3..39af28e52 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -1787,8 +1787,8 @@ int CLuaInstance::ComponentsTextSetText(lua_State *L) if (!m) return 0; std::string text = ""; - int mode = m->mode; - int font_text = m->font_text; + lua_Integer mode = m->mode; + lua_Integer font_text = m->font_text; tableLookup(L, "text", text); tableLookup(L, "mode", mode); tableLookup(L, "font_text", font_text); @@ -1862,9 +1862,9 @@ int CLuaInstance::CPictureNew(lua_State *L) lua_assert(lua_istable(L,1)); CLuaCWindow* parent = NULL; - int x=10, y=10, dx=100, dy=100; + lua_Integer x=10, y=10, dx=100, dy=100; std::string image_name = ""; - int alignment = CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER; + lua_Integer alignment = CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER; std::string tmp1 = "false"; // has_shadow lua_Integer color_frame = (lua_Integer)COL_MENUCONTENT_PLUS_6; From c8eb4851540f21e373d0d5ecec186a63e96df991 Mon Sep 17 00:00:00 2001 From: tomworld Date: Fri, 2 May 2014 08:16:33 +0200 Subject: [PATCH 013/511] Update locale Signed-off-by: M. Liebmann Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6ac945f78fd339527ef839788c7b8a9a391c8a37 Author: tomworld Date: 2014-05-02 (Fri, 02 May 2014) ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 4 ++-- data/locale/english.locale | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 7a4ccdf1a..04395bc91 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -619,7 +619,7 @@ hdd_5min 5 min. hdd_60min 60 min. hdd_activate Übernehmen hdd_check Dateisystemprüfung -hdd_check_failed Festplattenprüfung fehlgeschlagen +hdd_check_failed Datenträgerprüfung fehlgeschlagen hdd_check_format_bad Überprüfung von Datenträgern mit Format %s wird nicht unterstützt. hdd_extended_settings Erweiterte Festplatteneinstellungen hdd_fast Schnell @@ -635,7 +635,7 @@ hdd_mount_failed Fehler! Überprüfen Sie ihre Laufwerkseinstellungen. hdd_mount_ok Laufwerk bereit hdd_mount_umount Mount/Unmount hdd_noise Akustikkontrolle (AAM) -hdd_not_found Keine Festplatte +hdd_not_found Kein Datenträger hdd_removable_device Wechseldatenträger hdd_set_recdir Diesen Datenträger für die Aufnahme nutzen? hdd_settings Laufwerke diff --git a/data/locale/english.locale b/data/locale/english.locale index 79e006cee..304f366dc 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -628,7 +628,7 @@ hdd_format_failed Formating failed! Make sure device not in use, reboot and try hdd_format_warn All data on device will be lost ! Continue with format ? hdd_fs Filesystem used to format hdd_fs_unknown unknown -hdd_manage Manage drives +hdd_manage Manage device hdd_middle Mid hdd_mount Mount hdd_mount_failed Failed to mount. @@ -638,7 +638,7 @@ hdd_noise Acoustic-control (AAM) hdd_not_found No HDD found hdd_removable_device Removable device hdd_set_recdir Use device for recording ? -hdd_settings Hard Disk Drive/USB +hdd_settings Data Storage hdd_sleep Switch off after... hdd_slow Slow hdd_umount Unmount @@ -883,10 +883,10 @@ menu.hint_font_ttx Select font file to use for teletext menu.hint_fonts Configure GUI fonts and font sizes menu.hint_gamelist_fonts Change games and scripts list font sizes menu.hint_games Show list of installed games -menu.hint_hdd Format / check hard disk drive +menu.hint_hdd Format / check data storage menu.hint_hdd_apply Apply sleep/noise parameters menu.hint_hdd_check Check filesystem (fsck) -menu.hint_hdd_fmt Select the disk format +menu.hint_hdd_fmt Select the data storage format menu.hint_hdd_format Create HDD partition and format it menu.hint_hdd_noise Set Automatic Acoustic Management\nnot all drives support this menu.hint_hdd_sleep Select time to stop hdd on inactivity From cdb47cfcf404e5bcb7026c0f90bd75304a843d7c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 2 May 2014 22:28:36 +0200 Subject: [PATCH 014/511] drop obsolete code around FONT_TYPE_GAMELIST these fonts are not needed since gamelist/scriptlist are painted with menu-widget Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/da7f3b9cb113701b921a6bb6ffd4101d0f8afd77 Author: vanhofen Date: 2014-05-02 (Fri, 02 May 2014) Origin message was: ------------------ - drop obsolete code around FONT_TYPE_GAMELIST these fonts are not needed since gamelist/scriptlist are painted with menu-widget ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 5 +---- data/locale/english.locale | 5 +---- data/locale/nederlands.locale | 4 ---- data/locale/slovak.locale | 4 ---- src/gui/luainstance.cpp | 2 -- src/gui/osd_setup.cpp | 15 +++------------ src/gui/widget/shellwindow.cpp | 2 +- src/neutrino_menue.h | 1 - src/system/locals.h | 5 +---- src/system/locals_intern.h | 5 +---- src/system/settings.h | 2 -- 11 files changed, 8 insertions(+), 42 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 04395bc91..30f41b13a 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -573,7 +573,6 @@ flashupdate.wrongbase Abweichende Release-Information\nFortfahren? fontmenu.channellist Kanalliste fontmenu.epg EPG (Programmführer) fontmenu.eventlist Event-Liste -fontmenu.gamelist Spiele-Liste fontmenu.head Schrift fontmenu.infobar Infobar fontmenu.menu Menü @@ -599,8 +598,6 @@ fontsize.eventlist_itemlarge Groß fontsize.eventlist_itemsmall Klein fontsize.eventlist_title Titel fontsize.filebrowser_item Dateibrowsereinträge -fontsize.gamelist_itemlarge Groß -fontsize.gamelist_itemsmall Klein fontsize.hint Schriftart wird initialisiert,\nbitte warten... fontsize.infobar_channame Kanalname fontsize.infobar_info Info @@ -881,7 +878,6 @@ menu.hint_font_gui Wählen Sie die Schriftart für die Menüs menu.hint_font_scaling Legen Sie die vertikale und horizontale Skalierung der Menüschrift fest menu.hint_font_ttx Wählen Sie die Schriftart für den Teletext menu.hint_fonts Konfigurieren Sie die Schriftart und die Schriftgrößen für die Menüs -menu.hint_gamelist_fonts Ändern die Schriftgrößen für die Spiele- und Script-Liste menu.hint_games Zeige Liste der installierten Spiele menu.hint_hdd Formatierung und Prüfung der Datenträger menu.hint_hdd_apply Die veränderten Einstellungen zum Sleep- und Akustik-Modus werden übernommen @@ -1045,6 +1041,7 @@ menu.hint_osd Farben, Schriftarten, Anzeigegröße, Ansichtsoptionen der Menüs menu.hint_osd_language Wählen Sie ihre Menü-Sprache menu.hint_osd_preset Wählen Sie zwischen Röhren-TV (CRT) oder Flachbildschirm (LCD) menu.hint_osd_timing Einblendzeit, die das OSD auf dem TV angezeigt wird +menu.hint_other_fonts Ändern Sie andere Schriftgrößen menu.hint_parentallock_changepin Geben Sie den 4-stelligen PIN-Code ein, der dann ggf. abgefragt wird menu.hint_parentallock_lockage Legen Sie fest, bei welcher Altersklasse die Abfrage der PIN erfolgt menu.hint_parentallock_menu Menüs mit PIN Code sichern diff --git a/data/locale/english.locale b/data/locale/english.locale index 304f366dc..161f0e975 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -573,7 +573,6 @@ flashupdate.wrongbase Your Release cycle differs.\nTo continue? fontmenu.channellist Channellist fontmenu.epg EPG fontmenu.eventlist Eventlist -fontmenu.gamelist Gamelist fontmenu.head Font settings fontmenu.infobar Infobar fontmenu.menu Menu @@ -599,8 +598,6 @@ fontsize.eventlist_itemlarge Large fontsize.eventlist_itemsmall Small fontsize.eventlist_title Title fontsize.filebrowser_item Filebrowser items -fontsize.gamelist_itemlarge Large -fontsize.gamelist_itemsmall Small fontsize.hint Initialising font,\nplease wait... fontsize.infobar_channame Channel name fontsize.infobar_info info @@ -881,7 +878,6 @@ menu.hint_font_gui Select font file to use for GUI menu.hint_font_scaling Set global vertical and horizontal\nGUI font scaling menu.hint_font_ttx Select font file to use for teletext menu.hint_fonts Configure GUI fonts and font sizes -menu.hint_gamelist_fonts Change games and scripts list font sizes menu.hint_games Show list of installed games menu.hint_hdd Format / check data storage menu.hint_hdd_apply Apply sleep/noise parameters @@ -1045,6 +1041,7 @@ menu.hint_osd Colors, fonts, screen size\nGUI look and feel options menu.hint_osd_language Select OSD language menu.hint_osd_preset Pre-configured screen margins for CRT and LCD TV menu.hint_osd_timing After this time the OSD will be faded out +menu.hint_other_fonts Change other font sizes menu.hint_parentallock_changepin Change PIN code menu.hint_parentallock_lockage Select age allowed to watch menu.hint_parentallock_menu Lock menus with pin code diff --git a/data/locale/nederlands.locale b/data/locale/nederlands.locale index 6688ca37b..32bbc3f5f 100644 --- a/data/locale/nederlands.locale +++ b/data/locale/nederlands.locale @@ -543,7 +543,6 @@ flashupdate.wrongbase Uw release-cyclus verschilt.\nVerder gaan? fontmenu.channellist Kanalenlijst fontmenu.epg EPG fontmenu.eventlist Programmalijst -fontmenu.gamelist Spelletjes lijst fontmenu.head Lettertype instellingen fontmenu.infobar Informatiebalk fontmenu.menu Menu @@ -567,8 +566,6 @@ fontsize.eventlist_itemlarge Groot fontsize.eventlist_itemsmall Klein fontsize.eventlist_title Titel fontsize.filebrowser_item Verkenner items -fontsize.gamelist_itemlarge Groot -fontsize.gamelist_itemsmall Klein fontsize.hint Initialiseren lettertype,\néén moment geduld... fontsize.infobar_channame Kanaalnaam fontsize.infobar_info Info @@ -810,7 +807,6 @@ menu.hint_font_gui Selecteer het algemene lettertype dat u wenst te gebruiken vo menu.hint_font_scaling Globale verticale en horizontale font schaling instellen. menu.hint_font_ttx Selecteer het lettertype dat u wenst te gebruiken voor teletekst. menu.hint_fonts Configureer lettertypes gebruikersinterface -menu.hint_gamelist_fonts Wijzig lettertype games en scripts lijst menu.hint_games Lijst met geïnstalleerde games weergeven. menu.hint_hdd Formatteer / check harde schijf menu.hint_hdd_apply Slaap/Geluid parameters toepassen diff --git a/data/locale/slovak.locale b/data/locale/slovak.locale index 51b9187d9..729dc7ede 100644 --- a/data/locale/slovak.locale +++ b/data/locale/slovak.locale @@ -571,7 +571,6 @@ flashupdate.wrongbase Vaša verzia je odlišná.\nPokračovať? fontmenu.channellist Zoznam kanálov fontmenu.epg EPG fontmenu.eventlist Programový sprievodca -fontmenu.gamelist Zoznam hier fontmenu.head Nastavenia písma fontmenu.infobar Informačná lišta fontmenu.menu Menu @@ -596,8 +595,6 @@ fontsize.eventlist_itemlarge Veľké EPG fontsize.eventlist_itemsmall Malé EPG fontsize.eventlist_title Titul EPG fontsize.filebrowser_item Položka prehliadača súborov -fontsize.gamelist_itemlarge Veľký zoznam hier -fontsize.gamelist_itemsmall Malý zoznam hier fontsize.hint Inicializácia písma,\nprosím čakaj... fontsize.infobar_channame Názov kanálu fontsize.infobar_info Informácia na informačnej lište @@ -862,7 +859,6 @@ menu.hint_font_gui Výber súboru písma pre GUI menu.hint_font_scaling Zvislé a vodorovné nastavenie globálnej mierky písma menu.hint_font_ttx Výber písma pre teletext menu.hint_fonts Konfigurácia písma GUI -menu.hint_gamelist_fonts Zmena veľkosti písma zoznamu hier a skriptov menu.hint_games Zobrazenie zoznamu inštalovaných hier menu.hint_hdd Formátovanie/kontrola pevného disku menu.hint_hdd_apply Použitie parametrov uspania/stíšenia diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 39af28e52..7af745301 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -203,8 +203,6 @@ static void set_lua_variables(lua_State *L) { "EVENTLIST_ITEMLARGE",SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE }, { "EVENTLIST_ITEMSMALL",SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL }, { "EVENTLIST_DATETIME", SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME }, - { "GAMELIST_ITEMLARGE", SNeutrinoSettings::FONT_TYPE_GAMELIST_ITEMLARGE }, - { "GAMELIST_ITEMSMALL", SNeutrinoSettings::FONT_TYPE_GAMELIST_ITEMSMALL }, { "CHANNELLIST", SNeutrinoSettings::FONT_TYPE_CHANNELLIST }, { "CHANNELLIST_DESCR", SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR }, { "CHANNELLIST_NUMBER", SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER }, diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 42506d333..7006b7627 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -128,12 +128,6 @@ const SNeutrinoSettings::FONT_TYPES epg_font_sizes[4] = SNeutrinoSettings::FONT_TYPE_EPG_DATE }; -const SNeutrinoSettings::FONT_TYPES gamelist_font_sizes[2] = -{ - SNeutrinoSettings::FONT_TYPE_GAMELIST_ITEMLARGE, - SNeutrinoSettings::FONT_TYPE_GAMELIST_ITEMSMALL -}; - const SNeutrinoSettings::FONT_TYPES menu_font_sizes[4] = { SNeutrinoSettings::FONT_TYPE_MENU_TITLE, @@ -147,16 +141,15 @@ const SNeutrinoSettings::FONT_TYPES other_font_sizes[2] = SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM }; -#define FONT_GROUP_COUNT 7 +#define FONT_GROUP_COUNT 6 font_sizes_groups font_sizes_groups[FONT_GROUP_COUNT] = { - {LOCALE_FONTMENU_MENU , 4, menu_font_sizes , "fontsize.doth", LOCALE_MENU_HINT_MENU_FONTS }, + {LOCALE_FONTMENU_MENU , 4, menu_font_sizes , "fontsize.dmen", LOCALE_MENU_HINT_MENU_FONTS }, {LOCALE_FONTMENU_CHANNELLIST, 5, channellist_font_sizes, "fontsize.dcha", LOCALE_MENU_HINT_CHANNELLIST_FONTS }, {LOCALE_FONTMENU_EVENTLIST , 5, eventlist_font_sizes , "fontsize.deve", LOCALE_MENU_HINT_EVENTLIST_FONTS }, {LOCALE_FONTMENU_EPG , 4, epg_font_sizes , "fontsize.depg", LOCALE_MENU_HINT_EPG_FONTS }, {LOCALE_FONTMENU_INFOBAR , 4, infobar_font_sizes , "fontsize.dinf", LOCALE_MENU_HINT_INFOBAR_FONTS }, - {LOCALE_FONTMENU_GAMELIST , 2, gamelist_font_sizes , "fontsize.dgam", LOCALE_MENU_HINT_GAMELIST_FONTS }, - {LOCALE_FONTMENU_OTHER , 2, other_font_sizes , "fontsize.dgam", LOCALE_MENU_HINT_GAMELIST_FONTS } + {LOCALE_FONTMENU_OTHER , 2, other_font_sizes , "fontsize.doth", LOCALE_MENU_HINT_OTHER_FONTS } }; font_sizes_struct neutrino_font[SNeutrinoSettings::FONT_TYPE_COUNT] = @@ -173,8 +166,6 @@ font_sizes_struct neutrino_font[SNeutrinoSettings::FONT_TYPE_COUNT] = {LOCALE_FONTSIZE_EVENTLIST_ITEMSMALL, 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, {LOCALE_FONTSIZE_EVENTLIST_DATETIME , 16, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, {LOCALE_FONTSIZE_EVENTLIST_EVENT , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, - {LOCALE_FONTSIZE_GAMELIST_ITEMLARGE , 20, CNeutrinoFonts::FONT_STYLE_BOLD , 1}, - {LOCALE_FONTSIZE_GAMELIST_ITEMSMALL , 16, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, {LOCALE_FONTSIZE_CHANNELLIST , 20, CNeutrinoFonts::FONT_STYLE_BOLD , 1}, {LOCALE_FONTSIZE_CHANNELLIST_DESCR , 20, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, {LOCALE_FONTSIZE_CHANNELLIST_NUMBER , 14, CNeutrinoFonts::FONT_STYLE_BOLD , 2}, diff --git a/src/gui/widget/shellwindow.cpp b/src/gui/widget/shellwindow.cpp index 46a9e43ec..8e393f57b 100644 --- a/src/gui/widget/shellwindow.cpp +++ b/src/gui/widget/shellwindow.cpp @@ -62,7 +62,7 @@ CShellWindow::CShellWindow(const std::string &command, const int _mode, int *res *res = -1; return; } - Font *font = g_Font[SNeutrinoSettings::FONT_TYPE_GAMELIST_ITEMSMALL]; + Font *font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]; frameBuffer = CFrameBuffer::getInstance(); unsigned int lines_max = frameBuffer->getScreenHeight() / font->getHeight(); list lines; diff --git a/src/neutrino_menue.h b/src/neutrino_menue.h index 8a466f5a5..b00740b78 100644 --- a/src/neutrino_menue.h +++ b/src/neutrino_menue.h @@ -71,7 +71,6 @@ enum MN_WIDGET_ID MN_WIDGET_ID_OSDSETUP_FONTSIZE_EVENTLIST, MN_WIDGET_ID_OSDSETUP_FONTSIZE_EPG, MN_WIDGET_ID_OSDSETUP_FONTSIZE_INFOBAR, - MN_WIDGET_ID_OSDSETUP_FONTSIZE_GAMELIST, //progressbar setup MN_WIDGET_ID_PROGRESSBAR, diff --git a/src/system/locals.h b/src/system/locals.h index 79090365b..69c092e1b 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -600,7 +600,6 @@ typedef enum LOCALE_FONTMENU_CHANNELLIST, LOCALE_FONTMENU_EPG, LOCALE_FONTMENU_EVENTLIST, - LOCALE_FONTMENU_GAMELIST, LOCALE_FONTMENU_HEAD, LOCALE_FONTMENU_INFOBAR, LOCALE_FONTMENU_MENU, @@ -626,8 +625,6 @@ typedef enum LOCALE_FONTSIZE_EVENTLIST_ITEMSMALL, LOCALE_FONTSIZE_EVENTLIST_TITLE, LOCALE_FONTSIZE_FILEBROWSER_ITEM, - LOCALE_FONTSIZE_GAMELIST_ITEMLARGE, - LOCALE_FONTSIZE_GAMELIST_ITEMSMALL, LOCALE_FONTSIZE_HINT, LOCALE_FONTSIZE_INFOBAR_CHANNAME, LOCALE_FONTSIZE_INFOBAR_INFO, @@ -908,7 +905,6 @@ typedef enum LOCALE_MENU_HINT_FONT_SCALING, LOCALE_MENU_HINT_FONT_TTX, LOCALE_MENU_HINT_FONTS, - LOCALE_MENU_HINT_GAMELIST_FONTS, LOCALE_MENU_HINT_GAMES, LOCALE_MENU_HINT_HDD, LOCALE_MENU_HINT_HDD_APPLY, @@ -1072,6 +1068,7 @@ typedef enum LOCALE_MENU_HINT_OSD_LANGUAGE, LOCALE_MENU_HINT_OSD_PRESET, LOCALE_MENU_HINT_OSD_TIMING, + LOCALE_MENU_HINT_OTHER_FONTS, LOCALE_MENU_HINT_PARENTALLOCK_CHANGEPIN, LOCALE_MENU_HINT_PARENTALLOCK_LOCKAGE, LOCALE_MENU_HINT_PARENTALLOCK_MENU, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 9a17e0083..25770efe9 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -600,7 +600,6 @@ const char * locale_real_names[] = "fontmenu.channellist", "fontmenu.epg", "fontmenu.eventlist", - "fontmenu.gamelist", "fontmenu.head", "fontmenu.infobar", "fontmenu.menu", @@ -626,8 +625,6 @@ const char * locale_real_names[] = "fontsize.eventlist_itemsmall", "fontsize.eventlist_title", "fontsize.filebrowser_item", - "fontsize.gamelist_itemlarge", - "fontsize.gamelist_itemsmall", "fontsize.hint", "fontsize.infobar_channame", "fontsize.infobar_info", @@ -908,7 +905,6 @@ const char * locale_real_names[] = "menu.hint_font_scaling", "menu.hint_font_ttx", "menu.hint_fonts", - "menu.hint_gamelist_fonts", "menu.hint_games", "menu.hint_hdd", "menu.hint_hdd_apply", @@ -1072,6 +1068,7 @@ const char * locale_real_names[] = "menu.hint_osd_language", "menu.hint_osd_preset", "menu.hint_osd_timing", + "menu.hint_other_fonts", "menu.hint_parentallock_changepin", "menu.hint_parentallock_lockage", "menu.hint_parentallock_menu", diff --git a/src/system/settings.h b/src/system/settings.h index f763e8ca1..6ae6e2457 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -554,8 +554,6 @@ struct SNeutrinoSettings FONT_TYPE_EVENTLIST_ITEMSMALL, FONT_TYPE_EVENTLIST_DATETIME, FONT_TYPE_EVENTLIST_EVENT, - FONT_TYPE_GAMELIST_ITEMLARGE, - FONT_TYPE_GAMELIST_ITEMSMALL, FONT_TYPE_CHANNELLIST, FONT_TYPE_CHANNELLIST_DESCR, FONT_TYPE_CHANNELLIST_NUMBER, From ca370a6f2b6d46cff72bb077244d1a2b48e00a03 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 27 Apr 2014 19:33:03 +0200 Subject: [PATCH 015/511] scan_setup: fix build without ENABLE_FASTSCAN Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b53c1d1bd62e435a62ec52dfabe46dc37b54a977 Author: Stefan Seyfried Date: 2014-04-27 (Sun, 27 Apr 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/scan_setup.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index fc70b5f00..cafb07d9b 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -309,7 +309,11 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey) } if (actionKey == "fastdiseqc") { printf("[neutrino] CScanSetup::%s: showFastscanDiseqcSetup()\n", __FUNCTION__); +#ifdef ENABLE_FASTSCAN return showFastscanDiseqcSetup(); +#else + return res; +#endif } std::string scants_key[] = {"all", "manual", "test", "fast", "auto"/*doesn't exists in CScanTs!*/}; From facfe0d83948bd50081df71675cbcf8315dc87a4 Mon Sep 17 00:00:00 2001 From: martii Date: Tue, 6 May 2014 12:21:07 +0200 Subject: [PATCH 016/511] gui/channellist: use localized value for minutes Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/00c1a8af01aea04f67d20472885008fa2711d201 Author: martii Date: 2014-05-06 (Tue, 06 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 8 +++++--- src/gui/channellist.h | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index ff81abd50..93176d399 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1641,12 +1641,12 @@ void CChannelList::paintDetails(int index) unsigned seit = ( time(NULL) - p_event->startTime ) / 60; snprintf(cSeit, sizeof(cSeit), "%s %02d:%02d",(displayNext) ? g_Locale->getText(LOCALE_CHANNELLIST_START):g_Locale->getText(LOCALE_CHANNELLIST_SINCE), pStartZeit->tm_hour, pStartZeit->tm_min); if (displayNext) { - snprintf(cNoch, sizeof(cNoch), "(%d min)", p_event->duration / 60); + snprintf(cNoch, sizeof(cNoch), "(%d %s)", p_event->duration / 60, unit_short_minute); } else { int noch = (p_event->startTime + p_event->duration - time(NULL)) / 60; if ((noch< 0) || (noch>=10000)) noch= 0; - snprintf(cNoch, sizeof(cNoch), "(%u / %d min)", seit, noch); + snprintf(cNoch, sizeof(cNoch), "(%u / %d %s)", seit, noch, unit_short_minute); } int seit_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cSeit, true); // UTF-8 int noch_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cNoch, true); // UTF-8 @@ -2167,6 +2167,8 @@ void CChannelList::paint() frameBuffer->paintBoxRel(x+width,y+theight+pig_height,infozone_width,infozone_height,COL_MENUCONTENT_PLUS_0); } + unit_short_minute = g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); + for(unsigned int count = 0; count < listmaxshow; count++) { paintItem(count, true); } @@ -2270,7 +2272,7 @@ void CChannelList::paint_events(int index) frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0); char startTime[10]; - int eventStartTimeWidth = g_Font[eventFont]->getRenderWidth("22:22") + 5; // use a fixed value + int eventStartTimeWidth = 4 * g_Font[eventFont]->getMaxDigitWidth() + g_Font[eventFont]->getRenderWidth(":") + 5; // use a fixed value int startTimeWidth = 0; CChannelEventList::iterator e; time_t azeit; diff --git a/src/gui/channellist.h b/src/gui/channellist.h index c6e3f310c..ad9e61ff9 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -92,6 +92,8 @@ private: int infozone_height; int previous_channellist_additional; + const char * unit_short_minute; + CEPGData epgData; bool historyMode; bool vlist; // "virtual" list, not bouquet From 95bc39c627575124cd7fb4414be9141d0b4950e7 Mon Sep 17 00:00:00 2001 From: martii Date: Tue, 6 May 2014 12:26:19 +0200 Subject: [PATCH 017/511] gui/infoviewer: use localized value for minutes Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ab42e7f032514b22c069fa523a40ae7c02e55ec0 Author: martii Date: 2014-05-06 (Tue, 06 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 883883f91..164868088 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -533,8 +533,9 @@ void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channe if (CMoviePlayerGui::getInstance().file_prozent > 100) CMoviePlayerGui::getInstance().file_prozent = 100; - char runningRest[32]; // %d can be 10 digits max... - sprintf(runningRest, "%d / %d min", (curr_pos + 30000) / 60000, (duration + 30000) / 60000); + const char *unit_short_minute = g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); + char runningRest[32]; // %d can be 10 digits max... + snprintf(runningRest, sizeof(runningRest), "%d / %d %s", (curr_pos + 30000) / 60000, (duration - curr_pos + 30000) / 60000, unit_short_minute); display_Info(g_file_epg.c_str(), g_file_epg1.c_str(), true, false, CMoviePlayerGui::getInstance().file_prozent, NULL, runningRest); int speed = CMoviePlayerGui::getInstance().GetSpeed(); @@ -1289,10 +1290,11 @@ int CInfoViewer::handleMsg (const neutrino_msg_t msg, neutrino_msg_data_t data) if (fileplay || CMoviePlayerGui::getInstance().timeshift) CMoviePlayerGui::getInstance().UpdatePosition(); if (fileplay) { - char runningRest[32]; // %d can be 10 digits max... - int curr_pos = CMoviePlayerGui::getInstance().GetPosition(); - int duration = CMoviePlayerGui::getInstance().GetDuration(); - sprintf(runningRest, "%d / %d min", (curr_pos + 30000) / 60000, (duration + 30000) / 60000); + const char *unit_short_minute = g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); + char runningRest[64]; // %d can be 10 digits max... + int curr_pos = CMoviePlayerGui::getInstance().GetPosition(); + int duration = CMoviePlayerGui::getInstance().GetDuration(); + snprintf(runningRest, sizeof(runningRest), "%d / %d %s", (curr_pos + 30000) / 60000, (duration - curr_pos + 30000) / 60000, unit_short_minute); display_Info(NULL, NULL, true, false, CMoviePlayerGui::getInstance().file_prozent, NULL, runningRest); } else { show_Data( true ); @@ -1639,12 +1641,12 @@ void CInfoViewer::show_Data (bool calledFromEvent) if (fileplay && !CMoviePlayerGui::getInstance().timeshift) return; - char runningStart[10]; - char runningRest[20]; + char runningStart[32]; + char runningRest[32]; char runningPercent = 0; - char nextStart[10]; - char nextDuration[10]; + char nextStart[32]; + char nextDuration[32]; int is_nvod = false; @@ -1662,20 +1664,22 @@ void CInfoViewer::show_Data (bool calledFromEvent) time_t jetzt = time (NULL); + const char *unit_short_minute = g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); + if (info_CurrentNext.flags & CSectionsdClient::epgflags::has_current) { int seit = (abs(jetzt - info_CurrentNext.current_zeit.startzeit) + 30) / 60; int rest = (info_CurrentNext.current_zeit.dauer / 60) - seit; if (jetzt < info_CurrentNext.current_zeit.startzeit) { runningPercent = 0; - snprintf (runningRest, sizeof(runningRest), "in %d min", seit); + snprintf (runningRest, sizeof(runningRest), "in %d %s", seit, unit_short_minute); //FIXME } else { runningPercent = (jetzt - info_CurrentNext.current_zeit.startzeit) * 100 / info_CurrentNext.current_zeit.dauer; if (runningPercent > 100) runningPercent = 100; if (rest >= 0) - snprintf(runningRest, sizeof(runningRest), "%d / %d min", seit, rest); + snprintf(runningRest, sizeof(runningRest), "%d / %d %s", seit, rest, unit_short_minute); else - snprintf(runningRest, sizeof(runningRest), "%d +%d min", info_CurrentNext.current_zeit.dauer / 60, -rest); + snprintf(runningRest, sizeof(runningRest), "%d +%d %s", info_CurrentNext.current_zeit.dauer / 60, -rest, unit_short_minute); } struct tm *pStartZeit = localtime (&info_CurrentNext.current_zeit.startzeit); @@ -1685,7 +1689,7 @@ void CInfoViewer::show_Data (bool calledFromEvent) if (info_CurrentNext.flags & CSectionsdClient::epgflags::has_next) { unsigned dauer = info_CurrentNext.next_zeit.dauer / 60; - snprintf (nextDuration, sizeof(nextDuration), "%d min", dauer); + snprintf (nextDuration, sizeof(nextDuration), "%d %s", dauer, unit_short_minute); struct tm *pStartZeit = localtime (&info_CurrentNext.next_zeit.startzeit); snprintf (nextStart, sizeof(nextStart), "%02d:%02d", pStartZeit->tm_hour, pStartZeit->tm_min); } else From 09b398a09f7a017f256210b7b8d7bed6d2ad104b Mon Sep 17 00:00:00 2001 From: martii Date: Tue, 6 May 2014 12:28:25 +0200 Subject: [PATCH 018/511] gui/infoviewer, gui/eventlist: localization fixes Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5fb5ea91bf4e97352f1f5e9614794e4137b29f15 Author: martii Date: 2014-05-06 (Tue, 06 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/eventlist.cpp | 9 +++++---- src/gui/eventlist.h | 2 ++ src/gui/infoviewer.cpp | 2 +- src/gui/moviebrowser.cpp | 9 +++++---- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 8 files changed, 17 insertions(+), 9 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 30f41b13a..c96d8a8db 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -652,6 +652,7 @@ imageinfo.kernel Kernel: imageinfo.license Lizenz imageinfo.vcs Git: imageinfo.version Version: +in in inetradio.name Internetradio infoviewer.epgnotload Informationen noch nicht geladen... infoviewer.epgwait Warte auf EPG-Informationen... diff --git a/data/locale/english.locale b/data/locale/english.locale index 161f0e975..07b43a090 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -652,6 +652,7 @@ imageinfo.kernel Kernel: imageinfo.license License imageinfo.vcs Git: imageinfo.version Version: +in in inetradio.name Internetradio infoviewer.epgnotload EPG not loaded.... infoviewer.epgwait waiting for EPG... diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 5b0815f69..e8ca2f0e8 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -271,9 +271,10 @@ int CNeutrinoEventList::exec(const t_channel_id channel_id, const std::string& c int h2 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getHeight(); fheight2 = std::max( h1, h2 ); } + unit_short_minute = g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); fheight = fheight1 + fheight2 + 2; - fwidth1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth("DDD, 00:00, "); - fwidth2 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth("[999 min] "); + fwidth1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth("DDD, :, ") + 4 * g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getMaxDigitWidth(); + fwidth2 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth("[ ] ") + 3 * g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getMaxDigitWidth() + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(unit_short_minute); listmaxshow = (height-theight-iheight-0)/fheight; height = theight+iheight+0+listmaxshow*fheight; // recalc height @@ -766,7 +767,7 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI) datetime2_str += CServiceManager::getInstance()->GetServiceName(channel); } - snprintf(tmpstr,sizeof(tmpstr), "[%d min]", evtlist[curpos].duration / 60 ); + snprintf(tmpstr,sizeof(tmpstr), "[%d %s]", evtlist[curpos].duration / 60, unit_short_minute); duration_str = tmpstr; } @@ -778,7 +779,7 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI) if ( (seit> 0) && (seit<100) && (duration_str.length()!=0) ) { char beginnt[100]; - snprintf((char*) &beginnt,sizeof(beginnt), "in %d min", seit); + snprintf(beginnt, sizeof(beginnt), "%s %d %s", g_Locale->getText(LOCALE_IN), seit, unit_short_minute); int w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(beginnt) + 10; g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20- w, ypos+ fheight1+3, fwidth2, beginnt, color); diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 96f79265b..6f724a354 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -107,6 +107,8 @@ class CNeutrinoEventList event_id_t item_event_ID; CComponentsText *cc_infozone; + const char * unit_short_minute; + void paintItem(unsigned pos, t_channel_id channel_id = 0); void paintDescription(int index); void paint(t_channel_id channel_id = 0); diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 164868088..a02dc0f11 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1671,7 +1671,7 @@ void CInfoViewer::show_Data (bool calledFromEvent) int rest = (info_CurrentNext.current_zeit.dauer / 60) - seit; if (jetzt < info_CurrentNext.current_zeit.startzeit) { runningPercent = 0; - snprintf (runningRest, sizeof(runningRest), "in %d %s", seit, unit_short_minute); //FIXME + snprintf (runningRest, sizeof(runningRest), "%s %d %s", g_Locale->getText(LOCALE_IN), seit, unit_short_minute); } else { runningPercent = (jetzt - info_CurrentNext.current_zeit.startzeit) * 100 / info_CurrentNext.current_zeit.dauer; if (runningPercent > 100) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index a2207e958..ec01a312e 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -3235,6 +3235,7 @@ bool CMovieBrowser::showMenu(MI_MOVIE_INFO* /*movie_info*/) int CMovieBrowser::showStartPosSelectionMenu(void) // P2 { + const char *unit_short_minute = g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); //TRACE("[mb]->showStartPosSelectionMenu\r\n"); int pos = -1; int result = 0; @@ -3243,10 +3244,10 @@ int CMovieBrowser::showStartPosSelectionMenu(void) // P2 if(m_movieSelectionHandler == NULL) return(result); - char start_pos[13]; snprintf(start_pos, 12,"%3d min",m_movieSelectionHandler->bookmarks.start/60); - char play_pos[13]; snprintf(play_pos, 12,"%3d min",m_movieSelectionHandler->bookmarks.lastPlayStop/60); + char start_pos[32]; snprintf(start_pos, sizeof(start_pos), "%3d %s",m_movieSelectionHandler->bookmarks.start/60, unit_short_minute); + char play_pos[32]; snprintf(play_pos, sizeof(play_pos), "%3d %s",m_movieSelectionHandler->bookmarks.lastPlayStop/60, unit_short_minute); - char book[MI_MOVIE_BOOK_USER_MAX][20]; + char book[MI_MOVIE_BOOK_USER_MAX][32]; CMenuWidgetSelection startPosSelectionMenu(LOCALE_MOVIEBROWSER_HEAD , NEUTRINO_ICON_MOVIEPLAYER); startPosSelectionMenu.enableFade(false); @@ -3276,7 +3277,7 @@ int CMovieBrowser::showStartPosSelectionMenu(void) // P2 else position[menu_nr] = m_movieSelectionHandler->bookmarks.user[i].pos + m_movieSelectionHandler->bookmarks.user[i].length; - snprintf(book[i], 19,"%5d min",position[menu_nr]/60); + snprintf(book[i], sizeof(book[i]),"%5d %s",position[menu_nr]/60, unit_short_minute); startPosSelectionMenu.addItem(new CMenuForwarder (m_movieSelectionHandler->bookmarks.user[i].name.c_str(), true, book[i])); menu_nr++; } diff --git a/src/system/locals.h b/src/system/locals.h index 69c092e1b..c0665a000 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -679,6 +679,7 @@ typedef enum LOCALE_IMAGEINFO_LICENSE, LOCALE_IMAGEINFO_VCS, LOCALE_IMAGEINFO_VERSION, + LOCALE_IN, LOCALE_INETRADIO_NAME, LOCALE_INFOVIEWER_EPGNOTLOAD, LOCALE_INFOVIEWER_EPGWAIT, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 25770efe9..c129e5cb9 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -679,6 +679,7 @@ const char * locale_real_names[] = "imageinfo.license", "imageinfo.vcs", "imageinfo.version", + "in", "inetradio.name", "infoviewer.epgnotload", "infoviewer.epgwait", From 3eb233b2531389d01791ce6ea55e491cb04dc47d Mon Sep 17 00:00:00 2001 From: martii Date: Tue, 6 May 2014 12:31:32 +0200 Subject: [PATCH 019/511] locale: rename in => word.in Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/dff38fc6eeb7e686523edbb44a3e4cfb13e55a7f Author: martii Date: 2014-05-06 (Tue, 06 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 2 +- data/locale/english.locale | 2 +- src/gui/eventlist.cpp | 2 +- src/gui/infoviewer.cpp | 2 +- src/system/locals.h | 2 +- src/system/locals_intern.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index c96d8a8db..116063cca 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -652,7 +652,6 @@ imageinfo.kernel Kernel: imageinfo.license Lizenz imageinfo.vcs Git: imageinfo.version Version: -in in inetradio.name Internetradio infoviewer.epgnotload Informationen noch nicht geladen... infoviewer.epgwait Warte auf EPG-Informationen... @@ -2120,6 +2119,7 @@ wizard.setup_type_hint Wählen Sie einfache Grundeinstellungen oder erweiterte A wizard.welcome_head Willkommen zur Ersteinrichtung Ihres Receivers! wizard.welcome_text Wir gratulieren Ihnen zum Kauf Ihrer CST. In den nun folgenden\nSchritten begleiten wir Sie durch die Erstinstallation des Gerätes.\nWir wünschen Ihnen viel Freude mit dem wohl einzigartigsten Receiver!\nBeachten Sie: Ihre CST Set-Top-Box lässt sich bequem per Webinterface\nsteuern, um zum Beispiel die Timer-Verwaltung zu nutzen oder Live-TV im Web-Browser zu schauen.\nAchten Sie darauf, dass Ihre Gerät nicht von aussen zugänglich ist,\nda sonst ein Zugriff über das Internet nicht ausgeschlossen werden kann!\nNächster Schritt? word.from ab +word.in in zapit.scantype Service-Auswahl zapit.scantype.all Alle Services zapit.scantype.radio Nur Radio diff --git a/data/locale/english.locale b/data/locale/english.locale index 07b43a090..a6d62f1c6 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -652,7 +652,6 @@ imageinfo.kernel Kernel: imageinfo.license License imageinfo.vcs Git: imageinfo.version Version: -in in inetradio.name Internetradio infoviewer.epgnotload EPG not loaded.... infoviewer.epgwait waiting for EPG... @@ -2120,6 +2119,7 @@ wizard.setup_type_hint Easy to setup for CanalDigitaal/TéléSAT/TV Vlaanderen p wizard.welcome_head Welcome to the Setup Wizard wizard.welcome_text Next steps will guide you through initial installation of the device.\nImportant: Your CST set-top box can be conveniently controlled\nwith the web interface for timer management or live TV on the Web browser.\nDo not make it accessible to untrusted networks!\nDo you want to continue? word.from from +word.in in zapit.scantype scan for services zapit.scantype.all all services zapit.scantype.radio only radio diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index e8ca2f0e8..8cca0c519 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -779,7 +779,7 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI) if ( (seit> 0) && (seit<100) && (duration_str.length()!=0) ) { char beginnt[100]; - snprintf(beginnt, sizeof(beginnt), "%s %d %s", g_Locale->getText(LOCALE_IN), seit, unit_short_minute); + snprintf(beginnt, sizeof(beginnt), "%s %d %s", g_Locale->getText(LOCALE_WORD_IN), seit, unit_short_minute); int w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(beginnt) + 10; g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20- w, ypos+ fheight1+3, fwidth2, beginnt, color); diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index a02dc0f11..149f9b064 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1671,7 +1671,7 @@ void CInfoViewer::show_Data (bool calledFromEvent) int rest = (info_CurrentNext.current_zeit.dauer / 60) - seit; if (jetzt < info_CurrentNext.current_zeit.startzeit) { runningPercent = 0; - snprintf (runningRest, sizeof(runningRest), "%s %d %s", g_Locale->getText(LOCALE_IN), seit, unit_short_minute); + snprintf (runningRest, sizeof(runningRest), "%s %d %s", g_Locale->getText(LOCALE_WORD_IN), seit, unit_short_minute); } else { runningPercent = (jetzt - info_CurrentNext.current_zeit.startzeit) * 100 / info_CurrentNext.current_zeit.dauer; if (runningPercent > 100) diff --git a/src/system/locals.h b/src/system/locals.h index c0665a000..4380963a5 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -679,7 +679,6 @@ typedef enum LOCALE_IMAGEINFO_LICENSE, LOCALE_IMAGEINFO_VCS, LOCALE_IMAGEINFO_VERSION, - LOCALE_IN, LOCALE_INETRADIO_NAME, LOCALE_INFOVIEWER_EPGNOTLOAD, LOCALE_INFOVIEWER_EPGWAIT, @@ -2147,6 +2146,7 @@ typedef enum LOCALE_WIZARD_WELCOME_HEAD, LOCALE_WIZARD_WELCOME_TEXT, LOCALE_WORD_FROM, + LOCALE_WORD_IN, LOCALE_ZAPIT_SCANTYPE, LOCALE_ZAPIT_SCANTYPE_ALL, LOCALE_ZAPIT_SCANTYPE_RADIO, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index c129e5cb9..27e78864f 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -679,7 +679,6 @@ const char * locale_real_names[] = "imageinfo.license", "imageinfo.vcs", "imageinfo.version", - "in", "inetradio.name", "infoviewer.epgnotload", "infoviewer.epgwait", @@ -2147,6 +2146,7 @@ const char * locale_real_names[] = "wizard.welcome_head", "wizard.welcome_text", "word.from", + "word.in", "zapit.scantype", "zapit.scantype.all", "zapit.scantype.radio", From 5c7d69daf10e08822a7a67d4643e4baec53ddc7c Mon Sep 17 00:00:00 2001 From: martii Date: Sat, 30 Nov 2013 15:19:52 +0100 Subject: [PATCH 020/511] gui/infoviewer: check for time being set Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ff06822dd0a77ed17e4621b6b233fb77d799fa8c Author: martii Date: 2013-11-30 (Sat, 30 Nov 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 149f9b064..afacc87eb 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -251,6 +251,9 @@ void CInfoViewer::changePB() void CInfoViewer::paintTime (bool show_dot) { + if (!gotTime) + gotTime = timeset; + if (! gotTime) return; From 35a12f9a02da62f26f22335296e95dbcdb9a7d91 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 7 May 2014 09:20:39 +0200 Subject: [PATCH 021/511] infoviewer: only show remaining time if time is set taken from martiis-neutrino-mp; based on code by seife; contains an addition to 95bc39c627575124cd7fb4414be9141d0b4950e7 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9d25727660819d81835a00adfc158c268102fc91 Author: vanhofen Date: 2014-05-07 (Wed, 07 May 2014) ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index afacc87eb..7d9f741d1 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -254,7 +254,7 @@ void CInfoViewer::paintTime (bool show_dot) if (!gotTime) gotTime = timeset; - if (! gotTime) + if (!gotTime) return; int clock_x = BoxEndX - time_width - LEFT_OFFSET; @@ -465,7 +465,7 @@ void CInfoViewer::show_current_next(bool new_chan, int epgpos) if (!(info_CurrentNext.flags & (CSectionsdClient::epgflags::has_later | CSectionsdClient::epgflags::has_current | CSectionsdClient::epgflags::not_broadcast))) { neutrino_locale_t loc; - if (! gotTime) + if (!gotTime) loc = LOCALE_INFOVIEWER_WAITTIME; else if (showButtonBar) loc = LOCALE_INFOVIEWER_EPGWAIT; @@ -1672,10 +1672,12 @@ void CInfoViewer::show_Data (bool calledFromEvent) if (info_CurrentNext.flags & CSectionsdClient::epgflags::has_current) { int seit = (abs(jetzt - info_CurrentNext.current_zeit.startzeit) + 30) / 60; int rest = (info_CurrentNext.current_zeit.dauer / 60) - seit; - if (jetzt < info_CurrentNext.current_zeit.startzeit) { - runningPercent = 0; - snprintf (runningRest, sizeof(runningRest), "%s %d %s", g_Locale->getText(LOCALE_WORD_IN), seit, unit_short_minute); - } else { + runningPercent = 0; + if (!gotTime) + snprintf(runningRest, sizeof(runningRest), "%d %s", info_CurrentNext.current_zeit.dauer / 60, unit_short_minute); + else if (jetzt < info_CurrentNext.current_zeit.startzeit) + snprintf(runningRest, sizeof(runningRest), "%s %d %s", g_Locale->getText(LOCALE_WORD_IN), seit, unit_short_minute); + else { runningPercent = (jetzt - info_CurrentNext.current_zeit.startzeit) * 100 / info_CurrentNext.current_zeit.dauer; if (runningPercent > 100) runningPercent = 100; From fe24da94d06e4bcfc1130563d9ee0e16a7a3fe46 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 8 May 2014 12:36:56 +0400 Subject: [PATCH 022/511] driver/rcinput.cpp: re-add shutdown after wakeup cancel, code from commit af3bd6e922e001266034eb07d34c6394b0c633c4 is lost after some pick ? Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c359fe4eaa5ef4fbef2dcff740533322fd134609 Author: [CST] Focus Date: 2014-05-08 (Thu, 08 May 2014) ------------------ This commit was generated by Migit --- src/driver/rcinput.cpp | 6 ++++++ src/driver/rcinput.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 0c89de40d..3a5783584 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -145,6 +145,7 @@ CRCInput::CRCInput() repeat_block = repeat_block_generic = 0; open(); rc_last_key = KEY_MAX; + firstKey = true; longPressEnd = 0; //select and setup remote control hardware @@ -1242,6 +1243,11 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 if (ev.type == EV_SYN) continue; /* ignore... */ SHTDCNT::getInstance()->resetSleepTimer(); + if (firstKey) { + firstKey = false; + CTimerManager::getInstance()->cancelShutdownOnWakeup(); + } + uint32_t trkey = translate(ev.code); #ifdef DEBUG printf("%d key: %04x value %d, translate: %04x -%s-\n", ev.value, ev.code, ev.value, trkey, getKeyName(trkey).c_str()); diff --git a/src/driver/rcinput.h b/src/driver/rcinput.h index 89f7f4100..f8dc8e906 100644 --- a/src/driver/rcinput.h +++ b/src/driver/rcinput.h @@ -154,6 +154,7 @@ class CRCInput int fd_max; int clickfd; + bool firstKey; __u16 rc_last_key; void set_dsp(); From 06269ca967071b1942035cc7f9c4b1bb8a2b4e27 Mon Sep 17 00:00:00 2001 From: gixxpunk Date: Thu, 8 May 2014 21:32:48 +0200 Subject: [PATCH 023/511] upnp browser: add menu hint Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f8840a8d5a8d7d1366133a9195d4fae80862c83a Author: gixxpunk Date: 2014-05-08 (Thu, 08 May 2014) Origin message was: ------------------ - upnp browser: add menu hint ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/mediaplayer.cpp | 1 + src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 5 files changed, 5 insertions(+) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 116063cca..c185bdcac 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1211,6 +1211,7 @@ menu.hint_timezone Wählen Sie ihre Zeitzone aus menu.hint_tools Werkzeuge ausführen menu.hint_tvmode Schaltet zum TV-Modus menu.hint_tvradio_switch Schaltet zwischen TV- und Radio-Modus um +menu.hint_upnp Universal Plug and Play Browser menu.hint_vfd Frontdisplay und Power-LEDs menu.hint_vfd_brightness Definiert die Helligkeit im TV-Betrieb menu.hint_vfd_brightness_setup Konfiguriert die Helligkeit des Frontdisplays für verschiedene Modi diff --git a/data/locale/english.locale b/data/locale/english.locale index a6d62f1c6..4f205e31f 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1211,6 +1211,7 @@ menu.hint_timezone Select your timezone menu.hint_tools Run tools menu.hint_tvmode Switch box to TV mode menu.hint_tvradio_switch Switches between TV and Radio mode +menu.hint_upnp Universal Plug and Play Browser menu.hint_vfd Frontpanel LEDS, VFD options menu.hint_vfd_brightness Working brightness menu.hint_vfd_brightness_setup Configure frontpanel display brightness\nfor different modes diff --git a/src/gui/mediaplayer.cpp b/src/gui/mediaplayer.cpp index d1970c75e..edd0e7af9 100644 --- a/src/gui/mediaplayer.cpp +++ b/src/gui/mediaplayer.cpp @@ -195,6 +195,7 @@ int CMediaPlayerMenu::initMenuMedia(CMenuWidget *m, CPersonalizeGui *p) if (!upnpbrowsergui) upnpbrowsergui = new CUpnpBrowserGui(); fw_upnp = new CMenuForwarder(LOCALE_UPNPBROWSER_HEAD, true, NULL, upnpbrowsergui, NULL, CRCInput::RC_0, NEUTRINO_ICON_BUTTON_0); + fw_upnp->setHint(NEUTRINO_ICON_HINT_A_PIC, LOCALE_MENU_HINT_UPNP); } #endif // media->addIntroItems(NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, usage_mode == MODE_AUDIO ? CMenuWidget::BTN_TYPE_CANCEL : CMenuWidget::BTN_TYPE_BACK); diff --git a/src/system/locals.h b/src/system/locals.h index 4380963a5..efeeef7b6 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1238,6 +1238,7 @@ typedef enum LOCALE_MENU_HINT_TOOLS, LOCALE_MENU_HINT_TVMODE, LOCALE_MENU_HINT_TVRADIO_SWITCH, + LOCALE_MENU_HINT_UPNP, LOCALE_MENU_HINT_VFD, LOCALE_MENU_HINT_VFD_BRIGHTNESS, LOCALE_MENU_HINT_VFD_BRIGHTNESS_SETUP, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 27e78864f..96e354eda 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1238,6 +1238,7 @@ const char * locale_real_names[] = "menu.hint_tools", "menu.hint_tvmode", "menu.hint_tvradio_switch", + "menu.hint_upnp", "menu.hint_vfd", "menu.hint_vfd_brightness", "menu.hint_vfd_brightness_setup", From 3cf91e6a4eb32c987306d79b5d6d87565786f4d5 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 9 May 2014 22:02:53 +0200 Subject: [PATCH 024/511] widget/listbox.cpp use paintButtons in foot Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/682b4b141ce2d62ec830035533da3e40c2ee487e Author: Jacek Jendrzej Date: 2014-05-09 (Fri, 09 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/listbox.cpp | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/gui/widget/listbox.cpp b/src/gui/widget/listbox.cpp index 236f4137e..12f711cf8 100644 --- a/src/gui/widget/listbox.cpp +++ b/src/gui/widget/listbox.cpp @@ -26,6 +26,7 @@ #endif #include +#include #include #include @@ -88,22 +89,16 @@ void CListBox::paintHead() void CListBox::paintFoot() { - int ButtonWidth = width / 4; - //frameBuffer->paintBoxRel(x,y+height, width,ButtonHeight, COL_MENUHEAD_PLUS_0); - frameBuffer->paintBoxRel(x, y+height, width, ButtonHeight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);//round - frameBuffer->paintHLine(x, x+width, y, COL_INFOBAR_SHADOW_PLUS_0); +const struct button_label ListButtons[] = +{ + { NEUTRINO_ICON_BUTTON_OKAY, LOCALE_CHANNELLIST_EDIT }, + { NEUTRINO_ICON_BUTTON_RED, LOCALE_BOUQUETEDITOR_ADD}, + { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_BOUQUETEDITOR_DELETE}, + { NEUTRINO_ICON_BUTTON_HOME, LOCALE_BOUQUETEDITOR_RETURN } +}; + const short numbuttons = sizeof(ListButtons)/sizeof(ListButtons[0]); + ::paintButtons(x, y + height-ButtonHeight, width, numbuttons, ListButtons, width, ButtonHeight); - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 4* ButtonWidth+ 8, y+height+1); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 4* ButtonWidth+ 38, y+height+24 - 2, width, "edit", COL_INFOBAR_TEXT); - - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, x+width- 3* ButtonWidth+ 8, y+height+4); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 3* ButtonWidth+ 29, y+height+24 - 2, width- 26, "add", COL_INFOBAR_TEXT); - - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RED, x+width- 2* ButtonWidth+ 8, y+height+4); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 2* ButtonWidth+ 29, y+height+24 - 2, width- 26, "remove", COL_INFOBAR_TEXT); - - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HOME, x+width - ButtonWidth+ 8, y+height+1); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width - ButtonWidth+ 38, y+height+24 - 2, width, "ready", COL_INFOBAR_TEXT); } void CListBox::paintItem(int pos) From d4f68a07925074a9850ac78018d9c2c99e6b39d5 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 9 May 2014 22:28:44 +0200 Subject: [PATCH 025/511] src/gui/bedit/bouqueteditor_chanselect.cpp: fix kill details line Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4f65a8d8234047b45ec52f7eef0e7b887c491955 Author: Jacek Jendrzej Date: 2014-05-09 (Fri, 09 May 2014) Origin message was: ------------------ src/gui/bedit/bouqueteditor_chanselect.cpp: fix kill details line ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/bedit/bouqueteditor_chanselect.cpp | 6 ++++++ src/gui/bedit/bouqueteditor_chanselect.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index c330a55cb..a44afd70f 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -319,3 +319,9 @@ void CBEChannelSelectWidget::initItem2DetailsLine (int pos, int /*ch_index*/) } } +void CBEChannelSelectWidget::hide() +{ + if (dline) + dline->kill(); //kill details line + CListBox::hide(); +} diff --git a/src/gui/bedit/bouqueteditor_chanselect.h b/src/gui/bedit/bouqueteditor_chanselect.h index 43bc6601e..f0cca9adf 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.h +++ b/src/gui/bedit/bouqueteditor_chanselect.h @@ -60,6 +60,7 @@ class CBEChannelSelectWidget : public CListBox void paintFoot(); void onOkKeyPressed(); void onRedKeyPressed(); + void hide(); int footerHeight; From 0b2a9b580fe1fe663be8cfd55983a6abd71ece2d Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 10 May 2014 19:25:59 +0200 Subject: [PATCH 026/511] src/gui/hdd_menu.cpp: remove '\n' for all msg Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8acad336baa3d65100ed038378f445f3f498ce9e Author: Jacek Jendrzej Date: 2014-05-10 (Sat, 10 May 2014) Origin message was: ------------------ src/gui/hdd_menu.cpp: remove '\n' for all msg ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/hdd_menu.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index bee9c69bd..64c10ff1f 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -1029,11 +1029,13 @@ int CHDDMenuHandler::checkDevice(std::string dev) progress->showLocalStatus(percent); } } - else if(!strncmp(buf, "Pass", 4)) { + else { char *t = strrchr(buf, '\n'); if (t) *t = 0; - progress->showStatusMessageUTF(buf); + if(!strncmp(buf, "Pass", 4)) { + progress->showStatusMessageUTF(buf); + } } } //printf("CHDDChkExec: %s\n", buf); From 92a6be85f7ff975725d4368653747d3bab8c9e11 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 14 May 2014 16:32:49 +0400 Subject: [PATCH 027/511] gui/miscsettings_menu.cpp: move epg scan OFF option to epg mode, reorder epg settings, add separators Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0c22682df3737e3e2c6340af76cfa0940e78a1e9 Author: [CST] Focus Date: 2014-05-14 (Wed, 14 May 2014) ------------------ This commit was generated by Migit --- data/locale/english.locale | 11 ++++++----- src/driver/scanepg.cpp | 13 ++++--------- src/driver/scanepg.h | 1 + src/gui/miscsettings_menu.cpp | 26 ++++++++++++++------------ src/gui/miscsettings_menu.h | 1 + src/neutrino.cpp | 16 +++++++++++----- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 8 files changed, 39 insertions(+), 31 deletions(-) diff --git a/data/locale/english.locale b/data/locale/english.locale index 4f205e31f..0d8d32309 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -860,8 +860,8 @@ menu.hint_epg_max_events Maximum events to cache. After reaching limit\nEPG cach menu.hint_epg_old_events Hours after event end time to consider\nevent old and remove it from cache menu.hint_epg_save Save cached EPG to harddisk or usb flash\nand load it after boot menu.hint_epg_save_standby Save EPG on soft standby mode -menu.hint_epg_scan Enable background epg scan using free tuner,\ncurrent bouquet or all favorites -menu.hint_epg_scan_mode Select box state to run epg scan +menu.hint_epg_scan Select bouquets to scan epg, current on zap,\nall or selected favorites +menu.hint_epg_scan_mode Enable background epg scan using free tuner menu.hint_event_textcolor Change event color for colored-event options\nin channel list and infobar menu.hint_eventlist_additional Show additional informations\nin main box menu.hint_eventlist_fonts Change event list font sizes @@ -1276,10 +1276,11 @@ miscsettings.epg_old_events_hint1 How long will EPG-Data be stored after they ti miscsettings.epg_old_events_hint2 Set in hours miscsettings.epg_save Save/Restore epg on reboot miscsettings.epg_save_standby Save epg on soft standby -miscsettings.epg_scan EPG scan +miscsettings.epg_scan EPG scan mode miscsettings.epg_scan_always Always -miscsettings.epg_scan_bq bouquet -miscsettings.epg_scan_fav favorites +miscsettings.epg_scan_bouquets EPG scan bouquets +miscsettings.epg_scan_bq Current +miscsettings.epg_scan_fav Favorites miscsettings.epg_scan_live Live miscsettings.epg_scan_sel Selected miscsettings.epg_scan_standby Standby diff --git a/src/driver/scanepg.cpp b/src/driver/scanepg.cpp index db30ed3f1..f60410aea 100644 --- a/src/driver/scanepg.cpp +++ b/src/driver/scanepg.cpp @@ -172,14 +172,14 @@ void CEpgScan::AddTransponders() AddBouquet(bouquetList->Bouquets[current_bnum]->channelList); INFO("Added bouquet #%d, scan map size: %d", current_bnum, scanmap.size()); } - } else { + } else if (g_settings.epg_scan == SCAN_FAV) { AddFavorites(); } } bool CEpgScan::CheckMode() { - if (!g_settings.epg_scan + if ((g_settings.epg_scan_mode == CEpgScan::MODE_OFF) || (standby && !(g_settings.epg_scan_mode & MODE_STANDBY)) || (!standby && !(g_settings.epg_scan_mode & MODE_LIVE)) || (!standby && (CFEManager::getInstance()->getEnabledCount() <= 1))) { @@ -201,7 +201,7 @@ void CEpgScan::Start(bool instandby) void CEpgScan::Stop() { - if (!g_settings.epg_scan) + if (g_settings.epg_scan_mode == CEpgScan::MODE_OFF) return; INFO("stopping %s scan...", standby ? "standby" : "live"); @@ -306,12 +306,7 @@ void CEpgScan::Next() bool locked = false; next_chid = 0; -#if 0 - if (!g_settings.epg_scan) - return; - if (!CheckMode()) - return; -#endif + if (!standby && CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_standby) return; if (CRecordManager::getInstance()->RecordingStatus() || CStreamManager::getInstance()->StreamStatus()) diff --git a/src/driver/scanepg.h b/src/driver/scanepg.h index 989e2a63b..0bcbca2d7 100644 --- a/src/driver/scanepg.h +++ b/src/driver/scanepg.h @@ -36,6 +36,7 @@ class CEpgScan SCAN_SEL }; enum { + MODE_OFF = 0, MODE_LIVE = 0x1, MODE_STANDBY = 0x2, MODE_ALWAYS = 0x3 diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 43d8dbae9..3c23a55e5 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -204,7 +204,6 @@ const CMenuOptionChooser::keyval_ext CPU_FREQ_OPTIONS[CPU_FREQ_OPTION_COUNT] = const CMenuOptionChooser::keyval EPG_SCAN_OPTIONS[] = { - { CEpgScan::SCAN_OFF, LOCALE_OPTIONS_OFF }, { CEpgScan::SCAN_CURRENT, LOCALE_MISCSETTINGS_EPG_SCAN_BQ }, { CEpgScan::SCAN_FAV, LOCALE_MISCSETTINGS_EPG_SCAN_FAV }, { CEpgScan::SCAN_SEL, LOCALE_MISCSETTINGS_EPG_SCAN_SEL }, @@ -213,8 +212,9 @@ const CMenuOptionChooser::keyval EPG_SCAN_OPTIONS[] = const CMenuOptionChooser::keyval EPG_SCAN_MODE_OPTIONS[] = { - { CEpgScan::MODE_LIVE, LOCALE_MISCSETTINGS_EPG_SCAN_LIVE }, + { CEpgScan::MODE_OFF, LOCALE_OPTIONS_OFF }, { CEpgScan::MODE_STANDBY, LOCALE_MISCSETTINGS_EPG_SCAN_STANDBY }, + { CEpgScan::MODE_LIVE, LOCALE_MISCSETTINGS_EPG_SCAN_LIVE }, { CEpgScan::MODE_ALWAYS, LOCALE_MISCSETTINGS_EPG_SCAN_ALWAYS } }; #define EPG_SCAN_MODE_OPTION_COUNT (sizeof(EPG_SCAN_MODE_OPTIONS)/sizeof(CMenuOptionChooser::keyval)) @@ -309,6 +309,7 @@ int CMiscMenue::showMiscSettingsMenu() delete miscNotifier; #endif delete miscEpgNotifier; + delete miscEpgScanNotifier; return res; } @@ -461,32 +462,33 @@ void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg) miscEpgNotifier = new COnOffNotifier(); miscEpgNotifier->addItem(mc1); - //miscEpgNotifier->addItem(mf); - //miscEpgNotifier->addItem(mf1); - //miscEpgNotifier->addItem(mf2); - //miscEpgNotifier->addItem(mf3); miscEpgNotifier->addItem(mf4); CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE, &g_settings.epg_save, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true,miscEpgNotifier); mc->setHint("", LOCALE_MENU_HINT_EPG_SAVE); - CMenuOptionChooser * mc2 = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SCAN, &g_settings.epg_scan, EPG_SCAN_OPTIONS, EPG_SCAN_OPTION_COUNT, - true /*CFEManager::getInstance()->getEnabledCount() > 1*/); + CMenuOptionChooser * mc2 = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SCAN_BOUQUETS, &g_settings.epg_scan, EPG_SCAN_OPTIONS, EPG_SCAN_OPTION_COUNT, + g_settings.epg_scan_mode != CEpgScan::MODE_OFF); mc2->setHint("", LOCALE_MENU_HINT_EPG_SCAN); - CMenuOptionChooser * mc3 = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SCAN, &g_settings.epg_scan_mode, EPG_SCAN_MODE_OPTIONS, EPG_SCAN_MODE_OPTION_COUNT, - CFEManager::getInstance()->getEnabledCount() > 1); + miscEpgScanNotifier = new COnOffNotifier(); + miscEpgScanNotifier->addItem(mc2); + + CMenuOptionChooser * mc3 = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SCAN, &g_settings.epg_scan_mode, EPG_SCAN_MODE_OPTIONS, + CFEManager::getInstance()->getEnabledCount() > 1 ? EPG_SCAN_MODE_OPTION_COUNT : 2, true, miscEpgScanNotifier); mc3->setHint("", LOCALE_MENU_HINT_EPG_SCAN_MODE); ms_epg->addItem(mc); ms_epg->addItem(mc1); + ms_epg->addItem(mf4); + ms_epg->addItem(GenericMenuSeparatorLine); ms_epg->addItem(mf); ms_epg->addItem(mf1); ms_epg->addItem(mf2); ms_epg->addItem(mf3); - ms_epg->addItem(mf4); - ms_epg->addItem(mc2); + ms_epg->addItem(GenericMenuSeparatorLine); ms_epg->addItem(mc3); + ms_epg->addItem(mc2); } //filebrowser settings diff --git a/src/gui/miscsettings_menu.h b/src/gui/miscsettings_menu.h index 16c2c2968..8958c0aae 100644 --- a/src/gui/miscsettings_menu.h +++ b/src/gui/miscsettings_menu.h @@ -42,6 +42,7 @@ class CMiscMenue : public CMenuTarget, CChangeObserver CSectionsdConfigNotifier* sectionsdConfigNotifier; //COnOffNotifier* miscNotifier; COnOffNotifier* miscEpgNotifier; + COnOffNotifier* miscEpgScanNotifier; int width; std::string epg_cache; std::string epg_extendedcache; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 53e5cc40b..30413396a 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -469,8 +469,13 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.epg_save = configfile.getBool("epg_save", false); g_settings.epg_save_standby = configfile.getBool("epg_save_standby", true); - g_settings.epg_scan = configfile.getInt32("epg_scan", 0); - g_settings.epg_scan_mode = configfile.getInt32("epg_scan_mode", CEpgScan::MODE_ALWAYS); + g_settings.epg_scan = configfile.getInt32("epg_scan", CEpgScan::SCAN_CURRENT); + g_settings.epg_scan_mode = configfile.getInt32("epg_scan_mode", CEpgScan::MODE_OFF); + // backward-compatible check + if (g_settings.epg_scan == 0) { + g_settings.epg_scan = CEpgScan::SCAN_CURRENT; + g_settings.epg_scan_mode = CEpgScan::MODE_OFF; + } //widget settings g_settings.widget_fade = false; g_settings.widget_fade = configfile.getBool("widget_fade" , false ); @@ -2141,7 +2146,7 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) StartSubtitles(); saveSetup(NEUTRINO_SETTINGS_FILE); if (old_epg != g_settings.epg_scan || old_mode != g_settings.epg_scan_mode) { - if (g_settings.epg_scan) + if (g_settings.epg_scan_mode != CEpgScan::MODE_OFF) CEpgScan::getInstance()->Start(); else CEpgScan::getInstance()->Clear(); @@ -3400,7 +3405,8 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) g_Zapit->stopPip(); #endif bool stream_status = CStreamManager::getInstance()->StreamStatus(); - if(!g_settings.epg_scan && !fromDeepStandby && !CRecordManager::getInstance()->RecordingStatus() && !stream_status) { + if((g_settings.epg_scan_mode == CEpgScan::MODE_OFF) && !fromDeepStandby && + !CRecordManager::getInstance()->RecordingStatus() && !stream_status) { g_Zapit->setStandby(true); } else { //g_Zapit->stopPlayBack(); @@ -3753,7 +3759,7 @@ void stop_daemons(bool stopall, bool for_flash) CVFD::getInstance()->Clear(); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); CVFD::getInstance()->ShowText("Stop daemons..."); - g_settings.epg_scan = false; + g_settings.epg_scan_mode = CEpgScan::MODE_OFF; my_system(NEUTRINO_ENTER_FLASH_SCRIPT); } diff --git a/src/system/locals.h b/src/system/locals.h index efeeef7b6..de995812e 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1305,6 +1305,7 @@ typedef enum LOCALE_MISCSETTINGS_EPG_SAVE_STANDBY, LOCALE_MISCSETTINGS_EPG_SCAN, LOCALE_MISCSETTINGS_EPG_SCAN_ALWAYS, + LOCALE_MISCSETTINGS_EPG_SCAN_BOUQUETS, LOCALE_MISCSETTINGS_EPG_SCAN_BQ, LOCALE_MISCSETTINGS_EPG_SCAN_FAV, LOCALE_MISCSETTINGS_EPG_SCAN_LIVE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 96e354eda..17f3ea646 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1305,6 +1305,7 @@ const char * locale_real_names[] = "miscsettings.epg_save_standby", "miscsettings.epg_scan", "miscsettings.epg_scan_always", + "miscsettings.epg_scan_bouquets", "miscsettings.epg_scan_bq", "miscsettings.epg_scan_fav", "miscsettings.epg_scan_live", From 885a32dd9138ff532375aea5ef96a514a425e92f Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 14 May 2014 19:28:37 +0400 Subject: [PATCH 028/511] gui/audio_setup.cpp: add option to set static volume on boot Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/44bfc6f746d50be10b9ee887cd66a280fc8b7b83 Author: [CST] Focus Date: 2014-05-14 (Wed, 14 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/english.locale | 2 ++ src/gui/audio_setup.cpp | 5 +++++ src/neutrino.cpp | 17 +++++++++++++---- src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ src/system/settings.h | 1 + 6 files changed, 25 insertions(+), 4 deletions(-) diff --git a/data/locale/english.locale b/data/locale/english.locale index 0d8d32309..0b3420de8 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -128,6 +128,7 @@ audiomenu.pref_subs_head Subtitle language preferences audiomenu.spdif_dd Encoded DD on SPDIF audiomenu.stereo stereo audiomenu.volume_adjust Volume adjustment, in % +audiomenu.volume_start Start volume audiomenu.volume_step Volume step audioplayer.add Add audioplayer.add_ic Icecast @@ -807,6 +808,7 @@ menu.hint_audio_srs_algo Amount of control, light or normal menu.hint_audio_srs_nmgr Noise manager menu.hint_audio_srs_volume Reference level to maintain menu.hint_audio_volstep Volume +/- keys increase/decrease step +menu.hint_audio_volstart Always set selected volume value on boot menu.hint_audioplayer_defdir Default audioplayer directory menu.hint_audioplayer_follow Move playlist selected pointer\nto current playing song menu.hint_audioplayer_highprio Increase playback priority diff --git a/src/gui/audio_setup.cpp b/src/gui/audio_setup.cpp index c1b7daf97..5b854d798 100644 --- a/src/gui/audio_setup.cpp +++ b/src/gui/audio_setup.cpp @@ -150,6 +150,7 @@ int CAudioSetup::showAudioSetup() CMenuOptionChooser * as_oj_avsync = NULL; CMenuOptionNumberChooser * as_oj_vsteps = NULL; + CMenuOptionNumberChooser * st = NULL; if (!g_settings.easymenu) { //av synch as_oj_avsync = new CMenuOptionChooser(LOCALE_AUDIOMENU_AVSYNC, &g_settings.avsync, AUDIOMENU_AVSYNC_OPTIONS, AUDIOMENU_AVSYNC_OPTION_COUNT, true, audioSetupNotifier); @@ -158,6 +159,9 @@ int CAudioSetup::showAudioSetup() //volume steps as_oj_vsteps = new CMenuOptionNumberChooser(LOCALE_AUDIOMENU_VOLUME_STEP, (int *)&g_settings.current_volume_step, true, 1, 25, NULL); as_oj_vsteps->setHint("", LOCALE_MENU_HINT_AUDIO_VOLSTEP); + + st = new CMenuOptionNumberChooser(LOCALE_AUDIOMENU_VOLUME_START, &g_settings.start_volume, true, -1, 100, NULL, 0, -1, LOCALE_OPTIONS_OFF); + st->setHint("", LOCALE_MENU_HINT_AUDIO_VOLSTART); //clock rec //CMenuOptionChooser * as_oj_clockrec new CMenuOptionChooser(LOCALE_AUDIOMENU_CLOCKREC, &g_settings.clockrec, AUDIOMENU_CLOCKREC_OPTIONS, AUDIOMENU_CLOCKREC_OPTION_COUNT, true, audioSetupNotifier); } @@ -194,6 +198,7 @@ int CAudioSetup::showAudioSetup() audioSettings->addItem(GenericMenuSeparatorLine); audioSettings->addItem(as_oj_avsync); audioSettings->addItem(as_oj_vsteps); + audioSettings->addItem(st); //audioSettings->addItem(as_clockrec); } //--------------------------------------------------------- diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 30413396a..e05be7ae9 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -335,6 +335,10 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.video_43mode = configfile.getInt32("video_43mode", DISPLAY_AR_MODE_LETTERBOX); g_settings.current_volume = configfile.getInt32("current_volume", 50); g_settings.current_volume_step = configfile.getInt32("current_volume_step", 2); + g_settings.start_volume = configfile.getInt32("start_volume", -1); + if (g_settings.start_volume >= 0) + g_settings.current_volume = g_settings.start_volume; + g_settings.channel_mode = configfile.getInt32("channel_mode", LIST_MODE_PROV); g_settings.channel_mode_radio = configfile.getInt32("channel_mode_radio", LIST_MODE_PROV); g_settings.channel_mode_initial = configfile.getInt32("channel_mode_initial", -1); @@ -885,6 +889,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "current_volume", g_settings.current_volume ); configfile.setInt32( "current_volume_step", g_settings.current_volume_step ); + configfile.setInt32( "start_volume", g_settings.start_volume ); configfile.setInt32( "channel_mode", g_settings.channel_mode ); configfile.setInt32( "channel_mode_radio", g_settings.channel_mode_radio ); configfile.setInt32( "channel_mode_initial", g_settings.channel_mode_initial ); @@ -1955,9 +1960,6 @@ TIMER_START(); CEitManager::getInstance()->Start(); #endif - CVFD::getInstance()->showVolume(g_settings.current_volume); - CVFD::getInstance()->setMuted(current_muted); - g_RemoteControl = new CRemoteControl; g_EpgData = new CEpgData; g_InfoViewer = new CInfoViewer; @@ -1992,9 +1994,17 @@ TIMER_START(); InitTimerdClient(); + // volume + if (g_settings.show_mute_icon && g_settings.current_volume == 0) + current_muted = true; + g_volume = CVolume::getInstance(); g_audioMute = CAudioMute::getInstance(); + g_audioMute->AudioMute(current_muted, true); + CVFD::getInstance()->showVolume(g_settings.current_volume); + CVFD::getInstance()->setMuted(current_muted); + if (show_startwizard) { hintBox->hide(); CStartUpWizard startwizard; @@ -2017,7 +2027,6 @@ TIMER_START(); cCA::GetInstance()->Ready(true); InitZapper(); - g_audioMute->AudioMute(current_muted, true); SHTDCNT::getInstance()->init(); hintBox->hide(); diff --git a/src/system/locals.h b/src/system/locals.h index de995812e..da3c680f8 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -155,6 +155,7 @@ typedef enum LOCALE_AUDIOMENU_SPDIF_DD, LOCALE_AUDIOMENU_STEREO, LOCALE_AUDIOMENU_VOLUME_ADJUST, + LOCALE_AUDIOMENU_VOLUME_START, LOCALE_AUDIOMENU_VOLUME_STEP, LOCALE_AUDIOPLAYER_ADD, LOCALE_AUDIOPLAYER_ADD_IC, @@ -833,6 +834,7 @@ typedef enum LOCALE_MENU_HINT_AUDIO_SRS_ALGO, LOCALE_MENU_HINT_AUDIO_SRS_NMGR, LOCALE_MENU_HINT_AUDIO_SRS_VOLUME, + LOCALE_MENU_HINT_AUDIO_VOLSTART, LOCALE_MENU_HINT_AUDIO_VOLSTEP, LOCALE_MENU_HINT_AUDIOPLAYER_DEFDIR, LOCALE_MENU_HINT_AUDIOPLAYER_FOLLOW, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 17f3ea646..817bf87a8 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -155,6 +155,7 @@ const char * locale_real_names[] = "audiomenu.spdif_dd", "audiomenu.stereo", "audiomenu.volume_adjust", + "audiomenu.volume_start", "audiomenu.volume_step", "audioplayer.add", "audioplayer.add_ic", @@ -833,6 +834,7 @@ const char * locale_real_names[] = "menu.hint_audio_srs_algo", "menu.hint_audio_srs_nmgr", "menu.hint_audio_srs_volume", + "menu.hint_audio_volstart", "menu.hint_audio_volstep", "menu.hint_audioplayer_defdir", "menu.hint_audioplayer_follow", diff --git a/src/system/settings.h b/src/system/settings.h index 6ae6e2457..cd1b60fbf 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -63,6 +63,7 @@ struct SNeutrinoSettings #endif char current_volume; int current_volume_step; + int start_volume; int channel_mode; int channel_mode_radio; int channel_mode_initial; From a4dbfa2e4e279eba9b162cf1105e135467c6626b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 14 May 2014 22:10:32 +0200 Subject: [PATCH 029/511] deutsch.locale: update Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5f99e88ba23091164e4d60e74ceca21a898f1e52 Author: vanhofen Date: 2014-05-14 (Wed, 14 May 2014) Origin message was: ------------------ - deutsch.locale: update ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index c185bdcac..5825e5cd9 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -128,6 +128,7 @@ audiomenu.pref_subs_head Untertitelwahl audiomenu.spdif_dd Dolby Digital über S/PDIF audiomenu.stereo stereo audiomenu.volume_adjust Lautstärke ändern, in % +audiomenu.volume_start Einschaltlautstärke audiomenu.volume_step Lautstärke Schrittweite audioplayer.add Hinzufügen audioplayer.add_ic Icecast @@ -806,6 +807,7 @@ menu.hint_audio_srs Schalten Sie SRS TruVolume ein oder aus menu.hint_audio_srs_algo Stellen Sie die Betriebsarten von SRS TruVolume ein menu.hint_audio_srs_nmgr Schalten Sie den NoiseManager ein oder aus menu.hint_audio_srs_volume Legen Sie die Referenzlautstärke für SRS TruVolume fest +menu.hint_audio_volstart Legen Sie die Einschaltlautstärke fest, die immer beim Starten eingestellt werden soll menu.hint_audio_volstep Beim Betätigen der Lautstärketasten wird die Lautstärke immer schrittweise nach diesem Wert geändert menu.hint_audioplayer_defdir Wählen Sie das Startverzeichnis für den Audioplayer menu.hint_audioplayer_follow Das Auswählen eines aktuellen Titels in der Wiedergabeliste zulassen @@ -860,8 +862,8 @@ menu.hint_epg_max_events Maxiale Anzahl der Events im Zwischenspeicher menu.hint_epg_old_events Veraltete EPG-Daten werden nach dieser Zeit (in Stunden) verworfen menu.hint_epg_save Speichert die EPG-Daten auf einem externen Datenträger und läd es von dort nach einen Neustart menu.hint_epg_save_standby Speichert die EPG-Daten auch im Standby-Modus -menu.hint_epg_scan Aktivieren Sie den Hintergrundscan der EPG-Daten, wenn ein freier Tuner vorhanden ist, im aktuellen Bouquet oder in allen Favoriten -menu.hint_epg_scan_mode Wählen Sie den Modus für den EPG Scan aus. +menu.hint_epg_scan Zu scannende Bouquets wählen. Aktuelles Bouquet beim Umschalten, markierte Bouquets oder alle Favoriten +menu.hint_epg_scan_mode Aktivieren Sie den Hintergrundscan der EPG-Daten, wenn ein freier Tuner vorhanden ist menu.hint_event_textcolor Ändern Sie die Farbe für farbige Events in der Kanalliste und der Infobar menu.hint_eventlist_additional Definiert, ob zusätzliche Informationen im Hauptfenster angezeigt werden sollen menu.hint_eventlist_fonts Ändern Sie die Schriftgröße in der Event-Liste @@ -1278,6 +1280,7 @@ miscsettings.epg_save EPG zwischenspeichern miscsettings.epg_save_standby EPG speichern in Standby-Modus miscsettings.epg_scan Hintergrundscan EPG miscsettings.epg_scan_always Immer +miscsettings.epg_scan_bouquets Zu scannende Bouquets miscsettings.epg_scan_bq Aktuelles Bouquet miscsettings.epg_scan_fav Alle Favoriten miscsettings.epg_scan_live Bei eingeschalteter Box From 9ede0965b583808139b7b6e3c8af304a5a84eec7 Mon Sep 17 00:00:00 2001 From: martii Date: Tue, 13 May 2014 21:07:48 +0200 Subject: [PATCH 030/511] gui/keybind_setup:checkLongPress(): return true for RC_standby Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/17774a41b79f3e75bb31996eb8027a615022ea45 Author: martii Date: 2014-05-13 (Tue, 13 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/keybind_setup.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index e47d742a9..94598bdfa 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -199,6 +199,8 @@ bool checkLongPress(uint32_t key) { if (g_settings.longkeypress_duration == LONGKEYPRESS_OFF) return false; + if (key == CRCInput::RC_standby) + return true; key |= CRCInput::RC_Repeat; for (unsigned int i = 0; i < CKeybindSetup::KEYBINDS_COUNT; i++) if ((uint32_t)*key_settings[i].keyvalue_p == key) From d7cbcf6e32003a95f3af5c9490d351344426a06a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 4 May 2014 20:18:15 +0200 Subject: [PATCH 031/511] COPKGManager: remove unused variable Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/53e734e7c335158147c84b396ce87d7b0303e950 Author: Thilo Graf Date: 2014-05-04 (Sun, 04 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/opkg_manager.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index 7bac91044..3a6067ed5 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -82,7 +82,6 @@ static const std::string pkg_types[OM_MAX] = COPKGManager::COPKGManager() { width = w_max (40, 10); //% - frameBuffer = CFrameBuffer::getInstance(); pkg_map.clear(); list_installed_done = false; list_upgradeable_done = false; From e789ac01a53b800e976ff5cfdf24bad1449cd5d9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 4 May 2014 20:28:37 +0200 Subject: [PATCH 032/511] COPKGManager: use of appropriate width Most entries are larger then 40% and in case of failed package update, window is too small. Displayerrors in footer bar are possible. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a323173aed3c806cee026751691afb2839c10425 Author: Thilo Graf Date: 2014-05-04 (Sun, 04 May 2014) ------------------ This commit was generated by Migit --- src/gui/opkg_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index 3a6067ed5..c2d7c924a 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -81,7 +81,7 @@ static const std::string pkg_types[OM_MAX] = COPKGManager::COPKGManager() { - width = w_max (40, 10); //% + width = w_max (80, 10); //% pkg_map.clear(); list_installed_done = false; list_upgradeable_done = false; From 628f89e78711d9e675b3e1d8dbecee9d46d4576f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 2 May 2014 16:14:29 +0200 Subject: [PATCH 033/511] gui/customcolor.h: add COL_OLIVE Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/399c4e9c943df6feb0ca207ea77b1dff909cde15 Author: Thilo Graf Date: 2014-05-02 (Fri, 02 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/customcolor.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/customcolor.h b/src/gui/customcolor.h index 47a6020cc..8d5be708a 100644 --- a/src/gui/customcolor.h +++ b/src/gui/customcolor.h @@ -13,6 +13,7 @@ */ #define COL_DARK_RED 0x02 #define COL_DARK_GREEN 0x03 +#define COL_OLIVE 0x04 #define COL_DARK_BLUE 0x05 #define COL_LIGHT_GRAY 0x08 #define COL_DARK_GRAY 0x09 @@ -27,6 +28,7 @@ #else #define COL_DARK_RED0 0x02 #define COL_DARK_GREEN0 0x03 +#define COL_OLIVE0 0x04 #define COL_DARK_BLUE0 0x05 #define COL_LIGHT_GRAY0 0x08 #define COL_DARK_GRAY0 0x09 @@ -41,6 +43,7 @@ #define COL_DARK_RED (CFrameBuffer::getInstance()->realcolor[0x02]) #define COL_DARK_GREEN (CFrameBuffer::getInstance()->realcolor[0x03]) +#define COL_OLIVE (CFrameBuffer::getInstance()->realcolor[0x04]) #define COL_DARK_BLUE (CFrameBuffer::getInstance()->realcolor[0x05]) #define COL_LIGHT_GRAY (CFrameBuffer::getInstance()->realcolor[0x08]) #define COL_DARK_GRAY (CFrameBuffer::getInstance()->realcolor[0x09]) From 224683488115d1cf543da579a90a871312d13e1f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 3 May 2014 22:28:03 +0200 Subject: [PATCH 034/511] CBox:remove unused members Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9bba42a3d9d696268f3767c36a6ae44b43750ab1 Author: Thilo Graf Date: 2014-05-03 (Sat, 03 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/textbox.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/gui/widget/textbox.h b/src/gui/widget/textbox.h index b748e9f84..a7b5aa089 100644 --- a/src/gui/widget/textbox.h +++ b/src/gui/widget/textbox.h @@ -68,12 +68,6 @@ class CBox { - protected: - int *pX; - int *pY; - int *pWidth; - int *pHeight; - public: /* Constructor */ inline CBox(){iX=0; iY=0; iWidth=0; iHeight=0;}; From 4b8d195850c4812ced7f68c2987e9cfb6f1b785f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 3 May 2014 17:15:22 +0200 Subject: [PATCH 035/511] CFrameBuffer: add function to get icon base path Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/06a5f568a93e020815bfd30ed5d785114c13ca94 Author: Thilo Graf Date: 2014-05-03 (Sat, 03 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/framebuffer.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/driver/framebuffer.h b/src/driver/framebuffer.h index 575c2510a..401b572c6 100644 --- a/src/driver/framebuffer.h +++ b/src/driver/framebuffer.h @@ -198,6 +198,7 @@ class CFrameBuffer void paintHLineRel(int x, int dx, int y, const fb_pixel_t col); void setIconBasePath(const std::string & iconPath); + std::string getIconBasePath(){return iconBasePath;}; void getIconSize(const char * const filename, int* width, int *height); /* h is the height of the target "window", if != 0 the icon gets centered in that window */ From b9664a3ae4216bb9e939673b3428a97d33139016 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Apr 2014 16:13:06 +0200 Subject: [PATCH 036/511] CImageInfo: reduce font size of button Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/43637941acfc39dffc3b76c28a3eee68ddcf6cba Author: Thilo Graf Date: 2014-04-27 (Sun, 27 Apr 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/imageinfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 8675636e0..7cc02b4c1 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -185,7 +185,8 @@ void CImageInfo::ShowWindow() cc_win->setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); footer = cc_win->getFooterObject(); footer->setColorBody(COL_INFOBAR_SHADOW_PLUS_1); - btn_red = new CComponentsButtonRed(10, CC_CENTERED, 250, footer->getHeight(), LOCALE_BUILDINFO_MENU, footer, false , true, false, footer->getColorBody(), footer->getColorBody()); + int h_footer = footer->getHeight(); + btn_red = new CComponentsButtonRed(10, CC_CENTERED, 250, h_footer-h_footer/4, LOCALE_BUILDINFO_MENU, footer, false , true, false, footer->getColorBody(), footer->getColorBody()); } //prepare minitv From ad2195b4e26f6df90a2be02b0a6e85b2e514fe56 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Apr 2014 16:30:26 +0200 Subject: [PATCH 037/511] CImageInfo: remove superfluous assign of footer color Is default assigned with same color. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/09e529741aacea3ca4f4009ae6d50b7e23760e71 Author: Thilo Graf Date: 2014-04-27 (Sun, 27 Apr 2014) ------------------ This commit was generated by Migit --- src/gui/imageinfo.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 7cc02b4c1..43ceb3240 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -184,7 +184,6 @@ void CImageInfo::ShowWindow() cc_win = new CComponentsWindowMax(LOCALE_IMAGEINFO_HEAD, NEUTRINO_ICON_INFO, 0, CC_SHADOW_ON); cc_win->setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); footer = cc_win->getFooterObject(); - footer->setColorBody(COL_INFOBAR_SHADOW_PLUS_1); int h_footer = footer->getHeight(); btn_red = new CComponentsButtonRed(10, CC_CENTERED, 250, h_footer-h_footer/4, LOCALE_BUILDINFO_MENU, footer, false , true, false, footer->getColorBody(), footer->getColorBody()); } From 83ee5b664651e437495673c3f2fd3d19f91146a3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 5 May 2014 18:52:21 +0200 Subject: [PATCH 038/511] CComponents/CComponentsItem: add advanced version of kill() kill() allows now paint with defined colors over rendered objects without restore of background. It's similar to paintBackgroundBoxRel() known from CFrameBuffer, but with possiblity to define color, default color is 0 like before (empty background). Items with parent bindings use the background color of its parent as default, but can also be ignored. This function can be useful before repaint of items and/or, if required, to have a clean background inside item containers. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6a2e701a7ab925c580af78b53b9f70e4e494f656 Author: Thilo Graf Date: 2014-05-05 (Mon, 05 May 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_base.cpp | 12 ++++++++---- src/gui/components/cc_base.h | 12 ++++++++++-- src/gui/components/cc_item.cpp | 16 ++++++++++++++++ 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_base.cpp b/src/gui/components/cc_base.cpp index d704dfb43..009ef49c9 100644 --- a/src/gui/components/cc_base.cpp +++ b/src/gui/components/cc_base.cpp @@ -227,11 +227,15 @@ inline void CComponents::hide() is_painted = false; } -//erase rendered objects -void CComponents::kill() +//erase or paint over rendered objects +void CComponents::kill(const fb_pixel_t& bg_color) { - for(size_t i =0; i< v_fbdata.size() ;i++) - frameBuffer->paintBackgroundBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy); + for(size_t i =0; i< v_fbdata.size() ;i++){ + if (bg_color) + frameBuffer->paintBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, bg_color, v_fbdata[i].r, corner_type); + else + frameBuffer->paintBackgroundBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy); + } clearFbData(); firstPaint = true; is_painted = false; diff --git a/src/gui/components/cc_base.h b/src/gui/components/cc_base.h index 57db14785..819a2e60b 100644 --- a/src/gui/components/cc_base.h +++ b/src/gui/components/cc_base.h @@ -201,8 +201,11 @@ class CComponents ///hide current screen and restore background virtual void hide(); - ///erase current screen without restore of background, it's similar to paintBackgroundBoxRel() from CFrameBuffer - virtual void kill(); + + ///erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known + ///from CFrameBuffer but with possiblity to define color, default color is 0 (empty background) + virtual void kill(const fb_pixel_t& bg_color = 0); + ///returns paint mode, true=item was painted virtual bool isPainted(){return is_painted;} ///allows paint of elementary item parts (shadow, frame and body), similar as background, set it usually to false, if item used in a form @@ -262,6 +265,11 @@ class CComponentsItem : public CComponents ///hides item, arg: no_restore see hideCCItem() above virtual void hide(bool no_restore = false); + ///erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known + ///from CFrameBuffer but with possiblity to define color, default color is 0 (empty background) + ///NOTE: Items with parent binding use the parent background color as default! Set parameter 'ignore_parent=true' to ignore parent background color! + virtual void kill(const fb_pixel_t& bg_color = 0, bool ignore_parent = false); + ///get the current item type, see attribute cc_item_type above virtual int getItemType(); ///syncronizes item colors with current color settings if required, NOTE: overwrites internal values! diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index a35b2e33c..5819ad774 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -133,6 +133,22 @@ void CComponentsItem::hide(bool no_restore) hideCCItem(no_restore); } +//erase or paint over rendered objects +void CComponentsItem::kill(const fb_pixel_t& bg_color, bool ignore_parent) +{ + if(bg_color || cc_parent == NULL){ + CComponents::kill(bg_color); + return; + } + + if (cc_parent){ + if(bg_color || ignore_parent) + CComponents::kill(bg_color); + else + CComponents::kill(cc_parent->getColorBody()); + } +} + //synchronize colors for forms //This is usefull if the system colors are changed during runtime //so you can ensure correct applied system colors in relevant objects with unchanged instances. From f46716651cb452b2c73b28759bd21e998fa8338d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Apr 2014 23:48:02 +0200 Subject: [PATCH 039/511] CComponentsIconForm: consider relevant paint direction, don't use 0 values Value 0 can not be used without problems here, because explicit values are required since a9a6a925240675c44243754e82dbee79f2d84698 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b038d1b6c1b7979e19a6ba7a4364a1578b7f7112 Author: Thilo Graf Date: 2014-04-27 (Sun, 27 Apr 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_icons.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_icons.cpp b/src/gui/components/cc_frm_icons.cpp index 67349abf8..c8c3d52c5 100644 --- a/src/gui/components/cc_frm_icons.cpp +++ b/src/gui/components/cc_frm_icons.cpp @@ -76,7 +76,12 @@ void CComponentsIconForm::initVarIconForm( const int &x_pos, const int &y_pos, c void CComponentsIconForm::addIcon(const std::string& icon_name) { //create new cc-picture item object - CComponentsPicture *ccp = new CComponentsPicture(0, 0, 0, 0, icon_name, CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, this); + CComponentsPicture *ccp = new CComponentsPicture(chn_direction == CC_DIR_X ? CC_APPEND : CC_CENTERED, + chn_direction == CC_DIR_Y ? CC_APPEND : CC_CENTERED, + 0, 0, + icon_name, + CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, + this); ccp->doPaintBg(false); initChainItems(); @@ -91,7 +96,11 @@ void CComponentsIconForm::addIcon(std::vector icon_name) void CComponentsIconForm::insertIcon(const uint& icon_id, const std::string& icon_name) { //create new cc-picture item object - CComponentsPicture *ccp = new CComponentsPicture(0, 0, 0, 0, icon_name, CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER); + CComponentsPicture *ccp = new CComponentsPicture(chn_direction == CC_DIR_X ? CC_APPEND : CC_CENTERED, + chn_direction == CC_DIR_Y ? CC_APPEND : CC_CENTERED, + 0, 0, + icon_name, + CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER); ccp->doPaintBg(false); insertCCItem(icon_id, ccp); From 409e70d3ed4d87cb67b9acdb5a890c5d0e2cdf75 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 4 May 2014 01:47:43 +0200 Subject: [PATCH 040/511] CComponentsItem: don't increase x/y position if frame width already defined Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6ba757bd9d669e8db6ce6fecbaa5cca69352240d Author: Thilo Graf Date: 2014-05-04 (Sun, 04 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_item.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 5819ad774..1db1cb436 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -82,8 +82,9 @@ void CComponentsItem::paintInit(bool do_save_bg) //if item is bound on a parent form, we must use real x/y values and from parent form as reference int ix = x, iy = y; if (cc_parent){ - ix = cc_xr + cc_parent->getFrameThickness(); - iy = cc_yr + cc_parent->getFrameThickness(); + int w_parent_frame = cc_parent->getFrameThickness(); + ix = cc_xr + (x < w_parent_frame ? w_parent_frame : 0); + iy = cc_yr + (y < w_parent_frame ? w_parent_frame : 0); } comp_fbdata_t fbdata[] = From e7944434282c5e1a210f504081376bf12b6ec496 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 4 May 2014 19:18:55 +0200 Subject: [PATCH 041/511] CComponentsText: fix fit of textbox object inside cc text object dimensions Position related to parent container was wrong. Some variables were unused and removed. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f4447b38e0cac9b39e943877267d0807d263e045 Author: Thilo Graf Date: 2014-05-04 (Sun, 04 May 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_item_text.cpp | 38 +++++++++++++---------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index 7ecda826c..b159ecd5f 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -82,15 +82,10 @@ void CComponentsText::initVarText( const int x_pos, const int y_pos, const int w ct_old_text = ct_text; ct_text_mode = mode; - x = x_pos; - y = y_pos; - width = w; - height = h; - - pX = &x; - pY = &y; - pHeight = &height; - pWidth = &width; + iX = x = x_pos; + iY = y = y_pos; + iWidth=width = w; + iHeight=height = h; /* we need a minimal borderwith of 1px because the edge-smoothing (or fontrenderer?) otherwise will paint single pixels outside the @@ -121,19 +116,20 @@ void CComponentsText::initCCText() ct_font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]; //define height from font size - height = max(height, ct_font->getHeight()); + height = max(height, ct_font->getHeight()); - //using of real x/y values to paint images if this text object is bound in a parent form - int tx = x, ty = y; + //init CBox dimensions + iWidth = width-2*fr_thickness; + iHeight = height-2*fr_thickness; + iX = x + fr_thickness; + iY = y + fr_thickness; + + //using of real x/y values to paint textbox if this text object is bound in a parent form if (cc_parent){ - tx = cc_xr; - ty = cc_yr; + int th_parent_fr = cc_parent->getFrameThickness(); + iX = cc_xr + (x <= th_parent_fr ? th_parent_fr : 0); + iY = cc_yr + (y <= th_parent_fr ? th_parent_fr : 0); } - //init text box dimensions - this->iX/*x*/ = tx+fr_thickness; - this->iY/*y*/ = ty+fr_thickness; - this->iWidth/*width*/ = width-2*fr_thickness; - this->iHeight/*height*/ = height-2*fr_thickness; //init textbox if (ct_textbox == NULL) @@ -148,8 +144,8 @@ void CComponentsText::initCCText() ct_textbox->setBackGroundColor(col_body); ct_textbox->setBackGroundRadius(corner_rad-fr_thickness, corner_type); ct_textbox->setTextColor(ct_col_text); - ct_textbox->setWindowMaxDimensions(width, height); - ct_textbox->setWindowMinDimensions(width, height); + ct_textbox->setWindowMaxDimensions(iWidth, iHeight); + ct_textbox->setWindowMinDimensions(iWidth, iHeight); //observe behavior of parent form if available bool force_text_paint = ct_force_text_paint; From 7db932a720a8b9a7504d882b2308f9a5ddd3d94a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 16 May 2014 11:59:03 +0200 Subject: [PATCH 042/511] gui/bedit details line osd fix Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9d916ba8d7941fd211877300a8f0979ca7dff690 Author: Jacek Jendrzej Date: 2014-05-16 (Fri, 16 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/bedit/bouqueteditor_channels.cpp | 2 +- src/gui/bedit/bouqueteditor_chanselect.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 5cbd820fd..ddffb1893 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -222,7 +222,7 @@ void CBEChannelWidget::paintDetails(int index) void CBEChannelWidget::initItem2DetailsLine (int pos, int /*ch_index*/) { int xpos = x - ConnectLineBox_Width; - int ypos1 = y + theight+0 + pos*fheight; + int ypos1 = y + theight+0 + pos*iheight; int ypos2 = y + height + INFO_BOX_Y_OFFSET; int ypos1a = ypos1 + (fheight/2)-2; int ypos2a = ypos2 + (info_height/2)-2; diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index a44afd70f..9b48eadcd 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -294,7 +294,7 @@ void CBEChannelSelectWidget::paintDetails(int index) void CBEChannelSelectWidget::initItem2DetailsLine (int pos, int /*ch_index*/) { int xpos = x - ConnectLineBox_Width; - int ypos1 = y + theight+0 + pos*fheight; + int ypos1 = y + theight+0 + pos*iheight; int ypos2 = y + height + INFO_BOX_Y_OFFSET; int ypos1a = ypos1 + (fheight/2)-2; int ypos2a = ypos2 + (info_height/2)-2; From f1aecee5e47cede96abd66bd7510b3af4a0be436 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 21 May 2014 14:45:53 +0400 Subject: [PATCH 043/511] gui/upnpbrowser.cpp: avoid crash, if TotalMatches is wrong; try to fix ogg mime type, add audio/x-wav for wav Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d602f6b1d9bbe2e166a7eb1b45bacbccd4101418 Author: [CST] Focus Date: 2014-05-21 (Wed, 21 May 2014) ------------------ This commit was generated by Migit --- src/gui/upnpbrowser.cpp | 119 ++++++++++++++++++++++------------------ src/gui/upnpbrowser.h | 9 ++- 2 files changed, 71 insertions(+), 57 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 71e7e8ea9..6b0189494 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -291,7 +291,7 @@ std::vector *CUpnpBrowserGui::decodeResult(std::string result) p = ""; children=std::string(p); - UPnPEntry entry={id, isdir, title, artist, album, albumArtURI, children, resources, -1}; + UPnPEntry entry={id, isdir, title, artist, album, albumArtURI, children, "", "", resources, -1, CFile::FILE_DIR}; entries->push_back(entry); } if (!strcmp(node->GetType(), "item")) @@ -299,6 +299,7 @@ std::vector *CUpnpBrowserGui::decodeResult(std::string result) std::vector resources; int preferred = -1; std::string protocol, prot, network, mime, additional; + CFile::FileType ftype = CFile::FILE_UNKNOWN; isdir=false; for (snode=node->GetChild(); snode; snode=snode->GetNext()) { @@ -385,9 +386,11 @@ std::vector *CUpnpBrowserGui::decodeResult(std::string result) { preferred=i; pref=3; + ftype = CFile::FILE_MP3; } - if (mime == "audio/x-vorbis+ogg" && pref < 4) + if ((mime == "audio/ogg" || mime == "audio/x-ogg") && pref < 4) { + ftype = CFile::FILE_OGG; preferred=i; pref=4; } @@ -395,22 +398,29 @@ std::vector *CUpnpBrowserGui::decodeResult(std::string result) { preferred=i; pref=5; + ftype = CFile::FILE_FLAC; } - if (mime.substr(0,6) == "video/" && pref < 6) + if (mime == "audio/x-wav" && pref < 6) { preferred=i; pref=6; + ftype = CFile::FILE_WAV; } - if (mime == "video/x-flv" && pref < 7) + if (mime.substr(0,6) == "video/" && pref < 7) { preferred=i; pref=7; } - if (mime == "video/mp4" && pref < 8) + if (mime == "video/x-flv" && pref < 8) { preferred=i; pref=8; } + if (mime == "video/mp4" && pref < 9) + { + preferred=i; + pref=9; + } } } p = node->GetAttributeValue("id"); @@ -423,7 +433,7 @@ std::vector *CUpnpBrowserGui::decodeResult(std::string result) p = ""; children=std::string(p); - UPnPEntry entry={id, isdir, title, artist, album, albumArtURI, children, resources, preferred}; + UPnPEntry entry={id, isdir, title, artist, album, albumArtURI, children, prot, mime, resources, preferred, ftype}; entries->push_back(entry); } } @@ -586,13 +596,11 @@ void CUpnpBrowserGui::playnext(void) int preferred=(*entries)[0].preferred; if (preferred != -1) { - std::string protocol, prot, network, mime, additional; - protocol=(*entries)[0].resources[preferred].protocol; - splitProtocol(protocol, prot, network, mime, additional); - if (mime == "audio/mpeg" || mime == "audio/x-vorbis+ogg" || mime == "audio/x-flac") { + std::string &mime = (*entries)[0].mime; + if (mime.substr(0,6) == "audio/") { m_playing_entry = (*entries)[0]; m_playing_entry_is_shown = false; - playAudio((*entries)[0].resources[preferred].url, mime); + playAudio((*entries)[0].resources[preferred].url, (*entries)[0].type); } else if (mime.substr(0,6) == "video/") { playVideo((*entries)[0].title, (*entries)[0].resources[preferred].url); @@ -748,6 +756,8 @@ bool CUpnpBrowserGui::selectItem(std::string id) updateItemSelection(id, entries, new_selected, selected, liststart); } else if (!timeout && (msg == CRCInput::RC_ok || msg == CRCInput::RC_right)) { + if ((selected - liststart) >= (*entries).size()) + continue; if ((*entries)[selected - liststart].isdir) { endall=selectItem((*entries)[selected - liststart].id); if (endall) @@ -758,14 +768,12 @@ bool CUpnpBrowserGui::selectItem(std::string id) int preferred=(*entries)[selected - liststart].preferred; if (preferred != -1) { - std::string protocol, prot, network, mime, additional; - protocol=(*entries)[selected - liststart].resources[preferred].protocol; - splitProtocol(protocol, prot, network, mime, additional); - if (mime == "audio/mpeg" || mime == "audio/x-vorbis+ogg" || mime == "audio/x-flac") + std::string &mime = (*entries)[selected - liststart].mime; + if (mime.substr(0,6) == "audio/") { m_playing_entry = (*entries)[selected - liststart]; m_playing_entry_is_shown = false; - playAudio((*entries)[selected - liststart].resources[preferred].url, mime); + playAudio((*entries)[selected - liststart].resources[preferred].url, (*entries)[selected - liststart].type); } else if (mime.substr(0,6) == "video/") { @@ -807,6 +815,8 @@ bool CUpnpBrowserGui::selectItem(std::string id) } } else if (msg == CRCInput::RC_play) { + if ((selected - liststart) >= (*entries).size()) + continue; m_folderplay = true; m_playfolder = (*entries)[selected - liststart].id; m_playid = 0; @@ -982,7 +992,7 @@ void CUpnpBrowserGui::paintDevices() paintItem2DetailsLine (-1); // clear it } -void CUpnpBrowserGui::paintItem(std::vector *entry, unsigned int pos, unsigned int selected) +void CUpnpBrowserGui::paintItem(std::vector *entries, unsigned int pos, unsigned int selected) { int ypos = m_y + m_title_height + m_theight + pos*m_fheight; fb_pixel_t color; @@ -992,12 +1002,6 @@ void CUpnpBrowserGui::paintItem(std::vector *entry, unsigned int pos, { color = COL_MENUCONTENT_TEXT_PLUS_2; bgcolor = COL_MENUCONTENT_PLUS_2; - paintItemInfo(entry, selected); - paintDetails(entry, pos); - if ((*entry)[pos].isdir) - paintItem2DetailsLine (-1); // clear it - else - paintItem2DetailsLine (pos); } else { @@ -1006,13 +1010,25 @@ void CUpnpBrowserGui::paintItem(std::vector *entry, unsigned int pos, } m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, bgcolor); - if (pos >= entry->size()) + if (pos >= (*entries).size()) return; - int preferred=(*entry)[pos].preferred; + UPnPEntry *entry = &(*entries)[pos]; + + if (pos == selected) + { + paintItemInfo(entry); + paintDetails(entry); + if (entry->isdir) + paintItem2DetailsLine (-1); // clear it + else + paintItem2DetailsLine (pos); + } + + int preferred=entry->preferred; std::string info; std::string fileicon; - if ((*entry)[pos].isdir) + if (entry->isdir) { info = ""; fileicon = NEUTRINO_ICON_FOLDER; @@ -1021,7 +1037,7 @@ void CUpnpBrowserGui::paintItem(std::vector *entry, unsigned int pos, { if (preferred != -1) { - info = (*entry)[pos].resources[preferred].duration; + info = entry->resources[preferred].duration; fileicon = NEUTRINO_ICON_MP3; } else @@ -1031,7 +1047,7 @@ void CUpnpBrowserGui::paintItem(std::vector *entry, unsigned int pos, } } - std::string name = (*entry)[pos].title; + std::string name = entry->title; char tmp_time[] = "00:00:00.0"; int w = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->getRenderWidth(tmp_time); @@ -1042,26 +1058,26 @@ void CUpnpBrowserGui::paintItem(std::vector *entry, unsigned int pos, name, color, m_fheight, true); // UTF-8 } -void CUpnpBrowserGui::paintItemInfo(std::vector *entry, unsigned int selected) +void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) { std::string tmp; std::stringstream ts; int w, xstart; - int preferred=(*entry)[selected].preferred; + int preferred=entry->preferred; // LCD - CVFD::getInstance()->showMenuText(0, (*entry)[selected].title.c_str(), -1, true); + CVFD::getInstance()->showMenuText(0, entry->title.c_str(), -1, true); // Info m_frameBuffer->paintBoxRel(m_x, m_y, m_width, m_title_height - 10, COL_MENUCONTENT_PLUS_6, RADIUS_MID); m_frameBuffer->paintBoxRel(m_x + 2, m_y + 2, m_width - 4, m_title_height - 14, COL_MENUCONTENTSELECTED_PLUS_0, RADIUS_MID); // first line - ts << "Resources: " << (*entry)[selected].resources.size() << " Selected: " << preferred+1 << " "; + ts << "Resources: " << entry->resources.size() << " Selected: " << preferred+1 << " "; tmp = ts.str(); if (preferred != -1) - tmp = tmp + "Duration: " + (*entry)[selected].resources[preferred].duration; + tmp = tmp + "Duration: " + entry->resources[preferred].duration; else tmp = tmp + "No resource for Item"; @@ -1072,17 +1088,13 @@ void CUpnpBrowserGui::paintItemInfo(std::vector *entry, unsigned int tmp, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8 // second line - if ((*entry)[selected].isdir) + if (entry->isdir) tmp = "Directory"; else { tmp = ""; if (preferred != -1) - { - std::string proto, network, mime, info; - splitProtocol((*entry)[selected].resources[preferred].protocol, proto, network, mime, info); - tmp = "Protocol: " + proto + ", MIME-Type: " + mime; - } + tmp = "Protocol: " + entry->proto + ", MIME-Type: " + entry->mime; } w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true); // UTF-8 w = std::min(w, m_width - 20); @@ -1092,8 +1104,8 @@ void CUpnpBrowserGui::paintItemInfo(std::vector *entry, unsigned int //third line tmp = ""; - if (!(*entry)[selected].isdir && preferred != -1) - tmp = "URL: " + (*entry)[selected].resources[preferred].url; + if (!entry->isdir && preferred != -1) + tmp = "URL: " + entry->resources[preferred].url; w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true); // UTF-8 w = std::min(w, m_width - 20); @@ -1101,10 +1113,10 @@ void CUpnpBrowserGui::paintItemInfo(std::vector *entry, unsigned int g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 3*m_mheight, m_width - 20, tmp, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8 static std::string lastname = "", tmpname = ""; - if(!(*entry)[selected].albumArtURI.empty()){ + if(!entry->albumArtURI.empty()){ static int flogo_w = 0, flogo_h = 0; - if(lastname != (*entry)[selected].albumArtURI){ - tmpname = lastname = (*entry)[selected].albumArtURI.c_str(); + if(lastname != entry->albumArtURI){ + tmpname = lastname = entry->albumArtURI.c_str(); tmpname = g_PicViewer->DownloadImage(tmpname ); flogo_w = 0, flogo_h = 0; g_PicViewer->getSize(tmpname.c_str(), &flogo_w, &flogo_h); @@ -1155,13 +1167,13 @@ printf("CUpnpBrowserGui::paintItem:s selected %d max %d offset %d\n", selected, ::paintButtons(m_x, top, 0, 4, BrowseButtons, m_width, m_buttonHeight); } -void CUpnpBrowserGui::paintDetails(std::vector *entry, unsigned int index, bool use_playing) +void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) { // Foot info int top = m_y + (m_height - m_info_height - 1 * m_buttonHeight) + 2; int text_start = m_x + 10; -printf("paintDetails: index %d use_playing %d shown %d\n", index, use_playing, m_playing_entry_is_shown); - if ((!use_playing) && ((*entry)[index].isdir)) +printf("paintDetails: use_playing %d shown %d\n", use_playing, m_playing_entry_is_shown); + if ((!use_playing) && entry->isdir) { m_frameBuffer->paintBackgroundBoxRel(m_x+2, top + 2, m_width-4, 2 * m_buttonHeight+8); m_playing_entry_is_shown = false; @@ -1189,10 +1201,10 @@ printf("paintDetails: index %d use_playing %d shown %d\n", index, use_playing, m m_playing_entry_is_shown = false; m_frameBuffer->paintBoxRel(m_x, top + 2, m_width-2, 2 * ih, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE); g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(text_start, - top + 1 * m_buttonHeight + 4, m_x + m_width - 8, (*entry)[index].title + " - " + - (*entry)[index].artist, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8 + top + 1 * m_buttonHeight + 4, m_x + m_width - 8, entry->title + " - " + + entry->artist, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8 g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(text_start, - top + 2 * m_buttonHeight + 4, m_x + m_width - 8, (*entry)[index].album, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8 + top + 2 * m_buttonHeight + 4, m_x + m_width - 8, entry->album, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8 } } } @@ -1240,7 +1252,7 @@ printf("updateTimes: force %d updatePlayed %d\n", force, updatePlayed); if (updatePlayed) { - paintDetails(NULL, 0, true); + paintDetails(NULL, true); top = m_y + (m_height - m_info_height - 1 * m_buttonHeight) + m_buttonHeight + 4; m_frameBuffer->paintBoxRel(m_x + m_width - w - 15, top + 1, w + 4, m_buttonHeight, COL_MENUCONTENTDARK_PLUS_0); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(m_x + m_width - w - 11, top + 1 + m_buttonHeight, w, play_time, COL_MENUCONTENTDARK_TEXT); @@ -1248,10 +1260,9 @@ printf("updateTimes: force %d updatePlayed %d\n", force, updatePlayed); } } -void CUpnpBrowserGui::playAudio(std::string name, std::string mime) +void CUpnpBrowserGui::playAudio(std::string name, int type) { - CFile::FileType type = mime == "audio/mpeg" ? CFile::FILE_MP3 : mime == "audio/x-vorbis+ogg" ? CFile::FILE_OGG : CFile::FILE_FLAC; - CAudiofile mp3(name, type); + CAudiofile mp3(name, (CFile::FileType) type); CAudioPlayer::getInstance()->play(&mp3, g_settings.audioplayer_highprio == 1); } diff --git a/src/gui/upnpbrowser.h b/src/gui/upnpbrowser.h index ae7dba0f4..1e7f78051 100644 --- a/src/gui/upnpbrowser.h +++ b/src/gui/upnpbrowser.h @@ -59,8 +59,11 @@ struct UPnPEntry std::string album; std::string albumArtURI; std::string children; + std::string proto; + std::string mime; std::vector resources; int preferred; + int type; }; class CUpnpBrowserGui : public CMenuTarget @@ -116,12 +119,12 @@ class CUpnpBrowserGui : public CMenuTarget bool selectItem(std::string); void paintItems(std::vector *entry, unsigned int selected, unsigned int max, unsigned int offset); void paintItem (std::vector *entry, unsigned int pos, unsigned int selected); - void paintItemInfo(std::vector *entry, unsigned int selected); - void paintDetails(std::vector *entry, unsigned int index, bool use_playing = false); + void paintItemInfo(UPnPEntry *entry); + void paintDetails(UPnPEntry *entry, bool use_playing = false); void paintItem2DetailsLine (int pos); void updateTimes(const bool force = false); - void playAudio(std::string name, std::string mime); + void playAudio(std::string name, int type); void showPicture(std::string name); void playVideo(std::string name, std::string url); }; From f2e15fbea73dcebe7b2bafca1fb13460af7745ea Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 6 May 2014 19:32:25 +0200 Subject: [PATCH 044/511] CChannelList: ensure erase of clock after stopping Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4a28d853d2b2adaaa964396f38ec58acc87f010d Author: Thilo Graf Date: 2014-05-06 (Tue, 06 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 93176d399..ce77a68d2 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1012,8 +1012,8 @@ void CChannelList::hide() cc_minitv = NULL; } if (headerClock) { - headerClock->Stop(); - headerClock->kill(); + if (headerClock->Stop()) + headerClock->kill(); } frameBuffer->paintBackgroundBoxRel(x, y, full_width, height + info_height); clearItem2DetailsLine(); From a1c1463e44c1b9bb2c5d170a65d2d1e853387b76 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 11 May 2014 16:18:34 +0200 Subject: [PATCH 045/511] CComponentsHeader: remove superfluous semicolon Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e06d8353969f5d70f4ce210e2b53297384ee0f30 Author: Thilo Graf Date: 2014-05-11 (Sun, 11 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 248977542..af7c1e559 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -255,7 +255,7 @@ void CComponentsHeader::removeContextButtons() dprintf(DEBUG_DEBUG, "[CComponentsHeader]\t [%s - %d] removing %u context buttons...\n", __func__, __LINE__, v_cch_btn.size()); v_cch_btn.clear(); if (cch_btn_obj) - cch_btn_obj->clear();; + cch_btn_obj->clear(); } void CComponentsHeader::initButtons() From 8d7ebdb77d5dff1251861cf9d014f36e27251ee6 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 22 May 2014 21:36:03 +0200 Subject: [PATCH 046/511] COPKGManager: simplify intro items Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/aa46ba615609030699945be903ae45ec8bfead4a Author: Thilo Graf Date: 2014-05-22 (Thu, 22 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/opkg_manager.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index c2d7c924a..d002b226b 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -232,12 +232,8 @@ int COPKGManager::showMenu() getPkgData(OM_LIST); getPkgData(OM_LIST_UPGRADEABLE); - menu = new CMenuWidget(g_Locale->getText(LOCALE_OPKG_TITLE), NEUTRINO_ICON_UPDATE, width, MN_WIDGET_ID_SOFTWAREUPDATE); - CMenuForwarder menuBack(LOCALE_MENU_BACK, true, NULL, NULL, NULL, CRCInput::RC_nokey, NEUTRINO_ICON_BUTTON_LEFT, NULL, true); - menuBack.setItemButton(!g_settings.menu_left_exit ? NEUTRINO_ICON_BUTTON_HOME : NEUTRINO_ICON_BUTTON_LEFT); - menu->addItem(&menuBack); - menuBack.setHint(NEUTRINO_ICON_HINT_BACK, LOCALE_MENU_HINT_BACK_BRIEF); - menu->addItem(GenericMenuSeparatorLine); + menu = new CMenuWidget(g_Locale->getText(LOCALE_SERVICEMENU_UPDATE), NEUTRINO_ICON_UPDATE, width, MN_WIDGET_ID_SOFTWAREUPDATE); + menu->addIntroItems(LOCALE_OPKG_TITLE); upgrade_forwarder = new CMenuForwarder(LOCALE_OPKG_UPGRADE, true, NULL , this, pkg_types[OM_UPGRADE].c_str(), CRCInput::RC_red); upgrade_forwarder->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, LOCALE_MENU_HINT_OPKG_UPGRADE); From 80853dce36a52b543b9788acf2232be0cf5eb14f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 24 Apr 2014 22:15:38 +0200 Subject: [PATCH 047/511] CComponentsHeader: add missing init of icon Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1c39d08c607404eb5f94aec24d92f0b46f883b80 Author: Thilo Graf Date: 2014-04-24 (Thu, 24 Apr 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index af7c1e559..c761d73ac 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -177,6 +177,7 @@ void CComponentsHeader::setIcon(const char* icon_name) void CComponentsHeader::setIcon(const std::string& icon_name) { cch_icon_name = icon_name; + initIcon(); } void CComponentsHeader::initIcon() From 9fd307969f1b53e98289fdd4141eb05970e14872 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 24 Apr 2014 23:02:37 +0200 Subject: [PATCH 048/511] CComponentsHeader: add icons to button collection for use in headers or footers Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9955fa92034203abbc95b5c46a8141500a19fd09 Author: Thilo Graf Date: 2014-04-24 (Thu, 24 Apr 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 30 ++++++++++++++++++++++++++++ src/gui/components/cc_frm_header.h | 25 ++++++++++++++++++----- 2 files changed, 50 insertions(+), 5 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index c761d73ac..80b6236a1 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -249,6 +249,36 @@ void CComponentsHeader::addContextButton(const int& buttons) addContextButton(NEUTRINO_ICON_BUTTON_INFO); if (buttons & CC_BTN_MENU) addContextButton(NEUTRINO_ICON_BUTTON_MENU); + if (buttons & CC_BTN_MUTE_ZAP_ACTIVE ) + addContextButton(NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE); + if (buttons & CC_BTN_MUTE_ZAP_INACTIVE ) + addContextButton(NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE); + if (buttons & CC_BTN_OKAY) + addContextButton(NEUTRINO_ICON_BUTTON_OKAY); + if (buttons & CC_BTN_MUTE) + addContextButton(NEUTRINO_ICON_BUTTON_MUTE); + if (buttons & CC_BTN_TOP) + addContextButton(NEUTRINO_ICON_BUTTON_TOP); + if (buttons & CC_BTN_DOWN) + addContextButton(NEUTRINO_ICON_BUTTON_DOWN); + if (buttons & CC_BTN_RIGHT) + addContextButton(NEUTRINO_ICON_BUTTON_RIGHT); + if (buttons & CC_BTN_LEFT) + addContextButton(NEUTRINO_ICON_BUTTON_LEFT); + if (buttons & CC_BTN_FORWARD) + addContextButton(NEUTRINO_ICON_BUTTON_FORWARD); + if (buttons & CC_BTN_BACKWARD) + addContextButton(NEUTRINO_ICON_BUTTON_BACKWARD); + if (buttons & CC_BTN_PAUSE) + addContextButton(NEUTRINO_ICON_BUTTON_PAUSE); + if (buttons & CC_BTN_PLAY) + addContextButton(NEUTRINO_ICON_BUTTON_PLAY); + if (buttons & CC_BTN_RECORD_ACTIVE) + addContextButton(NEUTRINO_ICON_BUTTON_RECORD_ACTIVE); + if (buttons & CC_BTN_RECORD_INACTIVE) + addContextButton(NEUTRINO_ICON_BUTTON_RECORD_INACTIVE); + if (buttons & CC_BTN_RECORD_STOP) + addContextButton(NEUTRINO_ICON_BUTTON_STOP); } void CComponentsHeader::removeContextButtons() diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index d30522d0b..76d015df5 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -153,12 +153,27 @@ class CComponentsHeader : public CComponentsForm enum { - CC_BTN_HELP = 0x02, - CC_BTN_INFO = 0x04, - CC_BTN_MENU = 0x40, - CC_BTN_EXIT = 0x80 - + CC_BTN_HELP = 0x02, + CC_BTN_INFO = 0x04, + CC_BTN_MENU = 0x40, + CC_BTN_EXIT = 0x80, + CC_BTN_MUTE_ZAP_ACTIVE = 0x100, + CC_BTN_MUTE_ZAP_INACTIVE = 0x200, + CC_BTN_OKAY = 0x400, + CC_BTN_MUTE = 0x800, + CC_BTN_TOP = 0x1000, + CC_BTN_DOWN = 0x2000, + CC_BTN_RIGHT = 0x4000, + CC_BTN_LEFT = 0x8000, + CC_BTN_FORWARD = 0x10000, + CC_BTN_BACKWARD = 0x20000, + CC_BTN_PAUSE = 0x40000, + CC_BTN_PLAY = 0x80000, + CC_BTN_RECORD_ACTIVE = 0x100000, + CC_BTN_RECORD_INACTIVE = 0x200000, + CC_BTN_RECORD_STOP = 0x400000 }; + ///set offset between icons within context button object virtual void setButtonsSpace(const int buttons_space){cch_buttons_space = buttons_space;}; From 226cb853c1aabd718cd5f63cdf1aae5ebe89e4b4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Apr 2014 11:56:32 +0200 Subject: [PATCH 049/511] CComponentsFrmChain: add possibility to use individual positions for items Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/40cfc7533d7dceab0d03f70fd3a67a05979bb9f2 Author: Thilo Graf Date: 2014-04-27 (Sun, 27 Apr 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_chain.cpp | 7 +++++-- src/gui/components/cc_frm_chain.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_chain.cpp b/src/gui/components/cc_frm_chain.cpp index f57be9161..9d451041d 100644 --- a/src/gui/components/cc_frm_chain.cpp +++ b/src/gui/components/cc_frm_chain.cpp @@ -94,16 +94,19 @@ void CComponentsFrmChain::initChainItems() h_tmp = append_y_offset; for (size_t i= 0; i< v_cc_items.size(); i++){ + int x_item = v_cc_items[i]->getXPos(); + int y_item = v_cc_items[i]->getYPos(); + if (chn_direction & CC_DIR_X){ w_tmp += v_cc_items[i]->getWidth(); w_tmp += append_x_offset; - v_cc_items[i]->setPos(CC_APPEND, CC_CENTERED); + v_cc_items[i]->setPos(max(CC_APPEND, x_item), max(CC_CENTERED, y_item)); } if (chn_direction & CC_DIR_Y){ h_tmp += v_cc_items[i]->getHeight(); h_tmp += append_y_offset; - v_cc_items[i]->setPos(CC_CENTERED, CC_APPEND); + v_cc_items[i]->setPos(max(CC_CENTERED, x_item), max(CC_APPEND, y_item)); } } width = max (w_tmp, width); diff --git a/src/gui/components/cc_frm_chain.h b/src/gui/components/cc_frm_chain.h index 3005942d6..2ce8b7e42 100644 --- a/src/gui/components/cc_frm_chain.h +++ b/src/gui/components/cc_frm_chain.h @@ -70,7 +70,7 @@ class CComponentsFrmChain : public CComponentsForm fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t& color_body = COL_MENUHEAD_PLUS_0, fb_pixel_t& color_shadow = COL_MENUCONTENTDARK_PLUS_0); -// ~CComponentsSlider(); //inherited from CComponentsForm +// ~CComponentsFrmChain(); //inherited from CComponentsForm ///defines mode for arrangement direction of items, see also chn_direction virtual void setDirection(int direction); From 570bc0cfe83d6d9143a8b6cd74869db20f612053 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Apr 2014 14:19:32 +0200 Subject: [PATCH 050/511] CComponentsFooter: add functionality to add button labels via struct This function uses struct label like old button label function see /gui/widget/buttons.cpp, but can also use strings in structs also possible: add single button with text or locale Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8797872d47afe0cafcba9ef56bfd4603f591c174 Author: Thilo Graf Date: 2014-04-27 (Sun, 27 Apr 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 83 +++++++++++++++++++++++++++- src/gui/components/cc_frm_footer.h | 39 ++++++++++++- 2 files changed, 118 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 2fa63df8e..9bde8c8d3 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -63,7 +63,7 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const x = x_pos; y = y_pos; - + //init footer width width = w == 0 ? frameBuffer->getScreenWidth(true) : w; //init header height @@ -72,16 +72,93 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const height = h; else height = cch_font->getHeight(); - + shadow = has_shadow; col_frame = color_frame; col_body = color_body; col_shadow = color_shadow; - + corner_rad = RADIUS_LARGE; corner_type = CORNER_BOTTOM; + btn_contour = false; + addContextButton(buttons); initCCItems(); initParent(parent); } + +void CComponentsFooter::setButtonLabels(const struct button_label_s * const content, const size_t& label_count, const int& total_width, const int& label_width) +{ + //define required total width of button group, minimal width is >0, sensless values are nonsens! + int w_total = total_width > 0 ? total_width : width;//TODO: alow and handle only with rational values >0 + //consider context button group on the right side of footer, if exist then subtract result from total width of button container + if (cch_btn_obj) + w_total -= cch_btn_obj->getWidth(); + + //calculate required position of button container + //consider icon (inherited) width, if exist then set evaluated result as x position for button label container and ... + int x_btnchain = 0; + if (cch_icon_obj) + x_btnchain = (cch_icon_obj->getXPos() + cch_offset + cch_icon_obj->getWidth()); + //... reduce also total width for button label container + w_total -= x_btnchain; + + //initialize a sub form (item chain as button label container): this contains all passed (as interleaved) button label items, with this container we can work within + //footer as primary container (in this context '=this') and the parent for the button label container and + //button label container itself is concurrent the parent object for button objects + CComponentsFrmChain *btnchain = new CComponentsFrmChain(x_btnchain, CC_CENTERED, w_total, height, 0, CC_DIR_X, this); + btnchain->doPaintBg(false); + + //calculate matching maximal possible width of button lable within button label container + int w_btn_max = btnchain->getWidth() / label_count; + int w_btn = min(label_width, w_btn_max); + + //unused size, usable for offset calculation + int w_btn_unused = w_total - w_btn * label_count; + + //consider offset of button labels + int w_btn_offset = w_btn_unused / (label_count+1); + btnchain->setAppendOffset(w_btn_offset, 0); + + //finally generate button objects passed from button label content. + for (size_t i= 0; i< label_count; i++){ + CComponentsButton *btn = new CComponentsButton(CC_APPEND, CC_CENTERED, w_btn, height-height/4, content[i].text, content[i].button); + btn->doPaintBg(btn_contour); + btnchain->addCCItem(btn); + } +} + +void CComponentsFooter::setButtonLabels(const struct button_label_l * const content, const size_t& label_count, const int& total_width, const int& label_width) +{ + button_label_s buttons[label_count]; + + for (size_t i= 0; i< label_count; i++){ + buttons[i].button = content[i].button; + buttons[i].text = g_Locale->getText(content[i].locale); + } + + setButtonLabels(buttons, label_count, total_width, label_width); +} + +void CComponentsFooter::setButtonLabels(const struct button_label * const content, const size_t& label_count, const int& total_width, const int& label_width) +{ + setButtonLabels((button_label_l*)content, label_count, total_width, label_width); +} + +void CComponentsFooter::setButtonLabel(const char *button_icon, const std::string& text, const int& total_width, const int& label_width) +{ + button_label_s button[1]; + + button[0].button = button_icon; + button[0].text = text; + + setButtonLabels(button, 1, total_width, label_width); +} + +void CComponentsFooter::setButtonLabel(const char *button_icon, const neutrino_locale_t& locale, const int& total_width, const int& label_width) +{ + string txt = g_Locale->getText(locale); + + setButtonLabel(button_icon, txt, total_width, label_width); +} diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index f0fad0646..db478637c 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -26,6 +26,21 @@ #include "cc_frm_header.h" +#include "cc_frm_button.h" +#include //for compatibility with 'button_label' type + +//for 'button_label' type with string +typedef struct button_label_s +{ + const char * button; + std::string text; +} button_label_s_struct; + +typedef struct button_label_l +{ + const char * button; + neutrino_locale_t locale; +} button_label_l_struct; /*! CComponentsFooter, sub class of CComponentsHeader provides prepared container for footer @@ -33,7 +48,7 @@ Is mostly usable like a header but without caption, and context button icons. */ class CComponentsFooter : public CComponentsHeader { - protected: + private: void initVarFooter( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, const int& buttons = 0, CComponentsForm *parent = NULL, @@ -41,7 +56,12 @@ class CComponentsFooter : public CComponentsHeader fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_INFOBAR_SHADOW_PLUS_1, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + + ///show button frame and background, default false + bool btn_contour; + public: + CComponentsFooter(CComponentsForm *parent = NULL); CComponentsFooter( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, const int& buttons = 0, @@ -50,6 +70,23 @@ class CComponentsFooter : public CComponentsHeader fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_INFOBAR_SHADOW_PLUS_1, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + + ///add button labels with string label type as content, count as size_t, total_width as int, label width as int + void setButtonLabels(const struct button_label_s * const content, const size_t& label_count, const int& total_width = 0, const int& label_width = 0); + ///add button labels with locale label type as content, count as size_t, total_width as int, label width as int + void setButtonLabels(const struct button_label_l * const content, const size_t& label_count, const int& total_width = 0, const int& label_width = 0); + + ///add button labels with old label type, count as size_t, total_width as int, label width as int + ///NOTE: for compatibility with older button handler find in gui/widget/buttons.h + void setButtonLabels(const struct button_label * const content, const size_t& label_count, const int& total_width = 0, const int& label_width = 0); + + ///add single button label with string label type as content, total_width as int, label width as int + void setButtonLabel(const char *button_icon, const std::string& text, const int& total_width = 0, const int& label_width = 0); + ///add single button label with locale label type as content, total_width as int, label width as int + void setButtonLabel(const char *button_icon, const neutrino_locale_t& locale, const int& total_width = 0, const int& label_width = 0); + + ///causes show/hide countour of button frame and background, parameter bool show, default= true + void showButtonContour(bool show = true){btn_contour = show;}; }; #endif From 1ee724fe44cea63115e80513f47019eac1be6211 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Apr 2014 23:51:01 +0200 Subject: [PATCH 051/511] CComponentsButton: simplify handling of init of buttons with chain class Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7b279ddd33f2e3b6aadc15c780888a34996e91cb Author: Thilo Graf Date: 2014-04-27 (Sun, 27 Apr 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_button.cpp | 74 ++++++++++------------------ src/gui/components/cc_frm_button.h | 6 ++- 2 files changed, 29 insertions(+), 51 deletions(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index 69d25ed65..16af21af1 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -32,8 +32,6 @@ #include "cc_frm_button.h" -#define FRAME_TH 3 -#define H_SPACE 4 using namespace std; @@ -83,7 +81,10 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const col_shadow = color_shadow; cc_item_enabled = enabled; cc_item_selected = selected; - fr_thickness = FRAME_TH; + fr_thickness = 3; + append_x_offset = 2*fr_thickness; + append_y_offset = append_x_offset; + corner_rad = RADIUS_MID; cc_btn_capt_col = COL_MENUCONTENT_TEXT; cc_btn_icon_obj = NULL; @@ -108,42 +109,13 @@ void CComponentsButton::initIcon() //initialize icon object if (cc_btn_icon_obj == NULL){ - cc_btn_icon_obj = new CComponentsPicture(0, 0, 0, 0, cc_btn_icon); - addCCItem(cc_btn_icon_obj); - } - - //get first icon dimensions - int icon_w = cc_btn_icon_obj->getWidth(); - int icon_h = cc_btn_icon_obj->getHeight(); - - //position of icon default centered - int icon_x = width/2-icon_w/2; - int icon_y = height/2-icon_h/2; - - //set properties to picture object - if (cc_btn_icon_obj){ - cc_btn_icon_obj->setDimensionsAll(icon_x, icon_y, icon_w, icon_h); - cc_btn_icon_obj->setPictureAlign(CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER); + cc_btn_icon_obj = new CComponentsPicture(fr_thickness, CC_CENTERED, 0, 0, cc_btn_icon, CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, this); cc_btn_icon_obj->doPaintBg(false); } - } void CComponentsButton::initCaption() { - //if we have an icon, we must calculate positions for booth items together - //also the icon width and left position = 0 - int face_w = 0; - - //calculate width and left position of icon, if available, picture position is default centered - if (cc_btn_icon_obj){ - //if found a picture object, then get width from it... - face_w = cc_btn_icon_obj->getWidth(); - //...and set position as centered - int face_x = width/2 - face_w/2; - cc_btn_icon_obj->setXPos(face_x); - } - //init label as caption object and add to container if (!cc_btn_capt.empty()){ if (cc_btn_capt_obj == NULL){ @@ -158,31 +130,35 @@ void CComponentsButton::initCaption() } } - //basicly we set caption appended to picture if available and to top border, width = 0 - int cap_x = fr_thickness + H_SPACE; - int cap_y = fr_thickness + H_SPACE; - - //set properties to label object + //set basic properties if (cc_btn_capt_obj){ - int cap_w = width - 2*fr_thickness - face_w; - int cap_h = height - 2*fr_thickness - H_SPACE; - if (cc_btn_icon_obj){ - cc_btn_icon_obj->setXPos(cap_x); - cap_x += face_w + H_SPACE; - } + //position and size + int x_cap = fr_thickness + append_x_offset; + x_cap += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() : 0; - cc_btn_capt_obj->setDimensionsAll(cap_x, cap_y, cap_w, cap_h); - cc_btn_font = *cc_btn_dy_font->getDynFont(cap_w, cap_h, cc_btn_capt); + int w_cap = width - x_cap - 2*fr_thickness - append_x_offset; + int h_cap = height - 2*fr_thickness; - cc_btn_capt_obj->setTextColor(this->cc_item_enabled ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT); + /*FIXME: + paint of centered text in y without y_offset + looks unlovely displaced in y direction besides icon, + but text render isn't wrong here, because chars like e. 'q', 'y' are considered! + */ + int y_cap = height/2 - h_cap/2 + append_x_offset/2 /*CC_CENTERED*/; + + cc_btn_capt_obj->setDimensionsAll(x_cap, y_cap, w_cap, h_cap); + + //text and font + cc_btn_font = *cc_btn_dy_font->getDynFont(w_cap, h_cap, cc_btn_capt); cc_btn_capt_obj->setText(cc_btn_capt, CTextBox::NO_AUTO_LINEBREAK, cc_btn_font); cc_btn_capt_obj->forceTextPaint(); //here required; + //set color + cc_btn_capt_obj->setTextColor(this->cc_item_enabled ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT); + //corner of text item cc_btn_capt_obj->setCorner(corner_rad-fr_thickness, corner_type); } - - } void CComponentsButton::setCaption(const std::string& text) diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index 5df275521..c44a5b2ea 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -28,7 +28,9 @@ #include #include "cc_base.h" -#include "cc_frm.h" +#include "cc_frm_chain.h" +#include "cc_item_picture.h" +#include "cc_item_text.h" #include #include @@ -36,7 +38,7 @@ /*! Shows a button box with caption and optional icon. */ -class CComponentsButton : public CComponentsForm +class CComponentsButton : public CComponentsFrmChain { protected: ///object: picture object From 8941a634f1faa42f6d8daec656c923160311bd57 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 30 Apr 2014 11:10:54 +0200 Subject: [PATCH 052/511] CComponentsButton: add possibility to change font type, whitespace fixes Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/419fc12f2e9ad9d28f780b46dc71d093e2a9bf03 Author: Thilo Graf Date: 2014-04-30 (Wed, 30 Apr 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_button.cpp | 23 ++++++++++++++++++----- src/gui/components/cc_frm_button.h | 15 +++++++++------ 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index 16af21af1..bb05d2ed1 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -82,7 +82,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const cc_item_enabled = enabled; cc_item_selected = selected; fr_thickness = 3; - append_x_offset = 2*fr_thickness; + append_x_offset = 6; append_y_offset = append_x_offset; corner_rad = RADIUS_MID; @@ -95,6 +95,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const cc_btn_capt = caption; initParent(parent); + initCCBtnItems(); } void CComponentsButton::initIcon() @@ -133,12 +134,12 @@ void CComponentsButton::initCaption() //set basic properties if (cc_btn_capt_obj){ //position and size - int x_cap = fr_thickness + append_x_offset; + int x_cap = fr_thickness; x_cap += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() : 0; - int w_cap = width - x_cap - 2*fr_thickness - append_x_offset; + int w_cap = width - fr_thickness - append_x_offset - x_cap - fr_thickness; int h_cap = height - 2*fr_thickness; - + /*FIXME: paint of centered text in y without y_offset looks unlovely displaced in y direction besides icon, @@ -149,7 +150,8 @@ void CComponentsButton::initCaption() cc_btn_capt_obj->setDimensionsAll(x_cap, y_cap, w_cap, h_cap); //text and font - cc_btn_font = *cc_btn_dy_font->getDynFont(w_cap, h_cap, cc_btn_capt); + if (cc_btn_font == NULL) + cc_btn_font = *cc_btn_dy_font->getDynFont(w_cap, h_cap, cc_btn_capt); cc_btn_capt_obj->setText(cc_btn_capt, CTextBox::NO_AUTO_LINEBREAK, cc_btn_font); cc_btn_capt_obj->forceTextPaint(); //here required; @@ -159,6 +161,17 @@ void CComponentsButton::initCaption() //corner of text item cc_btn_capt_obj->setCorner(corner_rad-fr_thickness, corner_type); } + + //handle common position of icon and text inside container required for alignment + int w_required = cc_btn_icon_obj->getWidth() + append_x_offset + cc_btn_font->getRenderWidth(cc_btn_capt, true); + + //do center + int x_icon = width/2 - w_required/2; + cc_btn_icon_obj->setXPos(x_icon); + cc_btn_capt_obj->setXPos(x_icon + cc_btn_icon_obj->getWidth() + append_x_offset); + + //dynamic width + width = max(w_required, width); } void CComponentsButton::setCaption(const std::string& text) diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index c44a5b2ea..c4aabeb06 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -60,7 +60,7 @@ class CComponentsButton : public CComponentsFrmChain std::string cc_btn_capt; ///property: button text as locale, see also setCaption() and getCaptionLocale() neutrino_locale_t cc_btn_capt_locale; - + ///property: icon name, only icons supported, to find in gui/widget/icons.h std::string cc_btn_icon; @@ -75,10 +75,10 @@ class CComponentsButton : public CComponentsFrmChain void initIcon(); ///initialize label object void initCaption(); - + ///initialize picture and label object void initCCBtnItems(); - + public: ///basic constructor for button object with most needed params, no button icon is definied here CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, @@ -100,17 +100,20 @@ class CComponentsButton : public CComponentsFrmChain ///set text color virtual void setButtonTextColor(fb_pixel_t caption_color){cc_btn_capt_col = caption_color;}; - + ///set caption: parameter as string virtual void setCaption(const std::string& text); ///set caption: parameter as locale virtual void setCaption(const neutrino_locale_t locale_text); - + ///get caption, type as std::string virtual std::string getCaptionString(){return cc_btn_capt;}; ///get loacalized caption id, type = neutrino_locale_t virtual neutrino_locale_t getCaptionLocale(){return cc_btn_capt_locale;}; - + + ///property: set font for label caption, parameter as font object, value NULL causes usaage of dynamic font + virtual void setButtonFont(Font* font){cc_btn_font = font;}; + ///reinitialize items virtual void Refresh(){initCCBtnItems();}; From 75927ba409c1cad814df525866a04a176889136a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 30 Apr 2014 11:12:57 +0200 Subject: [PATCH 053/511] CComponentsFooter: add possibility to change font type Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/41c01cedad66ea665cc72a32344a82868f05fb8e Author: Thilo Graf Date: 2014-04-30 (Wed, 30 Apr 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 4 +++- src/gui/components/cc_frm_footer.h | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 9bde8c8d3..fe8e10321 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -82,6 +82,7 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const corner_type = CORNER_BOTTOM; btn_contour = false; + ccf_btn_font = NULL; addContextButton(buttons); initCCItems(); @@ -121,9 +122,10 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont int w_btn_offset = w_btn_unused / (label_count+1); btnchain->setAppendOffset(w_btn_offset, 0); - //finally generate button objects passed from button label content. + //finally generate and add button objects passed from button label content. for (size_t i= 0; i< label_count; i++){ CComponentsButton *btn = new CComponentsButton(CC_APPEND, CC_CENTERED, w_btn, height-height/4, content[i].text, content[i].button); + btn->setButtonFont(ccf_btn_font); btn->doPaintBg(btn_contour); btnchain->addCCItem(btn); } diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index db478637c..2d6ed3fe4 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -60,6 +60,9 @@ class CComponentsFooter : public CComponentsHeader ///show button frame and background, default false bool btn_contour; + ///property: set font for label caption, see also setButtonFont() + Font* ccf_btn_font; + public: CComponentsFooter(CComponentsForm *parent = NULL); @@ -87,6 +90,9 @@ class CComponentsFooter : public CComponentsHeader ///causes show/hide countour of button frame and background, parameter bool show, default= true void showButtonContour(bool show = true){btn_contour = show;}; + + ///property: set font for label caption, parameter as font object, value NULL causes usage of dynamic font + void setButtonFont(Font* font){ccf_btn_font = font;}; }; #endif From f8d13f53aa53f6b60b8cf7b2a51a68454b34e2b8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 24 Apr 2014 23:08:49 +0200 Subject: [PATCH 054/511] CTestMenu: use correct class name for footer object Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/87031e79b89cd2ba3c5a62bec667aafe629b355b Author: Thilo Graf Date: 2014-04-24 (Thu, 24 Apr 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/test_menu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/test_menu.h b/src/gui/test_menu.h index 10869fe83..ee3693276 100644 --- a/src/gui/test_menu.h +++ b/src/gui/test_menu.h @@ -46,7 +46,7 @@ class CTestMenu : public CMenuTarget CComponentsForm *form; CComponentsText *txt; CComponentsHeader *header; - CComponentsHeader *footer; + CComponentsFooter *footer; CComponentsIconForm *iconform; CComponentsWindow *window; CComponentsButton *button; From ea0fe91ab1ae024af56f0a5fa3837e3a84c71869 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Apr 2014 15:40:02 +0200 Subject: [PATCH 055/511] CTestMenu: add samples for new button handling in cc footer Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/45ce42e505c47b2e4db7db0279955888a9e57b77 Author: Thilo Graf Date: 2014-04-27 (Sun, 27 Apr 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/test_menu.cpp | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 0e5ed1e0c..2a491e5dd 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -55,9 +55,18 @@ #include #include #include +#include extern int cs_test_card(int unit, char * str); +#define TestButtonsCount 3 +const struct button_label TestButtons[/*TestButtonsCount*/] = +{ + { NEUTRINO_ICON_BUTTON_RED , LOCALE_STRINGINPUT_CAPS }, + { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_STRINGINPUT_CLEAR }, + { NEUTRINO_ICON_BUTTON_YELLOW , LOCALE_MESSAGEBOX_INFO } +}; + CTestMenu::CTestMenu() { @@ -533,12 +542,21 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) else if (actionKey == "footer"){ int hh = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); if (footer == NULL){ - footer = new CComponentsFooter (100, 50, 500, hh, CComponentsHeader::CC_BTN_HELP | CComponentsHeader::CC_BTN_EXIT | CComponentsHeader::CC_BTN_MENU, NULL, true); + footer = new CComponentsFooter (100, 30, 1000, hh, CComponentsFooter::CC_BTN_HELP | CComponentsFooter::CC_BTN_EXIT | CComponentsFooter::CC_BTN_MENU |CComponentsFooter::CC_BTN_MUTE_ZAP_ACTIVE, NULL, true); int start = 5, btnw =90, btnh = 37; - footer->addCCItem(new CComponentsButtonRed(start, 0, btnw, btnh, "Button1")); - footer->addCCItem(new CComponentsButtonGreen(start+=btnw, 0, btnw, btnh, "Button2")); - footer->addCCItem(new CComponentsButtonYellow(start+=btnw, 0, btnw, btnh, "Button3")); - footer->addCCItem(new CComponentsButtonBlue(start+=btnw, 0, btnw, btnh, "Button4")); + footer->setIcon(NEUTRINO_ICON_INFO); + + //add button labels with conventional button label struct + footer->setButtonLabels(TestButtons, TestButtonsCount, 0, 250); + + //also possible: use directly button name and as 2nd parameter string or locale as text +// footer->setButtonLabel(NEUTRINO_ICON_BUTTON_RED, "This is a button label text!", 0, 250); + + //also possible: use Button objects +// footer->addCCItem(new CComponentsButtonRed(start, 0, btnw, btnh, "Button1")); +// footer->addCCItem(new CComponentsButtonGreen(start+=btnw, 0, btnw, btnh, "Button2")); +// footer->addCCItem(new CComponentsButtonYellow(start+=btnw, 0, btnw, btnh, "Button3")); +// footer->addCCItem(new CComponentsButtonBlue(start+=btnw, 0, btnw, btnh, "Button4")); } if (!footer->isPainted()) footer->paint(); From 40ae98d72e8adce3dca7084dc8376ef706de8e1b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 1 May 2014 16:22:22 +0200 Subject: [PATCH 056/511] CComponentsButton: reinit button items after changed font type Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2256c83b9828685af133fd036aab97874cea1093 Author: Thilo Graf Date: 2014-05-01 (Thu, 01 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_button.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index c4aabeb06..d3dabcd82 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -112,7 +112,7 @@ class CComponentsButton : public CComponentsFrmChain virtual neutrino_locale_t getCaptionLocale(){return cc_btn_capt_locale;}; ///property: set font for label caption, parameter as font object, value NULL causes usaage of dynamic font - virtual void setButtonFont(Font* font){cc_btn_font = font;}; + virtual void setButtonFont(Font* font){cc_btn_font = font; initCCBtnItems();}; ///reinitialize items virtual void Refresh(){initCCBtnItems();}; From ea451154d711785cce4dcf6b8a4b9fa5fd76293e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 1 May 2014 19:40:59 +0200 Subject: [PATCH 057/511] CComponentsButton, CComponentsFooter: rework bestfit of buttons inside chain Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9ffdb1cb986214a0bba7f003ae93a2637ebc3450 Author: Thilo Graf Date: 2014-05-01 (Thu, 01 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_button.cpp | 22 +++++--- src/gui/components/cc_frm_footer.cpp | 82 +++++++++++++++++----------- src/gui/components/cc_frm_footer.h | 20 +++---- src/gui/test_menu.cpp | 12 ++-- 4 files changed, 82 insertions(+), 54 deletions(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index bb05d2ed1..9b9d4c956 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -29,7 +29,7 @@ #include #include - +#include #include "cc_frm_button.h" @@ -152,6 +152,7 @@ void CComponentsButton::initCaption() //text and font if (cc_btn_font == NULL) cc_btn_font = *cc_btn_dy_font->getDynFont(w_cap, h_cap, cc_btn_capt); + cc_btn_capt_obj->setText(cc_btn_capt, CTextBox::NO_AUTO_LINEBREAK, cc_btn_font); cc_btn_capt_obj->forceTextPaint(); //here required; @@ -163,20 +164,25 @@ void CComponentsButton::initCaption() } //handle common position of icon and text inside container required for alignment - int w_required = cc_btn_icon_obj->getWidth() + append_x_offset + cc_btn_font->getRenderWidth(cc_btn_capt, true); - - //do center - int x_icon = width/2 - w_required/2; - cc_btn_icon_obj->setXPos(x_icon); - cc_btn_capt_obj->setXPos(x_icon + cc_btn_icon_obj->getWidth() + append_x_offset); + int w_required = fr_thickness + append_x_offset + cc_btn_icon_obj->getWidth() + append_x_offset + cc_btn_font->getRenderWidth(cc_btn_capt, true) + append_x_offset + fr_thickness; //dynamic width - width = max(w_required, width); + if (w_required > width){ + dprintf(DEBUG_INFO, "[CComponentsButton] [%s - %d] width of button (%s) will be changed: defined width=%d, required width=%d\n", __func__, __LINE__, cc_btn_capt.c_str(), width, w_required); + width = max(w_required, width); + } + + //do center + int x_icon = width/2 - w_required/2 + fr_thickness + append_x_offset; + cc_btn_icon_obj->setXPos(x_icon); + cc_btn_capt_obj->setXPos(x_icon + cc_btn_icon_obj->getWidth() + append_x_offset); + cc_btn_capt_obj->setWidth(width - cc_btn_capt_obj->getXPos()); } void CComponentsButton::setCaption(const std::string& text) { cc_btn_capt = text; + initCCBtnItems(); } void CComponentsButton::setCaption(const neutrino_locale_t locale_text) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index fe8e10321..2bc6ca09a 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -28,6 +28,7 @@ #include #include #include "cc_frm_footer.h" +#include using namespace std; @@ -89,49 +90,66 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const initParent(parent); } -void CComponentsFooter::setButtonLabels(const struct button_label_s * const content, const size_t& label_count, const int& total_width, const int& label_width) +void CComponentsFooter::setButtonLabels(const struct button_label_s * const content, const size_t& label_count, const int& chain_width, const int& label_width) { //define required total width of button group, minimal width is >0, sensless values are nonsens! - int w_total = total_width > 0 ? total_width : width;//TODO: alow and handle only with rational values >0 - //consider context button group on the right side of footer, if exist then subtract result from total width of button container + int w_chain = chain_width > 0 ? chain_width : width;//TODO: alow and handle only with rational values >0, exit here + if (w_chain < 100){ + dprintf(DEBUG_NORMAL, "[CComponentsFooter] [%s - %d] stupid width of chain: width = %d, values < 100 are nonsens, buttons not painted!\n", __func__, __LINE__, w_chain); + return; + } + + //consider context button group on the right side of footer, if exist then subtract result from chain_width of button container if (cch_btn_obj) - w_total -= cch_btn_obj->getWidth(); + w_chain -= cch_btn_obj->getWidth(); //calculate required position of button container //consider icon (inherited) width, if exist then set evaluated result as x position for button label container and ... - int x_btnchain = 0; + int x_chain = 0; if (cch_icon_obj) - x_btnchain = (cch_icon_obj->getXPos() + cch_offset + cch_icon_obj->getWidth()); + x_chain = (cch_icon_obj->getXPos() + cch_offset + cch_icon_obj->getWidth()); //... reduce also total width for button label container - w_total -= x_btnchain; + w_chain -= x_chain; - //initialize a sub form (item chain as button label container): this contains all passed (as interleaved) button label items, with this container we can work within - //footer as primary container (in this context '=this') and the parent for the button label container and - //button label container itself is concurrent the parent object for button objects - CComponentsFrmChain *btnchain = new CComponentsFrmChain(x_btnchain, CC_CENTERED, w_total, height, 0, CC_DIR_X, this); - btnchain->doPaintBg(false); + //initialize container (chain object) as button label container: this contains all passed (as interleaved) button label items, with this container we can work inside + //footer as primary container (in this context '=this') and the parent for the button label container (chain object), + //button label container (chain object) itself is concurrent the parent object for button objects. + CComponentsFrmChain *chain = new CComponentsFrmChain(x_chain, CC_CENTERED, w_chain, height, 0, CC_DIR_X, this); + chain->doPaintBg(false); - //calculate matching maximal possible width of button lable within button label container - int w_btn_max = btnchain->getWidth() / label_count; - int w_btn = min(label_width, w_btn_max); + //calculate default static width of button labels inside button object container related to available width of chain object + int w_btn_fix = chain->getWidth() / label_count; + int w_btn_min = min(label_width, w_btn_fix); - //unused size, usable for offset calculation - int w_btn_unused = w_total - w_btn * label_count; + int w_used = 0; - //consider offset of button labels - int w_btn_offset = w_btn_unused / (label_count+1); - btnchain->setAppendOffset(w_btn_offset, 0); - - //finally generate and add button objects passed from button label content. + //generate and add button objects passed from button label content with default width to chain object. for (size_t i= 0; i< label_count; i++){ - CComponentsButton *btn = new CComponentsButton(CC_APPEND, CC_CENTERED, w_btn, height-height/4, content[i].text, content[i].button); + CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, height-height/4, content[i].text, content[i].button); btn->setButtonFont(ccf_btn_font); btn->doPaintBg(btn_contour); - btnchain->addCCItem(btn); + chain->addCCItem(btn); + + //set x position of next button object + if (i != 0) + btn->setXPos(CC_APPEND); + + //collect used button width inside chain object + w_used += btn->getWidth(); } + + //calculate offset between button objects inside chain object + int w_rest = max(w_chain - w_used, 0); + int btn_offset = w_rest / chain->size(); + chain->setAppendOffset(btn_offset, 0); + dprintf(DEBUG_INFO, "[CComponentsFooter] [%s - %d] btn_offset = %d, w_rest = %d, w_chain = %d, w_used = %d, chain->size() = %u\n", btn_offset, w_rest, w_chain, w_used, chain->size()); + + //set x position of 1st button object inside chain, this is centering button objects inside chain + int x_1st_btn = btn_offset/2; + chain->getCCItem(0)->setXPos(x_1st_btn); } -void CComponentsFooter::setButtonLabels(const struct button_label_l * const content, const size_t& label_count, const int& total_width, const int& label_width) +void CComponentsFooter::setButtonLabels(const struct button_label_l * const content, const size_t& label_count, const int& chain_width, const int& label_width) { button_label_s buttons[label_count]; @@ -140,27 +158,27 @@ void CComponentsFooter::setButtonLabels(const struct button_label_l * const cont buttons[i].text = g_Locale->getText(content[i].locale); } - setButtonLabels(buttons, label_count, total_width, label_width); + setButtonLabels(buttons, label_count, chain_width, label_width); } -void CComponentsFooter::setButtonLabels(const struct button_label * const content, const size_t& label_count, const int& total_width, const int& label_width) +void CComponentsFooter::setButtonLabels(const struct button_label * const content, const size_t& label_count, const int& chain_width, const int& label_width) { - setButtonLabels((button_label_l*)content, label_count, total_width, label_width); + setButtonLabels((button_label_l*)content, label_count, chain_width, label_width); } -void CComponentsFooter::setButtonLabel(const char *button_icon, const std::string& text, const int& total_width, const int& label_width) +void CComponentsFooter::setButtonLabel(const char *button_icon, const std::string& text, const int& chain_width, const int& label_width) { button_label_s button[1]; button[0].button = button_icon; button[0].text = text; - setButtonLabels(button, 1, total_width, label_width); + setButtonLabels(button, 1, chain_width, label_width); } -void CComponentsFooter::setButtonLabel(const char *button_icon, const neutrino_locale_t& locale, const int& total_width, const int& label_width) +void CComponentsFooter::setButtonLabel(const char *button_icon, const neutrino_locale_t& locale, const int& chain_width, const int& label_width) { string txt = g_Locale->getText(locale); - setButtonLabel(button_icon, txt, total_width, label_width); + setButtonLabel(button_icon, txt, chain_width, label_width); } diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 2d6ed3fe4..d943a5bc7 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -74,19 +74,19 @@ class CComponentsFooter : public CComponentsHeader fb_pixel_t color_body = COL_INFOBAR_SHADOW_PLUS_1, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); - ///add button labels with string label type as content, count as size_t, total_width as int, label width as int - void setButtonLabels(const struct button_label_s * const content, const size_t& label_count, const int& total_width = 0, const int& label_width = 0); - ///add button labels with locale label type as content, count as size_t, total_width as int, label width as int - void setButtonLabels(const struct button_label_l * const content, const size_t& label_count, const int& total_width = 0, const int& label_width = 0); + ///add button labels with string label type as content, count as size_t, chain_width as int, label width as int + void setButtonLabels(const struct button_label_s * const content, const size_t& label_count, const int& chain_width = 0, const int& label_width = 0); + ///add button labels with locale label type as content, count as size_t, chain_width as int, label width as int + void setButtonLabels(const struct button_label_l * const content, const size_t& label_count, const int& chain_width = 0, const int& label_width = 0); - ///add button labels with old label type, count as size_t, total_width as int, label width as int + ///add button labels with old label type, count as size_t, chain_width as int, label width as int ///NOTE: for compatibility with older button handler find in gui/widget/buttons.h - void setButtonLabels(const struct button_label * const content, const size_t& label_count, const int& total_width = 0, const int& label_width = 0); + void setButtonLabels(const struct button_label * const content, const size_t& label_count, const int& chain_width = 0, const int& label_width = 0); - ///add single button label with string label type as content, total_width as int, label width as int - void setButtonLabel(const char *button_icon, const std::string& text, const int& total_width = 0, const int& label_width = 0); - ///add single button label with locale label type as content, total_width as int, label width as int - void setButtonLabel(const char *button_icon, const neutrino_locale_t& locale, const int& total_width = 0, const int& label_width = 0); + ///add single button label with string label type as content, chain_width as int, label width as int + void setButtonLabel(const char *button_icon, const std::string& text, const int& chain_width = 0, const int& label_width = 0); + ///add single button label with locale label type as content, chain_width as int, label width as int + void setButtonLabel(const char *button_icon, const neutrino_locale_t& locale, const int& chain_width = 0, const int& label_width = 0); ///causes show/hide countour of button frame and background, parameter bool show, default= true void showButtonContour(bool show = true){btn_contour = show;}; diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 2a491e5dd..5b7db682e 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -59,12 +59,13 @@ extern int cs_test_card(int unit, char * str); -#define TestButtonsCount 3 +#define TestButtonsCount 4 const struct button_label TestButtons[/*TestButtonsCount*/] = { { NEUTRINO_ICON_BUTTON_RED , LOCALE_STRINGINPUT_CAPS }, { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_STRINGINPUT_CLEAR }, - { NEUTRINO_ICON_BUTTON_YELLOW , LOCALE_MESSAGEBOX_INFO } + { NEUTRINO_ICON_BUTTON_YELLOW , LOCALE_MESSAGEBOX_INFO }, + { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_STRINGINPUT_CLEAR } }; @@ -368,7 +369,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } else if (actionKey == "button"){ if (button == NULL) - button = new CComponentsButtonRed(100, 100, 100, 40, "Test"); + button = new CComponentsButtonRed(100, 100, 100, 50, "Test"); if (!button->isPainted()){ if (button->isSelected()) @@ -544,10 +545,13 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) if (footer == NULL){ footer = new CComponentsFooter (100, 30, 1000, hh, CComponentsFooter::CC_BTN_HELP | CComponentsFooter::CC_BTN_EXIT | CComponentsFooter::CC_BTN_MENU |CComponentsFooter::CC_BTN_MUTE_ZAP_ACTIVE, NULL, true); int start = 5, btnw =90, btnh = 37; + footer->showButtonContour(); + footer->setButtonFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]); footer->setIcon(NEUTRINO_ICON_INFO); //add button labels with conventional button label struct - footer->setButtonLabels(TestButtons, TestButtonsCount, 0, 250); + footer->setButtonLabels(TestButtons, TestButtonsCount, 0, 150); + //also possible: use directly button name and as 2nd parameter string or locale as text // footer->setButtonLabel(NEUTRINO_ICON_BUTTON_RED, "This is a button label text!", 0, 250); From 1150003e56c30d4bb2c0591960a5738e171a391c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 1 May 2014 19:41:52 +0200 Subject: [PATCH 058/511] CTestMenu: set dynamic size of buttons, use 1/10 of footer width Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2bde5a6d084732617c606fc9c87ff6a390c3c32f Author: Thilo Graf Date: 2014-05-01 (Thu, 01 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/test_menu.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 5b7db682e..58564da82 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -550,8 +550,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) footer->setIcon(NEUTRINO_ICON_INFO); //add button labels with conventional button label struct - footer->setButtonLabels(TestButtons, TestButtonsCount, 0, 150); - + footer->setButtonLabels(TestButtons, TestButtonsCount, 0, footer->getWidth()/10); //also possible: use directly button name and as 2nd parameter string or locale as text // footer->setButtonLabel(NEUTRINO_ICON_BUTTON_RED, "This is a button label text!", 0, 250); From 7c0599b989a6d50ecfd87fe4667b19e3b432e428 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 1 May 2014 21:18:06 +0200 Subject: [PATCH 059/511] CComponentsButton: ignonre objects if no inititalized This makes it possible to use buttons with or without icons or text Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/95c7e44eb1742307d8d91e0443d9c597a1343155 Author: Thilo Graf Date: 2014-05-01 (Thu, 01 May 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_button.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index 9b9d4c956..f932d4d44 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -164,7 +164,10 @@ void CComponentsButton::initCaption() } //handle common position of icon and text inside container required for alignment - int w_required = fr_thickness + append_x_offset + cc_btn_icon_obj->getWidth() + append_x_offset + cc_btn_font->getRenderWidth(cc_btn_capt, true) + append_x_offset + fr_thickness; + int w_required = fr_thickness + append_x_offset; + w_required += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() + append_x_offset : 0; + w_required += cc_btn_font ? cc_btn_font->getRenderWidth(cc_btn_capt, true) : 0; + w_required += append_x_offset + fr_thickness; //dynamic width if (w_required > width){ @@ -173,10 +176,17 @@ void CComponentsButton::initCaption() } //do center - int x_icon = width/2 - w_required/2 + fr_thickness + append_x_offset; - cc_btn_icon_obj->setXPos(x_icon); - cc_btn_capt_obj->setXPos(x_icon + cc_btn_icon_obj->getWidth() + append_x_offset); - cc_btn_capt_obj->setWidth(width - cc_btn_capt_obj->getXPos()); + int x_icon = width/2 - w_required/2 /*+ fr_thickness + append_x_offset*/; + int w_icon = 0; + if (cc_btn_icon_obj){ + x_icon += fr_thickness + append_x_offset; + cc_btn_icon_obj->setXPos(x_icon); + w_icon = cc_btn_icon_obj->getWidth(); + } + if (cc_btn_capt_obj){ + cc_btn_capt_obj->setXPos(x_icon + w_icon + append_x_offset); + cc_btn_capt_obj->setWidth(width - cc_btn_capt_obj->getXPos()); + } } void CComponentsButton::setCaption(const std::string& text) From f4fed85aa47f571ef2451c2e8e2c445c2d6a2ba3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 1 May 2014 21:46:57 +0200 Subject: [PATCH 060/511] CComponentsFooter: fix missing types for log output Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/14ea1de789501afde6241e74fda765b4ec36234b Author: Thilo Graf Date: 2014-05-01 (Thu, 01 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 2bc6ca09a..f8538b0f5 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -142,7 +142,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont int w_rest = max(w_chain - w_used, 0); int btn_offset = w_rest / chain->size(); chain->setAppendOffset(btn_offset, 0); - dprintf(DEBUG_INFO, "[CComponentsFooter] [%s - %d] btn_offset = %d, w_rest = %d, w_chain = %d, w_used = %d, chain->size() = %u\n", btn_offset, w_rest, w_chain, w_used, chain->size()); + dprintf(DEBUG_INFO, "[CComponentsFooter] [%s - %d] btn_offset = %d, w_rest = %d, w_chain = %d, w_used = %d, chain->size() = %u\n", __func__, __LINE__, btn_offset, w_rest, w_chain, w_used, chain->size()); //set x position of 1st button object inside chain, this is centering button objects inside chain int x_1st_btn = btn_offset/2; From 9c543703a827e0ef07f7089dbc036311d94c1799 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 1 May 2014 21:49:31 +0200 Subject: [PATCH 061/511] CComponentsButton: add class with const char* parameters for icon names Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2c87bb750aa80e55ca3d84ae96ee312fcba43eab Author: Thilo Graf Date: 2014-05-01 (Thu, 01 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_button.cpp | 25 +++++++++++++++++++++++++ src/gui/components/cc_frm_button.h | 21 ++++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index f932d4d44..47f41ad2f 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -59,6 +59,31 @@ CComponentsButton::CComponentsButton( const int& x_pos, const int& y_pos, const initVarButton(x_pos, y_pos, w, h, g_Locale->getText(cc_btn_capt_locale), icon_name, parent, selected, enabled, has_shadow, color_frame, color_body, color_shadow); } +CComponentsButton::CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, + const std::string& caption, const char* icon_name, + CComponentsForm* parent, + bool selected, + bool enabled, + bool has_shadow, + fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) +{ + string _icon_name = icon_name == NULL ? "" : string(icon_name); + initVarButton(x_pos, y_pos, w, h, caption, _icon_name, parent, selected, enabled, has_shadow, color_frame, color_body, color_shadow); +} + +CComponentsButton::CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, + const neutrino_locale_t& caption_locale, const char* icon_name, + CComponentsForm* parent, + bool selected, + bool enabled, + bool has_shadow, + fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) +{ + string _icon_name = icon_name == NULL ? "" : string(icon_name); + cc_btn_capt_locale = caption_locale; + initVarButton(x_pos, y_pos, w, h, g_Locale->getText(cc_btn_capt_locale), _icon_name, parent, selected, enabled, has_shadow, color_frame, color_body, color_shadow); +} + void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption, const std::string& icon_name, diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index d3dabcd82..3e5001d11 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -82,7 +82,8 @@ class CComponentsButton : public CComponentsFrmChain public: ///basic constructor for button object with most needed params, no button icon is definied here CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, - const std::string& caption, const std::string& icon_name = "", + const std::string& caption, + const std::string& icon_name = "", CComponentsForm *parent = NULL, bool selected = false, bool enabled = true, @@ -98,6 +99,24 @@ class CComponentsButton : public CComponentsFrmChain bool has_shadow = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, + const neutrino_locale_t& caption_locale, + const char* icon_name = NULL, + CComponentsForm *parent = NULL, + bool selected = false, + bool enabled = true, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + + CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, + const std::string& caption, + const char* icon_name = NULL, + CComponentsForm *parent = NULL, + bool selected = false, + bool enabled = true, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + ///set text color virtual void setButtonTextColor(fb_pixel_t caption_color){cc_btn_capt_col = caption_color;}; From 113c07a27a8b969ec655ba9cf67d72368db3da13 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 1 May 2014 22:07:42 +0200 Subject: [PATCH 062/511] CComponentsFooter: use chain object in global scope of class Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bd03327cb46532eb000bf732adb1898c6835b47c Author: Thilo Graf Date: 2014-05-01 (Thu, 01 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 9 +++++++-- src/gui/components/cc_frm_footer.h | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index f8538b0f5..dacb4574e 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -84,6 +84,7 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const btn_contour = false; ccf_btn_font = NULL; + chain = NULL; addContextButton(buttons); initCCItems(); @@ -114,8 +115,12 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont //initialize container (chain object) as button label container: this contains all passed (as interleaved) button label items, with this container we can work inside //footer as primary container (in this context '=this') and the parent for the button label container (chain object), //button label container (chain object) itself is concurrent the parent object for button objects. - CComponentsFrmChain *chain = new CComponentsFrmChain(x_chain, CC_CENTERED, w_chain, height, 0, CC_DIR_X, this); - chain->doPaintBg(false); + if (chain == NULL){ + chain = new CComponentsFrmChain(x_chain, CC_CENTERED, w_chain, height, 0, CC_DIR_X, this); + chain->doPaintBg(false); + } + if (!chain->empty()) + chain->clear(); //calculate default static width of button labels inside button object container related to available width of chain object int w_btn_fix = chain->getWidth() / label_count; diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index d943a5bc7..fcb547616 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -63,8 +63,10 @@ class CComponentsFooter : public CComponentsHeader ///property: set font for label caption, see also setButtonFont() Font* ccf_btn_font; + ///container for button objects + CComponentsFrmChain *chain; + public: - CComponentsFooter(CComponentsForm *parent = NULL); CComponentsFooter( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, const int& buttons = 0, From 12e0a4b02ecca689464bdcd676adc42617f3eeb6 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 2 May 2014 00:32:32 +0200 Subject: [PATCH 063/511] CComponentsFooter: apply showButtonContour() after init of labels Function was without effect after adding of button objects, showButtonContour() now changes property explicit for all items, also after their addition to chain. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f7860fed35bff07c83a5545399b2988b2e3da15e Author: Thilo Graf Date: 2014-05-02 (Fri, 02 May 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 10 ++++++++++ src/gui/components/cc_frm_footer.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index dacb4574e..8dc11c77b 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -187,3 +187,13 @@ void CComponentsFooter::setButtonLabel(const char *button_icon, const neutrino_l setButtonLabel(button_icon, txt, chain_width, label_width); } + +void CComponentsFooter::showButtonContour(bool show) +{ + btn_contour = show; + if (chain) { + for (size_t i= 0; i< chain->size(); i++) + chain->getCCItem(i)->doPaintBg(btn_contour); + } +} + diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index fcb547616..81eefd1bb 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -91,7 +91,7 @@ class CComponentsFooter : public CComponentsHeader void setButtonLabel(const char *button_icon, const neutrino_locale_t& locale, const int& chain_width = 0, const int& label_width = 0); ///causes show/hide countour of button frame and background, parameter bool show, default= true - void showButtonContour(bool show = true){btn_contour = show;}; + void showButtonContour(bool show = true); ///property: set font for label caption, parameter as font object, value NULL causes usage of dynamic font void setButtonFont(Font* font){ccf_btn_font = font;}; From 7faf6fa2b30c85f335b725a345ae2f4a29db8c7f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 2 May 2014 16:55:15 +0200 Subject: [PATCH 064/511] CComponentsFooter: set color of button frames to button type, default=gray Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/995eff8ffee76cad51d9907ea7cd716859161666 Author: Thilo Graf Date: 2014-05-02 (Fri, 02 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 8dc11c77b..d5e8abbfa 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -133,6 +133,17 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, height-height/4, content[i].text, content[i].button); btn->setButtonFont(ccf_btn_font); btn->doPaintBg(btn_contour); + + string btn_name = string(content[i].button); + if (btn_name == NEUTRINO_ICON_BUTTON_RED) + btn->setColorFrame(COL_DARK_RED); + if (btn_name == NEUTRINO_ICON_BUTTON_GREEN) + btn->setColorFrame(COL_DARK_GREEN); + if (btn_name == NEUTRINO_ICON_BUTTON_YELLOW) + btn->setColorFrame(COL_OLIVE); + if (btn_name == NEUTRINO_ICON_BUTTON_BLUE) + btn->setColorFrame(COL_DARK_BLUE); + chain->addCCItem(btn); //set x position of next button object From 4cb4ce2d3ddee02ee205f1dc154c6ab3c1516187 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 2 May 2014 17:46:13 +0200 Subject: [PATCH 065/511] CComponentsFooter: add member to get pointer to button container Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7cbd4e34693fdaa804aa0b2da077ea9c0a94d582 Author: Thilo Graf Date: 2014-05-02 (Fri, 02 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 81eefd1bb..18e75ae7b 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -95,6 +95,9 @@ class CComponentsFooter : public CComponentsHeader ///property: set font for label caption, parameter as font object, value NULL causes usage of dynamic font void setButtonFont(Font* font){ccf_btn_font = font;}; + + ///returns pointer to internal button container + CComponentsFrmChain* getButtonChainObject(){return chain;}; }; #endif From efc07077a3a972e01f6a1711b083e96cb34fb7a6 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 3 May 2014 16:29:03 +0200 Subject: [PATCH 066/511] CComponentsButton: remove additonal y offset Any other offset could have bad side effects for centered text, it must be centered here. Other font sizes can make problems here. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/75bf3aa27663949c3796379fc86541849b67d85a Author: Thilo Graf Date: 2014-05-03 (Sat, 03 May 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_button.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index 47f41ad2f..d73ea48d5 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -165,12 +165,12 @@ void CComponentsButton::initCaption() int w_cap = width - fr_thickness - append_x_offset - x_cap - fr_thickness; int h_cap = height - 2*fr_thickness; - /*FIXME: + /*NOTE: paint of centered text in y without y_offset looks unlovely displaced in y direction besides icon, but text render isn't wrong here, because chars like e. 'q', 'y' are considered! */ - int y_cap = height/2 - h_cap/2 + append_x_offset/2 /*CC_CENTERED*/; + int y_cap = height/2 - h_cap/2; cc_btn_capt_obj->setDimensionsAll(x_cap, y_cap, w_cap, h_cap); From 99fa0b3a67536a007058bc1ee123cb4a3c7f4210 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 3 May 2014 19:00:28 +0200 Subject: [PATCH 067/511] CComponentsButton: ensure matching icons inside button Some icons can be too large for defined button height, so it's required to scale icons. Scaling happens inside cc_btn_icon_obj during its init. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9d014d20398a6af1b1b483c084bc15637147c7fc Author: Thilo Graf Date: 2014-05-03 (Sat, 03 May 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_button.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index d73ea48d5..120ee3ee8 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -135,7 +135,19 @@ void CComponentsButton::initIcon() //initialize icon object if (cc_btn_icon_obj == NULL){ - cc_btn_icon_obj = new CComponentsPicture(fr_thickness, CC_CENTERED, 0, 0, cc_btn_icon, CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, this); + int w_icon = 0; + int h_icon = 0; + frameBuffer->getIconSize(cc_btn_icon.c_str(), &w_icon, &h_icon); + + int h_max = height-2*fr_thickness; + if (h_icon > h_max){ + int ratio = h_icon/h_max; + cc_btn_icon = frameBuffer->getIconBasePath() + cc_btn_icon; + cc_btn_icon += ".png"; + w_icon = w_icon*ratio; + } + + cc_btn_icon_obj = new CComponentsPicture(fr_thickness, CC_CENTERED, w_icon, h_max, cc_btn_icon, CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, this); cc_btn_icon_obj->doPaintBg(false); } } From 3f46a8fbc66bca4fccdb853f4d6499b85a6f6100 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 4 May 2014 01:26:57 +0200 Subject: [PATCH 068/511] CComponentsForm: use variable instead function Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/421296932e49265e343b4a883790d7751b943bbb Author: Thilo Graf Date: 2014-05-04 (Sun, 04 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index fbf203048..985dedcb9 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -276,7 +276,7 @@ void CComponentsForm::paintCCItems() } //positionize vertical centered else if (xpos == CC_CENTERED){ - auto_x = width/2 - cc_item->getWidth()/2; + auto_x = width/2 - w_item/2; cc_item->setRealXPos(this_x + auto_x); } else{ @@ -293,7 +293,7 @@ void CComponentsForm::paintCCItems() } //positionize hor centered else if (ypos == CC_CENTERED){ - auto_y = height/2 - cc_item->getHeight()/2; + auto_y = height/2 - h_item/2; cc_item->setRealYPos(this_y + auto_y); } else{ From 1f73a91a364e60db5fa70d266690dd76f2d31822 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 4 May 2014 01:39:17 +0200 Subject: [PATCH 069/511] CComponentsForm: fix centering of items inside form Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2f889b95634af1dbdcad1fc2be11818bd7532f79 Author: Thilo Graf Date: 2014-05-04 (Sun, 04 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 985dedcb9..ea60fc479 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -276,7 +276,7 @@ void CComponentsForm::paintCCItems() } //positionize vertical centered else if (xpos == CC_CENTERED){ - auto_x = width/2 - w_item/2; + auto_x = width/2 - w_item/2 +fr_thickness; cc_item->setRealXPos(this_x + auto_x); } else{ @@ -293,7 +293,7 @@ void CComponentsForm::paintCCItems() } //positionize hor centered else if (ypos == CC_CENTERED){ - auto_y = height/2 - h_item/2; + auto_y = height/2 - h_item/2 +fr_thickness; cc_item->setRealYPos(this_y + auto_y); } else{ From 1fa74157b2e54615f35a04c2fad24684207d5fbe Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 4 May 2014 19:20:07 +0200 Subject: [PATCH 070/511] CComponentsButton: use y position 0 for general alignment Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9c4aadd2bf54d26a6da077dde1f7d41e9ef57f22 Author: Thilo Graf Date: 2014-05-04 (Sun, 04 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_button.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index 120ee3ee8..e458514e8 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -178,11 +178,12 @@ void CComponentsButton::initCaption() int h_cap = height - 2*fr_thickness; /*NOTE: - paint of centered text in y without y_offset - looks unlovely displaced in y direction besides icon, - but text render isn't wrong here, because chars like e. 'q', 'y' are considered! + paint of centered text in y direction without y_offset + looks unlovely displaced in y direction especially besides small icons and inside small areas, + but text render isn't wrong here, because capitalized chars or long chars like e. 'q', 'y' are considered! + Therefore we here need other icons or a hack, that considers some different height values. */ - int y_cap = height/2 - h_cap/2; + int y_cap = 0; cc_btn_capt_obj->setDimensionsAll(x_cap, y_cap, w_cap, h_cap); From 295f39a42080342963b47f9ea716a2d0deba7987 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 4 May 2014 19:23:35 +0200 Subject: [PATCH 071/511] CComponentsFooter: simplified dimensions init for default height Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0a3101728aed4c71bcd103b407a6bf7d8ce48b32 Author: Thilo Graf Date: 2014-05-04 (Sun, 04 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index d5e8abbfa..70105c7bf 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -67,12 +67,10 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const //init footer width width = w == 0 ? frameBuffer->getScreenWidth(true) : w; - //init header height - cch_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]; - if (h > 0) - height = h; - else - height = cch_font->getHeight(); + + //init footer height + cch_font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]; + height = max(h, cch_font->getHeight()); shadow = has_shadow; col_frame = color_frame; From 804facbcf89ba037446ae5371e51227804c82424 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 2 May 2014 22:42:31 +0200 Subject: [PATCH 072/511] CMenuWidget: implement CComponentsFooter, remove paintButtons Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d87807af67c61d0631b8bfedf040a316de75776a Author: Thilo Graf Date: 2014-05-02 (Fri, 02 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 19 +++++++++++-------- src/gui/widget/menue.h | 1 - 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 8e8b41780..fea30fe37 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -408,6 +408,7 @@ void CMenuWidget::Init(const std::string & Icon, const int mwidth, const mn_widg has_hints = false; hint_painted = false; hint_height = 0; + hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); fbutton_count = 0; fbutton_labels = NULL; fbutton_height = 0; @@ -866,6 +867,7 @@ void CMenuWidget::calcSize() if (neededWidth > width-48) { width= neededWidth+ 49; } + //reinit header height, 1st init happens in Init() hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); int itemHeightTotal=0; @@ -952,8 +954,13 @@ void CMenuWidget::paint() item_start_y = y+hheight; paintItems(); washidden = false; - if (fbutton_count) - ::paintButtons(x, y + height + RADIUS_LARGE - fbutton_height, width + sb_width, fbutton_count, fbutton_labels, width, fbutton_height); + if (fbutton_count){ + int y_footer = y + height + RADIUS_LARGE - fbutton_height; + int w_footer = width + sb_width; + CComponentsFooter footer(x, y_footer, w_footer, fbutton_height); + footer.setButtonLabels(fbutton_labels, fbutton_count, 0, (w_footer/max(fbutton_count, 4)+2)-20); + footer.paint(CC_SAVE_SCREEN_NO); + } } void CMenuWidget::setMenuPos(const int& menu_width) @@ -1193,12 +1200,8 @@ void CMenuWidget::setFooter(const struct button_label *_fbutton_labels, const in { fbutton_count = _fbutton_count; fbutton_labels = _fbutton_labels; - fbutton_height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 6; // init min buttonbar height - int h = 0, w = 0; - for (int i = 0; i < fbutton_count; i++) { - frameBuffer->getIconSize(fbutton_labels[i].button, &w, &h); - fbutton_height = std::max(fbutton_height, h + 4); - } + fbutton_height = hheight;//g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 6; // init min buttonbar height + if (repaint) paint(); } diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 12be61110..ce311e3fc 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include From 7355917bb2cfc4ccc57fd6a34c44ecf2501b5400 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 5 May 2014 22:28:09 +0200 Subject: [PATCH 073/511] CTestMenu: clean up, change some sample comments for footer init Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7e6ce8acc69dd199c44640abb673e0cb58dd3729 Author: Thilo Graf Date: 2014-05-05 (Mon, 05 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/test_menu.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 58564da82..f8f7031ef 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -379,7 +379,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) button->paint(); }else button->hide(); - + return res; } else if (actionKey == "circle"){ @@ -545,15 +545,14 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) if (footer == NULL){ footer = new CComponentsFooter (100, 30, 1000, hh, CComponentsFooter::CC_BTN_HELP | CComponentsFooter::CC_BTN_EXIT | CComponentsFooter::CC_BTN_MENU |CComponentsFooter::CC_BTN_MUTE_ZAP_ACTIVE, NULL, true); int start = 5, btnw =90, btnh = 37; - footer->showButtonContour(); footer->setButtonFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]); footer->setIcon(NEUTRINO_ICON_INFO); //add button labels with conventional button label struct - footer->setButtonLabels(TestButtons, TestButtonsCount, 0, footer->getWidth()/10); + footer->setButtonLabels(TestButtons, TestButtonsCount, 0, footer->getWidth()/6); //also possible: use directly button name and as 2nd parameter string or locale as text -// footer->setButtonLabel(NEUTRINO_ICON_BUTTON_RED, "This is a button label text!", 0, 250); +// footer->setButtonLabel(NULL, "Test", 0, 250); //also possible: use Button objects // footer->addCCItem(new CComponentsButtonRed(start, 0, btnw, btnh, "Button1")); @@ -561,6 +560,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) // footer->addCCItem(new CComponentsButtonYellow(start+=btnw, 0, btnw, btnh, "Button3")); // footer->addCCItem(new CComponentsButtonBlue(start+=btnw, 0, btnw, btnh, "Button4")); } + if (!footer->isPainted()) footer->paint(); else From 3ab6b5c1b81920b001b089c3eb6e0aed877d885f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 10 May 2014 17:21:48 +0200 Subject: [PATCH 074/511] CComponentsText: add parameter for text color in member function setText() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/745f7b70f1660ebf717756b588b595df9359b1ae Author: Thilo Graf Date: 2014-05-10 (Sat, 10 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_item_text.cpp | 20 +++++++++++--------- src/gui/components/cc_item_text.h | 10 +++++----- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index b159ecd5f..3e35f44bc 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -176,31 +176,33 @@ void CComponentsText::clearCCText() ct_textbox = NULL; } -void CComponentsText::setText(const std::string& stext, const int mode, Font* font_text) +void CComponentsText::setText(const std::string& stext, const int mode, Font* font_text, const fb_pixel_t& color_text) { ct_old_text = ct_text; ct_text = stext; ct_text_mode = mode; ct_font = font_text; + if (color_text != 0) + ct_col_text = color_text; dprintf(DEBUG_DEBUG, "[CComponentsText] [%s - %d] ct_text: %s \n", __func__, __LINE__, ct_text.c_str()); } -void CComponentsText::setText(neutrino_locale_t locale_text, int mode, Font* font_text) +void CComponentsText::setText(neutrino_locale_t locale_text, int mode, Font* font_text, const fb_pixel_t& color_text) { string stext = g_Locale->getText(locale_text); - setText(stext, mode, font_text); + setText(stext, mode, font_text, color_text); } -void CComponentsText::setText(const char* ctext, const int mode, Font* font_text) +void CComponentsText::setText(const char* ctext, const int mode, Font* font_text, const fb_pixel_t& color_text) { - setText((string)ctext, mode, font_text); + setText((string)ctext, mode, font_text, color_text); } -void CComponentsText::setText(const int digit, const int mode, Font* font_text) +void CComponentsText::setText(const int digit, const int mode, Font* font_text, const fb_pixel_t& color_text) { string s_digit = iToString(digit); - setText(s_digit, mode, font_text); + setText(s_digit, mode, font_text, color_text); } string CComponentsText::getTextFromFile(const string& path_to_textfile) @@ -224,14 +226,14 @@ string CComponentsText::getTextFromFile(const string& path_to_textfile) } //set text lines directly from a file, returns true on succsess -bool CComponentsText::setTextFromFile(const string& path_to_textfile, const int mode, Font* font_text) +bool CComponentsText::setTextFromFile(const string& path_to_textfile, const int mode, Font* font_text, const fb_pixel_t& color_text) { string txt = getTextFromFile(path_to_textfile); if (txt.empty()) return false; - setText(txt, mode, font_text); + setText(txt, mode, font_text, color_text); return true; } diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h index 362d26224..74f90087a 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -128,15 +128,15 @@ class CComponentsText : public CComponentsItem, public CBox virtual inline void doPaintTextBoxBg(bool do_paintbox_bg){ ct_paint_textbg = do_paintbox_bg;}; ///set text as string also possible with overloades members for loacales, const char and text file - virtual void setText(const std::string& stext, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL); + virtual void setText(const std::string& stext, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL, const fb_pixel_t& color_text = 0); ///set text with const char* - virtual void setText(const char* ctext, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL); + virtual void setText(const char* ctext, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL, const fb_pixel_t& color_text = 0); ///set text from locale - virtual void setText(neutrino_locale_t locale_text, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL); + virtual void setText(neutrino_locale_t locale_text, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL, const fb_pixel_t& color_text = 0); ///set text from digit, digit is integer - virtual void setText(const int digit, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL); + virtual void setText(const int digit, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL, const fb_pixel_t& color_text = 0); ///set text directly from a textfile, path as string is required - virtual bool setTextFromFile(const std::string& path_to_textfile, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL); + virtual bool setTextFromFile(const std::string& path_to_textfile, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL, const fb_pixel_t& color_text = 0); ///get text directly from a textfile, path as string is required virtual std::string getTextFromFile(const std::string& path_to_textfile); From e09b3e485b60268af27b2e7170f542572fc909ef Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 10 May 2014 23:09:52 +0200 Subject: [PATCH 075/511] CComponentsForm: paint log on debug level 2 if dimensions too large Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f073c74a40f0e267875fd19cb2c3e1e943ecb735 Author: Thilo Graf Date: 2014-05-10 (Sat, 10 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index ea60fc479..2fbd8aae2 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -261,7 +261,7 @@ void CComponentsForm::paintCCItems() //check item for corrupt position, skip current item if found problems //TODO: need a solution with possibility for scrolling if (ypos > height || xpos > width){ - printf("[CComponentsForm] %s: [form: %d] [item-index %d] [type=%d] WARNING: item position is out of form size:\ndefinied x=%d, defined width=%d \ndefinied y=%d, defined height=%d \n", + dprintf(DEBUG_INFO, "[CComponentsForm] %s: [form: %d] [item-index %d] [type=%d] WARNING: item position is out of form size:\ndefinied x=%d, defined width=%d \ndefinied y=%d, defined height=%d \n", __func__, cc_item_index, cc_item->getIndex(), cc_item->getItemType(), xpos, width, ypos, height); if (this->cc_item_type != CC_ITEMTYPE_FRM_CHAIN) continue; @@ -314,7 +314,7 @@ void CComponentsForm::paintCCItems() right_item -= (new_w%2); w_item -= (new_w%2); if (right_item > right_frm){ - printf("[CComponentsForm] %s: [form: %d] [item-index %d] [type=%d] width is too large, definied width=%d, possible width=%d \n", + dprintf(DEBUG_INFO, "[CComponentsForm] %s: [form: %d] [item-index %d] [type=%d] width is too large, definied width=%d, possible width=%d \n", __func__, cc_item_index, cc_item->getIndex(), cc_item->getItemType(), w_item, new_w); cc_item->setWidth(new_w); } @@ -328,7 +328,7 @@ void CComponentsForm::paintCCItems() bottom_item -= (new_h%2); h_item -= (new_h%2); if (bottom_item > bottom_frm){ - printf("[CComponentsForm] %s: [form: %d] [item-index %d] [type=%d] height is too large, definied height=%d, possible height=%d \n", + dprintf(DEBUG_INFO, "[CComponentsForm] %s: [form: %d] [item-index %d] [type=%d] height is too large, definied height=%d, possible height=%d \n", __func__, cc_item_index, cc_item->getIndex(), cc_item->getItemType(), h_item, new_h); cc_item->setHeight(new_h); } From 40c61134b3161e53f351eac737bc3f659f9de5cc Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 11 May 2014 16:17:18 +0200 Subject: [PATCH 076/511] CComponentsFooter: add member paintButtons() This is a nearly methode similar with the older button handler find in gui/widget/buttons.h, some parameters are different, but require minimalized input. This member sets some basic parameters and will paint concurrently on execute, explicit call of paint() is not required. This should simplify the implementation of the footer class. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/18f13b0062285c64cd313b40a6126334952de552 Author: Thilo Graf Date: 2014-05-11 (Sun, 11 May 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 23 +++++++++++++++++++++-- src/gui/components/cc_frm_footer.h | 14 ++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 70105c7bf..5bb824cea 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -169,7 +169,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_l * const cont for (size_t i= 0; i< label_count; i++){ buttons[i].button = content[i].button; - buttons[i].text = g_Locale->getText(content[i].locale); + buttons[i].text = content[i].locale != NONEXISTANT_LOCALE ? g_Locale->getText(content[i].locale) : ""; } setButtonLabels(buttons, label_count, chain_width, label_width); @@ -192,7 +192,7 @@ void CComponentsFooter::setButtonLabel(const char *button_icon, const std::strin void CComponentsFooter::setButtonLabel(const char *button_icon, const neutrino_locale_t& locale, const int& chain_width, const int& label_width) { - string txt = g_Locale->getText(locale); + string txt = locale != NONEXISTANT_LOCALE ? g_Locale->getText(locale) : ""; setButtonLabel(button_icon, txt, chain_width, label_width); } @@ -206,3 +206,22 @@ void CComponentsFooter::showButtonContour(bool show) } } + +void CComponentsFooter::paintButtons(const int& x_pos, + const int& y_pos, + const int& w, + const int& h, + const size_t& label_count, + const struct button_label * const content, + const int& label_width, + const int& context_buttons, + Font* font, + bool do_save_bg) +{ + this->setDimensionsAll(x_pos, y_pos, w, h); + this->setButtonFont(font); + this->setButtonLabels(content, label_count, 0, label_width); + this->setContextButton(context_buttons); + + this->paint(do_save_bg); +} diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 18e75ae7b..748879470 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -98,6 +98,20 @@ class CComponentsFooter : public CComponentsHeader ///returns pointer to internal button container CComponentsFrmChain* getButtonChainObject(){return chain;}; + + ///this is a nearly methode similar with the older button handler find in gui/widget/buttons.h, some parameters are different, but require minimalized input + ///this member sets some basic parameters and will paint concurrently on execute, explicit call of paint() is not required + void paintButtons( const int& x_pos, + const int& y_pos, + const int& w, + const int& h, + const size_t& label_count, + const struct button_label * const content, + const int& label_width = 0, + const int& context_buttons = 0, + Font* font = NULL, + bool do_save_bg = CC_SAVE_SCREEN_NO + ); }; #endif From 0c91c4b0dc617d72203f3789cc8b9a668ae48e3e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 11 May 2014 17:26:38 +0200 Subject: [PATCH 077/511] CComponentsFooter: ignore item, if no text and icon are defined Empty buttons with defined width are causing gaps...looks not nice! Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9937c0fae8b8be1c5f2437480c7791944b63f66d Author: Thilo Graf Date: 2014-05-11 (Sun, 11 May 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 5bb824cea..5d2411fe1 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -128,11 +128,19 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont //generate and add button objects passed from button label content with default width to chain object. for (size_t i= 0; i< label_count; i++){ - CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, height-height/4, content[i].text, content[i].button); + string txt = content[i].text; + string btn_name = string(content[i].button); + + //ignore item, if no text and icon are defined; + if (txt.empty() && btn_name.empty()){ + dprintf(DEBUG_INFO, "[CComponentsFooter] [%s - %d] ignore item [%d], no icon and text defined!\n", __func__, __LINE__, i); + continue; + } + + CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, height-height/4, txt, btn_name); btn->setButtonFont(ccf_btn_font); btn->doPaintBg(btn_contour); - string btn_name = string(content[i].button); if (btn_name == NEUTRINO_ICON_BUTTON_RED) btn->setColorFrame(COL_DARK_RED); if (btn_name == NEUTRINO_ICON_BUTTON_GREEN) @@ -220,8 +228,8 @@ void CComponentsFooter::paintButtons(const int& x_pos, { this->setDimensionsAll(x_pos, y_pos, w, h); this->setButtonFont(font); - this->setButtonLabels(content, label_count, 0, label_width); this->setContextButton(context_buttons); + this->setButtonLabels(content, label_count, 0, label_width); this->paint(do_save_bg); } From 54215da9edd4510e2fd8011ab5d9884469389927 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 11 May 2014 18:49:03 +0200 Subject: [PATCH 078/511] CComponentsHeader: add member getContextBtnObject() Allow access directly to methods and properties of context button object. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bed36eab339f79dde17e73ecd04fc825546ba75b Author: Thilo Graf Date: 2014-05-11 (Sun, 11 May 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 76d015df5..f85c85300 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -150,7 +150,10 @@ class CComponentsHeader : public CComponentsForm ///sets a single context button icon or combined button icons to the header object, possible types are for example: CC_BTN_HELP, CC_BTN_INFO, CC_BTN_MENU, CC_BTN_EXIT ///existing buttons are removed virtual void setContextButton(const int& buttons){removeContextButtons(); addContextButton(buttons);}; - + + ///gets the embedded context button object, so it's possible to get access directly to its methods and properties + virtual CComponentsIconForm* getContextBtnObject() { return cch_btn_obj;}; + enum { CC_BTN_HELP = 0x02, From 439193292267006af4b951ee5fff25a9e1b22791 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 11 May 2014 19:03:37 +0200 Subject: [PATCH 079/511] CComponents: cc_base.h: expand override of is_painted variable Value of is_painted is modified temporarily till next paint of item Not sure whether this is sufficiently or has bad side effects? Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b6c781f7e4c941e82fa35e7d54fe041f02d39f1f Author: Thilo Graf Date: 2014-05-11 (Sun, 11 May 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_base.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_base.h b/src/gui/components/cc_base.h index 819a2e60b..cc011de18 100644 --- a/src/gui/components/cc_base.h +++ b/src/gui/components/cc_base.h @@ -212,8 +212,8 @@ class CComponents virtual void doPaintBg(bool do_paint){paint_bg = do_paint;}; ///allow/disalows paint of item and its contents, but initialize of other properties are not touched - ///this can be understood as a counterpart to isPainted(), but before paint - virtual void allowPaint(bool allow){cc_allow_paint = allow;}; + ///this can be understood as a counterpart to isPainted(), but before paint and value of is_painted is modified temporarily till next paint of item //TODO: is this sufficiently? + virtual void allowPaint(bool allow){cc_allow_paint = allow; is_painted = cc_allow_paint ? false : true;}; ///returns visibility mode virtual bool paintAllowed(){return cc_allow_paint;}; }; From 9fa06a7279b6f5202f71521fb752287811639225 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 16 May 2014 23:07:22 +0200 Subject: [PATCH 080/511] CComponentsButton: use darker color for Button COL_LIGHT_GRAY is too garish related to background Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a0492bc530e053e30feb61a3e61f398891fce8db Author: Thilo Graf Date: 2014-05-16 (Fri, 16 May 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_button.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index 3e5001d11..3de510f21 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -88,7 +88,7 @@ class CComponentsButton : public CComponentsFrmChain bool selected = false, bool enabled = true, bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const neutrino_locale_t& caption_locale, @@ -97,7 +97,7 @@ class CComponentsButton : public CComponentsFrmChain bool selected = false, bool enabled = true, bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const neutrino_locale_t& caption_locale, @@ -106,7 +106,7 @@ class CComponentsButton : public CComponentsFrmChain bool selected = false, bool enabled = true, bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption, @@ -115,7 +115,7 @@ class CComponentsButton : public CComponentsFrmChain bool selected = false, bool enabled = true, bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); ///set text color virtual void setButtonTextColor(fb_pixel_t caption_color){cc_btn_capt_col = caption_color;}; From 091af659e0e4f960125c063586af2ed71a6e1bfe Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 17 May 2014 00:39:45 +0200 Subject: [PATCH 081/511] CComponentsFooter: use dynamic font on too small footer width If required width of evaluated buttons larger than footer width, then use dynamic font for caption, and try to fit buttons into chain container. Dynamic font is used if ccf_btn_font==NULL NOTE: user should not use too small window size and not select too large fontsize. At some point this possibility will be depleted and it's no more space for readable caption. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6aecdf3b5ad1af4be3b839a8b1314a693b5a1b6e Author: Thilo Graf Date: 2014-05-17 (Sat, 17 May 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 5d2411fe1..6e4d9249f 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -169,6 +169,14 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont //set x position of 1st button object inside chain, this is centering button objects inside chain int x_1st_btn = btn_offset/2; chain->getCCItem(0)->setXPos(x_1st_btn); + + //check used width of generated buttons, if required then use dynamic font, and try to fit buttons into chain container, dynamic font is used if ccf_btn_font==NULL + //NOTE: user should be set not too small window size and not too large fontsize, at some point this possibility will be depleted and it's no more space for readable caption + if (w_used > width && ccf_btn_font != NULL){ + chain->clear(); + ccf_btn_font = NULL; + setButtonLabels(content, label_count, chain_width, label_width); + } } void CComponentsFooter::setButtonLabels(const struct button_label_l * const content, const size_t& label_count, const int& chain_width, const int& label_width) From 9fd211f81a86d9d02a84f43ce8cc79f39641420a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 18 May 2014 20:36:24 +0200 Subject: [PATCH 082/511] CComponents/CComponentsItem: use correct background color color "0" was wrong Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7096e701b6e72a9c22c0c5aad5f3d9f5b2b753cf Author: Thilo Graf Date: 2014-05-18 (Sun, 18 May 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_base.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_base.h b/src/gui/components/cc_base.h index cc011de18..5c991366e 100644 --- a/src/gui/components/cc_base.h +++ b/src/gui/components/cc_base.h @@ -203,8 +203,8 @@ class CComponents virtual void hide(); ///erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known - ///from CFrameBuffer but with possiblity to define color, default color is 0 (empty background) - virtual void kill(const fb_pixel_t& bg_color = 0); + ///from CFrameBuffer but with possiblity to define color, default color is COL_BACKGROUND (empty background) + virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND); ///returns paint mode, true=item was painted virtual bool isPainted(){return is_painted;} @@ -268,7 +268,7 @@ class CComponentsItem : public CComponents ///erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known ///from CFrameBuffer but with possiblity to define color, default color is 0 (empty background) ///NOTE: Items with parent binding use the parent background color as default! Set parameter 'ignore_parent=true' to ignore parent background color! - virtual void kill(const fb_pixel_t& bg_color = 0, bool ignore_parent = false); + virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND, bool ignore_parent = false); ///get the current item type, see attribute cc_item_type above virtual int getItemType(); From b6aca3fdb96750758aceddc2c2a9e5bfb246d222 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 18 May 2014 20:39:52 +0200 Subject: [PATCH 083/511] CComponentsFooter: use same corner properties like parent object This avoids paint of unnecessary edges inside parent object. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/df4151936b6491a8a9a135580b050f6f6ab4c8cb Author: Thilo Graf Date: 2014-05-18 (Sun, 18 May 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 6e4d9249f..c76b7adf7 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -115,6 +115,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont //button label container (chain object) itself is concurrent the parent object for button objects. if (chain == NULL){ chain = new CComponentsFrmChain(x_chain, CC_CENTERED, w_chain, height, 0, CC_DIR_X, this); + chain->setCorner(this->corner_rad, this->corner_type); chain->doPaintBg(false); } if (!chain->empty()) From f4dcb577de77cf90e651ec8636ab9ae392828e62 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 18 May 2014 20:41:42 +0200 Subject: [PATCH 084/511] CComponents/CComponentsItem: simplify statement Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/336ddf75b64201514e51de192a92326239c77b4c Author: Thilo Graf Date: 2014-05-18 (Sun, 18 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_item.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 1db1cb436..466bec66d 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -137,13 +137,10 @@ void CComponentsItem::hide(bool no_restore) //erase or paint over rendered objects void CComponentsItem::kill(const fb_pixel_t& bg_color, bool ignore_parent) { - if(bg_color || cc_parent == NULL){ + if(cc_parent == NULL){ CComponents::kill(bg_color); - return; - } - - if (cc_parent){ - if(bg_color || ignore_parent) + }else{ + if(ignore_parent) CComponents::kill(bg_color); else CComponents::kill(cc_parent->getColorBody()); From 8bbea0b7624c62f71fa7ec71f81817b0b1387168 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 18 May 2014 21:49:07 +0200 Subject: [PATCH 085/511] CComponents: use paintBoxRel() only in kill() paintBackgroundBoxRel() ignores rounded corners. This avoids painting of undesirable parts on corners. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/dc007e810a949895f9275210e5f6867a7422d73d Author: Thilo Graf Date: 2014-05-18 (Sun, 18 May 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_base.cpp | 13 ++++++++++--- src/gui/components/cc_base.h | 2 +- src/gui/components/cc_item.cpp | 6 +++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/gui/components/cc_base.cpp b/src/gui/components/cc_base.cpp index 009ef49c9..bffb827dc 100644 --- a/src/gui/components/cc_base.cpp +++ b/src/gui/components/cc_base.cpp @@ -228,13 +228,20 @@ inline void CComponents::hide() } //erase or paint over rendered objects -void CComponents::kill(const fb_pixel_t& bg_color) +void CComponents::kill(const fb_pixel_t& bg_color, const int& corner_radius) { for(size_t i =0; i< v_fbdata.size() ;i++){ - if (bg_color) - frameBuffer->paintBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, bg_color, v_fbdata[i].r, corner_type); +#if 0 + if (bg_color != COL_BACKGROUND) +#endif + int r = v_fbdata[i].r; + if (corner_radius > -1) + r = corner_radius; + frameBuffer->paintBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, bg_color, r, corner_type); +#if 0 else frameBuffer->paintBackgroundBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy); +#endif } clearFbData(); firstPaint = true; diff --git a/src/gui/components/cc_base.h b/src/gui/components/cc_base.h index 5c991366e..40e764c00 100644 --- a/src/gui/components/cc_base.h +++ b/src/gui/components/cc_base.h @@ -204,7 +204,7 @@ class CComponents ///erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known ///from CFrameBuffer but with possiblity to define color, default color is COL_BACKGROUND (empty background) - virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND); + virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND, const int& corner_radius = -1); ///returns paint mode, true=item was painted virtual bool isPainted(){return is_painted;} diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 466bec66d..e727fb6c1 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -138,12 +138,12 @@ void CComponentsItem::hide(bool no_restore) void CComponentsItem::kill(const fb_pixel_t& bg_color, bool ignore_parent) { if(cc_parent == NULL){ - CComponents::kill(bg_color); + CComponents::kill(bg_color, this->corner_rad); }else{ if(ignore_parent) - CComponents::kill(bg_color); + CComponents::kill(bg_color, this->corner_rad); else - CComponents::kill(cc_parent->getColorBody()); + CComponents::kill(cc_parent->getColorBody(), cc_parent->getCornerRadius()); } } From b4a9c91f2b556a72c6693cc2d6bbbc3d1f4f2e38 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 20 May 2014 19:47:39 +0200 Subject: [PATCH 086/511] deutsch.locale: use capitalization for now/next button caption Labels are generally always capitalized Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/61dc01f719c1470c1220112b213df04908ac0edc Author: Thilo Graf Date: 2014-05-20 (Tue, 20 May 2014) ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 5825e5cd9..3489b8d07 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -659,11 +659,11 @@ infoviewer.epgwait Warte auf EPG-Informationen... infoviewer.eventlist EPG/Vorschau infoviewer.languages Tonwahl infoviewer.motor_moving Antennenpositionierung -infoviewer.next später +infoviewer.next Später infoviewer.nocurrent Keine Info zu laufendem Programm infoviewer.noepg Keine EPG-Information verfügbar infoviewer.notavailable Kanal (zur Zeit) nicht verfügbar -infoviewer.now jetzt +infoviewer.now Jetzt infoviewer.selecttime Startzeiten infoviewer.streaminfo Erweiterungen infoviewer.subchan_disp_pos Unterkanalanzeige From 104bcad13a266f0a3d5d8dfd807bcd34aa66754f Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 27 Apr 2014 19:31:37 +0200 Subject: [PATCH 087/511] movieplayer: memset() with zero length is useless Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7dac1e7ad9b2bf67e5d34902e621c9be4c71fcf8 Author: Stefan Seyfried Date: 2014-04-27 (Sun, 27 Apr 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/movieplayer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index f0319cad7..0256f9573 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1461,12 +1461,11 @@ bool CMoviePlayerGui::convertSubtitle(std::string &text) size_t ilen = text.length(); size_t olen = ilen*4; size_t len = olen; - char * buf = (char *) malloc(olen+1); + char * buf = (char *) calloc(olen + 1, 1); if (buf == NULL) { iconv_close(cd); return ret; } - memset(buf, olen+1, 0); char * out = buf; char * in = (char *) text.c_str(); if (iconv(cd, &in, &ilen, &out, &olen) == (size_t)-1) { From ce7cb28d85cb15250fe36ba611e0243931faf4b1 Mon Sep 17 00:00:00 2001 From: martii Date: Sun, 25 May 2014 15:22:31 +0200 Subject: [PATCH 088/511] zapit/bouquets: count locked bouquets a channels is in, and honor lock in all bouquets Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/abe03ad749cbf3ec478cd1bf3780adee9de48eb5 Author: martii Date: 2014-05-25 (Sun, 25 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/daemonc/remotecontrol.cpp | 2 +- src/gui/bedit/bouqueteditor_bouquets.cpp | 20 ++++++++++++++++++++ src/gui/channellist.cpp | 6 +++--- src/zapit/include/zapit/channel.h | 2 +- src/zapit/src/bouquets.cpp | 6 ++++-- src/zapit/src/channel.cpp | 1 + 6 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index fc1036ccb..5f001b20f 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -147,7 +147,7 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data is_video_started = true; if (channel) { current_channel_name = channel->getName(); - if (channel->bAlwaysLocked != g_settings.parentallock_defaultlocked) + if (!!channel->bAlwaysLocked != g_settings.parentallock_defaultlocked) stopvideo(); } CVFD::getInstance()->showServicename(current_channel_name); // UTF-8 diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 98d9d4949..d14934c22 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -430,6 +430,16 @@ void CBEBouquetWidget::deleteBouquet() if (ShowMsg(LOCALE_FILEBROWSER_DELETE, (*Bouquets)[selected]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : (*Bouquets)[selected]->Name, CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)!=CMessageBox::mbrYes) return; + if ((*Bouquets)[selected]->bLocked) { + ZapitChannelList *channels = &(*Bouquets)[selected]->tvChannels; + for(unsigned int i = 0; i < channels->size(); i++) + ((*channels)[i])->bAlwaysLocked--; + + channels = &(*Bouquets)[selected]->radioChannels; + for(unsigned int i = 0; i < channels->size(); i++) + ((*channels)[i])->bAlwaysLocked--; + } + g_bouquetManager->deleteBouquet(selected); Bouquets = &g_bouquetManager->Bouquets; if (selected >= Bouquets->size()) @@ -520,6 +530,16 @@ void CBEBouquetWidget::switchLockBouquet() bouquetsChanged = true; (*Bouquets)[selected]->bLocked = !(*Bouquets)[selected]->bLocked; paint(); + + int add = (*Bouquets)[selected]->bLocked ? +1 : -1; + + ZapitChannelList *channels = &(*Bouquets)[selected]->tvChannels; + for(unsigned int i = 0; i < channels->size(); i++) + ((*channels)[i])->bAlwaysLocked += add; + + channels = &(*Bouquets)[selected]->radioChannels; + for(unsigned int i = 0; i < channels->size(); i++) + ((*channels)[i])->bAlwaysLocked += add; } std::string CBEBouquetWidget::inputName(const char * const defaultName, const neutrino_locale_t caption) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index ce77a68d2..04cb89964 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -352,7 +352,7 @@ int CChannelList::doChannelMenu(void) * a channel could be added/removed to/from an unlocked bouquet and so made * accessible. */ if (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED && - chanlist[selected]->bAlwaysLocked != g_settings.parentallock_defaultlocked) + !!chanlist[selected]->bAlwaysLocked != g_settings.parentallock_defaultlocked) unlocked = (chanlist[selected]->last_unlocked_time + 3600 > time_monotonic()); snprintf(cnt, sizeof(cnt), "%d", i); @@ -1083,7 +1083,7 @@ int CChannelList::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data) chanlist[selected]->last_unlocked_EPGid = g_RemoteControl->current_EPGid; else { - /* data >= 0x100: pre locked bouquet -> remember unlock time */ + /* data >= 0x100: pre-locked bouquet -> remember unlock time */ chanlist[selected]->last_unlocked_time = time_monotonic(); int bnum = bouquetList->getActiveBouquetNumber(); if (bnum >= 0) @@ -1298,7 +1298,7 @@ void CChannelList::zapToChannel(CZapitChannel *channel, bool force) } selected_chid = channel->getChannelID(); - g_RemoteControl->zapTo_ChannelID(selected_chid, channel->getName(), (channel->bAlwaysLocked == g_settings.parentallock_defaultlocked)); + g_RemoteControl->zapTo_ChannelID(selected_chid, channel->getName(), (!!channel->bAlwaysLocked == g_settings.parentallock_defaultlocked)); CNeutrinoApp::getInstance()->channelList->adjustToChannelID(channel->getChannelID()); } if(new_zap_mode != 2 /* not active */) { diff --git a/src/zapit/include/zapit/channel.h b/src/zapit/include/zapit/channel.h index 3017a8791..2361df501 100644 --- a/src/zapit/include/zapit/channel.h +++ b/src/zapit/include/zapit/channel.h @@ -178,7 +178,7 @@ class CZapitChannel } channel_flags_t; casys_map_t camap; - bool bAlwaysLocked; + unsigned int bAlwaysLocked; int number; CChannelEvent currentEvent,nextEvent; diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp index d7526423a..e1771d74d 100644 --- a/src/zapit/src/bouquets.cpp +++ b/src/zapit/src/bouquets.cpp @@ -110,6 +110,8 @@ void CZapitBouquet::addService(CZapitChannel* newChannel) radioChannels.push_back(newChannel); break; } + if (bLocked) + newChannel->bAlwaysLocked++; } void CZapitBouquet::removeService(CZapitChannel* oldChannel) @@ -128,6 +130,8 @@ void CZapitBouquet::removeService(CZapitChannel* oldChannel) break; } + if (bLocked) + oldChannel->bAlwaysLocked--; (*channels).erase(remove(channels->begin(), channels->end(), oldChannel), channels->end()); } } @@ -406,14 +410,12 @@ void CBouquetManager::parseBouquetsXml(const char *fname, bool bUser) if(!bUser) chan->pname = (char *) newBouquet->Name.c_str(); - chan->bAlwaysLocked = newBouquet->bLocked; newBouquet->addService(chan); } else if (bUser) { chan = new CZapitChannel(name2, CREATE_CHANNEL_ID64, 1 /*service_type*/, satellitePosition, freq); CServiceManager::getInstance()->AddChannel(chan); chan->flags = CZapitChannel::NOT_FOUND; - chan->bAlwaysLocked = newBouquet->bLocked; newBouquet->addService(chan); CServiceManager::getInstance()->SetServicesChanged(false); } diff --git a/src/zapit/src/channel.cpp b/src/zapit/src/channel.cpp index 0bdc95695..89c6e21ad 100644 --- a/src/zapit/src/channel.cpp +++ b/src/zapit/src/channel.cpp @@ -69,6 +69,7 @@ void CZapitChannel::Init() polarization = 0; flags = 0; deltype = FE_QPSK; + bAlwaysLocked = 0; } CZapitChannel::~CZapitChannel(void) From 8bd99bea8ee664a417b6e5481f81621949b7c973 Mon Sep 17 00:00:00 2001 From: martii Date: Sun, 25 May 2014 15:44:27 +0200 Subject: [PATCH 089/511] zapit/bouquets: rename bAlwaysLocked => bLockCount Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3a52a97fce8b09ea3107dda00884f72d5825a08a Author: martii Date: 2014-05-25 (Sun, 25 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/daemonc/remotecontrol.cpp | 2 +- src/gui/bedit/bouqueteditor_bouquets.cpp | 10 +++++----- src/gui/channellist.cpp | 4 ++-- src/zapit/include/zapit/channel.h | 2 +- src/zapit/src/bouquets.cpp | 4 ++-- src/zapit/src/channel.cpp | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index 5f001b20f..37b063865 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -147,7 +147,7 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data is_video_started = true; if (channel) { current_channel_name = channel->getName(); - if (!!channel->bAlwaysLocked != g_settings.parentallock_defaultlocked) + if (!!channel->bLockCount != g_settings.parentallock_defaultlocked) stopvideo(); } CVFD::getInstance()->showServicename(current_channel_name); // UTF-8 diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index d14934c22..effe45515 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -433,11 +433,11 @@ void CBEBouquetWidget::deleteBouquet() if ((*Bouquets)[selected]->bLocked) { ZapitChannelList *channels = &(*Bouquets)[selected]->tvChannels; for(unsigned int i = 0; i < channels->size(); i++) - ((*channels)[i])->bAlwaysLocked--; + ((*channels)[i])->bLockCount--; channels = &(*Bouquets)[selected]->radioChannels; for(unsigned int i = 0; i < channels->size(); i++) - ((*channels)[i])->bAlwaysLocked--; + ((*channels)[i])->bLockCount--; } g_bouquetManager->deleteBouquet(selected); @@ -531,15 +531,15 @@ void CBEBouquetWidget::switchLockBouquet() (*Bouquets)[selected]->bLocked = !(*Bouquets)[selected]->bLocked; paint(); - int add = (*Bouquets)[selected]->bLocked ? +1 : -1; + int add = (*Bouquets)[selected]->bLocked * 2 - 1; ZapitChannelList *channels = &(*Bouquets)[selected]->tvChannels; for(unsigned int i = 0; i < channels->size(); i++) - ((*channels)[i])->bAlwaysLocked += add; + ((*channels)[i])->bLockCount += add; channels = &(*Bouquets)[selected]->radioChannels; for(unsigned int i = 0; i < channels->size(); i++) - ((*channels)[i])->bAlwaysLocked += add; + ((*channels)[i])->bLockCount += add; } std::string CBEBouquetWidget::inputName(const char * const defaultName, const neutrino_locale_t caption) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 04cb89964..d8fd53e1a 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -352,7 +352,7 @@ int CChannelList::doChannelMenu(void) * a channel could be added/removed to/from an unlocked bouquet and so made * accessible. */ if (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED && - !!chanlist[selected]->bAlwaysLocked != g_settings.parentallock_defaultlocked) + !!chanlist[selected]->bLockCount != g_settings.parentallock_defaultlocked) unlocked = (chanlist[selected]->last_unlocked_time + 3600 > time_monotonic()); snprintf(cnt, sizeof(cnt), "%d", i); @@ -1298,7 +1298,7 @@ void CChannelList::zapToChannel(CZapitChannel *channel, bool force) } selected_chid = channel->getChannelID(); - g_RemoteControl->zapTo_ChannelID(selected_chid, channel->getName(), (!!channel->bAlwaysLocked == g_settings.parentallock_defaultlocked)); + g_RemoteControl->zapTo_ChannelID(selected_chid, channel->getName(), (!!channel->bLockCount == g_settings.parentallock_defaultlocked)); CNeutrinoApp::getInstance()->channelList->adjustToChannelID(channel->getChannelID()); } if(new_zap_mode != 2 /* not active */) { diff --git a/src/zapit/include/zapit/channel.h b/src/zapit/include/zapit/channel.h index 2361df501..a59ac5251 100644 --- a/src/zapit/include/zapit/channel.h +++ b/src/zapit/include/zapit/channel.h @@ -178,7 +178,7 @@ class CZapitChannel } channel_flags_t; casys_map_t camap; - unsigned int bAlwaysLocked; + unsigned int bLockCount; int number; CChannelEvent currentEvent,nextEvent; diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp index e1771d74d..8eafc1cd9 100644 --- a/src/zapit/src/bouquets.cpp +++ b/src/zapit/src/bouquets.cpp @@ -111,7 +111,7 @@ void CZapitBouquet::addService(CZapitChannel* newChannel) break; } if (bLocked) - newChannel->bAlwaysLocked++; + newChannel->bLockCount++; } void CZapitBouquet::removeService(CZapitChannel* oldChannel) @@ -131,7 +131,7 @@ void CZapitBouquet::removeService(CZapitChannel* oldChannel) } if (bLocked) - oldChannel->bAlwaysLocked--; + oldChannel->bLockCount--; (*channels).erase(remove(channels->begin(), channels->end(), oldChannel), channels->end()); } } diff --git a/src/zapit/src/channel.cpp b/src/zapit/src/channel.cpp index 89c6e21ad..fefb643c3 100644 --- a/src/zapit/src/channel.cpp +++ b/src/zapit/src/channel.cpp @@ -69,7 +69,7 @@ void CZapitChannel::Init() polarization = 0; flags = 0; deltype = FE_QPSK; - bAlwaysLocked = 0; + bLockCount = 0; } CZapitChannel::~CZapitChannel(void) From e1207415af8ea65201b4f8a9333306b355955443 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 26 May 2014 16:55:02 +0200 Subject: [PATCH 090/511] /pictureviewer.cpp CPictureViewer::GetLogoName: don't add the same dir twice Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c86ad2ef484485244ac4eab641da9f6a3aa13d4c Author: Jacek Jendrzej Date: 2014-05-26 (Mon, 26 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/pictureviewer/pictureviewer.cpp | 38 ++++++++++++---------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index 809523849..74badde23 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -527,26 +527,28 @@ bool CPictureViewer::GetLogoName(const uint64_t& channel_id, const std::string& id_tmp_path += strChnId + fileType[i]; v_path.push_back(id_tmp_path); - //create filename with channel name (LOGO_FLASH_DIR_VAR) - id_tmp_path = LOGO_FLASH_DIR_VAR "/"; - id_tmp_path += ChannelName + fileType[i]; - v_path.push_back(id_tmp_path); + if(g_settings.logo_hdd_dir != LOGO_FLASH_DIR_VAR){ + //create filename with channel name (LOGO_FLASH_DIR_VAR) + id_tmp_path = LOGO_FLASH_DIR_VAR "/"; + id_tmp_path += ChannelName + fileType[i]; + v_path.push_back(id_tmp_path); - //create filename with id (LOGO_FLASH_DIR_VAR) - id_tmp_path = LOGO_FLASH_DIR_VAR "/"; - id_tmp_path += strChnId + fileType[i]; - v_path.push_back(id_tmp_path); - - //create filename with channel name (LOGO_FLASH_DIR) - id_tmp_path = LOGO_FLASH_DIR "/"; - id_tmp_path += ChannelName + fileType[i]; - v_path.push_back(id_tmp_path); - - //create filename with id (LOGO_FLASH_DIR) - id_tmp_path = LOGO_FLASH_DIR "/"; - id_tmp_path += strChnId + fileType[i]; - v_path.push_back(id_tmp_path); + //create filename with id (LOGO_FLASH_DIR_VAR) + id_tmp_path = LOGO_FLASH_DIR_VAR "/"; + id_tmp_path += strChnId + fileType[i]; + v_path.push_back(id_tmp_path); + } + if(g_settings.logo_hdd_dir != LOGO_FLASH_DIR){ + //create filename with channel name (LOGO_FLASH_DIR) + id_tmp_path = LOGO_FLASH_DIR "/"; + id_tmp_path += ChannelName + fileType[i]; + v_path.push_back(id_tmp_path); + //create filename with id (LOGO_FLASH_DIR) + id_tmp_path = LOGO_FLASH_DIR "/"; + id_tmp_path += strChnId + fileType[i]; + v_path.push_back(id_tmp_path); + } //check if file is available, name with real name is preferred, return true on success for (size_t j = 0; j < v_path.size(); j++){ if (access(v_path[j].c_str(), R_OK) != -1){ From 67ca20c2c4590e0628e7ae5b09a42ecb12c0750e Mon Sep 17 00:00:00 2001 From: martii Date: Tue, 27 May 2014 11:14:09 +0200 Subject: [PATCH 091/511] zapit/src/zapit.cpp: simplify Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cc80a79f58320d56e6f5fc7af84cf5d6f6e347b2 Author: martii Date: 2014-05-27 (Tue, 27 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/src/zapit.cpp | 65 +++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 39 deletions(-) diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 548a58855..7c0d06c11 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -82,7 +82,7 @@ CBouquetManager *g_bouquetManager = NULL; //int cam_ci = 2; // CA_INIT_SC 0 or CA_INIT_CI 1 or CA_INIT_BOTH 2 cCA *ca = NULL; -extern cDemux * pmtDemux; +extern cDemux *pmtDemux; extern cVideo *videoDecoder; extern cAudio *audioDecoder; extern cDemux *audioDemux; @@ -2025,16 +2025,11 @@ void CZapit::sendChannels(int connfd, const CZapitClient::channelsMode mode, con bool CZapit::StartPlayBack(CZapitChannel *thisChannel) { - bool have_pcr = false; - bool have_audio = false; - bool have_video = false; - bool have_teletext = false; - INFO("standby %d playing %d forced %d", standby, playing, playbackStopForced); if(!thisChannel) thisChannel = current_channel; - if ((playbackStopForced == true) || (!thisChannel) || playing) + if (playbackStopForced || !thisChannel || playing) return false; if(standby) { @@ -2042,65 +2037,58 @@ bool CZapit::StartPlayBack(CZapitChannel *thisChannel) return true; } - printf("[zapit] vpid %X apid %X pcr %X\n", thisChannel->getVideoPid(), thisChannel->getAudioPid(), thisChannel->getPcrPid()); - if (thisChannel->getPcrPid() != 0) - have_pcr = true; - if (thisChannel->getAudioPid() != 0) - have_audio = true; - if ((thisChannel->getVideoPid() != 0) && (currentMode & TV_MODE)) - have_video = true; - if (thisChannel->getTeletextPid() != 0) - have_teletext = true; + unsigned short pcr_pid = thisChannel->getPcrPid(); + unsigned short audio_pid = thisChannel->getAudioPid(); + unsigned short video_pid = (currentMode & TV_MODE) ? thisChannel->getVideoPid() : 0; + unsigned short teletext_pid = thisChannel->getTeletextPid(); + printf("[zapit] vpid %X apid %X pcr %X\n", video_pid, audio_pid, pcr_pid); - if ((!have_audio) && (!have_video) && (!have_teletext)) + if (!audio_pid && !video_pid && !teletext_pid) return false; #if 1 - if(have_video && (thisChannel->getPcrPid() == 0x1FFF)) { //FIXME - thisChannel->setPcrPid(thisChannel->getVideoPid()); - have_pcr = true; + if(video_pid && (pcr_pid == 0x1FFF)) { //FIXME + thisChannel->setPcrPid(video_pid); + pcr_pid = video_pid; } #endif /* set demux filters */ videoDecoder->SetStreamType((VIDEO_FORMAT)thisChannel->type); // videoDecoder->SetSync(VIDEO_PLAY_MOTION); - if (have_pcr) { - pcrDemux->pesFilter(thisChannel->getPcrPid()); - } - if (have_audio) { - audioDemux->pesFilter(thisChannel->getAudioPid()); - } - if (have_video) { - videoDemux->pesFilter(thisChannel->getVideoPid()); - } + if (pcr_pid) + pcrDemux->pesFilter(pcr_pid); + if (audio_pid) + audioDemux->pesFilter(audio_pid); + if (video_pid) + videoDemux->pesFilter(video_pid); // audioDecoder->SetSyncMode(AVSYNC_ENABLED); #if 0 //FIXME hack ? if(thisChannel->getServiceType() == ST_DIGITAL_RADIO_SOUND_SERVICE) { audioDecoder->SetSyncMode(AVSYNC_AUDIO_IS_MASTER); - have_pcr = false; + pcr_pid = false; } #endif - if (have_pcr) { - printf("[zapit] starting PCR 0x%X\n", thisChannel->getPcrPid()); + if (pcr_pid) { + //printf("[zapit] starting PCR 0x%X\n", thisChannel->getPcrPid()); pcrDemux->Start(); } /* select audio output and start audio */ - if (have_audio) { + if (audio_pid) { SetAudioStreamType(thisChannel->getAudioChannel()->audioChannelType); audioDemux->Start(); audioDecoder->Start(); } /* start video */ - if (have_video) { - videoDecoder->Start(0, thisChannel->getPcrPid(), thisChannel->getVideoPid()); + if (video_pid) { + videoDecoder->Start(0, pcr_pid, video_pid); videoDemux->Start(); } #ifdef USE_VBI - if(have_teletext) - videoDecoder->StartVBI(thisChannel->getTeletextPid()); + if(teletext_pid) + videoDecoder->StartVBI(teletext_pid); #endif playing = true; @@ -2236,8 +2224,7 @@ unsigned CZapit::ZapTo(const unsigned int pchannel) CBouquetManager::ChannelIterator cit = ((currentMode & RADIO_MODE) ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin()).FindChannelNr(pchannel); if (!(cit.EndOfChannels())) return ZapTo((*cit)->getChannelID(), false); - else - return 0; + return 0; } bool CZapit::Start(Z_start_arg *ZapStart_arg) From 2792c9e94558cc42d191d08d1d615f76a1812fce Mon Sep 17 00:00:00 2001 From: martii Date: Tue, 27 May 2014 12:04:25 +0200 Subject: [PATCH 092/511] styling for EPG view/eventlist (patch from Benny, thanks!) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5809315cc59d3436ad62bbeacb3c0e11446a10d9 Author: martii Date: 2014-05-27 (Tue, 27 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 20 +++++++------------- src/gui/eventlist.cpp | 20 +++++++++----------- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 9f4e9e35d..ee17b8e4b 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -180,7 +180,7 @@ void CEpgData::processTextToArray(std::string text, int screening) // UTF-8 // check the wordwidth - add to this line if size ok int aktWordWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(aktWord, true); - if ((aktWordWidth+aktWidth)<(ox- 20- 15)) + if ((aktWordWidth+aktWidth)<(ox - 20 - 15)) {//space ok, add aktWidth += aktWordWidth; aktLine += aktWord; @@ -228,10 +228,10 @@ void CEpgData::showText( int startPos, int ypos ) int max_mon_w = 0, max_wday_w = 0; int digi = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth("29.."); for(int i = 0; i < 12;i++){ - max_mon_w = std::max(max_mon_w ,g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getMonth(i))) + ".", true)); // UTF-8 + max_mon_w = std::max(max_mon_w, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getMonth(i))) + " ", true)); // UTF-8 if(i > 6) - continue; - max_wday_w = std::max(max_wday_w ,g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getWeekday(i))) + ".", true)); // UTF-8 + continue; + max_wday_w = std::max(max_wday_w, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getWeekday(i))) + " ", true)); // UTF-8 } frameBuffer->paintBoxRel(sx, y, ox- 15, sb, COL_MENUCONTENT_PLUS_0); // background of the text box for (int i = startPos; i < textSize && i < startPos + medlinecount; i++, y += medlineheight) @@ -245,7 +245,7 @@ void CEpgData::showText( int startPos, int ypos ) offset += max_wday_w; break; case 3: - offset += max_mon_w; + offset += max_mon_w/2; break; default: offset += digi; @@ -1111,15 +1111,9 @@ int CEpgData::FollowScreenings (const t_channel_id /*channel_id*/, const std::st tmStartZeit = localtime(&(e->startTime)); screening_dates = g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit)); - screening_dates += '.'; - - strftime(tmpstr, sizeof(tmpstr), " %d.", tmStartZeit ); - screening_dates += tmpstr; - + screening_dates += strftime(", %d", tmStartZeit); screening_dates += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); - - strftime(tmpstr, sizeof(tmpstr), ". %H:%M", tmStartZeit ); - screening_dates += tmpstr; + screening_dates += strftime(", %R", tmStartZeit); if (e->startTime <= tmp_curent_zeit) flag = 2; else diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 8cca0c519..06e755c74 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -749,16 +749,11 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI) datetime1_str = g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit)); + datetime1_str += strftime(", %H:%M,", tmStartZeit ); + datetime1_str += strftime(" %d", tmStartZeit ); + datetime1_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); - strftime(tmpstr, sizeof(tmpstr), ". %H:%M, ", tmStartZeit ); - datetime1_str += tmpstr; - - strftime(tmpstr, sizeof(tmpstr), " %d. ", tmStartZeit ); - datetime2_str = tmpstr; - - datetime2_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); - - datetime2_str += '.'; + //datetime2_str += '.'; if ( m_showChannel ) // show the channel if we made a event search only (which could be made through all channels ). { @@ -772,8 +767,11 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI) } // 1st line - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5, ypos+ fheight1+3, fwidth1+5, datetime1_str, color, 0, true); // UTF-8 - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5+fwidth1, ypos+ fheight1+3, width-fwidth1-10- 20, datetime2_str, color, 0, true); // UTF-8 + int fwidth1a=g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime1_str); + //int fwidth1b=g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime2_str); + + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5, ypos+ fheight1+3, fwidth1a, datetime1_str, color, 0, true); // UTF-8 + //g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5+fwidth1a/2, ypos+ fheight1+3, fwidth1b, datetime2_str, color, 0, true); // UTF-8 int seit = ( evtlist[curpos].startTime - time(NULL) ) / 60; if ( (seit> 0) && (seit<100) && (duration_str.length()!=0) ) From 0945c525caf78bffcfef39e4b115dd7280370f35 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 27 May 2014 17:21:42 +0200 Subject: [PATCH 093/511] Revert "styling for EPG view/eventlist (patch from Benny, thanks!)" This reverts commit 2792c9e94558cc42d191d08d1d615f76a1812fce because this commit seems to need some more affection. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/193c49d55e1c694d2a19134e1dad6fb0426bf2da Author: vanhofen Date: 2014-05-27 (Tue, 27 May 2014) ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 20 +++++++++++++------- src/gui/eventlist.cpp | 20 +++++++++++--------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index ee17b8e4b..9f4e9e35d 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -180,7 +180,7 @@ void CEpgData::processTextToArray(std::string text, int screening) // UTF-8 // check the wordwidth - add to this line if size ok int aktWordWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(aktWord, true); - if ((aktWordWidth+aktWidth)<(ox - 20 - 15)) + if ((aktWordWidth+aktWidth)<(ox- 20- 15)) {//space ok, add aktWidth += aktWordWidth; aktLine += aktWord; @@ -228,10 +228,10 @@ void CEpgData::showText( int startPos, int ypos ) int max_mon_w = 0, max_wday_w = 0; int digi = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth("29.."); for(int i = 0; i < 12;i++){ - max_mon_w = std::max(max_mon_w, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getMonth(i))) + " ", true)); // UTF-8 + max_mon_w = std::max(max_mon_w ,g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getMonth(i))) + ".", true)); // UTF-8 if(i > 6) - continue; - max_wday_w = std::max(max_wday_w, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getWeekday(i))) + " ", true)); // UTF-8 + continue; + max_wday_w = std::max(max_wday_w ,g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getWeekday(i))) + ".", true)); // UTF-8 } frameBuffer->paintBoxRel(sx, y, ox- 15, sb, COL_MENUCONTENT_PLUS_0); // background of the text box for (int i = startPos; i < textSize && i < startPos + medlinecount; i++, y += medlineheight) @@ -245,7 +245,7 @@ void CEpgData::showText( int startPos, int ypos ) offset += max_wday_w; break; case 3: - offset += max_mon_w/2; + offset += max_mon_w; break; default: offset += digi; @@ -1111,9 +1111,15 @@ int CEpgData::FollowScreenings (const t_channel_id /*channel_id*/, const std::st tmStartZeit = localtime(&(e->startTime)); screening_dates = g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit)); - screening_dates += strftime(", %d", tmStartZeit); + screening_dates += '.'; + + strftime(tmpstr, sizeof(tmpstr), " %d.", tmStartZeit ); + screening_dates += tmpstr; + screening_dates += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); - screening_dates += strftime(", %R", tmStartZeit); + + strftime(tmpstr, sizeof(tmpstr), ". %H:%M", tmStartZeit ); + screening_dates += tmpstr; if (e->startTime <= tmp_curent_zeit) flag = 2; else diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 06e755c74..8cca0c519 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -749,11 +749,16 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI) datetime1_str = g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit)); - datetime1_str += strftime(", %H:%M,", tmStartZeit ); - datetime1_str += strftime(" %d", tmStartZeit ); - datetime1_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); - //datetime2_str += '.'; + strftime(tmpstr, sizeof(tmpstr), ". %H:%M, ", tmStartZeit ); + datetime1_str += tmpstr; + + strftime(tmpstr, sizeof(tmpstr), " %d. ", tmStartZeit ); + datetime2_str = tmpstr; + + datetime2_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); + + datetime2_str += '.'; if ( m_showChannel ) // show the channel if we made a event search only (which could be made through all channels ). { @@ -767,11 +772,8 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI) } // 1st line - int fwidth1a=g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime1_str); - //int fwidth1b=g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime2_str); - - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5, ypos+ fheight1+3, fwidth1a, datetime1_str, color, 0, true); // UTF-8 - //g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5+fwidth1a/2, ypos+ fheight1+3, fwidth1b, datetime2_str, color, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5, ypos+ fheight1+3, fwidth1+5, datetime1_str, color, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5+fwidth1, ypos+ fheight1+3, width-fwidth1-10- 20, datetime2_str, color, 0, true); // UTF-8 int seit = ( evtlist[curpos].startTime - time(NULL) ) / 60; if ( (seit> 0) && (seit<100) && (duration_str.length()!=0) ) From ce38dcf12e7bdc18270cb34d0d7b35cbc27eae4b Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 29 May 2014 16:23:36 +0200 Subject: [PATCH 094/511] add h265 to record and stream Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d9483e019eb6631c5b6ac63b12067a31ec5c988a Author: Jacek Jendrzej Date: 2014-05-29 (Thu, 29 May 2014) Origin message was: ------------------ -add h265 to record and stream ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/genpsi.cpp | 5 +++++ src/driver/genpsi.h | 1 + src/driver/record.cpp | 2 +- src/driver/streamts.cpp | 2 +- src/eitd/eitd.h | 2 +- src/zapit/src/scanpmt.cpp | 3 ++- 6 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/driver/genpsi.cpp b/src/driver/genpsi.cpp index e85e8f1fc..f2acc19f7 100644 --- a/src/driver/genpsi.cpp +++ b/src/driver/genpsi.cpp @@ -34,6 +34,7 @@ #define ES_TYPE_MPEG12 0x02 #define ES_TYPE_AVC 0x1b +#define ES_TYPE_HEVC 0x24 #define ES_TYPE_MPA 0x03 #define ES_TYPE_EAC3 0x7a #define ES_TYPE_AC3 0x81 @@ -131,6 +132,10 @@ void CGenPsi::addPid(uint16_t pid, uint16_t pidtype, short isAC3, const char *da pcrpid=vpid=pid; vtype = ES_TYPE_AVC; break; + case EN_TYPE_HEVC: + pcrpid=vpid=pid; + vtype = ES_TYPE_HEVC; + break; case EN_TYPE_PCR: pcrpid=pid; break; diff --git a/src/driver/genpsi.h b/src/driver/genpsi.h index b34ff8510..c52b4acb2 100644 --- a/src/driver/genpsi.h +++ b/src/driver/genpsi.h @@ -30,6 +30,7 @@ #define EN_TYPE_AVC 0x04 #define EN_TYPE_DVBSUB 0x06 #define EN_TYPE_AUDIO_EAC3 0x07 +#define EN_TYPE_HEVC 0x08 class CGenPsi { diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 7e2896903..4bfc8a529 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -164,7 +164,7 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) CGenPsi psi; numpids = 0; if (allpids.PIDs.vpid != 0){ - psi.addPid(allpids.PIDs.vpid, recMovieInfo->VideoType ? EN_TYPE_AVC : EN_TYPE_VIDEO, 0); + psi.addPid(allpids.PIDs.vpid, recMovieInfo->VideoType == 1 ? EN_TYPE_AVC : recMovieInfo->VideoType == 2 ? EN_TYPE_HEVC : EN_TYPE_VIDEO, 0); if (allpids.PIDs.pcrpid && (allpids.PIDs.pcrpid != allpids.PIDs.vpid)) { psi.addPid(allpids.PIDs.pcrpid, EN_TYPE_PCR, 0); apids[numpids++]=allpids.PIDs.pcrpid; diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index aaf9574fb..b30247b47 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -437,7 +437,7 @@ void CStreamManager::AddPids(int fd, CZapitChannel *channel, stream_pids_t &pids for (stream_pids_t::iterator it = pids.begin(); it != pids.end(); ++it) { if (*it == channel->getVideoPid()) { printf("CStreamManager::Parse: genpsi vpid %x (%d)\n", *it, channel->type); - psi.addPid(*it, channel->type ? EN_TYPE_AVC : EN_TYPE_VIDEO, 0); + psi.addPid(*it, channel->type == 1 ? EN_TYPE_AVC : channel->type == 2 ? EN_TYPE_HEVC : EN_TYPE_VIDEO, 0); } else { for (int i = 0; i < channel->getAudioChannelCount(); i++) { if (*it == channel->getAudioChannel(i)->pid) { diff --git a/src/eitd/eitd.h b/src/eitd/eitd.h index e0aead9c3..c650001ad 100644 --- a/src/eitd/eitd.h +++ b/src/eitd/eitd.h @@ -52,7 +52,7 @@ typedef SIservice * SIservicePtr; #define TIME_EIT_SCHEDULED_PAUSE 60 * 60 /* force EIT thread to change filter after, seconds */ -#define TIME_EIT_SKIPPING 180 // 90 <- Canal diditaal 19.2e -> ~100 seconds for 0x5x +#define TIME_EIT_SKIPPING 240 // 90 <- Canal diditaal 19.2e -> ~100 seconds for 0x5x /* a little more time for freesat epg */ #define TIME_FSEIT_SKIPPING 240 /* Timeout in ms for reading from dmx in EIT threads. Dont make this too long diff --git a/src/zapit/src/scanpmt.cpp b/src/zapit/src/scanpmt.cpp index b2e9b4789..f62cbf60b 100644 --- a/src/zapit/src/scanpmt.cpp +++ b/src/zapit/src/scanpmt.cpp @@ -265,9 +265,10 @@ bool CPmt::ParseEsInfo(ElementaryStreamInfo *esinfo, CZapitChannel * const chann switch (stream_type) { case 0x01: case 0x02: + case 0x24: case 0x1b: // AVC Video Stream (MPEG4 H264) channel->setVideoPid(esinfo->getPid()); - channel->type = (stream_type == 0x1b); //FIXME + channel->type = (stream_type == 0x1b) ? 1 : (stream_type == 0x24) ? 2 : 0; //FIXME printf("[pmt] vpid %04x stream %d type %d\n", esinfo->getPid(), stream_type, channel->type); break; case 0x03: From 2814d74d0d10ad677a65a30deb2e978b2093bddc Mon Sep 17 00:00:00 2001 From: martii Date: Mon, 26 May 2014 18:19:40 +0200 Subject: [PATCH 095/511] gui/eventlist: utf8 rendering fix (thanks Benny!) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/67bb4f7d10dc917fe7e064a6aa1f270468fa280e Author: martii Date: 2014-05-26 (Mon, 26 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 8cca0c519..d4fe16de6 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -782,7 +782,7 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI) snprintf(beginnt, sizeof(beginnt), "%s %d %s", g_Locale->getText(LOCALE_WORD_IN), seit, unit_short_minute); int w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(beginnt) + 10; - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20- w, ypos+ fheight1+3, fwidth2, beginnt, color); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20- w, ypos+ fheight1+3, fwidth2, beginnt, color, 0, true); // UTF-8 } g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20, ypos+ fheight1+3, fwidth2, duration_str, color, 0, true); // UTF-8 From f7299b98db6d087d9285feaa4c0935979e4bf62c Mon Sep 17 00:00:00 2001 From: martii Date: Wed, 28 May 2014 19:26:40 +0200 Subject: [PATCH 096/511] gui/eventlist: fix paintItem() [patch from Benny] Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f4fd139e08d8d29eefb5052bff358e6161ebdedc Author: martii Date: 2014-05-28 (Wed, 28 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index d4fe16de6..9f4c4b1e7 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -782,7 +782,7 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI) snprintf(beginnt, sizeof(beginnt), "%s %d %s", g_Locale->getText(LOCALE_WORD_IN), seit, unit_short_minute); int w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(beginnt) + 10; - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20- w, ypos+ fheight1+3, fwidth2, beginnt, color, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20- w, ypos+ fheight1+3, w, beginnt, color, 0, true); // UTF-8 } g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20, ypos+ fheight1+3, fwidth2, duration_str, color, 0, true); // UTF-8 From 6351278e6de70e27cd2397528d3ef8146d4f8f04 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 29 May 2014 20:02:30 +0200 Subject: [PATCH 097/511] streaminfo2.cpp -fix bitrate calc offset and use utf8 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/99a7f2ba3bb76c87d4ebe3896b6000a3b68f902f Author: Jacek Jendrzej Date: 2014-05-29 (Thu, 29 May 2014) Origin message was: ------------------ streaminfo2.cpp -fix bitrate calc offset and use utf8 ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/unmaintained/polski.locale | 2 +- src/gui/streaminfo2.cpp | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/data/locale/unmaintained/polski.locale b/data/locale/unmaintained/polski.locale index 9c44e795b..1f6d1e0dc 100644 --- a/data/locale/unmaintained/polski.locale +++ b/data/locale/unmaintained/polski.locale @@ -1117,7 +1117,7 @@ sleeptimerbox.title Wyłącznik czasowy streaminfo.aratio Proporcje streaminfo.aratio_unknown Proporcje: nieznane streaminfo.audiotype Format dźwięku -streaminfo.bitrate Szybkość transmisji: +streaminfo.bitrate Szybkość transmisji streaminfo.framerate Klatek/s streaminfo.framerate_unknown Klatek/s: brak danych streaminfo.head Informacje o strumieniu diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 738815b81..c8a80e5e4 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -449,17 +449,20 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) transponder t; CServiceManager::getInstance()->GetTransponder(channel->getTransponderId(), t); - int array[5]={g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION)), - g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_ARATIO)), - g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE)), - g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE)), - g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_SCANTS_FREQDATA))}; + int array[6]={g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION),true), + g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_ARATIO),true), + g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_BITRATE),true), + g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE),true), + g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE),true), + g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_SCANTS_FREQDATA),true)};// UTF-8 - for(i=0 ; i<5; i++) { + for(i=0 ; i<6; i++) { if(spaceoffset < array[i]) spaceoffset = array[i]; } - average_bitrate_offset = spaceoffset+=4; + spaceoffset += g_Font[font_info]->getRenderWidth(" "); + + average_bitrate_offset = spaceoffset; if(channel->getVideoPid() && !(videoDecoder->getBlank())){ videoDecoder->getPictureInfo(xres, yres, framerate); From 23abd23c4ab3cfe746dcb04cbf91c8fb702f94d8 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 29 May 2014 20:15:44 +0200 Subject: [PATCH 098/511] fix to Commit 2814d74 (thx Gaucho316) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/39eb29e43781cdcfcb7a5013cba000b3ba0b9d7b Author: Jacek Jendrzej Date: 2014-05-29 (Thu, 29 May 2014) Origin message was: ------------------ fix to Commit 2814d74 (thx Gaucho316) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 9f4c4b1e7..7d6b507b1 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -780,8 +780,7 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI) { char beginnt[100]; snprintf(beginnt, sizeof(beginnt), "%s %d %s", g_Locale->getText(LOCALE_WORD_IN), seit, unit_short_minute); - int w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(beginnt) + 10; - + int w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(beginnt, true) + 10; g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20- w, ypos+ fheight1+3, w, beginnt, color, 0, true); // UTF-8 } g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20, ypos+ fheight1+3, fwidth2, duration_str, color, 0, true); // UTF-8 From 2e874500a6e2abf3818501dcb806ca1749d4195a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 29 May 2014 22:26:30 +0200 Subject: [PATCH 099/511] helpers.cpp: add shortened strftime() function taken from martiis neutrino-mp Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/672257906eebb55915944ea819c2f94fcf2cb26d Author: vanhofen Date: 2014-05-29 (Thu, 29 May 2014) Origin message was: ------------------ - helpers.cpp: add shortened strftime() function taken from martiis neutrino-mp ------------------ This commit was generated by Migit --- src/system/helpers.cpp | 8 + src/system/helpers.cpp.orig | 759 ++++++++++++++++++++++++++++++++++++ src/system/helpers.h | 1 + src/system/helpers.h.orig | 90 +++++ 4 files changed, 858 insertions(+) create mode 100644 src/system/helpers.cpp.orig create mode 100644 src/system/helpers.h.orig diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 85a369ff6..a376e82ad 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -390,6 +390,14 @@ std::string trim(std::string &str, const std::string &trimChars /*= " \n\r\t"*/) return result.erase(0, result.find_first_not_of(trimChars)); } +std::string strftime(const char *format, const struct tm *tm) +{ + char buf[4096]; + *buf = 0; + strftime(buf, sizeof(buf), format, tm); + return std::string(buf); +} + time_t toEpoch(std::string &date) { struct tm t; diff --git a/src/system/helpers.cpp.orig b/src/system/helpers.cpp.orig new file mode 100644 index 000000000..85a369ff6 --- /dev/null +++ b/src/system/helpers.cpp.orig @@ -0,0 +1,759 @@ +/* + Neutrino-HD + + License: GPL + + (C) 2012-2013 the neutrino-hd developers + (C) 2012,2013 Stefan Seyfried + + 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 HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include /* or */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +void mySleep(int sec) { + struct timeval timeout; + + timeout.tv_sec = sec; + timeout.tv_usec = 0; + select(0,0,0,0, &timeout); +} + +off_t file_size(const char *filename) +{ + struct stat stat_buf; + if(::stat(filename, &stat_buf) == 0) + { + return stat_buf.st_size; + } else + { + return 0; + } +} + +bool file_exists(const char *filename) +{ + struct stat stat_buf; + if(::stat(filename, &stat_buf) == 0) + { + return true; + } else + { + return false; + } +} + +void wakeup_hdd(const char *hdd_dir) +{ + if(!check_dir(hdd_dir) && hdd_get_standby(hdd_dir)){ + std::string wakeup_file = hdd_dir; + wakeup_file += "/.wakeup"; + int fd = open(wakeup_file.c_str(), O_SYNC | O_WRONLY | O_CREAT | O_TRUNC, S_IWUSR); + if (fd >= 0) { + unsigned char buf[512]; + memset(buf, 0xFF, sizeof(buf)); + for (int i = 0; i < 20; i++) { + if (write(fd, buf, sizeof(buf)) < 0) { + perror("write to .wakeup"); + break; + } + } + fdatasync(fd); + close(fd); + } + hdd_flush(hdd_dir); + remove(wakeup_file.c_str()); + } +} +//use for script with full path +int my_system(const char * cmd) +{ + if (!file_exists(cmd)) + return -1; + + return my_system(1, cmd); +} + +int my_system(int argc, const char *arg, ...) +{ + int i = 0, ret = 0, childExit = 0; +#define ARGV_MAX 64 + /* static right now but could be made dynamic if necessary */ + int argv_max = ARGV_MAX; + const char *argv[ARGV_MAX]; + va_list args; + argv[0] = arg; + va_start(args, arg); + + while(++i < argc) + { + if (i == argv_max) + { + fprintf(stderr, "my_system: too many arguments!\n"); + return -1; + } + argv[i] = va_arg(args, const char *); + } + argv[i] = NULL; /* sentinel */ + //fprintf(stderr,"%s:", __func__);for(i=0;argv[i];i++)fprintf(stderr," '%s'",argv[i]);fprintf(stderr,"\n"); + + pid_t pid; + int maxfd = getdtablesize();// sysconf(_SC_OPEN_MAX); + switch (pid = vfork()) + { + case -1: /* can't vfork */ + perror("vfork"); + ret = -errno; + break; + case 0: /* child process */ + for(i = 3; i < maxfd; i++) + close(i); + if (setsid() == -1) + perror("my_system setsid"); + if (execvp(argv[0], (char * const *)argv)) + { + ret = -errno; + if (errno != ENOENT) /* don't complain if argv[0] only does not exist */ + fprintf(stderr, "ERROR: my_system \"%s\": %m\n", argv[0]); + } + _exit(ret); // terminate c h i l d proces s only + default: /* parent returns to calling process */ + waitpid(pid, &childExit, 0); + if (WEXITSTATUS(childExit) != 0) + ret = (signed char)WEXITSTATUS(childExit); + break; + } + va_end(args); + return ret; +} + +FILE* my_popen( pid_t& pid, const char *cmdstring, const char *type) +{ + int pfd[2] ={-1,-1}; + FILE *fp = NULL; + + /* only allow "r" or "w" */ + if ((type[0] != 'r' && type[0] != 'w') || type[1] != 0) { + errno = EINVAL; /* required by POSIX */ + return(NULL); + } + + if (pipe(pfd) < 0) + return(NULL); /* errno set by pipe() */ + + if ((pid = vfork()) < 0) { + return(NULL); /* errno set by vfork() */ + } else if (pid == 0) { /* child */ + if (*type == 'r') { + close(pfd[0]); + if (pfd[1] != STDOUT_FILENO) { + dup2(pfd[1], STDOUT_FILENO); + close(pfd[1]); + } + } else { + close(pfd[1]); + if (pfd[0] != STDIN_FILENO) { + dup2(pfd[0], STDIN_FILENO); + close(pfd[0]); + } + } + int maxfd = getdtablesize(); + for(int i = 3; i < maxfd; i++) + close(i); + if (setsid() == -1) + perror("my_popen setsid"); + execl("/bin/sh", "sh", "-c", cmdstring, (char *)0); + exit(0); + } + + /* parent continues... */ + if (*type == 'r') { + close(pfd[1]); + if ((fp = fdopen(pfd[0], type)) == NULL) + return(NULL); + } else { + close(pfd[0]); + if ((fp = fdopen(pfd[1], type)) == NULL) + return(NULL); + } + return(fp); +} + +int safe_mkdir(const char * path) +{ + struct statfs s; + size_t l = strlen(path); + char d[l + 3]; + strncpy(d, path, l); + + // skip trailing slashes + while (l > 0 && d[l - 1] == '/') + l--; + // find last slash + while (l > 0 && d[l - 1] != '/') + l--; + if (!l) + return -1; + // append a single dot + d[l++] = '.'; + d[l] = 0; + + if(statfs(d, &s) || (s.f_type == 0x72b6 /* jffs2 */)) + return -1; + return mkdir(path, 0755); +} + +/* function used to check is this dir writable, i.e. not flash, for record etc */ +int check_dir(const char * dir, bool allow_tmp) +{ + /* default to return, if statfs fail */ + int ret = -1; + struct statfs s; + if (::statfs(dir, &s) == 0) { + switch (s.f_type) { + case 0x858458f6L: // ramfs + case 0x1021994L: // tmpfs + if(allow_tmp) + ret = 0;//ok + case 0x72b6L: // jffs2 + break; + default: + ret = 0; // ok + } + } + return ret; +} + +bool get_fs_usage(const char * dir, uint64_t &btotal, uint64_t &bused, long *bsize/*=NULL*/) +{ + btotal = bused = 0; + struct statfs s; + + if (::statfs(dir, &s) == 0 && s.f_blocks) { + btotal = s.f_blocks; + bused = s.f_blocks - s.f_bfree; + if (bsize != NULL) + *bsize = s.f_bsize; + //printf("fs (%s): total %llu used %llu\n", dir, btotal, bused); + return true; + } + return false; +} + +bool get_mem_usage(unsigned long &kbtotal, unsigned long &kbfree) +{ + unsigned long cached = 0, buffers = 0; + kbtotal = kbfree = 0; + + FILE * f = fopen("/proc/meminfo", "r"); + if (!f) + return false; + + char buffer[256]; + while (fgets(buffer, 255, f)) { + if (!strncmp(buffer, "Mem", 3)) { + if (!strncmp(buffer+3, "Total", 5)) + kbtotal = strtoul(buffer+9, NULL, 10); + else if (!strncmp(buffer+3, "Free", 4)) + kbfree = strtoul(buffer+8, NULL, 10); + } + else if (!strncmp(buffer, "Buffers", 7)) { + buffers = strtoul(buffer+8, NULL, 10); + } + else if (!strncmp(buffer, "Cached", 6)) { + cached = strtoul(buffer+7, NULL, 10); + break; + } + } + fclose(f); + kbfree = kbfree + cached + buffers; + printf("mem: total %ld cached %ld free %ld\n", kbtotal, cached, kbfree); + return true; +} + +std::string find_executable(const char *name) +{ + struct stat s; + char *tmpPath = getenv("PATH"); + char *p, *n, *path; + if (tmpPath) + path = strdupa(tmpPath); + else + path = strdupa("/bin:/usr/bin:/sbin:/usr/sbin"); + if (name[0] == '/') { /* full path given */ + if (!access(name, X_OK) && !stat(name, &s) && S_ISREG(s.st_mode)) + return std::string(name); + return ""; + } + + p = path; + while (p) { + n = strchr(p, ':'); + if (n) + *n++ = '\0'; + if (*p != '\0') { + std::string tmp = std::string(p) + "/" + std::string(name); + const char *f = tmp.c_str(); + if (!access(f, X_OK) && !stat(f, &s) && S_ISREG(s.st_mode)) + return tmp; + } + p = n; + } + return ""; +} + +std::string _getPathName(std::string &path, std::string sep) +{ + size_t pos = path.find_last_of(sep); + if (pos == std::string::npos) + return path; + return path.substr(0, pos); +} + +std::string _getBaseName(std::string &path, std::string sep) +{ + size_t pos = path.find_last_of(sep); + if (pos == std::string::npos) + return path; + if (path.length() == pos +1) + return ""; + return path.substr(pos+1); +} + +std::string getPathName(std::string &path) +{ + return _getPathName(path, "/"); +} + +std::string getBaseName(std::string &path) +{ + return _getBaseName(path, "/"); +} + +std::string getFileName(std::string &file) +{ + return _getPathName(file, "."); +} + +std::string getFileExt(std::string &file) +{ + return _getBaseName(file, "."); +} + + +std::string getNowTimeStr(const char* format) +{ + char tmpStr[256]; + struct timeval tv; + gettimeofday(&tv, NULL); + strftime(tmpStr, sizeof(tmpStr), format, localtime(&tv.tv_sec)); + return (std::string)tmpStr; +} + +std::string trim(std::string &str, const std::string &trimChars /*= " \n\r\t"*/) +{ + std::string result = str.erase(str.find_last_not_of(trimChars) + 1); + return result.erase(0, result.find_first_not_of(trimChars)); +} + +time_t toEpoch(std::string &date) +{ + struct tm t; + memset(&t, 0, sizeof(t)); + char *p = strptime(date.c_str(), "%Y-%m-%d", &t); + if(p) + return mktime(&t); + + return 0; + +} + +std::string& str_replace(const std::string &search, const std::string &replace, std::string &text) +{ + if (search.empty() || text.empty()) + return text; + + size_t searchLen = search.length(); + while (1) { + size_t pos = text.find(search); + if (pos == std::string::npos) + break; + text.replace(pos, searchLen, replace); + } + return text; +} + +std::string& htmlEntityDecode(std::string& text) +{ + struct decode_table { + const char* code; + const char* htmlCode; + }; + decode_table dt[] = + { + {" ", " "}, + {"&", "&"}, + {"<", "<"}, + {">", ">"}, + {"\"", """}, + {"'", "'"}, + {"€", "€"}, + {"–", "–"}, + {"“", "“"}, + {"”", "”"}, + {"„", "„"}, + {"•", "•"}, + {"…", "…"}, + {NULL, NULL} + }; + for (int i = 0; dt[i].code != NULL; i++) + text = str_replace(dt[i].htmlCode, dt[i].code, text); + + return text; +} + +CFileHelpers::CFileHelpers() +{ + FileBufSize = 0xFFFF; + FileBuf = new char[FileBufSize]; + doCopyFlag = true; +} + +CFileHelpers::~CFileHelpers() +{ + if (FileBuf != NULL) + delete [] FileBuf; +} + +CFileHelpers* CFileHelpers::getInstance() +{ + static CFileHelpers* FileHelpers = NULL; + if(!FileHelpers) + FileHelpers = new CFileHelpers(); + return FileHelpers; +} + +bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t mode) +{ + doCopyFlag = true; + unlink(Dst); + if ((fd1 = open(Src, O_RDONLY)) < 0) + return false; + if ((fd2 = open(Dst, O_WRONLY | O_CREAT, 0666)) < 0) { + close(fd1); + return false; + } + + uint32_t block; + off64_t fsizeSrc64 = lseek64(fd1, 0, SEEK_END); + lseek64(fd1, 0, SEEK_SET); + if (fsizeSrc64 > 0x7FFFFFF0) { // > 2GB + off64_t fsize64 = fsizeSrc64; + block = FileBufSize; + //printf("#####[%s] fsizeSrc64: %lld 0x%010llX - large file\n", __FUNCTION__, fsizeSrc64, fsizeSrc64); + while(fsize64 > 0) { + if(fsize64 < (off64_t)FileBufSize) + block = (uint32_t)fsize64; + read(fd1, FileBuf, block); + write(fd2, FileBuf, block); + fsize64 -= block; + if (!doCopyFlag) + break; + } + if (doCopyFlag) { + lseek64(fd2, 0, SEEK_SET); + off64_t fsizeDst64 = lseek64(fd2, 0, SEEK_END); + if (fsizeSrc64 != fsizeDst64){ + close(fd1); + close(fd2); + return false; + } + } + } + else { // < 2GB + off_t fsizeSrc = lseek(fd1, 0, SEEK_END); + lseek(fd1, 0, SEEK_SET); + off_t fsize = fsizeSrc; + block = FileBufSize; + //printf("#####[%s] fsizeSrc: %ld 0x%08lX - normal file\n", __FUNCTION__, fsizeSrc, fsizeSrc); + while(fsize > 0) { + if(fsize < (off_t)FileBufSize) + block = (uint32_t)fsize; + read(fd1, FileBuf, block); + write(fd2, FileBuf, block); + fsize -= block; + if (!doCopyFlag) + break; + } + if (doCopyFlag) { + lseek(fd2, 0, SEEK_SET); + off_t fsizeDst = lseek(fd2, 0, SEEK_END); + if (fsizeSrc != fsizeDst){ + close(fd1); + close(fd2); + return false; + } + } + } + close(fd1); + close(fd2); + + if (!doCopyFlag) { + sync(); + unlink(Dst); + return false; + } + + chmod(Dst, mode); + return true; +} + +bool CFileHelpers::copyDir(const char *Src, const char *Dst, bool backupMode) +{ + DIR *Directory; + struct dirent *CurrentFile; + static struct stat FileInfo; + char srcPath[PATH_MAX]; + char dstPath[PATH_MAX]; + char buf[PATH_MAX]; + + //open directory + if ((Directory = opendir(Src)) == NULL) + return false; + if (lstat(Src, &FileInfo) == -1) { + closedir(Directory); + return false; + } + // create directory + // is symlink + if (S_ISLNK(FileInfo.st_mode)) { + int len = readlink(Src, buf, sizeof(buf)-1); + if (len != -1) { + buf[len] = '\0'; + symlink(buf, Dst); + } + } + else { + // directory + if (createDir(Dst, FileInfo.st_mode & 0x0FFF) == false) { + if (errno != EEXIST) { + closedir(Directory); + return false; + } + } + } + + // read directory + while ((CurrentFile = readdir(Directory)) != NULL) { + // ignore '.' and '..' + if (strcmp(CurrentFile->d_name, ".") && strcmp(CurrentFile->d_name, "..")) { + strcpy(srcPath, Src); + strcat(srcPath, "/"); + strcat(srcPath, CurrentFile->d_name); + if (lstat(srcPath, &FileInfo) == -1) { + closedir(Directory); + return false; + } + strcpy(dstPath, Dst); + strcat(dstPath, "/"); + strcat(dstPath, CurrentFile->d_name); + // is symlink + if (S_ISLNK(FileInfo.st_mode)) { + int len = readlink(srcPath, buf, sizeof(buf)-1); + if (len != -1) { + buf[len] = '\0'; + symlink(buf, dstPath); + } + } + // is directory + else if (S_ISDIR(FileInfo.st_mode)) { + copyDir(srcPath, dstPath); + } + // is file + else if (S_ISREG(FileInfo.st_mode)) { + std::string save = ""; + if (backupMode && (CExtUpdate::getInstance()->isBlacklistEntry(srcPath))) + save = ".save"; + copyFile(srcPath, (dstPath + save).c_str(), FileInfo.st_mode & 0x0FFF); + } + } + } + closedir(Directory); + return true; +} + +bool CFileHelpers::createDir(const char *Dir, mode_t mode) +{ + char dirPath[PATH_MAX]; + DIR *dir; + if ((dir = opendir(Dir)) != NULL) { + closedir(dir); + errno = EEXIST; + return false; + } + + int ret = -1; + while (ret == -1) { + strcpy(dirPath, Dir); + ret = mkdir(dirPath, mode); + if ((errno == ENOENT) && (ret == -1)) { + char * pos = strrchr(dirPath,'/'); + if (pos != NULL) { + pos[0] = '\0'; + createDir(dirPath, mode); + } + } + else + return !ret || (errno == EEXIST); + } + errno = 0; + return true; +} + +bool CFileHelpers::removeDir(const char *Dir) +{ + DIR *dir; + struct dirent *entry; + char path[PATH_MAX]; + + dir = opendir(Dir); + if (dir == NULL) { + printf("Error opendir()\n"); + return false; + } + while ((entry = readdir(dir)) != NULL) { + if (strcmp(entry->d_name, ".") && strcmp(entry->d_name, "..")) { + snprintf(path, (size_t) PATH_MAX, "%s/%s", Dir, entry->d_name); + if (entry->d_type == DT_DIR) + removeDir(path); + else + unlink(path); + } + } + closedir(dir); + rmdir(Dir); + + errno = 0; + return true; +} + +static int hdd_open_dev(const char * fname) +{ + FILE * fp; + struct mntent * mnt; + dev_t dev; + struct stat st; + int fd = -1; + + if (stat(fname, &st) != 0) { + perror(fname); + return fd; + } + + dev = st.st_dev; + fp = setmntent("/proc/mounts", "r"); + if (fp == NULL) { + perror("setmntent"); + return fd; + } + + while ((mnt = getmntent(fp)) != NULL) { + if (stat(mnt->mnt_fsname, &st) != 0) + continue; + if (S_ISBLK(st.st_mode) && st.st_rdev == dev) { + printf("[hdd] file [%s] -> dev [%s]\n", fname, mnt->mnt_fsname); + fd = open(mnt->mnt_fsname, O_RDONLY|O_NONBLOCK); + if (fd < 0) + perror(mnt->mnt_fsname); + break; + } + } + endmntent(fp); + return fd; +} + +bool hdd_get_standby(const char * fname) +{ + bool standby = false; + + int fd = hdd_open_dev(fname); + if (fd >= 0) { + unsigned char args[4] = {WIN_CHECKPOWERMODE1,0,0,0}; + int ret = ioctl(fd, HDIO_DRIVE_CMD, args); + if (ret) { + args[0] = WIN_CHECKPOWERMODE2; + ret = ioctl(fd, HDIO_DRIVE_CMD, args); + } + if ((ret == 0) && (args[2] != 0xFF)) + standby = true; + + printf("[hdd] %s\n", standby ? "standby" : "active"); + close(fd); + } + return standby; +} + +void hdd_flush(const char * fname) +{ + int fd = hdd_open_dev(fname); + if (fd >= 0) { + printf("[hdd] flush buffers...\n"); + fsync(fd); + if (ioctl(fd, BLKFLSBUF, NULL)) + perror("BLKFLSBUF"); + else + ioctl(fd, HDIO_DRIVE_CMD, NULL); + close(fd); + } +} + +/* split string like PARAM1=value1 PARAM2=value2 into map */ +bool split_config_string(const std::string &str, std::map &smap) +{ + smap.clear(); + std::string::size_type start = 0; + std::string::size_type end = 0; + while ((end = str.find(" ", start)) != std::string::npos) { + std::string param = str.substr(start, end - start); + std::string::size_type i = param.find("="); + if (i != std::string::npos) { + smap[param.substr(0,i).c_str()] = param.substr(i+1).c_str(); + } + start = end + 1; + } + return !smap.empty(); +} diff --git a/src/system/helpers.h b/src/system/helpers.h index de994141a..8f1a13bbf 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -54,6 +54,7 @@ std::string getFileName(std::string &file); std::string getFileExt(std::string &file); std::string getNowTimeStr(const char* format); std::string trim(std::string &str, const std::string &trimChars = " \n\r\t"); +std::string strftime(const char *format, const struct tm *tm); time_t toEpoch(std::string &date); std::string& str_replace(const std::string &search, const std::string &replace, std::string &text); std::string& htmlEntityDecode(std::string& text); diff --git a/src/system/helpers.h.orig b/src/system/helpers.h.orig new file mode 100644 index 000000000..de994141a --- /dev/null +++ b/src/system/helpers.h.orig @@ -0,0 +1,90 @@ + +#ifndef __system_helpers__ +#define __system_helpers__ + +/* + Neutrino-HD + + 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. +*/ + +#include +#include +#include +#include +#include + +int my_system(const char * cmd); +int my_system(int argc, const char *arg, ...); /* argc is number of arguments including command */ + +FILE* my_popen( pid_t& pid, const char *cmdstring, const char *type); + +int safe_mkdir(const char * path); +inline int safe_mkdir(std::string path) { return safe_mkdir(path.c_str()); } +off_t file_size(const char *filename); +bool file_exists(const char *filename); +void wakeup_hdd(const char *hdd_dir); +int check_dir(const char * dir, bool allow_tmp = false); +bool get_fs_usage(const char * dir, uint64_t &btotal, uint64_t &bused, long *bsize=NULL); +bool get_mem_usage(unsigned long &total, unsigned long &free); +void mySleep(int sec); + +std::string find_executable(const char *name); + +bool hdd_get_standby(const char * fname); +void hdd_flush(const char * fname); + +std::string getPathName(std::string &path); +std::string getBaseName(std::string &path); +std::string getFileName(std::string &file); +std::string getFileExt(std::string &file); +std::string getNowTimeStr(const char* format); +std::string trim(std::string &str, const std::string &trimChars = " \n\r\t"); +time_t toEpoch(std::string &date); +std::string& str_replace(const std::string &search, const std::string &replace, std::string &text); +std::string& htmlEntityDecode(std::string& text); + +class CFileHelpers +{ + private: + unsigned long FileBufSize; + char *FileBuf; + int fd1, fd2; + + public: + CFileHelpers(); + ~CFileHelpers(); + static CFileHelpers* getInstance(); + bool doCopyFlag; + + bool copyFile(const char *Src, const char *Dst, mode_t mode); + bool copyDir(const char *Src, const char *Dst, bool backupMode=false); + bool createDir(const char *Dir, mode_t mode); + bool removeDir(const char *Dir); +}; + +template std::string to_string(C i) +{ + std::stringstream s; + s << i; + return s.str(); +} + +inline void cstrncpy(char *dest, const char * const src, size_t n) { n--; strncpy(dest, src, n); dest[n] = 0; } +inline void cstrncpy(char *dest, const std::string &src, size_t n) { n--; strncpy(dest, src.c_str(), n); dest[n] = 0; } +bool split_config_string(const std::string &str, std::map &smap); +#endif From e213d6696fd0fd67989001a31b02303101ec2754 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 29 May 2014 22:28:06 +0200 Subject: [PATCH 100/511] styling for EPG view/eventlist (patch from Benny, thanks!) (fixed) taken from martiis neutrino-mp Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6ee9a3a05388cd5f69636fd558e6f683814df8ea Author: vanhofen Date: 2014-05-29 (Thu, 29 May 2014) Origin message was: ------------------ styling for EPG view/eventlist (patch from Benny, thanks!) (fixed) taken from martiis neutrino-mp ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 20 +++++++------------- src/gui/eventlist.cpp | 23 ++++++++++------------- 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 9f4e9e35d..0a44b8224 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -180,7 +180,7 @@ void CEpgData::processTextToArray(std::string text, int screening) // UTF-8 // check the wordwidth - add to this line if size ok int aktWordWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(aktWord, true); - if ((aktWordWidth+aktWidth)<(ox- 20- 15)) + if ((aktWordWidth+aktWidth)<(ox - 20 - 15)) {//space ok, add aktWidth += aktWordWidth; aktLine += aktWord; @@ -228,10 +228,10 @@ void CEpgData::showText( int startPos, int ypos ) int max_mon_w = 0, max_wday_w = 0; int digi = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth("29.."); for(int i = 0; i < 12;i++){ - max_mon_w = std::max(max_mon_w ,g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getMonth(i))) + ".", true)); // UTF-8 + max_mon_w = std::max(max_mon_w, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getMonth(i))) + " ", true)); // UTF-8 if(i > 6) - continue; - max_wday_w = std::max(max_wday_w ,g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getWeekday(i))) + ".", true)); // UTF-8 + continue; + max_wday_w = std::max(max_wday_w, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getWeekday(i))) + " ", true)); // UTF-8 } frameBuffer->paintBoxRel(sx, y, ox- 15, sb, COL_MENUCONTENT_PLUS_0); // background of the text box for (int i = startPos; i < textSize && i < startPos + medlinecount; i++, y += medlineheight) @@ -1101,7 +1101,6 @@ int CEpgData::FollowScreenings (const t_channel_id /*channel_id*/, const std::st std::string screening_dates,screening_nodual; int count = 0; int flag = 1; - char tmpstr[256]={0}; screening_dates = screening_nodual = ""; @@ -1111,15 +1110,9 @@ int CEpgData::FollowScreenings (const t_channel_id /*channel_id*/, const std::st tmStartZeit = localtime(&(e->startTime)); screening_dates = g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit)); - screening_dates += '.'; - - strftime(tmpstr, sizeof(tmpstr), " %d.", tmStartZeit ); - screening_dates += tmpstr; - + screening_dates += strftime(", %d", tmStartZeit); screening_dates += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); - - strftime(tmpstr, sizeof(tmpstr), ". %H:%M", tmStartZeit ); - screening_dates += tmpstr; + screening_dates += strftime(", %R", tmStartZeit); if (e->startTime <= tmp_curent_zeit) flag = 2; else @@ -1127,6 +1120,7 @@ int CEpgData::FollowScreenings (const t_channel_id /*channel_id*/, const std::st if (screening_dates != screening_nodual) { screening_nodual=screening_dates; + processTextToArray(screening_dates, flag ); // UTF-8 } } diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 7d6b507b1..282ed702a 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -49,7 +49,7 @@ #include #include - +#include #include #include #include @@ -747,18 +747,12 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI) char tmpstr[256]; struct tm *tmStartZeit = localtime(&evtlist[curpos].startTime); - datetime1_str = g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit)); + datetime1_str += strftime(", %H:%M", tmStartZeit); + datetime1_str += strftime(", %d", tmStartZeit); + datetime1_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); - strftime(tmpstr, sizeof(tmpstr), ". %H:%M, ", tmStartZeit ); - datetime1_str += tmpstr; - - strftime(tmpstr, sizeof(tmpstr), " %d. ", tmStartZeit ); - datetime2_str = tmpstr; - - datetime2_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); - - datetime2_str += '.'; + //datetime2_str += '.'; if ( m_showChannel ) // show the channel if we made a event search only (which could be made through all channels ). { @@ -772,8 +766,11 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI) } // 1st line - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5, ypos+ fheight1+3, fwidth1+5, datetime1_str, color, 0, true); // UTF-8 - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5+fwidth1, ypos+ fheight1+3, width-fwidth1-10- 20, datetime2_str, color, 0, true); // UTF-8 + int fwidth1a=g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime1_str); + //int fwidth1b=g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime2_str); + + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5, ypos+ fheight1+3, fwidth1a, datetime1_str, color, 0, true); // UTF-8 + //g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5+fwidth1a/2, ypos+ fheight1+3, fwidth1b, datetime2_str, color, 0, true); // UTF-8 int seit = ( evtlist[curpos].startTime - time(NULL) ) / 60; if ( (seit> 0) && (seit<100) && (duration_str.length()!=0) ) From c32e21e10f04bced992e3bc935efdb200f152cd6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 29 May 2014 23:00:49 +0200 Subject: [PATCH 101/511] delete *.orig crap files Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f3c87f75aec93642ffad0071ddb1f48d28ac4454 Author: vanhofen Date: 2014-05-29 (Thu, 29 May 2014) Origin message was: ------------------ - delete *.orig crap files ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/system/helpers.cpp.orig | 759 ------------------------------------ src/system/helpers.h.orig | 90 ----- 2 files changed, 849 deletions(-) delete mode 100644 src/system/helpers.cpp.orig delete mode 100644 src/system/helpers.h.orig diff --git a/src/system/helpers.cpp.orig b/src/system/helpers.cpp.orig deleted file mode 100644 index 85a369ff6..000000000 --- a/src/system/helpers.cpp.orig +++ /dev/null @@ -1,759 +0,0 @@ -/* - Neutrino-HD - - License: GPL - - (C) 2012-2013 the neutrino-hd developers - (C) 2012,2013 Stefan Seyfried - - 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 HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include /* or */ -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -void mySleep(int sec) { - struct timeval timeout; - - timeout.tv_sec = sec; - timeout.tv_usec = 0; - select(0,0,0,0, &timeout); -} - -off_t file_size(const char *filename) -{ - struct stat stat_buf; - if(::stat(filename, &stat_buf) == 0) - { - return stat_buf.st_size; - } else - { - return 0; - } -} - -bool file_exists(const char *filename) -{ - struct stat stat_buf; - if(::stat(filename, &stat_buf) == 0) - { - return true; - } else - { - return false; - } -} - -void wakeup_hdd(const char *hdd_dir) -{ - if(!check_dir(hdd_dir) && hdd_get_standby(hdd_dir)){ - std::string wakeup_file = hdd_dir; - wakeup_file += "/.wakeup"; - int fd = open(wakeup_file.c_str(), O_SYNC | O_WRONLY | O_CREAT | O_TRUNC, S_IWUSR); - if (fd >= 0) { - unsigned char buf[512]; - memset(buf, 0xFF, sizeof(buf)); - for (int i = 0; i < 20; i++) { - if (write(fd, buf, sizeof(buf)) < 0) { - perror("write to .wakeup"); - break; - } - } - fdatasync(fd); - close(fd); - } - hdd_flush(hdd_dir); - remove(wakeup_file.c_str()); - } -} -//use for script with full path -int my_system(const char * cmd) -{ - if (!file_exists(cmd)) - return -1; - - return my_system(1, cmd); -} - -int my_system(int argc, const char *arg, ...) -{ - int i = 0, ret = 0, childExit = 0; -#define ARGV_MAX 64 - /* static right now but could be made dynamic if necessary */ - int argv_max = ARGV_MAX; - const char *argv[ARGV_MAX]; - va_list args; - argv[0] = arg; - va_start(args, arg); - - while(++i < argc) - { - if (i == argv_max) - { - fprintf(stderr, "my_system: too many arguments!\n"); - return -1; - } - argv[i] = va_arg(args, const char *); - } - argv[i] = NULL; /* sentinel */ - //fprintf(stderr,"%s:", __func__);for(i=0;argv[i];i++)fprintf(stderr," '%s'",argv[i]);fprintf(stderr,"\n"); - - pid_t pid; - int maxfd = getdtablesize();// sysconf(_SC_OPEN_MAX); - switch (pid = vfork()) - { - case -1: /* can't vfork */ - perror("vfork"); - ret = -errno; - break; - case 0: /* child process */ - for(i = 3; i < maxfd; i++) - close(i); - if (setsid() == -1) - perror("my_system setsid"); - if (execvp(argv[0], (char * const *)argv)) - { - ret = -errno; - if (errno != ENOENT) /* don't complain if argv[0] only does not exist */ - fprintf(stderr, "ERROR: my_system \"%s\": %m\n", argv[0]); - } - _exit(ret); // terminate c h i l d proces s only - default: /* parent returns to calling process */ - waitpid(pid, &childExit, 0); - if (WEXITSTATUS(childExit) != 0) - ret = (signed char)WEXITSTATUS(childExit); - break; - } - va_end(args); - return ret; -} - -FILE* my_popen( pid_t& pid, const char *cmdstring, const char *type) -{ - int pfd[2] ={-1,-1}; - FILE *fp = NULL; - - /* only allow "r" or "w" */ - if ((type[0] != 'r' && type[0] != 'w') || type[1] != 0) { - errno = EINVAL; /* required by POSIX */ - return(NULL); - } - - if (pipe(pfd) < 0) - return(NULL); /* errno set by pipe() */ - - if ((pid = vfork()) < 0) { - return(NULL); /* errno set by vfork() */ - } else if (pid == 0) { /* child */ - if (*type == 'r') { - close(pfd[0]); - if (pfd[1] != STDOUT_FILENO) { - dup2(pfd[1], STDOUT_FILENO); - close(pfd[1]); - } - } else { - close(pfd[1]); - if (pfd[0] != STDIN_FILENO) { - dup2(pfd[0], STDIN_FILENO); - close(pfd[0]); - } - } - int maxfd = getdtablesize(); - for(int i = 3; i < maxfd; i++) - close(i); - if (setsid() == -1) - perror("my_popen setsid"); - execl("/bin/sh", "sh", "-c", cmdstring, (char *)0); - exit(0); - } - - /* parent continues... */ - if (*type == 'r') { - close(pfd[1]); - if ((fp = fdopen(pfd[0], type)) == NULL) - return(NULL); - } else { - close(pfd[0]); - if ((fp = fdopen(pfd[1], type)) == NULL) - return(NULL); - } - return(fp); -} - -int safe_mkdir(const char * path) -{ - struct statfs s; - size_t l = strlen(path); - char d[l + 3]; - strncpy(d, path, l); - - // skip trailing slashes - while (l > 0 && d[l - 1] == '/') - l--; - // find last slash - while (l > 0 && d[l - 1] != '/') - l--; - if (!l) - return -1; - // append a single dot - d[l++] = '.'; - d[l] = 0; - - if(statfs(d, &s) || (s.f_type == 0x72b6 /* jffs2 */)) - return -1; - return mkdir(path, 0755); -} - -/* function used to check is this dir writable, i.e. not flash, for record etc */ -int check_dir(const char * dir, bool allow_tmp) -{ - /* default to return, if statfs fail */ - int ret = -1; - struct statfs s; - if (::statfs(dir, &s) == 0) { - switch (s.f_type) { - case 0x858458f6L: // ramfs - case 0x1021994L: // tmpfs - if(allow_tmp) - ret = 0;//ok - case 0x72b6L: // jffs2 - break; - default: - ret = 0; // ok - } - } - return ret; -} - -bool get_fs_usage(const char * dir, uint64_t &btotal, uint64_t &bused, long *bsize/*=NULL*/) -{ - btotal = bused = 0; - struct statfs s; - - if (::statfs(dir, &s) == 0 && s.f_blocks) { - btotal = s.f_blocks; - bused = s.f_blocks - s.f_bfree; - if (bsize != NULL) - *bsize = s.f_bsize; - //printf("fs (%s): total %llu used %llu\n", dir, btotal, bused); - return true; - } - return false; -} - -bool get_mem_usage(unsigned long &kbtotal, unsigned long &kbfree) -{ - unsigned long cached = 0, buffers = 0; - kbtotal = kbfree = 0; - - FILE * f = fopen("/proc/meminfo", "r"); - if (!f) - return false; - - char buffer[256]; - while (fgets(buffer, 255, f)) { - if (!strncmp(buffer, "Mem", 3)) { - if (!strncmp(buffer+3, "Total", 5)) - kbtotal = strtoul(buffer+9, NULL, 10); - else if (!strncmp(buffer+3, "Free", 4)) - kbfree = strtoul(buffer+8, NULL, 10); - } - else if (!strncmp(buffer, "Buffers", 7)) { - buffers = strtoul(buffer+8, NULL, 10); - } - else if (!strncmp(buffer, "Cached", 6)) { - cached = strtoul(buffer+7, NULL, 10); - break; - } - } - fclose(f); - kbfree = kbfree + cached + buffers; - printf("mem: total %ld cached %ld free %ld\n", kbtotal, cached, kbfree); - return true; -} - -std::string find_executable(const char *name) -{ - struct stat s; - char *tmpPath = getenv("PATH"); - char *p, *n, *path; - if (tmpPath) - path = strdupa(tmpPath); - else - path = strdupa("/bin:/usr/bin:/sbin:/usr/sbin"); - if (name[0] == '/') { /* full path given */ - if (!access(name, X_OK) && !stat(name, &s) && S_ISREG(s.st_mode)) - return std::string(name); - return ""; - } - - p = path; - while (p) { - n = strchr(p, ':'); - if (n) - *n++ = '\0'; - if (*p != '\0') { - std::string tmp = std::string(p) + "/" + std::string(name); - const char *f = tmp.c_str(); - if (!access(f, X_OK) && !stat(f, &s) && S_ISREG(s.st_mode)) - return tmp; - } - p = n; - } - return ""; -} - -std::string _getPathName(std::string &path, std::string sep) -{ - size_t pos = path.find_last_of(sep); - if (pos == std::string::npos) - return path; - return path.substr(0, pos); -} - -std::string _getBaseName(std::string &path, std::string sep) -{ - size_t pos = path.find_last_of(sep); - if (pos == std::string::npos) - return path; - if (path.length() == pos +1) - return ""; - return path.substr(pos+1); -} - -std::string getPathName(std::string &path) -{ - return _getPathName(path, "/"); -} - -std::string getBaseName(std::string &path) -{ - return _getBaseName(path, "/"); -} - -std::string getFileName(std::string &file) -{ - return _getPathName(file, "."); -} - -std::string getFileExt(std::string &file) -{ - return _getBaseName(file, "."); -} - - -std::string getNowTimeStr(const char* format) -{ - char tmpStr[256]; - struct timeval tv; - gettimeofday(&tv, NULL); - strftime(tmpStr, sizeof(tmpStr), format, localtime(&tv.tv_sec)); - return (std::string)tmpStr; -} - -std::string trim(std::string &str, const std::string &trimChars /*= " \n\r\t"*/) -{ - std::string result = str.erase(str.find_last_not_of(trimChars) + 1); - return result.erase(0, result.find_first_not_of(trimChars)); -} - -time_t toEpoch(std::string &date) -{ - struct tm t; - memset(&t, 0, sizeof(t)); - char *p = strptime(date.c_str(), "%Y-%m-%d", &t); - if(p) - return mktime(&t); - - return 0; - -} - -std::string& str_replace(const std::string &search, const std::string &replace, std::string &text) -{ - if (search.empty() || text.empty()) - return text; - - size_t searchLen = search.length(); - while (1) { - size_t pos = text.find(search); - if (pos == std::string::npos) - break; - text.replace(pos, searchLen, replace); - } - return text; -} - -std::string& htmlEntityDecode(std::string& text) -{ - struct decode_table { - const char* code; - const char* htmlCode; - }; - decode_table dt[] = - { - {" ", " "}, - {"&", "&"}, - {"<", "<"}, - {">", ">"}, - {"\"", """}, - {"'", "'"}, - {"€", "€"}, - {"–", "–"}, - {"“", "“"}, - {"”", "”"}, - {"„", "„"}, - {"•", "•"}, - {"…", "…"}, - {NULL, NULL} - }; - for (int i = 0; dt[i].code != NULL; i++) - text = str_replace(dt[i].htmlCode, dt[i].code, text); - - return text; -} - -CFileHelpers::CFileHelpers() -{ - FileBufSize = 0xFFFF; - FileBuf = new char[FileBufSize]; - doCopyFlag = true; -} - -CFileHelpers::~CFileHelpers() -{ - if (FileBuf != NULL) - delete [] FileBuf; -} - -CFileHelpers* CFileHelpers::getInstance() -{ - static CFileHelpers* FileHelpers = NULL; - if(!FileHelpers) - FileHelpers = new CFileHelpers(); - return FileHelpers; -} - -bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t mode) -{ - doCopyFlag = true; - unlink(Dst); - if ((fd1 = open(Src, O_RDONLY)) < 0) - return false; - if ((fd2 = open(Dst, O_WRONLY | O_CREAT, 0666)) < 0) { - close(fd1); - return false; - } - - uint32_t block; - off64_t fsizeSrc64 = lseek64(fd1, 0, SEEK_END); - lseek64(fd1, 0, SEEK_SET); - if (fsizeSrc64 > 0x7FFFFFF0) { // > 2GB - off64_t fsize64 = fsizeSrc64; - block = FileBufSize; - //printf("#####[%s] fsizeSrc64: %lld 0x%010llX - large file\n", __FUNCTION__, fsizeSrc64, fsizeSrc64); - while(fsize64 > 0) { - if(fsize64 < (off64_t)FileBufSize) - block = (uint32_t)fsize64; - read(fd1, FileBuf, block); - write(fd2, FileBuf, block); - fsize64 -= block; - if (!doCopyFlag) - break; - } - if (doCopyFlag) { - lseek64(fd2, 0, SEEK_SET); - off64_t fsizeDst64 = lseek64(fd2, 0, SEEK_END); - if (fsizeSrc64 != fsizeDst64){ - close(fd1); - close(fd2); - return false; - } - } - } - else { // < 2GB - off_t fsizeSrc = lseek(fd1, 0, SEEK_END); - lseek(fd1, 0, SEEK_SET); - off_t fsize = fsizeSrc; - block = FileBufSize; - //printf("#####[%s] fsizeSrc: %ld 0x%08lX - normal file\n", __FUNCTION__, fsizeSrc, fsizeSrc); - while(fsize > 0) { - if(fsize < (off_t)FileBufSize) - block = (uint32_t)fsize; - read(fd1, FileBuf, block); - write(fd2, FileBuf, block); - fsize -= block; - if (!doCopyFlag) - break; - } - if (doCopyFlag) { - lseek(fd2, 0, SEEK_SET); - off_t fsizeDst = lseek(fd2, 0, SEEK_END); - if (fsizeSrc != fsizeDst){ - close(fd1); - close(fd2); - return false; - } - } - } - close(fd1); - close(fd2); - - if (!doCopyFlag) { - sync(); - unlink(Dst); - return false; - } - - chmod(Dst, mode); - return true; -} - -bool CFileHelpers::copyDir(const char *Src, const char *Dst, bool backupMode) -{ - DIR *Directory; - struct dirent *CurrentFile; - static struct stat FileInfo; - char srcPath[PATH_MAX]; - char dstPath[PATH_MAX]; - char buf[PATH_MAX]; - - //open directory - if ((Directory = opendir(Src)) == NULL) - return false; - if (lstat(Src, &FileInfo) == -1) { - closedir(Directory); - return false; - } - // create directory - // is symlink - if (S_ISLNK(FileInfo.st_mode)) { - int len = readlink(Src, buf, sizeof(buf)-1); - if (len != -1) { - buf[len] = '\0'; - symlink(buf, Dst); - } - } - else { - // directory - if (createDir(Dst, FileInfo.st_mode & 0x0FFF) == false) { - if (errno != EEXIST) { - closedir(Directory); - return false; - } - } - } - - // read directory - while ((CurrentFile = readdir(Directory)) != NULL) { - // ignore '.' and '..' - if (strcmp(CurrentFile->d_name, ".") && strcmp(CurrentFile->d_name, "..")) { - strcpy(srcPath, Src); - strcat(srcPath, "/"); - strcat(srcPath, CurrentFile->d_name); - if (lstat(srcPath, &FileInfo) == -1) { - closedir(Directory); - return false; - } - strcpy(dstPath, Dst); - strcat(dstPath, "/"); - strcat(dstPath, CurrentFile->d_name); - // is symlink - if (S_ISLNK(FileInfo.st_mode)) { - int len = readlink(srcPath, buf, sizeof(buf)-1); - if (len != -1) { - buf[len] = '\0'; - symlink(buf, dstPath); - } - } - // is directory - else if (S_ISDIR(FileInfo.st_mode)) { - copyDir(srcPath, dstPath); - } - // is file - else if (S_ISREG(FileInfo.st_mode)) { - std::string save = ""; - if (backupMode && (CExtUpdate::getInstance()->isBlacklistEntry(srcPath))) - save = ".save"; - copyFile(srcPath, (dstPath + save).c_str(), FileInfo.st_mode & 0x0FFF); - } - } - } - closedir(Directory); - return true; -} - -bool CFileHelpers::createDir(const char *Dir, mode_t mode) -{ - char dirPath[PATH_MAX]; - DIR *dir; - if ((dir = opendir(Dir)) != NULL) { - closedir(dir); - errno = EEXIST; - return false; - } - - int ret = -1; - while (ret == -1) { - strcpy(dirPath, Dir); - ret = mkdir(dirPath, mode); - if ((errno == ENOENT) && (ret == -1)) { - char * pos = strrchr(dirPath,'/'); - if (pos != NULL) { - pos[0] = '\0'; - createDir(dirPath, mode); - } - } - else - return !ret || (errno == EEXIST); - } - errno = 0; - return true; -} - -bool CFileHelpers::removeDir(const char *Dir) -{ - DIR *dir; - struct dirent *entry; - char path[PATH_MAX]; - - dir = opendir(Dir); - if (dir == NULL) { - printf("Error opendir()\n"); - return false; - } - while ((entry = readdir(dir)) != NULL) { - if (strcmp(entry->d_name, ".") && strcmp(entry->d_name, "..")) { - snprintf(path, (size_t) PATH_MAX, "%s/%s", Dir, entry->d_name); - if (entry->d_type == DT_DIR) - removeDir(path); - else - unlink(path); - } - } - closedir(dir); - rmdir(Dir); - - errno = 0; - return true; -} - -static int hdd_open_dev(const char * fname) -{ - FILE * fp; - struct mntent * mnt; - dev_t dev; - struct stat st; - int fd = -1; - - if (stat(fname, &st) != 0) { - perror(fname); - return fd; - } - - dev = st.st_dev; - fp = setmntent("/proc/mounts", "r"); - if (fp == NULL) { - perror("setmntent"); - return fd; - } - - while ((mnt = getmntent(fp)) != NULL) { - if (stat(mnt->mnt_fsname, &st) != 0) - continue; - if (S_ISBLK(st.st_mode) && st.st_rdev == dev) { - printf("[hdd] file [%s] -> dev [%s]\n", fname, mnt->mnt_fsname); - fd = open(mnt->mnt_fsname, O_RDONLY|O_NONBLOCK); - if (fd < 0) - perror(mnt->mnt_fsname); - break; - } - } - endmntent(fp); - return fd; -} - -bool hdd_get_standby(const char * fname) -{ - bool standby = false; - - int fd = hdd_open_dev(fname); - if (fd >= 0) { - unsigned char args[4] = {WIN_CHECKPOWERMODE1,0,0,0}; - int ret = ioctl(fd, HDIO_DRIVE_CMD, args); - if (ret) { - args[0] = WIN_CHECKPOWERMODE2; - ret = ioctl(fd, HDIO_DRIVE_CMD, args); - } - if ((ret == 0) && (args[2] != 0xFF)) - standby = true; - - printf("[hdd] %s\n", standby ? "standby" : "active"); - close(fd); - } - return standby; -} - -void hdd_flush(const char * fname) -{ - int fd = hdd_open_dev(fname); - if (fd >= 0) { - printf("[hdd] flush buffers...\n"); - fsync(fd); - if (ioctl(fd, BLKFLSBUF, NULL)) - perror("BLKFLSBUF"); - else - ioctl(fd, HDIO_DRIVE_CMD, NULL); - close(fd); - } -} - -/* split string like PARAM1=value1 PARAM2=value2 into map */ -bool split_config_string(const std::string &str, std::map &smap) -{ - smap.clear(); - std::string::size_type start = 0; - std::string::size_type end = 0; - while ((end = str.find(" ", start)) != std::string::npos) { - std::string param = str.substr(start, end - start); - std::string::size_type i = param.find("="); - if (i != std::string::npos) { - smap[param.substr(0,i).c_str()] = param.substr(i+1).c_str(); - } - start = end + 1; - } - return !smap.empty(); -} diff --git a/src/system/helpers.h.orig b/src/system/helpers.h.orig deleted file mode 100644 index de994141a..000000000 --- a/src/system/helpers.h.orig +++ /dev/null @@ -1,90 +0,0 @@ - -#ifndef __system_helpers__ -#define __system_helpers__ - -/* - Neutrino-HD - - 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. -*/ - -#include -#include -#include -#include -#include - -int my_system(const char * cmd); -int my_system(int argc, const char *arg, ...); /* argc is number of arguments including command */ - -FILE* my_popen( pid_t& pid, const char *cmdstring, const char *type); - -int safe_mkdir(const char * path); -inline int safe_mkdir(std::string path) { return safe_mkdir(path.c_str()); } -off_t file_size(const char *filename); -bool file_exists(const char *filename); -void wakeup_hdd(const char *hdd_dir); -int check_dir(const char * dir, bool allow_tmp = false); -bool get_fs_usage(const char * dir, uint64_t &btotal, uint64_t &bused, long *bsize=NULL); -bool get_mem_usage(unsigned long &total, unsigned long &free); -void mySleep(int sec); - -std::string find_executable(const char *name); - -bool hdd_get_standby(const char * fname); -void hdd_flush(const char * fname); - -std::string getPathName(std::string &path); -std::string getBaseName(std::string &path); -std::string getFileName(std::string &file); -std::string getFileExt(std::string &file); -std::string getNowTimeStr(const char* format); -std::string trim(std::string &str, const std::string &trimChars = " \n\r\t"); -time_t toEpoch(std::string &date); -std::string& str_replace(const std::string &search, const std::string &replace, std::string &text); -std::string& htmlEntityDecode(std::string& text); - -class CFileHelpers -{ - private: - unsigned long FileBufSize; - char *FileBuf; - int fd1, fd2; - - public: - CFileHelpers(); - ~CFileHelpers(); - static CFileHelpers* getInstance(); - bool doCopyFlag; - - bool copyFile(const char *Src, const char *Dst, mode_t mode); - bool copyDir(const char *Src, const char *Dst, bool backupMode=false); - bool createDir(const char *Dir, mode_t mode); - bool removeDir(const char *Dir); -}; - -template std::string to_string(C i) -{ - std::stringstream s; - s << i; - return s.str(); -} - -inline void cstrncpy(char *dest, const char * const src, size_t n) { n--; strncpy(dest, src, n); dest[n] = 0; } -inline void cstrncpy(char *dest, const std::string &src, size_t n) { n--; strncpy(dest, src.c_str(), n); dest[n] = 0; } -bool split_config_string(const std::string &str, std::map &smap); -#endif From 3da726560d6f482957e5731d5d2ea9736c3cc27f Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 30 May 2014 14:57:17 +0400 Subject: [PATCH 102/511] gui/hdd_menu.cpp: ask to set recording path after mount (hotplug or format) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/05558331f7636a692e25083e6957a9bd5371de57 Author: [CST] Focus Date: 2014-05-30 (Fri, 30 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/hdd_menu.cpp | 45 +++++++++++++++++++++++++++++--------------- src/gui/hdd_menu.h | 1 + 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index 64c10ff1f..dadb6e0d7 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -356,6 +356,30 @@ void CHDDMenuHandler::showHint(std::string &message) delete hintBox; } +void CHDDMenuHandler::setRecordPath(std::string &dev) +{ + std::string newpath = std::string(MOUNT_BASE) + dev + "/movies"; + if (g_settings.network_nfs_recordingdir == newpath) { + printf("CHDDMenuHandler::setRecordPath: recordingdir already set to %s\n", newpath.c_str()); + return; + } + bool old_menu = in_menu; + in_menu = false; + int res = ShowMsg(LOCALE_RECORDINGMENU_DEFDIR, LOCALE_HDD_SET_RECDIR, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo); + if(res == CMessageBox::mbrYes) { + g_settings.network_nfs_recordingdir = newpath; + CRecordManager::getInstance()->SetDirectory(g_settings.network_nfs_recordingdir); + if(g_settings.timeshiftdir.empty()) + { + std::string timeshiftDir = g_settings.network_nfs_recordingdir + "/.timeshift"; + safe_mkdir(timeshiftDir.c_str()); + printf("New timeshift dir: %s\n", timeshiftDir.c_str()); + CRecordManager::getInstance()->SetTimeshiftDirectory(timeshiftDir); + } + } + in_menu = old_menu; +} + int CHDDMenuHandler::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data) { if (msg == NeutrinoMessages::EVT_HOTPLUG) { @@ -399,6 +423,8 @@ int CHDDMenuHandler::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t dat g_Locale->getText(mounted ? LOCALE_HDD_MOUNT_OK : LOCALE_HDD_MOUNT_FAILED) : g_Locale->getText(LOCALE_HDD_UMOUNTED)); showHint(message); + if (added && tmp != "sr") + setRecordPath(dev); } if (in_menu && !lock_refresh) { show_menu = true; @@ -461,24 +487,13 @@ int CHDDMenuHandler::exec(CMenuTarget* parent, const std::string &actionkey) } else if (actionkey[0] == 'f') { int ret = formatDevice(dev); +#if 0 std::string devname = "/dev/" + dev + getDefaultPart(dev); if (show_menu && is_mounted(devname.c_str())) { - bool old_menu = in_menu; - in_menu = false; - int res = ShowMsg(LOCALE_RECORDINGMENU_DEFDIR, LOCALE_HDD_SET_RECDIR, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo); - if(res == CMessageBox::mbrYes) { - g_settings.network_nfs_recordingdir = std::string(MOUNT_BASE) + "/" + dev + getDefaultPart(dev) + "/movies"; - CRecordManager::getInstance()->SetDirectory(g_settings.network_nfs_recordingdir); - if(g_settings.timeshiftdir.empty()) - { - std::string timeshiftDir = g_settings.network_nfs_recordingdir + "/.timeshift"; - safe_mkdir(timeshiftDir.c_str()); - printf("New timeshift dir: %s\n", timeshiftDir.c_str()); - CRecordManager::getInstance()->SetTimeshiftDirectory(timeshiftDir); - } - } - in_menu = old_menu; + devname = dev + getDefaultPart(dev); + setRecordPath(devname); } +#endif return ret; } return menu_return::RETURN_REPAINT; diff --git a/src/gui/hdd_menu.h b/src/gui/hdd_menu.h index d073da013..899d0f6e5 100644 --- a/src/gui/hdd_menu.h +++ b/src/gui/hdd_menu.h @@ -92,6 +92,7 @@ class CHDDMenuHandler : public CMenuTarget void showError(neutrino_locale_t err); bool scanDevices(); void showHint(std::string &messsage); + void setRecordPath(std::string &dev); CHDDMenuHandler(); public: From de1fdddf3a68024a3f035fd5e99968e3cc9256ac Mon Sep 17 00:00:00 2001 From: martii Date: Sat, 31 May 2014 12:10:54 +0200 Subject: [PATCH 103/511] gui/plugins: exclude unused methods Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a7ebf966c416a2893d5ab65b44aace1ed735b3a6 Author: martii Date: 2014-05-31 (Sat, 31 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/plugins.cpp | 2 ++ src/gui/plugins.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/gui/plugins.cpp b/src/gui/plugins.cpp index f5088e0d6..f574e2e09 100644 --- a/src/gui/plugins.cpp +++ b/src/gui/plugins.cpp @@ -260,6 +260,7 @@ bool CPlugins::parseCfg(plugin *plugin_data) return !reject; } +#if 0 PluginParam * CPlugins::makeParam(const char * const id, const char * const value, PluginParam * const next) { PluginParam * startparam = new PluginParam; @@ -279,6 +280,7 @@ PluginParam * CPlugins::makeParam(const char * const id, const int value, Plugin return makeParam(id, aval, next); } +#endif void CPlugins::startPlugin_by_name(const std::string & name) { diff --git a/src/gui/plugins.h b/src/gui/plugins.h index ede5aa4a3..9415173a2 100644 --- a/src/gui/plugins.h +++ b/src/gui/plugins.h @@ -110,8 +110,10 @@ class CPlugins void setPluginDir(const std::string & dir) { plugin_dir = dir; } +#if 0 PluginParam * makeParam(const char * const id, const char * const value, PluginParam * const next); PluginParam * makeParam(const char * const id, const int value, PluginParam * const next); +#endif inline int getNumberOfPlugins (void ) const { return plugin_list.size() ; } inline const char * getName (const int number) const { return plugin_list[number].name.c_str() ; } From e094c23534487e53545e2269f87e219fe01a414c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 31 May 2014 15:23:46 +0200 Subject: [PATCH 104/511] filebrowser: paintFoot() at every ChangeDir() this fixes the empty footer when parentDir was empty Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f22a8ee1c6e6cd74e8941270832d4a09ab8d1e10 Author: vanhofen Date: 2014-05-31 (Sat, 31 May 2014) Origin message was: ------------------ - filebrowser: paintFoot() at every ChangeDir() this fixes the empty footer when parentDir was empty ------------------ This commit was generated by Migit --- src/gui/filebrowser.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index c571e29a3..d1dbeb3d3 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -405,8 +405,10 @@ void CFileBrowser::ChangeDir(const std::string & filename, int selection) selected = 0; if ((selection != -1) && (selection < (int)filelist.size())) selected = selection; + paintHead(); paint(); + paintFoot(); } //------------------------------------------------------------------------ @@ -763,8 +765,6 @@ bool CFileBrowser::exec(const char * const dirname) selection = selected; ChangeDir(name, selection); - //paint(); - paintFoot(); int oldselected = selected; @@ -910,7 +910,6 @@ bool CFileBrowser::exec(const char * const dirname) if(Filter != NULL) { use_filter = !use_filter; - paintFoot(); ChangeDir(Path); } } From 7738ad3855c393145b6388b0c3f808972be940a7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 31 May 2014 17:54:29 +0200 Subject: [PATCH 105/511] filebrowser: fix paint of SMSKey in footer and ... ... align both buttonlines in footer to same width Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/dc39bde14acb2bfb49e9b80f595bcd73037b7cf4 Author: vanhofen Date: 2014-05-31 (Sat, 31 May 2014) Origin message was: ------------------ - filebrowser: fix paint of SMSKey in footer and ... ... align both buttonlines in footer to same width ------------------ This commit was generated by Migit --- src/gui/filebrowser.cpp | 48 ++++++++++++++++++++++++++--------------- src/gui/filebrowser.h | 2 ++ 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index d1dbeb3d3..88ef0831b 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -298,6 +298,7 @@ void CFileBrowser::commonInit() if (fheight == 0) fheight = 1; /* avoid div by zero on invalid font */ foheight = fnt_small->getHeight()+6; //initial height value for buttonbar; TODO get value from buttonbar + skwidth = 26; liststart = 0; listmaxshow = std::max(1,(int)(height - theight - 2 * foheight)/fheight); @@ -782,6 +783,7 @@ bool CFileBrowser::exec(const char * const dirname) if(!CRCInput::isNumeric(msg)) { m_SMSKeyInput.resetOldKey(); + paintSMSKey(); } if (msg == CRCInput::RC_yellow) @@ -1383,15 +1385,16 @@ void CFileBrowser::paintFoot() { NEUTRINO_ICON_BUTTON_MUTE_SMALL , LOCALE_FILEBROWSER_DELETE }, }; -// int iw = 0, ih = 0; -// frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &iw, &ih); + //y first line + int by1 = y + height - (2 * foheight ); + //y second line + int by2 = by1 + foheight; + //width + int fowidth = width - skwidth; - //Background - int by0 = y + height - (2 * foheight ); - frameBuffer->paintBoxRel(x, by0, width, (2 * foheight ), COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); + //background + frameBuffer->paintBoxRel(x, by1, width, (2 * foheight ), COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); - //Second Line (bottom, top) - int by2 = by0 + foheight; if (!(filelist.empty())) { @@ -1404,7 +1407,7 @@ void CFileBrowser::paintFoot() num_buttons++; } //red, green, yellow button - ::paintButtons(x, by0, 0, num_buttons, FileBrowserButtons, width, foheight); + ::paintButtons(x, by1, 0, num_buttons, FileBrowserButtons, fowidth, foheight); /* TODO: the changing existence of the OK button makes the sort button * shift its place :-( */ @@ -1417,16 +1420,26 @@ void CFileBrowser::paintFoot() } if (strncmp(Path.c_str(), VLC_URI, strlen(VLC_URI)) != 0) // No delete in vlc mode num_buttons++; - /* width-26 to leave room for the SMSinput indicator */ - ::paintButtons(x, by2, 0, num_buttons, &(FileBrowserButtons2[idx]), width - 26, foheight); - if(m_SMSKeyInput.getOldKey()!=0) - { - char cKey[2]={m_SMSKeyInput.getOldKey(),0}; - cKey[0] = toupper(cKey[0]); - int len = fnt_small->getRenderWidth(cKey); - fnt_small->RenderString(x + width - 10 - len, by2 + foheight, len, cKey, COL_MENUHEAD_TEXT, 0, true); - } + ::paintButtons(x, by2, 0, num_buttons, &(FileBrowserButtons2[idx]), fowidth, foheight); + + paintSMSKey(); + } +} + +void CFileBrowser::paintSMSKey() +{ + int skheight = fnt_small->getHeight(); + + //background + frameBuffer->paintBoxRel(x + width - skwidth, y + height - foheight - (skheight/2), skwidth, skheight, COL_INFOBAR_SHADOW_PLUS_1); + + if(m_SMSKeyInput.getOldKey()!=0) + { + char cKey[2]={m_SMSKeyInput.getOldKey(),0}; + cKey[0] = toupper(cKey[0]); + int len = fnt_small->getRenderWidth(cKey, true); + fnt_small->RenderString(x + width - skwidth, y + height - foheight + (skheight/2), len, cKey, COL_MENUHEAD_TEXT, 0, true); } } @@ -1483,6 +1496,7 @@ void CFileBrowser::SMSInput(const neutrino_msg_t msg) { paintItem(selected - liststart); } + paintSMSKey(); } //------------------------------------------------------------------------ diff --git a/src/gui/filebrowser.h b/src/gui/filebrowser.h index c209b4df0..e3638f5a6 100644 --- a/src/gui/filebrowser.h +++ b/src/gui/filebrowser.h @@ -170,6 +170,7 @@ class CFileBrowser int fheight; // Fonthoehe Filelist-Inhalt int theight; // Fonthoehe Filelist-Titel int foheight; // Hoehe der button leiste + int skwidth; // width SMSKey field std::string name; std::string base; std::string m_baseurl; @@ -188,6 +189,7 @@ class CFileBrowser void paint(); void paintHead(); void paintFoot(); + void paintSMSKey(); void recursiveDelete(const char* file); protected: From ace6e896dd7cc979f7c6df6bbfa07ab8d6be92fc Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 1 Jun 2014 22:27:42 +0200 Subject: [PATCH 106/511] CComponents: fix screen rests Frame of painted box was incomplete removed, eg hint box see also: http://www.dbox2world.net/board293-cst-coolstream/board314-cst-coolstream-development/12230-r%C3%BCckst%C3%A4nde-auf-bildschirm-bei-apollo/ Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f74a0009299d0d9d3db3a7153ce5d2dc686dfb20 Author: Thilo Graf Date: 2014-06-01 (Sun, 01 Jun 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_base.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_base.cpp b/src/gui/components/cc_base.cpp index bffb827dc..22b06f7f8 100644 --- a/src/gui/components/cc_base.cpp +++ b/src/gui/components/cc_base.cpp @@ -237,7 +237,23 @@ void CComponents::kill(const fb_pixel_t& bg_color, const int& corner_radius) int r = v_fbdata[i].r; if (corner_radius > -1) r = corner_radius; - frameBuffer->paintBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, bg_color, r, corner_type); + frameBuffer->paintBoxRel(v_fbdata[i].x, + v_fbdata[i].y, + v_fbdata[i].dx, + v_fbdata[i].dy, + bg_color, + r, + corner_type); + if (v_fbdata[i].frame_thickness) + frameBuffer->paintBoxFrame(v_fbdata[i].x, + v_fbdata[i].y, + v_fbdata[i].dx, + v_fbdata[i].dy, + v_fbdata[i].frame_thickness, + bg_color, + r, + corner_type); + #if 0 else frameBuffer->paintBackgroundBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy); From 18a4b5647dc2aab7da277854977b4bae135bf9ca Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 30 May 2014 18:18:46 +0400 Subject: [PATCH 107/511] driver/record.cpp: create record directory before record Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3124ed62cf0724b0f5938cb66f71678932834130 Author: [CST] Focus Date: 2014-05-30 (Fri, 30 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/record.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 4bfc8a529..12bfc3e20 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -631,9 +631,11 @@ record_error_msg_t CRecordInstance::MakeFileName(CZapitChannel * channel) std::string ext_channel_name; unsigned int pos; + safe_mkdir(Directory.c_str()); if(check_dir(Directory.c_str())) { /* check if Directory and network_nfs_recordingdir the same */ if(g_settings.network_nfs_recordingdir != Directory) { + safe_mkdir(g_settings.network_nfs_recordingdir.c_str()); /* not the same, check network_nfs_recordingdir and return error if not ok */ if(check_dir(g_settings.network_nfs_recordingdir.c_str())) return RECORD_INVALID_DIRECTORY; From 58529bd895f0e2f8eca0e09bcc6a777d70b323fd Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 4 Jun 2014 21:47:32 +0200 Subject: [PATCH 108/511] setting_helpers: ensure to create flagfile to reset var-partition Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/566ea033726f87f969f5cdfe319a08b314dc11b6 Author: vanhofen Date: 2014-06-04 (Wed, 04 Jun 2014) Origin message was: ------------------ - setting_helpers: ensure to create flagfile to reset var-partition ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/system/setting_helpers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 7949249b9..97015f403 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -536,8 +536,6 @@ int CDataResetNotifier::exec(CMenuTarget* /*parent*/, const std::string& actionK CServiceManager::getInstance()->SatelliteList().clear(); CZapit::getInstance()->LoadSettings(); CZapit::getInstance()->GetConfig(zapitCfg); - g_RCInput->postMsg( NeutrinoMessages::REBOOT, 0); - ret = menu_return::RETURN_EXIT_ALL; #ifdef BOXMODEL_APOLLO /* flag file to erase /var partition on factory reset, will be done by init scripts */ @@ -545,6 +543,8 @@ int CDataResetNotifier::exec(CMenuTarget* /*parent*/, const std::string& actionK if (fp) fclose(fp); #endif + g_RCInput->postMsg( NeutrinoMessages::REBOOT, 0); + ret = menu_return::RETURN_EXIT_ALL; } if(delete_set) { unlink(NEUTRINO_SETTINGS_FILE); From 7470c006136ebd0c19cfa8813cc9e94af877af01 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 6 Jun 2014 19:00:25 +0200 Subject: [PATCH 109/511] satellites.xml: update freq 12722000 as suggested by Janus Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3e08c361a725a6ffb1b236fbca69611e97ca5fec Author: vanhofen Date: 2014-06-06 (Fri, 06 Jun 2014) Origin message was: ------------------ - satellites.xml: update freq 12722000 as suggested by Janus ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/satellites.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/satellites.xml b/data/satellites.xml index d28eb8946..7540a326d 100644 --- a/data/satellites.xml +++ b/data/satellites.xml @@ -2578,7 +2578,7 @@ - + From 2e0234e9f19e863e3ba6fbc43c5797db2b820055 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 7 Jun 2014 13:14:11 +0200 Subject: [PATCH 110/511] src/gui/eventlist.cpp -fix show channel name in search mode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/218a3906fd5b9336e6b3d171c1149fe42690b51e Author: Jacek Jendrzej Date: 2014-06-07 (Sat, 07 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 282ed702a..dc8518f90 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -540,6 +540,7 @@ int CNeutrinoEventList::exec(const t_channel_id channel_id, const std::string& c { if(in_search) { in_search = false; + m_showChannel = false; paintHead(channel_id, channelname); readEvents(channel_id); paint(channel_id); @@ -752,13 +753,11 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI) datetime1_str += strftime(", %d", tmStartZeit); datetime1_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); - //datetime2_str += '.'; - if ( m_showChannel ) // show the channel if we made a event search only (which could be made through all channels ). { t_channel_id channel = evtlist[curpos].channelID; - datetime2_str += " "; - datetime2_str += CServiceManager::getInstance()->GetServiceName(channel); + datetime1_str += " "; + datetime1_str += CServiceManager::getInstance()->GetServiceName(channel); } snprintf(tmpstr,sizeof(tmpstr), "[%d %s]", evtlist[curpos].duration / 60, unit_short_minute); @@ -766,11 +765,9 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI) } // 1st line - int fwidth1a=g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime1_str); - //int fwidth1b=g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime2_str); + int fwidth1a=g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime1_str,true); g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5, ypos+ fheight1+3, fwidth1a, datetime1_str, color, 0, true); // UTF-8 - //g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5+fwidth1a/2, ypos+ fheight1+3, fwidth1b, datetime2_str, color, 0, true); // UTF-8 int seit = ( evtlist[curpos].startTime - time(NULL) ) / 60; if ( (seit> 0) && (seit<100) && (duration_str.length()!=0) ) From 3e3070a1f8a5091c4501fe90fd6fdcb148bfc7be Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 11 Jun 2014 16:26:34 +0200 Subject: [PATCH 111/511] remove unused ringbuffer code again Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6fca465c7bfe161c54a12b859406f114cf3e11ef Author: vanhofen Date: 2014-06-11 (Wed, 11 Jun 2014) Origin message was: ------------------ - remove unused ringbuffer code again ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/Makefile.am | 1 - src/driver/radiotext.cpp | 4 - src/driver/ringbuffer.c | 378 --------------------------------------- src/driver/ringbuffer.h | 45 ----- src/gui/ringbuffer.c | 308 ------------------------------- 5 files changed, 736 deletions(-) delete mode 100644 src/driver/ringbuffer.c delete mode 100644 src/driver/ringbuffer.h delete mode 100755 src/gui/ringbuffer.c diff --git a/src/driver/Makefile.am b/src/driver/Makefile.am index 8e6955669..7bbc69b96 100644 --- a/src/driver/Makefile.am +++ b/src/driver/Makefile.am @@ -32,7 +32,6 @@ libneutrino_driver_a_SOURCES = \ radiotools.cpp \ rcinput.cpp \ record.cpp \ - ringbuffer.c \ scanepg.cpp \ screen_max.cpp \ screenshot.cpp \ diff --git a/src/driver/radiotext.cpp b/src/driver/radiotext.cpp index 1c0a8461a..80eae7e1a 100644 --- a/src/driver/radiotext.cpp +++ b/src/driver/radiotext.cpp @@ -82,10 +82,6 @@ #include #include -extern "C" { -#include "ringbuffer.h" -} - #include "radiotext.h" #include "radiotools.h" diff --git a/src/driver/ringbuffer.c b/src/driver/ringbuffer.c deleted file mode 100644 index af8d15786..000000000 --- a/src/driver/ringbuffer.c +++ /dev/null @@ -1,378 +0,0 @@ -/* - * Copyright (C) 2000 Paul Davis - * Copyright (C) 2003 Rohan Drape - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * ISO/POSIX C version of Paul Davis's lock free ringbuffer C++ code. - * This is safe for the case of one read thread and one write thread. - */ - -#include -#include -#include -#include "ringbuffer.h" - - -/* Create a new ringbuffer to hold at least `sz' bytes of data. The - * actual buffer size is rounded up to the next power of two. - */ -ringbuffer_t * ringbuffer_create (int sz) -{ - int power_of_two; - ringbuffer_t *rb; - - rb = malloc (sizeof (ringbuffer_t)); - - for(power_of_two = 1; 1 << power_of_two < sz; power_of_two++) - ; - - rb->size = 1 << power_of_two; - rb->size_mask = rb->size; - rb->size_mask -= 1; - rb->write_ptr = 0; - rb->read_ptr = 0; - rb->buf = malloc (rb->size); - rb->mlocked = 0; - rb->helpbufsize = 1; - rb->helpbuf = malloc (rb->helpbufsize); - - if( rb->buf ) - return rb; - - free( rb ); - return NULL; -} - - -/* Free all data associated with the ringbuffer `rb'. - */ -void ringbuffer_free (ringbuffer_t * rb) -{ - if (rb->mlocked) - munlock (rb->buf, rb->size); - - free (rb->buf); - rb->buf=0; - free (rb->helpbuf); - rb->helpbuf=0; - free (rb); - rb=0; -} - -/* Lock the data block of `rb' using the system call 'mlock'. */ -int ringbuffer_mlock (ringbuffer_t * rb) -{ - if (mlock (rb->buf, rb->size)) - return -1; - - rb->mlocked = 1; - return 0; -} - -/* Reset the read and write pointers to zero. This is not thread - * safe. - */ -void ringbuffer_reset (ringbuffer_t * rb) -{ - rb->read_ptr = 0; - rb->write_ptr = 0; -} - -/* Return the number of bytes available for reading. This is the - * number of bytes in front of the read pointer and behind the write - * pointer. - */ -size_t ringbuffer_read_space (ringbuffer_t * rb) -{ - size_t w, r; - - w = rb->write_ptr; - r = rb->read_ptr; - - if (w > r) - return w - r; - else - return (w - r + rb->size) & rb->size_mask; -} - -/* Return the number of bytes available for writing. This is the - * number of bytes in front of the write pointer and behind the read - * pointer. - */ -size_t ringbuffer_write_space (ringbuffer_t * rb) -{ - size_t w, r; - - w = rb->write_ptr; - r = rb->read_ptr; - - if (w > r) - return ((r - w + rb->size) & rb->size_mask) - 1; - else if (w < r) - return (r - w) - 1; - else - return rb->size - 1; -} - -/* The copying data reader. Copy at most `cnt' bytes from `rb' to - * `dest'. Returns the actual number of bytes copied. - */ -size_t ringbuffer_read (ringbuffer_t * rb, char *dest, size_t cnt) -{ - size_t free_cnt; - size_t cnt2; - size_t to_read; - size_t n1, n2; - - if ((free_cnt = ringbuffer_read_space (rb)) == 0) - return 0; - - to_read = cnt > free_cnt ? free_cnt : cnt; - - cnt2 = rb->read_ptr + to_read; - - if (cnt2 > rb->size) - { - n1 = rb->size - rb->read_ptr; - n2 = cnt2 & rb->size_mask; - } - else - { - n1 = to_read; - n2 = 0; - } - - memcpy (dest, &(rb->buf[rb->read_ptr]), n1); - rb->read_ptr += n1; - rb->read_ptr &= rb->size_mask; - - if (n2) - { - memcpy (dest + n1, &(rb->buf[rb->read_ptr]), n2); - rb->read_ptr += n2; - rb->read_ptr &= rb->size_mask; - } - - return to_read; -} - -/* The copying data writer. Copy at most `cnt' bytes to `rb' from - * `src'. Returns the actual number of bytes copied. - */ -size_t ringbuffer_write (ringbuffer_t * rb, char *src, size_t cnt) -{ - size_t free_cnt; - size_t cnt2; - size_t to_write; - size_t n1, n2; - - if ((free_cnt = ringbuffer_write_space (rb)) == 0) - return 0; - - to_write = cnt > free_cnt ? free_cnt : cnt; - - cnt2 = rb->write_ptr + to_write; - - if (cnt2 > rb->size) { - n1 = rb->size - rb->write_ptr; - n2 = cnt2 & rb->size_mask; - } - else - { - n1 = to_write; - n2 = 0; - } - - memcpy (&(rb->buf[rb->write_ptr]), src, n1); - rb->write_ptr += n1; - rb->write_ptr &= rb->size_mask; - - if (n2) - { - memcpy (&(rb->buf[rb->write_ptr]), src + n1, n2); - rb->write_ptr += n2; - rb->write_ptr &= rb->size_mask; - } - - return to_write; -} - -/* Advance the read pointer `cnt' places. - */ -void ringbuffer_read_advance (ringbuffer_t * rb, size_t cnt) -{ - rb->read_ptr += cnt; - rb->read_ptr &= rb->size_mask; -} - -/* Advance the write pointer `cnt' places. - */ -void ringbuffer_write_advance (ringbuffer_t * rb, size_t cnt) -{ - rb->write_ptr += cnt; - rb->write_ptr &= rb->size_mask; -} - -/* The non-copying data reader. `vec' is an array of two places. Set - * the values at `vec' to hold the current readable data at `rb'. If - * the readable data is in one segment the second segment has zero - * length. - */ -void ringbuffer_get_read_vector (ringbuffer_t * rb, ringbuffer_data_t * vec) -{ - size_t free_cnt; - size_t cnt2; - size_t w, r; - - w = rb->write_ptr; - r = rb->read_ptr; - - if (w > r) - free_cnt = w - r; - else - free_cnt = (w - r + rb->size) & rb->size_mask; - - cnt2 = r + free_cnt; - - if (cnt2 > rb->size) - { - /* Two part vector: the rest of the buffer after the current write - * ptr, plus some from the start of the buffer. - */ - vec[0].buf = &(rb->buf[r]); - vec[0].len = rb->size - r; - vec[1].buf = rb->buf; - vec[1].len = cnt2 & rb->size_mask; - } - else - { - /* Single part vector: just the rest of the buffer */ - vec[0].buf = &(rb->buf[r]); - vec[0].len = free_cnt; - vec[1].len = 0; - } -} - -/* The non-copying data writer. `vec' is an array of two places. Set - * the values at `vec' to hold the current writeable data at `rb'. If - * the writeable data is in one segment the second segment has zero - * length. - */ -void ringbuffer_get_write_vector (ringbuffer_t * rb, ringbuffer_data_t * vec) -{ - size_t free_cnt; - size_t cnt2; - size_t w, r; - - w = rb->write_ptr; - r = rb->read_ptr; - - if (w > r) - free_cnt = ((r - w + rb->size) & rb->size_mask) - 1; - else if (w < r) - free_cnt = (r - w) - 1; - else - free_cnt = rb->size - 1; - - cnt2 = w + free_cnt; - - if (cnt2 > rb->size) - { - /* Two part vector: the rest of the buffer after the current write - * ptr, plus some from the start of the buffer. - */ - vec[0].buf = &(rb->buf[w]); - vec[0].len = rb->size - w; - vec[1].buf = rb->buf; - vec[1].len = cnt2 & rb->size_mask; - } - else - { - vec[0].buf = &(rb->buf[w]); - vec[0].len = free_cnt; - vec[1].len = 0; - } -} - -/* Get read pointer at most `cnt' bytes from `rb' to - `dest'. Returns the actual readable number of bytes . */ -size_t ringbuffer_get_readpointer (ringbuffer_t * rb, char **dest, size_t cnt) -{ - size_t free_cnt; - size_t cnt2; - size_t to_read; - size_t n1, n2; - size_t tmp_read_ptr = rb->read_ptr; - - if ((free_cnt = ringbuffer_read_space (rb)) == 0) - return 0; - - to_read = cnt > free_cnt ? free_cnt : cnt; - - cnt2 = rb->read_ptr + to_read; - - if (cnt2 > rb->size) - { - n1 = rb->size - rb->read_ptr; - n2 = cnt2 & rb->size_mask; - } - else - { - n1 = to_read; - n2 = 0; - } - if (n2) - { - if (to_read > rb->helpbufsize) - { - rb->helpbufsize = to_read; - rb->helpbuf = realloc (rb->helpbuf, rb->helpbufsize); - } - memcpy (rb->helpbuf, &(rb->buf[rb->read_ptr]), n1); - tmp_read_ptr += n1; - tmp_read_ptr &= rb->size_mask; - memcpy (rb->helpbuf + n1, &(rb->buf[tmp_read_ptr]), n2); - *dest = rb->helpbuf; - } - else - *dest = &(rb->buf[rb->read_ptr]); - - return to_read; -} - - -/* Get write pointer at most `cnt' bytes to `rb' from - `src'. Returns the actual number of bytes can insert. */ -size_t ringbuffer_get_writepointer (ringbuffer_t * rb, char **src, size_t cnt) -{ - size_t free_cnt; - size_t cnt2; - size_t to_write; - - if ((free_cnt = ringbuffer_write_space (rb)) == 0) - return 0; - - to_write = cnt > free_cnt ? free_cnt : cnt; - - cnt2 = rb->write_ptr + to_write; - - if (cnt2 > rb->size) - return 0; - else - *src = &(rb->buf[rb->write_ptr]); - - return to_write; -} diff --git a/src/driver/ringbuffer.h b/src/driver/ringbuffer.h deleted file mode 100644 index b992e96c5..000000000 --- a/src/driver/ringbuffer.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _RINGBUFFER_H -#define _RINGBUFFER_H - -#include - -typedef struct -{ - char *buf; - size_t len; -} ringbuffer_data_t; - -typedef struct -{ - char *buf; - volatile size_t write_ptr; - volatile size_t read_ptr; - size_t size; - size_t size_mask; - int mlocked; - char *helpbuf; - size_t helpbufsize; -} ringbuffer_t; - -ringbuffer_t *ringbuffer_create(int sz); -void ringbuffer_free(ringbuffer_t *rb); - -int ringbuffer_mlock(ringbuffer_t *rb); -void ringbuffer_reset(ringbuffer_t *rb); - -void ringbuffer_write_advance(ringbuffer_t *rb, size_t cnt); -void ringbuffer_read_advance(ringbuffer_t *rb, size_t cnt); - -size_t ringbuffer_write_space(ringbuffer_t *rb); -size_t ringbuffer_read_space(ringbuffer_t *rb); - -size_t ringbuffer_read(ringbuffer_t *rb, char *dest, size_t cnt); -size_t ringbuffer_write(ringbuffer_t *rb, char *src, size_t cnt); - -void ringbuffer_get_read_vector(ringbuffer_t *rb, ringbuffer_data_t *vec); -void ringbuffer_get_write_vector(ringbuffer_t *rb, ringbuffer_data_t *vec); - -size_t ringbuffer_get_readpointer(ringbuffer_t * rb, char **dest, size_t cnt); -size_t ringbuffer_get_writepointer(ringbuffer_t * rb, char **src, size_t cnt); - -#endif diff --git a/src/gui/ringbuffer.c b/src/gui/ringbuffer.c deleted file mode 100755 index f017ab44a..000000000 --- a/src/gui/ringbuffer.c +++ /dev/null @@ -1,308 +0,0 @@ -/* - Copyright (C) 2000 Paul Davis - Copyright (C) 2003 Rohan Drape - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - ISO/POSIX C version of Paul Davis's lock free ringbuffer C++ code. - This is safe for the case of one read thread and one write thread. -*/ - -#include -#include -#include -#include "ringbuffer.h" - -/* Create a new ringbuffer to hold at least `sz' bytes of data. The - actual buffer size is rounded up to the next power of two. */ - -ringbuffer_t * -ringbuffer_create (int sz) -{ - int power_of_two; - ringbuffer_t *rb = NULL; - - rb = malloc (sizeof (ringbuffer_t)); - - for (power_of_two = 1; 1 << power_of_two < sz; power_of_two++); - - rb->size = 1 << power_of_two; - rb->size_mask = rb->size; - rb->size_mask -= 1; - rb->write_ptr = 0; - rb->read_ptr = 0; - rb->buf = malloc (rb->size); - rb->mlocked = 0; -printf("[ringbuffer] size %d\n", rb->size); - return rb; -} - -/* Free all data associated with the ringbuffer `rb'. */ - -void -ringbuffer_free (ringbuffer_t * rb) -{ - if (rb->mlocked) { - munlock (rb->buf, rb->size); - } - free (rb->buf); - free (rb); -} - -/* Lock the data block of `rb' using the system call 'mlock'. */ - -int -ringbuffer_mlock (ringbuffer_t * rb) -{ - if (mlock (rb->buf, rb->size)) { - return -1; - } - rb->mlocked = 1; - return 0; -} - -/* Reset the read and write pointers to zero. This is not thread - safe. */ - -void -ringbuffer_reset (ringbuffer_t * rb) -{ - rb->read_ptr = 0; - rb->write_ptr = 0; -} - -/* Return the number of bytes available for reading. This is the - number of bytes in front of the read pointer and behind the write - pointer. */ - -size_t -ringbuffer_read_space (ringbuffer_t * rb) -{ - size_t w, r; - - w = rb->write_ptr; - r = rb->read_ptr; - - if (w > r) { - return w - r; - } else { - return (w - r + rb->size) & rb->size_mask; - } -} - -/* Return the number of bytes available for writing. This is the - number of bytes in front of the write pointer and behind the read - pointer. */ - -size_t -ringbuffer_write_space (ringbuffer_t * rb) -{ - size_t w, r; - - w = rb->write_ptr; - r = rb->read_ptr; - - if (w > r) { - return ((r - w + rb->size) & rb->size_mask) - 1; - } else if (w < r) { - return (r - w) - 1; - } else { - return rb->size - 1; - } -} - -/* The copying data reader. Copy at most `cnt' bytes from `rb' to - `dest'. Returns the actual number of bytes copied. */ - -size_t -ringbuffer_read (ringbuffer_t * rb, char *dest, size_t cnt) -{ - size_t free_cnt; - size_t cnt2; - size_t to_read; - size_t n1, n2; - - if ((free_cnt = ringbuffer_read_space (rb)) == 0) { - return 0; - } - - to_read = cnt > free_cnt ? free_cnt : cnt; - - cnt2 = rb->read_ptr + to_read; - - if (cnt2 > rb->size) { - n1 = rb->size - rb->read_ptr; - n2 = cnt2 & rb->size_mask; - } else { - n1 = to_read; - n2 = 0; - } - - memmove (dest, &(rb->buf[rb->read_ptr]), n1); - rb->read_ptr += n1; - rb->read_ptr &= rb->size_mask; - - if (n2) { - memmove (dest + n1, &(rb->buf[rb->read_ptr]), n2); - rb->read_ptr += n2; - rb->read_ptr &= rb->size_mask; - } - - return to_read; -} - -/* The copying data writer. Copy at most `cnt' bytes to `rb' from - `src'. Returns the actual number of bytes copied. */ - -size_t -ringbuffer_write (ringbuffer_t * rb, char *src, size_t cnt) -{ - size_t free_cnt; - size_t cnt2; - size_t to_write; - size_t n1, n2; - - if ((free_cnt = ringbuffer_write_space (rb)) == 0) { - return 0; - } - - to_write = cnt > free_cnt ? free_cnt : cnt; - - cnt2 = rb->write_ptr + to_write; - - if (cnt2 > rb->size) { - n1 = rb->size - rb->write_ptr; - n2 = cnt2 & rb->size_mask; - } else { - n1 = to_write; - n2 = 0; - } - - memmove (&(rb->buf[rb->write_ptr]), src, n1); - rb->write_ptr += n1; - rb->write_ptr &= rb->size_mask; - - if (n2) { - memmove (&(rb->buf[rb->write_ptr]), src + n1, n2); - rb->write_ptr += n2; - rb->write_ptr &= rb->size_mask; - } - - return to_write; -} - -/* Advance the read pointer `cnt' places. */ - -void -ringbuffer_read_advance (ringbuffer_t * rb, size_t cnt) -{ - rb->read_ptr += cnt; - rb->read_ptr &= rb->size_mask; -} - -/* Advance the write pointer `cnt' places. */ - -void -ringbuffer_write_advance (ringbuffer_t * rb, size_t cnt) -{ - rb->write_ptr += cnt; - rb->write_ptr &= rb->size_mask; -} - -/* The non-copying data reader. `vec' is an array of two places. Set - the values at `vec' to hold the current readable data at `rb'. If - the readable data is in one segment the second segment has zero - length. */ - -void -ringbuffer_get_read_vector (ringbuffer_t * rb, - ringbuffer_data_t * vec) -{ - size_t free_cnt; - size_t cnt2; - size_t w, r; - - w = rb->write_ptr; - r = rb->read_ptr; - - if (w > r) { - free_cnt = w - r; - } else { - free_cnt = (w - r + rb->size) & rb->size_mask; - } - - cnt2 = r + free_cnt; - - if (cnt2 > rb->size) { - - /* Two part vector: the rest of the buffer after the current write - ptr, plus some from the start of the buffer. */ - - vec[0].buf = &(rb->buf[r]); - vec[0].len = rb->size - r; - vec[1].buf = rb->buf; - vec[1].len = cnt2 & rb->size_mask; - - } else { - - /* Single part vector: just the rest of the buffer */ - - vec[0].buf = &(rb->buf[r]); - vec[0].len = free_cnt; - vec[1].len = 0; - } -} - -/* The non-copying data writer. `vec' is an array of two places. Set - the values at `vec' to hold the current writeable data at `rb'. If - the writeable data is in one segment the second segment has zero - length. */ - -void -ringbuffer_get_write_vector (ringbuffer_t * rb, - ringbuffer_data_t * vec) -{ - size_t free_cnt; - size_t cnt2; - size_t w, r; - - w = rb->write_ptr; - r = rb->read_ptr; - - if (w > r) { - free_cnt = ((r - w + rb->size) & rb->size_mask) - 1; - } else if (w < r) { - free_cnt = (r - w) - 1; - } else { - free_cnt = rb->size - 1; - } - - cnt2 = w + free_cnt; - - if (cnt2 > rb->size) { - - /* Two part vector: the rest of the buffer after the current write - ptr, plus some from the start of the buffer. */ - - vec[0].buf = &(rb->buf[w]); - vec[0].len = rb->size - w; - vec[1].buf = rb->buf; - vec[1].len = cnt2 & rb->size_mask; - } else { - vec[0].buf = &(rb->buf[w]); - vec[0].len = free_cnt; - vec[1].len = 0; - } -} From 80f6dde55119adef4ead02f59acbc703eab82847 Mon Sep 17 00:00:00 2001 From: martii Date: Wed, 24 Jul 2013 18:00:09 +0200 Subject: [PATCH 112/511] driver/fontrenderer: adding an additional bool to RenderString() seems inappropriate. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2047b51780601cc0f2eb00f42c02f8fb890de2ad Author: martii Date: 2013-07-24 (Wed, 24 Jul 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/fontrenderer.cpp | 12 +++++++----- src/driver/fontrenderer.h | 10 ++++++++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/driver/fontrenderer.cpp b/src/driver/fontrenderer.cpp index d7bc09fb3..104ec4135 100644 --- a/src/driver/fontrenderer.cpp +++ b/src/driver/fontrenderer.cpp @@ -214,7 +214,7 @@ std::string FBFontRenderClass::getFamily(const char * const filename) const return f->family; } - return ""; + return ""; } Font::Font(FBFontRenderClass *render, FTC_FaceID faceid, const int isize, const fontmodifier _stylemodifier) @@ -395,8 +395,10 @@ void Font::paintFontPixel(fb_pixel_t *td, uint8_t fg_trans, uint8_t fg_red, uint ((fg_blue + ((korr_b*faktor)/F_MUL)) & 0x000000FF); } -void Font::RenderString(int x, int y, const int width, const char *text, const fb_pixel_t color, const int boxheight, const bool utf8_encoded, const bool useFullBg) +void Font::RenderString(int x, int y, const int width, const char *text, const fb_pixel_t color, const int boxheight, const unsigned int flags) { + const bool utf8_encoded = flags & IS_UTF8; + const bool useFullBg = flags & FULLBG; /* useFullBg (default = false) @@ -644,14 +646,14 @@ void Font::RenderString(int x, int y, const int width, const char *text, const f pen1 = x; lastindex = index; } -//printf("RenderStat: %d %d %d \n", renderer->cacheManager->num_nodes, renderer->cacheManager->num_bytes, renderer->cacheManager->max_bytes); + //printf("RenderStat: %d %d %d \n", renderer->cacheManager->num_nodes, renderer->cacheManager->num_bytes, renderer->cacheManager->max_bytes); pthread_mutex_unlock( &renderer->render_mutex ); frameBuffer->checkFbArea(x, y-height, width, height, false); } -void Font::RenderString(int x, int y, const int width, const std::string & text, const fb_pixel_t color, const int boxheight, const bool utf8_encoded, const bool useFullBg) +void Font::RenderString(int x, int y, const int width, const std::string & text, const fb_pixel_t color, const int boxheight, const unsigned int flags) { - RenderString(x, y, width, text.c_str(), color, boxheight, utf8_encoded, useFullBg); + RenderString(x, y, width, text.c_str(), color, boxheight, flags); } int Font::getRenderWidth(const char *text, const bool utf8_encoded) diff --git a/src/driver/fontrenderer.h b/src/driver/fontrenderer.h index fa1f97ae1..6c4ced71e 100644 --- a/src/driver/fontrenderer.h +++ b/src/driver/fontrenderer.h @@ -65,8 +65,14 @@ class Font }; fontmodifier stylemodifier; - void RenderString(int x, int y, const int width, const char * text, const fb_pixel_t color, const int boxheight = 0, const bool utf8_encoded = false, const bool useFullBg = false); - void RenderString(int x, int y, const int width, const std::string & text, const fb_pixel_t color, const int boxheight = 0, const bool utf8_encoded = false, const bool useFullBg = false); + enum renderflags + { + IS_UTF8 = 1, + FULLBG = 2 + }; + + void RenderString(int x, int y, const int width, const char * text, const fb_pixel_t color, const int boxheight = 0, const unsigned int flags = 0); + void RenderString(int x, int y, const int width, const std::string & text, const fb_pixel_t color, const int boxheight = 0, const unsigned int flags = 0); int getRenderWidth(const char * text, const bool utf8_encoded = false); int getRenderWidth(const std::string & text, const bool utf8_encoded = false); From 68b7a1e86cf5eec3bc606bf9ac2238c6108d0596 Mon Sep 17 00:00:00 2001 From: martii Date: Wed, 11 Jun 2014 10:26:26 +0200 Subject: [PATCH 113/511] driver/fontrenderer: let RenderString() and getRenderWidth() default to UTF8 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bec2e874129d45a7891382b5bbc15c943e19e633 Author: martii Date: 2014-06-11 (Wed, 11 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/fb_window.cpp | 4 ++-- src/driver/fb_window.h | 2 +- src/driver/fontrenderer.h | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/driver/fb_window.cpp b/src/driver/fb_window.cpp index a39aa05e9..8d6ddfa23 100644 --- a/src/driver/fb_window.cpp +++ b/src/driver/fb_window.cpp @@ -62,7 +62,7 @@ bool CFBWindow::paintIcon(const char * const _filename, const int _x, const int return 0; } -void CFBWindow::RenderString(const font_t _font, const int _x, const int _y, const int _width, const char * const _text, const color_t _color, const int _boxheight, const bool _utf8_encoded) +void CFBWindow::RenderString(const font_t _font, const int _x, const int _y, const int _width, const char * const _text, const color_t _color, const int _boxheight, const unsigned int _flags) { - ((Font *)_font)->RenderString(x + _x, y + _y, _width, _text, _color, _boxheight, _utf8_encoded); + ((Font *)_font)->RenderString(x + _x, y + _y, _width, _text, _color, _boxheight, _flags); } diff --git a/src/driver/fb_window.h b/src/driver/fb_window.h index 9e4a0b347..0f9cf8a49 100644 --- a/src/driver/fb_window.h +++ b/src/driver/fb_window.h @@ -44,7 +44,7 @@ class CFBWindow void paintBoxRel(const int _x, const int _y, const int _dx, const int _dy, const color_t _col, int radius = 0, int type = 0xF); bool paintIcon(const char * const _filename, const int _x, const int _y, const int _h = 0, const color_t _offset = 1); - void RenderString(const font_t _font, const int _x, const int _y, const int _width, const char * const _text, const color_t _color, const int _boxheight = 0, const bool _utf8_encoded = false); + void RenderString(const font_t _font, const int _x, const int _y, const int _width, const char * const _text, const color_t _color, const int _boxheight = 0, const unsigned int _flags = Font::IS_UTF8); }; #endif /* __fb_window_h__ */ diff --git a/src/driver/fontrenderer.h b/src/driver/fontrenderer.h index 6c4ced71e..7a67b68f9 100644 --- a/src/driver/fontrenderer.h +++ b/src/driver/fontrenderer.h @@ -71,11 +71,11 @@ class Font FULLBG = 2 }; - void RenderString(int x, int y, const int width, const char * text, const fb_pixel_t color, const int boxheight = 0, const unsigned int flags = 0); - void RenderString(int x, int y, const int width, const std::string & text, const fb_pixel_t color, const int boxheight = 0, const unsigned int flags = 0); + void RenderString(int x, int y, const int width, const char * text, const fb_pixel_t color, const int boxheight = 0, const unsigned int flags = IS_UTF8); + void RenderString(int x, int y, const int width, const std::string & text, const fb_pixel_t color, const int boxheight = 0, const unsigned int flags = IS_UTF8); - int getRenderWidth(const char * text, const bool utf8_encoded = false); - int getRenderWidth(const std::string & text, const bool utf8_encoded = false); + int getRenderWidth(const char * text, const bool utf8_encoded = true); + int getRenderWidth(const std::string & text, const bool utf8_encoded = true); int getHeight(void); int getDigitHeight(void); int getMaxDigitWidth(void); From 108a1c1b93a74d058d323fd35f433895d5b96bbf Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 11 Jun 2014 11:48:59 +0200 Subject: [PATCH 114/511] change getRenderWidth() default to UTF8 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8b91cda918ad69a6e83a3b9aea6576c0eb686559 Author: vanhofen Date: 2014-06-11 (Wed, 11 Jun 2014) Origin message was: ------------------ - change getRenderWidth() default to UTF8 ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/fontrenderer.cpp | 2 +- src/driver/lcdd.cpp | 20 ++++++++-------- src/driver/neutrinofonts.cpp | 8 +++---- src/driver/vfd.cpp | 12 +++++----- src/gui/audioplayer.cpp | 6 ++--- src/gui/bouquetlist.cpp | 2 +- src/gui/channellist.cpp | 22 +++++++++--------- src/gui/components/cc_frm_button.cpp | 2 +- src/gui/components/cc_frm_clock.cpp | 6 ++--- src/gui/dboxinfo.cpp | 18 +++++++-------- src/gui/epgplus.cpp | 8 +++---- src/gui/epgview.cpp | 6 ++--- src/gui/eventlist.cpp | 10 ++++---- src/gui/filebrowser.cpp | 2 +- src/gui/infoviewer.cpp | 6 ++--- src/gui/luainstance.cpp | 4 ++-- src/gui/movieplayer.cpp | 2 +- src/gui/scan.cpp | 8 +++---- src/gui/scan_setup.cpp | 2 +- src/gui/streaminfo2.cpp | 16 ++++++------- src/gui/upnpbrowser.cpp | 12 +++++----- src/gui/widget/buttons.cpp | 4 ++-- src/gui/widget/colorchooser.cpp | 2 +- src/gui/widget/drawable.cpp | 2 +- src/gui/widget/hintbox.cpp | 5 ++-- src/gui/widget/hintboxext.cpp | 2 +- src/gui/widget/keychooser.cpp | 6 ++--- src/gui/widget/menue.cpp | 34 ++++++++++++++-------------- src/gui/widget/messagebox.cpp | 2 +- src/gui/widget/msgbox.cpp | 2 +- src/gui/widget/shellwindow.cpp | 2 +- src/gui/widget/stringinput.cpp | 6 ++--- src/gui/widget/stringinput_ext.cpp | 6 ++--- src/gui/widget/textbox.cpp | 6 ++--- src/neutrino.cpp | 2 +- 35 files changed, 127 insertions(+), 128 deletions(-) diff --git a/src/driver/fontrenderer.cpp b/src/driver/fontrenderer.cpp index 104ec4135..26880e6bd 100644 --- a/src/driver/fontrenderer.cpp +++ b/src/driver/fontrenderer.cpp @@ -327,7 +327,7 @@ int Font::getMaxDigitWidth(void) b[1] = 0; for (char c = '0'; c <= '9'; c++) { *b = c; - int w = getRenderWidth(b, true); + int w = getRenderWidth(b); if (w > maxdigitwidth) maxdigitwidth = w; } diff --git a/src/driver/lcdd.cpp b/src/driver/lcdd.cpp index 6730b59f0..23085ed50 100644 --- a/src/driver/lcdd.cpp +++ b/src/driver/lcdd.cpp @@ -409,7 +409,7 @@ static std::string splitString(const std::string & text, const int maxwidth, Lcd int pos; std::string tmp = removeLeadingSpaces(text); - if (font->getRenderWidth(tmp.c_str(), utf8) > maxwidth) + if (font->getRenderWidth(tmp, utf8) > maxwidth) { do { @@ -423,7 +423,7 @@ static std::string splitString(const std::string & text, const int maxwidth, Lcd else // does not fit -> fall back to dumb split tmp = tmp.substr(0, tmp.length()-1); } - } while (font->getRenderWidth(tmp.c_str(), utf8) > maxwidth); + } while (font->getRenderWidth(tmp, utf8) > maxwidth); } return tmp; @@ -510,7 +510,7 @@ void CLCD::showTextScreen(const std::string & big, const std::string & small, co y += 14; if (centered) { - int w = fonts.channelname->getRenderWidth(cname[i].c_str(), big_utf8); + int w = fonts.channelname->getRenderWidth(cname[i], big_utf8); x = (LCD_COLS - w) / 2; } fonts.channelname->RenderString(x, y, LCD_COLS + 10, cname[i].c_str(), CLCDDisplay::PIXEL_ON, 0, big_utf8); @@ -527,7 +527,7 @@ void CLCD::showTextScreen(const std::string & big, const std::string & small, co y += 10; if (centered) { - int w = fonts.menu->getRenderWidth(event[i].c_str(), small_utf8); + int w = fonts.menu->getRenderWidth(event[i], small_utf8); x = (LCD_COLS - w) / 2; } fonts.menu->RenderString(x, y, LCD_COLS + 10, event[i].c_str(), CLCDDisplay::PIXEL_ON, 0, small_utf8); @@ -1185,7 +1185,7 @@ void CLCD::showInfoBox(const char * const title, const char * const text ,int au // paint title if(!m_infoBoxTitle.empty()) { - int width = fonts.menu->getRenderWidth(m_infoBoxTitle.c_str(),true); + int width = fonts.menu->getRenderWidth(m_infoBoxTitle); if(width > LCD_COLS - 20) width = LCD_COLS - 20; int start_pos = (LCD_COLS - width) /2; @@ -1202,7 +1202,7 @@ void CLCD::showInfoBox(const char * const title, const char * const text ,int au { text_line.clear(); while ( m_infoBoxText[pos] != '\n' && - ((fonts.menu->getRenderWidth(text_line.c_str(), true) < EPG_INFO_TEXT_WIDTH-10) || !m_infoBoxAutoNewline )&& + ((fonts.menu->getRenderWidth(text_line) < EPG_INFO_TEXT_WIDTH-10) || !m_infoBoxAutoNewline )&& (pos < length)) // UTF-8 { if ( m_infoBoxText[pos] >= ' ' && m_infoBoxText[pos] <= '~' ) // any char between ASCII(32) and ASCII (126) @@ -1249,7 +1249,7 @@ void CLCD::showFilelist(int flist_pos,CFileList* flist,const char * const mainDi if(m_fileListPos > size) m_fileListPos = size-1; - int width = fonts.menu->getRenderWidth(m_fileListHeader.c_str(), true); + int width = fonts.menu->getRenderWidth(m_fileListHeader); if(width > LCD_COLS - 10) width = LCD_COLS - 10; fonts.menu->RenderString((LCD_COLS - width) / 2, 11, width+5, m_fileListHeader.c_str(), CLCDDisplay::PIXEL_ON); @@ -1351,7 +1351,7 @@ void CLCD::showProgressBar(int global, const char * const text,int show_escape,i display.draw_fill_rect (0, 12, LCD_COLS, 64, CLCDDisplay::PIXEL_OFF); // paint progress header - int width = fonts.menu->getRenderWidth(m_progressHeaderGlobal.c_str(),true); + int width = fonts.menu->getRenderWidth(m_progressHeaderGlobal); if(width > 100) width = 100; int start_pos = (LCD_COLS - width) /2; @@ -1421,7 +1421,7 @@ void CLCD::showProgressBar2(int local,const char * const text_local ,int global // paint global caption - int width = fonts.menu->getRenderWidth(m_progressHeaderGlobal.c_str(),true); + int width = fonts.menu->getRenderWidth(m_progressHeaderGlobal); if(width > 100) width = 100; int start_pos = (LCD_COLS - width) /2; @@ -1435,7 +1435,7 @@ void CLCD::showProgressBar2(int local,const char * const text_local ,int global // paint local caption - width = fonts.menu->getRenderWidth(m_progressHeaderLocal.c_str(),true); + width = fonts.menu->getRenderWidth(m_progressHeaderLocal); if(width > 100) width = 100; start_pos = (LCD_COLS - width) /2; diff --git a/src/driver/neutrinofonts.cpp b/src/driver/neutrinofonts.cpp index 908c2ec1d..40cc0f88a 100644 --- a/src/driver/neutrinofonts.cpp +++ b/src/driver/neutrinofonts.cpp @@ -239,7 +239,7 @@ int CNeutrinoFonts::getDynFontSize(int dx, int dy, std::string text, int style) std::string tmpText = text; if (text == "") tmpText = "x"; - _width = dynFont->getRenderWidth(tmpText.c_str()); + _width = dynFont->getRenderWidth(tmpText); if ((_height > dy) || (_width > dx)) { if (dynFlag) dynSize--; @@ -314,7 +314,7 @@ Font **CNeutrinoFonts::getDynFontWithID(int &dx, int &dy, std::string text, int if ((v_dyn_fonts[f_id].size == dynSize) && (v_dyn_fonts[f_id].font != NULL)) { dy = v_dyn_fonts[f_id].font->getHeight(); if (text != "") - dx = v_dyn_fonts[f_id].font->getRenderWidth(text.c_str()); + dx = v_dyn_fonts[f_id].font->getRenderWidth(text); return &(v_dyn_fonts[f_id].font); } @@ -335,7 +335,7 @@ Font **CNeutrinoFonts::getDynFontWithID(int &dx, int &dy, std::string text, int dy = (*ret)->getHeight(); if (text != "") - dx = (*ret)->getRenderWidth(text.c_str()); + dx = (*ret)->getRenderWidth(text); #ifdef DEBUG_NFONTS printf("##### [%s] dx: %d, dy: %d, dynSize: %d, dynFont: %p, ret: %p, FontID: %d\n", __FUNCTION__, dx, dy, dynSize, *ret, ret, f_id); #endif @@ -389,7 +389,7 @@ Font **CNeutrinoFonts::getDynFontShare(int &dx, int &dy, std::string text, int s dy = (*ret)->getHeight(); if (text != "") - dx = (*ret)->getRenderWidth(text.c_str()); + dx = (*ret)->getRenderWidth(text); #ifdef DEBUG_NFONTS printf("##### [%s] dx: %d, dy: %d, dynSize: %d, dynFont: %p, ret: %p, fontAvailable: %d\n", __FUNCTION__, dx, dy, dynSize, *ret, ret, fontAvailable); #endif diff --git a/src/driver/vfd.cpp b/src/driver/vfd.cpp index 8072f0bf3..b0bcd6d58 100644 --- a/src/driver/vfd.cpp +++ b/src/driver/vfd.cpp @@ -768,7 +768,7 @@ void CVFD::showInfoBox(const char * const title, const char * const text ,int au // paint title if(!m_infoBoxTitle.empty()) { - int width = fonts.menu->getRenderWidth(m_infoBoxTitle.c_str(),true); + int width = fonts.menu->getRenderWidth(m_infoBoxTitle); if(width > 100) width = 100; int start_pos = (120-width) /2; @@ -785,7 +785,7 @@ void CVFD::showInfoBox(const char * const title, const char * const text ,int au { text_line.clear(); while ( m_infoBoxText[pos] != '\n' && - ((fonts.menu->getRenderWidth(text_line.c_str(), true) < EPG_INFO_TEXT_WIDTH-10) || !m_infoBoxAutoNewline )&& + ((fonts.menu->getRenderWidth(text_line) < EPG_INFO_TEXT_WIDTH-10) || !m_infoBoxAutoNewline )&& (pos < length)) // UTF-8 { if ( m_infoBoxText[pos] >= ' ' && m_infoBoxText[pos] <= '~' ) // any char between ASCII(32) and ASCII (126) @@ -835,7 +835,7 @@ void CVFD::showFilelist(int flist_pos,CFileList* flist,const char * const mainDi if(m_fileListPos > size) m_fileListPos = size-1; - int width = fonts.menu->getRenderWidth(m_fileListHeader.c_str(), true); + int width = fonts.menu->getRenderWidth(m_fileListHeader); if(width>110) width=110; fonts.menu->RenderString((120-width)/2, 11, width+5, m_fileListHeader.c_str(), CLCDDisplay::PIXEL_ON); @@ -940,7 +940,7 @@ void CVFD::showProgressBar(int global, const char * const text,int show_escape,i display.draw_fill_rect (0,12,120,64, CLCDDisplay::PIXEL_OFF); // paint progress header - int width = fonts.menu->getRenderWidth(m_progressHeaderGlobal.c_str(),true); + int width = fonts.menu->getRenderWidth(m_progressHeaderGlobal); if(width > 100) width = 100; int start_pos = (120-width) /2; @@ -1011,7 +1011,7 @@ void CVFD::showProgressBar2(int local,const char * const text_local ,int global display.draw_fill_rect (0,12,120,64, CLCDDisplay::PIXEL_OFF); // paint global header - int width = fonts.menu->getRenderWidth(m_progressHeaderGlobal.c_str(),true); + int width = fonts.menu->getRenderWidth(m_progressHeaderGlobal); if(width > 100) width = 100; int start_pos = (120-width) /2; @@ -1024,7 +1024,7 @@ void CVFD::showProgressBar2(int local,const char * const text_local ,int global display.draw_fill_rect (PROG2_GLOB_POS_X+1+marker_length, PROG2_GLOB_POS_Y+1, PROG2_GLOB_POS_X+PROG2_GLOB_POS_WIDTH-1, PROG2_GLOB_POS_Y+PROG2_GLOB_POS_HEIGTH-1, CLCDDisplay::PIXEL_OFF); // paint local header - width = fonts.menu->getRenderWidth(m_progressHeaderLocal.c_str(),true); + width = fonts.menu->getRenderWidth(m_progressHeaderLocal); if(width > 100) width = 100; start_pos = (120-width) /2; diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 6d6f62a61..3b37773aa 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1753,7 +1753,7 @@ void CAudioPlayerGui::paintInfo() tmp += sNr ; } - int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true); // UTF-8 + int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); int xstart = (m_width - w) / 2; if (xstart < 10) xstart = 10; @@ -1779,7 +1779,7 @@ void CAudioPlayerGui::paintInfo() tmp += " / "; tmp += m_curr_audiofile.MetaData.title; } - w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true); // UTF-8 + w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); xstart=(m_width-w)/2; if (xstart < 10) xstart=10; @@ -1872,7 +1872,7 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos) tmp += " / "; tmp += m_playlist[m_selected].MetaData.date; } - int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true) + 10; // UTF-8 + int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp) + 10; g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + m_width - w - 5, ypos2 + 2 + 1*m_fheight, w, tmp, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8 tmp = m_playlist[m_selected].MetaData.artist; diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 5a0365de5..af02b9560 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -370,7 +370,7 @@ int CBouquetList::show(bool bShowChannelList) favonly = !bShowChannelList; for(unsigned int count = 0; count < sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]);count++){ - int w_text = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText (CBouquetListButtons[count].locale),true); + int w_text = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(CBouquetListButtons[count].locale)); w_max_text = std::max(w_max_text, w_text); frameBuffer->getIconSize(CBouquetListButtons[count].button, &icol_w, &icol_h); w_max_icon = std::max(w_max_icon, icol_w); diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index d8fd53e1a..fb997ae7a 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1648,14 +1648,14 @@ void CChannelList::paintDetails(int index) noch= 0; snprintf(cNoch, sizeof(cNoch), "(%u / %d %s)", seit, noch, unit_short_minute); } - int seit_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cSeit, true); // UTF-8 - int noch_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cNoch, true); // UTF-8 + int seit_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cSeit); + int noch_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cNoch); std::string text1= p_event->description; std::string text2= p_event->text; int xstart = 10; - if (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1, true) > (full_width - 30 - seit_len) ) + if (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1) > (full_width - 30 - seit_len) ) { // zu breit, Umbruch versuchen... int pos; @@ -1663,7 +1663,7 @@ void CChannelList::paintDetails(int index) pos = text1.find_last_of("[ -.]+"); if ( pos!=-1 ) text1 = text1.substr( 0, pos ); - } while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1, true) > (full_width - 30 - seit_len) ) ); + } while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1) > (full_width - 30 - seit_len) ) ); std::string text3 = ""; /* not perfect, but better than crashing... */ if (p_event->description.length() > text1.length()) @@ -1672,7 +1672,7 @@ void CChannelList::paintDetails(int index) if (!text2.empty() && !text3.empty()) text3= text3+ " - "; - xstart += g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text3, true); + xstart += g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text3); g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2* fheight, full_width - 30- noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true); } @@ -1682,7 +1682,7 @@ void CChannelList::paintDetails(int index) text2 = text2.substr( 0, text2.find('\n') ); #if 0 //FIXME: to discuss, eat too much cpu time if string long enough int pos = 0; - while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text2, true) > (full_width - 30 - noch_len) ) ) { + while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text2) > (full_width - 30 - noch_len) ) ) { pos = text2.find_last_of(" "); if ( pos!=-1 ) { @@ -1719,7 +1719,7 @@ void CChannelList::paintDetails(int index) struct tm *pStartZeit = localtime (& CurrentNext.next_zeit.startzeit); snprintf(cFrom, sizeof(cFrom), "%s %02d:%02d",g_Locale->getText(LOCALE_WORD_FROM),pStartZeit->tm_hour, pStartZeit->tm_min ); snprintf(buf, sizeof(buf), "%s", CurrentNext.next_name.c_str()); - int from_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cFrom, true); // UTF-8 + int from_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cFrom); g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2*fheight+ fdescrheight, full_width - 30 - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_TEXT :COL_MENUCONTENTDARK_TEXT, 0, true); g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- from_len, y+ height+ 5+ 2*fheight+ fdescrheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8 @@ -2036,8 +2036,8 @@ void CChannelList::paintItem(int pos, const bool firstpaint) int pb_max = pb_space - 4; if (!(p_event->description.empty())) { snprintf(nameAndDescription+l, sizeof(nameAndDescription)-l,g_settings.channellist_epgtext_align_right ? " ":" - "); - unsigned int ch_name_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(nameAndDescription, true); - unsigned int ch_desc_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(p_event->description, true); + unsigned int ch_name_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(nameAndDescription); + unsigned int ch_desc_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(p_event->description); int max_desc_len = width - numwidth - prg_offset - ch_name_len - 15 - 20; // 15 = scrollbar, 20 = spaces if (chan->scrambled || (g_settings.channellist_extended ||g_settings.channellist_epgtext_align_right)) @@ -2149,7 +2149,7 @@ void CChannelList::paintHead() void CChannelList::paint() { - numwidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(MaxChanNr().c_str()); + numwidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(MaxChanNr()); liststart = (selected/listmaxshow)*listmaxshow; updateEvents(this->historyMode ? 0:liststart, this->historyMode ? 0:(liststart + listmaxshow)); @@ -2409,7 +2409,7 @@ void CChannelList::processTextToArray(std::string text, int screening) // UTF-8 if (*text_!='\n') aktWord += *text_; - int aktWordWidth = g_Font[eventFont]->getRenderWidth(aktWord, true); + int aktWordWidth = g_Font[eventFont]->getRenderWidth(aktWord); if ((aktWordWidth+aktWidth)<(infozone_width - 20)) {//space ok, add aktWidth += aktWordWidth; diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index e458514e8..6a023bacb 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -204,7 +204,7 @@ void CComponentsButton::initCaption() //handle common position of icon and text inside container required for alignment int w_required = fr_thickness + append_x_offset; w_required += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() + append_x_offset : 0; - w_required += cc_btn_font ? cc_btn_font->getRenderWidth(cc_btn_capt, true) : 0; + w_required += cc_btn_font ? cc_btn_font->getRenderWidth(cc_btn_capt) : 0; w_required += append_x_offset + fr_thickness; //dynamic width diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index 12dfbaeb1..cc01ee1c1 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -117,7 +117,7 @@ void CComponentsFrmClock::initCCLockItems() string s_time = cl_timestr; //get minimal required height, width from raw text - int min_text_w = (*getClockFont())->getRenderWidth(s_time, true);; + int min_text_w = (*getClockFont())->getRenderWidth(s_time); int min_text_h = (*getClockFont())->getHeight(); height = max(height, min_text_h); width = max(width, min_text_w); @@ -153,7 +153,7 @@ void CComponentsFrmClock::initCCLockItems() int minSepWidth = 0; string sep[] ={" ", ".", ":"}; for (size_t i = 0; i < sizeof(sep)/sizeof(sep[0]); i++) - minSepWidth = max((*getClockFont())->getRenderWidth(sep[i], true), minSepWidth); + minSepWidth = max((*getClockFont())->getRenderWidth(sep[i]), minSepWidth); //modify available label items with current segment chars for (size_t i = 0; i < v_cc_items.size(); i++) @@ -179,7 +179,7 @@ void CComponentsFrmClock::initCCLockItems() if (isdigit(stmp.at(0)) ) //check for digits, if true, we use digit width wtmp = (*getClockFont())->getMaxDigitWidth(); else //not digit found, we use render width or minimal width - wtmp = max((*getClockFont())->getRenderWidth(stmp, true), minSepWidth); + wtmp = max((*getClockFont())->getRenderWidth(stmp), minSepWidth); //set size, text, color of current item lbl->setDimensionsAll(cl_x, cl_y, wtmp, cl_h); diff --git a/src/gui/dboxinfo.cpp b/src/gui/dboxinfo.cpp index 6bdbbd4ca..70ff43ce2 100644 --- a/src/gui/dboxinfo.cpp +++ b/src/gui/dboxinfo.cpp @@ -69,9 +69,9 @@ CDBoxInfoWidget::CDBoxInfoWidget() fontWidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getWidth(); sizeWidth = 6 * g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getMaxDigitWidth() - + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(std::string(" MiB") + g_Locale->getText(LOCALE_UNIT_DECIMAL), true); ;//9999.99 MiB + + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(std::string(" MiB") + g_Locale->getText(LOCALE_UNIT_DECIMAL)); ;//9999.99 MiB percWidth = 3 * g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getMaxDigitWidth() - + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("%", true); //100% + + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("%"); //100% nameWidth = fontWidth * 10; } @@ -280,7 +280,7 @@ void CDBoxInfoWidget::paint() mounts[mountpoint] = is_rec; int icon_space = is_rec ? 10 + icon_w : 0; const char *mnt = mountpoint.c_str(); - nameWidth = std::max(nameWidth, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(basename((char *)mnt), true) + icon_space + 10); + nameWidth = std::max(nameWidth, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(basename((char *)mnt)) + icon_space + 10); } } in.close(); @@ -341,7 +341,7 @@ void CDBoxInfoWidget::paint() int head_info_rw = 0; for (int line = 0; line < head_info_lines; line++) { - head_info_rw = std::max(head_info_rw, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(head_info[line], true)); + head_info_rw = std::max(head_info_rw, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(head_info[line])); } int dw = offsetw - 3*10 - head_info_rw; @@ -467,7 +467,7 @@ void CDBoxInfoWidget::paint() } mpOffset = offsets[column]; int space = 0; - int rw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true); + int rw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); if (column > 0) { space = widths[column] - rw; } @@ -491,7 +491,7 @@ void CDBoxInfoWidget::paint() int ypos_mnt_head = ypos; ypos += mheight; - int width_i = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("i", true); + int width_i = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("i"); CRecordManager * crm = CRecordManager::getInstance(); for (std::map::iterator it = mounts.begin(); it != mounts.end(); ++it) { @@ -535,7 +535,7 @@ void CDBoxInfoWidget::paint() } int space = 0; if (column > 0) { - int rw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true); + int rw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); maxWidth[column] = std::max(maxWidth[column], rw); space = widths[column] - rw; _w = rw; @@ -570,7 +570,7 @@ void CDBoxInfoWidget::paint() for (int column = 0; column < headSize; column++) { headOffset = offsets[column]; int space = 0; - int rw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(head_mem[column], true); + int rw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(head_mem[column]); int _w = rw; if (column > 0) { if (rw > maxWidth[column]) @@ -585,7 +585,7 @@ void CDBoxInfoWidget::paint() for (int column = 0; column < headSize; column++) { headOffset = offsets[column]; int space = 0; - int rw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(head_mnt[column], true); + int rw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(head_mnt[column]); int _w = rw; if (column > 0) { if (rw > maxWidth[column]) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index dfeaf45d4..04ca01923 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -186,13 +186,13 @@ void EpgPlus::TimeLine::paint (time_t startTime, int pduration) std::string timeStr = EpgPlus::getTimeString (tickTime, "%H"); - int textWidth = this->fontTime->getRenderWidth (timeStr, true); + int textWidth = this->fontTime->getRenderWidth (timeStr); this->fontTime->RenderString (xPos - textWidth - 4, this->y + this->fontTime->getHeight() , textWidth, timeStr, toggleColor ? COL_MENUCONTENT_P1 : COL_MENUCONTENT_P2, 0, true); // UTF-8 timeStr = EpgPlus::getTimeString (tickTime, "%M"); - textWidth = this->fontTime->getRenderWidth (timeStr, true); + textWidth = this->fontTime->getRenderWidth (timeStr); this->fontTime->RenderString (xPos + 4, this->y + this->fontTime->getHeight() , textWidth, timeStr, toggleColor ? COL_MENUCONTENT_P1 : COL_MENUCONTENT_P2, 0, true); // UTF-8 @@ -223,14 +223,14 @@ void EpgPlus::TimeLine::paintMark (time_t startTime, int pduration, int px, int // display start time before mark std::string timeStr = EpgPlus::getTimeString (startTime, "%H:%M"); - int textWidth = this->fontTime->getRenderWidth (timeStr, true); + int textWidth = this->fontTime->getRenderWidth (timeStr); this->fontTime->RenderString (px - textWidth, this->y + this->fontTime->getHeight() + this->fontTime->getHeight() , textWidth, timeStr, COL_MENUCONTENT_TEXT, 0, true); // UTF-8 // display end time after mark timeStr = EpgPlus::getTimeString (startTime + pduration, "%H:%M"); - textWidth = fontTime->getRenderWidth (timeStr, true); + textWidth = fontTime->getRenderWidth (timeStr); if (px + pwidth + textWidth < this->x + this->width) { this->fontTime->RenderString (px + pwidth, this->y + this->fontTime->getHeight() + this->fontTime->getHeight() diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 0a44b8224..6f0861e67 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -179,7 +179,7 @@ void CEpgData::processTextToArray(std::string text, int screening) // UTF-8 aktWord += *text_; // check the wordwidth - add to this line if size ok - int aktWordWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(aktWord, true); + int aktWordWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(aktWord); if ((aktWordWidth+aktWidth)<(ox - 20 - 15)) {//space ok, add aktWidth += aktWordWidth; @@ -228,10 +228,10 @@ void CEpgData::showText( int startPos, int ypos ) int max_mon_w = 0, max_wday_w = 0; int digi = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth("29.."); for(int i = 0; i < 12;i++){ - max_mon_w = std::max(max_mon_w, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getMonth(i))) + " ", true)); // UTF-8 + max_mon_w = std::max(max_mon_w, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getMonth(i))) + " ")); if(i > 6) continue; - max_wday_w = std::max(max_wday_w, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getWeekday(i))) + " ", true)); // UTF-8 + max_wday_w = std::max(max_wday_w, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getWeekday(i))) + " ")); } frameBuffer->paintBoxRel(sx, y, ox- 15, sb, COL_MENUCONTENT_PLUS_0); // background of the text box for (int i = startPos; i < textSize && i < startPos + medlinecount; i++, y += medlineheight) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index dc8518f90..21f9b1b58 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -765,7 +765,7 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI) } // 1st line - int fwidth1a=g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime1_str,true); + int fwidth1a=g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime1_str); g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5, ypos+ fheight1+3, fwidth1a, datetime1_str, color, 0, true); // UTF-8 @@ -774,7 +774,7 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI) { char beginnt[100]; snprintf(beginnt, sizeof(beginnt), "%s %d %s", g_Locale->getText(LOCALE_WORD_IN), seit, unit_short_minute); - int w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(beginnt, true) + 10; + int w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(beginnt) + 10; g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20- w, ypos+ fheight1+3, w, beginnt, color, 0, true); // UTF-8 } g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20, ypos+ fheight1+3, fwidth2, duration_str, color, 0, true); // UTF-8 @@ -852,9 +852,9 @@ void CNeutrinoEventList::paintHead(std::string _channelname, std::string _channe const short font_h = 8 /* FONT_TYPE_EVENTLIST_ITEMLARGE */; short pn_y_off = std::max((theight - g_Font[font_h]->getHeight()) / 2, 0); - short prev_len = g_Font[font_h]->getRenderWidth(_channelname_prev.c_str(),true); - short next_len = g_Font[font_h]->getRenderWidth(_channelname_next.c_str(),true); - short middle_len = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->getRenderWidth(_channelname.c_str(),true); + short prev_len = g_Font[font_h]->getRenderWidth(_channelname_prev); + short next_len = g_Font[font_h]->getRenderWidth(_channelname_next); + short middle_len = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->getRenderWidth(_channelname); short middle_offset = (full_width- next_len- prev_len- middle_len)/2; if(middle_offset < 0){ int fw_h = g_Font[font_h]->getWidth(); diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 88ef0831b..4ef5b2be3 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -1438,7 +1438,7 @@ void CFileBrowser::paintSMSKey() { char cKey[2]={m_SMSKeyInput.getOldKey(),0}; cKey[0] = toupper(cKey[0]); - int len = fnt_small->getRenderWidth(cKey, true); + int len = fnt_small->getRenderWidth(cKey); fnt_small->RenderString(x + width - skwidth, y + height - foheight + (skheight/2), len, cKey, COL_MENUHEAD_TEXT, 0, true); } } diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 7d9f741d1..05dc0f640 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -773,7 +773,7 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con std::string prov_name = pname; prov_name=prov_name.substr(prov_name.find_first_of("]")+1); - int chname_width = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth (ChannelName, true);// UTF-8 + int chname_width = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth (ChannelName); unsigned int chann_size = ChannelName.size(); if(ChannelName.empty()) chann_size = 1; @@ -1017,7 +1017,7 @@ void CInfoViewer::showSubchan () int dy = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight(); // 25; if (g_RemoteControl->director_mode) { - int w = 20 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth (g_Locale->getText (LOCALE_NVODSELECTOR_DIRECTORMODE), true) + 20; // UTF-8 + int w = 20 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth (g_Locale->getText (LOCALE_NVODSELECTOR_DIRECTORMODE)) + 20; int h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); if (w > dx) dx = w; @@ -1103,7 +1103,7 @@ void CInfoViewer::showMotorMoving (int duration) char text[256]; snprintf(text, sizeof(text), "%s (%ds)", g_Locale->getText (LOCALE_INFOVIEWER_MOTOR_MOVING), duration); - ShowHint (LOCALE_MESSAGEBOX_INFO, text, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth (text, true) + 10, duration); // UTF-8 + ShowHint (LOCALE_MESSAGEBOX_INFO, text, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth (text) + 10, duration); // UTF-8 } void CInfoViewer::killRadiotext() diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 7af745301..6afbe45c4 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -608,7 +608,7 @@ int CLuaInstance::RenderString(lua_State *L) center = luaL_checkint(L, 9); if (f >= SNeutrinoSettings::FONT_TYPE_COUNT || f < 0) f = SNeutrinoSettings::FONT_TYPE_MENU; - int rwidth = g_Font[f]->getRenderWidth(text, true); + int rwidth = g_Font[f]->getRenderWidth(text); if (center) { /* center the text inside the box */ if (rwidth < w) x += (w - rwidth) / 2; @@ -635,7 +635,7 @@ int CLuaInstance::getRenderWidth(lua_State *L) if (f >= SNeutrinoSettings::FONT_TYPE_COUNT || f < 0) f = SNeutrinoSettings::FONT_TYPE_MENU; - lua_pushinteger(L, (int)g_Font[f]->getRenderWidth(text, true)); + lua_pushinteger(L, (int)g_Font[f]->getRenderWidth(text)); return 1; } diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 0256f9573..218d7ad45 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1606,7 +1606,7 @@ void CMoviePlayerGui::showSubtitle(neutrino_msg_data_t data) int x[subtext.size()]; int y[subtext.size()]; for (unsigned i = 0; i < subtext.size(); i++) { - int w = g_Font[SNeutrinoSettings::FONT_TYPE_SUBTITLES]->getRenderWidth (subtext[i].c_str(), true); + int w = g_Font[SNeutrinoSettings::FONT_TYPE_SUBTITLES]->getRenderWidth (subtext[i]); x[i] = (sw - w) / 2; y[i] = sh - height + h*(i + 1); min_x = std::min(min_x, x[i]); diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 0dc6f6595..bc38a2763 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -412,7 +412,7 @@ int CScanTs::handleMsg(neutrino_msg_t msg, neutrino_msg_data_t data) case NeutrinoMessages::EVT_SCAN_REPORT_FREQUENCY: freqready = 1; sprintf(buffer, "%u", data); - xpos_frequency = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(buffer, true)+2; + xpos_frequency = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(buffer)+2; paintLine(xpos2, ypos_frequency, xpos_frequency, buffer); paintRadar(); break; @@ -533,12 +533,12 @@ void CScanTs::paint(bool fortest) if(deltype == FE_QPSK) { //sat paintLineLocale(xpos1, &ypos, width - xpos1, LOCALE_SCANTS_ACTSATELLITE); - xpos2 = xpos1 + 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_SCANTS_ACTSATELLITE), true)+2; // UTF-8 + xpos2 = xpos1 + 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_SCANTS_ACTSATELLITE))+2; } if(deltype == FE_QAM) { //cable paintLineLocale(xpos1, &ypos, width - xpos1, LOCALE_SCANTS_ACTCABLE); - xpos2 = xpos1 + 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_SCANTS_ACTCABLE), true)+2; // UTF-8 + xpos2 = xpos1 + 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_SCANTS_ACTCABLE))+2; } ypos_transponder = ypos; @@ -569,7 +569,7 @@ void CScanTs::paint(bool fortest) int CScanTs::greater_xpos(int xpos, const neutrino_locale_t txt) { - int txt_xpos = xpos1 + 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(txt), true)+2; // UTF-8 + int txt_xpos = xpos1 + 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(txt))+2; if (txt_xpos > xpos) return txt_xpos; else diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index cafb07d9b..ed59b5ef5 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -369,7 +369,7 @@ unsigned int CScanSetup::getSatMenuListWidth() satellite_map_t satmap = CServiceManager::getInstance()->SatelliteList(); for(sat_iterator_t it = satmap.begin(); it != satmap.end(); ++it) { - sat_txt_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(it->second.name.c_str(), true); + sat_txt_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(it->second.name); max_txt_w = std::max(max_txt_w, sat_txt_w); } diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index c8a80e5e4..d39cc67ec 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -449,12 +449,12 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) transponder t; CServiceManager::getInstance()->GetTransponder(channel->getTransponderId(), t); - int array[6]={g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION),true), - g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_ARATIO),true), - g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_BITRATE),true), - g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE),true), - g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE),true), - g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_SCANTS_FREQDATA),true)};// UTF-8 + int array[6]={g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION)), + g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_ARATIO)), + g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_BITRATE)), + g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE)), + g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE)), + g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_SCANTS_FREQDATA))}; for(i=0 ; i<6; i++) { if(spaceoffset < array[i]) @@ -685,7 +685,7 @@ void CStreamInfo2::paintCASystem(int xpos, int ypos) return; for(i = 0; i < NUM_CAIDS; i++) { - array[i] = g_Font[font_info]->getRenderWidth(casys[i].c_str()); + array[i] = g_Font[font_info]->getRenderWidth(casys[i]); caids[i] = false; } @@ -759,7 +759,7 @@ void CStreamInfo2::paintCASystem(int xpos, int ypos) if(index == 0) width_txt = spaceoffset; else - width_txt += g_Font[font_small]->getRenderWidth(casys[ca_id].substr(last_pos, pos - last_pos).c_str())+10; + width_txt += g_Font[font_small]->getRenderWidth(casys[ca_id].substr(last_pos, pos - last_pos))+10; index++; if (index > 5) break; diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 6b0189494..6353e9c5d 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -895,7 +895,7 @@ void CUpnpBrowserGui::paintDeviceInfo() // first line tmp = m_devices[m_selecteddevice].manufacturer + " " + m_devices[m_selecteddevice].manufacturerurl; - w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true); // UTF-8 + w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); w = std::min(w, m_width - 20); xstart = (m_width - w) / 2; g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 1*m_mheight, m_width - 20, @@ -905,14 +905,14 @@ void CUpnpBrowserGui::paintDeviceInfo() tmp = m_devices[m_selecteddevice].modelname + " " + m_devices[m_selecteddevice].modelnumber + " " + m_devices[m_selecteddevice].modeldescription; - w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true); // UTF-8 + w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); w = std::min(w, m_width - 20); xstart = (m_width - w) / 2; g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 2*m_mheight, m_width - 20, tmp, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8 // third line tmp = m_devices[m_selecteddevice].modelurl; - w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true); // UTF-8 + w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); w = std::min(w, m_width - 20); xstart = (m_width - w) / 2; g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 3*m_mheight, m_width - 20, @@ -1081,7 +1081,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) else tmp = tmp + "No resource for Item"; - w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true); // UTF-8 + w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); w = std::min(w, m_width - 20); xstart = (m_width - w) / 2; g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 1*m_mheight, m_width - 20, @@ -1096,7 +1096,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) if (preferred != -1) tmp = "Protocol: " + entry->proto + ", MIME-Type: " + entry->mime; } - w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true); // UTF-8 + w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); w = std::min(w, m_width - 20); xstart = (m_width - w) / 2; g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 2*m_mheight, m_width - 20, @@ -1107,7 +1107,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) if (!entry->isdir && preferred != -1) tmp = "URL: " + entry->resources[preferred].url; - w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true); // UTF-8 + w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); w = std::min(w, m_width - 20); xstart = (m_width - w) / 2; g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 3*m_mheight, m_width - 20, diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index 0d52a4406..fad576a52 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -140,9 +140,9 @@ int paintButtons( const int &x, buttontext[i] = g_Locale->getText(content[i].locale); //text width if (alt_buttontext != NULL && i == buttontext_id) - fwidth[i] = font->getRenderWidth(alt_buttontext, true); //...with an alternate buttontext + fwidth[i] = font->getRenderWidth(alt_buttontext); //...with an alternate buttontext else - fwidth[i] = font->getRenderWidth(buttontext[i], true); + fwidth[i] = font->getRenderWidth(buttontext[i]); w_text += fwidth[i]; count_labels++; } else { diff --git a/src/gui/widget/colorchooser.cpp b/src/gui/widget/colorchooser.cpp index 758cce4a7..602a7400b 100644 --- a/src/gui/widget/colorchooser.cpp +++ b/src/gui/widget/colorchooser.cpp @@ -79,7 +79,7 @@ CColorChooser::CColorChooser(const neutrino_locale_t Name, unsigned char *R, uns //calculate max width of LOCALS offset = 0; for (int i = 0; i < 4; i++) { - int tmpoffset = g_Font[font_info]->getRenderWidth(g_Locale->getText (colorchooser_names[i])); + int tmpoffset = g_Font[font_info]->getRenderWidth(g_Locale->getText(colorchooser_names[i])); if (tmpoffset > offset) { offset = tmpoffset; } diff --git a/src/gui/widget/drawable.cpp b/src/gui/widget/drawable.cpp index 7435d9158..d83c7882b 100644 --- a/src/gui/widget/drawable.cpp +++ b/src/gui/widget/drawable.cpp @@ -80,7 +80,7 @@ DText::DText(const char *text) void DText::init() { - m_width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(m_text, true); // UTF-8 + m_width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(m_text); m_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); } diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 314b0519a..4fb237fab 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -106,15 +106,14 @@ void CHintBox::init(const char * const Caption, const char * const Text, const i else iconfile = ""; - //nw = additional_width + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(g_Locale->getText(caption), true); // UTF-8 - nw = additional_width + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(caption, true); // UTF-8 + nw = additional_width + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(caption); if (nw > width) width = nw; for (std::vector::const_iterator it = line.begin(); it != line.end(); ++it) { - int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(*it, true); // UTF-8 + int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(*it); maxLineWidth = std::max(maxLineWidth, w); nw = additional_width + w; if (nw > width) diff --git a/src/gui/widget/hintboxext.cpp b/src/gui/widget/hintboxext.cpp index 4ac14c74c..1a7c90f4a 100644 --- a/src/gui/widget/hintboxext.cpp +++ b/src/gui/widget/hintboxext.cpp @@ -224,7 +224,7 @@ void CHintBoxExt::init(const neutrino_locale_t Caption, const std::string &Capti m_iconfile = ""; const char *l_caption = (m_caption == NONEXISTANT_LOCALE) ? m_captionString.c_str() : g_Locale->getText(m_caption); - nw = additional_width + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(l_caption, true); // UTF-8 + nw = additional_width + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(l_caption); if (nw > m_width) m_width = nw; diff --git a/src/gui/widget/keychooser.cpp b/src/gui/widget/keychooser.cpp index f11a0d28b..50abbb697 100644 --- a/src/gui/widget/keychooser.cpp +++ b/src/gui/widget/keychooser.cpp @@ -157,11 +157,11 @@ void CKeyChooserItem::paint() CFrameBuffer * frameBuffer = CFrameBuffer::getInstance(); int tmp; - width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(g_Locale->getText(name), true); - tmp = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_KEYCHOOSER_TEXT1), true); + width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(g_Locale->getText(name)); + tmp = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_KEYCHOOSER_TEXT1)); if (tmp > width) width = tmp; - tmp = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_KEYCHOOSER_TEXT2), true); + tmp = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_KEYCHOOSER_TEXT2)); if (tmp > width) width = tmp; width += 20; diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index fea30fe37..cd7e778c2 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -166,8 +166,8 @@ void CMenuItem::paintItemCaption(const bool select_mode, const int &item_height, //right text if (right_text && (*right_text || right_bgcol)) { - int stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(right_text, true); - int stringstartposOption = std::max(name_start_x + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(left_text, true) + icon_frame_w, x + dx - stringwidth - icon_frame_w); //+ offx + int stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(right_text); + int stringstartposOption = std::max(name_start_x + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(left_text) + icon_frame_w, x + dx - stringwidth - icon_frame_w); //+ offx if (right_bgcol) { if (!*right_text) stringstartposOption -= 60; @@ -210,9 +210,9 @@ void CMenuItem::paintItemSlider( const bool select_mode, const int &item_height, return; int stringwidth = 0; if (right_text != NULL) { - stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("U999", true) ; + stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("U999") ; } - int stringwidth2 = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(left_text, true); + int stringwidth2 = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(left_text); int maxspace = dx - stringwidth - icon_frame_w - stringwidth2 - 10; if(maxspace < slider_lenght){ @@ -863,7 +863,7 @@ void CMenuWidget::calcSize() if(height > ((int)frameBuffer->getScreenHeight() - 10)) height = frameBuffer->getScreenHeight() - 10; - int neededWidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(nameString.c_str(), true); // UTF-8 + int neededWidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(nameString); if (neededWidth > width-48) { width= neededWidth+ 49; } @@ -1345,14 +1345,14 @@ int CMenuOptionNumberChooser::paint(bool selected) int CMenuOptionNumberChooser::getWidth(void) { - int width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(getName(), true); + int width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(getName()); int _lower_bound = lower_bound; int _upper_bound = upper_bound; int m = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getMaxDigitWidth(); int w1 = 0; if (_lower_bound < 0) - w1 += g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("-", true); + w1 += g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("-"); while (_lower_bound) { w1 += m; _lower_bound /= 10; @@ -1360,7 +1360,7 @@ int CMenuOptionNumberChooser::getWidth(void) int w2 = 0; if (_upper_bound < 0) - w2 += g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("-", true); + w2 += g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("-"); while (_upper_bound) { w1 += m; _upper_bound /= 10; @@ -1370,11 +1370,11 @@ int CMenuOptionNumberChooser::getWidth(void) if (numberFormatFunction) { std::string s = numberFormatFunction(0); - width += g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(s.c_str(), true) - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("0", true); // arbitrary + width += g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(s) - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("0"); // arbitrary } else if (numberFormat != "%d") { char format[numberFormat.length()]; snprintf(format, numberFormat.length(), numberFormat.c_str(), 0); - width += g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(format, true) - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("0", true); + width += g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(format) - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("0"); } return width + 10; /* min 10 pixels between option name and value. enough? */ @@ -1710,17 +1710,17 @@ int CMenuOptionChooser::paint( bool selected) int CMenuOptionChooser::getWidth(void) { int ow = 0; - int tw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(getName(), true); + int tw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(getName()); int width = tw; for(unsigned int count = 0; count < options.size(); count++) { ow = 0; if (options[count].valname) ow = g_Font[SNeutrinoSettings::FONT_TYPE_MENU] - ->getRenderWidth(options[count].valname, true); + ->getRenderWidth(options[count].valname); else ow = g_Font[SNeutrinoSettings::FONT_TYPE_MENU] - ->getRenderWidth(g_Locale->getText(options[count].value), true); + ->getRenderWidth(g_Locale->getText(options[count].value)); if (tw + ow > width) width = tw + ow; @@ -1979,7 +1979,7 @@ int CMenuForwarder::getHeight(void) const int CMenuForwarder::getWidth(void) { const char *_name = (name == NONEXISTANT_LOCALE) ? nameString.c_str() : g_Locale->getText(name); - int tw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(_name, true); + int tw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(_name); fb_pixel_t bgcol = 0; std::string option_name = getOption(); @@ -1987,7 +1987,7 @@ int CMenuForwarder::getWidth(void) bgcol = jumpTarget->getColor(); if (!option_name.empty()) - tw += 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(option_name.c_str(), true); + tw += 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(option_name); else if (bgcol) tw += 10 + 60; @@ -2087,7 +2087,7 @@ int CMenuSeparator::getWidth(void) w = 30; /* 15 pixel left and right */ const char *l_name = getName(); if ((type & STRING) && *l_name) - w += g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(l_name, true); + w += g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(l_name); return w; } @@ -2119,7 +2119,7 @@ int CMenuSeparator::paint(bool selected) if (*l_name) { - int stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(l_name, true); // UTF-8 + int stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(l_name); /* if no alignment is specified, align centered */ if (type & ALIGN_LEFT) diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index cb88930de..236e4b0c2 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -131,7 +131,7 @@ int CMessageBox::getButtonWidth() neutrino_locale_t localeMsg[localeMsgCount] = {LOCALE_MESSAGEBOX_YES, LOCALE_MESSAGEBOX_NO, LOCALE_MESSAGEBOX_CANCEL, LOCALE_MESSAGEBOX_OK, LOCALE_MESSAGEBOX_BACK}; int MaxButtonTextWidth = 0; for (int i = 0; i < localeMsgCount; i++) - MaxButtonTextWidth = std::max(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(localeMsg[i]), true), MaxButtonTextWidth); + MaxButtonTextWidth = std::max(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(localeMsg[i])), MaxButtonTextWidth); return MaxButtonTextWidth + i_maxw + 36 + (RADIUS_LARGE / 2); } diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 9b8426251..282df39fd 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -341,7 +341,7 @@ void CMsgBox::refreshFoot(void) //const char* text; - int MaxButtonTextWidth = m_pcFontFoot->getRenderWidth(g_Locale->getText(LOCALE_MESSAGEBOX_CANCEL), true); // UTF-8 + int MaxButtonTextWidth = m_pcFontFoot->getRenderWidth(g_Locale->getText(LOCALE_MESSAGEBOX_CANCEL)); int ButtonWidth = 20 + 33 + MaxButtonTextWidth; int ButtonSpacing = (m_cBoxFrameFootRel.iWidth - 20- (ButtonWidth*3) ) / 2; int xpos = m_cBoxFrameFootRel.iX; diff --git a/src/gui/widget/shellwindow.cpp b/src/gui/widget/shellwindow.cpp index 8e393f57b..71d5816b1 100644 --- a/src/gui/widget/shellwindow.cpp +++ b/src/gui/widget/shellwindow.cpp @@ -179,7 +179,7 @@ CShellWindow::~CShellWindow() int iw, ih; frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_OKAY, &iw, &ih); Font *font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]; - int b_width = font->getRenderWidth(g_Locale->getText(LOCALE_MESSAGEBOX_OK), true) + 36 + ih + (RADIUS_LARGE / 2); + int b_width = font->getRenderWidth(g_Locale->getText(LOCALE_MESSAGEBOX_OK)) + 36 + ih + (RADIUS_LARGE / 2); int fh = font->getHeight(); int b_height = std::max(fh, ih) + 8 + (RADIUS_LARGE / 2); int xpos = frameBuffer->getScreenWidth() - b_width; diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index 146269d70..00da93c2e 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -114,7 +114,7 @@ void CStringInput::init() width = std::max(size*input_w + 2*offset, (int) frameBuffer->getScreenWidth() / 100 * 45); - int tmp_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(head.c_str(), true); // UTF-8 + int tmp_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(head); if (!(iconfile.empty())) { @@ -130,13 +130,13 @@ void CStringInput::init() { if (hint_1 != NONEXISTANT_LOCALE) { - tmp_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getRenderWidth(g_Locale->getText(hint_1), true); + tmp_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getRenderWidth(g_Locale->getText(hint_1)); width = std::max(width, tmp_w + 2*offset); bheight += iheight; } if (hint_2 != NONEXISTANT_LOCALE) { - tmp_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getRenderWidth(g_Locale->getText(hint_2), true); + tmp_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getRenderWidth(g_Locale->getText(hint_2)); width = std::max(width, tmp_w + 2*offset); bheight += iheight; } diff --git a/src/gui/widget/stringinput_ext.cpp b/src/gui/widget/stringinput_ext.cpp index 0f49cbb8b..1807d6a4a 100644 --- a/src/gui/widget/stringinput_ext.cpp +++ b/src/gui/widget/stringinput_ext.cpp @@ -66,7 +66,7 @@ void CExtendedInput::Init(void) width = frameBuffer->getScreenWidth() / 100 * 45; - int tmp_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(g_Locale->getText(name), true); // UTF-8 + int tmp_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(g_Locale->getText(name)); width = std::max(width, tmp_w + offset); bheight = input_h + 2*offset; @@ -74,13 +74,13 @@ void CExtendedInput::Init(void) { if (hint_1 != NONEXISTANT_LOCALE) { - tmp_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getRenderWidth(g_Locale->getText(hint_1), true); + tmp_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getRenderWidth(g_Locale->getText(hint_1)); width = std::max(width, tmp_w + 2*offset); bheight += iheight; } if (hint_2 != NONEXISTANT_LOCALE) { - tmp_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getRenderWidth(g_Locale->getText(hint_2), true); + tmp_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getRenderWidth(g_Locale->getText(hint_2)); width = std::max(width, tmp_w + 2*offset); bheight += iheight; } diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index e60946120..f098a0319 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -395,7 +395,7 @@ void CTextBox::refreshTextLineArray(void) aktWord = m_cText.substr(pos_prev, pos - pos_prev + 1); //calculate length of current found word - aktWordWidth = m_pcFontText->getRenderWidth(aktWord, true); + aktWordWidth = m_pcFontText->getRenderWidth(aktWord); //set next start pos pos_prev = pos + 1; @@ -628,10 +628,10 @@ void CTextBox::refreshText(void) { //calculate centered xpos if( m_nMode & CENTER ){ - x_center = ((m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i], true))>>1) - text_Hborder_width; + x_center = ((m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i]))>>1) - text_Hborder_width; } else if ( m_nMode & RIGHT ){ - x_center = ((m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i], true)) - text_Hborder_width*2); + x_center = ((m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i])) - text_Hborder_width*2); if ( m_nMode & SCROLL ) x_center -= SCROLL_FRAME_WIDTH; } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index e05be7ae9..e506c37a7 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2555,7 +2555,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) scrambled_timer = 0; if(g_settings.scrambled_message && videoDecoder->getBlank() && videoDecoder->getPlayState()) { const char * text = g_Locale->getText(LOCALE_SCRAMBLED_CHANNEL); - ShowHint (LOCALE_MESSAGEBOX_INFO, text, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth (text, true) + 10, 5); + ShowHint (LOCALE_MESSAGEBOX_INFO, text, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(text) + 10, 5); } return messages_return::handled; } From 4f9e0ee544776696bb42d9019ae5a5129e908f8d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 11 Jun 2014 13:43:38 +0200 Subject: [PATCH 115/511] change RenderString() default to UTF8 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/649d1b1f9dc75c995958e9642d39abbc0927bfe0 Author: vanhofen Date: 2014-06-11 (Wed, 11 Jun 2014) Origin message was: ------------------ - change RenderString() default to UTF8 ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/lcdd.cpp | 12 ++-- src/driver/vfd.cpp | 18 ++--- src/gui/audioplayer.cpp | 16 ++--- src/gui/bedit/bouqueteditor_bouquets.cpp | 2 +- src/gui/bedit/bouqueteditor_channels.cpp | 4 +- src/gui/bedit/bouqueteditor_chanselect.cpp | 8 +-- src/gui/bookmarkmanager.cpp | 8 +-- src/gui/bouquetlist.cpp | 2 +- src/gui/channellist.cpp | 34 ++++----- src/gui/epgplus.cpp | 23 +++--- src/gui/epgview.cpp | 14 ++-- src/gui/eventlist.cpp | 16 ++--- src/gui/filebrowser.cpp | 6 +- src/gui/infoviewer.cpp | 38 +++++----- src/gui/infoviewer_bb.cpp | 2 +- src/gui/luainstance.cpp | 2 +- src/gui/motorcontrol.cpp | 6 +- src/gui/moviebrowser.cpp | 16 ++--- src/gui/movieplayer.cpp | 2 +- src/gui/pictureviewer.cpp | 2 +- src/gui/scan.cpp | 4 +- src/gui/screensetup.cpp | 4 +- src/gui/streaminfo2.cpp | 84 +++++++++++----------- src/gui/timerlist.cpp | 12 ++-- src/gui/upnpbrowser.cpp | 26 +++---- src/gui/widget/buttons.cpp | 2 +- src/gui/widget/colorchooser.cpp | 4 +- src/gui/widget/drawable.cpp | 4 +- src/gui/widget/hintbox.cpp | 8 +-- src/gui/widget/hintboxext.cpp | 2 +- src/gui/widget/keychooser.cpp | 6 +- src/gui/widget/listbox.cpp | 2 +- src/gui/widget/listframe.cpp | 8 +-- src/gui/widget/menue.cpp | 4 +- src/gui/widget/messagebox.cpp | 2 +- src/gui/widget/msgbox.cpp | 14 ++-- src/gui/widget/progresswindow.cpp | 6 +- src/gui/widget/shellwindow.cpp | 2 +- src/gui/widget/stringinput.cpp | 6 +- src/gui/widget/stringinput_ext.cpp | 6 +- src/gui/widget/textbox.cpp | 2 +- 41 files changed, 217 insertions(+), 222 deletions(-) diff --git a/src/driver/lcdd.cpp b/src/driver/lcdd.cpp index 23085ed50..0eb6dd0f6 100644 --- a/src/driver/lcdd.cpp +++ b/src/driver/lcdd.cpp @@ -964,7 +964,7 @@ void CLCD::setMode(const MODES m, const char * const title) case MODE_MENU_UTF8: showclock = false; display.load_screen(&(background[BACKGROUND_SETUP])); - fonts.menutitle->RenderString(0, 28, LCD_COLS + 20, title, CLCDDisplay::PIXEL_ON, 0, true); // UTF-8 + fonts.menutitle->RenderString(0, 28, LCD_COLS + 20, title, CLCDDisplay::PIXEL_ON); displayUpdate(); break; case MODE_SHUTDOWN: @@ -1190,7 +1190,7 @@ void CLCD::showInfoBox(const char * const title, const char * const text ,int au width = LCD_COLS - 20; int start_pos = (LCD_COLS - width) /2; display.draw_fill_rect (start_pos, EPG_INFO_WINDOW_POS-4, start_pos+width+5, EPG_INFO_WINDOW_POS+10, CLCDDisplay::PIXEL_OFF); - fonts.menu->RenderString(start_pos+4,EPG_INFO_WINDOW_POS+5, width+5, m_infoBoxTitle.c_str(), CLCDDisplay::PIXEL_ON, 0, true); // UTF-8 + fonts.menu->RenderString(start_pos+4,EPG_INFO_WINDOW_POS+5, width+5, m_infoBoxTitle.c_str(), CLCDDisplay::PIXEL_ON); } // paint info @@ -1210,7 +1210,7 @@ void CLCD::showInfoBox(const char * const title, const char * const text ,int au pos++; } //printf("[lcdd] line %d:'%s'\r\n",line,text_line.c_str()); - fonts.menu->RenderString(EPG_INFO_TEXT_POS+1,EPG_INFO_TEXT_POS+(line*EPG_INFO_FONT_HEIGHT)+EPG_INFO_FONT_HEIGHT+3, EPG_INFO_TEXT_WIDTH, text_line.c_str(), CLCDDisplay::PIXEL_ON, 0, true); // UTF-8 + fonts.menu->RenderString(EPG_INFO_TEXT_POS+1,EPG_INFO_TEXT_POS+(line*EPG_INFO_FONT_HEIGHT)+EPG_INFO_FONT_HEIGHT+3, EPG_INFO_TEXT_WIDTH, text_line.c_str(), CLCDDisplay::PIXEL_ON); if ( m_infoBoxText[pos] == '\n' ) pos++; // remove new line } @@ -1355,7 +1355,7 @@ void CLCD::showProgressBar(int global, const char * const text,int show_escape,i if(width > 100) width = 100; int start_pos = (LCD_COLS - width) /2; - fonts.menu->RenderString(start_pos, 12+12, width+10, m_progressHeaderGlobal.c_str(), CLCDDisplay::PIXEL_ON,0,true); + fonts.menu->RenderString(start_pos, 12+12, width+10, m_progressHeaderGlobal.c_str(), CLCDDisplay::PIXEL_ON); // paint global bar int marker_length = (PROG_GLOB_POS_WIDTH * m_progressGlobal)/100; @@ -1425,7 +1425,7 @@ void CLCD::showProgressBar2(int local,const char * const text_local ,int global if(width > 100) width = 100; int start_pos = (LCD_COLS - width) /2; - fonts.menu->RenderString(start_pos, PROG2_GLOB_POS_Y+20, width+10, m_progressHeaderGlobal.c_str(), CLCDDisplay::PIXEL_ON,0,true); + fonts.menu->RenderString(start_pos, PROG2_GLOB_POS_Y+20, width+10, m_progressHeaderGlobal.c_str(), CLCDDisplay::PIXEL_ON); // paint global bar int marker_length = (PROG2_GLOB_POS_WIDTH * m_progressGlobal)/100; @@ -1439,7 +1439,7 @@ void CLCD::showProgressBar2(int local,const char * const text_local ,int global if(width > 100) width = 100; start_pos = (LCD_COLS - width) /2; - fonts.menu->RenderString(start_pos, PROG2_LOCAL_POS_Y -3, width+10, m_progressHeaderLocal.c_str(), CLCDDisplay::PIXEL_ON,0,true); + fonts.menu->RenderString(start_pos, PROG2_LOCAL_POS_Y -3, width+10, m_progressHeaderLocal.c_str(), CLCDDisplay::PIXEL_ON); // paint local bar marker_length = (PROG2_LOCAL_POS_WIDTH * m_progressLocal)/100; diff --git a/src/driver/vfd.cpp b/src/driver/vfd.cpp index b0bcd6d58..b290cd96d 100644 --- a/src/driver/vfd.cpp +++ b/src/driver/vfd.cpp @@ -437,9 +437,9 @@ printf("CVFD::showAudioTrack: %s\n", title.c_str()); wake_up(); #ifdef HAVE_LCD - fonts.menu->RenderString(0,22, 125, artist.c_str() , CLCDDisplay::PIXEL_ON, 0, true); // UTF-8 - fonts.menu->RenderString(0,35, 125, album.c_str() , CLCDDisplay::PIXEL_ON, 0, true); // UTF-8 - fonts.menu->RenderString(0,48, 125, title.c_str() , CLCDDisplay::PIXEL_ON, 0, true); // UTF-8 + fonts.menu->RenderString(0,22, 125, artist.c_str() , CLCDDisplay::PIXEL_ON); + fonts.menu->RenderString(0,35, 125, album.c_str() , CLCDDisplay::PIXEL_ON); + fonts.menu->RenderString(0,48, 125, title.c_str() , CLCDDisplay::PIXEL_ON); #endif } @@ -541,7 +541,7 @@ void CVFD::setMode(const MODES m, const char * const title) break; case MODE_MENU_UTF8: showclock = false; - //fonts.menutitle->RenderString(0,28, 140, title, CLCDDisplay::PIXEL_ON, 0, true); // UTF-8 + //fonts.menutitle->RenderString(0,28, 140, title, CLCDDisplay::PIXEL_ON); break; case MODE_SHUTDOWN: showclock = false; @@ -773,7 +773,7 @@ void CVFD::showInfoBox(const char * const title, const char * const text ,int au width = 100; int start_pos = (120-width) /2; display.draw_fill_rect (start_pos, EPG_INFO_WINDOW_POS-4, start_pos+width+5, EPG_INFO_WINDOW_POS+10, CLCDDisplay::PIXEL_OFF); - fonts.menu->RenderString(start_pos+4,EPG_INFO_WINDOW_POS+5, width+5, m_infoBoxTitle.c_str(), CLCDDisplay::PIXEL_ON, 0, true); // UTF-8 + fonts.menu->RenderString(start_pos+4,EPG_INFO_WINDOW_POS+5, width+5, m_infoBoxTitle.c_str(), CLCDDisplay::PIXEL_ON); } // paint info @@ -793,7 +793,7 @@ void CVFD::showInfoBox(const char * const title, const char * const text ,int au pos++; } //printf("[lcdd] line %d:'%s'\r\n",line,text_line.c_str()); - fonts.menu->RenderString(EPG_INFO_TEXT_POS+1,EPG_INFO_TEXT_POS+(line*EPG_INFO_FONT_HEIGHT)+EPG_INFO_FONT_HEIGHT+3, EPG_INFO_TEXT_WIDTH, text_line.c_str(), CLCDDisplay::PIXEL_ON, 0, true); // UTF-8 + fonts.menu->RenderString(EPG_INFO_TEXT_POS+1,EPG_INFO_TEXT_POS+(line*EPG_INFO_FONT_HEIGHT)+EPG_INFO_FONT_HEIGHT+3, EPG_INFO_TEXT_WIDTH, text_line.c_str(), CLCDDisplay::PIXEL_ON); if ( m_infoBoxText[pos] == '\n' ) pos++; // remove new line } @@ -944,7 +944,7 @@ void CVFD::showProgressBar(int global, const char * const text,int show_escape,i if(width > 100) width = 100; int start_pos = (120-width) /2; - fonts.menu->RenderString(start_pos, 12+12, width+10, m_progressHeaderGlobal.c_str(), CLCDDisplay::PIXEL_ON,0,true); + fonts.menu->RenderString(start_pos, 12+12, width+10, m_progressHeaderGlobal.c_str(), CLCDDisplay::PIXEL_ON); // paint global bar int marker_length = (PROG_GLOB_POS_WIDTH * m_progressGlobal)/100; @@ -1015,7 +1015,7 @@ void CVFD::showProgressBar2(int local,const char * const text_local ,int global if(width > 100) width = 100; int start_pos = (120-width) /2; - fonts.menu->RenderString(start_pos, PROG2_GLOB_POS_Y-3, width+10, m_progressHeaderGlobal.c_str(), CLCDDisplay::PIXEL_ON,0,true); + fonts.menu->RenderString(start_pos, PROG2_GLOB_POS_Y-3, width+10, m_progressHeaderGlobal.c_str(), CLCDDisplay::PIXEL_ON); // paint global bar int marker_length = (PROG2_GLOB_POS_WIDTH * m_progressGlobal)/100; @@ -1028,7 +1028,7 @@ void CVFD::showProgressBar2(int local,const char * const text_local ,int global if(width > 100) width = 100; start_pos = (120-width) /2; - fonts.menu->RenderString(start_pos, PROG2_LOCAL_POS_Y + PROG2_LOCAL_POS_HEIGTH +10 , width+10, m_progressHeaderLocal.c_str(), CLCDDisplay::PIXEL_ON,0,true); + fonts.menu->RenderString(start_pos, PROG2_LOCAL_POS_Y + PROG2_LOCAL_POS_HEIGTH +10 , width+10, m_progressHeaderLocal.c_str(), CLCDDisplay::PIXEL_ON); // paint local bar marker_length = (PROG2_LOCAL_POS_WIDTH * m_progressLocal)/100; diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 3b37773aa..1c55c85d8 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -785,7 +785,7 @@ int CAudioPlayerGui::show() m_frameBuffer->paintBoxRel(x1 - 7, y1 - h - 5, w + 14, h + 10, COL_MENUCONTENT_PLUS_6, RADIUS_SMALL); m_frameBuffer->paintBoxRel(x1 - 4, y1 - h - 3, w + 8, h + 6, COL_MENUCONTENTSELECTED_PLUS_0, RADIUS_SMALL); g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP] - ->RenderString(x1,y1,w+1,selectedKey,COL_MENUCONTENTSELECTED_TEXT,0); + ->RenderString(x1,y1,w+1,selectedKey,COL_MENUCONTENTSELECTED_TEXT); g_RCInput->getMsg_ms(&msg, &data, AUDIOPLAYERGUI_SMSKEY_TIMEOUT - 200); @@ -1561,7 +1561,7 @@ void CAudioPlayerGui::paintItem(int pos) m_playlist[pos + m_liststart].MetaData.total_time % 60); int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(dura) + 5; g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + 10, ypos + m_fheight, m_width - 30 - w, - tmp, color, m_fheight, true); // UTF-8 + tmp, color, m_fheight); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + m_width - 15 - w, ypos + m_fheight, w, dura, color, m_fheight); if ((pos + m_liststart) == m_selected) @@ -1758,7 +1758,7 @@ void CAudioPlayerGui::paintInfo() if (xstart < 10) xstart = 10; g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 1*m_fheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8 + tmp, COL_MENUCONTENTSELECTED_TEXT); // second line (Artist/Title...) GetMetaData(m_curr_audiofile); @@ -1783,7 +1783,7 @@ void CAudioPlayerGui::paintInfo() xstart=(m_width-w)/2; if (xstart < 10) xstart=10; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x+xstart, m_y +4+ 2*m_fheight, m_width- 20, tmp, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x+xstart, m_y +4+ 2*m_fheight, m_width- 20, tmp, COL_MENUCONTENTSELECTED_TEXT); // reset so fields get painted always m_metainfo.clear(); @@ -1860,7 +1860,7 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos) ibox->paint(false); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + 10, ypos2 + 2 + 1*m_fheight, m_width- 80, - m_playlist[m_selected].MetaData.title, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8 + m_playlist[m_selected].MetaData.title, COL_MENUCONTENTDARK_TEXT); std::string tmp; if (m_playlist[m_selected].MetaData.genre.empty()) tmp = m_playlist[m_selected].MetaData.date; @@ -1874,7 +1874,7 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos) } int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp) + 10; g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + m_width - w - 5, ypos2 + 2 + 1*m_fheight, - w, tmp, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8 + w, tmp, COL_MENUCONTENTDARK_TEXT); tmp = m_playlist[m_selected].MetaData.artist; if (!(m_playlist[m_selected].MetaData.album.empty())) { @@ -1883,7 +1883,7 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos) tmp += ')'; } g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + 10, ypos2 + 2*m_fheight - 2, m_width - 20, - tmp, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8 + tmp, COL_MENUCONTENTDARK_TEXT); } else { @@ -2292,7 +2292,7 @@ bool CAudioPlayerGui::getNumericInput(neutrino_msg_t& msg, int& val) { int h = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getHeight(); m_frameBuffer->paintBoxRel(x1 - 7, y1 - h - 5, w + 14, h + 10, COL_MENUCONTENT_PLUS_6); m_frameBuffer->paintBoxRel(x1 - 4, y1 - h - 3, w + 8, h + 6, COL_MENUCONTENTSELECTED_PLUS_0); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->RenderString(x1, y1, w + 1, str, COL_MENUCONTENTSELECTED_TEXT, 0); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->RenderString(x1, y1, w + 1, str, COL_MENUCONTENTSELECTED_TEXT); while (true) { g_RCInput->getMsg(&msg, &data, 100); diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index effe45515..63fbfe15d 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -103,7 +103,7 @@ void CBEBouquetWidget::paintItem(int pos) if ((*Bouquets)[current]->bHidden) frameBuffer->paintIcon(NEUTRINO_ICON_HIDDEN, x + 10, ypos, iheight); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+iconoffset+20, ypos + iheight - (iheight-fheight)/2, width-iconoffset-20, (*Bouquets)[current]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : (*Bouquets)[current]->Name, color, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+iconoffset+20, ypos + iheight - (iheight-fheight)/2, width-iconoffset-20, (*Bouquets)[current]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : (*Bouquets)[current]->Name, color); } } diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index ddffb1893..6e304a261 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -128,9 +128,9 @@ void CBEChannelWidget::paintItem(int pos) } if(current < Channels->size()) { - //g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10, ypos+ fheight, width- numwidth- 20- 15, (*Channels)[current]->getName(), color, 0, true); + //g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10, ypos+ fheight, width- numwidth- 20- 15, (*Channels)[current]->getName(), color); //FIXME numwidth ? we not show chan numbers - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 20 + iconoffset, ypos + iheight - (iheight-fheight)/2, width- iconoffset- 20, (*Channels)[current]->getName(), color, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 20 + iconoffset, ypos + iheight - (iheight-fheight)/2, width- iconoffset- 20, (*Channels)[current]->getName(), color); if((*Channels)[current]->scrambled) frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, x+width- 15 - 28, ypos, fheight); diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index 9b48eadcd..eaf4da5e5 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -139,8 +139,8 @@ void CBEChannelSelectWidget::paintItem(uint32_t itemNr, int paintNr, bool pselec //frameBuffer->paintBoxRel(x+8, ypos+4, NEUTRINO_ICON_BUTTON_GREEN_WIDTH, fheight-4, bgcolor); frameBuffer->paintBoxRel(x+10, ypos, iconoffset, iheight, bgcolor); } - //g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 8 + NEUTRINO_ICON_BUTTON_GREEN_WIDTH + 8, ypos+ fheight, width - (8 + NEUTRINO_ICON_BUTTON_GREEN_WIDTH + 8 + 8), Channels[itemNr]->getName(), color, 0, true); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 20 + iconoffset, ypos + iheight - (iheight-fheight)/2, width - 20 - iconoffset, Channels[itemNr]->getName(), color, 0, true); + //g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 8 + NEUTRINO_ICON_BUTTON_GREEN_WIDTH + 8, ypos+ fheight, width - (8 + NEUTRINO_ICON_BUTTON_GREEN_WIDTH + 8 + 8), Channels[itemNr]->getName(), color); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 20 + iconoffset, ypos + iheight - (iheight-fheight)/2, width - 20 - iconoffset, Channels[itemNr]->getName(), color); if(Channels[itemNr]->scrambled) frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, x+width- 15 - 28, ypos, fheight); } @@ -253,10 +253,10 @@ void CBEChannelSelectWidget::paintFoot() ::paintButtons(x, y + (height-footerHeight), width, numbuttons, Button, width, footerHeight); #if 0 frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 3* ButtonWidth+ 8, y+height+1); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 3* ButtonWidth+ 38, y+height+24 - 2, width, g_Locale->getText(LOCALE_BOUQUETEDITOR_SWITCH), COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 3* ButtonWidth+ 38, y+height+24 - 2, width, g_Locale->getText(LOCALE_BOUQUETEDITOR_SWITCH), COL_INFOBAR_TEXT); frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HOME, x+width - ButtonWidth+ 8, y+height+1); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width - ButtonWidth+ 38, y+height+24 - 2, width, g_Locale->getText(LOCALE_BOUQUETEDITOR_RETURN), COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width - ButtonWidth+ 38, y+height+24 - 2, width, g_Locale->getText(LOCALE_BOUQUETEDITOR_RETURN), COL_INFOBAR_TEXT); #endif } diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index 89ee000c6..06712d614 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -379,8 +379,8 @@ void CBookmarkManager::paintItem(int pos) if (liststart+posRenderString(x+10,ypos+fheight, real_width-10, theBookmark.getName(), color, fheight, true); // UTF-8 - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+2*fheight, real_width-10, theBookmark.getUrl(), color, fheight, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+fheight, real_width-10, theBookmark.getName(), color, fheight); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+2*fheight, real_width-10, theBookmark.getUrl(), color, fheight); // LCD Display if (liststart+pos==selected) @@ -424,14 +424,14 @@ void CBookmarkManager::paintFoot() if (bookmarks.empty()) { frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 1* ButtonWidth + 10, y+height); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width-1 * ButtonWidth + 38, y+height+footerHeight - 2, ButtonWidth- 28, g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width-1 * ButtonWidth + 38, y+height+footerHeight - 2, ButtonWidth- 28, g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), COL_INFOBAR_TEXT); } else { ::paintButtons(x + 10, y + height + 4, width, 2, BookmarkmanagerButtons, footerHeight, ButtonWidth); frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 1* ButtonWidth + 10, y+height); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width-1 * ButtonWidth + 38, y+height+footerHeight - 2, ButtonWidth- 28, g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width-1 * ButtonWidth + 38, y+height+footerHeight - 2, ButtonWidth- 28, g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), COL_INFOBAR_TEXT); } } diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index af02b9560..dc5cae9aa 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -628,7 +628,7 @@ void CBouquetList::paintItem(int pos) int numpos = x+5+numwidth- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(tmp); g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(numpos,ypos+fheight, numwidth+5, tmp, color, fheight); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10, ypos+ fheight, width- numwidth- 20- 15 - iw, lname, color, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10, ypos+ fheight, width- numwidth- 20- 15 - iw, lname, color); //CVFD::getInstance()->showMenuText(0, bouq->channelList->getName(), -1, true); } } diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index fb997ae7a..1681dd831 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1673,7 +1673,7 @@ void CChannelList::paintDetails(int index) text3= text3+ " - "; xstart += g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text3); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2* fheight, full_width - 30- noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2* fheight, full_width - 30- noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); } if (!(text2.empty())) { @@ -1690,12 +1690,12 @@ void CChannelList::paintDetails(int index) } } #endif - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, y+ height+ 5+ fdescrheight+ fheight, full_width- xstart- 30- noch_len, text2, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, y+ height+ 5+ fdescrheight+ fheight, full_width- xstart- 30- noch_len, text2, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); } - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight, full_width - 30 - seit_len, text1, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- seit_len, y+ height+ 5+ fheight, seit_len, cSeit, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8 - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- noch_len, y+ height+ 5+ fdescrheight+ fheight, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight, full_width - 30 - seit_len, text1, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- seit_len, y+ height+ 5+ fheight, seit_len, cSeit, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- noch_len, y+ height+ 5+ fdescrheight+ fheight, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); } if(g_settings.channellist_foot == 0) { transponder t; @@ -1707,7 +1707,7 @@ void CChannelList::paintDetails(int index) else desc = desc + " (" + CServiceManager::getInstance()->GetSatelliteName(chanlist[index]->getSatellitePosition()) + ")"; - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2*fheight +fdescrheight, full_width - 30, desc.c_str(), COL_MENUCONTENTDARK_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2*fheight +fdescrheight, full_width - 30, desc.c_str(), COL_MENUCONTENTDARK_TEXT); } else if( !displayNext && g_settings.channellist_foot == 1) { // next Event @@ -1721,8 +1721,8 @@ void CChannelList::paintDetails(int index) snprintf(buf, sizeof(buf), "%s", CurrentNext.next_name.c_str()); int from_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cFrom); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2*fheight+ fdescrheight, full_width - 30 - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_TEXT :COL_MENUCONTENTDARK_TEXT, 0, true); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- from_len, y+ height+ 5+ 2*fheight+ fdescrheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2*fheight+ fdescrheight, full_width - 30 - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_TEXT :COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- from_len, y+ height+ 5+ 2*fheight+ fdescrheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); } } if ((g_settings.channellist_additional) && (p_event != NULL)) @@ -2054,8 +2054,8 @@ void CChannelList::paintItem(int pos, const bool firstpaint) struct tm *pStartZeit = localtime(&p_event->startTime); snprintf((char*) tmp, sizeof(tmp), "%02d:%02d", pStartZeit->tm_hour, pStartZeit->tm_min); -// g_Font[SNeutrinoSettings::FONT_TYPE_IMAGEINFO_SMALL]->RenderString(x+ 5+ numwidth+ 6, ypos+ xtheight, width- numwidth- 20- 15 -poffs, tmp, COL_MENUCONTENT_TEXT, 0, true); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x+ 5+ numwidth+ 6, ypos+ xtheight, width- numwidth- 20- 15 -prg_offset, tmp, tcolor, 0, true); +// g_Font[SNeutrinoSettings::FONT_TYPE_IMAGEINFO_SMALL]->RenderString(x+ 5+ numwidth+ 6, ypos+ xtheight, width- numwidth- 20- 15 -poffs, tmp, COL_MENUCONTENT_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x+ 5+ numwidth+ 6, ypos+ xtheight, width- numwidth- 20- 15 -prg_offset, tmp, tcolor); } else { @@ -2082,14 +2082,14 @@ void CChannelList::paintItem(int pos, const bool firstpaint) } } - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10+prg_offset, ypos+ fheight, width- numwidth- 40- 15-prg_offset, nameAndDescription, color, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10+prg_offset, ypos+ fheight, width- numwidth- 40- 15-prg_offset, nameAndDescription, color); if (g_settings.channellist_epgtext_align_right) { // align right - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - 20 - ch_desc_len - icon_space - 4, ypos + fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED_TEXT:(!displayNext ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT) , 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - 20 - ch_desc_len - icon_space - 4, ypos + fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED_TEXT:(!displayNext ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT)); } else { // align left - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ 5+ numwidth+ 10+ ch_name_len+ 5+prg_offset, ypos+ fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED_TEXT:(!displayNext ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT) , 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ 5+ numwidth+ 10+ ch_name_len+ 5+prg_offset, ypos+ fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED_TEXT:(!displayNext ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT)); } } else { @@ -2103,7 +2103,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint) pb.paint(); } //name - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10+prg_offset, ypos+ fheight, width- numwidth- 40- 15-prg_offset, nameAndDescription, color, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10+prg_offset, ypos+ fheight, width- numwidth- 40- 15-prg_offset, nameAndDescription, color); } if (curr == selected) { if (!(chan->currentEvent.description.empty())) { @@ -2320,9 +2320,9 @@ void CChannelList::paint_events(int index) strftime(startTime, sizeof(startTime), "%H:%M", tmStartZeit ); //printf("%s %s\n", startTime, e->description.c_str()); startTimeWidth = eventStartTimeWidth; - g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, startTimeWidth, startTime, color, 0, true); + g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, startTimeWidth, startTime, color); } - g_Font[eventFont]->RenderString(x+ width+5+startTimeWidth, y+ theight+ pig_height + i*ffheight, infozone_width - startTimeWidth - 20, e->description, color, 0, true); + g_Font[eventFont]->RenderString(x+ width+5+startTimeWidth, y+ theight+ pig_height + i*ffheight, infozone_width - startTimeWidth - 20, e->description, color); } else { @@ -2373,7 +2373,7 @@ void CChannelList::showdescription(int index) frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0); for (int i = 1; (i < (int)epgText.size()+1) && ((y+ theight+ pig_height + i*ffheight) < (y+ theight+ pig_height + infozone_height)); i++) - g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, infozone_width - 20, epgText[i-1].first, COL_MENUCONTENTDARK_TEXT, 0, true); + g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, infozone_width - 20, epgText[i-1].first, COL_MENUCONTENTDARK_TEXT); } void CChannelList::addTextToArray(const std::string & text, int screening) // UTF-8 diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 04ca01923..ae0ff408d 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -173,7 +173,7 @@ void EpgPlus::TimeLine::paint (time_t startTime, int pduration) , toggleColor ? COL_MENUCONTENT_PLUS_2 : COL_MENUCONTENT_PLUS_1); this->fontDate->RenderString (this->x + 4, this->y + this->fontDate->getHeight() - , this->width, EpgPlus::getTimeString (startTime, "%d-%b") , COL_MENUCONTENT_TEXT, 0, true); // UTF-8 + , this->width, EpgPlus::getTimeString (startTime, "%d-%b") , COL_MENUCONTENT_TEXT); // paint ticks for (int i = 0; i < numberOfTicks; ++i, xPos += tickDist, tickTime += pduration / numberOfTicks) { @@ -189,12 +189,12 @@ void EpgPlus::TimeLine::paint (time_t startTime, int pduration) int textWidth = this->fontTime->getRenderWidth (timeStr); this->fontTime->RenderString (xPos - textWidth - 4, this->y + this->fontTime->getHeight() - , textWidth, timeStr, toggleColor ? COL_MENUCONTENT_P1 : COL_MENUCONTENT_P2, 0, true); // UTF-8 + , textWidth, timeStr, toggleColor ? COL_MENUCONTENT_P1 : COL_MENUCONTENT_P2); timeStr = EpgPlus::getTimeString (tickTime, "%M"); textWidth = this->fontTime->getRenderWidth (timeStr); this->fontTime->RenderString (xPos + 4, this->y + this->fontTime->getHeight() - , textWidth, timeStr, toggleColor ? COL_MENUCONTENT_P1 : COL_MENUCONTENT_P2, 0, true); // UTF-8 + , textWidth, timeStr, toggleColor ? COL_MENUCONTENT_P1 : COL_MENUCONTENT_P2); toggleColor = !toggleColor; } @@ -226,7 +226,7 @@ void EpgPlus::TimeLine::paintMark (time_t startTime, int pduration, int px, int int textWidth = this->fontTime->getRenderWidth (timeStr); this->fontTime->RenderString (px - textWidth, this->y + this->fontTime->getHeight() + this->fontTime->getHeight() - , textWidth, timeStr, COL_MENUCONTENT_TEXT, 0, true); // UTF-8 + , textWidth, timeStr, COL_MENUCONTENT_TEXT); // display end time after mark timeStr = EpgPlus::getTimeString (startTime + pduration, "%H:%M"); @@ -234,10 +234,10 @@ void EpgPlus::TimeLine::paintMark (time_t startTime, int pduration, int px, int if (px + pwidth + textWidth < this->x + this->width) { this->fontTime->RenderString (px + pwidth, this->y + this->fontTime->getHeight() + this->fontTime->getHeight() - , textWidth, timeStr, COL_MENUCONTENT_TEXT, 0, true); // UTF-8 + , textWidth, timeStr, COL_MENUCONTENT_TEXT); } else if (textWidth < pwidth - 10) { this->fontTime->RenderString (px + pwidth - textWidth, this->y + this->fontTime->getHeight() + this->fontTime->getHeight() - , textWidth, timeStr, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8 + , textWidth, timeStr, COL_MENUCONTENTSELECTED_TEXT); } } @@ -291,8 +291,7 @@ void EpgPlus::ChannelEventEntry::paint (bool pisSelected, bool toggleColor) , this->channelEvent.description.empty()? COL_MENUCONTENT_PLUS_0 : (pisSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : (toggleColor ? COL_MENUCONTENT_PLUS_1 : COL_MENUCONTENT_PLUS_2))); this->font->RenderString (this->x + 2, this->y + this->font->getHeight() - , this->width - 4 > 0 ? this->width - 4 : 0, this->channelEvent.description, pisSelected ? COL_MENUCONTENTSELECTED_TEXT : (toggleColor ? COL_MENUCONTENT_P1 : COL_MENUCONTENT_P2) - , 0, true); + , this->width - 4 > 0 ? this->width - 4 : 0, this->channelEvent.description, pisSelected ? COL_MENUCONTENTSELECTED_TEXT : (toggleColor ? COL_MENUCONTENT_P1 : COL_MENUCONTENT_P2)); // paint the separation line if (separationLineHeight > 0) { @@ -368,7 +367,7 @@ void EpgPlus::ChannelEntry::paint (bool isSelected, time_t selectedTime) isSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : COL_MENUCONTENT_PLUS_0); this->font->RenderString (this->x + 2, this->y + this->font->getHeight(), - this->width - 4, this->displayName, isSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT, 0, true); + this->width - 4, this->displayName, isSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT); if (isSelected) { #if 0 @@ -469,7 +468,7 @@ void EpgPlus::Footer::paintEventDetails (const std::string & description, const yPos += height; // display new text - this->fontBouquetChannelName->RenderString (this->x + 10, yPos, this->width - 20, this->currentBouquetName + " : " + this->currentChannelName, COL_MENUHEAD_TEXT, 0, true); + this->fontBouquetChannelName->RenderString (this->x + 10, yPos, this->width - 20, this->currentBouquetName + " : " + this->currentChannelName, COL_MENUHEAD_TEXT); height = this->fontEventDescription->getHeight(); @@ -479,7 +478,7 @@ void EpgPlus::Footer::paintEventDetails (const std::string & description, const yPos += height; // display new text - this->fontEventDescription->RenderString (this->x + 10, yPos, this->width - 20, description, COL_MENUHEAD_TEXT, 0, true); + this->fontEventDescription->RenderString (this->x + 10, yPos, this->width - 20, description, COL_MENUHEAD_TEXT); height = this->fontEventShortDescription->getHeight(); @@ -489,7 +488,7 @@ void EpgPlus::Footer::paintEventDetails (const std::string & description, const yPos += height; // display new text - this->fontEventShortDescription->RenderString (this->x + 10, yPos, this->width - 20, shortDescription, COL_MENUHEAD_TEXT, 0, true); + this->fontEventShortDescription->RenderString (this->x + 10, yPos, this->width - 20, shortDescription, COL_MENUHEAD_TEXT); } struct button_label buttonLabels[] = { diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 6f0861e67..2b46adf58 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -251,7 +251,7 @@ void CEpgData::showText( int startPos, int ypos ) offset += digi; break; } - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10+offset, y+medlineheight, ox- 15- 15, epgText[i].first.substr(pos1, pos2 - pos1), (epgText[i].second==2)? COL_MENUCONTENTINACTIVE_TEXT: COL_MENUCONTENT_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10+offset, y+medlineheight, ox- 15- 15, epgText[i].first.substr(pos1, pos2 - pos1), (epgText[i].second==2)? COL_MENUCONTENTINACTIVE_TEXT: COL_MENUCONTENT_TEXT); count++; pos1 = epgText[i].first.find_first_not_of(tok, pos2); pos2 = epgText[i].first.find_first_of(tok, pos1); @@ -260,7 +260,7 @@ void CEpgData::showText( int startPos, int ypos ) count = 0; } else{ - g_Font[( i< info1_lines ) ?SNeutrinoSettings::FONT_TYPE_EPG_INFO1:SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10, y+medlineheight, ox- 15- 15, epgText[i].first, COL_MENUCONTENT_TEXT, 0, true); // UTF-8 + g_Font[( i< info1_lines ) ?SNeutrinoSettings::FONT_TYPE_EPG_INFO1:SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10, y+medlineheight, ox- 15- 15, epgText[i].first, COL_MENUCONTENT_TEXT); } } @@ -631,9 +631,9 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start g_PicViewer->DisplayImage(lname, sx+10, sy + (toph-logo_h)/2, logo_w, logo_h); //show the title - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->RenderString(sx+15 + pic_offx, sy + topheight+ 3, ox-15- pic_offx, text1, COL_MENUHEAD_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->RenderString(sx+15 + pic_offx, sy + topheight+ 3, ox-15- pic_offx, text1, COL_MENUHEAD_TEXT); if (!(text2.empty())) - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->RenderString(sx+15+ pic_offx, sy+ 2* topheight+ 3, ox-15 - pic_offx, text2, COL_MENUHEAD_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->RenderString(sx+15+ pic_offx, sy+ 2* topheight+ 3, ox-15 - pic_offx, text2, COL_MENUHEAD_TEXT); //show date-time.... frameBuffer->paintBoxRel(sx, sy+oy-botboxheight, ox, botboxheight, COL_MENUHEAD_PLUS_0); @@ -646,7 +646,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start widthl = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getRenderWidth(fromto); g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+40, sy+oy-3, widthl, fromto, COL_MENUHEAD_TEXT); widthr = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getRenderWidth(epg_date); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ox-40-widthr, sy+oy-3, widthr, epg_date, COL_MENUHEAD_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ox-40-widthr, sy+oy-3, widthr, epg_date, COL_MENUHEAD_TEXT); int showPos = 0; textCount = epgText.size(); @@ -1180,12 +1180,12 @@ void CEpgData::showTimerEventBar (bool pshow, bool webzap) { pos = 0; frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RED, x+8+cellwidth*pos, y+h_offset ); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+29+cellwidth*pos, y+h-h_offset, w-30, g_Locale->getText(LOCALE_TIMERBAR_RECORDEVENT), COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+29+cellwidth*pos, y+h-h_offset, w-30, g_Locale->getText(LOCALE_TIMERBAR_RECORDEVENT), COL_INFOBAR_TEXT); } // Button: Timer Channelswitch pos = 2; frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x+8+cellwidth*pos, y+h_offset ); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+29+cellwidth*pos, y+h-h_offset, w-30, g_Locale->getText(LOCALE_TIMERBAR_CHANNELSWITCH), COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+29+cellwidth*pos, y+h-h_offset, w-30, g_Locale->getText(LOCALE_TIMERBAR_CHANNELSWITCH), COL_INFOBAR_TEXT); #endif } diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 21f9b1b58..7a85ea989 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -767,7 +767,7 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI) // 1st line int fwidth1a=g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime1_str); - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5, ypos+ fheight1+3, fwidth1a, datetime1_str, color, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5, ypos+ fheight1+3, fwidth1a, datetime1_str, color); int seit = ( evtlist[curpos].startTime - time(NULL) ) / 60; if ( (seit> 0) && (seit<100) && (duration_str.length()!=0) ) @@ -775,9 +775,9 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI) char beginnt[100]; snprintf(beginnt, sizeof(beginnt), "%s %d %s", g_Locale->getText(LOCALE_WORD_IN), seit, unit_short_minute); int w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(beginnt) + 10; - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20- w, ypos+ fheight1+3, w, beginnt, color, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20- w, ypos+ fheight1+3, w, beginnt, color); } - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20, ypos+ fheight1+3, fwidth2, duration_str, color, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20, ypos+ fheight1+3, fwidth2, duration_str, color); // 2nd line // set status icons @@ -805,7 +805,7 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI) } // paint 2nd line text - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x+10+iw, ypos+ fheight, width- 25- 20 -iw, evtlist[curpos].description, color, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x+10+iw, ypos+ fheight, width- 25- 20 -iw, evtlist[curpos].description, color); } } @@ -867,9 +867,9 @@ void CNeutrinoEventList::paintHead(std::string _channelname, std::string _channe middle_offset = 0; } - g_Font[font_h]->RenderString(x+10,y+theight-pn_y_off+1, prev_len, _channelname_prev.c_str(), COL_INFOBAR_TEXT, 0, true); // UTF-8 - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->RenderString(x+prev_len+middle_offset,y+theight+1, middle_len, _channelname.c_str(), COL_MENUHEAD_TEXT, 0, true); // UTF-8 - g_Font[font_h]->RenderString(x+full_width-next_len-10,y+theight-pn_y_off+1, next_len, _channelname_next.c_str(), COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_h]->RenderString(x+10,y+theight-pn_y_off+1, prev_len, _channelname_prev.c_str(), COL_INFOBAR_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->RenderString(x+prev_len+middle_offset,y+theight+1, middle_len, _channelname.c_str(), COL_MENUHEAD_TEXT); + g_Font[font_h]->RenderString(x+full_width-next_len-10,y+theight-pn_y_off+1, next_len, _channelname_next.c_str(), COL_INFOBAR_TEXT); } @@ -888,7 +888,7 @@ void CNeutrinoEventList::paintHead(t_channel_id _channel_id, std::string _channe logo_ok = g_PicViewer->DisplayImage(lname, x+10, y+(theight-logo_h)/2, logo_w, logo_h); } else - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->RenderString(x+15+(logo_ok? 5+logo_w:0),y+theight+1, full_width, _channelname.c_str(), COL_MENUHEAD_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->RenderString(x+15+(logo_ok? 5+logo_w:0),y+theight+1, full_width, _channelname.c_str(), COL_MENUHEAD_TEXT); } void CNeutrinoEventList::paint(t_channel_id channel_id) diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 4ef5b2be3..28cfb31e3 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -1232,7 +1232,7 @@ void CFileBrowser::paintItem(unsigned int pos) } frameBuffer->paintIcon(fileicon, x+5 , ypos + (fheight-16) / 2 ); - fnt_item->RenderString(x + 35, ypos + fheight, colwidth1 - 10 , FILESYSTEM_ENCODING_TO_UTF8_STRING(actual_file->getFileName()), color, 0, true); // UTF-8 + fnt_item->RenderString(x + 35, ypos + fheight, colwidth1 - 10 , FILESYSTEM_ENCODING_TO_UTF8_STRING(actual_file->getFileName()), color); if( S_ISREG(actual_file->Mode) ) { @@ -1246,7 +1246,7 @@ void CFileBrowser::paintItem(unsigned int pos) } modestring[9] = 0; - fnt_item->RenderString(x + width - 25 - colwidth3 - colwidth2 , ypos+ fheight, colwidth2, modestring, color, 0, true); // UTF-8 + fnt_item->RenderString(x + width - 25 - colwidth3 - colwidth2 , ypos+ fheight, colwidth2, modestring, color); } #define GIGABYTE 1073741824LL @@ -1439,7 +1439,7 @@ void CFileBrowser::paintSMSKey() char cKey[2]={m_SMSKeyInput.getOldKey(),0}; cKey[0] = toupper(cKey[0]); int len = fnt_small->getRenderWidth(cKey); - fnt_small->RenderString(x + width - skwidth, y + height - foheight + (skheight/2), len, cKey, COL_MENUHEAD_TEXT, 0, true); + fnt_small->RenderString(x + width - skwidth, y + height - foheight + (skheight/2), len, cKey, COL_MENUHEAD_TEXT); } } diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 05dc0f640..59e808742 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -346,7 +346,7 @@ void CInfoViewer::showRecordIcon (const bool show) frameBuffer->paintBoxRel(box_posX, BoxStartY + box_posY , box_len, chanH, COL_INFOBAR_PLUS_0, radius); if (rec_mode != CRecordManager::RECMODE_TSHIFT) - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString (rec_icon_posX + rec_icon_w + icon_space, BoxStartY + box_posY + chanH, box_len, records_msg, COL_INFOBAR_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString (rec_icon_posX + rec_icon_w + icon_space, BoxStartY + box_posY + chanH, box_len, records_msg, COL_INFOBAR_TEXT); if (rec_mode == CRecordManager::RECMODE_REC) { @@ -530,7 +530,7 @@ void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channe if (g_settings.infobar_show_channellogo > 1) ChannelLogoMode = showChannelLogo(channel_id, 0); if (ChannelLogoMode == 0 || ChannelLogoMode == 3 || ChannelLogoMode == 4) - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString(ChanNameX + 10 , ChanNameY + time_height,BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 5 ,ChannelName, COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString(ChanNameX + 10 , ChanNameY + time_height,BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 5 ,ChannelName, COL_INFOBAR_TEXT); // show_Data if (CMoviePlayerGui::getInstance().file_prozent > 100) @@ -580,7 +580,7 @@ void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channe if (speed) { int sh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight(); int sy = BoxStartY + ChanHeight/2 - sh/2 + sh; - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(icon_x, sy, ChanHeight, runningRest, COL_INFOBAR_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(icon_x, sy, ChanHeight, runningRest, COL_INFOBAR_TEXT); icon_x += speedw; } frameBuffer->paintIcon(playicon, icon_x, icon_y); @@ -767,7 +767,7 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString( ChanNameX + 10 + ChanNumWidth, ChanNameY + time_height, BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 5 - ChanNumWidth, - ChannelName, color /*COL_INFOBAR_TEXT*/, 0, true); // UTF-8 + ChannelName, color /*COL_INFOBAR_TEXT*/); //provider name if(g_settings.infobar_show_channeldesc && pname){ std::string prov_name = pname; @@ -784,7 +784,7 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString( ChanNameX + 10 + ChanNumWidth + chname_width, tmpY, BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 5 - ChanNumWidth - chname_width, - prov_name, color /*COL_INFOBAR_TEXT*/, 0, true); // UTF-8 + prov_name, color /*COL_INFOBAR_TEXT*/); } } @@ -1054,15 +1054,15 @@ void CInfoViewer::showSubchan () lframeBuffer->paintBackgroundBoxRel (x + dx, y, borderwidth, dy); lframeBuffer->paintBoxRel (x, y, dx, dy, COL_MENUCONTENT_PLUS_0); - //g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (x + 10, y + 30, dx - 20, text, COL_MENUCONTENT_TEXT, 0, true); + //g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (x + 10, y + 30, dx - 20, text, COL_MENUCONTENT_TEXT); if (g_RemoteControl->director_mode) { lframeBuffer->paintIcon (NEUTRINO_ICON_BUTTON_YELLOW, x + 8, y + dy - 20); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString (x + 30, y + dy - 2, dx - 40, g_Locale->getText (LOCALE_NVODSELECTOR_DIRECTORMODE), COL_MENUCONTENT_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString (x + 30, y + dy - 2, dx - 40, g_Locale->getText (LOCALE_NVODSELECTOR_DIRECTORMODE), COL_MENUCONTENT_TEXT); int h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (x + 10, y + dy - h - 2, dx - 20, text, COL_MENUCONTENT_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (x + 10, y + dy - h - 2, dx - 20, text, COL_MENUCONTENT_TEXT); } else - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (x + 10, y + dy - 2, dx - 20, text, COL_MENUCONTENT_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (x + 10, y + dy - 2, dx - 20, text, COL_MENUCONTENT_TEXT); uint64_t timeoutEnd_tmp = CRCInput::calcTimeoutEnd (2); int res = messages_return::none; @@ -1153,7 +1153,7 @@ void CInfoViewer::showRadiotext() // shadow frameBuffer->paintBoxRel(rt_x+SHADOW_OFFSET, rt_y+SHADOW_OFFSET, rt_dx, rt_dy, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_TOP); frameBuffer->paintBoxRel(rt_x, rt_y, rt_dx, rt_dy, COL_INFOBAR_PLUS_0, RADIUS_LARGE, CORNER_TOP); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rt_x+10, rt_y+ 30, rt_dx-20, stext[0], COL_INFOBAR_TEXT, 0, RTisIsUTF); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rt_x+10, rt_y+ 30, rt_dx-20, stext[0], COL_INFOBAR_TEXT, 0, RTisIsUTF); } // yoff = 17; ii = 1; @@ -1190,15 +1190,15 @@ void CInfoViewer::showRadiotext() int rts_dx = rt_dx-20; if (g_Radiotext->S_RtOsdLoop == 1) { // latest bottom for (int i = ind+1; i < g_Radiotext->S_RtOsdRows; i++) - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rts_x, rts_y + (ii++)*rt_dy, rts_dx, g_Radiotext->RT_Text[i], COL_INFOBAR_TEXT, 0, RTisIsUTF); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rts_x, rts_y + (ii++)*rt_dy, rts_dx, g_Radiotext->RT_Text[i], COL_INFOBAR_TEXT, 0, RTisIsUTF); for (int i = 0; i <= ind; i++) - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rts_x, rts_y + (ii++)*rt_dy, rts_dx, g_Radiotext->RT_Text[i], COL_INFOBAR_TEXT, 0, RTisIsUTF); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rts_x, rts_y + (ii++)*rt_dy, rts_dx, g_Radiotext->RT_Text[i], COL_INFOBAR_TEXT, 0, RTisIsUTF); } else { // latest top for (int i = ind; i >= 0; i--) - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rts_x, rts_y + (ii++)*rt_dy, rts_dx, g_Radiotext->RT_Text[i], COL_INFOBAR_TEXT, 0, RTisIsUTF); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rts_x, rts_y + (ii++)*rt_dy, rts_dx, g_Radiotext->RT_Text[i], COL_INFOBAR_TEXT, 0, RTisIsUTF); for (int i = g_Radiotext->S_RtOsdRows-1; i > ind; i--) - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rts_x, rts_y + (ii++)*rt_dy, rts_dx, g_Radiotext->RT_Text[i], COL_INFOBAR_TEXT, 0, RTisIsUTF); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rts_x, rts_y + (ii++)*rt_dy, rts_dx, g_Radiotext->RT_Text[i], COL_INFOBAR_TEXT, 0, RTisIsUTF); } } #if 0 @@ -1788,7 +1788,7 @@ void CInfoViewer::show_Data (bool calledFromEvent) // no EPG available ChanInfoY += height; frameBuffer->paintBox (ChanInfoX + 10, ChanInfoY, BoxEndX, ChanInfoY + height, COL_INFOBAR_PLUS_0); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (BoxStartX + ChanWidth + 20, ChanInfoY + height, BoxEndX - (BoxStartX + ChanWidth + 20), g_Locale->getText (gotTime ? LOCALE_INFOVIEWER_NOEPG : LOCALE_INFOVIEWER_WAITTIME), COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (BoxStartX + ChanWidth + 20, ChanInfoY + height, BoxEndX - (BoxStartX + ChanWidth + 20), g_Locale->getText (gotTime ? LOCALE_INFOVIEWER_NOEPG : LOCALE_INFOVIEWER_WAITTIME), COL_INFOBAR_TEXT); } else { // irgendein EPG gefunden int duration1Width = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth (runningRest); @@ -1800,7 +1800,7 @@ void CInfoViewer::show_Data (bool calledFromEvent) if ((info_CurrentNext.flags & CSectionsdClient::epgflags::has_next) && (!(info_CurrentNext.flags & CSectionsdClient::epgflags::has_current))) { // there are later events available - yet no current frameBuffer->paintBox (ChanInfoX + 10, ChanInfoY, BoxEndX, ChanInfoY + height, COL_INFOBAR_PLUS_0); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (xStart, ChanInfoY + height, BoxEndX - xStart, g_Locale->getText (LOCALE_INFOVIEWER_NOCURRENT), COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (xStart, ChanInfoY + height, BoxEndX - xStart, g_Locale->getText (LOCALE_INFOVIEWER_NOCURRENT), COL_INFOBAR_TEXT); ChanInfoY += height; @@ -1810,7 +1810,7 @@ void CInfoViewer::show_Data (bool calledFromEvent) if (last_next_id != info_CurrentNext.next_uniqueKey) { frameBuffer->paintBox (ChanInfoX + 10, ChanInfoY, BoxEndX, ChanInfoY + height, COL_INFOBAR_PLUS_0); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (ChanInfoX + 10, ChanInfoY + height, 100, nextStart, COL_INFOBAR_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (xStart, ChanInfoY + height, duration2TextPos - xStart - 5, info_CurrentNext.next_name, COL_INFOBAR_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (xStart, ChanInfoY + height, duration2TextPos - xStart - 5, info_CurrentNext.next_name, COL_INFOBAR_TEXT); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (duration2TextPos, ChanInfoY + height, duration2Width, nextDuration, COL_INFOBAR_TEXT); last_next_id = info_CurrentNext.next_uniqueKey; } @@ -1818,7 +1818,7 @@ void CInfoViewer::show_Data (bool calledFromEvent) if (last_curr_id != info_CurrentNext.current_uniqueKey) { frameBuffer->paintBox (ChanInfoX + 10, ChanInfoY, BoxEndX, ChanInfoY + height, COL_INFOBAR_PLUS_0); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (ChanInfoX + 10, ChanInfoY + height, 100, runningStart, COL_INFOBAR_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (xStart, ChanInfoY + height, duration1TextPos - xStart - 5, info_CurrentNext.current_name, COL_INFOBAR_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (xStart, ChanInfoY + height, duration1TextPos - xStart - 5, info_CurrentNext.current_name, COL_INFOBAR_TEXT); last_curr_id = info_CurrentNext.current_uniqueKey; } @@ -1834,7 +1834,7 @@ void CInfoViewer::show_Data (bool calledFromEvent) if (last_next_id != info_CurrentNext.next_uniqueKey) { frameBuffer->paintBox (ChanInfoX + 10, ChanInfoY, BoxEndX, ChanInfoY + height, COL_INFOBAR_PLUS_0); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (ChanInfoX + 10, ChanInfoY + height, 100, nextStart, COL_INFOBAR_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (xStart, ChanInfoY + height, duration2TextPos - xStart - 5, info_CurrentNext.next_name, COL_INFOBAR_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (xStart, ChanInfoY + height, duration2TextPos - xStart - 5, info_CurrentNext.next_name, COL_INFOBAR_TEXT); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (duration2TextPos, ChanInfoY + height, duration2Width, nextDuration, COL_INFOBAR_TEXT); last_next_id = info_CurrentNext.next_uniqueKey; } diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index fbb15043c..c374ca78f 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -383,7 +383,7 @@ void CInfoViewerBB::showBBButtons(const int modus) frameBuffer->paintIcon(bbButtonInfo[i].icon, bbButtonInfo[i].x, BBarY, InfoHeightY_Info); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(bbButtonInfo[i].x + bbButtonInfo[i].cx, BBarFontY, - bbButtonInfo[i].w - bbButtonInfo[i].cx, bbButtonInfo[i].text, COL_INFOBAR_TEXT, 0, true); // UTF-8 + bbButtonInfo[i].w - bbButtonInfo[i].cx, bbButtonInfo[i].text, COL_INFOBAR_TEXT); } } diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 6afbe45c4..bd1047d00 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -616,7 +616,7 @@ int CLuaInstance::RenderString(lua_State *L) if ((c & MAGIC_MASK) == MAGIC_COLOR) c = CFrameBuffer::getInstance()->realcolor[c & 0x000000ff]; if (boxh > -1) /* if boxh < 0, don't paint string */ - W->fbwin->RenderString(g_Font[f], x, y, w, text, c, boxh, true); + W->fbwin->RenderString(g_Font[f], x, y, w, text, c, boxh); lua_pushinteger(L, rwidth); /* return renderwidth */ return 1; } diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index a61b120e5..8bad63512 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -358,19 +358,19 @@ void CMotorControl::paintLine(int px, int *py, int pwidth, const char *txt) { frameBuffer->paintBoxRel(px, *py, pwidth, mheight, COL_MENUCONTENT_PLUS_0); *py += mheight; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px, *py, pwidth, txt, COL_MENUCONTENT_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px, *py, pwidth, txt, COL_MENUCONTENT_TEXT); } void CMotorControl::paintLine(int px, int py, int pwidth, const char *txt) { - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px, py, pwidth, txt, COL_MENUCONTENT_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px, py, pwidth, txt, COL_MENUCONTENT_TEXT); } void CMotorControl::paintLine(int ix, int tx, int *py, int pwidth, const char *icon, const char *txt) { frameBuffer->paintIcon(icon, ix, *py, mheight); *py += mheight; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(tx, *py, pwidth, txt, COL_MENUCONTENT_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(tx, *py, pwidth, txt, COL_MENUCONTENT_TEXT); } void CMotorControl::paintSeparator(int xpos, int *pypos, int pwidth, const char * /*txt*/) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index ec01a312e..35182a1b1 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1696,38 +1696,38 @@ void CMovieBrowser::refreshFoot(void) { m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_RED, &iw, &ih); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_RED, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight+ 6); - m_pcFontFoot->RenderString(xpos + xoff + iw, ypos_font, width - iw - 2*xoff, sort_text.c_str(), (CFBWindow::color_t)color, 0, true); // UTF-8 + m_pcFontFoot->RenderString(xpos + xoff + iw, ypos_font, width - iw - 2*xoff, sort_text.c_str(), (CFBWindow::color_t)color); xpos += width; m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_GREEN, &iw, &ih); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight+ 6); - m_pcFontFoot->RenderString(xpos + xoff + iw, ypos_font, width - iw - 2*xoff, filter_text.c_str(), (CFBWindow::color_t)color, 0, true); // UTF-8 + m_pcFontFoot->RenderString(xpos + xoff + iw, ypos_font, width - iw - 2*xoff, filter_text.c_str(), (CFBWindow::color_t)color); xpos += width; } m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_YELLOW, &iw, &ih); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight+ 6); - m_pcFontFoot->RenderString(xpos + xoff + iw, ypos_font, width - iw - 2*xoff, g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_FOCUS), (CFBWindow::color_t)color, 0, true); // UTF-8 + m_pcFontFoot->RenderString(xpos + xoff + iw, ypos_font, width - iw - 2*xoff, g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_FOCUS), (CFBWindow::color_t)color); xpos += width; m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_BLUE, &iw, &ih); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_BLUE, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight+ 6); - m_pcFontFoot->RenderString(xpos + xoff + iw, ypos_font, width - iw - 2*xoff, g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_REFRESH), (CFBWindow::color_t)color, 0, true); // UTF-8 + m_pcFontFoot->RenderString(xpos + xoff + iw, ypos_font, width - iw - 2*xoff, g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_REFRESH), (CFBWindow::color_t)color); xpos += width; m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_OKAY, &iw, &ih); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight+ 6); - m_pcFontFoot->RenderString(xpos + xoff + iw, ypos_font, width - iw - 2*xoff, ok_text.c_str(), (CFBWindow::color_t)color, 0, true); // UTF-8 + m_pcFontFoot->RenderString(xpos + xoff + iw, ypos_font, width - iw - 2*xoff, ok_text.c_str(), (CFBWindow::color_t)color); xpos += width; m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_SMALL, &iw, &ih); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight+ 6); - m_pcFontFoot->RenderString(xpos + xoff + iw , ypos_font, width - iw - 2*xoff, g_Locale->getText(LOCALE_FILEBROWSER_DELETE), (CFBWindow::color_t)color, 0, true); // UTF-8 + m_pcFontFoot->RenderString(xpos + xoff + iw , ypos_font, width - iw - 2*xoff, g_Locale->getText(LOCALE_FILEBROWSER_DELETE), (CFBWindow::color_t)color); xpos += width; m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_MENU_SMALL, &iw, &ih); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_MENU_SMALL, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight+ 6); - m_pcFontFoot->RenderString(xpos + xoff + iw , ypos_font, width - iw - 2*xoff, g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_OPTIONS), (CFBWindow::color_t)color, 0, true); // UTF-8 + m_pcFontFoot->RenderString(xpos + xoff + iw , ypos_font, width - iw - 2*xoff, g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_OPTIONS), (CFBWindow::color_t)color); } bool CMovieBrowser::onButtonPress(neutrino_msg_t msg) @@ -3910,7 +3910,7 @@ int CMenuSelector::paint(bool selected) frameBuffer->paintBoxRel(x, y, dx, height, bgcolor); int stringstartposName = x + offx + 10; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(stringstartposName, y+height,dx- (stringstartposName - x), optionName, color, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(stringstartposName, y+height,dx- (stringstartposName - x), optionName, color); if (selected) CVFD::getInstance()->showMenuText(0, optionName, -1, true); // UTF-8 diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 218d7ad45..c000cf9e0 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1618,7 +1618,7 @@ void CMoviePlayerGui::showSubtitle(neutrino_msg_data_t data) frameBuffer->paintBoxRel(min_x, min_y, max_x - min_x, max_y-min_y, COL_MENUCONTENT_PLUS_0); for (unsigned i = 0; i < subtext.size(); i++) - g_Font[SNeutrinoSettings::FONT_TYPE_SUBTITLES]->RenderString(x[i], y[i], sw, subtext[i].c_str(), COL_MENUCONTENT_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_SUBTITLES]->RenderString(x[i], y[i], sw, subtext[i].c_str(), COL_MENUCONTENT_TEXT); end_time = sub->end_display_time + time_monotonic_ms(); } diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 633a3995e..366d31c3b 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -695,7 +695,7 @@ void CPictureViewerGui::paintItem(int pos) char timestring[18]; strftime(timestring, 18, "%d-%m-%Y %H:%M", gmtime(&playlist[liststart+pos].Date)); int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(timestring); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+fheight, width-30 - w, tmp, color, fheight, true); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+fheight, width-30 - w, tmp, color, fheight); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+width-20-w,ypos+fheight, w, timestring, color, fheight); } diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index bc38a2763..b78ccc80e 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -505,7 +505,7 @@ void CScanTs::hide() void CScanTs::paintLineLocale(int px, int * py, int pwidth, const neutrino_locale_t l) { frameBuffer->paintBoxRel(px, *py, pwidth, mheight, COL_MENUCONTENT_PLUS_0); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px+2, *py + mheight, pwidth, g_Locale->getText(l), COL_MENUCONTENTINACTIVE_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px+2, *py + mheight, pwidth, g_Locale->getText(l), COL_MENUCONTENTINACTIVE_TEXT); *py += mheight; } @@ -513,7 +513,7 @@ void CScanTs::paintLine(int px, int py, int w, const char * const txt) { //printf("CScanTs::paintLine x %d y %d w %d width %d xpos2 %d: %s\n", px, py, w, width, xpos2, txt); frameBuffer->paintBoxRel(px, py, w, mheight, COL_MENUCONTENT_PLUS_0); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px+2, py + mheight, w, txt, COL_MENUCONTENT_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px+2, py + mheight, w, txt, COL_MENUCONTENT_TEXT); } void CScanTs::paint(bool fortest) diff --git a/src/gui/screensetup.cpp b/src/gui/screensetup.cpp index 6e98f1409..73006cc00 100644 --- a/src/gui/screensetup.cpp +++ b/src/gui/screensetup.cpp @@ -259,9 +259,9 @@ void CScreenSetup::paintIcons(int pselected) frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, x_box + 5, y_box+BoxHeight, BoxHeight); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x_box + icol_w + 10, y_box + BoxHeight, BoxWidth, - g_Locale->getText(LOCALE_SCREENSETUP_UPPERLEFT ), (pselected == 0) ? COL_MENUCONTENTSELECTED_TEXT:COL_MENUCONTENT_TEXT , 0, true); // UTF-8 + g_Locale->getText(LOCALE_SCREENSETUP_UPPERLEFT ), (pselected == 0) ? COL_MENUCONTENTSELECTED_TEXT:COL_MENUCONTENT_TEXT); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x_box + icol_w + 10, y_box + BoxHeight * 2, BoxWidth, - g_Locale->getText(LOCALE_SCREENSETUP_LOWERRIGHT), (pselected == 1) ? COL_MENUCONTENTSELECTED_TEXT:COL_MENUCONTENT_TEXT, 0, true); // UTF-8 + g_Locale->getText(LOCALE_SCREENSETUP_LOWERRIGHT), (pselected == 1) ? COL_MENUCONTENTSELECTED_TEXT:COL_MENUCONTENT_TEXT); } void CScreenSetup::paintBorderUL() diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index d39cc67ec..c44fd40e2 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -169,7 +169,7 @@ int CStreamInfo2::doSignalStrengthLoop () char currate[150]; sprintf(tmp_str, "%s:",g_Locale->getText(LOCALE_STREAMINFO_BITRATE)); - g_Font[font_info]->RenderString(dx1 , average_bitrate_pos, offset+10, tmp_str, COL_INFOBAR_TEXT, 0, true); + g_Font[font_info]->RenderString(dx1 , average_bitrate_pos, offset+10, tmp_str, COL_INFOBAR_TEXT); sprintf(currate, "%5llu.%02llu", rate.short_average / 1000ULL, rate.short_average % 1000ULL); frameBuffer->paintBoxRel (dx1 + average_bitrate_offset , average_bitrate_pos -dheight, sw, dheight, COL_MENUHEAD_PLUS_0); g_Font[font_info]->RenderString (dx1 + average_bitrate_offset , average_bitrate_pos, sw - 10, currate, COL_INFOBAR_TEXT); @@ -259,7 +259,7 @@ void CStreamInfo2::paint_signal_fe_box(int _x, int _y, int w, int h) char tname[255]; snprintf(tname, sizeof(tname), "%s: %d: %s", g_Locale->getText(LOCALE_STREAMINFO_SIGNAL), tuner, frontend->getInfo()->name); - g_Font[font_small]->RenderString(_x, _y+iheight+15, width-_x-10, tname /*tuner_name.c_str()*/, COL_INFOBAR_TEXT, 0, true); + g_Font[font_small]->RenderString(_x, _y+iheight+15, width-_x-10, tname /*tuner_name.c_str()*/, COL_INFOBAR_TEXT); sigBox_x = _x; sigBox_y = _y+iheight+15; @@ -272,16 +272,16 @@ void CStreamInfo2::paint_signal_fe_box(int _x, int _y, int w, int h) frameBuffer->paintBoxRel(_x+xd*0,y1- 12,16,2, COL_RED); //red - g_Font[font_small]->RenderString(_x+20+xd*0, y1, fw*4, "BER", COL_INFOBAR_TEXT, 0, true); + g_Font[font_small]->RenderString(_x+20+xd*0, y1, fw*4, "BER", COL_INFOBAR_TEXT); frameBuffer->paintBoxRel(_x+xd*1,y1- 12,16,2,COL_BLUE); //blue - g_Font[font_small]->RenderString(_x+20+xd*1, y1, fw*4, "SNR", COL_INFOBAR_TEXT, 0, true); + g_Font[font_small]->RenderString(_x+20+xd*1, y1, fw*4, "SNR", COL_INFOBAR_TEXT); frameBuffer->paintBoxRel(_x+8+xd*2,y1- 12,16,2, COL_GREEN); //green - g_Font[font_small]->RenderString(_x+28+xd*2, y1, fw*4, "SIG", COL_INFOBAR_TEXT, 0, true); + g_Font[font_small]->RenderString(_x+28+xd*2, y1, fw*4, "SIG", COL_INFOBAR_TEXT); frameBuffer->paintBoxRel(_x+xd*3,y1- 12,16,2,COL_YELLOW); // near yellow - g_Font[font_small]->RenderString(_x+20+xd*3, y1, fw*5, "Bitrate", COL_INFOBAR_TEXT, 0, true); + g_Font[font_small]->RenderString(_x+20+xd*3, y1, fw*5, "Bitrate", COL_INFOBAR_TEXT); sig_text_ber_x = _x + xd * 0; sig_text_snr_x = _x + 5 + xd * 1; @@ -296,9 +296,9 @@ void CStreamInfo2::paint_signal_fe_box(int _x, int _y, int w, int h) else maxmin_x = _x + 40 + xd * 3 + (fontW*4); - g_Font[font_small]->RenderString(maxmin_x, y1 + sheight + 5, fw*3, "max", COL_INFOBAR_TEXT, 0, true); - g_Font[font_small]->RenderString(maxmin_x, y1 + (sheight * 2) +5, fw*3, "now", COL_INFOBAR_TEXT, 0, true); - g_Font[font_small]->RenderString(maxmin_x, y1 + (sheight * 3) +5, fw*3, "min", COL_INFOBAR_TEXT, 0, true); + g_Font[font_small]->RenderString(maxmin_x, y1 + sheight + 5, fw*3, "max", COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(maxmin_x, y1 + (sheight * 2) +5, fw*3, "now", COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(maxmin_x, y1 + (sheight * 3) +5, fw*3, "min", COL_INFOBAR_TEXT); sigBox_pos = 0; @@ -388,7 +388,7 @@ void CStreamInfo2::SignalRenderStr(unsigned int value, int _x, int _y) fw *=(fw>17)?5:6; frameBuffer->paintBoxRel(_x, _y - sheight + 5, fw, sheight -1, COL_MENUHEAD_PLUS_0); sprintf(str,"%6u",value); - g_Font[font_small]->RenderString(_x, _y + 5, fw, str, COL_INFOBAR_TEXT, 0, true); + g_Font[font_small]->RenderString(_x, _y + 5, fw, str, COL_INFOBAR_TEXT); } void CStreamInfo2::paint (int /*mode*/) @@ -409,7 +409,7 @@ void CStreamInfo2::paint (int /*mode*/) // paint backround, title pig, etc. frameBuffer->paintBoxRel (0, 0, max_width, max_height, COL_MENUHEAD_PLUS_0); - g_Font[font_head]->RenderString (xpos, ypos + hheight + 1, width, head_string, COL_MENUHEAD_TEXT, 0, true); // UTF-8 + g_Font[font_head]->RenderString (xpos, ypos + hheight + 1, width, head_string, COL_MENUHEAD_TEXT); ypos += hheight; if (pip == NULL) @@ -474,14 +474,14 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) //Video RESOLUTION ypos += iheight; sprintf (buf, "%s:",g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION)); - g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR_TEXT); sprintf (buf, "%dx%d", xres, yres); - g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT); //audio rate ypos += iheight; sprintf (buf, "%s:",g_Locale->getText (LOCALE_STREAMINFO_ARATIO)); - g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR_TEXT); switch (aspectRatio) { case 0: sprintf (buf, "N/A"); @@ -501,12 +501,12 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) default: strncpy (buf, g_Locale->getText (LOCALE_STREAMINFO_ARATIO_UNKNOWN), sizeof (buf)-1); } - g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT); //Video FRAMERATE ypos += iheight; sprintf (buf, "%s:", g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE)); - g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR_TEXT); switch (framerate) { case 0: snprintf (buf,sizeof(buf), "23.976fps"); @@ -536,7 +536,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) strncpy (buf, g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE_UNKNOWN), sizeof (buf)-1); break; } - g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT); // place for average bitrate average_bitrate_pos = ypos += iheight; //AUDIOTYPE @@ -545,7 +545,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) audioDecoder->getAudioInfo(type, layer, freq, lbitrate, mode); sprintf (buf, "%s:", g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE)); - g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR_TEXT); if(type == 0) { const char *mpegmodes[4] = { "stereo", "joint_st", "dual_ch", "single_ch" }; @@ -554,7 +554,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) const char *ddmodes[8] = { "CH1/CH2", "C", "L/R", "L/C/R", "L/R/S", "L/C/R/S", "L/R/SL/SR", "L/C/R/SL/SR" }; sprintf (buf, "DD %s (%d)", ddmodes[mode], freq); } - g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT); //satellite ypos += iheight; @@ -565,18 +565,18 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) else snprintf (buf, sizeof(buf), "%s:",g_Locale->getText (LOCALE_TERRESTRIALSETUP_AREA)); - g_Font[font_info]->RenderString(xpos, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_info]->RenderString(xpos, ypos, box_width, buf, COL_INFOBAR_TEXT); sprintf (buf, "%s", CServiceManager::getInstance()->GetSatelliteName(channel->getSatellitePosition()).c_str()); - g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT); //channel ypos += iheight; sprintf (buf, "%s:",g_Locale->getText (LOCALE_TIMERLIST_CHANNEL));//swiped locale - g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_INFOBAR_TEXT); sprintf(buf, "%s", channel->getName().c_str()); - g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT); //tsfrequenz ypos += iheight; @@ -586,8 +586,8 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) scaling = 15000; sprintf (buf, "%s",g_Locale->getText (LOCALE_SCANTS_FREQDATA)); - g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_INFOBAR_TEXT, 0, true); // UTF-8 - g_Font[font_info]->RenderString(xpos+spaceoffset, ypos, box_width, t.description().c_str(), COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString(xpos+spaceoffset, ypos, box_width, t.description().c_str(), COL_INFOBAR_TEXT); // paint labels int fontW = g_Font[font_small]->getWidth(); @@ -595,27 +595,27 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) //onid ypos+= sheight; sprintf(buf, "0x%04X (%i)", channel->getOriginalNetworkId(), channel->getOriginalNetworkId()); - g_Font[font_small]->RenderString(xpos, ypos, box_width, "ONid:" , COL_INFOBAR_TEXT, 0, true); // UTF-8 - g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_small]->RenderString(xpos, ypos, box_width, "ONid:" , COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT); //sid ypos+= sheight; sprintf(buf, "0x%04X (%i)", channel->getServiceId(), channel->getServiceId()); - g_Font[font_small]->RenderString(xpos, ypos, box_width, "Sid:" , COL_INFOBAR_TEXT, 0, true); // UTF-8 - g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_small]->RenderString(xpos, ypos, box_width, "Sid:" , COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT); //tsid ypos+= sheight; sprintf(buf, "0x%04X (%i)", channel->getTransportStreamId(), channel->getTransportStreamId()); - g_Font[font_small]->RenderString(xpos, ypos, box_width, "TSid:" , COL_INFOBAR_TEXT, 0, true); // UTF-8 - g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_small]->RenderString(xpos, ypos, box_width, "TSid:" , COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT); //pmtpid ypos+= sheight; pmt_version = channel->getPmtVersion(); sprintf(buf, "0x%04X (%i) [0x%02X]", channel->getPmtPid(), channel->getPmtPid(), pmt_version); - g_Font[font_small]->RenderString(xpos, ypos, box_width, "PMTpid:", COL_INFOBAR_TEXT, 0, true); // UTF-8 - g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_small]->RenderString(xpos, ypos, box_width, "PMTpid:", COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT); //vpid ypos+= sheight; @@ -624,12 +624,12 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) } else { sprintf(buf, "%s", g_Locale->getText(LOCALE_STREAMINFO_NOT_AVAILABLE)); } - g_Font[font_small]->RenderString(xpos, ypos, box_width, "Vpid:" , COL_INFOBAR_TEXT, 0, true); // UTF-8 - g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_small]->RenderString(xpos, ypos, box_width, "Vpid:" , COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT); //apid ypos+= sheight; - g_Font[font_small]->RenderString(xpos, ypos, box_width, "Apid(s):" , COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_small]->RenderString(xpos, ypos, box_width, "Apid(s):" , COL_INFOBAR_TEXT); if (g_RemoteControl->current_PIDs.APIDs.empty()){ sprintf(buf, "%s", g_Locale->getText(LOCALE_STREAMINFO_NOT_AVAILABLE)); } else { @@ -638,10 +638,10 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) { sprintf(buf, "0x%04X (%i)", g_RemoteControl->current_PIDs.APIDs[li].pid, g_RemoteControl->current_PIDs.APIDs[li].pid ); if (li == g_RemoteControl->current_PIDs.PIDs.selected_apid){ - g_Font[font_small]->RenderString(xpos+sw, ypos, box_width, buf, COL_MENUHEAD_TEXT, 0, true); // UTF-8 + g_Font[font_small]->RenderString(xpos+sw, ypos, box_width, buf, COL_MENUHEAD_TEXT); } else{ - g_Font[font_small]->RenderString(xpos+sw, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_small]->RenderString(xpos+sw, ypos, box_width, buf, COL_INFOBAR_TEXT); } sw = g_Font[font_small]->getRenderWidth(buf)+sw+10; if (((li+1)%3 == 0) &&(g_RemoteControl->current_PIDs.APIDs.size()-1 > li)){ // if we have lots of apids, put "intermediate" line with pids @@ -657,8 +657,8 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) sprintf(buf, "%s", g_Locale->getText(LOCALE_STREAMINFO_NOT_AVAILABLE)); else sprintf(buf, "0x%04X (%i)", g_RemoteControl->current_PIDs.PIDs.vtxtpid, g_RemoteControl->current_PIDs.PIDs.vtxtpid ); - g_Font[font_small]->RenderString(xpos, ypos, box_width, "VTXTpid:" , COL_INFOBAR_TEXT, 0, true); // UTF-8 - g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8 + g_Font[font_small]->RenderString(xpos, ypos, box_width, "VTXTpid:" , COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT); if(box_h == 0) box_h = ypos - ypos1; yypos = ypos; @@ -746,7 +746,7 @@ void CStreamInfo2::paintCASystem(int xpos, int ypos) if(caids[ca_id] == true){ if(cryptsysteme){ ypos += iheight; - g_Font[font_info]->RenderString(xpos , ypos, box_width, "Conditional access:" , COL_INFOBAR_TEXT, 0, false); + g_Font[font_info]->RenderString(xpos , ypos, box_width, "Conditional access:" , COL_INFOBAR_TEXT); cryptsysteme = false; } ypos += sheight; @@ -755,7 +755,7 @@ void CStreamInfo2::paintCASystem(int xpos, int ypos) std::string::size_type last_pos = casys[ca_id].find_first_not_of(tok, 0); std::string::size_type pos = casys[ca_id].find_first_of(tok, last_pos); while (std::string::npos != pos || std::string::npos != last_pos){ - g_Font[font_small]->RenderString(xpos + width_txt, ypos, box_width, casys[ca_id].substr(last_pos, pos - last_pos).c_str() , COL_INFOBAR_TEXT, 0, false); + g_Font[font_small]->RenderString(xpos + width_txt, ypos, box_width, casys[ca_id].substr(last_pos, pos - last_pos).c_str() , COL_INFOBAR_TEXT); if(index == 0) width_txt = spaceoffset; else diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 00b4ac109..5d6accc03 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -734,12 +734,12 @@ void CTimerList::paintItem(int pos) struct tm *stopTime = localtime(&(timer.stopTime)); strftime(zStopTime,20,"%d.%m. %H:%M",stopTime); int fw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getWidth(); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+fheight, fw*12, zAlarmTime, color, fheight, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+fheight, fw*12, zAlarmTime, color, fheight); if (timer.stopTime != 0) { - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+2*fheight, fw*12, zStopTime, color, fheight, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+2*fheight, fw*12, zStopTime, color, fheight); } - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13,ypos+fheight, (real_width-fw*13)/2-5, convertTimerRepeat2String(timer.eventRepeat), color, fheight, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13,ypos+fheight, (real_width-fw*13)/2-5, convertTimerRepeat2String(timer.eventRepeat), color, fheight); if (timer.eventRepeat != CTimerd::TIMERREPEAT_ONCE) { @@ -750,9 +750,9 @@ void CTimerList::paintItem(int pos) sprintf(srepeatcount,"00"); else sprintf(srepeatcount,"%ux",timer.repeatCount); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*23)/2,ypos+fheight, (real_width-fw*13)/2-5, srepeatcount, color, fheight, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*23)/2,ypos+fheight, (real_width-fw*13)/2-5, srepeatcount, color, fheight); } - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*13)/2,ypos+fheight, (real_width-fw*13)/2-5, convertTimerType2String(timer.eventType), color, fheight, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*13)/2,ypos+fheight, (real_width-fw*13)/2-5, convertTimerType2String(timer.eventType), color, fheight); // paint rec icon when recording in progress if ((timer.eventType == CTimerd::TIMER_RECORD) && (CRecordManager::getInstance()->RecordingStatus(timer.channel_id))) { @@ -838,7 +838,7 @@ void CTimerList::paintItem(int pos) default: {} } - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13,ypos+2*fheight, real_width-(fw*13+5), zAddData, color, fheight, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13,ypos+2*fheight, real_width-(fw*13+5), zAddData, color, fheight); // LCD Display if (liststart+pos==selected) { diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 6353e9c5d..3a714e055 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -899,7 +899,7 @@ void CUpnpBrowserGui::paintDeviceInfo() w = std::min(w, m_width - 20); xstart = (m_width - w) / 2; g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 1*m_mheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8 + tmp, COL_MENUCONTENTSELECTED_TEXT); // second line tmp = m_devices[m_selecteddevice].modelname + " " + @@ -909,14 +909,14 @@ void CUpnpBrowserGui::paintDeviceInfo() w = std::min(w, m_width - 20); xstart = (m_width - w) / 2; g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 2*m_mheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8 + tmp, COL_MENUCONTENTSELECTED_TEXT); // third line tmp = m_devices[m_selecteddevice].modelurl; w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); w = std::min(w, m_width - 20); xstart = (m_width - w) / 2; g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 3*m_mheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8 + tmp, COL_MENUCONTENTSELECTED_TEXT); } void CUpnpBrowserGui::paintDevice(unsigned int _pos) @@ -950,9 +950,9 @@ void CUpnpBrowserGui::paintDevice(unsigned int _pos) int w = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->getRenderWidth(name) + 5; g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(m_x + 10, ypos + m_fheight, m_width - 30 - w, - num, color, m_fheight, true); // UTF-8 + num, color, m_fheight); g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(m_x + m_width - 15 - w, ypos + m_fheight, - w, name, color, m_fheight, true); // UTF-8 + w, name, color, m_fheight); } void CUpnpBrowserGui::paintDevices() @@ -1055,7 +1055,7 @@ void CUpnpBrowserGui::paintItem(std::vector *entries, unsigned int po g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(m_x + m_width - 15 - w, ypos + m_fheight, w, info, color, m_fheight); g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(m_x + 30, ypos + m_fheight, m_width - 50 - w, - name, color, m_fheight, true); // UTF-8 + name, color, m_fheight); } void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) @@ -1085,7 +1085,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) w = std::min(w, m_width - 20); xstart = (m_width - w) / 2; g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 1*m_mheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8 + tmp, COL_MENUCONTENTSELECTED_TEXT); // second line if (entry->isdir) @@ -1100,7 +1100,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) w = std::min(w, m_width - 20); xstart = (m_width - w) / 2; g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 2*m_mheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8 + tmp, COL_MENUCONTENTSELECTED_TEXT); //third line tmp = ""; @@ -1111,7 +1111,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) w = std::min(w, m_width - 20); xstart = (m_width - w) / 2; g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 3*m_mheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8 + tmp, COL_MENUCONTENTSELECTED_TEXT); static std::string lastname = "", tmpname = ""; if(!entry->albumArtURI.empty()){ static int flogo_w = 0, flogo_h = 0; @@ -1190,9 +1190,9 @@ printf("paintDetails: use_playing %d shown %d\n", use_playing, m_playing_entry_i m_frameBuffer->paintBoxRel(m_x, top + 2, m_width-2, 2 * ih, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE); g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(text_start, top + 1 * m_buttonHeight + 4, m_x + m_width - 8, m_playing_entry.title + " - " + - m_playing_entry.artist, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8 + m_playing_entry.artist, COL_MENUCONTENTDARK_TEXT); g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(text_start, - top + 2 * m_buttonHeight + 4, m_x + m_width - 8, m_playing_entry.album, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8 + top + 2 * m_buttonHeight + 4, m_x + m_width - 8, m_playing_entry.album, COL_MENUCONTENTDARK_TEXT); } } else @@ -1202,9 +1202,9 @@ printf("paintDetails: use_playing %d shown %d\n", use_playing, m_playing_entry_i m_frameBuffer->paintBoxRel(m_x, top + 2, m_width-2, 2 * ih, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE); g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(text_start, top + 1 * m_buttonHeight + 4, m_x + m_width - 8, entry->title + " - " + - entry->artist, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8 + entry->artist, COL_MENUCONTENTDARK_TEXT); g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(text_start, - top + 2 * m_buttonHeight + 4, m_x + m_width - 8, entry->album, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8 + top + 2 * m_buttonHeight + 4, m_x + m_width - 8, entry->album, COL_MENUCONTENTDARK_TEXT); } } } diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index fad576a52..9843b48f5 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -205,7 +205,7 @@ int paintButtons( const int &x, // paint icon and text frameBuffer->paintIcon(icon, x_button , y_base - iconh[j]/2); x_caption = x_button + iconw[j] + h_space; - font->RenderString(x_caption, y_caption, fwidth[j], caption, fcolor, 0, true); + font->RenderString(x_caption, y_caption, fwidth[j], caption, fcolor); /* set next startposition x, if text is length=0 then offset is =renderwidth of icon, * for generating buttons without captions, diff --git a/src/gui/widget/colorchooser.cpp b/src/gui/widget/colorchooser.cpp index 602a7400b..f08644c97 100644 --- a/src/gui/widget/colorchooser.cpp +++ b/src/gui/widget/colorchooser.cpp @@ -247,7 +247,7 @@ void CColorChooser::paint() { //frameBuffer->paintBoxRel(x,y, width,hheight, COL_MENUHEAD_PLUS_0); frameBuffer->paintBoxRel(x,y, width,hheight, COL_MENUHEAD_PLUS_0, RADIUS_MID, CORNER_TOP); //round - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+hheight, width, g_Locale->getText(name), COL_MENUHEAD_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+hheight, width, g_Locale->getText(name), COL_MENUHEAD_TEXT); //frameBuffer->paintBoxRel(x,y+hheight, width,height-hheight, COL_MENUCONTENT_PLUS_0); frameBuffer->paintBoxRel(x,y+hheight, width,height-hheight, COL_MENUCONTENT_PLUS_0, RADIUS_MID, CORNER_BOTTOM);//round @@ -267,5 +267,5 @@ void CColorChooser::paintSlider(int px, int py, unsigned char *spos, const neutr frameBuffer->paintIcon(NEUTRINO_ICON_VOLUMEBODY,px+offset+10,py+2+mheight/4); frameBuffer->paintIcon(selected ? iconname : NEUTRINO_ICON_VOLUMESLIDER2,px+offset+13+(*spos),py+mheight/4); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px,py+mheight, width, g_Locale->getText(text), COL_MENUCONTENT_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px,py+mheight, width, g_Locale->getText(text), COL_MENUCONTENT_TEXT); } diff --git a/src/gui/widget/drawable.cpp b/src/gui/widget/drawable.cpp index d83c7882b..0319e34ff 100644 --- a/src/gui/widget/drawable.cpp +++ b/src/gui/widget/drawable.cpp @@ -88,7 +88,7 @@ void DText::init() void DText::draw(CFBWindow *window, int x, int y, int width) { window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU], x, y + m_height, width, - m_text.c_str(), COL_MENUCONTENT_TEXT, 0, true); // UTF-8 + m_text.c_str(), COL_MENUCONTENT_TEXT); } void DText::print(void) @@ -136,7 +136,7 @@ void DPagebreak::draw(CFBWindow */*window*/, int /*x*/, int /*y*/, int /*width*/ { // window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU], // x, y + m_height, width, "", -// COL_MENUCONTENT_TEXT, 0, true); // UTF-8 +// COL_MENUCONTENT_TEXT); } void DPagebreak::print(void) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 4fb237fab..0b1ba2c42 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -180,11 +180,11 @@ void CHintBox::refresh(void) CFrameBuffer::getInstance()->getIconSize(iconfile.c_str(), &iw, &ih); //window->paintIcon(iconfile.c_str(), 8, 5); window->paintIcon(iconfile.c_str(), 10, 0, theight); - //window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], iw+20, theight, width - 20-iw, g_Locale->getText(caption), COL_MENUHEAD_TEXT, 0, true); // UTF-8 - window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], iw+20, theight, width - 20-iw, caption, COL_MENUHEAD_TEXT, 0, true); // UTF-8 + //window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], iw+20, theight, width - 20-iw, g_Locale->getText(caption), COL_MENUHEAD_TEXT); + window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], iw+20, theight, width - 20-iw, caption, COL_MENUHEAD_TEXT); } else - window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], 10, theight, width - 10, caption, COL_MENUHEAD_TEXT, 0, true); // UTF-8 + window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], 10, theight, width - 10, caption, COL_MENUHEAD_TEXT); //window->paintBoxRel(0, theight, width, (entries_per_page + 1) * fheight, (CFBWindow::color_t)COL_MENUCONTENT_PLUS_0); window->paintBoxRel(0, theight, width, (entries_per_page + 1) * fheight, (CFBWindow::color_t)COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);//round @@ -193,7 +193,7 @@ void CHintBox::refresh(void) int ypos = theight + (fheight >> 1); for (std::vector::const_iterator it = line.begin() + (entries_per_page * current_page); ((it != line.end()) && (count > 0)); ++it, count--) - window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU], textStartX, (ypos += fheight), width, *it, COL_MENUCONTENT_TEXT, 0, true); // UTF-8 + window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU], textStartX, (ypos += fheight), width, *it, COL_MENUCONTENT_TEXT); if (entries_per_page < line.size()) { diff --git a/src/gui/widget/hintboxext.cpp b/src/gui/widget/hintboxext.cpp index 1a7c90f4a..2a4e7e1e9 100644 --- a/src/gui/widget/hintboxext.cpp +++ b/src/gui/widget/hintboxext.cpp @@ -295,7 +295,7 @@ void CHintBoxExt::refresh(bool toround) x_text = x_offset; // title text - m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], x_text, m_theight, m_width, title_text, COL_MENUHEAD_TEXT, 0, true); // UTF-8 + m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], x_text, m_theight, m_width, title_text, COL_MENUHEAD_TEXT); // background of text panel m_window->paintBoxRel(0, m_theight, m_width, (m_maxEntriesPerPage + 1) * m_fheight, (CFBWindow::color_t)COL_MENUCONTENT_PLUS_0, toround ? RADIUS_LARGE : 0, CORNER_BOTTOM);//round diff --git a/src/gui/widget/keychooser.cpp b/src/gui/widget/keychooser.cpp index 50abbb697..960a4b3d8 100644 --- a/src/gui/widget/keychooser.cpp +++ b/src/gui/widget/keychooser.cpp @@ -175,9 +175,9 @@ void CKeyChooserItem::paint() frameBuffer->paintBoxRel(x, y , width, hheight , COL_MENUHEAD_PLUS_0 , RADIUS_LARGE, CORNER_TOP);//round frameBuffer->paintBoxRel(x, y + hheight, width, height - hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);//round - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+ 10, y+ hheight, width, g_Locale->getText(name), COL_MENUHEAD_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+ 10, y+ hheight, width, g_Locale->getText(name), COL_MENUHEAD_TEXT); //paint msg... - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, y+ hheight+ mheight, width, g_Locale->getText(LOCALE_KEYCHOOSER_TEXT1), COL_MENUCONTENT_TEXT, 0, true); // UTF-8 - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, y+ hheight+ mheight* 2, width, g_Locale->getText(LOCALE_KEYCHOOSER_TEXT2), COL_MENUCONTENT_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, y+ hheight+ mheight, width, g_Locale->getText(LOCALE_KEYCHOOSER_TEXT1), COL_MENUCONTENT_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, y+ hheight+ mheight* 2, width, g_Locale->getText(LOCALE_KEYCHOOSER_TEXT2), COL_MENUCONTENT_TEXT); } diff --git a/src/gui/widget/listbox.cpp b/src/gui/widget/listbox.cpp index 12f711cf8..2d706d098 100644 --- a/src/gui/widget/listbox.cpp +++ b/src/gui/widget/listbox.cpp @@ -84,7 +84,7 @@ void CListBox::paintHead() { //frameBuffer->paintBoxRel(x,y, width,theight+0, COL_MENUHEAD_PLUS_0); frameBuffer->paintBoxRel(x, y, width, theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, width, caption.c_str() , COL_MENUHEAD_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, width, caption.c_str() , COL_MENUHEAD_TEXT); } void CListBox::paintFoot() diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index fe8d979af..0a483ba66 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -363,7 +363,7 @@ void CListFrame::refreshTitle(void) m_pcFontTitle->RenderString(m_cFrameTitleRel.iX + TEXT_BORDER_WIDTH + m_cFrame.iX, m_cFrameTitleRel.iY + m_cFrameTitleRel.iHeight + m_cFrame.iY, m_cFrameTitleRel.iWidth - (TEXT_BORDER_WIDTH << 1), - m_textTitle.c_str(), TITLE_FONT_COLOR, 0, true); // UTF-8 + m_textTitle.c_str(), TITLE_FONT_COLOR); } void CListFrame::refreshScroll(void) @@ -447,7 +447,7 @@ void CListFrame::refreshList(void) xDiff = 0; m_pcFontList->RenderString(x+m_cFrame.iX+xDiff, y+m_cFrame.iY, width-xDiff, m_pLines->lineArray[row][line].c_str(), - color, 0, true); // UTF-8 + color); x += width + ROW_BORDER_WIDTH; } } @@ -493,7 +493,7 @@ void CListFrame::refreshLine(int line) xDiff = 0; m_pcFontList->RenderString(x+m_cFrame.iX+xDiff, y+m_cFrame.iY, width-xDiff, m_pLines->lineArray[row][line].c_str(), - color, 0, true); // UTF-8 + color); x += width + ROW_BORDER_WIDTH; } } @@ -523,7 +523,7 @@ void CListFrame::refreshHeaderList(void) } m_pcFontHeaderList->RenderString(x+m_cFrame.iX, y+m_cFrame.iY, width, m_pLines->lineHeader[row].c_str(), - HEADER_LIST_FONT_COLOR, 0, true); // UTF-8 + HEADER_LIST_FONT_COLOR); x += width + ROW_BORDER_WIDTH; } } diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index cd7e778c2..ff94033de 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -161,7 +161,7 @@ void CMenuItem::paintItemCaption(const bool select_mode, const int &item_height, if (icon_w) _dx -= icon_frame_w + icon_w; } - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(name_start_x, y+ item_height, _dx- (name_start_x - x), left_text, item_color, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(name_start_x, y+ item_height, _dx- (name_start_x - x), left_text, item_color); //right text if (right_text && (*right_text || right_bgcol)) @@ -187,7 +187,7 @@ void CMenuItem::paintItemCaption(const bool select_mode, const int &item_height, } if (*right_text) { stringstartposOption -= (icon_w == 0 ? 0 : icon_w + icon_frame_w); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(stringstartposOption, y+item_height,dx- (stringstartposOption- x), right_text, item_color, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(stringstartposOption, y+item_height,dx- (stringstartposOption- x), right_text, item_color); } } } diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index 236e4b0c2..31c0a6f9e 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -179,7 +179,7 @@ void CMessageBox::paintButtons() m_window->paintBoxRel(xpos, ypos, b_width, b_height, (CFBWindow::color_t)bgcolor, RADIUS_LARGE); m_window->paintIcon(Buttons[i].icon, xpos + ((b_height - ih) / 2), ypos + ((b_height - ih) / 2), ih); m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], xpos + iw + 17, ypos + fh + ((b_height - fh) / 2), - b_width - (iw + 21), Buttons[i].text, (CFBWindow::color_t)color, 0, true); + b_width - (iw + 21), Buttons[i].text, (CFBWindow::color_t)color); xpos += b_width + ButtonDistance; } } diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 282df39fd..56ae40724 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -362,7 +362,7 @@ void CMsgBox::refreshFoot(void) m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, (CFBWindow::color_t)bgcolor, RADIUS_MID); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_RED, xpos + 14+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY); /*m_pcWindow->RenderString(*/ - m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 4 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth - 53, g_Locale->getText(LOCALE_MESSAGEBOX_YES), (CFBWindow::color_t)color, 0, true); // UTF-8 + m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 4 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth - 53, g_Locale->getText(LOCALE_MESSAGEBOX_YES), (CFBWindow::color_t)color); } xpos += ButtonWidth + ButtonSpacing; @@ -384,7 +384,7 @@ void CMsgBox::refreshFoot(void) m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, (CFBWindow::color_t)bgcolor, RADIUS_MID); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, xpos + 14+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY); /*m_pcWindow->RenderString(*/ - m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 4 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth- 53, g_Locale->getText(LOCALE_MESSAGEBOX_NO), (CFBWindow::color_t)color, 0, true); // UTF-8 + m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 4 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth- 53, g_Locale->getText(LOCALE_MESSAGEBOX_NO), (CFBWindow::color_t)color); } xpos += ButtonWidth + ButtonSpacing; @@ -406,7 +406,7 @@ void CMsgBox::refreshFoot(void) m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, (CFBWindow::color_t)bgcolor, RADIUS_MID); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_HOME, xpos+10+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY); /*m_pcWindow->RenderString(*/ - m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 2 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth- 53, g_Locale->getText((m_nFootButtons & mbCancel) ? LOCALE_MESSAGEBOX_CANCEL : LOCALE_MESSAGEBOX_BACK), (CFBWindow::color_t)color, 0, true); // UTF-8 + m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 2 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth- 53, g_Locale->getText((m_nFootButtons & mbCancel) ? LOCALE_MESSAGEBOX_CANCEL : LOCALE_MESSAGEBOX_BACK), (CFBWindow::color_t)color); } } @@ -441,9 +441,7 @@ void CMsgBox::refreshTitle(void) m_cBoxFrameTitleRel.iHeight+3+m_cBoxFrame.iY, m_cBoxFrameTitleRel.iWidth - TITLE_ICON_WIDTH + TEXT_BORDER_WIDTH, m_cTitle.c_str(), - COL_MENUHEAD_TEXT, - 0, - true); // UTF-8 + COL_MENUHEAD_TEXT); } else { @@ -454,9 +452,7 @@ void CMsgBox::refreshTitle(void) m_cBoxFrameTitleRel.iHeight+3+m_cBoxFrame.iY, m_cBoxFrameTitleRel.iWidth - TEXT_BORDER_WIDTH, m_cTitle.c_str(), - COL_MENUHEAD_TEXT, - 0, - true); // UTF-8 + COL_MENUHEAD_TEXT); } } diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 59b29f8a9..5b92197fb 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -128,7 +128,7 @@ void CProgressWindow::showStatusMessageUTF(const std::string & text) { statusText = text; frameBuffer->paintBox(x, statusTextY-mheight, x+width, statusTextY, COL_MENUCONTENT_PLUS_0); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10, statusTextY, width-20, text, COL_MENUCONTENT_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10, statusTextY, width-20, text, COL_MENUCONTENT_TEXT); #ifdef VFD_UPDATE CVFD::getInstance()->showProgressBar2(-1,text.c_str()); // set local text in VFD @@ -152,7 +152,7 @@ void CProgressWindow::paint() int ypos=y; frameBuffer->paintBoxRel(x, ypos, width, hheight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); if (caption != NONEXISTANT_LOCALE) - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10, ypos+ hheight, width - 10, g_Locale->getText(caption), COL_MENUHEAD_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10, ypos+ hheight, width - 10, g_Locale->getText(caption), COL_MENUHEAD_TEXT); frameBuffer->paintBoxRel(x, ypos+ hheight, width, height- hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); ypos+= hheight + (mheight >>1); @@ -164,7 +164,7 @@ void CProgressWindow::paint() showLocalStatus(0); ypos+= mheight+10; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width- 10, g_Locale->getText(LOCALE_FLASHUPDATE_GLOBALPROGRESS), COL_MENUCONTENT_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width- 10, g_Locale->getText(LOCALE_FLASHUPDATE_GLOBALPROGRESS), COL_MENUCONTENT_TEXT); ypos+= mheight; globalstatusY = ypos+ mheight-20; diff --git a/src/gui/widget/shellwindow.cpp b/src/gui/widget/shellwindow.cpp index 71d5816b1..6610f53b2 100644 --- a/src/gui/widget/shellwindow.cpp +++ b/src/gui/widget/shellwindow.cpp @@ -186,7 +186,7 @@ CShellWindow::~CShellWindow() int ypos = frameBuffer->getScreenHeight() - b_height; frameBuffer->paintBoxRel(xpos, ypos, b_width, b_height, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE); frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, xpos + ((b_height - ih) / 2), ypos + ((b_height - ih) / 2), ih); - font->RenderString(xpos + iw + 17, ypos + fh + ((b_height - fh) / 2), b_width - (iw + 21), g_Locale->getText(LOCALE_MESSAGEBOX_OK), COL_MENUCONTENT_TEXT, 0, true); + font->RenderString(xpos + iw + 17, ypos + fh + ((b_height - fh) / 2), b_width - (iw + 21), g_Locale->getText(LOCALE_MESSAGEBOX_OK), COL_MENUCONTENT_TEXT); frameBuffer->blit(); neutrino_msg_t msg; diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index 00da93c2e..18afdb93d 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -552,7 +552,7 @@ void CStringInput::paint(bool sms) icol_o = icol_w + (offset/2); } - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+ (offset/2)+ icol_o, y+ hheight, width- offset- icol_o, head.c_str(), COL_MENUHEAD_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+ (offset/2)+ icol_o, y+ hheight, width- offset- icol_o, head.c_str(), COL_MENUHEAD_TEXT); int tmp_y = y+ hheight+ offset+ input_h+ offset; if ((hint_1 != NONEXISTANT_LOCALE) || (hint_2 != NONEXISTANT_LOCALE)) @@ -560,12 +560,12 @@ void CStringInput::paint(bool sms) if (hint_1 != NONEXISTANT_LOCALE) { tmp_y += iheight; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, tmp_y, width- 2*offset, g_Locale->getText(hint_1), COL_MENUCONTENT_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, tmp_y, width- 2*offset, g_Locale->getText(hint_1), COL_MENUCONTENT_TEXT); } if (hint_2 != NONEXISTANT_LOCALE) { tmp_y += iheight; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, tmp_y, width- 2*offset, g_Locale->getText(hint_2), COL_MENUCONTENT_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, tmp_y, width- 2*offset, g_Locale->getText(hint_2), COL_MENUCONTENT_TEXT); } tmp_y += offset; } diff --git a/src/gui/widget/stringinput_ext.cpp b/src/gui/widget/stringinput_ext.cpp index 1807d6a4a..17d7ab97d 100644 --- a/src/gui/widget/stringinput_ext.cpp +++ b/src/gui/widget/stringinput_ext.cpp @@ -289,7 +289,7 @@ void CExtendedInput::paint() frameBuffer->paintBoxRel(x, y, width, hheight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); frameBuffer->paintBoxRel(x, y + hheight, width, bheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+ (offset/2), y+ hheight, width- offset, g_Locale->getText(name), COL_MENUHEAD_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+ (offset/2), y+ hheight, width- offset, g_Locale->getText(name), COL_MENUHEAD_TEXT); int tmp_y = y+ hheight+ offset+ input_h+ offset; @@ -298,12 +298,12 @@ void CExtendedInput::paint() if (hint_1 != NONEXISTANT_LOCALE) { tmp_y += iheight; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, tmp_y, width- 2*offset, g_Locale->getText(hint_1), COL_MENUCONTENT_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, tmp_y, width- 2*offset, g_Locale->getText(hint_1), COL_MENUCONTENT_TEXT); } if (hint_2 != NONEXISTANT_LOCALE) { tmp_y += iheight; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, tmp_y, width- 2*offset, g_Locale->getText(hint_2), COL_MENUCONTENT_TEXT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, tmp_y, width- 2*offset, g_Locale->getText(hint_2), COL_MENUCONTENT_TEXT); } tmp_y += offset; } diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index f098a0319..655119049 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -639,7 +639,7 @@ void CTextBox::refreshText(void) //TRACE("[CTextBox] %s Line %d m_cFrame.iX %d m_cFrameTextRel.iX %d\r\n", __FUNCTION__, __LINE__, m_cFrame.iX, m_cFrameTextRel.iX); m_pcFontText->RenderString(m_cFrame.iX + m_cFrameTextRel.iX + text_Hborder_width + x_center, y+m_cFrame.iY, m_cFrameTextRel.iWidth, m_cLineArray[i].c_str(), - m_textColor, 0, true); // UTF-8 + m_textColor); m_old_cText = m_cText; y += m_nFontTextHeight; } From 8fcca7c0c431e2421ed4fd2d789bc6a53136bbcc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 11 Jun 2014 15:25:30 +0200 Subject: [PATCH 116/511] eventlist: rework header show channellogo, prev channel, next channel if possible Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/069d19f70118577489475001e5fb37e75b1b40ff Author: vanhofen Date: 2014-06-11 (Wed, 11 Jun 2014) Origin message was: ------------------ - eventlist: rework header show channellogo, prev channel, next channel if possible ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 85 ++++++++++++++++++++++--------------------- src/gui/eventlist.h | 3 +- 2 files changed, 45 insertions(+), 43 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 7a85ea989..247d297ed 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -315,11 +315,7 @@ int CNeutrinoEventList::exec(const t_channel_id channel_id, const std::string& c UpdateTimerList(); bool dont_hide = false; - if(channelname_prev.empty(), channelname_next.empty()){ - paintHead(channel_id, channelname); - }else{ - paintHead(channelname, channelname_prev, channelname_next); - } + paintHead(channel_id, channelname, channelname_prev, channelname_next); paint(channel_id); showFunctionBar(true, channel_id); @@ -642,7 +638,7 @@ int CNeutrinoEventList::exec(const t_channel_id channel_id, const std::string& c /* in case timer was added in g_EpgData */ timerlist.clear(); g_Timerd->getTimerList (timerlist); - paintHead(channel_id,in_search ? search_head_name: channelname); + paintHead(channel_id, in_search ? search_head_name : channelname); oldIndex = -1; oldEventID = -1; bgRightBoxPaint = false; @@ -846,49 +842,56 @@ void CNeutrinoEventList::paintDescription(int index) cc_infozone->paint(CC_SAVE_SCREEN_NO); } -void CNeutrinoEventList::paintHead(std::string _channelname, std::string _channelname_prev, std::string _channelname_next) +void CNeutrinoEventList::paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev, std::string _channelname_next) { frameBuffer->paintBoxRel(x,y, full_width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); - const short font_h = 8 /* FONT_TYPE_EVENTLIST_ITEMLARGE */; - short pn_y_off = std::max((theight - g_Font[font_h]->getHeight()) / 2, 0); - short prev_len = g_Font[font_h]->getRenderWidth(_channelname_prev); - short next_len = g_Font[font_h]->getRenderWidth(_channelname_next); - short middle_len = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->getRenderWidth(_channelname); - short middle_offset = (full_width- next_len- prev_len- middle_len)/2; - if(middle_offset < 0){ - int fw_h = g_Font[font_h]->getWidth(); - int newsize = abs(middle_offset / fw_h) + 1; - if(_channelname_prev.size() > _channelname_next.size() ){ - _channelname_prev.resize( _channelname_prev.size() - newsize); - }else{ - _channelname_next.resize( _channelname_next.size() - newsize); - } - middle_offset = 0; - } - - g_Font[font_h]->RenderString(x+10,y+theight-pn_y_off+1, prev_len, _channelname_prev.c_str(), COL_INFOBAR_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->RenderString(x+prev_len+middle_offset,y+theight+1, middle_len, _channelname.c_str(), COL_MENUHEAD_TEXT); - g_Font[font_h]->RenderString(x+full_width-next_len-10,y+theight-pn_y_off+1, next_len, _channelname_next.c_str(), COL_INFOBAR_TEXT); - -} - -void CNeutrinoEventList::paintHead(t_channel_id _channel_id, std::string _channelname) -{ bool logo_ok = false; - frameBuffer->paintBoxRel(x,y, full_width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); - std::string lname; + int name_w = 0; int logo_w = 0; int logo_h = 0; - int logo_w_max = full_width / 4; + int x_off = 10; + int y_off = std::max((theight - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->getHeight()) / 2, 0); + int x_pos = x; + int y_pos = y; + int mid_width = full_width * 40 / 100; // 40% + int side_width = ((full_width - mid_width) / 2) - (2 * x_off); + if(g_settings.infobar_show_channellogo && g_PicViewer->GetLogoName(_channel_id, _channelname, lname, &logo_w, &logo_h)){ - if((logo_h > theight) || (logo_w > logo_w_max)) - g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, theight); - logo_ok = g_PicViewer->DisplayImage(lname, x+10, y+(theight-logo_h)/2, logo_w, logo_h); + if((logo_h > theight) || (logo_w > mid_width)) + g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, mid_width, theight); + x_pos = x + (full_width-logo_w)/2; + y_pos = y + (theight-logo_h)/2; + logo_ok = g_PicViewer->DisplayImage(lname, x_pos, y_pos, logo_w, logo_h); + } + + if (!logo_ok) { + name_w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->getRenderWidth(_channelname); + x_pos = x + (full_width - std::min(name_w, mid_width))/2; + y_pos = y + theight; + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->RenderString(x_pos, y_pos, mid_width, _channelname.c_str(), COL_MENUHEAD_TEXT); + } + else + { + // recalc widths + mid_width = logo_w; + side_width = ((full_width - mid_width) / 2) - (4 * x_off); + } + + if (!_channelname_prev.empty()) { + //name_w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->getRenderWidth(_channelname_prev); + x_pos = x + x_off; + y_pos = y + theight - y_off; + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x_pos, y_pos, side_width, _channelname_prev.c_str(), COL_MENUHEAD_TEXT); + } + + if (!_channelname_next.empty()) { + name_w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->getRenderWidth(_channelname_next); + x_pos = x + full_width - std::min(name_w, side_width) - x_off; + y_pos = y + theight - y_off; + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x_pos, y_pos, std::min(name_w, side_width), _channelname_next.c_str(), COL_MENUHEAD_TEXT); } - else - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->RenderString(x+15+(logo_ok? 5+logo_w:0),y+theight+1, full_width, _channelname.c_str(), COL_MENUHEAD_TEXT); } void CNeutrinoEventList::paint(t_channel_id channel_id) @@ -1322,7 +1325,7 @@ int CEventFinderMenu::showMenu(void) else if(*m_search_list == CNeutrinoEventList::SEARCH_LIST_BOUQUET) { if (*m_search_bouquet_id >= bouquetList->Bouquets.size()){ - *m_search_bouquet_id = bouquetList->getActiveBouquetNumber();; + *m_search_bouquet_id = bouquetList->getActiveBouquetNumber(); } if(!bouquetList->Bouquets.empty()) m_search_channelname = bouquetList->Bouquets[*m_search_bouquet_id]->channelList->getName(); diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 6f724a354..0aa61cf0a 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -112,8 +112,7 @@ class CNeutrinoEventList void paintItem(unsigned pos, t_channel_id channel_id = 0); void paintDescription(int index); void paint(t_channel_id channel_id = 0); - void paintHead(t_channel_id channel_id, std::string name); - void paintHead(std::string _channelname, std::string _channelname_prev, std::string _channelname_next); + void paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev = "", std::string _channelname_next = ""); void hide(); void showFunctionBar(bool show, t_channel_id channel_id); From 51c2e771a86c39ad79cd26cfafb762a7d5485add Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 12 Jun 2014 18:56:42 +0400 Subject: [PATCH 117/511] gui/movieplayer.cpp: add 'http' action key, with cut/restore neutrino Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/81735f5e538b883aa43ada95efd06b967445d8f2 Author: [CST] Focus Date: 2014-06-12 (Thu, 12 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/movieplayer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index c000cf9e0..50d4fae5b 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -238,6 +238,11 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey) is_file_player = 1; PlayFile(); } + else if (actionKey == "http") { + isHTTP = true; + is_file_player = 1; + PlayFile(); + } else { return menu_return::RETURN_REPAINT; } From 86380b6a0566cd261f3c072ad05ec19dab5eecda Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 12 Jun 2014 18:57:37 +0400 Subject: [PATCH 118/511] gui/luainstance.cpp: add function to start file/url play Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/943850eefc106db16505dc82ae59c81e72276b82 Author: [CST] Focus Date: 2014-06-12 (Thu, 12 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/luainstance.cpp | 24 ++++++++++++++++++++++++ src/gui/luainstance.h | 1 + 2 files changed, 25 insertions(+) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index bd1047d00..8eac49bef 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -408,6 +409,7 @@ const luaL_Reg CLuaInstance::methods[] = { "Blit", CLuaInstance::Blit }, { "GetLanguage", CLuaInstance::GetLanguage }, { "runScript", CLuaInstance::runScriptExt }, + { "PlayFile", CLuaInstance::PlayFile }, { NULL, NULL } }; @@ -565,6 +567,28 @@ int CLuaInstance::DisplayImage(lua_State *L) return 0; } +int CLuaInstance::PlayFile(lua_State *L) +{ + printf("CLuaInstance::%s %d\n", __func__, lua_gettop(L)); + int numargs = lua_gettop(L); + + if (numargs < 3) { + printf("CLuaInstance::%s: not enough arguments (%d, expected 3)\n", __func__, numargs); + return 0; + } + const char *title; + const char *fname; + + title = luaL_checkstring(L, 2); + fname = luaL_checkstring(L, 3); + printf("CLuaInstance::%s: title %s file %s\n", __func__, title, fname); + std::string st(title); + std::string sf(fname); + CMoviePlayerGui::getInstance().SetFile(st, sf); + CMoviePlayerGui::getInstance().exec(NULL, "http"); + return 0; +} + int CLuaInstance::GetSize(lua_State *L) { DBG("CLuaInstance::%s %d\n", __func__, lua_gettop(L)); diff --git a/src/gui/luainstance.h b/src/gui/luainstance.h index be9459c42..bda26c6aa 100644 --- a/src/gui/luainstance.h +++ b/src/gui/luainstance.h @@ -191,6 +191,7 @@ private: static int runScriptExt(lua_State *L); static int GetSize(lua_State *L); static int DisplayImage(lua_State *L); + static int PlayFile(lua_State *L); void MenuRegister(lua_State *L); static int MenuNew(lua_State *L); From ebcb077608cb21bd0442eec01e4e0208220c688c Mon Sep 17 00:00:00 2001 From: "[CST] Bas" Date: Thu, 12 Jun 2014 08:18:47 +0200 Subject: [PATCH 119/511] src/gui/streaminfo2.cpp: fix possible integer overflow if fe driver reports very high values. The fix is to check for overflow and if so just return max_y. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/60a53d9eb550c5142b695b77a99dbc6b7abb5cb2 Author: [CST] Bas Date: 2014-06-12 (Thu, 12 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/streaminfo2.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index c44fd40e2..8531fd36a 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -369,13 +369,20 @@ void CStreamInfo2::paint_signal_fe(struct bitrate br, struct feSignal s) // -- calc y from max_range and max_y int CStreamInfo2::y_signal_fe (unsigned long value, unsigned long max_value, int max_y) { - long l; + unsigned long long m; + unsigned long l; if (!max_value) max_value = 1; - l = ((long) max_y * (long) value) / (long) max_value; - if (l > max_y) + // we use a 64 bits int here to detect integer overflow + // and if it overflows, just return max_y + m = (unsigned long long)value * max_y; + if (m > 0xffffffff) + return max_y; + + l = m / max_value; + if (l > (unsigned long)max_y) l = max_y; return (int) l; From 7e11c4456327ec0fd4425ac38b3e9b96f6fc614d Mon Sep 17 00:00:00 2001 From: "[CST] Bas" Date: Mon, 26 May 2014 15:04:42 +0200 Subject: [PATCH 120/511] fastscan: fix astra1 scan in case there is only one LNB connected to the system. We should check if the data arrived too before deciding if the TP was valid or not. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e9cba838fdc4d07674c91e2c5f239caad0d161d6 Author: [CST] Bas Date: 2014-05-26 (Mon, 26 May 2014) ------------------ This commit was generated by Migit --- src/zapit/include/zapit/fastscan.h | 2 ++ src/zapit/include/zapit/scan.h | 1 + src/zapit/src/fastscan.cpp | 57 ++++++++++++++++++++---------- 3 files changed, 42 insertions(+), 18 deletions(-) diff --git a/src/zapit/include/zapit/fastscan.h b/src/zapit/include/zapit/fastscan.h index 397f6c470..5fc8237a4 100644 --- a/src/zapit/include/zapit/fastscan.h +++ b/src/zapit/include/zapit/fastscan.h @@ -47,6 +47,8 @@ typedef enum fs_operator { #define FAST_SCAN_HD 2 #define FAST_SCAN_ALL 3 +#define FAST_TUNE_TPS 2 + typedef struct fast_scan_operator { int id; unsigned short pid; diff --git a/src/zapit/include/zapit/scan.h b/src/zapit/include/zapit/scan.h index 32fab7085..36565cfa9 100644 --- a/src/zapit/include/zapit/scan.h +++ b/src/zapit/include/zapit/scan.h @@ -107,6 +107,7 @@ class CServiceScan : public OpenThreads::Thread std::map fast_services_freq; std::map fast_services_number; std::list > fst_sections; + uint32_t tune_tp_index; unsigned char fst_version; bool quiet_fastscan; diff --git a/src/zapit/src/fastscan.cpp b/src/zapit/src/fastscan.cpp index a04e6916b..e680cbc96 100644 --- a/src/zapit/src/fastscan.cpp +++ b/src/zapit/src/fastscan.cpp @@ -161,15 +161,27 @@ bool CServiceScan::FastscanTune(int id) { uint8_t polarization; FrontendParameters feparams; - bool res = false; + bool res = true; - feparams.dvb_feparams.frequency = 12070000; - feparams.dvb_feparams.u.qpsk.symbol_rate = 27500000; - feparams.dvb_feparams.u.qpsk.fec_inner = FEC_3_4; - polarization = 0; + if (tune_tp_index >= FAST_TUNE_TPS) { + printf("[fast scan] no more TPs to try, exiting\n"); + return false; + } - ReportFastScan(feparams, polarization, 235); - if(!tuneFrequency(&feparams, polarization, 235)) { + if (tune_tp_index == 0) { + printf("[fast scan] try tuning to main TP\n"); + feparams.dvb_feparams.frequency = 12070000; + feparams.dvb_feparams.u.qpsk.symbol_rate = 27500000; + feparams.dvb_feparams.u.qpsk.fec_inner = FEC_3_4; + polarization = 0; + ReportFastScan(feparams, polarization, 235); + res = tuneFrequency(&feparams, polarization, 235); + } + + // if TP 0 lock failed or TP 0 lock succeeded but no fastscan data arrived + // ie on Astra 1 and 3 there are 12070 H 27000 3/4 identical TPs so we can + // not use 'lock-failed' as the only condition to check the next sat/TP. + if (tune_tp_index == 1 || !res) { printf("[fast scan] tune failed, try backup\n"); if (id == HELLO_OPERATOR_ID) { feparams.dvb_feparams.frequency = 12074000; @@ -185,8 +197,7 @@ bool CServiceScan::FastscanTune(int id) ReportFastScan(feparams, polarization, 192); res = tuneFrequency(&feparams, polarization, 192); } - } else - res = true; + } return res; } @@ -199,6 +210,9 @@ bool CServiceScan::ScanFast() INFO("[fast scan] invalid operator %d", num); return false; } + + tune_tp_index = 0; + return ScanFast(num); } @@ -219,16 +233,23 @@ bool CServiceScan::ScanFast(int num, bool reload) printf("[fast scan] scaning operator %d [%s], pid 0x%x\n", op->id, op->name, op->pid); - if (!FastscanTune(op->id)) - goto _err; + while (tune_tp_index < FAST_TUNE_TPS) { + if (!FastscanTune(op->id)) + goto _err; - if (!quiet_fastscan) - CZapit::getInstance()->SendEvent(CZapitClient::EVT_SCAN_SATELLITE, op->name, strlen(op->name)+1); + if (!quiet_fastscan) + CZapit::getInstance()->SendEvent(CZapitClient::EVT_SCAN_SATELLITE, op->name, strlen(op->name)+1); - scanBouquetManager = new CBouquetManager(); + if (!scanBouquetManager) + scanBouquetManager = new CBouquetManager(); - if(ParseFnt(op->pid, op->id)) - ParseFst(op->pid, op); + if (ParseFnt(op->pid, op->id)) + break; + + tune_tp_index++; + } + + ParseFst(op->pid, op); //FIXME move to Cleanup() ? if(found_channels) { @@ -303,7 +324,7 @@ bool CServiceScan::ReadFst(unsigned short pid, unsigned short operator_id, bool cDemux * dmx = new cDemux(); dmx->Open(DMX_PSI_CHANNEL); - if (dmx->sectionFilter(pid, filter, mask, 3) < 0) { + if (dmx->sectionFilter(pid, filter, mask, 3, 3000) < 0) { delete dmx; return false; } @@ -555,7 +576,7 @@ bool CServiceScan::ParseFnt(unsigned short pid, unsigned short operator_id) frontendType = FE_QPSK; printf("[FNT] scaning pid %d operator %d\n", pid, operator_id); - if (dmx->sectionFilter(pid, filter, mask, 3) < 0) { + if (dmx->sectionFilter(pid, filter, mask, 3, 3000) < 0) { delete dmx; return false; } From b5a2b02ea4ea85b448d0d71ccbcacddcbffc4e24 Mon Sep 17 00:00:00 2001 From: martii Date: Sun, 15 Jun 2014 22:39:08 +0200 Subject: [PATCH 121/511] gui/epgview: replace left/right chars with corresponding icons Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5a66db2a079af9710c069da56e2e4d54673b7c20 Author: martii Date: 2014-06-15 (Sun, 15 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 2b46adf58..5b2df145c 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -666,17 +666,17 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start pb.paint(false); } - GetPrevNextEPGData( epgData.eventID, &epgData.epg_times.startzeit ); - if ((prev_id != 0) && !call_fromfollowlist) - { - frameBuffer->paintBoxRel(sx+ 5, sy+ oy- botboxheight+ 4, botboxheight- 8, botboxheight- 8, COL_MENUCONTENT_PLUS_3); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ 10, sy+ oy- 3, widthr, "<", COL_MENUCONTENT_TEXT_PLUS_3); - } + static int iw = 0, ih = 0; + if (!iw && !ih) + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_LEFT, &iw, &ih); - if ((next_id != 0) && !call_fromfollowlist) - { - frameBuffer->paintBoxRel(sx+ ox- botboxheight+ 8- 5, sy+ oy- botboxheight+ 4, botboxheight- 8, botboxheight- 8, COL_MENUCONTENT_PLUS_3); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ ox- botboxheight+ 8, sy+ oy- 3, widthr, ">", COL_MENUCONTENT_TEXT_PLUS_3); + GetPrevNextEPGData( epgData.eventID, &epgData.epg_times.startzeit ); + if (!call_fromfollowlist) { + int iy = sy + oy - 3 - height/2 - iw/2; + if (prev_id) + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_LEFT, sx + 5, iy); + if (next_id) + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RIGHT, sx + ox - iw - 5, iy); } if ( doLoop ) From 4510c876ffeb52a829e5777bd1c08732de2965b0 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 16 Jun 2014 14:35:15 +0400 Subject: [PATCH 122/511] zapit/src/frontend.cpp: fix cable tune log Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9562d40c99aa300bd0c365ef0edfea93e5ad3c45 Author: [CST] Focus Date: 2014-06-16 (Mon, 16 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/src/frontend.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index 12cfdc254..0ccb82579 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -1201,6 +1201,7 @@ int CFrontend::setParameters(TP_params *TP, bool nowait) break; } #endif + break; case FE_OFDM: if (freq < 1000*1000) feparams.dvb_feparams.frequency = freq * 1000; From 3bffc68dba17f4bfba514da59fb0707ed8b2dbab Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 19 Jun 2014 14:25:17 +0200 Subject: [PATCH 123/511] yWeb: fix MODE_RADIO/MODE keys in RCUs Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c853231b1f022f650d3cc2c3ed24bac2e6b68bc2 Author: vanhofen Date: 2014-06-19 (Thu, 19 Jun 2014) Origin message was: ------------------ - yWeb: fix MODE_RADIO/MODE keys in RCUs ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/web/Y_Blocks.txt | 12 ++++++------ src/nhttpd/web/Y_Version.txt | 4 ++-- src/nhttpd/web/languages/Deutsch | 3 ++- src/nhttpd/web/languages/English | 3 ++- src/nhttpd/web/languages/Slovak | 3 ++- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/nhttpd/web/Y_Blocks.txt b/src/nhttpd/web/Y_Blocks.txt index 4f6c332ac..63b2711ad 100644 --- a/src/nhttpd/web/Y_Blocks.txt +++ b/src/nhttpd/web/Y_Blocks.txt @@ -652,12 +652,12 @@ start-block~map_rc_cst_v3_v4 standby mute - tv/radio + tv/radio skip- skip+ - + vformat sleep audio help @@ -738,9 +738,9 @@ start-block~rc_cst_v5 7 8 9 - + vformat 0 - tv/radio + tv/radio ok up @@ -794,8 +794,8 @@ start-block~rc_cst_v6 mute sat - tv-radio - + tv-radio + vformat skip+ skip- picsize diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index 8c0df9096..df418630b 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.8.0.60 -date=01.04.2014 +version=2.8.0.61 +date=19.06.2014 type=Release info=Port CST diff --git a/src/nhttpd/web/languages/Deutsch b/src/nhttpd/web/languages/Deutsch index 3ce68695e..af16357b0 100644 --- a/src/nhttpd/web/languages/Deutsch +++ b/src/nhttpd/web/languages/Deutsch @@ -562,7 +562,8 @@ rc.key_volumeup=Vol+ rc.key_volumedown=Vol- rc.key_pageup=Page+ rc.key_pagedown=Page- -rc.key_mode=TV/Radio +rc.key_radio=TV/Radio +rc.key_mode=Video Format rc.key_next=Skip- rc.key_previous=Skip+ rc.key_sleep=Sleep diff --git a/src/nhttpd/web/languages/English b/src/nhttpd/web/languages/English index 7bd7a6689..1faa29a56 100644 --- a/src/nhttpd/web/languages/English +++ b/src/nhttpd/web/languages/English @@ -565,7 +565,8 @@ rc.key_volumeup=Vol+ rc.key_volumedown=Vol- rc.key_pageup=Page+ rc.key_pagedown=Page- -rc.key_mode=TV/Radio +rc.key_radio=TV/Radio +rc.key_mode=Video Format rc.key_next=Skip- rc.key_previous=Skip+ rc.key_sleep=Sleep diff --git a/src/nhttpd/web/languages/Slovak b/src/nhttpd/web/languages/Slovak index dd984399d..1d45f5f24 100644 --- a/src/nhttpd/web/languages/Slovak +++ b/src/nhttpd/web/languages/Slovak @@ -563,7 +563,8 @@ rc.key_volumeup=Hlas+ rc.key_volumedown=Hlas- rc.key_pageup=Strana+ rc.key_pagedown=Strana- -rc.key_mode=TV/Radio +rc.key_radio=TV/Radio +rc.key_mode=Video Format rc.key_next=Preskočiť- rc.key_previous=Preskočiť+ rc.key_sleep=Uspať From c70e531529a9eacc6c652339c898ff0329a39f7a Mon Sep 17 00:00:00 2001 From: martii Date: Thu, 19 Jun 2014 18:01:59 +0200 Subject: [PATCH 124/511] gui/infoviewer: remove no longer used class member "old_timestr" Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e4801974beccb9f184ef3b40e351e61d71a641c3 Author: martii Date: 2014-06-19 (Thu, 19 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 1 - src/gui/infoviewer.h | 1 - 2 files changed, 2 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 59e808742..bfe37ae22 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -108,7 +108,6 @@ CInfoViewer::CInfoViewer () time_dot_width = 0; time_width = 0; time_height = 0; - old_timestr[0] = 0; lastsnr = 0; lastsig = 0; lasttime = 0; diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index e842f18eb..ee541c62d 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -96,7 +96,6 @@ class CInfoViewer int info_time_width; bool newfreq ; - char old_timestr[10]; static const short bar_width = 72; static event_id_t last_curr_id, last_next_id; uint64_t timeoutEnd; From 0ba1ddf21caaddaf9681472cb6da1812be4ebdd2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 23 Jun 2014 17:05:44 +0200 Subject: [PATCH 125/511] channellist: add colored progressbars * thx to bazi98, martii and benny Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/df1c8ac00dc76ef9173acc7082f0690c2ef5eecd Author: vanhofen Date: 2014-06-23 (Mon, 23 Jun 2014) Origin message was: ------------------ - channellist: add colored progressbars * thx to bazi98, martii and benny ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 4 +++- src/gui/channellist.cpp | 20 +++++++++++++------- src/gui/osd_setup.cpp | 12 ++++++++++-- src/neutrino.cpp | 4 ++-- src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ 7 files changed, 34 insertions(+), 12 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 3489b8d07..43bebc92c 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -218,6 +218,8 @@ channellist.edit Bearbeiten channellist.epgtext_align_left links channellist.epgtext_align_right rechts channellist.extended Sendungsfortschritt anzeigen +channellist.extended_colored mit farbigem Fortschrittsbalken +channellist.extended_simple mit einfachem Fortschrittsbalken channellist.favs Favoriten channellist.foot Kanalinformationen channellist.foot_freq Tuning-Parameter diff --git a/data/locale/english.locale b/data/locale/english.locale index 0b3420de8..e2909c286 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -217,7 +217,9 @@ channellist.current_tp Current transponder channellist.edit Edit channellist.epgtext_align_left left channellist.epgtext_align_right right -channellist.extended Show progressbars +channellist.extended Show event progress +channellist.extended_colored with colored progressbar +channellist.extended_simple with simple progressbar channellist.favs Favoriten channellist.foot Channel Information channellist.foot_freq Sat/Freq Info diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 1681dd831..3e3c8ed77 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2031,9 +2031,15 @@ void CChannelList::paintItem(int pos, const bool firstpaint) l = snprintf(nameAndDescription, sizeof(nameAndDescription), "%s", chan->getName().c_str()); int pb_space = prg_offset - title_offset; - CProgressBar pb(x+5+numwidth + title_offset, ypos + fheight/4, pb_space + 2, fheight/2); /* never colored */ - pb.setFrameThickness(2); - int pb_max = pb_space - 4; + bool pb_colored = ((g_settings.channellist_extended == 2) && g_settings.progressbar_color); + int pb_frame = pb_colored ? 0 : 1; + CProgressBar pb(x+5+numwidth + title_offset, ypos + fheight/4, pb_space, fheight/2, + color, bgcolor, COL_MENUCONTENTDARK_PLUS_0, color, COL_MENUCONTENT_PLUS_1, + pb_colored, 0, 100, 70); + pb.setCornerType(0); + pb.setFrameThickness(pb_frame); + + int pb_max = pb_space - (2*pb_frame); if (!(p_event->description.empty())) { snprintf(nameAndDescription+l, sizeof(nameAndDescription)-l,g_settings.channellist_epgtext_align_right ? " ":" - "); unsigned int ch_name_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(nameAndDescription); @@ -2074,9 +2080,9 @@ void CChannelList::paintItem(int pos, const bool firstpaint) } if (liststart + pos != selected) - pb.setStatusColors(COL_MENUCONTENT_PLUS_3, COL_MENUCONTENT_PLUS_1); + pb.setPassiveColor(COL_MENUCONTENT_PLUS_3); else - pb.setStatusColors(COL_MENUCONTENTSELECTED_PLUS_2, COL_MENUCONTENTSELECTED_PLUS_0); + pb.setPassiveColor(COL_MENUCONTENTSELECTED_PLUS_2); pb.setValues(runningPercent, pb_max); pb.paint(); } @@ -2095,9 +2101,9 @@ void CChannelList::paintItem(int pos, const bool firstpaint) else { if(g_settings.channellist_extended) { if (liststart + pos != selected) - pb.setStatusColors(COL_MENUCONTENT_PLUS_2, COL_MENUCONTENT_PLUS_1); + pb.setPassiveColor(COL_MENUCONTENT_PLUS_1); else - pb.setStatusColors(COL_MENUCONTENTSELECTED_PLUS_2, COL_MENUCONTENTSELECTED_PLUS_0); + pb.setPassiveColor(COL_MENUCONTENTSELECTED_PLUS_2); pb.setValues(0, pb_max); pb.setZeroLine(); pb.paint(); diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 7006b7627..e7a0a9aee 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -436,6 +436,14 @@ const CMenuOptionChooser::keyval CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS[CHANNE { 1 , LOCALE_CHANNELLIST_EPGTEXT_ALIGN_RIGHT } }; +#define CHANNELLIST_EXTENDED_OPTIONS_COUNT 3 +const CMenuOptionChooser::keyval CHANNELLIST_EXTENDED_OPTIONS[CHANNELLIST_EXTENDED_OPTIONS_COUNT]= +{ + { 0, LOCALE_OPTIONS_OFF }, //none + { 1, LOCALE_CHANNELLIST_EXTENDED_SIMPLE }, //unicolor + { 2, LOCALE_CHANNELLIST_EXTENDED_COLORED } //colored +}; + #define OPTIONS_COLORED_EVENTS_OPTION_COUNT 3 const CMenuOptionChooser::keyval OPTIONS_COLORED_EVENTS_OPTIONS[OPTIONS_COLORED_EVENTS_OPTION_COUNT] = { @@ -933,7 +941,7 @@ void COsdSetup::showOsdChanlistSetup(CMenuWidget *menu_chanlist) menu_chanlist->addItem(mc); // extended channel list - mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, CHANNELLIST_EXTENDED_OPTIONS, CHANNELLIST_EXTENDED_OPTIONS_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EXTENDED); menu_chanlist->addItem(mc); @@ -1114,7 +1122,7 @@ int COsdSetup::showContextChanlistMenu() mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EPG_ALIGN); menu_chanlist->addItem(mc); - mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, CHANNELLIST_EXTENDED_OPTIONS, CHANNELLIST_EXTENDED_OPTIONS_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EXTENDED); menu_chanlist->addItem(mc); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index e506c37a7..2e922867f 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -660,7 +660,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.channellist_additional = configfile.getInt32("channellist_additional", 2); //default minitv g_settings.eventlist_additional = configfile.getInt32("eventlist_additional", 0); g_settings.channellist_epgtext_align_right = configfile.getBool("channellist_epgtext_align_right" , false); - g_settings.channellist_extended = configfile.getBool("channellist_extended" , true); + g_settings.channellist_extended = configfile.getInt32("channellist_extended", 1); g_settings.channellist_foot = configfile.getInt32("channellist_foot" , 1);//default next Event g_settings.channellist_new_zap_mode = configfile.getInt32("channellist_new_zap_mode", 1); g_settings.channellist_sort_mode = configfile.getInt32("channellist_sort_mode", 0);//sort mode: alpha, freq, sat @@ -1156,7 +1156,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("eventlist_additional", g_settings.eventlist_additional); configfile.setInt32("channellist_additional", g_settings.channellist_additional); configfile.setBool("channellist_epgtext_align_right", g_settings.channellist_epgtext_align_right); - configfile.setBool("channellist_extended" , g_settings.channellist_extended); + configfile.setInt32("channellist_extended", g_settings.channellist_extended); configfile.setInt32("channellist_foot" , g_settings.channellist_foot); configfile.setInt32("channellist_new_zap_mode", g_settings.channellist_new_zap_mode); configfile.setInt32("remote_control_hardware", g_settings.remote_control_hardware); diff --git a/src/system/locals.h b/src/system/locals.h index da3c680f8..51943932f 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -245,6 +245,8 @@ typedef enum LOCALE_CHANNELLIST_EPGTEXT_ALIGN_LEFT, LOCALE_CHANNELLIST_EPGTEXT_ALIGN_RIGHT, LOCALE_CHANNELLIST_EXTENDED, + LOCALE_CHANNELLIST_EXTENDED_COLORED, + LOCALE_CHANNELLIST_EXTENDED_SIMPLE, LOCALE_CHANNELLIST_FAVS, LOCALE_CHANNELLIST_FOOT, LOCALE_CHANNELLIST_FOOT_FREQ, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 817bf87a8..ad7629dfb 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -245,6 +245,8 @@ const char * locale_real_names[] = "channellist.epgtext_align_left", "channellist.epgtext_align_right", "channellist.extended", + "channellist.extended_colored", + "channellist.extended_simple", "channellist.favs", "channellist.foot", "channellist.foot_freq", From 5c7441f5d1a0b31f0eafa5b9a247573123cbfd17 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 30 May 2014 11:55:39 +0200 Subject: [PATCH 126/511] COSDFader: rename member functions, adapt implementations Stop() is not exactly attributable if fader class used as inherited and Fade() don't tell really what done and related to return value 'bool'... especially as the fader class members have been not documented. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/69e2debb0291298436a77ed964190ed0323110c5 Author: Thilo Graf Date: 2014-05-30 (Fri, 30 May 2014) ------------------ This commit was generated by Migit --- src/driver/fade.cpp | 6 +++--- src/driver/fade.h | 8 ++++---- src/gui/bouquetlist.cpp | 6 +++--- src/gui/channellist.cpp | 8 ++++---- src/gui/dboxinfo.cpp | 6 +++--- src/gui/epgplus.cpp | 6 +++--- src/gui/epgview.cpp | 6 +++--- src/gui/eventlist.cpp | 6 +++--- src/gui/infoviewer.cpp | 12 ++++++------ src/gui/timerlist.cpp | 6 +++--- src/gui/widget/menue.cpp | 10 +++++----- 11 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/driver/fade.cpp b/src/driver/fade.cpp index 1b96ec95a..92a5fbe40 100644 --- a/src/driver/fade.cpp +++ b/src/driver/fade.cpp @@ -43,7 +43,7 @@ COSDFader::COSDFader(unsigned char & alpha) COSDFader::~COSDFader() { - Stop(); + StopFade(); } void COSDFader::StartFadeIn() @@ -85,7 +85,7 @@ bool COSDFader::StartFadeOut() return ret; } -void COSDFader::Stop() +void COSDFader::StopFade() { if ( fadeIn || fadeOut ) { g_RCInput->killTimer(fadeTimer); @@ -100,7 +100,7 @@ void COSDFader::Stop() } /* return true, if fade out done */ -bool COSDFader::Fade() +bool COSDFader::FadeDone() { bool ret = false; diff --git a/src/driver/fade.h b/src/driver/fade.h index e9d472d28..83c81ef60 100644 --- a/src/driver/fade.h +++ b/src/driver/fade.h @@ -36,12 +36,12 @@ class COSDFader CFrameBuffer *frameBuffer; public: COSDFader(unsigned char &alpha); - ~COSDFader(); + virtual ~COSDFader(); void StartFadeIn(); bool StartFadeOut(); - void Stop(); - bool Fade(); - uint32_t GetTimer() { return fadeTimer; }; + void StopFade(); + bool FadeDone(); + uint32_t GetFadeTimer() { return fadeTimer; }; }; #endif diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index dc5cae9aa..7c5a0a669 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -419,8 +419,8 @@ int CBouquetList::show(bool bShowChannelList) if ( msg <= CRCInput::RC_MaxRC ) timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); - if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetTimer())) { - if(fader.Fade()) + if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) { + if(fader.FadeDone()) loop = false; } else if ((msg == CRCInput::RC_timeout ) || @@ -561,7 +561,7 @@ int CBouquetList::show(bool bShowChannelList) } hide(); - fader.Stop(); + fader.StopFade(); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); if (save_bouquets) { diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 3e3c8ed77..c02287740 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -672,8 +672,8 @@ int CChannelList::show() if ( msg <= CRCInput::RC_MaxRC ) timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); - if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetTimer())) { - if(fader.Fade()) { + if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) { + if(fader.FadeDone()) { loop = false; } } @@ -757,7 +757,7 @@ int CChannelList::show() } else if ( msg == CRCInput::RC_setup) { old_b_id = bouquetList->getActiveBouquetNumber(); - fader.Stop(); + fader.StopFade(); int ret = doChannelMenu(); if (ret != 0) CNeutrinoApp::getInstance()->MarkChannelListChanged(); @@ -980,7 +980,7 @@ int CChannelList::show() new_zap_mode = 0; hide(); - fader.Stop(); + fader.StopFade(); } if (bShowBouquetList) { diff --git a/src/gui/dboxinfo.cpp b/src/gui/dboxinfo.cpp index 70ff43ce2..0821a4b84 100644 --- a/src/gui/dboxinfo.cpp +++ b/src/gui/dboxinfo.cpp @@ -104,8 +104,8 @@ int CDBoxInfoWidget::exec(CMenuTarget* parent, const std::string &) { g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd ); - if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetTimer())) { - if(fader.Fade()) + if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) { + if(fader.FadeDone()) doLoop = false; } else if((msg == NeutrinoMessages::EVT_TIMER) && (data == updateTimer)) { @@ -151,7 +151,7 @@ int CDBoxInfoWidget::exec(CMenuTarget* parent, const std::string &) } hide(); - fader.Stop(); + fader.StopFade(); g_RCInput->killTimer(updateTimer); return res; } diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index ae0ff408d..349946b63 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -817,8 +817,8 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu timeoutEnd = CRCInput::calcTimeoutEnd (g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); - if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetTimer())) { - if(fader.Fade()) + if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) { + if(fader.FadeDone()) loop = false; } else if ((msg == CRCInput::RC_timeout) || (msg == (neutrino_msg_t) g_settings.key_channelList_cancel)) { @@ -1148,7 +1148,7 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu this->hide(); - fader.Stop(); + fader.StopFade(); #if 0 for (TChannelEntries::iterator It = this->displayedChannelEntries.begin(); It != this->displayedChannelEntries.end(); It++) { diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 5b2df145c..d7ad305cd 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -712,8 +712,8 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start pb.paint(false); } } - if(data == fader.GetTimer()) { - if(fader.Fade()) + if(data == fader.GetFadeTimer()) { + if(fader.FadeDone()) loop = false; } else @@ -973,7 +973,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } } hide(); - fader.Stop(); + fader.StopFade(); } return res; } diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 247d297ed..e923508bd 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -331,8 +331,8 @@ int CNeutrinoEventList::exec(const t_channel_id channel_id, const std::string& c if ( msg <= CRCInput::RC_MaxRC ) timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); - if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetTimer())) { - if(fader.Fade()) + if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) { + if(fader.FadeDone()) loop = false; } else if (msg == CRCInput::RC_timeout) @@ -680,7 +680,7 @@ int CNeutrinoEventList::exec(const t_channel_id channel_id, const std::string& c if(!dont_hide){ hide(); - fader.Stop(); + fader.StopFade(); } return res; } diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index bfe37ae22..4d9a7afe7 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -876,8 +876,8 @@ void CInfoViewer::loop(bool show_dot) else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { g_RCInput->postMsg (NeutrinoMessages::SHOW_EPG, 0); res = messages_return::cancel_info; - } else if ((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetTimer())) { - if(fader.Fade()) + } else if ((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) { + if(fader.FadeDone()) res = messages_return::cancel_info; } else if ((msg == CRCInput::RC_ok) || (msg == CRCInput::RC_home) || (msg == CRCInput::RC_timeout)) { if(fader.StartFadeOut()) @@ -927,7 +927,7 @@ void CInfoViewer::loop(bool show_dot) } else { if (msg == CRCInput::RC_standby) { g_RCInput->killTimer (sec_timer_id); - fader.Stop(); + fader.StopFade(); } res = neutrino->handleMsg (msg, data); if (res & messages_return::unhandled) { @@ -975,7 +975,7 @@ void CInfoViewer::loop(bool show_dot) } g_RCInput->killTimer (sec_timer_id); - fader.Stop(); + fader.StopFade(); if (virtual_zap_mode) { /* if bouquet cycle set, do virtual over current bouquet */ if (/*g_settings.zap_cycle && */ /* (bouquetList != NULL) && */ !(bouquetList->Bouquets.empty())) @@ -1282,9 +1282,9 @@ int CInfoViewer::handleMsg (const neutrino_msg_t msg, neutrino_msg_data_t data) //Set_CA_Status (data); return messages_return::handled; } else if (msg == NeutrinoMessages::EVT_TIMER) { - if (data == fader.GetTimer()) { + if (data == fader.GetFadeTimer()) { // here, the event can only come if there is another window in the foreground! - fader.Stop(); + fader.StopFade(); return messages_return::handled; } else if (data == lcdUpdateTimer) { //printf("CInfoViewer::handleMsg: lcdUpdateTimer\n"); diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 5d6accc03..dbbe7eff6 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -508,8 +508,8 @@ int CTimerList::show() timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings ::TIMING_MENU]); - if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetTimer())) { - if(fader.Fade()) + if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) { + if(fader.FadeDone()) loop = false; } else if ( ( msg == CRCInput::RC_timeout ) || @@ -679,7 +679,7 @@ int CTimerList::show() } } hide(); - fader.Stop(); + fader.StopFade(); return(res); } diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index ff94033de..d02ac880a 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -563,7 +563,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) std::map::iterator it = keyActionMap.find(msg); if (it != keyActionMap.end()) { - fader.Stop(); + fader.StopFade(); int rv = it->second.menue->exec(this, it->second.action); switch ( rv ) { case menu_return::RETURN_EXIT_ALL: @@ -611,8 +611,8 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) switch (msg) { case (NeutrinoMessages::EVT_TIMER): - if(data == fader.GetTimer()) { - if(fader.Fade()) + if(data == fader.GetFadeTimer()) { + if(fader.FadeDone()) msg = CRCInput::RC_timeout; } else { if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { @@ -699,7 +699,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) if (!item->isSelectable()) break; item->msg = msg; - fader.Stop(); + fader.StopFade(); int rv = item->exec( this ); switch ( rv ) { case menu_return::RETURN_EXIT_ALL: @@ -773,7 +773,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) delete[] background; background = NULL; - fader.Stop(); + fader.StopFade(); if(!parent) if(oldLcdMode != CVFD::getInstance()->getMode()) From 11ad899d7d0368a3d115f52394b5b737f032190b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 30 May 2014 20:56:08 +0200 Subject: [PATCH 127/511] CFrameBuffer: reduce fade time 10000 seems to bee too much for nice handling Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c41b4fd015521a8864654903eabb64e8b54c9d6e Author: Thilo Graf Date: 2014-05-30 (Fri, 30 May 2014) ------------------ This commit was generated by Migit --- src/driver/framebuffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/framebuffer.h b/src/driver/framebuffer.h index 401b572c6..aafd378a6 100644 --- a/src/driver/framebuffer.h +++ b/src/driver/framebuffer.h @@ -50,7 +50,7 @@ typedef struct fb_var_screeninfo t_fb_var_screeninfo; #define CORNER_BOTTOM 0xC #define CORNER_ALL 0xF -#define FADE_TIME 10000 +#define FADE_TIME 1750 #define FADE_STEP 5 #define FADE_RESET 0xFFFF From 800cb803c835c6438fe3027b41b6559a97639fa8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 30 May 2014 21:53:29 +0200 Subject: [PATCH 128/511] CComponents: inherit COSDFader class Allows a simplified implementation without prior declaration and initialisation Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/53cf57876c63c7f51966dda9539da81efaa5505b Author: Thilo Graf Date: 2014-05-30 (Fri, 30 May 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_base.cpp | 2 +- src/gui/components/cc_base.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_base.cpp b/src/gui/components/cc_base.cpp index 22b06f7f8..33f074794 100644 --- a/src/gui/components/cc_base.cpp +++ b/src/gui/components/cc_base.cpp @@ -35,7 +35,7 @@ using namespace std; //abstract basic class CComponents -CComponents::CComponents() +CComponents::CComponents() : COSDFader(g_settings.menu_Content_alpha) { x = saved_screen.x = 0; y = saved_screen.y = 0; diff --git a/src/gui/components/cc_base.h b/src/gui/components/cc_base.h index 40e764c00..7a9fc262b 100644 --- a/src/gui/components/cc_base.h +++ b/src/gui/components/cc_base.h @@ -32,13 +32,13 @@ #include #include #include - +#include /// Basic component class. /*! Basic attributes and member functions for component sub classes */ -class CComponents +class CComponents : public COSDFader { private: ///pixel buffer handling, returns pixel buffer depends of given parameters From af84eac9f0904efef2ee51d76e74de811316b095 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 1 Jun 2014 21:04:50 +0200 Subject: [PATCH 129/511] CComponentsWindow: add possibilty to add sidebars in window objects This allows to add objects in to window on left or right site. eg. for navigation icons or other similar stuff. Default this feature is disabled. to enable with methode enableSidebar(TYPE); With parameter CC_WINDOW_LEFT_SIDEBAR, CC_WINDOW_RIGHT_SIDEBAR or both. Width of sidebar can be changed with methode setWidthSidebar(int) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f21c1195177b4d005de6bab551875d08104019fa Author: Thilo Graf Date: 2014-06-01 (Sun, 01 Jun 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_window.cpp | 122 +++++++++++++++++++++++++-- src/gui/components/cc_frm_window.h | 31 ++++++- 2 files changed, 146 insertions(+), 7 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index ed0d536ad..149004cc2 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -32,6 +32,29 @@ #include using namespace std; +/* + scheme of window object + + +x,y----------------------------------------------------------------+ + |+-----------------------------------------------------------------+| + ||header (ccw_head) || + |+---+-------------------------------------------------------+----+|| + ||left |body (ccw_body) |right|| + ||side | |side || + ||bar | |bar || + || | | || + || | | || + || | | || + || | | || + || | | || + || | | || + || | | || + |+-----+-----------------------------------------------------+-----+| + ||footer (ccw_footer) || + |+-----------------------------------------------------------------+| + +-------------------------------------------------------------------+ +*/ + //------------------------------------------------------------------------------------------------------- //sub class CComponentsWindow inherit from CComponentsForm CComponentsWindow::CComponentsWindow(CComponentsForm *parent) @@ -117,6 +140,8 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const col_shadow = color_shadow; ccw_head = NULL; + ccw_left_sidebar= NULL; + ccw_right_sidebar= NULL; ccw_body = NULL; ccw_footer = NULL; @@ -124,6 +149,9 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const ccw_show_footer = true; ccw_show_header = true; ccw_align_mode = CTextBox::NO_AUTO_LINEBREAK; + ccw_show_l_sideber = false; + ccw_show_r_sideber = false; + ccw_w_sidebar = 40; initCCWItems(); initParent(parent); @@ -187,6 +215,46 @@ void CComponentsWindow::initFooter() } } +void CComponentsWindow::initLeftSideBar() +{ + if (ccw_left_sidebar== NULL) + ccw_left_sidebar = new CComponentsFrmChain(); + //set side bar properties + if (ccw_left_sidebar){ + ccw_left_sidebar->setCornerType(0); + int h_footer = 0; + int h_header = 0; + if (ccw_footer) + h_footer = ccw_footer->getHeight(); + if (ccw_head) + h_header = ccw_head->getHeight(); + int h_sbar = height - h_header - h_footer - 2*fr_thickness; + int w_sbar = ccw_w_sidebar; + ccw_left_sidebar->setDimensionsAll(0, CC_APPEND, w_sbar, h_sbar); + ccw_left_sidebar->doPaintBg(false); + } +} + +void CComponentsWindow::initRightSideBar() +{ + if (ccw_right_sidebar== NULL) + ccw_right_sidebar = new CComponentsFrmChain(); + //set side bar properties + if (ccw_right_sidebar){ + ccw_right_sidebar->setCornerType(0); + int h_footer = 0; + int h_header = 0; + if (ccw_footer) + h_footer = ccw_footer->getHeight(); + if (ccw_head) + h_header = ccw_head->getHeight(); + int h_sbar = height - h_header - h_footer - 2*fr_thickness; + int w_sbar = ccw_w_sidebar; + ccw_right_sidebar->setDimensionsAll(width - w_sbar, CC_APPEND, w_sbar, h_sbar); + ccw_right_sidebar->doPaintBg(false); + } +} + void CComponentsWindow::initBody() { if (ccw_body== NULL) @@ -195,14 +263,23 @@ void CComponentsWindow::initBody() //set body properties if (ccw_body){ ccw_body->setCornerType(0); - int fh = 0; - int hh = 0; + int h_footer = 0; + int h_header = 0; + int w_l_sidebar = 0; + int w_r_sidebar = 0; if (ccw_footer) - fh = ccw_footer->getHeight(); + h_footer = ccw_footer->getHeight(); if (ccw_head) - hh = ccw_head->getHeight(); - int h_body = height - hh - fh - 2*fr_thickness; - ccw_body->setDimensionsAll(0, CC_APPEND, width-2*fr_thickness, h_body); + h_header = ccw_head->getHeight(); + if (ccw_left_sidebar) + w_l_sidebar = ccw_left_sidebar->getWidth(); + if (ccw_right_sidebar) + w_r_sidebar = ccw_right_sidebar->getWidth(); + int h_body = height - h_header - h_footer - 2*fr_thickness; + int x_body = w_l_sidebar; + int w_body = width-2*fr_thickness - w_l_sidebar - w_r_sidebar; + + ccw_body->setDimensionsAll(x_body, CC_APPEND, w_body, h_body); ccw_body->doPaintBg(false); } } @@ -230,7 +307,28 @@ void CComponentsWindow::initCCWItems() ccw_footer = NULL; } } + + //add/remove left sidebar + if (ccw_show_l_sideber){ + initLeftSideBar(); + }else{ + if (ccw_left_sidebar){ + removeCCItem(ccw_left_sidebar); + ccw_left_sidebar = NULL; + } + } + //add/remove right sidebar + if (ccw_show_r_sideber){ + initRightSideBar(); + }else{ + if (ccw_right_sidebar){ + removeCCItem(ccw_right_sidebar); + ccw_right_sidebar = NULL; + } + } + + //init window body core initBody(); //add header, body and footer items only one time @@ -244,6 +342,18 @@ void CComponentsWindow::initCCWItems() addCCItem(ccw_footer); } +void CComponentsWindow::enableSidebar(const int& sidbar_type) +{ + ccw_show_l_sideber = ccw_show_r_sideber = false; + + if (sidbar_type & CC_WINDOW_LEFT_SIDEBAR) + ccw_show_l_sideber = true; + if (sidbar_type & CC_WINDOW_RIGHT_SIDEBAR) + ccw_show_r_sideber = true; + + initCCWItems(); +} + void CComponentsWindow::addWindowItem(CComponentsItem* cc_Item) { if (ccw_body) diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index 30838c1c2..9bd47a870 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.h @@ -57,6 +57,10 @@ class CComponentsWindow : public CComponentsForm protected: ///object: header object, to get access to header properties see also getHeaderObject() CComponentsHeader * ccw_head; + ///object: left sidebar chain object, this is a container that contains sidebar items + CComponentsFrmChain * ccw_left_sidebar; + ///object: right sidebar chain object, this is a container that contains sidebar items + CComponentsFrmChain * ccw_right_sidebar; ///object: body object, this is the container for all needed items, to add with addWindowItem() CComponentsForm * ccw_body; ///object: footer object, to get access to header properties see also getFooterObject( @@ -73,9 +77,19 @@ class CComponentsWindow : public CComponentsForm bool ccw_show_footer; ///property: value = true, let show header, see showHeader() bool ccw_show_header; + ///property: value = true, let show left sidebar, see enableSideBar() + bool ccw_show_l_sideber; + ///property: value = true, let show right sidebar, see enableSidebar() + bool ccw_show_r_sideber; + ///width of sidebars + int ccw_w_sidebar; ///initialze header object void initHeader(); + ///initialze left sidebar object + void initLeftSideBar(); + ///initialze right sidebar object + void initRightSideBar(); ///initialze body object void initBody(); ///initialze footer object @@ -132,6 +146,14 @@ class CComponentsWindow : public CComponentsForm ///allow/disallow paint a header, default true, see also ccw_show_header, showFooter() void showHeader(bool show = true){ccw_show_header = show; initCCWItems();}; + enum + { + CC_WINDOW_LEFT_SIDEBAR = 1, + CC_WINDOW_RIGHT_SIDEBAR = 2 + }; + ///allow/disallow paint a sidebar, default are enabled + void enableSidebar(const int& sidbar_type = CC_WINDOW_LEFT_SIDEBAR | CC_WINDOW_RIGHT_SIDEBAR); + ///set caption in header with string, see also getHeaderObject() void setWindowCaption(const std::string& text, const int& align_mode = CTextBox::NO_AUTO_LINEBREAK){ccw_caption = text; ccw_align_mode = align_mode;}; @@ -141,7 +163,7 @@ class CComponentsWindow : public CComponentsForm void setWindowCaptionAlignment(const int& align_mode){ccw_align_mode = align_mode;}; ///set icon name in header, see also getHeaderObject() - void setWindowIcon(const std::string& iconname){ccw_icon_name = iconname;}; + void setWindowIcon(const std::string& iconname){ccw_icon_name = iconname; initHeader();}; ///set default header icon buttons, see also getHeaderObject() void setWindowHeaderButtons(const int& buttons){ccw_buttons = buttons;}; @@ -154,6 +176,13 @@ class CComponentsWindow : public CComponentsForm ///returns a pointer to the internal footer object, use this to get access to footer properities CComponentsFooter* getFooterObject(){return ccw_footer;}; + ///returns a pointer to the internal left side bar object, use this to get access to left sidebar properities + CComponentsFrmChain* getLeftSidebarObject(){return ccw_left_sidebar;}; + ///returns a pointer to the internal right side bar object, use this to get access to right sidebar properities + CComponentsFrmChain* getRightSidebarObject(){return ccw_right_sidebar;}; + + void setWidthSidebar(const int& sidebar_width){ccw_w_sidebar = sidebar_width; initCCWItems();}; + ///refresh position and dimension and reinitialize elemenatary properties void Refresh(){initCCWItems();}; From fabc25999045ec5171d62d195b314791ee763711 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 5 Jun 2014 15:29:04 +0200 Subject: [PATCH 130/511] CComponentsForm: add methode killCCItems() This methode is an equivalent version of CComponentsItem::kill() and allows to erase all items inside of a container at once. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/581b9c770136d5193b0959d55bed748891b47cee Author: Thilo Graf Date: 2014-06-05 (Thu, 05 Jun 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm.cpp | 7 +++++++ src/gui/components/cc_frm.h | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 2fbd8aae2..ed86f7c62 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -362,3 +362,10 @@ void CComponentsForm::hide(bool no_restore) //hide body hideCCItem(no_restore); } + +//erase or paint over rendered objects +void CComponentsForm::killCCItems(const fb_pixel_t& bg_color, bool ignore_parent) +{ + for(size_t i=0; ikill(bg_color, ignore_parent); +} diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index fc5b21dcd..a642a7aa6 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -50,6 +50,11 @@ class CComponentsForm : public CComponentsItem void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); void hide(bool no_restore = false); + + ///same like CComponentsItem::kill(), but erases all embedded items inside of parent at once, this = parent + ///NOTE: Items always have parent bindings to "this" and use the parent background color as default! Set parameter 'ignore_parent=true' to ignore parent background color! + virtual void killCCItems(const fb_pixel_t& bg_color, bool ignore_parent); + virtual void addCCItem(CComponentsItem* cc_Item); virtual void addCCItem(const std::vector &cc_items); virtual void insertCCItem(const uint& cc_item_id, CComponentsItem* cc_Item); From 5168291d011831bb71ca44075bd8eb5a29d0196b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 6 Jun 2014 18:59:34 +0200 Subject: [PATCH 131/511] CComponentsText: add function to get current text content from object Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/33202059cccda386d002ef8e61cb66b3dbf7bcae Author: Thilo Graf Date: 2014-06-06 (Fri, 06 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_item_text.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h index 74f90087a..aca43416b 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -139,6 +139,8 @@ class CComponentsText : public CComponentsItem, public CBox virtual bool setTextFromFile(const std::string& path_to_textfile, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL, const fb_pixel_t& color_text = 0); ///get text directly from a textfile, path as string is required virtual std::string getTextFromFile(const std::string& path_to_textfile); + ///returns current text content of text/label object as std::string + virtual std::string getText(){return ct_text;}; ///helper to remove linebreak chars from a string if needed virtual void removeLineBreaks(std::string& str); From 19684ff082fa235a988ad166a4bfe153e736bdfd Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 9 Jun 2014 14:35:39 +0200 Subject: [PATCH 132/511] CMenuWidget: add member to suppress paint of details line In some situations is it more senseful to suppress painting of details line. Required if menu window is painted over another window. The hide() functionality of detailsline paints only an empty background on screen so we have blank parts on screen. That looks bad. For example, this is to observe on context menu in channellist. We should see this as a workaround. It is not certain whether the details line is really needed in the future. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/793230e9a7b521b07bc9ac55ce9dc4c951b16980 Author: Thilo Graf Date: 2014-06-09 (Mon, 09 Jun 2014) ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 5 ++++- src/gui/widget/menue.h | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index d02ac880a..c0a1c6599 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -340,6 +340,7 @@ CMenuWidget::CMenuWidget() preselected = -1; details_line = NULL; info_box = NULL; + show_details_line = true; } CMenuWidget::CMenuWidget(const neutrino_locale_t Name, const std::string & Icon, const int mwidth, const mn_widget_id_t &w_index) @@ -364,6 +365,7 @@ void CMenuWidget::Init(const std::string & Icon, const int mwidth, const mn_widg frameBuffer = CFrameBuffer::getInstance(); iconfile = Icon; details_line = new CComponentsDetailLine(); + show_details_line = true; info_box = new CComponentsInfoBox(); //handle select values @@ -1184,7 +1186,8 @@ void CMenuWidget::paintHint(int pos) } //paint result - details_line->paint(savescreen); + if (show_details_line) + details_line->paint(savescreen); info_box->paint(savescreen); hint_painted = true; diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index ce311e3fc..e518034f8 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -630,7 +630,7 @@ class CMenuWidget : public CMenuTarget CComponentsDetailLine *details_line; CComponentsInfoBox *info_box; int hint_height; - + bool show_details_line; protected: std::string nameString; neutrino_locale_t name; @@ -725,6 +725,7 @@ class CMenuWidget : public CMenuTarget }; void addKey(neutrino_msg_t key, CMenuTarget *menue, const std::string &action); void setFooter(const struct button_label *_fbutton_label, const int _fbutton_count, bool repaint = false); + void suppressDetailsLine(bool suppress = true){show_details_line = !suppress ? false : true;}; }; class CPINProtection From e990abf51676fa77bcd838595ba0315abfb7303a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 9 Jun 2014 14:56:12 +0200 Subject: [PATCH 133/511] CProgressWindow: implement CComponent classes This implement window functionality from CComponentsWindow, progress items from CProgressBar() and status text items from CComponentsLabel() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2f0e4e1687fb4e93db600da5ade63609f52aaf75 Author: Thilo Graf Date: 2014-06-09 (Mon, 09 Jun 2014) ------------------ This commit was generated by Migit --- src/gui/update.h | 2 +- src/gui/widget/progressstatus.h | 40 -------- src/gui/widget/progresswindow.cpp | 164 +++++++++++++----------------- src/gui/widget/progresswindow.h | 52 ++++------ src/system/flashtool.cpp | 2 +- src/system/flashtool.h | 6 +- src/system/httptool.cpp | 2 +- src/system/httptool.h | 6 +- 8 files changed, 99 insertions(+), 175 deletions(-) delete mode 100644 src/gui/widget/progressstatus.h diff --git a/src/gui/update.h b/src/gui/update.h index 05bb4cfe9..22f08d442 100644 --- a/src/gui/update.h +++ b/src/gui/update.h @@ -35,7 +35,7 @@ #define __update__ #include -#include + #include #include diff --git a/src/gui/widget/progressstatus.h b/src/gui/widget/progressstatus.h deleted file mode 100644 index 6b37930f3..000000000 --- a/src/gui/widget/progressstatus.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Neutrino-GUI - DBoxII-Project - - Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ - - 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 -*/ - - -#ifndef __progressstatus__ -#define __progressstatus__ - -#include - -class CProgress_StatusViewer -{ - public: - virtual void showGlobalStatus(const unsigned int prog) = 0; - virtual unsigned int getGlobalStatus(void) = 0; - virtual void showLocalStatus(const unsigned int prog) = 0; - virtual void showStatusMessageUTF(const std::string & text) = 0; - virtual void paint() = 0; -}; - -#endif diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 5b92197fb..c927ee49c 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -1,26 +1,24 @@ /* - $Id: progresswindow.cpp,v 1.16 2007/02/25 21:32:58 guenther Exp $ + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' - Neutrino-GUI - DBoxII-Project - - Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ + Implementation of CComponent Window class. + Copyright (C) 2014 Thilo Graf 'dbt' 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 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. + 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. + along with this program. If not, see . */ #ifdef HAVE_CONFIG_H @@ -33,39 +31,66 @@ #include #include +#include #include -#include -#include -CProgressWindow::CProgressWindow() +CProgressWindow::CProgressWindow(CComponentsForm *parent) +: CComponentsWindow(0, 0, 700, 200, string(), NEUTRINO_ICON_INFO, NULL, parent) { - frameBuffer = CFrameBuffer::getInstance(); - hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - int fw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getWidth(); - width = w_max (50*fw, 0); - height = h_max(hheight+5*mheight, 20); + Init(); +} - global_progress = local_progress = 101; - statusText = ""; - globalstatusX = 0; - globalstatusY = 0; - localstatusY = 0; - statusTextY = 0; +void CProgressWindow::Init() +{ + global_progress = local_progress = 100; - x = frameBuffer->getScreenX() + ((frameBuffer->getScreenWidth() - width ) >> 1 ); - y = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight() - height) >>1 ); + showFooter(false); + shadow = true; - caption = NONEXISTANT_LOCALE; + int x_item = 10; + int y_item = 10; + int w_item = width-2*x_item; + int h_item = 20; + + //create status text object + status_txt = new CComponentsLabel(); + status_txt->setDimensionsAll(x_item, y_item, w_item, h_item); + status_txt->setColorBody(col_body); + addWindowItem(status_txt); + y_item += 2*h_item; + + //create local_bar object + local_bar = new CProgressBar(); + local_bar->setDimensionsAll(x_item, y_item, w_item, h_item); + local_bar->setColorBody(col_body); + local_bar->setActiveColor(COL_MENUCONTENT_PLUS_7); + local_bar->setFrameThickness(2); + local_bar->setColorFrame(COL_MENUCONTENT_PLUS_7); + addWindowItem(local_bar); + y_item += 2*h_item; + + //create global_bar object + global_bar = new CProgressBar(); + global_bar->setDimensionsAll(x_item, y_item, w_item, h_item); + global_bar->setColorBody(col_body); + global_bar->setActiveColor(COL_MENUCONTENT_PLUS_7); + global_bar->setFrameThickness(2); + global_bar->setColorFrame(COL_MENUCONTENT_PLUS_7); + addWindowItem(global_bar); + y_item += 2*h_item; + + height = y_item + ccw_head->getHeight() + 10; + + setCenterPos(); } void CProgressWindow::setTitle(const neutrino_locale_t title) { - caption = title; + setWindowCaption(title); #ifdef VFD_UPDATE - CVFD::getInstance()->showProgressBar2(-1,NULL,-1,g_Locale->getText(caption)); // set global text in VFD + CVFD::getInstance()->showProgressBar2(-1,NULL,-1,g_Locale->getText(ccw_caption)); // set global text in VFD #endif // VFD_UPDATE } @@ -76,20 +101,8 @@ void CProgressWindow::showGlobalStatus(const unsigned int prog) return; global_progress = prog; - - int pos = x + 10; - - if(global_progress != 0) - { - if (global_progress > 100) - global_progress = 100; - - pos += int( float(width-20)/100.0 * global_progress); - //vordergrund - frameBuffer->paintBox(x+10, globalstatusY,pos, globalstatusY+10, COL_MENUCONTENT_PLUS_7); - } - //hintergrund - frameBuffer->paintBox(pos, globalstatusY, x+width-10, globalstatusY+10, COL_MENUCONTENT_PLUS_2); + global_bar->setValues(prog, 100); + global_bar->paint(false); #ifdef VFD_UPDATE CVFD::getInstance()->showProgressBar2(-1,NULL,global_progress); @@ -102,33 +115,24 @@ void CProgressWindow::showLocalStatus(const unsigned int prog) return; local_progress = prog; - - int pos = x + 10; - - if (local_progress != 0) - { - if (local_progress > 100) - local_progress = 100; - - pos += int( float(width-20)/100.0 * local_progress); - //vordergrund - frameBuffer->paintBox(x+10, localstatusY,pos, localstatusY+10, COL_MENUCONTENT_PLUS_7); - } - //hintergrund - frameBuffer->paintBox(pos, localstatusY, x+width-10, localstatusY+10, COL_MENUCONTENT_PLUS_2); + local_bar->setValues(prog, 100); + local_bar->paint(false); #ifdef VFD_UPDATE CVFD::getInstance()->showProgressBar2(local_progress); #else - CVFD::getInstance()->showPercentOver(local_progress); + CVFD::getInstance()->showPercentOver((uint8_t)local_progress); #endif // VFD_UPDATE } void CProgressWindow::showStatusMessageUTF(const std::string & text) { - statusText = text; - frameBuffer->paintBox(x, statusTextY-mheight, x+width, statusTextY, COL_MENUCONTENT_PLUS_0); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10, statusTextY, width-20, text, COL_MENUCONTENT_TEXT); + string txt = text; + int w_txt = status_txt->getWidth(); + int h_txt = status_txt->getHeight(); + status_txt->setText(txt, CTextBox::CENTER, *CNeutrinoFonts::getInstance()->getDynFont(w_txt, h_txt, txt), COL_MENUCONTENT_TEXT); + + status_txt->paint(false); #ifdef VFD_UPDATE CVFD::getInstance()->showProgressBar2(-1,text.c_str()); // set local text in VFD @@ -141,35 +145,9 @@ unsigned int CProgressWindow::getGlobalStatus(void) return global_progress; } - -void CProgressWindow::hide() +void CProgressWindow::hide(bool no_restore) { - frameBuffer->paintBackgroundBoxRel(x,y, width,height); -} - -void CProgressWindow::paint() -{ - int ypos=y; - frameBuffer->paintBoxRel(x, ypos, width, hheight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); - if (caption != NONEXISTANT_LOCALE) - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10, ypos+ hheight, width - 10, g_Locale->getText(caption), COL_MENUHEAD_TEXT); - frameBuffer->paintBoxRel(x, ypos+ hheight, width, height- hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); - - ypos+= hheight + (mheight >>1); - statusTextY = ypos+mheight; - showStatusMessageUTF(statusText); - - ypos+= mheight; - localstatusY = ypos+ mheight-20; - showLocalStatus(0); - ypos+= mheight+10; - - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width- 10, g_Locale->getText(LOCALE_FLASHUPDATE_GLOBALPROGRESS), COL_MENUCONTENT_TEXT); - ypos+= mheight; - - globalstatusY = ypos+ mheight-20; - //ypos+= mheight >>1; - showGlobalStatus(global_progress); + CComponentsWindow::hide(no_restore); } int CProgressWindow::exec(CMenuTarget* parent, const std::string & /*actionKey*/) diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index 9b4282d4f..114b62fe0 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -1,24 +1,24 @@ /* - Neutrino-GUI - DBoxII-Project + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' - Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ + Implementation of CComponent Window class. + Copyright (C) 2014 Thilo Graf 'dbt' 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 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. + 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. + along with this program. If not, see . */ @@ -28,41 +28,27 @@ #include #include -#include "progressstatus.h" +#include #include "menue.h" #include -class CProgressWindow : public CMenuTarget, public CProgress_StatusViewer +class CProgressWindow : public CComponentsWindow, public CMenuTarget { - protected: + private: + CProgressBar *local_bar, *global_bar; + CComponentsLabel *status_txt; - CFrameBuffer *frameBuffer; - neutrino_locale_t caption; - - int x; - int y; - int width; - int height; - int hheight; // head font height - int mheight; // menu font height unsigned int global_progress; unsigned int local_progress; - int globalstatusX; - int globalstatusY; - int localstatusY; - int statusTextY; - std::string statusText; - - //---------------------------- + void Init(); public: - CProgressWindow(); + CProgressWindow(CComponentsForm *parent = NULL); void setTitle(const neutrino_locale_t title); - virtual void hide(); - virtual void paint(); + virtual void hide(bool no_restore = false); virtual int exec( CMenuTarget* parent, const std::string & actionKey ); diff --git a/src/system/flashtool.cpp b/src/system/flashtool.cpp index d3c3ce5c6..59bff8812 100644 --- a/src/system/flashtool.cpp +++ b/src/system/flashtool.cpp @@ -65,7 +65,7 @@ void CFlashTool::setMTDDevice( const std::string & mtddevice ) printf("flashtool.cpp: set mtd device to %s\n", mtddevice.c_str()); } -void CFlashTool::setStatusViewer( CProgress_StatusViewer* statusview ) +void CFlashTool::setStatusViewer( CProgressWindow* statusview ) { statusViewer = statusview; } diff --git a/src/system/flashtool.h b/src/system/flashtool.h index 7b19cb689..4885f98b4 100644 --- a/src/system/flashtool.h +++ b/src/system/flashtool.h @@ -33,7 +33,7 @@ #ifndef __flashtool__ #define __flashtool__ -#include +#include #include #include @@ -43,7 +43,7 @@ class CFlashTool { private: - CProgress_StatusViewer* statusViewer; + CProgressWindow* statusViewer; std::string mtdDevice; std::string ErrorMessage; @@ -61,7 +61,7 @@ class CFlashTool const std::string & getErrorMessage(void) const; void setMTDDevice( const std::string & mtddevice ); - void setStatusViewer( CProgress_StatusViewer* statusview ); + void setStatusViewer( CProgressWindow* statusview ); bool program( const std::string & filename, int globalProgressEndErase=-1, int globalProgressEndFlash=-1 ); bool readFromMTD( const std::string & filename, int globalProgressEnd=-1 ); diff --git a/src/system/httptool.cpp b/src/system/httptool.cpp index ab93c954c..1d5170d2d 100644 --- a/src/system/httptool.cpp +++ b/src/system/httptool.cpp @@ -37,7 +37,7 @@ CHTTPTool::CHTTPTool() userAgent = "neutrino/httpdownloader"; } -void CHTTPTool::setStatusViewer( CProgress_StatusViewer* statusview ) +void CHTTPTool::setStatusViewer( CProgressWindow* statusview ) { statusViewer = statusview; } diff --git a/src/system/httptool.h b/src/system/httptool.h index 21de18096..c0b3f487f 100644 --- a/src/system/httptool.h +++ b/src/system/httptool.h @@ -33,7 +33,7 @@ #ifndef __httptool__ #define __httptool__ -#include +#include #include @@ -44,12 +44,12 @@ class CHTTPTool int iGlobalProgressEnd; int iGlobalProgressBegin; - CProgress_StatusViewer* statusViewer; + CProgressWindow* statusViewer; static int show_progress( void *clientp, double dltotal, double dlnow, double ultotal, double ulnow); public: CHTTPTool(); - void setStatusViewer( CProgress_StatusViewer* statusview ); + void setStatusViewer( CProgressWindow* statusview ); bool downloadFile( const std::string & URL, const char * const downloadTarget, int globalProgressEnd=-1 ); From d10a1b79e42f159abb9f13e8cc576e9a2848443b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 13 Jun 2014 20:34:09 +0200 Subject: [PATCH 134/511] CComponents: epand method setFrameThickness() to change selected frame Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8bbd7024d94e3d2989e6e29778006e8531596d2a Author: Thilo Graf Date: 2014-06-13 (Fri, 13 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_base.cpp | 8 ++++++++ src/gui/components/cc_base.h | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_base.cpp b/src/gui/components/cc_base.cpp index 33f074794..17bc1d811 100644 --- a/src/gui/components/cc_base.cpp +++ b/src/gui/components/cc_base.cpp @@ -282,3 +282,11 @@ inline void CComponents::setYPos(const int& ypos) { y = ypos; } + +void CComponents::setFrameThickness(const int& thickness, const int& thickness_sel) +{ + fr_thickness = thickness; + + if (fr_thickness_sel != thickness_sel) + fr_thickness_sel = thickness_sel; +} diff --git a/src/gui/components/cc_base.h b/src/gui/components/cc_base.h index 7a9fc262b..973da83a0 100644 --- a/src/gui/components/cc_base.h +++ b/src/gui/components/cc_base.h @@ -81,9 +81,9 @@ class CComponents : public COSDFader ///property: width of shadow int shadow_w; - ///property: frame thickness + ///property: frame thickness, see also setFrameThickness() int fr_thickness; - ///property: frame thickness of selected component + ///property: frame thickness of selected component, see also setFrameThickness() int fr_thickness_sel; ///status: true=component was painted for 1st time @@ -194,7 +194,7 @@ class CComponents : public COSDFader inline virtual int getCornerRadius(){return corner_rad;}; ///set frame thickness - inline virtual void setFrameThickness(const int& thickness){fr_thickness = thickness;}; + virtual void setFrameThickness(const int& thickness, const int& thickness_sel = 3); ///switch shadow on/off ///Note: it's recommended to use #defines: CC_SHADOW_ON=true or CC_SHADOW_OFF=false as parameter, see also cc_types.h inline virtual void setShadowOnOff(bool has_shadow){shadow = has_shadow;}; From f2da159bdf45b340cc15f99aeedce7575907cb0e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 20 Jun 2014 17:20:15 +0200 Subject: [PATCH 135/511] CComponentsPicture: structure of class highly simplified It should be now easier to use images as objects. An initialized picture object should provide all relevant properties and some functionalities of picture viewer. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5eb63b951534333cf41acd7709ecf0b50ec2d84e Author: Thilo Graf Date: 2014-06-20 (Fri, 20 Jun 2014) Origin message was: ------------------ CComponentsPicture: structure of class highly simplified It should be now easier to use images as objects. An initialized picture object should provide all relevant properties and some functionalities of picture viewer. ------------------ This commit was generated by Migit --- src/gui/audiomute.cpp | 2 +- src/gui/components/cc_frm_button.cpp | 23 +-- src/gui/components/cc_frm_header.cpp | 11 +- src/gui/components/cc_frm_icons.cpp | 4 +- src/gui/components/cc_frm_slider.cpp | 1 - src/gui/components/cc_item_infobox.cpp | 2 +- src/gui/components/cc_item_picture.cpp | 226 +++++++++++-------------- src/gui/components/cc_item_picture.h | 94 ++++++---- src/gui/components/cc_item_tvpic.cpp | 2 +- src/gui/luainstance.cpp | 13 +- src/gui/test_menu.cpp | 7 +- src/gui/volumebar.cpp | 1 - 12 files changed, 190 insertions(+), 196 deletions(-) diff --git a/src/gui/audiomute.cpp b/src/gui/audiomute.cpp index f311f8277..954c4d714 100644 --- a/src/gui/audiomute.cpp +++ b/src/gui/audiomute.cpp @@ -34,7 +34,7 @@ #include #include -CAudioMute::CAudioMute():CComponentsPicture(0, 0, 0, 0, NEUTRINO_ICON_BUTTON_MUTE) +CAudioMute::CAudioMute():CComponentsPicture(0, 0, NEUTRINO_ICON_BUTTON_MUTE) { y_old = -1; paint_bg = false; diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index 6a023bacb..2de521890 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -108,7 +108,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const cc_item_selected = selected; fr_thickness = 3; append_x_offset = 6; - append_y_offset = append_x_offset; + append_y_offset = 0; corner_rad = RADIUS_MID; cc_btn_capt_col = COL_MENUCONTENT_TEXT; @@ -139,15 +139,16 @@ void CComponentsButton::initIcon() int h_icon = 0; frameBuffer->getIconSize(cc_btn_icon.c_str(), &w_icon, &h_icon); - int h_max = height-2*fr_thickness; - if (h_icon > h_max){ - int ratio = h_icon/h_max; - cc_btn_icon = frameBuffer->getIconBasePath() + cc_btn_icon; - cc_btn_icon += ".png"; - w_icon = w_icon*ratio; - } - - cc_btn_icon_obj = new CComponentsPicture(fr_thickness, CC_CENTERED, w_icon, h_max, cc_btn_icon, CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, this); + h_icon = min(height-2*fr_thickness, h_icon); +// if (h_icon != h_max){ +// int ratio = h_icon/h_max; +// cc_btn_icon = frameBuffer->getIconBasePath() + cc_btn_icon; +// cc_btn_icon += ".png"; +// w_icon = w_icon*ratio; +// } + + int y_icon = height/2 - h_icon/2; + cc_btn_icon_obj = new CComponentsPicture(fr_thickness, y_icon, w_icon, h_icon, cc_btn_icon, this); cc_btn_icon_obj->doPaintBg(false); } } @@ -183,7 +184,7 @@ void CComponentsButton::initCaption() but text render isn't wrong here, because capitalized chars or long chars like e. 'q', 'y' are considered! Therefore we here need other icons or a hack, that considers some different height values. */ - int y_cap = 0; + int y_cap = height/2 - h_cap/2 - fr_thickness; cc_btn_capt_obj->setDimensionsAll(x_cap, y_cap, w_cap, h_cap); diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 80b6236a1..48ed77bb8 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -109,7 +109,7 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const cch_btn_obj = NULL; cch_col_text = COL_MENUHEAD_TEXT; cch_caption_align = CTextBox::NO_AUTO_LINEBREAK; - cch_items_y = 0; + cch_items_y = CC_CENTERED; cch_offset = 8; cch_icon_x = cch_offset; cch_icon_w = 0; @@ -195,7 +195,7 @@ void CComponentsHeader::initIcon() //create instance for cch_icon_obj and add to container at once if (cch_icon_obj == NULL){ dprintf(DEBUG_DEBUG, "[CComponentsHeader]\n [%s - %d] init header icon: %s\n", __func__, __LINE__, cch_icon_name.c_str()); - cch_icon_obj = new CComponentsPicture(cch_icon_x, cch_items_y, 0, 0, cch_icon_name, CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, this); + cch_icon_obj = new CComponentsPicture(cch_icon_x, cch_items_y, 0, 0, cch_icon_name, this); } //set properties for icon object @@ -203,7 +203,8 @@ void CComponentsHeader::initIcon() //get dimensions of header icon int iw = 0; int ih = 0; - cch_icon_obj->getPictureSize(&iw, &ih); + cch_icon_obj->getImageSize(&iw, &ih); + dprintf(DEBUG_INFO, "[CComponentsHeader]\n [%s - %d] init icon size: iw = %d, ih = %d\n", __func__, __LINE__, iw, ih); cch_icon_obj->setWidth(iw); cch_icon_obj->setHeight(ih); cch_icon_obj->doPaintBg(false); @@ -222,8 +223,8 @@ void CComponentsHeader::initIcon() //global adapt height height = max(height, cch_icon_obj->getHeight()); - //re-align height of icon object - cch_icon_obj->setHeight(height); +// //re-align height of icon object +// cch_icon_obj->setHeight(height); } } diff --git a/src/gui/components/cc_frm_icons.cpp b/src/gui/components/cc_frm_icons.cpp index c8c3d52c5..6cb020cc2 100644 --- a/src/gui/components/cc_frm_icons.cpp +++ b/src/gui/components/cc_frm_icons.cpp @@ -80,7 +80,6 @@ void CComponentsIconForm::addIcon(const std::string& icon_name) chn_direction == CC_DIR_Y ? CC_APPEND : CC_CENTERED, 0, 0, icon_name, - CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, this); ccp->doPaintBg(false); @@ -99,8 +98,7 @@ void CComponentsIconForm::insertIcon(const uint& icon_id, const std::string& ico CComponentsPicture *ccp = new CComponentsPicture(chn_direction == CC_DIR_X ? CC_APPEND : CC_CENTERED, chn_direction == CC_DIR_Y ? CC_APPEND : CC_CENTERED, 0, 0, - icon_name, - CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER); + icon_name); ccp->doPaintBg(false); insertCCItem(icon_id, ccp); diff --git a/src/gui/components/cc_frm_slider.cpp b/src/gui/components/cc_frm_slider.cpp index bed4cbd64..e96d83c07 100644 --- a/src/gui/components/cc_frm_slider.cpp +++ b/src/gui/components/cc_frm_slider.cpp @@ -110,7 +110,6 @@ void CComponentsSlider::initCCSlBody() if (csl_body_obj){ csl_body_obj->setDimensionsAll(icon_x, icon_y, icon_w, icon_h); - csl_body_obj->setPictureAlign(CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER); } } diff --git a/src/gui/components/cc_item_infobox.cpp b/src/gui/components/cc_item_infobox.cpp index 30e41c234..4fa846ede 100644 --- a/src/gui/components/cc_item_infobox.cpp +++ b/src/gui/components/cc_item_infobox.cpp @@ -98,7 +98,7 @@ void CComponentsInfoBox::paintPicture() return; //init pic object and set icon paint position - pic = new CComponentsPicture(x+fr_thickness+x_offset, y+fr_thickness, 0, 0, ""); + pic = new CComponentsPicture(x+fr_thickness+x_offset, y+fr_thickness, ""); //define icon pic->setPicture(pic_name); diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index ecf5d1cc8..ba9bf9cd4 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -33,7 +33,7 @@ #include "cc_item_picture.h" #include #include -extern CPictureViewer * g_PicViewer; + using namespace std; @@ -41,18 +41,25 @@ using namespace std; //------------------------------------------------------------------------------------------------------- //sub class CComponentsPicture from CComponentsItem CComponentsPicture::CComponentsPicture( const int &x_pos, const int &y_pos, const int &w, const int &h, - const std::string& image_name, - const int &alignment, + const std::string& image_path, CComponentsForm *parent, bool has_shadow, fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow) { - init(x_pos, y_pos, w, h, image_name, alignment, parent, has_shadow, color_frame, color_background, color_shadow); + init(x_pos, y_pos, w, h, image_path, parent, has_shadow, color_frame, color_background, color_shadow); +} + +CComponentsPicture::CComponentsPicture( const int &x_pos, const int &y_pos, + const std::string& image_name, + CComponentsForm *parent, + bool has_shadow, + fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow) +{ + init(x_pos, y_pos, 0, 0, image_name, parent, has_shadow, color_frame, color_background, color_shadow); } void CComponentsPicture::init( const int &x_pos, const int &y_pos, const int &w, const int &h, const string& image_name, - const int &alignment, CComponentsForm *parent, bool has_shadow, fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow) @@ -61,8 +68,8 @@ void CComponentsPicture::init( const int &x_pos, const int &y_pos, const int &w, cc_item_type = CC_ITEMTYPE_PICTURE; //CComponents - x = pic_x = x_pos; - y = pic_y = y_pos; + x = x_pos; + y = y_pos; height = h; width = w; shadow = has_shadow; @@ -72,19 +79,14 @@ void CComponentsPicture::init( const int &x_pos, const int &y_pos, const int &w, col_shadow = color_shadow; //CComponentsPicture - pic_paint_mode = CC_PIC_IMAGE_MODE_AUTO, pic_name = image_name; - pic_align = alignment; - pic_offset = 1; - pic_paint = true; - pic_paintBg = false; - pic_painted = false; - do_paint = false; - pic_max_w = 0; - pic_max_h = 0; - if (pic_name.empty()) - pic_width = pic_height = 0; + is_icon = false; + is_image_painted= false; + do_paint = true; + + getSupportedImageFormats(v_ext); + v_ext.resize(unique(v_ext.begin(), v_ext.end()) - v_ext.begin()); initCCItem(); initParent(parent); } @@ -103,111 +105,87 @@ void CComponentsPicture::setPicture(const char* picture_name) setPicture(s_tmp); } -void CComponentsPicture::setPictureAlign(const int alignment) -{ - pic_align = alignment; - initCCItem(); -} - void CComponentsPicture::initCCItem() { - pic_width = pic_height = 0; - pic_painted = false; - do_paint = false; - - if (pic_name == "") + //handle size + int w_pic = width; + int h_pic = height; + + if (pic_name.empty()) return; - if (pic_max_w == 0) - pic_max_w = width-2*fr_thickness; + //check for path or name, set icon or image with full path + string::size_type pos = pic_name.find("/", 0); + is_icon = (pos == string::npos); - if (pic_max_h == 0) - pic_max_h = height-2*fr_thickness; + dprintf(DEBUG_INFO, "[CComponentsPicture] %s: detected image file: is_icon: %d (pos= %d), pic_name=%s\n", __func__, is_icon, pos, pic_name.c_str()); - //set the image mode depends of name syntax, icon names contains no path, - //so we can detect the required image mode - if (pic_paint_mode == CC_PIC_IMAGE_MODE_AUTO){ - if (!access(pic_name.c_str(), F_OK )) - pic_paint_mode = CC_PIC_IMAGE_MODE_ON; - else - pic_paint_mode = CC_PIC_IMAGE_MODE_OFF; + //get current image size + getImageSize(&w_pic, &h_pic); + + //for icons (names without explicit path) set dimensions of "this" to current image...//TODO: centering image/icon + if (is_icon){ + width = w_pic; + height = max(h_pic, height); + } + else{ //defined values ​​in constructor or defined via setters defined, have priority, value 0 is not allowed + if (width == 0) + width = w_pic; + if (height == 0) + height = h_pic; } - if (pic_paint_mode == CC_PIC_IMAGE_MODE_OFF){ - frameBuffer->getIconSize(pic_name.c_str(), &pic_width, &pic_height); -#if 0 - pic_width = max(pic_width, pic_max_w); - pic_height = max(pic_height, pic_max_h); -#endif + //resize/scale image if required, if no icon mode detected, use real image size + if (!is_icon){ + if (width != w_pic || height != h_pic) + rescaleImageDimensions(&w_pic, &h_pic, width, height); } - - if (pic_paint_mode == CC_PIC_IMAGE_MODE_ON) { - g_PicViewer->getSize(pic_name.c_str(), &pic_width, &pic_height); - if((pic_width > pic_max_w) || (pic_height > pic_max_h)) - g_PicViewer->rescaleImageDimensions(&pic_width, &pic_height, pic_max_w, pic_max_h); - } - - if (pic_width == 0 || pic_height == 0) - dprintf(DEBUG_DEBUG, "[CComponentsPicture] %s file: %s, no icon dimensions found! width = %d, height = %d\n", __func__, pic_name.c_str(), pic_width, pic_height); - - initPosition(); - - int sw = (shadow ? shadow_w :0); - width = max(max(pic_width, pic_max_w), width) + sw ; - height = max(max(pic_height, pic_max_h), height) + sw ; - - dprintf(DEBUG_DEBUG, "[CComponentsPicture] %s initialized Image: ====>> %s\n\titem x = %d\n\tdx = %d (image dx = %d)\n\titem y = %d\n\titem dy = %d (image dy = %d)\n", - __func__, pic_name.c_str(), x, width, pic_width, y, height, pic_height); } -void CComponentsPicture::initPosition() +void CComponentsPicture::initPosition(int *x_position, int *y_position) { //using of real x/y values to paint images if this picture object is bound in a parent form - int px = pic_x = x, py = pic_y = y; + *x_position = x; + *y_position = y; + if (cc_parent){ - px = cc_xr; - py = cc_yr; + *x_position = cc_xr; + *y_position = cc_yr; } +} - if (pic_height>0 && pic_width>0){ - if (pic_align & CC_ALIGN_LEFT) - pic_x = px+fr_thickness; - if (pic_align & CC_ALIGN_RIGHT) - pic_x = px+width-pic_width-fr_thickness; - if (pic_align & CC_ALIGN_TOP) - pic_y = py+fr_thickness; - if (pic_align & CC_ALIGN_BOTTOM) - pic_y = py+height-pic_height-fr_thickness; - if (pic_align & CC_ALIGN_HOR_CENTER) - pic_x = px+width/2-pic_width/2; - if (pic_align & CC_ALIGN_VER_CENTER) - pic_y = py+height/2-pic_height/2; - do_paint = true; - } +void CComponentsPicture::getImageSize(int* width_image, int *height_image) +{ + if (!is_icon) + CPictureViewer::getSize(pic_name.c_str(), width_image, height_image); + else + frameBuffer->getIconSize(pic_name.c_str(), width_image, height_image); } void CComponentsPicture::paintPicture() { - pic_painted = false; + is_image_painted = false; + //initialize image position + int x_pic = x; + int y_pic = y; + initPosition(&x_pic, &y_pic); - if (do_paint && cc_allow_paint){ - dprintf(DEBUG_DEBUG, "[CComponentsPicture] %s: paint image: %s (do_paint=%d) with mode %d\n", __func__, pic_name.c_str(), do_paint, pic_paint_mode); + if (pic_name.empty()) + return; - if (pic_paint_mode == CC_PIC_IMAGE_MODE_OFF) - pic_painted = frameBuffer->paintIcon(pic_name, pic_x, pic_y, 0 /*pic_max_h*/, pic_offset, pic_paint, pic_paintBg, col_body); - else if (pic_paint_mode == CC_PIC_IMAGE_MODE_ON) - pic_painted = g_PicViewer->DisplayImage(pic_name, pic_x, pic_y, pic_width, pic_height); + dprintf(DEBUG_INFO, "[CComponentsPicture] %s: paint image file: pic_name=%s\n", __func__, pic_name.c_str()); + if (cc_allow_paint){ + if (!is_icon) + is_image_painted = DisplayImage(pic_name, x_pic, y_pic, width, height); + else + is_image_painted = frameBuffer->paintIcon(pic_name, x_pic, y_pic, height, 1, do_paint, paint_bg, col_body); } - - if (pic_painted) - do_paint = false; } void CComponentsPicture::paint(bool do_save_bg) { - initCCItem(); paintInit(do_save_bg); paintPicture(); } @@ -215,69 +193,65 @@ void CComponentsPicture::paint(bool do_save_bg) void CComponentsPicture::hide(bool no_restore) { hideCCItem(no_restore); - pic_painted = false; + is_image_painted = false; } CComponentsChannelLogo::CComponentsChannelLogo( const int &x_pos, const int &y_pos, const int &w, const int &h, - const uint64_t& channelId, const std::string& channelName, - const int &alignment, + const uint64_t& channelId, CComponentsForm *parent, bool has_shadow, fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow) :CComponentsPicture(x_pos, y_pos, w, h, - "", alignment, parent, has_shadow, + "", parent, has_shadow, color_frame, color_background, color_shadow) { - channel_id = channelId; - channel_name = channelName; - initVarPictureChannellLogo(); + setChannel(channelId, channelName); + alt_pic_name = ""; } -void CComponentsChannelLogo::setPicture(const std::string& picture_name) +CComponentsChannelLogo::CComponentsChannelLogo( const int &x_pos, const int &y_pos, + const std::string& channelName, + const uint64_t& channelId, + CComponentsForm *parent, + bool has_shadow, + fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow) + :CComponentsPicture(x_pos, y_pos, 0, 0, + "", parent, has_shadow, + color_frame, color_background, color_shadow) { - pic_name = picture_name; + setChannel(channelId, channelName); + alt_pic_name = ""; +} + + +void CComponentsChannelLogo::setAltLogo(const std::string& picture_name) +{ + alt_pic_name = picture_name; channel_id = 0; channel_name = ""; - initVarPictureChannellLogo(); + has_logo = true; + initCCItem(); } -void CComponentsChannelLogo::setPicture(const char* picture_name) +void CComponentsChannelLogo::setAltLogo(const char* picture_name) { string s_tmp = ""; if (picture_name) s_tmp = string(picture_name); - this->setPicture(s_tmp); + this->setAltLogo(s_tmp); } void CComponentsChannelLogo::setChannel(const uint64_t& channelId, const std::string& channelName) { channel_id = channelId; channel_name = channelName; - initVarPictureChannellLogo(); -} -void CComponentsChannelLogo::initVarPictureChannellLogo() -{ - string tmp_logo = pic_name; - has_logo = false; - - if (!(channel_id == 0 && channel_name.empty() && pic_name.empty())) - has_logo = GetLogoName(channel_id, channel_name, pic_name, &pic_width, &pic_height); + has_logo = GetLogoName(channel_id, channel_name, pic_name, &width, &height); if (!has_logo) - pic_name = tmp_logo; + pic_name = alt_pic_name; - dprintf(DEBUG_DEBUG, "\t[CComponentsChannelLogo] %s: init image: %s (has_logo=%d, channel_id=%" PRIu64 ")\n", __func__, pic_name.c_str(), has_logo, channel_id); - initCCItem(); } - -void CComponentsChannelLogo::paint(bool do_save_bg) -{ - initVarPictureChannellLogo(); - paintInit(do_save_bg); - paintPicture(); - has_logo = false; //reset -} diff --git a/src/gui/components/cc_item_picture.h b/src/gui/components/cc_item_picture.h index 149174e3d..57b8a97ca 100644 --- a/src/gui/components/cc_item_picture.h +++ b/src/gui/components/cc_item_picture.h @@ -37,32 +37,27 @@ //! Sub class of CComponentsItem. Shows box with image with assigned attributes. /*! -Picture is usable like each other CCItems. +Picture is usable as an object like each other CCItems. */ -class CComponentsPicture : public CComponentsItem +class CComponentsPicture : public CComponentsItem, public CPictureViewer { protected: - ///some internal modes for icon and image handling - enum - { - CC_PIC_IMAGE_MODE_OFF = 0, //paint pictures in icon mode, mainly not scaled - CC_PIC_IMAGE_MODE_ON = 1, //paint pictures in image mode, paint scaled if required - CC_PIC_IMAGE_MODE_AUTO = 2 - }; + ///possible image formats + std::vector v_ext; - ///property: path or name of image, icon names to find in /widget/icons.h, icons will paint never scaled + ///property: name of image (without extensionn) full path to image (with extension), icon names to find in /widget/icons.h, icons will paint never scaled std::string pic_name; - ///property: interface to CFrameBuffer::paintIcon() arg 5 - unsigned char pic_offset; - - bool pic_paint, pic_paintBg, pic_painted, do_paint; - int pic_align, pic_x, pic_y, pic_width, pic_height; - int pic_max_w, pic_max_h, pic_paint_mode; + + ///indicate that image was sucessful painted + bool is_image_painted; + ///image is defined only by name without full path, handling as icon, not as scalable image, default = false + bool is_icon; + ///sets that image may be painted, default = false + bool do_paint; void init( const int &x_pos, const int &y_pos, const int &w, const int &h, const std::string& image_name, - const int &alignment, CComponentsForm *parent, bool has_shadow, fb_pixel_t color_frame, @@ -72,63 +67,88 @@ class CComponentsPicture : public CComponentsItem ///initialize all required attributes void initCCItem(); ///initialize position of picture object dependendly from settings - void initPosition(); + void initPosition(int *x_position, int *y_position); + ///paint image void paintPicture(); public: CComponentsPicture( const int &x_pos, const int &y_pos, const int &w, const int &h, const std::string& image_name, - const int &alignment = CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, CComponentsForm *parent = NULL, bool has_shadow = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); - virtual inline void setPictureOffset(const unsigned char offset){pic_offset = offset;}; - virtual inline void setPicturePaint(bool paint_p){pic_paint = paint_p;}; - virtual inline void setPicturePaintBackground(bool paintBg){pic_paintBg = paintBg;}; + CComponentsPicture( const int &x_pos, const int &y_pos, + const std::string& image_name, + CComponentsForm *parent = NULL, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_background = 0, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + + ///sets an image name (unscaled icons only), full image path or url to an iamge file (scalable) virtual void setPicture(const std::string& picture_name); + ///sets an image name (unscaled icons only), full image path or url to an iamge file (scalable) virtual void setPicture(const char* picture_name); - virtual void setPictureAlign(const int alignment); ///return paint mode of internal image, true=image was painted, please do not to confuse with isPainted()! isPainted() is related to item itself. - virtual inline bool isPicPainted(){return pic_painted;}; + virtual inline bool isPicPainted(){return is_image_painted;}; + ///handle image size + void getImageSize(int* width_image, int *height_image); + + ///paint item virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); + ///hide item virtual void hide(bool no_restore = false); - virtual inline void getPictureSize(int *pwidth, int *pheight){*pwidth=pic_width; *pheight=pic_height;}; - virtual void setMaxWidth(const int w_max){pic_max_w = w_max;}; - virtual void setMaxHeight(const int h_max){pic_max_h = h_max;}; }; -class CComponentsChannelLogo : public CComponentsPicture, CPictureViewer +class CComponentsChannelLogo : public CComponentsPicture { - protected: - ///initialize all required attributes - void initVarPictureChannellLogo(); - private: + ///channel id uint64_t channel_id; + ///channel name std::string channel_name; + + ///alternate image file, if no channel logo is available + std::string alt_pic_name; + + ///indicates that logo is available, after paint or new instance, value = false bool has_logo; public: CComponentsChannelLogo( const int &x_pos, const int &y_pos, const int &w, const int &h, - const uint64_t& channelId =0, const std::string& channelName = "", - const int &alignment = CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, + const uint64_t& channelId =0, + CComponentsForm *parent = NULL, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_background = 0, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + + CComponentsChannelLogo( const int &x_pos, const int &y_pos, + const std::string& channelName = "", + const uint64_t& channelId =0, CComponentsForm *parent = NULL, bool has_shadow = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + ///set channel id and/or channel name, NOTE: channel name is prefered void setChannel(const uint64_t& channelId, const std::string& channelName); - void setPicture(const std::string& picture_name); - void setPicture(const char* picture_name); + + ///set an alternate logo if no logo is available NOTE: value of has_logo will set to true + void setAltLogo(const std::string& picture_name); + ///set an alternate logo if no logo is available, NOTE: value of has_logo will set to true + void setAltLogo(const char* picture_name); + + ///returns true, if any logo is available, also if an alternate logo was setted bool hasLogo(){return has_logo;}; - void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); + }; #endif diff --git a/src/gui/components/cc_item_tvpic.cpp b/src/gui/components/cc_item_tvpic.cpp index 8cdf6e873..4dc7cd566 100644 --- a/src/gui/components/cc_item_tvpic.cpp +++ b/src/gui/components/cc_item_tvpic.cpp @@ -99,7 +99,7 @@ void CComponentsPIP::paint(bool do_save_bg) videoDecoder->Pig(pig_x, pig_y, pig_w, pig_h, screen_w, screen_h); } else{ //paint an alternate image if no tv mode available - CComponentsPicture pic = CComponentsPicture (pig_x, pig_y, pig_w, pig_h, pic_name, CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, NULL, false, col_frame, col_frame); + CComponentsPicture pic = CComponentsPicture (pig_x, pig_y, pig_w, pig_h, pic_name, NULL, false, col_frame, col_frame); pic.setCorner(corner_rad, corner_type); pic.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 8eac49bef..327b1c8a8 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -32,7 +32,7 @@ #include #include #include - +#include #include "luainstance.h" /* the magic color that tells us we are using one of the palette colors */ @@ -1886,8 +1886,7 @@ int CLuaInstance::CPictureNew(lua_State *L) CLuaCWindow* parent = NULL; lua_Integer x=10, y=10, dx=100, dy=100; std::string image_name = ""; - lua_Integer alignment = CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER; - + lua_Integer alignment = 0; std::string tmp1 = "false"; // has_shadow lua_Integer color_frame = (lua_Integer)COL_MENUCONTENT_PLUS_6; lua_Integer color_background = (lua_Integer)COL_MENUCONTENT_PLUS_0; @@ -1899,7 +1898,11 @@ int CLuaInstance::CPictureNew(lua_State *L) tableLookup(L, "dx" , dx); tableLookup(L, "dy" , dy); tableLookup(L, "image" , image_name); - tableLookup(L, "alignment" , alignment); + + tableLookup(L, "alignment" , alignment); //invalid argumet, for compatibility + if (alignment) + dprintf(DEBUG_NORMAL, "[CLuaInstance][%s - %d] invalid argument: 'alignment' has no effect!\n", __func__, __LINE__); + tableLookup(L, "has_shadow" , tmp1); bool has_shadow = (tmp1 == "true" || tmp1 == "1" || tmp1 == "yes"); tableLookup(L, "color_frame" , color_frame); @@ -1910,7 +1913,7 @@ int CLuaInstance::CPictureNew(lua_State *L) CLuaPicture **udata = (CLuaPicture **) lua_newuserdata(L, sizeof(CLuaPicture *)); *udata = new CLuaPicture(); - (*udata)->cp = new CComponentsPicture(x, y, dx, dy, image_name, alignment, pw, has_shadow, (fb_pixel_t)color_frame, (fb_pixel_t)color_background, (fb_pixel_t)color_shadow); + (*udata)->cp = new CComponentsPicture(x, y, dx, dy, image_name, pw, has_shadow, (fb_pixel_t)color_frame, (fb_pixel_t)color_background, (fb_pixel_t)color_shadow); (*udata)->parent = pw; luaL_getmetatable(L, "cpicture"); lua_setmetatable(L, -2); diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index f8f7031ef..25ac66c9b 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -404,7 +404,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } else if (actionKey == "picture"){ if (pic == NULL) - pic = new CComponentsPicture (100, 100, 200, 200, DATADIR "/neutrino/icons/mp3-5.jpg"); + pic = new CComponentsPicture (100, 100, 200, 100, DATADIR "/neutrino/icons/mp3-5.jpg"); if (!pic->isPainted() && !pic->isPicPainted()) pic->paint(); @@ -414,7 +414,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } else if (actionKey == "channellogo"){ if (chnl_pic == NULL) - chnl_pic = new CComponentsChannelLogo(100, 100, 200, 200, 0, "ProSieben"); + chnl_pic = new CComponentsChannelLogo(100, 100, "ProSieben", 0); if (!chnl_pic->isPainted() && !chnl_pic->isPicPainted()) chnl_pic->paint(); @@ -430,10 +430,9 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) form->setFrameThickness(2); form->setColorFrame(COL_WHITE); - CComponentsPicture *ptmp = new CComponentsPicture(0, 0, 0, 0, NEUTRINO_ICON_BUTTON_YELLOW); + CComponentsPicture *ptmp = new CComponentsPicture(0, 0, NEUTRINO_ICON_BUTTON_YELLOW); ptmp->setWidth(28); ptmp->setHeight(28); - ptmp->setPictureAlign(CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER); ptmp->setColorBody(COL_BLUE); ptmp->setCorner(RADIUS_MID, CORNER_TOP_LEFT); form->addCCItem(ptmp); diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index 74abf4373..90fc35b0b 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -175,7 +175,6 @@ void CVolumeBar::initVolumeBarIcon() { vb_icon = new CComponentsPicture(vb_icon_x, 0, vb_icon_w, height, NEUTRINO_ICON_VOLUME); - vb_icon->setPictureAlign(CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER); vb_icon->setColorBody(col_body); vb_icon->setCorner(cornerRad(), CORNER_LEFT); From 7a92bdb901b11157707a1cff28d5a65cf5d2aa47 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 22 Jun 2014 23:28:48 +0200 Subject: [PATCH 136/511] CComponentsItem: remove unnecessary calculation of position with frame This should be done in the arrangement of the container contents Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2aff49deea9ffae10c797e3525e7ee35a6722cf8 Author: Thilo Graf Date: 2014-06-22 (Sun, 22 Jun 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_item.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index e727fb6c1..01550c6b6 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -82,9 +82,8 @@ void CComponentsItem::paintInit(bool do_save_bg) //if item is bound on a parent form, we must use real x/y values and from parent form as reference int ix = x, iy = y; if (cc_parent){ - int w_parent_frame = cc_parent->getFrameThickness(); - ix = cc_xr + (x < w_parent_frame ? w_parent_frame : 0); - iy = cc_yr + (y < w_parent_frame ? w_parent_frame : 0); + ix = cc_xr; + iy = cc_yr; } comp_fbdata_t fbdata[] = From e73e411479cd60a1a2a862e4a902a5e2f286d5f4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 22 Jun 2014 23:30:12 +0200 Subject: [PATCH 137/511] CComponentsForm: add comment Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/eee10df7bbdfc2599ec23d0fceb1dd5f249cef78 Author: Thilo Graf Date: 2014-06-22 (Sun, 22 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index a642a7aa6..c5dc0f6ec 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -58,8 +58,12 @@ class CComponentsForm : public CComponentsItem virtual void addCCItem(CComponentsItem* cc_Item); virtual void addCCItem(const std::vector &cc_items); virtual void insertCCItem(const uint& cc_item_id, CComponentsItem* cc_Item); + + ///removes item object from container and deallocates instance virtual void removeCCItem(const uint& cc_item_id); + ///removes item object from container and deallocates instance virtual void removeCCItem(CComponentsItem* cc_Item); + virtual void replaceCCItem(const uint& cc_item_id, CComponentsItem* new_cc_Item); virtual void replaceCCItem(CComponentsItem* old_cc_Item, CComponentsItem* new_cc_Item); virtual void exchangeCCItem(const uint& item_id_a, const uint& item_id_b); From d04944de2fb2bde45d1cc43888d28ab38dc52976 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 22 Jun 2014 23:33:10 +0200 Subject: [PATCH 138/511] CComponentsForm: don't consider frame for position calculation This should be done in the arrangement of the container contents Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/dce25e94b31c3dbc260a4257079150cfb0c589a6 Author: Thilo Graf Date: 2014-06-22 (Sun, 22 Jun 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index ed86f7c62..2fe9b7b12 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -276,7 +276,7 @@ void CComponentsForm::paintCCItems() } //positionize vertical centered else if (xpos == CC_CENTERED){ - auto_x = width/2 - w_item/2 +fr_thickness; + auto_x = width/2 - w_item/2; cc_item->setRealXPos(this_x + auto_x); } else{ @@ -293,7 +293,7 @@ void CComponentsForm::paintCCItems() } //positionize hor centered else if (ypos == CC_CENTERED){ - auto_y = height/2 - h_item/2 +fr_thickness; + auto_y = height/2 - h_item/2; cc_item->setRealYPos(this_y + auto_y); } else{ From 4bfeb58ea3f5f141cef8f0ea6806d0834d4aea13 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 23 Jun 2014 15:37:49 +0200 Subject: [PATCH 139/511] CComponentsWindow: add missing comment for sidebars Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/67ab4addebec512f9903dd39eb05ce13a7af870e Author: Thilo Graf Date: 2014-06-23 (Mon, 23 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_window.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index 9bd47a870..3875c8015 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.h @@ -180,7 +180,7 @@ class CComponentsWindow : public CComponentsForm CComponentsFrmChain* getLeftSidebarObject(){return ccw_left_sidebar;}; ///returns a pointer to the internal right side bar object, use this to get access to right sidebar properities CComponentsFrmChain* getRightSidebarObject(){return ccw_right_sidebar;}; - + ///sets width of sidebars void setWidthSidebar(const int& sidebar_width){ccw_w_sidebar = sidebar_width; initCCWItems();}; ///refresh position and dimension and reinitialize elemenatary properties From 373dbba0593221de63c0cf3769ba68021abc13bc Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 7 Jun 2014 23:13:09 +0200 Subject: [PATCH 140/511] CChannelList/COsdSetup: use showOsdChanlistSetup() from OSD-Setup This removes multiple code parts from COsdSetup without loss of functionality. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/253579909f9e053a9a5fad8c4d37bfc139066a5b Author: Thilo Graf Date: 2014-06-07 (Sat, 07 Jun 2014) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 8 ++++-- src/gui/osd_setup.cpp | 64 ++--------------------------------------- src/gui/osd_setup.h | 2 +- 3 files changed, 10 insertions(+), 64 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index c02287740..efc294bea 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -39,7 +39,7 @@ #include #include - +#include #include #include #include @@ -371,6 +371,10 @@ int CChannelList::doChannelMenu(void) menu->addItem(new CMenuForwarder(LOCALE_CHANNELLIST_RESET_ALL, reset_all, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++); snprintf(cnt, sizeof(cnt), "%d", i); menu->addItem(new CMenuSeparator(CMenuSeparator::LINE)); + + //use osd channel list settings widget from COsdSetup class + CMenuWidget osd_menu_chanlist(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_OSDSETUP_CHANNELLIST); + osd_menu_chanlist.suppressDetailsLine(true); menu->addItem(new CMenuForwarder(LOCALE_MAINMENU_SETTINGS, true, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++); menu->exec(NULL, ""); delete menu; @@ -492,7 +496,7 @@ int CChannelList::doChannelMenu(void) { previous_channellist_additional = g_settings.channellist_additional; COsdSetup osd_setup; - osd_setup.showContextChanlistMenu(); + osd_setup.showContextChanlistMenu(&osd_menu_chanlist); //FIXME check font/options changed ? hide(); calcSize(); diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index e7a0a9aee..ca613ba87 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -1101,68 +1101,10 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) return false; } -int COsdSetup::showContextChanlistMenu() +int COsdSetup::showContextChanlistMenu(CMenuWidget *menu_chanlist) { - static int cselected = -1; - - CMenuWidget * menu_chanlist = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width); - menu_chanlist->enableSaveScreen(true); - menu_chanlist->enableFade(false); - menu_chanlist->setSelected(cselected); - - CMenuOptionChooser * mc; - - menu_chanlist->addIntroItems(LOCALE_MISCSETTINGS_CHANNELLIST);//, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL); - - mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_ADDITIONAL, &g_settings.channellist_additional, CHANNELLIST_ADDITIONAL_OPTIONS, CHANNELLIST_ADDITIONAL_OPTION_COUNT, true); - mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_ADDITIONAL); - menu_chanlist->addItem(mc); - - mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_EPGTEXT_ALIGN, &g_settings.channellist_epgtext_align_right, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS_COUNT, true); - mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EPG_ALIGN); - menu_chanlist->addItem(mc); - - mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, CHANNELLIST_EXTENDED_OPTIONS, CHANNELLIST_EXTENDED_OPTIONS_COUNT, true); - mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EXTENDED); - menu_chanlist->addItem(mc); - - mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_FOOT, &g_settings.channellist_foot, CHANNELLIST_FOOT_OPTIONS, CHANNELLIST_FOOT_OPTIONS_COUNT, true); - mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_FOOT); - menu_chanlist->addItem(mc); - - mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_COLORED_EVENTS, &g_settings.colored_events_channellist, OPTIONS_COLORED_EVENTS_OPTIONS, OPTIONS_COLORED_EVENTS_OPTION_COUNT, true); - mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_COLORED); - menu_chanlist->addItem(mc); - - //show channel logo - mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_SHOW_CHANNELLOGO, &g_settings.channellist_show_channellogo, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); - mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_SHOW_CHANNELLOGO); - menu_chanlist->addItem(mc); - - menu_chanlist->addItem(new CMenuSeparator(CMenuSeparator::LINE)); - - CMenuWidget *fontSettingsSubMenu = new CMenuWidget(LOCALE_FONTMENU_HEAD, NEUTRINO_ICON_KEYBINDING); - fontSettingsSubMenu->enableSaveScreen(true); - fontSettingsSubMenu->enableFade(false); - - int i = 1; - fontSettingsSubMenu->addIntroItems(font_sizes_groups[i].groupname);//, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL); - - for (unsigned int j = 0; j < font_sizes_groups[i].count; j++) - { - AddFontSettingItem(*fontSettingsSubMenu, font_sizes_groups[i].content[j]); - } - fontSettingsSubMenu->addItem(GenericMenuSeparatorLine); - fontSettingsSubMenu->addItem(new CMenuForwarder(LOCALE_OPTIONS_DEFAULT, true, NULL, this, font_sizes_groups[i].actionkey)); - - CMenuForwarder * mf = new CMenuDForwarder(LOCALE_FONTMENU_HEAD, true, NULL, fontSettingsSubMenu, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); - mf->setHint("", LOCALE_MENU_HINT_FONTS); - menu_chanlist->addItem(mf); - - int res = menu_chanlist->exec(NULL, ""); - cselected = menu_chanlist->getSelected(); - delete menu_chanlist; - return res; + showOsdChanlistSetup(menu_chanlist); + return menu_chanlist->exec(NULL, ""); } //screenshot diff --git a/src/gui/osd_setup.h b/src/gui/osd_setup.h index be227c04e..a33a37ac3 100644 --- a/src/gui/osd_setup.h +++ b/src/gui/osd_setup.h @@ -101,7 +101,7 @@ class COsdSetup : public CMenuTarget, public CChangeObserver ~COsdSetup(); int exec(CMenuTarget* parent, const std::string & actionKey); bool changeNotify(const neutrino_locale_t OptionName, void * /*data*/); - int showContextChanlistMenu(); + int showContextChanlistMenu(CMenuWidget *menu_chanlist); }; #endif From 74e4c812c27039d94a2a76b829a1fadd4ec229d0 Mon Sep 17 00:00:00 2001 From: Christian Schuett Date: Mon, 23 Jun 2014 21:37:49 +0200 Subject: [PATCH 141/511] libconfigfile: accept booleans as int32 or int64 for compatibility if config file entry is changed from boolean to int32 or int64 based on patch by martii in Neutrino-MP Git Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ad498249d1baa7c469631833e23a919bd154ee04 Author: Christian Schuett Date: 2014-06-23 (Mon, 23 Jun 2014) ------------------ This commit was generated by Migit --- lib/libconfigfile/configfile.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/libconfigfile/configfile.cpp b/lib/libconfigfile/configfile.cpp index 651562335..38517d8dc 100644 --- a/lib/libconfigfile/configfile.cpp +++ b/lib/libconfigfile/configfile.cpp @@ -204,6 +204,10 @@ int32_t CConfigFile::getInt32(const std::string & key, const int32_t defaultVal) } } + if (configData[key] == "false") + return 0; + if (configData[key] == "true") + return 1; return atoi(configData[key].c_str()); } @@ -225,6 +229,10 @@ int64_t CConfigFile::getInt64(const std::string & key, const int64_t defaultVal) } } + if (configData[key] == "false") + return 0; + if (configData[key] == "true") + return 1; return atoll(configData[key].c_str()); } From e99fb152b2b4ac29577bb71d558f52e9e5fb5334 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 27 Jun 2014 10:41:01 +0200 Subject: [PATCH 142/511] =?UTF-8?q?neutrinoyparser:=20detect=20Zee=C2=B2;?= =?UTF-8?q?=20fix=20Boxmodel=20for=20Trinity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8322c9e40845b8957b53883f367ebec3283c0706 Author: vanhofen Date: 2014-06-27 (Fri, 27 Jun 2014) Origin message was: ------------------ - neutrinoyparser: detect Zee²; fix Boxmodel for Trinity ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp index dee74317a..cc552f24b 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp @@ -721,6 +721,9 @@ std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string) case 11: boxname += "Trinity"; break; + case 12: + boxname += "Zee2"; + break; default: char buffer[10]; @@ -749,9 +752,14 @@ std::string CNeutrinoYParser::func_get_boxmodel(CyhookHandler *, std::string) boxmodel = "Nevis"; break; case 9: - case 11: boxmodel = "Apollo"; break; + case 11: + boxmodel = "Shiner"; + break; + case 12: + boxmodel = "Kronos"; + break; default: break; } From f721c8d40604b5c58c65f05dc63c700bcd2a234d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 27 Jun 2014 10:43:25 +0200 Subject: [PATCH 143/511] =?UTF-8?q?yWeb:=20show=20correct=20RCU=20at=20Zee?= =?UTF-8?q?=C2=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bf42b7c4cf664773183c2b51c3478d3234fe9554 Author: vanhofen Date: 2014-06-27 (Fri, 27 Jun 2014) Origin message was: ------------------ - yWeb: show correct RCU at Zee² ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/web/Y_Blocks.txt | 3 ++- src/nhttpd/web/Y_Version.txt | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/nhttpd/web/Y_Blocks.txt b/src/nhttpd/web/Y_Blocks.txt index 63b2711ad..6f8dfdc6f 100644 --- a/src/nhttpd/web/Y_Blocks.txt +++ b/src/nhttpd/web/Y_Blocks.txt @@ -506,9 +506,10 @@ start-block~remote {=if-equal:{=var-get:boxtype=}~CST Neo Twin~ {=include-block:Y_Blocks.txt;rc_cst_v4=}~ {=if-equal:{=var-get:boxtype=}~CST Tank~ {=include-block:Y_Blocks.txt;rc_cst_v5=}~ {=if-equal:{=var-get:boxtype=}~CST Trinity~ {=include-block:Y_Blocks.txt;rc_cst_v6=}~ + {=if-equal:{=var-get:boxtype=}~CST Zee2~ {=include-block:Y_Blocks.txt;rc_cst_v6=}~ {=comment:fallback~=} {=include-block:Y_Blocks.txt;rc_cst_v1=} - =}=}=}=}=} + =}=}=}=}=}=} =}=} ~ {=if-equal:{=var-get:yfbtype=}~-2~ {=include-block:Y_Blocks.txt;rc_dbox_philips=}~ diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index df418630b..d4a791c43 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.8.0.61 -date=19.06.2014 +version=2.8.0.62 +date=27.06.2014 type=Release info=Port CST From f5182499b3e660d747efc5b7d32f040c49e9be1f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 27 Jun 2014 18:26:13 +0200 Subject: [PATCH 144/511] osd_setup: don't show colored progress bar option in channellist ... ... when colored progress bar is disabled Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/88877671415414ebaaf3e2f9af602beb83a5cd96 Author: vanhofen Date: 2014-06-27 (Fri, 27 Jun 2014) Origin message was: ------------------ - osd_setup: don't show colored progress bar option in channellist ... ... when colored progress bar is disabled ------------------ This commit was generated by Migit --- src/gui/osd_setup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index ca613ba87..b226e98b8 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -941,7 +941,7 @@ void COsdSetup::showOsdChanlistSetup(CMenuWidget *menu_chanlist) menu_chanlist->addItem(mc); // extended channel list - mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, CHANNELLIST_EXTENDED_OPTIONS, CHANNELLIST_EXTENDED_OPTIONS_COUNT, true); + mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, CHANNELLIST_EXTENDED_OPTIONS, CHANNELLIST_EXTENDED_OPTIONS_COUNT - (g_settings.progressbar_color ? 0 : 1), true); mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EXTENDED); menu_chanlist->addItem(mc); From 55b76b69ba2105e1319580751f9b24ede670094b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 24 Jun 2014 22:41:43 +0200 Subject: [PATCH 145/511] CComponentsForm: add functions to get first and last item Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c2bc275d5d382c98d16269c0f87486f8ee3221c6 Author: Thilo Graf Date: 2014-06-24 (Tue, 24 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index c5dc0f6ec..6b526a4e2 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -78,6 +78,10 @@ class CComponentsForm : public CComponentsItem virtual bool empty(){return v_cc_items.empty();}; ///return size (count) of available items virtual size_t size(){return v_cc_items.size();}; + ///return reference to first item + virtual CComponentsItem* front(){return v_cc_items.front();}; + ///return reference to last item + virtual CComponentsItem* back(){return v_cc_items.back();}; virtual void setAppendOffset(const int &x_offset, const int& y_offset){append_x_offset = x_offset; append_y_offset = y_offset;}; }; From a78751ea5517d96702910399229081d7feba56da Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 25 Jun 2014 09:58:21 +0200 Subject: [PATCH 146/511] CComponentsPicture: use current instance of CPictureViewer reduce precautionary too much unnecessary impact Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e6f6931b72e74d8b9246b427c7c6040d1f2c5b3d Author: Thilo Graf Date: 2014-06-25 (Wed, 25 Jun 2014) ------------------ This commit was generated by Migit --- src/driver/pictureviewer/pictureviewer.h | 2 +- src/gui/components/cc_item_picture.cpp | 13 +++++++------ src/gui/components/cc_item_picture.h | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/driver/pictureviewer/pictureviewer.h b/src/driver/pictureviewer/pictureviewer.h index 4326c45d4..8183f1943 100644 --- a/src/driver/pictureviewer/pictureviewer.h +++ b/src/driver/pictureviewer/pictureviewer.h @@ -66,7 +66,7 @@ class CPictureViewer static double m_aspect_ratio_correction; bool DisplayImage (const std::string & name, int posx, int posy, int width, int height, int transp=CFrameBuffer::TM_EMPTY); // bool DisplayLogo (uint64_t channel_id, int posx, int posy, int width, int height); - virtual bool GetLogoName(const uint64_t& channel_id, const std::string& ChanName, std::string & name, int *width = NULL, int *height = NULL); + bool GetLogoName(const uint64_t& channel_id, const std::string& ChanName, std::string & name, int *width = NULL, int *height = NULL); fb_pixel_t * getImage (const std::string & name, int width, int height); fb_pixel_t * getIcon (const std::string & name, int *width, int *height); void getSize(const char *name, int* width, int *height); diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index ba9bf9cd4..c34905f94 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -34,6 +34,7 @@ #include #include +extern CPictureViewer * g_PicViewer; using namespace std; @@ -85,7 +86,7 @@ void CComponentsPicture::init( const int &x_pos, const int &y_pos, const int &w, is_image_painted= false; do_paint = true; - getSupportedImageFormats(v_ext); + g_PicViewer->getSupportedImageFormats(v_ext); v_ext.resize(unique(v_ext.begin(), v_ext.end()) - v_ext.begin()); initCCItem(); initParent(parent); @@ -129,7 +130,7 @@ void CComponentsPicture::initCCItem() width = w_pic; height = max(h_pic, height); } - else{ //defined values ​​in constructor or defined via setters defined, have priority, value 0 is not allowed + else{ //defined values in constructor or defined via setters defined, have priority, value 0 is not allowed if (width == 0) width = w_pic; if (height == 0) @@ -139,7 +140,7 @@ void CComponentsPicture::initCCItem() //resize/scale image if required, if no icon mode detected, use real image size if (!is_icon){ if (width != w_pic || height != h_pic) - rescaleImageDimensions(&w_pic, &h_pic, width, height); + g_PicViewer->rescaleImageDimensions(&w_pic, &h_pic, width, height); } } @@ -159,7 +160,7 @@ void CComponentsPicture::initPosition(int *x_position, int *y_position) void CComponentsPicture::getImageSize(int* width_image, int *height_image) { if (!is_icon) - CPictureViewer::getSize(pic_name.c_str(), width_image, height_image); + g_PicViewer->getSize(pic_name.c_str(), width_image, height_image); else frameBuffer->getIconSize(pic_name.c_str(), width_image, height_image); } @@ -178,7 +179,7 @@ void CComponentsPicture::paintPicture() dprintf(DEBUG_INFO, "[CComponentsPicture] %s: paint image file: pic_name=%s\n", __func__, pic_name.c_str()); if (cc_allow_paint){ if (!is_icon) - is_image_painted = DisplayImage(pic_name, x_pic, y_pic, width, height); + is_image_painted = g_PicViewer->DisplayImage(pic_name, x_pic, y_pic, width, height); else is_image_painted = frameBuffer->paintIcon(pic_name, x_pic, y_pic, height, 1, do_paint, paint_bg, col_body); } @@ -248,7 +249,7 @@ void CComponentsChannelLogo::setChannel(const uint64_t& channelId, const std::st channel_id = channelId; channel_name = channelName; - has_logo = GetLogoName(channel_id, channel_name, pic_name, &width, &height); + has_logo = g_PicViewer->GetLogoName(channel_id, channel_name, pic_name, &width, &height); if (!has_logo) pic_name = alt_pic_name; diff --git a/src/gui/components/cc_item_picture.h b/src/gui/components/cc_item_picture.h index 57b8a97ca..4796d2216 100644 --- a/src/gui/components/cc_item_picture.h +++ b/src/gui/components/cc_item_picture.h @@ -40,7 +40,7 @@ Picture is usable as an object like each other CCItems. */ -class CComponentsPicture : public CComponentsItem, public CPictureViewer +class CComponentsPicture : public CComponentsItem { protected: ///possible image formats From 060a36dd6b4d0e9bcbdd2ee3337f5ae57647c533 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 26 Jun 2014 09:59:19 +0200 Subject: [PATCH 147/511] CComponents: implement scroll functionality into CComponentsForm CComponentsForm provides page scroll if found more than one pre defined page and is working with all derivated sub classes from CComponentsForm . Pages are defined with setPageNumber(0...n) in items (1st page = 0). The item page number property is defined in variable cc_page_number. The highest page number sets the count of pages inside container to required value. Thats compellingly! To show a page, we can use setCurrentPage(0...n ) and paintCurPage() or use directly paintPage(0...n). Note: global paint() will show the current page. Default page is 0 (as first). Use setCurrentPage(0...n) to change this before first call of paint(). Note: In CComponentsWindow class, these methods are applied to window body. For examples, take a look into CTestMenu Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/672757606c2697c666132d2ed601c081a9ecc4ea Author: Thilo Graf Date: 2014-06-26 (Thu, 26 Jun 2014) ------------------ This commit was generated by Migit --- src/gui/components/Makefile.am | 1 + src/gui/components/cc.h | 3 +- src/gui/components/cc_base.h | 8 ++ src/gui/components/cc_frm.cpp | 97 +++++++++++-- src/gui/components/cc_frm.h | 37 ++++- src/gui/components/cc_frm_scrollbar.cpp | 175 ++++++++++++++++++++++++ src/gui/components/cc_frm_scrollbar.h | 82 +++++++++++ src/gui/components/cc_frm_window.cpp | 28 ++++ src/gui/components/cc_frm_window.h | 14 +- src/gui/components/cc_item.cpp | 1 + src/gui/components/cc_types.h | 2 + src/gui/test_menu.cpp | 60 ++++++-- src/gui/test_menu.h | 1 + 13 files changed, 485 insertions(+), 24 deletions(-) create mode 100644 src/gui/components/cc_frm_scrollbar.cpp create mode 100644 src/gui/components/cc_frm_scrollbar.h diff --git a/src/gui/components/Makefile.am b/src/gui/components/Makefile.am index b4b58ec39..1e618566b 100644 --- a/src/gui/components/Makefile.am +++ b/src/gui/components/Makefile.am @@ -34,6 +34,7 @@ libneutrino_gui_components_a_SOURCES = \ cc_frm_header.cpp \ cc_frm_ext_text.cpp \ cc_frm_icons.cpp \ + cc_frm_scrollbar.cpp \ cc_frm_signalbars.cpp \ cc_frm_slider.cpp \ cc_frm_window.cpp \ diff --git a/src/gui/components/cc.h b/src/gui/components/cc.h index 3383752ec..d7f08650d 100644 --- a/src/gui/components/cc.h +++ b/src/gui/components/cc.h @@ -42,9 +42,10 @@ Basic attributes and member functions for component sub classes #include "cc_detailsline.h" +#include "cc_frm_scrollbar.h" #include "cc_frm.h" -#include "cc_frm_button.h" #include "cc_frm_chain.h" +#include "cc_frm_button.h" #include "cc_frm_clock.h" #include "cc_frm_ext_text.h" #include "cc_frm_header.h" diff --git a/src/gui/components/cc_base.h b/src/gui/components/cc_base.h index 973da83a0..2f04ae620 100644 --- a/src/gui/components/cc_base.h +++ b/src/gui/components/cc_base.h @@ -231,6 +231,9 @@ class CComponentsItem : public CComponents bool cc_item_enabled; ///property: default not selected bool cc_item_selected; + ///property: page number, this defines current item page location, means: this item is embedded in a parent container on page number n, see also setPageNumber() + ///default value is 0 for page one, any value > 0 causes handling for mutilple pages at parent container + uint8_t cc_page_number; ///Pointer to the form object in which this item is embedded. ///Is typically the type CComponentsForm or derived classes, default intialized with NULL @@ -291,6 +294,11 @@ class CComponentsItem : public CComponents ///To generate an index, use genIndex() virtual void setIndex(const int& index){cc_item_index = index;}; + ///sets page location of current item, parameter as uint8_t, see: cc_page_number + virtual void setPageNumber(const uint8_t& on_page_number){cc_page_number = on_page_number;}; + ///returns current number of page location of current item, see: cc_page_number + virtual u_int8_t getPageNumber(){return cc_page_number;}; + ///set screen x-position, parameter as uint8_t, percent x value related to current width of parent form or screen virtual void setXPosP(const uint8_t& xpos_percent); ///set screen y-position, parameter as uint8_t, percent y value related to current height of parent form or screen diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 2fe9b7b12..54964741c 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -67,11 +67,16 @@ CComponentsForm::CComponentsForm( const int x_pos, const int y_pos, const int w, append_x_offset = 0; append_y_offset = 0; + page_count = 1; + cur_page = 0; + sb = NULL; + w_sb = 15; } CComponentsForm::~CComponentsForm() { clear(); + delete sb; } @@ -234,22 +239,70 @@ void CComponentsForm::paint(bool do_save_bg) paintForm(do_save_bg); } +bool CComponentsForm::isPageChanged() +{ + for(size_t i=0; igetPageNumber() != cur_page) + return true; + } + return false; +} + +void CComponentsForm::paintPage(const u_int8_t& page_number, bool do_save_bg) +{ + cur_page = page_number; + paint(do_save_bg); +} void CComponentsForm::paintCCItems() { size_t items_count = v_cc_items.size(); //using of real x/y values to paint items if this text object is bound in a parent form - int this_x = x, auto_x = x, this_y = y, auto_y = y; + int this_x = x, auto_x = x, this_y = y, auto_y = y, this_w = width; if (cc_parent){ this_x = auto_x = cc_xr; this_y = auto_y = cc_yr; } + //init and handle scrollbar + getPageCount(); + int y_sb = this_y+1; + int x_sb = this_x + width - w_sb; + int h_sb = height-2; + if (sb == NULL){ + sb = new CComponentsScrollBar(x_sb, y_sb, w_sb, h_sb); + }else{ + //clean background, if dimension of scrollbar was changed + if (w_sb != sb->getWidth()) + sb->kill(col_body); + + //set current dimensions and position + sb->setDimensionsAll(x_sb, y_sb, w_sb, h_sb); + } + + if(page_count > 1){ + sb->setSegmentCount(page_count); + sb->setMarkID(cur_page); + this_w = width - w_sb; + sb->paint(false); + }else{ + if (sb->isPainted()) + sb->kill(col_body); + this_w = width; + } + + //detect if current page has changed, if true then kill items from screen + if(isPageChanged()){ + this->killCCItems(col_body, true); + } + for(size_t i=0; igetPageNumber(), this->cur_page); + //get current dimension of item int w_item = cc_item->getWidth(); int h_item = cc_item->getHeight(); @@ -259,10 +312,9 @@ void CComponentsForm::paintCCItems() int ypos = cc_item->getYPos(); //check item for corrupt position, skip current item if found problems - //TODO: need a solution with possibility for scrolling - if (ypos > height || xpos > width){ - dprintf(DEBUG_INFO, "[CComponentsForm] %s: [form: %d] [item-index %d] [type=%d] WARNING: item position is out of form size:\ndefinied x=%d, defined width=%d \ndefinied y=%d, defined height=%d \n", - __func__, cc_item_index, cc_item->getIndex(), cc_item->getItemType(), xpos, width, ypos, height); + if (ypos > height || xpos > this_w){ + dprintf(DEBUG_INFO, "[CComponentsForm] %s: [form: %d] [item-index %d] [type=%d] WARNING: item position is out of form size:\ndefinied x=%d, defined this_w=%d \ndefinied y=%d, defined height=%d \n", + __func__, cc_item_index, cc_item->getIndex(), cc_item->getItemType(), xpos, this_w, ypos, height); if (this->cc_item_type != CC_ITEMTYPE_FRM_CHAIN) continue; } @@ -276,7 +328,7 @@ void CComponentsForm::paintCCItems() } //positionize vertical centered else if (xpos == CC_CENTERED){ - auto_x = width/2 - w_item/2; + auto_x = this_w/2 - w_item/2; cc_item->setRealXPos(this_x + auto_x); } else{ @@ -301,12 +353,11 @@ void CComponentsForm::paintCCItems() auto_y = (cc_item->getRealYPos() + h_item); } - //These steps check whether the element can be painted into the container. //Is it too wide or too high, it will be shortened and displayed in the log. //This should be avoid! //checkwidth and adapt if required - int right_frm = (cc_parent ? cc_xr : x) + width - 2*fr_thickness; + int right_frm = (cc_parent ? cc_xr : x) + this_w - 2*fr_thickness; int right_item = cc_item->getRealXPos() + w_item; int w_diff = right_item - right_frm; int new_w = w_item - w_diff; @@ -314,7 +365,7 @@ void CComponentsForm::paintCCItems() right_item -= (new_w%2); w_item -= (new_w%2); if (right_item > right_frm){ - dprintf(DEBUG_INFO, "[CComponentsForm] %s: [form: %d] [item-index %d] [type=%d] width is too large, definied width=%d, possible width=%d \n", + dprintf(DEBUG_INFO, "[CComponentsForm] %s: [form: %d] [item-index %d] [type=%d] this_w is too large, definied width=%d, possible width=%d \n", __func__, cc_item_index, cc_item->getIndex(), cc_item->getItemType(), w_item, new_w); cc_item->setWidth(new_w); } @@ -339,8 +390,9 @@ void CComponentsForm::paintCCItems() if (!this->cc_allow_paint) cc_item->allowPaint(false); - //finally paint current item - cc_item->paint(CC_SAVE_SCREEN_NO); + //finally paint current item, but only required contents of page + if (cc_item->getPageNumber() == cur_page) + cc_item->paint(CC_SAVE_SCREEN_NO); //restore defined old visibility mode of item after paint cc_item->allowPaint(item_visible); @@ -369,3 +421,26 @@ void CComponentsForm::killCCItems(const fb_pixel_t& bg_color, bool ignore_parent for(size_t i=0; ikill(bg_color, ignore_parent); } + +void CComponentsForm::setPageCount(const u_int8_t& pageCount) +{ + u_int8_t new_val = pageCount; + if (new_val < page_count) + dprintf(DEBUG_NORMAL, "[CComponentsForm] %s: current count (= %u) of pages higher than page_count (= %u) will be set, smaller value is ignored!\n", __func__, page_count, new_val) ; + page_count = max(new_val, page_count); +} + +u_int8_t CComponentsForm::getPageCount() +{ + u_int8_t num = 0; + for(size_t i=0; igetPageNumber(); + num = max(item_num, num); + } + + //convert type, possible -Wconversion warnings! + page_count = static_cast(num + 1); + + return page_count; +} + diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 6b526a4e2..79ba3ffb9 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -27,7 +27,7 @@ #include "config.h" #include - +#include "cc_frm_scrollbar.h" class CComponentsForm : public CComponentsItem { @@ -37,8 +37,21 @@ class CComponentsForm : public CComponentsItem ///generates next possible index for an item, see also cc_item_index, getIndex(), setIndex() int genIndex(); + ///scrollbar object + CComponentsScrollBar *sb; + int append_x_offset; int append_y_offset; + + ///property: count of pages of form + u_int8_t page_count; + ///property: id of current page, default = 0 for 1st page + u_int8_t cur_page; + ///scrollbar width + int w_sb; + ///returns true, if current page is changed, see also: setCurrentPage() + bool isPageChanged(); + public: CComponentsForm( const int x_pos = 0, const int y_pos = 0, const int w = 800, const int h = 600, CComponentsForm *parent = NULL, @@ -47,8 +60,10 @@ class CComponentsForm : public CComponentsItem fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); virtual ~CComponentsForm(); - + + ///paints current form on screen, for paint a page use paintPage() void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); + ///hides current form, background will be restored, if parameter = false void hide(bool no_restore = false); ///same like CComponentsItem::kill(), but erases all embedded items inside of parent at once, this = parent @@ -83,7 +98,25 @@ class CComponentsForm : public CComponentsItem ///return reference to last item virtual CComponentsItem* back(){return v_cc_items.back();}; + ///sets alignment offset between items virtual void setAppendOffset(const int &x_offset, const int& y_offset){append_x_offset = x_offset; append_y_offset = y_offset;}; + + ///sets count of pages, parameter as u_int8_t + ///NOTE: page numbers are primary defined in items and this values have priority!! Consider that smaller values + ///than the current values can make problems and are not allowed, therefore smaller values than + ///current page count are ignored! + virtual void setPageCount(const u_int8_t& pageCount); + ///returns current count of pages, + ///NOTE: page number are primary defined in items and secondary in form variable 'page_count'. This function returns the maximal value from both! + virtual u_int8_t getPageCount(); + ///sets current page + virtual void setCurrentPage(const u_int8_t& current_page){cur_page = current_page;}; + ///get current page + virtual u_int8_t getCurrentPage(){return cur_page;}; + ///paint defined page number 0...n + virtual void paintPage(const u_int8_t& page_number, bool do_save_bg = CC_SAVE_SCREEN_NO); + ///set width of scrollbar + virtual void setScrollBarWidth(const int& scrollbar_width){w_sb = scrollbar_width;}; }; #endif diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp new file mode 100644 index 000000000..eb880d6e2 --- /dev/null +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -0,0 +1,175 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + Scrollbar class based up CComponentsFrmChain. + Copyright (C) 2014 Thilo Graf 'dbt' + + 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, see . +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include "cc_frm_scrollbar.h" +#include "system/debug.h" + +using namespace std; + +/* base schema + x,y + +-----------------+ + |+---------------+| + ||sb_up_obj || + || || + |+---------------+| + |+---------------+| + ||sb_segments_obj|| + ||+-------------+|| + ||| segment ||| + ||| id 0 ||| + ||| ||| + ||+-------------+|| + ||| segment ||| + ||| id 1 ||| + ||| ||| + ||+-------------+|| + |+---------------+| + |+---------------+| + ||sb_up_obj || + || || + |+---------------+| + +-----------------+ +*/ + +//sub class CComponentsScrollBar inherit from CComponentsFrmChain +CComponentsScrollBar::CComponentsScrollBar( const int &x_pos, const int &y_pos, const int &w, const int &h, + const int& count, + CComponentsForm* parent, + bool has_shadow, + fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) + :CComponentsFrmChain(x_pos, y_pos, w, h, NULL, CC_DIR_Y, parent, has_shadow, color_frame, color_body, color_shadow) +{ + initVarSbForm(count); +} + +void CComponentsScrollBar::initVarSbForm(const int& count) +{ + cc_item_type = CC_ITEMTYPE_FRM_SCROLLBAR; + fr_thickness = 0; + + append_x_offset = 0; + append_y_offset = 2; + + sb_up_obj = sb_down_obj = NULL; + sb_segments_obj = NULL; + sb_up_icon = frameBuffer->getIconBasePath() + NEUTRINO_ICON_BUTTON_TOP; + sb_up_icon += ".png"; + sb_down_icon = frameBuffer->getIconBasePath() + NEUTRINO_ICON_BUTTON_DOWN; + sb_down_icon += ".png"; + + sb_segments_count = count; + sb_mark_id = 0; + + initCCItems(); +} + +void CComponentsScrollBar::setSegmentCount(const int& segment_count, const int& mark_id) +{ + sb_segments_count = segment_count; + sb_mark_id = mark_id; + initSegments(); +} + + +void CComponentsScrollBar::initCCItems() +{ + initTopNaviIcon(); + initSegments(); + initBottomNaviIcon(); +} + +void CComponentsScrollBar::initTopNaviIcon() +{ + //initialize icon object + if (sb_up_obj == NULL){ + sb_up_obj = new CComponentsPicture(CC_CENTERED, fr_thickness, sb_up_icon, this); + sb_up_obj->doPaintBg(false); + } + sb_up_obj->setWidth(width-2*fr_thickness); +} + +void CComponentsScrollBar::initBottomNaviIcon() +{ + //initialize icon object + if (sb_down_obj == NULL){ + sb_down_obj = new CComponentsPicture(CC_CENTERED, CC_APPEND, sb_down_icon, this); + sb_down_obj->doPaintBg(false); + } + sb_down_obj->setWidth(width-2*fr_thickness); +} + +void CComponentsScrollBar::initSegments() +{ + //init dimensions for segments + int w_seg = width - 4*fr_thickness; + int h_seg = height - (sb_segments_count-1)*append_y_offset; + + //calculate height of segment container + int h_seg_obj = height - 2*sb_up_obj->getHeight() - 3*append_y_offset; + + //init segment container + if (sb_segments_obj == NULL){ + sb_segments_obj = new CComponentsFrmChain(CC_CENTERED, CC_APPEND, w_seg, h_seg_obj, NULL, CC_DIR_Y, this, false); + sb_segments_obj->setFrameThickness(0,0); + sb_segments_obj->setAppendOffset(0, 3); + }else + sb_segments_obj->setDimensionsAll(CC_CENTERED, CC_APPEND, w_seg, h_seg_obj); + + //set current color for segment container + sb_segments_obj->setColorBody(col_body); + + //clean up segment container before add new segments + sb_segments_obj->clear(); + + //set y position of 1st segment and set height of segments + int y_seg = 1+ append_y_offset; + h_seg = sb_segments_obj->getHeight()/sb_segments_count - append_y_offset; + + //create and add segments to segment container + for(u_int8_t i=0; igetCCItemId(item); + if (sb_mark_id > id){ + dprintf(DEBUG_NORMAL, "[CComponentsScrollBar] %s: sb_mark_id out of range current=%d allowed=%d\n", __func__, sb_mark_id, id); + } + + //set color for marked id + if (sb_mark_id == id) + item->setColorBody(COL_MENUCONTENTSELECTED_PLUS_0); + else + item->setColorBody(COL_MENUCONTENT_PLUS_1); + } + + //set corner types + sb_segments_obj->front()->setCorner(RADIUS_MIN, CORNER_TOP); + sb_segments_obj->back()->setCorner(RADIUS_MIN, CORNER_BOTTOM); +} diff --git a/src/gui/components/cc_frm_scrollbar.h b/src/gui/components/cc_frm_scrollbar.h new file mode 100644 index 000000000..55b93faaa --- /dev/null +++ b/src/gui/components/cc_frm_scrollbar.h @@ -0,0 +1,82 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + Scrollbar class based up CComponentsFrmChain. + Copyright (C) 2014 Thilo Graf 'dbt' + + 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, see . +*/ + +#ifndef __CC_FORM_SCROLLBAR_H__ +#define __CC_FORM_SCROLLBAR_H__ + +#include "cc_frm_chain.h" +#include "cc_item_picture.h" + +class CComponentsScrollBar : public CComponentsFrmChain +{ + private: + ///scroll up navi icon object + CComponentsPicture *sb_up_obj; + ///scroll down navi icon object + CComponentsPicture *sb_down_obj; + ///container object for segments + CComponentsFrmChain *sb_segments_obj; + + ///names of navi icons + std::string sb_up_icon, sb_down_icon; + + ///count of segments + int sb_segments_count; + + ///mark id + int sb_mark_id; + + ///init top icon + void initTopNaviIcon(); + ///init bottom icon + void initBottomNaviIcon(); + + ///init segements + void initSegments(); + + ///init all items + void initCCItems(); + + void initVarSbForm( const int& count); + + public: + CComponentsScrollBar( const int &x_pos, const int &y_pos, const int &w = 15, const int &h = 40, + const int& count = 1, + CComponentsForm *parent = NULL, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_3, + fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); +// ~CComponentsScrollBar(); //inherited from CComponentsForm + + ///set marked segment, 1st = 0, 2nd = 1 ... + void setMarkID(const int& mark_id){sb_mark_id = mark_id; initSegments();}; + ///get current assigned marked id + int getMarkID(){return sb_mark_id;}; + + ///Sets count of scrollbar segments and is similar e.g. page count. Each segment is assigned to an id. Starting with id 0...n see also setMarkID(), getMarkID(). + void setSegmentCount(const int& segment_count, const int& mark_id = 0); + ///Get count of current scrollbar segments + int getSegmentCount(){return sb_segments_count;} +}; + +#endif diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 149004cc2..570ae7485 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -360,6 +360,34 @@ void CComponentsWindow::addWindowItem(CComponentsItem* cc_Item) ccw_body->addCCItem(cc_Item); } +void CComponentsWindow::setCurrentPage(const u_int8_t& current_page) +{ + ccw_body->setCurrentPage(current_page); +} + +u_int8_t CComponentsWindow::getCurrentPage() +{ + return ccw_body->getCurrentPage(); +} + +void CComponentsWindow::setScrollBarWidth(const int& scrollbar_width) +{ + ccw_body->setScrollBarWidth(scrollbar_width); +} + +void CComponentsWindow::paintCurPage(bool do_save_bg) +{ + if (is_painted) //ensure that we have painted already the parent form before paint body + ccw_body->paint(do_save_bg); + else + paint(do_save_bg); +} + +void CComponentsWindow::paintPage(const u_int8_t& page_number, bool do_save_bg) +{ + CComponentsWindow::setCurrentPage(page_number); + CComponentsWindow::paintCurPage(do_save_bg); +} void CComponentsWindow::paint(bool do_save_bg) { diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index 3875c8015..8d86a9b38 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.h @@ -183,11 +183,23 @@ class CComponentsWindow : public CComponentsForm ///sets width of sidebars void setWidthSidebar(const int& sidebar_width){ccw_w_sidebar = sidebar_width; initCCWItems();}; + ///sets current page, NOTE: this is simliar with setCurrentPage() known from basic class CComponentsForm, but here it is related only for window body object + void setCurrentPage(const u_int8_t& current_page); + ///get current page, NOTE: this is simliar with getCurrentPage() known from basic class CComponentsForm, but here it is related only for window body object + u_int8_t getCurrentPage(); + + ///paint window body items, this paints only the current page, body = page, current page is definied in body object, see setCurrentPage() + void paintCurPage(bool do_save_bg = CC_SAVE_SCREEN_NO); + ///paint defined page of body, parameter number 0...n + void paintPage(const u_int8_t& page_number, bool do_save_bg = CC_SAVE_SCREEN_NO); + ///set width of body scrollbar + void setScrollBarWidth(const int& scrollbar_width); + ///refresh position and dimension and reinitialize elemenatary properties void Refresh(){initCCWItems();}; ///paint all window items, this overwriting paint() from CComponentsForm - virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); + void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); }; class CComponentsWindowMax : public CComponentsWindow diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 01550c6b6..8a2a1312f 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -49,6 +49,7 @@ CComponentsItem::CComponentsItem(CComponentsForm* parent) cc_item_index = CC_NO_INDEX; cc_item_enabled = true; cc_item_selected = false; + cc_page_number = 0; initParent(parent); } diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index c8f23b386..7d03bcb97 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -33,6 +33,7 @@ class CComponentsForm; +class CComponentsScrollBar; ///cc item types typedef enum @@ -60,6 +61,7 @@ typedef enum CC_ITEMTYPE_BUTTON_YELLOW, CC_ITEMTYPE_BUTTON_BLUE, CC_ITEMTYPE_SLIDER, + CC_ITEMTYPE_FRM_SCROLLBAR, CC_ITEMTYPES }CC_ITEMTYPES_T; diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 25ac66c9b..f70275e0b 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -84,6 +84,7 @@ CTestMenu::CTestMenu() button = NULL; clock = clock_r = NULL; text_ext = NULL; + scrollbar = NULL; } CTestMenu::~CTestMenu() @@ -102,6 +103,7 @@ CTestMenu::~CTestMenu() delete clock_r; delete chnl_pic; delete text_ext; + delete scrollbar; } static int test_pos[4] = { 130, 192, 282, 360 }; @@ -566,6 +568,25 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) footer->hide(); return res; } + else if (actionKey == "scrollbar"){ + if (scrollbar == NULL) + scrollbar = new CComponentsScrollBar(50, 100, 20, 400, 1); + + if (scrollbar->isPainted()){ + if (scrollbar->getMarkID() == scrollbar->getSegmentCount()){ + scrollbar->hide(); + scrollbar->setSegmentCount(scrollbar->getSegmentCount()+1); + } + else{ + scrollbar->setMarkID(scrollbar->getMarkID()+1); + scrollbar->paint(); + } + } + else + scrollbar->paint(); + + return res; + } else if (actionKey == "iconform"){ if (iconform == NULL) iconform = new CComponentsIconForm(); @@ -607,8 +628,9 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) if (window == NULL){ window = new CComponentsWindow(); window->setWindowCaption("|.....................|"); - window->setDimensionsAll(50, 50, 1000, 500); + window->setDimensionsAll(50, 50, 500, 500); window->setWindowIcon(NEUTRINO_ICON_INFO); + window->setShadowOnOff(true); CComponentsShapeCircle *c10 = new CComponentsShapeCircle(0, 0, 28); CComponentsShapeCircle *c11 = new CComponentsShapeCircle(0, CC_APPEND, 28); @@ -618,25 +640,43 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) c11->setColorBody(COL_GREEN); c12->setColorBody(COL_YELLOW); c13->setColorBody(COL_BLUE); - + window->getBodyObject()->setAppendOffset(0,50); window->addWindowItem(c10); window->addWindowItem(c11); window->addWindowItem(c12); window->addWindowItem(c13); + + CComponentsShapeCircle *c14 = new CComponentsShapeCircle(20, 20, 100); + c14->setColorBody(COL_RED); + c14->setPageNumber(1); + window->addWindowItem(c14); } else{ window->setWindowIcon(NEUTRINO_ICON_LOCK); window->setWindowCaption("Test"); } - - - - if (!window->isPainted()) - window->paint(); - else +#if 0 + if (!window->isPainted()){ + window->paint(); //if no other page has been defined, 1st page always painted + } + else{ +#endif //or paint direct a defined page + if (window->getCurrentPage() == 1) + window->paintPage(0); + else + window->paintPage(1); +#if 0 + } +#endif + return res; + } + else if (actionKey == "window_close"){ + if (window){ window->hide(); - + delete window; + window = NULL; + } return res; } else if (actionKey == "running_clock"){ @@ -754,7 +794,9 @@ void CTestMenu::showCCTests(CMenuWidget *widget) widget->addItem(new CMenuForwarder("Footer", true, NULL, this, "footer")); widget->addItem(new CMenuForwarder("Icon-Form", true, NULL, this, "iconform")); widget->addItem(new CMenuForwarder("Window", true, NULL, this, "window")); + widget->addItem(new CMenuForwarder("Window-Close", true, NULL, this, "window_close")); widget->addItem(new CMenuForwarder("Text-Extended", true, NULL, this, "text_ext")); + widget->addItem(new CMenuForwarder("Scrollbar", true, NULL, this, "scrollbar")); } void CTestMenu::showHWTests(CMenuWidget *widget) diff --git a/src/gui/test_menu.h b/src/gui/test_menu.h index ee3693276..e7196d29f 100644 --- a/src/gui/test_menu.h +++ b/src/gui/test_menu.h @@ -53,6 +53,7 @@ class CTestMenu : public CMenuTarget CComponentsFrmClock *clock ,*clock_r; CComponentsChannelLogo* chnl_pic; CComponentsExtTextForm* text_ext; + CComponentsScrollBar* scrollbar; int width, selected; int showTestMenu(); From ce26c10328cdca172633e2e20e15b3cb48b94739 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 27 Jun 2014 23:32:31 +0200 Subject: [PATCH 148/511] CChannelList: disable paint of clock background, it's not required here Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5670e87d77393fb42555bdd147b122cbdda7ea8a Author: Thilo Graf Date: 2014-06-27 (Fri, 27 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index efc294bea..9f772a66c 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2136,7 +2136,7 @@ void CChannelList::paintHead() headerClock = new CComponentsFrmClock(0, 0, 0, 0, "%H:%M", true); headerClock->setClockBlink("%H %M"); headerClock->setClockIntervall(1); - + headerClock->doPaintBg(false); } headerClock->setClockFormat("%H:%M"); headerClock->setClockFont(SNeutrinoSettings::FONT_TYPE_MENU_TITLE); From c0c658ccaaa75d3b35ad9b15d978524db5bffc6c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 28 Jun 2014 14:26:18 +0200 Subject: [PATCH 149/511] neutrino_menue: add own personalize item to standby item Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/aad8c86cb8d98553ce5cd75e826138dd25a62f10 Author: vanhofen Date: 2014-06-28 (Sat, 28 Jun 2014) Origin message was: ------------------ - neutrino_menue: add own personalize item to standby item ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino_menue.cpp | 3 ++- src/system/settings.cpp | 1 + src/system/settings.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index 44474f338..33deb320d 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -282,7 +282,8 @@ void CNeutrinoApp::InitMenuMain() // standby mf = new CMenuForwarder(LOCALE_MAINMENU_STANDBY, true, NULL, this, "standby", CRCInput::RC_red , NEUTRINO_ICON_BUTTON_RED); mf->setHint(NEUTRINO_ICON_HINT_SLEEPTIMER, LOCALE_MENU_HINT_STANDBY); - personalize.addItem(MENU_SHUTDOWN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SLEEPTIMER]); + personalize.addItem(MENU_SHUTDOWN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_STANDBY]); + //sleeptimer mf = new CMenuForwarder(LOCALE_MAINMENU_SLEEPTIMER, true, NULL, new CSleepTimerWidget, NULL, CRCInput::RC_green , NEUTRINO_ICON_BUTTON_GREEN); mf->setHint(NEUTRINO_ICON_HINT_SLEEPTIMER, LOCALE_MENU_HINT_SLEEPTIMER); diff --git a/src/system/settings.cpp b/src/system/settings.cpp index 33f0d42f6..5515e72bb 100644 --- a/src/system/settings.cpp +++ b/src/system/settings.cpp @@ -53,6 +53,7 @@ const struct personalize_settings_t personalize_settings[SNeutrinoSettings::P_SE {"personalize_settings" , CPersonalizeGui::PERSONALIZE_PROTECT_MODE_NOT_PROTECTED}, {"personalize_service" , CPersonalizeGui::PERSONALIZE_PROTECT_MODE_NOT_PROTECTED}, {"personalize_sleeptimer" , CPersonalizeGui::PERSONALIZE_MODE_VISIBLE}, + {"personalize_standby" , CPersonalizeGui::PERSONALIZE_MODE_VISIBLE}, {"personalize_reboot" , CPersonalizeGui::PERSONALIZE_MODE_VISIBLE}, {"personalize_shutdown" , CPersonalizeGui::PERSONALIZE_MODE_VISIBLE}, {"personalize_infomenu_main" , CPersonalizeGui::PERSONALIZE_MODE_VISIBLE}, diff --git a/src/system/settings.h b/src/system/settings.h index cd1b60fbf..dfb96eb07 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -190,6 +190,7 @@ struct SNeutrinoSettings P_MAIN_SETTINGS, P_MAIN_SERVICE, P_MAIN_SLEEPTIMER, + P_MAIN_STANDBY, P_MAIN_REBOOT, P_MAIN_SHUTDOWN, P_MAIN_INFOMENU, From 06c2f76dc3ac611ea17b1a21f0756334e443eef6 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 15 May 2014 13:43:47 +0200 Subject: [PATCH 150/511] Fix sort order in english.locale Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4fc95d63955af9f050c7eaae15c711a90d2faa0c Author: Michael Liebmann Date: 2014-05-15 (Thu, 15 May 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/english.locale | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/locale/english.locale b/data/locale/english.locale index e2909c286..709e95d3f 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -809,8 +809,8 @@ menu.hint_audio_srs SRS TruVolume control volume jumps\nat content changes menu.hint_audio_srs_algo Amount of control, light or normal menu.hint_audio_srs_nmgr Noise manager menu.hint_audio_srs_volume Reference level to maintain -menu.hint_audio_volstep Volume +/- keys increase/decrease step menu.hint_audio_volstart Always set selected volume value on boot +menu.hint_audio_volstep Volume +/- keys increase/decrease step menu.hint_audioplayer_defdir Default audioplayer directory menu.hint_audioplayer_follow Move playlist selected pointer\nto current playing song menu.hint_audioplayer_highprio Increase playback priority From 0c2f834e3e22d32f564bb246cc553c59957655f2 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 27 Jun 2014 22:14:01 +0200 Subject: [PATCH 151/511] CTextBox: Add Flag m_renderMode (Font::FULLBG) for RenderString() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1b9037e8e8d6ce50db6c10e1a49a5c5e2d6c811d Author: Michael Liebmann Date: 2014-06-27 (Fri, 27 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/textbox.cpp | 4 +++- src/gui/widget/textbox.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 655119049..2ff770e4a 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -185,6 +185,8 @@ void CTextBox::initVar(void) m_cLineArray.clear(); + m_renderMode = 0; + // max_width = 0; } @@ -639,7 +641,7 @@ void CTextBox::refreshText(void) //TRACE("[CTextBox] %s Line %d m_cFrame.iX %d m_cFrameTextRel.iX %d\r\n", __FUNCTION__, __LINE__, m_cFrame.iX, m_cFrameTextRel.iX); m_pcFontText->RenderString(m_cFrame.iX + m_cFrameTextRel.iX + text_Hborder_width + x_center, y+m_cFrame.iY, m_cFrameTextRel.iWidth, m_cLineArray[i].c_str(), - m_textColor); + m_textColor, 0, m_renderMode | Font::IS_UTF8); m_old_cText = m_cText; y += m_nFontTextHeight; } diff --git a/src/gui/widget/textbox.h b/src/gui/widget/textbox.h index a7b5aa089..b94f932ff 100644 --- a/src/gui/widget/textbox.h +++ b/src/gui/widget/textbox.h @@ -134,6 +134,7 @@ class CTextBox int m_nMaxTextWidth; int m_nMode; + int m_renderMode; int m_nNrOfPages; int m_nNrOfLines; @@ -183,6 +184,7 @@ class CTextBox void setTextBorderWidth(int Hborder, int Vborder); void setTextFont(Font* font_text); void setTextMode(const int text_mode){m_nMode = text_mode;}; + void setTextRenderModeFullBG(bool mode){ m_renderMode = (mode) ? Font::FULLBG : 0; }; void setBackGroundColor(CFBWindow::color_t textBackgroundColor){m_textBackgroundColor = textBackgroundColor;}; void setWindowPos(const CBox* position){m_cFrame = *position;}; void setWindowMaxDimensions(const int width, const int height); From 02d85fad41936d6a3960be6921f6e39454cc1d45 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 28 Jun 2014 15:27:26 +0200 Subject: [PATCH 152/511] CComponentsChannelLogo: disable paint of logo background, it's not required here - Fix calculation of logo width & height Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3d805054f4897ccd24aafc3fc611b5361acb6140 Author: Michael Liebmann Date: 2014-06-28 (Sat, 28 Jun 2014) ------------------ This commit was generated by Migit --- src/gui/components/cc_item_picture.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index c34905f94..eaad21253 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -139,8 +139,11 @@ void CComponentsPicture::initCCItem() //resize/scale image if required, if no icon mode detected, use real image size if (!is_icon){ - if (width != w_pic || height != h_pic) + if (width != w_pic || height != h_pic) { g_PicViewer->rescaleImageDimensions(&w_pic, &h_pic, width, height); + width = w_pic; + height = h_pic; + } } } @@ -248,11 +251,13 @@ void CComponentsChannelLogo::setChannel(const uint64_t& channelId, const std::st { channel_id = channelId; channel_name = channelName; + int dummy; - has_logo = g_PicViewer->GetLogoName(channel_id, channel_name, pic_name, &width, &height); + has_logo = g_PicViewer->GetLogoName(channel_id, channel_name, pic_name, &dummy, &dummy); if (!has_logo) pic_name = alt_pic_name; initCCItem(); + doPaintBg(false); } From c1174ba5ab0e2afb12b21df52262897e58c30909 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 28 Jun 2014 16:23:11 +0200 Subject: [PATCH 153/511] CChannelList: Use CComponentsChannelLogo for display channellogo Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2ecd9918cb53f0d419da8a07d11015644c8d0b8a Author: Michael Liebmann Date: 2014-06-28 (Sat, 28 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 25 ++++++++++++++----------- src/gui/channellist.h | 2 ++ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 9f772a66c..15c6b1251 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -119,6 +119,7 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl cc_minitv = NULL; logo_off = 0; pig_on_win = false; + CChannelLogo = NULL; //printf("************ NEW LIST %s : %x\n", name.c_str(), (int) this);fflush(stdout); } @@ -141,6 +142,11 @@ CChannelList::~CChannelList() if (headerClock->isClockRun()) headerClock->stopThread(); } + + if (CChannelLogo) { + delete CChannelLogo; + CChannelLogo = NULL; + } } void CChannelList::ClearList(void) { @@ -1766,19 +1772,16 @@ void CChannelList::paintItem2DetailsLine (int pos) void CChannelList::showChannelLogo() { if(g_settings.channellist_show_channellogo){ - static int logo_w = 0; - static int logo_h = 0; int logo_w_max = full_width / 4; - - if (logo_w && logo_h) - frameBuffer->paintBoxRel(x + full_width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h, COL_MENUHEAD_PLUS_0); - - std::string lname; - if(g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->getName(), lname, &logo_w, &logo_h)) { - if((logo_h > theight) || (logo_w > logo_w_max)) - g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, theight); - g_PicViewer->DisplayImage(lname, x + full_width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h); + if (CChannelLogo) { + CChannelLogo->hide(); + delete CChannelLogo; } + CChannelLogo = new CComponentsChannelLogo(0, 0, logo_w_max, theight, + chanlist[selected]->getName(), chanlist[selected]->channel_id); + CChannelLogo->setXPos(x + full_width - logo_off - CChannelLogo->getWidth()); + CChannelLogo->setYPos(y + (theight - CChannelLogo->getHeight()) / 2); + CChannelLogo->paint(); } } diff --git a/src/gui/channellist.h b/src/gui/channellist.h index ad9e61ff9..273c23023 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -104,6 +104,8 @@ private: int ChannelList_Rec; + CComponentsChannelLogo* CChannelLogo; + void paintDetails(int index); void clearItem2DetailsLine (); void paintItem2DetailsLine (int pos); From 66685bf0d10d6f62fcf3b31a0ba252ba7c3ba1c6 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 28 Jun 2014 16:55:35 +0200 Subject: [PATCH 154/511] CMovieBrowser: Use CComponentsChannelLogo for display channellogo Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2b63d1a243ced72d34830c57669ad4935820ea74 Author: Michael Liebmann Date: 2014-06-28 (Sat, 28 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser.cpp | 30 ++++++++++++++++++++++-------- src/gui/moviebrowser.h | 2 ++ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 35182a1b1..c41e7b9bb 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -375,6 +375,11 @@ CMovieBrowser::~CMovieBrowser() m_FilterLines.lineArray[i].clear(); } m_browserListLines.Icon.clear(); + + if (CChannelLogo) { + delete CChannelLogo; + CChannelLogo = NULL; + } } void CMovieBrowser::fileInfoStale(void) @@ -516,6 +521,8 @@ void CMovieBrowser::init(void) refreshFilterList(); g_PicViewer->getSupportedImageFormats(PicExts); show_mode = MB_SHOW_RECORDS; //FIXME + + CChannelLogo = NULL; #if 0 TRACE_1("Frames\r\n\tScren:\t%3d,%3d,%3d,%3d\r\n\tMain:\t%3d,%3d,%3d,%3d\r\n\tTitle:\t%3d,%3d,%3d,%3d \r\n\tBrowsr:\t%3d,%3d,%3d,%3d \r\n\tPlay:\t%3d,%3d,%3d,%3d \r\n\tRecord:\t%3d,%3d,%3d,%3d\r\n\r\n", g_settings.screen_StartX, @@ -1305,15 +1312,22 @@ void CMovieBrowser::refreshMovieInfo(void) short pb_hdd_offset = 104; if (show_mode == MB_SHOW_YT) pb_hdd_offset = 0; - m_pcWindow->paintBoxRel(lx - pb_hdd_offset , ly, logo_w, logo_h, TITLE_BACKGROUND_COLOR); - std::string lname; - if(g_PicViewer->GetLogoName(m_movieSelectionHandler->epgEpgId >>16, m_movieSelectionHandler->epgChannel, lname, &logo_w, &logo_h)){ - if((logo_h > m_cBoxFrameTitleRel.iHeight) || (logo_w > logo_w_max)) - g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, m_cBoxFrameTitleRel.iHeight); - lx = m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-logo_w-10; - ly = m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-logo_h)/2; - g_PicViewer->DisplayImage(lname, lx - pb_hdd_offset, ly, logo_w, logo_h); + static uint64_t old_EpgId = 0; + if (CChannelLogo && (old_EpgId != m_movieSelectionHandler->epgEpgId >>16)) { + CChannelLogo->hide(); + delete CChannelLogo; } + if (old_EpgId != m_movieSelectionHandler->epgEpgId >>16) { + CChannelLogo = new CComponentsChannelLogo(0, 0, logo_w_max, m_cBoxFrameTitleRel.iHeight, + m_movieSelectionHandler->epgChannel, m_movieSelectionHandler->epgEpgId >>16); + old_EpgId = m_movieSelectionHandler->epgEpgId >>16; + } + lx = m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-CChannelLogo->getWidth()-10; + ly = m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-CChannelLogo->getHeight())/2; + CChannelLogo->setXPos(lx - pb_hdd_offset); + CChannelLogo->setYPos(ly); + CChannelLogo->paint(); + if(logo_ok) { lx = m_cBoxFrameInfo.iX+m_cBoxFrameInfo.iWidth - flogo_w -14; ly = m_cBoxFrameInfo.iY - 1 + (m_cBoxFrameInfo.iHeight-flogo_h)/2; diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser.h index e543ee303..38ed0a0ea 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -314,6 +314,8 @@ class CMovieBrowser : public CMenuTarget MB_SETTINGS m_settings; std::vector m_dir; + CComponentsChannelLogo* CChannelLogo; + int movieInfoUpdateAll[MB_INFO_MAX_NUMBER]; int movieInfoUpdateAllIfDestEmptyOnly; From 0950d5e56dd09e763909cc2126a008559d1a5981 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 17 Jun 2014 16:26:46 +0400 Subject: [PATCH 155/511] neutrino.cpp: zap also with page up/page down buttons Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fa8f28eed11b021ca82b5afe68f76d68b71254cd Author: [CST] Focus Date: 2014-06-17 (Tue, 17 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 2e922867f..542679bc0 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2270,6 +2270,9 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) else if (CRCInput::isNumeric(msg)) { numericZap( msg ); } + else if( msg == CRCInput::RC_page_up || msg == CRCInput::RC_page_down) { + quickZap(msg == CRCInput::RC_page_up ? CRCInput::RC_right : CRCInput::RC_left); + } else if(msg == CRCInput::RC_rewind) { if(g_RemoteControl->is_video_started) { t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); From 9fddab50fdde259762dc14395078a64a794ff977 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 17 Jun 2014 16:27:16 +0400 Subject: [PATCH 156/511] gui/scan.cpp: change signal/snr layout to vertical Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9f4aeb207438b24c6b17df211b8a964eef70442f Author: [CST] Focus Date: 2014-06-17 (Tue, 17 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/scan.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index b78ccc80e..48ac83c52 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -201,7 +201,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); fw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getWidth(); width = w_max(fw * 42, 0); - height = h_max(hheight + (10 * mheight), 0); //9 lines + height = h_max(hheight + (11 * mheight), 0); //9 lines x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - height) / 2; xpos_radar = x + 36 * fw; @@ -580,7 +580,8 @@ void CScanTs::showSNR () { if (signalbox == NULL){ CFrontend * frontend = CServiceScan::getInstance()->GetFrontend(); - signalbox = new CSignalBox(xpos1, y + height - mheight - 5, width - 2*(xpos1-x), g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(), frontend, false); + //signalbox = new CSignalBox(xpos1, y + height - mheight - 5, width - 2*(xpos1-x), g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(), frontend, false); + signalbox = new CSignalBox(xpos1, y + height - 2*mheight - 5, width - 2*(xpos1-x), 2*g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(), frontend, true); signalbox->setColorBody(COL_MENUCONTENT_PLUS_0); signalbox->setTextColor(COL_MENUCONTENT_TEXT); signalbox->doPaintBg(true); From 5b4f34b8baac566d0a7e91909769161b40782653 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 17 Jun 2014 16:27:30 +0400 Subject: [PATCH 157/511] gui/motorcontrol.cpp: change signal/snr layout to vertical Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/60c965d6b8c8a0f3bd8e939b700bcbe40c9c73eb Author: [CST] Focus Date: 2014-06-17 (Tue, 17 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/motorcontrol.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index 8bad63512..caf2b2689 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -77,7 +77,7 @@ void CMotorControl::Init(void) width = w_max(720, 0); mheight = mheight - 2; - height = hheight + (22 * mheight) - 5; + height = hheight + (23 * mheight) - 5; height = h_max(height, 0); x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; @@ -582,7 +582,8 @@ void CMotorControl::showSNR () { if (signalbox == NULL){ int xpos1 = x + 10; - signalbox = new CSignalBox(xpos1, y + height - mheight - 5, width - 2*(xpos1-x), g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(), frontend, false); + //signalbox = new CSignalBox(xpos1, y + height - mheight - 5, width - 2*(xpos1-x), g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(), frontend, false); + signalbox = new CSignalBox(xpos1, y + height - 4*mheight - 5, width - 2*(xpos1-x), 4*g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(), frontend, true); signalbox->setColorBody(COL_MENUCONTENT_PLUS_0); signalbox->setTextColor(COL_MENUCONTENT_TEXT); signalbox->doPaintBg(true); From 0157f1d448dd4a68a8fddd14da66e1dd9f8fb6d6 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 18 Jun 2014 15:11:21 +0400 Subject: [PATCH 158/511] gui/network_service.cpp: change djmount charset option to UTF-8 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ba754ba61af504447b1b1f1ee8106c7b3c0f4fca Author: [CST] Focus Date: 2014-06-18 (Wed, 18 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/network_service.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/network_service.cpp b/src/gui/network_service.cpp index 2fa4c2c79..9ae2ec059 100644 --- a/src/gui/network_service.cpp +++ b/src/gui/network_service.cpp @@ -55,7 +55,7 @@ static struct network_service services[SERVICE_COUNT] = { { "FTP", "vsftpd", "", LOCALE_MENU_HINT_NET_FTPD, "", 0 }, { "Telnet", "telnetd", "-l/bin/login", LOCALE_MENU_HINT_NET_TELNET, "", 0 }, - { "DjMount", "djmount", "-o iocharset=utf8 /media/00upnp/", LOCALE_MENU_HINT_NET_DJMOUNT, "", 0 }, + { "DjMount", "djmount", "-o iocharset=UTF-8 /media/00upnp/", LOCALE_MENU_HINT_NET_DJMOUNT, "", 0 }, { "uShare", "ushare", "-D -n `cat /etc/hostname`", LOCALE_MENU_HINT_NET_USHARE, "", 0 }, { "xupnpd", "xupnpd", "", LOCALE_MENU_HINT_NET_XUPNPD, "", 0 }, }; From 7a88703a8b165cd51fde8477d0ba5d61b874dda9 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 19 Jun 2014 10:15:31 +0400 Subject: [PATCH 159/511] gui/network_service.cpp: add dropbear Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fc3e9ebd62522e622b9a31598b98346d65782ac9 Author: [CST] Focus Date: 2014-06-19 (Thu, 19 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/english.locale | 1 + src/gui/network_service.cpp | 5 +++-- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/data/locale/english.locale b/data/locale/english.locale index 709e95d3f..e295cb317 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1006,6 +1006,7 @@ menu.hint_movieplayer_plugin Choose a plugin that's executed with the one touch menu.hint_net_broadcast Enter broadcast address\nif unsure, use IP address with last .255 menu.hint_net_dhcp Use DHCP server to auto-configure menu.hint_net_djmount Mount UPnP devices as filesystem\nunder /media/00upnp +menu.hint_net_dropbear Enable ssh access to the box menu.hint_net_ftpd Enable file transfer using FTP menu.hint_net_gateway Enter gateway/router IP address menu.hint_net_hostname Change your box hostname diff --git a/src/gui/network_service.cpp b/src/gui/network_service.cpp index 9ae2ec059..15ff33e8b 100644 --- a/src/gui/network_service.cpp +++ b/src/gui/network_service.cpp @@ -50,15 +50,16 @@ struct network_service int enabled; }; -#define SERVICE_COUNT 5 -static struct network_service services[SERVICE_COUNT] = +static struct network_service services[] = { { "FTP", "vsftpd", "", LOCALE_MENU_HINT_NET_FTPD, "", 0 }, { "Telnet", "telnetd", "-l/bin/login", LOCALE_MENU_HINT_NET_TELNET, "", 0 }, { "DjMount", "djmount", "-o iocharset=UTF-8 /media/00upnp/", LOCALE_MENU_HINT_NET_DJMOUNT, "", 0 }, { "uShare", "ushare", "-D -n `cat /etc/hostname`", LOCALE_MENU_HINT_NET_USHARE, "", 0 }, { "xupnpd", "xupnpd", "", LOCALE_MENU_HINT_NET_XUPNPD, "", 0 }, + { "Dropbear", "dropbear", "-B", LOCALE_MENU_HINT_NET_DROPBEAR, "", 0 }, }; +#define SERVICE_COUNT (sizeof(services)/sizeof(struct network_service)) CNetworkService::CNetworkService(std::string cmd, std::string opts) { diff --git a/src/system/locals.h b/src/system/locals.h index 51943932f..6e57c0539 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1033,6 +1033,7 @@ typedef enum LOCALE_MENU_HINT_NET_BROADCAST, LOCALE_MENU_HINT_NET_DHCP, LOCALE_MENU_HINT_NET_DJMOUNT, + LOCALE_MENU_HINT_NET_DROPBEAR, LOCALE_MENU_HINT_NET_FTPD, LOCALE_MENU_HINT_NET_GATEWAY, LOCALE_MENU_HINT_NET_HOSTNAME, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index ad7629dfb..850fe513a 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1033,6 +1033,7 @@ const char * locale_real_names[] = "menu.hint_net_broadcast", "menu.hint_net_dhcp", "menu.hint_net_djmount", + "menu.hint_net_dropbear", "menu.hint_net_ftpd", "menu.hint_net_gateway", "menu.hint_net_hostname", From cd2933aa7f136c0b8a9dcac659d733433a083f28 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 19 Jun 2014 17:40:55 +0400 Subject: [PATCH 160/511] gui/scan.cpp, gui/motorcontrol.cpp: increase signal bar height for 50% Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bb77bafdca14fd2fa7fae716c356350526206ba2 Author: [CST] Focus Date: 2014-06-19 (Thu, 19 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/motorcontrol.cpp | 4 ++-- src/gui/scan.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index caf2b2689..75fa484f9 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -77,7 +77,7 @@ void CMotorControl::Init(void) width = w_max(720, 0); mheight = mheight - 2; - height = hheight + (23 * mheight) - 5; + height = hheight + (24 * mheight) - 5; height = h_max(height, 0); x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; @@ -583,7 +583,7 @@ void CMotorControl::showSNR () if (signalbox == NULL){ int xpos1 = x + 10; //signalbox = new CSignalBox(xpos1, y + height - mheight - 5, width - 2*(xpos1-x), g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(), frontend, false); - signalbox = new CSignalBox(xpos1, y + height - 4*mheight - 5, width - 2*(xpos1-x), 4*g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(), frontend, true); + signalbox = new CSignalBox(xpos1, y + height - (mheight*2*3)/2 - 5, width - 2*(xpos1-x), (g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight()*2*3)/2, frontend, true); signalbox->setColorBody(COL_MENUCONTENT_PLUS_0); signalbox->setTextColor(COL_MENUCONTENT_TEXT); signalbox->doPaintBg(true); diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 48ac83c52..4451abff9 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -201,7 +201,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); fw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getWidth(); width = w_max(fw * 42, 0); - height = h_max(hheight + (11 * mheight), 0); //9 lines + height = h_max(hheight + (12 * mheight), 0); //9 lines x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - height) / 2; xpos_radar = x + 36 * fw; @@ -581,7 +581,7 @@ void CScanTs::showSNR () if (signalbox == NULL){ CFrontend * frontend = CServiceScan::getInstance()->GetFrontend(); //signalbox = new CSignalBox(xpos1, y + height - mheight - 5, width - 2*(xpos1-x), g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(), frontend, false); - signalbox = new CSignalBox(xpos1, y + height - 2*mheight - 5, width - 2*(xpos1-x), 2*g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(), frontend, true); + signalbox = new CSignalBox(xpos1, y + height - (mheight*2*3)/2 - 5, width - 2*(xpos1-x), (g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight()*2*3)/2, frontend, true); signalbox->setColorBody(COL_MENUCONTENT_PLUS_0); signalbox->setTextColor(COL_MENUCONTENT_TEXT); signalbox->doPaintBg(true); From 0b0bc4e62da7d232e4106f31a46b5c722fa71583 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 19 Jun 2014 17:41:47 +0400 Subject: [PATCH 161/511] gui/scan_setup.cpp: add signal test menu on request Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/629528908b94ec85304f7416eadce865855e0c0b Author: [CST] Focus Date: 2014-06-19 (Thu, 19 Jun 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/scan_setup.cpp | 16 ++++++++++++---- src/gui/scan_setup.h | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index ed59b5ef5..7728fbf56 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -458,6 +458,12 @@ int CScanSetup::showScanMenu() mf->setHint("", LOCALE_MENU_HINT_SCAN_FAST); settings->addItem(mf); #endif + //signal test + CMenuWidget * sTest = new CMenuWidget(LOCALE_SCANTS_TEST, NEUTRINO_ICON_SETTINGS, w/*width*/, MN_WIDGET_ID_SCAN_MANUAL_SCAN); + addScanMenuManualScan(sTest, true); + mf = new CMenuDForwarder(LOCALE_SCANTS_TEST, true, NULL, sTest, "", CRCInput::convertDigitToKey(shortcut++)); + mf->setHint("", LOCALE_MENU_HINT_SCAN_TEST); + settings->addItem(mf); settings->addItem(GenericMenuSeparatorLine); } if (CFEManager::getInstance()->haveCable()) { @@ -1179,7 +1185,7 @@ void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satcon } //init manual scan menu -void CScanSetup::addScanMenuManualScan(CMenuWidget *manual_Scan) +void CScanSetup::addScanMenuManualScan(CMenuWidget *manual_Scan, bool stest) { printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__); int shortCut = 1; @@ -1229,9 +1235,11 @@ void CScanSetup::addScanMenuManualScan(CMenuWidget *manual_Scan) mf->setHint("", LOCALE_MENU_HINT_SCAN_TEST); manual_Scan->addItem(mf); - mf = new CMenuForwarder(LOCALE_SCANTS_STARTNOW, allow_start, NULL, this, act_manual, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE); - mf->setHint("", LOCALE_MENU_HINT_SCAN_START); - manual_Scan->addItem(mf); + if (!stest) { + mf = new CMenuForwarder(LOCALE_SCANTS_STARTNOW, allow_start, NULL, this, act_manual, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE); + mf->setHint("", LOCALE_MENU_HINT_SCAN_START); + manual_Scan->addItem(mf); + } } //init auto scan all menu diff --git a/src/gui/scan_setup.h b/src/gui/scan_setup.h index b76dc9784..a61dd34ea 100644 --- a/src/gui/scan_setup.h +++ b/src/gui/scan_setup.h @@ -110,7 +110,7 @@ class CScanSetup : public CMenuTarget, public CChangeObserver neutrino_locale_t getModeLocale(int mode); int showScanMenuFrontendSetup(); void addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t &satconfig); - void addScanMenuManualScan(CMenuWidget *manual_Scan); + void addScanMenuManualScan(CMenuWidget *manual_Scan, bool stest = false); void addScanMenuAutoScanAll(CMenuWidget *auto_ScanAll); void addScanMenuAutoScan(CMenuWidget *auto_Scan); From 53f3f844736e42d49302c04b74fbec147a09c1ae Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 2 Jul 2014 14:49:53 +0400 Subject: [PATCH 162/511] gui/moviebrowser.cpp: fix off-screen draw, if OSD height is set to max in osd setup Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a7c93d19265431f3e13e929ddc05ab10fb3adbb9 Author: [CST] Focus Date: 2014-07-02 (Wed, 02 Jul 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index c41e7b9bb..137252d4e 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -648,9 +648,9 @@ void CMovieBrowser::initFrames(void) m_cBoxFrameBrowserList.iHeight = m_cBoxFrame.iHeight * m_settings.browserFrameHeight / 100; m_cBoxFrameFootRel.iX = 0; - m_cBoxFrameFootRel.iY = m_cBoxFrame.iHeight - m_pcFontFoot->getHeight(); + m_cBoxFrameFootRel.iY = m_cBoxFrame.iHeight - m_pcFontFoot->getHeight() - 6; m_cBoxFrameFootRel.iWidth = m_cBoxFrameBrowserList.iWidth; - m_cBoxFrameFootRel.iHeight = m_pcFontFoot->getHeight(); + m_cBoxFrameFootRel.iHeight = m_pcFontFoot->getHeight() + 6; m_cBoxFrameLastPlayList.iX = m_cBoxFrameBrowserList.iX; m_cBoxFrameLastPlayList.iY = m_cBoxFrameBrowserList.iY ; @@ -1683,7 +1683,7 @@ void CMovieBrowser::refreshFoot(void) // draw the background first m_pcWindow->paintBoxRel(m_cBoxFrame.iX+m_cBoxFrameFootRel.iX, m_cBoxFrame.iY+ m_cBoxFrameFootRel.iY, - m_cBoxFrameFootRel.iWidth, m_cBoxFrameFootRel.iHeight+ 6, + m_cBoxFrameFootRel.iWidth, m_cBoxFrameFootRel.iHeight, (CFBWindow::color_t)COL_INFOBAR_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); if(m_settings.gui == MB_GUI_FILTER && m_windowFocus == MB_FOCUS_FILTER) @@ -1697,7 +1697,7 @@ void CMovieBrowser::refreshFoot(void) const int xoff = 10; const int ypos_icon = m_cBoxFrame.iY + m_cBoxFrameFootRel.iY; - const int ypos_font = m_cBoxFrame.iY + m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4; + const int ypos_font = m_cBoxFrame.iY + m_cBoxFrameFootRel.iY + m_pcFontFoot->getHeight() + (m_cBoxFrameFootRel.iHeight - m_pcFontFoot->getHeight()) / 2; int xpos = m_cBoxFrame.iX + m_cBoxFrameFootRel.iX + xoff; int max_b = 5; @@ -1709,38 +1709,38 @@ void CMovieBrowser::refreshFoot(void) if (m_settings.gui != MB_GUI_LAST_PLAY && m_settings.gui != MB_GUI_LAST_RECORD) { m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_RED, &iw, &ih); - m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_RED, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight+ 6); + m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_RED, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight); m_pcFontFoot->RenderString(xpos + xoff + iw, ypos_font, width - iw - 2*xoff, sort_text.c_str(), (CFBWindow::color_t)color); xpos += width; m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_GREEN, &iw, &ih); - m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight+ 6); + m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight); m_pcFontFoot->RenderString(xpos + xoff + iw, ypos_font, width - iw - 2*xoff, filter_text.c_str(), (CFBWindow::color_t)color); xpos += width; } m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_YELLOW, &iw, &ih); - m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight+ 6); + m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight); m_pcFontFoot->RenderString(xpos + xoff + iw, ypos_font, width - iw - 2*xoff, g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_FOCUS), (CFBWindow::color_t)color); xpos += width; m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_BLUE, &iw, &ih); - m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_BLUE, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight+ 6); + m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_BLUE, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight); m_pcFontFoot->RenderString(xpos + xoff + iw, ypos_font, width - iw - 2*xoff, g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_REFRESH), (CFBWindow::color_t)color); xpos += width; m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_OKAY, &iw, &ih); - m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight+ 6); + m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight); m_pcFontFoot->RenderString(xpos + xoff + iw, ypos_font, width - iw - 2*xoff, ok_text.c_str(), (CFBWindow::color_t)color); xpos += width; m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_SMALL, &iw, &ih); - m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight+ 6); + m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight); m_pcFontFoot->RenderString(xpos + xoff + iw , ypos_font, width - iw - 2*xoff, g_Locale->getText(LOCALE_FILEBROWSER_DELETE), (CFBWindow::color_t)color); xpos += width; m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_MENU_SMALL, &iw, &ih); - m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_MENU_SMALL, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight+ 6); + m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_MENU_SMALL, xpos, ypos_icon, m_cBoxFrameFootRel.iHeight); m_pcFontFoot->RenderString(xpos + xoff + iw , ypos_font, width - iw - 2*xoff, g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_OPTIONS), (CFBWindow::color_t)color); } From ba37ea33977f78ebfbb2b3ab66dcbbfef882d88f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 3 Jul 2014 11:43:31 +0200 Subject: [PATCH 163/511] moviebrowser: prevent segfault at movies w/o channellogo commit taken from max10s-neutrino-mp Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b7b0da12b476aa0e367395448670f03df8966fee Author: vanhofen Date: 2014-07-03 (Thu, 03 Jul 2014) Origin message was: ------------------ - moviebrowser: prevent segfault at movies w/o channellogo commit taken from max10s-neutrino-mp ------------------ This commit was generated by Migit --- src/gui/moviebrowser.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 137252d4e..d112ccd46 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1322,11 +1322,14 @@ void CMovieBrowser::refreshMovieInfo(void) m_movieSelectionHandler->epgChannel, m_movieSelectionHandler->epgEpgId >>16); old_EpgId = m_movieSelectionHandler->epgEpgId >>16; } - lx = m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-CChannelLogo->getWidth()-10; - ly = m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-CChannelLogo->getHeight())/2; - CChannelLogo->setXPos(lx - pb_hdd_offset); - CChannelLogo->setYPos(ly); - CChannelLogo->paint(); + + if (CChannelLogo) { + lx = m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-CChannelLogo->getWidth()-10; + ly = m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-CChannelLogo->getHeight())/2; + CChannelLogo->setXPos(lx - pb_hdd_offset); + CChannelLogo->setYPos(ly); + CChannelLogo->paint(); + } if(logo_ok) { lx = m_cBoxFrameInfo.iX+m_cBoxFrameInfo.iWidth - flogo_w -14; From 5a54cac654aaa616076caf0943a6de0f1301ca66 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 2 Jul 2014 11:38:56 +0200 Subject: [PATCH 164/511] Update deutsch.locale Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0a9d363251ed3d6ba39b518f8a13f8402906991e Author: Michael Liebmann Date: 2014-07-02 (Wed, 02 Jul 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 1 + 1 file changed, 1 insertion(+) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 43bebc92c..184545f21 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1006,6 +1006,7 @@ menu.hint_movieplayer_plugin Wählen Sie ein Plugin, das mit einer Schnellstart- menu.hint_net_broadcast Ändern Sie die Broadcast-Adresse.\nWenn Sie unsicher sind, verwenden Sie zuletzt .255 menu.hint_net_dhcp Verwenden Sie einen DHCP-Server für die automatische Vergabe einer IP-Adresse im Netzwerk menu.hint_net_djmount Mountet UPnP-Geräte als Dateisystem unter /media/00upnp +menu.hint_net_dropbear Aktivieren Sie SSH Zugriff zur Box menu.hint_net_ftpd Aktivieren Sie die Dateiübertragung über FTP menu.hint_net_gateway Geben Sie die Gateway-Adresse des Routers ein menu.hint_net_hostname Ändern Sie den Hostnamen der Box From 4cb337578bf30dc56401babefeabc4d47709d61c Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 4 Jul 2014 02:03:57 +0200 Subject: [PATCH 165/511] CLuaInstance::SignalBoxNew: Add 'parent' parameter... ...for the integration of signalbox in a parent cwindow Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/176d97969e494986bd0817a75fc3aa9b766b7357 Author: Michael Liebmann Date: 2014-07-04 (Fri, 04 Jul 2014) ------------------ This commit was generated by Migit --- src/gui/luainstance.cpp | 6 +++++- src/gui/luainstance.h | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 327b1c8a8..3d4a29788 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -1636,15 +1636,19 @@ int CLuaInstance::SignalBoxNew(lua_State *L) std::string name, icon = std::string(NEUTRINO_ICON_INFO); int x = 110, y = 150, dx = 430, dy = 150; int vertical = true; + CLuaCWindow* parent = NULL; tableLookup(L, "x", x); tableLookup(L, "y", y); tableLookup(L, "dx", dx); tableLookup(L, "dy", dy); tableLookup(L, "vertical", vertical); + tableLookup(L, "parent", (void**)&parent); + CComponentsForm* pw = (parent && parent->w) ? parent->w->getBodyObject() : NULL; CLuaSignalBox **udata = (CLuaSignalBox **) lua_newuserdata(L, sizeof(CLuaSignalBox *)); *udata = new CLuaSignalBox(); - (*udata)->s = new CSignalBox(x, y, dx, dy, NULL, (vertical!=0)?true:false); + (*udata)->s = new CSignalBox(x, y, dx, dy, NULL, (vertical!=0)?true:false, pw); + (*udata)->parent = pw; luaL_getmetatable(L, "signalbox"); lua_setmetatable(L, -2); return 1; diff --git a/src/gui/luainstance.h b/src/gui/luainstance.h index bda26c6aa..f69a42ae9 100644 --- a/src/gui/luainstance.h +++ b/src/gui/luainstance.h @@ -131,8 +131,9 @@ class CLuaSignalBox { public: CSignalBox *s; - CLuaSignalBox() { s = NULL; } - ~CLuaSignalBox() { delete s; } + CComponentsForm *parent; + CLuaSignalBox() { s = NULL; parent = NULL;} + ~CLuaSignalBox() { if (parent == NULL) delete s; } }; class CLuaComponentsText From aaa305dd57e5b154f8a63e68f93911fbe6cd1b1d Mon Sep 17 00:00:00 2001 From: martii Date: Sun, 6 Jul 2014 08:28:38 +0200 Subject: [PATCH 166/511] driver/record: auto-terminate temporary timeshift recordings Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c9d78e1a9c814625d3daadff61d9074e5bcdd55e Author: martii Date: 2014-07-06 (Sun, 06 Jul 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/record.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 12bfc3e20..5c2eae786 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1274,7 +1274,9 @@ void CRecordManager::StartTimeshift() if(res) { CMoviePlayerGui::getInstance().exec(NULL, tmode); - if(g_settings.temp_timeshift && !g_settings.auto_timeshift && autoshift) + if(g_settings.temp_timeshift) + Stop(live_channel_id); + else if (!(g_settings.auto_timeshift && autoshift)) ShowMenu(); } } From 2795f29339365364c8f3ee36a24096b43e405e7b Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 10 Jul 2014 15:59:20 +0200 Subject: [PATCH 167/511] CComponentsPicture: Add parameter 'transparent'... ...to set the transparency of pictures - Set default transparency for CComponentsChannelLogo to CFrameBuffer::TM_BLACK (Transparency when black content -> 'pseudo' transparency) - Set default transparency for CComponentsPicture to CFrameBuffer::TM_NONE (No 'pseudo' transparency) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a182fca81f1e088c65490be45a9eb69acb8a6751 Author: Michael Liebmann Date: 2014-07-10 (Thu, 10 Jul 2014) Origin message was: ------------------ CComponentsPicture: Add parameter 'transparent'... ...to set the transparency of pictures - Set default transparency for CComponentsChannelLogo to CFrameBuffer::TM_BLACK (Transparency when black content -> 'pseudo' transparency) - Set default transparency for CComponentsPicture to CFrameBuffer::TM_NONE (No 'pseudo' transparency) ------------------ This commit was generated by Migit --- src/gui/components/cc_item_picture.cpp | 22 +++++++++++++--------- src/gui/components/cc_item_picture.h | 22 +++++++++++++++++----- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index eaad21253..56905219f 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -45,25 +45,25 @@ CComponentsPicture::CComponentsPicture( const int &x_pos, const int &y_pos, cons const std::string& image_path, CComponentsForm *parent, bool has_shadow, - fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow) + fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow, int transparent) { - init(x_pos, y_pos, w, h, image_path, parent, has_shadow, color_frame, color_background, color_shadow); + init(x_pos, y_pos, w, h, image_path, parent, has_shadow, color_frame, color_background, color_shadow, transparent); } CComponentsPicture::CComponentsPicture( const int &x_pos, const int &y_pos, const std::string& image_name, CComponentsForm *parent, bool has_shadow, - fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow) + fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow, int transparent) { - init(x_pos, y_pos, 0, 0, image_name, parent, has_shadow, color_frame, color_background, color_shadow); + init(x_pos, y_pos, 0, 0, image_name, parent, has_shadow, color_frame, color_background, color_shadow, transparent); } void CComponentsPicture::init( const int &x_pos, const int &y_pos, const int &w, const int &h, const string& image_name, CComponentsForm *parent, bool has_shadow, - fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow) + fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow, int transparent) { //CComponents, CComponentsItem cc_item_type = CC_ITEMTYPE_PICTURE; @@ -86,6 +86,8 @@ void CComponentsPicture::init( const int &x_pos, const int &y_pos, const int &w, is_image_painted= false; do_paint = true; + image_transparent = transparent; + g_PicViewer->getSupportedImageFormats(v_ext); v_ext.resize(unique(v_ext.begin(), v_ext.end()) - v_ext.begin()); initCCItem(); @@ -181,10 +183,12 @@ void CComponentsPicture::paintPicture() dprintf(DEBUG_INFO, "[CComponentsPicture] %s: paint image file: pic_name=%s\n", __func__, pic_name.c_str()); if (cc_allow_paint){ + frameBuffer->SetTransparent(image_transparent); if (!is_icon) is_image_painted = g_PicViewer->DisplayImage(pic_name, x_pic, y_pic, width, height); else is_image_painted = frameBuffer->paintIcon(pic_name, x_pic, y_pic, height, 1, do_paint, paint_bg, col_body); + frameBuffer->SetTransparentDefault(); } } @@ -206,10 +210,10 @@ CComponentsChannelLogo::CComponentsChannelLogo( const int &x_pos, const int &y_p const uint64_t& channelId, CComponentsForm *parent, bool has_shadow, - fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow) + fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow, int transparent) :CComponentsPicture(x_pos, y_pos, w, h, "", parent, has_shadow, - color_frame, color_background, color_shadow) + color_frame, color_background, color_shadow, transparent) { setChannel(channelId, channelName); alt_pic_name = ""; @@ -220,10 +224,10 @@ CComponentsChannelLogo::CComponentsChannelLogo( const int &x_pos, const int &y_p const uint64_t& channelId, CComponentsForm *parent, bool has_shadow, - fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow) + fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow, int transparent) :CComponentsPicture(x_pos, y_pos, 0, 0, "", parent, has_shadow, - color_frame, color_background, color_shadow) + color_frame, color_background, color_shadow, transparent) { setChannel(channelId, channelName); alt_pic_name = ""; diff --git a/src/gui/components/cc_item_picture.h b/src/gui/components/cc_item_picture.h index 4796d2216..b332ca92b 100644 --- a/src/gui/components/cc_item_picture.h +++ b/src/gui/components/cc_item_picture.h @@ -56,13 +56,17 @@ class CComponentsPicture : public CComponentsItem ///sets that image may be painted, default = false bool do_paint; + ///set the transparency of pictures (default = CFrameBuffer::TM_NONE) + int image_transparent; + void init( const int &x_pos, const int &y_pos, const int &w, const int &h, const std::string& image_name, CComponentsForm *parent, bool has_shadow, fb_pixel_t color_frame, fb_pixel_t color_background, - fb_pixel_t color_shadow); + fb_pixel_t color_shadow, + int transparent); ///initialize all required attributes void initCCItem(); @@ -71,6 +75,10 @@ class CComponentsPicture : public CComponentsItem ///paint image void paintPicture(); + // t = CFrameBuffer::TM_BLACK : Transparency when black content ('pseudo' transparency) + // t = CFrameBuffer::TM_NONE : No 'pseudo' transparency + void SetTransparent(int t){ image_transparent = t; } + public: CComponentsPicture( const int &x_pos, const int &y_pos, const int &w, const int &h, const std::string& image_name, @@ -78,7 +86,8 @@ class CComponentsPicture : public CComponentsItem bool has_shadow = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + int transparent = CFrameBuffer::TM_NONE); CComponentsPicture( const int &x_pos, const int &y_pos, const std::string& image_name, @@ -86,7 +95,8 @@ class CComponentsPicture : public CComponentsItem bool has_shadow = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + int transparent = CFrameBuffer::TM_NONE); ///sets an image name (unscaled icons only), full image path or url to an iamge file (scalable) virtual void setPicture(const std::string& picture_name); @@ -127,7 +137,8 @@ class CComponentsChannelLogo : public CComponentsPicture bool has_shadow = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + int transparent = CFrameBuffer::TM_BLACK); CComponentsChannelLogo( const int &x_pos, const int &y_pos, const std::string& channelName = "", @@ -136,7 +147,8 @@ class CComponentsChannelLogo : public CComponentsPicture bool has_shadow = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + int transparent = CFrameBuffer::TM_BLACK); ///set channel id and/or channel name, NOTE: channel name is prefered void setChannel(const uint64_t& channelId, const std::string& channelName); From 4bdd52d56a70ebe338178408b3d2f3d51ceae497 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 10 Jul 2014 16:05:41 +0200 Subject: [PATCH 168/511] CLuaInstance::CPictureNew: Add parameter 'transparent' for cpicture.new - Default is CFrameBuffer::TM_NONE (No 'pseudo' transparency) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e991507888c00704f08b93696ea8a507a592f093 Author: Michael Liebmann Date: 2014-07-10 (Thu, 10 Jul 2014) ------------------ This commit was generated by Migit --- src/gui/luainstance.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 3d4a29788..26577d955 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -1896,6 +1896,12 @@ int CLuaInstance::CPictureNew(lua_State *L) lua_Integer color_background = (lua_Integer)COL_MENUCONTENT_PLUS_0; lua_Integer color_shadow = (lua_Integer)COL_MENUCONTENTDARK_PLUS_0; + /* + transparency = CFrameBuffer::TM_BLACK (2): Transparency when black content ('pseudo' transparency) + transparency = CFrameBuffer::TM_NONE (1): No 'pseudo' transparency + */ + lua_Integer transparency = CFrameBuffer::TM_NONE; + tableLookup(L, "parent" , (void**)&parent); tableLookup(L, "x" , x); tableLookup(L, "y" , y); @@ -1912,12 +1918,13 @@ int CLuaInstance::CPictureNew(lua_State *L) tableLookup(L, "color_frame" , color_frame); tableLookup(L, "color_background" , color_background); tableLookup(L, "color_shadow" , color_shadow); + tableLookup(L, "transparency" , transparency); CComponentsForm* pw = (parent && parent->w) ? parent->w->getBodyObject() : NULL; CLuaPicture **udata = (CLuaPicture **) lua_newuserdata(L, sizeof(CLuaPicture *)); *udata = new CLuaPicture(); - (*udata)->cp = new CComponentsPicture(x, y, dx, dy, image_name, pw, has_shadow, (fb_pixel_t)color_frame, (fb_pixel_t)color_background, (fb_pixel_t)color_shadow); + (*udata)->cp = new CComponentsPicture(x, y, dx, dy, image_name, pw, has_shadow, (fb_pixel_t)color_frame, (fb_pixel_t)color_background, (fb_pixel_t)color_shadow, transparency); (*udata)->parent = pw; luaL_getmetatable(L, "cpicture"); lua_setmetatable(L, -2); From ce8f23bd69395637f426a63a6d518ec8e7c58518 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 11 Jul 2014 10:45:59 +0200 Subject: [PATCH 169/511] CLuaInstance::MenuAddItem: Add separator typ 'subhead' Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/09a39546c26674724451ecc90893ed4353d854ee Author: Michael Liebmann Date: 2014-07-11 (Fri, 11 Jul 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/luainstance.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 26577d955..26661f38c 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -1033,12 +1033,12 @@ int CLuaInstance::MenuAddItem(lua_State *L) m->m->addItem(GenericMenuCancel); } else if (type == "separator") { m->m->addItem(GenericMenuSeparator); - } else if (type == "separatorline") { + } else if ((type == "separatorline") || (type == "subhead")) { if (!b->name.empty()) { - m->m->addItem(new CMenuSeparator(CMenuSeparator::STRING | CMenuSeparator::LINE, b->name.c_str(), NONEXISTANT_LOCALE)); - } else { + int flag = (type == "separatorline") ? CMenuSeparator::LINE : CMenuSeparator::SUB_HEAD; + m->m->addItem(new CMenuSeparator(CMenuSeparator::STRING | flag, b->name.c_str(), NONEXISTANT_LOCALE)); + } else m->m->addItem(GenericMenuSeparatorLine); - } } else { std::string right_icon; tableLookup(L, "right_icon", right_icon); std::string action; tableLookup(L, "action", action); From a8e4cf97098ad814bc54c3db1886df476f9d7df6 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 12 Jul 2014 22:05:13 +0200 Subject: [PATCH 170/511] CUpnpBrowserGui::paintItemInfo: Set transparency for DisplayImage()... ...to CFrameBuffer::TM_NONE Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/de91201fa273d334f92b118bc757ca8bb561b1b7 Author: Michael Liebmann Date: 2014-07-12 (Sat, 12 Jul 2014) ------------------ This commit was generated by Migit --- src/gui/upnpbrowser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 3a714e055..225c36f9b 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -1124,7 +1124,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) g_PicViewer->rescaleImageDimensions(&flogo_w, &flogo_h, m_title_height*2, m_title_height-14); } } - g_PicViewer->DisplayImage(tmpname.c_str(), m_x+m_width-flogo_w-2-RADIUS_MID, m_y + 2, flogo_w, flogo_h); + g_PicViewer->DisplayImage(tmpname.c_str(), m_x+m_width-flogo_w-2-RADIUS_MID, m_y + 2, flogo_w, flogo_h, CFrameBuffer::TM_NONE); } } From 780c2f28099ccddbe85d6d94eeacdfe9c43cfd03 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 16 Jul 2014 11:52:24 +0400 Subject: [PATCH 171/511] libiw/iwscan.cpp: fix crash in case of different cmd order Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/40167afef4d8a885aa89d55b0a3e5f0738bae600 Author: [CST] Focus Date: 2014-07-16 (Wed, 16 Jul 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libiw/iwscan.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/libiw/iwscan.cpp b/lib/libiw/iwscan.cpp index ab39a56e2..45efd2b4d 100644 --- a/lib/libiw/iwscan.cpp +++ b/lib/libiw/iwscan.cpp @@ -219,6 +219,11 @@ realloc: if (ret <= 0) break; switch(event->cmd) { + case SIOCGIWAP: + count++; + networks.push_back(network); + printf(" Network %d:\n", count+1); + break; case SIOCGIWESSID: { char essid[IW_ESSID_MAX_SIZE+1]; @@ -228,14 +233,12 @@ realloc: if(event->u.essid.flags) { printf(" ESSID:\"%s\"\n", essid); - network.ssid = essid; + networks[count].ssid = essid; } else { printf(" ESSID:off/any/hidden\n"); - network.ssid = "(hidden)"; + networks[count].ssid = "(hidden)"; } - count++; - networks.push_back(network); } break; From 4f8625fc7e10538f6c864516b4b562d443fe714a Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 16 Jul 2014 23:33:52 +0200 Subject: [PATCH 172/511] CLuainstance/cwindow.new: Add parameter for show or hide header/footer - default (parameter missing) is true (show) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b8ed776a7668f6278309e15612e51f436c45b42c Author: Michael Liebmann Date: 2014-07-16 (Wed, 16 Jul 2014) ------------------ This commit was generated by Migit --- src/gui/luainstance.cpp | 53 +++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 26661f38c..f5628059b 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -1459,30 +1459,43 @@ int CLuaInstance::CWindowNew(lua_State *L) tableLookup(L, "btnYellow", btnYellow); tableLookup(L, "btnBlue", btnBlue); + tmp1 = "true"; + tableLookup(L, "show_header" , tmp1); + bool show_header = (tmp1 == "true" || tmp1 == "show" || tmp1 == "yes"); + tmp1 = "true"; + tableLookup(L, "show_footer" , tmp1); + bool show_footer = (tmp1 == "true" || tmp1 == "show" || tmp1 == "yes"); + CLuaCWindow **udata = (CLuaCWindow **) lua_newuserdata(L, sizeof(CLuaCWindow *)); *udata = new CLuaCWindow(); (*udata)->w = new CComponentsWindow(x, y, dx, dy, name.c_str(), icon.c_str(), 0, has_shadow, (fb_pixel_t)color_frame, (fb_pixel_t)color_body, (fb_pixel_t)color_shadow); - CComponentsFooter* footer = (*udata)->w->getFooterObject(); - if (footer) { - int btnCount = 0; - if (btnRed != "") btnCount++; - if (btnGreen != "") btnCount++; - if (btnYellow != "") btnCount++; - if (btnBlue != "") btnCount++; - if (btnCount) { - fb_pixel_t col = footer->getColorBody(); - int btnw = (dx-20) / btnCount; - int btnh = footer->getHeight(); - int start = 10; - if (btnRed != "") - footer->addCCItem(new CComponentsButtonRed(start, CC_CENTERED, btnw, btnh, btnRed, 0, false , true, false, col, col)); - if (btnGreen != "") - footer->addCCItem(new CComponentsButtonGreen(start+=btnw, CC_CENTERED, btnw, btnh, btnGreen, 0, false , true, false, col, col)); - if (btnYellow != "") - footer->addCCItem(new CComponentsButtonYellow(start+=btnw, CC_CENTERED, btnw, btnh, btnYellow, 0, false , true, false, col, col)); - if (btnBlue != "") - footer->addCCItem(new CComponentsButtonBlue(start+=btnw, CC_CENTERED, btnw, btnh, btnBlue, 0, false , true, false, col, col)); + if (!show_header) + (*udata)->w->showHeader(false); + if (!show_footer) + (*udata)->w->showFooter(false); + else { + CComponentsFooter* footer = (*udata)->w->getFooterObject(); + if (footer) { + int btnCount = 0; + if (btnRed != "") btnCount++; + if (btnGreen != "") btnCount++; + if (btnYellow != "") btnCount++; + if (btnBlue != "") btnCount++; + if (btnCount) { + fb_pixel_t col = footer->getColorBody(); + int btnw = (dx-20) / btnCount; + int btnh = footer->getHeight(); + int start = 10; + if (btnRed != "") + footer->addCCItem(new CComponentsButtonRed(start, CC_CENTERED, btnw, btnh, btnRed, 0, false , true, false, col, col)); + if (btnGreen != "") + footer->addCCItem(new CComponentsButtonGreen(start+=btnw, CC_CENTERED, btnw, btnh, btnGreen, 0, false , true, false, col, col)); + if (btnYellow != "") + footer->addCCItem(new CComponentsButtonYellow(start+=btnw, CC_CENTERED, btnw, btnh, btnYellow, 0, false , true, false, col, col)); + if (btnBlue != "") + footer->addCCItem(new CComponentsButtonBlue(start+=btnw, CC_CENTERED, btnw, btnh, btnBlue, 0, false , true, false, col, col)); + } } } From 63c9f1e9c92b5c188ccf0f102b9f6f6c908066ef Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 16 Jul 2014 23:34:04 +0200 Subject: [PATCH 173/511] CLuainstance: Use lua_Unsigned for color definitions - Add additional tableLookup() for get lua_Unsigned - Change tableLookup() for int to lua_Integer Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0714c7f5ed5d9b5782b725637a41977fb75bf386 Author: Michael Liebmann Date: 2014-07-16 (Wed, 16 Jul 2014) ------------------ This commit was generated by Migit --- src/gui/luainstance.cpp | 99 +++++++++++++++++++++++++++++------------ src/gui/luainstance.h | 3 +- 2 files changed, 72 insertions(+), 30 deletions(-) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index f5628059b..5410c8b10 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -44,11 +44,21 @@ struct table_key { lua_Integer code; }; +struct table_key_u { + const char *name; + lua_Unsigned code; +}; + struct lua_envexport { const char *name; table_key *t; }; +struct lua_envexport_u { + const char *name; + table_key_u *t; +}; + static void set_lua_variables(lua_State *L) { /* keyname table created with @@ -147,7 +157,7 @@ static void set_lua_variables(lua_State *L) }; /* list of colors, exported e.g. as COL['INFOBAR_SHADOW'] */ - static table_key colorlist[] = + static table_key_u colorlist[] = { { "COLORED_EVENTS_CHANNELLIST", MAGIC_COLOR | (COL_COLORED_EVENTS_CHANNELLIST) }, { "COLORED_EVENTS_INFOBAR", MAGIC_COLOR | (COL_COLORED_EVENTS_INFOBAR) }, @@ -172,21 +182,21 @@ static void set_lua_variables(lua_State *L) { "LIGHT_BLUE", MAGIC_COLOR | (COL_LIGHT_BLUE0) }, { "WHITE", MAGIC_COLOR | (COL_WHITE0) }, { "BLACK", MAGIC_COLOR | (COL_BLACK0) }, - { "COLORED_EVENTS_TEXT", (lua_Integer) (COL_COLORED_EVENTS_TEXT) }, - { "INFOBAR_TEXT", (lua_Integer) (COL_INFOBAR_TEXT) }, - { "INFOBAR_SHADOW_TEXT", (lua_Integer) (COL_INFOBAR_SHADOW_TEXT) }, - { "MENUHEAD_TEXT", (lua_Integer) (COL_MENUHEAD_TEXT) }, - { "MENUCONTENT_TEXT", (lua_Integer) (COL_MENUCONTENT_TEXT) }, - { "MENUCONTENT_TEXT_PLUS_1", (lua_Integer) (COL_MENUCONTENT_TEXT_PLUS_1) }, - { "MENUCONTENT_TEXT_PLUS_2", (lua_Integer) (COL_MENUCONTENT_TEXT_PLUS_2) }, - { "MENUCONTENT_TEXT_PLUS_3", (lua_Integer) (COL_MENUCONTENT_TEXT_PLUS_3) }, - { "MENUCONTENTDARK_TEXT", (lua_Integer) (COL_MENUCONTENTDARK_TEXT) }, - { "MENUCONTENTDARK_TEXT_PLUS_1", (lua_Integer) (COL_MENUCONTENTDARK_TEXT_PLUS_1) }, - { "MENUCONTENTDARK_TEXT_PLUS_2", (lua_Integer) (COL_MENUCONTENTDARK_TEXT_PLUS_2) }, - { "MENUCONTENTSELECTED_TEXT", (lua_Integer) (COL_MENUCONTENTSELECTED_TEXT) }, - { "MENUCONTENTSELECTED_TEXT_PLUS_1", (lua_Integer) (COL_MENUCONTENTSELECTED_TEXT_PLUS_1) }, - { "MENUCONTENTSELECTED_TEXT_PLUS_2", (lua_Integer) (COL_MENUCONTENTSELECTED_TEXT_PLUS_2) }, - { "MENUCONTENTINACTIVE_TEXT", (lua_Integer) (COL_MENUCONTENTINACTIVE_TEXT) }, + { "COLORED_EVENTS_TEXT", (lua_Unsigned) (COL_COLORED_EVENTS_TEXT) }, + { "INFOBAR_TEXT", (lua_Unsigned) (COL_INFOBAR_TEXT) }, + { "INFOBAR_SHADOW_TEXT", (lua_Unsigned) (COL_INFOBAR_SHADOW_TEXT) }, + { "MENUHEAD_TEXT", (lua_Unsigned) (COL_MENUHEAD_TEXT) }, + { "MENUCONTENT_TEXT", (lua_Unsigned) (COL_MENUCONTENT_TEXT) }, + { "MENUCONTENT_TEXT_PLUS_1", (lua_Unsigned) (COL_MENUCONTENT_TEXT_PLUS_1) }, + { "MENUCONTENT_TEXT_PLUS_2", (lua_Unsigned) (COL_MENUCONTENT_TEXT_PLUS_2) }, + { "MENUCONTENT_TEXT_PLUS_3", (lua_Unsigned) (COL_MENUCONTENT_TEXT_PLUS_3) }, + { "MENUCONTENTDARK_TEXT", (lua_Unsigned) (COL_MENUCONTENTDARK_TEXT) }, + { "MENUCONTENTDARK_TEXT_PLUS_1", (lua_Unsigned) (COL_MENUCONTENTDARK_TEXT_PLUS_1) }, + { "MENUCONTENTDARK_TEXT_PLUS_2", (lua_Unsigned) (COL_MENUCONTENTDARK_TEXT_PLUS_2) }, + { "MENUCONTENTSELECTED_TEXT", (lua_Unsigned) (COL_MENUCONTENTSELECTED_TEXT) }, + { "MENUCONTENTSELECTED_TEXT_PLUS_1", (lua_Unsigned) (COL_MENUCONTENTSELECTED_TEXT_PLUS_1) }, + { "MENUCONTENTSELECTED_TEXT_PLUS_2", (lua_Unsigned) (COL_MENUCONTENTSELECTED_TEXT_PLUS_2) }, + { "MENUCONTENTINACTIVE_TEXT", (lua_Unsigned) (COL_MENUCONTENTINACTIVE_TEXT) }, { NULL, 0 } }; @@ -254,7 +264,6 @@ static void set_lua_variables(lua_State *L) lua_envexport e[] = { { "RC", keyname }, - { "COL", colorlist }, { "SCREEN", screenopts }, { "FONT", fontlist }, { "CORNER", corners }, @@ -275,6 +284,26 @@ static void set_lua_variables(lua_State *L) lua_setglobal(L, e[i].name); i++; } + + lua_envexport_u e_u[] = + { + { "COL", colorlist }, + { NULL, NULL } + }; + + i = 0; + while (e_u[i].name) { + int j = 0; + lua_newtable(L); + while (e_u[i].t[j].name) { + lua_pushstring(L, e_u[i].t[j].name); + lua_pushunsigned(L, e_u[i].t[j].code); + lua_settable(L, -3); + j++; + } + lua_setglobal(L, e_u[i].name); + i++; + } } //#define DBG printf @@ -773,14 +802,26 @@ bool CLuaInstance::tableLookup(lua_State *L, const char *what, std::string &valu return res; } -bool CLuaInstance::tableLookup(lua_State *L, const char *what, int &value) +bool CLuaInstance::tableLookup(lua_State *L, const char *what, lua_Integer &value) { bool res = false; lua_pushstring(L, what); lua_gettable(L, -2); res = lua_isnumber(L, -1); if (res) - value = (int) lua_tonumber(L, -1); + value = (lua_Integer) lua_tonumber(L, -1); + lua_pop(L, 1); + return res; +} + +bool CLuaInstance::tableLookup(lua_State *L, const char *what, lua_Unsigned &value) +{ + bool res = false; + lua_pushstring(L, what); + lua_gettable(L, -2); + res = lua_isnumber(L, -1); + if (res) + value = (lua_Unsigned) lua_tonumber(L, -1); lua_pop(L, 1); return res; } @@ -1434,9 +1475,9 @@ int CLuaInstance::CWindowNew(lua_State *L) lua_assert(lua_istable(L,1)); std::string name, icon = std::string(NEUTRINO_ICON_INFO); - lua_Integer color_frame = (lua_Integer)COL_MENUCONTENT_PLUS_6; - lua_Integer color_body = (lua_Integer)COL_MENUCONTENT_PLUS_0; - lua_Integer color_shadow = (lua_Integer)COL_MENUCONTENTDARK_PLUS_0; + lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6; + lua_Unsigned color_body = (lua_Unsigned)COL_MENUCONTENT_PLUS_0; + lua_Unsigned color_shadow = (lua_Unsigned)COL_MENUCONTENTDARK_PLUS_0; std::string tmp1 = "false"; std::string btnRed = ""; std::string btnGreen = ""; @@ -1729,10 +1770,10 @@ int CLuaInstance::ComponentsTextNew(lua_State *L) std::string tmpMode = ""; int mode = CTextBox::AUTO_WIDTH; int font_text = SNeutrinoSettings::FONT_TYPE_MENU; - lua_Integer color_text = (lua_Integer)COL_MENUCONTENT_TEXT; - lua_Integer color_frame = (lua_Integer)COL_MENUCONTENT_PLUS_6; - lua_Integer color_body = (lua_Integer)COL_MENUCONTENT_PLUS_0; - lua_Integer color_shadow = (lua_Integer)COL_MENUCONTENTDARK_PLUS_0; + lua_Unsigned color_text = (lua_Unsigned)COL_MENUCONTENT_TEXT; + lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6; + lua_Unsigned color_body = (lua_Unsigned)COL_MENUCONTENT_PLUS_0; + lua_Unsigned color_shadow = (lua_Unsigned)COL_MENUCONTENTDARK_PLUS_0; std::string tmp1 = "false"; tableLookup(L, "parent" , (void**)&parent); @@ -1905,9 +1946,9 @@ int CLuaInstance::CPictureNew(lua_State *L) std::string image_name = ""; lua_Integer alignment = 0; std::string tmp1 = "false"; // has_shadow - lua_Integer color_frame = (lua_Integer)COL_MENUCONTENT_PLUS_6; - lua_Integer color_background = (lua_Integer)COL_MENUCONTENT_PLUS_0; - lua_Integer color_shadow = (lua_Integer)COL_MENUCONTENTDARK_PLUS_0; + lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6; + lua_Unsigned color_background = (lua_Unsigned)COL_MENUCONTENT_PLUS_0; + lua_Unsigned color_shadow = (lua_Unsigned)COL_MENUCONTENTDARK_PLUS_0; /* transparency = CFrameBuffer::TM_BLACK (2): Transparency when black content ('pseudo' transparency) diff --git a/src/gui/luainstance.h b/src/gui/luainstance.h index f69a42ae9..822735e49 100644 --- a/src/gui/luainstance.h +++ b/src/gui/luainstance.h @@ -252,7 +252,8 @@ private: static int CPictureDelete(lua_State *L); static bool tableLookup(lua_State*, const char*, std::string&); - static bool tableLookup(lua_State*, const char*, int&); + static bool tableLookup(lua_State*, const char*, lua_Integer&); + static bool tableLookup(lua_State*, const char*, lua_Unsigned&); static bool tableLookup(lua_State*, const char*, void**); }; From 3506849cf02919db1b6c5459e83580335ab96607 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 16 Jul 2014 23:34:09 +0200 Subject: [PATCH 174/511] CLuaInstance: Add function checkMagicMask() for use the color constants - Use checkMagicMask() for colors in CComponents-Lua functions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a3c453c403c72e6c98c3a9e0a3eba849d4cedd38 Author: Michael Liebmann Date: 2014-07-16 (Wed, 16 Jul 2014) ------------------ This commit was generated by Migit --- src/gui/luainstance.cpp | 28 +++++++++++++++++++++++----- src/gui/luainstance.h | 1 + 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 5410c8b10..70b549038 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -347,6 +347,14 @@ void CLuaInstance::functionDeprecated(lua_State *L, const char* oldFunc, const c ar.short_src, ar.currentline); } +lua_Unsigned CLuaInstance::checkMagicMask(lua_Unsigned &col) +{ + if ((col & MAGIC_MASK) == MAGIC_COLOR) + /* use the color constants */ + col = CFrameBuffer::getInstance()->realcolor[col & 0x000000ff]; + return col; +} + #define SET_VAR1(NAME) \ lua_pushinteger(lua, NAME); \ lua_setglobal(lua, #NAME); @@ -550,9 +558,7 @@ int CLuaInstance::PaintBox(lua_State *L) w = W->fbwin->dx - x; if (h < 0 || y + h > W->fbwin->dy) h = W->fbwin->dy - y; - /* use the color constants */ - if ((c & MAGIC_MASK) == MAGIC_COLOR) - c = CFrameBuffer::getInstance()->realcolor[c & 0x000000ff]; + checkMagicMask(c); W->fbwin->paintBoxRel(x, y, w, h, c, radius, corner); return 0; } @@ -666,8 +672,7 @@ int CLuaInstance::RenderString(lua_State *L) if (rwidth < w) x += (w - rwidth) / 2; } - if ((c & MAGIC_MASK) == MAGIC_COLOR) - c = CFrameBuffer::getInstance()->realcolor[c & 0x000000ff]; + checkMagicMask(c); if (boxh > -1) /* if boxh < 0, don't paint string */ W->fbwin->RenderString(g_Font[f], x, y, w, text, c, boxh); lua_pushinteger(L, rwidth); /* return renderwidth */ @@ -1500,6 +1505,10 @@ int CLuaInstance::CWindowNew(lua_State *L) tableLookup(L, "btnYellow", btnYellow); tableLookup(L, "btnBlue", btnBlue); + checkMagicMask(color_frame); + checkMagicMask(color_body); + checkMagicMask(color_shadow); + tmp1 = "true"; tableLookup(L, "show_header" , tmp1); bool show_header = (tmp1 == "true" || tmp1 == "show" || tmp1 == "yes"); @@ -1793,6 +1802,11 @@ int CLuaInstance::ComponentsTextNew(lua_State *L) tableLookup(L, "color_body" , color_body); tableLookup(L, "color_shadow", color_shadow); + checkMagicMask(color_text); + checkMagicMask(color_frame); + checkMagicMask(color_body); + checkMagicMask(color_shadow); + if (!tmpMode.empty()) { table_key txt_align[] = { { "ALIGN_AUTO_WIDTH", CTextBox::AUTO_WIDTH }, @@ -1974,6 +1988,10 @@ int CLuaInstance::CPictureNew(lua_State *L) tableLookup(L, "color_shadow" , color_shadow); tableLookup(L, "transparency" , transparency); + checkMagicMask(color_frame); + checkMagicMask(color_background); + checkMagicMask(color_shadow); + CComponentsForm* pw = (parent && parent->w) ? parent->w->getBodyObject() : NULL; CLuaPicture **udata = (CLuaPicture **) lua_newuserdata(L, sizeof(CLuaPicture *)); diff --git a/src/gui/luainstance.h b/src/gui/luainstance.h index 822735e49..d15541e25 100644 --- a/src/gui/luainstance.h +++ b/src/gui/luainstance.h @@ -178,6 +178,7 @@ private: void registerFunctions(); static void functionDeprecated(lua_State *L, const char* oldFunc, const char* newFunc); + static lua_Unsigned checkMagicMask(lua_Unsigned &col); static int NewWindow(lua_State *L); static int PaintBox(lua_State *L); From d56a3733e9a094ac7f636749f0ea9024bb239b04 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 16 Jul 2014 23:34:14 +0200 Subject: [PATCH 175/511] Neutrino: Stop info clock when box shutdown Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9f1c7f2800bd6ef1dce90451c69597f0d7c9e060 Author: Michael Liebmann Date: 2014-07-16 (Wed, 16 Jul 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 542679bc0..6caefb35a 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3775,6 +3775,7 @@ void stop_daemons(bool stopall, bool for_flash) my_system(NEUTRINO_ENTER_FLASH_SCRIPT); } + InfoClock->enableInfoClock(false); dvbsub_close(); tuxtxt_stop(); tuxtxt_close(); From 5ee14dabdd3a2697b7f0b5d5f0147842216b075d Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 17 Jul 2014 14:32:44 +0400 Subject: [PATCH 176/511] merge neutrino-mp menu/buttons/icons changes, (C) martii Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cf91f2eccbbbd95234c3feeb6aa5eab64ab6456b Author: [CST] Focus Date: 2014-07-17 (Thu, 17 Jul 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/icons/0-green.png | Bin 0 -> 316 bytes data/icons/0-red.png | Bin 0 -> 316 bytes data/icons/1-green.png | Bin 0 -> 310 bytes data/icons/1-red.png | Bin 0 -> 310 bytes data/icons/2-green.png | Bin 0 -> 318 bytes data/icons/2-red.png | Bin 0 -> 318 bytes data/icons/3-green.png | Bin 0 -> 324 bytes data/icons/3-red.png | Bin 0 -> 324 bytes data/icons/4-green.png | Bin 0 -> 318 bytes data/icons/4-red.png | Bin 0 -> 318 bytes data/icons/5-green.png | Bin 0 -> 316 bytes data/icons/5-red.png | Bin 0 -> 316 bytes data/icons/6-green.png | Bin 0 -> 316 bytes data/icons/6-red.png | Bin 0 -> 316 bytes data/icons/7-green.png | Bin 0 -> 321 bytes data/icons/7-red.png | Bin 0 -> 321 bytes data/icons/8-green.png | Bin 0 -> 318 bytes data/icons/8-red.png | Bin 0 -> 318 bytes data/icons/9-green.png | Bin 0 -> 310 bytes data/icons/9-red.png | Bin 0 -> 310 bytes data/icons/hint_nkplay.png | Bin 0 -> 4072 bytes data/icons/hint_rass.png | Bin 0 -> 1107 bytes data/icons/hint_spark.png | Bin 0 -> 6572 bytes data/icons/icon_nkplay.png | Bin 0 -> 2884 bytes data/icons/icon_ytplay.png | Bin 0 -> 2001 bytes data/icons/longpress.png | Bin 0 -> 545 bytes data/icons/mp_play_repeat_all.png | Bin 0 -> 3395 bytes data/icons/mp_play_repeat_track.png | Bin 0 -> 3400 bytes data/icons/rass.png | Bin 0 -> 3058 bytes data/icons/warning.png | Bin 0 -> 286 bytes src/driver/display.h | 7 + src/driver/record.cpp | 2 +- src/gui/audio_setup.cpp | 2 +- src/gui/audioplayer_setup.cpp | 2 +- src/gui/keybind_setup.cpp | 2 +- src/gui/luainstance.cpp | 25 +- src/gui/miscsettings_menu.cpp | 2 +- src/gui/network_service.cpp | 12 +- src/gui/personalize.cpp | 6 +- src/gui/scan_setup.cpp | 12 +- src/gui/timerlist.cpp | 2 +- src/gui/vfd_setup.cpp | 8 +- src/gui/widget/buttons.cpp | 319 ++++++- src/gui/widget/buttons.h | 63 +- src/gui/widget/icons.h | 36 +- src/gui/widget/menue.cpp | 1214 +++++++++++++++------------ src/gui/widget/menue.h | 529 +++++------- src/system/helpers.h | 12 + 48 files changed, 1285 insertions(+), 970 deletions(-) create mode 100644 data/icons/0-green.png create mode 100644 data/icons/0-red.png create mode 100644 data/icons/1-green.png create mode 100644 data/icons/1-red.png create mode 100644 data/icons/2-green.png create mode 100644 data/icons/2-red.png create mode 100644 data/icons/3-green.png create mode 100644 data/icons/3-red.png create mode 100644 data/icons/4-green.png create mode 100644 data/icons/4-red.png create mode 100644 data/icons/5-green.png create mode 100644 data/icons/5-red.png create mode 100644 data/icons/6-green.png create mode 100644 data/icons/6-red.png create mode 100644 data/icons/7-green.png create mode 100644 data/icons/7-red.png create mode 100644 data/icons/8-green.png create mode 100644 data/icons/8-red.png create mode 100644 data/icons/9-green.png create mode 100644 data/icons/9-red.png create mode 100644 data/icons/hint_nkplay.png create mode 100644 data/icons/hint_rass.png create mode 100644 data/icons/hint_spark.png create mode 100644 data/icons/icon_nkplay.png create mode 100644 data/icons/icon_ytplay.png create mode 100644 data/icons/longpress.png create mode 100644 data/icons/mp_play_repeat_all.png create mode 100644 data/icons/mp_play_repeat_track.png create mode 100644 data/icons/rass.png create mode 100644 data/icons/warning.png create mode 100644 src/driver/display.h diff --git a/data/icons/0-green.png b/data/icons/0-green.png new file mode 100644 index 0000000000000000000000000000000000000000..716637c7a22655441b04c1e5d775c1ebe57d2ed0 GIT binary patch literal 316 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=8&8?9Bbl42u{T*E2G1 zWn?_c$atNR@h&6dTSm5jY%>33jQ$x}{j>7<=X3k!?dlIqvw(USOM?7@862M7NCR<_ zyxm;OkH}&M25w;xW@MN(M*?I;iKnkC`(0LHZYF~dP5JYILam-Ijv*Y^ zlM_Tlgjkpu*}iTsZ+sA^*c?;o8ujx`Xum|tCGUU#&(A5H;Ao}$Z}tE0k+U6o@_*h> zJ0vMBx#ZBF{Y;YFl3Seq?myNn5w!4I{GmdKI;Vst0HL03 A4*&oF literal 0 HcmV?d00001 diff --git a/data/icons/0-red.png b/data/icons/0-red.png new file mode 100644 index 0000000000000000000000000000000000000000..a99393a3fb50dfedd557701bf888c0c18947d926 GIT binary patch literal 316 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=4*CA(I%w7BPfuU~t>U z;CYNe^#%j$JqCt%3=IES1^-J2{x_`uZ`twRd&TXWxA_GU`ha>EOM?7@862M7NCR<_ zyxm;OkH}&M25w;xW@MN(M*=9wUgGKN%6^wsNK};h$<<__2t%usx6WTA4a>@JO|MPQ7CpcQ^{#*V3d*p0~p8TKp z(+){WOD;L|XFro9x8xS5zx$6hO9UnY@6iw*x&WMWo<-&HcudlDGtIL7S&CviDBCYeSBpMSI0v*i2;OXk;vd$@?2>@6C BZhim& literal 0 HcmV?d00001 diff --git a/data/icons/1-green.png b/data/icons/1-green.png new file mode 100644 index 0000000000000000000000000000000000000000..1ad8fee1b98f8bfd7995f961d4572e93c37c69d9 GIT binary patch literal 310 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=8&8?9Bbl3`-aoH!?CF zWn{e0$at5L@hv0EKNhZkTyp>9jQ$x}{j>7<=X3k!?Q$cQD?mMrB|(0{3=Yq3q=7g| z-tI089jvk*Kn`btM`SSr1Gg{;GcwGYBLT9a#M9T6{VuC8H#48c59d;#P`#&%V+hCf z8T}WYECE!PkZ)%?c&c0%_SM9{;!vnm2Tvzw{Vs} zbD@a$4g3MgPlM{5MSeZ<+DmyXp4L+u73MGl6;-OM?7@862M7NCR<_ zyxm;OkH}&M25w;xW@MN(M*=9wUgGKN%6^wsNL1MDi4DV2pisT1i(?4K z_2dK*kq{9eND!#57Uy`UYII`h(&?!sXKGF;2v2+Vf9>MW3e6=Mr~a>(m6dMfskd;J zKXajo_v8PliyJ36o-)1iKfCg%6PvGi_<#MEqQa6Y4n12wxhWhz`p-MUYR1DyQnT1n uW;947_VOq_O?~?G>B~MIhxCR928R3I#v6K_Q`CV@VeoYIb6Mw<&;$V60cZRG literal 0 HcmV?d00001 diff --git a/data/icons/2-green.png b/data/icons/2-green.png new file mode 100644 index 0000000000000000000000000000000000000000..3679e751183dcb16798d9813bbd7dba244002215 GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=8&8?9Bbl3`-ao*E2G1 zWn?_c$atNR@h&6dTSm5jY;ynPjQ$x}{j>7<=X3k!ZH-@SeLy{oB|(0{3=Yq3q=7g| z-tI089jvk*Kn`btM`SSr1Gg{;GcwGYBLT9a#M9T6{VuC8H?xqgTe~DWM4f DHmYph literal 0 HcmV?d00001 diff --git a/data/icons/2-red.png b/data/icons/2-red.png new file mode 100644 index 0000000000000000000000000000000000000000..05845207e8c557efe0a983d9c938da0272245be4 GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=4*CA(I%wmN0~FU~t>U z;CYNe^#%j$JqCt%3=IESx&O;r{5MSeZ<+DmyXp4L+o|{Yn}B*4OM?7@862M7NCR<_ zyxm;OkH}&M25w;xW@MN(M*=9wUgGKN%6^wsNK`~?f6XafpisM~i(?4K z_2h&Q5f(;9wvXG(8z00eHpf)DM*TVy$}gF6$@|~`^D(6p9IbT!cmMw$Dc#t!rRPt+ z@xh*=dI4uG9o?t(N6xhJ1TD<`7O&;NbN#{pXHR9hB~@bI+V5Nz?vpa1WaIz;|D|U< z%*hc7<4c*bqor->QvVczxfk!nUA!oG;=qa(EM;sA8&u7^4H!JX1D(X+>FVdQ&MBb@ E06~{7<=X3k!?NZe(96&vcB|(0{3=Yq3q=7g| z-tI089jvk*Kn`btM`SSr1Gg{;GcwGYBLT9a#M9T6{VuC8HU z;CX^U?FIwuJqCt%3=IESx&O;r{5MSeZ<+DmyXp4L+geQ}Hb6a$B|(0{3=Yq3q=7g| z-tI089jvk*Kn`btM`SSr1Gg{;GcwGYBLNg-FY)wsWxvZRBr2@j`S6J!P^j0_#W95A zdUAq@h)4(!CkWJ6i*vjaH99f1e96-DF<&P*s_lL9|Nog#cF84|KkfffKYy#>2@mhj z|Lug&ocN#5nBvj8bm`6d**hmVYMJQj{=0p~)xpgp;?MSTtvr*~{hR-Gf2mK(gp$I4 z|L?D5I#OV2=Bv$a7~^#K(j|4Hj&mzsym+yKCk1G`5Q`Ec!^(r^QB{w))&d>I;OXk; Jvd$@?2>>{qbCv)A literal 0 HcmV?d00001 diff --git a/data/icons/4-green.png b/data/icons/4-green.png new file mode 100644 index 0000000000000000000000000000000000000000..4b690273d06e7bb13a914630f208aebabc811425 GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=8&8?9Bbl3=0?-*E2G1 zWn?_g$atNR@h&6dTSm5jY%>33jQ$x}{j>7<=X3k!?b`Xi;Xpl%B|(0{3=Yq3q=7g| z-tI089jvk*Kn`btM`SSr1Gg{;GcwGYBLT9a#M9T6{VuC8H#6t9IoGZMh1xw`978y+ zCnt!6h_Em*vVGiM-uNI+u{oy7-Tmj9P=3jjOWINY!_QfrP?#Gw@4tQVH8%z2yZ`H- z`3NX~HJ+h3b=sew^~cV%@&qORJNDn!fhYX;|Nr|-^-?C3@D~2dzh^kn@sg^^llltQ zj)zjOCWY}O?PzIRy3{{KAUFSgM*e%AlmrnLW>$tfvn^!f{(gxAI*Gy4)z4*}Q$iB} DrRr?T literal 0 HcmV?d00001 diff --git a/data/icons/4-red.png b/data/icons/4-red.png new file mode 100644 index 0000000000000000000000000000000000000000..c2508e59e0a01e10d7e7347216edbfac970f515e GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=4*CA(I%w7BB>FU~t>U z;CX^U?FIwuJqCt%3=IESx&KRB|2IthZ<+DmyXp4L+s9Vvo&@S)ED7=pW^j0RBMrn! z@^*J&=wOxg0CG4BJR*x37`TN&n2}-D90{Nxdx@v7EBjqmAyH8Uw@pGtK%sU|7sn8e z>&XcsAtEeHjBFpbmp49$Q*4f@a(Dl^CX`IpA{r~^|QoWQ3CA@|I^6wc=biAZ$@}$0k zwd0}Gt4U#eNjqBFmM-;A5y;JdpOOEbCnZ6Ig_)J%&TI?WxW8ZGfKFoYboFyt=akR{ E0MP?(egFUf literal 0 HcmV?d00001 diff --git a/data/icons/5-green.png b/data/icons/5-green.png new file mode 100644 index 0000000000000000000000000000000000000000..bf74eeed9285c8feea992a4f5b3fb6c81ab4adec GIT binary patch literal 316 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=8&8?9Bbl3=0?-*E2G1 zWn?_g$atNR@h&6dTSm5jY%>33jQ$x}{j>7<=X3k!?b`Xi;Xpl%B|(0{3=Yq3q=7g| z-tI089jvk*Kn`btM`SSr1Gg{;GcwGYBLT9a#M9T6{VuC8H?x@al-tTcp;k{9#}JO| z$q6DX%&cr5x0g3Qh*NBisdSI3dcMk?$0#%P|Ns9pN+&p4t$ngT`stZo2e&`Zx6Djv z0}2Z|w1v$2pZ+`FSlq~?b!p4dX32$$c^~gvi5q3KH7(InGxFGF@&A85TiOnZ-Akr2 zORDKDOw4>KEa|eme9HFl5*8x^F0RHoiVO^5wH6(EH{x#r9mL@2>gTe~DWM4ffYE5J literal 0 HcmV?d00001 diff --git a/data/icons/5-red.png b/data/icons/5-red.png new file mode 100644 index 0000000000000000000000000000000000000000..cc9963238c72592ee7f0ada34864083ad56ba34c GIT binary patch literal 316 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=4*C`jZ$87BDz$U~t>U z;CX^U?FIwuJqCt%3=IESx&KRB|2IthZ<+DmyXp4L+YPrLUIpr5ED7=pW^j0RBMrn! z@^*J&=wOxg0CG4BJR*x37`TN&n2}-D90{Nxdx@v7EBjqmAyE-lk+t7TfI_XFE{-7_ z*OL=OSeRMaK5j2>d=RJD98>8YRrP$8JC9Lj>i_@$XOvEGv|9UQfArHcy$)`Fo^P3% z&;}G1bZ85i^*{Z0zOlHGN9)p-qs@{F74tscw-PtXXlq)crDo)@%i{n4e73Y561$g7 zWtLRaTbP*nQdrVudHIy>;Uz3a23%Z?a}*gE#A+=%^lrr80y>Dn)78&qol`;+0PNvx AW&i*H literal 0 HcmV?d00001 diff --git a/data/icons/6-green.png b/data/icons/6-green.png new file mode 100644 index 0000000000000000000000000000000000000000..b8376864a256d448dfaff1a8770968e04fbd90ba GIT binary patch literal 316 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=8%T>?}Pj3=0?-S2HrM zXJp*Z$as;F@h&6ddq$>zOcMVjwEk&X{Il@-=XK@U75&A^tUx`CB|(0{3=Yq3q=7g| z-tI089jvk*Kn`btM`SSr1Gg{;GcwGYBLT9a#M9T6{VuC8HnAvF+p~CY&9znSJVq~{e*AA7E}JsJ&->@A|H;qX6qNsYXQ|D2 z`2T;s$^^x!V*hXczkQ~aCurfn_{R%-^grIW5;yYLb*p~c|7(U59WNdI`M-WMm%!np zH%->coG{?z=Fb2JqFef3~c`y+5d~{{@3*RZ=Uwwv+>HcD;rL8DgyN|mIV0)GdMiEkp|)< zdAqwXbg;^L06Clm9+AZi4BWyX%*Zfnjs#GUy~NYkmHjTOkf?~MQOWTeK%rJo7sn8e z>&XcsLM)7oY#(9jQ$x}{j>7<=X3k!?Q$cQD?mMrB|(0{3=Yq3q=7g| z-tI089jvk*Kn`btM`SSr1Gg{;GcwGYBLT9a#M9T6{VuC8H#5U|hrA-7P?x8RV+hCf z;IsO8z(rPGQILI+j4^9%SWH?o9s4g3MgPlM{5MSeZ<+DmyXp4L+u73MGl6;-OM?7@862M7NCR<_ zyxm;OkH}&M25w;xW@MN(M*=9wUgGKN%6^wsNK{0o;8^??piq~mi(?4K z_2h&Qkq{9eND!#57H1KXd~zwsIaoW*E@c8|@Bjb*f1hdQxwLTM!f*Gj%$Xz;SN^xP zGHY~k`sZGflQMye_v`$;$?wjmQQfhAN{#<{3!zVX3P61_I z*&_vpg}lDZ#xYLLhovN4PF+5I`m~meq{LK*bpj#`3`-1+)vwf9KLNUm!PC{xWt~$( F698WBYK;H@ literal 0 HcmV?d00001 diff --git a/data/icons/8-green.png b/data/icons/8-green.png new file mode 100644 index 0000000000000000000000000000000000000000..a87ae15c01f40e44f8c2597846b821683476be59 GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=8&8?9Bbl42u{T*E2G1 zWn?_c$atNR@h&6dTSm5jY%>33jQ$x}{j>7<=X3k!?dlIqvw(USOM?7@862M7NCR<_ zyxm;OkH}&M25w;xW@MN(M*?I;iKnkC`(0LHZf2Gfx~sB*LhYU|jv*Y^ zlM_T(m>JnVZZB_q5U1E2Q|TJ@YfUJ>WXdJ)fB(Jm?T)AP%|NpvadPx(wzW&eopZm;-O*8!e`j7Xm#Em?5-C}mtQUlT!|NrN+rL|b> zUN)UsQcZ7RX68#_Ntg5~2*o+LgxEkj&GUU&;V!3Ab{S(kh44$rjF6*2UngFC$ BYRLcq literal 0 HcmV?d00001 diff --git a/data/icons/8-red.png b/data/icons/8-red.png new file mode 100644 index 0000000000000000000000000000000000000000..000fc524b538da27651be556bf74a196dedc05b0 GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=4*CA(I%w7BPfuU~t>U z;CYNe^#%j$JqCt%3=IESx&KRB|2IthZ<+DmyXp4L+jkNeKzbQVg8YIR9G=}s196hP z-CYDqW*~tqJ9qOu6L!@BjIj(g}`My8pBPe4i=Z*z+U*=Y549 z{eKFAD>p3p|6eyvFKGhT*Z(>HbDue}X@>t_|M9++xRJ-MTg5@LBd`o!=n~?z*SL0kphWy!9EZ6M5e*!v*!PC{xWt~$(699oC BY;*ts literal 0 HcmV?d00001 diff --git a/data/icons/9-green.png b/data/icons/9-green.png new file mode 100644 index 0000000000000000000000000000000000000000..8959902e80ef43a794685cd8e778ddfa35fea911 GIT binary patch literal 310 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=8&8?9Bbl42u{T*E2G1 zWn?_c$atNR@h&6dTSm5jYzqGrjQ$x}{j>7<=X3k!?fk^JYM>s*k|4ie28U-i(mD&3=gtqJ9qOu6L!@BjIj(g}`My8pfZe4i=Z*z+U*=lugb z^&HMxXZ~;gzkMdRTFuB~m&O18lj0bYc1Y}A vI<;AHVP@t_VaX8dQ`Wa`TQf^0oMT`}dTH7HB{+W>&?yX_u6{1-oD!MU z;CYNe^#%j$JqCt%3=IESx&O;s{x?kgZ<+DmyXp4L+e;@{F#+{3mIV0)GdMiEkp|)< zdAqwXbg;^L06Clm9+AZi4BWyX%*Zfnjs#GUy~NYkmHjTOkf^Ax1#{kcpisT1i(?4K z_2dK*7G_4akK4-|AH*p($5gsU{aO>sFPU=5```cbF{Kk6t#to;|M@;sy0Pa+{?Gdd zcx1`)4EU;Yw0D#R_ zmc;$wh}mc`KCnLsSxEo~=y79PV*t3GCb&x41b)kTTJE<6fCyy(V4nhj@8A@B8UR8- z;>TkEfX@K{amK|4M?)~cN8V>a1lBj+qNegJa0bq>JRA%F>WUkUhgG^a6aWM*t%%0X z-os6~`~19K9&V2r!A%Xj*}wL`=O4E8?OV&!3#3dNv@#@nlZmBVx+V;M9VQ7yN$O@K zq7WIZ-3Sq$Bm^{1MKBb$69tpM4!_w^gb_$DLhs2cu(RL$HuUvEZ54OC@z9$a_sWk< z%yVpF23*cnrS`6@_b%nnhFG(#$;klZD$fx6E1~nIxS$`;-ke50Bu;mFIt$KV@8Z-z zYHWw=3#68Wlpr{UpRh|<`$kj(Pkjt(C<5e;1Bc^NPp~i^|&~lGJO?`9nTq}ZYN!CWn z%Mqc7_t6dpZ$|9hJC@JM9x2MJnBizZ=x1P5O|BNFYW>8nsqWXC7_M^=Nb_O$Kz1+x zsUYb6xKT@;Mpn3Vsi?Kadt)u(ow&^x(d^u+@|Nh8#imTbBu}HCK~qYjL$M>NSTb9S z<9pI@?$I@=n2-75?mCZz>*2*mvNif4)Ei_p*`&zdFr^FODF;nhz}=O`Fism!J6zFq z{N}Czj6~IswinQE4EFC8Syh_r1J1L%-S#|Lyq_m>^wg+o=Wz7HHB+Gi;?B#cs6>`_ zj*tznlJIf7b0@;j?Aw-B%ND|A)rQc76VHoldXCwKRVyz(Dv(T59mIF<<2*NoOvQ4W zVp~p!-_v;ESUBG=f<0kVrfo#n2Hn0dXHg)9%1_x()Nc4h!Y83qwhl*LyjI%=Gmt@5 zN+mKw;;Xq&YZ}B-bQ~Vr_%Fkj_=Jl#y8{>k-?ZbFN!9BTe(%EQ86Pag%(f9;NqQyC zBO2 z?TLcNOiO}z#G$lnMF(`ZJwOEbc$DZ z`@nPCdHxZ_q)nBd92aH#4ux}xKMHIKrz#)BU;j}gX7stw^)73GQAgO}6t!xS)$CUD zbt-1gtoleK&#Y9gWiVGzm%AfFP2qJ;Z5M7|x&Ra0+-=Suv3GT=$M^A(@}bu)k@gg| zp68RJriPGN?3dzK zOpANV9}V&TcF!L=L$IvXX7vjPoMkfGQap{;(m6gY^Wq+>hU+VndKH~0-_PUWOA_BooyPOBNQE zkd|uXU(JGEyv3S5Bl@F;8W*$MYH7ETY8`6zj^5({ds6~u%MTTZJdyds=Cfw`=jZ57 znJwZ97QL7Brx-o&O!s(9`1S^0ZcTjb+FEjW-M<}ryxcr~Tv<#$TQQlPbhhp;COCh< z;=As z-9iEyam4YUv#POD%7qhm>M~?Mndz#pi}}hrCUQzAl1nFC?ticMFj8<3+w`O5XGHFj zBf7#ofdMFF9NWkIs=XbCjH?=%5i0E-uN>R?g)^)_@Z?D`sx~O&*jr?eVeiYA!+Wb(pw=Hr^bn?;lb{>@bi{uByUMNx8YX9h#Dh zaL1NN$fQrLIYS%ODmo$3d&+`+AVt{^b57-;(J6}+9Ibw~U0$N51@vN`w-c12X|ol3 z%Bg_YtdB3n#H&FOXGegRiVDGvOZd>`mab_qZ9>`SB$E$fSvxbGyq$@O!=z;MONkK? zT{`XSjHU+@+LM#I>1E|3PtD_fk`+*j9YR7*W9*_#Wo(>)ut(}~nK2O; zh2=3o>DfQhwaZY2K9ZIF6*o=KEC;T?Jjowd-x_o%FVosL%xLpW;3V?t^jKR_Hez0; z`DOS_bge?%lLQqHlqd0qx^-T~X+0NS{NtkjYuz1NUV!vm$K)69bj{)FY??-|drU(l zQvO5rJCj!L=0#b=&((P@FB18Q#TJVuLg~3VgJU*Rm|go6X==y;Vc?aFgK&M}nXQ+X zoFl`m#PnyeZ$q-JsHue?M$LRPOQ&j$GQHzxN7}X&i=00Nqpb5(ZXY~+otCA3aZkTa zZ>j?}Gqi^gxmgwhPbE)Hz9-o4KvpR?cR#|cl;fQnfS(lF-JrMHUOkalA7IY{FWKJy zqA)S|x@3Rm3UcD)EJ?gKOD*7;PXS`5`+K|Ip!!*r)222bEw^VNX0qk%*rLr7{MnIV z4rcU$8$!#2hh2RSraKkrnC1_*cXfOc!kTAN#c@lhwnYPpd-i3Uh90!AV)$>?8V?+< z9#80SY?|3)nb`5Jt(+jlbAHw{;dSd5^)swzB{LRFkZaGAb||M^$Y}YxMHp@fnZK19 zkpIH9(ED=8nuW?D*MYki?GktC;X;6;5Z8FnOz(W(VZnUu#AeaBmV>zas&j2d^0SK1 zVT#C7F(aaYm1WOSg_-J$emxvl3*KxFS3Wi@_Q(12S?A(UlhYGk7HFDh>(=!gZN7c* z%J-#oG8>5*OQeW+d?F#QN_18deN*}c;4(_bvf0&=?z%qCVJ8O%aL$?etYeA`-4l~O z0=1jp7@`@ntmr0RqqQ?%x79qzDy)2A`6?-gDt_>j=aMY)D-Wu3I~v)HGKoLHcT(Qw zm9>jQdR?F36K(viw3}VHVP$hx_@42xOrB*v##A~1x@HG|@a^f)tEm94Yrv9pgiMkI z5}7%uU=^G(>hG^QAwdtmTu=1;VvP)m%Mr`JjS>AC@#bxThvYI$@>HM=OxTNA)lhtKDV{MphlkybZ6kJtUq8A?P57_5K)a8m5jqVCL*77IO1qlSzDI~U>A zZs_XVl?$P*ca$?Ag?vVWQJO^8(yAXhy}9iEK8%2p7^gl~!)c^Xy#2(kFJf@E(x}U5 z7KfrN?$dinYQgyD);VR-`V}VIpucha4diFb`EcY)49}bCR|aa=Qs=-QZ6&7JA*L6J zNx^#tQNRJv#9+15u$pQZeP^sD9;=Vn)Zc}{;xU-^rdvFJA^6k1Xw>lkOVGk=YW+d5 z;lEr962yM3;EAWwgZxQMfaXs+PSIe}s8n?1-WD*9+=x?HG%DVd?ne)DVvsy309GUq zVg&{zeg_?BEQ;SDBF&!?5KN;709qJ~+3jrJ|BpHRCq@&e&qv;k12L!#9fmiZNe}j> zGw_zQU?x2%91z%YP#TQx+lU4;_fx2NFS=(4xCGOR2#~z!WXi?_%?tl0m4v~0lCfl* z8rf6NOAU*qXsVHQ^r>oIIIN~VRiBE{@gfh1?{5NS@qfzF0)m;O08a`i8xjKQ{Y!=P zcPjk@8nU2@_=d{HdErTZ3~v$;5DE#Iy!HR)<_Xib0XW=nAc&x4*=q%7v z+F0G8GhHBB<~RD#eo8RiFNFE83S+=W1G~{1#1-H93-a)PLl(fbZvQ)L7Kwp3{pD-o zZ*OCC)Udi6-u{)rA67+3>coN^)r~xUbLc_Nbh_W)?6t0?fB8RIwiG4_yh^0MU&~E! ziTt1W+5Wmlf6pnIfN$*nmrud`Y;Ezx|K(GCJ#8Hl4y&t1reLUl_!OtBNm0|+_QL4t ZV{kYv9qr@kh;C38urjkFR+}7)`zH{j;G_Tm literal 0 HcmV?d00001 diff --git a/data/icons/hint_rass.png b/data/icons/hint_rass.png new file mode 100644 index 0000000000000000000000000000000000000000..e9f5462da6ebce7bd745de379fedd90109714901 GIT binary patch literal 1107 zcmV-Z1g!gsP)aD9<0oV9-N4ftSBL4By2E(ia`u2h@wQO ztRb!JqR>pKjWeU?*F*me%k4QnR7@}59}esL_FCV%?X}k4N2*YvLWK$yDpaUYp~8Ow z;B4Sq{>C4`N5J(!Y9N0KupD>|=mE9>%YgR(D}Zb5e2rtVppcsctOX8JAKgI5NITyO zJOT^=-vj-@!L>jFMmxg?3Wo>1V?)3puPq&7kkllpN7A~K(pw=3<0LKd z>tRW?e~`$OQo{C0DN*ur!tL|1yI|S|Y;q=#6n*g<@M!qvB-63LyI}`zZ{(nNJJqX# zsI$TMEhj7^)7ikD;LMQe9^j^|C>nAZW$XsdD9W?tM8<>dNx+N1QsC4Ww4ZMPo&zoe z+K$VP>HVSBhlBHT&2I;q!*`Fn`7`c}!=bRz4ovrNR9J5_eIw|3rr^ye#{BGh&Y$L) z9y8w$%&(KRt6ge?!Dwg5R%_6C7q9_%2lxVb9hhSNXw!Q`+4ccf#!~e+aa2#P7r+t= z42J*~nl}|#=#0My>@CLWx}4R#L%=HFGvHt$`!z5<*uNC`H3V=7I63Ia!R68Z{BgYk zOa!)CAkXuA{QCs>#zxA6?nmIZV64SwMpqqKtfLErYF{fP}>`VY&<0QS?&kF4>*9_Zx2W3 zCxk2j>;ldOE^-g#vdS5K+tZ~zOp09dD~fBzVxR-q0rUcEfQiBOg}~>Qy&U*CRKYpG z9e&^L0khxlFU0^Bhb^iBD?$Ta2Rv0|rysbcsP|0Y4{|HLwjiv18X7nEUI%capLbjC zAaH@#E(R_E=7az?##`mCVBpmThtGImXOP>%7?RX4X`7_gzBryIsaMhgUn2KPdLgCMUHt{EP@zJF3Kc3;s8Hcw Z;V(60pCpW5G5Y`j002ovPDHLkV1hve4m|(> literal 0 HcmV?d00001 diff --git a/data/icons/hint_spark.png b/data/icons/hint_spark.png new file mode 100644 index 0000000000000000000000000000000000000000..f10fca62e25289fa96331a9be3f8ff2bff00311a GIT binary patch literal 6572 zcmV;d8B^woP)H z0=h0sk8Wyh&7ga7GLtw0fuTQ>mB{3?=`JbBsZ3rr0E=h-EE#ca>7pWAnp#_08k!lI zeo?6Zy7)IG?(HJI3i#YJh}QRq?XUb&>HuKOifXg#4_nNB06Mk;Ab0-{o8}<^Bt?B| zzwyO+XySQ^7YI^qjEyrhGmW?$mXWxizw3WG{0)8aJtOgUzn6#Z%86wPlLT~e-B>9} zDMCIyJ(bDg&<+1Q#Q!+(uk%&0*raG}W_n!s*`>t?__>spaFD&Aut10z!o?HH?RWufnX30)&drY2g!gB zGC?lb3<^LI*ah~2N>BspK_h4ZCqM@{4K9Go;5xVo?tlki1dM~{UdP zU)xj{ZqAQTQoLvauf5<ZgZNI6o6v>;tbFLDbRL8g&+C=7~%qN5B^wkS_j2#SSD zLv276qbgBHQSGQ6)GgE~Y6kTQO-3uB4bV1dFZ3#O96A$SfG$Tjpxe-w(09<|=rSYbRd;g|%>I!rO<0Hzgl9y5R$!^~o_Sb3}g)(-23Wnu-`0_=Y5G3+_)Aa)%4 z7DvRX;>>XFxCk5%mxn9IHQ~!?W?(_!4|Qz6*Z?KaQU#NE37j zc7$L;0%0?ug3v;^M0iMeMI;i{iPppbBA2*{SV25ayh0o$z9Y$y^hqwHNRp7WlXQf1 zo^+4&icBVJlO4$sWC3|6xsiO4{FwY!f+Arg;U&SA*eFpY(JnD4@j?SR-`K0DzX#{6;CMMSAv!Fl>(L4DIHeoQ<_y)QT9+yRo<_B zQF&U0rsAlQpi-uCR%J?+qH3?oRV`CJr}~U8OLw9t(JSaZ^cgiJHBU96TCG~Y+Pu1s zdWd?SdaL>)4T1(kBUYnKqg!J}Q&rPfGgq@&^S%~di=h>-wNI;8Yff87J4}0Dtz%@8vFt8N8 z)OsmzY2DIcLz1DBVTNI|;iwVK$j2zpsKe-mv8Hi^@owW@<4-0QCP^msCJ#(yOjnrZ znRc1}YNl_-GOIGXZB90KH{WR9Y5sDV!7|RWgUjw(P%L~cwpnyre6+N(HrY-t*ICY4UcY?IPTh`a zS8F$7Pq&Y@KV(1Rpyt4IsB?JYsNu+VY;c@#(sN31I_C7k*~FRe+~z#zV&k&j<-9B6 z>fu`G+V3Xg7UEXv_SjwBJ8G6!a$8Ik+VFL5OaMFr+(FGBh%@F?24>HLNsjWR>x%^{cLjD}-~yJ0q|W zp%D!cv#Z@!?_E6}X%SfvIkZM+P1c&LYZcZetvwSZ8O4k`8I6t(i*Abk!1QC*F=u1E zVya_iST3x6tmkY;b{Tt$W5+4wOvKv7mc~xT*~RUNn~HacFOQ$*x^OGGFB3cyY7*uW z{SuEPE+mB|wI<_|qmxhZWO#|Zo)ndotdxONgVci5ku;mMy=gOiZ+=5Ml)fgtQ$Q8{ zO!WzMgPUHd;&##i2{a;|Ev zR;u1nJ$Hb8VDO;h!Im23nxdNbhq#CC)_T;o*J;<4AI2QcIQ+Cew7&Oi#@CGv3JpaK zACK^kj2sO-+S6#&*x01hRMHGL3!A5oMIO8Pjq5j^Eru<%t+dvnoA$o+&v? zIGcZV;atwS+4HIAr!T}^80(JeesFQs#oIjrJ^h!wFI~Cpe)(drQ}4Mec2`bcwYhrg z8sl2Wb<6AReHMLfKUnZUby9Y>+)@{+t=@`yfZKq zGIV!1a(Lt}`|jkuqXC)@%*Rcr{xo>6OEH*lc%TLr*1x5{cQYs>ht;Of}f>-u708W;=5lQf9ac9 zH8cK_|8n8i;#cyoj=Wy>x_j1t_VJtKH}i9aZ{^<}eaCp$`#$Xb#C+xl?1zevdLO$! zd4GDiki4+)8~23s`{L#u!Ty{D4^000SaNLh0L01FcU01FcV z0GgZ_00007bV*G`2i*(^3L?Ph~wFrWXN;EtaE!-_vEv>CJF31+OOQ9|rceT{OimR5j%PtE6A6U48ilC)i zC19-qvO%LrNPqx&&rD{LNv5ZJ`f=|$=eK{{o;XP+BoX4N>Z(1RepN0=BIh84Lio_VmhUn*07SOO8iy zAiHX0u(7(Q_cDP`3!LepH>eT-J<7%c7?DFzHSgU7+`npM@K%7^dU~Tzj|{q#0-y|dNc!j=9Hq4DOrq!f64XWrdEFcJ0z^O7B0;S;C=M(mOuQ`zb zScENB^uzx+JoNOfJ-yLqPQV)SDsE$eUjmo58_Tj>%ki7+I35~@!1Ikd74H#)QzgQM zPkr{l@K;V`FFTX)UbVxDYz}btshOO9wRjx;DU@&&wBS5p#%(C{R$y zDCC*wb8N5^e}TYGvhR9L?xn|E_<;D7~G~ z{q6{LP+A)^zSeQkvmIQpwu2qFSHVMQC@p7N-u8}JgcwES?O*PmzY5^??)ma+E|mRZ zPj8ojOP6K~)~V9tlvV|`fCH_8*1>i|{v0S?1}&Efxusw_gfO1ocQ`GGfSZI_AIV^> zLaYpaJLZ&|v(&c-#426y%z|pFpNcYjv1PHzO8~qvU;4)EIT!70@0t-n)b#!O7kUrBYj~#9I}~OtVHqX<1>> znv!e@myHyLFge*Y`a4g5RQj{q?B zC5!oBmyMXKim5~ETRg=}9ML>UT}TB#W>V&`n%d4lhyzkJh*gU36pG6Yjm^sbulm%F zJY<&|@Pf1`)gL4jW5vJZv8P)sir+8TE@k(>H5mEt24Wx%${VvSY^YbPgSqRv=YR3R z(%3EI`CRzeMEPJinryQS$Q!eCAXryuS9(6#p#7=@)1qii(MHofG=ORvnIUBkQBVRJ zfQF)pl3gOqyC*|#nV=4$`2umkWQF<@9y3SScYTf84-?{1MXP~5--;PpQ$K_REYKI_ z1i*`2H&!T~vT4?#u^<39_jjLtaiin+mtHKs_^#LrgvjewO@>sAnBQ1gf17*HdK z7}TWqixJ2gDnIo!o>RI$pF?KB;GfrsdWHO3BWMxAV#5o!)Kgk5O8VTxg7nw*3b8`o zC3oI9HgZFD8X;QxFxS<)A6{{_=_ysi>V4K-WL=X{F6q%lLCHlwNDG*Pq57C(_N_T`7g@5W8L|ruwjh)@hpBva$Wow140~Mcg0&Y8dH z0CzRfW8R5FsYe<2{o3TCr?s~8 zaNHoekVU^y9lX#-oFq-2U<1t|~?v2n~UTLgX5nJAHY6(djFS zi;6u_D@M~mMNtD&#go#EpGeWVkU32-5tQyt$iLMh5tyMszM@Q;qbI~UHj-T~4$he6 zKQ6Y-+tf90n92mvDIfCqm@u~8m4>(Y(%zSoeY>7bMqJRzY(_@2Ei#g8HT!|Rs+18b z#*izto6Z*=t;`b?~uP0QQt?&DuSHMjIck{cQ82^_Ji$dB&AI!=DOp$s#*k3>YhOl1~;DI?&hCME!7DdhrX=C(5tu=yr?8IuAj7$$!fDBbIk{Goe{Si#AWg`)ta;CZGoNlVb7-b(3hAF5Ti zn2%1B21$YIYwfg*g&W+&h-tMCHMZBjaL32XrSiVut%9l|A)pFc4iv94NOUCUXO1FB z0NRa374;%>RAj-w%$+Y5;E}k&BXQ$3w~AAHJTzXbe=uuau`v9^ujIW;&as-yix}JV z7$b;R+#tB2!>U*jsxos|XMqtHs~3qn8}*;W)^0JJr1iVbxpBt%hl<8McHb9jVx_4@ z-?T)4!kguYILL&fJAwk)W{0RET~<|28i3ojZ`UoIUFD1mU(RIU{#&bRMAJa_iugdL zpEL%hNs&EcQT^@yJ?ghUlb{|XC>oT^07#BQN{C|# zbQm}}sQ_*~uurdXNiCPSd%Y*x@Cz4=DC#r?Q3(_-hEPATsf-Ayfkr3~BLuQr9hgr>4ZC`ed#scHdQ3SiUcp}?OtsbQ152b~W4o&4%CLL7` zLN(aJg z0`QY-7Mh9w8aS>!yowWndaW72KBR@-VH&Q<%z+t+u*b!kQysUe+YRhK9@d(1ZMwN% z0G@wByW1Aofmgft>!60c$=W<_F9D-8O@(S2Q~R5<{a7#wdQD;P$4pV_?Q+CPMg4qoPHZ z?69gY1COsPmnM!IKx+qc9=LqrC+04Y_eB}{lLQu@Bkt}EA<8&QuG4f^E5WOtZA6|u zgi`DWcleFJ?f>M?t>FSu=(|ubHqB!I@iv1d>C~olnDA5M){Su$g0FTq>KnYsW55dl zE6b_Hj|t$wUj2uUeL8cK2E|yM0_uobvci}K;t+M5|L(%uM4nw&{pOq7&!PdGfwKKW1D^^nycpN0B#rSo_1bzTvR>d9 zE6b(YjOPP0t$S}eSC;M>`TS!KCfn+Da0yY;ATkEd8n6rn&r`qhe(pK>)gxc-ySZ>G zZ3_mZXZT+SKDzM}{d&*s{%;#)cu}3{Spt_Xi!jZRTfEayf6gKX%H~k^QQ+CeBqi6F zoKvr@2i6Px2pBuzQ_4HKx{C2wa(U-zh1<@*I=AeM^F?dbbe46^s!3*B!|Amsyy+rq za_vy9!pKf#=q2@;S(x>eLO~Pc-b`!abxG~ zxV}k|r-APRuS~hk2_LiG-PX}A!WGWT)%3MoyW#^;v1`7_fwFS_*J@N7$^v7UkEKft z;~LlzJfj4zxG=+w*JkmdIq*^#`(}>vkT7QD;3Uzjveh-%=MvvluWg8e-`zYM|1q%r zX#M(eA3EOE*4dKHv(z^HTXs$6u03N#{w-I1z=qPenxFsL@ziF|L|q9exkxy@*Kp;Z zWjK3@Wqd-(*vY3rCR=(&lSYg^B4{ky+dX@iR~J{)=~W78>L8nh7{*kX9;fgFUCb*e%2m82$> z;9W7Uzff>)kEE|8Yykcjcz!Bby>0;3v~|eJa!LQA*l9CaIVCj0UnM<-8!vcAc5dIP zLRYt7^C?NXijb6q@@^yBp0teZ5|S2ADRyDP#gh%6R64vLE;=`ui0o73_kykio(C$^ zsq%HTz(JQPv`dtc`Ofp6M9t;enY}0!Y*$MrlNUgpFcEt~O=Axw^#sPonl5USOI zXyf72b~(2@Q^Q-W4~ZUz0XpJ z@(1)T18Td0?M{{I-H0k1Wum{NElKrP;p;`vff;i_Yj7}JE5+WKdEw$N64A=dL4UAm zVX1d!N4U&xPYDIC^;_gyWtXspZIZ(RYl%vL2EbchCj~XTTTL&pmD+;Xv+c9>4wLM& zL5R^84U=PPk+dHf#Zn2?3E%eOZVB{g~$u)Lp54yZ{q{KJwAM8HC=l%{zlCB9Ww2LD<~f%cl_L0ZLAt$ za|z{JrbF<;7RWo(Pp+}wvx(p+JJ ztww0}rOmgTnPX`!6UqK#=Q?$?rKe@3PFLrCYqZt1`W;+#aSB#^IK*){rfAMVcln`2 zE=SS!T0pxD*Hb?|QkYcO$yeyGsXnsx)c1`iP73)AS&U$_mLXch+1B&$?Ffa}8@uYJ zNQ-5DGqAY(@@T`KHoWli54}r!vUMCrE^R8T1tMbV&)*Yy!9axazDq9TGtq(qZ2$Iq zdGLfP$H|2))1c>!f~qkuD6^1Adib4oKF!+l_O8={oAL&26(eag^Ya30zjC@4Hv)k@ zo%0P^n{2?BpU#8NUzL3pdH3WydXYOUHgo*?4$siCPiB3N$>f`f#@?AZ1HU+(Os=iC zU}(|7CsnkaaoU%p!oAh|wSl|rv!CwXOzzq*YHUiZ+l@N5_0Su{IXU0!Z)9;ucscyk z!wlZ#UH+fiYa8pAta3Hu^11^)8))MT%8r(qyJCtIODpd7BPiTWwF#OT;hh>1GObat z0{E5T&W5HWPLZEzn{H_Sf0D_|Pd`pA_Q+d5FOKcaQrA~16=t3?FtRcN1;{k=gImri z!F6`8%4r#cZ94@>lBX82YVRiDAsFS&$=0RHrsg#7;;Eq%2mO9qxY=2ge(z%JqOz=m zoLrpCIn4(8J8X5W)59jG@=v5{zNz5;zB6Cj{d|-aJ{49>emeb#^LFX+0sP1-jh-tl zmc>~)FEth^?;iAS9pK7eh6T&=3Zm0@%M@VRRXTceZ|iM2z5I$6*XCQ^{MbJ})iPkk zSX(;o?a?e@L*j-l9d%ia#EZJ-`)nEvOHua|QND6IdnC^^T6+zdSoM}DS+y{SU2^)~ zPR<;rxH%&gl9!&;Xw~Uj-6==tne@jfDfWyk*hyY0eUYktCSiT{Q=2xUyFiIHs`W}P ze0*QRHER*m?Sx#9bbw6Uz>bXb%935Ne(w#36H!7Cc@V^sJ<6mqHH6AXZpUUycKD=s zV}9+GPOmNlg`INJMCDxCi56iCQ^qhq90BL$>43;W+B@vVuhL35duY2asv*nW;5jaom~R7E1K(vG*W(4ma*{IbkzQO>kCysZJ<}4_U zCo-;m?^AMFt)`AA^1{Pr6@#JPY)z~LzTj&Jg=STE=1<`UGxcTqID_62Tmk<_f^zCnsUCLx$;{?8+iU! z9YHiE(@H;KJ|=jneEDksv=mhq39pLq>hqN+%+!Y|lKJX%%dO?A$uR6(o^Q0GD7@LY z``E|9XSsLY%no&pisZ{QXAsr(y@ZGU`p1$d4&EOYy?}$l9*nP`YyB<8lIdk$2~pt0 zUL0@7=Ei*7)NCR^Ek(91*$rs<&!ki~&a+1w9xm)#E}EFHYDbu`4J#wpVH+}>AKx2y zFZ@U@8d(MwuM3HSq({HvpRlw(bR8;Lz`EA1*gstX4TJLw6Lw^K3r+)v*BudZbAUvd zUdh7UpIw`ss-)lNALv)Am;_d2?kkZ$vo_xzgnn`Qe0v{0ox*1jXkiR!0!%TW85%T2 zV{jgzDFMV2%yGsTkbuF=Di7EHgAmH0vzXEUCYW0MPQZPD*+B%=)g5RACMPVE!UtHP zlpux)pT%VA#ag#Pakx0nh+;7bcAOASm^+t3V*sF1p`-&8M6Ly0SW%1+A0jK1!RE0z zY`_eIvA>!l^>2*tUl>z7ZXIVMu>+tw)3?_ljp@l;tdwDV@dArZ;0AN} z99}SoOQ2xzG%85Nqp37YIvNBSrf8}Kj)|t@K~o$P$HZ9BsRQb6O^__%FIg6w$EUDq z3`jOS9Mbzkh4Lkp{s9v$NJU+&BJK!*62c9p0O4#3j|U|M9S1#qi&QNHQCfpA*mM?! z4TSQj9^vtPD74z&RrYELp$vW)iw3yuv8_cpJpPAz7$=g4<}$+2JP5)COhMdwl{^Fl z*|Mh2<1qP=lrRQhBW?}K<e?G-onp;rtAQnw!V3@!A6puA!pmFAO cj3o|($D3K02W2VuK(c^?y%Vv*Ht@)Q0ogdO)&Kwi literal 0 HcmV?d00001 diff --git a/data/icons/icon_ytplay.png b/data/icons/icon_ytplay.png new file mode 100644 index 0000000000000000000000000000000000000000..858f4ffd4505a8eb158cc6f8be158452b720b9c0 GIT binary patch literal 2001 zcmV;?2QK)DP)fReODiA0NQJ&kUHd6kCyyT&MZ(ewa`cRd;pjNHghK8sO zjc7!Z7J_Tj27?U&gV**h>)pBMe0{hxvuooNsY*uLJ+nJA=bm%E?|k=+{PNHw`Y0}O zvMX}ZA3-1lAoy|*0u;bNsIgrXS?JJw48XNx_x)OR&?yw9Kk1N!vvfNsS+c7G|Zysm+#tnILVuIomSr<@5BsQap2qAQ!s0a#V@Rs@N zu|~qwKoT)Pm@1S6L4+@KEdZ>yV1K{N|SO$m# z2M}Mo#@5sn#y|WJuJw@Y^_5y9VWuDuAkZEN6cEiUAQmu!etK0fI*Q%jn3mS;ztA{( zOrF@Y2mRYerEv1Q;P|)<9XkeAt1|fPvm$*Zc(Us&wOt4l3>>gf0V6yCHBvKcq$l7- zfW_Nv&(EV!ud{V)0ew5iSiE@?_dog@{Xjn?is=H=7>UpbD0_URHeCanL107|0um4r zkc3Fi0RV8VmMqWAure_rer=5q5e2BE7)b+#0bgOrl1d1W`eN4x4k$<t)&N-AXP$v=nx2cuBR;d|@-8q{c#%MeuHI~jKmk$&6h|{dw7N>$ ze*jXglJ_6LIvrx?PT2G`OVujcA*s#20tpdXpCsa(gif*mHwcOVM1V)!+#FlWbrJ6w z{pHW1{bg3Ym(GO?j8(-x`Gl25Q|zx7k+fRWu&q2QL?D8Oq!5@H6b`m2T2JCZu?P$e zA&O&SVF4?Pi)5_^5R~^W00NQ(qL>ff{Uc~bI0sj$pihnE_WC0g$dV?|tw16UPP!HF zr2J>BhVfTl!`Qew9h|BV|A5L6v3_3xjH|O*^fWwuHC!Q@t(J4 zW-wH(qPBm35Tu|NKp2Xk3~Q!35Nf7@?4bfA)qw-Z{`;^_ zLKnxPs#HQeK}jnR)?~L034xNCT2R2O0#H?`8N|}xMrx+@=|GbIZwAIOzjo>r8bd?C zo;}p1d+;HloCBf!LHJy@-)L4E5*i=~0;LL7MSwzKX1Fsui~7x*FjXX-4wkN8$I9X& zqGAcfN(FZp7I5k8S**;><-WSUnQwe42T}+Cco06_yGavM6;s7ft%hv}4@z7vV`6$* zY;6tuCMTslHin&(lj0i#Z=6|^c`16oF&6X13Xpbg-R zlK%iO)LX)@=nw!+03Qj^`Y%Sl`vR<;Q-lBj03~!qSaf7zbY(hYa%Ew3WdJfTF*7YN zHZ3tXR53X^H8MIeG%GMNIxsL77GC$ zL{5{t&tAP;C<5S$?|a0UZeK6nF16^)yfS`SNkojBlQ)psZS4HEvew(WCuRMuZ#)M8 zZEWIN`Oe)b;;u_XMEQK4HrDGDg$cc_R>HIAE|S@0jmU#`!ES6f`bI}CKvH!4M-stx zIZotGvVp!+*rDrF^1-%4Z4^gR`bayXFa!VyAuvBT2g7KA%2XUpABL)`mYfI?aL(cT zK9VGY&jZXpokgiMk6LXRkO0r+h@*(h>#ILL|K8l%s#MC*G=?DHV2t73^fV@mMf`D` zr22jluIIi001ViLM}^@tRDSb1^4tc+QApl)gPdPK#mvk@%J$?a-QICr0)XyJwl&eT zC%X*ee8C<<#_Ry+9MyMASX^3$-}J{^cT~cJ_mdex|CFBKR jumDK+*S>%K2mt>8kf7t~GR@s100000NkvXXu0mjfPk;P^ literal 0 HcmV?d00001 diff --git a/data/icons/mp_play_repeat_all.png b/data/icons/mp_play_repeat_all.png new file mode 100644 index 0000000000000000000000000000000000000000..415c530b9a08bc256bc9061f7b325b9cf1026c33 GIT binary patch literal 3395 zcmV-J4ZQM+P)!1`!wjU?-^%N1+@;VdAnw zib}-8Dr|xcDNJFUIIhG>uu0h!n};cfvMUBD0b^uG(E}*NTe~Z1AKICn-JSQ$y?t+Y zKHNLAvtngOCdmFkPuBpd>!*{1F(O=@6qtG zuz?!jLd=P=P$*C|1q2|mDN!LMy72H#dK5|Goo%Un-U! z0V+V@=k@OuLY#Tdxo1E7v2EA-KYHpv^xRzDD5cElZc4c(o6DLffAH`6W81Fv&pG$( zXN3@F0=*~mKqoM;apT6XUv~MWAGr6Pdn2}Olg(u*m&+*SqK(1$KEBo%qtU*`HwL49 zKww!CDJ?9^LRu0_T3AvdEek0vq?A}vB7{IG7uR)hU4`p9n6MxUArL}f+cxQRn&IKK zcuKM3&K>Ic=k`2v=+L2?fLWjlV6_2Q(b?I#^^(gj{>%gSe>vj14x{6vIE@CzXrz=u z$`S%0ML3W|3K4tF*-)D9<%h>oRW8Z}*QKJ8GRy0IOE5_HX^`TdlQg*KzFF5oWS8Tzt{{#kaowtqrzq zk0_-US^$I)v3NYb4xqcco5`t3gp>>nWY~V&cJGx}4jp{UKfHyNf&N*YUdbh^H{<9A z27?G+&5#l&DZmjC!x+P!sl7~=j<*Or^ybjc6Z@7*<#X@5|4ZjRaQ_4L03pI)8+U zS45-33J`FYu(XM0DGF1C31w@iOmY?@{KLU-@WRv~h{CafW1mbvl)kEId^(-ZtP(4& z>FLQWmSu%D8EiW+H?-Ai#efh(3L#n)X=Z}<=12$c3=b5fHgs_Q<-g6mGmDQ#3JcLH zWwP~*B>)T3^{;u(dfgZ~#l2j9EKA@9s!jL-d7 z?BMbZ7cL5goy%({AtaWym_$Nbt#&adtt9}&k`m!Kj%V7QZ7}%S3k=h3MryZpsbxPa ze63KXL0(N`@VW1IZ|BmH&7eZceF5Y9zUMfO*HWBP(nb(MTV)G?XeR5HgsuLur?o9a$pc9mjRrDbyYv?G$QdA!$jg%|%OsSh*(vFlLc1Mj?$K z$c1JGLM$V67XfIaDa@9sR~?2122nA^tFwn&5h