diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index dd5958170..adb9f8b1a 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -256,16 +256,16 @@ colorchooser.green grün colorchooser.red rot colormenu.background Hintergrundfarbe colormenu.contrast_fonts Schriftkontrast -colormenu.fade Menüs faden +colormenu.fade Ein-/Ausblenden colormenu.font Neutrino Schriftart colormenu.font_ttx Teletext Schriftart colormenu.hd_preset LCD -colormenu.menucolors Menüfarben +colormenu.menucolors Farben colormenu.osd_preset Monitor Auswahl colormenu.sd_preset CRT colormenu.textcolor Textfarbe colormenu.themeselect Theme auswählen -colormenu.timing OSD Timeouts +colormenu.timing Timeouts colormenusetup.menucontent Fensterinhalt colormenusetup.menucontent_inactive Fensterinhalt deaktiviert colormenusetup.menucontent_selected Fensterinhalt selektiert @@ -312,11 +312,16 @@ epgextended.year_of_production Produktionsjahr epglist.noevents Keine EPG-Information verfügbar. epgviewer.More_Screenings Weitere Termine auf diesem Kanal epgviewer.More_Screenings_short Weitere Termine +epgviewer.age_rating Altersfreigabe +epgviewer.audio Audio +epgviewer.genre Genre +epgviewer.length Spieldauer (Min.) epgviewer.nodetailed Keine ausführlichen Informationen verfügbar epgviewer.notfound Keine Programminformationen (EPG) gefunden eventfinder.head EPG-Suche eventfinder.keyword Suche nach Textpassage eventfinder.search Suche +eventfinder.search_all_epg Ganze eventfinder.search_within_epg Suche innerhalb EPG-Daten eventfinder.search_within_list Suche innerhalb Text eventfinder.searching Suche... @@ -779,7 +784,7 @@ menu.hint_eventlist_fonts Ändern Sie die Schriftgröße in der Event-Liste menu.hint_eventlist_setup Wählen Sie die Anzeigeoptionen für die Event-Liste menu.hint_extended Energiespar-, EPG-Speicher- und Lade-Optionen, HDMI-CEC, Startkanal und mehr menu.hint_factory Zurücksetzen der Box auf Werkseinstellungen.\nDie Box wird danach neu gestartet -menu.hint_fade Bei aktivierter Funktion werden die Menüfenster 'weich' ein- bzw. ausgeblendet +menu.hint_fade Bei aktivierter Funktion werden die GUI-Fenster 'weich' ein- bzw. ausgeblendet menu.hint_fan_speed Steuerung der Lüftergeschwindigkeit für die CPU menu.hint_fe_type Ändert die Empfangsart\n(Neustart notwendig) menu.hint_filebrowser_denydirectoryleave Verhindert das Verlassen des Startverzeichnisses @@ -893,6 +898,7 @@ menu.hint_media Abspielen von Musik, Internetradio und Filmen; Betrachten Sie Bi menu.hint_menu_fonts Ändern Sie die Schriftgrößen im Menü menu.hint_menu_hints Zeigt Ihnen Hinweise zu den Menüpunkten an. Sie erreichen das auch jederzeit mit der Taste 'Hilfe' menu.hint_menu_pos Legen Sie die Anzeigeposition der Menüs fest +menu.hint_menus Wählen Sie die Anzeigeoptionen für die Menüs menu.hint_misc_cec HDMI-CEC Optionen menu.hint_misc_channellist Erweiterte Einstellungen für die Kanallisten und Zapping-Einstellungen menu.hint_misc_energy Energieverbrauchs- und Standby-Optionen, verzögertes Ausschalten, setzen bzw. ändern des Inaktivitätstimers @@ -1077,7 +1083,7 @@ menu.hint_softupdate_expert_write Einzelne Partitionen (Splash, Kernel, SystemFS menu.hint_softupdate_settings Das lokale Update-Verzeichnis und die Konfigurationsdatei festlegen menu.hint_start_tostandby Aktiviert den Standby-Modus direkt nach dem Starten der Box menu.hint_streaminfo Aktuelle Sender-Informationen über PIDs, SNR-Verhältnis, Bitrate und mehr -menu.hint_subchannel_pos Wählen Sie die Anzeigeposition der Untertitel aus +menu.hint_subchannel_pos Wählen Sie die Anzeigeposition der Unterkanäle aus menu.hint_sw_update Neutrino-HD aktualisieren, Image sichern und wiederherstellen menu.hint_theme Wählen Sie ein vordefiniertes Farbschema, speichern oder laden Sie ihre eigenen Farbschemata menu.hint_timeouts Gibt an, nach welcher Zeit in Sekunden die Menüs oder Infofenster sich automatisch schließen (0 deaktiviert) @@ -1108,6 +1114,7 @@ menu.hint_video_modes Definiert, welche Videosysteme mit der VF-Taste der Fernbe menu.hint_video_pip Bild in Bild Größe und Position menu.hint_video_saturation Change picture saturation menu.hint_video_scart_mode Wählen Sie den Modus des Ausgangssignals für den SCART-Anschluss +menu.hint_volume Wählen Sie die Anzeigeoptionen für die Lautstärke menu.hint_volume_digits Zifferndarstellung der Lautstärkeanzeige ein- oder ausschalten menu.hint_volume_pos Wählen Sie die Position der Lautstärkeanzeige aus menu.hint_zap_cycle Wählen Sie, ob nur innerhalb des aktiven Bouquets umgeschaltet werden kann @@ -1187,6 +1194,7 @@ miscsettings.shutdown_count_hint2 den Deep-Standby geschalten wird (0 = aus) miscsettings.shutdown_real Standbymodus miscsettings.shutdown_real_rcdelay Verzögertes Ausschalten miscsettings.sleeptimer Ausschalten nach Inaktivität +miscsettings.volume Lautstärke miscsettings.zapto_pre_time Umschaltstart-Vorlaufzeit (Minuten) motorcontrol.calc_positions Positionen (Neu)-Berechne(n)) motorcontrol.disable_limit Deaktiviere (soft) Limit @@ -1701,14 +1709,16 @@ servicemenu.update Software-Aktualisierung settings.backup Image-Einstellungen: Sichern settings.backup_failed Sicherung fehlgeschlagen! settings.help Hilfe -settings.menu_hints Menühinweise anzeigen -settings.menu_pos Menüposition +settings.menu_hints Hinweise anzeigen +settings.menu_pos Position +settings.menus Menüs settings.missingoptionsconffile Die Neutrino Einstellungen wurden erweitert.\nDie neuen Werte werden auf Standard gesetzt. settings.noconffile Die Neutrino Einstellungen wurden nicht\ngefunden. Es werden Standardwerte benutzt. +settings.pos_bottom_center unten zentriert settings.pos_bottom_left unten links settings.pos_bottom_right unten rechts -settings.pos_default_center oben Mitte -settings.pos_higher_center unten Mitte +settings.pos_default_center zentriert +settings.pos_top_center oben zentriert settings.pos_top_left oben links settings.pos_top_right oben rechts settings.restore Image-Einstellungen: Wiederherstellen diff --git a/data/locale/english.locale b/data/locale/english.locale index fdd7c501c..fec5ba572 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -256,7 +256,7 @@ colorchooser.green green colorchooser.red red colormenu.background Background colormenu.contrast_fonts Contrast fonts -colormenu.fade Fade menus +colormenu.fade Fade GUI colormenu.font Select GUI font colormenu.font_ttx Select Teletext font colormenu.hd_preset LCD @@ -265,7 +265,7 @@ colormenu.osd_preset TV preset colormenu.sd_preset CRT colormenu.textcolor Text color colormenu.themeselect Select theme -colormenu.timing OSD Timeouts +colormenu.timing Timeouts colormenusetup.menucontent Content colormenusetup.menucontent_inactive Content inactive colormenusetup.menucontent_selected Content selected @@ -312,11 +312,16 @@ epgextended.year_of_production Year of Production epglist.noevents EPG is not available... epgviewer.More_Screenings More Screenings on this Channel epgviewer.More_Screenings_short More Screenings +epgviewer.age_rating Age rating +epgviewer.audio Audio +epgviewer.genre Genre +epgviewer.length Length (min.) epgviewer.nodetailed No detailed informations available epgviewer.notfound No EPG found eventfinder.head Search in EPG eventfinder.keyword Keyword eventfinder.search Search +eventfinder.search_all_epg whole eventfinder.search_within_epg Search within eventfinder.search_within_list Search within eventfinder.searching Search for keyword in EPG... @@ -893,6 +898,7 @@ menu.hint_media Play movies, audio files\nWatch pictures menu.hint_menu_fonts Change menu font sizes menu.hint_menu_hints Show this hints. Also you can switch\nit any time using 'help' button menu.hint_menu_pos Select menu position +menu.hint_menus Configure menu options menu.hint_misc_cec HDMI-CEC Options menu.hint_misc_channellist HD/New/Removed channel lists\nZap cycle menu.hint_misc_energy Enable soft-standby, delayed shutdown\ninactivity timers @@ -1108,6 +1114,7 @@ menu.hint_video_modes VF key will cycle between enabled modes menu.hint_video_pip Picture in picture size and position menu.hint_video_saturation Change picture saturation menu.hint_video_scart_mode Select analog output mode for SCART connectors +menu.hint_volume Configure Volume GUI options menu.hint_volume_digits Numeric display of the volumebar on/off menu.hint_volume_pos Select volume indicator position menu.hint_zap_cycle When swithing channels, stay in current bouquet @@ -1187,6 +1194,7 @@ miscsettings.shutdown_count_hint2 to deep standby (0 = off). miscsettings.shutdown_real Enable standby miscsettings.shutdown_real_rcdelay Delayed shutdown miscsettings.sleeptimer Inactivity shutdown timer +miscsettings.volume Volume miscsettings.zapto_pre_time Zapto Start Time Correction (minutes) motorcontrol.calc_positions (Re)-Calculate Positions motorcontrol.disable_limit Disable (soft) Limits @@ -1703,12 +1711,14 @@ settings.backup_failed Backup failed! settings.help Help settings.menu_hints Show menu hints settings.menu_pos Menu position +settings.menus Menus settings.missingoptionsconffile The Neutrino settings have been updated.\nNew Options will be set to default. settings.noconffile No Neutrino settings found.\nUsing defaults. +settings.pos_bottom_center bottom center settings.pos_bottom_left bottom left settings.pos_bottom_right bottom right -settings.pos_default_center top center -settings.pos_higher_center higher center +settings.pos_default_center center +settings.pos_top_center top center settings.pos_top_left top left settings.pos_top_right top right settings.restore Image-Settings: Restore diff --git a/src/driver/audiodec/basedec.cpp b/src/driver/audiodec/basedec.cpp index 08dfed926..c38752464 100644 --- a/src/driver/audiodec/basedec.cpp +++ b/src/driver/audiodec/basedec.cpp @@ -191,7 +191,8 @@ bool CBaseDec::GetMetaDataBase(CAudiofile* const in, const bool nice) #ifdef ENABLE_FLAC else if (in->FileType == CFile::FILE_FLAC) { - Status = CFlacDec::getInstance()->GetMetaData(fp, nice, &in->MetaData); + CFlacDec FlacDec; + Status = FlacDec.GetMetaData(fp, nice, &in->MetaData); } #endif if ( fclose( fp ) == EOF ) diff --git a/src/driver/fontrenderer.cpp b/src/driver/fontrenderer.cpp index 8a3927e00..e4de0cc70 100644 --- a/src/driver/fontrenderer.cpp +++ b/src/driver/fontrenderer.cpp @@ -372,6 +372,8 @@ void Font::RenderString(int x, int y, const int width, const char *text, const u if (!frameBuffer->getActive()) return; + frameBuffer->checkFbArea(x, y-height, width, height, true); + pthread_mutex_lock( &renderer->render_mutex ); FT_Error err = FTC_Manager_LookupSize(renderer->cacheManager, &scaler, &size); @@ -441,7 +443,7 @@ void Font::RenderString(int x, int y, const int width, const char *text, const u /* the GXA seems to do it's job asynchonously, so we need to wait until it's ready, otherwise the font will sometimes "be overwritten" with background color or bgcolor will be wrong */ - frameBuffer->waitForIdle(); + frameBuffer->waitForIdle("Font::RenderString"); #endif /* fetch bgcolor from framebuffer, using lower left edge of the font... */ fb_pixel_t bgcolor = *(frameBuffer->getFrameBufferPointer() + x + @@ -620,6 +622,7 @@ void Font::RenderString(int x, int y, const int width, const char *text, const u } //printf("RenderStat: %d %d %d \n", renderer->cacheManager->num_nodes, renderer->cacheManager->num_bytes, renderer->cacheManager->max_bytes); pthread_mutex_unlock( &renderer->render_mutex ); + frameBuffer->checkFbArea(x, y-height, width, height, false); /* x is the rightmost position of the last drawn character */ frameBuffer->mark(left, y + lower - height, x, y + lower); } diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index e5230a0e3..2e52808d1 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -4,21 +4,27 @@ Copyright (C) 2001 Steffen Hehn 'McClean' 2003 thegoodguy + mute icon handling from tuxbox project + Copyright (C) 2009 Stefan Seyfried + mute icon & info clock handling + Copyright (C) 2013 M. Liebmann (micha-bbg) + License: GPL - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + You should have received a copy of the GNU General Public + License along with this program; if not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -38,6 +44,7 @@ #include +#include #include #include #include @@ -138,7 +145,7 @@ void CFrameBuffer::add_gxa_sync_marker(void) } /* wait until the current marker comes out of the GXA command queue */ -void CFrameBuffer::waitForIdle(void) +void CFrameBuffer::waitForIdle(const char* func) { unsigned int cfg, count = 0; do { @@ -152,8 +159,12 @@ void CFrameBuffer::waitForIdle(void) //fprintf(stderr, "%s: read %02x, expected %02x\n", __FUNCTION__, cfg, _mark); } while(++count < 2048); /* don't deadlock here if there is an error */ - if (count > 512) /* more than 100 are unlikely, */ - fprintf(stderr, "CFrameBuffer::waitForIdle: count is big (%d)!\n", count); + if (count > 512) /* more than 100 are unlikely, */{ + if (func != NULL) + fprintf(stderr, "CFrameBuffer::waitForIdle: count is big (%04d) [%s]!\n", count, func); + else + fprintf(stderr, "CFrameBuffer::waitForIdle: count is big (%d)!\n", count); + } } #endif /* USE_NEVIS_GXA */ @@ -191,11 +202,20 @@ CFrameBuffer::CFrameBuffer() // TM_NONE: No 'pseudo' transparency // TM_INI: Transparency depends on g_settings.infobar_alpha ??? m_transparent = m_transparent_default; + q_circle = NULL; + initQCircle(); + corner_tl = false; + corner_tr = false; + corner_bl = false; + corner_br = false; //FIXME: test memset(red, 0, 256*sizeof(__u16)); memset(green, 0, 256*sizeof(__u16)); memset(blue, 0, 256*sizeof(__u16)); memset(trans, 0, 256*sizeof(__u16)); + fbAreaActiv = false; + fb_no_check = false; + do_paint_mute_icon = true; } CFrameBuffer* CFrameBuffer::getInstance() @@ -381,6 +401,11 @@ CFrameBuffer::~CFrameBuffer() backupBackground = NULL; } + if (q_circle) { + delete[] q_circle; + q_circle = NULL; + } + #if 0 #ifdef RETURN_FROM_GRAPHICS_MODE if (-1 == ioctl(tty,KDSETMODE, kd_mode)) @@ -402,6 +427,8 @@ CFrameBuffer::~CFrameBuffer() } close(fd); close(tty); + + v_fbarea.clear(); } int CFrameBuffer::getFileHandle() const @@ -430,15 +457,25 @@ unsigned int CFrameBuffer::getScreenHeight(bool real) return g_settings.screen_EndY - g_settings.screen_StartY; } -unsigned int CFrameBuffer::getScreenWidthRel() +unsigned int CFrameBuffer::getScreenPercentRel(bool force_small) { - // always reduce a possible detailline - return (g_settings.screen_EndX - g_settings.screen_StartX - 2*ConnectLineBox_Width) * (g_settings.big_windows ? 100 : NON_BIG_WINDOWS) / 100; + int percent = 100; + if (force_small || !g_settings.big_windows) + percent = NON_BIG_WINDOWS; + return percent; } -unsigned int CFrameBuffer::getScreenHeightRel() +unsigned int CFrameBuffer::getScreenWidthRel(bool force_small) { - return (g_settings.screen_EndY - g_settings.screen_StartY) * (g_settings.big_windows ? 100 : NON_BIG_WINDOWS) / 100; + int percent = getScreenPercentRel(force_small); + // always reduce a possible detailline + return (g_settings.screen_EndX - g_settings.screen_StartX - 2*ConnectLineBox_Width) * percent / 100; +} + +unsigned int CFrameBuffer::getScreenHeightRel(bool force_small) +{ + int percent = getScreenPercentRel(force_small); + return (g_settings.screen_EndY - g_settings.screen_StartY) * percent / 100; } unsigned int CFrameBuffer::getScreenX() @@ -638,97 +675,32 @@ void CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, const int return; if (dx == 0 || dy == 0) { - printf("paintBoxRel: radius %d, start x %d y %d end x %d y %d\n", radius, x, y, x+dx, y+dy); + printf("[%s - %d]: radius %d, start x %d y %d end x %d y %d\n", __FUNCTION__, __LINE__, radius, x, y, x+dx, y+dy); return; } + + checkFbArea(x, y, dx, dy, true); + #if defined(FB_HW_ACCELERATION) fb_fillrect fillrect; fillrect.color = col; fillrect.rop = ROP_COPY; #elif defined(USE_NEVIS_GXA) - OpenThreads::ScopedLock m_lock(mutex); + if (!fb_no_check) + OpenThreads::ScopedLock m_lock(mutex); /* solid fill with background color */ unsigned int cmd = GXA_CMD_BLT | GXA_CMD_NOT_TEXT | GXA_SRC_BMP_SEL(7) | GXA_DST_BMP_SEL(2) | GXA_PARAM_COUNT(2) | GXA_CMD_NOT_ALPHA; _write_gxa(gxa_base, GXA_BG_COLOR_REG, (unsigned int) col); /* setup the drawing color */ #endif - /* this table contains the x coordinates for a quarter circle (the bottom right quarter) with fixed - radius of 540 px which is the half of the max HD graphics size of 1080 px. So with that table we - ca draw boxes with round corners and als circles by just setting dx = dy = radius (max 540). */ - static const int q_circle[541] = { - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 539, 539, 539, 539, 539, 539, 539, 539, 539, 539, 539, 539, 539, 539, 539, 539, - 539, 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, 537, 537, 537, 537, 537, 537, 537, - 537, 537, 536, 536, 536, 536, 536, 536, 536, 536, 535, 535, 535, 535, 535, 535, 535, 535, 534, 534, - 534, 534, 534, 534, 533, 533, 533, 533, 533, 533, 532, 532, 532, 532, 532, 532, 531, 531, 531, 531, - 531, 531, 530, 530, 530, 530, 529, 529, 529, 529, 529, 529, 528, 528, 528, 528, 527, 527, 527, 527, - 527, 526, 526, 526, 526, 525, 525, 525, 525, 524, 524, 524, 524, 523, 523, 523, 523, 522, 522, 522, - 522, 521, 521, 521, 521, 520, 520, 520, 519, 519, 519, 518, 518, 518, 518, 517, 517, 517, 516, 516, - 516, 515, 515, 515, 515, 514, 514, 514, 513, 513, 513, 512, 512, 512, 511, 511, 511, 510, 510, 510, - 509, 509, 508, 508, 508, 507, 507, 507, 506, 506, 506, 505, 505, 504, 504, 504, 503, 503, 502, 502, - 502, 501, 501, 500, 500, 499, 499, 499, 498, 498, 498, 497, 497, 496, 496, 496, 495, 495, 494, 494, - 493, 493, 492, 492, 491, 491, 490, 490, 490, 489, 489, 488, 488, 487, 487, 486, 486, 485, 485, 484, - 484, 483, 483, 482, 482, 481, 481, 480, 480, 479, 479, 478, 478, 477, 477, 476, 476, 475, 475, 474, - 473, 473, 472, 472, 471, 471, 470, 470, 469, 468, 468, 467, 466, 466, 465, 465, 464, 464, 463, 462, - 462, 461, 460, 460, 459, 459, 458, 458, 457, 456, 455, 455, 454, 454, 453, 452, 452, 451, 450, 450, - 449, 449, 448, 447, 446, 446, 445, 445, 444, 443, 442, 441, 441, 440, 440, 439, 438, 437, 436, 436, - 435, 435, 434, 433, 432, 431, 431, 430, 429, 428, 427, 427, 426, 425, 425, 424, 423, 422, 421, 421, - 420, 419, 418, 417, 416, 416, 415, 414, 413, 412, 412, 411, 410, 409, 408, 407, 406, 405, 404, 403, - 403, 402, 401, 400, 399, 398, 397, 397, 395, 394, 393, 393, 392, 391, 390, 389, 388, 387, 386, 385, - 384, 383, 382, 381, 380, 379, 378, 377, 376, 375, 374, 373, 372, 371, 369, 368, 367, 367, 365, 364, - 363, 362, 361, 360, 358, 357, 356, 355, 354, 353, 352, 351, 350, 348, 347, 346, 345, 343, 342, 341, - 340, 339, 337, 336, 335, 334, 332, 331, 329, 328, 327, 326, 324, 323, 322, 321, 319, 317, 316, 315, - 314, 312, 310, 309, 308, 307, 305, 303, 302, 301, 299, 297, 296, 294, 293, 291, 289, 288, 287, 285, - 283, 281, 280, 278, 277, 275, 273, 271, 270, 268, 267, 265, 263, 261, 259, 258, 256, 254, 252, 250, - 248, 246, 244, 242, 240, 238, 236, 234, 232, 230, 228, 225, 223, 221, 219, 217, 215, 212, 210, 207, - 204, 202, 200, 197, 195, 192, 190, 187, 184, 181, 179, 176, 173, 170, 167, 164, 160, 157, 154, 150, - 147, 144, 140, 136, 132, 128, 124, 120, 115, 111, 105, 101, 95, 89, 83, 77, 69, 61, 52, 40, - 23}; - int line = 0; - if (type && radius) { - bool corner_tl = (type & CORNER_TOP_LEFT) == CORNER_TOP_LEFT; - bool corner_tr = (type & CORNER_TOP_RIGHT) == CORNER_TOP_RIGHT; - bool corner_bl = (type & CORNER_BOTTOM_LEFT) == CORNER_BOTTOM_LEFT; - bool corner_br = (type & CORNER_BOTTOM_RIGHT)== CORNER_BOTTOM_RIGHT; - int ofs, scf, scl, ofl, ofr; - /* just an multiplicator for all math to reduce rounding errors */ -#define MUL 32768 - - /* limit the radius */ - if (radius > dx) - radius = dx; - if (radius > dy) - radius = dy; - if (radius > 540) - radius = 540; - - scf = (540 * MUL) / ((radius < 1) ? 1 : radius); + setCornerFlags(type); + radius = limitRadius(dx, dy, radius); while (line < dy) { - ofl = ofr = 0; - - if (line < radius && (type & CORNER_TOP)) {/* one of the top corners */ - //printf("1: x %d y %d dx %d dy %d rad %d line %d\n", x, y, dx, dy, radius, line); - /* uper round corners */ - scl = scf * (radius - line) / MUL; - if ((scf * (radius - line) % MUL) >= (MUL / 2)) /* round up */ - scl++; - ofs = radius - (q_circle[scl] * MUL / scf); - // ofl = corner_tl * ofs; // might depend on the arch if multiply is faster or not - ofl = corner_tl ? ofs : 0; - ofr = corner_tr ? ofs : 0; - } else if ((line >= dy - radius) && (type & CORNER_BOTTOM)) { /* one of the bottom corners */ - //printf("2: x %d y %d dx %d dy %d rad %d line %d\n", x, y, dx, dy, radius, line); - /* lower round corners */ - scl = scf * (radius - (dy - (line + 1))) / MUL; - if ((scf * (radius - (dy - (line + 1))) % MUL) >= (MUL / 2)) /* round up */ - scl++; - ofs = radius - (q_circle[scl] * MUL / scf); - ofl = corner_bl ? ofs : 0; - ofr = corner_br ? ofs : 0; - } else { + int ofl, ofr; + if (calcCorners(NULL, &ofl, &ofr, dy, line, radius, type)) { //printf("3: x %d y %d dx %d dy %d rad %d line %d\n", x, y, dx, dy, radius, line); #if defined(FB_HW_ACCELERATION) || defined(USE_NEVIS_GXA) int rect_height_mult = ((type & CORNER_TOP) && (type & CORNER_BOTTOM)) ? 2 : 1; @@ -749,8 +721,15 @@ void CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, const int #endif } - if (dx-ofr-ofl == 0) - printf("paintBoxRel: radius %d, start x %d y %d end x %d y %d\n", radius, x, y, dx-ofr-ofl, y+line); + if (dx-ofr-ofl < 1) { + if (dx-ofr-ofl == 0) + printf("[%s - %d]: radius %d, start x %d y %d end x %d y %d\n", __FUNCTION__, __LINE__, radius, x, y, x+dx-ofr-ofl, y+line); + else + printf("[%s - %04d]: Calculated width: %d\n (radius %d, dx %d, offsetLeft %d, offsetRight %d).\n Width can not be less than 0, abort.\n", + __FUNCTION__, __LINE__, dx-ofr-ofl, radius, dx, ofl, ofr); + line++; + continue; + } #ifdef USE_NEVIS_GXA _write_gxa(gxa_base, GXA_BLT_CONTROL_REG, 0); _write_gxa(gxa_base, cmd, GXA_POINT(x + ofl, y + line)); /* destination x/y */ @@ -795,6 +774,7 @@ void CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, const int */ add_gxa_sync_marker(); #endif + checkFbArea(x, y, dx, dy, false); } void CFrameBuffer::paintVLineRelInternal(int x, int y, int dy, const fb_pixel_t col) @@ -1059,9 +1039,11 @@ _display: if (h != 0) yy += (h - height) / 2; + checkFbArea(x, yy, width, height, true); if (paintBg) paintBoxRel(x, yy, width, height, colBg); blit2FB(data, width, height, x, yy, 0, 0, true); + checkFbArea(x, yy, width, height, false); return true; } @@ -1114,65 +1096,170 @@ void CFrameBuffer::paintPixel(const int x, const int y, const fb_pixel_t col) #endif } -void CFrameBuffer::paintBoxFrame(const int sx, const int sy, const int dx, const int dy, const int px, const fb_pixel_t col, const int rad) +void CFrameBuffer::paintShortHLineRelInternal(const int& x, const int& dx, const int& y, const fb_pixel_t& col) +{ + uint8_t * pos = ((uint8_t *)getFrameBufferPointer()) + x * sizeof(fb_pixel_t) + stride * y; + fb_pixel_t * dest = (fb_pixel_t *)pos; + for (int i = 0; i < dx; i++) + *(dest++) = col; +} + +int CFrameBuffer::limitRadius(const int& dx, const int& dy, int& radius) +{ + if (radius > dx) + return dx; + if (radius > dy) + return dy; + if (radius > 540) + return 540; + return radius; +} + +void CFrameBuffer::setCornerFlags(const int& type) +{ + corner_tl = (type & CORNER_TOP_LEFT) == CORNER_TOP_LEFT; + corner_tr = (type & CORNER_TOP_RIGHT) == CORNER_TOP_RIGHT; + corner_bl = (type & CORNER_BOTTOM_LEFT) == CORNER_BOTTOM_LEFT; + corner_br = (type & CORNER_BOTTOM_RIGHT) == CORNER_BOTTOM_RIGHT; +} + +void CFrameBuffer::initQCircle() +{ + /* this table contains the x coordinates for a quarter circle (the bottom right quarter) with fixed + radius of 540 px which is the half of the max HD graphics size of 1080 px. So with that table we + ca draw boxes with round corners and als circles by just setting dx = dy = radius (max 540). */ + static const int _q_circle[541] = { + 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 540, 539, 539, 539, 539, 539, 539, 539, 539, 539, 539, 539, 539, 539, 539, 539, 539, + 539, 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, 537, 537, 537, 537, 537, 537, 537, + 537, 537, 536, 536, 536, 536, 536, 536, 536, 536, 535, 535, 535, 535, 535, 535, 535, 535, 534, 534, + 534, 534, 534, 534, 533, 533, 533, 533, 533, 533, 532, 532, 532, 532, 532, 532, 531, 531, 531, 531, + 531, 531, 530, 530, 530, 530, 529, 529, 529, 529, 529, 529, 528, 528, 528, 528, 527, 527, 527, 527, + 527, 526, 526, 526, 526, 525, 525, 525, 525, 524, 524, 524, 524, 523, 523, 523, 523, 522, 522, 522, + 522, 521, 521, 521, 521, 520, 520, 520, 519, 519, 519, 518, 518, 518, 518, 517, 517, 517, 516, 516, + 516, 515, 515, 515, 515, 514, 514, 514, 513, 513, 513, 512, 512, 512, 511, 511, 511, 510, 510, 510, + 509, 509, 508, 508, 508, 507, 507, 507, 506, 506, 506, 505, 505, 504, 504, 504, 503, 503, 502, 502, + 502, 501, 501, 500, 500, 499, 499, 499, 498, 498, 498, 497, 497, 496, 496, 496, 495, 495, 494, 494, + 493, 493, 492, 492, 491, 491, 490, 490, 490, 489, 489, 488, 488, 487, 487, 486, 486, 485, 485, 484, + 484, 483, 483, 482, 482, 481, 481, 480, 480, 479, 479, 478, 478, 477, 477, 476, 476, 475, 475, 474, + 473, 473, 472, 472, 471, 471, 470, 470, 469, 468, 468, 467, 466, 466, 465, 465, 464, 464, 463, 462, + 462, 461, 460, 460, 459, 459, 458, 458, 457, 456, 455, 455, 454, 454, 453, 452, 452, 451, 450, 450, + 449, 449, 448, 447, 446, 446, 445, 445, 444, 443, 442, 441, 441, 440, 440, 439, 438, 437, 436, 436, + 435, 435, 434, 433, 432, 431, 431, 430, 429, 428, 427, 427, 426, 425, 425, 424, 423, 422, 421, 421, + 420, 419, 418, 417, 416, 416, 415, 414, 413, 412, 412, 411, 410, 409, 408, 407, 406, 405, 404, 403, + 403, 402, 401, 400, 399, 398, 397, 397, 395, 394, 393, 393, 392, 391, 390, 389, 388, 387, 386, 385, + 384, 383, 382, 381, 380, 379, 378, 377, 376, 375, 374, 373, 372, 371, 369, 368, 367, 367, 365, 364, + 363, 362, 361, 360, 358, 357, 356, 355, 354, 353, 352, 351, 350, 348, 347, 346, 345, 343, 342, 341, + 340, 339, 337, 336, 335, 334, 332, 331, 329, 328, 327, 326, 324, 323, 322, 321, 319, 317, 316, 315, + 314, 312, 310, 309, 308, 307, 305, 303, 302, 301, 299, 297, 296, 294, 293, 291, 289, 288, 287, 285, + 283, 281, 280, 278, 277, 275, 273, 271, 270, 268, 267, 265, 263, 261, 259, 258, 256, 254, 252, 250, + 248, 246, 244, 242, 240, 238, 236, 234, 232, 230, 228, 225, 223, 221, 219, 217, 215, 212, 210, 207, + 204, 202, 200, 197, 195, 192, 190, 187, 184, 181, 179, 176, 173, 170, 167, 164, 160, 157, 154, 150, + 147, 144, 140, 136, 132, 128, 124, 120, 115, 111, 105, 101, 95, 89, 83, 77, 69, 61, 52, 40, + 23}; + if (q_circle == NULL) + q_circle = new int[sizeof(_q_circle) / sizeof(int)]; + memcpy(q_circle, _q_circle, sizeof(_q_circle)); +} + +bool CFrameBuffer::calcCorners(int *ofs, int *ofl, int *ofr, const int& dy, const int& line, const int& radius, const int& type) +{ +/* just an multiplicator for all math to reduce rounding errors */ +#define MUL 32768 + int scl, _ofs = 0; + bool ret = false; + if (ofl != NULL) *ofl = 0; + if (ofr != NULL) *ofr = 0; + int scf = (540 * MUL) / ((radius < 1) ? 1 : radius); + /* one of the top corners */ + if (line < radius && (type & CORNER_TOP)) { + /* uper round corners */ + scl = scf * (radius - line) / MUL; + if ((scf * (radius - line) % MUL) >= (MUL / 2)) /* round up */ + scl++; + _ofs = radius - (q_circle[scl] * MUL / scf); + if (ofl != NULL) *ofl = corner_tl ? _ofs : 0; + if (ofr != NULL) *ofr = corner_tr ? _ofs : 0; + } + /* one of the bottom corners */ + else if ((line >= dy - radius) && (type & CORNER_BOTTOM)) { + /* lower round corners */ + scl = scf * (radius - (dy - (line + 1))) / MUL; + if ((scf * (radius - (dy - (line + 1))) % MUL) >= (MUL / 2)) /* round up */ + scl++; + _ofs = radius - (q_circle[scl] * MUL / scf); + if (ofl != NULL) *ofl = corner_bl ? _ofs : 0; + if (ofr != NULL) *ofr = corner_br ? _ofs : 0; + } + else + ret = true; + if (ofs != NULL) *ofs = _ofs; + return ret; +} + +void CFrameBuffer::paintBoxFrame(const int x, const int y, const int dx, const int dy, const int px, const fb_pixel_t col, int radius, int type) { if (!getActive()) return; - int radius = rad; - int c_radius = rad << 1; - - paintBoxRel(sx + rad , sy , dx - c_radius, px, col); // upper horizontal - paintBoxRel(sx + rad , sy + dy - px, dx - c_radius, px, col); // lower horizontal - paintBoxRel(sx , sy + rad , px, dy - c_radius , col); // left vertical - paintBoxRel(sx + dx - px, sy + rad , px, dy - c_radius , col); // right vertical - - if (!radius) - { + if (dx == 0 || dy == 0) { + printf("paintBoxFrame: radius %d, start x %d y %d end x %d y %d\n", radius, x, y, x+dx, y+dy); return; } - int x1 = sx + radius; - int y1 = sy + radius; - int x2 = sx + dx - radius -1; - int y2 = sy + dy - radius -1; + setCornerFlags(type); + int rad_tl = 0, rad_tr = 0, rad_bl = 0, rad_br = 0; + if (type && radius) { + int x_rad = radius - 1; + if (corner_tl) rad_tl = x_rad; + if (corner_tr) rad_tr = x_rad; + if (corner_bl) rad_bl = x_rad; + if (corner_br) rad_br = x_rad; + } + paintBoxRel(x + rad_tl , y , dx - rad_tl - rad_tr, px , col); // top horizontal + paintBoxRel(x + rad_bl , y + dy - px, dx - rad_bl - rad_br, px , col); // bottom horizontal + paintBoxRel(x , y + rad_tl , px , dy - rad_tl - rad_bl, col); // left vertical + paintBoxRel(x + dx - px, y + rad_tr , px , dy - rad_tr - rad_br, col); // right vertical - int f = 1 - radius; - int ddF_x = 1; - int ddF_y = - c_radius; - int x = 0; - int y = radius; + if (type && radius) { + radius = limitRadius(dx, dy, radius); + int line = 0; + waitForIdle("CFrameBuffer::paintBoxFrame"); + while (line < dy) { + int ofs = 0, ofs_i = 0; + // inner box + if ((line >= px) && (line < (dy - px))) + ofs_i = calcCornersOffset(dy - 2*px, line-px, radius-px, type); + // outer box + ofs = calcCornersOffset(dy, line, radius, type); - while(x < y) - { - // ddF_x == 2 * x + 1; - // ddF_y == -2 * y; - // f == x*x + y*y - radius*radius + 2*x - y + 1; - if(f >= 0) - { - y--; - ddF_y += 2; - f += ddF_y; - } - x++; - ddF_x += 2; - f += ddF_x; - - int width = 0; - while (width <= px) - { - paintPixel(x2 + x , y1 - y + width, col); // 1. oct - paintPixel(x2 + y - width, y1 - x , col); // 2. oct - paintPixel(x2 + y - width, y2 + x , col); // 3. oct - paintPixel(x2 + x , y2 + y - width, col); // 4. oct - paintPixel(x1 - x , y2 + y - width, col); // 5. oct - paintPixel(x1 - y + width, y2 + x , col); // 6. oct - paintPixel(x1 - y + width, y1 - x , col); // 7. oct - paintPixel(x1 - x , y1 - y + width, col); // 8. oct - width++; + int _x = x + ofs; + int _x_end = x + dx; + int _y = y + line; + if ((line < px) || (line >= (dy - px))) { + // left + if (((corner_tl) && (line < radius)) || ((corner_bl) && (line >= dy - radius))) + paintShortHLineRelInternal(_x, radius - ofs, _y, col); + // right + if (((corner_tr) && (line < radius)) || ((corner_br) && (line >= dy - radius))) + paintShortHLineRelInternal(_x_end - radius, radius - ofs, _y, col); + } + else if (line < (dy - px)) { + int _dx = (ofs_i-ofs) + px; + // left + if (((corner_tl) && (line < radius)) || ((corner_bl) && (line >= dy - radius))) + paintShortHLineRelInternal(_x, _dx, _y, col); + // right + if (((corner_tr) && (line < radius)) || ((corner_br) && (line >= dy - radius))) + paintShortHLineRelInternal(_x_end - ofs_i - px, _dx, _y, col); + } + if ((line == radius) && (dy > 2*radius)) + // line outside the rounded corners + line = dy - radius; + else + line++; } } - } void CFrameBuffer::paintLine(int xa, int ya, int xb, int yb, const fb_pixel_t col) @@ -1465,6 +1552,7 @@ void CFrameBuffer::paintBackgroundBoxRel(int x, int y, int dx, int dy) if (!getActive()) return; + checkFbArea(x, y, dx, dy, true); if(!useBackgroundPaint) { paintBoxRel(x, y, dx, dy, backgroundColor); @@ -1480,6 +1568,7 @@ void CFrameBuffer::paintBackgroundBoxRel(int x, int y, int dx, int dy) bkpos += BACKGROUNDIMAGEWIDTH; } } + checkFbArea(x, y, dx, dy, false); } void CFrameBuffer::paintBackground() @@ -1487,6 +1576,7 @@ void CFrameBuffer::paintBackground() if (!getActive()) return; + checkFbArea(0, 0, xRes, yRes, true); if (useBackgroundPaint && (background != NULL)) { for (int i = 0; i < 576; i++) @@ -1496,6 +1586,7 @@ void CFrameBuffer::paintBackground() { paintBoxRel(0, 0, xRes, yRes, backgroundColor); } + checkFbArea(0, 0, xRes, yRes, false); } void CFrameBuffer::SaveScreen(int x, int y, int dx, int dy, fb_pixel_t * const memp) @@ -1503,6 +1594,7 @@ void CFrameBuffer::SaveScreen(int x, int y, int dx, int dy, fb_pixel_t * const m if (!getActive()) return; + checkFbArea(x, y, dx, dy, true); uint8_t * pos = ((uint8_t *)getFrameBufferPointer()) + x * sizeof(fb_pixel_t) + stride * y; fb_pixel_t * bkpos = memp; for (int count = 0; count < dy; count++) { @@ -1526,6 +1618,7 @@ void CFrameBuffer::SaveScreen(int x, int y, int dx, int dy, fb_pixel_t * const m bkpos += dx; } #endif + checkFbArea(x, y, dx, dy, false); } @@ -1534,6 +1627,7 @@ void CFrameBuffer::RestoreScreen(int x, int y, int dx, int dy, fb_pixel_t * cons if (!getActive()) return; + checkFbArea(x, y, dx, dy, true); uint8_t * fbpos = ((uint8_t *)getFrameBufferPointer()) + x * sizeof(fb_pixel_t) + stride * y; fb_pixel_t * bkpos = memp; for (int count = 0; count < dy; count++) @@ -1542,6 +1636,7 @@ void CFrameBuffer::RestoreScreen(int x, int y, int dx, int dy, fb_pixel_t * cons fbpos += stride; bkpos += dx; } + checkFbArea(x, y, dx, dy, false); } #if 0 //never used @@ -1758,3 +1853,91 @@ void CFrameBuffer::displayRGB(unsigned char *rgbbuff, int x_size, int y_size, in blit2FB(fbbuff, x_size, y_size, x_offs, y_offs, x_pan, y_pan); cs_free_uncached(fbbuff); } + +// ## AudioMute / Clock ###################################### + +void CFrameBuffer::setFbArea(int element, int _x, int _y, int _dx, int _dy) +{ + if (_x == 0 && _y == 0 && _dx == 0 && _dy == 0) { + // delete area + for (fbarea_iterator_t it = v_fbarea.begin(); it != v_fbarea.end(); ++it) { + if (it->element == element) { + v_fbarea.erase(it); + break; + } + } + if (v_fbarea.empty()) { + fbAreaActiv = false; + } + } + else { + // change area + bool found = false; + for (unsigned int i = 0; i < v_fbarea.size(); i++) { + if (v_fbarea[i].element == element) { + v_fbarea[i].x = _x; + v_fbarea[i].y = _y; + v_fbarea[i].dx = _dx; + v_fbarea[i].dy = _dy; + found = true; + break; + } + } + // set new area + if (!found) { + fb_area_t area; + area.x = _x; + area.y = _y; + area.dx = _dx; + area.dy = _dy; + area.element = element; + v_fbarea.push_back(area); + } + fbAreaActiv = true; + } +} + +int CFrameBuffer::checkFbAreaElement(int _x, int _y, int _dx, int _dy, fb_area_t *area) +{ + if (fb_no_check) + return FB_PAINTAREA_MATCH_NO; + + if (_y > area->y + area->dy) + return FB_PAINTAREA_MATCH_NO; + if (_x + _dx < area->x) + return FB_PAINTAREA_MATCH_NO; + if (_x > area->x + area->dx) + return FB_PAINTAREA_MATCH_NO; + if (_y + _dy < area->y) + return FB_PAINTAREA_MATCH_NO; + return FB_PAINTAREA_MATCH_OK; +} + +bool CFrameBuffer::_checkFbArea(int _x, int _y, int _dx, int _dy, bool prev) +{ + if (v_fbarea.empty()) + return true; + + for (unsigned int i = 0; i < v_fbarea.size(); i++) { + int ret = checkFbAreaElement(_x, _y, _dx, _dy, &v_fbarea[i]); + if (ret == FB_PAINTAREA_MATCH_OK) { + switch (v_fbarea[i].element) { + case FB_PAINTAREA_MUTEICON1: + if (!do_paint_mute_icon) + break; +// waitForIdle(); + fb_no_check = true; + if (prev) + CAudioMute::getInstance()->hide(true); + else + CAudioMute::getInstance()->paint(); + fb_no_check = false; + break; + default: + break; + } + } + } + + return true; +} diff --git a/src/driver/framebuffer.h b/src/driver/framebuffer.h index a114d9899..b53ecda40 100644 --- a/src/driver/framebuffer.h +++ b/src/driver/framebuffer.h @@ -2,23 +2,23 @@ Neutrino-GUI - DBoxII-Project Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ License: GPL - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + You should have received a copy of the GNU General Public + License along with this program; if not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. */ #include "framebuffer_ng.h" @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -112,30 +113,40 @@ class CFrameBuffer bool active; static void switch_signal (int); fb_fix_screeninfo fix; - #ifdef USE_NEVIS_GXA +#ifdef USE_NEVIS_GXA int devmem_fd; /* to access the GXA register we use /dev/mem */ unsigned int smem_start; /* as aquired from the fbdev, the framebuffers physical start address */ volatile uint8_t *gxa_base; /* base address for the GXA's register access */ - - #endif /* USE_NEVIS_GXA */ +#endif /* USE_NEVIS_GXA */ bool locked; std::map icon_cache; int cache_size; + + int *q_circle; + bool corner_tl, corner_tr, corner_bl, corner_br; + void * int_convertRGB2FB(unsigned char *rgbbuff, unsigned long x, unsigned long y, int transp, bool alpha); int m_transparent_default, m_transparent; // Unlocked versions (no mutex) void paintHLineRelInternal(int x, int dx, int y, const fb_pixel_t col); void paintVLineRelInternal(int x, int y, int dy, const fb_pixel_t col); + void paintShortHLineRelInternal(const int& x, const int& dx, const int& y, const fb_pixel_t& col); + int limitRadius(const int& dx, const int& dy, int& radius); + void setCornerFlags(const int& type); + void initQCircle(); + inline int calcCornersOffset(const int& dy, const int& line, const int& radius, const int& type) { int ofs = 0; calcCorners(&ofs, NULL, NULL, dy, line, radius, type); return ofs; } + bool calcCorners(int *ofs, int *ofl, int *ofr, const int& dy, const int& line, const int& radius, const int& type); + public: fb_pixel_t realcolor[256]; ~CFrameBuffer(); static CFrameBuffer* getInstance(); - #ifdef USE_NEVIS_GXA +#ifdef USE_NEVIS_GXA void setupGXA(void); - #endif +#endif void init(const char * const fbDevice = "/dev/fb/0"); int setMode(unsigned int xRes, unsigned int yRes, unsigned int bpp); @@ -148,8 +159,9 @@ class CFrameBuffer unsigned int getStride() const; // size of a single line in the framebuffer (in bytes) unsigned int getScreenWidth(bool real = false); unsigned int getScreenHeight(bool real = false); - unsigned int getScreenWidthRel(); - unsigned int getScreenHeightRel(); + unsigned int getScreenPercentRel(bool force_small); + unsigned int getScreenWidthRel(bool force_small = false); + unsigned int getScreenHeightRel(bool force_small = false); unsigned int getScreenX(); unsigned int getScreenY(); @@ -177,7 +189,7 @@ class CFrameBuffer inline void paintBox(int xa, int ya, int xb, int yb, const fb_pixel_t col) { paintBoxRel(xa, ya, xb - xa, yb - ya, col); } inline void paintBox(int xa, int ya, int xb, int yb, const fb_pixel_t col, int radius, int type) { paintBoxRel(xa, ya, xb - xa, yb - ya, col, radius, type); } - void paintBoxFrame(const int x, const int y, const int dx, const int dy, const int px, const fb_pixel_t col, const int rad = 0); + void paintBoxFrame(const int x, const int y, const int dx, const int dy, const int px, const fb_pixel_t col, int radius = 0, int type = CORNER_ALL); void paintLine(int xa, int ya, int xb, int yb, const fb_pixel_t col); inline void paintVLine(int x, int ya, int yb, const fb_pixel_t col) { paintVLineRel(x, ya, yb - ya, col); } @@ -225,7 +237,7 @@ class CFrameBuffer bool Locked(void) { return locked; }; #ifdef USE_NEVIS_GXA void add_gxa_sync_marker(void); - void waitForIdle(void); + void waitForIdle(const char* func=NULL); #else inline void waitForIdle(void) {}; #endif @@ -244,6 +256,51 @@ class CFrameBuffer }; void SetTransparent(int t){ m_transparent = t; } void SetTransparentDefault(){ m_transparent = m_transparent_default; } + +// ## AudioMute / Clock ###################################### + private: + enum { + FB_PAINTAREA_MATCH_NO, + FB_PAINTAREA_MATCH_OK + }; + + typedef struct fb_area_t + { + int x; + int y; + int dx; + int dy; + int element; + } fb_area_struct_t; + + bool fbAreaActiv; + typedef std::vector v_fbarea_t; + typedef v_fbarea_t::iterator fbarea_iterator_t; + v_fbarea_t v_fbarea; + bool fb_no_check; + bool do_paint_mute_icon; + + bool _checkFbArea(int _x, int _y, int _dx, int _dy, bool prev); + int checkFbAreaElement(int _x, int _y, int _dx, int _dy, fb_area_t *area); + + public: + enum { + FB_PAINTAREA_INFOCLOCK, + FB_PAINTAREA_MUTEICON1, + FB_PAINTAREA_MUTEICON2, + + FB_PAINTAREA_MAX + }; + +#if defined(FB_HW_ACCELERATION) + inline bool checkFbArea(int, int, int, int, bool) { return true; } +#else + inline bool checkFbArea(int _x, int _y, int _dx, int _dy, bool prev) { return (fbAreaActiv && !fb_no_check) ? _checkFbArea(_x, _y, _dx, _dy, prev) : true; } +#endif + + void setFbArea(int element, int _x=0, int _y=0, int _dx=0, int _dy=0); + void fbNoCheck(bool noCheck) { fb_no_check = noCheck; } + void doPaintMuteIcon(bool mode) { do_paint_mute_icon = mode; } }; #endif diff --git a/src/driver/volume.cpp b/src/driver/volume.cpp index 6a20a93a7..c26b3b082 100644 --- a/src/driver/volume.cpp +++ b/src/driver/volume.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include @@ -138,6 +139,11 @@ void CVolume::setVolume(const neutrino_msg_t key, bool nowait) } if (do_vol) { CAudioMute::getInstance()->AudioMute(false, true); + if (mode == CNeutrinoApp::mode_audio) { + CAudioPlayerGui *cap = CMediaPlayerMenu::getInstance()->getPlayerInstance(); + if (cap != NULL) + cap->refreshMuteIcon(); + } setVolume(msg); return; } @@ -160,6 +166,11 @@ void CVolume::setVolume(const neutrino_msg_t key, bool nowait) volscale = NULL; } CAudioMute::getInstance()->AudioMute(true, true); + if (mode == CNeutrinoApp::mode_audio) { + CAudioPlayerGui *cap = CMediaPlayerMenu::getInstance()->getPlayerInstance(); + if (cap != NULL) + cap->refreshMuteIcon(); + } setVolume(msg); return; } diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 334243c98..6a080a4c1 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -2250,50 +2250,52 @@ printf("SIevent size: %d\n", (int)sizeof(SIevent)); } /* was: commandAllEventsChannelID sendAllEvents */ -void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search, std::string search_text) +void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search, std::string search_text,bool all_chann) { dprintf("sendAllEvents for " PRINTF_CHANNEL_ID_TYPE "\n", serviceUniqueKey); - if(!eList.empty() && search == 0)//skip on search mode eList.clear(); t_channel_id serviceUniqueKey64 = serviceUniqueKey& 0xFFFFFFFFFFFFULL; //0xFFFFFFFFFFFFULL for CREATE_CHANNEL_ID64 - if(serviceUniqueKey64 == 0) + if(serviceUniqueKey64 == 0 && !all_chann) return; // service Found readLockEvents(); int serviceIDfound = 0; - if (search_text.length()) std::transform(search_text.begin(), search_text.end(), search_text.begin(), tolower); for (MySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey::iterator e = mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.begin(); e != mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.end(); ++e) { - if ((*e)->get_channel_id() == serviceUniqueKey64) { + if ((*e)->get_channel_id() == serviceUniqueKey64 || (all_chann)) { serviceIDfound = 1; bool copy = true; - if(search == 0); // nothing to do here - else if(search == 1) { - std::string eName = (*e)->getName(); - std::transform(eName.begin(), eName.end(), eName.begin(), tolower); - if(eName.find(search_text) == std::string::npos) - copy = false; + if(search){ + if((search == 1) || (search == 5)) {//SEARCH_EPG_TITLE == 1 SEARCH_EPG_ALL == 5 defined in eventlist.h + std::string eName = (*e)->getName(); + std::transform(eName.begin(), eName.end(), eName.begin(), tolower); + if(eName.find(search_text) == std::string::npos) + copy = false; + } + if((search == 2) || (!copy && search == 5)) {//SEARCH_EPG_INFO1 == 2 + std::string eText = (*e)->getText(); + std::transform(eText.begin(), eText.end(), eText.begin(), tolower); + if(eText.find(search_text) == std::string::npos) + copy = false; + else if(search == 5) + copy = true; + } + if((search == 3) || (!copy && search == 5)) {//SEARCH_EPG_INFO2 == 3 + std::string eExtendedText = (*e)->getExtendedText(); + std::transform(eExtendedText.begin(), eExtendedText.end(), eExtendedText.begin(), tolower); + if(eExtendedText.find(search_text) == std::string::npos) + copy = false; + else if(search == 5) + copy = true; + } } - else if(search == 2) { - std::string eText = (*e)->getText(); - std::transform(eText.begin(), eText.end(), eText.begin(), tolower); - if(eText.find(search_text) == std::string::npos) - copy = false; - } - else if(search == 3) { - std::string eExtendedText = (*e)->getExtendedText(); - std::transform(eExtendedText.begin(), eExtendedText.end(), eExtendedText.begin(), tolower); - if(eExtendedText.find(search_text) == std::string::npos) - copy = false; - } - if(copy) { for (SItimes::iterator t = (*e)->times.begin(); t != (*e)->times.end(); ++t) { @@ -2306,7 +2308,10 @@ void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEve aEvent.text = (*e)->getExtendedText().substr(0, 120); else aEvent.text = (*e)->getText(); - aEvent.channelID = serviceUniqueKey; + if(all_chann)//hack for all channel search + aEvent.channelID = (*e)->get_channel_id(); + else + aEvent.channelID = serviceUniqueKey; eList.push_back(aEvent); } } // if = serviceID diff --git a/src/eitd/sectionsd.h b/src/eitd/sectionsd.h index 2181502f6..9f82b216a 100644 --- a/src/eitd/sectionsd.h +++ b/src/eitd/sectionsd.h @@ -55,7 +55,7 @@ class CEitManager : public OpenThreads::Thread, public OpenThreads::Mutex bool Stop(); void SetConfig(CSectionsdClient::epg_config &cfg) { config = cfg; }; - void getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = ""); + void getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = "", bool all_chann=false); void getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next ); bool getEPGidShort(event_id_t epgID, CShortEPGData * epgdata); bool getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata); diff --git a/src/gui/audiomute.cpp b/src/gui/audiomute.cpp index 4a5e979c7..3fb627994 100644 --- a/src/gui/audiomute.cpp +++ b/src/gui/audiomute.cpp @@ -4,6 +4,8 @@ audioMute - Neutrino-GUI Copyright (C) 2013 M. Liebmann (micha-bbg) + CComponents implementation + Copyright (C) 2013 Thilo Graf License: GPL @@ -34,20 +36,13 @@ #include -CAudioMute::CAudioMute() +CAudioMute::CAudioMute():CComponentsPicture(0, 0, 0, 0, NEUTRINO_ICON_BUTTON_MUTE) { - mute_ax = 0; - mute_ay = 0; - mute_dx = 0; - mute_dy = 0; - mute_ay_old = -1; - CVolumeHelper::getInstance()->getMuteIconDimensions(&mute_ax, &mute_ay, &mute_dx, &mute_dy); - mIcon = new CComponentsPicture(mute_ax, mute_ay, mute_dx, mute_dy, NEUTRINO_ICON_BUTTON_MUTE); -} - -CAudioMute::~CAudioMute() -{ - delete mIcon; + y_old = -1; + paint_bg = false; + do_paint_mute_icon = true; + CVolumeHelper::getInstance()->refresh(); + CVolumeHelper::getInstance()->getMuteIconDimensions(&x, &y, &width, &height); } CAudioMute* CAudioMute::getInstance() @@ -69,21 +64,59 @@ void CAudioMute::AudioMute(int newValue, bool isEvent) if( isEvent && ( neutrino->getMode() != CNeutrinoApp::mode_scart ) && ( neutrino->getMode() != CNeutrinoApp::mode_audio) && ( neutrino->getMode() != CNeutrinoApp::mode_pic)) { - CVolumeHelper::getInstance()->getMuteIconDimensions(&mute_ax, &mute_ay, &mute_dx, &mute_dy); - if ((mIcon) && (mute_ay_old != mute_ay)) { - mIcon->hide(); - mIcon->setYPos(mute_ay); - mute_ay_old = mute_ay; + CVolumeHelper::getInstance()->getMuteIconDimensions(&x, &y, &width, &height); + if ((y_old != y)) { + if (do_paint_mute_icon) + { + frameBuffer->fbNoCheck(true); + this->hide(true); + frameBuffer->fbNoCheck(false); + } + frameBuffer->setFbArea(CFrameBuffer::FB_PAINTAREA_MUTEICON1); + y_old = y; } if ((g_settings.mode_clock) && (doInit)) - CInfoClock::getInstance(true)->ClearDisplay(); + CInfoClock::getInstance()->ClearDisplay(); - if (newValue) - mIcon->paint(); - else - mIcon->hide(); + frameBuffer->fbNoCheck(true); + if (newValue) { + if (do_paint_mute_icon) + this->paint(); + frameBuffer->setFbArea(CFrameBuffer::FB_PAINTAREA_MUTEICON1, x, y, width, height); + } + else { + if (do_paint_mute_icon) + this->hide(true); + frameBuffer->setFbArea(CFrameBuffer::FB_PAINTAREA_MUTEICON1); + } + frameBuffer->fbNoCheck(false); if (doInit) - CInfoClock::getInstance(true)->Init(true); + CVolumeHelper::getInstance()->refresh(); + } + else if (neutrino->getMode() == CNeutrinoApp::mode_audio) { + if (newValue) + frameBuffer->setFbArea(CFrameBuffer::FB_PAINTAREA_MUTEICON1, x, y, width, height); + else + frameBuffer->setFbArea(CFrameBuffer::FB_PAINTAREA_MUTEICON1); } } + +void CAudioMute::enableMuteIcon(bool enable) +{ + CNeutrinoApp *neutrino = CNeutrinoApp::getInstance(); + frameBuffer->fbNoCheck(true); + if (enable) { + frameBuffer->doPaintMuteIcon(true); + do_paint_mute_icon = true; + if (neutrino->isMuted()) + this->paint(); + } + else { + if (neutrino->isMuted()) + this->hide(true); + frameBuffer->doPaintMuteIcon(false); + do_paint_mute_icon = false; + } + frameBuffer->fbNoCheck(false); +} diff --git a/src/gui/audiomute.h b/src/gui/audiomute.h index a45fa70e2..406483f18 100644 --- a/src/gui/audiomute.h +++ b/src/gui/audiomute.h @@ -29,20 +29,21 @@ #include -class CAudioMute +class CAudioMute : public CComponentsPicture { private: - int mute_ay_old; - int mute_ax, mute_ay, mute_dx, mute_dy; - CComponentsPicture *mIcon; + int y_old; + bool do_paint_mute_icon; public: CAudioMute(); - ~CAudioMute(); +// ~CAudioMute(); static CAudioMute* getInstance(); void AudioMute(int newValue, bool isEvent= false); + void doPaintMuteIcon(bool mode) { do_paint_mute_icon = mode; } + void enableMuteIcon(bool enable); }; #endif // __CAUDIOMUTE__ diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 202480188..6d609fa44 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -282,6 +282,8 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); int iw, ih; + m_frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE, &iw, &ih); + m_theight = std::max(m_theight, ih+2); m_frameBuffer->getIconSize(NEUTRINO_ICON_MP3, &iw, &ih); m_theight = std::max(m_theight, ih+4); @@ -900,6 +902,9 @@ int CAudioPlayerGui::show() ret = menu_return::RETURN_EXIT_ALL; loop = false; } + // update mute icon + paintHead(); + paintLCD(); } m_frameBuffer->blit(); } @@ -1639,7 +1644,7 @@ void CAudioPlayerGui::paintItem(int pos) void CAudioPlayerGui::paintHead() { - if (!m_show_playlist) + if (!m_show_playlist || m_screensaver) return; int c_rad_mid = RADIUS_MID; @@ -1670,6 +1675,11 @@ void CAudioPlayerGui::paintHead() } //m_frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, m_x + m_width - 30, ypos); #endif + if ( CNeutrinoApp::getInstance()->isMuted() ) + { + m_frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE, &iw, &ih); + m_frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MUTE, xpos - iw, ypos, m_theight); + } m_frameBuffer->blit(); } diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index 74284ed4a..8ed6eb5f8 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -261,6 +261,7 @@ class CAudioPlayerGui : public CMenuTarget bool playNext(bool allow_rotate = false); bool playPrev(bool allow_rotate = false); int getAudioPlayerM_current() {return m_current;} + void refreshMuteIcon() { paintHead(); } }; diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 3ed1ff4ff..87359d968 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -607,6 +607,7 @@ int CChannelList::show() bool bouquet_changed = false; bool loop=true; + bool dont_hide = false; while (loop) { g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd, true); if ( msg <= CRCInput::RC_MaxRC ) @@ -776,6 +777,7 @@ int CChannelList::show() res = bouquetList->showChannelList(); loop = false; } + dont_hide = true; } } else if ( msg == CRCInput::RC_ok ) { @@ -872,9 +874,6 @@ int CChannelList::show() paintHead(); // update button bar paint(); - - if (!displayList && g_settings.channellist_additional) - showdescription(selected); } else if ( msg == CRCInput::RC_green ) { @@ -934,10 +933,10 @@ int CChannelList::show() if (bouquet_changed) res = -5; /* in neutrino.cpp: -5 == "don't change bouquet after adding a channel to fav" */ - - hide(); - - fader.Stop(); + if(!dont_hide){ + hide(); + fader.Stop(); + } if (bShowBouquetList) { res = bouquetList->exec(true); @@ -1671,7 +1670,12 @@ void CChannelList::paintDetails(int index) } } if ((g_settings.channellist_additional) && (p_event != NULL)) - paint_events(index); + { + if (displayList) + paint_events(index); + else + showdescription(selected); + } } void CChannelList::clearItem2DetailsLine() @@ -2110,8 +2114,12 @@ void CChannelList::paint() // paint background for main box frameBuffer->paintBoxRel(x, y+theight, width, height-footerHeight-theight, COL_MENUCONTENT_PLUS_0); if (g_settings.channellist_additional) + { + // disable displayNext + displayNext = false; // paint background for right box frameBuffer->paintBoxRel(x+width,y+theight,infozone_width,pig_height+infozone_height,COL_MENUCONTENT_PLUS_0); + } for(unsigned int count = 0; count < listmaxshow; count++) { paintItem(count, true); @@ -2229,6 +2237,7 @@ void CChannelList::paint_events(int index) CChannelEventList::iterator e; time_t azeit; time(&azeit); + unsigned int u_azeit = ( azeit > -1)? azeit:0; if ( evtlist.empty() ) { @@ -2244,8 +2253,7 @@ void CChannelList::paint_events(int index) for (e=evtlist.begin(); e!=evtlist.end(); ++e ) { //Remove events in the past - time_t dif = azeit - e->startTime; - if ( (dif > 0) && (!(e->eventID == 0))) + if ( (u_azeit > (e->startTime + e->duration)) && (!(e->eventID == 0))) { do { @@ -2253,9 +2261,8 @@ void CChannelList::paint_events(int index) e = evtlist.erase( e ); if (e == evtlist.end()) break; - dif = azeit - e->startTime; } - while ( dif > 0 ); + while ( u_azeit > (e->startTime + e->duration)); } if (e == evtlist.end()) break; @@ -2263,15 +2270,20 @@ void CChannelList::paint_events(int index) //Display the remaining events if ((y+ theight+ pig_height + i*ffheight) < (y+ theight+ pig_height + infozone_height)) { + bool first = false; + fb_pixel_t color = COL_MENUCONTENTDARK; if (e->eventID) { + first = (i == 1); + if ((first && g_settings.colored_events_channellist == 1 /* current */) || (!first && g_settings.colored_events_channellist == 2 /* next */)) + color = COL_COLORED_EVENTS_CHANNELLIST; struct tm *tmStartZeit = localtime(&e->startTime); strftime(startTime, sizeof(startTime), "%H:%M", tmStartZeit ); //printf("%s %s\n", startTime, e->description.c_str()); startTimeWidth = eventStartTimeWidth; - g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, startTimeWidth, startTime, (g_settings.colored_events_channellist == 2 /* next */) ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTINACTIVE, 0, true); + g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, startTimeWidth, startTime, color, 0, true); } - g_Font[eventFont]->RenderString(x+ width+5+startTimeWidth, y+ theight+ pig_height + i*ffheight, infozone_width - startTimeWidth - 20, e->description, COL_MENUCONTENTDARK, 0, true); + g_Font[eventFont]->RenderString(x+ width+5+startTimeWidth, y+ theight+ pig_height + i*ffheight, infozone_width - startTimeWidth - 20, e->description, color, 0, true); } else { @@ -2315,13 +2327,15 @@ void CChannelList::showdescription(int index) epgData.info2.clear(); epgText.clear(); CEitManager::getInstance()->getEPGid(p_event->eventID, p_event->startTime, &epgData); + if (!(epgData.info2.empty())) - { - frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0); processTextToArray(epgData.info2); - for (int i = 1; (i < (int)epgText.size()+1) && ((y+ theight+ pig_height + i*ffheight) < (y+ theight+ pig_height + infozone_height)); i++) - g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, infozone_width - 20, epgText[i-1].first, COL_MENUCONTENTDARK , 0, true); - } + else + processTextToArray(g_Locale->getText(LOCALE_EPGVIEWER_NODETAILED)); + + frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0); + for (int i = 1; (i < (int)epgText.size()+1) && ((y+ theight+ pig_height + i*ffheight) < (y+ theight+ pig_height + infozone_height)); i++) + g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, infozone_width - 20, epgText[i-1].first, COL_MENUCONTENTDARK , 0, true); } void CChannelList::addTextToArray(const std::string & text, int screening) // UTF-8 diff --git a/src/gui/components/cc.h b/src/gui/components/cc.h index 8e68473d7..248bc2be0 100644 --- a/src/gui/components/cc.h +++ b/src/gui/components/cc.h @@ -36,8 +36,6 @@ class CComponents { - private: - bool allowPaint(const int& i); protected: int x, y, height, width, corner_type, shadow_w; int corner_rad, fr_thickness, fr_thickness_sel; diff --git a/src/gui/components/cc_base.cpp b/src/gui/components/cc_base.cpp index 5cb0a9f7f..8e0d7a5da 100644 --- a/src/gui/components/cc_base.cpp +++ b/src/gui/components/cc_base.cpp @@ -80,27 +80,10 @@ void CComponents::initVarBasic() saved_screen.pixbuf = NULL; } -bool CComponents::allowPaint(const int& i) -{ - if(v_fbdata[i].fbdata_type == CC_FBDATA_TYPE_BOX) - return true; - - - if (v_fbdata[CC_FBDATA_TYPE_BOX].x != v_fbdata[i].x) - return true; - else if (v_fbdata[CC_FBDATA_TYPE_BOX].y != v_fbdata[i].y) - return true; - else if (v_fbdata[CC_FBDATA_TYPE_BOX].dx != v_fbdata[i].dx) - return true; - else if (v_fbdata[CC_FBDATA_TYPE_BOX].dy != v_fbdata[i].dy) - return true; - - return false; -} - //paint framebuffer stuff and fill buffer void CComponents::paintFbItems(bool do_save_bg) { + //save background before first paint, do_save_bg must be true if (firstPaint && do_save_bg) { for(size_t i=0; i 0) - frameBuffer->paintBoxFrame(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].frame_thickness, v_fbdata[i].color, v_fbdata[i].r); + + //paint all fb relevant basic parts (frame and body) with all specified properties, paint_bg must be true + if (fbtype != CC_FBDATA_TYPE_BGSCREEN && paint_bg){ + if (fbtype == CC_FBDATA_TYPE_FRAME) { + if (v_fbdata[i].frame_thickness > 0) + frameBuffer->paintBoxFrame(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].frame_thickness, v_fbdata[i].color, v_fbdata[i].r, corner_type); + } else if (fbtype == CC_FBDATA_TYPE_BACKGROUND) frameBuffer->paintBackgroundBoxRel(x, y, v_fbdata[i].dx, v_fbdata[i].dy); - else if( allowPaint(i) || fbtype == CC_FBDATA_TYPE_LINE) + else frameBuffer->paintBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].color, v_fbdata[i].r, corner_type); } } @@ -156,6 +145,7 @@ void CComponents::paintFbItems(bool do_save_bg) inline fb_pixel_t* CComponents::getScreen(int ax, int ay, int dx, int dy) { fb_pixel_t* pixbuf = new fb_pixel_t[dx * dy]; + frameBuffer->waitForIdle("CComponents::getScreen()"); frameBuffer->SaveScreen(ax, ay, dx, dy, pixbuf); return pixbuf; } @@ -165,6 +155,7 @@ inline void CComponents::hide() { for(size_t i =0; i< v_fbdata.size() ;i++) { if (v_fbdata[i].pixbuf != NULL){ + frameBuffer->waitForIdle("CComponents::hide()"); frameBuffer->RestoreScreen(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].pixbuf); delete[] v_fbdata[i].pixbuf; v_fbdata[i].pixbuf = NULL; diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index a50375d10..d621b0cae 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -67,10 +67,6 @@ void CComponentsItem::paintInit(bool do_save_bg) { clear(); - if(!paint_bg) - return; - - int sw = shadow ? shadow_w : 0; int th = fr_thickness; fb_pixel_t col_frame_cur = col_frame; @@ -83,13 +79,21 @@ void CComponentsItem::paintInit(bool do_save_bg) //calculate current needed corner radius for body box, depends of frame thickness int rad = (corner_rad>th) ? corner_rad-th : corner_rad; - //calculate positon of shadow areas - int x_sh = corner_rad>0 ? x+width-2*corner_rad+sw : x+width; //right - int y_sh = corner_rad>0 ? y+height-2*corner_rad+sw : y+height; //bottom - - //calculate current shadow width depends of current corner_rad - int sw_cur = corner_rad>0 ? 2*corner_rad : sw; - + int sw = 0, sw_cur = 0; + int x_sh = x + width; + int y_sh = y + height; + if (shadow) { + sw = shadow_w; + sw_cur = sw; + if (corner_type && corner_rad) { + //calculate positon of shadow areas + x_sh += sw - 2*corner_rad; + y_sh += sw - 2*corner_rad; + //calculate current shadow width depends of current corner_rad + sw_cur = max(2*corner_rad, sw); + } + } + comp_fbdata_t fbdata[] = { {CC_FBDATA_TYPE_BGSCREEN, x, y, width+sw, height+sw, 0, 0, 0, NULL, NULL}, @@ -115,6 +119,7 @@ void CComponentsItem::hideCCItem(bool no_restore) is_painted = false; if (saved_screen.pixbuf) { + frameBuffer->waitForIdle("CComponentsItem::hideCCItem()"); frameBuffer->RestoreScreen(saved_screen.x, saved_screen.y, saved_screen.dx, saved_screen.dy, saved_screen.pixbuf); if (no_restore) { delete[] saved_screen.pixbuf; diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index c416e36b0..bcc5b9ad3 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -93,12 +93,12 @@ typedef struct comp_screen_data_t //align types enum { - CC_ALIGN_RIGHT = 0, - CC_ALIGN_LEFT = 1, - CC_ALIGN_TOP = 2, - CC_ALIGN_BOTTOM = 4, - CC_ALIGN_HOR_CENTER = 8, - CC_ALIGN_VER_CENTER = 16 + CC_ALIGN_RIGHT = 1, + CC_ALIGN_LEFT = 2, + CC_ALIGN_TOP = 4, + CC_ALIGN_BOTTOM = 8, + CC_ALIGN_HOR_CENTER = 16, + CC_ALIGN_VER_CENTER = 32 }; enum diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 43770ef2a..495e1b046 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -117,8 +117,8 @@ CEpgData::CEpgData() void CEpgData::start() { - ox = frameBuffer->getScreenWidthRel(); - oy = frameBuffer->getScreenHeightRel(); + ox = frameBuffer->getScreenWidthRel(bigFonts ? false /* big */ : true /* small */); + oy = frameBuffer->getScreenHeightRel(bigFonts ? false /* big */ : true /* small */); topheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getHeight(); topboxheight = topheight + 6; @@ -548,28 +548,55 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start else processTextToArray(strEpisode + epgData.info2); + // Add a blank line + processTextToArray(""); + + // 21.07.2005 - rainerk // Show extended information if ( !epgData.itemDescriptions.empty() && !epgData.items.empty()) { char line[256]; std::vector::iterator description; std::vector::iterator item; - processTextToArray(""); // Add a blank line for (description = epgData.itemDescriptions.begin(), item = epgData.items.begin(); description != epgData.itemDescriptions.end(), item != epgData.items.end(); ++description, ++item) { sprintf(line, "%s: %s", (*(description)).c_str(), (*(item)).c_str()); processTextToArray(line); } } + // Show FSK information if (epgData.fsk > 0) { - char _tfsk[11]; - sprintf (_tfsk, "FSK: ab %d", epgData.fsk ); - processTextToArray( _tfsk ); // UTF-8 + char fskInfo[4]; + sprintf(fskInfo, "%d", epgData.fsk); + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_AGE_RATING)) + ": " + fskInfo); // UTF-8 } + // Show length information + char lengthInfo[11]; + sprintf(lengthInfo, "%d", epgData.epg_times.dauer / 60); + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_LENGTH)) + ": " + lengthInfo); // UTF-8 + + // Show audio information + std::string audioInfo = ""; + CSectionsdClient::ComponentTagList tags; + bool hasComponentTags = CEitManager::getInstance()->getComponentTagsUniqueKey( epgData.eventID, tags); + if (hasComponentTags) + { + for (unsigned int i = 0; i < tags.size(); i++) + if (tags[i].streamContent == 2 && !tags[i].component.empty()) + audioInfo += tags[i].component + ", "; + + if (!audioInfo.empty()) + { + audioInfo.erase(audioInfo.size()-2); + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_AUDIO)) + ": " + ZapitTools::Latin1_to_UTF8(audioInfo)); // UTF-8 + } + } + + // Show genre information if (epgData.contentClassification.length()> 0) - processTextToArray(GetGenre(epgData.contentClassification[0])); // UTF-8 + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_GENRE)) + ": " + GetGenre(epgData.contentClassification[0])); // UTF-8 // processTextToArray( epgData.userClassification.c_str() ); // -- display more screenings on the same channel @@ -627,11 +654,10 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start showTimerEventBar (true); //show Content&Component for Dolby & 16:9 - CSectionsdClient::ComponentTagList tags; int dummy_h,dummy_w; frameBuffer->getIconSize(NEUTRINO_ICON_16_9_GREY, &dummy_w, &dummy_h); if (dummy_h == 16 && dummy_w == 26){ // show only standard icon size - if (CEitManager::getInstance()->getComponentTagsUniqueKey( epgData.eventID, tags)) + if (hasComponentTags) { for (unsigned int i=0; i< tags.size(); i++) { diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 7bbcd508d..08d2d083a 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -66,6 +66,11 @@ bool sortById (const CChannelEvent& a, const CChannelEvent& b) { return a.eventID < b.eventID ; } + +inline static bool sortbyEventid (const CChannelEvent& a, const CChannelEvent& b) +{ + return (a.channelID == b.channelID && a.eventID == b.eventID && a.startTime == b.startTime); +} #endif inline bool sortByDescription (const CChannelEvent& a, const CChannelEvent& b) { @@ -79,11 +84,6 @@ inline static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& return a.startTime < b.startTime; } -inline static bool sortbyEventid (const CChannelEvent& a, const CChannelEvent& b) -{ - return (a.channelID == b.channelID && a.eventID == b.eventID && a.startTime == b.startTime); -} - CNeutrinoEventList::CNeutrinoEventList() { frameBuffer = CFrameBuffer::getInstance(); @@ -93,7 +93,6 @@ CNeutrinoEventList::CNeutrinoEventList() sort_mode = 0; m_search_list = SEARCH_LIST_NONE; - m_search_epg_item = SEARCH_LIST_NONE; m_search_epg_item = SEARCH_EPG_TITLE; m_search_channel_id = 1; m_search_bouquet_id= 1; @@ -307,11 +306,11 @@ int CNeutrinoEventList::exec(const t_channel_id channel_id, const std::string& c } UpdateTimerList(); + bool dont_hide = false; if(channelname_prev.empty(), channelname_next.empty()){ paintHead(channel_id, channelname); }else{ paintHead(channelname, channelname_prev, channelname_next); - } paint(channel_id); showFunctionBar(true, channel_id); @@ -582,6 +581,7 @@ int CNeutrinoEventList::exec(const t_channel_id channel_id, const std::string& c } } loop = false; + dont_hide = true; exec(_channel_id, current_channel_name, prev_channel_name, next_channel_name); } else if (msg == CRCInput::RC_0) { @@ -674,8 +674,10 @@ int CNeutrinoEventList::exec(const t_channel_id channel_id, const std::string& c oldEventID = -1; bgRightBoxPaint = false; - hide(); - fader.Stop(); + if(!dont_hide){ + hide(); + fader.Stop(); + } return res; } @@ -831,8 +833,12 @@ void CNeutrinoEventList::paintDescription(int index) else CEitManager::getInstance()->getActualEPGServiceKey(evtlist[index].channelID, &epgData ); - if(!epgData.info2.empty()) + if(!epgData.info2.empty()){ infozone_text = epgData.info2; + } + else if (!epgData.info1.empty()){ + infozone_text = epgData.info1; + } else infozone_text = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS); @@ -1008,8 +1014,6 @@ int CEventListHandler::exec(CMenuTarget* parent, const std::string &/*actionkey* return res; } - - /************************************************************************************************/ bool CNeutrinoEventList::findEvents(void) /************************************************************************************************/ @@ -1018,6 +1022,12 @@ bool CNeutrinoEventList::findEvents(void) int event = 0; t_channel_id channel_id = 0; + if((m_search_keyword.empty() || m_search_keyword == m_search_autokeyword) && evtlist[selected].eventID != 0) + { + m_search_keyword = evtlist[selected].description; + m_search_autokeyword = m_search_keyword; + } + CEventFinderMenu menu( &event, &m_search_epg_item, &m_search_keyword, @@ -1028,7 +1038,6 @@ bool CNeutrinoEventList::findEvents(void) hide(); menu.exec(NULL,""); search_head_name = g_Locale->getText(LOCALE_EVENTFINDER_SEARCH); - if(event == 1) { res = true; @@ -1050,23 +1059,42 @@ bool CNeutrinoEventList::findEvents(void) } else if(m_search_list == SEARCH_LIST_ALL) { + CHintBox box(LOCALE_TIMING_EPG,g_Locale->getText(LOCALE_EVENTFINDER_SEARCHING)); box.paint(); - int bouquet_nr = bouquetList->Bouquets.size(); - for(int bouquet = 0; bouquet < bouquet_nr; bouquet++) - { - int channel_nr = bouquetList->Bouquets[bouquet]->channelList->getSize(); - for(int channel = 0; channel < channel_nr; channel++) - { - channel_id = bouquetList->Bouquets[bouquet]->channelList->getChannelFromIndex(channel)->channel_id; - CEitManager::getInstance()->getEventsServiceKey(channel_id,evtlist, m_search_epg_item,m_search_keyword); + std::vector v; + int channel_nr = CNeutrinoApp::getInstance ()->channelList->getSize();//unique channelList TV or Radio + for(int channel = 0; channel < channel_nr; channel++){ + channel_id = CNeutrinoApp::getInstance ()->channelList->getChannelFromIndex(channel)->channel_id; + v.push_back(channel_id); + } + + std::map ch_id_map; + std::vector::iterator it; + for (it = v.begin(); it != v.end(); ++it){ + ch_id_map[*it & 0xFFFFFFFFFFFFULL] = *it; + } + CEitManager::getInstance()->getEventsServiceKey(0,evtlist, m_search_epg_item,m_search_keyword, true);//all_chann + + std::map::iterator map_it; + CChannelEventList::iterator e; + if(!evtlist.empty()){ + for ( e=evtlist.begin(); e!=evtlist.end();){ + map_it = ch_id_map.find(e->channelID); + if (map_it != ch_id_map.end()){ + e->channelID = map_it->second;//map channelID48 to channelID + ++e; + } + else{ + evtlist.erase(e);// remove event for not found channels in channelList + } } } + box.hide(); } if(!evtlist.empty()){ sort(evtlist.begin(),evtlist.end(),sortByDateTime); - evtlist.erase(unique(evtlist.begin(), evtlist.end(),sortbyEventid), evtlist.end()); } current_event = (unsigned int)-1; @@ -1142,14 +1170,15 @@ const CMenuOptionChooser::keyval SEARCH_LIST_OPTIONS[SEARCH_LIST_OPTION_COUNT] = }; -#define SEARCH_EPG_OPTION_COUNT 3 +#define SEARCH_EPG_OPTION_COUNT 4 const CMenuOptionChooser::keyval SEARCH_EPG_OPTIONS[SEARCH_EPG_OPTION_COUNT] = { // { CNeutrinoEventList::SEARCH_EPG_NONE, LOCALE_PICTUREVIEWER_RESIZE_NONE }, { CNeutrinoEventList::SEARCH_EPG_TITLE, LOCALE_FONTSIZE_EPG_TITLE }, { CNeutrinoEventList::SEARCH_EPG_INFO1, LOCALE_FONTSIZE_EPG_INFO1 }, - { CNeutrinoEventList::SEARCH_EPG_INFO2, LOCALE_FONTSIZE_EPG_INFO2 } -// ,{ CNeutrinoEventList::SEARCH_EPG_GENRE, LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR } + { CNeutrinoEventList::SEARCH_EPG_INFO2, LOCALE_FONTSIZE_EPG_INFO2 }, +// { CNeutrinoEventList::SEARCH_EPG_GENRE, LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR }, + { CNeutrinoEventList::SEARCH_EPG_ALL, LOCALE_EVENTFINDER_SEARCH_ALL_EPG } }; @@ -1178,7 +1207,6 @@ int CEventFinderMenu::exec(CMenuTarget* parent, const std::string &actionkey) { int res = menu_return::RETURN_REPAINT; - if(actionkey =="") { if(parent != NULL) @@ -1269,7 +1297,7 @@ int CEventFinderMenu::showMenu(void) } else if(*m_search_list == CNeutrinoEventList::SEARCH_LIST_BOUQUET) { - if(bouquetList->Bouquets.size()<*m_search_bouquet_id ){ + if (*m_search_bouquet_id >= bouquetList->Bouquets.size()){ *m_search_bouquet_id = bouquetList->getActiveBouquetNumber();; } if(!bouquetList->Bouquets.empty()) @@ -1310,6 +1338,7 @@ int CEventFinderMenu::showMenu(void) bool CEventFinderMenu::changeNotify(const neutrino_locale_t OptionName, void *) /************************************************************************************************/ { + if (ARE_LOCALES_EQUAL(OptionName, LOCALE_EVENTFINDER_SEARCH_WITHIN_LIST)) { if (*m_search_list == CNeutrinoEventList::SEARCH_LIST_CHANNEL) @@ -1319,8 +1348,13 @@ bool CEventFinderMenu::changeNotify(const neutrino_locale_t OptionName, void *) } else if (*m_search_list == CNeutrinoEventList::SEARCH_LIST_BOUQUET) { - m_search_channelname = bouquetList->Bouquets[*m_search_bouquet_id]->channelList->getName(); - m_search_channelname_mf->setActive(true); + if (*m_search_bouquet_id >= bouquetList->Bouquets.size()){ + *m_search_bouquet_id = bouquetList->getActiveBouquetNumber(); + } + if(!bouquetList->Bouquets.empty()){ + m_search_channelname = bouquetList->Bouquets[*m_search_bouquet_id]->channelList->getName(); + m_search_channelname_mf->setActive(true); + } } else if (*m_search_list == CNeutrinoEventList::SEARCH_LIST_ALL) { diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 530b69e8d..8eff085db 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -46,31 +46,32 @@ class CNeutrinoEventList { - // Eventfinder start - public: - typedef enum - { - SEARCH_EPG_NONE, - SEARCH_EPG_TITLE, - SEARCH_EPG_INFO1, - SEARCH_EPG_INFO2, - SEARCH_EPG_GENRE, - SEARCH_EPG_ALL - }SEARCH_EPG; - typedef enum - { - SEARCH_LIST_NONE, - SEARCH_LIST_CHANNEL, - SEARCH_LIST_BOUQUET, - SEARCH_LIST_ALL - }SEARCH_LIST; - private: - int m_search_epg_item; - std::string m_search_keyword; - int m_search_list; - t_channel_id m_search_channel_id; - t_bouquet_id m_search_bouquet_id; - bool m_showChannel; + // Eventfinder start + public: + typedef enum + { + SEARCH_EPG_NONE, + SEARCH_EPG_TITLE, + SEARCH_EPG_INFO1, + SEARCH_EPG_INFO2, + SEARCH_EPG_GENRE, + SEARCH_EPG_ALL + }SEARCH_EPG; + typedef enum + { + SEARCH_LIST_NONE, + SEARCH_LIST_CHANNEL, + SEARCH_LIST_BOUQUET, + SEARCH_LIST_ALL + }SEARCH_LIST; + private: + int m_search_epg_item; + std::string m_search_keyword; + std::string m_search_autokeyword; + int m_search_list; + t_channel_id m_search_channel_id; + t_bouquet_id m_search_bouquet_id; + bool m_showChannel; int FunctionBarHeight; int oldIndex; event_id_t oldEventID; diff --git a/src/gui/infoclock.cpp b/src/gui/infoclock.cpp index f553ea04f..0967f52a3 100644 --- a/src/gui/infoclock.cpp +++ b/src/gui/infoclock.cpp @@ -17,12 +17,12 @@ #define YOFF 0 -CInfoClock::CInfoClock(bool noVolume) +CInfoClock::CInfoClock() { frameBuffer = CFrameBuffer::getInstance(); x = y = clock_x = 0; time_height = time_width = thrTimer = 0; - Init(noVolume); + Init(); } CInfoClock::~CInfoClock() @@ -32,53 +32,35 @@ CInfoClock::~CInfoClock() thrTimer = 0; } -void CInfoClock::Init(bool noVolume) +void CInfoClock::Init() { - static int mute_dx = 0, mute_dy = 0, y_org = 0, spacer = 0; - int mute_corrY = 0; - if (!noVolume) { - CVolumeHelper *vh = CVolumeHelper::getInstance(); - int dummy; - vh->getDimensions(&dummy, &y, &x, &dummy); - vh->getMuteIconDimensions(&dummy, &dummy, &mute_dx, &mute_dy); - vh->getSpacer(&spacer, &dummy); - y_org = y; - } - else - y = y_org; - - digit_offset = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getDigitOffset(); - digit_h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getDigitHeight(); - int t1 = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(widest_number); - int t2 = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(":"); - time_height = digit_h + (int)((float)digit_offset * 1.5); - time_width = t1*6 + t2*2; - clock_x = x - time_width; - if (CNeutrinoApp::getInstance()->isMuted()) { - clock_x -= (mute_dx + spacer); - if (mute_dy > time_height) - y += (mute_dy - time_height) / 2; - else - mute_corrY = (time_height - mute_dy) / 2; - CVolumeHelper::getInstance()->setMuteIconCorrY(mute_corrY); - } + CVolumeHelper::getInstance()->refresh(); + CVolumeHelper::getInstance()->getInfoClockDimensions(&clock_x, &y, &time_width, &time_height, &digit_h, &digit_offset); } -CInfoClock* CInfoClock::getInstance(bool noVolume) +CInfoClock* CInfoClock::getInstance() { static CInfoClock* InfoClock = NULL; if(!InfoClock) - InfoClock = new CInfoClock(noVolume); + InfoClock = new CInfoClock(); return InfoClock; } void CInfoClock::paintTime( bool show_dot) { char timestr[20]; + int dummy, mute_dx, h_spacer; time_t tm = time(0); strftime((char*) ×tr, sizeof(timestr), "%H:%M:%S", localtime(&tm)); timestr[2] = show_dot ? ':':'.'; + CVolumeHelper *cvh = CVolumeHelper::getInstance(); + cvh->getInfoClockDimensions(&clock_x, &y, &time_width, &time_height, &digit_h, &digit_offset); + cvh->getMuteIconDimensions(&dummy, &dummy, &mute_dx, &dummy); + cvh->getSpacer(&h_spacer, &dummy); + if (CNeutrinoApp::getInstance()->isMuted()) + clock_x -= (mute_dx + h_spacer); + int x_diff = (time_width - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(timestr)) / 2; frameBuffer->paintBoxRel(clock_x, y, time_width, time_height, COL_MENUCONTENT_PLUS_0, RADIUS_SMALL); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString(clock_x + x_diff, y + digit_h + digit_offset + ((time_height - digit_h) / 2), time_width, timestr, COL_MENUCONTENT); @@ -105,6 +87,7 @@ void* CInfoClock::TimerProc(void *arg) void CInfoClock::ClearDisplay() { frameBuffer->paintBackgroundBoxRel(clock_x, y, time_width, time_height); + Init(); } void CInfoClock::StartClock() diff --git a/src/gui/infoclock.h b/src/gui/infoclock.h index 73b4ebb93..8d578181d 100644 --- a/src/gui/infoclock.h +++ b/src/gui/infoclock.h @@ -20,15 +20,15 @@ class CInfoClock void paintTime( bool show_dot); int time_offset, digit_offset, digit_h; int x, y, clock_x; + void Init(); static void CleanUpProc(void* arg); static void* TimerProc(void *arg); public: - CInfoClock(bool noVolume=false); + CInfoClock(); ~CInfoClock(); - static CInfoClock* getInstance(bool noVolume=false); + static CInfoClock* getInstance(); - void Init(bool noVolume=false); void StartClock(); void StopClock(); void ClearDisplay(); diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index e3fb93aa9..147b55deb 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -535,7 +535,7 @@ void CInfoViewer::showMovieTitle(const int playState, const std::string &Channel paintTime (show_dot, true); showRecordIcon (show_dot); show_dot = !show_dot; - showInfoFile(); + infoViewerBB->paintshowButtonBar(); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString(ChanNameX + 10 , ChanNameY + time_height,BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 5 ,ChannelName, COL_INFOBAR, 0, true); // UTF-8 @@ -593,6 +593,8 @@ void CInfoViewer::showMovieTitle(const int playState, const std::string &Channel frameBuffer->paintIcon(playicon, icon_x, icon_y); showLcdPercentOver (); + showInfoFile(); + //loop(fadeValue, show_dot , fadeIn); loop(show_dot); aspectRatio = 0; @@ -693,7 +695,6 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con showRecordIcon (show_dot); show_dot = !show_dot; - showInfoFile(); if (showButtonBar) { infoViewerBB->paintshowButtonBar(); } @@ -790,7 +791,9 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con } else { show_current_next(new_chan,epgpos); } + showLcdPercentOver (); + showInfoFile(); #if 0 if ((g_RemoteControl->current_channel_id == channel_id) && !(((info_CurrentNext.flags & CSectionsdClient::epgflags::has_next) && (info_CurrentNext.flags & (CSectionsdClient::epgflags::has_current | CSectionsdClient::epgflags::has_no_current))) || (info_CurrentNext.flags & CSectionsdClient::epgflags::not_broadcast))) { @@ -1859,12 +1862,17 @@ void CInfoViewer::showInfoFile() return; } + //get width of progressbar timescale + int pb_w = 0; + if ( (timescale != NULL) && (g_settings.infobar_progressbar == 0) ) { + pb_w = timescale->getWidth(); + } + //set position of info area const int oOffset = 140; // outer left/right offset - const int pb_w = 112; // same value as int pb_w in display_Info() const int xStart = BoxStartX + ChanWidth + oOffset; const int yStart = BoxStartY; - const int width = BoxEndX - xStart - (g_settings.infobar_progressbar ? oOffset : oOffset + pb_w); + const int width = BoxEndX - xStart - oOffset - pb_w; const int height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight() + 2; //create info object diff --git a/src/gui/mediaplayer.cpp b/src/gui/mediaplayer.cpp index b7998ca51..b120e528d 100644 --- a/src/gui/mediaplayer.cpp +++ b/src/gui/mediaplayer.cpp @@ -38,6 +38,7 @@ #include #include +#include #include #include #if ENABLE_UPNP @@ -87,30 +88,35 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey) if (parent) parent->hide(); + CAudioMute *audiomute = CAudioMute::getInstance(); if (actionKey == "audioplayer") { + audiomute->enableMuteIcon(false); if (audioPlayer == NULL) audioPlayer = new CAudioPlayerGui(); int res = audioPlayer->exec(NULL, "init"); - + audiomute->enableMuteIcon(true); return res /*menu_return::RETURN_REPAINT*/; } else if (actionKey == "inetplayer") { + audiomute->enableMuteIcon(false); if (inetPlayer == NULL) inetPlayer = new CAudioPlayerGui(true); int res = inetPlayer->exec(NULL, "init"); - + audiomute->enableMuteIcon(true); return res; //menu_return::RETURN_REPAINT; } else if (actionKey == "movieplayer") { + audiomute->enableMuteIcon(false); int mode = CNeutrinoApp::getInstance()->getMode(); if( mode == NeutrinoMessages::mode_radio ) videoDecoder->StopPicture(); int res = CMoviePlayerGui::getInstance().exec(NULL, "tsmoviebrowser"); if( mode == NeutrinoMessages::mode_radio ) videoDecoder->ShowPicture(DATADIR "/neutrino/icons/radiomode.jpg"); + audiomute->enableMuteIcon(true); return res; } diff --git a/src/gui/mediaplayer.h b/src/gui/mediaplayer.h index a52199d8b..e2b6710d7 100644 --- a/src/gui/mediaplayer.h +++ b/src/gui/mediaplayer.h @@ -63,6 +63,7 @@ class CMediaPlayerMenu : public CMenuTarget int exec(CMenuTarget* parent, const std::string & actionKey); void setMenuTitel(const neutrino_locale_t title = LOCALE_MAINMENU_MEDIA){menu_title = title;}; void setUsageMode(const int& mm_mode = MODE_DEFAULT){usage_mode = mm_mode;}; + CAudioPlayerGui *getPlayerInstance() { if (audioPlayer != NULL) return audioPlayer; else if (inetPlayer != NULL) return inetPlayer; else return NULL; } }; diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser.h index 70f9523a9..a4df89ba4 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -499,7 +499,7 @@ class CDirMenu : public CMenuWidget }; -// EPG Genre , taken from epgview, TODO: migth be splitted in major/minor to increase handling, might be moved to CMovieInfo +// EPG Genre, taken from epgview, TODO: might be splitted in major/minor to increase handling #define GENRE_ALL_COUNT 76 const CMenuOptionChooser::keyval GENRE_ALL[GENRE_ALL_COUNT] = { @@ -581,137 +581,6 @@ const CMenuOptionChooser::keyval GENRE_ALL[GENRE_ALL_COUNT] = { 0xA7, LOCALE_GENRE_TRAVEL_HOBBIES_7 } }; -#define GENRE_MOVIE_COUNT 9 -const CMenuOptionChooser::keyval genre_movie[GENRE_MOVIE_COUNT] = -{ - { 0, LOCALE_GENRE_MOVIE_0 }, - { 1, LOCALE_GENRE_MOVIE_1 }, - { 2, LOCALE_GENRE_MOVIE_2 }, - { 3, LOCALE_GENRE_MOVIE_3 }, - { 4, LOCALE_GENRE_MOVIE_4 }, - { 5, LOCALE_GENRE_MOVIE_5 }, - { 6, LOCALE_GENRE_MOVIE_6 }, - { 7, LOCALE_GENRE_MOVIE_7 }, - { 8, LOCALE_GENRE_MOVIE_8 } -}; -#define GENRE_NEWS_COUNT 5 -const CMenuOptionChooser::keyval genre_news[GENRE_NEWS_COUNT] = -{ - { 0, LOCALE_GENRE_NEWS_0 }, - { 1, LOCALE_GENRE_NEWS_1 }, - { 2, LOCALE_GENRE_NEWS_2 }, - { 3, LOCALE_GENRE_NEWS_3 }, - { 4, LOCALE_GENRE_NEWS_4 } -}; -#define GENRE_SHOW_COUNT 4 -const CMenuOptionChooser::keyval genre_show[GENRE_SHOW_COUNT] = -{ - { 0, LOCALE_GENRE_SHOW_0 }, - { 1, LOCALE_GENRE_SHOW_1 }, - { 2, LOCALE_GENRE_SHOW_2 }, - { 3, LOCALE_GENRE_SHOW_3 } -}; -#define GENRE_SPORTS_COUNT 12 -const CMenuOptionChooser::keyval genre_sports[GENRE_SPORTS_COUNT] = -{ - { 0, LOCALE_GENRE_SPORTS_0 }, - { 1, LOCALE_GENRE_SPORTS_1 }, - { 2, LOCALE_GENRE_SPORTS_2 }, - { 3, LOCALE_GENRE_SPORTS_3 }, - { 4, LOCALE_GENRE_SPORTS_4 }, - { 5, LOCALE_GENRE_SPORTS_5 }, - { 6, LOCALE_GENRE_SPORTS_6 }, - { 7, LOCALE_GENRE_SPORTS_7 }, - { 8, LOCALE_GENRE_SPORTS_8 }, - { 9, LOCALE_GENRE_SPORTS_9 }, - {10, LOCALE_GENRE_SPORTS_10 }, - {11, LOCALE_GENRE_SPORTS_11 } -}; -#define GENRE_CHILDRENS_PROGRAMMES_COUNT 6 -const CMenuOptionChooser::keyval genre_childrens_programmes[GENRE_CHILDRENS_PROGRAMMES_COUNT] = -{ - { 0, LOCALE_GENRE_CHILDRENS_PROGRAMMES_0 }, - { 1, LOCALE_GENRE_CHILDRENS_PROGRAMMES_1 }, - { 2, LOCALE_GENRE_CHILDRENS_PROGRAMMES_2 }, - { 3, LOCALE_GENRE_CHILDRENS_PROGRAMMES_3 }, - { 4, LOCALE_GENRE_CHILDRENS_PROGRAMMES_4 }, - { 5, LOCALE_GENRE_CHILDRENS_PROGRAMMES_5 } -}; -#define GENRE_MUSIC_DANCE_COUNT 7 -const CMenuOptionChooser::keyval genre_music_dance[GENRE_MUSIC_DANCE_COUNT] = -{ - { 0, LOCALE_GENRE_MUSIC_DANCE_0 }, - { 1, LOCALE_GENRE_MUSIC_DANCE_1 }, - { 2, LOCALE_GENRE_MUSIC_DANCE_2 }, - { 3, LOCALE_GENRE_MUSIC_DANCE_3 }, - { 4, LOCALE_GENRE_MUSIC_DANCE_4 }, - { 5, LOCALE_GENRE_MUSIC_DANCE_5 }, - { 6, LOCALE_GENRE_MUSIC_DANCE_6 } -}; -#define GENRE_ARTS_COUNT 12 -const CMenuOptionChooser::keyval genre_arts_dance[GENRE_ARTS_COUNT] = -{ - { 0, LOCALE_GENRE_ARTS_0 }, - { 1, LOCALE_GENRE_ARTS_1 }, - { 2, LOCALE_GENRE_ARTS_2 }, - { 3, LOCALE_GENRE_ARTS_3 }, - { 4, LOCALE_GENRE_ARTS_4 }, - { 5, LOCALE_GENRE_ARTS_5 }, - { 6, LOCALE_GENRE_ARTS_6 }, - { 7, LOCALE_GENRE_ARTS_7 }, - { 8, LOCALE_GENRE_ARTS_8 }, - { 9, LOCALE_GENRE_ARTS_9 }, - {10, LOCALE_GENRE_ARTS_10 }, - {11, LOCALE_GENRE_ARTS_11 } -}; -#define GENRE_SOCIAL_POLITICAL_COUNT 4 -const CMenuOptionChooser::keyval genre_social_political[GENRE_SOCIAL_POLITICAL_COUNT] = -{ - { 0, LOCALE_GENRE_SOCIAL_POLITICAL_0 }, - { 1, LOCALE_GENRE_SOCIAL_POLITICAL_1 }, - { 2, LOCALE_GENRE_SOCIAL_POLITICAL_2 }, - { 3, LOCALE_GENRE_SOCIAL_POLITICAL_3 } -}; -#define GENRE_DOCUS_MAGAZINES_COUNT 8 -const CMenuOptionChooser::keyval genre_docus_magazines[GENRE_DOCUS_MAGAZINES_COUNT] = -{ - { 0, LOCALE_GENRE_DOCUS_MAGAZINES_0 }, - { 1, LOCALE_GENRE_DOCUS_MAGAZINES_1 }, - { 2, LOCALE_GENRE_DOCUS_MAGAZINES_2 }, - { 3, LOCALE_GENRE_DOCUS_MAGAZINES_3 }, - { 4, LOCALE_GENRE_DOCUS_MAGAZINES_4 }, - { 5, LOCALE_GENRE_DOCUS_MAGAZINES_5 }, - { 6, LOCALE_GENRE_DOCUS_MAGAZINES_6 }, - { 7, LOCALE_GENRE_DOCUS_MAGAZINES_7 } -}; -#define GENRE_TRAVEL_HOBBIES_COUNT 8 -const CMenuOptionChooser::keyval genre_travel_hobbies[GENRE_TRAVEL_HOBBIES_COUNT] = -{ - { 0, LOCALE_GENRE_TRAVEL_HOBBIES_0 }, - { 1, LOCALE_GENRE_TRAVEL_HOBBIES_1 }, - { 2, LOCALE_GENRE_TRAVEL_HOBBIES_2 }, - { 3, LOCALE_GENRE_TRAVEL_HOBBIES_3 }, - { 4, LOCALE_GENRE_TRAVEL_HOBBIES_4 }, - { 5, LOCALE_GENRE_TRAVEL_HOBBIES_5 }, - { 6, LOCALE_GENRE_TRAVEL_HOBBIES_6 }, - { 7, LOCALE_GENRE_TRAVEL_HOBBIES_7 } -}; - -#define GENRE_MAJOR_COUNT 10 -const CMenuOptionChooser::keyval genre_major[GENRE_MAJOR_COUNT] = -{ - { 1, LOCALE_GENRE_MOVIE_0 }, - { 2, LOCALE_GENRE_NEWS_0 }, - { 3, LOCALE_GENRE_SHOW_0 }, - { 4, LOCALE_GENRE_SPORTS_0 }, - { 5, LOCALE_GENRE_CHILDRENS_PROGRAMMES_0 }, - { 6, LOCALE_GENRE_MUSIC_DANCE_0 }, - { 7, LOCALE_GENRE_ARTS_0 }, - { 8, LOCALE_GENRE_SOCIAL_POLITICAL_0 }, - { 9, LOCALE_GENRE_DOCUS_MAGAZINES_0 }, - { 10, LOCALE_GENRE_TRAVEL_HOBBIES_0} -}; - #endif /*MOVIEBROWSER_H_*/ diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index a279b972b..a8b46c4b3 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -53,6 +53,8 @@ #include #include +#include + //#define XMLTREE_LIB #ifdef XMLTREE_LIB #include @@ -480,6 +482,24 @@ void CMovieInfo::showMovieInfo(MI_MOVIE_INFO & movie_info) print_buffer += movie_info.audioPids[i].epgAudioPidName; print_buffer += ", "; } + print_buffer.erase(print_buffer.size()-2); + } + if (movie_info.genreMajor != 0) + { + neutrino_locale_t locale_genre; + unsigned char i = (movie_info.genreMajor & 0x0F0); + if (i >= 0x010 && i < 0x0B0) + { + i >>= 4; + i--; + locale_genre = genre_sub_classes_list[i][((movie_info.genreMajor & 0x0F) < genre_sub_classes[i]) ? (movie_info.genreMajor & 0x0F) : 0]; + } + else + locale_genre = LOCALE_GENRE_UNKNOWN; + print_buffer += "\n"; + print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR); + print_buffer += ": "; + print_buffer += g_Locale->getText(locale_genre); } print_buffer += "\n\n"; diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 44ea673f4..7891ee078 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -381,6 +382,7 @@ bool CMoviePlayerGui::SelectFile() menu_ret = moviebrowser->getMenuRet(); } else { // filebrowser + CAudioMute::getInstance()->enableMuteIcon(false); if (filebrowser->exec(Path_local.c_str()) == true) { Path_local = filebrowser->getCurrentDir(); CFile *file; @@ -416,6 +418,7 @@ bool CMoviePlayerGui::SelectFile() } } else menu_ret = filebrowser->getMenuRet(); + CAudioMute::getInstance()->enableMuteIcon(true); } if(ret && file_name.empty()) { std::string::size_type pos = full_name.find_last_of('/'); @@ -507,6 +510,8 @@ void CMoviePlayerGui::PlayFile(void) } } + CAudioMute::getInstance()->enableMuteIcon(true); + while (playstate >= CMoviePlayerGui::PLAY) { if (update_lcd) { @@ -742,6 +747,8 @@ void CMoviePlayerGui::PlayFile(void) restoreNeutrino(); + CAudioMute::getInstance()->enableMuteIcon(false); + if (g_settings.mode_clock) InfoClock->StartClock(); } diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 6125fc8b2..cacbdaad8 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -69,10 +69,12 @@ COsdSetup::COsdSetup(bool wizard_mode) colorSetupNotifier = new CColorSetupNotifier(); fontsizenotifier = new CFontSizeNotifier; osd_menu = NULL; + submenu_menus = NULL; is_wizard = wizard_mode; width = w_max (40, 10); //% + show_menu_hints = 0; show_tuner_icon = 0; } @@ -338,8 +340,8 @@ const CMenuOptionChooser::keyval VOLUMEBAR_DISP_POS_OPTIONS[VOLUMEBAR_DISP_POS_ { 1 , LOCALE_SETTINGS_POS_TOP_LEFT }, { 2 , LOCALE_SETTINGS_POS_BOTTOM_LEFT }, { 3 , LOCALE_SETTINGS_POS_BOTTOM_RIGHT }, - { 4 , LOCALE_SETTINGS_POS_DEFAULT_CENTER }, - { 5 , LOCALE_SETTINGS_POS_HIGHER_CENTER } + { 4 , LOCALE_SETTINGS_POS_TOP_CENTER }, + { 5 , LOCALE_SETTINGS_POS_BOTTOM_CENTER } }; #define MENU_DISP_POS_OPTIONS_COUNT 5 @@ -411,6 +413,8 @@ const CMenuOptionChooser::keyval PROGRESSBAR_COLOR_OPTIONS[PROGRESSBAR_COLOR_OPT //show osd setup int COsdSetup::showOsdSetup() { + int shortcut = 1; + //osd main menu osd_menu = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_COLORS, width, MN_WIDGET_ID_OSDSETUP); osd_menu->setWizardMode(is_wizard); @@ -447,36 +451,52 @@ int COsdSetup::showOsdSetup() mf->setHint("", LOCALE_MENU_HINT_SCREEN_SETUP); osd_menu->addItem(mf); + //menus + CMenuWidget osd_menu_menus(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_OSDSETUP_MENUS); + showOsdMenusSetup(&osd_menu_menus); + mf = new CMenuForwarder(LOCALE_SETTINGS_MENUS, true, NULL, &osd_menu_menus, NULL, CRCInput::convertDigitToKey(shortcut++)); + mf->setHint("", LOCALE_MENU_HINT_MENUS); + osd_menu->addItem(mf); + //infobar CMenuWidget osd_menu_infobar(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_OSDSETUP_INFOBAR); showOsdInfobarSetup(&osd_menu_infobar); - mf = new CMenuForwarder(LOCALE_MISCSETTINGS_INFOBAR, true, NULL, &osd_menu_infobar, NULL, CRCInput::RC_1); + mf = new CMenuForwarder(LOCALE_MISCSETTINGS_INFOBAR, true, NULL, &osd_menu_infobar, NULL, CRCInput::convertDigitToKey(shortcut++)); mf->setHint("", LOCALE_MENU_HINT_INFOBAR_SETUP); osd_menu->addItem(mf); //channellist CMenuWidget osd_menu_chanlist(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_OSDSETUP_CHANNELLIST); showOsdChanlistSetup(&osd_menu_chanlist); - mf = new CMenuForwarder(LOCALE_MISCSETTINGS_CHANNELLIST, true, NULL, &osd_menu_chanlist, NULL, CRCInput::RC_2); + mf = new CMenuForwarder(LOCALE_MISCSETTINGS_CHANNELLIST, true, NULL, &osd_menu_chanlist, NULL, CRCInput::convertDigitToKey(shortcut++)); mf->setHint("", LOCALE_MENU_HINT_CHANNELLIST_SETUP); osd_menu->addItem(mf); //eventlist CMenuWidget osd_menu_eventlist(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_OSDSETUP_EVENTLIST); showOsdEventlistSetup(&osd_menu_eventlist); - mf = new CMenuForwarder(LOCALE_EVENTLIST_NAME, true, NULL, &osd_menu_eventlist, NULL, CRCInput::RC_4); + mf = new CMenuForwarder(LOCALE_EVENTLIST_NAME, true, NULL, &osd_menu_eventlist, NULL, CRCInput::convertDigitToKey(shortcut++)); mf->setHint("", LOCALE_MENU_HINT_EVENTLIST_SETUP); osd_menu->addItem(mf); + //volume + CMenuWidget osd_menu_volume(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_OSDSETUP_VOLUME); + showOsdVolumeSetup(&osd_menu_volume); + mf = new CMenuForwarder(LOCALE_MISCSETTINGS_VOLUME, true, NULL, &osd_menu_volume, NULL, CRCInput::convertDigitToKey(shortcut++)); + mf->setHint("", LOCALE_MENU_HINT_VOLUME); + osd_menu->addItem(mf); + #ifdef SCREENSHOT //screenshot CMenuWidget osd_menu_screenshot(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_OSDSETUP_SCREENSHOT); showOsdScreenShotSetup(&osd_menu_screenshot); - mf = new CMenuForwarder(LOCALE_SCREENSHOT_MENU, true, NULL, &osd_menu_screenshot, NULL, CRCInput::RC_5); + mf = new CMenuForwarder(LOCALE_SCREENSHOT_MENU, true, NULL, &osd_menu_screenshot, NULL, CRCInput::convertDigitToKey(shortcut++)); mf->setHint("", LOCALE_MENU_HINT_SCREENSHOT_SETUP); osd_menu->addItem(mf); #endif + osd_menu->addItem(GenericMenuSeparatorLine); + //monitor CMenuOptionChooser *mc; if (cs_get_revision() != 1) { /* 1 == Tripledragon */ @@ -484,49 +504,13 @@ int COsdSetup::showOsdSetup() mc->setHint("", LOCALE_MENU_HINT_OSD_PRESET); osd_menu->addItem(mc); } - osd_menu->addItem(GenericMenuSeparatorLine); - // corners + + // round corners int rounded_corners = g_settings.rounded_corners; mc = new CMenuOptionChooser(LOCALE_EXTRA_ROUNDED_CORNERS, &rounded_corners, MENU_CORNERSETTINGS_TYPE_OPTIONS, MENU_CORNERSETTINGS_TYPE_OPTION_COUNT, true, this); mc->setHint("", LOCALE_MENU_HINT_ROUNDED_CORNERS); osd_menu->addItem(mc); - // scrambled - mc = new CMenuOptionChooser(LOCALE_EXTRA_SCRAMBLED_MESSAGE, &g_settings.scrambled_message, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); - mc->setHint("", LOCALE_MENU_HINT_SCRAMBLED_MESSAGE); - osd_menu->addItem(mc); - - // subchannel menu position - mc = new CMenuOptionChooser(LOCALE_INFOVIEWER_SUBCHAN_DISP_POS, &g_settings.infobar_subchan_disp_pos, INFOBAR_SUBCHAN_DISP_POS_OPTIONS, INFOBAR_SUBCHAN_DISP_POS_OPTIONS_COUNT, true); - mc->setHint("", LOCALE_MENU_HINT_SUBCHANNEL_POS); - osd_menu->addItem(mc); - - // volume position - mc = new CMenuOptionChooser(LOCALE_EXTRA_VOLUME_POS, &g_settings.volume_pos, VOLUMEBAR_DISP_POS_OPTIONS, VOLUMEBAR_DISP_POS_OPTIONS_COUNT, true, this); - mc->setHint("", LOCALE_MENU_HINT_VOLUME_POS); - osd_menu->addItem(mc); - - // volume digits - mc = new CMenuOptionChooser(LOCALE_EXTRA_VOLUME_DIGITS, &g_settings.volume_digits, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); - mc->setHint("", LOCALE_MENU_HINT_VOLUME_DIGITS); - osd_menu->addItem(mc); - - // show mute at volume 0 - mc = new CMenuOptionChooser(LOCALE_EXTRA_SHOW_MUTE_ICON, &g_settings.show_mute_icon, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); - mc->setHint("", LOCALE_MENU_HINT_SHOW_MUTE_ICON); - osd_menu->addItem(mc); - - // menu position - mc = new CMenuOptionChooser(LOCALE_SETTINGS_MENU_POS, &g_settings.menu_pos, MENU_DISP_POS_OPTIONS, MENU_DISP_POS_OPTIONS_COUNT, true, this); - mc->setHint("", LOCALE_MENU_HINT_MENU_POS); - osd_menu->addItem(mc); - - // menu hints - int show_hints = g_settings.show_menu_hints; - mc = new CMenuOptionChooser(LOCALE_SETTINGS_MENU_HINTS, &show_hints, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); - mc->setHint("", LOCALE_MENU_HINT_MENU_HINTS); - osd_menu->addItem(mc); - // fade windows mc = new CMenuOptionChooser(LOCALE_COLORMENU_FADE, &g_settings.widget_fade, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true ); mc->setHint("", LOCALE_MENU_HINT_FADE); @@ -542,6 +526,17 @@ int COsdSetup::showOsdSetup() mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_PROGRESSBAR_DESIGN_LONG, &pb_color, PROGRESSBAR_COLOR_OPTIONS, PROGRESSBAR_COLOR_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_PROGRESSBAR_COLOR); osd_menu->addItem(mc); + osd_menu->addItem(GenericMenuSeparatorLine); + + // scrambled + mc = new CMenuOptionChooser(LOCALE_EXTRA_SCRAMBLED_MESSAGE, &g_settings.scrambled_message, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_SCRAMBLED_MESSAGE); + osd_menu->addItem(mc); + + // subchannel menu position + mc = new CMenuOptionChooser(LOCALE_INFOVIEWER_SUBCHAN_DISP_POS, &g_settings.infobar_subchan_disp_pos, INFOBAR_SUBCHAN_DISP_POS_OPTIONS, INFOBAR_SUBCHAN_DISP_POS_OPTIONS_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_SUBCHANNEL_POS); + osd_menu->addItem(mc); int res = osd_menu->exec(NULL, ""); @@ -774,6 +769,26 @@ const CMenuOptionChooser::keyval LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_OPTION { 3 , LOCALE_MISCSETTINGS_PROGRESSBAR_INFOBAR_POSITION_3 } }; +//menus +void COsdSetup::showOsdMenusSetup(CMenuWidget *menu_menus) +{ + submenu_menus = menu_menus; + CMenuOptionChooser * mc; + + submenu_menus->addIntroItems(LOCALE_SETTINGS_MENUS); + + // menu position + mc = new CMenuOptionChooser(LOCALE_SETTINGS_MENU_POS, &g_settings.menu_pos, MENU_DISP_POS_OPTIONS, MENU_DISP_POS_OPTIONS_COUNT, true, this); + mc->setHint("", LOCALE_MENU_HINT_MENU_POS); + submenu_menus->addItem(mc); + + // menu hints + show_menu_hints = g_settings.show_menu_hints; + mc = new CMenuOptionChooser(LOCALE_SETTINGS_MENU_HINTS, &show_menu_hints, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); + mc->setHint("", LOCALE_MENU_HINT_MENU_HINTS); + submenu_menus->addItem(mc); +} + //infobar void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar) { @@ -897,17 +912,40 @@ void COsdSetup::showOsdEventlistSetup(CMenuWidget *menu_eventlist) menu_eventlist->addItem(mc); } +// volume +void COsdSetup::showOsdVolumeSetup(CMenuWidget *menu_volume) +{ + CMenuOptionChooser * mc; + + menu_volume->addIntroItems(LOCALE_MISCSETTINGS_VOLUME); + + // volume position + mc = new CMenuOptionChooser(LOCALE_EXTRA_VOLUME_POS, &g_settings.volume_pos, VOLUMEBAR_DISP_POS_OPTIONS, VOLUMEBAR_DISP_POS_OPTIONS_COUNT, true, this); + mc->setHint("", LOCALE_MENU_HINT_VOLUME_POS); + menu_volume->addItem(mc); + + // volume digits + mc = new CMenuOptionChooser(LOCALE_EXTRA_VOLUME_DIGITS, &g_settings.volume_digits, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); + mc->setHint("", LOCALE_MENU_HINT_VOLUME_DIGITS); + menu_volume->addItem(mc); + + // show mute at volume 0 + mc = new CMenuOptionChooser(LOCALE_EXTRA_SHOW_MUTE_ICON, &g_settings.show_mute_icon, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_SHOW_MUTE_ICON); + menu_volume->addItem(mc); +} + bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) { if(ARE_LOCALES_EQUAL(OptionName, LOCALE_COLORMENU_CONTRAST_FONTS)) return true; else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SETTINGS_MENU_POS)) { - osd_menu->hide(); + submenu_menus->hide(); return true; } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_SETTINGS_MENU_HINTS)) { /* change option after hide, to let hide clear hint */ - osd_menu->hide(); + submenu_menus->hide(); g_settings.show_menu_hints = * (int*) data; return true; } @@ -950,6 +988,10 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) g_Radiotext = NULL; } } + else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_EXTRA_VOLUME_DIGITS)) { + CVolumeHelper::getInstance()->refresh(); + return false; + } return false; } diff --git a/src/gui/osd_setup.h b/src/gui/osd_setup.h index d3a84ce30..d8c866131 100644 --- a/src/gui/osd_setup.h +++ b/src/gui/osd_setup.h @@ -46,18 +46,22 @@ class COsdSetup : public CMenuTarget, public CChangeObserver CColorSetupNotifier *colorSetupNotifier; CFontSizeNotifier *fontsizenotifier; CMenuWidget *osd_menu; + CMenuWidget *submenu_menus; int width; bool is_wizard; + int show_menu_hints; int show_tuner_icon; int showOsdSetup(); void showOsdMenueColorSetup(CMenuWidget *menu_colors); void showOsdFontSizeSetup(CMenuWidget *menu_fonts); void showOsdTimeoutSetup(CMenuWidget *menu_timeout); + void showOsdMenusSetup(CMenuWidget *menu_menus); void showOsdInfobarSetup(CMenuWidget *menu_infobar); void showOsdChanlistSetup(CMenuWidget *menu_chanlist); void showOsdEventlistSetup(CMenuWidget *menu_eventlist); + void showOsdVolumeSetup(CMenuWidget *menu_volume); void showOsdScreenShotSetup(CMenuWidget *menu_screenshot); void AddFontSettingItem(CMenuWidget &font_Settings, const SNeutrinoSettings::FONT_TYPES number_of_fontsize_entry); diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 26f37d02d..3e24e9f05 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -44,6 +44,7 @@ #include #include +#include #include #include @@ -239,6 +240,8 @@ int CPictureViewerGui::show() if (audioplayer) m_currentTitle = m_audioPlayer->getAudioPlayerM_current(); + CAudioMute::getInstance()->enableMuteIcon(false); + while (loop) { if (update) @@ -621,6 +624,9 @@ int CPictureViewerGui::show() } hide(); + if (!audioplayer) + CAudioMute::getInstance()->enableMuteIcon(true); + return(res); } diff --git a/src/gui/sleeptimer.cpp b/src/gui/sleeptimer.cpp index be0c70d32..08ebbbc20 100644 --- a/src/gui/sleeptimer.cpp +++ b/src/gui/sleeptimer.cpp @@ -4,13 +4,6 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Homepage: http://dbox.cyberphoria.org/ - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - License: GPL @@ -35,22 +28,30 @@ #include -#include -#include #include #include #include -#include +#include extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ #include +bool CSleepTimerWidget::is_running = false; + int CSleepTimerWidget::exec(CMenuTarget* parent, const std::string &actionKey) { - int res = menu_return::RETURN_REPAINT; + int res = menu_return::RETURN_REPAINT; + + if (is_running) + { + printf("[CSleepTimerWidget] %s: another instance is already running.\n", __FUNCTION__); + return res; + } + is_running = true; + int shutdown_min = 0; char value[16]; CStringInput *inbox; @@ -88,7 +89,10 @@ int CSleepTimerWidget::exec(CMenuTarget* parent, const std::string &actionKey) /* exit pressed, cancel timer setup */ if(ret == menu_return::RETURN_EXIT_REPAINT) + { + is_running = false; return res; + } int new_val = atoi(value); if(permanent) { @@ -107,5 +111,8 @@ int CSleepTimerWidget::exec(CMenuTarget* parent, const std::string &actionKey) else // set the sleeptimer to actual time + shutdown mins and announce 1 min before g_Timerd->setSleeptimer(time(NULL) + ((shutdown_min -1) * 60),time(NULL) + shutdown_min * 60,0); } + + is_running = false; + return res; } diff --git a/src/gui/sleeptimer.h b/src/gui/sleeptimer.h index 8215c34d2..dd02a34a8 100644 --- a/src/gui/sleeptimer.h +++ b/src/gui/sleeptimer.h @@ -27,8 +27,11 @@ class CSleepTimerWidget: public CMenuTarget { - public: - int exec(CMenuTarget* parent, const std::string & actionKey); + private: + static bool is_running; + + public: + int exec(CMenuTarget* parent, const std::string & actionKey); }; diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 38208caf5..cbfbda39e 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -34,6 +34,7 @@ #include #include +#include #include #include @@ -64,7 +65,6 @@ extern int cs_test_card(int unit, char * str); CTestMenu::CTestMenu() { width = w_max (50, 10); - selected = -1; circle = NULL; sq = NULL; pic= NULL; @@ -534,24 +534,22 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } - showTestMenu(); - - return res; + return showTestMenu(); } /* shows entries for proxy settings */ -void CTestMenu::showTestMenu() +int CTestMenu::showTestMenu() { unsigned int system_rev = cs_get_revision(); //init char rev[255]; sprintf(rev, "Test menu, System revision %d %s", system_rev, system_rev == 0 ? "WARNING - INVALID" : ""); - CMenuWidget w_test(rev /*"Test menu"*/, NEUTRINO_ICON_INFO, width); + CMenuWidget w_test(rev /*"Test menu"*/, NEUTRINO_ICON_INFO, width, MN_WIDGET_ID_TESTMENU); w_test.addIntroItems(); //hardware - CMenuWidget * w_hw = new CMenuWidget("Hardware Test", NEUTRINO_ICON_INFO, width); + CMenuWidget * w_hw = new CMenuWidget("Hardware Test", NEUTRINO_ICON_INFO, width, MN_WIDGET_ID_TESTMENU_HARDWARE); w_test.addItem(new CMenuForwarderNonLocalized(w_hw->getName().c_str(), true, NULL, w_hw)); showHWTests(w_hw); @@ -559,18 +557,16 @@ void CTestMenu::showTestMenu() w_test.addItem(new CMenuForwarderNonLocalized("Buttons", true, NULL, this, "buttons")); //components - CMenuWidget * w_cc = new CMenuWidget("OSD-Components Demo", NEUTRINO_ICON_INFO, width); + CMenuWidget * w_cc = new CMenuWidget("OSD-Components Demo", NEUTRINO_ICON_INFO, width, MN_WIDGET_ID_TESTMENU_COMPONENTS); w_test.addItem(new CMenuForwarderNonLocalized(w_cc->getName().c_str(), true, NULL, w_cc)); showCCTests(w_cc); //exit - w_test.exec(NULL, ""); - selected = w_test.getSelected(); + return w_test.exec(NULL, "");; } void CTestMenu::showCCTests(CMenuWidget *widget) { - widget->setSelected(selected); widget->addIntroItems(); widget->addItem(new CMenuForwarderNonLocalized("Button", true, NULL, this, "button")); widget->addItem(new CMenuForwarderNonLocalized("Circle", true, NULL, this, "circle")); @@ -585,7 +581,6 @@ void CTestMenu::showCCTests(CMenuWidget *widget) void CTestMenu::showHWTests(CMenuWidget *widget) { - widget->setSelected(selected); widget->addIntroItems(); widget->addItem(new CMenuForwarderNonLocalized("VFD", true, NULL, this, "vfd")); widget->addItem(new CMenuForwarderNonLocalized("Network", true, NULL, this, "network")); diff --git a/src/gui/test_menu.h b/src/gui/test_menu.h index 1b3e58504..b84f75970 100644 --- a/src/gui/test_menu.h +++ b/src/gui/test_menu.h @@ -52,7 +52,7 @@ class CTestMenu : public CMenuTarget CComponentsButton *button; int width, selected; - void showTestMenu(); + int showTestMenu(); void showHWTests(CMenuWidget *widget); void showCCTests(CMenuWidget *widget); diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index d9672d6cc..709d85f64 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -53,6 +53,7 @@ #include +#include #include #include #include @@ -397,6 +398,8 @@ void CUpnpBrowserGui::selectDevice() return; } + CAudioMute::getInstance()->enableMuteIcon(false); + while (loop) { if (changed) @@ -489,6 +492,8 @@ void CUpnpBrowserGui::selectDevice() } } delete scanBox; + + CAudioMute::getInstance()->enableMuteIcon(true); } //------------------------------------------------------------------------ diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index 65ead0134..8e45cfa89 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -28,7 +28,6 @@ #include #endif - #include "gui/volumebar.h" #include @@ -37,6 +36,9 @@ using namespace std; +//default vol_height +#define VOL_HEIGHT 36 + CVolumeBar::CVolumeBar() { initVarVolumeBar(); @@ -47,7 +49,6 @@ void CVolumeBar::initVarVolumeBar() //init inherited variables initVarForm(); col_body = COL_MENUCONTENT_PLUS_0; - height = 36; //default height //init variables this @@ -57,12 +58,6 @@ void CVolumeBar::initVarVolumeBar() //items //icon object vb_icon = NULL; - // icon whith / height - int tmp_h = 0; - frameBuffer->getIconSize(NEUTRINO_ICON_VOLUME, &icon_w, &tmp_h); - icon_w += 12; - tmp_h += 4; - height = max(height, tmp_h); //progressbar object vb_pb = NULL; @@ -87,16 +82,14 @@ void CVolumeBar::initVarVolumeBar() //calculates size referred for possible activated clock or/and mute icon void CVolumeBar::initVolumeBarSize() { - int tmp_h = height; - - // digit whith / height - if (g_settings.volume_digits) { - tmp_h = g_Font[VolumeFont]->getDigitHeight() + (g_Font[VolumeFont]->getDigitOffset() * 18) / 10; - height = max(height, tmp_h); + // digit whith + if (g_settings.volume_digits) digit_w = g_Font[VolumeFont]->getRenderWidth("100 "); - } else digit_w = 0; + int dummy = 0; + frameBuffer->getIconSize(NEUTRINO_ICON_VOLUME, &icon_w, &dummy); + icon_w += 12; //adapt x-pos icon_x = corner_rad + 2; @@ -112,30 +105,19 @@ void CVolumeBar::initVolumeBarSize() CVolumeHelper *cvh = CVolumeHelper::getInstance(); cvh->getSpacer(&h_spacer, &v_spacer); cvh->getDimensions(&x, &y, &sw, &sh); + cvh->getVolBarDimensions(&y, &height); // mute icon cvh->getMuteIconDimensions(&mute_ax, &mute_ay, &mute_dx, &mute_dy); - - clock_height = 0; - int clock_width = 0; + // info clock + cvh->getInfoClockDimensions(&dummy, &clock_y, &clock_width, &clock_height, &dummy, &dummy); int mute_corrY = 0; - if ((g_settings.mode_clock) && (g_settings.volume_pos == 0)) { - // Clock and MuteIcon in a line. - clock_height = CInfoClock::getInstance(true)->time_height; - clock_width = CInfoClock::getInstance(true)->time_width; - mute_corrY = (clock_height - mute_dy) / 2; - } - else { - // Volume level and MuteIcon in a line. - if (mute_dy > height) - y += (mute_dy - height) / 2; - else - mute_corrY = (height - mute_dy) / 2; - } + if (mute_dy < height) + mute_corrY = (height - mute_dy) / 2; cvh->setMuteIconCorrY(mute_corrY); if ((g_settings.mode_clock) && (!CNeutrinoApp::getInstance()->isMuted())) - frameBuffer->paintBackgroundBoxRel(sw - clock_width, y, clock_width, clock_height); + CInfoClock::getInstance()->ClearDisplay(); vb_pbh = height-8; vb_pby = height/2-vb_pbh/2; @@ -154,7 +136,7 @@ void CVolumeBar::initVolumeBarPosition() if ((neutrino->isMuted()) && (!g_settings.mode_clock)) x_corr = mute_dx + h_spacer; if (g_settings.mode_clock) - y += clock_height + v_spacer / 2; + y += max(clock_y + clock_height, mute_ay + mute_dy) /*+ v_spacer / 2*/; } x = sw - width - x_corr; break; @@ -290,22 +272,75 @@ CVolumeHelper::CVolumeHelper() h_spacer = 11; v_spacer = 6; - CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); - x = frameBuffer->getScreenX() + h_spacer; - y = frameBuffer->getScreenY() + v_spacer; - sw = g_settings.screen_EndX - h_spacer; - sh = frameBuffer->getScreenHeight(); + frameBuffer = CFrameBuffer::getInstance(); - int mute_icon_dx = 0; - int mute_icon_dy = 0; - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE, &mute_icon_dx, &mute_icon_dy); - mute_dx = mute_icon_dx; - mute_dy = mute_icon_dy; - mute_dx += mute_icon_dx / 4; - mute_dy += mute_icon_dx / 4; + Init(); +} + +void CVolumeHelper::Init() +{ + + x = frameBuffer->getScreenX() + h_spacer; + y = frameBuffer->getScreenY() + v_spacer; + sw = g_settings.screen_EndX - h_spacer; + sh = frameBuffer->getScreenHeight(); + + initVolBarHeight(); + initMuteIcon(); + initInfoClock(); +} + +void CVolumeHelper::initInfoClock() +{ + digit_offset = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getDigitOffset(); + digit_h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getDigitHeight(); + int t1 = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(widest_number); + int t2 = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(":"); + clock_dy = digit_h + (int)((float)digit_offset * 1.5); + clock_dx = t1*6 + t2*2; + clock_ax = sw - clock_dx; + clock_ay = y; + vol_ay = y; + mute_corrY = 0; + + if (g_settings.mode_clock) { + if (mute_dy > clock_dy) + clock_ay += (mute_dy - clock_dy) / 2; + else + mute_corrY = (clock_dy - mute_dy) / 2; + } + else { + if (mute_dy > vol_height) + vol_ay += (mute_dy - vol_height) / 2; + else + mute_corrY = (vol_height - mute_dy) / 2; + } +} + +void CVolumeHelper::initMuteIcon() +{ + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE, &mute_dx, &mute_dy); mute_ax = sw - mute_dx; mute_ay = y; - mute_corrY = 0; +} + +void CVolumeHelper::initVolBarHeight() +{ + vol_height = VOL_HEIGHT; + int tmp_h = 0; + int dummy = 0; + frameBuffer->getIconSize(NEUTRINO_ICON_VOLUME, &dummy, &tmp_h); + tmp_h += 4; + vol_height = max(vol_height, tmp_h); + if (g_settings.volume_digits) { + tmp_h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getDigitHeight() + (g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getDigitOffset() * 18) / 10; + vol_height = max(vol_height, tmp_h); + } +} + +void CVolumeHelper::refresh() +{ + Init(); } CVolumeHelper* CVolumeHelper::getInstance() diff --git a/src/gui/volumebar.h b/src/gui/volumebar.h index ce78b7f65..e44b2d881 100644 --- a/src/gui/volumebar.h +++ b/src/gui/volumebar.h @@ -44,7 +44,7 @@ class CVolumeBar : public CComponentsForm int h_spacer, v_spacer; //clock - int clock_height; + int clock_y, clock_width, clock_height; //volume value char *vb_vol; @@ -82,7 +82,15 @@ class CVolumeHelper private: int x, y, sw, sh; int mute_ax, mute_ay, mute_dx, mute_dy, mute_corrY; + int clock_ax, clock_ay, clock_dx, clock_dy, digit_h, digit_offset; int h_spacer, v_spacer; + int vol_ay, vol_height; + CFrameBuffer *frameBuffer; + + void Init(); + void initVolBarHeight(); + void initMuteIcon(); + void initInfoClock(); public: @@ -92,7 +100,10 @@ class CVolumeHelper void getSpacer(int *h, int *v) { *h = h_spacer; *v = v_spacer; } void getDimensions(int *_x, int *_y, int *_sw, int *_sh) { *_x = x; *_y = y; *_sw = sw; *_sh = sh; } void getMuteIconDimensions(int *_x, int *_y, int *w, int *h) { *_x = mute_ax; *_y = mute_ay+mute_corrY; *w = mute_dx; *h = mute_dy; } + void getInfoClockDimensions(int *_x, int *_y, int *w, int *h, int *d_h, int *d_o) { *_x = clock_ax; *_y = clock_ay; *w = clock_dx; *h = clock_dy, *d_h = digit_h, *d_o = digit_offset; } + void getVolBarDimensions(int *_y, int *_dy) { *_y = vol_ay; *_dy = vol_height; } void setMuteIconCorrY(int corr) { mute_corrY = corr; } + void refresh(); }; #endif diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index a7f0ee63a..7ccd061a1 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -987,7 +987,7 @@ void CMenuWidget::paintItems() int item_height=height-(item_start_y-y); frameBuffer->paintBoxRel(x+ width,item_start_y, 15, item_height, COL_MENUCONTENT_PLUS_1, RADIUS_MIN); frameBuffer->paintBoxRel(x+ width +2, item_start_y+ 2+ current_page*(item_height-4)/total_pages, 11, (item_height-4)/total_pages, COL_MENUCONTENT_PLUS_3, RADIUS_MIN); - if(current_page==total_pages-1){ + if((current_page==total_pages-1) || (current_page == 0 && RADIUS_MIN)){ frameBuffer->paintBoxRel(x,item_start_y, width,item_height, COL_MENUCONTENT_PLUS_0); } } diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index bd60dc22e..06c3a854d 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -439,6 +439,11 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & ) strcat(value, " "); strncpy(oldval, value, size); + fb_pixel_t * pixbuf = new fb_pixel_t[(width + SHADOW_OFFSET) * (hheight + bheight + SHADOW_OFFSET)]; + + if (pixbuf != NULL) + frameBuffer->SaveScreen(x, y, width + SHADOW_OFFSET, hheight + bheight + SHADOW_OFFSET, pixbuf); + paint(); frameBuffer->blit(); @@ -552,6 +557,12 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & ) hide(); + if (pixbuf != NULL) + { + frameBuffer->RestoreScreen(x, y, width + SHADOW_OFFSET, hheight + bheight + SHADOW_OFFSET, pixbuf); + delete[] pixbuf;//Mismatching allocation and deallocation: pixbuf + } + for(int count=size-1;count>=0;count--) { if((value[count]==' ') || (value[count]==0)) @@ -584,12 +595,13 @@ int CStringInput::handleOthers(const neutrino_msg_t /*msg*/, const neutrino_msg_ void CStringInput::hide() { - frameBuffer->paintBackgroundBoxRel(x, y, width, height); + frameBuffer->paintBackgroundBoxRel(x, y, width + SHADOW_OFFSET, height + SHADOW_OFFSET); frameBuffer->blit(); } void CStringInput::paint(bool sms) { + frameBuffer->paintBoxRel(x + SHADOW_OFFSET, y + SHADOW_OFFSET, width, hheight + bheight, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE, CORNER_ALL); //round frameBuffer->paintBoxRel(x, y, width, hheight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); //round frameBuffer->paintBoxRel(x, y + hheight, width, bheight, COL_MENUCONTENT_PLUS_0, sms ? 0 : RADIUS_LARGE, CORNER_BOTTOM); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 6bb208439..a5c2ccede 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -81,6 +81,7 @@ #include "gui/plugins.h" #include "gui/rc_lock.h" #include "gui/scan_setup.h" +#include "gui/sleeptimer.h" #include "gui/start_wizard.h" #include "gui/videosettings.h" @@ -2155,9 +2156,6 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) //if(!g_settings.cacheTXT) // tuxtxt_stop(); g_RCInput->clearRCMsg(); - // restore mute symbol - if (current_muted) - g_audioMute->AudioMute(current_muted, true); if(g_settings.mode_clock) InfoClock->StartClock(); StartSubtitles(); @@ -2168,9 +2166,6 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) if(g_settings.mode_clock) InfoClock->StopClock(); mainMenu.exec(NULL, ""); - // restore mute symbol - if (current_muted) - g_audioMute->AudioMute(current_muted, true); if(g_settings.mode_clock) InfoClock->StartClock(); StartSubtitles(); @@ -2491,13 +2486,14 @@ _show: //_show: if(msg == CRCInput::RC_ok) { + if (g_settings.channellist_new_zap_mode > 0) /* allow or active */ + g_audioMute->enableMuteIcon(false); if( !bouquetList->Bouquets.empty() && bouquetList->Bouquets[old_b]->channelList->getSize() > 0) nNewChannel = bouquetList->Bouquets[old_b]->channelList->exec();//with ZAP! else nNewChannel = bouquetList->exec(true); - // restore mute symbol - if (current_muted) - g_audioMute->AudioMute(current_muted, true); + if (g_settings.channellist_new_zap_mode > 0) /* allow or active */ + g_audioMute->enableMuteIcon(true); } else if(msg == CRCInput::RC_sat) { SetChannelMode(LIST_MODE_SAT); nNewChannel = bouquetList->exec(true); @@ -2691,6 +2687,12 @@ _repeat: g_videoSettings->SwitchFormat(); return messages_return::handled; } + else if( msg == CRCInput::RC_sleep ) { + CSleepTimerWidget *sleepTimer = new CSleepTimerWidget; + sleepTimer->exec(NULL, ""); + delete sleepTimer; + return messages_return::handled; + } #ifdef SCREENSHOT else if (msg == (neutrino_msg_t) g_settings.key_screenshot) { //video+osd scaled to osd size diff --git a/src/neutrino.h b/src/neutrino.h index 76f891516..bf470f6ad 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -82,6 +82,9 @@ typedef struct font_sizes_groups const neutrino_locale_t hint; } font_sizes_groups_struct; +extern const unsigned char genre_sub_classes[]; /* epgview.cpp */ +extern const neutrino_locale_t * genre_sub_classes_list[]; /* epgview.cpp */ + class CNeutrinoApp : public CMenuTarget, CChangeObserver { public: diff --git a/src/neutrino_menue.h b/src/neutrino_menue.h index dd62e51c8..712472094 100644 --- a/src/neutrino_menue.h +++ b/src/neutrino_menue.h @@ -54,6 +54,7 @@ enum MN_WIDGET_ID //osd setup MN_WIDGET_ID_OSDSETUP, + MN_WIDGET_ID_OSDSETUP_MENUS, MN_WIDGET_ID_OSDSETUP_CHANNELLIST, MN_WIDGET_ID_OSDSETUP_EVENTLIST, MN_WIDGET_ID_OSDSETUP_FONT, @@ -62,6 +63,7 @@ enum MN_WIDGET_ID MN_WIDGET_ID_OSDSETUP_MENUCOLORS, MN_WIDGET_ID_OSDSETUP_TIMEOUT, MN_WIDGET_ID_OSDSETUP_SCREENSHOT, + MN_WIDGET_ID_OSDSETUP_VOLUME, //actually it does not matter, but these 6 entries must be the same order as in menu MN_WIDGET_ID_OSDSETUP_FONTSIZE_MENU, MN_WIDGET_ID_OSDSETUP_FONTSIZE_CHANNELLIST, @@ -166,7 +168,11 @@ enum MN_WIDGET_ID MN_WIDGET_ID_SCAN_MANUAL_SCAN, MN_WIDGET_ID_SCAN_FAST_SCAN, MN_WIDGET_ID_SCAN_CABLE_SCAN, - + + MN_WIDGET_ID_TESTMENU, + MN_WIDGET_ID_TESTMENU_HARDWARE, + MN_WIDGET_ID_TESTMENU_COMPONENTS, + MN_WIDGET_ID_MAX }; diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 5612153e5..fda35eb27 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -738,6 +738,7 @@ static const struct key keynames[] = { {"KEY_NEXT", KEY_NEXT}, {"KEY_PREVIOUS", KEY_PREVIOUS}, {"KEY_TIME", KEY_TIME}, + {"KEY_SLEEP", KEY_SLEEP}, {"KEY_AUDIO", KEY_AUDIO}, {"KEY_REWIND", KEY_REWIND}, {"KEY_FORWARD", KEY_FORWARD}, diff --git a/src/nhttpd/web/Y_Blocks.txt b/src/nhttpd/web/Y_Blocks.txt index 15efccad1..c887e2822 100644 --- a/src/nhttpd/web/Y_Blocks.txt +++ b/src/nhttpd/web/Y_Blocks.txt @@ -595,6 +595,7 @@ start-block~remote_zee + diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 7796bd34c..d7dc12781 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -317,7 +317,7 @@ bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t mode) unlink(Dst); if ((fd1 = open(Src, O_RDONLY)) < 0) return false; - if ((fd2 = open(Dst, O_WRONLY | O_CREAT)) < 0) { + if ((fd2 = open(Dst, O_WRONLY | O_CREAT, 0666)) < 0) { close(fd1); return false; } diff --git a/src/system/locals.h b/src/system/locals.h index 4f962f3de..842432237 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -339,11 +339,16 @@ typedef enum LOCALE_EPGLIST_NOEVENTS, LOCALE_EPGVIEWER_MORE_SCREENINGS, LOCALE_EPGVIEWER_MORE_SCREENINGS_SHORT, + LOCALE_EPGVIEWER_AGE_RATING, + LOCALE_EPGVIEWER_AUDIO, + LOCALE_EPGVIEWER_GENRE, + LOCALE_EPGVIEWER_LENGTH, LOCALE_EPGVIEWER_NODETAILED, LOCALE_EPGVIEWER_NOTFOUND, LOCALE_EVENTFINDER_HEAD, LOCALE_EVENTFINDER_KEYWORD, LOCALE_EVENTFINDER_SEARCH, + LOCALE_EVENTFINDER_SEARCH_ALL_EPG, LOCALE_EVENTFINDER_SEARCH_WITHIN_EPG, LOCALE_EVENTFINDER_SEARCH_WITHIN_LIST, LOCALE_EVENTFINDER_SEARCHING, @@ -920,6 +925,7 @@ typedef enum LOCALE_MENU_HINT_MENU_FONTS, LOCALE_MENU_HINT_MENU_HINTS, LOCALE_MENU_HINT_MENU_POS, + LOCALE_MENU_HINT_MENUS, LOCALE_MENU_HINT_MISC_CEC, LOCALE_MENU_HINT_MISC_CHANNELLIST, LOCALE_MENU_HINT_MISC_ENERGY, @@ -1135,6 +1141,7 @@ typedef enum LOCALE_MENU_HINT_VIDEO_PIP, LOCALE_MENU_HINT_VIDEO_SATURATION, LOCALE_MENU_HINT_VIDEO_SCART_MODE, + LOCALE_MENU_HINT_VOLUME, LOCALE_MENU_HINT_VOLUME_DIGITS, LOCALE_MENU_HINT_VOLUME_POS, LOCALE_MENU_HINT_ZAP_CYCLE, @@ -1214,6 +1221,7 @@ typedef enum LOCALE_MISCSETTINGS_SHUTDOWN_REAL, LOCALE_MISCSETTINGS_SHUTDOWN_REAL_RCDELAY, LOCALE_MISCSETTINGS_SLEEPTIMER, + LOCALE_MISCSETTINGS_VOLUME, LOCALE_MISCSETTINGS_ZAPTO_PRE_TIME, LOCALE_MOTORCONTROL_CALC_POSITIONS, LOCALE_MOTORCONTROL_DISABLE_LIMIT, @@ -1730,12 +1738,14 @@ typedef enum LOCALE_SETTINGS_HELP, LOCALE_SETTINGS_MENU_HINTS, LOCALE_SETTINGS_MENU_POS, + LOCALE_SETTINGS_MENUS, LOCALE_SETTINGS_MISSINGOPTIONSCONFFILE, LOCALE_SETTINGS_NOCONFFILE, + LOCALE_SETTINGS_POS_BOTTOM_CENTER, LOCALE_SETTINGS_POS_BOTTOM_LEFT, LOCALE_SETTINGS_POS_BOTTOM_RIGHT, LOCALE_SETTINGS_POS_DEFAULT_CENTER, - LOCALE_SETTINGS_POS_HIGHER_CENTER, + LOCALE_SETTINGS_POS_TOP_CENTER, LOCALE_SETTINGS_POS_TOP_LEFT, LOCALE_SETTINGS_POS_TOP_RIGHT, LOCALE_SETTINGS_RESTORE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index de45cbb75..b4c370018 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -339,11 +339,16 @@ const char * locale_real_names[] = "epglist.noevents", "epgviewer.More_Screenings", "epgviewer.More_Screenings_short", + "epgviewer.age_rating", + "epgviewer.audio", + "epgviewer.genre", + "epgviewer.length", "epgviewer.nodetailed", "epgviewer.notfound", "eventfinder.head", "eventfinder.keyword", "eventfinder.search", + "eventfinder.search_all_epg", "eventfinder.search_within_epg", "eventfinder.search_within_list", "eventfinder.searching", @@ -920,6 +925,7 @@ const char * locale_real_names[] = "menu.hint_menu_fonts", "menu.hint_menu_hints", "menu.hint_menu_pos", + "menu.hint_menus", "menu.hint_misc_cec", "menu.hint_misc_channellist", "menu.hint_misc_energy", @@ -1135,6 +1141,7 @@ const char * locale_real_names[] = "menu.hint_video_pip", "menu.hint_video_saturation", "menu.hint_video_scart_mode", + "menu.hint_volume", "menu.hint_volume_digits", "menu.hint_volume_pos", "menu.hint_zap_cycle", @@ -1214,6 +1221,7 @@ const char * locale_real_names[] = "miscsettings.shutdown_real", "miscsettings.shutdown_real_rcdelay", "miscsettings.sleeptimer", + "miscsettings.volume", "miscsettings.zapto_pre_time", "motorcontrol.calc_positions", "motorcontrol.disable_limit", @@ -1730,12 +1738,14 @@ const char * locale_real_names[] = "settings.help", "settings.menu_hints", "settings.menu_pos", + "settings.menus", "settings.missingoptionsconffile", "settings.noconffile", + "settings.pos_bottom_center", "settings.pos_bottom_left", "settings.pos_bottom_right", "settings.pos_default_center", - "settings.pos_higher_center", + "settings.pos_top_center", "settings.pos_top_left", "settings.pos_top_right", "settings.restore", diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 71d38f381..36aef3354 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -244,8 +244,8 @@ bool CFontSizeNotifier::changeNotify(const neutrino_locale_t, void *) CNeutrinoApp::getInstance()->SetupFonts(); hintBox.hide(); - /* recalculate infoclock */ - CInfoClock::getInstance()->Init(); + /* recalculate infoclock/muteicon/volumebar */ + CVolumeHelper::getInstance()->refresh(); return true; }