From 9facbaec6d1678b9f970ed91ca2c9a420293dfe9 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Wed, 30 May 2012 21:09:50 +0100 Subject: [PATCH] UTF-8 patch from Marten Richter, inc threadMethod err 1 fix --- l10n/format-definition | 10 ++-- l10n/main-de | 50 +++++++++--------- l10n/main-fi | 36 ++++++------- l10n/main-fr | 4 +- l10n/main-hu | 112 ++++++++++++++++++++--------------------- l10n/main-it | 6 +-- l10n/main-nl | 2 +- l10n/main-sv | 52 +++++++++---------- l10n/missing-fr | 4 +- responsepacket.h | 1 + vompclient.c | 31 +++++++++++- vompclient.h | 6 +++ vompclientrrproc.c | 110 +++++++++++++++++++++++++++++++--------- vompclientrrproc.h | 1 + 14 files changed, 262 insertions(+), 163 deletions(-) diff --git a/l10n/format-definition b/l10n/format-definition index e710c8b..69a3d56 100644 --- a/l10n/format-definition +++ b/l10n/format-definition @@ -11,13 +11,13 @@ vomp-l10n:[] represents a whitespace string (spaces and/or tabs). can be any string of visible ASCII characters. It is intended to be a recognised language code or locale code. - can be any Latin-1 string (TODO: UTF-8). + can be any UTF-8 string. Example: vomp-l10n: cy Cymraeg vomp-l10n:ga-IE Gaeilge -vomp-l10n: gd-GB Gàidhlig +vomp-l10n: gd-GB Gàidhlig The first line not of this form begins the main body of the translation file. @@ -35,7 +35,7 @@ If there is no previous key, the translation is ignored. must match one of the codes introduced by the vomp-l10n: section; otherwise the line is ignored. - can be any Latin-1 string (TODO: UTF-8). + can be any UTF-8 string. Any other lines (blank or otherwise) are ignored. Nonblank lines should be treated as comments and preserved by tools written to manipulate these files. @@ -49,8 +49,8 @@ gd: Aon * This is a comment. Note the trailing whitespace below. x:"two " -gd: "dà " -ga: "dó " +gd: "dà " +ga: "dó " This is a comment, perhaps giving a good reason why the translation below has no trailing space. The quotation marks have no effect here. cy: "dau" diff --git a/l10n/main-de b/l10n/main-de index a0ceadc..1625bdf 100644 --- a/l10n/main-de +++ b/l10n/main-de @@ -1,5 +1,5 @@ l10n-vomp:de Deutsch -* German translation by André Jagusch +* German translation by André Jagusch x: VDR de: VDR @@ -51,7 +51,7 @@ x: %lu\t%s de: %lu\t%s x: [ok] = menu -de: [ok] = Menü +de: [ok] = Menü x: %lu%% used, %iGB free de: %lu%% belegt, %iGB frei @@ -69,7 +69,7 @@ de: Nein * RECORDING MENU * x: Programme menu -de: Programm-Menü +de: Programm-Menü x: Play de: Wiedergeben @@ -81,23 +81,23 @@ x: Summary de: Inhalt x: Delete -de: Löschen +de: Löschen x: Programme summary de: Programminhalt x: Summary unavailable -de: Inhalt nicht verfügbar +de: Inhalt nicht verfügbar x: Delete recording -de: Aufnahme löschen +de: Aufnahme löschen x: Are you sure you want to delete this recording? -de: Sind Sie sich sicher, dass Sie diese Aufnahme löschen möchten? +de: Sind Sie sich sicher, dass Sie diese Aufnahme löschen möchten? * SERVER SELECT * x: Choose a VDR server -de: Wählen Sie einen VDR-Server +de: Wählen Sie einen VDR-Server * OPTION MENUS * x: Options @@ -134,7 +134,7 @@ x: Default end margin (minutes) de: Standard End-Zeitpuffer (Min.) x: Default priority -de: Standard Priorität +de: Standard Priorität x: Default lifetime de: Standard Lebenszeit @@ -143,13 +143,13 @@ x: Advanced Options de: Erweiterte Einstellungen x: TV connection type -de: TV-Anschlußart +de: TV-Anschlußart x: Remote control type de: Fernbedienungstyp x: TV aspect ratio -de: Seitenverhältnis +de: Seitenverhältnis x: 16:9 on 4:3 display mode de: 16:9 auf 4:3-Modus @@ -158,7 +158,7 @@ x: Power state after bootup de: Einschalten nach Neustart x: Display channels -de: Kanäle anzeigen +de: Kanäle anzeigen x: Language de: Sprache @@ -173,7 +173,7 @@ x: VDR-Pri 0=OK !See forums! de: VDR-Pri 0=OK !Siehe Forum! x: TCP receive window size -de: TCP Empfangsgrösse +de: TCP Empfangsgrösse x: Use WSS (PAL only) de: Benutze WSS (nur PAL) @@ -214,20 +214,20 @@ de: Aus * CHANNEL LISTS * x: Channels -de: Fernsehkanäle +de: Fernsehkanäle x: Radio Stations -de: Radiokanäle +de: Radiokanäle * BANNERS * x: No channel data available -de: Keine Daten für diesen Kanal verfügbar +de: Keine Daten für diesen Kanal verfügbar x: info de: Info x: Channel unavailable -de: Kanal nicht verfügbar +de: Kanal nicht verfügbar * CONNECT SCREEN * x: Locating server @@ -269,7 +269,7 @@ x: Go: Preview de: Go: Vorschau x: Guide / Back: Close -de: Back:EPG schließen +de: Back:EPG schließen x: Rec: Set timer de: Rec: Neuer Timer @@ -278,7 +278,7 @@ x: Sel channel de: Umschalten x: There are no programme details available for this period -de: Es sind keine Programminformationen für diesen Zeitraum verfügbar +de: Es sind keine Programminformationen für diesen Zeitraum verfügbar x: No programme details de: Keine Programminformation @@ -316,7 +316,7 @@ x: Stop de: Ende x: Priority -de: Priorität +de: Priorität x: Lifetime de: Lebenszeit @@ -331,7 +331,7 @@ x: Move de: Verschieben x: Failed to delete recording -de: Löschen der Aufnahme fehlgeschlagen +de: Löschen der Aufnahme fehlgeschlagen x: Failed to move recording de: Verschieben der Aufnahme fehlgeschlagen @@ -346,7 +346,7 @@ x: Timer set successfully de: Timer erfolgreich angelegt x: There is already a timer for this event -de: Für dieses Ereignis existiert schon ein Timer +de: Für dieses Ereignis existiert schon ein Timer x: Failure setting timer de: Fehler beim Anlegen des Timers @@ -367,7 +367,7 @@ de: Keine Verbindung zum VDR x: Format(px) x: Filesize -de: Dateigröße +de: Dateigröße x: Time de: Zeit @@ -388,7 +388,7 @@ de: Playlist de*Wiedergabeliste?? x: unable to open audio file -de: kann die Audio Datei nicht öffnen +de: kann die Audio Datei nicht öffnen x: Rand de: Zuf. @@ -409,7 +409,7 @@ x: Mono de: Mono x: Artist -de: Künstler +de: Künstler x: Year de: Jahr diff --git a/l10n/main-fi b/l10n/main-fi index 8924248..466292f 100644 --- a/l10n/main-fi +++ b/l10n/main-fi @@ -5,7 +5,7 @@ x: VDR fi: VDR x: Welcome -fi: Üdvözöljük +fi: Üdvözöljük x: 1. Live TV fi: 1. TV @@ -26,10 +26,10 @@ x: 6. Options fi: 6. Asetukset x: 6. Reboot -fi: 6. Uudelleenkäynnistys +fi: 6. Uudelleenkäynnistys x: 7. Reboot -fi: 7. Uudelleenkäynnistys +fi: 7. Uudelleenkäynnistys x: Downloading recordings list fi: Ladataan tallennelistaa @@ -47,15 +47,15 @@ x: [ok] = menu fi: [ok] = valikko x: %lu%% used, %iGB free -fi: %lu%% käytetty, %iGt vapaana +fi: %lu%% käytetty, %iGt vapaana * Also used in channels list x: %i to %i of %i -fi: %i - %i (yhteensä %i) +fi: %i - %i (yhteensä %i) * QUESTION * x: Yes -fi: Kyllä +fi: Kyllä x: No fi: Ei @@ -65,7 +65,7 @@ x: Programme menu fi: Ohjelmavalikko x: Play -fi: Näytä +fi: Näytä x: Resume fi: Jatka @@ -86,7 +86,7 @@ x: Delete recording fi: Poista tallenne x: Are you sure you want to delete this recording? -fi: Oletko varma, että haluat poistaa tämän tallenteen? +fi: Oletko varma, että haluat poistaa tämän tallenteen? * SERVER SELECT * x: Choose a VDR server @@ -97,7 +97,7 @@ x: Options fi: Asetukset x: TV connection type -fi: TV-liityntä +fi: TV-liityntä x: Remote control type fi: Kauko-ohjaimen tyyppi @@ -106,13 +106,13 @@ x: TV aspect ratio fi: Kuvasuhde x: 16:9 on 4:3 display mode -fi: 16:9 kuvasuhde 4:3 TV:ssä +fi: 16:9 kuvasuhde 4:3 TV:ssä x: Power state after bootup -fi: Tila käynnistyksen jälkeen +fi: Tila käynnistyksen jälkeen x: Display channels -fi: Näytä kanavat +fi: Näytä kanavat x: Language fi: Kieli @@ -152,7 +152,7 @@ x: FTA only fi: Vain FTA x: On -fi: Päällä +fi: Päällä x: Off fi: Poissa @@ -176,16 +176,16 @@ fi: Kanava ei saatavilla * CONNECT SCREEN * x: Locating server -fi: Etsitään palvelinta +fi: Etsitään palvelinta x: Connecting to VDR -fi: Yhdistetään VDR:ään +fi: Yhdistetään VDR:ään x: Login failed -fi: Sisäänkirjautuminen epäonnistui +fi: Sisäänkirjautuminen epäonnistui x: Connection failed -fi: Yhteys epäonnistui +fi: Yhteys epäonnistui * COMMAND * x: Connected, loading config @@ -223,7 +223,7 @@ x: Sel channel fi: Valitse kanava x: There are no programme details available for this period -fi: Tälle ajanjaksolle ei saatavilla ohjelmatietoja +fi: Tälle ajanjaksolle ei saatavilla ohjelmatietoja x: No programme details fi: Ei ohjelmatietoja diff --git a/l10n/main-fr b/l10n/main-fr index 44c1d26..adc9751 100644 --- a/l10n/main-fr +++ b/l10n/main-fr @@ -1,4 +1,4 @@ -l10n-vomp: fr Français +l10n-vomp: fr Français * Translation by jtk x: VDR @@ -97,7 +97,7 @@ x: TV connection type fr: Type de connection TV x: Remote control type -fr: Type telecommande +fr: Type télécommande x: TV aspect ratio fr: Rapport TV diff --git a/l10n/main-hu b/l10n/main-hu index d466c05..17a491d 100644 --- a/l10n/main-hu +++ b/l10n/main-hu @@ -1,5 +1,5 @@ l10n-vomp: hu Magyar -* Translation by Pák Gergely +* Translation by Pák Gergely x: VDR hu: VDR @@ -11,47 +11,47 @@ x: 1. Live TV hu: 1. TV x: 2. Radio -hu: 2. Rádió +hu: 2. Rádió x: 3. Recordings -hu: 3. Felvett müsorok +hu: 3. Felvett müsorok x: 4. Timers -hu: 4. Felvétel +hu: 4. Felvétel x: 5. Options -hu: 5. Beállítások +hu: 5. Beállítások x: 6. Options -hu: 6. Beállítások +hu: 6. Beállítások x: 6. Reboot -hu: 6. Újraindítás +hu: 6. Újraindítás x: 7. Reboot -hu: 7. Újraindítás +hu: 7. Újraindítás x: Downloading recordings list -hu: Felvétellista letöltése +hu: Felvétellista letöltése x: Recordings - %s -hu: Felvételek - %s +hu: Felvételek - %s x: Recordings -hu: Felvételek +hu: Felvételek x: %lu\t%s hu: %lu\t%s x: [ok] = menu -hu: [ok] = menü +hu: [ok] = menü x: %lu%% used, %iGB free -hu: %lu%% felhasznált, %iGB szabad +hu: %lu%% felhasznált, %iGB szabad * Also used in channels list x: %i to %i of %i -hu: %i - %i (összesen %i) +hu: %i - %i (összesen %i) * QUESTION * x: Yes @@ -62,73 +62,73 @@ hu: Nem * RECORDING MENU * x: Programme menu -hu: Müsor menü +hu: Müsor menü x: Play -hu: Lejátszás +hu: Lejátszás x: Resume -hu: Folytatás +hu: Folytatás x: Summary hu: Tartalom x: Delete -hu: Törlés +hu: Törlés x: Programme summary -hu: Müsor tartalom +hu: Müsor tartalom x: Summary unavailable -hu: Tartalom nem elérhetö +hu: Tartalom nem elérhetö x: Delete recording -hu: Felvétel törlése +hu: Felvétel törlése x: Are you sure you want to delete this recording? -hu: Biztosan törölni szeretné ezt a felvételt? +hu: Biztosan törölni szeretné ezt a felvételt? * SERVER SELECT * x: Choose a VDR server -hu: Válasszon egy VDR szervert +hu: Válasszon egy VDR szervert * OPTION MENUS * x: Options -hu: Beállitások +hu: Beállitások x: TV connection type -hu: TV csatlakozás tipusa +hu: TV csatlakozás tipusa x: Remote control type -hu: Távirányitó tipusa +hu: Távirányitó tipusa x: TV aspect ratio -hu: TV képformátum +hu: TV képformátum x: 16:9 on 4:3 display mode -hu: 16:9 a 4:3-as képernyön +hu: 16:9 a 4:3-as képernyön x: Power state after bootup -hu: Bekapcsolás utáni állapot +hu: Bekapcsolás utáni állapot x: Display channels -hu: Csatornák megjelenítése +hu: Csatornák megjelenítése x: Language hu: Nyelv x: Press back to exit, <, > or [ok] to change -hu: [back] gombbal kilép, [<], [>] vagy [ok] gombbal választ +hu: [back] gombbal kilép, [<], [>] vagy [ok] gombbal választ x: VDR-Pri 0=OK !See forums! -hu: VDR-Pri 0=OK !lásd. fórum! +hu: VDR-Pri 0=OK !lásd. fórum! * OPTION CHOICES * x: Old -hu: Régi +hu: Régi x: New -hu: Új +hu: Új x: RGB+composite hu: RGB+composite @@ -137,16 +137,16 @@ x: S-Video hu: S-Video x: Chop sides -hu: Szélek levágva +hu: Szélek levágva x: Letterbox hu: Letterbox x: Last state -hu: Utolsó állapot +hu: Utolsó állapot x: All -hu: Összes +hu: Összes x: FTA only hu: Csak FTA @@ -159,37 +159,37 @@ hu: Ki * CHANNEL LISTS * x: Channels -hu: Csatornák +hu: Csatornák x: Radio Stations -hu: Rádiócsatornák +hu: Rádiócsatornák * BANNERS * x: No channel data available -hu: Csatorna-adatok nem állnak rendelkezésre +hu: Csatorna-adatok nem állnak rendelkezésre x: info -hu: Infó +hu: Infó x: Channel unavailable -hu: A csatorna nem elérhetö +hu: A csatorna nem elérhetö * CONNECT SCREEN * x: Locating server -hu: Szerver keresése +hu: Szerver keresése x: Connecting to VDR -hu: Csatlakozás a VDR-hez +hu: Csatlakozás a VDR-hez x: Login failed -hu: Bejelentkezés sikertelen +hu: Bejelentkezés sikertelen x: Connection failed -hu: Kapcsolódás sikertelen +hu: Kapcsolódás sikertelen * COMMAND * x: Connected, loading config -hu: Kapcsolódva, beállitások betöltése +hu: Kapcsolódva, beállitások betöltése * EPG * x: EPG @@ -205,30 +205,30 @@ x: Page down hu: Le x: -24 hours -hu: -24 óra +hu: -24 óra x: +24 hours -hu: +24 óra +hu: +24 óra x: Go: Preview -hu: Go: Betekintés +hu: Go: Betekintés x: Guide / Back: Close -hu: Guide/Back: Bezárás +hu: Guide/Back: Bezárás x: Rec: Set timer -hu: Rec: Felvétel beállítása +hu: Rec: Felvétel beállítása x: Sel channel -hu: Csatornaválasztás +hu: Csatornaválasztás x: There are no programme details available for this period -hu: Nincs programinformáció ehhez az idöszakhoz +hu: Nincs programinformáció ehhez az idöszakhoz x: No programme details -hu: Nincs programinformáció +hu: Nincs programinformáció * TIMERS * x: Timers -hu: Felvétel +hu: Felvétel diff --git a/l10n/main-it b/l10n/main-it index adcb6fd..cab7cb9 100644 --- a/l10n/main-it +++ b/l10n/main-it @@ -62,7 +62,7 @@ it: %i a %i di %i * QUESTION * x: Yes -it: Sì +it: Sì x: No it: Non @@ -346,7 +346,7 @@ x: Timer set successfully it: Timer impostato x: There is already a timer for this event -it: C'è gia un Timer per questo evento +it: C'è gia un Timer per questo evento x: Failure setting timer it: Falito di impostare questo Timer @@ -362,7 +362,7 @@ x: No Media found it: Non ho trovaro la media x: no VDR connection -it: Non c'è una connesione al VDR +it: Non c'è una connesione al VDR x: Format(px) it: Formatto(px) diff --git a/l10n/main-nl b/l10n/main-nl index 3485a97..31bf45c 100644 --- a/l10n/main-nl +++ b/l10n/main-nl @@ -263,7 +263,7 @@ x: Set Timer nl: Zet Timer x: Create this timer? -nl: Deze timer creëren? +nl: Deze timer creëren? * TIMERS * x: Timers diff --git a/l10n/main-sv b/l10n/main-sv index 2206003..23a0e32 100644 --- a/l10n/main-sv +++ b/l10n/main-sv @@ -5,7 +5,7 @@ x: VDR sv: VDR x: Welcome -sv: Välkommen +sv: Välkommen x: 1. Live TV sv: 1. TV @@ -17,10 +17,10 @@ x: 3. Recordings sv: 3. Inspelningar x: 5. Options -sv: 5. Inställningar +sv: 5. Inställningar x: 6. Options -sv: 6. Inställningar +sv: 6. Inställningar x: 6. Reboot sv: 6. Starta om @@ -29,7 +29,7 @@ x: 7. Reboot sv: 7. Starta om x: Downloading recordings list -sv: Laddar lista över inspelningar +sv: Laddar lista över inspelningar x: Recordings - %s sv: Inspelningar - %s @@ -44,7 +44,7 @@ x: [ok] = menu sv: [ok] = meny x: %lu%% used, %iGB free -sv: %lu%% använt, %iGB ledigt +sv: %lu%% använt, %iGB ledigt * Also used in channels list x: %i to %i of %i @@ -65,7 +65,7 @@ x: Play sv: Spela upp x: Resume -sv: Återuppta +sv: Återuppta x: Summary sv: Sammanfattning @@ -77,45 +77,45 @@ x: Programme summary sv: Programsammanfattning x: Summary unavailable -sv: Ingen sammanfattning tillgänglig +sv: Ingen sammanfattning tillgänglig x: Delete recording sv: Ta bort inspelning x: Are you sure you want to delete this recording? -sv: Är du säker att du vill ta bort den här inspelningen +sv: Är du säker att du vill ta bort den här inspelningen * SERVER SELECT * x: Choose a VDR server -sv: Välj VDR server +sv: Välj VDR server * OPTION MENUS * x: Options -sv: Inställningar +sv: Inställningar x: TV connection type sv: Typ av TV-anslutning x: Remote control type -sv: Fjärrkontroll +sv: Fjärrkontroll x: TV aspect ratio sv: TV-format x: 16:9 on 4:3 display mode -sv: 16:9 på 4:3-skärm +sv: 16:9 pÃ¥ 4:3-skärm x: Power state after bootup -sv: Läge efter strömborfall +sv: Läge efter strömborfall x: Display channels sv: Visa kanaler x: Language -sv: Språk +sv: SprÃ¥k x: Press back to exit, <, > or [ok] to change -sv: Tryck [back] för att avsluta, eller [ok] för att ändra +sv: Tryck [back] för att avsluta, eller [ok] för att ändra x: VDR-Pri 0=OK !See forums! sv: VDR-Prio 0=OK !Se forum! @@ -134,13 +134,13 @@ x: S-Video sv: S-Video x: Chop sides -sv: Ta bort på sidorna +sv: Ta bort pÃ¥ sidorna x: Letterbox sv: Letterbox x: Last state -sv: Återgå til senaste läge +sv: ÅtergÃ¥ til senaste läge x: All sv: Alla @@ -149,7 +149,7 @@ x: FTA only sv: Endast FTA x: On -sv: På +sv: PÃ¥ x: Off sv: Av @@ -163,13 +163,13 @@ sv: Radiostationer * BANNERS * x: No channel data available -sv: Ingen programinformation tillgänglig +sv: Ingen programinformation tillgänglig x: info sv: Info x: Channel unavailable -sv: Kanalen är inte tillgänglig +sv: Kanalen är inte tillgänglig * CONNECT SCREEN * x: Locating server @@ -196,10 +196,10 @@ x: OK sv: OK x: Page up -sv: Föregående sida +sv: FöregÃ¥ende sida x: Page down -sv: Nästa sida +sv: Nästa sida x: -24 hours sv: -24 timmar @@ -211,17 +211,17 @@ x: Go: Preview sv: Go: Visa x: Guide / Back: Close -sv: Guide / Back: Stäng +sv: Guide / Back: Stäng x: Rec: Set timer sv: Rec: Programmera timer x: Sel channel -sv: Välj kanal +sv: Välj kanal x: There are no programme details available for this period -sv: Det finns ingen programinforamtion för denna period +sv: Det finns ingen programinforamtion för denna period x: No programme details -sv: Ingen programinformation tillgänglig +sv: Ingen programinformation tillgänglig diff --git a/l10n/missing-fr b/l10n/missing-fr index e7f11f7..3691991 100644 --- a/l10n/missing-fr +++ b/l10n/missing-fr @@ -1,5 +1,5 @@ -l10n-vomp: fr Français -* Missing texts for fr (Français) supplemented with en (English) +l10n-vomp: fr Français +* Missing texts for fr (Français) supplemented with en (English) x: 4. Timers fr: 4. Timers diff --git a/responsepacket.h b/responsepacket.h index 945d28b..13fb0a7 100644 --- a/responsepacket.h +++ b/responsepacket.h @@ -22,6 +22,7 @@ #define RESPONSEPACKET_H #include "defines.h" +#include class ResponsePacket { diff --git a/vompclient.c b/vompclient.c index 6562fe7..64fd20b 100644 --- a/vompclient.c +++ b/vompclient.c @@ -56,6 +56,10 @@ VompClient::VompClient(Config* cfgBase, char* tconfigDir, int tsocket) media=new MediaPlayer(); mediaprovider=new ServerMediaFile(cfgBase,media); netLogFile = NULL; + charcoding=1; //latin1 is default + charconvsys=NULL; + charconvutf8=NULL; + setCharset(charcoding); rrproc.init(); } @@ -84,6 +88,10 @@ VompClient::~VompClient() delete media; delete mediaprovider; + + if (charconvsys) delete charconvsys; + if (charconvutf8) delete charconvutf8; + if (netLogFile) { @@ -92,6 +100,27 @@ VompClient::~VompClient() } } +void VompClient::setCharset(int charset) +{ + charcoding=charset; + cCharSetConv *oldcharconvsys=charconvsys; + cCharSetConv *oldcharconvutf8=charconvutf8; + switch (charcoding) { + case 2: //UTF-8 + charconvsys=new cCharSetConv(NULL,"UTF-8"); + charconvutf8=new cCharSetConv("UTF-8","UTF-8"); + break; + case 1: + default://latin1 + charconvsys=new cCharSetConv(NULL,"ISO-8859-1"); + charconvutf8=new cCharSetConv("UTF-8","ISO-8859-1"); + break; + }; + if (oldcharconvsys) delete oldcharconvsys; + if (oldcharconvutf8) delete oldcharconvutf8; + +} + void VompClient::incClients() { pthread_mutex_lock(&threadClientMutex); @@ -393,7 +422,7 @@ void VompClient::writeResumeData() (char*)recplayer->getCurrentRecording()->FileName(), recplayer->frameNumberFromPosition(recplayer->getLastPosition()) );*/ - /* write to vdrdeveldevel resume file */ + /* write to vdr resume file */ int resume = recplayer->frameNumberFromPosition(recplayer->getLastPosition()); char* ResumeIdC = config.getValueString("General", "ResumeId"); int ResumeId; diff --git a/vompclient.h b/vompclient.h index a7b0bf0..cab1599 100644 --- a/vompclient.h +++ b/vompclient.h @@ -110,6 +110,12 @@ class VompClient #endif MediaPlayer *media; ServerMediaFile *mediaprovider; + + void setCharset(int charset); + int charcoding; // 1= latin1 2= UTF-8 + cCharSetConv *charconvutf8; + cCharSetConv *charconvsys; + }; #endif diff --git a/vompclientrrproc.c b/vompclientrrproc.c index ccc628f..44e7bd4 100644 --- a/vompclientrrproc.c +++ b/vompclientrrproc.c @@ -90,9 +90,35 @@ void VompClientRRProc::threadMethod() if (req_queue.size() != 0) { - log->log("RRProc", Log::ERR, "threadMethod err 1"); - threadUnlock(); - return; +/* +- log->log("RRProc", Log::ERR, "threadMethod err 1"); +- threadUnlock(); +- return; + +That was how the code used to be. + +TODO: Work out why this happens. +*/ + + log->log("RRProc", Log::ERR, "threadMethod startup with already queued packets"); + while (req_queue.size()) + { + //log->log("RRProc", Log::DEBUG, "thread while"); + req = req_queue.front(); + req_queue.pop(); + + threadUnlock(); // allow recvRequest to be queuing packets while we are working on this one + + if (!processPacket()) + { + log->log("RRProc", Log::ERR, "processPacket exited with fail"); + return; + } + + threadLock(); + } + log->log("RRProc", Log::ERR, "threadMethod startup with already queued packets done."); + } while(1) @@ -241,6 +267,9 @@ bool VompClientRRProc::processPacket() case VDR_CLOSECHANNEL: result= processCloseMediaChannel(); break; + case 37: + result = processSetCharset(); + break; } @@ -283,6 +312,25 @@ int VompClientRRProc::processLogin() return 1; } +int VompClientRRProc::processSetCharset() +{ + int charset = ntohl(*(ULONG*)req->data); + if (charset>0 && charset<3) { + log->log("RRProc", Log::DEBUG, "Set charset to %d", charset); + x.setCharset(charset); + resp->addULONG(1); + } else { + log->log("RRProc", Log::DEBUG, "Invalid charset %d", charset); + resp->addULONG(0); + } + resp->finalise(); + x.tcp.sendPacket(resp->getPtr(), resp->getLen()); + +} + + + + int VompClientRRProc::processConfigSave() { char* section = (char*)req->data; @@ -342,7 +390,7 @@ int VompClientRRProc::processConfigLoad() if (value) { - resp->addString(value); + resp->addString(value);//client coding, do not touch log->log("RRProc", Log::DEBUG, "Written config load packet"); delete[] value; } @@ -561,8 +609,8 @@ int VompClientRRProc::processGetLanguageList() I18n::lang_code_list::const_iterator iter; for (iter = languages.begin(); iter != languages.end(); ++iter) { - resp->addString(iter->first.c_str()); - resp->addString(iter->second.c_str()); + resp->addString(iter->first.c_str()); // Source code is acsii + resp->addString(x.charconvutf8->Convert(iter->second.c_str())); //translate string can be any utf-8 character } resp->finalise(); x.tcp.sendPacket(resp->getPtr(), resp->getLen()); @@ -579,8 +627,8 @@ int VompClientRRProc::processGetLanguageContent() I18n::trans_table::const_iterator iter; for (iter = texts.begin(); iter != texts.end(); ++iter) { - resp->addString(iter->first.c_str()); - resp->addString(iter->second.c_str()); + resp->addString(iter->first.c_str());// source code is acsii since it is english + resp->addString(x.charconvutf8->Convert(iter->second.c_str())); // translate text can be any unicode string, it is stored as UTF-8 } resp->finalise(); x.tcp.sendPacket(resp->getPtr(), resp->getLen()); @@ -609,8 +657,8 @@ int VompClientRRProc::processGetRecordingsList() #else resp->addULONG(recording->Start()); #endif - resp->addString(recording->Name()); - resp->addString(recording->FileName()); + resp->addString(x.charconvsys->Convert(recording->Name())); //coding of recording name is system dependent + resp->addString(recording->FileName());//file name are not visible by user do not touch } resp->finalise(); @@ -641,7 +689,7 @@ int VompClientRRProc::processDeleteRecording() { if (recording->Delete()) { - // Copy svdrdeveldevelp's way of doing this, see if it works + // Copy svdrp's way of doing this, see if it works #if VDRVERSNUM > 10300 ::Recordings.DelByName(recording->FileName()); #endif @@ -803,7 +851,7 @@ int VompClientRRProc::processMoveRecording() #endif // Success. Send a different packet from just a ulong resp->addULONG(1); // success - resp->addString(newDir); + resp->addString(newDir); //system depent do not convert } else { @@ -863,7 +911,7 @@ int VompClientRRProc::processGetChannelsList() resp->addULONG(channel->Number()); resp->addULONG(type); - resp->addString(channel->Name()); + resp->addString(x.charconvsys->Convert(channel->Name())); #if VDRVERSNUM < 10703 resp->addULONG(2); #else @@ -971,19 +1019,19 @@ int VompClientRRProc::processGetChannelPids() for (ULONG i = 0; i < numApids; i++) { resp->addULONG(channel->Apid(i)); - resp->addString(channel->Alang(i)); + resp->addString(x.charconvsys->Convert(channel->Alang(i))); } resp->addULONG(numDpids); for (ULONG i = 0; i < numDpids; i++) { resp->addULONG(channel->Dpid(i)); - resp->addString(channel->Dlang(i)); + resp->addString(x.charconvsys->Convert(channel->Dlang(i))); } resp->addULONG(numSpids); for (ULONG i = 0; i < numSpids; i++) { resp->addULONG(channel->Spid(i)); - resp->addString(channel->Slang(i)); + resp->addString(x.charconvsys->Convert(channel->Slang(i))); } #endif resp->addULONG(channel->Tpid()); @@ -1364,9 +1412,9 @@ int VompClientRRProc::processGetChannelSchedule() resp->addULONG(thisEventTime); resp->addULONG(thisEventDuration); - resp->addString(thisEventTitle); - resp->addString(thisEventSubTitle); - resp->addString(thisEventDescription); + resp->addString(x.charconvsys->Convert(thisEventTitle)); + resp->addString(x.charconvsys->Convert(thisEventSubTitle)); + resp->addString(x.charconvsys->Convert(thisEventDescription)); atLeastOneEvent = true; } @@ -1412,7 +1460,7 @@ int VompClientRRProc::processGetTimers() resp->addULONG(timer->StopTime()); resp->addULONG(timer->Day()); resp->addULONG(timer->WeekDays()); - resp->addString(timer->File()); + resp->addString(timer->File()); //Filename is system specific and not visible by user } resp->finalise(); @@ -1567,6 +1615,9 @@ int VompClientRRProc::processGetRecInfo() time_t timerStart = 0; time_t timerStop = 0; char* summary = NULL; + char* shorttext = NULL; + char* description = NULL; + bool newsummary=false; ULONG resumePoint = 0; if (!recording) @@ -1652,13 +1703,24 @@ int VompClientRRProc::processGetRecInfo() summary = (char*)recording->Summary(); #else const cRecordingInfo *Info = recording->Info(); - summary = (char*)Info->ShortText(); + shorttext = (char*)Info->ShortText(); + description = (char*) (char*)Info->Description(); + if (isempty(shorttext)) summary=description; + else if (isempty(description)) summary=shorttext; + else { + int length=strlen(description)+strlen(shorttext)+4; + summary=new char[length]; + snprintf(summary,length,"%s\n\n%s",shorttext,description); + newsummary=true; + } + if (isempty(summary)) summary = (char*)Info->Description(); #endif log->log("RRProc", Log::DEBUG, "GRI: S: %s", summary); if (summary) { - resp->addString(summary); + resp->addString(x.charconvsys->Convert(summary)); + if (newsummary) delete [] summary; } else { @@ -1697,7 +1759,7 @@ int VompClientRRProc::processGetRecInfo() if (component->language) { - resp->addString(component->language); + resp->addString(x.charconvsys->Convert(component->language)); } else { @@ -1705,7 +1767,7 @@ int VompClientRRProc::processGetRecInfo() } if (component->description) { - resp->addString(component->description); + resp->addString(x.charconvsys->Convert(component->description)); } else { diff --git a/vompclientrrproc.h b/vompclientrrproc.h index 72bf0c9..535766c 100644 --- a/vompclientrrproc.h +++ b/vompclientrrproc.h @@ -91,6 +91,7 @@ class VompClientRRProc : public Thread int processCloseMediaChannel(); int processGetLanguageList(); int processGetLanguageContent(); + int processSetCharset(); void threadMethod(); -- 2.39.2