From 23878b086cd2600259e09a1e8c414c1584d7be1e Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sun, 26 Mar 2006 13:30:36 +0000 Subject: [PATCH] Portability --- Makefile | 3 +- defines.h | 2 + demuxer.h | 2 +- event.h | 1 + i18n.cc | 2 +- i18n.h | 6 + language-data.h | 1384 +++++++++++++++++++++++------------------------ log.h | 7 +- main.cc | 6 +- osd.cc | 45 -- osd.h | 17 +- osdmvp.cc | 75 +++ osdmvp.h | 50 ++ osdwin.cc | 57 ++ osdwin.h | 46 ++ timerreceiver.h | 60 +- timers.h | 186 +++---- vepg.h | 178 +++--- wtextbox.h | 102 ++-- 19 files changed, 1212 insertions(+), 1017 deletions(-) create mode 100644 osdmvp.cc create mode 100644 osdmvp.h create mode 100644 osdwin.cc create mode 100644 osdwin.h diff --git a/Makefile b/Makefile index a57fc1b..3b5bc3b 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,8 @@ OBJECTS1 = main.o command.o log.o tcp.o dsock.o thread.o timers.o i18n.o OBJECTS2 = remote.o led.o mtd.o video.o audio.o osd.o surface.o \ audiomvp.o audiowin.o \ - videomvp.o videowin.o + videomvp.o videowin.o \ + osdmvp.o osdwin.o OBJECTS = $(OBJECTS1) $(OBJECTS2) diff --git a/defines.h b/defines.h index bb4ebeb..1c278f3 100644 --- a/defines.h +++ b/defines.h @@ -37,10 +37,12 @@ ULLONG ntohll(ULLONG a); #define SNPRINTF _snprintf #define VSNPRINTF _vsnprintf #define STRCASECMP stricmp +#define STRCASESTR StrStrI #else #define SNPRINTF snprintf #define VSNPRINTF vsnprintf #define STRCASECMP strcasecmp +#define STRCASESTR strcasestr #endif #endif diff --git a/demuxer.h b/demuxer.h index f8e6e61..f935dbc 100644 --- a/demuxer.h +++ b/demuxer.h @@ -94,7 +94,7 @@ class Demuxer UCHAR* local_frame; static const int demuxMemoryV = 2097152; static const int demuxMemoryA = 524288; - static const int Demuxer::FrameRates[9]; + static const int FrameRates[9]; enum FRAMETYPE { diff --git a/event.h b/event.h index f73f1a6..63ab88f 100644 --- a/event.h +++ b/event.h @@ -22,6 +22,7 @@ #define EVENT_H #include +#include #include "defines.h" diff --git a/i18n.cc b/i18n.cc index 28904a0..4097bf7 100644 --- a/i18n.cc +++ b/i18n.cc @@ -91,7 +91,7 @@ int I18n::LanguageIndex(const char* Name) { for (int i = 0; i < NumLanguages; i++) { - if (strcasestr(Languages[i], Name)) return i; + if (STRCASESTR(Languages[i], Name)) return i; } Log::getInstance()->log("I18n", Log::ERR, "Unknown language: '%s'", Name); return -1; diff --git a/i18n.h b/i18n.h index 0bc8515..cad5c91 100644 --- a/i18n.h +++ b/i18n.h @@ -26,6 +26,12 @@ #define I18N_H #include +#include +#ifdef WIN32 +#include +#endif + +#include "defines.h" #include "log.h" #include "vdr.h" diff --git a/language-data.h b/language-data.h index 8f14bc4..971482f 100644 --- a/language-data.h +++ b/language-data.h @@ -1,692 +1,692 @@ -/* - * language_data.h: Internationalization - * - * This code is taken from the VDR project and modified for VOMP. - * See the main source file 'vdr.c' for original copyright information. - * Modifications (C) 2005 D Pickles. - - This file is part of VOMP. - - VOMP is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - VOMP is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* - * How to add a new language: - * - * 1. Announce your translation action on the VOMP forum - * to avoid duplicate work. - * 2. Increase the value of 'NUM_LANGUAGES' below. - * 3. Insert a new line in the 'Languages' array containing the name of your - * language IN YOUR LANGUAGE, so 'Italiano' not 'Italian' for example. - * Append your language after the last existing language - * but before the 'test' language - * 4. Insert a new line in the charSets array containing the name of the character - * set needed for your language. Note that at present only ISO8859-1 is - * supported - * 5. Insert a new line in the languageCodes array containing the 3-letter - * abbreviation(s) for your language as used in the channels.conf. - * 6. Insert a line in every member of the 'Phrases[]' array, - * containing the translated text for your language. You can use the 'test' - * language to see where the phrases appear on the screen. - * 7. If your language requires a character set other than the default iso8859-1 - * then work will be needed elsewhere in vomp to manage multiple font files. - * 8. Compile VOMP and test the new language by switching to it - * in the "Options" menu. - * 9. Send the modified files to Chris to have it included in the next version. - * - * In case an English phrase is used in more than one context (and might need - * different translations in other languages) it can be preceeded with an - * arbitrary string to describe its context, separated from the actual phrase - * by a '$' character (see for instance "Button$Stop" vs. "Stop"). - * Of course this means that no English phrase may contain the '$' character! - * If this should ever become necessary, the existing '$' would have to be - * replaced with something different... - */ - -#ifdef I18N_HEADER - -#define NUM_LANGUAGES 7 -#define DEFAULT_LANGUAGE_INDEX 0 - -#else - -// The names of the languages (English MUST be first!): -const char* const I18n::Languages[] = -{ - "English", - "Deutsch", // German by André Jagusch - "Svenska", // Swedish by Lars Fredriksson - "Magyar", // Hungarian by Pák Gergely - "Suomi", // Finnish by Kimmo Lahdensivu - "Francais", // French by jtk - "Test" -}; - -// The character set needed for each language: -const char* const I18n::charSets[] = -{ - "iso8859-1", - "iso8859-1", - "iso8859-1", - "iso8859-1", - "iso8859-1", - "iso8859-1", - "iso8859-1" -}; - -// The 3-letter names of the language (this MUST be the third phrase!): -const char* const I18n::languageCodes[] = -{ - "eng,dos", - "deu,ger", - "sve,swe", - "hun", - "fin", - "fre", - "tst,xxx" -}; - -// The phrases to be translated: -const I18n::tI18nPhrase I18n::Phrases[] = -{ - // Menu titles: - { "VDR", - "VDR", - "VDR", - "VDR", - "VDR", - "VDR", - "VDR", - }, - // Welcome screen - { "Welcome", - "Willkommen", - "Välkommen", - "Tervetuloa", - "Üdvözöljük", - "Bonjour", - "1", - }, - { "1. Live TV", - "1. Fernsehen", - "1. TV", - "1. TV", - "1. TV", - "1. TV en direct", - "2", - }, - { "2. Radio", - "2. Radio", - "2. Radio", - "2. Rádió", - "2. Radio", - "2. Radio", - "3", - }, - { "3. Recordings", - "3. Aufnahmen", - "3. Inspelningar", - "3. Felvett müsorok", - "3. Tallenteet", - "3. Enregistrements", - "4", - }, - { "4. Timers", - "", - "", - "4. Felvétel", - "", - "", - "5", - }, - { "5. Options", - "5. Einstellungen", - "5. Inställningar", - "5. Beállítások", - "5. Asetukset", - "5. Options", - "6", - }, - { "6. Reboot", - "6. Neustart", - "6. Starta om", - "6. Újraindítás", - "6. Uudelleenkäynnistys", - "6. Redemarrer", - "7", - }, - { "Downloading recordings list", - "Lade die Aufnahmen-Liste", - "Laddar lista över inspelningar", - "Felvétellista letöltése", - "Ladataan tallennelistaa", - "Recuperer liste enregistrements", - "8", - }, - // Recordings list - { "Recordings - %s", - "Aufnahmen - %s", - "Inspelningar - %s", - "Felvételek - %s", - "Tallenteet - %s", - "Enregistrements - %s", - "9 - %s", - }, - { "Recordings", - "Aufnahmen", - "Inspelningar", - "Felvételek", - "Tallenteet", - "Enregistrements", - "10", - }, - { " %lu\t%s", - " %lu\t%s", - " %lu\t%s", - " %lu\t%s", - " %lu\t%s", - " %lu\t%s", - "11 %lu\t%s", - }, - { "[ok] = menu", - "[ok] = Menü", - "[ok] = meny", - "[ok] = menü", - "[ok] = menu", - "[ok] = valikko", - "12", - }, - { "%lu%% used, %iGB free", - "%lu%% belegt, %iGB frei", - "%lu%% använt, %iGB ledigt", - "%lu%% felhasznált, %iGB szabad", - "%lu%% käytetty, %iGt vapaana", - "%lu%% utilise, %iGB libre", - "13 %lu%% %i", - }, - { "%i to %i of %i", // Also used in channels list - "%i bis %i (von %i)", - "%i av %i till %i", - "%i - %i (összesen %i)", - "%i - %i (yhteensä %i)", - "%i de %i a %i", - "14 %i %i %i", - }, - // Question - { "Yes", - "Ja", - "Ja", - "Igen", - "Kyllä", - "Oui", - "15", - }, - { "No", - "Nein", - "Nej", - "Nem", - "Ei", - "Non", - "16", - }, - // Recording Menu - { "Programme menu", - "Programm-Menü", - "Programmeny", - "Müsor menü", - "Ohjelmavalikko", - "Menu Programation", - "17", - }, - { "Play", - "Wiedergeben", - "Spela upp", - "Lejátszás", - "Näytä", - "Jouer", - "18", - }, - { "Resume", - "Fortsetzen", - "Återuppta", - "Folytatás", - "Jatka", - "Reprendre", - "19", - }, - { "Summary", - "Inhalt", - "Sammanfattning", - "Tartalom", - "Yhteenveto", - "Resume", - "20", - }, - { "Delete", - "Löschen", - "Ta bort", - "Törlés", - "Poista", - "Supprimer", - "21", - }, - { "Programme summary", - "Programminhalt", - "Programsammanfattning", - "Müsor tartalom", - "Ohjelmayhteenveto", - "Sommaire programmes", - "22", - }, - { "Summary unavailable", - "Inhalt nicht verfügbar", - "Ingen sammanfattning tillgänglig", - "Tartalom nem elérhetö", - "Yhteenvetoa ei saatavissa", - "Sommaire indisponible", - "23", - }, - { "Delete recording", - "Aufnahme löschen", - "Ta bort inspelning", - "Felvétel törlése", - "Poista tallenne", - "Effacer enregistrement", - "24", - }, - { "Are you sure you want to delete this recording?", - "Sind Sie sich sicher, dass Sie diese Aufnahme löschen möchten?", - "Är du säker att du vill ta bort den här inspelningen", - "Biztosan törölni szeretné ezt a felvételt?", - "Oletko varma, että haluat poistaa tämän tallenteen?", - "Etes-vous sur de vouloir supprimer cet enregistrement?", - "25", - }, - // Server select - { "Choose a VDR server", - "Wählen Sie einen VDR-Server", - "Välj VDR server", - "Válasszon egy VDR szervert", - "Valitse VDR-palvelin", - "Choisir une serveur VDR", - "26", - }, - - // Option menus - { "Options", - "Einstellungen", - "Inställningar", - "Beállitások", - "Asetukset", - "Options", - "27", - }, - { "TV connection type", - "TV-Anschlußart", - "Typ av TV-anslutning", - "TV csatlakozás tipusa", - "TV-liityntä", - "Type de connection TV", - "28", - }, - { "Remote control type", - "Fernbedienungstyp", - "Fjärrkontroll", - "Távirányitó tipusa", - "Kauko-ohjaimen tyyppi", - "Type telecommande", - "29", - }, - { "TV aspect ratio", - "Seitenverhältnis", - "TV-format", - "TV képformátum", - "Kuvasuhde", - "Rapport TV", - "30", - }, - { "16:9 on 4:3 display mode", - "16:9 auf 4:3-Modus", - "16:9 på 4:3-skärm", - "16:9 a 4:3-as képernyön", - "16:9 kuvasuhde 4:3 TV:ssä", - "16:9 sur affichage 4:3", - "30a", - }, - { "Power state after bootup", - "Einschalten nach Neustart", - "Läge efter strömborfall", - "Bekapcsolás utáni állapot", - "Tila käynnistyksen jälkeen", - "Marche apres demarrage", - "31", - }, - { "Display channels", - "Kanäle anzeigen", - "Visa kanaler", - "Csatornák megjelenítése", - "Näytä kanavat", - "Afficher chaines", - "32", - }, - { "Language", - "Sprache", - "Språk", - "Nyelv", - "Kieli", - "Langue", - "33", - }, - { "Press back to exit, <, > or [ok] to change", - "Zum Verlassen back drücken, <, > oder [ok] zum Wechseln", - "Tryck [back] för att avsluta, eller [ok] för att ändra", - "[back] gombbal kilép, [<], [>] vagy [ok] gombbal választ", - "Paina [back] poistuaksesi, <, > tao [ok] muuttaaksesi", - "Appuyer retour pour sortir <, > ou [ok] pour valider", - "34", - }, - { "VDR-Pri 0=OK !See forums!", - "VDR-Pri 0=OK !Siehe Forum!", - "VDR-Prio 0=OK !Se forum!", - "VDR-Pri 0=OK !lásd. fórum!", - "VDR-Pri 0=OK !Lue forumit!", - "VDR-Pri 0=OK !Voir forums!", - "34a", - }, - // Option choices - { "Old", - "Alt", - "Gammal modell", - "Régi", - "Vanha", - "Vieux", - "35", - }, - { "New", - "Neu", - "Ny modell", - "Új", - "Uusi", - "Nouveau", - "36", - }, - { "RGB+composite", - "RGB+composite", - "RGB+komposit", - "RGB+composite", - "RGB+komposiitti", - "RGB+composite", - "37", - }, - { "S-Video", - "S-Video", - "S-Video", - "S-Video", - "S-Video", - "S-Video", - "38", - }, - { "Chop sides", - "Seiten abschneiden", - "Ta bort på sidorna", - "Szélek levágva", - "Leikkaa sivut", - "Couper bords", - "39", - }, - { "Letterbox", - "Letterbox", - "Letterbox", - "Letterbox", - "Letterbox", - "Letterbox", - "40", - }, - { "Last state", - "Letzter Zustand", - "Återgå til senaste läge", - "Utolsó állapot", - "Edellinen tila", - "Etat precedent", - "41", - }, - { "All", - "Alle", - "Alla", - "Összes", - "Kaikki", - "Tout", - "42", - }, - { "FTA only", - "nur FTA", - "Endast FTA", - "Csak FTA", - "Vain FTA", - "FTA seulement", - "43", - }, - { "On", - "An", - "På", - "Be", - "Päällä", - "On", - "44", - }, - { "Off", - "Aus", - "Av", - "Ki", - "Poissa", - "Off", - "45", - }, - - // Channel Lists - { "Channels", - "Fernsehkanäle", - "Kanaler", - "Csatornák", - "Kanavat", - "Chaines", - "46", - }, - { "Radio Stations", - "Radiokanäle", - "Radiostationer", - "Rádiócsatornák", - "Radiokanavat", - "Stations Radio", - "47", - }, - // Banners - { "No channel data available", - "Keine Daten für diesen Kanal verfügbar", - "Ingen programinformation tillgänglig", - "Csatorna-adatok nem állnak rendelkezésre", - "Kanavatietoa ei saatavilla", - "Pas de chaines disponibles", - "48", - }, - { "info", - "Info", - "Info", - "Infó", - "Info", - "Info", - "49", - }, - { "Channel unavailable", - "Kanal nicht verfügbar", - "Kanalen är inte tillgänglig", - "A csatorna nem elérhetö", - "Kanava ei saatavilla", - "Chaine indisponible", - "51", - }, - // Connect screen - { "Locating server", - "Lokalisiere Server", - "Letar efter server", - "Szerver keresése", - "Etsitään palvelinta", - "Recherche serveur", - "52", - }, - { "Connecting to VDR", - "Verbinde zum VDR", - "Ansluter till VDR", - "Csatlakozás a VDR-hez", - "Yhdistetään VDR:ään", - "Connection au VDR", - "53", - }, - { "Login failed", - "Login fehlgeschlagen", - "Inloggning misslycklades", - "Bejelentkezés sikertelen", - "Sisäänkirjautuminen epäonnistui", - "Echec de login", - "54", - }, - { "Connection failed", - "Verbindung fehlgeschlagen", - "Anslutning misslyckades", - "Kapcsolódás sikertelen", - "Yhteys epäonnistui", - "Echec de connection", - "55", - }, - // Command - { "Connected, loading config", - "Verbunden, lade Einstellungen", - "Ansluten, laddar konfigurering", - "Kapcsolódva, beállitások betöltése", - "Yhdistetty, ladataan konfiguraatiota", - "Connecte, chargement configuration", - "56", - }, - // EPG - { "EPG", - "EPG", - "EPG", - "EPG", - "EPG", - "EPG", - "57", - }, - { "OK", - "OK", - "OK", - "OK", - "OK", - "OK", - "57.5", - }, - { "Page up", - "Seite hoch", - "Föregående sida", - "Fel", - "Seuraava sivu", - "Haut de page", - "58", - }, - { "Page down", - "Seite runter", - "Nästa sida", - "Le", - "Edellinen sivu", - "Bas de page", - "59", - }, - { "-24 hours", - "-24 Std.", - "-24 timmar", - "-24 óra", - "-24 tuntia", - "-24 heures", - "60", - }, - { "+24 hours", - "+24 Std.", - "+24 timmar", - "+24 óra", - "+24 tuntia", - "+24 heures", - "61", - }, - { "Go: Preview", - "Go: Vorschau", - "Go: Visa", - "Go: Betekintés", - "Go: Esikatselu", - "Go: apercu", - "61.5", - }, - { "Guide / Back: Close", - "Back: EPG schließen", - "Guide / Back: Stäng", - "Guide/Back: Bezárás", - "Guide / Back: Sulje", - "Guide / Back: Fermer", - "62", - }, - { "Rec: Set timer", - "Rec: Aufnahme programmieren", - "Rec: Programmera timer", - "Rec: Felvétel beállítása", - "Rec: Aseta ajastus", - "Rec: Definir heure", - "63", - }, - { "Sel channel", - "Umschalten", - "Välj kanal", - "Csatornaválasztás", - "Valitse kanava", - "Selection chaine", - "64", - }, - { "There are no programme details available for this period", - "Es sind keine Programminformationen für diesen Zeitraum verfügbar", - "Det finns ingen programinforamtion för denna period", - "Nincs programinformáció ehhez az idöszakhoz", - "Tälle ajanjaksolle ei saatavilla ohjelmatietoja", - "Aucune information sur le programme pour cette periode", - "65", - }, - { "No programme details", - "Keine Programminformation", - "Ingen programinformation tillgänglig", - "Nincs programinformáció", - "Ei ohjelmatietoja", - "Pas de detail du programme", - "66", - }, - // Edit timer - { "Edit Timer", - "", - "", - "", - "", - "", - "67", - }, - // End marker. - { NULL } -}; - -#endif +/* + * language_data.h: Internationalization + * + * This code is taken from the VDR project and modified for VOMP. + * See the main source file 'vdr.c' for original copyright information. + * Modifications (C) 2005 D Pickles. + + This file is part of VOMP. + + VOMP is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + VOMP is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with VOMP; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* + * How to add a new language: + * + * 1. Announce your translation action on the VOMP forum + * to avoid duplicate work. + * 2. Increase the value of 'NUM_LANGUAGES' below. + * 3. Insert a new line in the 'Languages' array containing the name of your + * language IN YOUR LANGUAGE, so 'Italiano' not 'Italian' for example. + * Append your language after the last existing language + * but before the 'test' language + * 4. Insert a new line in the charSets array containing the name of the character + * set needed for your language. Note that at present only ISO8859-1 is + * supported + * 5. Insert a new line in the languageCodes array containing the 3-letter + * abbreviation(s) for your language as used in the channels.conf. + * 6. Insert a line in every member of the 'Phrases[]' array, + * containing the translated text for your language. You can use the 'test' + * language to see where the phrases appear on the screen. + * 7. If your language requires a character set other than the default iso8859-1 + * then work will be needed elsewhere in vomp to manage multiple font files. + * 8. Compile VOMP and test the new language by switching to it + * in the "Options" menu. + * 9. Send the modified files to Chris to have it included in the next version. + * + * In case an English phrase is used in more than one context (and might need + * different translations in other languages) it can be preceeded with an + * arbitrary string to describe its context, separated from the actual phrase + * by a '$' character (see for instance "Button$Stop" vs. "Stop"). + * Of course this means that no English phrase may contain the '$' character! + * If this should ever become necessary, the existing '$' would have to be + * replaced with something different... + */ + +#ifdef I18N_HEADER + +#define NUM_LANGUAGES 7 +#define DEFAULT_LANGUAGE_INDEX 0 + +#else + +// The names of the languages (English MUST be first!): +const char* const I18n::Languages[] = +{ + "English", + "Deutsch", // German by André Jagusch + "Svenska", // Swedish by Lars Fredriksson + "Magyar", // Hungarian by Pák Gergely + "Suomi", // Finnish by Kimmo Lahdensivu + "Francais", // French by jtk + "Test" +}; + +// The character set needed for each language: +const char* const I18n::charSets[] = +{ + "iso8859-1", + "iso8859-1", + "iso8859-1", + "iso8859-1", + "iso8859-1", + "iso8859-1", + "iso8859-1" +}; + +// The 3-letter names of the language (this MUST be the third phrase!): +const char* const I18n::languageCodes[] = +{ + "eng,dos", + "deu,ger", + "sve,swe", + "hun", + "fin", + "fre", + "tst,xxx" +}; + +// The phrases to be translated: +const I18n::tI18nPhrase I18n::Phrases[] = +{ + // Menu titles: + { "VDR", + "VDR", + "VDR", + "VDR", + "VDR", + "VDR", + "VDR", + }, + // Welcome screen + { "Welcome", + "Willkommen", + "Välkommen", + "Tervetuloa", + "Üdvözöljük", + "Bonjour", + "1", + }, + { "1. Live TV", + "1. Fernsehen", + "1. TV", + "1. TV", + "1. TV", + "1. TV en direct", + "2", + }, + { "2. Radio", + "2. Radio", + "2. Radio", + "2. Rádió", + "2. Radio", + "2. Radio", + "3", + }, + { "3. Recordings", + "3. Aufnahmen", + "3. Inspelningar", + "3. Felvett müsorok", + "3. Tallenteet", + "3. Enregistrements", + "4", + }, + { "4. Timers", + "", + "", + "4. Felvétel", + "", + "", + "5", + }, + { "5. Options", + "5. Einstellungen", + "5. Inställningar", + "5. Beállítások", + "5. Asetukset", + "5. Options", + "6", + }, + { "6. Reboot", + "6. Neustart", + "6. Starta om", + "6. Újraindítás", + "6. Uudelleenkäynnistys", + "6. Redemarrer", + "7", + }, + { "Downloading recordings list", + "Lade die Aufnahmen-Liste", + "Laddar lista över inspelningar", + "Felvétellista letöltése", + "Ladataan tallennelistaa", + "Recuperer liste enregistrements", + "8", + }, + // Recordings list + { "Recordings - %s", + "Aufnahmen - %s", + "Inspelningar - %s", + "Felvételek - %s", + "Tallenteet - %s", + "Enregistrements - %s", + "9 - %s", + }, + { "Recordings", + "Aufnahmen", + "Inspelningar", + "Felvételek", + "Tallenteet", + "Enregistrements", + "10", + }, + { " %lu\t%s", + " %lu\t%s", + " %lu\t%s", + " %lu\t%s", + " %lu\t%s", + " %lu\t%s", + "11 %lu\t%s", + }, + { "[ok] = menu", + "[ok] = Menü", + "[ok] = meny", + "[ok] = menü", + "[ok] = menu", + "[ok] = valikko", + "12", + }, + { "%lu%% used, %iGB free", + "%lu%% belegt, %iGB frei", + "%lu%% använt, %iGB ledigt", + "%lu%% felhasznált, %iGB szabad", + "%lu%% käytetty, %iGt vapaana", + "%lu%% utilise, %iGB libre", + "13 %lu%% %i", + }, + { "%i to %i of %i", // Also used in channels list + "%i bis %i (von %i)", + "%i av %i till %i", + "%i - %i (összesen %i)", + "%i - %i (yhteensä %i)", + "%i de %i a %i", + "14 %i %i %i", + }, + // Question + { "Yes", + "Ja", + "Ja", + "Igen", + "Kyllä", + "Oui", + "15", + }, + { "No", + "Nein", + "Nej", + "Nem", + "Ei", + "Non", + "16", + }, + // Recording Menu + { "Programme menu", + "Programm-Menü", + "Programmeny", + "Müsor menü", + "Ohjelmavalikko", + "Menu Programation", + "17", + }, + { "Play", + "Wiedergeben", + "Spela upp", + "Lejátszás", + "Näytä", + "Jouer", + "18", + }, + { "Resume", + "Fortsetzen", + "Återuppta", + "Folytatás", + "Jatka", + "Reprendre", + "19", + }, + { "Summary", + "Inhalt", + "Sammanfattning", + "Tartalom", + "Yhteenveto", + "Resume", + "20", + }, + { "Delete", + "Löschen", + "Ta bort", + "Törlés", + "Poista", + "Supprimer", + "21", + }, + { "Programme summary", + "Programminhalt", + "Programsammanfattning", + "Müsor tartalom", + "Ohjelmayhteenveto", + "Sommaire programmes", + "22", + }, + { "Summary unavailable", + "Inhalt nicht verfügbar", + "Ingen sammanfattning tillgänglig", + "Tartalom nem elérhetö", + "Yhteenvetoa ei saatavissa", + "Sommaire indisponible", + "23", + }, + { "Delete recording", + "Aufnahme löschen", + "Ta bort inspelning", + "Felvétel törlése", + "Poista tallenne", + "Effacer enregistrement", + "24", + }, + { "Are you sure you want to delete this recording?", + "Sind Sie sich sicher, dass Sie diese Aufnahme löschen möchten?", + "Är du säker att du vill ta bort den här inspelningen", + "Biztosan törölni szeretné ezt a felvételt?", + "Oletko varma, että haluat poistaa tämän tallenteen?", + "Etes-vous sur de vouloir supprimer cet enregistrement?", + "25", + }, + // Server select + { "Choose a VDR server", + "Wählen Sie einen VDR-Server", + "Välj VDR server", + "Válasszon egy VDR szervert", + "Valitse VDR-palvelin", + "Choisir une serveur VDR", + "26", + }, + + // Option menus + { "Options", + "Einstellungen", + "Inställningar", + "Beállitások", + "Asetukset", + "Options", + "27", + }, + { "TV connection type", + "TV-Anschlußart", + "Typ av TV-anslutning", + "TV csatlakozás tipusa", + "TV-liityntä", + "Type de connection TV", + "28", + }, + { "Remote control type", + "Fernbedienungstyp", + "Fjärrkontroll", + "Távirányitó tipusa", + "Kauko-ohjaimen tyyppi", + "Type telecommande", + "29", + }, + { "TV aspect ratio", + "Seitenverhältnis", + "TV-format", + "TV képformátum", + "Kuvasuhde", + "Rapport TV", + "30", + }, + { "16:9 on 4:3 display mode", + "16:9 auf 4:3-Modus", + "16:9 på 4:3-skärm", + "16:9 a 4:3-as képernyön", + "16:9 kuvasuhde 4:3 TV:ssä", + "16:9 sur affichage 4:3", + "30a", + }, + { "Power state after bootup", + "Einschalten nach Neustart", + "Läge efter strömborfall", + "Bekapcsolás utáni állapot", + "Tila käynnistyksen jälkeen", + "Marche apres demarrage", + "31", + }, + { "Display channels", + "Kanäle anzeigen", + "Visa kanaler", + "Csatornák megjelenítése", + "Näytä kanavat", + "Afficher chaines", + "32", + }, + { "Language", + "Sprache", + "Språk", + "Nyelv", + "Kieli", + "Langue", + "33", + }, + { "Press back to exit, <, > or [ok] to change", + "Zum Verlassen back drücken, <, > oder [ok] zum Wechseln", + "Tryck [back] för att avsluta, eller [ok] för att ändra", + "[back] gombbal kilép, [<], [>] vagy [ok] gombbal választ", + "Paina [back] poistuaksesi, <, > tao [ok] muuttaaksesi", + "Appuyer retour pour sortir <, > ou [ok] pour valider", + "34", + }, + { "VDR-Pri 0=OK !See forums!", + "VDR-Pri 0=OK !Siehe Forum!", + "VDR-Prio 0=OK !Se forum!", + "VDR-Pri 0=OK !lásd. fórum!", + "VDR-Pri 0=OK !Lue forumit!", + "VDR-Pri 0=OK !Voir forums!", + "34a", + }, + // Option choices + { "Old", + "Alt", + "Gammal modell", + "Régi", + "Vanha", + "Vieux", + "35", + }, + { "New", + "Neu", + "Ny modell", + "Új", + "Uusi", + "Nouveau", + "36", + }, + { "RGB+composite", + "RGB+composite", + "RGB+komposit", + "RGB+composite", + "RGB+komposiitti", + "RGB+composite", + "37", + }, + { "S-Video", + "S-Video", + "S-Video", + "S-Video", + "S-Video", + "S-Video", + "38", + }, + { "Chop sides", + "Seiten abschneiden", + "Ta bort på sidorna", + "Szélek levágva", + "Leikkaa sivut", + "Couper bords", + "39", + }, + { "Letterbox", + "Letterbox", + "Letterbox", + "Letterbox", + "Letterbox", + "Letterbox", + "40", + }, + { "Last state", + "Letzter Zustand", + "Återgå til senaste läge", + "Utolsó állapot", + "Edellinen tila", + "Etat precedent", + "41", + }, + { "All", + "Alle", + "Alla", + "Összes", + "Kaikki", + "Tout", + "42", + }, + { "FTA only", + "nur FTA", + "Endast FTA", + "Csak FTA", + "Vain FTA", + "FTA seulement", + "43", + }, + { "On", + "An", + "På", + "Be", + "Päällä", + "On", + "44", + }, + { "Off", + "Aus", + "Av", + "Ki", + "Poissa", + "Off", + "45", + }, + + // Channel Lists + { "Channels", + "Fernsehkanäle", + "Kanaler", + "Csatornák", + "Kanavat", + "Chaines", + "46", + }, + { "Radio Stations", + "Radiokanäle", + "Radiostationer", + "Rádiócsatornák", + "Radiokanavat", + "Stations Radio", + "47", + }, + // Banners + { "No channel data available", + "Keine Daten für diesen Kanal verfügbar", + "Ingen programinformation tillgänglig", + "Csatorna-adatok nem állnak rendelkezésre", + "Kanavatietoa ei saatavilla", + "Pas de chaines disponibles", + "48", + }, + { "info", + "Info", + "Info", + "Infó", + "Info", + "Info", + "49", + }, + { "Channel unavailable", + "Kanal nicht verfügbar", + "Kanalen är inte tillgänglig", + "A csatorna nem elérhetö", + "Kanava ei saatavilla", + "Chaine indisponible", + "51", + }, + // Connect screen + { "Locating server", + "Lokalisiere Server", + "Letar efter server", + "Szerver keresése", + "Etsitään palvelinta", + "Recherche serveur", + "52", + }, + { "Connecting to VDR", + "Verbinde zum VDR", + "Ansluter till VDR", + "Csatlakozás a VDR-hez", + "Yhdistetään VDR:ään", + "Connection au VDR", + "53", + }, + { "Login failed", + "Login fehlgeschlagen", + "Inloggning misslycklades", + "Bejelentkezés sikertelen", + "Sisäänkirjautuminen epäonnistui", + "Echec de login", + "54", + }, + { "Connection failed", + "Verbindung fehlgeschlagen", + "Anslutning misslyckades", + "Kapcsolódás sikertelen", + "Yhteys epäonnistui", + "Echec de connection", + "55", + }, + // Command + { "Connected, loading config", + "Verbunden, lade Einstellungen", + "Ansluten, laddar konfigurering", + "Kapcsolódva, beállitások betöltése", + "Yhdistetty, ladataan konfiguraatiota", + "Connecte, chargement configuration", + "56", + }, + // EPG + { "EPG", + "EPG", + "EPG", + "EPG", + "EPG", + "EPG", + "57", + }, + { "OK", + "OK", + "OK", + "OK", + "OK", + "OK", + "57.5", + }, + { "Page up", + "Seite hoch", + "Föregående sida", + "Fel", + "Seuraava sivu", + "Haut de page", + "58", + }, + { "Page down", + "Seite runter", + "Nästa sida", + "Le", + "Edellinen sivu", + "Bas de page", + "59", + }, + { "-24 hours", + "-24 Std.", + "-24 timmar", + "-24 óra", + "-24 tuntia", + "-24 heures", + "60", + }, + { "+24 hours", + "+24 Std.", + "+24 timmar", + "+24 óra", + "+24 tuntia", + "+24 heures", + "61", + }, + { "Go: Preview", + "Go: Vorschau", + "Go: Visa", + "Go: Betekintés", + "Go: Esikatselu", + "Go: apercu", + "61.5", + }, + { "Guide / Back: Close", + "Back: EPG schließen", + "Guide / Back: Stäng", + "Guide/Back: Bezárás", + "Guide / Back: Sulje", + "Guide / Back: Fermer", + "62", + }, + { "Rec: Set timer", + "Rec: Aufnahme programmieren", + "Rec: Programmera timer", + "Rec: Felvétel beállítása", + "Rec: Aseta ajastus", + "Rec: Definir heure", + "63", + }, + { "Sel channel", + "Umschalten", + "Välj kanal", + "Csatornaválasztás", + "Valitse kanava", + "Selection chaine", + "64", + }, + { "There are no programme details available for this period", + "Es sind keine Programminformationen für diesen Zeitraum verfügbar", + "Det finns ingen programinforamtion för denna period", + "Nincs programinformáció ehhez az idöszakhoz", + "Tälle ajanjaksolle ei saatavilla ohjelmatietoja", + "Aucune information sur le programme pour cette periode", + "65", + }, + { "No programme details", + "Keine Programminformation", + "Ingen programinformation tillgänglig", + "Nincs programinformáció", + "Ei ohjelmatietoja", + "Pas de detail du programme", + "66", + }, + // Edit timer + { "Edit Timer", + "", + "", + "", + "", + "", + "67", + }, + // End marker. + { NULL } +}; + +#endif diff --git a/log.h b/log.h index ff91243..0b5c197 100644 --- a/log.h +++ b/log.h @@ -23,8 +23,13 @@ #define LOG_H #include +#ifndef WIN32 + #include +#else + #include +#endif + #include -#include #include #include #include "defines.h" diff --git a/main.cc b/main.cc index 7fc0681..e33bae8 100644 --- a/main.cc +++ b/main.cc @@ -32,14 +32,15 @@ #include "mtd.h" #include "timers.h" #include "vdr.h" -#include "osd.h" #include "viewman.h" #include "command.h" #ifndef WIN32 + #include "osdmvp.h" #include "audiomvp.h" #include "videomvp.h" #else + #include "osdwin.h" #include "audiowin.h" #include "videowin.h" #endif @@ -73,12 +74,13 @@ int main(int argc, char** argv) mtd = new Mtd(); led = new Led(); timers = new Timers(); - osd = new Osd(); vdr = new VDR(); #ifndef WIN32 + osd = new OsdMVP(); audio = new AudioMVP(); video = new VideoMVP(); #else + osd = new OsdWin(); audio = new AudioWin(); video = new VideoWin(); #endif diff --git a/osd.cc b/osd.cc index 751b858..96db8e3 100644 --- a/osd.cc +++ b/osd.cc @@ -34,7 +34,6 @@ Osd::Osd() Osd::~Osd() { - if (initted) shutdown(); instance = NULL; } @@ -42,47 +41,3 @@ Osd* Osd::getInstance() { return instance; } - -int Osd::getFD() -{ - if (!initted) return 0; - return fdOsd; -} - -int Osd::init(char* device) -{ - if (initted) return 0; - - fdOsd = open(device, O_RDWR); - if (!fdOsd) - { - Log::getInstance()->log("OSD", Log::DEBUG, "Could not open OSD device!"); - return 0; - } - - initted = 1; // must set this here or create surface won't work - - Surface::initConversionTables(); - - Video* video = Video::getInstance(); - - screen = new Surface(Surface::SCREEN); - screen->create(video->getScreenWidth(), video->getScreenHeight()); - screen->display(); - - return 1; -} - -int Osd::shutdown() -{ - if (!initted) return 0; - initted = 0; - delete screen; - close(fdOsd); - return 1; -} - -void Osd::screenShot(char* fileName) -{ - screen->screenShot(fileName); -} diff --git a/osd.h b/osd.h index cc258ed..e0d57b2 100644 --- a/osd.h +++ b/osd.h @@ -22,29 +22,24 @@ #define OSD_H #include -#include -#include -#include "defines.h" -#include "log.h" #include "surface.h" -#include "video.h" class Osd { public: Osd(); - ~Osd(); + virtual ~Osd(); static Osd* getInstance(); - int init(char* device); - int shutdown(); + virtual int init(char* device)=0; + virtual int shutdown()=0; - int getFD(); + virtual int getFD()=0; - void screenShot(char* fileName); + virtual void screenShot(char* fileName)=0; - private: + protected: static Osd* instance; int initted; Surface* screen; diff --git a/osdmvp.cc b/osdmvp.cc new file mode 100644 index 0000000..b4fda69 --- /dev/null +++ b/osdmvp.cc @@ -0,0 +1,75 @@ +/* + Copyright 2004-2005 Chris Tallon + + This file is part of VOMP. + + VOMP is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + VOMP is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with VOMP; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "osdmvp.h" + +OsdMVP::OsdMVP() +{ + if (instance) return; +} + +OsdMVP::~OsdMVP() +{ + if (initted) shutdown(); +} + +int OsdMVP::getFD() +{ + if (!initted) return 0; + return fdOsd; +} + +int OsdMVP::init(char* device) +{ + if (initted) return 0; + + fdOsd = open(device, O_RDWR); + if (!fdOsd) + { + Log::getInstance()->log("OSD", Log::DEBUG, "Could not open OSD device!"); + return 0; + } + + initted = 1; // must set this here or create surface won't work + + Surface::initConversionTables(); + + Video* video = Video::getInstance(); + + screen = new Surface(Surface::SCREEN); + screen->create(video->getScreenWidth(), video->getScreenHeight()); + screen->display(); + + return 1; +} + +int OsdMVP::shutdown() +{ + if (!initted) return 0; + initted = 0; + delete screen; + close(fdOsd); + return 1; +} + +void OsdMVP::screenShot(char* fileName) +{ + screen->screenShot(fileName); +} diff --git a/osdmvp.h b/osdmvp.h new file mode 100644 index 0000000..dbea737 --- /dev/null +++ b/osdmvp.h @@ -0,0 +1,50 @@ +/* + Copyright 2004-2005 Chris Tallon + + This file is part of VOMP. + + VOMP is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + VOMP is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with VOMP; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef OSDMVP_H +#define OSDMVP_H + +#include +#include +#include + +#include "osd.h" +#include "defines.h" +#include "log.h" +#include "surface.h" +#include "video.h" + +class OsdMVP : public Osd +{ + public: + OsdMVP(); + ~OsdMVP(); + + int init(char* device); + int shutdown(); + + int getFD(); + + void screenShot(char* fileName); + + private: +}; + +#endif diff --git a/osdwin.cc b/osdwin.cc new file mode 100644 index 0000000..9e4c9a5 --- /dev/null +++ b/osdwin.cc @@ -0,0 +1,57 @@ +/* + Copyright 2004-2005 Chris Tallon + + This file is part of VOMP. + + VOMP is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + VOMP is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with VOMP; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "osdwin.h" + +OsdWin::OsdWin() +{ + if (instance) return; +} + +OsdWin::~OsdWin() +{ + if (initted) shutdown(); +} + +int OsdWin::getFD() +{ + if (!initted) return 0; + return fdOsd; +} + +int OsdWin::init(char* device) +{ + if (initted) return 0; + initted = 1; // must set this here or create surface won't work + + return 1; +} + +int OsdWin::shutdown() +{ + if (!initted) return 0; + initted = 0; + return 1; +} + +void OsdWin::screenShot(char* fileName) +{ + screen->screenShot(fileName); +} diff --git a/osdwin.h b/osdwin.h new file mode 100644 index 0000000..0a084be --- /dev/null +++ b/osdwin.h @@ -0,0 +1,46 @@ +/* + Copyright 2004-2005 Chris Tallon + + This file is part of VOMP. + + VOMP is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + VOMP is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with VOMP; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef OSDWIN_H +#define OSDWIN_H + +#include + +#include "osd.h" +#include "defines.h" +#include "log.h" + +class OsdWin : public Osd +{ + public: + OsdWin(); + ~OsdWin(); + + int init(char* device); + int shutdown(); + + int getFD(); + + void screenShot(char* fileName); + + private: +}; + +#endif diff --git a/timerreceiver.h b/timerreceiver.h index db11b61..4c37401 100755 --- a/timerreceiver.h +++ b/timerreceiver.h @@ -1,30 +1,30 @@ -/* - Copyright 2005 Chris Tallon - - This file is part of VOMP. - - VOMP is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - VOMP is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#ifndef TIMERRECEIVER_H -#define TIMERRECEIVER_H - -class TimerReceiver -{ - public: - virtual void timercall(int clientReference)=0; -}; - -#endif +/* + Copyright 2005 Chris Tallon + + This file is part of VOMP. + + VOMP is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + VOMP is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with VOMP; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef TIMERRECEIVER_H +#define TIMERRECEIVER_H + +class TimerReceiver +{ + public: + virtual void timercall(int clientReference)=0; +}; + +#endif diff --git a/timers.h b/timers.h index 1044b1f..562f00c 100755 --- a/timers.h +++ b/timers.h @@ -1,93 +1,93 @@ -/* - Copyright 2004-2005 Chris Tallon - - This file is part of VOMP. - - VOMP is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - VOMP is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#ifndef TIMERS_H -#define TIMERS_H - -#include -#include -#include - -#include "defines.h" -#include "log.h" -#include "thread.h" -#include "command.h" -#include "timerreceiver.h" - -/* - -Timers documentation - -Call setTimer to set a timer.... cancelTimer to delete a running timer. -Derive your object from TimerReceiver (timerreceiver.h), implement timercall() in your class -and supply your 'this' pointer to setTimer. - -Once a timer has fired it does not exist anymore, you have to keep creating them if you want -a constant pulse. - -clientReference is any int of your choice. It will be supplied back to you in the timercall() -so you can identify which timer has fired if you have more than one. - -You can reset a timer by calling setTimer again. This will not create 2 timers, it will overwrite the first one. - -You must not allow a timer to fire on an object that has been deleted already, unless you want -segfaulty hell. - -*/ - -class Timer -{ - public: - TimerReceiver* client; - int clientReference; - struct timespec requestedTime; -}; - -using namespace std; -//using namespace __gnu_cxx; -typedef list TimerList; - -class Timers : public Thread -{ - public: - Timers(); - virtual ~Timers(); - static Timers* getInstance(); - - int init(); - int shutdown(); - - int setTimer(TimerReceiver* client, int clientReference, long int requestedTime, long int requestedTimeNSEC=0); - int setTimer(TimerReceiver* client, int clientReference, timespec duration); - int cancelTimer(TimerReceiver* client, int clientReference); - - // Thread stuff - virtual void threadMethod(); - virtual void threadPostStopCleanup() {}; - - private: - static Timers* instance; - Log* logger; - bool initted; - TimerList timerList; - bool resetThreadFlag; -}; - -#endif +/* + Copyright 2004-2005 Chris Tallon + + This file is part of VOMP. + + VOMP is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + VOMP is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with VOMP; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef TIMERS_H +#define TIMERS_H + +#include +#include +#include + +#include "defines.h" +#include "log.h" +#include "thread.h" +#include "command.h" +#include "timerreceiver.h" + +/* + +Timers documentation + +Call setTimer to set a timer.... cancelTimer to delete a running timer. +Derive your object from TimerReceiver (timerreceiver.h), implement timercall() in your class +and supply your 'this' pointer to setTimer. + +Once a timer has fired it does not exist anymore, you have to keep creating them if you want +a constant pulse. + +clientReference is any int of your choice. It will be supplied back to you in the timercall() +so you can identify which timer has fired if you have more than one. + +You can reset a timer by calling setTimer again. This will not create 2 timers, it will overwrite the first one. + +You must not allow a timer to fire on an object that has been deleted already, unless you want +segfaulty hell. + +*/ + +class Timer +{ + public: + TimerReceiver* client; + int clientReference; + struct timespec requestedTime; +}; + +using namespace std; +//using namespace __gnu_cxx; +typedef list TimerList; + +class Timers : public Thread +{ + public: + Timers(); + virtual ~Timers(); + static Timers* getInstance(); + + int init(); + int shutdown(); + + int setTimer(TimerReceiver* client, int clientReference, long int requestedTime, long int requestedTimeNSEC=0); + int setTimer(TimerReceiver* client, int clientReference, timespec duration); + int cancelTimer(TimerReceiver* client, int clientReference); + + // Thread stuff + virtual void threadMethod(); + virtual void threadPostStopCleanup() {}; + + private: + static Timers* instance; + Log* logger; + bool initted; + TimerList timerList; + bool resetThreadFlag; +}; + +#endif diff --git a/vepg.h b/vepg.h index a00da97..27f8e9f 100644 --- a/vepg.h +++ b/vepg.h @@ -1,89 +1,89 @@ -/* - Copyright 2005 Brian Walton - - This file is part of VOMP. - - VOMP is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - VOMP is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#ifndef VEPG_H -#define VEPG_H -#define WINDOW_WIDTH (150) -#define MINUTE_SCALE (3) -#include -#include - -#include "view.h" -#include "remote.h" -#include "wselectlist.h" -#include "viewman.h" -#include "vdr.h" -#include "vchannellist.h" -#include "command.h" -#include "message.h" -#include "colour.h" -#include "video.h" -#include "wtextbox.h" -#include "event.h" -#include "message.h" -#include "vvideolive.h" -#include "vepgsettimer.h" - -class VVideoLive; - -class VEpg : public View -{ - public: - VEpg(VVideoLive* v, UINT currentChannel = 0); - ~VEpg(); - static VEpg* getInstance(); - - int handleCommand(int command); // deal with commands (from remote control) - void draw(); // draw epg view - void setCurrentChannel(char* chname); - - private: - static VEpg* instance; - - void setInfo(Event* event); // display details of selected programme - void drawgrid(); // redraws grid and select programme - void drawData(); - - WSelectList chanListbox; // listbox to display available channels - WTextbox progTitle; // area to display time and title of selected programme - WTextbox progInfo; // area to display details of selected programme - EventList* eventList; // list of events (programmes) for a channel - Event thisEvent; // the selected event - time_t selTime; // current selection time - UINT e; // temp used to point to an event - ChannelList* chanList; // list of available channels - tm* epgtime; // selected time within epg - tm* Ltime; // time of LHS of epg view - time_t ltime; // time of LHS of epg view - time_t lastEnd; // end time of last painted cell - used to look for gaps in epg - WTextbox chanName; - EventList* eventLista[7]; - int listTop; - int listWindowSize; - void updateChanList(); - void updateEventList(); - void paintCell(Event* event, int yOffset, Colour bg, Colour fg); - time_t prevHour(time_t* t); - VVideoLive* videoLive; - ViewMan* viewman; - UINT gridRows; -}; - -#endif +/* + Copyright 2005 Brian Walton + + This file is part of VOMP. + + VOMP is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + VOMP is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with VOMP; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef VEPG_H +#define VEPG_H +#define WINDOW_WIDTH (150) +#define MINUTE_SCALE (3) +#include +#include + +#include "view.h" +#include "remote.h" +#include "wselectlist.h" +#include "viewman.h" +#include "vdr.h" +#include "vchannellist.h" +#include "command.h" +#include "message.h" +#include "colour.h" +#include "video.h" +#include "wtextbox.h" +#include "event.h" +#include "message.h" +#include "vvideolive.h" +#include "vepgsettimer.h" + +class VVideoLive; + +class VEpg : public View +{ + public: + VEpg(VVideoLive* v, UINT currentChannel = 0); + ~VEpg(); + static VEpg* getInstance(); + + int handleCommand(int command); // deal with commands (from remote control) + void draw(); // draw epg view + void setCurrentChannel(char* chname); + + private: + static VEpg* instance; + + void setInfo(Event* event); // display details of selected programme + void drawgrid(); // redraws grid and select programme + void drawData(); + + WSelectList chanListbox; // listbox to display available channels + WTextbox progTitle; // area to display time and title of selected programme + WTextbox progInfo; // area to display details of selected programme + EventList* eventList; // list of events (programmes) for a channel + Event thisEvent; // the selected event + time_t selTime; // current selection time + UINT e; // temp used to point to an event + ChannelList* chanList; // list of available channels + tm* epgtime; // selected time within epg + tm* Ltime; // time of LHS of epg view + time_t ltime; // time of LHS of epg view + time_t lastEnd; // end time of last painted cell - used to look for gaps in epg + WTextbox chanName; + EventList* eventLista[7]; + int listTop; + int listWindowSize; + void updateChanList(); + void updateEventList(); + void paintCell(Event* event, int yOffset, Colour bg, Colour fg); + time_t prevHour(time_t* t); + VVideoLive* videoLive; + ViewMan* viewman; + UINT gridRows; +}; + +#endif diff --git a/wtextbox.h b/wtextbox.h index 53bd721..87bdaae 100644 --- a/wtextbox.h +++ b/wtextbox.h @@ -1,51 +1,51 @@ -/* - Copyright 2005 Brian Walton - - This file is part of VOMP. - - VOMP is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - VOMP is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#ifndef WTEXTBOX_H -#define WTEXTBOX_H - -#include -#include - -#include "defines.h" -#include "widget.h" -#include "colour.h" - -class WTextbox : public Widget -{ - public: - WTextbox(); - ~WTextbox(); - void setText(char* text); - void draw(); - void setBackgroundColour(Colour bcolour); - void setForegroundColour(Colour fcolour); - void setTextPos(int x, int y); // optional - - private: - - char* text; - Colour foreColour; - Colour backColour; - int textX; - int textY; -}; - -#endif +/* + Copyright 2005 Brian Walton + + This file is part of VOMP. + + VOMP is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + VOMP is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with VOMP; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef WTEXTBOX_H +#define WTEXTBOX_H + +#include +#include + +#include "defines.h" +#include "widget.h" +#include "colour.h" + +class WTextbox : public Widget +{ + public: + WTextbox(); + ~WTextbox(); + void setText(char* text); + void draw(); + void setBackgroundColour(Colour bcolour); + void setForegroundColour(Colour fcolour); + void setTextPos(int x, int y); // optional + + private: + + char* text; + Colour foreColour; + Colour backColour; + int textX; + int textY; +}; + +#endif -- 2.39.2