summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-08-16 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-08-16 18:00:00 +0200
commited643353b100bee75459c4ef2d0330e7a04e1f2a (patch)
tree8a424eba464677a71309e1125ce4e7acef58607e /menu.c
parent527748826c8d3cfacff8a7ab3fda9551c1182590 (diff)
downloadvdr-patch-lnbsharing-ed643353b100bee75459c4ef2d0330e7a04e1f2a.tar.gz
vdr-patch-lnbsharing-ed643353b100bee75459c4ef2d0330e7a04e1f2a.tar.bz2
Version 1.1.7vdr-1.1.7
- Adapted VDR to the NEWSTRUCT driver. To use the new driver, compile VDR with 'make NEWSTRUCT=1' (thanks to Holger Wächtler for some valuable advice). By default it currently still uses the old driver. - Added some missing #includes (thanks to Martin Hammerschmid). - Changed the log error message "can't record MPEG1!" to "error in data stream!", since the mentioning of MPEG1 has irritated many people. - Consistently using malloc/free and new/delete (thanks to Andreas Schultz). - Temporarily made cDevice::ProvidesCa() virtual (Andreas Schultz needs this in his DXR3 plugin). - cDevice no longer exposes a file handle to cPlayer. A derived cPlayer class can now call DevicePoll() to see whether the replay device is ready for further data. A derived cDevice class must implement Poll() and shall check if any of its file handles is ready for data. - Implemented several replay modes to allow players that play only audio (thanks to Stefan Huelswitt). - Improved cCondVar::Wait() and implemented cCondVar::TimedWait() (thanks to Stefan Huelswitt). - VDR no longer gives up if there is no DVB device. It continues to work if there is at least one device, either a DVB device found by the core VDR code itself, or a device implemented by a plugin.
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/menu.c b/menu.c
index bb25385..5b56b3a 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.203 2002/08/03 09:55:44 kls Exp $
+ * $Id: menu.c 1.205 2002/08/15 11:28:08 kls Exp $
*/
#include "menu.h"
@@ -32,8 +32,6 @@
#define CHNUMWIDTH (Channels.Count() > 999 ? 5 : 4) // there are people with more than 999 channels...
-const char *FileNameChars = " abcdefghijklmnopqrstuvwxyz0123456789-.#~";
-
// --- cMenuEditChanItem -----------------------------------------------------
class cMenuEditChanItem : public cMenuEditIntItem {
@@ -936,7 +934,7 @@ cMenuEvent::cMenuEvent(const cEventInfo *EventInfo, bool CanSwitch)
char *buffer;
asprintf(&buffer, "%-17.*s\t%.*s %s - %s", 17, channel->name, 5, eventInfo->GetDate(), eventInfo->GetTimeString(), eventInfo->GetEndTimeString());
SetTitle(buffer, false);
- delete buffer;
+ free(buffer);
int Line = 2;
cMenuTextItem *item;
const char *Title = eventInfo->GetTitle();
@@ -1040,7 +1038,7 @@ cMenuWhatsOn::cMenuWhatsOn(const cSchedules *Schedules, bool Now, int CurrentCha
Add(new cMenuWhatsOnItem(pArray[a]), pArray[a]->GetChannelNumber() == CurrentChannelNr);
currentChannel = CurrentChannelNr;
- delete pArray;
+ free(pArray);
SetHelp(tr("Record"), Now ? tr("Next") : tr("Now"), tr("Button$Schedule"), tr("Switch"));
}
@@ -1173,11 +1171,11 @@ void cMenuSchedule::PrepareSchedule(cChannel *Channel)
char *buffer = NULL;
asprintf(&buffer, tr("Schedule - %s"), Channel->name);
SetTitle(buffer);
- delete buffer;
+ free(buffer);
if (schedules) {
const cSchedule *Schedule = Channel->pnr ? schedules->GetSchedule(Channel->pnr) : schedules->GetSchedule();
int num = Schedule->NumEvents();
- const cEventInfo **pArray = (const cEventInfo **)malloc(num * sizeof(cEventInfo *));
+ const cEventInfo **pArray = MALLOC(const cEventInfo *, num);
if (pArray) {
time_t now = time(NULL);
int numreal = 0;
@@ -1191,7 +1189,7 @@ void cMenuSchedule::PrepareSchedule(cChannel *Channel)
for (int a = 0; a < numreal; a++)
Add(new cMenuScheduleItem(pArray[a]));
- delete pArray;
+ free(pArray);
}
}
}
@@ -1306,8 +1304,8 @@ cMenuRecordingItem::cMenuRecordingItem(cRecording *Recording, int Level)
cMenuRecordingItem::~cMenuRecordingItem()
{
- delete fileName;
- delete name;
+ free(fileName);
+ free(name);
}
void cMenuRecordingItem::IncrementCounter(bool New)
@@ -1344,7 +1342,7 @@ cMenuRecordings::cMenuRecordings(const char *Base, int Level, bool OpenSubMenus)
if (*Item->Text() && (!LastItem || strcmp(Item->Text(), LastItemText) != 0)) {
Add(Item);
LastItem = Item;
- delete LastItemText;
+ free(LastItemText);
LastItemText = strdup(LastItem->Text()); // must use a copy because of the counters!
}
else
@@ -1357,7 +1355,7 @@ cMenuRecordings::cMenuRecordings(const char *Base, int Level, bool OpenSubMenus)
}
}
}
- delete LastItemText;
+ free(LastItemText);
if (Current() < 0)
SetCurrent(First());
else if (OpenSubMenus && Open(true))
@@ -1370,7 +1368,7 @@ cMenuRecordings::cMenuRecordings(const char *Base, int Level, bool OpenSubMenus)
cMenuRecordings::~cMenuRecordings()
{
helpKeys = -1;
- delete base;
+ free(base);
}
void cMenuRecordings::SetHelpKeys(void)
@@ -1417,7 +1415,7 @@ bool cMenuRecordings::Open(bool OpenSubMenus)
t = buffer;
}
AddSubMenu(new cMenuRecordings(t, level + 1, OpenSubMenus));
- delete buffer;
+ free(buffer);
return true;
}
return false;
@@ -1766,7 +1764,7 @@ cMenuSetupPlugins::cMenuSetupPlugins(void)
char *buffer = NULL;
asprintf(&buffer, "%s (%s) - %s", p->Name(), p->Version(), p->Description());
Add(new cMenuSetupPluginItem(hk(buffer), i));
- delete buffer;
+ free(buffer);
}
else
break;
@@ -1901,7 +1899,7 @@ eOSState cMenuCommands::Execute(void)
asprintf(&buffer, "%s...", command->Title());
Interface->Status(buffer);
Interface->Flush();
- delete buffer;
+ free(buffer);
const char *Result = command->Execute();
if (Result)
return AddSubMenu(new cMenuText(command->Title(), Result, fontFix));
@@ -2013,7 +2011,7 @@ void cMenuMain::Set(void)
char *buffer = NULL;
asprintf(&buffer, "%s%s", STOP_RECORDING, ON_PRIMARY_INTERFACE);
Add(new cOsdItem(buffer, osStopRecord));
- delete buffer;
+ free(buffer);
}
const char *s = NULL;
@@ -2021,7 +2019,7 @@ void cMenuMain::Set(void)
char *buffer = NULL;
asprintf(&buffer, "%s%s", STOP_RECORDING, s);
Add(new cOsdItem(buffer, osStopRecord));
- delete buffer;
+ free(buffer);
}
// Editing control:
@@ -2452,8 +2450,8 @@ cRecordControl::cRecordControl(cDevice *Device, cTimer *Timer)
cRecordControl::~cRecordControl()
{
Stop(true);
- delete instantId;
- delete fileName;
+ free(instantId);
+ free(fileName);
}
#define INSTANT_REC_EPG_LOOKAHEAD 300 // seconds to look into the EPG data for an instant recording
@@ -2701,8 +2699,8 @@ cReplayControl::~cReplayControl()
void cReplayControl::SetRecording(const char *FileName, const char *Title)
{
- delete fileName;
- delete title;
+ free(fileName);
+ free(title);
fileName = FileName ? strdup(FileName) : NULL;
title = Title ? strdup(Title) : NULL;
}
@@ -2715,7 +2713,7 @@ const char *cReplayControl::LastReplayed(void)
void cReplayControl::ClearLastReplayed(const char *FileName)
{
if (fileName && FileName && strcmp(fileName, FileName) == 0) {
- delete fileName;
+ free(fileName);
fileName = NULL;
}
}