diff --git a/data/fonts/DejaVuLGCSansMono-Bold.LICENSE b/data/fonts/DejaVuLGCSansMono-Bold.LICENSE new file mode 100644 index 000000000..635e609c8 --- /dev/null +++ b/data/fonts/DejaVuLGCSansMono-Bold.LICENSE @@ -0,0 +1,98 @@ +Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below) + +Bitstream Vera Fonts Copyright +------------------------------ + +Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is +a trademark of Bitstream, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of the fonts accompanying this license ("Fonts") and associated +documentation files (the "Font Software"), to reproduce and distribute the +Font Software, including without limitation the rights to use, copy, merge, +publish, distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to the +following conditions: + +The above copyright and trademark notices and this permission notice shall +be included in all copies of one or more of the Font Software typefaces. + +The Font Software may be modified, altered, or added to, and in particular +the designs of glyphs or characters in the Fonts may be modified and +additional glyphs or characters may be added to the Fonts, only if the fonts +are renamed to names not containing either the words "Bitstream" or the word +"Vera". + +This License becomes null and void to the extent applicable to Fonts or Font +Software that has been modified and is distributed under the "Bitstream +Vera" names. + +The Font Software may be sold as part of a larger software package but no +copy of one or more of the Font Software typefaces may be sold by itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME +FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING +ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE +FONT SOFTWARE. + +Except as contained in this notice, the names of Gnome, the Gnome +Foundation, and Bitstream Inc., shall not be used in advertising or +otherwise to promote the sale, use or other dealings in this Font Software +without prior written authorization from the Gnome Foundation or Bitstream +Inc., respectively. For further information, contact: fonts at gnome dot +org. + +Arev Fonts Copyright +------------------------------ + +Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the fonts accompanying this license ("Fonts") and +associated documentation files (the "Font Software"), to reproduce +and distribute the modifications to the Bitstream Vera Font Software, +including without limitation the rights to use, copy, merge, publish, +distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to +the following conditions: + +The above copyright and trademark notices and this permission notice +shall be included in all copies of one or more of the Font Software +typefaces. + +The Font Software may be modified, altered, or added to, and in +particular the designs of glyphs or characters in the Fonts may be +modified and additional glyphs or characters may be added to the +Fonts, only if the fonts are renamed to names not containing either +the words "Tavmjong Bah" or the word "Arev". + +This License becomes null and void to the extent applicable to Fonts +or Font Software that has been modified and is distributed under the +"Tavmjong Bah Arev" names. + +The Font Software may be sold as part of a larger software package but +no copy of one or more of the Font Software typefaces may be sold by +itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL +TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +Except as contained in this notice, the name of Tavmjong Bah shall not +be used in advertising or otherwise to promote the sale, use or other +dealings in this Font Software without prior written authorization +from Tavmjong Bah. For further information, contact: tavmjong @ free +. fr. + +$Id: LICENSE 778 2006-04-20 18:14:24Z moyogo $ diff --git a/data/fonts/DejaVuLGCSansMono-Bold.ttf b/data/fonts/DejaVuLGCSansMono-Bold.ttf new file mode 100644 index 000000000..b55beca47 Binary files /dev/null and b/data/fonts/DejaVuLGCSansMono-Bold.ttf differ diff --git a/data/locale/english.locale b/data/locale/english.locale index 211254d73..08141e6bb 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -222,6 +222,7 @@ colorchooser.red red colormenu.background Background colormenu.fade Fade menus colormenu.font Font size +colormenu.font_ttx Teletext font colormenu.gtx_alpha Transparency (GTX) colormenu.head Color Settings colormenu.menucolors Menucolor @@ -981,7 +982,7 @@ extra.zapit_menu Zapit options extra.zapit_make_bouquet Make Remaining Channels list extra.zapit_save_last_chan Save last channel extra.zapit_motor_speed Motor moving speed (10 = 1deg/sec) -extra.zapit_fe_timeout Tune timeout +extra.zapit_fe_timeout Tune timeout (1 = 10 msec) extra.add_to_bouquet Add to bouquet extra.key_list_start home extra.key_list_end end diff --git a/lib/libtuxtxt/teletext.h b/lib/libtuxtxt/teletext.h index 1fafd7a5c..6bc317171 100644 --- a/lib/libtuxtxt/teletext.h +++ b/lib/libtuxtxt/teletext.h @@ -9,6 +9,6 @@ extern int tuxtx_main(int _rc, int pid, int page = 0); void tuxtx_stop_subtitle(); int tuxtx_subtitle_running(int *pid, int *page, int *running); void tuxtx_pause_subtitle(bool pause = 1); -void tuxtx_set_pid(int pid, int page); +void tuxtx_set_pid(int pid, int page, char * cc); #endif diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index 2653ede78..b36cf8ef2 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -21,10 +21,19 @@ extern cVideo * videoDecoder; +static pthread_t ttx_sub_thread; +static int reader_running; +static int ttx_paused; +static int ttx_req_pause; +static int sub_pid, sub_page; +static bool use_gui; +static int cfg_national_subset; + +#define USE_FBPAN // FBIOPAN_DISPLAY seems to be working in current driver + void FillRect(int x, int y, int w, int h, int color) { unsigned char *p = lfb + x*4 + y * fix_screeninfo.line_length; -#if 1 unsigned int col = bgra[color][3] << 24 | bgra[color][2] << 16 | bgra[color][1] << 8 | bgra[color][0]; if (w > 0) for (int count = 0; count < h; count++) { @@ -33,18 +42,6 @@ void FillRect(int x, int y, int w, int h, int color) *(dest0++) = col; p += fix_screeninfo.line_length; } -#else - int xtmp; - if (w > 0) - for ( ; h > 0 ; h--) - { - for (xtmp=0; xtmp<=w; xtmp++) - { - memcpy(p+xtmp*4,bgra[color],4); - } - p += fix_screeninfo.line_length; - } -#endif } void FillBorder(int color) @@ -222,14 +219,13 @@ void RenderClearMenuLineBB(char *p, tstPageAttr *attrcol, tstPageAttr *attr) void ClearBB(int color) { - FillRect(0,(var_screeninfo.yres-var_screeninfo.yoffset),var_screeninfo.xres,var_screeninfo.yres, color); - //FillRect(0,(var_screeninfo.yres-var_screeninfo.yoffset),fix_screeninfo.line_length,var_screeninfo.yres, color); + FillRect(0, (var_screeninfo.yres - var_screeninfo.yoffset), var_screeninfo.xres, var_screeninfo.yres, color); } void ClearFB(int /*color*/) { - memset(lfb,0, var_screeninfo.yres*fix_screeninfo.line_length); - //FillRect(0,var_screeninfo.yoffset,fix_screeninfo.line_length,var_screeninfo.yres,color); + //memset(lfb,0, var_screeninfo.yres*fix_screeninfo.line_length); + CFrameBuffer::getInstance()->paintBackground(); } void ClearB(int color) @@ -237,7 +233,6 @@ void ClearB(int color) FillRect(0,0,var_screeninfo.xres,var_screeninfo.yres*2,color); } - int GetCurFontWidth() { int mx = (displaywidth)%(40-nofirst); // # of unused pixels @@ -277,7 +272,6 @@ void setfontwidth(int newwidth) } } - void setcolors(unsigned short *pcolormap, int offset, int number) { int i,trans_tmp; @@ -305,7 +299,6 @@ void setcolors(unsigned short *pcolormap, int offset, int number) } } - /* hexdump of page contents to stdout for debugging */ void dump_page() { @@ -329,7 +322,6 @@ void dump_page() } } - /* get object data */ /* in: absolute triplet number (0..506, start at packet 3 byte 1) */ /* in: pointer to cache struct of page data */ @@ -1467,27 +1459,30 @@ void eval_l25() } } - if (boxed || transpmode) -// FullScrColor = transp; + if (boxed || transpmode) { FillBorder(transp); - else + } else if(use_gui) { FillBorder(FullScrColor); + } if (colortable) /* as late as possible to shorten the time the old page is displayed with the new colors */ setcolors(colortable, 16, 16); /* set colors for CLUTs 2+3 */ } /* is_dec(page) */ - } /****************************************************************************** * main loop * ******************************************************************************/ - -static pthread_t ttx_sub_thread; -static int reader_running; -static int ttx_paused; -static int ttx_req_pause; -static int sub_pid, sub_page; -static bool use_gui; +static void cleanup_fb_pan() +{ +#ifdef USE_FBPAN + if (var_screeninfo.yoffset) + { + var_screeninfo.yoffset = 0; + if (ioctl(fb, FBIOPAN_DISPLAY, &var_screeninfo) == -1) + perror("TuxTxt "); + } +#endif +} static void* reader_thread(void * /*arg*/) { @@ -1506,6 +1501,7 @@ static void* reader_thread(void * /*arg*/) } if(!ttx_paused) CleanUp(); + cleanup_fb_pan(); tuxtxt_close(); printf("TuxTxt subtitle thread stopped\n"); pthread_exit(NULL); @@ -1527,6 +1523,7 @@ void tuxtx_pause_subtitle(bool pause) while(!ttx_paused) usleep(10); printf("TuxTxt subtitle paused\n"); + cleanup_fb_pan(); } } @@ -1541,14 +1538,16 @@ void tuxtx_stop_subtitle() ttx_paused = 0; } -void tuxtx_set_pid(int pid, int page) +void tuxtx_set_pid(int pid, int page, char * cc) { if(reader_running) tuxtx_stop_subtitle(); sub_pid = pid; sub_page = page; - printf("TuxTxt subtitle set pid %d page %d\n", sub_pid, sub_page); + + cfg_national_subset = GetNationalSubset(cc); + printf("TuxTxt subtitle set pid %d page %d lang %s (%d)\n", sub_pid, sub_page, cc, cfg_national_subset); #if 0 ttx_paused = 1; if(sub_pid && sub_page) @@ -1578,6 +1577,7 @@ int tuxtx_main(int _rc, int pid, int page) char cvs_revision[] = "$Revision: 1.95 $"; use_gui = 1; + boxed = 0; //printf("to init tuxtxt\n");fflush(stdout); #if !TUXTXT_CFG_STANDALONE int initialized = tuxtxt_init(); @@ -1587,6 +1587,7 @@ int tuxtx_main(int _rc, int pid, int page) sub_page = tuxtxt_cache.page = page; sub_pid = pid; use_gui = 0; + boxed = 1; } #endif @@ -1645,7 +1646,8 @@ int tuxtx_main(int _rc, int pid, int page) ex = x + w - tx; sy = y; ey = y + h; -printf("[tuxtxt] screen is %dx%d at %dx%d border %d\n", ex-sx, ey-sy, sx, sy, tx); + + printf("[tuxtxt] screen is %dx%d at %dx%d border %d\n", ex-sx, ey-sy, sx, sy, tx); /* initialisations */ transpmode = 0; @@ -1796,10 +1798,6 @@ printf("[tuxtxt] screen is %dx%d at %dx%d border %d\n", ex-sx, ey-sy, sx, sy, tx /* exit */ CleanUp(); -#if 0 - close(rc); - close(lcd); -#endif close(fb); #if 1 @@ -1834,16 +1832,17 @@ FT_Error MyFaceRequester(FTC_FaceID face_id, FT_Library plibrary, FT_Pointer /*r /****************************************************************************** * Init * ******************************************************************************/ - +extern std::string ttx_font_file; +static bool ft_init_done = false; int Init() { int error, i; unsigned char magazine; + static std::string font_file; /* init data */ - - //page_atrb[32] = transp<<4 | transp; + //page_atrb[32] = transp<<4 | transp; inputcounter = 2; for (magazine = 1; magazine < 9; magazine++) @@ -1852,7 +1851,7 @@ int Init() tuxtxt_cache.current_subpage [magazine] = -1; } #if TUXTXT_CFG_STANDALONE -/* init data */ + /* init data */ memset(&tuxtxt_cache.astCachetable, 0, sizeof(tuxtxt_cache.astCachetable)); memset(&tuxtxt_cache.subpagetable, 0xFF, sizeof(tuxtxt_cache.subpagetable)); memset(&tuxtxt_cache.astP29, 0, sizeof(tuxtxt_cache.astP29)); @@ -1878,7 +1877,7 @@ int Init() next_10 = 0x100; tuxtxt_cache.subpage = tuxtxt_cache.subpagetable[tuxtxt_cache.page]; if (tuxtxt_cache.subpage == 0xff) - tuxtxt_cache.subpage = 0; + tuxtxt_cache.subpage = 0; tuxtxt_cache.pageupdate = 0; @@ -1896,8 +1895,8 @@ int Init() screen_mode2 = 0; color_mode = 10; trans_mode = 10; - menulanguage = 0; /* german */ - national_subset = 0;/* default */ + menulanguage = 1; /* english */ + /*national_subset = 0;*//* default */ auto_national = 1; swapupdown = 0; showhex = 0; @@ -1905,7 +1904,7 @@ int Init() show39 = 1; showl25 = 1; dumpl25 = 0; - usettf = 0; + usettf = 1; TTFWidthFactor16 = 28; TTFHeightFactor16 = 16; TTFShiftX = 0; @@ -1987,32 +1986,8 @@ int Init() savedscreenmode = screenmode; national_subset_secondary = NAT_DEFAULT; - - /* init fontlibrary */ - if ((error = FT_Init_FreeType(&library))) - { - printf("TuxTxt ", error); - return 0; - } - - if ((error = FTC_Manager_New(library, 7, 2, 0, &MyFaceRequester, NULL, &manager))) - { - FT_Done_FreeType(library); - printf("TuxTxt \n", error); - return 0; - } - - if ((error = FTC_SBitCache_New(manager, &cache))) - { - FTC_Manager_Done(manager); - FT_Done_FreeType(library); - printf("TuxTxt \n", error); - return 0; - } - fontwidth = 0; /* initialize at first setting */ - /* calculate font dimensions */ displaywidth = (ex-sx); fontheight = (ey-sy) / 25; //21; @@ -2037,6 +2012,7 @@ int Init() StartX = sx; //+ (((ex-sx) - 40*fontwidth) / 2); StartY = sy + (((ey-sy) - 25*fontheight) / 2); +#if 0 if (usettf) { typettf.face_id = (FTC_FaceID) TUXTXTTTFVAR; @@ -2062,67 +2038,76 @@ int Init() return 0; } } - ascender = (usettf ? fontheight * face->ascender / face->units_per_EM : 16); +#endif + if(!ft_init_done || font_file != ttx_font_file) { + printf("TuxTxt: init fontlibrary\n"); + if(ft_init_done) { + FTC_Manager_Done(manager); + FT_Done_FreeType(library); + ft_init_done = false; + } + /* init fontlibrary */ + if ((error = FT_Init_FreeType(&library))) + { + printf("TuxTxt ", error); + return 0; + } + + if ((error = FTC_Manager_New(library, 7, 2, 1024*1024, &MyFaceRequester, NULL, &manager))) + { + FT_Done_FreeType(library); + printf("TuxTxt \n", error); + return 0; + } + + if ((error = FTC_SBitCache_New(manager, &cache))) + { + FTC_Manager_Done(manager); + FT_Done_FreeType(library); + printf("TuxTxt \n", error); + return 0; + } + + if (usettf) { + printf("TuxTxt: using font %s\n", ttx_font_file.c_str()); + typettf.face_id = (FTC_FaceID) ttx_font_file.c_str(); + typettf.height = (FT_UShort) fontheight * TTFHeightFactor16 / 16; + } else { + typettf.face_id = (FTC_FaceID) TUXTXTOTB; + typettf.width = (FT_UShort) 23; + typettf.height = (FT_UShort) 23; + } + + typettf.flags = FT_LOAD_MONOCHROME; + + if ((error = FTC_Manager_LookupFace(manager, typettf.face_id, &face))) + { + printf("TuxTxt \n", error); + FTC_Manager_Done(manager); + FT_Done_FreeType(library); + return 0; + } + font_file = ttx_font_file; + ft_init_done = true; + + ascender = (usettf ? fontheight * face->ascender / face->units_per_EM : 16); + } #if TUXTXT_DEBUG printf("TuxTxt \n", - fontheight, fontwidth, fontwidth_small, fontwidth_topmenumain, fontwidth_topmenusmall, - ymosaic[0], ymosaic[1], ymosaic[2], StartX, StartY, ascender); + fontheight, fontwidth, fontwidth_small, fontwidth_topmenumain, fontwidth_topmenusmall, + ymosaic[0], ymosaic[1], ymosaic[2], StartX, StartY, ascender); #endif -#if 0 - /* get fixed screeninfo */ - if (ioctl(fb, FBIOGET_FSCREENINFO, &fix_screeninfo) == -1) - { - perror("TuxTxt "); - return 0; - } - - /* get variable screeninfo */ - if (ioctl(fb, FBIOGET_VSCREENINFO, &var_screeninfo) == -1) - { - perror("TuxTxt "); - return 0; - } - - /* set variable screeninfo for double buffering */ - var_screeninfo.yoffset = 0; -#endif -#if 0 - var_screeninfo.yres_virtual = 2*var_screeninfo.yres; - var_screeninfo.xres_virtual = var_screeninfo.xres; - - if (ioctl(fb, FBIOPUT_VSCREENINFO, &var_screeninfo) == -1) - { - perror("TuxTxt "); - return 0; - } - - if (ioctl(fb, FBIOGET_VSCREENINFO, &var_screeninfo) == -1) - { - perror("TuxTxt "); - return 0; - } -#endif #if TUXTXT_DEBUG printf("TuxTxt \n", - var_screeninfo.xres, var_screeninfo.yres, - var_screeninfo.xres_virtual, var_screeninfo.yres_virtual, - var_screeninfo.yoffset); + var_screeninfo.xres, var_screeninfo.yres, + var_screeninfo.xres_virtual, var_screeninfo.yres_virtual, + var_screeninfo.yoffset); #endif - /* set new colormap */ setcolors((unsigned short *)defaultcolors, 0, SIZECOLTABLE); -#if 0 - /* map framebuffer into memory */ - lfb = (unsigned char*)mmap(0, fix_screeninfo.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, fb, 0); - if (!lfb) - { - perror("TuxTxt "); - return 0; - } -#endif ClearBB(transp); /* initialize backbuffer */ for (i = 0; i < 40 * 25; i++) { @@ -2143,7 +2128,6 @@ int Init() { FTC_Manager_Done(manager); FT_Done_FreeType(library); - //munmap(lfb, fix_screeninfo.smem_len); return 0; } @@ -2162,7 +2146,11 @@ int Init() { SDT_ready = 0; getpidsdone = 0; -// tuxtxt_cache.pageupdate = 1; /* force display of message page not found (but not twice) */ + //getpidsdone = GetTeletextPIDs(false); + if(auto_national && cfg_national_subset) + national_subset = cfg_national_subset; + printf("Tuxtxt: national_subset %d (cfg %d)\n", national_subset, cfg_national_subset); + // tuxtxt_cache.pageupdate = 1; /* force display of message page not found (but not twice) */ } #if TUXTXT_CFG_STANDALONE @@ -2173,7 +2161,12 @@ int Init() #endif fcntl(rc, F_SETFL, O_NONBLOCK); gethotlist(); - SwitchScreenMode(screenmode); + + if(use_gui) + SwitchScreenMode(screenmode); + else + SwitchScreenMode(0); + prevscreenmode = screenmode; printf("TuxTxt: init ok\n"); @@ -2205,12 +2198,17 @@ void CleanUp() //tuxtxt_stop(); #endif - memset(lfb,0, var_screeninfo.yres*fix_screeninfo.line_length); +#ifdef USE_FBPAN + cleanup_fb_pan(); +#endif + //memset(lfb,0, var_screeninfo.yres*fix_screeninfo.line_length); + CFrameBuffer::getInstance()->paintBackground(); +#if 0 /* close freetype */ FTC_Manager_Done(manager); FT_Done_FreeType(library); - +#endif if (hotlistchanged) savehotlist(); @@ -2348,13 +2346,15 @@ int GetTeletextPIDs() pid_table[pids_found].national_subset = NAT_DEFAULT; /* use default charset */ } -#if TUXTXT_DEBUG - printf("TuxTxt \n", - pid_table[pids_found].service_id, - country_code, - pid_table[pids_found].national_subset, - (pid_table[pids_found].vtxt_pid == tuxtxt_cache.vtxtpid) ? " * " : "" - ); +#if 1 // TUXTXT_DEBUG + printf("TuxTxt \n", + pids_found, + pid_table[pids_found].service_id, + pid_table[pids_found].vtxt_pid, + country_code, + pid_table[pids_found].national_subset, + (pid_table[pids_found].vtxt_pid == tuxtxt_cache.vtxtpid) ? " * " : "" + ); #endif pids_found++; @@ -2412,6 +2412,7 @@ skip_pid: diff = 0; pid_table[pid_test].service_name_len = bufSDT[sdt_scan+9 + bufSDT[sdt_scan+8]]; + //FIXME ?? for (byte = 0; byte < pid_table[pid_test].service_name_len; byte++) { if (bufSDT[sdt_scan+10 + bufSDT[sdt_scan + 8] + byte] == (unsigned char)'ִ') @@ -2447,11 +2448,15 @@ skip_pid: if (tuxtxt_cache.vtxtpid != 0) { - while (pid_table[current_service].vtxt_pid != tuxtxt_cache.vtxtpid && current_service < pids_found) + while (pid_table[current_service].vtxt_pid != tuxtxt_cache.vtxtpid && current_service < pids_found) { current_service++; + } - if (auto_national && current_service < pids_found) + if (auto_national && current_service < pids_found) { national_subset = pid_table[current_service].national_subset; + printf("Tuxtxt: GetTeletextPIDs set national_subset -> %d\n", national_subset); + } + printf("Tuxtxt: GetTeletextPIDs national_subset %d\n", national_subset); RenderMessage(ShowServiceName); } @@ -2470,43 +2475,43 @@ int GetNationalSubset(char *cc) { if (memcmp(cc, "cze", 3) == 0 || memcmp(cc, "ces", 3) == 0 || memcmp(cc, "slo", 3) == 0 || memcmp(cc, "slk", 3) == 0) - return 0; + return NAT_CZ; if (memcmp(cc, "eng", 3) == 0) - return 1; + return NAT_UK; if (memcmp(cc, "est", 3) == 0) - return 2; + return NAT_ET; if (memcmp(cc, "fre", 3) == 0 || memcmp(cc, "fra", 3) == 0) - return 3; + return NAT_FR; if (memcmp(cc, "ger", 3) == 0 || memcmp(cc, "deu", 3) == 0) - return 4; + return NAT_DE; if (memcmp(cc, "ita", 3) == 0) - return 5; + return NAT_IT; if (memcmp(cc, "lav", 3) == 0 || memcmp(cc, "lit", 3) == 0) - return 6; + return NAT_LV; if (memcmp(cc, "pol", 3) == 0) - return 7; + return NAT_PL; if (memcmp(cc, "spa", 3) == 0 || memcmp(cc, "por", 3) == 0) - return 8; + return NAT_SP; if (memcmp(cc, "rum", 3) == 0 || memcmp(cc, "ron", 3) == 0) - return 9; + return NAT_RO; if (memcmp(cc, "scc", 3) == 0 || memcmp(cc, "srp", 3) == 0 || memcmp(cc, "scr", 3) == 0 || memcmp(cc, "hrv", 3) == 0 || memcmp(cc, "slv", 3) == 0) - return 10; + return NAT_SR; if (memcmp(cc, "swe", 3) == 0 || memcmp(cc, "dan", 3) == 0 || memcmp(cc, "nor", 3) == 0 || memcmp(cc, "fin", 3) == 0 || memcmp(cc, "hun", 3) == 0) - return 11; + return NAT_SW; if (memcmp(cc, "tur", 3) == 0) - return 12; + return NAT_TR; if (memcmp(cc, "rus", 3) == 0 || memcmp(cc, "bul", 3) == 0) - return NAT_RB; + return NAT_RB; if (memcmp(cc, "ser", 3) == 0 || memcmp(cc, "cro", 3) == 0) - return NAT_SC; + return NAT_SC; if (memcmp(cc, "ukr", 3) == 0) - return NAT_UA; + return NAT_UA; if (memcmp(cc, "gre", 3) == 0) return NAT_GR; if (memcmp(cc, "heb", 3) == 0) @@ -2716,7 +2721,7 @@ void Menu_Init(char *menu, int current_pid, int menuitem, int hotindex) memset(&menu[Menu_Width*MenuLine[M_TRA] + 3+trans_mode ], 0x20,24-trans_mode); memcpy(&menu[Menu_Width*MenuLine[M_AUN] + Menu_Width - 5], &configonoff[menulanguage][auto_national ? 3 : 0], 3); - if (national_subset != NAT_DE) + /*if (national_subset != NAT_DE)*/ memcpy(&menu[Menu_Width*MenuLine[M_NAT] + 2], &countrystring[national_subset*COUNTRYSTRING_WIDTH], COUNTRYSTRING_WIDTH); if (national_subset == 0 || auto_national) menu[MenuLine[M_NAT]*Menu_Width + 1] = ' '; @@ -2749,7 +2754,6 @@ void Menu_Init(char *menu, int current_pid, int menuitem, int hotindex) void ConfigMenu(int Init) { -printf("[tuxtxt] Menu\n"); int val, menuitem = M_Start; int current_pid = 0; int hotindex; @@ -2759,8 +2763,9 @@ printf("[tuxtxt] Menu\n"); char menu[Menu_Height*Menu_Width]; if (auto_national && tuxtxt_cache.astCachetable[tuxtxt_cache.page][tuxtxt_cache.subpage] && - tuxtxt_cache.astCachetable[tuxtxt_cache.page][tuxtxt_cache.subpage]->pageinfo.nationalvalid) + tuxtxt_cache.astCachetable[tuxtxt_cache.page][tuxtxt_cache.subpage]->pageinfo.nationalvalid) { national_subset = countryconversiontable[tuxtxt_cache.astCachetable[tuxtxt_cache.page][tuxtxt_cache.subpage]->pageinfo.national]; + } if (getpidsdone) { @@ -2791,6 +2796,15 @@ printf("[tuxtxt] Menu\n"); /* clear framebuffer */ ClearFB(transp); + + //FIXME this is hack. sometimes menu appear over txt page -> FB pan problem ? + int old_pagecatching = pagecatching; + pagecatching = 1; + ClearBB(transp); + CopyBB2FB(); + pagecatching = old_pagecatching; + // hack end + clearbbcolor = black; Menu_Init(menu, current_pid, menuitem, hotindex); @@ -3277,7 +3291,6 @@ printf("[tuxtxt] Menu\n"); RCCode = -1; if (oldscreenmode) SwitchScreenMode(oldscreenmode); /* restore divided screen */ -printf("[tuxtxt] Menu return from M_PID\n"); transpmode = oldtrans; return; } @@ -3343,6 +3356,8 @@ printf("[tuxtxt] Menu return from M_PID\n"); UpdateLCD(); /* update number of cached pages */ } while ((RCCode != RC_HOME) && (RCCode != RC_DBOX) && (RCCode != RC_MUTE)); + ClearBB(transp); + CopyBB2FB(); /* reset to nonblocking mode */ fcntl(rc, F_SETFL, O_NONBLOCK); tuxtxt_cache.pageupdate = 1; @@ -3350,7 +3365,6 @@ printf("[tuxtxt] Menu return from M_PID\n"); if (oldscreenmode) SwitchScreenMode(oldscreenmode); /* restore divided screen */ transpmode = oldtrans; -printf("[tuxtxt] Menu return\n"); } /****************************************************************************** @@ -3864,13 +3878,12 @@ void SwitchScreenMode(int newscreenmode) /* reset transparency mode */ if (transpmode) transpmode = 0; - //transpmode = 1; //NEW if (newscreenmode < 0) /* toggle mode */ screenmode++; else /* set directly */ screenmode = newscreenmode; -// if ((screenmode > (screen_mode2 ? 2 : 1)) || (screenmode < 0)) + if ((screenmode > 2) || (screenmode < 0)) screenmode = 0; @@ -3883,7 +3896,9 @@ void SwitchScreenMode(int newscreenmode) /* clear back buffer */ clearbbcolor = screenmode?transp:static_cast(FullScrColor); - ClearBB(clearbbcolor); + + if(use_gui) + ClearBB(clearbbcolor); /* set mode */ if (screenmode) /* split */ @@ -3940,7 +3955,6 @@ void SwitchScreenMode(int newscreenmode) videoDecoder->Pig(-1, -1, -1, -1); int x = CFrameBuffer::getInstance()->getScreenX(); - int y = CFrameBuffer::getInstance()->getScreenY(); int w = CFrameBuffer::getInstance()->getScreenWidth(); int h = CFrameBuffer::getInstance()->getScreenHeight(); @@ -4861,7 +4875,8 @@ void RenderMessage(int Message) int fbcolor, timecolor, imenuatr; int pagecolumn; const char *msg; - + int national_subset_back = national_subset; + national_subset = menusubset[menulanguage]; /* 00000000001111111111222222222233333333334 */ /* 01234567890123456789012345678901234567890 */ @@ -4955,6 +4970,7 @@ void RenderMessage(int Message) PosY = StartY + fontheight*21; for (byte = 0; byte < 38; byte++) RenderCharFB(message_6[byte], &atrtable[imenuatr + 2]); + national_subset = national_subset_back; } /****************************************************************************** @@ -5155,10 +5171,10 @@ void RenderPage() national_subset <= NAT_MAX_FROM_HEADER && /* not for GR/RU as long as line28 is not evaluated */ pageinfo && pageinfo->nationalvalid) /* individual subset according to page header */ { - national_subset = countryconversiontable[pageinfo->national]; #if TUXTXT_DEBUG - printf("p%03x b%d n%d v%d i%d\n", tuxtxt_cache.page,national_subset_bak, national_subset, pageinfo->nationalvalid, pageinfo->national); + printf("p%03x bak %d nat %d valid %d info nat %d\n", tuxtxt_cache.page,national_subset_bak, national_subset, pageinfo->nationalvalid, pageinfo->national); #endif + national_subset = countryconversiontable[pageinfo->national]; } /* render page */ PosY = StartY + startrow*fontheight; @@ -5285,13 +5301,14 @@ void showlink(int column, int linkpage) int oldfontwidth = fontwidth; int yoffset; -#if 0 +#ifdef USE_FBPAN if (var_screeninfo.yoffset) yoffset = 0; else yoffset = var_screeninfo.yres; -#endif +#else yoffset = var_screeninfo.yres; //NEW +#endif int abx = ((displaywidth)%(40-nofirst) == 0 ? displaywidth+1 : (displaywidth)/(((displaywidth)%(40-nofirst)))+1);// distance between 'inserted' pixels int width = displaywidth /4; @@ -5321,7 +5338,8 @@ void showlink(int column, int linkpage) else /* display number */ { PosX = StartX + column*width; - FillRect(PosX, PosY+yoffset, displaywidth+sx-PosX, fontheight, atrtable[ATR_L250 + column].bg); + //FillRect(PosX, PosY+yoffset, displaywidth+sx-PosX, fontheight, atrtable[ATR_L250 + column].bg); + FillRect(PosX, PosY+yoffset, width, fontheight, atrtable[ATR_L250 + column].bg); if (linkpage < tuxtxt_cache.page) { line[6] = '<'; @@ -5493,16 +5511,14 @@ void CopyBB2FB() unsigned char *src, *dst, *topsrc; int fillcolor, i, screenwidth, swtmp; -//printf("[tuxtxt] CopyBB2FB: zoommode %d\n", zoommode); - /* line 25 */ - if (!pagecatching) + if (!pagecatching && use_gui) CreateLine25(); + /* copy backbuffer to framebuffer */ if (!zoommode) { - memcpy(lfb, lfb+fix_screeninfo.line_length * var_screeninfo.yres, fix_screeninfo.line_length*var_screeninfo.yres); -#if 0 +#ifdef USE_FBPAN /* if yoffset != 0, we had active page 1, and activate 0 */ /* else active was page 0, activate page 1 */ if (var_screeninfo.yoffset) @@ -5512,12 +5528,15 @@ void CopyBB2FB() if (ioctl(fb, FBIOPAN_DISPLAY, &var_screeninfo) == -1) perror("TuxTxt "); +#else + memcpy(lfb, lfb+fix_screeninfo.line_length * var_screeninfo.yres, fix_screeninfo.line_length*var_screeninfo.yres); #endif /* adapt background of backbuffer if changed */ - if (StartX > 0 && *lfb != *(lfb + fix_screeninfo.line_length * var_screeninfo.yres)) + if (StartX > 0 && *lfb != *(lfb + fix_screeninfo.line_length * var_screeninfo.yres)) { FillBorder(*(lfb + fix_screeninfo.line_length * var_screeninfo.yoffset)); // ClearBB(*(lfb + var_screeninfo.xres * var_screeninfo.yoffset)); + } if (clearbbcolor >= 0) { diff --git a/lib/libtuxtxt/tuxtxt.h b/lib/libtuxtxt/tuxtxt.h index b61468b8e..acc43e402 100644 --- a/lib/libtuxtxt/tuxtxt.h +++ b/lib/libtuxtxt/tuxtxt.h @@ -595,9 +595,8 @@ unsigned char restoreaudio = 0; /* typ_vcr/dvb: v1 a1 v2 a2 v3 a3 (vcr_only: fblk) */ /* language dependent texts */ -#define MAXMENULANGUAGE 8 /* 0 deutsch, 1 englisch, 2 franzצsisch, 3 niederlהndisch, 4 griechisch, 5 italienisch, 6 polnisch, 7 schwedisch, 8 suomi */ -const int menusubset[] = { NAT_DE , NAT_UK , NAT_FR , NAT_UK , NAT_GR , NAT_IT , NAT_PL , NAT_SW, NAT_SW }; -//const int menusubset[] = { NAT_DE , NAT_UK , NAT_FR , NAT_UK , NAT_GR , NAT_IT , NAT_PL , NAT_SW , NAT_SW , NAT_SP, NAT_RB};//FIXME +#define MAXMENULANGUAGE 10 /* 0 deutsch, 1 englisch, 2 franzצsisch, 3 niederlהndisch, 4 griechisch, 5 italienisch, 6 polnisch, 7 schwedisch, 8 suomi, 9 portuguesa, 10 russian */ +const int menusubset[] = { NAT_DE , NAT_UK , NAT_FR , NAT_UK , NAT_GR , NAT_IT , NAT_PL , NAT_SW , NAT_SW , NAT_SP, NAT_RB};//FIXME #define Menu_StartX (StartX + fontwidth*9/2) #define Menu_StartY (StartY + fontheight) @@ -628,11 +627,11 @@ enum const char hotlistpagecolumn[] = /* last(!) column of page to show in each language */ { - 22, 26, 28, 27, 28, 27, 28, 21, 20 + 22, 26, 28, 27, 28, 27, 28, 21, 20, 26, 26 }; const char hotlisttextcolumn[] = { - 24, 14, 14, 15, 14, 15, 14, 23, 22 + 24, 14, 14, 15, 14, 15, 14, 23, 22, 14, 14 }; const char hotlisttext[][2*6] = { @@ -645,6 +644,8 @@ const char hotlisttext[][2*6] = { "dodajkasuj" }, { "ny bort " }, { "lis{{pois " }, + { " adi rem. " }, + { "Dob. Udal." } }; const char configonoff[][2*4] = @@ -658,6 +659,8 @@ const char configonoff[][2*4] = { "wy}w} " }, { "p} av " }, { "EI ON " }, + { "offon " }, + { "w&kwkl" } }; const char menuatr[Menu_Height*(Menu_Width+1)] = { @@ -689,257 +692,312 @@ const char menuatr[Menu_Height*(Menu_Width+1)] = const char configmenu[][Menu_Height*(Menu_Width+1)] = { { +/* 0123456789012345678901234567890 */ + "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" + "ד Konfigurationsmen} הי" + "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" + "ד1 Favoriten: Seite 111 dazu הי" + "דםמסע הי" + "ד+-? הי" + "ד הי" + "ד2 Teletext-Auswahl הי" + "דם suchen מהי" + "ד הי" + "ד Bildschirmformat הי" + "ד3 Standard-Modus 16:9 הי" + "ד4 TextBild-Modus 16:9 הי" + "ד הי" + "ד5 Helligkeit הי" + "דם מהי" + "ד6 Transparenz הי" + "דם מהי" + "ד7 nationaler Zeichensatz הי" + "דautomatische Erkennung הי" + "דם מהי" + "דם Sprache/Language deutsch מהי" + "וז www.tuxtxt.net x.xx זחי" + "כלללללללללללללללללללללללללללללך" + }, /* 0000000000111111111122222222223 */ /* 0123456789012345678901234567890 */ - "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" - "ד Konfigurationsmen} הי" - "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" - "ד1 Favoriten: Seite 111 dazu הי" - "דםמסע הי" - "ד+-? הי" - "ד הי" - "ד2 Teletext-Auswahl הי" - "דם suchen מהי" - "ד הי" - "ד Bildschirmformat הי" - "ד3 Standard-Modus 16:9 הי" - "ד4 TextBild-Modus 16:9 הי" - "ד הי" - "ד5 Helligkeit הי" - "דם מהי" - "ד6 Transparenz הי" - "דם מהי" - "ד7 nationaler Zeichensatz הי" - "דautomatische Erkennung הי" - "דם DE (#$@[\\]^_`{|}~) מהי" - "דם Sprache/Language deutsch מהי" - "וז www.tuxtxt.net x.xx זחי" - "כלללללללללללללללללללללללללללללך" - }, + { + "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" + "ד Configuration menu הי" + "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" + "ד1 Favorites: add page 111 הי" + "דםמסע הי" + "ד+-? הי" + "ד הי" + "ד2 Teletext selection הי" + "דם search מהי" + "ד הי" + "ד Screen format הי" + "ד3 Standard mode 16:9 הי" + "ד4 Text/TV mode 16:9 הי" + "ד הי" + "ד5 Brightness הי" + "דם מהי" + "ד6 Transparency הי" + "דם מהי" + "ד7 national characterset הי" + "ד automatic recognition הי" + "דם מהי" + "דם Sprache/language english מהי" + "וז www.tuxtxt.net x.xx זחי" + "כלללללללללללללללללללללללללללללך" + }, /* 0000000000111111111122222222223 */ /* 0123456789012345678901234567890 */ - { - "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" - "ד Configuration menu הי" - "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" - "ד1 Favorites: add page 111 הי" - "דםמסע הי" - "ד+-? הי" - "ד הי" - "ד2 Teletext selection הי" - "דם search מהי" - "ד הי" - "ד Screen format הי" - "ד3 Standard mode 16:9 הי" - "ד4 Text/TV mode 16:9 הי" - "ד הי" - "ד5 Brightness הי" - "דם מהי" - "ד6 Transparency הי" - "דם מהי" - "ד7 national characterset הי" - "ד automatic recognition הי" - "דם DE (#$@[\\]^_`{|}~) מהי" - "דם Sprache/language english מהי" - "וז www.tuxtxt.net x.xx זחי" - "כלללללללללללללללללללללללללללללך" - }, + { + "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" + "ד Menu de configuration הי" + "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" + "ד1 Favorites: ajout. page 111הי" + "דםמסע הי" + "ד+-? הי" + "ד הי" + "ד2 Selection de teletext הי" + "דם recherche מהי" + "ד הי" + "ד Format de l'#cran הי" + "ד3 Mode standard 16:9 הי" + "ד4 Texte/TV 16:9 הי" + "ד הי" + "ד5 Clarte הי" + "דם מהי" + "ד6 Transparence הי" + "דם מהי" + "ד7 police nationale הי" + "דreconn. automatique הי" + "דם מהי" + "דם Sprache/language francaisמהי" + "וז www.tuxtxt.net x.xx זחי" + "כלללללללללללללללללללללללללללללך" + }, /* 0000000000111111111122222222223 */ /* 0123456789012345678901234567890 */ - { - "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" - "ד Menu de configuration הי" - "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" - "ד1 Favorites: ajout. page 111הי" - "דםמסע הי" - "ד+-? הי" - "ד הי" - "ד2 Selection de teletext הי" - "דם recherche מהי" - "ד הי" - "ד Format de l'#cran הי" - "ד3 Mode standard 16:9 הי" - "ד4 Texte/TV 16:9 הי" - "ד הי" - "ד5 Clarte הי" - "דם מהי" - "ד6 Transparence הי" - "דם מהי" - "ד7 police nationale הי" - "דreconn. automatique הי" - "דם DE (#$@[\\]^_`{|}~) מהי" - "דם Sprache/language francaisמהי" - "וז www.tuxtxt.net x.xx זחי" - "כלללללללללללללללללללללללללללללך" - }, + { + "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" + "ד Configuratiemenu הי" + "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" + "ד1 Favorieten: toev. pag 111 הי" + "דםמסע הי" + "ד+-? הי" + "ד הי" + "ד2 Teletekst-selectie הי" + "דם zoeken מהי" + "ד הי" + "ד Beeldschermformaat הי" + "ד3 Standaardmode 16:9 הי" + "ד4 Tekst/TV mode 16:9 הי" + "ד הי" + "ד5 Helderheid הי" + "דם מהי" + "ד6 Transparantie הי" + "דם מהי" + "ד7 nationale tekenset הי" + "דautomatische herkenning הי" + "דם מהי" + "דם Sprache/Language nederl. מהי" + "וז www.tuxtxt.net x.xx זחי" + "כלללללללללללללללללללללללללללללך" + }, /* 0000000000111111111122222222223 */ /* 0123456789012345678901234567890 */ - { - "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" - "ד Configuratiemenu הי" - "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" - "ד1 Favorieten: toev. pag 111 הי" - "דםמסע הי" - "ד+-? הי" - "ד הי" - "ד2 Teletekst-selectie הי" - "דם zoeken מהי" - "ד הי" - "ד Beeldschermformaat הי" - "ד3 Standaardmode 16:9 הי" - "ד4 Tekst/TV mode 16:9 הי" - "ד הי" - "ד5 Helderheid הי" - "דם מהי" - "ד6 Transparantie הי" - "דם מהי" - "ד7 nationale tekenset הי" - "דautomatische herkenning הי" - "דם DE (#$@[\\]^_`{|}~) מהי" - "דם Sprache/Language nederl. מהי" - "וז www.tuxtxt.net x.xx זחי" - "כלללללללללללללללללללללללללללללך" - }, + { + "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" + "ד Lemo} quhl_seym הי" + "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" + "ד1 Vaboq_: pqo_h. sek. 111הי" + "דםמסע הי" + "ד+-? הי" + "ד הי" + "ד2 Epikoc^ Teket]nt הי" + "דם Amaf^tgsg מהי" + "ד הי" + "ד Loqv^ oh|mgr הי" + "ד3 Tq|por pq|tupor 16:9 הי" + "ד4 Tq|por eij. jeil. 16:9 הי" + "ד הי" + "ד5 Kalpq|tgta הי" + "דם מהי" + "ד6 Diav\\meia הי" + "דם מהי" + "ד7 Ehmij^ tuposeiq\\ הי" + "דaut|latg amacm~qisg הי" + "דם מהי" + "דם Ck~ssa/Language ekkgmij\\ מהי" + "וז www.tuxtxt.net x.xx זחי" + "כלללללללללללללללללללללללללללללך" + }, /* 0000000000111111111122222222223 */ /* 0123456789012345678901234567890 */ - { - "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" - "ד Lemo} quhl_seym הי" - "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" - "ד1 Vaboq_: pqo_h. sek. 111הי" - "דםמסע הי" - "ד+-? הי" - "ד הי" - "ד2 Epikoc^ Teket]nt הי" - "דם Amaf^tgsg מהי" - "ד הי" - "ד Loqv^ oh|mgr הי" - "ד3 Tq|por pq|tupor 16:9 הי" - "ד4 Tq|por eij. jeil. 16:9 הי" - "ד הי" - "ד5 Kalpq|tgta הי" - "דם מהי" - "ד6 Diav\\meia הי" - "דם מהי" - "ד7 Ehmij^ tuposeiq\\ הי" - "דaut|latg amacm~qisg הי" - "דם DE (#$@[\\]^_`{|}~) מהי" - "דם Ck~ssa/Language ekkgmij\\ מהי" - "וז www.tuxtxt.net x.xx זחי" - "כלללללללללללללללללללללללללללללך" - }, + { + "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" + "ד Menu di configurazione הי" + "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" + "ד1 Preferiti: agg. pag.111 הי" + "דםמסע הי" + "ד+-? הי" + "ד הי" + "ד2 Selezione televideo הי" + "דם ricerca מהי" + "ד הי" + "ד Formato schermo הי" + "ד3 Modo standard 16:9 הי" + "ד4 Text/Mod.TV 16:9 הי" + "ד הי" + "ד5 Luminosit{ הי" + "דם מהי" + "ד6 Trasparenza הי" + "דם מהי" + "ד7 nazionalita'caratteri הי" + "ד riconoscimento automatico הי" + "דם מהי" + "דם Lingua/Language Italiana מהי" + "וז www.tuxtxt.net x.xx זחי" + "כלללללללללללללללללללללללללללללך" + }, /* 0000000000111111111122222222223 */ /* 0123456789012345678901234567890 */ - { - "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" - "ד Menu di configurazione הי" - "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" - "ד1 Preferiti: agg. pag.111 הי" - "דםמסע הי" - "ד+-? הי" - "ד הי" - "ד2 Selezione televideo הי" - "דם ricerca מהי" - "ד הי" - "ד Formato schermo הי" - "ד3 Modo standard 16:9 הי" - "ד4 Text/Mod.TV 16:9 הי" - "ד הי" - "ד5 Luminosit{ הי" - "דם מהי" - "ד6 Trasparenza הי" - "דם מהי" - "ד7 nazionalita'caratteri הי" - "ד riconoscimento automatico הי" - "דם DE (#$@[\\]^_`{|}~) מהי" - "דם Lingua/Language Italiana מהי" - "וז www.tuxtxt.net x.xx זחי" - "כלללללללללללללללללללללללללללללך" - }, + { + "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" + "ד Konfiguracja הי" + "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" + "ד1 Ulubione : kasuj str. 111הי" + "דםמסע הי" + "ד+-? הי" + "ד הי" + "ד2 Wyb_r telegazety הי" + "דם szukaj מהי" + "ד הי" + "ד Format obrazu הי" + "ד3 Tryb standard 16:9 הי" + "ד4 Telegazeta/TV 16:9 הי" + "ד הי" + "ד5 Jasno|^ הי" + "דם מהי" + "ד6 Prze~roczysto|^ הי" + "דם מהי" + "ד7 Znaki charakterystyczne הי" + "ד automatyczne rozpozn. הי" + "דם מהי" + "דם J`zyk/Language polski מהי" + "וז www.tuxtxt.net x.xx זחי" + "כלללללללללללללללללללללללללללללך" + }, /* 0000000000111111111122222222223 */ /* 0123456789012345678901234567890 */ - { - "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" - "ד Konfiguracja הי" - "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" - "ד1 Ulubione : kasuj str. 111הי" - "דםמסע הי" - "ד+-? הי" - "ד הי" - "ד2 Wyb_r telegazety הי" - "דם szukaj מהי" - "ד הי" - "ד Format obrazu הי" - "ד3 Tryb standard 16:9 הי" - "ד4 Telegazeta/TV 16:9 הי" - "ד הי" - "ד5 Jasno|^ הי" - "דם מהי" - "ד6 Prze~roczysto|^ הי" - "דם מהי" - "ד7 Znaki charakterystyczne הי" - "ד automatyczne rozpozn. הי" - "דם DE (#$@[\\]^_`{|}~) מהי" - "דם J`zyk/Language polski מהי" - "וז www.tuxtxt.net x.xx זחי" - "כלללללללללללללללללללללללללללללך" - }, + { + "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" + "ד Konfigurationsmeny הי" + "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" + "ד1 Favoriter: sida 111 ny הי" + "דםמסע הי" + "ד+-? הי" + "ד הי" + "ד2 TextTV v{ljaren הי" + "דם s|k מהי" + "ד הי" + "ד TV- format הי" + "ד3 Standard l{ge 16:9 הי" + "ד4 Text/Bild l{ge 16:9 הי" + "ד הי" + "ד5 Ljusstyrka הי" + "דם מהי" + "ד6 Genomskinlighet הי" + "דם מהי" + "ד7nationell teckenupps{ttningהי" + "ד automatisk igenk{nning הי" + "דם מהי" + "דם Sprache/language svenska מהי" + "וז www.tuxtxt.net x.xx זחי" + "כלללללללללללללללללללללללללללללך" + }, /* 0000000000111111111122222222223 */ /* 0123456789012345678901234567890 */ - { - "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" - "ד Konfigurationsmeny הי" - "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" - "ד1 Favoriter: sida 111 ny הי" - "דםמסע הי" - "ד+-? הי" - "ד הי" - "ד2 TextTV v{ljaren הי" - "דם s|k מהי" - "ד הי" - "ד TV- format הי" - "ד3 Standard l{ge 16:9 הי" - "ד4 Text/Bild l{ge 16:9 הי" - "ד הי" - "ד5 Ljusstyrka הי" - "דם מהי" - "ד6 Genomskinlighet הי" - "דם מהי" - "ד7nationell teckenupps{ttningהי" - "ד automatisk igenk{nning הי" - "דם DE (#$@[\\]^_`{|}~) מהי" - "דם Sprache/language svenska מהי" - "וז www.tuxtxt.net x.xx זחי" - "כלללללללללללללללללללללללללללללך" - }, + { + "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" + "ד Asetusvalikko הי" + "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" + "ד1 Suosikit: sivu 111 lis{{ הי" + "דםמסע הי" + "ד+-? הי" + "ד הי" + "ד2 Tekstikanavan valinta הי" + "דם search מהי" + "ד הי" + "ד N{ytt|tila הי" + "ד3 Vakiotila 16:9 הי" + "ד4 Teksti/TV 16:9 הי" + "ד הי" + "ד5 Kirkkaus הי" + "דם מהי" + "ד6 L{pin{kyvyys הי" + "דם מהי" + "ד7 kansallinen merkist| הי" + "ד automaattinen tunnistus הי" + "דם מהי" + "דם Kieli suomi מהי" + "וז www.tuxtxt.net x.xx זחי" + "כלללללללללללללללללללללללללללללך" + }, /* 0000000000111111111122222222223 */ /* 0123456789012345678901234567890 */ - { - "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" - "ד Asetusvalikko הי" - "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" - "ד1 Suosikit: sivu 111 lis{{ הי" - "דםמסע הי" - "ד+-? הי" - "ד הי" - "ד2 Tekstikanavan valinta הי" - "דם search מהי" - "ד הי" - "ד N{ytt|tila הי" - "ד3 Vakiotila 16:9 הי" - "ד4 Teksti/TV 16:9 הי" - "ד הי" - "ד5 Kirkkaus הי" - "דם מהי" - "ד6 L{pin{kyvyys הי" - "דם מהי" - "ד7 kansallinen merkist| הי" - "ד automaattinen tunnistus הי" - "דם DE (#$@[\\]^_`{|}~) מהי" - "דם Kieli suomi מהי" - "וז www.tuxtxt.net x.xx זחי" - "כלללללללללללללללללללללללללללללך" - }, + { + "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" + "ד Menu de Configuracao הי" + "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" + "ד1 Favoritos: adi pag. 111 הי" + "דםמסע הי" + "ד+-? הי" + "ד הי" + "ד2 Seleccao Teletext הי" + "דם Procurar מהי" + "ד הי" + "ד formato ecran הי" + "ד3 Standard mode 16:9 הי" + "ד4 Text/TV mode 16:9 הי" + "ד הי" + "ד5 Brilho הי" + "דם מהי" + "ד6 Transparencia הי" + "דם מהי" + "ד7 Caracteres nacionaist הי" + "דreconhecimento utomatico הי" + "דם מהי" + "דם Lingua Portuguesa מהי" + "וז www.tuxtxt.net x.xx זחי" + "כלללללללללללללללללללללללללללללך" + }, +/* 0000000000111111111122222222223 */ +/* 0123456789012345678901234567890 */ + { + "אבבבבבבבבבבבבבבבבבבבבבבבבבבבבגט" + "ד Konfiguraciq הי" + "וזזזזזזזזזזזזזזזזזזזזזזזזזזזזחי" + "ד1 Faworit&: dob str. 111 הי" + "דםמסע הי" + "ד+-? הי" + "ד הי" + "ד2 W&bor teleteksta הי" + "דם Poisk מהי" + "ד הי" + "ד Format kartinki הי" + "ד3 Stand. revim 16:9 הי" + "ד4 Tekst/TW rev. 16:9 הי" + "ד הי" + "ד5 Qrkostx הי" + "דם מהי" + "ד6 Prozra~nostx הי" + "דם מהי" + "ד7 Ispolxzuem&j alfawit הי" + "ד awtoopredelenie הי" + "דם מהי" + "דם Qz&k: Russkij מהי" + "וז www.tuxtxt.net x.xx זחי" + "כלללללללללללללללללללללללללללללך" + } }; const char catchmenutext[][81] = @@ -962,6 +1020,10 @@ const char catchmenutext[][81] = "0000000011110000000000110000000000000000" }, { " םןנמ valitse סע n{yt{ " "0000000011110000000000110000000000000000" }, + { " םןנמ seleccao סע mostrar " + "0000000011110000000000110000000000000000" }, + { " םןנמ w&bratx סע pokazatx " + "0000000011110000000000110000000000000000" }, }; const char message_3[][39] = @@ -975,6 +1037,8 @@ const char message_3[][39] = { "ד poszukiwanie sygna}u telegazety הי" }, { "ד s|ker efter TextTV tj{nster הי" }, { "ד etsit{{n Teksti-TV -palvelua הי" }, + { "ד Procurar servicos de teletexto הי" }, + { "ד W&polnqetsq poisk teleteksta הי" }, }; const char message_3_blank[] = "ד הי"; const char message_7[][39] = @@ -988,6 +1052,8 @@ const char message_7[][39] = { "ד brak sygna}u na transponderze הי" }, { "ד ingen TextTV p} denna transponder הי" }, { "ד Ei Teksti-TV:t{ l{hettimell{ הי" }, + { "ד nao ha teletexto no transponder הי" }, + { "ד Na transpondere net teleteksta הי" }, }; const char message_8[][39] = { @@ -1002,10 +1068,12 @@ const char message_8[][39] = { "ד oczekiwanie na stron` 100 הי" }, { "ד v{ntar p} mottagning av sida 100 הי" }, { "ד Odotetaan sivua 100 הי" }, + { "ד esperando recepcao na pag 100 הי" }, + { "ד Ovidanie priema stranic& 100 הי" }, }; const char message8pagecolumn[] = /* last(!) column of page to show in each language */ { - 33, 34, 34, 35, 29, 30, 30, 34, 34 + 33, 34, 34, 35, 29, 30, 30, 34, 34, 32, 34 }; enum /* options for charset */ @@ -1312,9 +1380,7 @@ unsigned char *aShapes[] = aG3_70, aG3_71, aG3_72, aG3_73, aG3_74, aG3_75, aG3_76, aG3_77, aG3_78, aG3_79, aG3_7a, aG3_7b, aG3_7c, aG3_7d, aG3_7e }; - - - +#if 0 /* lcd layout */ const char lcd_layout[] = { @@ -1636,7 +1702,7 @@ const char lcd_digits[] = 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, }; - +#endif /* functions */ void ConfigMenu(int Init); void CleanUp(); diff --git a/lib/libtuxtxt/tuxtxt2.conf b/lib/libtuxtxt/tuxtxt2.conf index 1d8ffd65d..cbde68f1e 100644 --- a/lib/libtuxtxt/tuxtxt2.conf +++ b/lib/libtuxtxt/tuxtxt2.conf @@ -1,7 +1,7 @@ ScreenMode16x9Normal 0 ScreenMode16x9Divided 0 Brightness 10 -MenuLanguage 0 +MenuLanguage 1 AutoNational 1 NationalSubset 5 SwapUpDown 0 diff --git a/lib/libtuxtxt/tuxtxt_common.h b/lib/libtuxtxt/tuxtxt_common.h index 6ef5cd0e9..8708c3821 100644 --- a/lib/libtuxtxt/tuxtxt_common.h +++ b/lib/libtuxtxt/tuxtxt_common.h @@ -720,8 +720,9 @@ void *tuxtxt_CacheThread(void * /*arg*/) } else { - pageinfo_thread->nationalvalid = 1; + //pageinfo_thread->nationalvalid = 1;// FIXME without full eval some is broken pageinfo_thread->national = rev_lut[b1] & 0x07; +//printf("TuxTxt 0: b1=%x\n", rev_lut[b1]); } /* check parity, copy line 0 to cache (start and end 8 bytes are not needed and used otherwise) */ @@ -958,7 +959,8 @@ void *tuxtxt_CacheThread(void * /*arg*/) pageinfo_thread->function = t1 & 0x0f; if (!pageinfo_thread->nationalvalid) { - pageinfo_thread->nationalvalid = 1; +//printf("TuxTxt 28: t1=%x\n", t1>>4); + // pageinfo_thread->nationalvalid = 1; // FIXME without full eval some is broken pageinfo_thread->national = (t1>>4) & 0x07; } } diff --git a/src/gui/audio_select.cpp b/src/gui/audio_select.cpp index cc5f1e5dc..1f2f4ec97 100644 --- a/src/gui/audio_select.cpp +++ b/src/gui/audio_select.cpp @@ -145,7 +145,7 @@ int CAudioSelectMenuHandler::doMenu () char spid[10]; int page = ((sd->teletext_magazine_number & 0xFF) << 8) | sd->teletext_page_number; int pid = sd->pId; - sprintf(spid, "TTX:%d:%03X", sd->pId, page); + sprintf(spid, "TTX:%d:%03X:%s", sd->pId, page, sd->ISO639_language_code.c_str()); char item[64]; sprintf(item, "TTX: %s (pid %x page %03X)", sd->ISO639_language_code.c_str(), sd->pId, page); AudioSelector.addItem(new CMenuForwarderNonLocalized(item /*sd->ISO639_language_code.c_str()*/, diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index 306d37663..ab5a45ad1 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -126,6 +126,8 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) sat.position = sit->first; strncpy(sat.satName, get_set.satNameNoDiseqc, 50); satList.push_back(sat); + if(sit->second.motor_position) + motorPosition = sit->second.motor_position; break; } } @@ -154,7 +156,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) while (!istheend) { - uint64_t timeoutEnd = CRCInput::calcTimeoutEnd_MS(250); + uint64_t timeoutEnd = CRCInput::calcTimeoutEnd_MS(100 /*250*/); msg = CRCInput::RC_nokey; while (!(msg == CRCInput::RC_timeout) && (!(msg == CRCInput::RC_home))) @@ -166,13 +168,14 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) if(last_snr < g_snr) { wasgrow = 1; } - //if((last_snr > g_snr) && last_snr > 37000) { + //if((last_snr > g_snr) && last_snr > 37000) if(wasgrow && (last_snr > g_snr) && last_snr > 50) { //printf("Must stop rotor!!!\n"); g_Zapit->sendMotorCommand(0xE0, 0x31, 0x60, 0, 0, 0); moving = 0; paintStatus(); last_snr = 0; + g_Zapit->tune_TP(TP); } else last_snr = g_snr; } else @@ -195,6 +198,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) printf("[motorcontrol] left/1 key received... drive/Step motor west, stepMode: %d\n", stepMode); motorStepWest(); paintStatus(); + g_Zapit->tune_TP(TP); break; case CRCInput::RC_red: @@ -203,6 +207,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) g_Zapit->sendMotorCommand(0xE0, 0x31, 0x60, 0, 0, 0); moving = 0; paintStatus(); + g_Zapit->tune_TP(TP); break; case CRCInput::RC_3: @@ -210,6 +215,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) printf("[motorcontrol] right/3 key received... drive/Step motor east, stepMode: %d\n", stepMode); motorStepEast(); paintStatus(); + g_Zapit->tune_TP(TP); break; case CRCInput::RC_4: @@ -217,11 +223,13 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) if(g_settings.rotor_swap) lim_cmd = 0x66; else lim_cmd = 0x67; g_Zapit->sendMotorCommand(0xE1, 0x31, lim_cmd, 0, 0, 0); + g_Zapit->tune_TP(TP); break; case CRCInput::RC_5: printf("[motorcontrol] 5 key received... disable (soft) limits\n"); g_Zapit->sendMotorCommand(0xE0, 0x31, 0x63, 0, 0, 0); + g_Zapit->tune_TP(TP); break; case CRCInput::RC_6: @@ -229,6 +237,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) if(g_settings.rotor_swap) lim_cmd = 0x67; else lim_cmd = 0x66; g_Zapit->sendMotorCommand(0xE1, 0x31, lim_cmd, 0, 0, 0); + g_Zapit->tune_TP(TP); break; case CRCInput::RC_7: @@ -236,16 +245,19 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) g_Zapit->sendMotorCommand(0xE0, 0x31, 0x6B, 1, 0, 0); satellitePosition = 0; paintStatus(); + g_Zapit->tune_TP(TP); break; case CRCInput::RC_8: printf("[motorcontrol] 8 key received... enable (soft) limits\n"); g_Zapit->sendMotorCommand(0xE0, 0x31, 0x6A, 1, 0, 0); + g_Zapit->tune_TP(TP); break; case CRCInput::RC_9: printf("[motorcontrol] 9 key received... (re)-calculate positions\n"); g_Zapit->sendMotorCommand(0xE0, 0x31, 0x6F, 1, 0, 0); + g_Zapit->tune_TP(TP); break; case CRCInput::RC_plus: @@ -297,12 +309,14 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) printf("[motorcontrol] left/1 key received... drive/Step motor west, stepMode: %d\n", stepMode); motorStepWest(); paintStatus(); + g_Zapit->tune_TP(TP); break; case CRCInput::RC_red: case CRCInput::RC_2: printf("[motorcontrol] 2 key received... halt motor\n"); g_Zapit->sendMotorCommand(0xE0, 0x31, 0x60, 0, 0, 0); + g_Zapit->tune_TP(TP); break; case CRCInput::RC_3: @@ -310,12 +324,14 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) printf("[motorcontrol] right/3 key received... drive/Step motor east, stepMode: %d\n", stepMode); motorStepEast(); paintStatus(); + g_Zapit->tune_TP(TP); break; case CRCInput::RC_green: case CRCInput::RC_5: printf("[motorcontrol] 5 key received... store present satellite number: %d\n", motorPosition); g_Zapit->sendMotorCommand(0xE0, 0x31, 0x6A, 1, motorPosition, 0); + g_Zapit->tune_TP(TP); break; case CRCInput::RC_6: @@ -330,6 +346,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) g_Zapit->sendMotorCommand(0xE0, 0x31, 0x6B, 1, motorPosition, 0); satellitePosition = 0; paintStatus(); + g_Zapit->tune_TP(TP); break; case CRCInput::RC_9: @@ -343,6 +360,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) printf("[motorcontrol] up key received... increase satellite position: %d\n", ++motorPosition); satellitePosition = 0; paintStatus(); + g_Zapit->tune_TP(TP); break; case CRCInput::RC_minus: @@ -351,6 +369,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) printf("[motorcontrol] down key received... decrease satellite position: %d\n", motorPosition); satellitePosition = 0; paintStatus(); + g_Zapit->tune_TP(TP); break; case CRCInput::RC_blue: @@ -375,6 +394,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) } hide(); + frontend->setTsidOnid(0); return menu_return::RETURN_REPAINT; } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index b1c846f0d..990169c4b 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -725,6 +725,8 @@ const lcd_setting_struct_t lcd_setting[LCD_SETTING_COUNT] = #define DEFAULT_Y_START 20 #define DEFAULT_X_END 1220 #define DEFAULT_Y_END 560 +std::string ttx_font_file = ""; + int CNeutrinoApp::loadSetup(const char * fname) { char cfg_key[81]; @@ -1064,6 +1066,8 @@ printf("***************************** rec dir %s timeshift dir %s\n", g_settings strcpy(g_settings.softupdate_proxypassword, configfile.getString("softupdate_proxypassword", "" ).c_str()); // strcpy( g_settings.font_file, configfile.getString( "font_file", FONTDIR"/neutrino.ttf" ).c_str() ); + strcpy( g_settings.ttx_font_file, configfile.getString( "ttx_font_file", FONTDIR"/DejaVuLGCSansMono-Bold.ttf" ).c_str() ); + ttx_font_file = g_settings.ttx_font_file; strcpy( g_settings.update_dir, configfile.getString( "update_dir", "/tmp" ).c_str() ); //BouquetHandling g_settings.bouquetlist_mode = configfile.getInt32( "bouquetlist_mode", 0 ); @@ -1554,6 +1558,7 @@ void CNeutrinoApp::saveSetup(const char * fname) #endif configfile.setString("update_dir", g_settings.update_dir); configfile.setString("font_file", g_settings.font_file); + configfile.setString("ttx_font_file", g_settings.ttx_font_file); //BouquetHandling configfile.setInt32( "bouquetlist_mode", g_settings.bouquetlist_mode ); @@ -3600,6 +3605,7 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) CVFD::getInstance()->setMode(CVFD::MODE_SHUTDOWN); dprintf(DEBUG_INFO, "exit\n"); + StopSubtitles(); g_Zapit->stopPlayBack(); frameBuffer->paintBackground(); @@ -4147,6 +4153,7 @@ printf("CNeutrinoApp::startNextRecording: start to dir %s\n", recordingDir); * CNeutrinoApp - exec, menuitem callback (shutdown) * **************************************************************************************/ void SaveMotorPositions(); + int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) { // printf("ac: %s\n", actionKey.c_str()); @@ -4427,6 +4434,20 @@ printf("New timeshift dir: %s\n", timeshiftDir); } return menu_return::RETURN_REPAINT; } + else if(actionKey == "ttx_font") { + parent->hide(); + CFileBrowser fileBrowser; + CFileFilter fileFilter; + fileFilter.addFilter("ttf"); + fileBrowser.Filter = &fileFilter; + if (fileBrowser.exec(FONTDIR) == true) { + strcpy(g_settings.ttx_font_file, fileBrowser.getSelectedFile()->Name.c_str()); + ttx_font_file = fileBrowser.getSelectedFile()->Name; + printf("[neutrino] ttx font file %s\n", fileBrowser.getSelectedFile()->Name.c_str()); + SetupFonts(); + } + return menu_return::RETURN_REPAINT; + } else if(actionKey == "movieplugin") { parent->hide(); CMenuWidget MoviePluginSelector(LOCALE_MOVIEPLAYER_DEFPLUGIN, NEUTRINO_ICON_FEATURES); @@ -4961,7 +4982,7 @@ void CNeutrinoApp::SelectSubtitles() int page = ((sd->teletext_magazine_number & 0xFF) << 8) | sd->teletext_page_number; printf("CNeutrinoApp::SelectSubtitles: found TTX %s, pid %x page %03X\n", sd->ISO639_language_code.c_str(), sd->pId, page); tuxtx_stop_subtitle(); - tuxtx_set_pid(sd->pId, page); + tuxtx_set_pid(sd->pId, page, (char *) sd->ISO639_language_code.c_str()); return; } } diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index f5708cedf..9345e3bcc 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -1004,12 +1004,12 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/ extern int scan_pids; -#define FAST_SCAN_OPTIONS_COUNT 3 +#define FAST_SCAN_OPTIONS_COUNT 2 const CMenuOptionChooser::keyval FAST_SCAN_OPTIONS[FAST_SCAN_OPTIONS_COUNT] = { { FAST_SCAN_SD, LOCALE_SATSETUP_FASTSCAN_SD }, - { FAST_SCAN_HD, LOCALE_SATSETUP_FASTSCAN_HD }, - { FAST_SCAN_ALL, LOCALE_SATSETUP_FASTSCAN_ALL } + { FAST_SCAN_HD, LOCALE_SATSETUP_FASTSCAN_HD } + /*{ FAST_SCAN_ALL, LOCALE_SATSETUP_FASTSCAN_ALL }*/ }; #define FAST_SCAN_PROV_OPTIONS_COUNT 3 @@ -1244,6 +1244,7 @@ void CNeutrinoApp::InitScanSettings(CMenuWidget &settings) settings.addItem(fsatSetup); settings.addItem(fmotorMenu); } + settings.addItem(new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_TIMEOUT, (int *)&zapitCfg.feTimeout, true, 0, 100) ); settings.addItem(new CMenuForwarder(LOCALE_SATSETUP_MANUAL_SCAN, true, NULL, manualScan, "", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN)); settings.addItem(new CMenuForwarder(LOCALE_SATSETUP_AUTO_SCAN, true, NULL, autoScan, "", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW)); @@ -2350,6 +2351,7 @@ void CNeutrinoApp::InitColorSettings(CMenuWidget &colorSettings, CMenuWidget &fo colorSettings.addItem(GenericMenuSeparatorLine); colorSettings.addItem( new CMenuForwarder(LOCALE_COLORMENU_FONT, true, NULL, &fontSettings, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE) ); colorSettings.addItem( new CMenuForwarder(LOCALE_EPGPLUS_SELECT_FONT_NAME, true, NULL, this, "select_font")); + colorSettings.addItem( new CMenuForwarder(LOCALE_COLORMENU_FONT_TTX, true, NULL, this, "ttx_font")); CMenuWidget *colorSettings_timing = new CMenuWidget(LOCALE_COLORMENU_TIMING, NEUTRINO_ICON_SETTINGS); InitColorSettingsTiming(*colorSettings_timing); diff --git a/src/system/configure_network.cpp b/src/system/configure_network.cpp index f65bed07a..8b3dbfa7d 100644 --- a/src/system/configure_network.cpp +++ b/src/system/configure_network.cpp @@ -29,12 +29,30 @@ CNetworkConfig::CNetworkConfig(void) { char our_nameserver[16]; + netGetNameserver(our_nameserver); nameserver = our_nameserver; inet_static = getInetAttributes("eth0", automatic_start, address, netmask, broadcast, gateway); + + init_vars(); copy_to_orig(); } +void CNetworkConfig::init_vars(void) +{ + char mask[16]; + char _broadcast[16]; + char router[16]; + char ip[16]; + + netGetDefaultRoute(router); + gateway = router; + netGetIP((char *) "eth0", ip, mask, _broadcast); + netmask = mask; + broadcast = _broadcast; + address = ip; +} + void CNetworkConfig::copy_to_orig(void) { orig_automatic_start = automatic_start; @@ -108,6 +126,9 @@ int mysystem(char * cmd, char * arg1, char * arg2) void CNetworkConfig::startNetwork(void) { system("/sbin/ifup -v eth0"); + if (!inet_static) { + init_vars(); + } //mysystem((char *) "ifup", (char *) "-v", (char *) "eth0"); } diff --git a/src/system/configure_network.h b/src/system/configure_network.h index 7993c087d..be90eca74 100644 --- a/src/system/configure_network.h +++ b/src/system/configure_network.h @@ -37,6 +37,7 @@ class CNetworkConfig void copy_to_orig(void); bool modified_from_orig(void); + void init_vars(void); public: bool automatic_start; diff --git a/src/system/locals.h b/src/system/locals.h index 99268fb9e..0fb38b485 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -243,6 +243,7 @@ typedef enum { LOCALE_COLORMENU_BACKGROUND, LOCALE_COLORMENU_FADE, LOCALE_COLORMENU_FONT, + LOCALE_COLORMENU_FONT_TTX, LOCALE_COLORMENU_GTX_ALPHA, LOCALE_COLORMENU_HEAD, LOCALE_COLORMENU_MENUCOLORS, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index fbe9af2c1..ec67ebc57 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -243,6 +243,7 @@ const char *locale_real_names[] = { "colormenu.background", "colormenu.fade", "colormenu.font", + "colormenu.font_ttx", "colormenu.gtx_alpha", "colormenu.head", "colormenu.menucolors", diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index a9f4b4554..93912b205 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -536,6 +536,10 @@ bool CIPChangeNotifier::changeNotify(const neutrino_locale_t, void * Data) CNeutrinoApp::getInstance()->networkConfig.netmask = (_ip[0] == 10) ? "255.0.0.0" : "255.255.255.0"; + sprintf(ip, "%hhu.%hhu.%hhu.1", _ip[0], _ip[1], _ip[2]); + CNeutrinoApp::getInstance()->networkConfig.nameserver = ip; + CNeutrinoApp::getInstance()->networkConfig.gateway = ip; + return true; } @@ -611,8 +615,11 @@ printf("CSubtitleChangeExec::exec: action %s\n", actionKey.c_str()); ptr = strchr(ptr, ':'); ptr++; int page = strtol(ptr, NULL, 16); -printf("CSubtitleChangeExec::exec: TTX, pid %x page %x\n", pid, page); + ptr = strchr(ptr, ':'); + ptr++; +printf("CSubtitleChangeExec::exec: TTX, pid %x page %x lang %s\n", pid, page, ptr); tuxtx_stop_subtitle(); + tuxtx_set_pid(pid, page, ptr); dvbsub_stop(); tuxtx_main(g_RCInput->getFileHandle(), pid, page); } diff --git a/src/system/settings.h b/src/system/settings.h index fd204b977..664d0fe00 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -432,6 +432,7 @@ struct SNeutrinoSettings int zap_cycle; int sms_channel; char font_file[100]; + char ttx_font_file[100]; char update_dir[100]; // USERMENU typedef enum diff --git a/src/zapit/include/zapit/channel.h b/src/zapit/include/zapit/channel.h index 25f85b2e1..4c1d376fd 100644 --- a/src/zapit/include/zapit/channel.h +++ b/src/zapit/include/zapit/channel.h @@ -140,6 +140,7 @@ class CZapitChannel /* from neutrino CChannel class */ uint64_t last_unlocked_EPGid; + std::string ttx_language_code; friend class CChannelList; public: @@ -174,6 +175,7 @@ class CZapitChannel unsigned short getPcrPid(void) { return pcrPid; } unsigned short getPmtPid(void) { return pmtPid; } unsigned short getTeletextPid(void) { return teletextPid; } + const char * getTeletextLang(void) { return ttx_language_code.c_str(); } unsigned short getVideoPid(void) { return videoPid; } unsigned short getPrivatePid(void) { return privatePid; } unsigned short getPreAudioPid(void) { return audioPid; } @@ -193,6 +195,7 @@ class CZapitChannel void setPcrPid(unsigned short pPcrPid) { pcrPid = pPcrPid; } void setPmtPid(unsigned short pPmtPid) { pmtPid = pPmtPid; } void setTeletextPid(unsigned short pTeletextPid) { teletextPid = pTeletextPid; } + void setTeletextLang(char * lang) { ttx_language_code = lang; }; void setVideoPid(unsigned short pVideoPid) { videoPid = pVideoPid; } void setAudioPid(unsigned short pAudioPid) { audioPid = pAudioPid; } void setPrivatePid(unsigned short pPrivatePid) { privatePid = pPrivatePid; } diff --git a/src/zapit/src/channel.cpp b/src/zapit/src/channel.cpp index 5d0c77882..ad4f6ba8f 100644 --- a/src/zapit/src/channel.cpp +++ b/src/zapit/src/channel.cpp @@ -41,6 +41,7 @@ CZapitChannel::CZapitChannel(const std::string & p_name, t_service_id p_sid, t_t //currentEvent = NULL; pmtPid = 0; resetPids(); + ttx_language_code = ""; //printf("NEW CHANNEL %s %x\n", name.c_str(), this); } diff --git a/src/zapit/src/pmt.cpp b/src/zapit/src/pmt.cpp index b041bde66..1cde22922 100644 --- a/src/zapit/src/pmt.cpp +++ b/src/zapit/src/pmt.cpp @@ -143,13 +143,18 @@ printf("descr 0x0A: %02X %02X %02X\n", buffer[pos+2], buffer[pos+3], buffer[pos+ break; case 0x56: /* teletext descriptor */ - for (unsigned char fIdx=0;fIdxelementary_PID, tmpLang); + printf("[pmt] teletext pid %x\n", esInfo->elementary_PID); + for (unsigned char fIdx = 0; fIdx < fieldCount; fIdx++) { memcpy(tmpLang, &buffer[pos + 5*fIdx + 2], 3); tmpLang[3] = '\0'; unsigned char teletext_type=buffer[pos + 5*fIdx + 5]>> 3; unsigned char teletext_magazine_number = buffer[pos + 5*fIdx + 5] & 7; unsigned char teletext_page_number=buffer[pos + 5*fIdx + 6]; +printf("[pmt] teletext type %d mag %d page %d lang %s\n", teletext_type, teletext_magazine_number, teletext_page_number, tmpLang); + if (teletext_type==0x01) + channel->setTeletextLang(tmpLang); if (teletext_type==0x02){ channel->addTTXSubtitle(esInfo->elementary_PID,tmpLang,teletext_magazine_number,teletext_page_number); } else { diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 9ba716198..cd49be7fb 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -516,10 +516,23 @@ printf("[zapit] saving channel, apid %x sub pid %x mode %d volume %d\n", channel dvbsub_start(audio_map_it->second.subpid); #endif dvbsub_setpid(audio_map_it->second.subpid); - tuxtx_set_pid(audio_map_it->second.ttxpid, audio_map_it->second.ttxpage); + + std::string tmplang; + for (int i = 0 ; i < (int)channel->getSubtitleCount() ; ++i) { + CZapitAbsSub* s = channel->getChannelSub(i); + if(s->pId == audio_map_it->second.ttxpid) { + tmplang = s->ISO639_language_code; + break; + } + } + if(tmplang.empty()) + tuxtx_set_pid(audio_map_it->second.ttxpid, audio_map_it->second.ttxpage, (char *) channel->getTeletextLang()); + else + tuxtx_set_pid(audio_map_it->second.ttxpid, audio_map_it->second.ttxpage, (char *) tmplang.c_str()); } else { volume_left = volume_right = def_volume_left; audio_mode = def_audio_mode; + tuxtx_set_pid(0, 0, (char *) channel->getTeletextLang()); } if(audioDecoder) { //audioDecoder->setVolume(volume_left, volume_right); @@ -530,6 +543,7 @@ printf("[zapit] saving channel, apid %x sub pid %x mode %d volume %d\n", channel startPlayBack(channel); printf("[zapit] sending capmt....\n"); + /* currently, recording always starts after zap to channel. * if we not in record mode, we just send new pmt over cam0, * if mode is recording, we zapping from or back to recording channel.