From 6cd7f4ca22b4cdf3fc8b5b422befb286a5de64a9 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Tue, 20 Dec 2005 15:58:28 +0000 Subject: [PATCH 01/16] Volume doesnt auto unmute if at 100% already fixed --- audio.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audio.cc b/audio.cc index bf6ed4b..116c1ca 100644 --- a/audio.cc +++ b/audio.cc @@ -242,20 +242,20 @@ int Audio::test() int Audio::volumeUp() { if (!initted) return 0; + if (userMute) toggleUserMute(); if (volume == 20) return volume; volume++; setVolume(volume); - if (userMute) toggleUserMute(); return volume; } int Audio::volumeDown() { if (!initted) return 0; + if (userMute) toggleUserMute(); if (volume == 0) return 0; volume--; setVolume(volume); - if (userMute) toggleUserMute(); return volume; } -- 2.39.2 From e1040d9633cfe71b83d54687cc784708df904f96 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Tue, 20 Dec 2005 16:03:16 +0000 Subject: [PATCH 02/16] Pause then number key naviating recording bug fixed --- playervideo.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/playervideo.cc b/playervideo.cc index 5c6d71d..72f2609 100644 --- a/playervideo.cc +++ b/playervideo.cc @@ -469,6 +469,9 @@ void PlayerVideo::toggleFastBackward() void PlayerVideo::jumpToPercent(int percent) { + if (paused) togglePause(); + if (ffwd) toggleFastForward(); + threadStop(); vfeed.stop(); afeed.stop(); -- 2.39.2 From fe9f9eb13f933e207c3e90ecb909b5305259cdcd Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Tue, 20 Dec 2005 16:19:03 +0000 Subject: [PATCH 03/16] Last channel highlighted in channel list view --- vchannellist.cc | 10 +++++++++- vchannellist.h | 1 + vvideolive.cc | 6 +++++- vvideolive.h | 5 +++-- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/vchannellist.cc b/vchannellist.cc index e4f8d8d..554cf72 100644 --- a/vchannellist.cc +++ b/vchannellist.cc @@ -88,6 +88,14 @@ void VChannelList::setList(ChannelList* tlist) } } +void VChannelList::highlightChannel(Channel* chan) +{ + sl.hintSetCurrent(chan->index); + sl.draw(); + doShowingBar(); + ViewMan::getInstance()->updateView(this); +} + void VChannelList::draw() { View::draw(); @@ -200,7 +208,7 @@ int VChannelList::handleCommand(int command) // if (chan->type == VDR::RADIO) return 2; - VVideoLive* v = new VVideoLive(chanList, chan->type); + VVideoLive* v = new VVideoLive(chanList, chan->type, this); v->draw(); ViewMan::getInstance()->add(v); diff --git a/vchannellist.h b/vchannellist.h index 6f737aa..4feeb11 100644 --- a/vchannellist.h +++ b/vchannellist.h @@ -45,6 +45,7 @@ class VChannelList : public View ~VChannelList(); void setList(ChannelList* chanList); + void highlightChannel(Channel* channel); int handleCommand(int command); void draw(); diff --git a/vvideolive.cc b/vvideolive.cc index e7dabd6..7fb9685 100644 --- a/vvideolive.cc +++ b/vvideolive.cc @@ -22,7 +22,7 @@ VVideoLive* VVideoLive::instance = NULL; -VVideoLive::VVideoLive(ChannelList* tchanList, ULONG tstreamType) +VVideoLive::VVideoLive(ChannelList* tchanList, ULONG tstreamType, VChannelList* tvchannelList) { instance = this; vdr = VDR::getInstance(); @@ -30,6 +30,8 @@ VVideoLive::VVideoLive(ChannelList* tchanList, ULONG tstreamType) video = Video::getInstance(); chanList = tchanList; + vchannelList = tvchannelList; + currentChannel = 0; previousChannel = 0; unavailable = 0; @@ -83,6 +85,8 @@ int VVideoLive::handleCommand(int command) { if (unavailable) showUnavailable(0); else stop(); + + vchannelList->highlightChannel((*chanList)[currentChannel]); return 4; } // Take up and down from new remote and do live banner diff --git a/vvideolive.h b/vvideolive.h index 3757324..8d2d1c5 100644 --- a/vvideolive.h +++ b/vvideolive.h @@ -41,13 +41,13 @@ #include "wtextbox.h" class VEpg; - +class VChannelList; class VLiveBanner; class VVideoLive : public View { public: - VVideoLive(ChannelList* chanList, ULONG streamType); + VVideoLive(ChannelList* chanList, ULONG streamType, VChannelList* vchannelList); ~VVideoLive(); static VVideoLive* getInstance(); void draw(); @@ -77,6 +77,7 @@ class VVideoLive : public View Video* video; Player* player; ChannelList* chanList; + VChannelList* vchannelList; UINT currentChannel; // index in list UINT previousChannel; // index in list int unavailable; -- 2.39.2 From 2cfb364d4726deb3550be71f25bf5b945e4594d1 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Tue, 3 Jan 2006 18:00:05 +0000 Subject: [PATCH 04/16] Recording timer list --- Makefile | 4 +- playervideo.cc | 2 +- rectimer.cc | 44 +++++++++++ rectimer.h | 50 +++++++++++++ vdr.cc | 56 ++++++++++++++ vdr.h | 5 ++ vtimerlist.cc | 197 +++++++++++++++++++++++++++++++++++++++++++++++++ vtimerlist.h | 56 ++++++++++++++ vwelcome.cc | 21 ++++++ vwelcome.h | 2 + 10 files changed, 434 insertions(+), 3 deletions(-) create mode 100644 rectimer.cc create mode 100644 rectimer.h create mode 100644 vtimerlist.cc create mode 100644 vtimerlist.h diff --git a/Makefile b/Makefile index 67e569b..276a265 100644 --- a/Makefile +++ b/Makefile @@ -13,8 +13,8 @@ CROSSLIBS = ../jpeg-6b/libjpeg.a OBJECTS = main.o command.o log.o remote.o led.o mtd.o video.o audio.o tcp.o directory.o thread.o event.o \ player.o demuxer.o stream.o vfeed.o afeed.o afeedr.o osd.o surface.o viewman.o vdr.o dsock.o box.o \ - recording.o channel.o message.o playervideo.o messagequeue.o \ - view.o vinfo.o vwallpaper.o vvolume.o vrecordinglist.o vlivebanner.o vmute.o \ + recording.o channel.o message.o playervideo.o messagequeue.o rectimer.o \ + view.o vinfo.o vwallpaper.o vvolume.o vrecordinglist.o vlivebanner.o vmute.o vtimerlist.o \ vrecordingmenu.o vquestion.o vchannellist.o vwelcome.o vvideolive.o vvideorec.o \ vchannelselect.o vserverselect.o colour.o vconnect.o voptions.o vepg.o region.o \ widget.o wselectlist.o wjpeg.o wsymbol.o wbutton.o woptionbox.o wtextbox.o i18n.o timers.o \ diff --git a/playervideo.cc b/playervideo.cc index 72f2609..ef72f09 100644 --- a/playervideo.cc +++ b/playervideo.cc @@ -1,4 +1,4 @@ -/* +#/* Copyright 2004-2005 Chris Tallon This file is part of VOMP. diff --git a/rectimer.cc b/rectimer.cc new file mode 100644 index 0000000..9211fd7 --- /dev/null +++ b/rectimer.cc @@ -0,0 +1,44 @@ +/* + 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 "rectimer.h" + +RecTimer::RecTimer() +{ + active = 0; + recording = 0; + pending = 0; + priority = 0; + lifeTime = 0; + channelNumber = 0; + startTime = 0; + stopTime = 0; + + file = NULL; + summary = NULL; + + index = -1; +} + +RecTimer::~RecTimer() +{ + if (file) delete[] file; + if (summary) delete[] summary; +} diff --git a/rectimer.h b/rectimer.h new file mode 100644 index 0000000..55a8944 --- /dev/null +++ b/rectimer.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 RECTIMER_H +#define RECTIMER_H + +#include + +#include "defines.h" + +class RecTimer +{ + public: + RecTimer(); + ~RecTimer(); + + ULONG active; + ULONG recording; + ULONG pending; + ULONG priority; + ULONG lifeTime; + ULONG channelNumber; + ULONG startTime; + ULONG stopTime; + + char* file; + char* summary; + + + int index; +}; + +#endif diff --git a/vdr.cc b/vdr.cc index b5d1fac..9eb4106 100644 --- a/vdr.cc +++ b/vdr.cc @@ -799,3 +799,59 @@ char* VDR::configLoad(char* section, char* key) return toReturn; } + +RecTimerList* VDR::getRecTimersList() +{ + if (!connected) return NULL; + + UCHAR buffer[8]; + + *(unsigned long*)&buffer[0] = htonl(4); + *(unsigned long*)&buffer[4] = htonl(VDR_GETTIMERS); + + pthread_mutex_lock(&mutex); + int a = tcp->sendPacket(buffer, 8); + if (a != 8) + { + pthread_mutex_unlock(&mutex); + return NULL; + } + + // reply + + if (!getPacket()) + { + pthread_mutex_unlock(&mutex); + return NULL; + } + + RecTimerList* recTimerList = new RecTimerList(); + + RecTimer* newRecTimer; + + while (packetPos < packetLength) + { + newRecTimer = new RecTimer(); + newRecTimer->active = extractULONG(); + newRecTimer->recording = extractULONG(); + newRecTimer->pending = extractULONG(); + newRecTimer->priority = extractULONG(); + newRecTimer->lifeTime = extractULONG(); + newRecTimer->channelNumber = extractULONG(); + newRecTimer->startTime = extractULONG(); + newRecTimer->stopTime = extractULONG(); + + newRecTimer->file = extractString(); + newRecTimer->summary = extractString(); + + recTimerList->push_back(newRecTimer); + Log::getInstance()->log("VDR", Log::DEBUG, "TL: %lu %lu %lu %lu %lu %lu %lu %lu %s", + newRecTimer->active, newRecTimer->recording, newRecTimer->pending, newRecTimer->priority, newRecTimer->lifeTime, + newRecTimer->channelNumber, newRecTimer->startTime, newRecTimer->stopTime, newRecTimer->file); + } + + freePacket(); + pthread_mutex_unlock(&mutex); + + return recTimerList; +} diff --git a/vdr.h b/vdr.h index 48c4c6e..21c4b8e 100644 --- a/vdr.h +++ b/vdr.h @@ -34,6 +34,7 @@ #include "recording.h" #include "channel.h" #include "event.h" +#include "rectimer.h" using namespace std; @@ -41,6 +42,7 @@ using namespace std; typedef vector EventList; typedef vector ChannelList; +typedef vector RecTimerList; class VDR { @@ -80,6 +82,8 @@ class VDR int configSave(char* section, char* key, const char* value); char* configLoad(char* section, char* key); + RecTimerList* getRecTimersList(); + // end const static ULONG VIDEO = 1; @@ -113,6 +117,7 @@ class VDR const static ULONG VDR_CONFIGSAVE = 11; const static ULONG VDR_CONFIGLOAD = 12; const static ULONG VDR_RESCANRECORDING = 13; + const static ULONG VDR_GETTIMERS = 14; int getPacket(); void freePacket(); diff --git a/vtimerlist.cc b/vtimerlist.cc new file mode 100644 index 0000000..2798bd7 --- /dev/null +++ b/vtimerlist.cc @@ -0,0 +1,197 @@ +/* + 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 "vtimerlist.h" + +VTimerList::VTimerList(RecTimerList* trtl) +{ + recTimerList = trtl; + + create(570, 420); + if (Video::getInstance()->getFormat() == Video::PAL) + { + setScreenPos(80, 70); + } + else + { + setScreenPos(70, 35); + } + + + setBackgroundColour(Colour::VIEWBACKGROUND); + setTitleBarOn(1); + setTitleText(tr("Timers")); + setTitleBarColour(Colour::TITLEBARBACKGROUND); + + sl.setSurface(surface); + sl.setSurfaceOffset(10, 30 + 5); + sl.setDimensions(area.w - 20, area.h - 30 - 15 - 30); + + drawData(); +} + +VTimerList::~VTimerList() +{ + if (recTimerList) + { + for (UINT i = 0; i < recTimerList->size(); i++) + { + delete (*recTimerList)[i]; + } + + recTimerList->clear(); + delete recTimerList; + } +} + +void VTimerList::drawData() +{ + char str[500]; + + sl.addColumn(0); + sl.addColumn(60); + + RecTimer* recTimer; + int first = 1; + + for (UINT i = 0; i < recTimerList->size(); i++) + { + recTimer = (*recTimerList)[i]; + sprintf(str, "%u\t%s", i, recTimer->file); + recTimer->index = sl.addOption(str, first); + first = 0; + } +} + +void VTimerList::draw() +{ + View::draw(); + sl.draw(); + + // Put the status stuff at the bottom + + WSymbol w; + w.setSurface(surface); + + w.nextSymbol = WSymbol::UP; + w.setSurfaceOffset(20, 385); + w.draw(); + + w.nextSymbol = WSymbol::DOWN; + w.setSurfaceOffset(50, 385); + w.draw(); + + w.nextSymbol = WSymbol::SKIPBACK; + w.setSurfaceOffset(85, 385); + w.draw(); + + w.nextSymbol = WSymbol::SKIPFORWARD; + w.setSurfaceOffset(115, 385); + w.draw(); + +// w.nextSymbol = WSymbol::PLAY; +// w.setSurfaceOffset(150, 385); +// w.draw(); + + doShowingBar(); +} + +void VTimerList::doShowingBar() +{ + int topOption = sl.getTopOption() + 1; + if (sl.getNumOptions() == 0) topOption = 0; + + char showing[200]; + sprintf(showing, tr("%i to %i of %i"), topOption, sl.getBottomOption(), sl.getNumOptions()); + + rectangle(220, 385, 220+160, 385+25, Colour::VIEWBACKGROUND); + drawText(showing, 220, 385, Colour::LIGHTTEXT); +} + +int VTimerList::handleCommand(int command) +{ + switch(command) + { + case Remote::DF_UP: + case Remote::UP: + { + sl.up(); + sl.draw(); + + doShowingBar(); + ViewMan::getInstance()->updateView(this); + return 2; + } + case Remote::DF_DOWN: + case Remote::DOWN: + { + sl.down(); + sl.draw(); + + doShowingBar(); + ViewMan::getInstance()->updateView(this); + return 2; + } + case Remote::SKIPBACK: + { + sl.pageUp(); + sl.draw(); + + doShowingBar(); + ViewMan::getInstance()->updateView(this); + return 2; + } + case Remote::SKIPFORWARD: + { + sl.pageDown(); + sl.draw(); + + doShowingBar(); + ViewMan::getInstance()->updateView(this); + return 2; + } + case Remote::OK: + { + RecTimer* recTimer = NULL; + if (recTimerList) + { + int currentOption = sl.getCurrentOption(); + + for (UINT i = 0; i < recTimerList->size(); i++) + { + recTimer = (*recTimerList)[i]; + if (currentOption == recTimer->index) break; + } + } + + if (recTimer == NULL) return 2; + + // recTimer is the one you want FIXME + + return 2; + } + case Remote::BACK: + { + return 4; + } + } + // stop command getting to any more views + return 1; +} diff --git a/vtimerlist.h b/vtimerlist.h new file mode 100644 index 0000000..57dae9d --- /dev/null +++ b/vtimerlist.h @@ -0,0 +1,56 @@ +/* + 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 VTIMERLIST_H +#define VTIMERLIST_H + +#include +#include +#include + +#include "view.h" +#include "wselectlist.h" +#include "remote.h" +#include "wsymbol.h" +#include "viewman.h" +#include "vdr.h" +#include "colour.h" +#include "video.h" +#include "i18n.h" + +class VTimerList : public View +{ + public: + VTimerList(RecTimerList* rtl); + ~VTimerList(); + + int handleCommand(int command); + void draw(); + + private: + RecTimerList* recTimerList; + + WSelectList sl; + + void doShowingBar(); + void drawData(); +}; + +#endif diff --git a/vwelcome.cc b/vwelcome.cc index 5208f61..65b4a17 100644 --- a/vwelcome.cc +++ b/vwelcome.cc @@ -193,6 +193,13 @@ int VWelcome::handleCommand(int command) } return 2; // never gets here } +#ifdef DEV + case Remote::NINE: + { + doTimersList(); + return 2; + } +#endif } return 1; @@ -262,6 +269,20 @@ void VWelcome::doRecordingsList() Log::getInstance()->log("VWelcome", Log::DEBUG, "possible delay end"); } +void VWelcome::doTimersList() +{ + RecTimerList* recTimerList = VDR::getInstance()->getRecTimersList(); + + if (recTimerList) + { + VTimerList* vtl = new VTimerList(recTimerList); + + vtl->draw(); + viewman->add(vtl); + viewman->updateView(vtl); + } +} + void VWelcome::doOptions() { VOptions* voptions = new VOptions(this); diff --git a/vwelcome.h b/vwelcome.h index 06440b5..8192dc3 100644 --- a/vwelcome.h +++ b/vwelcome.h @@ -33,6 +33,7 @@ #include "directory.h" #include "vchannellist.h" #include "vrecordinglist.h" +#include "vtimerlist.h" #include "command.h" #include "message.h" #include "colour.h" @@ -61,6 +62,7 @@ class VWelcome : public View, public TimerReceiver void doChannelsList(); void doRadioList(); void doRecordingsList(); + void doTimersList(); void doOptions(); void drawClock(); -- 2.39.2 From 6ce984c59e2eea82c2790bc98ff2339350d3325c Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Tue, 3 Jan 2006 23:53:42 +0000 Subject: [PATCH 05/16] Finnish and French added, Timers screen code --- language-data.h | 1232 +++++++++++++++++++++++++-------------------- rectimer.cc | 37 +- rectimer.h | 20 +- vdr.cc | 12 +- vdr.h | 9 + vrecordinglist.cc | 2 +- vtimerlist.cc | 47 +- vtimerlist.h | 7 +- vwelcome.cc | 21 +- vwelcome.h | 1 + 10 files changed, 810 insertions(+), 578 deletions(-) diff --git a/language-data.h b/language-data.h index 23182e7..437b9f8 100644 --- a/language-data.h +++ b/language-data.h @@ -1,549 +1,683 @@ -/* - * 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 5 -#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 - "Test" -}; - -// The character set needed for each language: -const char* const I18n::charSets[] = -{ - "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", - "tst,xxx" -}; - -// The phrases to be translated: -const I18n::tI18nPhrase I18n::Phrases[] = -{ - // Menu titles: - { "VDR", - "VDR", - "VDR", - "VDR", - "VDR", - }, - { "Schedule", - "Programm", - "Program", - "Müsor", - "0", - }, - // Welcome screen - { "Welcome", - "Willkommen", - "Välkommen", - "Üdvözöljük", - "1", - }, - { "1. Live TV", - "1. Fernsehen", - "1. TV", - "1. TV", - "2", - }, - { "2. Radio", - "2. Radio", - "2. Radio", - "2. Rádió", - "3", - }, - { "3. Recordings", - "3. Aufnahmen", - "3. Inspelningar", - "3. Felvételek", - "4", - }, - { "4. Options", - "4. Einstellungen", - "4. Inställningar", - "4. Beállítások", - "5", - }, - { "5. Stand by", - "5. Stand-by", - "5. Stäng av", - "5. Készenlét", - "6", - }, - { "6. Reboot", - "6. Neustart", - "6. Starta om", - "6. Újraindítás", - "7", - }, - { "Downloading recordings list", - "Lade die Aufnahmen-Liste", - "Laddar lista över inspelningar", - "Felvétellista letöltése", - "8", - }, - // Recordings list - { "Recordings - %s", - "Aufnahmen - %s", - "Inspelningar - %s", - "Felvételek - %s", - "9 - %s", - }, - { "Recordings", - "Aufnahmen", - "Inspelningar", - "Felvételek", - "10", - }, - { " %lu\t%s", - " %lu\t%s", - " %lu\t%s", - " %lu\t%s", - "11 %lu\t%s", - }, - { "[ok] = menu", - "[ok] = Menü", - "[ok] = meny", - "[ok] = menü", - "12", - }, - { "%lu%% used, %iGB free", - "%lu%% belegt, %iGB frei", - "%lu% använt, %iGB ledigt", - "%lu% felhasznált, %iGB szabad", - "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)", - "14 %i %i %i", - }, - // Question - { "Yes", - "Ja", - "Ja", - "Igen", - "15", - }, - { "No", - "Nein", - "Nej", - "Nem", - "16", - }, - // Recording Menu - { "Programme menu", - "Programm-Menü", - "Programmeny", - "Müsor menü", - "17", - }, - { "Play", - "Wiedergeben", - "Spela upp", - "Lejátszás", - "18", - }, - { "Resume", - "Fortsetzen", - "Återuppta", - "Folytatás", - "19", - }, - { "Summary", - "Inhalt", - "Sammanfattning", - "Tartalom", - "20", - }, - { "Delete", - "Löschen", - "Ta bort", - "Törlés", - "21", - }, - { "Programme summary", - "Programminhalt", - "Programsammanfattning", - "Müsor tartalom", - "22", - }, - { "Summary unavailable", - "Inhalt nicht verfügbar", - "Ingen sammanfattning tillgänglig", - "Tartalom nem elérhetö", - "23", - }, - { "Delete recording", - "Aufnahme löschen", - "Ta bort inspelning", - "Felvétel törlése", - "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?", - "25", - }, - // Server select - { "Choose a VDR server", - "Wählen Sie einen VDR-Server", - "Välj VDR server", - "Válasszon egy VDR szervert", - "26", - }, - - // Option menus - { "Options", - "Einstellungen", - "Inställningar", - "Beállitások", - "27", - }, - { "TV connection type", - "TV-Anschlußart", - "Typ av TV-anslutning", - "TV csatlakozás tipusa", - "28", - }, - { "Remote control type", - "Fernbedienungstyp", - "Fjärrkontroll", - "Távirányitó tipusa", - "29", - }, - { "TV aspect ratio", - "Seitenverhältnis", - "TV-format", - "TV képformátum", - "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", - "30a", - }, - { "Power state after bootup", - "Einschalten nach Neustart", - "Läge efter strömborfall", - "Bekapcsolás utáni állapot", - "31", - }, - { "Display channels", - "Kanäle anzeigen", - "Visa kanaler", - "Csatornák megjelenítése", - "32", - }, - { "Language", - "Sprache", - "Språk", - "Nyelv", - "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", - "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!", - "34a", - }, - // Option choices - { "Old", - "Alt", - "Gammal modell", - "Régi", - "35", - }, - { "New", - "Neu", - "Ny modell", - "Új", - "36", - }, - { "RGB+composite", - "RGB+composite", - "RGB+komposit", - "RGB+composite", - "37", - }, - { "S-Video", - "S-Video", - "S-Video", - "S-Video", - "38", - }, - { "Chop sides", - "Seiten abschneiden", - "Ta bort på sidorna", - "Szélek levágva", - "39", - }, - { "Letterbox", - "Letterbox", - "Letterbox", - "Letterbox", - "40", - }, - { "Last state", - "Letzter Zustand", - "Återgå til senaste läge", - "Utolsó állapot", - "41", - }, - { "All", - "Alle", - "Alla", - "Összes", - "42", - }, - { "FTA only", - "nur FTA", - "Endast FTA", - "Csak FTA", - "43", - }, - { "On", - "An", - "På", - "Be", - "44", - }, - { "Off", - "Aus", - "Av", - "Ki", - "45", - }, - - // Channel Lists - { "Channels", - "Fernsehkanäle", - "Kanaler", - "Csatornák", - "46", - }, - { "Radio Stations", - "Radiokanäle", - "Radiostationer", - "Rádiócsatornák", - "47", - }, - // Banners - { "No channel data available", - "Keine Daten für diesen Kanal verfügbar", - "Ingen programinformation tillgänglig", - "Csatorna-adatok nem állnak rendelkezésre", - "48", - }, - { "info", - "Info", - "Info", - "Infó", - "49", - }, - { "info", - "Info", - "Info", - "Infó", - "50", - }, - { "Channel unavailable", - "Kanal nicht verfügbar", - "Kanalen är inte tillgänglig", - "A csatorna nem elérhetö", - "51", - }, - // Connect screen - { "Locating server", - "Lokalisiere Server", - "Letar efter server", - "Szerver keresése", - "52", - }, - { "Connecting to VDR", - "Verbinde zum VDR", - "Ansluter till VDR", - "Csatlakozás a VDR-hez", - "53", - }, - { "Login failed", - "Login fehlgeschlagen", - "Inloggning misslycklades", - "Bejelentkezés sikertelen", - "54", - }, - { "Connection failed", - "Verbindung fehlgeschlagen", - "Anslutning misslyckades", - "Kapcsolódás sikertelen", - "55", - }, - // Command - { "Connected, loading config", - "Verbunden, lade Einstellungen", - "Ansluten, laddar konfigurering", - "Kapcsolódva, beállitások betöltése", - "56", - }, - // EPG - { "EPG", - "EPG", - "EPG", - "EPG", - "57", - }, - { "OK", - "OK", - "OK", - "OK", - "57.5", - }, - { "Page up", - "Seite hoch", - "", - "Visszalapozás", - "58", - }, - { "Page down", - "Seite runter", - "", - "Elörelapozás", - "59", - }, - { "-24 hours", - "-24 Std.", - "", - "-24 óra", - "60", - }, - { "+24 hours", - "+24 Std.", - "", - "+24 óra", - "61", - }, - { "Go: Preview", - "Go: Vorschau", - "", - "", - "61.5", - }, - { "Guide / Back: Close", - "Back: EPG schließen", - "", - "Guide / Back: Bezárás", - "62", - }, - { "Rec: Set timer", - "Rec: Aufnahme programmieren", - "", - "Rec: Felvétel beállítása", - "63", - }, - { "Sel channel", - "Umschalten", - "", - "Csatornaválasztás", - "64", - }, - { "There are no programme details available for this period", - "Es sind keine Programminformationen für diesen Zeitraum verfügbar", - "", - "Nincs programinformáció ehhez az idöszakhoz", - "65", - }, - { "No programme details", - "Keine Programminformation", - "", - "Nincs programinformáció", - "66", - }, - // 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. Felvételek", + "3. Tallenteet", + "3. Enregistrements", + "4", + }, + { "4. Timers", + "", + "", + "", + "", + "", + "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", + "Visszalapozás", + "Seuraava sivu", + "Haut de page", + "58", + }, + { "Page down", + "Seite runter", + "Nästa sida", + "Elörelapozás", + "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: 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", + }, + // End marker. + { NULL } +}; + +#endif diff --git a/rectimer.cc b/rectimer.cc index 9211fd7..d6742c0 100644 --- a/rectimer.cc +++ b/rectimer.cc @@ -35,10 +35,45 @@ RecTimer::RecTimer() summary = NULL; index = -1; + directory = NULL; + name = NULL; } RecTimer::~RecTimer() { - if (file) delete[] file; if (summary) delete[] summary; + if (file) delete[] file; + if (directory) delete[] directory; + if (name) delete[] name; +} + +bool RecTimer::operator< (const RecTimer& op2) +{ + return startTime < op2.startTime; +} + +void RecTimer::setFile(const char* tFile) +{ + file = new char[strlen(tFile)+1]; + strcpy(file, tFile); + + + char* sub = strstr(file, "~"); + + if (sub) // Its in a dir + { + directory = new char[sub - file + 1]; + memcpy(directory, file, sub - file); + directory[sub - file] = '\0'; + + sub++; + int sublen = strlen(sub); + name = new char[sublen + 1]; + strcpy(name, sub); + } + else + { + name = new char[strlen(file)+1]; + strcpy(name, file); + } } diff --git a/rectimer.h b/rectimer.h index 55a8944..42ba46f 100644 --- a/rectimer.h +++ b/rectimer.h @@ -22,6 +22,7 @@ #define RECTIMER_H #include +#include #include "defines.h" @@ -30,6 +31,11 @@ class RecTimer public: RecTimer(); ~RecTimer(); + void setFile(const char* tFile); + + const char* getFile() { return file; } + const char* getDirectory() { return directory; } + const char* getName() { return name; } ULONG active; ULONG recording; @@ -40,11 +46,21 @@ class RecTimer ULONG startTime; ULONG stopTime; - char* file; char* summary; - int index; + + bool operator< (const RecTimer& op2); + + private: + char* file; + char* directory; + char* name; }; #endif + + +// File = orig VDR info = filename +// Directory = Base Dir +// Name = Prog name \ No newline at end of file diff --git a/vdr.cc b/vdr.cc index 9eb4106..4f27a46 100644 --- a/vdr.cc +++ b/vdr.cc @@ -828,6 +828,7 @@ RecTimerList* VDR::getRecTimersList() RecTimerList* recTimerList = new RecTimerList(); RecTimer* newRecTimer; + char* tempString; while (packetPos < packetLength) { @@ -841,17 +842,24 @@ RecTimerList* VDR::getRecTimersList() newRecTimer->startTime = extractULONG(); newRecTimer->stopTime = extractULONG(); - newRecTimer->file = extractString(); + tempString = extractString(); + newRecTimer->setFile(tempString); + delete[] tempString; + newRecTimer->summary = extractString(); recTimerList->push_back(newRecTimer); Log::getInstance()->log("VDR", Log::DEBUG, "TL: %lu %lu %lu %lu %lu %lu %lu %lu %s", newRecTimer->active, newRecTimer->recording, newRecTimer->pending, newRecTimer->priority, newRecTimer->lifeTime, - newRecTimer->channelNumber, newRecTimer->startTime, newRecTimer->stopTime, newRecTimer->file); + newRecTimer->channelNumber, newRecTimer->startTime, newRecTimer->stopTime, newRecTimer->getFile()); } freePacket(); pthread_mutex_unlock(&mutex); + // Sort the list + + sort(recTimerList->begin(), recTimerList->end(), RecTimerSorter()); + return recTimerList; } diff --git a/vdr.h b/vdr.h index 21c4b8e..bf3fec5 100644 --- a/vdr.h +++ b/vdr.h @@ -25,6 +25,7 @@ #include #include #include +#include #include "defines.h" #include "log.h" @@ -44,6 +45,14 @@ typedef vector EventList; typedef vector ChannelList; typedef vector RecTimerList; +struct RecTimerSorter // : public binary_function +{ + bool operator() (const RecTimer* a, const RecTimer* b) + { + return a->startTime < b->startTime; + } +}; + class VDR { diff --git a/vrecordinglist.cc b/vrecordinglist.cc index 452876a..bd1575e 100644 --- a/vrecordinglist.cc +++ b/vrecordinglist.cc @@ -168,7 +168,7 @@ void VRecordingList::draw() w.setSurfaceOffset(150, 385); w.draw(); - drawTextRJ("[ok] = menu", 560, 385, Colour::LIGHTTEXT); + drawTextRJ(tr("[ok] = menu"), 560, 385, Colour::LIGHTTEXT); // All static stuff done diff --git a/vtimerlist.cc b/vtimerlist.cc index 2798bd7..ad4b2f3 100644 --- a/vtimerlist.cc +++ b/vtimerlist.cc @@ -24,6 +24,11 @@ VTimerList::VTimerList(RecTimerList* trtl) { recTimerList = trtl; + clockRegion.x = 420; + clockRegion.y = 0; + clockRegion.w = 150; + clockRegion.h = 30; + create(570, 420); if (Video::getInstance()->getFormat() == Video::PAL) { @@ -63,10 +68,13 @@ VTimerList::~VTimerList() void VTimerList::drawData() { - char str[500]; + char strA[300]; + char strB[300]; + + struct tm* btime; sl.addColumn(0); - sl.addColumn(60); + sl.addColumn(110); RecTimer* recTimer; int first = 1; @@ -74,12 +82,29 @@ void VTimerList::drawData() for (UINT i = 0; i < recTimerList->size(); i++) { recTimer = (*recTimerList)[i]; - sprintf(str, "%u\t%s", i, recTimer->file); - recTimer->index = sl.addOption(str, first); + btime = localtime((time_t*)&recTimer->startTime); + strftime(strA, 299, "%d/%m %H:%M ", btime); + snprintf(strB, 299, "%s\t%s", strA, recTimer->getName()); + recTimer->index = sl.addOption(strB, first); first = 0; } } +void VTimerList::drawClock() +{ + // Blank the area first + rectangle(area.w - 150, 0, 150, 30, titleBarColour); + + char timeString[20]; + time_t t; + time(&t); + struct tm* tms = localtime(&t); + strftime(timeString, 19, "%d/%m %H:%M:%S", tms); + drawTextRJ(timeString, 560, 5, Colour::LIGHTTEXT); + + Timers::getInstance()->setTimer(this, 1, t + 1); +} + void VTimerList::draw() { View::draw(); @@ -106,11 +131,10 @@ void VTimerList::draw() w.setSurfaceOffset(115, 385); w.draw(); -// w.nextSymbol = WSymbol::PLAY; -// w.setSurfaceOffset(150, 385); -// w.draw(); + drawTextRJ("[ok] = edit", 560, 385, Colour::LIGHTTEXT); doShowingBar(); + drawClock(); } void VTimerList::doShowingBar() @@ -118,13 +142,18 @@ void VTimerList::doShowingBar() int topOption = sl.getTopOption() + 1; if (sl.getNumOptions() == 0) topOption = 0; + rectangle(220, 385, 180, 25, Colour::VIEWBACKGROUND); char showing[200]; sprintf(showing, tr("%i to %i of %i"), topOption, sl.getBottomOption(), sl.getNumOptions()); - - rectangle(220, 385, 220+160, 385+25, Colour::VIEWBACKGROUND); drawText(showing, 220, 385, Colour::LIGHTTEXT); } +void VTimerList::timercall(int clientReference) +{ + drawClock(); + ViewMan::getInstance()->updateView(this, &clockRegion); +} + int VTimerList::handleCommand(int command) { switch(command) diff --git a/vtimerlist.h b/vtimerlist.h index 57dae9d..9aff6c3 100644 --- a/vtimerlist.h +++ b/vtimerlist.h @@ -34,8 +34,9 @@ #include "colour.h" #include "video.h" #include "i18n.h" +#include "timers.h" -class VTimerList : public View +class VTimerList : public View, public TimerReceiver { public: VTimerList(RecTimerList* rtl); @@ -43,6 +44,8 @@ class VTimerList : public View int handleCommand(int command); void draw(); + void timercall(int clientReference); + void drawClock(); private: RecTimerList* recTimerList; @@ -51,6 +54,8 @@ class VTimerList : public View void doShowingBar(); void drawData(); + + Region clockRegion; }; #endif diff --git a/vwelcome.cc b/vwelcome.cc index 65b4a17..5fa09a9 100644 --- a/vwelcome.cc +++ b/vwelcome.cc @@ -65,8 +65,8 @@ void VWelcome::setup() sl.addOption(tr("1. Live TV"), 1); sl.addOption(tr("2. Radio"), 0); sl.addOption(tr("3. Recordings"), 0); - sl.addOption(tr("4. Options"), 0); - sl.addOption(tr("5. Stand by"), 0); + sl.addOption(tr("4. Timers"), 0); + sl.addOption(tr("5. Options"), 0); sl.addOption(tr("6. Reboot"), 0); } @@ -142,15 +142,13 @@ int VWelcome::handleCommand(int command) } case Remote::FOUR: { - doOptions(); + doTimersList(); return 2; } case Remote::FIVE: { - Message* m = new Message(); // Must be done after this view deleted - m->message = Message::STANDBY; - Command::getInstance()->postMessageNoLock(m); - return 4; + doOptions(); + return 2; } case Remote::SIX: { @@ -176,15 +174,13 @@ int VWelcome::handleCommand(int command) } else if (option == 3) { - doOptions(); + doTimersList(); return 2; } else if (option == 4) { - Message* m = new Message(); // Must be done after this view deleted - m->message = Message::STANDBY; - Command::getInstance()->postMessageNoLock(m); - return 4; + doOptions(); + return 2; } else if (option == 5) { @@ -196,7 +192,6 @@ int VWelcome::handleCommand(int command) #ifdef DEV case Remote::NINE: { - doTimersList(); return 2; } #endif diff --git a/vwelcome.h b/vwelcome.h index 8192dc3..4993ba5 100644 --- a/vwelcome.h +++ b/vwelcome.h @@ -40,6 +40,7 @@ #include "video.h" #include "voptions.h" #include "i18n.h" +#include "timers.h" class VWelcome : public View, public TimerReceiver { -- 2.39.2 From e51c0c9cb2dae615e73cc5e7c9aec3ceae746c8b Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Tue, 3 Jan 2006 23:54:25 +0000 Subject: [PATCH 06/16] *** empty log message *** --- vtimerlist.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/vtimerlist.cc b/vtimerlist.cc index ad4b2f3..088dd36 100644 --- a/vtimerlist.cc +++ b/vtimerlist.cc @@ -54,6 +54,7 @@ VTimerList::VTimerList(RecTimerList* trtl) VTimerList::~VTimerList() { + Timers::getInstance()->cancelTimer(this, 1); if (recTimerList) { for (UINT i = 0; i < recTimerList->size(); i++) -- 2.39.2 From ccfabbd7c091a2db379fd67af049e48fd897da16 Mon Sep 17 00:00:00 2001 From: Mark Calderbank Date: Sun, 8 Jan 2006 11:16:50 +0000 Subject: [PATCH 07/16] Fix "wrapped" font (top two lines of glyph rendered at the bottom) --- bogl.h | 1 + fonts/helvB18.cc | Bin 240846 -> 257328 bytes fonts/helvB24.cc | Bin 298697 -> 298703 bytes surface.cc | 2 +- surface.h | 1 + 5 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bogl.h b/bogl.h index be7a623..9dc98a3 100644 --- a/bogl.h +++ b/bogl.h @@ -9,6 +9,7 @@ typedef struct bogl_font { char *name; /* Font name. */ int height; /* Height in pixels. */ + int spacing; /* Vertical spacing in pixels. */ unsigned long *content; /* 32-bit right-padded bitmap array. */ short *offset; /* 256 offsets into content. */ unsigned char *width; /* 256 character widths. */ diff --git a/fonts/helvB18.cc b/fonts/helvB18.cc index 5da9b7f5cb70b0de232ff7d9c9a80a712631cf79..f9b668442cebaf4cade692d45a69a05e8f2869a5 100644 GIT binary patch delta 10779 zcmbta33yahmj3R2A%sd*Qeq?tOHyP90(rHiDuGBqWJ?I8A`OU8f{0*%Vg~_Jj<~dn z6uHX5MkLy{vWNs;Pi`yH1lLAD(>>bl(zfNkfmW-nj_aIrUsWYRn3->e@2kqIs&~&l z_nh;e<$t{RT1M;ZnXQ>z)Rxs7nfz-mT1Mp;wudLtVl92Hh*dYk1yxP}#prbFXJb>?mn8(uH;KFjb` zYOJ@f;v#lyu1G&WTl~~J$0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RO%k7KvF&x43g#UJTWot> zri6J{!4}(Im#JaiQ?SK02A7V-_Z4jUx7TfIn7Isc1e_ zutmAo9ri%hR~SZKk6WjikJJE*WmEuq2R~M@MY7jpN}9t8wn+AROiA-k1zRM0J*K2N zqF{?;%n#bKqiP4I+AMobO>;~Qw^{a@lBQY0(`=Hxrlk2q!8XZ0Q__5@V4Gy0DQP}a zuubwrpQ&j+SGdix&y+O(Qm{?3&y+M@DA*?1Z%Ufu3bsl1dqObxYe}--R54$v0XE5g zQ^kC(V4GyWDP&G4*d{q(3Yl*dY?B-?h0I9>+aw1}A#+NRJk2IKU@Do@YPd~uz*I7E z2~W344!U&=eyd=cU2&3`M{COKrvnjaNxB@b`Nlr=vg+`nqNO?lYVH9xE2HsxVc*ZiVjoAR(P1ns|J t7o*xXmCSEyfX#B)R5E82Y?179p^_Q(4L0${e8?7DLfyUKr*ByBe*n5F<}CmK diff --git a/fonts/helvB24.cc b/fonts/helvB24.cc index 8ed2c3b25df3ee83c4522a16483b36bf3f5c72a3..047b58594fcc3d880ee582ce0febcf54c1d1d2bd 100644 GIT binary patch delta 22 ecmX>(SLpm)p@tU57N!>FEi6;}ruX-;SOEZRlnB-U delta 22 ecmX>FEi6;}rqAwUF#!N<&height; + return font->spacing; } void Surface::screenShot(char* fileName) diff --git a/surface.h b/surface.h index 5eaef78..c44656d 100644 --- a/surface.h +++ b/surface.h @@ -110,6 +110,7 @@ typedef struct { typedef struct bogl_font { char *name; /* Font name. */ int height; /* Height in pixels. */ + int spacing; /* Vertical spacing in pixels. */ unsigned long *content; /* 32-bit right-padded bitmap array. */ short *offset; /* 256 offsets into content. */ unsigned char *width; /* 256 character widths. */ -- 2.39.2 From 4ecb5228dcf70d51ac895e34f16fb31ddf10ac80 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sun, 8 Jan 2006 18:19:59 +0000 Subject: [PATCH 08/16] View timer --- Makefile | 2 +- language-data.h | 9 +++ rectimer.h | 16 ++++- vtimeredit.cc | 160 ++++++++++++++++++++++++++++++++++++++++++++++++ vtimeredit.h | 51 +++++++++++++++ vtimerlist.cc | 107 ++++++++++++++++++-------------- vtimerlist.h | 7 ++- vwelcome.cc | 1 - 8 files changed, 301 insertions(+), 52 deletions(-) create mode 100644 vtimeredit.cc create mode 100644 vtimeredit.h diff --git a/Makefile b/Makefile index 276a265..557dbaa 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ CROSSLIBS = ../jpeg-6b/libjpeg.a OBJECTS = main.o command.o log.o remote.o led.o mtd.o video.o audio.o tcp.o directory.o thread.o event.o \ player.o demuxer.o stream.o vfeed.o afeed.o afeedr.o osd.o surface.o viewman.o vdr.o dsock.o box.o \ - recording.o channel.o message.o playervideo.o messagequeue.o rectimer.o \ + recording.o channel.o message.o playervideo.o messagequeue.o rectimer.o vtimeredit.o \ view.o vinfo.o vwallpaper.o vvolume.o vrecordinglist.o vlivebanner.o vmute.o vtimerlist.o \ vrecordingmenu.o vquestion.o vchannellist.o vwelcome.o vvideolive.o vvideorec.o \ vchannelselect.o vserverselect.o colour.o vconnect.o voptions.o vepg.o region.o \ diff --git a/language-data.h b/language-data.h index 437b9f8..f940882 100644 --- a/language-data.h +++ b/language-data.h @@ -676,6 +676,15 @@ const I18n::tI18nPhrase I18n::Phrases[] = "Pas de detail du programme", "66", }, + // Edit timer + { "Edit Timer", + "", + "", + "", + "", + "", + "67", + }, // End marker. { NULL } }; diff --git a/rectimer.h b/rectimer.h index 42ba46f..840af9b 100644 --- a/rectimer.h +++ b/rectimer.h @@ -63,4 +63,18 @@ class RecTimer // File = orig VDR info = filename // Directory = Base Dir -// Name = Prog name \ No newline at end of file +// Name = Prog name + +/* +Name +Directory +Active +Recording +Pending +Priority +Lifetime +Channel number +Start time +Stop time +Summary +*/ diff --git a/vtimeredit.cc b/vtimeredit.cc new file mode 100644 index 0000000..e5e1eaf --- /dev/null +++ b/vtimeredit.cc @@ -0,0 +1,160 @@ +/* + 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 "vtimeredit.h" + +VTimerEdit::VTimerEdit(RecTimer* trt) +{ + recTimer = trt; + + create(570, 420); + if (Video::getInstance()->getFormat() == Video::PAL) + { + setScreenPos(80, 70); + } + else + { + setScreenPos(70, 35); + } + + + setBackgroundColour(Colour::VIEWBACKGROUND); + setTitleBarOn(1); + setTitleText(tr("Edit Timer")); + setTitleBarColour(Colour::TITLEBARBACKGROUND); + + + // Draw statics + + draw(); // View::draw + + int xpos = 20; + int ypos = 50; + drawText("Active", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + drawText("Channel", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + drawText("Name", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + drawText("Directory", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + ypos += surface->getFontHeight(); + drawText("Start", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + drawText("Stop", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + drawText("Priority", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + drawText("Lifetime", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + ypos += surface->getFontHeight(); + drawText("Current", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + drawText("Recording", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + drawText("Summary", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + + + // Temp + char buffer[1000]; + struct tm* tms; + xpos = 150; + ypos = 50; + + // Active + if (recTimer->active) strcpy(buffer, "Yes"); + else strcpy(buffer, "No"); + drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + + // Channel + snprintf(buffer, 999, "%lu", recTimer->channelNumber); + drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + + // Name + snprintf(buffer, 999, "%s", recTimer->getName()); + drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + + // Directory + if (recTimer->getDirectory()) snprintf(buffer, 999, "%s", recTimer->getDirectory()); + else strcpy(buffer, ""); + drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + ypos += surface->getFontHeight(); + + // Start + tms = localtime((time_t*)&recTimer->startTime); + strftime(buffer, 999, "%d/%m %H:%M", tms); + drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + + // Stop + tms = localtime((time_t*)&recTimer->stopTime); + strftime(buffer, 999, "%d/%m %H:%M", tms); + drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + + // Priority + snprintf(buffer, 999, "%lu", recTimer->priority); + drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + + // Lifetime + snprintf(buffer, 999, "%lu", recTimer->lifeTime); + drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + ypos += surface->getFontHeight(); + + // Current + if (recTimer->pending) strcpy(buffer, "Yes"); + else strcpy(buffer, "No"); + drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + + // Recording now + if (recTimer->recording) strcpy(buffer, "Yes"); + else strcpy(buffer, "No"); + drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + + // Summary + strcpy(buffer, "View summary"); + drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + + +} + +VTimerEdit::~VTimerEdit() +{ +} + +int VTimerEdit::handleCommand(int command) +{ + switch(command) + { + case Remote::DF_UP: + case Remote::UP: + { + + ViewMan::getInstance()->updateView(this); + return 2; + } + case Remote::DF_DOWN: + case Remote::DOWN: + { + + ViewMan::getInstance()->updateView(this); + return 2; + } + case Remote::OK: + { + + return 2; + } + case Remote::BACK: + { + return 4; + } + } + // stop command getting to any more views + return 1; +} diff --git a/vtimeredit.h b/vtimeredit.h new file mode 100644 index 0000000..0279248 --- /dev/null +++ b/vtimeredit.h @@ -0,0 +1,51 @@ +/* + 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 VTIMEREDIT_H +#define VTIMEREDIT_H + +#include +#include + +#include "view.h" +#include "wselectlist.h" +#include "remote.h" +#include "wsymbol.h" +#include "viewman.h" +#include "vdr.h" +#include "colour.h" +#include "video.h" +#include "i18n.h" +#include "timers.h" + +class VTimerEdit : public View +{ + public: + VTimerEdit(RecTimer* rt); + ~VTimerEdit(); + + int handleCommand(int command); + + private: + RecTimer* recTimer; + +}; + +#endif diff --git a/vtimerlist.cc b/vtimerlist.cc index 088dd36..19ffbab 100644 --- a/vtimerlist.cc +++ b/vtimerlist.cc @@ -49,7 +49,36 @@ VTimerList::VTimerList(RecTimerList* trtl) sl.setSurfaceOffset(10, 30 + 5); sl.setDimensions(area.w - 20, area.h - 30 - 15 - 30); - drawData(); + // Draw statics + + draw(); // View::draw + + WSymbol w; + w.setSurface(surface); + + w.nextSymbol = WSymbol::UP; + w.setSurfaceOffset(20, 385); + w.draw(); + + w.nextSymbol = WSymbol::DOWN; + w.setSurfaceOffset(50, 385); + w.draw(); + + w.nextSymbol = WSymbol::SKIPBACK; + w.setSurfaceOffset(85, 385); + w.draw(); + + w.nextSymbol = WSymbol::SKIPFORWARD; + w.setSurfaceOffset(115, 385); + w.draw(); + + drawTextRJ("[ok] = edit", 560, 385, Colour::LIGHTTEXT); + + + insertData(); + sl.draw(); + drawShowing(); + drawClock(); } VTimerList::~VTimerList() @@ -67,15 +96,18 @@ VTimerList::~VTimerList() } } -void VTimerList::drawData() +void VTimerList::insertData() { char strA[300]; char strB[300]; + char status; struct tm* btime; + // FIXME all drawing stuff in this class and sl.clear somewhere?! + sl.addColumn(0); - sl.addColumn(110); + sl.addColumn(130); RecTimer* recTimer; int first = 1; @@ -83,9 +115,26 @@ void VTimerList::drawData() for (UINT i = 0; i < recTimerList->size(); i++) { recTimer = (*recTimerList)[i]; + if (recTimer->recording) + { + status = 'R'; + } + else if (recTimer->pending) + { + status = 'X'; + } + else if (recTimer->active == 0) + { + status = 'N'; + } + else + { + status = 'O'; + } + btime = localtime((time_t*)&recTimer->startTime); strftime(strA, 299, "%d/%m %H:%M ", btime); - snprintf(strB, 299, "%s\t%s", strA, recTimer->getName()); + snprintf(strB, 299, "%c %s\t%s", status, strA, recTimer->getName()); recTimer->index = sl.addOption(strB, first); first = 0; } @@ -106,39 +155,7 @@ void VTimerList::drawClock() Timers::getInstance()->setTimer(this, 1, t + 1); } -void VTimerList::draw() -{ - View::draw(); - sl.draw(); - - // Put the status stuff at the bottom - - WSymbol w; - w.setSurface(surface); - - w.nextSymbol = WSymbol::UP; - w.setSurfaceOffset(20, 385); - w.draw(); - - w.nextSymbol = WSymbol::DOWN; - w.setSurfaceOffset(50, 385); - w.draw(); - - w.nextSymbol = WSymbol::SKIPBACK; - w.setSurfaceOffset(85, 385); - w.draw(); - - w.nextSymbol = WSymbol::SKIPFORWARD; - w.setSurfaceOffset(115, 385); - w.draw(); - - drawTextRJ("[ok] = edit", 560, 385, Colour::LIGHTTEXT); - - doShowingBar(); - drawClock(); -} - -void VTimerList::doShowingBar() +void VTimerList::drawShowing() { int topOption = sl.getTopOption() + 1; if (sl.getNumOptions() == 0) topOption = 0; @@ -164,8 +181,7 @@ int VTimerList::handleCommand(int command) { sl.up(); sl.draw(); - - doShowingBar(); + drawShowing(); ViewMan::getInstance()->updateView(this); return 2; } @@ -174,8 +190,7 @@ int VTimerList::handleCommand(int command) { sl.down(); sl.draw(); - - doShowingBar(); + drawShowing(); ViewMan::getInstance()->updateView(this); return 2; } @@ -183,8 +198,7 @@ int VTimerList::handleCommand(int command) { sl.pageUp(); sl.draw(); - - doShowingBar(); + drawShowing(); ViewMan::getInstance()->updateView(this); return 2; } @@ -192,8 +206,7 @@ int VTimerList::handleCommand(int command) { sl.pageDown(); sl.draw(); - - doShowingBar(); + drawShowing(); ViewMan::getInstance()->updateView(this); return 2; } @@ -213,7 +226,9 @@ int VTimerList::handleCommand(int command) if (recTimer == NULL) return 2; - // recTimer is the one you want FIXME + VTimerEdit* v = new VTimerEdit(recTimer); + ViewMan::getInstance()->add(v); + ViewMan::getInstance()->updateView(v); return 2; } diff --git a/vtimerlist.h b/vtimerlist.h index 9aff6c3..415f561 100644 --- a/vtimerlist.h +++ b/vtimerlist.h @@ -35,6 +35,7 @@ #include "video.h" #include "i18n.h" #include "timers.h" +#include "vtimeredit.h" class VTimerList : public View, public TimerReceiver { @@ -43,16 +44,16 @@ class VTimerList : public View, public TimerReceiver ~VTimerList(); int handleCommand(int command); - void draw(); void timercall(int clientReference); - void drawClock(); private: RecTimerList* recTimerList; WSelectList sl; - void doShowingBar(); + void insertData(); + void drawClock(); + void drawShowing(); void drawData(); Region clockRegion; diff --git a/vwelcome.cc b/vwelcome.cc index 5fa09a9..cf2e745 100644 --- a/vwelcome.cc +++ b/vwelcome.cc @@ -272,7 +272,6 @@ void VWelcome::doTimersList() { VTimerList* vtl = new VTimerList(recTimerList); - vtl->draw(); viewman->add(vtl); viewman->updateView(vtl); } -- 2.39.2 From a3d8b25d99185a0b2bef5df35d04cb24a5471e18 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sun, 8 Jan 2006 23:02:26 +0000 Subject: [PATCH 09/16] More timers display code --- vtimerlist.cc | 87 ++++++++++++++++++++++++++++++++++++++------------- vtimerlist.h | 4 +++ wselectlist.h | 2 +- 3 files changed, 71 insertions(+), 22 deletions(-) diff --git a/vtimerlist.cc b/vtimerlist.cc index 19ffbab..ad25bc9 100644 --- a/vtimerlist.cc +++ b/vtimerlist.cc @@ -29,6 +29,13 @@ VTimerList::VTimerList(RecTimerList* trtl) clockRegion.w = 150; clockRegion.h = 30; + indicatorsRegion.x = 6; + indicatorsRegion.y = 44; + indicatorsRegion.w = 18; + indicatorsRegion.h = 15 * (surface->getFontHeight() + 1); + + flipflop = true; + create(570, 420); if (Video::getInstance()->getFormat() == Video::PAL) { @@ -46,8 +53,8 @@ VTimerList::VTimerList(RecTimerList* trtl) setTitleBarColour(Colour::TITLEBARBACKGROUND); sl.setSurface(surface); - sl.setSurfaceOffset(10, 30 + 5); - sl.setDimensions(area.w - 20, area.h - 30 - 15 - 30); + sl.setSurfaceOffset(30, 30 + 5); + sl.setDimensions(area.w - 40, area.h - 30 - 15 - 30); // Draw statics @@ -78,6 +85,7 @@ VTimerList::VTimerList(RecTimerList* trtl) insertData(); sl.draw(); drawShowing(); + drawIndicators(); drawClock(); } @@ -100,14 +108,13 @@ void VTimerList::insertData() { char strA[300]; char strB[300]; - char status; struct tm* btime; // FIXME all drawing stuff in this class and sl.clear somewhere?! sl.addColumn(0); - sl.addColumn(130); + sl.addColumn(110); RecTimer* recTimer; int first = 1; @@ -115,26 +122,10 @@ void VTimerList::insertData() for (UINT i = 0; i < recTimerList->size(); i++) { recTimer = (*recTimerList)[i]; - if (recTimer->recording) - { - status = 'R'; - } - else if (recTimer->pending) - { - status = 'X'; - } - else if (recTimer->active == 0) - { - status = 'N'; - } - else - { - status = 'O'; - } btime = localtime((time_t*)&recTimer->startTime); strftime(strA, 299, "%d/%m %H:%M ", btime); - snprintf(strB, 299, "%c %s\t%s", status, strA, recTimer->getName()); + snprintf(strB, 299, "%s\t%s", strA, recTimer->getName()); recTimer->index = sl.addOption(strB, first); first = 0; } @@ -166,10 +157,60 @@ void VTimerList::drawShowing() drawText(showing, 220, 385, Colour::LIGHTTEXT); } +void VTimerList::drawIndicators() +{ + int top = sl.getTopOption(); + int bottom = sl.getBottomOption(); + int yinc = surface->getFontHeight() + 1; + RecTimer* recTimer; + + rectangle(6, 44, 18, 15*yinc, Colour::VIEWBACKGROUND); + + // The indexes recorded from the wselectlist into the index member of the RecTimer + // Is the same as the position in the vector of RecTimers + // Because they are in order, they don't change order and wselectlist starts from 0 up consecutively + + int ypos = 44; + for (int current = top; current < bottom; current++) + { + recTimer = (*recTimerList)[current]; + + if (recTimer->recording) // Flashing red square + { + if (flipflop) + { + //rectangle(6, ypos, 18, 16, Colour::RED); + rectangle(6, ypos, 18, 16, Colour::RED); + drawText("R", 8, ypos-3, Colour::LIGHTTEXT); + } + } + else if (recTimer->pending) + { + rectangle(6, ypos, 18, 16, Colour::RED); + drawText("X", 8, ypos-3, Colour::BLACK); + } + else if (recTimer->active == 0) + { + rectangle(6, ypos, 18, 16, Colour::SELECTHIGHLIGHT); + drawText("X", 8, ypos-3, Colour::BLACK); + } + else + { +// if (flipflop) rectangle(6, ypos, 18, 16, Colour::GREEN); + } + + ypos += yinc; + } +} + void VTimerList::timercall(int clientReference) { drawClock(); ViewMan::getInstance()->updateView(this, &clockRegion); + + flipflop = !flipflop; + drawIndicators(); + ViewMan::getInstance()->updateView(this, &indicatorsRegion); } int VTimerList::handleCommand(int command) @@ -182,6 +223,7 @@ int VTimerList::handleCommand(int command) sl.up(); sl.draw(); drawShowing(); + drawIndicators(); ViewMan::getInstance()->updateView(this); return 2; } @@ -191,6 +233,7 @@ int VTimerList::handleCommand(int command) sl.down(); sl.draw(); drawShowing(); + drawIndicators(); ViewMan::getInstance()->updateView(this); return 2; } @@ -199,6 +242,7 @@ int VTimerList::handleCommand(int command) sl.pageUp(); sl.draw(); drawShowing(); + drawIndicators(); ViewMan::getInstance()->updateView(this); return 2; } @@ -207,6 +251,7 @@ int VTimerList::handleCommand(int command) sl.pageDown(); sl.draw(); drawShowing(); + drawIndicators(); ViewMan::getInstance()->updateView(this); return 2; } diff --git a/vtimerlist.h b/vtimerlist.h index 415f561..3fa0b81 100644 --- a/vtimerlist.h +++ b/vtimerlist.h @@ -55,8 +55,12 @@ class VTimerList : public View, public TimerReceiver void drawClock(); void drawShowing(); void drawData(); + void drawIndicators(); Region clockRegion; + Region indicatorsRegion; + + bool flipflop; }; #endif diff --git a/wselectlist.h b/wselectlist.h index c411cb7..a556af8 100644 --- a/wselectlist.h +++ b/wselectlist.h @@ -51,7 +51,7 @@ class WSelectList : public Widget int getTopOption(); int getNumOptions(); - int getBottomOption(); + int getBottomOption(); // actually returns bottom + 1 i.e. the one just past display ?! int getCurrentOption(); void hintSetCurrent(int index); -- 2.39.2 From 454b9e36e14680a3b0c390d7d0dd4c23f7b8a139 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Fri, 20 Jan 2006 23:44:49 +0000 Subject: [PATCH 10/16] Display server names --- vconnect.cc | 34 +++++++++++++++++++++++----------- vconnect.h | 2 +- vdr.cc | 27 ++++++++++++++++++++------- vdr.h | 18 +++++++++++++++++- 4 files changed, 61 insertions(+), 20 deletions(-) diff --git a/vconnect.cc b/vconnect.cc index c86a5f3..6b19c27 100644 --- a/vconnect.cc +++ b/vconnect.cc @@ -76,22 +76,26 @@ void VConnect::threadMethod() draw(); viewman->updateView(this); - vdr->findServers(serverIPs); + vdr->findServers(servers); if (!irun) { - for(UINT k = 0; k < serverIPs.size(); k++) delete[] serverIPs[k]; - serverIPs.clear(); + for(UINT k = 0; k < servers.size(); k++) + { + delete[] servers[k].ip; + delete[] servers[k].name; + } + servers.clear(); return; } - if (serverIPs.size() == 1) + if (servers.size() == 1) { selectedServer = 0; } else { selectedServer = -1; - VServerSelect* vs = new VServerSelect(&serverIPs, this); + VServerSelect* vs = new VServerSelect(servers, this); vs->draw(); viewman->add(vs); // FIXME - do this better - perhaps post message to Command // Otherwise it will be using ViewMan without the Command mutex locked @@ -104,17 +108,25 @@ void VConnect::threadMethod() if (!irun) { - for(UINT k = 0; k < serverIPs.size(); k++) delete[] serverIPs[k]; - serverIPs.clear(); + for(UINT k = 0; k < servers.size(); k++) + { + delete[] servers[k].ip; + delete[] servers[k].name; + } + servers.clear(); return; } - logger->log("VConnect", Log::NOTICE, "Connecting to server at %s", serverIPs[selectedServer]); - vdr->setServerIP(serverIPs[selectedServer]); + logger->log("VConnect", Log::NOTICE, "Connecting to server at %s", servers[selectedServer].ip); + vdr->setServerIP(servers[selectedServer].ip); // Clear the serverIPs vector - for(UINT k = 0; k < serverIPs.size(); k++) delete[] serverIPs[k]; - serverIPs.clear(); + for(UINT k = 0; k < servers.size(); k++) + { + delete[] servers[k].ip; + delete[] servers[k].name; + } + servers.clear(); setOneLiner(tr("Connecting to VDR")); draw(); diff --git a/vconnect.h b/vconnect.h index 5cc6925..139550e 100644 --- a/vconnect.h +++ b/vconnect.h @@ -55,7 +55,7 @@ class VConnect : public VInfo, public Thread UCHAR irun; VDR* vdr; Log* logger; - std::vector serverIPs; + std::vector servers; int selectedServer; }; diff --git a/vdr.cc b/vdr.cc index 4f27a46..f5bd948 100644 --- a/vdr.cc +++ b/vdr.cc @@ -64,14 +64,13 @@ int VDR::shutdown() return 1; } -void VDR::findServers(vector& serverIPs) +void VDR::findServers(vector& servers) { findingServer = 1; - char* message = "VOMP CLIENT"; + char* message = "VOMP"; DatagramSocket ds(port); int haveAtLeastOne = 0; - char* newIP; int retval; int waitType = 1; while(findingServer) @@ -85,15 +84,28 @@ void VDR::findServers(vector& serverIPs) if (retval == 2) // we got a reply { - if (strcmp(ds.getData(), "VOMP SERVER")) // echo..... + if (!strcmp(ds.getData(), "VOMP")) // echo..... { waitType = 2; } else { - newIP = new char[16]; - strcpy(newIP, ds.getFromIPA()); - serverIPs.push_back(newIP); + VDRServer newServer; + newServer.ip = new char[16]; + strcpy(newServer.ip, ds.getFromIPA()); + + if (ds.getDataLength() == 0) + { + newServer.name = new char[1]; + newServer.name[0] = '\0'; + } + else + { + newServer.name = new char[strlen(ds.getData())+1]; + strcpy(newServer.name, ds.getData()); + } + + servers.push_back(newServer); waitType = 2; haveAtLeastOne = 1; } @@ -104,6 +116,7 @@ void VDR::findServers(vector& serverIPs) waitType = 1; } } + sort(servers.begin(), servers.end(), ServerSorter()); } void VDR::cancelFindingServer() diff --git a/vdr.h b/vdr.h index bf3fec5..d63b1f5 100644 --- a/vdr.h +++ b/vdr.h @@ -53,6 +53,22 @@ struct RecTimerSorter // : public binary_function } }; +struct VDRServer +{ + char* ip; + char* name; +}; + +struct ServerSorter +{ + bool operator() (const VDRServer a, const VDRServer b) + { + printf("%s %s\n", a.name, b.name); + if (strcmp(b.name, a.name) > 0) return true; + return false; + } +}; + class VDR { @@ -64,7 +80,7 @@ class VDR int init(int port); int shutdown(); - void findServers(vector& serverIPs); + void findServers(vector& servers); void cancelFindingServer(); void setServerIP(char*); int connect(); -- 2.39.2 From bc8e133c24097757083dc6ed1641cc769359292a Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Fri, 20 Jan 2006 23:45:17 +0000 Subject: [PATCH 11/16] Display server names --- vdr.h | 1 - vserverselect.cc | 8 ++++---- vserverselect.h | 5 ++++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/vdr.h b/vdr.h index d63b1f5..9111d2c 100644 --- a/vdr.h +++ b/vdr.h @@ -63,7 +63,6 @@ struct ServerSorter { bool operator() (const VDRServer a, const VDRServer b) { - printf("%s %s\n", a.name, b.name); if (strcmp(b.name, a.name) > 0) return true; return false; } diff --git a/vserverselect.cc b/vserverselect.cc index 4718f60..f6bfb5c 100644 --- a/vserverselect.cc +++ b/vserverselect.cc @@ -20,7 +20,7 @@ #include "vserverselect.h" -VServerSelect::VServerSelect(std::vector* serverIPs, void* treplyTo) +VServerSelect::VServerSelect(vector& servers, void* treplyTo) { // I tried the whole passing using a reference here, but // the program segfaulted when settitletext tried to new @@ -46,10 +46,10 @@ VServerSelect::VServerSelect(std::vector* serverIPs, void* treplyTo) sl.setSurfaceOffset(10, 30 + 5); sl.setDimensions(area.w - 20, area.h - 30 - 15); - sl.addOption((*serverIPs)[0], 1); - for(UINT k = 1; k < serverIPs->size(); k++) + sl.addOption(servers[0].name, 1); + for(UINT k = 1; k < servers.size(); k++) { - sl.addOption((*serverIPs)[k], 0); + sl.addOption(servers[k].name, 0); } replyTo = treplyTo; diff --git a/vserverselect.h b/vserverselect.h index c01c144..2af588d 100644 --- a/vserverselect.h +++ b/vserverselect.h @@ -33,11 +33,14 @@ #include "video.h" #include "viewman.h" #include "i18n.h" +#include "vdr.h" + +using namespace std; class VServerSelect : public View { public: - VServerSelect(std::vector* tserverIPs, void* replyTo); + VServerSelect(vector& servers, void* replyTo); ~VServerSelect(); int handleCommand(int command); -- 2.39.2 From 739a6e9404257d462321f835bccb532d26c15571 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sat, 21 Jan 2006 14:33:37 +0000 Subject: [PATCH 12/16] Sort recordings from VDR 1.3, patch from Dave --- recording.cc | 2 +- recording.h | 2 +- vdr.cc | 2 ++ vdr.h | 26 +++++++++++++++++++------- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/recording.cc b/recording.cc index 016ef5a..2b28d54 100644 --- a/recording.cc +++ b/recording.cc @@ -58,7 +58,7 @@ char* Recording::getDirName() return dirName; } -char* Recording::getProgName() +char* Recording::getProgName() const { return progName; } diff --git a/recording.h b/recording.h index 57e0701..0d65eda 100644 --- a/recording.h +++ b/recording.h @@ -34,7 +34,7 @@ class Recording int isInDir(); char* getDirName(); - char* getProgName(); + char* getProgName() const; unsigned long start; char* fileName; diff --git a/vdr.cc b/vdr.cc index f5bd948..7d7a550 100644 --- a/vdr.cc +++ b/vdr.cc @@ -359,6 +359,8 @@ Directory* VDR::getRecordingsList() freePacket(); pthread_mutex_unlock(&mutex); + sort(recDir->recList.begin(), recDir->recList.end(), RecordingSorter()); + return recDir; } diff --git a/vdr.h b/vdr.h index 9111d2c..22ae2c1 100644 --- a/vdr.h +++ b/vdr.h @@ -45,6 +45,12 @@ typedef vector EventList; typedef vector ChannelList; typedef vector RecTimerList; +struct VDRServer +{ + char* ip; + char* name; +}; + struct RecTimerSorter // : public binary_function { bool operator() (const RecTimer* a, const RecTimer* b) @@ -53,21 +59,27 @@ struct RecTimerSorter // : public binary_function } }; -struct VDRServer -{ - char* ip; - char* name; -}; - struct ServerSorter { - bool operator() (const VDRServer a, const VDRServer b) + bool operator() (const VDRServer& a, const VDRServer& b) { if (strcmp(b.name, a.name) > 0) return true; return false; } }; +struct RecordingSorter +{ + bool operator() (const Recording* a, const Recording* b) + { + int c = strcmp(b->getProgName(), a->getProgName()); + if (c > 0) return true; + if (c < 0) return false; + + return a->start < b->start; + } +}; + class VDR { -- 2.39.2 From 0057a6fd47623edb1b0338fae181756457dfe120 Mon Sep 17 00:00:00 2001 From: Mark Calderbank Date: Thu, 26 Jan 2006 23:52:38 +0000 Subject: [PATCH 13/16] Add video PTS to demuxer and do some tidying --- demuxer.cc | 60 ++++++++++++++++++++++++++++++++++++++++++++++-------- demuxer.h | 17 ++++++++++------ 2 files changed, 63 insertions(+), 14 deletions(-) diff --git a/demuxer.cc b/demuxer.cc index afd7eec..1f553ae 100644 --- a/demuxer.cc +++ b/demuxer.cc @@ -69,7 +69,7 @@ void Demuxer::reset() video_current = audio_current = -1; horizontal_size = vertical_size = 0; aspect_ratio = (enum AspectRatio) 0; - cbAspectRatio = frame_rate = bit_rate = 0; + frame_rate = bit_rate = 0; } int Demuxer::shutdown() @@ -109,18 +109,23 @@ void Demuxer::setVideoStream(int id) video_current = id; } -void Demuxer::setAspectRatio() +void Demuxer::setAspectRatio(enum AspectRatio ar) { - if (aspect_ratio != cbAspectRatio) + if (aspect_ratio != ar) { - cbAspectRatio = aspect_ratio; + aspect_ratio = ar; callback->call(this); } } -int Demuxer::getAspectRatio() +int Demuxer::writeAudio(int fd) { - return aspect_ratio; + return audiostream.drain(fd); +} + +int Demuxer::writeVideo(int fd) +{ + return videostream.drain(fd); } int Demuxer::scan(UCHAR *buf, int len) @@ -414,6 +419,16 @@ int Demuxer::parse_private1_frame(int len, int* full) void Demuxer::parse_video_details(UCHAR* buf, int len) { + // Extract video PTS if it exists + if ( buf[1] & 0x80 ) // PTS_DTS_flags indicate that PTS is present + { + video_pts = ( (ULLONG)(buf[3] & 0x0E) << 29 ) | + ( (ULLONG)(buf[4]) << 22 ) | + ( (ULLONG)(buf[5] & 0xFE) << 14 ) | + ( (ULLONG)(buf[6]) << 7 ) | + ( (ULLONG)(buf[7] & 0xFE) >> 1 ); + } + // Now, scan for a GOP header and extract video information UCHAR byte; int zeros = 0; while (len >= 8) // 8 is length of a GOP header @@ -455,7 +470,7 @@ void Demuxer::parse_video_details(UCHAR* buf, int len) if (len < 7) return; horizontal_size = ((int)buf[0] << 4) | ((int)buf[1] >> 4); vertical_size = (((int)buf[1] & 0xf) << 8) | (int)buf[2]; - aspect_ratio = (enum AspectRatio)(buf[3] >> 4); + setAspectRatio((enum AspectRatio)(buf[3] >> 4)); frame_rate = buf[3] & 0x0f; if (frame_rate >= 1 && frame_rate <= 8) frame_rate = FrameRates[frame_rate]; @@ -467,7 +482,6 @@ void Demuxer::parse_video_details(UCHAR* buf, int len) seeking = 0; buf += 8; // Minimum length of sequence header len -= 8; - setAspectRatio(); break; case 0xb8: // Group header // We're not going to bother parsing anything. @@ -478,3 +492,33 @@ void Demuxer::parse_video_details(UCHAR* buf, int len) } } } + +int Demuxer::findVideoPTS(UCHAR* buf, int len, ULLONG* dest) +{ + UINT LoPattern = 0x100 | FRAMETYPE_VID0, + HiPattern = 0x100 | FRAMETYPE_VIDMAX; + + while (len >= 14) + { + UINT pattern = *(UINT*)buf; + buf++; len--; + if (pattern < LoPattern || pattern > HiPattern) continue; + + UINT framelength = ((UINT)buf[3] << 8) | buf[4]; + buf += 5; len -= 5; + + if ( buf[1] & 0x80 ) // PTS_DTS_flags indicate that PTS is present + { + *dest = ( (ULLONG)(buf[3] & 0x0E) << 29 ) | + ( (ULLONG)(buf[4]) << 22 ) | + ( (ULLONG)(buf[5] & 0xFE) << 14 ) | + ( (ULLONG)(buf[6]) << 7 ) | + ( (ULLONG)(buf[7] & 0xFE) >> 1 ); + return 1; + } + + buf += framelength; len -= framelength; + } + // No PTS found. + return 0; +} diff --git a/demuxer.h b/demuxer.h index 96fcdac..29930b5 100644 --- a/demuxer.h +++ b/demuxer.h @@ -50,12 +50,18 @@ class Demuxer void seek(); void setVideoStream(int id); void setAudioStream(int id); - int writeAudio(int fd) { return audiostream.drain(fd); } - int writeVideo(int fd) { return videostream.drain(fd); } + int writeAudio(int fd); + int writeVideo(int fd); int scan(UCHAR* buf, int len); + int findVideoPTS(UCHAR* buf, int len, ULLONG* dest); int put(UCHAR* buf, int len); - int getAspectRatio(); + int getHorizontalSize() { return horizontal_size; } + int getVerticalSize() { return vertical_size; } + int getAspectRatio() { return aspect_ratio; } + int getFrameRate() { return frame_rate; } + int getBitRate() { return bit_rate; } + ULLONG getVideoPTS() { return video_pts; } enum AspectRatio { @@ -72,7 +78,7 @@ class Demuxer int seeking; UCHAR* inbuf; - void setAspectRatio(); + void setAspectRatio(enum AspectRatio); Callback* callback; int video_current, audio_current; @@ -152,8 +158,7 @@ class Demuxer enum AspectRatio aspect_ratio; int frame_rate; int bit_rate; - - int cbAspectRatio; + ULLONG video_pts; }; #endif -- 2.39.2 From 2459b5e00d69c8b2f3ecbce5f64fe9bc4c8efcc1 Mon Sep 17 00:00:00 2001 From: Mark Calderbank Date: Fri, 27 Jan 2006 00:32:05 +0000 Subject: [PATCH 14/16] WSelectList: Make 'page down' skip to end if no next page exists --- wselectlist.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/wselectlist.cc b/wselectlist.cc index 9942ff5..ec535b0 100644 --- a/wselectlist.cc +++ b/wselectlist.cc @@ -181,10 +181,15 @@ void WSelectList::pageUp() void WSelectList::pageDown() { - if ((topOption + numOptionsDisplayable) >= options.size()) return; - - topOption += numOptionsDisplayable; - selectedOption = topOption; + if ((topOption + numOptionsDisplayable) >= options.size()) + { + selectedOption = options.size() - 1; + } + else + { + topOption += numOptionsDisplayable; + selectedOption = topOption; + } } int WSelectList::getTopOption() -- 2.39.2 From 656e5ebef7461f82d120fc59bfc7917ea41eef4d Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Thu, 23 Feb 2006 19:07:04 +0000 Subject: [PATCH 15/16] Multiple options pages --- Makefile | 2 +- defines.h | 3 + message.h | 1 + thread.h | 2 - vdr.cc | 14 ++++ vdr.h | 10 +++ vepg.cc | 2 + view.cc | 2 +- view.h | 2 +- voptions.cc | 215 ++++++++++++++++++++++++++------------------------ voptions.h | 42 +++------- vwelcome.cc | 18 ++++- vwelcome.h | 7 +- wbutton.cc | 11 +++ wbutton.h | 3 + woptionbox.cc | 50 +++++++++--- woptionbox.h | 12 ++- 17 files changed, 241 insertions(+), 155 deletions(-) diff --git a/Makefile b/Makefile index 557dbaa..b2c3dc6 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ CROSSLIBS = ../jpeg-6b/libjpeg.a OBJECTS = main.o command.o log.o remote.o led.o mtd.o video.o audio.o tcp.o directory.o thread.o event.o \ player.o demuxer.o stream.o vfeed.o afeed.o afeedr.o osd.o surface.o viewman.o vdr.o dsock.o box.o \ - recording.o channel.o message.o playervideo.o messagequeue.o rectimer.o vtimeredit.o \ + recording.o channel.o message.o playervideo.o messagequeue.o rectimer.o vtimeredit.o voptionsmenu.o \ view.o vinfo.o vwallpaper.o vvolume.o vrecordinglist.o vlivebanner.o vmute.o vtimerlist.o \ vrecordingmenu.o vquestion.o vchannellist.o vwelcome.o vvideolive.o vvideorec.o \ vchannelselect.o vserverselect.o colour.o vconnect.o voptions.o vepg.o region.o \ diff --git a/defines.h b/defines.h index 0d6f880..638943c 100644 --- a/defines.h +++ b/defines.h @@ -27,6 +27,9 @@ typedef unsigned int UINT; typedef unsigned long ULONG; typedef unsigned long long ULLONG; +#define OPTIONTYPE_TEXT 1 +#define OPTIONTYPE_INT 2 + //#define SCREENWIDTH 720 //#define SCREENHEIGHT 576 //#define SCREENHEIGHT 480 diff --git a/message.h b/message.h index 3fe32a2..3508883 100644 --- a/message.h +++ b/message.h @@ -60,6 +60,7 @@ class Message const static ULONG TIMER = 15; const static ULONG EPG = 16; const static ULONG EPG_CLOSE = 17; + const static ULONG CHANGED_OPTIONS = 18; }; #endif diff --git a/thread.h b/thread.h index 965228e..544d345 100644 --- a/thread.h +++ b/thread.h @@ -24,8 +24,6 @@ #include #include -#include // temp - class Thread { protected: diff --git a/vdr.cc b/vdr.cc index 7d7a550..1b3b7aa 100644 --- a/vdr.cc +++ b/vdr.cc @@ -359,6 +359,20 @@ Directory* VDR::getRecordingsList() freePacket(); pthread_mutex_unlock(&mutex); + // Sort the directory order + sort(recDir->dirList.begin(), recDir->dirList.end(), DirectorySorter()); + + // Sort all the sub lists + + Directory* sortDir; + DirectoryList::iterator i; + for (i = recDir->dirList.begin(); i != recDir->dirList.end(); i++) + { + sortDir = *i; + sort(sortDir->recList.begin(), sortDir->recList.end(), RecordingSorter()); + } + + // Sort the root level list sort(recDir->recList.begin(), recDir->recList.end(), RecordingSorter()); return recDir; diff --git a/vdr.h b/vdr.h index 22ae2c1..4e36245 100644 --- a/vdr.h +++ b/vdr.h @@ -80,6 +80,16 @@ struct RecordingSorter } }; +struct DirectorySorter +{ + bool operator() (const Directory* a, const Directory* b) + { + int c = strcmp(b->name, a->name); + if (c > 0) return true; + return false; + } +}; + class VDR { diff --git a/vepg.cc b/vepg.cc index 2559fee..e00bc3f 100644 --- a/vepg.cc +++ b/vepg.cc @@ -341,6 +341,8 @@ int VEpg::handleCommand(int command) } case Remote::RECORD: { + Log::getInstance()->log("VEPG", Log::DEBUG, "ID %lu TIME %lu DURATION %lu TITLE %s\n", thisEvent.id, thisEvent.time, thisEvent.duration, thisEvent.title); + //TODO FIXME return 2; } diff --git a/view.cc b/view.cc index b589910..efeb07b 100644 --- a/view.cc +++ b/view.cc @@ -54,7 +54,7 @@ bool View::create(UINT w, UINT h) return surface->create(area.w, area.h); } -void View::setTitleText(char* takeText) +void View::setTitleText(const char* takeText) { int length = strlen(takeText); titleText = new char[length + 1]; diff --git a/view.h b/view.h index 1a9d710..34bdca6 100644 --- a/view.h +++ b/view.h @@ -42,7 +42,7 @@ class View : public Box void setBorderOn(UCHAR on); void setTitleBarOn(UCHAR on); - void setTitleText(char* title); + void setTitleText(const char* title); void setBackgroundColour(Colour& colour); void setTitleBarColour(Colour& colour); diff --git a/voptions.cc b/voptions.cc index caf5b2f..0d03d2a 100644 --- a/voptions.cc +++ b/voptions.cc @@ -20,76 +20,107 @@ #include "voptions.h" -VOptions::VOptions(VWelcome* tvwelcome) +VOptions::VOptions(View* tparent, const char* title, const OPTIONDATA* toptionData, const int tnumOptions) { - vwelcome = tvwelcome; viewman = ViewMan::getInstance(); - create(530, 85+(NUM_OPTIONS*30)); - if (Video::getInstance()->getFormat() == Video::PAL) - { - setScreenPos(104, 130); - } - else - { - setScreenPos(94, 70); - } + parent = tparent; + optionData = toptionData; + numOptions = tnumOptions; + + create(530, 85 + (numOptions * 30)); setBackgroundColour(Colour::VIEWBACKGROUND); setTitleBarOn(1); setTitleBarColour(Colour::TITLEBARBACKGROUND); - setTitleText(tr("Options")); + setTitleText(title); int fontHeight = surface->getFontHeight(); - UINT i; - for (i = 0; i < numOptions; i++) - { - optionBox[i].setSurface(surface); - optionBox[i].setSurfaceOffset(346, 45 + (i * 30)); - optionBox[i].setDimensions(150, fontHeight); - for (UINT j = 0; j < optionData[i].optionCount; j++) - { - Log::getInstance()->log("Options", Log::DEBUG, "Add option: %s", optionData[i].options[j]); - optionBox[i].addOption(tr((char*)optionData[i].options[j])); - } - } + optionBoxes = new WOptionBox[numOptions]; + UINT i, j; char* config; vdr = VDR::getInstance(); + // After setup, save all current indexes + optionsAtStart = new int[numOptions]; for (i = 0; i < numOptions; i++) { - optionBox[i].setSelected(tr((char*)optionData[i].options[optionData[i].defaultOption])); + optionBoxes[i].setSurface(surface); + optionBoxes[i].setSurfaceOffset(346, 45 + (i * 30)); + optionBoxes[i].setDimensions(150, fontHeight); + + if (optionData[i].optionType == OPTIONTYPE_TEXT) + { + for (j = 0; j < optionData[i].optionCount; j++) + { + Log::getInstance()->log("Options", Log::DEBUG, "Add option: %s", optionData[i].options[j]); + optionBoxes[i].addOption(tr((char*)optionData[i].options[j])); + } + + // Set the built in default + optionBoxes[i].setSelected(tr((char*)optionData[i].options[optionData[i].defaultOption])); + } + else + { + // int mode + optionBoxes[i].setIntMode(optionData[i].startInt, optionData[i].optionCount); + optionBoxes[i].setSelected(optionData[i].defaultOption); + } + + // Now see if there is a config option for it config = vdr->configLoad(optionData[i].configSection, optionData[i].configParam); if (config) { - for (UINT j = 0; j < optionData[i].optionCount; j++) + if (optionData[i].optionType == OPTIONTYPE_TEXT) { - if (!strcasecmp(config, optionData[i].options[j])) + for (j = 0; j < optionData[i].optionCount; j++) { - optionBox[i].setSelected(tr((char*)optionData[i].options[j])); + if (!strcasecmp(config, optionData[i].options[j])) + { + optionBoxes[i].setSelected(tr((char*)optionData[i].options[j])); + } } } + else + { + optionBoxes[i].setSelected(atoi(config)); + } delete[] config; } + + // After setup, save initial option + optionsAtStart[i] = optionBoxes[i].getSelectedIndex(); } - // After setup, save all current indexes - optionsAtStart = new int[numOptions]; + selectedOption = 0; + optionBoxes[0].setActive(1); - for (i = 0; i < numOptions; i++) + int voff = 0; + if ((numOptions < 8) && (numOptions >= 4)) + { + voff = (8 - numOptions) * 10; + } + else if (numOptions < 4) { - optionsAtStart[i] = optionBox[i].getSelectedIndex(); + voff = 40; //(4 * 10) } - selectedOption = 0; - optionBox[0].setActive(1); + if (Video::getInstance()->getFormat() == Video::PAL) + { + setScreenPos(104, 130 + voff); + } + else + { + setScreenPos(94, 70 + voff); + } } VOptions::~VOptions() { delete[] optionsAtStart; + delete[] optionBoxes; } void VOptions::draw() @@ -118,7 +149,7 @@ void VOptions::draw() wsy.nextSymbol = WSymbol::RIGHTARROW; wsy.setSurfaceOffset(498, 47 + (i * 30)); wsy.draw(); - optionBox[i].draw(); + optionBoxes[i].draw(); } } @@ -131,9 +162,9 @@ int VOptions::handleCommand(int command) { if (selectedOption > 0) { - optionBox[selectedOption].setActive(0); + optionBoxes[selectedOption].setActive(0); --selectedOption; - optionBox[selectedOption].setActive(1); + optionBoxes[selectedOption].setActive(1); draw(); viewman->updateView(this); } @@ -144,9 +175,9 @@ int VOptions::handleCommand(int command) { if (selectedOption < (numOptions - 1)) { - optionBox[selectedOption].setActive(0); + optionBoxes[selectedOption].setActive(0); ++selectedOption; - optionBox[selectedOption].setActive(1); + optionBoxes[selectedOption].setActive(1); draw(); viewman->updateView(this); } @@ -155,7 +186,7 @@ int VOptions::handleCommand(int command) case Remote::DF_LEFT: case Remote::LEFT: { - optionBox[selectedOption].left(); + optionBoxes[selectedOption].left(); draw(); viewman->updateView(this); return 2; @@ -163,7 +194,7 @@ int VOptions::handleCommand(int command) case Remote::DF_RIGHT: case Remote::RIGHT: { - optionBox[selectedOption].right(); + optionBoxes[selectedOption].right(); draw(); viewman->updateView(this); return 2; @@ -171,11 +202,23 @@ int VOptions::handleCommand(int command) case Remote::BACK: { doSave(); - return 4; + + // Instead of returning 4 here which would delete this view + // before the doSave message is processed, let the message queue + // do the doSave then this close message. That will make the options menu + // disappear before this view + + Message* m = new Message(); + m->message = Message::CLOSE_ME; + m->from = this; + m->to = viewman; + viewman->postMessage(m); + + return 2; } case Remote::OK: { - optionBox[selectedOption].cycle(); + optionBoxes[selectedOption].cycle(); draw(); viewman->updateView(this); } @@ -186,84 +229,50 @@ int VOptions::handleCommand(int command) void VOptions::doSave() { + UINT i; int result[numOptions]; - for (UINT i = 0; i < numOptions; i++) + for (i = 0; i < numOptions; i++) { - result[i] = optionBox[i].getSelectedIndex(); + result[i] = optionBoxes[i].getSelectedIndex(); if (result[i] != optionsAtStart[i]) { Log::getInstance()->log("Options", Log::DEBUG, "Option %i has changed", i); - vdr->configSave(optionData[i].configSection, optionData[i].configParam, - optionData[i].options[result[i]]); + if (optionData[i].optionType == OPTIONTYPE_TEXT) + { + vdr->configSave(optionData[i].configSection, optionData[i].configParam, + optionData[i].options[result[i]]); + } + else + { + char buffer[20]; + sprintf(buffer, "%i", result[i]); + vdr->configSave(optionData[i].configSection, optionData[i].configParam, + buffer); + } } } - // Apply changes - Video* video = Video::getInstance(); - - if (result[0] != optionsAtStart[0]) - { - if (result[0] == 1) - { - Log::getInstance()->log("Options", Log::DEBUG, "Setting New Remote"); - Remote::getInstance()->setRemoteType(Remote::NEWREMOTE); - } - else - { - Log::getInstance()->log("Options", Log::DEBUG, "Setting Old Remote"); - Remote::getInstance()->setRemoteType(Remote::OLDREMOTE); - } - } + // Save a vector of option IDs that have changed - if (result[1] != optionsAtStart[1]) - { - I18n::initialize(); - vwelcome->redrawLang(); - } + map* optionChanges = new map; - if (result[2] != optionsAtStart[2]) + for (i = 0; i < numOptions; i++) { - if (result[2] == 1) - { - Log::getInstance()->log("Options", Log::DEBUG, "Setting S-Video"); - video->setConnection(Video::SVIDEO); - } - else + if (result[i] != optionsAtStart[i]) { - Log::getInstance()->log("Options", Log::DEBUG, "Setting RGB/Composite"); - video->setConnection(Video::COMPOSITERGB); + (*optionChanges)[optionData[i].id] = result[i]; } } - if (result[3] != optionsAtStart[3]) - { - if (result[3] == 1) - { - Log::getInstance()->log("Options", Log::DEBUG, "Setting 16:9 TV"); - video->setTVsize(Video::ASPECT16X9); - } - else - { - Log::getInstance()->log("Options", Log::DEBUG, "Setting 4:3 TV"); - video->setTVsize(Video::ASPECT4X3); - } - } + // Send it to parent for changes to be applied + Message* m = new Message(); + m->message = Message::CHANGED_OPTIONS; + m->to = parent; + m->parameter = (ULONG)optionChanges; + viewman->postMessage(m); - if (result[4] != optionsAtStart[4]) - { - if (result[4] == 1) - { - Log::getInstance()->log("Options", Log::DEBUG, "Setting letterbox"); - video->setMode(Video::LETTERBOX); - } - else - { - Log::getInstance()->log("Options", Log::DEBUG, "Setting chop-sides"); - video->setMode(Video::NORMAL); - } - } } diff --git a/voptions.h b/voptions.h index 790ac38..0d1481c 100644 --- a/voptions.h +++ b/voptions.h @@ -21,8 +21,8 @@ #ifndef VOPTIONS_H #define VOPTIONS_H +#include #include "view.h" -#include "remote.h" #include "viewman.h" #include "vdr.h" #include "colour.h" @@ -30,45 +30,24 @@ #include "woptionbox.h" #include "wsymbol.h" #include "i18n.h" -#include "vwelcome.h" -#define NUM_OPTIONS 8 typedef struct { + UINT id; // Used for working out what has changed at the end char *title; // Name of the option char *configSection; // Which section of the config file char *configParam; // Parameter name in the config file + UINT optionType; // 1 for text, 2 for int UINT optionCount; // How many choices? - UINT defaultOption; // Serial of the default choice (base 0) - const char * const * options; // Text for the options + UINT defaultOption; // Serial of the default choice (base 0), or actual option in int mode + int startInt; // Starting int for int mode + const char * const * options; // Text for the options (null for int mode) } OPTIONDATA; -static const char* options0[] = {"Old", "New"}; -static const char* options1[] = {"RGB+composite", "S-Video"}; -static const char* options2[] = {"4:3", "16:9"}; -static const char* options3[] = {"Chop sides", "Letterbox"}; -static const char* options4[] = {"On", "Off", "Last state"}; -static const char* options5[] = {"All", "FTA only"}; -static const char* options6[] = {"0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "99"}; - -const static OPTIONDATA optionData[NUM_OPTIONS] = -{ - {"Remote control type", "General", "Remote type", 2, 0, options0 }, - {"Language", "General", "Language", I18n::NumLanguages, 0, I18n::Languages }, - {"TV connection type", "TV", "Connection", 2, 0, options1 }, - {"TV aspect ratio", "TV", "Aspect", 2, 0, options2 }, - {"16:9 on 4:3 display mode", "TV", "Widemode", 2, 0, options3 }, - {"Power state after bootup", "General", "Power After Boot", 3, 0, options4 }, - {"Display channels", "General", "Channels", 2, 0, options5 }, - {"VDR-Pri 0=OK !See forums!","General", "Live priority", 21, 0, options6 } -}; - -class VWelcome; - class VOptions : public View { public: - VOptions(VWelcome* tvwelcome); + VOptions(View* tparent, const char* title, const OPTIONDATA* toptionData, const int tnumOptions); ~VOptions(); int handleCommand(int command); @@ -77,13 +56,14 @@ class VOptions : public View private: void doSave(); - const static UINT numOptions = NUM_OPTIONS; + const OPTIONDATA* optionData; + UINT numOptions; UINT selectedOption; - WOptionBox optionBox[numOptions]; + WOptionBox* optionBoxes; VDR* vdr; int* optionsAtStart; ViewMan* viewman; - VWelcome* vwelcome; + View* parent; }; #endif diff --git a/vwelcome.cc b/vwelcome.cc index cf2e745..b495bae 100644 --- a/vwelcome.cc +++ b/vwelcome.cc @@ -20,8 +20,12 @@ #include "vwelcome.h" +VWelcome* VWelcome::instance = NULL; + VWelcome::VWelcome() { + instance = this; + viewman = ViewMan::getInstance(); clockRegion.x = 400; @@ -55,9 +59,15 @@ VWelcome::VWelcome() VWelcome::~VWelcome() { + instance = NULL; Timers::getInstance()->cancelTimer(this, 1); } +VWelcome* VWelcome::getInstance() +{ + return instance; +} + void VWelcome::setup() { sl.clear(); @@ -279,10 +289,10 @@ void VWelcome::doTimersList() void VWelcome::doOptions() { - VOptions* voptions = new VOptions(this); - voptions->draw(); - viewman->add(voptions); - viewman->updateView(voptions); + VOptionsMenu* voptionsmenu = new VOptionsMenu(); + voptionsmenu->draw(); + viewman->add(voptionsmenu); + viewman->updateView(voptionsmenu); } void VWelcome::redrawLang() diff --git a/vwelcome.h b/vwelcome.h index 4993ba5..59ac71b 100644 --- a/vwelcome.h +++ b/vwelcome.h @@ -38,15 +38,18 @@ #include "message.h" #include "colour.h" #include "video.h" -#include "voptions.h" +#include "voptionsmenu.h" #include "i18n.h" #include "timers.h" +// FIXME - take out singleton when broadcast messages exist + class VWelcome : public View, public TimerReceiver { public: VWelcome(); ~VWelcome(); + static VWelcome* getInstance(); void setup(); int handleCommand(int command); @@ -55,6 +58,8 @@ class VWelcome : public View, public TimerReceiver void redrawLang(); private: + static VWelcome* instance; + WSelectList sl; WJpeg jpeg; diff --git a/wbutton.cc b/wbutton.cc index 194d49e..5e7c69c 100644 --- a/wbutton.cc +++ b/wbutton.cc @@ -27,6 +27,7 @@ WButton::WButton() mytext = NULL; active = 0; + tag = 0; } WButton::~WButton() @@ -59,3 +60,13 @@ void WButton::draw() drawText(mytext, 0, 0, Colour::LIGHTTEXT); } } + +void WButton::setTag(int newTag) +{ + tag = newTag; +} + +int WButton::getTag() +{ + return tag; +} diff --git a/wbutton.h b/wbutton.h index cbe1cbd..a76f77e 100644 --- a/wbutton.h +++ b/wbutton.h @@ -36,11 +36,14 @@ class WButton : public Widget void setText(char* text); void setActive(UCHAR tactive); void draw(); + void setTag(int tag); + int getTag(); private: UCHAR active; char* mytext; + int tag; }; #endif diff --git a/woptionbox.cc b/woptionbox.cc index 70efeb8..65c3b4f 100644 --- a/woptionbox.cc +++ b/woptionbox.cc @@ -26,6 +26,8 @@ WOptionBox::WOptionBox() options = NULL; active = 0; currentOption = 0; + + mode = MODE_TEXT; } WOptionBox::~WOptionBox() @@ -41,14 +43,8 @@ void WOptionBox::addOption(const char* takeText) int length = strlen(takeText); char* newOption = new char[length + 1]; strcpy(newOption, takeText); - - Log::getInstance()->log("Temp", Log::DEBUG, "About to realloc, num Options=%i, current options = %p, new text = %s", numOptions, options, newOption); - options = (char**)realloc(options, (numOptions+1) * sizeof(char*)); - Log::getInstance()->log("Temp", Log::DEBUG, ""); - options[numOptions] = newOption; - numOptions++; } @@ -108,12 +104,46 @@ void WOptionBox::setSelected(const char* toSelect) currentOption = 0; } -char* WOptionBox::getSelected() +//char* WOptionBox::getSelected() +//{ +// return options[currentOption]; +//} + +int WOptionBox::getSelectedIndex() { - return options[currentOption]; + if (mode == MODE_TEXT) + { + return currentOption; + } + else + { + return atoi(options[currentOption]); + } } -int WOptionBox::getSelectedIndex() +void WOptionBox::setIntMode(int startInt, int setNumOptions) +{ + mode = MODE_INT; + + int cInt; + char buffer[20]; + + for (cInt = startInt; cInt < (startInt + setNumOptions); cInt++) + { + sprintf(buffer, "%i", cInt); + addOption(buffer); + } +} + +void WOptionBox::setSelected(int toSelect) { - return currentOption; + for(UINT i = 0; i < numOptions; i++) + { + if (atoi(options[i]) == toSelect) + { + currentOption = i; + return; + } + } + currentOption = 0; } diff --git a/woptionbox.h b/woptionbox.h index 433a7f6..6ef0514 100644 --- a/woptionbox.h +++ b/woptionbox.h @@ -32,9 +32,14 @@ class WOptionBox : public Widget public: WOptionBox(); ~WOptionBox(); + + // Int mode stuff + void setIntMode(int start, int numOptions); + void setSelected(int newSelection); + void addOption(const char* newOption); void setSelected(const char* selectedOption); - char* getSelected(); +// char* getSelected(); void setActive(UCHAR tactive); void left(); void right(); @@ -42,11 +47,16 @@ class WOptionBox : public Widget void draw(); int getSelectedIndex(); + const static int MODE_TEXT = 1; + const static int MODE_INT = 2; + private: UCHAR active; UINT numOptions; char** options; UINT currentOption; + + int mode; }; #endif -- 2.39.2 From beea3931a89fb5c93bd1695120e1803b20e87ca6 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sun, 26 Feb 2006 01:39:30 +0000 Subject: [PATCH 16/16] Options menu rearrangement, set timer from EPG --- Makefile | 2 +- command.cc | 2 + vdr.cc | 32 ++++++ vdr.h | 2 + vepg.cc | 19 ++-- vepg.h | 1 + vepgsettimer.cc | 257 ++++++++++++++++++++++++++++++++++++++++++++ vepgsettimer.h | 70 ++++++++++++ view.h | 2 +- vinfo.cc | 3 +- voptionsmenu.cc | 272 +++++++++++++++++++++++++++++++++++++++++++++++ voptionsmenu.h | 59 ++++++++++ vrecordinglist.h | 1 + 13 files changed, 710 insertions(+), 12 deletions(-) create mode 100644 vepgsettimer.cc create mode 100644 vepgsettimer.h create mode 100644 voptionsmenu.cc create mode 100644 voptionsmenu.h diff --git a/Makefile b/Makefile index b2c3dc6..f825f83 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ OBJECTS = main.o command.o log.o remote.o led.o mtd.o video.o audio.o tcp.o dire player.o demuxer.o stream.o vfeed.o afeed.o afeedr.o osd.o surface.o viewman.o vdr.o dsock.o box.o \ recording.o channel.o message.o playervideo.o messagequeue.o rectimer.o vtimeredit.o voptionsmenu.o \ view.o vinfo.o vwallpaper.o vvolume.o vrecordinglist.o vlivebanner.o vmute.o vtimerlist.o \ - vrecordingmenu.o vquestion.o vchannellist.o vwelcome.o vvideolive.o vvideorec.o \ + vrecordingmenu.o vquestion.o vchannellist.o vwelcome.o vvideolive.o vvideorec.o vepgsettimer.o \ vchannelselect.o vserverselect.o colour.o vconnect.o voptions.o vepg.o region.o \ widget.o wselectlist.o wjpeg.o wsymbol.o wbutton.o woptionbox.o wtextbox.o i18n.o timers.o \ fonts/helvB24.o fonts/helvB18.o diff --git a/command.cc b/command.cc index 815309a..7ece424 100644 --- a/command.cc +++ b/command.cc @@ -557,4 +557,6 @@ void Command::doJustConnected(VConnect* vconnect) vw->draw(); viewman->add(vw); viewman->updateView(vw); + + // Enter pre-keys here } diff --git a/vdr.cc b/vdr.cc index 1b3b7aa..3f8c7e7 100644 --- a/vdr.cc +++ b/vdr.cc @@ -892,3 +892,35 @@ RecTimerList* VDR::getRecTimersList() return recTimerList; } + +ULONG VDR::setEventTimer(char* timerString) +{ + if (!connected) return false; + + unsigned long totalLength = 8 + strlen(timerString) + 1; + UCHAR buffer[totalLength]; + + *(unsigned long*)&buffer[0] = htonl(totalLength - 4); + *(unsigned long*)&buffer[4] = htonl(VDR_SETTIMER); + strcpy((char*)&buffer[8], timerString); + + pthread_mutex_lock(&mutex); + unsigned int a = tcp->sendPacket(buffer, totalLength); + if (a != totalLength) + { + pthread_mutex_unlock(&mutex); + return 0; + } + + if (!getPacket()) + { + pthread_mutex_unlock(&mutex); + return 0; + } + + ULONG toReturn = extractULONG(); + freePacket(); + pthread_mutex_unlock(&mutex); + + return toReturn; +} diff --git a/vdr.h b/vdr.h index 4e36245..5622fd0 100644 --- a/vdr.h +++ b/vdr.h @@ -127,6 +127,7 @@ class VDR EventList* getChannelSchedule(ULONG number, time_t start, ULONG duration); int configSave(char* section, char* key, const char* value); char* configLoad(char* section, char* key); + ULONG setEventTimer(char* timerString); RecTimerList* getRecTimersList(); @@ -164,6 +165,7 @@ class VDR const static ULONG VDR_CONFIGLOAD = 12; const static ULONG VDR_RESCANRECORDING = 13; const static ULONG VDR_GETTIMERS = 14; + const static ULONG VDR_SETTIMER = 15; int getPacket(); void freePacket(); diff --git a/vepg.cc b/vepg.cc index e00bc3f..0f7ae5a 100644 --- a/vepg.cc +++ b/vepg.cc @@ -163,7 +163,7 @@ void VEpg::setInfo(Event* event) { time_t t; struct tm* btime; // to hold programme start and end time - char* timeString = new char[9]; // to hold programme start and end time + char timeString[9]; // to hold programme start and end time int length = strlen(event->title); // calculate length of programme title string char* title = new char[length + 15]; // create string to hold start time, end time and programme title btime = localtime((time_t*)&event->time); //get programme start time @@ -180,9 +180,8 @@ void VEpg::setInfo(Event* event) strcpy(info, event->description); progInfo.setText(info); // show programme detail string // destroy dynamically allocated memory - delete info; - delete title; - delete timeString; + delete[] info; + delete[] title; } void VEpg::draw() @@ -233,8 +232,8 @@ void VEpg::draw() drawText(tr("Guide / Back: Close"), keyx + 292 , keyy + 5, Colour::LIGHTTEXT); surface->fillblt(keyx + 290, keyy + Surface::getFontHeight() + 8, 180, Surface::getFontHeight() + 2, surface->rgba( 180, 180, 180, 255)); -// Colour red = Colour(130, 0, 0); -// drawText(tr("Rec: Set timer"), keyx + 292, keyy + Surface::getFontHeight() + 9, red); + Colour red = Colour(130, 0, 0); + drawText(tr("Rec: Set timer"), keyx + 292, keyy + Surface::getFontHeight() + 9, red); surface->fillblt(keyx + 474, keyy + 4, 128, Surface::getFontHeight() + 2, surface->rgba( 180, 180, 180, 255)); w.nextSymbol = WSymbol::PLAY; @@ -341,9 +340,11 @@ int VEpg::handleCommand(int command) } case Remote::RECORD: { - Log::getInstance()->log("VEPG", Log::DEBUG, "ID %lu TIME %lu DURATION %lu TITLE %s\n", thisEvent.id, thisEvent.time, thisEvent.duration, thisEvent.title); - - //TODO FIXME + Log::getInstance()->log("VEPG", Log::DEBUG, "ID %lu TIME %lu DURATION %lu TITLE %s", thisEvent.id, thisEvent.time, thisEvent.duration, thisEvent.title); + VEpgSetTimer* vs = new VEpgSetTimer(&thisEvent, (*chanList)[chanListbox.getCurrentOption()]); + vs->draw(); + viewman->add(vs); + viewman->updateView(vs); return 2; } case Remote::PLAY: diff --git a/vepg.h b/vepg.h index 4d48c50..a00da97 100644 --- a/vepg.h +++ b/vepg.h @@ -39,6 +39,7 @@ #include "event.h" #include "message.h" #include "vvideolive.h" +#include "vepgsettimer.h" class VVideoLive; diff --git a/vepgsettimer.cc b/vepgsettimer.cc new file mode 100644 index 0000000..7fdf590 --- /dev/null +++ b/vepgsettimer.cc @@ -0,0 +1,257 @@ +/* + 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 "vepgsettimer.h" + +VEpgSetTimer::VEpgSetTimer(Event* tevent, Channel* tchannel) +{ + viewman = ViewMan::getInstance(); + vdr = VDR::getInstance(); + logger = Log::getInstance(); + + event = tevent; + channel = tchannel; + + create(400, 240); + if (Video::getInstance()->getFormat() == Video::PAL) + { + setScreenPos(150, 170); + } + else + { + setScreenPos(140, 140); + } + + setBackgroundColour(Colour::VIEWBACKGROUND); + setTitleBarOn(1); + setTitleBarColour(Colour::TITLEBARBACKGROUND); + setBorderOn(true); + setTitleText(tr("Set Timer")); + + buttonYes.setSurface(surface); + buttonNo.setSurface(surface); + buttonYes.setSurfaceOffset(80, 40 + (7 * surface->getFontHeight())); + buttonNo.setSurfaceOffset(220, 40 + (7 * surface->getFontHeight())); + + buttonYes.setText(tr("Yes")); + buttonNo.setText(tr("No")); + buttonYes.setActive(1); + selectedOption = YES; + + logger->log("VEPGST", Log::DEBUG, "Title: %s", event->title); + logger->log("VEPGST", Log::DEBUG, "Time: %lu", event->time); + logger->log("VEPGST", Log::DEBUG, "Duration: %lu", event->duration); + logger->log("VEPGST", Log::DEBUG, "Channel: %i", channel->number); +} + +VEpgSetTimer::~VEpgSetTimer() +{ +} + +char* VEpgSetTimer::genTimerString() +{ + // Allocate to return + char* timerString = new char[1024]; + + // Other + struct tm* btime; + int flags; + char dateString[20]; + char startMargin[10]; + time_t startTime; + char startString[10]; + char endMargin[10]; + time_t endTime; + char endString[10]; + char priority[10]; + char lifetime[10]; + char* eventTitle; + + flags = 1; // hard coded active timer flag + + btime = localtime((time_t*)&event->time); + strftime(dateString, 19, "%Y-%m-%d", btime); + + char* startMarginConfig = vdr->configLoad("Timers", "Start margin"); + if (startMarginConfig) + { + strncpy(startMargin, startMarginConfig, 9); + delete[] startMarginConfig; + } + else strcpy(startMargin, "5"); + + startTime = event->time - (atoi(startMargin) * 60); + btime = localtime(&startTime); + strftime(startString, 9, "%H%M", btime); + + char* endMarginConfig = vdr->configLoad("Timers", "End margin"); + if (endMarginConfig) + { + strncpy(endMargin, endMarginConfig, 9); + delete[] endMarginConfig; + } + else strcpy(endMargin, "5"); + + endTime = event->time + event->duration + (atoi(endMargin) * 60); + btime = localtime(&endTime); + strftime(endString, 9, "%H%M", btime); + + char* priorityConfig = vdr->configLoad("Timers", "Priority"); + if (priorityConfig) + { + strncpy(priority, priorityConfig, 9); + delete[] priorityConfig; + } + else strcpy(priority, "99"); + + char* lifetimeConfig = vdr->configLoad("Timers", "Lifetime"); + if (lifetimeConfig) + { + strncpy(lifetime, lifetimeConfig, 9); + delete[] lifetimeConfig; + } + else strcpy(lifetime, "99"); + + eventTitle = new char[strlen(event->title) + 1]; + strcpy(eventTitle, event->title); + for(UINT i=0; i < strlen(eventTitle); i++) if (eventTitle[i] == ':') eventTitle[i] = '|'; + + snprintf(timerString, 1023, "%i:%lu:%s:%s:%s:%s:%s:%s:", + flags, channel->number, dateString, + startString, endString, + priority, lifetime, eventTitle); + + delete[] eventTitle; + + return timerString; +} + +void VEpgSetTimer::swap() +{ + if (selectedOption == NO) + { + selectedOption = YES; + buttonYes.setActive(1); + buttonNo.setActive(0); + } + else if (selectedOption == YES) + { + selectedOption = NO; + buttonYes.setActive(0); + buttonNo.setActive(1); + } +} + +void VEpgSetTimer::draw() +{ + View::draw(); + drawPara(event->title, 10, 40, Colour::LIGHTTEXT); + drawText(channel->name, 10, 40 + (2 * surface->getFontHeight()), Colour::LIGHTTEXT); + + char fullString[20]; + time_t t; + struct tm* btime; + char timeString[10]; + btime = localtime((time_t*)&event->time); + strftime(timeString, 9, "%0H:%0M - ", btime); // and format it as hh:mm - + strcpy(fullString, timeString); // put it in our buffer + t = event->time + event->duration; //get programme end time + btime = localtime(&t); + strftime(timeString, 9, "%0H:%0M", btime); // and format it as hh:mm - + strcat(fullString, timeString); // put it in our buffer + + drawText(fullString, 10, 40 + (3 * surface->getFontHeight()), Colour::LIGHTTEXT); + drawText(tr("Create this timer?"), 10, 40 + (5 * surface->getFontHeight()), Colour::LIGHTTEXT); + + buttonYes.draw(); + buttonNo.draw(); +} + +int VEpgSetTimer::handleCommand(int command) +{ + switch(command) + { + case Remote::DF_LEFT: + case Remote::LEFT: + { + swap(); + draw(); + ViewMan::getInstance()->updateView(this); + return 2; + } + case Remote::DF_RIGHT: + case Remote::RIGHT: + { + swap(); + draw(); + ViewMan::getInstance()->updateView(this); + return 2; + } + case Remote::BACK: + { + return 4; + } + case Remote::OK: + { + if (selectedOption != YES) return 4; + doit(); + return 4; + } + } + + return 1; +} + + +void VEpgSetTimer::doit() +{ + char* timerString = genTimerString(); + logger->log("VEPGST", Log::DEBUG, "%s", timerString); + + ULONG ret = vdr->setEventTimer(timerString); + delete[] timerString; + + if (ret == 0) logger->log("VEPGST", Log::DEBUG, "Success"); + else if (ret == 1) logger->log("VEPGST", Log::DEBUG, "Fail: Timer already set for this event"); + else if (ret == 2) logger->log("VEPGST", Log::DEBUG, "Fail: General failure setting timer"); + + VInfo* vi = new VInfo(); + vi->create(400, 150); + vi->setExitable(); + vi->setBorderOn(1); + vi->setTitleBarOn(0); + + if (Video::getInstance()->getFormat() == Video::PAL) + vi->setScreenPos(170, 200); + else + vi->setScreenPos(160, 150); + + if (ret == 0) vi->setOneLiner(tr("Timer set successfully")); + else if (ret == 1) vi->setOneLiner(tr("There is already a timer for this event")); + else if (ret == 2) vi->setOneLiner(tr("Failure setting timer")); + vi->draw(); + + Message* m = new Message(); + m->message = Message::ADD_VIEW; + m->to = viewman; + m->parameter = (ULONG)vi; + + viewman->postMessage(m); +} diff --git a/vepgsettimer.h b/vepgsettimer.h new file mode 100644 index 0000000..01f05d4 --- /dev/null +++ b/vepgsettimer.h @@ -0,0 +1,70 @@ +/* + 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 VEPGSETTIMER_H +#define VEPGSETTIMER_H + +#include +#include "video.h" +#include "view.h" +#include "remote.h" +#include "viewman.h" +#include "vdr.h" +#include "event.h" +#include "channel.h" +#include "i18n.h" +#include "wbutton.h" +#include "vinfo.h" +#include "message.h" + +class VEpgSetTimer : public View +{ + public: + VEpgSetTimer(Event* event, Channel* channel); + ~VEpgSetTimer(); + + int handleCommand(int command); + void draw(); + + private: + Log* logger; + ViewMan* viewman; + VDR* vdr; + + Event* event; + Channel* channel; + + // This lot is borrowed from VQuestion + // A shame not to use it, but this view will probably get + // a whole load more controls on it some day + const static UCHAR NO = 0; + const static UCHAR YES = 1; + + UCHAR selectedOption; + + WButton buttonYes; + WButton buttonNo; + + char* genTimerString(); + void swap(); + void doit(); +}; + +#endif diff --git a/view.h b/view.h index 34bdca6..4da134f 100644 --- a/view.h +++ b/view.h @@ -52,11 +52,11 @@ class View : public Box Colour backgroundColour; char* titleText; - UCHAR titleBarOn; UCHAR borderOn; protected: Colour titleBarColour; + UCHAR titleBarOn; }; #endif diff --git a/vinfo.cc b/vinfo.cc index a687c73..3760da7 100644 --- a/vinfo.cc +++ b/vinfo.cc @@ -75,7 +75,8 @@ void VInfo::draw() if (mainTextType == ONELINER) { - drawTextCentre(mainText, area.w / 2, 75, Colour::LIGHTTEXT); + if (titleBarOn) drawTextCentre(mainText, area.w / 2, 75, Colour::LIGHTTEXT); + else drawTextCentre(mainText, area.w / 2, 55, Colour::LIGHTTEXT); } } } diff --git a/voptionsmenu.cc b/voptionsmenu.cc new file mode 100644 index 0000000..f0ef93b --- /dev/null +++ b/voptionsmenu.cc @@ -0,0 +1,272 @@ +/* + 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 "voptionsmenu.h" + +VOptionsMenu::VOptionsMenu() +{ + viewman = ViewMan::getInstance(); + + create(460, 190); + if (Video::getInstance()->getFormat() == Video::PAL) + { + setScreenPos(140, 170); + } + else + { + setScreenPos(130, 140); + } + + setBackgroundColour(Colour::VIEWBACKGROUND); + setTitleBarOn(1); + setTitleBarColour(Colour::TITLEBARBACKGROUND); + setTitleText(tr("Options")); + + int fontHeight = surface->getFontHeight(); + + // Build gui + WButton* wb; + + wb = new WButton(); + wb->setText("General"); + wb->setSurface(surface); + wb->setSurfaceOffset(160, 70); + wb->setDimensions(140, fontHeight); + wb->setTag(1); + buttons.push_back(wb); + + wb = new WButton(); + wb->setText("Timers"); + wb->setSurface(surface); + wb->setSurfaceOffset(160, 110); + wb->setDimensions(140, fontHeight); + wb->setTag(2); + buttons.push_back(wb); + + selectedButton = buttons.begin(); + (*selectedButton)->setActive(1); +} + +VOptionsMenu::~VOptionsMenu() +{ + while (!buttons.empty()) + { + delete buttons.back(); + buttons.pop_back(); + } +} + +void VOptionsMenu::draw() +{ + View::draw(); + + vector::iterator i; + for(i = buttons.begin(); i != buttons.end(); i++) + { + (*i)->draw(); + } +} + +int VOptionsMenu::handleCommand(int command) +{ + switch(command) + { + case Remote::DF_UP: + case Remote::UP: + { + if (selectedButton == buttons.begin()) return 2; + (*selectedButton)->setActive(0); + selectedButton--; + (*selectedButton)->setActive(1); + draw(); // fixme - just draw buttons + viewman->updateView(this); + return 2; + } + case Remote::DF_DOWN: + case Remote::DOWN: + { + if (selectedButton == (buttons.end() - 1)) return 2; + (*selectedButton)->setActive(0); + selectedButton++; + (*selectedButton)->setActive(1); + draw(); // fixme - just draw buttons + viewman->updateView(this); + return 2; + } + case Remote::BACK: + { + return 4; + } + case Remote::OK: + { + switch((*selectedButton)->getTag()) + { + case 1: doGeneral(); break; + case 2: doTimers(); break; + } + return 2; + } + } + + return 1; +} + +void VOptionsMenu::processMessage(Message* m) +{ + if (m->message == Message::CHANGED_OPTIONS) + { + doApplyChanges((map*)m->parameter); + viewman->removeView(this); + } +} + +void VOptionsMenu::doApplyChanges(map* changedOptions) +{ + Video* video = Video::getInstance(); + map::iterator i; + + for(i = changedOptions->begin(); i != changedOptions->end(); i++) + { + printf("I FIRST = %i SECOND = %i\n", i->first, i->second); + + switch(i->first) + { + case 1: + { + if (i->second == 1) + { + Log::getInstance()->log("Options", Log::DEBUG, "Setting New Remote"); + Remote::getInstance()->setRemoteType(Remote::NEWREMOTE); + } + else + { + Log::getInstance()->log("Options", Log::DEBUG, "Setting Old Remote"); + Remote::getInstance()->setRemoteType(Remote::OLDREMOTE); + } + break; + } + case 2: + { + I18n::initialize(); + VWelcome::getInstance()->redrawLang(); + break; + } + case 3: + { + if (i->second == 1) + { + Log::getInstance()->log("Options", Log::DEBUG, "Setting S-Video"); + video->setConnection(Video::SVIDEO); + } + else + { + Log::getInstance()->log("Options", Log::DEBUG, "Setting RGB/Composite"); + video->setConnection(Video::COMPOSITERGB); + } + break; + } + case 4: + { + if (i->second == 1) + { + Log::getInstance()->log("Options", Log::DEBUG, "Setting 16:9 TV"); + video->setTVsize(Video::ASPECT16X9); + } + else + { + Log::getInstance()->log("Options", Log::DEBUG, "Setting 4:3 TV"); + video->setTVsize(Video::ASPECT4X3); + } + break; + } + case 5: + { + if (i->second == 1) + { + Log::getInstance()->log("Options", Log::DEBUG, "Setting letterbox"); + video->setMode(Video::LETTERBOX); + } + else + { + Log::getInstance()->log("Options", Log::DEBUG, "Setting chop-sides"); + video->setMode(Video::NORMAL); + } + break; + } + } + } + + delete changedOptions; + +} + +void VOptionsMenu::doGeneral() +{ + static const int numOptions = 8; + + static const char* options1[] = {"Old", "New"}; + static const char* options3[] = {"RGB+composite", "S-Video"}; + static const char* options4[] = {"4:3", "16:9"}; + static const char* options5[] = {"Chop sides", "Letterbox"}; + static const char* options6[] = {"On", "Off", "Last state"}; + static const char* options7[] = {"All", "FTA only"}; + + const static OPTIONDATA optionData[numOptions] = + { + {1, "Remote control type", "General", "Remote type", OPTIONTYPE_TEXT, 2, 0, 0, options1 }, + {2, "Language", "General", "Language", OPTIONTYPE_TEXT, I18n::NumLanguages, 0, 0, I18n::Languages }, + {3, "TV connection type", "TV", "Connection", OPTIONTYPE_TEXT, 2, 0, 0, options3 }, + {4, "TV aspect ratio", "TV", "Aspect", OPTIONTYPE_TEXT, 2, 0, 0, options4 }, + {5, "16:9 on 4:3 display mode", "TV", "Widemode", OPTIONTYPE_TEXT, 2, 0, 0, options5 }, + {6, "Power state after bootup", "General", "Power After Boot", OPTIONTYPE_TEXT, 3, 0, 0, options6 }, + {7, "Display channels", "General", "Channels", OPTIONTYPE_TEXT, 2, 0, 0, options7 }, + {8, "VDR-Pri 0=OK !See forums!","General", "Live priority", OPTIONTYPE_INT, 100, 0, 0, NULL } + }; + + // As all the above data is const static, it can be sent to the new View, this stack frame can + // quit and the pointers will all still be valid. I think. (Hope). + + VOptions* v = new VOptions(this, "General Options", optionData, numOptions); + v->draw(); + viewman->add(v); + viewman->updateView(v); +} + + +void VOptionsMenu::doTimers() +{ + static const int numOptions = 4; + + const static OPTIONDATA optionData[numOptions] = + { + {9, "Default start margin (minutes)", "Timers", "Start margin", OPTIONTYPE_INT, 20, 5, 0, NULL }, + {10, "Default end margin (minutes)", "Timers", "End margin", OPTIONTYPE_INT, 20, 5, 0, NULL }, + {11, "Default priority", "Timers", "Priority", OPTIONTYPE_INT, 100, 99, 0, NULL }, + {12, "Default lifetime", "Timers", "Lifetime", OPTIONTYPE_INT, 100, 99, 0, NULL } + }; + + // As all the above data is const static, it can be sent to the new View, this stack frame can + // quit and the pointers will all still be valid. I think. (Hope). + + VOptions* v = new VOptions(this, "Timer Options", optionData, numOptions); + v->draw(); + viewman->add(v); + viewman->updateView(v); +} diff --git a/voptionsmenu.h b/voptionsmenu.h new file mode 100644 index 0000000..fb1cf08 --- /dev/null +++ b/voptionsmenu.h @@ -0,0 +1,59 @@ +/* + 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 VOPTIONSMENU_H +#define VOPTIONSMENU_H + +#include +#include +#include "view.h" +#include "remote.h" +#include "viewman.h" +#include "vdr.h" +#include "colour.h" +#include "video.h" +#include "wbutton.h" +#include "i18n.h" +#include "vwelcome.h" +#include "voptions.h" + +class VOptionsMenu : public View +{ + public: + VOptionsMenu(); + ~VOptionsMenu(); + + int handleCommand(int command); + void processMessage(Message* m); + void draw(); + + private: + void doGeneral(); + void doTimers(); + void doApplyChanges(map* changedOptions); + + VDR* vdr; + ViewMan* viewman; + + vector buttons; + vector::iterator selectedButton; +}; + +#endif diff --git a/vrecordinglist.h b/vrecordinglist.h index 306704f..ac7c823 100644 --- a/vrecordinglist.h +++ b/vrecordinglist.h @@ -23,6 +23,7 @@ #include #include +#include #include #include "view.h" -- 2.39.2