diff --git a/acinclude.m4 b/acinclude.m4 index 0c92e193f..144d55b66 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -126,10 +126,12 @@ if test "$TARGET" = "cdk"; then sysconfdir="\${prefix}/etc" localstatedir="\${prefix}/var" libdir="\${prefix}/lib" + mntdir="\${prefix}/mnt" targetdatadir="\${TARGET_PREFIX}/share" targetsysconfdir="\${TARGET_PREFIX}/etc" targetlocalstatedir="\${TARGET_PREFIX}/var" targetlibdir="\${TARGET_PREFIX}/lib" + targetmntdir="\${TARGET_PREFIX}/mnt" fi TUXBOX_APPS_DIRECTORY_ONE(configdir,CONFIGDIR,localstatedir,/var,/tuxbox/config, @@ -164,6 +166,9 @@ TUXBOX_APPS_DIRECTORY_ONE(private_httpddir,PRIVATE_HTTPDDIR,datadir,/share,/tuxb TUXBOX_APPS_DIRECTORY_ONE(public_httpddir,PUBLIC_HTTPDDIR,localstatedir,/var,/httpd, [--with-public_httpddir=PATH ],[where to find the the public httpd files]) + +TUXBOX_APPS_DIRECTORY_ONE(hosted_httpddir,HOSTED_HTTPDDIR,mntdir,/mnt,/hosted, + [--with-hosted_httpddir=PATH ],[where to find the the hosted files]) ]) dnl automake <= 1.6 needs this specifications @@ -172,12 +177,14 @@ AC_SUBST(DATADIR) AC_SUBST(FONTDIR) AC_SUBST(GAMESDIR) AC_SUBST(LIBDIR) +AC_SUBST(MNTDIR) AC_SUBST(PLUGINDIR) AC_SUBST(UCODEDIR) AC_SUBST(THEMESDIR) AC_SUBST(ICONSDIR) AC_SUBST(PRIVATE_HTTPDDIR) AC_SUBST(PUBLIC_HTTPDDIR) +AC_SUBST(HOSTED_HTTPDDIR) dnl end workaround AC_DEFUN([TUXBOX_APPS_ENDIAN],[ diff --git a/configure.ac b/configure.ac index e2803c65e..ec633a252 100644 --- a/configure.ac +++ b/configure.ac @@ -243,6 +243,7 @@ data/Makefile data/fonts/Makefile data/icons/Makefile data/inetradio/Makefile +data/initial/Makefile data/iso-codes/Makefile data/lcd/Makefile data/lcd/icons/Makefile diff --git a/data/Makefile.am b/data/Makefile.am index d701b459f..520c059e1 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = fonts icons inetradio iso-codes license locale scripts themes neutrino-scripts +SUBDIRS = fonts icons inetradio initial iso-codes license locale scripts themes neutrino-scripts if BOXTYPE_TRIPLE SUBDIRS += lcd diff --git a/data/initial/Makefile.am b/data/initial/Makefile.am new file mode 100644 index 000000000..1099d2462 --- /dev/null +++ b/data/initial/Makefile.am @@ -0,0 +1,3 @@ +installdir = $(CONFIGDIR)/initial + +install_DATA = bouquets.xml services.xml ubouquets.xml frontend.conf diff --git a/data/initial/bouquets.xml b/data/initial/bouquets.xml new file mode 100644 index 000000000..16abf6a28 --- /dev/null +++ b/data/initial/bouquets.xml @@ -0,0 +1,1488 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/initial/frontend.conf b/data/initial/frontend.conf new file mode 100644 index 000000000..1bfe6aaf5 --- /dev/null +++ b/data/initial/frontend.conf @@ -0,0 +1,19 @@ +fe0_diseqcRepeats=0 +fe0_diseqcType=0 +fe0_highVoltage=0 +fe0_lastSatellitePosition=360 +fe0_motorRotationSpeed=18 +fe0_position_192=192,-1,-1,-1,0,0,9750,10600,11700,0,0,1 +fe0_satellites=192 +fe0_uni_qrg=0 +fe0_uni_scr=-1 +fe1_diseqcRepeats=0 +fe1_diseqcType=0 +fe1_highVoltage=0 +fe1_lastSatellitePosition=360 +fe1_motorRotationSpeed=18 +fe1_position_192=192,-1,-1,-1,0,0,9750,10600,11700,0,0,1 +fe1_satellites=192 +fe1_uni_qrg=0 +fe1_uni_scr=-1 +mode=1 diff --git a/data/initial/services.xml b/data/initial/services.xml new file mode 100644 index 000000000..2352ecb41 --- /dev/null +++ b/data/initial/services.xml @@ -0,0 +1,1572 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/initial/ubouquets.xml b/data/initial/ubouquets.xml new file mode 100644 index 000000000..bef717e4e --- /dev/null +++ b/data/initial/ubouquets.xml @@ -0,0 +1,1358 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/license/slovak.license b/data/license/slovak.license index fb94fcc56..0d481d492 100644 --- a/data/license/slovak.license +++ b/data/license/slovak.license @@ -1,4 +1,4 @@ -Tento program je slobodný softvér: môžete ho šíriť a upravovať podľa ustanovení Všeobecnej verejnej licencie GNU (GNU General Public License), vydávanej nadáciou Free Software Foundation, a to buď podľa 2.verzie tejto Licencie, alebo (podľa vášho uváženia) ktorejkoľvek neskoršej verzie. +Tento program je slobodný softvér: môžete ho šíriť a upravovať podľa ustanovení Všeobecnej verejnej licencie GNU (GNU General Public License), vydávanej nadáciou Free Software Foundation, a to podľa 2.verzie tejto Licencie. Tento program je šírený v nádeji, že bude užitočný, avšak BEZ AKEJKOĽVEK ZÁRUKY. Neposkytujú sa ani odvodené záruky OBCHODOVATEĽNOSTI alebo VHODNOSTI PRE URČITÝ ÚČEL. Ďalšie podrobnosti hľadajte vo Všeobecnej verejnej licencii GNU. diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 642293ccd..e6882d80b 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -591,7 +591,7 @@ imageinfo.creator Ersteller: imageinfo.date Datum: imageinfo.dokumentation Dokus: imageinfo.forum Forum: -imageinfo.head Image Info: +imageinfo.head Image-Informationen imageinfo.homepage Homepage: imageinfo.image Image: imageinfo.kernel Kernel: @@ -1359,6 +1359,7 @@ moviebrowser.update_if_dest_empty_only Übernehmen nur wenn Ziel leer moviebrowser.use_dir Verzeichnis verwenden moviebrowser.use_movie_dir Wiedergabeverzeichnis verwenden moviebrowser.use_rec_dir Aufnahmeverzeichnis verwenden +moviebrowser.yt_concurrent_connections Gleichzeitige Verbindungen moviebrowser.yt_error Fehler beim laden des Youtube Feed moviebrowser.yt_max_results Max. Anzahl der zu holenden Feeds moviebrowser.yt_most_discussed Am meisten diskutiert @@ -1368,6 +1369,7 @@ moviebrowser.yt_most_responded Feeds mit den meisten Reaktionen moviebrowser.yt_most_shared Am häufigsten wiedergegebe Videos moviebrowser.yt_next_results Nächste Ergebnisse moviebrowser.yt_on_the_web Trendvideos +moviebrowser.yt_pref_quality Bevorzugte Qualität moviebrowser.yt_prev_results Vorherige Ergebnisse moviebrowser.yt_recently_featured Vor kurzem empfohlen moviebrowser.yt_region Region @@ -1576,6 +1578,9 @@ rclock.unlockmsg Fernbedienung reaktiviert... recording.is_running Folgende Aufnahme läuft bereits! Neue Aufnahme starten? recording.start Starte Aufnahme, bitte warten...! recording.stop Beende Aufnahme, bitte warten...! +recording.time_hour Stunde +recording.time_hours Stunden +recording.time_min Min recordingmenu.apids Tonspuren recordingmenu.apids_ac3 AC3 Tonspuren aufnehmen recordingmenu.apids_alt Alternative Tonspuren aufn. @@ -1935,6 +1940,11 @@ videomenu.videoformat_43 4:3 videomenu.videomode Videosystem wizard.initial_settings Grundeinstellungen gefunden wizard.install_settings Kanalliste für Astra 19.2°E installieren? +wizard.setup Erste Installation +wizard.setup_advanced Erweitert +wizard.setup_easy Einfach +wizard.setup_type Installationstyp +wizard.setup_type_hint Wählen Sie einfache Grundeinstellungen oder erweiterte Auswahlmöglichkeiten für die Installation 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 diff --git a/data/locale/english.locale b/data/locale/english.locale index 20f726d18..0f82ce63f 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1359,6 +1359,7 @@ moviebrowser.update_if_dest_empty_only Copy if destination is empty only moviebrowser.use_dir Use directory moviebrowser.use_movie_dir Use movie directory moviebrowser.use_rec_dir Use record directory +moviebrowser.yt_concurrent_connections Concurrent connections moviebrowser.yt_error Failed to load youtube feed moviebrowser.yt_max_results Max results to fetch moviebrowser.yt_most_discussed Most discussed @@ -1368,6 +1369,7 @@ moviebrowser.yt_most_responded Most responded moviebrowser.yt_most_shared Most shared moviebrowser.yt_next_results Next results moviebrowser.yt_on_the_web Trending videos +moviebrowser.yt_pref_quality Prefered quality moviebrowser.yt_prev_results Previous results moviebrowser.yt_recently_featured Recently featured moviebrowser.yt_region Region @@ -1576,6 +1578,9 @@ rclock.unlockmsg Remote control reactivated. recording.is_running This channel already recording. Start new record? recording.start Start recording, please wait...! recording.stop Stop recording, please wait...! +recording.time_hour hour +recording.time_hours hours +recording.time_min min recordingmenu.apids Audio streams recordingmenu.apids_ac3 record AC3 streams recordingmenu.apids_alt record alternative streams @@ -1935,6 +1940,11 @@ videomenu.videoformat_43 4:3 videomenu.videomode Digital video mode wizard.initial_settings Initial settings found wizard.install_settings Do you want to install channels for Astra 19.2°E? +wizard.setup First installation +wizard.setup_advanced Advanced +wizard.setup_easy Easy +wizard.setup_type Installation type +wizard.setup_type_hint Easy to setup for CanalDigitaal/TéléSAT/TV Vlaanderen providers or simple cable scan 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 diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 8a098ae94..2bd2e32ee 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -665,7 +665,7 @@ record_error_msg_t CRecordInstance::MakeFileName(CZapitChannel * channel) return RECORD_OK; } -void CRecordInstance::GetRecordString(std::string &str) +void CRecordInstance::GetRecordString(std::string &str, std::string &dur) { CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id); if(channel == NULL) { @@ -676,12 +676,14 @@ void CRecordInstance::GetRecordString(std::string &str) char stime[15]; int err = GetStatus(); strftime(stime, sizeof(stime), "%H:%M:%S ", localtime(&start_time)); - time_t duration = time(0) - start_time; + time_t duration = (time(0) - start_time) / 60; char dtime[20]; - int h = duration/3600; - int m = duration/60; - snprintf(dtime, sizeof(dtime), " (%02d %s %02d min)", h, h == 1 ? "hour" : "hours", m); - str = stime + channel->getName() + ": " + GetEpgTitle() + ((err & REC_STATUS_OVERFLOW) ? " [!]" : "") + dtime; + int h = duration / 60; + int m = duration - (h * 60); + snprintf(dtime, sizeof(dtime), "(%d %s %02d %s)", h, h == 1 ? g_Locale->getText(LOCALE_RECORDING_TIME_HOUR) : g_Locale->getText(LOCALE_RECORDING_TIME_HOURS), + m, g_Locale->getText(LOCALE_RECORDING_TIME_MIN)); + str = stime + channel->getName() + ": " + GetEpgTitle() + ((err & REC_STATUS_OVERFLOW) ? " [!] " : " "); + dur = dtime; } //------------------------------------------------------------------------- @@ -697,6 +699,7 @@ CRecordManager::CRecordManager() //recordingstatus = 0; recmap.clear(); nextmap.clear(); + durations.clear(); autoshift = false; shift_timer = 0; check_timer = 0; @@ -717,6 +720,7 @@ CRecordManager::~CRecordManager() delete[] (unsigned char *) (*it); } nextmap.clear(); + durations.clear(); } CRecordManager * CRecordManager::getInstance() @@ -1372,8 +1376,9 @@ int CRecordManager::exec(CMenuTarget* parent, const std::string & actionKey ) bool tostart = true; CRecordInstance * inst = FindInstance(live_channel_id); if (inst) { - std::string title; - inst->GetRecordString(title); + std::string title, duration; + inst->GetRecordString(title, duration); + title += duration; tostart = (ShowMsgUTF(LOCALE_RECORDING_IS_RUNNING, title.c_str(), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrYes); } @@ -1413,6 +1418,7 @@ bool CRecordManager::ShowMenu(void) CMenuForwarder * iteml; t_channel_id channel_ids[RECORD_MAX_COUNT] = { 0 }; /* initialization avoids false "might */ int recording_ids[RECORD_MAX_COUNT] = { 0 }; /* be used uninitialized" warning */ + durations.clear(); CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); @@ -1449,8 +1455,9 @@ bool CRecordManager::ShowMenu(void) channel_ids[i] = inst->GetChannelId(); recording_ids[i] = inst->GetRecordingId(); - std::string title; - inst->GetRecordString(title); + std::string title, duration; + inst->GetRecordString(title, duration); + durations.push_back(duration); const char* mode_icon = NULL; //if (inst->tshift_mode) @@ -1465,7 +1472,7 @@ bool CRecordManager::ShowMenu(void) rc_key = CRCInput::RC_stop; btn_icon = NEUTRINO_ICON_BUTTON_STOP; } - item = new CMenuForwarderNonLocalized(title.c_str(), true, NULL, selector, cnt, rc_key, NULL, mode_icon); + item = new CMenuForwarderNonLocalized(title.c_str(), true, durations[i].c_str(), selector, cnt, rc_key, NULL, mode_icon); item->setItemButton(btn_icon, true); //if only one recording is running, set the focus to this menu item @@ -1508,7 +1515,7 @@ bool CRecordManager::ShowMenu(void) bool CRecordManager::AskToStop(const t_channel_id channel_id, const int recid) { //int recording_id = 0; - std::string title; + std::string title, duration; CRecordInstance * inst; mutex.lock(); @@ -1519,7 +1526,8 @@ bool CRecordManager::AskToStop(const t_channel_id channel_id, const int recid) if(inst) { //recording_id = inst->GetRecordingId(); - inst->GetRecordString(title); + inst->GetRecordString(title, duration); + title += duration; } mutex.unlock(); if(inst == NULL) diff --git a/src/driver/record.h b/src/driver/record.h index a401190bc..236333e99 100644 --- a/src/driver/record.h +++ b/src/driver/record.h @@ -123,7 +123,7 @@ class CRecordInstance t_channel_id GetChannelId(void) { return channel_id; }; std::string GetEpgTitle(void) { return epgTitle; }; MI_MOVIE_INFO * GetMovieInfo(void) { return recMovieInfo; }; - void GetRecordString(std::string& str); + void GetRecordString(std::string& str, std::string &dur); const char * GetFileName() { return filename; }; bool Timeshift() { return autoshift; }; int tshift_mode; @@ -149,6 +149,7 @@ class CRecordManager : public CMenuTarget /*, public CChangeObserver*/ nextmap_t nextmap; std::string Directory; std::string TimeshiftDirectory; + std::vector durations; bool StreamVTxtPid; bool StreamSubtitlePids; bool StreamPmtPid; diff --git a/src/driver/volume.cpp b/src/driver/volume.cpp index 7acbb2484..624fd4a78 100644 --- a/src/driver/volume.cpp +++ b/src/driver/volume.cpp @@ -96,16 +96,8 @@ void CVolume::setVolume(const neutrino_msg_t key) } } - if (volscale){ - volscale->hide(); - delete volscale; - volscale = NULL; - } - - if (volscale == NULL){ - volscale = new CVolumeBar(); - volscale->paint(); - } + hideVolscale(); + showVolscale(); neutrino_msg_data_t data; uint64_t timeoutEnd; @@ -131,12 +123,7 @@ void CVolume::setVolume(const neutrino_msg_t key) } else do_vol = true; if (CNeutrinoApp::getInstance()->isMuted() && (dir > 0 || g_settings.current_volume > 0)) { - if (volscale){ - if (volscale->isPainted()) - volscale->hide(); - delete volscale; - volscale = NULL; - } + hideVolscale(); if (do_vol) { CAudioMute::getInstance()->AudioMute(false, true); if (mode == CNeutrinoApp::mode_audio) { @@ -159,12 +146,7 @@ void CVolume::setVolume(const neutrino_msg_t key) v = 0; g_settings.current_volume = 0; if (g_settings.show_mute_icon) { - if (volscale) { - if (volscale->isPainted()) - volscale->hide(); - delete volscale; - volscale = NULL; - } + hideVolscale(); CAudioMute::getInstance()->AudioMute(true, true); if (mode == CNeutrinoApp::mode_audio) { CAudioPlayerGui *cap = CMediaPlayerMenu::getInstance()->getPlayerInstance(); @@ -210,12 +192,29 @@ void CVolume::setVolume(const neutrino_msg_t key) } } while (msg != CRCInput::RC_timeout); + hideVolscale(); +} + +bool CVolume::hideVolscale() +{ + bool ret = false; if (volscale) { - if (volscale->isPainted()) + if (volscale->isPainted()) { volscale->hide(); + ret = true; + } delete volscale; volscale = NULL; } + return ret; +} + +void CVolume::showVolscale() +{ + if (volscale == NULL){ + volscale = new CVolumeBar(); + volscale->paint(); + } } bool CVolume::changeNotify(const neutrino_locale_t OptionName, void * data) diff --git a/src/driver/volume.h b/src/driver/volume.h index 4c901c779..ecf019734 100644 --- a/src/driver/volume.h +++ b/src/driver/volume.h @@ -51,6 +51,8 @@ class CVolume : public CChangeObserver void SetCurrentPid(int pid) { apid = pid; } void SetCurrentChannel(t_channel_id id) { channel_id = id; } + bool hideVolscale(); + void showVolscale(); bool changeNotify(const neutrino_locale_t OptionName, void *); }; diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index f4d9ee9bd..58cdf23dd 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2088,10 +2088,11 @@ void CChannelList::paintHead() if (headerClock == NULL) { headerClock = new CComponentsFrmClock(0, 0, 0, 0, "%H:%M"); headerClock->setClockIntervall(10); - headerClock->setClockFontType(SNeutrinoSettings::FONT_TYPE_MENU_TITLE); - headerClock->setCornerRadius(RADIUS_LARGE); - headerClock->setCornerType(CORNER_TOP_RIGHT); + } + headerClock->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]); + headerClock->setCornerRadius(RADIUS_LARGE); + headerClock->setCornerType(CORNER_TOP_RIGHT); headerClock->setYPos(y); headerClock->setHeight(theight); headerClock->setTextColor(COL_MENUHEAD); diff --git a/src/gui/components/cc.h b/src/gui/components/cc.h index 39b8909d6..e86b43799 100644 --- a/src/gui/components/cc.h +++ b/src/gui/components/cc.h @@ -242,6 +242,8 @@ class CComponentsItem : public CComponents ///sets pointer to the form object in which this item is embedded. virtual void setParent(CComponentsItem *parent){cc_parent = parent;}; + ///returns pointer to the form object in which this item is embedded. + virtual CComponentsItem * getParent(){return cc_parent;}; ///abstract: paint item, arg: do_save_bg see paintInit() above virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES) = 0; @@ -265,7 +267,8 @@ class CComponentsItem : public CComponents ///get current index of item, see also attribut cc_item_index virtual int getIndex(){return cc_item_index;}; - ///set index to item, see also attribut cc_item_index + ///set an index to item, see also attribut cc_item_index. + ///To generate an index, use genIndex() virtual void setIndex(const int& index){cc_item_index = index;}; }; diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 5040f7d47..f00078539 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -143,11 +143,7 @@ void CComponentsForm::addCCItem(CComponentsItem* cc_Item) #endif //assign item index - int count = v_cc_items.size(); - char buf[64]; - snprintf(buf, sizeof(buf), "%d%d", cc_item_index, count); - buf[63] = '\0'; - int new_index = atoi(buf); + int new_index = genIndex(); cc_Item->setIndex(new_index); #ifdef DEBUG_CC printf(" %s-%d parent index = %d, assigned index ======> %d\n", __FUNCTION__, __LINE__, cc_item_index, new_index); @@ -177,6 +173,15 @@ bool CComponentsForm::isAdded(CComponentsItem* cc_item) return ret; } +int CComponentsForm::genIndex() +{ + int count = v_cc_items.size(); + char buf[64]; + snprintf(buf, sizeof(buf), "%d%d", cc_item_index, count); + buf[63] = '\0'; + int ret = atoi(buf); + return ret; +} CComponentsItem* CComponentsForm::getCCItem(const uint& cc_item_id) { @@ -188,9 +193,13 @@ CComponentsItem* CComponentsForm::getCCItem(const uint& cc_item_id) void CComponentsForm::replaceCCItem(const uint& cc_item_id, CComponentsItem* new_cc_Item) { if (!v_cc_items.empty()){ - if (v_cc_items[cc_item_id]){ - delete v_cc_items[cc_item_id]; - v_cc_items[cc_item_id] = NULL; + CComponentsItem* old_Item = v_cc_items[cc_item_id]; + if (old_Item){ + CComponentsItem * old_parent = old_Item->getParent(); + new_cc_Item->setParent(old_parent); + new_cc_Item->setIndex(old_parent->getIndex()); + delete old_Item; + old_Item = NULL; v_cc_items[cc_item_id] = new_cc_Item; } } @@ -217,12 +226,17 @@ void CComponentsForm::insertCCItem(const uint& cc_item_id, CComponentsItem* cc_I } if (v_cc_items.empty()){ - v_cc_items.push_back(cc_Item); + addCCItem(cc_Item); #ifdef DEBUG_CC printf("[CComponentsForm] %s insert cc_Item not possible, v_cc_items is empty, cc_Item added\n", __FUNCTION__); #endif - }else + }else{ v_cc_items.insert(v_cc_items.begin()+cc_item_id, cc_Item); + cc_Item->setParent(this); + //assign item index + int index = genIndex(); + cc_Item->setIndex(index); + } } void CComponentsForm::removeCCItem(const uint& cc_item_id) @@ -321,7 +335,8 @@ void CComponentsForm::paintCCItems() int w_diff = right_item - right_frm; int new_w = w_item - w_diff; if (right_item > right_frm){ - printf("[CComponentsForm] %s: item %d width is too large, definied width=%d, possible width=%d \n", __FUNCTION__, i, w_item, new_w); + printf("[CComponentsForm] %s: [form: %d] [item-index %d] [type=%d] width is too large, definied width=%d, possible width=%d \n", + __FUNCTION__, cc_item_index, cc_item->getIndex(), cc_item->getItemType(), w_item, new_w); cc_item->setWidth(new_w); } @@ -331,7 +346,8 @@ void CComponentsForm::paintCCItems() int h_diff = bottom_item - bottom_frm; int new_h = h_item - h_diff; if (bottom_item > bottom_frm){ - printf("[CComponentsForm] %s: item %d height is too large, definied height=%d, possible height=%d \n", __FUNCTION__, i, h_item, new_h); + printf("[CComponentsForm] %s: [form: %d] [item-index %d] [type=%d] height is too large, definied height=%d, possible height=%d \n", + __FUNCTION__, cc_item_index, cc_item->getIndex(), cc_item->getItemType(), h_item, new_h); cc_item->setHeight(new_h); } diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 38a2bd348..e936eaf6f 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -41,6 +41,8 @@ class CComponentsForm : public CComponentsItem std::vector v_cc_items; void initVarForm(); void paintForm(bool do_save_bg); + ///generates next possible index for an item, see also cc_item_index, getIndex(), setIndex() + int genIndex(); int append_h_offset; int append_v_offset; @@ -213,7 +215,7 @@ class CComponentsWindow : public CComponentsForm ///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( - CComponentsForm * ccw_footer; + CComponentsFooter * ccw_footer; ///property: caption in header, see also getHeaderObject() std::string ccw_caption; ///property: icon name in header, see also getHeaderObject() @@ -295,9 +297,10 @@ class CComponentsWindow : public CComponentsForm CComponentsForm* getBodyObject(){return ccw_body;}; ///returns a pointer to the internal footer object, use this to get access to footer properities - CComponentsForm* getFooterObject(){return ccw_footer;}; + CComponentsFooter* getFooterObject(){return ccw_footer;}; - int getStartY(); //y value for start of the area below header + ///refresh position and dimension and reinitialize elemenatary properties + void Refresh(){initCCWItems();}; }; #endif diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index 3636c7a34..4d3f3e957 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -69,12 +69,10 @@ void CComponentsFrmClock::initVarClock() cc_item_type = CC_ITEMTYPE_FRM_CLOCK; corner_rad = RADIUS_SMALL; - cl_font_type = SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO; - cl_font = NULL; + cl_font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]; cl_col_text = COL_MENUCONTENT; cl_format_str = "%H:%M"; cl_align = CC_ALIGN_VER_CENTER | CC_ALIGN_HOR_CENTER; -// cl_force_segment_paint = false; cl_thread = 0; cl_interval = 1; @@ -112,8 +110,6 @@ void CComponentsFrmClock::initCCLockItems() initTimeString(); string s_time = cl_timestr; - cl_font = g_Font[cl_font_type]; - //get minimal required height, width from raw text int min_text_w = cl_font->getRenderWidth(s_time, true);; int min_text_h = cl_font->getHeight(); @@ -254,6 +250,9 @@ void* CComponentsFrmClock::initClockThread(void *arg) sleep(clock->cl_interval); if (clock->paintClock) { + //refresh item property values + clock->refresh(); + //paint segements, but wihtout saved backgrounds clock->paint(CC_SAVE_SCREEN_NO); count = time(0); diff --git a/src/gui/components/cc_frm_clock.h b/src/gui/components/cc_frm_clock.h index e67fecdee..ebc0530d3 100644 --- a/src/gui/components/cc_frm_clock.h +++ b/src/gui/components/cc_frm_clock.h @@ -57,12 +57,11 @@ class CComponentsFrmClock : public CComponentsForm ///raw time chars char cl_timestr[20]; + //TODO: please add comments! bool paintClock; bool activeClock; - ///font - int cl_font_type; - ///fontrenderer object + ///object: font render object Font *cl_font; ///text color int cl_col_text; @@ -88,7 +87,7 @@ class CComponentsFrmClock : public CComponentsForm ~CComponentsFrmClock(); ///set font type for segments - void setClockFontType(const int& font_type){cl_font_type = font_type;}; + void setClockFont(Font *font){cl_font = font;}; ///set text color void setTextColor(fb_pixel_t color_text){ cl_col_text = color_text;}; diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 2b1fb257f..9feaffcdf 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -51,8 +51,7 @@ CComponentsWindow::CComponentsWindow(const std::string& caption, const char* ico ccw_caption = caption; ccw_icon_name = iconname; - initHeader(); - initBody(); + initCCWItems(); } CComponentsWindow::CComponentsWindow(neutrino_locale_t locale_caption, const char* iconname) @@ -211,14 +210,6 @@ void CComponentsWindow::addWindowItem(CComponentsItem* cc_Item) ccw_body->addCCItem(cc_Item); } -int CComponentsWindow::getStartY() -{ - if (ccw_head) - return ccw_head->getHeight(); - - return 0; -} - void CComponentsWindow::initCCWItems() { #ifdef DEBUG_CC diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 7e4e95434..c92f27dbb 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -65,6 +65,7 @@ #include #include #include +#include #include #include @@ -123,6 +124,7 @@ CInfoViewer::CInfoViewer () strcpy(old_timestr, ""); oldinfo.current_uniqueKey = 0; oldinfo.next_uniqueKey = 0; + isVolscale = false; } CInfoViewer::~CInfoViewer() @@ -483,6 +485,14 @@ void CInfoViewer::showMovieTitle(const int playState, const std::string &Channel const std::string &g_file_epg, const std::string &g_file_epg1, const int duration, const int curr_pos) { + if (g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_LEFT || + g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_RIGHT || + g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_CENTER || + g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_HIGHER_CENTER) + isVolscale = CVolume::getInstance()->hideVolscale(); + else + isVolscale = false; + check_channellogo_ca_SettingsChange(); aspectRatio = 0; last_curr_id = last_next_id = 0; @@ -623,6 +633,14 @@ void CInfoViewer::showTitle(t_channel_id chid, const bool calledFromNumZap, int void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, const t_satellite_position satellitePosition, const t_channel_id new_channel_id, const bool calledFromNumZap, int epgpos, char *pname) { + if (g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_LEFT || + g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_RIGHT || + g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_CENTER || + g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_HIGHER_CENTER) + isVolscale = CVolume::getInstance()->hideVolscale(); + else + isVolscale = false; + check_channellogo_ca_SettingsChange(); aspectRatio = 0; last_curr_id = last_next_id = 0; @@ -833,6 +851,9 @@ void CInfoViewer::loop(bool show_dot) neutrino_msg_t msg; neutrino_msg_data_t data; + if (isVolscale) + CVolume::getInstance()->showVolscale(); + while (!(res & (messages_return::cancel_info | messages_return::cancel_all))) { frameBuffer->blit(); g_RCInput->getMsgAbsoluteTimeout (&msg, &data, &timeoutEnd); @@ -945,8 +966,10 @@ void CInfoViewer::loop(bool show_dot) } } - if (hideIt) + if (hideIt) { + CVolume::getInstance()->hideVolscale(); killTitle (); + } g_RCInput->killTimer (sec_timer_id); fader.Stop(); diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index f92123980..437627ece 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -151,6 +151,7 @@ class CInfoViewer int BoxEndY; int ChanInfoX; bool showButtonBar; + bool isVolscale; CInfoViewer(); ~CInfoViewer(); diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 9e8454954..b9a2830b5 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -355,6 +356,14 @@ void CInfoViewerBB::showBBButtons(const int modus) int i; bool paint = false; + if (g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_LEFT || + g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_RIGHT || + g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_CENTER || + g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_HIGHER_CENTER) + g_InfoViewer->isVolscale = CVolume::getInstance()->hideVolscale(); + else + g_InfoViewer->isVolscale = false; + getBBButtonInfo(); for (i = 0; i < CInfoViewerBB::BUTTON_MAX; i++) { if (tmp_bbButtonInfoText[i] != bbButtonInfo[i].text) { @@ -365,7 +374,7 @@ void CInfoViewerBB::showBBButtons(const int modus) if (paint) { int last_x = minX; - frameBuffer->paintBoxRel(g_InfoViewer->ChanInfoX, BBarY, minX - g_InfoViewer->ChanInfoX, InfoHeightY_Info, COL_INFOBAR_BUTTONS_BACKGROUND, RADIUS_SMALL, CORNER_BOTTOM); //round + frameBuffer->paintBoxRel(g_InfoViewer->ChanInfoX, BBarY, minX - g_InfoViewer->ChanInfoX, InfoHeightY_Info, COL_INFOBAR_BUTTONS_BACKGROUND, RADIUS_LARGE, CORNER_BOTTOM); //round for (i = BUTTON_MAX; i > 0;) { --i; if ((bbButtonInfo[i].x <= g_InfoViewer->ChanInfoX) || (bbButtonInfo[i].x >= g_InfoViewer->BoxEndX) || (!bbButtonInfo[i].paint)) @@ -393,6 +402,8 @@ void CInfoViewerBB::showBBButtons(const int modus) tmp_bbButtonInfoText[i] = bbButtonInfo[i].text; } } + if (g_InfoViewer->isVolscale) + CVolume::getInstance()->showVolscale(); } void CInfoViewerBB::showBBIcons(const int modus, const std::string & icon) @@ -418,7 +429,7 @@ void CInfoViewerBB::paintshowButtonBar() if (g_settings.casystem_display < 2) paintCA_bar(0,0); - frameBuffer->paintBoxRel(g_InfoViewer->ChanInfoX, BBarY, g_InfoViewer->BoxEndX - g_InfoViewer->ChanInfoX, InfoHeightY_Info, COL_INFOBAR_BUTTONS_BACKGROUND, RADIUS_SMALL, CORNER_BOTTOM); //round + frameBuffer->paintBoxRel(g_InfoViewer->ChanInfoX, BBarY, g_InfoViewer->BoxEndX - g_InfoViewer->ChanInfoX, InfoHeightY_Info, COL_INFOBAR_BUTTONS_BACKGROUND, RADIUS_LARGE, CORNER_BOTTOM); //round g_InfoViewer->showSNR(); diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index cf43fc5e2..2b704e839 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -773,6 +773,8 @@ bool CMovieBrowser::loadSettings(MB_SETTINGS* settings) } settings->ytmode = configfile.getInt32("mb_ytmode", cYTFeedParser::MOST_POPULAR); settings->ytresults = configfile.getInt32("mb_ytresults", 10); + settings->ytquality = configfile.getInt32("mb_ytquality", 37); // itag value (MP4, 1080p) + settings->ytconcconn = configfile.getInt32("mb_ytconcconn", 4); // concurrent connections settings->ytregion = configfile.getString("mb_ytregion", "default"); settings->ytsearch = configfile.getString("mb_ytsearch", ""); settings->ytvid = configfile.getString("mb_ytvid", ""); @@ -827,6 +829,8 @@ bool CMovieBrowser::saveSettings(MB_SETTINGS* settings) } configfile.setInt32("mb_ytmode", settings->ytmode); configfile.setInt32("mb_ytresults", settings->ytresults); + configfile.setInt32("mb_ytquality", settings->ytquality); + configfile.setInt32("mb_ytconcconn", settings->ytconcconn); configfile.setString("mb_ytregion", settings->ytregion); configfile.setString("mb_ytsearch", settings->ytsearch); configfile.setString("mb_ytvid", settings->ytvid); @@ -3566,6 +3570,7 @@ void CMovieBrowser::loadYTitles(int mode, std::string search, std::string id) ytparser.SetRegion(m_settings.ytregion); ytparser.SetMaxResults(m_settings.ytresults); + ytparser.SetConcurrentDownloads(m_settings.ytconcconn); if (!ytparser.Parsed() || (ytparser.GetFeedMode() != mode)) { if (ytparser.ParseFeed((cYTFeedParser::yt_feed_mode_t)mode, search, id)) { @@ -3591,7 +3596,7 @@ void CMovieBrowser::loadYTitles(int mode, std::string search, std::string id) movieInfo.ytid = ylist[i].id; movieInfo.file.Name = ylist[i].title; - movieInfo.file.Url = ylist[i].GetUrl(); + movieInfo.file.Url = ylist[i].GetUrl(m_settings.ytquality, false); m_vMovieInfo.push_back(movieInfo); } m_currentBrowserSelection = 0; @@ -3685,7 +3690,22 @@ bool CMovieBrowser::showYTMenu() region->addOption("US"); mainMenu.addItem(region); + #define YT_QUALITY_OPTION_COUNT 3 + CMenuOptionChooser::keyval_ext YT_QUALITY_OPTIONS[YT_QUALITY_OPTION_COUNT] = + { + { 18, NONEXISTANT_LOCALE, "MP4 270p/360p"}, + { 22, NONEXISTANT_LOCALE, "MP4 720p" }, +#if 0 + { 34, NONEXISTANT_LOCALE, "FLV 360p" }, + { 35, NONEXISTANT_LOCALE, "FLV 480p" }, +#endif + { 37, NONEXISTANT_LOCALE, "MP4 1080p" } + }; + mainMenu.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_YT_PREF_QUALITY, &m_settings.ytquality, YT_QUALITY_OPTIONS, YT_QUALITY_OPTION_COUNT, true, NULL, CRCInput::RC_nokey, "", true)); + mainMenu.addItem(new CMenuOptionNumberChooser(LOCALE_MOVIEBROWSER_YT_CONCURRENT_CONNECTIONS, &m_settings.ytconcconn, true, 1, 8)); + mainMenu.exec(NULL, ""); + ytparser.SetConcurrentDownloads(m_settings.ytconcconn); delete selector; bool reload = false; diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser.h index 1126404a8..188eb95b5 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -229,6 +229,8 @@ typedef struct int lastRecordRowWidth[MB_MAX_ROWS]; int ytmode; int ytresults; + int ytquality; + int ytconcconn; std::string ytregion; std::string ytvid; std::string ytsearch; diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index e9f27f895..1076e07a6 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -55,6 +55,7 @@ #include #include +#include #include "cs_api.h" extern CRemoteControl * g_RemoteControl; @@ -70,6 +71,8 @@ COsdSetup::COsdSetup(bool wizard_mode) fontsizenotifier = new CFontSizeNotifier; osd_menu = NULL; submenu_menus = NULL; + mfFontFile = NULL; + mfTtxFontFile = NULL; is_wizard = wizard_mode; @@ -196,6 +199,8 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) strcpy(g_settings.font_file, fileBrowser.getSelectedFile()->Name.c_str()); printf("[neutrino] new font file %s\n", fileBrowser.getSelectedFile()->Name.c_str()); CNeutrinoApp::getInstance()->SetupFonts(); + osdFontFile = "(" + getBaseName(fileBrowser.getSelectedFile()->Name) + ")"; + mfFontFile->setOption(osdFontFile.c_str()); } return menu_return::RETURN_REPAINT; } @@ -211,6 +216,8 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) ttx_font_file = fileBrowser.getSelectedFile()->Name; printf("[neutrino] ttx font file %s\n", fileBrowser.getSelectedFile()->Name.c_str()); CNeutrinoApp::getInstance()->SetupFonts(); + osdTtxFontFile = "(" + getBaseName(fileBrowser.getSelectedFile()->Name) + ")"; + mfTtxFontFile->setOption(osdTtxFontFile.c_str()); } return menu_return::RETURN_REPAINT; } @@ -336,13 +343,13 @@ const CMenuOptionChooser::keyval INFOBAR_SUBCHAN_DISP_POS_OPTIONS[INFOBAR_SUBCH #define VOLUMEBAR_DISP_POS_OPTIONS_COUNT 7 const CMenuOptionChooser::keyval VOLUMEBAR_DISP_POS_OPTIONS[VOLUMEBAR_DISP_POS_OPTIONS_COUNT]= { - { 0 , LOCALE_SETTINGS_POS_TOP_RIGHT }, - { 1 , LOCALE_SETTINGS_POS_TOP_LEFT }, - { 2 , LOCALE_SETTINGS_POS_BOTTOM_LEFT }, - { 3 , LOCALE_SETTINGS_POS_BOTTOM_RIGHT }, - { 4 , LOCALE_SETTINGS_POS_TOP_CENTER }, - { 5 , LOCALE_SETTINGS_POS_BOTTOM_CENTER }, - { 6 , LOCALE_SETTINGS_POS_HIGHER_CENTER } + { CVolumeBar::VOLUMEBAR_POS_TOP_RIGHT , LOCALE_SETTINGS_POS_TOP_RIGHT }, + { CVolumeBar::VOLUMEBAR_POS_TOP_LEFT , LOCALE_SETTINGS_POS_TOP_LEFT }, + { CVolumeBar::VOLUMEBAR_POS_BOTTOM_LEFT , LOCALE_SETTINGS_POS_BOTTOM_LEFT }, + { CVolumeBar::VOLUMEBAR_POS_BOTTOM_RIGHT , LOCALE_SETTINGS_POS_BOTTOM_RIGHT }, + { CVolumeBar::VOLUMEBAR_POS_TOP_CENTER , LOCALE_SETTINGS_POS_TOP_CENTER }, + { CVolumeBar::VOLUMEBAR_POS_BOTTOM_CENTER, LOCALE_SETTINGS_POS_BOTTOM_CENTER }, + { CVolumeBar::VOLUMEBAR_POS_HIGHER_CENTER, LOCALE_SETTINGS_POS_HIGHER_CENTER } }; #define MENU_DISP_POS_OPTIONS_COUNT 5 @@ -433,7 +440,7 @@ int COsdSetup::showOsdSetup() osd_menu->addItem(mf); //fonts - CMenuWidget osd_menu_fonts(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_COLORS, width, MN_WIDGET_ID_OSDSETUP_FONT); + CMenuWidget osd_menu_fonts(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_COLORS, w_max(50, 10), MN_WIDGET_ID_OSDSETUP_FONT); showOsdFontSizeSetup(&osd_menu_fonts); mf = new CMenuForwarder(LOCALE_FONTMENU_HEAD, true, NULL, &osd_menu_fonts, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); mf->setHint("", LOCALE_MENU_HINT_FONTS); @@ -681,7 +688,6 @@ void COsdSetup::AddFontSettingItem(CMenuWidget &font_Settings, const SNeutrinoSe font_Settings.addItem(new CMenuNumberInput(neutrino_font[number_of_fontsize_entry].name, neutrino_font[number_of_fontsize_entry].defaultsize, fontsizenotifier, CNeutrinoApp::getInstance()->getConfigFile())); } - //font settings menu void COsdSetup::showOsdFontSizeSetup(CMenuWidget *menu_fonts) { @@ -691,14 +697,18 @@ void COsdSetup::showOsdFontSizeSetup(CMenuWidget *menu_fonts) fontSettings->addIntroItems(LOCALE_FONTMENU_HEAD); // select gui font file - mf = new CMenuForwarder(LOCALE_COLORMENU_FONT, true, NULL, this, "select_font", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); - mf->setHint("", LOCALE_MENU_HINT_FONT_GUI); - fontSettings->addItem(mf); + osdFontFile = g_settings.font_file; + osdFontFile = "(" + getBaseName(osdFontFile) + ")"; + mfFontFile = new CMenuForwarder(LOCALE_COLORMENU_FONT, true, osdFontFile.c_str(), this, "select_font", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); + mfFontFile->setHint("", LOCALE_MENU_HINT_FONT_GUI); + fontSettings->addItem(mfFontFile); // select teletext font file - mf = new CMenuForwarder(LOCALE_COLORMENU_FONT_TTX, true, NULL, this, "ttx_font", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); - mf->setHint("", LOCALE_MENU_HINT_FONT_TTX); - fontSettings->addItem(mf); + osdTtxFontFile = g_settings.ttx_font_file; + osdTtxFontFile = "(" + getBaseName(osdTtxFontFile) + ")"; + mfTtxFontFile = new CMenuForwarder(LOCALE_COLORMENU_FONT_TTX, true, osdTtxFontFile.c_str(), this, "ttx_font", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); + mfTtxFontFile->setHint("", LOCALE_MENU_HINT_FONT_TTX); + fontSettings->addItem(mfTtxFontFile); // contrast fonts CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_COLORMENU_CONTRAST_FONTS, &g_settings.contrast_fonts, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW); diff --git a/src/gui/osd_setup.h b/src/gui/osd_setup.h index d8c866131..b1ebb733e 100644 --- a/src/gui/osd_setup.h +++ b/src/gui/osd_setup.h @@ -47,6 +47,8 @@ class COsdSetup : public CMenuTarget, public CChangeObserver CFontSizeNotifier *fontsizenotifier; CMenuWidget *osd_menu; CMenuWidget *submenu_menus; + CMenuForwarder *mfFontFile, *mfTtxFontFile; + std::string osdFontFile, osdTtxFontFile; int width; bool is_wizard; diff --git a/src/gui/osdlang_setup.h b/src/gui/osdlang_setup.h index 5add67954..1e181b46b 100644 --- a/src/gui/osdlang_setup.h +++ b/src/gui/osdlang_setup.h @@ -56,7 +56,6 @@ class COsdLangSetup : public CMenuTarget, CChangeObserver bool is_wizard; int showLocalSetup(); - void showLanguageSetup(CMenuWidget *osdl_setup); void showPrefMenu(CMenuWidget *prefMenu, CLangSelectNotifier *langNotifier); CMenuOptionStringChooser* getTzItems(); @@ -74,6 +73,7 @@ class COsdLangSetup : public CMenuTarget, CChangeObserver COsdLangSetup(bool wizard_mode = OSDLANG_SETUP_MODE_WIZARD_NO); ~COsdLangSetup(); int exec(CMenuTarget* parent, const std::string & actionKey); + void showLanguageSetup(CMenuWidget *osdl_setup); }; #endif diff --git a/src/gui/pluginlist.cpp b/src/gui/pluginlist.cpp index cb1d72547..d5191e156 100644 --- a/src/gui/pluginlist.cpp +++ b/src/gui/pluginlist.cpp @@ -36,6 +36,7 @@ #include #include +#include #include #include @@ -304,23 +305,18 @@ void CPluginList::paintItem(int pos) void CPluginList::paintHead() { - if(listmaxshow > pluginlist.size()+1) - frameBuffer->paintBoxRel(x,y, width,theight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); - else - frameBuffer->paintBoxRel(x,y, width+15,theight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); + int h_width = width; + if (listmaxshow < pluginlist.size()) + h_width += 15; - if(pluginlisttype == CPlugins::P_TYPE_GAME) - { - frameBuffer->paintIcon(NEUTRINO_ICON_GAMES,x+8,y+5); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+38,y+theight+1, width, g_Locale->getText(name), COL_MENUHEAD, 0, true); // UTF-8 - } else if (pluginlisttype == CPlugins::P_TYPE_SCRIPT) - { - frameBuffer->paintIcon(NEUTRINO_ICON_SHELL,x+8,y+5); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+38,y+theight+1, width, g_Locale->getText(name), COL_MENUHEAD, 0, true); // UTF-8 - } else - { - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+8,y+theight+1, width, g_Locale->getText(name), COL_MENUHEAD, 0, true); // UTF-8 - } + CComponentsHeader header(x, y, h_width, theight, name, NULL /* no header icon */); + + if (pluginlisttype == CPlugins::P_TYPE_GAME) + header.setIcon(NEUTRINO_ICON_GAMES); + else if (pluginlisttype == CPlugins::P_TYPE_SCRIPT) + header.setIcon(NEUTRINO_ICON_SHELL); + + header.paint(CC_SAVE_SCREEN_NO); } void CPluginList::paint() @@ -341,7 +337,7 @@ void CPluginList::paint() void CPluginList::paintItems() { - if(listmaxshow <= pluginlist.size()+1) + if(listmaxshow < pluginlist.size()) { // Scrollbar int nrOfPages = ((pluginlist.size()-1) / listmaxshow)+1; diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index 9db935d09..7c2bbc8cf 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -233,6 +233,9 @@ CScanSetup::CScanSetup(bool wizard_mode) lcnhd = NULL; linkfe = NULL; in_menu = false; + allow_start = true; + if (CFEManager::getInstance()->haveCable()) + nid = new CIntInput(LOCALE_SATSETUP_CABLE_NID, (int&) scansettings.cable_nid, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); } CScanSetup* CScanSetup::getInstance() @@ -317,6 +320,8 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey) } CScanTs scanTs(FE_QAM); scanTs.exec(NULL, "manual"); + if (is_wizard) + return menu_return::RETURN_EXIT_ALL; return res; } std::string scants_key[] = {"all", "manual", "test", "fast", "auto"/*doesn't exists in CScanTs!*/}; @@ -340,6 +345,8 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey) //...then start scan CScanTs scanTs(delsys); scanTs.exec(NULL, scants_key[i]); + if (is_wizard && as == "fast") + return menu_return::RETURN_EXIT_ALL; return res; } } @@ -473,7 +480,7 @@ printf("C: %d S: %d T: %d\n", CFEManager::getInstance()->haveCable(),CFEManager: settings->addItem(fautoScanAll); #ifdef ENABLE_FASTSCAN //fast scan - CMenuWidget * fastScanMenu = new CMenuWidget(LOCALE_SATSETUP_FASTSCAN_HEAD, NEUTRINO_ICON_SETTINGS, MN_WIDGET_ID_SCAN_FAST_SCAN); + CMenuWidget * fastScanMenu = new CMenuWidget(LOCALE_SATSETUP_FASTSCAN_HEAD, NEUTRINO_ICON_SETTINGS, w, MN_WIDGET_ID_SCAN_FAST_SCAN); addScanMenuFastScan(fastScanMenu); mf = new CMenuDForwarder(LOCALE_SATSETUP_FASTSCAN_HEAD, true, NULL, fastScanMenu, "", CRCInput::convertDigitToKey(shortcut++)); mf->setHint("", LOCALE_MENU_HINT_SCAN_FAST); @@ -495,7 +502,7 @@ printf("C: %d S: %d T: %d\n", CFEManager::getInstance()->haveCable(),CFEManager: nc->setHint("", LOCALE_MENU_HINT_SCAN_FETIMEOUT); settings->addItem(nc); } - nid = new CIntInput(LOCALE_SATSETUP_CABLE_NID, (int&) scansettings.cable_nid, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); + //nid = new CIntInput(LOCALE_SATSETUP_CABLE_NID, (int&) scansettings.cable_nid, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); //auto scan char autoscan[64]; @@ -616,7 +623,7 @@ printf("C: %d S: %d T: %d\n", CFEManager::getInstance()->haveCable(),CFEManager: //delete satSelect; delete satOnOff; delete settings; - delete nid; + //delete nid; return res; } @@ -717,7 +724,7 @@ int CScanSetup::showScanMenuFrontendSetup() fe_restart = false; CFEManager::getInstance()->linkFrontends(true); t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); - if (live_channel_id) + if (live_channel_id && CNeutrinoApp::getInstance()->channelList) CNeutrinoApp::getInstance()->channelList->zapTo_ChannelID(live_channel_id, true); } return res; diff --git a/src/gui/scan_setup.h b/src/gui/scan_setup.h index bfc6fc382..8fa8a9543 100644 --- a/src/gui/scan_setup.h +++ b/src/gui/scan_setup.h @@ -112,11 +112,7 @@ class CScanSetup : public CMenuTarget, public CChangeObserver void addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t &satconfig); void addScanMenuManualScan(CMenuWidget *manual_Scan); void addScanMenuAutoScanAll(CMenuWidget *auto_ScanAll); -#ifdef ENABLE_FASTSCAN - void addScanMenuFastScan(CMenuWidget *fast_ScanMenu); -#endif void addScanMenuAutoScan(CMenuWidget *auto_Scan); - void addScanMenuCable(CMenuWidget *menu); int addScanOptionsItems(CMenuWidget *options_menu, const int &shortcut = 1); int addListFlagsItems(CMenuWidget *listflags_menu, const int &shortcut = 1, bool manual = false); @@ -141,6 +137,10 @@ class CScanSetup : public CMenuTarget, public CChangeObserver int exec(CMenuTarget* parent, const std::string & actionKey = ""); bool changeNotify(const neutrino_locale_t OptionName, void * /*data*/); +#ifdef ENABLE_FASTSCAN + void addScanMenuFastScan(CMenuWidget *fast_ScanMenu); +#endif + void addScanMenuCable(CMenuWidget *menu); }; class CTPSelectHandler : public CMenuTarget //CScanSetup diff --git a/src/gui/start_wizard.cpp b/src/gui/start_wizard.cpp index 7d8167675..f9e125f80 100644 --- a/src/gui/start_wizard.cpp +++ b/src/gui/start_wizard.cpp @@ -54,19 +54,23 @@ #include extern cVideo * videoDecoder; +extern Zapit_config zapitCfg; using namespace std; - CStartUpWizard::CStartUpWizard() { - } CStartUpWizard::~CStartUpWizard() { - } +const CMenuOptionChooser::keyval WIZARD_SETUP_TYPE[] = +{ + { 0, LOCALE_WIZARD_SETUP_EASY }, + { 1, LOCALE_WIZARD_SETUP_ADVANCED }, +}; + int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/) { int res = menu_return::RETURN_REPAINT; @@ -74,28 +78,45 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/) if (parent) parent->hide(); - + COsdLangSetup languageSettings(COsdLangSetup::OSDLANG_SETUP_MODE_WIZARD); - - languageSettings.exec(NULL, ""); #if 0 - if(ShowMsgUTF (LOCALE_WIZARD_WELCOME_HEAD, g_Locale->getText(LOCALE_WIZARD_WELCOME_TEXT), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbrCancel) == CMessageBox::mbrYes) + languageSettings.exec(NULL, ""); +#endif + //language setup + CMenuWidget osdl_setup(LOCALE_LANGUAGESETUP_OSD, NEUTRINO_ICON_LANGUAGE, 45, MN_WIDGET_ID_LANGUAGESETUP_LOCALE); + osdl_setup.setWizardMode(true); + languageSettings.showLanguageSetup(&osdl_setup); + osdl_setup.exec(NULL, ""); + +#if 0 + if(ShowMsgUTF (LOCALE_WIZARD_WELCOME_HEAD, g_Locale->getText(LOCALE_WIZARD_WELCOME_TEXT), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbrCancel) == CMessageBox::mbrYes) #endif { + int advanced = 1; +#ifdef ENABLE_FASTSCAN + advanced = 0; + CMenuWidget wtype(LOCALE_WIZARD_SETUP); + wtype.setWizardMode(true); + wtype.addIntroItems(); + CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_WIZARD_SETUP_TYPE, &advanced, WIZARD_SETUP_TYPE, 2, true, NULL); + mc->setHint("", LOCALE_WIZARD_SETUP_TYPE_HINT); + wtype.addItem(mc); + wtype.exec(NULL, ""); +#endif //open video settings in wizardmode - g_videoSettings->setWizardMode(CVideoSettings::V_SETUP_MODE_WIZARD); - - COsdSetup osdSettings(COsdSetup::OSD_SETUP_MODE_WIZARD); - - res = g_videoSettings->exec(NULL, ""); - g_videoSettings->setWizardMode(CVideoSettings::V_SETUP_MODE_WIZARD_NO); - - if(res != menu_return::RETURN_EXIT_ALL) + if(advanced && res != menu_return::RETURN_EXIT_ALL) { + g_videoSettings->setWizardMode(CVideoSettings::V_SETUP_MODE_WIZARD); + res = g_videoSettings->exec(NULL, ""); + g_videoSettings->setWizardMode(CVideoSettings::V_SETUP_MODE_WIZARD_NO); + } + if(advanced && res != menu_return::RETURN_EXIT_ALL) { + COsdSetup osdSettings(COsdSetup::OSD_SETUP_MODE_WIZARD); res = osdSettings.exec(NULL, ""); } - if(res != menu_return::RETURN_EXIT_ALL) + if(advanced && res != menu_return::RETURN_EXIT_ALL) { CNetworkSetup::getInstance()->setWizardMode(CNetworkSetup::N_SETUP_MODE_WIZARD); res = CNetworkSetup::getInstance()->exec(NULL, ""); @@ -115,19 +136,36 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/) CZapit::getInstance()->PrepareChannels(); } } - if(res != menu_return::RETURN_EXIT_ALL) + if(res != menu_return::RETURN_EXIT_ALL) { CScanSetup::getInstance()->setWizardMode(CScanSetup::SCAN_SETUP_MODE_WIZARD); - res = CScanSetup::getInstance()->exec(NULL, ""); + if (advanced) { + res = CScanSetup::getInstance()->exec(NULL, ""); + } else { + CZapit::getInstance()->GetConfig(zapitCfg); + if (CFEManager::getInstance()->haveSat()) { +#ifdef ENABLE_FASTSCAN + CMenuWidget fastScanMenu(LOCALE_SATSETUP_FASTSCAN_HEAD, NEUTRINO_ICON_SETTINGS, 45, MN_WIDGET_ID_SCAN_FAST_SCAN); + fastScanMenu.setWizardMode(true); + CScanSetup::getInstance()->addScanMenuFastScan(&fastScanMenu); + res = fastScanMenu.exec(NULL, ""); +#endif + } + if (CFEManager::getInstance()->haveCable()) { + CMenuWidget cableScan(LOCALE_SATSETUP_CABLE, NEUTRINO_ICON_SETTINGS, 45, MN_WIDGET_ID_SCAN_CABLE_SCAN); + cableScan.setWizardMode(true); + CScanSetup::getInstance()->addScanMenuCable(&cableScan); + res = cableScan.exec(NULL, ""); + } + } CScanSetup::getInstance()->setWizardMode(CScanSetup::SCAN_SETUP_MODE_WIZARD_NO); } } - + killBackgroundLogo(); return res; } - inline void CStartUpWizard::showBackgroundLogo() { videoDecoder->ShowPicture(DATADIR "/neutrino/icons/start.jpg"); diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index cf7459aec..710c6859f 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -594,7 +594,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) else if (actionKey == "running_clock"){ if (clock_r == NULL){ clock_r = new CComponentsFrmClock(100, 50, 0, 50, "%H.%M:%S"); - clock_r->setClockFontType(SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME); + clock_r->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]); clock_r->setClockIntervall(1); // clock_r->doPaintBg(false); } @@ -615,7 +615,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) else if (actionKey == "clock"){ if (clock == NULL){ clock = new CComponentsFrmClock(100, 50, 0, 50, "%H:%M", false); - clock->setClockFontType(SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME); + clock->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]); } if (!clock->isPainted()) diff --git a/src/gui/update.cpp b/src/gui/update.cpp index 900d1b4b7..ec8803b45 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -466,8 +466,10 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) #if ENABLE_EXTUPDATE if (g_settings.apply_settings) { if (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_APPLY_SETTINGS), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) == CMessageBox::mbrYes) - if (!CExtUpdate::getInstance()->applySettings(filename, CExtUpdate::MODE_SOFTUPDATE)) + if (!CExtUpdate::getInstance()->applySettings(filename, CExtUpdate::MODE_SOFTUPDATE)) { + hide(); return menu_return::RETURN_REPAINT; + } } #endif diff --git a/src/gui/update_ext.cpp b/src/gui/update_ext.cpp index 320107e46..0346eeb3d 100644 --- a/src/gui/update_ext.cpp +++ b/src/gui/update_ext.cpp @@ -202,7 +202,14 @@ bool CExtUpdate::applySettings() CMTDInfo * mtdInfo = CMTDInfo::getInstance(); std::string mtdFilename = mtdInfo->findMTDsystem(); // /dev/mtdX + if (mtdFilename.empty()) + return ErrorReset(0, "error system mtd not found"); + +#ifdef BOXMODEL_APOLLO + int mtdSize = 65536*1024; // FIXME hack, mtd size more than free RAM +#else int mtdSize = mtdInfo->getMTDSize(mtdFilename); +#endif int mtdEraseSize = mtdInfo->getMTDEraseSize(mtdFilename); mtdNumber = mtdInfo->findMTDNumber(mtdFilename); diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index 2df27f1dc..1b5cfc5da 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -443,13 +443,16 @@ void CVideoSettings::setVideoSettings() videoDecoder->SetVideoMode((analog_mode_t) g_settings.analog_mode1); videoDecoder->SetVideoMode((analog_mode_t) g_settings.analog_mode2); #endif +#ifdef BOXMODEL_APOLLO + changeNotify(LOCALE_VIDEOMENU_ANALOG_MODE, NULL); +#else if (system_rev == 0x06) { changeNotify(LOCALE_VIDEOMENU_ANALOG_MODE, NULL); } else { changeNotify(LOCALE_VIDEOMENU_SCART, NULL); changeNotify(LOCALE_VIDEOMENU_CINCH, NULL); } - +#endif //setupVideoSystem(false/*don't ask*/);// focus: CVideoSettings constructor do this already ? #if 0 diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index 446d7504b..6330ef150 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -121,7 +121,7 @@ void CVolumeBar::initVolumeBarPosition() switch (g_settings.volume_pos) { - case 0:{// upper right + case VOLUMEBAR_POS_TOP_RIGHT:{ int x_corr = 0; if (( neutrino->getMode() != CNeutrinoApp::mode_scart ) && ( neutrino->getMode() != CNeutrinoApp::mode_audio) && ( neutrino->getMode() != CNeutrinoApp::mode_pic)) { if ((neutrino->isMuted()) && (!g_settings.mode_clock)) @@ -132,23 +132,23 @@ void CVolumeBar::initVolumeBarPosition() x = sw - width - x_corr; break; } - case 1:// upper left + case VOLUMEBAR_POS_TOP_LEFT: break; - case 2:// bottom left + case VOLUMEBAR_POS_BOTTOM_LEFT: y = (sh + frameBuffer->getScreenY()) - height - v_spacer; break; - case 3:// bottom right + case VOLUMEBAR_POS_BOTTOM_RIGHT: x = sw - width; y = (sh + frameBuffer->getScreenY()) - height - v_spacer; break; - case 4:// upper center + case VOLUMEBAR_POS_TOP_CENTER: x = ((sw - width) / 2) + x - h_spacer/2; break; - case 5:// bottom center + case VOLUMEBAR_POS_BOTTOM_CENTER: x = ((sw - width) / 2) + x - h_spacer/2; y = (sh + frameBuffer->getScreenY()) - height - v_spacer; break; - case 6:// higher center + case VOLUMEBAR_POS_HIGHER_CENTER: x = ((sw - width) / 2) + x - h_spacer/2; y = (sh + frameBuffer->getScreenY()) - sh/10; break; diff --git a/src/gui/volumebar.h b/src/gui/volumebar.h index ce1903ae6..af44efef0 100644 --- a/src/gui/volumebar.h +++ b/src/gui/volumebar.h @@ -80,6 +80,17 @@ class CVolumeBar : public CComponentsForm public: + enum + { + VOLUMEBAR_POS_TOP_RIGHT = 0, + VOLUMEBAR_POS_TOP_LEFT = 1, + VOLUMEBAR_POS_BOTTOM_LEFT = 2, + VOLUMEBAR_POS_BOTTOM_RIGHT = 3, + VOLUMEBAR_POS_TOP_CENTER = 4, + VOLUMEBAR_POS_BOTTOM_CENTER = 5, + VOLUMEBAR_POS_HIGHER_CENTER = 6 + }; + CVolumeBar(/*int current_volume*/); // ~CVolumeBar(); inherited from CComponentsForm diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 23234d2e5..c905c945d 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -643,6 +643,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) if (fade && washidden) fader.StartFadeIn(); checkHints(); + pos = selected; paint(); break; } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index cac679fd0..0a7fe2aca 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -334,7 +334,7 @@ int CNeutrinoApp::loadSetup(const char * fname) #endif g_settings.video_Mode = configfile.getInt32("video_Mode", vid_Mode_default); #ifdef ANALOG_MODE - g_settings.analog_mode1 = configfile.getInt32("analog_mode1", (int)ANALOG_MODE(SCART,SD,RGB)); // default RGB + g_settings.analog_mode1 = configfile.getInt32("analog_mode1", (int)ANALOG_MODE(BOTH,SD,RGB)); // default RGB g_settings.analog_mode2 = configfile.getInt32("analog_mode2", (int)ANALOG_MODE(CINCH,SD,YPRPB)); // default YPBPR #else g_settings.analog_mode1 = configfile.getInt32("analog_mode1", (int)ANALOG_SD_RGB_SCART); // default RGB @@ -441,7 +441,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.infobar_progressbar = configfile.getInt32("infobar_progressbar" , 1 ); // below channel name g_settings.casystem_display = configfile.getInt32("casystem_display", 1 );//discreet ca mode default g_settings.scrambled_message = configfile.getBool("scrambled_message", true ); - g_settings.volume_pos = configfile.getInt32("volume_pos", 0 ); + g_settings.volume_pos = configfile.getInt32("volume_pos", CVolumeBar::VOLUMEBAR_POS_TOP_RIGHT ); g_settings.volume_digits = configfile.getBool("volume_digits", true); g_settings.menu_pos = configfile.getInt32("menu_pos", CMenuWidget::MENU_POS_CENTER); g_settings.show_menu_hints = configfile.getBool("show_menu_hints", false); diff --git a/src/nhttpd/README b/src/nhttpd/README index ec5e8f38d..b46815ca2 100644 --- a/src/nhttpd/README +++ b/src/nhttpd/README @@ -32,7 +32,7 @@ Tuxbox.LogosURL= WebsiteMain.directory=/share/tuxbox/neutrino/httpd // Main HTML,Javascript, Images Directoty root (e.g. read-only area in mFlash) WebsiteMain.override_directory=/var/httpd // Override directory (writable) for extensions or Updates. Webserver first search here. WebsiteMain.port=80 // Port the webserver is running on -WebsiteMain.hosted_directory=/var/hosted // our own directory hosted by the webserver. Adressable with /hosted/ +WebsiteMain.hosted_directory=/mnt/hosted // our own directory hosted by the webserver. Adressable with /hosted/ configfile.version=4 // Version of this config file mod_auth.authenticate=false // ask for username/password (http digit authentication) mod_auth.no_auth_client= // IP Adress without http authentication diff --git a/src/nhttpd/nhttpd.conf.in b/src/nhttpd/nhttpd.conf.in index a4d74e924..4facd7a42 100644 --- a/src/nhttpd/nhttpd.conf.in +++ b/src/nhttpd/nhttpd.conf.in @@ -4,7 +4,7 @@ Tuxbox.LogosURL=@TARGET_ICONSDIR@/logo WebsiteMain.directory=@TARGET_PRIVATE_HTTPDDIR@ WebsiteMain.override_directory=@TARGET_PUBLIC_HTTPDDIR@ WebsiteMain.port=80 -WebsiteMain.hosted_directory=/var/hosted +WebsiteMain.hosted_directory=@TARGET_HOSTED_HTTPDDIR@ configfile.version=4 mod_auth.authenticate=false mod_auth.no_auth_client= diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp index 9ea0ebaaf..a3489f34a 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp @@ -345,7 +345,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: int i = 1; char classname; t_channel_id current_channel = CZapit::getInstance()->GetCurrentChannelID(); - int prozent; + int prozent = 100; CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; std::string timestr; bool have_logos = false; @@ -373,20 +373,31 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: /* timer slider */ if(event && event->duration > 0) + { prozent = 100 * (time(NULL) - event->startTime) / event->duration; + yresult += string_printf("\n" + , classname + , (prozent / 10) * 3 + , (10 - (prozent / 10))*3 + ); + } else - prozent = 100; - yresult += string_printf("
\n" + "\t" + "" + "" + "" + "" + "
\n
\n" - , classname - , (prozent / 10) * 3 - , (10 - (prozent / 10))*3 - ); + { + yresult += string_printf("
\n" - "\t" - "" - "" - "" - "" - "
\n
\n" + , classname + ); + } /* channel name and buttons */ yresult += string_printf(" - {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ @@ -76,8 +76,15 @@ function do_submit() =} - + + + + + diff --git a/src/nhttpd/web/Y_Settings_yWeb.yhtm b/src/nhttpd/web/Y_Settings_yWeb.yhtm index bc7e396d9..0be09d97a 100644 --- a/src/nhttpd/web/Y_Settings_yWeb.yhtm +++ b/src/nhttpd/web/Y_Settings_yWeb.yhtm @@ -9,12 +9,20 @@ function do_submit(){ document.f.submit(); } function do_init(){ - val = "{=ini-get:/var/tuxbox/config/Y-Web.conf;fb;{=if-equal:{=global-var-get:boxtype=}~coolstream~Coolstream~default=}~open=}"; + val = "{=ini-get:/var/tuxbox/config/Y-Web.conf;fb;0~open=}"; var sel=2; switch(val){ - case "default": sel=0; break; - case "Nokia": sel=1; break; - case "CST": sel=3; break; + case "-2": // d-box philips + case "-1": // d-box nokia old + case "0": // auto + case "1": // cst hd1/bse + case "2": // cst neo + case "3": // cst zee/neo2 + case "4": // cst neo twin (todo!) + sel=(sel*1+val*1); + break; + default: + break; } document.f.fb.selectedIndex = sel; val = "{=ini-get:/var/tuxbox/config/Y-Web.conf;start_page;bouquets~cache=}"; @@ -78,12 +86,17 @@ function do_init(){ - + diff --git a/src/nhttpd/web/Y_Tools_Menue.yhtm b/src/nhttpd/web/Y_Tools_Menue.yhtm index 6cf1ac3e5..aa4a47799 100644 --- a/src/nhttpd/web/Y_Tools_Menue.yhtm +++ b/src/nhttpd/web/Y_Tools_Menue.yhtm @@ -7,36 +7,9 @@ function cmd_popup(){ window.open('Y_Tools_Cmd.yhtm','cmd','width=720,height=470,resizable=yes'); } function init(){ - var menu=ext.select_menu('tools'); - menu.each(function(e){ - var el=new Element('li').update( - new Element('a', {'target':'work', - 'title': e.get('desc'), - 'href': e.get('file') - }).update("-"+e.get('menuitem')) - ); - $('secmenu_tools').insert({'bottom':el}); - }); - var menu=ext.select_menu('expert'); - menu.each(function(e){ - var el=new Element('li').update( - new Element('a', {'target':'work', - 'title': e.get('desc'), - 'href': e.get('file') - }).update("-"+e.get('menuitem')) - ); - $('secmenu_expert').insert({'bottom':el}); - }); - var menu=ext.select_menu('yweb'); - menu.each(function(e){ - var el=new Element('li').update( - new Element('a', {'target':'work', - 'title': e.get('desc'), - 'href': e.get('file') - }).update("-"+e.get('menuitem')) - ); - $('secmenu_yweb').insert({'bottom':el}); - }); + add_yExtensions('tools', 'secmenu_tools'); + add_yExtensions('expert', 'secmenu_expert'); + add_yExtensions('yweb', 'secmenu_yweb'); } diff --git a/src/nhttpd/web/Y_Tools_Screenshot.yhtm b/src/nhttpd/web/Y_Tools_Screenshot.yhtm index 6adee9bc7..5051e5b27 100644 --- a/src/nhttpd/web/Y_Tools_Screenshot.yhtm +++ b/src/nhttpd/web/Y_Tools_Screenshot.yhtm @@ -65,17 +65,25 @@ function do_clearshot(){ loadSyncURL("/control/exec?Y_Tools&screenshot_clear"); } -function do_zoomshot(){ - // not a really zoom-function +function do_switchrc(){ if (id('remote').style.display == 'none') $('remote').show(); else $('remote').hide(); + + do_switchrc_txt(); +} + +function do_switchrc_txt(){ + if (id('remote').style.display == 'none') + $('switchrc').update("{=L:bc.control.remote=} {=L:show=}"); + else + $('switchrc').update("{=L:bc.control.remote=} {=L:hide=}"); } //]]> - +
{=var-set:help_url==}{=var-set:menu={=L:bc.menue.screenshot=}=}{=include-block:Y_Blocks.txt;work_menu=}
@@ -85,7 +93,7 @@ function do_zoomshot(){
    -   +  
@@ -108,7 +116,7 @@ function do_zoomshot(){ {=include-block:Y_Blocks.txt;remote=}
\n" + "\t" + "" + "" + "" + "
\n
\n%s - +# ------ Remote CST V1 (HD1 / BSE) +start-block~rc_cst_v1 +remote + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +end-block~rc_cst_v1 + +# ------- Remote CST V2 (NEO) +start-block~rc_cst_v2 +remote + @@ -557,112 +630,161 @@ start-block~remote_neo -end-block~remote_neo +end-block~rc_cst_v2 -# ------ Remote Coolstream ZEE -start-block~remote_zee - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -end-block~remote_zee +# ------ Remote CST V3 (ZEE, NEO2) +start-block~rc_cst_v3 +{=var-set:rcu=rc_cst_v3=} +remote +{=include-block:Y_Blocks.txt;map_rc_cst_v3_v4=} +end-block~rc_cst_v3 -# ------ Remote Coolstream HD1 -start-block~remote_hd1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# ------ Remote CST V4 (NEO TWIN) +start-block~rc_cst_v4 +{=var-set:rcu=rc_cst_v4=} +remote +{=include-block:Y_Blocks.txt;map_rc_cst_v3_v4=} +end-block~rc_cst_v4 + +# ------ Map for Remote CST V3 (ZEE, NEO2) and V4 (NEO TWIN) +start-block~map_rc_cst_v3_v4 + + standby + mute + + tv/radio + skip- + skip+ + + + + sleep + audio + help + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + + txt + fav + + epg + info + + up + down + left + right + ok + + menu + exit + + vol+ + vol- + page+ + page- + sat + + red + green + yellow + blue + + w + + + + + rew + play + ff + stop + + rec + pause + m/s + t/s + + picsize +{=if-equal:{=var-get:rcu=}~rc_cst_v3~ + picmode~ +{=if-equal:{=var-get:rcu=}~rc_cst_v4~ + picmode~ +=}=} -end-block~remote_hd1 +end-block~map_rc_cst_v3_v4 + +# ------- Remote d-Box Nokia old +start-block~rc_dbox_nokia_old +remote + + + + + + + + + + + + + + + + + + + + + + + + + + + + +end-block~rc_dbox_nokia_old + +# ------- Remote d-Box Philips/Sagem +start-block~rc_dbox_philips +remote + + + + + + + + + + + + + + + + + + + + + + + + + + + + +end-block~rc_dbox_philips diff --git a/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm b/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm index 536cd1dc7..993857228 100644 --- a/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm +++ b/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm @@ -56,17 +56,7 @@ function set_mode(_mode){ function init(){ volumen_set_audiobar(volumen_get()); set_mute_button(); - var menu=ext.select_menu('boxcontrol'); - menu.each(function(e){ - var el=new Element('li').update( - new Element('a', {'target':'work', - 'title': e.get('desc'), - 'href': e.get('file') - }).update("-"+e.get('menuitem')) - ); - $('secmenu_boxcontrol').insert({'bottom':el}); - }); - + add_yExtensions('boxcontrol', 'secmenu_boxcontrol'); } //]]> @@ -101,6 +91,8 @@ function init(){ ~=}
  • OSD-{=L:bc.menue.screenshot=} +
  • +
  • TV-{=L:bc.menue.screenshot=}
  • diff --git a/src/nhttpd/web/Y_Ext_Menue.yhtm b/src/nhttpd/web/Y_Ext_Menue.yhtm index 7981d982d..678e4ea5c 100644 --- a/src/nhttpd/web/Y_Ext_Menue.yhtm +++ b/src/nhttpd/web/Y_Ext_Menue.yhtm @@ -1,4 +1,4 @@ -{=var-set:extension={=if-file-exists:/var/tuxbox/config/extentions.txt~/var/tuxbox/config/extentions.txt~{=if-file-exists:/var/httpd/extentions.txt~/var/httpd/extentions.txt~/share/tuxbox/neutrino/httpd-y/extentions.txt=}=}=} +{=var-set:extension={=if-file-exists:/var/tuxbox/config/extentions.txt~/var/tuxbox/config/extentions.txt~{=if-file-exists:/var/httpd/extentions.txt~/var/httpd/extentions.txt~/share/tuxbox/neutrino/httpd/extentions.txt=}=}=} {=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} {=include-block:Y_Blocks.txt;head=} diff --git a/src/nhttpd/web/Y_Ext_Settings.yhtm b/src/nhttpd/web/Y_Ext_Settings.yhtm index 73472ed91..f9a9f906d 100644 --- a/src/nhttpd/web/Y_Ext_Settings.yhtm +++ b/src/nhttpd/web/Y_Ext_Settings.yhtm @@ -23,7 +23,7 @@ function do_submit(){ - +
     

    diff --git a/src/nhttpd/web/Y_Ext_Update.js b/src/nhttpd/web/Y_Ext_Update.js index 53ace0604..0a212f0e3 100644 --- a/src/nhttpd/web/Y_Ext_Update.js +++ b/src/nhttpd/web/Y_Ext_Update.js @@ -45,7 +45,7 @@ function update_list_addRow(_body, i, your_version, ext_item) var mycurrent_row = y_add_row_to_table(_body, ((i % 2) ==0)?"a":"b" ); var check=''; - var info=""; + var info=" "; var etype=""; switch (ext.upd_version){ @@ -56,7 +56,8 @@ function update_list_addRow(_body, i, your_version, ext_item) var yweb_version=ext_item.get('yweb_version'); if (!yweb.require(yweb_version)) check = ""; - info=""; + if (typeof(ext_item.get('info_url')) != 'undefined') + info=""; break; } switch(ext_item.get('type')){ @@ -180,7 +181,9 @@ function uninstall_list_addRow(_body, i, ext_item, has_uninstall) // var check=''; var etype=""; - var info=""; + var info=" "; + if (typeof(ext_item.get('info_url')) != 'undefined') + info=""; var uninst=""; if(!has_uninstall) uninst=" "; switch(ext_item.get('type')){ diff --git a/src/nhttpd/web/Y_Info_Menue.yhtm b/src/nhttpd/web/Y_Info_Menue.yhtm index c549d5ffc..3ea5dab60 100644 --- a/src/nhttpd/web/Y_Info_Menue.yhtm +++ b/src/nhttpd/web/Y_Info_Menue.yhtm @@ -5,16 +5,7 @@ diff --git a/src/nhttpd/web/Y_Live_Menue.yhtm b/src/nhttpd/web/Y_Live_Menue.yhtm index a92bb0d90..89457120f 100644 --- a/src/nhttpd/web/Y_Live_Menue.yhtm +++ b/src/nhttpd/web/Y_Live_Menue.yhtm @@ -22,36 +22,9 @@ function epg_plus_popup() { window.open("Y_EPG_Plus.yhtm","_blank","resizable=yes,scrollbars=yes"); } function init(){ - var menu=ext.select_menu('live'); - menu.each(function(e){ - var el=new Element('li').update( - new Element('a', {'target':'work', - 'title': e.get('desc'), - 'href': e.get('file') - }).update("-"+e.get('menuitem')) - ); - $('secmenu_live').insert({'bottom':el}); - }); - var menu=ext.select_menu('epg'); - menu.each(function(e){ - var el=new Element('li').update( - new Element('a', {'target':'work', - 'title': e.get('desc'), - 'href': e.get('file') - }).update("-"+e.get('menuitem')) - ); - $('secmenu_epg').insert({'bottom':el}); - }); - var menu=ext.select_menu('timer'); - menu.each(function(e){ - var el=new Element('li').update( - new Element('a', {'target':'work', - 'title': e.get('desc'), - 'href': e.get('file') - }).update("-"+e.get('menuitem')) - ); - $('secmenu_timer').insert({'bottom':el}); - }); + add_yExtensions('live', 'secmenu_live'); + add_yExtensions('epg', 'secmenu_epg'); + add_yExtensions('timer', 'secmenu_timer'); } //]]> diff --git a/src/nhttpd/web/Y_Main.css b/src/nhttpd/web/Y_Main.css index 705b64cad..1d3a39aa8 100644 --- a/src/nhttpd/web/Y_Main.css +++ b/src/nhttpd/web/Y_Main.css @@ -51,7 +51,7 @@ button[ytype="timedown"]{background-image:url(/images/time_down.png);} button[ytype="timeadd"]{background-image:url(/images/time_add.png);} button[ytype="snapshot"]{background-image:url(/images/snapshot.png);} button[ytype="clearshot"]{background-image:url(/images/remove.png);} -button[ytype="zoomshot"]{background-image:url(/images/fullscreen.png);} +button[ytype="switchrc"]{background-image:url(/images/fb.png);} button[ytype="go"]{background-image:url(/images/accept.png);} button[ytype="download"]{background-image:url(/images/wget.gif);} button[ytype="clear"]{background-image:url(/images/remove.png);} @@ -177,8 +177,6 @@ tr { font-weight: normal; padding: 0em 0.3em; } -.y_menu_prim_item { -} .y_menu_prim li a { font-size: 11pt; text-decoration: none; @@ -191,6 +189,10 @@ tr { .y_menu_prim li a:hover { color: #FF6600; } +/*extensions*/ +.y_menu_prim_ext { +} + #box_name { font-weight:normal; font-size:10pt; @@ -280,6 +282,10 @@ tr { .y_menu_sec ul li:first-child { margin-top: 5px; } +/*extensions*/ +.y_menu_sec_ext { +} + .y_menu_popup_link { float: right; margin-right: 15px; @@ -771,9 +777,12 @@ a:hover.clistsmall font-size:10pt; padding-left: 10px; } -.cslider_table +.cslider { height: 10px; +} +.cslider_table +{ border: 1px solid #6cafea; width: 30px; border-spacing: 0px; @@ -783,12 +792,14 @@ a:hover.clistsmall .cslider_used { background-color: #A1CCF2; - height: 10px; } .cslider_free { background-color: #EAEBFF; - height: 10px; +} +.cslider_noepg +{ + background-color: #FAFAFF; } /*EPG*/ .epg @@ -864,9 +875,13 @@ a.timer { #screenshot_header { height: 30px; } +td#remote, td.shot { vertical-align: top; } +td#remote img { + margin: 10px 10px 10px 0; +} img#shot { width: 100%; background-color: #ffffff; diff --git a/src/nhttpd/web/Y_Menue.yhtm b/src/nhttpd/web/Y_Menue.yhtm index 0ba6a9ad0..121d3e5b7 100644 --- a/src/nhttpd/web/Y_Menue.yhtm +++ b/src/nhttpd/web/Y_Menue.yhtm @@ -46,16 +46,7 @@ function i_start(){ g_i_counter = 0; i_clock(); g_i_active = window.setInterval('i_interval()', 1000); - var mainmenu=ext.select_menu('main'); - mainmenu.each(function(e){ - var el=new Element('li').update( - new Element('a', {'class':'y_menu_prim_item', 'target':'base', - 'title': e.get('desc'), - 'href': e.get('file') - }).update(e.get('menuitem')) - ); - $('menu_prim').insert({'bottom':el}); - }); + add_yExtensions('main', 'menu_prim'); } function i_stop(){ window.clearInterval(g_i_active); diff --git a/src/nhttpd/web/Y_Settings.yhtm b/src/nhttpd/web/Y_Settings.yhtm deleted file mode 100644 index 3f4ec1dbd..000000000 --- a/src/nhttpd/web/Y_Settings.yhtm +++ /dev/null @@ -1,17 +0,0 @@ -{=var-set:cancache=yPyes=} - - - - - - - - - - <body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0"> - <p>Diese Seite verwendet Frames. Frames werden von Ihrem Browser aber nicht unterst&uuml;zt.</p> - </body> - - - - diff --git a/src/nhttpd/web/Y_Settings_Menue.yhtm b/src/nhttpd/web/Y_Settings_Menue.yhtm index 2769674bf..72d4f9f20 100644 --- a/src/nhttpd/web/Y_Settings_Menue.yhtm +++ b/src/nhttpd/web/Y_Settings_Menue.yhtm @@ -5,36 +5,9 @@ diff --git a/src/nhttpd/web/Y_Settings_nhttpd.yhtm b/src/nhttpd/web/Y_Settings_nhttpd.yhtm index 5418e22a4..d3891c79a 100644 --- a/src/nhttpd/web/Y_Settings_nhttpd.yhtm +++ b/src/nhttpd/web/Y_Settings_nhttpd.yhtm @@ -62,7 +62,7 @@ function do_submit()
    {=L:set.nhttpd.port=} {=L:active_after_boot=} +  {=L:set.nhttpd.active_after_boot=}
    {=L:set.nhttpd.alternate_web_folder=} {=L:active_after_boot=} - +  {=L:set.nhttpd.active_after_boot=} +
    {=L:set.nhttpd.hosted_folder=} +  {=L:set.nhttpd.active_after_boot=} +
    {=L:set.nhttpd.allowed_file_extensions=}
    {=L:others=}
    {=L:set.yweb.remote=} + +
    {=L:set.yweb.start_page=} - +
    diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index 92c58e2c6..31639c62c 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.8.0.33 -date=06.02.2013 +version=2.8.0.39 +date=05.07.2013 type=Release info=Port CST diff --git a/src/nhttpd/web/Y_yweb.js b/src/nhttpd/web/Y_yweb.js index a73bdd7a1..ecd729d2a 100644 --- a/src/nhttpd/web/Y_yweb.js +++ b/src/nhttpd/web/Y_yweb.js @@ -182,6 +182,22 @@ Object.extend(Y.extension.prototype, { },this); } }); + +function add_yExtensions(_ymenu, _id) { + var menu=ext.select_menu(_ymenu); + menu.each(function(e){ + var el=new Element('li').update( + new Element('a', { + 'class': (_ymenu == 'main') ? 'y_menu_prim_ext' : 'y_menu_sec_ext', + 'target': (_ymenu == 'main') ? 'base' : 'work', + 'title': e.get('desc'), + 'href': e.get('file') + }).update(e.get('menuitem')) + ); + $(_id).insert({'bottom':el}); + }); +} + /* singleton pattern*/ if (window == top.top_main.prim_menu) { var ext = new Y.extension(); diff --git a/src/nhttpd/web/images/LICENSE b/src/nhttpd/web/images/LICENSE index c98e4bd19..71f5be81e 100644 --- a/src/nhttpd/web/images/LICENSE +++ b/src/nhttpd/web/images/LICENSE @@ -1,7 +1,7 @@ Same pictures used are form the Tuxbox Community: Published under GPL v2 -- rc.jpg : Jonny Spitzner -- rc_sagem.jpg Jonny Spitzner +- rc_dbox_nokia_old.jpg : Jonny Spitzner +- rc_dbox_philips.jpg : Jonny Spitzner - tux.gif : from wiki.tuxbox.org From Johannes Golombek yjogol@online.de: diff --git a/src/nhttpd/web/images/Makefile.am b/src/nhttpd/web/images/Makefile.am index 01bcdc88b..99ad6eaab 100644 --- a/src/nhttpd/web/images/Makefile.am +++ b/src/nhttpd/web/images/Makefile.am @@ -38,7 +38,6 @@ install_DATA = accept.png \ ftype_folder.gif \ ftype_link.gif \ fullscreen.png \ - hd1.jpg \ help.gif \ help_white.gif \ hidden.gif \ @@ -56,7 +55,6 @@ install_DATA = accept.png \ lock.gif \ lock.png \ modify.png \ - neo.jpg \ new.gif \ new.png \ ok.gif \ @@ -66,9 +64,12 @@ install_DATA = accept.png \ properties.gif \ properties.png \ radio.png \ - rc.gif \ - rc.jpg \ - rc_sagem.jpg \ + rc_cst_v1.jpg \ + rc_cst_v2.jpg \ + rc_cst_v3.jpg \ + rc_cst_v4.jpg \ + rc_dbox_nokia_old.jpg \ + rc_dbox_philips.jpg \ record.gif \ record.png \ reload.gif \ @@ -105,5 +106,4 @@ install_DATA = accept.png \ x_red.gif \ yjogol.gif \ y.png \ - zap.png \ - zee.jpg + zap.png diff --git a/src/nhttpd/web/images/fb.png b/src/nhttpd/web/images/fb.png index da7e7f031..e08d81e8b 100644 Binary files a/src/nhttpd/web/images/fb.png and b/src/nhttpd/web/images/fb.png differ diff --git a/src/nhttpd/web/images/rc.gif b/src/nhttpd/web/images/rc.gif deleted file mode 100644 index dfa2a1520..000000000 Binary files a/src/nhttpd/web/images/rc.gif and /dev/null differ diff --git a/src/nhttpd/web/images/hd1.jpg b/src/nhttpd/web/images/rc_cst_v1.jpg similarity index 100% rename from src/nhttpd/web/images/hd1.jpg rename to src/nhttpd/web/images/rc_cst_v1.jpg diff --git a/src/nhttpd/web/images/neo.jpg b/src/nhttpd/web/images/rc_cst_v2.jpg similarity index 100% rename from src/nhttpd/web/images/neo.jpg rename to src/nhttpd/web/images/rc_cst_v2.jpg diff --git a/src/nhttpd/web/images/rc_cst_v3.jpg b/src/nhttpd/web/images/rc_cst_v3.jpg new file mode 100644 index 000000000..33aba320e Binary files /dev/null and b/src/nhttpd/web/images/rc_cst_v3.jpg differ diff --git a/src/nhttpd/web/images/rc_cst_v4.jpg b/src/nhttpd/web/images/rc_cst_v4.jpg new file mode 100644 index 000000000..b52e6f1e0 Binary files /dev/null and b/src/nhttpd/web/images/rc_cst_v4.jpg differ diff --git a/src/nhttpd/web/images/rc.jpg b/src/nhttpd/web/images/rc_dbox_nokia_old.jpg similarity index 100% rename from src/nhttpd/web/images/rc.jpg rename to src/nhttpd/web/images/rc_dbox_nokia_old.jpg diff --git a/src/nhttpd/web/images/rc_sagem.jpg b/src/nhttpd/web/images/rc_dbox_philips.jpg similarity index 100% rename from src/nhttpd/web/images/rc_sagem.jpg rename to src/nhttpd/web/images/rc_dbox_philips.jpg diff --git a/src/nhttpd/web/images/rcd.jpg b/src/nhttpd/web/images/rcd.jpg deleted file mode 100644 index 129742060..000000000 Binary files a/src/nhttpd/web/images/rcd.jpg and /dev/null differ diff --git a/src/nhttpd/web/images/zee.jpg b/src/nhttpd/web/images/zee.jpg deleted file mode 100644 index 7bbb8ae61..000000000 Binary files a/src/nhttpd/web/images/zee.jpg and /dev/null differ diff --git a/src/nhttpd/web/languages/Deutsch b/src/nhttpd/web/languages/Deutsch index c8ca664e0..f17d79614 100644 --- a/src/nhttpd/web/languages/Deutsch +++ b/src/nhttpd/web/languages/Deutsch @@ -53,6 +53,9 @@ attention=Achtung! directory=Verzeichnis filename=Dateiname restriced_by_management_ip=Zugriff verwehrt wg. ManagementIP +automatic=automatisch +show=zeigen +hide=verstecken # ==========Main Menue main.boxcontrol=Boxsteuerung @@ -300,6 +303,7 @@ set.nhttpd.active_after_boot=Nach Neustart aktiv set.nhttpd.port=Port set.nhttpd.threading=Threading set.nhttpd.alternate_web_folder=Alternativer Web-Ordner +set.nhttpd.hosted_folder=Eingebundenes Verzeichnis set.nhttpd.allowed_file_extensions=Erlaubte Dateiendungen / MIME set.nhttpd.allow_all_file_extensions=Alle Dateiendungen erlauben set.nhttpd.url_of_logos_desc=URL bzw. Verzeichnis der Logos eingeben @@ -534,3 +538,54 @@ info.About=Über info.check_for_updates=Auf Updates prüfen info.your_version=Deine Version info.actual_version=Aktuelle Version + +=========Remote control +rc.key_power=Standby - Schaltet den Receiver ein bzw. aus +rc.key_mute=Mute - Schaltet den Ton an bzw. aus +rc.key_1=1 +rc.key_2=2 +rc.key_3=3 +rc.key_4=4 +rc.key_5=5 +rc.key_6=6 +rc.key_7=7 +rc.key_8=8 +rc.key_9=9 +rc.key_0=0 +rc.key_text=Text - Zeigt den Teletext an +rc.key_favorites=Favoriten - Zeigt die Favoritenliste an +rc.key_volumeup=Vol+ - Erhöht die Lautstärke +rc.key_volumedown=Vol- - Verringert die Lautstärke +rc.key_pageup=Page+ - Blättert im Menü eine Seite hoch +rc.key_pagedown=Page- - Blättert im Menü eine Seiter runter +rc.key_mode=TV/Radio - Wechselt zwischen TV- und Radio-Modus +rc.key_next=Skip- - Ändert das 4:3 Anzeigeverhalten +rc.key_previous=Skip+ - Ändert das Bildschirmformat +rc.key_sleep=Sleep - Setzt einen Ausschalt-Timer +rc.key_audio=Audio - Startet den Audioplayer bzw. Internetradio +rc.key_help=Help - Startet je nach Modus verschiedene Funktionen +rc.key_red=Rot - Öffnet das Menü 'EPG/Vorschau' +rc.key_green=Grün - Offnet das Menü 'Ton-Optionen' +rc.key_yellow=Gelb - Öffnet das Menü 'Bild-Optionen' (wenn verfügbar) +rc.key_blue=Blau - Öffnet das Menü 'Erweiterungen' +rc.key_epg=EPG - Zeigt EPG-Informationen an +rc.key_info=Info - Zeigt die Infobar und EPG-Beschreibung an +rc.key_ok=OK - Bestätigt Auswahl im Menüfenster +rc.key_up=Hoch - Programmwechsel und Menünavigation +rc.key_down=Runter - Programmwechsel und Menünavigation +rc.key_left=Links - Programmwechsel und Menünavigation +rc.key_right=Rechts - Programmwechsel und Menünavigation +rc.key_setup=Menü - Öffnet bzw. schließt das Hauptmenü +rc.key_home=Exit - Schließt das geöffnete Menüfenster +rc.key_sat=Sat - Öffnet Satelliten- bzw. Anbieterübersicht +rc.key_www= +rc.key_rewind=Rewind - Zurückspulen +rc.key_play=Play - Öffnet das Filmarchiv oder startet die Wiedergabe +rc.key_forward=Forward - Vorspulen +rc.key_stop=Stop - Beendet Aufnahme, Timeshift oder Wiedergabe +rc.key_record=Record - Startet Aufnahme +rc.key_pause=Pause - Aktiviert timeshift oder pausiert die Wiedergabe +rc.key_games= +rc.key_time= +rc.key_picsize=Pic Size - Ändert das 4:3 Anzeigeverhalten +rc.key_picmode=Pic Mode - Ändert das Bildschirmformat diff --git a/src/nhttpd/web/languages/English b/src/nhttpd/web/languages/English index d49bac530..d9ae7c8d2 100644 --- a/src/nhttpd/web/languages/English +++ b/src/nhttpd/web/languages/English @@ -53,6 +53,9 @@ attention=Attention! directory=Directory filename=Filename restriced_by_management_ip=restricted by ManagementIP +automatic=automatically +show=show +hide=hide #========= MAIN Menue main.live_tv_desc=LiveTV @@ -303,6 +306,7 @@ set.nhttpd.active_after_boot=active after boot set.nhttpd.port=Port set.nhttpd.threading=Threading set.nhttpd.alternate_web_folder=Alternate Web-Folder +set.nhttpd.hosted_folder=Mounted directory set.nhttpd.allowed_file_extensions=Allowed File Extensions / MIME set.nhttpd.allow_all_file_extensions=Allow all File Extensions set.nhttpd.url_of_logos_desc=Enter URL or directory of Logos @@ -538,3 +542,53 @@ info.check_for_updates=Check for Updates info.your_version=Your Version info.actual_version=Actual Version +=========Remote control +rc.key_power=Standby +rc.key_mute=Mute +rc.key_1=1 +rc.key_2=2 +rc.key_3=3 +rc.key_4=4 +rc.key_5=5 +rc.key_6=6 +rc.key_7=7 +rc.key_8=8 +rc.key_9=9 +rc.key_0=0 +rc.key_text=Text +rc.key_favorites=Favorites +rc.key_volumeup=Vol+ +rc.key_volumedown=Vol- +rc.key_pageup=Page+ +rc.key_pagedown=Page- +rc.key_mode=TV/Radio +rc.key_next=Skip- +rc.key_previous=Skip+ +rc.key_sleep=Sleep +rc.key_audio=Audio +rc.key_help=Help +rc.key_red=Red +rc.key_green=Green +rc.key_yellow=Yellow +rc.key_blue=Blue +rc.key_epg=EPG +rc.key_info=Info +rc.key_ok=OK +rc.key_up=Up +rc.key_down=Down +rc.key_left=Left +rc.key_right=Right +rc.key_setup=Menu +rc.key_home=Exit +rc.key_sat=Sat +rc.key_www= +rc.key_rewind=Rewind +rc.key_play=Play +rc.key_forward=Forward +rc.key_stop=Stop +rc.key_record=Record +rc.key_pause=Pause +rc.key_games= +rc.key_time= +rc.key_picsize=Pic Size +rc.key_picmode=Pic Mode diff --git a/src/nhttpd/yconfig.h b/src/nhttpd/yconfig.h index 675d6a04e..663e919b0 100644 --- a/src/nhttpd/yconfig.h +++ b/src/nhttpd/yconfig.h @@ -109,7 +109,8 @@ #define YWEB_CONFIGFILE HTTPD_CONFIGDIR"/Y-Web.conf" #define PUBLICDOCUMENTROOT PUBLIC_HTTPDDIR #define NEUTRINO_CONFIGFILE CONFIGDIR"/neutrino.conf" -#define HOSTEDDOCUMENTROOT "/mnt/hosted" +#define HOSTEDDOCUMENTROOT HOSTED_HTTPDDIR +#define HOSTEDDOCUMENTURL "/hosted/" #define EXTRASDOCUMENTROOT "/mnt/hosted/extras" #define EXTRASDOCUMENTURL "/hosted/extras" #define ZAPITXMLPATH CONFIGDIR"/zapit" diff --git a/src/nhttpd/yhttpd.cpp b/src/nhttpd/yhttpd.cpp index f3a2bf706..b4971328b 100644 --- a/src/nhttpd/yhttpd.cpp +++ b/src/nhttpd/yhttpd.cpp @@ -507,7 +507,7 @@ void Cyhttpd::ReadConfig(void) { Config->setString("Language.selected", HTTPD_DEFAULT_LANGUAGE); Config->setString("Language.directory", HTTPD_LANGUAGEDIR); if (Config->getString("WebsiteMain.hosted_directory", "") == "") - Config->setString("WebsiteMain.hosted_directory", "/var/hosted"); + Config->setString("WebsiteMain.hosted_directory", HOSTEDDOCUMENTROOT); Config->saveConfig(HTTPD_CONFIGFILE); } } @@ -544,14 +544,20 @@ void Cyhttpd::ReadConfig(void) { // Check location of logos if (Config->getString("Tuxbox.LogosURL", "") == "") { - if (access(std::string(ConfigList["WebsiteMain.directory"] + "/logos").c_str(), 4) == 0) { - Config->setString("Tuxbox.LogosURL", ConfigList["WebsiteMain.directory"] + "/logos"); - have_config = false; //save config - } - else if (access(std::string(ConfigList["WebsiteMain.override_directory"] ).c_str(), 4) == 0){ + if (access(std::string(ConfigList["WebsiteMain.override_directory"] + "/logos").c_str(), 4) == 0) { Config->setString("Tuxbox.LogosURL", ConfigList["WebsiteMain.override_directory"] + "/logos"); have_config = false; //save config } + else if (access(std::string(ConfigList["WebsiteMain.directory"] + "/logos").c_str(), 4) == 0){ + Config->setString("Tuxbox.LogosURL", ConfigList["WebsiteMain.directory"] + "/logos"); + have_config = false; //save config + } +#ifdef Y_CONFIG_USE_HOSTEDWEB + else if (access(std::string(ConfigList["WebsiteMain.hosted_directory"] + "/logos").c_str(), 4) == 0){ + Config->setString("Tuxbox.LogosURL", ConfigList["WebsiteMain.hosted_directory"] + "/logos"); + have_config = false; //save config + } +#endif //Y_CONFIG_USE_HOSTEDWEB } ConfigList["Tuxbox.LogosURL"] = Config->getString("Tuxbox.LogosURL", ""); diff --git a/src/nhttpd/yhttpd_core/yresponse.cpp b/src/nhttpd/yhttpd_core/yresponse.cpp index 96ed8f510..74af5515a 100644 --- a/src/nhttpd/yhttpd_core/yresponse.cpp +++ b/src/nhttpd/yhttpd_core/yresponse.cpp @@ -64,14 +64,6 @@ bool CWebserverResponse::SendResponse() { // Checking and Preperation: Auth, static, cache, ... //-------------------------------------------------------------- - // move to mod_sendfile ??? -#ifdef Y_CONFIG_USE_HOSTEDWEB - // for hosted webs: rewrite URL - std::string _hosted="/hosted/"; - if((Connection->Request.UrlData["path"]).compare(0,_hosted.length(),"/hosted/") == 0) // hosted Web ? - Connection->Request.UrlData["path"]=Cyhttpd::ConfigList["WebsiteMain.hosted_directory"] - +(Connection->Request.UrlData["path"]).substr(_hosted.length()-1); -#endif //Y_CONFIG_USE_HOSTEDWEB do { if (Connection->RequestCanceled) return false; diff --git a/src/nhttpd/yhttpd_mods/mod_sendfile.cpp b/src/nhttpd/yhttpd_mods/mod_sendfile.cpp index ce3a2551f..81f3cabb6 100644 --- a/src/nhttpd/yhttpd_mods/mod_sendfile.cpp +++ b/src/nhttpd/yhttpd_mods/mod_sendfile.cpp @@ -65,6 +65,14 @@ THandleStatus CmodSendfile::Hook_PrepareResponse(CyhookHandler *hh) { hh->status = HANDLED_NONE; log_level_printf(4, "mod_sendfile prepare hook start url:%s\n", hh->UrlData["fullurl"].c_str()); + +#ifdef Y_CONFIG_USE_HOSTEDWEB + // for hosted webs: rewrite URL + std::string _hosted=HOSTEDDOCUMENTURL; + if((hh->UrlData["path"]).compare(0,_hosted.length(),HOSTEDDOCUMENTURL) == 0) // hosted Web ? + hh->UrlData["path"]=hh->WebserverConfigList["WebsiteMain.hosted_directory"]+(hh->UrlData["path"]).substr(_hosted.length()-1); +#endif //Y_CONFIG_USE_HOSTEDWEB + std::string mime = sendfileTypes[hh->UrlData["fileext"]]; if (((mime != "") || (hh->WebserverConfigList["mod_sendfile.sendAll"] == "true")) && !(hh->UrlData["fileext"] == "yhtm" || hh->UrlData["fileext"] == "yjs" || hh->UrlData["fileext"] == "ysh")) { diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.cpp b/src/nhttpd/yhttpd_mods/mod_yparser.cpp index b7995dc23..e6859fb25 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.cpp +++ b/src/nhttpd/yhttpd_mods/mod_yparser.cpp @@ -271,10 +271,18 @@ std::string CyParser::cgi_file_parsing(CyhookHandler *hh, bool found = false; std::string htmlfullfilename, yresult, html_template; + bool isHosted = false; +#ifdef Y_CONFIG_USE_HOSTEDWEB + // for hosted webs: search in hosted_directory only + std::string _hosted=hh->WebserverConfigList["WebsiteMain.hosted_directory"]; + if((hh->UrlData["path"]).compare(0,_hosted.length(),hh->WebserverConfigList["WebsiteMain.hosted_directory"]) == 0) // hosted Web ? + isHosted = true; +#endif //Y_CONFIG_USE_HOSTEDWEB + char cwd[255]; getcwd(cwd, 254); - for (unsigned int i = 0; i < HTML_DIR_COUNT && !found; i++) { - htmlfullfilename = HTML_DIRS[i] + "/" + htmlfilename; + for (unsigned int i = 0; i < (isHosted ? 1 : HTML_DIR_COUNT) && !found; i++) { + htmlfullfilename = (isHosted ? "" : HTML_DIRS[i]) + "/" + htmlfilename; std::fstream fin(htmlfullfilename.c_str(), std::fstream::in); if (fin.good()) { found = true; @@ -292,11 +300,11 @@ std::string CyParser::cgi_file_parsing(CyhookHandler *hh, } chdir(cwd); if (!found) { - printf("[CyParser] Y-cgi:template %s not found in\n", - htmlfilename.c_str()); - for (unsigned int i = 0; i < HTML_DIR_COUNT; i++) { - printf("%s\n", HTML_DIRS[i].c_str()); - } + printf("[CyParser] Y-cgi:template %s not found %s\n", htmlfilename.c_str(), isHosted ? "" : "in"); + if (!isHosted) + for (unsigned int i = 0; i < HTML_DIR_COUNT; i++) { + printf("%s\n", HTML_DIRS[i].c_str()); + } } return yresult; } diff --git a/src/system/flashtool.cpp b/src/system/flashtool.cpp index b6fb4bb40..f79227351 100644 --- a/src/system/flashtool.cpp +++ b/src/system/flashtool.cpp @@ -583,22 +583,30 @@ std::string CMTDInfo::getMTDName(const int pos) { // TODO: check /proc/mtd specification to determine mtdname encoding - return FILESYSTEM_ENCODING_TO_UTF8_STRING(mtdData[pos]->name); + if (pos >= 0) + return FILESYSTEM_ENCODING_TO_UTF8_STRING(mtdData[pos]->name); + return ""; } std::string CMTDInfo::getMTDFileName(const int pos) { - return mtdData[pos]->filename; + if (pos >= 0) + return mtdData[pos]->filename; + return ""; } int CMTDInfo::getMTDSize(const int pos) { - return mtdData[pos]->size; + if (pos >= 0) + return mtdData[pos]->size; + return 0; } int CMTDInfo::getMTDEraseSize(const int pos) { - return mtdData[pos]->erasesize; + if (pos >= 0) + return mtdData[pos]->erasesize; + return 0; } int CMTDInfo::findMTDNumber(const std::string & filename) @@ -630,7 +638,11 @@ int CMTDInfo::getMTDEraseSize( const std::string & filename ) std::string CMTDInfo::findMTDsystem() { +#ifdef BOXMODEL_APOLLO + std::string sysfs = "root0"; +#else std::string sysfs = "systemFS"; +#endif for(int i = 0; i < getMTDCount(); i++) { if(getMTDName(i) == sysfs) { diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index d7dc12781..741d9bfb3 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -284,6 +284,24 @@ bool get_mem_usage(unsigned long &kbtotal, unsigned long &kbfree) return true; } +std::string getPathName(std::string &path) +{ + size_t pos = path.find_last_of("/"); + if (pos == std::string::npos) + return path; + return path.substr(0, pos); +} + +std::string getBaseName(std::string &path) +{ + size_t pos = path.find_last_of("/"); + if (pos == std::string::npos) + return path; + if (path.length() == pos +1) + return ""; + return path.substr(pos+1); +} + 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); diff --git a/src/system/helpers.h b/src/system/helpers.h index a811edab8..70db9525b 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -22,6 +22,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include + int my_system(const char * cmd); int my_system(int argc, const char *arg, ...); /* argc is number of arguments including command */ @@ -34,6 +36,8 @@ int check_dir(const char * dir); bool get_fs_usage(const char * dir, long &total, long &used, long *bsize=NULL); bool get_mem_usage(unsigned long &total, unsigned long &free); +std::string getPathName(std::string &path); +std::string getBaseName(std::string &path); std::string trim(std::string &str, const std::string &trimChars = " \n\r\t"); class CFileHelpers diff --git a/src/system/locals.h b/src/system/locals.h index e9aff93c9..6137d73fd 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1386,6 +1386,7 @@ typedef enum LOCALE_MOVIEBROWSER_USE_DIR, LOCALE_MOVIEBROWSER_USE_MOVIE_DIR, LOCALE_MOVIEBROWSER_USE_REC_DIR, + LOCALE_MOVIEBROWSER_YT_CONCURRENT_CONNECTIONS, LOCALE_MOVIEBROWSER_YT_ERROR, LOCALE_MOVIEBROWSER_YT_MAX_RESULTS, LOCALE_MOVIEBROWSER_YT_MOST_DISCUSSED, @@ -1395,6 +1396,7 @@ typedef enum LOCALE_MOVIEBROWSER_YT_MOST_SHARED, LOCALE_MOVIEBROWSER_YT_NEXT_RESULTS, LOCALE_MOVIEBROWSER_YT_ON_THE_WEB, + LOCALE_MOVIEBROWSER_YT_PREF_QUALITY, LOCALE_MOVIEBROWSER_YT_PREV_RESULTS, LOCALE_MOVIEBROWSER_YT_RECENTLY_FEATURED, LOCALE_MOVIEBROWSER_YT_REGION, @@ -1603,6 +1605,9 @@ typedef enum LOCALE_RECORDING_IS_RUNNING, LOCALE_RECORDING_START, LOCALE_RECORDING_STOP, + LOCALE_RECORDING_TIME_HOUR, + LOCALE_RECORDING_TIME_HOURS, + LOCALE_RECORDING_TIME_MIN, LOCALE_RECORDINGMENU_APIDS, LOCALE_RECORDINGMENU_APIDS_AC3, LOCALE_RECORDINGMENU_APIDS_ALT, @@ -1962,6 +1967,11 @@ typedef enum LOCALE_VIDEOMENU_VIDEOMODE, LOCALE_WIZARD_INITIAL_SETTINGS, LOCALE_WIZARD_INSTALL_SETTINGS, + LOCALE_WIZARD_SETUP, + LOCALE_WIZARD_SETUP_ADVANCED, + LOCALE_WIZARD_SETUP_EASY, + LOCALE_WIZARD_SETUP_TYPE, + LOCALE_WIZARD_SETUP_TYPE_HINT, LOCALE_WIZARD_WELCOME_HEAD, LOCALE_WIZARD_WELCOME_TEXT, LOCALE_WORD_FROM, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 84e7587ee..3cfb6d9d4 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1386,6 +1386,7 @@ const char * locale_real_names[] = "moviebrowser.use_dir", "moviebrowser.use_movie_dir", "moviebrowser.use_rec_dir", + "moviebrowser.yt_concurrent_connections", "moviebrowser.yt_error", "moviebrowser.yt_max_results", "moviebrowser.yt_most_discussed", @@ -1395,6 +1396,7 @@ const char * locale_real_names[] = "moviebrowser.yt_most_shared", "moviebrowser.yt_next_results", "moviebrowser.yt_on_the_web", + "moviebrowser.yt_pref_quality", "moviebrowser.yt_prev_results", "moviebrowser.yt_recently_featured", "moviebrowser.yt_region", @@ -1603,6 +1605,9 @@ const char * locale_real_names[] = "recording.is_running", "recording.start", "recording.stop", + "recording.time_hour", + "recording.time_hours", + "recording.time_min", "recordingmenu.apids", "recordingmenu.apids_ac3", "recordingmenu.apids_alt", @@ -1962,6 +1967,11 @@ const char * locale_real_names[] = "videomenu.videomode", "wizard.initial_settings", "wizard.install_settings", + "wizard.setup", + "wizard.setup_advanced", + "wizard.setup_easy", + "wizard.setup_type", + "wizard.setup_type_hint", "wizard.welcome_head", "wizard.welcome_text", "word.from", diff --git a/src/system/set_threadname.h b/src/system/set_threadname.h new file mode 100644 index 000000000..587b8c4f9 --- /dev/null +++ b/src/system/set_threadname.h @@ -0,0 +1,14 @@ +#ifndef __set_threadname_h__ +#define __set_threadname_h__ +#include +#include +#include + +inline void set_threadname(const char *name) +{ + char threadname[17]; + strncpy(threadname, name, sizeof(threadname)); + threadname[16] = 0; + prctl (PR_SET_NAME, (unsigned long)&threadname); +} +#endif diff --git a/src/system/ytparser.cpp b/src/system/ytparser.cpp index 012684e77..3e9eb1d46 100644 --- a/src/system/ytparser.cpp +++ b/src/system/ytparser.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -29,6 +30,9 @@ #include #include +#include +#include "set_threadname.h" + #include "ytparser.h" #if LIBCURL_VERSION_NUM < 0x071507 @@ -59,19 +63,26 @@ void cYTVideoInfo::Dump() printf("===================================================================\n"); } -std::string cYTVideoInfo::GetUrl(int fmt) +std::string cYTVideoInfo::GetUrl(int fmt, bool mandatory) { yt_urlmap_iterator_t it; if (fmt) { if ((it = formats.find(fmt)) != formats.end()) return it->second.GetUrl(); - return ""; + if (mandatory) + return ""; } - if ((it = formats.find(37)) != formats.end()) + if ((it = formats.find(37)) != formats.end()) // 1080p MP4 return it->second.GetUrl(); - if ((it = formats.find(22)) != formats.end()) + if ((it = formats.find(22)) != formats.end()) // 720p MP4 return it->second.GetUrl(); - if ((it = formats.find(18)) != formats.end()) +#if 0 + if ((it = formats.find(35)) != formats.end()) // 480p FLV + return it->second.GetUrl(); + if ((it = formats.find(34)) != formats.end()) // 360p FLV + return it->second.GetUrl(); +#endif + if ((it = formats.find(18)) != formats.end()) // 270p/360p MP4 return it->second.GetUrl(); return ""; } @@ -83,36 +94,41 @@ cYTFeedParser::cYTFeedParser() feedmode = -1; tquality = "mqdefault"; max_results = 25; + concurrent_downloads = 2; + curl_handle = curl_easy_init(); } cYTFeedParser::~cYTFeedParser() { + curl_easy_cleanup(curl_handle); } size_t cYTFeedParser::CurlWriteToString(void *ptr, size_t size, size_t nmemb, void *data) { - std::string* pStr = (std::string*) data; - pStr->append((char*) ptr, nmemb); + if (size * nmemb > 0) { + std::string* pStr = (std::string*) data; + pStr->append((char*) ptr, nmemb); + } return size*nmemb; } -bool cYTFeedParser::getUrl(std::string &url, std::string &answer) +bool cYTFeedParser::getUrl(std::string &url, std::string &answer, CURL *_curl_handle) { - CURL * curl_handle = curl_easy_init(); - curl_easy_setopt(curl_handle, CURLOPT_URL, url.c_str()); - curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, &cYTFeedParser::CurlWriteToString); - curl_easy_setopt(curl_handle, CURLOPT_FILE, (void *)&answer); - curl_easy_setopt(curl_handle, CURLOPT_FAILONERROR, 1); - curl_easy_setopt(curl_handle, CURLOPT_TIMEOUT, URL_TIMEOUT); - curl_easy_setopt(curl_handle, CURLOPT_NOSIGNAL, (long)1); + if (!_curl_handle) + _curl_handle = curl_handle; + + curl_easy_setopt(_curl_handle, CURLOPT_URL, url.c_str()); + curl_easy_setopt(_curl_handle, CURLOPT_WRITEFUNCTION, &cYTFeedParser::CurlWriteToString); + curl_easy_setopt(_curl_handle, CURLOPT_FILE, (void *)&answer); + curl_easy_setopt(_curl_handle, CURLOPT_FAILONERROR, 1); + curl_easy_setopt(_curl_handle, CURLOPT_TIMEOUT, URL_TIMEOUT); + curl_easy_setopt(_curl_handle, CURLOPT_NOSIGNAL, (long)1); char cerror[CURL_ERROR_SIZE]; - curl_easy_setopt(curl_handle, CURLOPT_ERRORBUFFER, cerror); + curl_easy_setopt(_curl_handle, CURLOPT_ERRORBUFFER, cerror); printf("try to get [%s] ...\n", url.c_str()); - CURLcode httpres = curl_easy_perform(curl_handle); - - curl_easy_cleanup(curl_handle); + CURLcode httpres = curl_easy_perform(_curl_handle); printf("http: res %d size %d\n", httpres, answer.size()); @@ -123,32 +139,34 @@ bool cYTFeedParser::getUrl(std::string &url, std::string &answer) return true; } -bool cYTFeedParser::DownloadUrl(std::string &url, std::string &file) +bool cYTFeedParser::DownloadUrl(std::string &url, std::string &file, CURL *_curl_handle) { + if (!_curl_handle) + _curl_handle = curl_handle; + FILE * fp = fopen(file.c_str(), "wb"); if (fp == NULL) { perror(file.c_str()); return false; } - CURL * curl_handle = curl_easy_init(); - curl_easy_setopt(curl_handle, CURLOPT_URL, url.c_str()); - curl_easy_setopt(curl_handle, CURLOPT_FILE, fp); - curl_easy_setopt(curl_handle, CURLOPT_FAILONERROR, 1); - curl_easy_setopt(curl_handle, CURLOPT_TIMEOUT, URL_TIMEOUT); - curl_easy_setopt(curl_handle, CURLOPT_NOSIGNAL, (long)1); + curl_easy_setopt(_curl_handle, CURLOPT_URL, url.c_str()); + curl_easy_setopt(_curl_handle, CURLOPT_WRITEFUNCTION, NULL); + curl_easy_setopt(_curl_handle, CURLOPT_FILE, fp); + curl_easy_setopt(_curl_handle, CURLOPT_FAILONERROR, 1); + curl_easy_setopt(_curl_handle, CURLOPT_TIMEOUT, URL_TIMEOUT); + curl_easy_setopt(_curl_handle, CURLOPT_NOSIGNAL, (long)1); char cerror[CURL_ERROR_SIZE]; - curl_easy_setopt(curl_handle, CURLOPT_ERRORBUFFER, cerror); + curl_easy_setopt(_curl_handle, CURLOPT_ERRORBUFFER, cerror); printf("try to get [%s] ...\n", url.c_str()); - CURLcode httpres = curl_easy_perform(curl_handle); + CURLcode httpres = curl_easy_perform(_curl_handle); double dsize; - curl_easy_getinfo(curl_handle, CURLINFO_SIZE_DOWNLOAD, &dsize); - curl_easy_cleanup(curl_handle); + curl_easy_getinfo(_curl_handle, CURLINFO_SIZE_DOWNLOAD, &dsize); fclose(fp); - printf("http: res %d size %f.\n", httpres, dsize); + printf("http: res %d size %g.\n", httpres, dsize); if (httpres != 0) { printf("curl error: %s\n", cerror); @@ -160,9 +178,7 @@ bool cYTFeedParser::DownloadUrl(std::string &url, std::string &file) void cYTFeedParser::decodeUrl(std::string &url) { - CURL * curl_handle = curl_easy_init(); char * str = curl_easy_unescape(curl_handle, url.c_str(), 0, NULL); - curl_easy_cleanup(curl_handle); if(str) url = str; curl_free(str); @@ -170,9 +186,7 @@ void cYTFeedParser::decodeUrl(std::string &url) void cYTFeedParser::encodeUrl(std::string &txt) { - CURL * curl_handle = curl_easy_init(); char * str = curl_easy_escape(curl_handle, txt.c_str(), txt.length()); - curl_easy_cleanup(curl_handle); if(str) txt = str; curl_free(str); @@ -357,12 +371,22 @@ bool cYTFeedParser::parseFeedXml(std::string &answer) /* save first one, if wanted not found */ if (vinfo.thumbnail.empty()) vinfo.thumbnail = thumbnail; - if (ParseVideoInfo(vinfo)) - videos.push_back(vinfo); + vinfo.ret = false; + videos.push_back(vinfo); } entry = entry->xmlNextNode; } xmlFreeDoc(answer_parser); + + GetVideoUrls(); + + std::vector::iterator pos = videos.begin(); + while (pos != videos.end()) + if ((*pos).ret) + ++pos; + else + pos = videos.erase(pos); + parsed = !videos.empty(); return parsed; } @@ -529,7 +553,7 @@ bool cYTFeedParser::ParseFeed(yt_feed_mode_t mode, std::string search, std::stri return ParseFeed(url); } -bool cYTFeedParser::ParseVideoInfo(cYTVideoInfo &vinfo) +bool cYTFeedParser::ParseVideoInfo(cYTVideoInfo &vinfo, CURL *_curl_handle) { bool ret = false; std::vector estr; @@ -544,44 +568,98 @@ bool cYTFeedParser::ParseVideoInfo(cYTVideoInfo &vinfo) vurl += "&ps=default&eurl=&gl=US&hl=en"; printf("cYTFeedParser::ParseVideoInfo: get [%s]\n", vurl.c_str()); std::string answer; - if (!getUrl(vurl, answer)) + if (!getUrl(vurl, answer, _curl_handle)) continue; ret = decodeVideoInfo(answer, vinfo); if (ret) break; } + vinfo.ret = ret; return ret; } +void *cYTFeedParser::DownloadThumbnailsThread(void *arg) +{ + set_threadname("YT::DownloadThumbnails"); + bool ret = true; + cYTFeedParser *caller = (cYTFeedParser *)arg; + CURL *c = curl_easy_init(); + unsigned int i; + do { + OpenThreads::ScopedLock m_lock(caller->mutex); + i = caller->worker_index++; + } while (i < caller->videos.size() && ((ret &= caller->DownloadThumbnail(caller->videos[i], c)) || true)); + curl_easy_cleanup(c); + pthread_exit(&ret); +} + +bool cYTFeedParser::DownloadThumbnail(cYTVideoInfo &vinfo, CURL *_curl_handle) +{ + if (!_curl_handle) + _curl_handle = curl_handle; + bool found = false; + if (!vinfo.thumbnail.empty()) { + std::string fname = thumbnail_dir + "/" + vinfo.id + ".jpg"; + found = !access(fname.c_str(), F_OK); + if (!found) + found = DownloadUrl(vinfo.thumbnail, fname, _curl_handle); + if (found) + vinfo.tfile = fname; + } + return found; +} + bool cYTFeedParser::DownloadThumbnails() { - bool ret = false; - if (mkdir(thumbnail_dir.c_str(), 0755)) { + bool ret = true; + if (mkdir(thumbnail_dir.c_str(), 0755) && errno != EEXIST) { perror(thumbnail_dir.c_str()); - //return ret; + return false; } - for (unsigned i = 0; i < videos.size(); i++) { - if (!videos[i].thumbnail.empty()) { - std::string fname = thumbnail_dir; - fname += "/"; - fname += videos[i].id; - fname += ".jpg"; - bool found = !access(fname.c_str(), F_OK); - if (!found) - found = DownloadUrl(videos[i].thumbnail, fname); - if (found) - videos[i].tfile = fname; - ret |= found; - } + unsigned int max_threads = concurrent_downloads; + if (videos.size() < max_threads) + max_threads = videos.size(); + pthread_t ta[max_threads]; + worker_index = 0; + for (unsigned i = 0; i < max_threads; i++) + pthread_create(&ta[i], NULL, cYTFeedParser::DownloadThumbnailsThread, this); + for (unsigned i = 0; i < max_threads; i++) { + void *r; + pthread_join(ta[i], &r); + ret &= *((bool *)r); } return ret; } +void *cYTFeedParser::GetVideoUrlsThread(void *arg) +{ + set_threadname("YT::GetVideoUrls"); + int ret = 0; + cYTFeedParser *caller = (cYTFeedParser *)arg; + CURL *c = curl_easy_init(); + unsigned int i; + do { + OpenThreads::ScopedLock m_lock(caller->mutex); + i = caller->worker_index++; + } while (i < caller->videos.size() && ((ret |= caller->ParseVideoInfo(caller->videos[i], c)) || true)); + curl_easy_cleanup(c); + pthread_exit(&ret); +} + bool cYTFeedParser::GetVideoUrls() { - bool ret = false; - for (unsigned i = 0; i < videos.size(); i++) { - ret |= ParseVideoInfo(videos[i]); + int ret = 0; + unsigned int max_threads = concurrent_downloads; + if (videos.size() < max_threads) + max_threads = videos.size(); + pthread_t ta[max_threads]; + worker_index = 0; + for (unsigned i = 0; i < max_threads; i++) + pthread_create(&ta[i], NULL, cYTFeedParser::GetVideoUrlsThread, this); + for (unsigned i = 0; i < max_threads; i++) { + void *r; + pthread_join(ta[i], &r); + ret |= *((int *)r); } return ret; } diff --git a/src/system/ytparser.h b/src/system/ytparser.h index 8978f7ef0..fb97d65d1 100644 --- a/src/system/ytparser.h +++ b/src/system/ytparser.h @@ -28,6 +28,9 @@ #include #include +#include +#include + class cYTVideoUrl { public: @@ -56,9 +59,10 @@ class cYTVideoInfo std::string published; int duration; yt_urlmap_t formats; + bool ret; void Dump(); - std::string GetUrl(int fmt = 0); + std::string GetUrl(int fmt = 0, bool mandatory = true); }; @@ -80,6 +84,7 @@ class cYTFeedParser int feedmode; int max_results; + int concurrent_downloads; bool parsed; yt_video_list_t videos; @@ -87,14 +92,20 @@ class cYTFeedParser std::string getXmlAttr(xmlNodePtr node, const char * attr); std::string getXmlData(xmlNodePtr node); + CURL *curl_handle; + OpenThreads::Mutex mutex; + int worker_index; + static void* GetVideoUrlsThread(void*); + static void* DownloadThumbnailsThread(void*); + static size_t CurlWriteToString(void *ptr, size_t size, size_t nmemb, void *data); - static void encodeUrl(std::string &txt); - static void decodeUrl(std::string &url); + void encodeUrl(std::string &txt); + void decodeUrl(std::string &url); static void splitString(std::string &str, std::string delim, std::vector &strlist, int start = 0); static void splitString(std::string &str, std::string delim, std::map &strmap, int start = 0); static bool saveToFile(const char * name, std::string str); - bool getUrl(std::string &url, std::string &answer); - bool DownloadUrl(std::string &url, std::string &file); + bool getUrl(std::string &url, std::string &answer, CURL *_curl_handle = NULL); + bool DownloadUrl(std::string &url, std::string &file, CURL *_curl_handle = NULL); bool parseFeedXml(std::string &answer); bool decodeVideoInfo(std::string &answer, cYTVideoInfo &vinfo); bool supportedFormat(int fmt); @@ -122,7 +133,8 @@ class cYTFeedParser ~cYTFeedParser(); bool ParseFeed(yt_feed_mode_t mode = MOST_POPULAR, std::string search = "", std::string vid = ""); - bool ParseVideoInfo(cYTVideoInfo &vinfo); + bool ParseVideoInfo(cYTVideoInfo &vinfo, CURL *_curl_handle = NULL); + bool DownloadThumbnail(cYTVideoInfo &vinfo, CURL *_curl_handle = NULL); bool GetVideoUrls(); bool DownloadThumbnails(); void Dump(); @@ -138,6 +150,7 @@ class cYTFeedParser void SetRegion(std::string reg) { region = reg; } void SetMaxResults(int count) { max_results = count; } + void SetConcurrentDownloads(int count) { concurrent_downloads = count; } }; #endif diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index d160e2fd6..86f95f27e 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -474,19 +474,26 @@ void CServiceManager::FindTransponder(xmlNodePtr search) while (search) { fe_type_t delsys = FE_QPSK; - if (!(strcmp(xmlGetName(search), "cable"))) + t_satellite_position satellitePosition = xmlGetSignedNumericAttribute(search, "position", 10); + if (!(strcmp(xmlGetName(search), "cable"))) { delsys = FE_QAM; - else if (!strcmp(xmlGetName(search), "terrestrial")) + char * name = xmlGetAttribute(search, "name"); + satellitePosition = GetSatellitePosition(name); + } + else if (!strcmp(xmlGetName(search), "terrestrial")) { delsys = FE_OFDM; + char * name = xmlGetAttribute(search, "name"); + satellitePosition = GetSatellitePosition(name); + } else if ((strcmp(xmlGetName(search), "sat"))) { search = search->xmlNextNode; continue; } - +#if 0 //t_satellite_position satellitePosition = xmlGetSignedNumericAttribute(search, "position", 10); char * name = xmlGetAttribute(search, "name"); t_satellite_position satellitePosition = GetSatellitePosition(name); - +#endif DBG("going to parse dvb-%c provider %s\n", xmlGetName(search)[0], xmlGetAttribute(search, "name")); ParseTransponders(search->xmlChildrenNode, satellitePosition, delsys); newfound++;