summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2005-05-29 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2005-05-29 18:00:00 +0200
commitf8367110245149a1333e47118c41827288c814c3 (patch)
tree6445577ffff8fab5e188d127170c8a2f2772a194 /menu.c
parentc23522ade253e23b5bf6141d7d7e7335d6abcd1d (diff)
downloadvdr-patch-lnbsharing-f8367110245149a1333e47118c41827288c814c3.tar.gz
vdr-patch-lnbsharing-f8367110245149a1333e47118c41827288c814c3.tar.bz2
Version 1.3.25vdr-1.3.25
- Updated the Estonian OSD texts (thanks to Arthur Konovalov). - Some cable providers don't mark short channel names according to the standard, but rather go their own way and use "name>short name". VDR now splits at this character for cable channels (thanks to Gerhard Steiner for reporting this one). - Added a check for Setup.DiSEqC in cDvbDevice::ProvidesTransponder(), otherwise the EPG scan didn't work on systems that don't use DiSEqC (thanks to Michael Reinelt for reporting this one). - Made the Makefile patch friendlier (thanks to Ludwig Nussel). - Made cOsd::isOpen an integer counter to avoid problems with messages when a cOsdObject uses the raw OSD (thanks to Andreas Regel for reporting this one). - Updated the Danish OSD texts (thanks to Mogens Elneff). - The file 'summary.vdr' has been replaced with 'info.vdr' and now contains the information about a recording, in the same format as the events are stored in 'epg.data' (see man vdr(5) for details). Existing summary files can be converted to the new format by running the Perl script 'summary2info.pl', as in summary2info.pl /video (the parameter given has to be the video directory). If there is no 'info.vdr' file for a recording, an attempt is made to read a 'summary.vdr'. - The "Summary" button in the "Recordings" menu has been renamed to "Info", and the page it brings up now shows the recording's information, much like the EPG event page. Therefore it now no longer uses the skin's SetText() function, but rather the SetRecording() function. Skin plugins may need to adjust that function accordingly (see skinsttng.c, for instance). - The SVDRP command LSTR now lists the recording information in the same tagged format as the LSTE command lists the EPG data. - The audio track menu now contains track descriptions when replaying (provided such descriptions were available in the EPG data when the recording was made, and are stored in the info.vdr file). - Avoiding extra blanks at the end of names of instant recordings. - Removed converting byte order on big endian systems from cDvbOsd::Flush(), which, according to Johannes Stezenbach and Paavo Hartikainen, is wrong. - Added cPlayer::DeviceSetVideoDisplayFormat() (thanks to Marco Schlüßler). - No longer saving the setup in case of a fatal error, to keep the volume level from being set to a wrong value (thanks to Marco Schlüßler). - Fixed a possible hangup when ending a replay session while cIndexFile::CatchUp() is waiting (thanks to Marco Schlüßler). - The SVDRP command DELR no longer deletes recordings that are currently being written to by a timer (thanks to Sascha Volkenandt for pointing out this one). - Pressing the "Play" key in live viewing mode now resumes a previous replay session (thanks to Mirko Dölle). - Now dropping EPG events that have a zero start time or duration (thanks to Oliver Endriss). - No longer stopping Transfer Mode or replay immediately when the Power button is pressed (thanks to Rolf Ahrenberg). - Moved the NPTL and UTF-8 checks after the version and help output (thanks to Andreas Kool for pointing out that 'vdr --version' failed on an UTF-8 system). - Made tChannelID::operator==() inline for better performance (thanks to Georg Acher). - Introduced cListBase::count for better performance (thanks to Georg Acher). - cEvent no longer stores the channelID directly, but rather has a pointer to the schedule it is in. - Now using hash tables to speed up cSchedule::GetEvent() (partially based on a patch from Georg Acher). - Avoiding unnecessary calls to getLength() in libsi/si.c, and avoiding the '& 0xff' in CRC32::crc32() of libsi/util.c (thanks to Georg Acher). - Speeded up deleting duplicate channels. - Fixed listing recordings with empty episode names in the LSTR command (thanks to Stefan Huelswitt for pointing this out). - Added cThread::SetPriority() and using it in cSectionHandler::Action() to reduce the priority of the section handler threads (as suggested by Georg Acher).
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c161
1 files changed, 112 insertions, 49 deletions
diff --git a/menu.c b/menu.c
index 30183df..e36cc65 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 1.348 2005/03/20 15:14:51 kls Exp $
+ * $Id: menu.c 1.349 2005/05/16 13:59:03 kls Exp $
*/
#include "menu.h"
@@ -872,7 +872,6 @@ eOSState cMenuTimers::Summary(void)
cTimer *ti = CurrentTimer();
if (ti && !isempty(ti->Summary()))
return AddSubMenu(new cMenuText(tr("Summary"), ti->Summary()));
- //XXX cSkin::SetRecording()???
return Edit(); // convenience for people not using the Summary feature ;-)
}
@@ -1297,8 +1296,12 @@ eOSState cMenuCommands::ProcessKey(eKeys Key)
if (state == osUnknown) {
switch (Key) {
- case kOk: return Execute();
- default: break;
+ case kRed:
+ case kGreen:
+ case kYellow:
+ case kBlue: return osContinue;
+ case kOk: return Execute();
+ default: break;
}
}
return state;
@@ -1430,6 +1433,63 @@ cOsdObject *CamControl(void)
return NULL;
}
+// --- cMenuRecording --------------------------------------------------------
+
+class cMenuRecording : public cOsdMenu {
+private:
+ const cRecording *recording;
+public:
+ cMenuRecording(const cRecording *Recording);
+ virtual void Display(void);
+ virtual eOSState ProcessKey(eKeys Key);
+};
+
+cMenuRecording::cMenuRecording(const cRecording *Recording)
+:cOsdMenu(tr("Recording"))
+{
+ recording = Recording;
+ if (recording)
+ SetHelp(tr("Play"), tr("Rewind"));
+}
+
+void cMenuRecording::Display(void)
+{
+ cOsdMenu::Display();
+ DisplayMenu()->SetRecording(recording);
+ cStatus::MsgOsdTextItem(recording->Info()->Description());
+}
+
+eOSState cMenuRecording::ProcessKey(eKeys Key)
+{
+ switch (Key) {
+ case kUp|k_Repeat:
+ case kUp:
+ case kDown|k_Repeat:
+ case kDown:
+ case kLeft|k_Repeat:
+ case kLeft:
+ case kRight|k_Repeat:
+ case kRight:
+ DisplayMenu()->Scroll(NORMALKEY(Key) == kUp || NORMALKEY(Key) == kLeft, NORMALKEY(Key) == kLeft || NORMALKEY(Key) == kRight);
+ cStatus::MsgOsdTextItem(NULL, NORMALKEY(Key) == kUp);
+ return osContinue;
+ default: break;
+ }
+
+ eOSState state = cOsdMenu::ProcessKey(Key);
+
+ if (state == osUnknown) {
+ switch (Key) {
+ case kRed: Key = kOk; // will play the recording, even if recording commands are defined
+ case kGreen: cRemote::Put(Key, true);
+ // continue with osBack to close the info menu and process the key
+ case kOk: return osBack;
+ default: break;
+ }
+ }
+ return state;
+}
+
// --- cMenuRecordingItem ----------------------------------------------------
class cMenuRecordingItem : public cOsdItem {
@@ -1530,7 +1590,7 @@ void cMenuRecordings::SetHelpKeys(void)
else {
NewHelpKeys = 2;
cRecording *recording = GetRecording(ri);
- if (recording && recording->Summary())
+ if (recording && recording->Info()->Title())
NewHelpKeys = 3;
}
}
@@ -1539,7 +1599,7 @@ void cMenuRecordings::SetHelpKeys(void)
case 0: SetHelp(NULL); break;
case 1: SetHelp(tr("Open")); break;
case 2:
- case 3: SetHelp(RecordingCommands.Count() ? tr("Commands") : tr("Play"), tr("Rewind"), tr("Delete"), NewHelpKeys == 3 ? tr("Summary") : NULL);
+ case 3: SetHelp(RecordingCommands.Count() ? tr("Commands") : tr("Play"), tr("Rewind"), tr("Delete"), NewHelpKeys == 3 ? tr("Info") : NULL);
}
helpKeys = NewHelpKeys;
}
@@ -1644,15 +1704,15 @@ eOSState cMenuRecordings::Delete(void)
return osContinue;
}
-eOSState cMenuRecordings::Summary(void)
+eOSState cMenuRecordings::Info(void)
{
if (HasSubMenu() || Count() == 0)
return osContinue;
cMenuRecordingItem *ri = (cMenuRecordingItem *)Get(Current());
if (ri && !ri->IsDirectory()) {
cRecording *recording = GetRecording(ri);
- if (recording && recording->Summary() && *recording->Summary())
- return AddSubMenu(new cMenuText(tr("Summary"), recording->Summary()));
+ if (recording && recording->Info()->Title())
+ return AddSubMenu(new cMenuRecording(recording));
}
return osContinue;
}
@@ -1689,7 +1749,7 @@ eOSState cMenuRecordings::ProcessKey(eKeys Key)
case kRed: return (helpKeys > 1 && RecordingCommands.Count()) ? Commands() : Play();
case kGreen: return Rewind();
case kYellow: return Delete();
- case kBlue: return Summary();
+ case kBlue: return Info();
case k1...k9: return Commands(Key);
default: break;
}
@@ -2568,36 +2628,43 @@ eOSState cMenuMain::ProcessKey(eKeys Key)
// --- SetTrackDescriptions --------------------------------------------------
-static void SetTrackDescriptions(void)
+static void SetTrackDescriptions(bool Live)
{
cDevice::PrimaryDevice()->ClrAvailableTracks(true);
- cChannel *Channel = Channels.GetByNumber(cDevice::CurrentChannel());
- if (Channel) {
- cSchedulesLock SchedulesLock;
- const cSchedules *Schedules = cSchedules::Schedules(SchedulesLock);
- if (Schedules) {
- const cSchedule *Schedule = Schedules->GetSchedule(Channel->GetChannelID());
- if (Schedule) {
- const cEvent *Present = Schedule->GetPresentEvent(true);
- if (Present) {
- const cComponents *Components = Present->Components();
- if (Components) {
- int indexAudio = 0;
- int indexDolby = 0;
- for (int i = 0; i < Components->NumComponents(); i++) {
- const tComponent *p = Components->Component(i);
- if (p->stream == 2) {
- if (p->type == 0x05)
- cDevice::PrimaryDevice()->SetAvailableTrack(ttDolby, indexDolby++, 0, NULL, p->description);
- else
- cDevice::PrimaryDevice()->SetAvailableTrack(ttAudio, indexAudio++, 0, NULL, p->description);
- }
- }
- }
+ const cComponents *Components = NULL;
+ cSchedulesLock SchedulesLock;
+ if (Live) {
+ cChannel *Channel = Channels.GetByNumber(cDevice::CurrentChannel());
+ if (Channel) {
+ const cSchedules *Schedules = cSchedules::Schedules(SchedulesLock);
+ if (Schedules) {
+ const cSchedule *Schedule = Schedules->GetSchedule(Channel->GetChannelID());
+ if (Schedule) {
+ const cEvent *Present = Schedule->GetPresentEvent(true);
+ if (Present)
+ Components = Present->Components();
}
}
}
}
+ else if (cReplayControl::LastReplayed()) {
+ cRecording *Recording = Recordings.GetByName(cReplayControl::LastReplayed());
+ if (Recording)
+ Components = Recording->Info()->Components();
+ }
+ if (Components) {
+ int indexAudio = 0;
+ int indexDolby = 0;
+ for (int i = 0; i < Components->NumComponents(); i++) {
+ const tComponent *p = Components->Component(i);
+ if (p->stream == 2) {
+ if (p->type == 0x05)
+ cDevice::PrimaryDevice()->SetAvailableTrack(ttDolby, indexDolby++, 0, NULL, p->description);
+ else
+ cDevice::PrimaryDevice()->SetAvailableTrack(ttAudio, indexAudio++, 0, NULL, p->description);
+ }
+ }
+ }
}
// --- cDisplayChannel -------------------------------------------------------
@@ -2657,7 +2724,7 @@ void cDisplayChannel::DisplayInfo(void)
const cEvent *Present = Schedule->GetPresentEvent(true);
const cEvent *Following = Schedule->GetFollowingEvent(true);
if (Present != lastPresent || Following != lastFollowing) {
- SetTrackDescriptions();
+ SetTrackDescriptions(true);
displayChannel->SetEvents(Present, Following);
cStatus::MsgOsdProgramme(Present ? Present->StartTime() : 0, Present ? Present->Title() : NULL, Present ? Present->ShortText() : NULL, Following ? Following->StartTime() : 0, Following ? Following->Title() : NULL, Following ? Following->ShortText() : NULL);
lastPresent = Present;
@@ -2877,9 +2944,7 @@ cDisplayTracks::cDisplayTracks(void)
:cOsdObject(true)
{
cDevice::PrimaryDevice()->EnsureAudioTrack();
- // Get the actual audio track descriptions from the EPG if we're not replaying:
- if (!cDevice::PrimaryDevice()->Replaying() || cTransferControl::ReceiverDevice())
- SetTrackDescriptions();
+ SetTrackDescriptions(!cDevice::PrimaryDevice()->Replaying() || cTransferControl::ReceiverDevice());
currentDisplayTracks = this;
numTracks = track = 0;
audioChannel = cDevice::PrimaryDevice()->GetAudioChannel();
@@ -2994,6 +3059,11 @@ eOSState cDisplayTracks::ProcessKey(eKeys Key)
cRecordControl::cRecordControl(cDevice *Device, cTimer *Timer, bool Pause)
{
+ // We're going to manipulate an event here, so we need to prevent
+ // others from modifying any EPG data:
+ cSchedulesLock SchedulesLock;
+ cSchedules::Schedules(SchedulesLock);
+
event = NULL;
instantId = NULL;
fileName = NULL;
@@ -3011,16 +3081,9 @@ cRecordControl::cRecordControl(cDevice *Device, cTimer *Timer, bool Pause)
timer->SetRecording(true);
event = timer->Event();
- const char *Title = NULL;
- const char *Subtitle = NULL;
- const char *Summary = NULL;
- if (event || GetEvent()) {
- Title = event->Title();
- Subtitle = event->ShortText();
- Summary = event->Description();
- dsyslog("Title: '%s' Subtitle: '%s'", Title, Subtitle);
- }
- cRecording Recording(timer, Title, Subtitle, Summary);
+ if (event || GetEvent())
+ dsyslog("Title: '%s' Subtitle: '%s'", event->Title(), event->ShortText());
+ cRecording Recording(timer, event);
fileName = strdup(Recording.FileName());
// crude attempt to avoid duplicate recordings:
@@ -3047,7 +3110,7 @@ cRecordControl::cRecordControl(cDevice *Device, cTimer *Timer, bool Pause)
const cChannel *ch = timer->Channel();
recorder = new cRecorder(fileName, ch->Ca(), timer->Priority(), ch->Vpid(), ch->Apids(), ch->Dpids(), ch->Spids());
if (device->AttachReceiver(recorder)) {
- Recording.WriteSummary();
+ Recording.WriteInfo();
cStatus::MsgRecording(device, Recording.Name());
if (!Timer && !cReplayControl::LastReplayed()) // an instant recording, maybe from cRecordControls::PauseLiveVideo()
cReplayControl::SetRecording(fileName, Recording.Name());