diff -Nu vdr-1.3.15/config.c vdr-1.3.15+aio1.4/config.c --- vdr-1.3.15/config.c 2004-10-31 17:17:39.000000000 +0100 +++ vdr-1.3.15+aio1.4/config.c 2004-11-01 16:56:39.000000000 +0100 @@ -297,6 +297,10 @@ ResumeID = 0; CurrentChannel = -1; CurrentVolume = MAXVOLUME; + ShowRecDate = 1; + ShowRecTime = 1; + ShowRecLength = 0; + MenuCmdPosition = 0; } cSetup& cSetup::operator= (const cSetup &s) @@ -450,6 +454,10 @@ else if (!strcasecmp(Name, "ResumeID")) ResumeID = atoi(Value); else if (!strcasecmp(Name, "CurrentChannel")) CurrentChannel = atoi(Value); else if (!strcasecmp(Name, "CurrentVolume")) CurrentVolume = atoi(Value); + else if (!strcasecmp(Name, "ShowRecDate")) ShowRecDate = atoi(Value); + else if (!strcasecmp(Name, "ShowRecTime")) ShowRecTime = atoi(Value); + else if (!strcasecmp(Name, "ShowRecLength")) ShowRecLength = atoi(Value); + else if (!strcasecmp(Name, "MenuCmdPosition")) MenuCmdPosition = atoi(Value); else return false; return true; @@ -510,6 +518,10 @@ Store("ResumeID", ResumeID); Store("CurrentChannel", CurrentChannel); Store("CurrentVolume", CurrentVolume); + Store("ShowRecDate", ShowRecDate); + Store("ShowRecTime", ShowRecTime); + Store("ShowRecLength", ShowRecLength); + Store("MenuCmdPosition", MenuCmdPosition); Sort(); diff -Nu vdr-1.3.15/config.h vdr-1.3.15+aio1.4/config.h --- vdr-1.3.15/config.h 2004-10-31 17:17:02.000000000 +0100 +++ vdr-1.3.15+aio1.4/config.h 2004-11-01 16:56:39.000000000 +0100 @@ -23,6 +23,8 @@ #define VDRVERSION "1.3.15" #define VDRVERSNUM 10315 // Version * 10000 + Major * 100 + Minor +#define ENAIOVERSION 14 + #define MAXPRIORITY 99 #define MAXLIFETIME 99 @@ -251,6 +253,7 @@ int ResumeID; int CurrentChannel; int CurrentVolume; + int ShowRecDate, ShowRecTime, ShowRecLength, MenuCmdPosition; int __EndData__; cSetup(void); cSetup& operator= (const cSetup &s); diff -Nu vdr-1.3.15/HISTORY-enAIO vdr-1.3.15+aio1.4/HISTORY-enAIO --- vdr-1.3.15/HISTORY-enAIO 1970-01-01 01:00:00.000000000 +0100 +++ vdr-1.3.15+aio1.4/HISTORY-enAIO 2004-11-01 16:56:39.000000000 +0100 @@ -0,0 +1,29 @@ +History enAIO: +-------------- + +20-05-2004: Version 1.0 + +- Initial revision based on following patches: + * Easyinput Patch by Marcel Schaeben / Patrick Maier + * Rename Recordings Patch by Torsten Kunkel + * Menu Selection Patch by Peter Dittmann + * Recording Length Patch by Tobias Faust + * Show Weekdays Patch by Oskar Signell + +23-05-2004: Version 1.1 + +- Updated for vdr-1.3.8 (aka. removed Show Weekdays Patch). + +06-06-2004: Version 1.2 + +- Added VDRAdmin changes from Recording Length Patch v0.3. + +20-06-2004: Version 1.3 + +- Updated for vdr-1.3.11 (Rename Recordings Patch). +- Added "Main Menu command position" feature. + Thanks to Olaf Henkel for his excellent weekly rants :) + +11-09-2004: Version 1.4 + +- Removed centering from the recording length field. diff -Nu vdr-1.3.15/i18n.c vdr-1.3.15+aio1.4/i18n.c --- vdr-1.3.15/i18n.c 2004-11-01 15:18:48.000000000 +0100 +++ vdr-1.3.15+aio1.4/i18n.c 2004-11-01 16:56:39.000000000 +0100 @@ -3449,6 +3449,63 @@ "Podijeli ureðene datoteke", "Tükelda redigeeritud faile", }, + { "Setup.Recording$Show Date", + "Aufnahmedatum anzeigen", + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "Näytä tallenteen päiväys", + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "¿ÞÚÐ×ëÒÐâì ÔÐâã", + "",//TODO + }, + { "Setup.Recording$Show Time", + "AufnahmeZeit anzeigen", + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "Näytä tallenteen ajankohta", + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "¿ÞÚÐ×ëÒÐâì ÒàÕÜï ×ÐßØáØ", + "",//TODO + }, + { "Setup.Recording$Show Length", + "Länge der Aufnahme anzeigen", + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "Näytä tallenteen kesto", + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "¿ÞÚÐ×ëÒÐâì ßàÞÔÞÛÖØâÕÛìÝÞáâì ×ÐßØáØ", + "",//TODO + }, { "Setup.Replay$Multi speed mode", "MultiSpeed Modus", "Rezim z vec hitrostmi", @@ -4874,6 +4931,44 @@ "ST:TNG Konzole", "ST:TNG konsool", }, + { "Rename recording", + "Aufzeichnung umbenennen", + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "Nimeä tallenne", + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "¿ÕàÕØÜÕÝÞÒÐâì ×ÐßØáì", + "",// TODO + }, + { "Setup.OSD$Main Menu command position", + "Befehle Position im Hauptmenü", + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "Komentojen sijainti päävalikossa", + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "ÀÐ×ÜÕéÕÝØÕ ÚÞÜÐÝÔ Ò ÓÛÐÒÝÞÜ ÜÕÝî", + "",//TODO + }, { NULL } }; Gemeinsame Unterverzeichnisse: vdr-1.3.15/libsi und vdr-1.3.15+aio1.4/libsi. diff -Nu vdr-1.3.15/makescript vdr-1.3.15+aio1.4/makescript --- vdr-1.3.15/makescript 1970-01-01 01:00:00.000000000 +0100 +++ vdr-1.3.15+aio1.4/makescript 2004-11-01 16:58:59.000000000 +0100 @@ -0,0 +1,6 @@ +DEFINES="-D_GNU_SOURCE +AUTOPID_PATCHED" +make clean &&\ +make plugins-clean &&\ +make REMOTE=LIRC TELETEXT=1 VFAT=1 CMD_SUBMENUS=1 &&\ +make plugins GRAPHLCD_DRIVER=KS0108 NAGRA=1 CONAX=1 SHL=1 SECA=1 IRDETO=1 VIACCESS=1 OPENSSL=1 HAVE_AC3_OVER_DVB=1 &&\ +cd .. diff -Nu vdr-1.3.15/menu.c vdr-1.3.15+aio1.4/menu.c --- vdr-1.3.15/menu.c 2004-11-01 14:49:40.000000000 +0100 +++ vdr-1.3.15+aio1.4/menu.c 2004-11-01 16:58:40.000000000 +0100 @@ -969,7 +969,7 @@ char t = Timers.GetMatch(Event, &TimerMatch) ? (TimerMatch == tmFull) ? 'T' : 't' : ' '; char v = event->Vps() && (event->Vps() - event->StartTime()) ? 'V' : ' '; char r = event->IsRunning() ? '*' : ' '; - asprintf(&buffer, "%d\t%.*s\t%s\t%c%c%c\t%s", channel->Number(), 6, channel->ShortName(true), event->GetTimeString(), t, v, r, event->Title()); + asprintf(&buffer, "%.*s\t%.*s\t%c%c%c\t%s", 10, channel->ShortName(true), 5, event->GetTimeString(), t, v, r, event->Title()); SetText(buffer, false); } @@ -993,7 +993,7 @@ const cEvent *cMenuWhatsOn::scheduleEvent = NULL; cMenuWhatsOn::cMenuWhatsOn(const cSchedules *Schedules, bool Now, int CurrentChannelNr) -:cOsdMenu(Now ? tr("What's on now?") : tr("What's on next?"), CHNUMWIDTH, 7, 6, 4) +:cOsdMenu(Now ? tr("What's on now?") : tr("What's on next?"), 12, 6, 4) { for (cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel)) { if (!Channel->GroupSep()) { @@ -1459,12 +1459,61 @@ SetText(buffer, false); } +// --- cMenuRenameRecording -------------------------------------------------- + +class cMenuRenameRecording : public cOsdMenu { +private: + int lifetime; + int priority; + char name[MaxFileName]; + cRecording *recording; +public: + cMenuRenameRecording(cRecording *Recording); + ~cMenuRenameRecording(); + virtual eOSState ProcessKey(eKeys Key); + }; + +cMenuRenameRecording::cMenuRenameRecording(cRecording *Recording) +:cOsdMenu(tr("Rename recording"), 12) +{ + recording = Recording; + priority = recording->priority; + lifetime = recording->lifetime; + strncpy(name, recording->Name(), sizeof(name)); + + Add(new cMenuEditStrItem(tr("Name"), name, sizeof(name), tr(FileNameChars))); + Add(new cMenuEditIntItem(tr("Priority"), &priority, 0, MAXPRIORITY )); + Add(new cMenuEditIntItem(tr("Lifetime"), &lifetime, 0, MAXLIFETIME )); +} + +cMenuRenameRecording::~cMenuRenameRecording() +{ +} + +eOSState cMenuRenameRecording::ProcessKey(eKeys Key) +{ + eOSState state = cOsdMenu::ProcessKey(Key); + + if (state == osUnknown) { + if (Key == kOk) { + if (recording->Rename(name, &priority, &lifetime)) { + Recordings.Load(); + return osRecordings; + } + else + Skins.Message(mtError, tr("Error while accessing recording!")); + } + return osContinue; + } + return state; +} + // --- cMenuRecordings ------------------------------------------------------- int cMenuRecordings::helpKeys = -1; cMenuRecordings::cMenuRecordings(const char *Base, int Level, bool OpenSubMenus) -:cOsdMenu(Base ? Base : tr("Recordings"), 6, 6) +:cOsdMenu(Base ? Base : tr("Recordings"), 6, 6, 6) { base = Base ? strdup(Base) : NULL; level = Setup.RecordingDirs ? Level : -1; @@ -1665,6 +1714,19 @@ return osContinue; } +eOSState cMenuRecordings::Rename(void) +{ + if (HasSubMenu() || Count() == 0) + return osContinue; + cMenuRecordingItem *ri = (cMenuRecordingItem *)Get(Current()); + if (ri && !ri->IsDirectory()) { + cRecording *recording = GetRecording(ri); + if (recording) + return AddSubMenu(new cMenuRenameRecording(recording)); + } + return osContinue; +} + eOSState cMenuRecordings::ProcessKey(eKeys Key) { bool HadSubMenu = HasSubMenu(); @@ -1677,6 +1739,7 @@ case kGreen: return Rewind(); case kYellow: return Delete(); case kBlue: return Summary(); + case k0: return Rename(); case k1...k9: return Commands(Key); default: break; } @@ -1773,6 +1836,7 @@ Add(new cMenuEditBoolItem(tr("Setup.OSD$Scroll pages"), &data.MenuScrollPage)); Add(new cMenuEditBoolItem(tr("Setup.OSD$Sort timers"), &data.SortTimers)); Add(new cMenuEditBoolItem(tr("Setup.OSD$Recording directories"), &data.RecordingDirs)); + Add(new cMenuEditBoolItem(tr("Setup.OSD$Main Menu command position"), &data.MenuCmdPosition, tr("bottom"), tr("top"))); SetCurrent(Get(current)); Display(); } @@ -2114,6 +2178,9 @@ Add(new cMenuEditBoolItem(tr("Setup.Recording$Record Dolby Digital"), &data.RecordDolbyDigital)); Add(new cMenuEditIntItem( tr("Setup.Recording$Max. video file size (MB)"), &data.MaxVideoFileSize, MINVIDEOFILESIZE, MAXVIDEOFILESIZE)); Add(new cMenuEditBoolItem(tr("Setup.Recording$Split edited files"), &data.SplitEditedFiles)); + Add(new cMenuEditBoolItem(tr("Setup.Recording$Show Date"), &data.ShowRecDate)); + Add(new cMenuEditBoolItem(tr("Setup.Recording$Show Time"), &data.ShowRecTime)); + Add(new cMenuEditBoolItem(tr("Setup.Recording$Show Length"), &data.ShowRecLength)); } // --- cMenuSetupReplay ------------------------------------------------------ @@ -2355,6 +2422,35 @@ //XXX -> skin function!!! SetTitle(buffer); + if (Setup.MenuCmdPosition) { + // Replay control: + + if (replaying) + Add(new cOsdItem(tr(" Stop replaying"), osStopReplay)); + + // Record control: + + if (cRecordControls::StopPrimary()) { + char *buffer = NULL; + asprintf(&buffer, "%s%s", STOP_RECORDING, ON_PRIMARY_INTERFACE); + Add(new cOsdItem(buffer, osStopRecord)); + free(buffer); + } + + const char *s = NULL; + while ((s = cRecordControls::GetInstantId(s)) != NULL) { + char *buffer = NULL; + asprintf(&buffer, "%s%s", STOP_RECORDING, s); + Add(new cOsdItem(buffer, osStopRecord)); + free(buffer); + } + + // Editing control: + + if (cCutter::Active()) + Add(new cOsdItem(tr(" Cancel editing"), osCancelEdit)); + } + // Basic menu items: Add(new cOsdItem(hk(tr("Schedule")), osSchedule)); @@ -2381,6 +2477,7 @@ if (Commands.Count()) Add(new cOsdItem(hk(tr("Commands")), osCommands)); + if (!Setup.MenuCmdPosition) { // Replay control: if (replaying) @@ -2407,6 +2504,7 @@ if (cCutter::Active()) Add(new cOsdItem(tr(" Cancel editing"), osCancelEdit)); + } // Color buttons: diff -Nu vdr-1.3.15/menu.h vdr-1.3.15+aio1.4/menu.h --- vdr-1.3.15/menu.h 2004-06-13 13:46:03.000000000 +0200 +++ vdr-1.3.15+aio1.4/menu.h 2004-11-01 16:56:39.000000000 +0100 @@ -117,6 +117,7 @@ eOSState Delete(void); eOSState Summary(void); eOSState Commands(eKeys Key = kNone); + eOSState Rename(void); public: cMenuRecordings(const char *Base = NULL, int Level = 0, bool OpenSubMenus = false); ~cMenuRecordings(); diff -Nu vdr-1.3.15/menuitems.c vdr-1.3.15+aio1.4/menuitems.c --- vdr-1.3.15/menuitems.c 2004-06-19 11:45:45.000000000 +0200 +++ vdr-1.3.15+aio1.4/menuitems.c 2004-11-01 16:56:39.000000000 +0100 @@ -15,6 +15,8 @@ #include "skins.h" #include "status.h" +#define SHIFTTIMEOUT 2 + const char *FileNameChars = " abcdefghijklmnopqrstuvwxyz0123456789-.#~"; // --- cMenuEditItem --------------------------------------------------------- @@ -243,6 +245,9 @@ pos = -1; insert = uppercase = false; newchar = true; + ieCurChr = 0; + lastKey = kNone; + lastActivity = time(NULL); Set(); } @@ -320,12 +325,24 @@ eOSState cMenuEditStrItem::ProcessKey(eKeys Key) { + const char c1[] = "-.#~,/_@1"; + const char c2[] = "abcäåá2"; + const char c3[] = "defé3"; + const char c4[] = "ghi4"; + const char c5[] = "jkl5"; + const char c6[] = "mnoöñó6"; + const char c7[] = "pqrs7"; + const char c8[] = "tuvüú8"; + const char c9[] = "wxyz9"; + const char c0[] = " 0"; + switch (Key) { case kRed: // Switch between upper- and lowercase characters if (pos >= 0 && (!insert || !newchar)) { uppercase = !uppercase; value[pos] = uppercase ? toupper(value[pos]) : tolower(value[pos]); } + lastKey = Key; break; case kGreen: // Toggle insert/overwrite modes if (pos >= 0) { @@ -333,6 +350,7 @@ newchar = true; SetHelpKeys(); } + lastKey = Key; break; case kYellow|k_Repeat: case kYellow: // Remove the character at current position; in insert mode it is the character to the right of cursor @@ -350,6 +368,7 @@ uppercase = isupper(value[pos]); newchar = true; } + lastKey = Key; break; case kLeft|k_Repeat: case kLeft: if (pos > 0) { @@ -359,6 +378,7 @@ } if (!insert && isalpha(value[pos])) uppercase = isupper(value[pos]); + lastKey = Key; break; case kRight|k_Repeat: case kRight: if (pos < length - 2 && pos < int(strlen(value)) ) { @@ -376,6 +396,7 @@ uppercase = isupper(value[pos]); if (pos == 0) SetHelpKeys(); + lastKey = Key; break; case kUp|k_Repeat: case kUp: @@ -396,9 +417,151 @@ } else return cMenuEditItem::ProcessKey(Key); + lastKey = Key; + break; + case k0|k_Repeat ... k9|k_Repeat: + case k0 ... k9: if ((Key != lastKey) || ((Key == lastKey) && (time(NULL) - lastActivity > SHIFTTIMEOUT)) ) { + ieCurChr = 0; + if (!newchar) { + // kRight + if (pos < length - 2 && pos < int(strlen(value)) ) { + if (++pos >= int(strlen(value))) { + if (pos >= 2 && value[pos - 1] == ' ' && value[pos - 2] == ' ') + pos--; // allow only two blanks at the end + else { + value[pos] = ' '; + value[pos + 1] = 0; + } + } + } + newchar = true; + if (!insert && isalpha(value[pos])) + uppercase = isupper(value[pos]); + } + } + // kUp/kDown + if (pos >= 0) { + if (insert && newchar) { + // create a new character in insert mode + if (int(strlen(value)) < length - 1) { + memmove(value + pos + 1, value + pos, strlen(value) - pos + 1); + value[pos] = ' '; + } + } + } + else + return cMenuEditItem::ProcessKey(Key); + switch (Key) { + case k1: + if (uppercase) + value[pos] = toupper(c1[ieCurChr]); + else + value[pos] = c1[ieCurChr]; + if (c1[ieCurChr+1] == 0) + ieCurChr = 0; + else + ieCurChr++; + break; + case k2: + if (uppercase) + value[pos] = toupper(c2[ieCurChr]); + else + value[pos] = c2[ieCurChr]; + if (c2[ieCurChr+1] == 0) + ieCurChr = 0; + else + ieCurChr++; + break; + case k3: + if (uppercase) + value[pos] = toupper(c3[ieCurChr]); + else + value[pos] = c3[ieCurChr]; + if (c3[ieCurChr+1] == 0) + ieCurChr = 0; + else + ieCurChr++; + break; + case k4: + if (uppercase) + value[pos] = toupper(c4[ieCurChr]); + else + value[pos] = c4[ieCurChr]; + if (c4[ieCurChr+1] == 0) + ieCurChr = 0; + else + ieCurChr++; + break; + case k5: + if (uppercase) + value[pos] = toupper(c5[ieCurChr]); + else + value[pos] = c5[ieCurChr]; + if (c5[ieCurChr+1] == 0) + ieCurChr = 0; + else + ieCurChr++; + break; + case k6: + if (uppercase) + value[pos] = toupper(c6[ieCurChr]); + else + value[pos] = c6[ieCurChr]; + if (c6[ieCurChr+1] == 0) + ieCurChr = 0; + else + ieCurChr++; + break; + case k7: + if (uppercase) + value[pos] = toupper(c7[ieCurChr]); + else + value[pos] = c7[ieCurChr]; + if (c7[ieCurChr+1] == 0) + ieCurChr = 0; + else + ieCurChr++; + break; + case k8: + if (uppercase) + value[pos] = toupper(c8[ieCurChr]); + else + value[pos] = c8[ieCurChr]; + if (c8[ieCurChr+1] == 0) + ieCurChr = 0; + else + ieCurChr++; + break; + case k9: + if (uppercase) + value[pos] = toupper(c9[ieCurChr]); + else + value[pos] = c9[ieCurChr]; + if (c9[ieCurChr+1] == 0) + ieCurChr = 0; + else + ieCurChr++; + break; + case k0: + if (uppercase) + value[pos] = toupper(c0[ieCurChr]); + else + value[pos] = c0[ieCurChr]; + if (c0[ieCurChr+1] == 0) + ieCurChr = 0; + else + ieCurChr++; + break; + default: + break; + } + lastKey = Key; + newchar = false; + lastActivity = time(NULL); break; case kOk: if (pos >= 0) { pos = -1; + lastKey = Key; newchar = true; stripspace(value); SetHelpKeys(); diff -Nu vdr-1.3.15/menuitems.h vdr-1.3.15+aio1.4/menuitems.h --- vdr-1.3.15/menuitems.h 2004-05-16 14:45:14.000000000 +0200 +++ vdr-1.3.15+aio1.4/menuitems.h 2004-11-01 16:56:39.000000000 +0100 @@ -82,6 +82,9 @@ char *allowed; int pos; bool insert, newchar, uppercase; + int ieCurChr; + eKeys lastKey; + time_t lastActivity; void SetHelpKeys(void); virtual void Set(void); char Inc(char c, bool Up); diff -Nu vdr-1.3.15/osdbase.c vdr-1.3.15+aio1.4/osdbase.c --- vdr-1.3.15/osdbase.c 2004-07-17 15:29:13.000000000 +0200 +++ vdr-1.3.15+aio1.4/osdbase.c 2004-11-01 16:56:39.000000000 +0100 @@ -71,6 +71,8 @@ { isMenu = true; digit = 0; + key_nr = -1; + lastActivity = time(NULL); hasHotkeys = false; title = NULL; SetTitle(Title); @@ -109,7 +111,7 @@ digit = -1; // prevents automatic hotkeys - input already has them if (digit >= 0) { digit++; - snprintf(buffer, sizeof(buffer), " %c %s", (digit < 10) ? '0' + digit : ' ' , s); + snprintf(buffer, sizeof(buffer), " %2d%s %s", digit, (digit > 9) ? "" : " ", s); s = buffer; } } @@ -338,18 +340,60 @@ } } +#define MENUKEYTIMEOUT 1 + eOSState cOsdMenu::HotKey(eKeys Key) { - for (cOsdItem *item = First(); item; item = Next(item)) { + bool match = false; + bool highlight = false; + int item_nr; + int i; + + if (Key == kNone) { + if ((time(NULL) - lastActivity) >= MENUKEYTIMEOUT) + Key = kOk; + else + return osContinue; + } + else { + lastActivity = time(NULL); + } + for (cOsdItem *item = Last(); item; item = Prev(item)) { const char *s = item->Text(); - if (s && (s = skipspace(s)) != NULL) { - if (*s == Key - k1 + '1') { + i = 0; + item_nr = 0; + if (s && (s = skipspace(s)) != '\0' && '0' <= s[i] && s[i] <= '9') { + do { + item_nr = item_nr * 10 + (s[i] - '0'); + } + while ( !((s[++i] == '\t')||(s[i] == ' ')) && (s[i] != '\0') && ('0' <= s[i]) && (s[i] <= '9')); + if ((Key == kOk) && (item_nr == key_nr)) { current = item->Index(); cRemote::Put(kOk, true); + key_nr = -1; break; } + else if (Key != kOk) { + if (!highlight && (item_nr == (Key - k0))) { + highlight = true; + current = item->Index(); + } + if (!match && (key_nr == -1) && ((item_nr / 10) == (Key - k0))) { + match = true; + key_nr = (Key - k0); + } + else if (((key_nr == -1) && (item_nr == (Key - k0))) || (!match && (key_nr >= 0) && (item_nr == (10 * key_nr + Key - k0)))) { + current = item->Index(); + cRemote::Put(kOk, true); + key_nr = -1; + break; + } + } } } + if ((!match) && (Key != kNone)) { + key_nr = -1; + } return osContinue; } @@ -388,7 +432,8 @@ } } switch (Key) { - case k1...k9: return hasHotkeys ? HotKey(Key) : osUnknown; + case kNone: + case k0...k9: return hasHotkeys ? HotKey(Key) : osUnknown; case kUp|k_Repeat: case kUp: CursorUp(); break; case kDown|k_Repeat: diff -Nu vdr-1.3.15/osdbase.h vdr-1.3.15+aio1.4/osdbase.h --- vdr-1.3.15/osdbase.h 2004-04-30 15:40:11.000000000 +0200 +++ vdr-1.3.15+aio1.4/osdbase.h 2004-11-01 16:56:39.000000000 +0100 @@ -95,6 +95,8 @@ char *status; int digit; bool hasHotkeys; + int key_nr; + time_t lastActivity; protected: cSkinDisplayMenu *DisplayMenu(void) { return displayMenu; } const char *hk(const char *s); Gemeinsame Unterverzeichnisse: vdr-1.3.15/PLUGINS und vdr-1.3.15+aio1.4/PLUGINS. diff -Nu vdr-1.3.15/recording.c vdr-1.3.15+aio1.4/recording.c --- vdr-1.3.15/recording.c 2004-11-01 15:04:47.000000000 +0100 +++ vdr-1.3.15+aio1.4/recording.c 2004-11-01 16:56:39.000000000 +0100 @@ -47,6 +47,7 @@ #define RESUMEFILESUFFIX "/resume%s%s.vdr" #define SUMMARYFILESUFFIX "/summary.vdr" #define MARKSFILESUFFIX "/marks.vdr" +#define INDEXFILESUFFIX "/index.vdr" #define MINDISKSPACE 1024 // MB @@ -490,7 +491,7 @@ return fileName; } -const char *cRecording::Title(char Delimiter, bool NewIndicator, int Level) const +const char *cRecording::Title(char Delimiter, bool NewIndicator, int Level, bool Original) const { char New = NewIndicator && IsNew() ? '*' : ' '; free(titleBuffer); @@ -503,6 +504,7 @@ s++; else s = name; + if (Original) { asprintf(&titleBuffer, "%02d.%02d%c%02d:%02d%c%c%s", t->tm_mday, t->tm_mon + 1, @@ -512,6 +514,57 @@ New, Delimiter, s); + } + else { + struct tIndex { int offset; uchar type; uchar number; short reserved; }; + tIndex *index; + char RecLength[20] = ""; + char RecDate[5] = ""; + char RecTime[5] = ""; + char RecDelimiter[1] = ""; + if (Setup.ShowRecLength) { + char *filename = NULL; + int last = -1; + index = NULL; + if (FileName()) { + filename = MALLOC(char, strlen(FileName()) + strlen(INDEXFILESUFFIX) + 1); + if (filename) { + strcpy(filename, FileName()); + char *pFileExt = filename + strlen(filename); + strcpy(pFileExt, INDEXFILESUFFIX); + int delta = 0; + if (access(filename, R_OK) == 0) { + struct stat buf; + if (stat(filename, &buf) == 0) { + delta = buf.st_size % sizeof(tIndex); + if (delta) { + delta = sizeof(tIndex) - delta; + esyslog("ERROR: invalid file size (%ld) in '%s'", buf.st_size, filename); + } + last = (buf.st_size + delta) / sizeof(tIndex) - 1; + char hour[2] = ""; char min[3] = ""; + sprintf(RecLength, "%s", IndexToHMSF(last, true)); + sprintf(hour, "%c", RecLength[0]); + sprintf(min, "%c%c", RecLength[2], RecLength[3]); + sprintf(RecLength, "%d´", (atoi(hour) * 60) + atoi(min)); + } + } + } + } + } + sprintf(RecDate,"%02d.%02d", t->tm_mday, t->tm_mon + 1); + sprintf(RecTime,"%02d:%02d", t->tm_hour, t->tm_min); + sprintf(RecDelimiter,"%c", Delimiter); + asprintf(&titleBuffer, "%s%s%s%c%s%s%s%s", + (Setup.ShowRecDate ? RecDate : ""), + (Setup.ShowRecDate ? Setup.ShowRecTime ? RecDelimiter : "" : ""), + (Setup.ShowRecTime ? RecTime : ""), + New, + (Setup.ShowRecTime ? RecDelimiter : Setup.ShowRecDate ? RecDelimiter : ""), + (Setup.ShowRecLength ? RecLength : ""), + (Setup.ShowRecLength ? RecDelimiter : ""), + s); + } // let's not display a trailing '~': stripspace(titleBuffer); s = &titleBuffer[strlen(titleBuffer) - 1]; @@ -616,6 +669,32 @@ return RemoveVideoFile(FileName()); } +bool cRecording::Rename(char *newName, int *newPriority, int *newLifetime) +{ + bool result = true; + char *newFileName; + struct tm tm_r; + struct tm *t = localtime_r(&start, &tm_r); + asprintf(&newFileName, NAMEFORMAT, VideoDirectory, ExchangeChars(newName, true), t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, *newPriority, *newLifetime); + if (strcmp(FileName(), newFileName)) { + if (access(newFileName, F_OK) == 0) { + isyslog("recording %s already exists", newFileName); + } + else { + isyslog("renaming recording %s to %s", FileName(), newFileName); + result = MakeDirs(newFileName, true); + if (result) + result = RenameVideoFile(FileName(), newFileName); + if (result) { + free(fileName); + fileName = strdup(newFileName); + } + } + } + free(newFileName); + return result; +} + // --- cRecordings ----------------------------------------------------------- cRecordings Recordings; @@ -827,8 +906,6 @@ //XXX+ somewhere else??? // --- cIndexFile ------------------------------------------------------------ -#define INDEXFILESUFFIX "/index.vdr" - // The number of frames to stay off the end in case of time shift: #define INDEXSAFETYLIMIT 150 // frames diff -Nu vdr-1.3.15/recording.h vdr-1.3.15+aio1.4/recording.h --- vdr-1.3.15/recording.h 2004-10-31 17:24:38.000000000 +0100 +++ vdr-1.3.15+aio1.4/recording.h 2004-11-01 16:56:39.000000000 +0100 @@ -53,7 +53,7 @@ virtual int Compare(const cListObject &ListObject) const; const char *Name(void) const { return name; } const char *FileName(void) const; - const char *Title(char Delimiter = ' ', bool NewIndicator = false, int Level = -1) const; + const char *Title(char Delimiter = ' ', bool NewIndicator = false, int Level = -1, bool Original = false) const; const char *Summary(void) const { return summary; } const char *PrefixFileName(char Prefix); int HierarchyLevels(void) const; @@ -66,6 +66,9 @@ bool Remove(void); // Actually removes the file from the disk // Returns false in case of error + bool Rename(char *newName, int *newPriority, int *newLifetime); + // Changes the file name + // Returns false in case of error }; class cRecordings : public cList { diff -Nu vdr-1.3.15/svdrp.c vdr-1.3.15+aio1.4/svdrp.c --- vdr-1.3.15/svdrp.c 2004-10-31 11:09:53.000000000 +0100 +++ vdr-1.3.15+aio1.4/svdrp.c 2004-11-01 16:56:39.000000000 +0100 @@ -814,7 +814,7 @@ else if (recordings) { cRecording *recording = Recordings.First(); while (recording) { - Reply(recording == Recordings.Last() ? 250 : -250, "%d %s", recording->Index() + 1, recording->Title(' ', true)); + Reply(recording == Recordings.Last() ? 250 : -250, "%d %s", recording->Index() + 1, recording->Title(' ', true, -1, true)); recording = Recordings.Next(recording); } } Gemeinsame Unterverzeichnisse: vdr-1.3.15/symbols und vdr-1.3.15+aio1.4/symbols. diff -Nu vdr-1.3.15/tools.c vdr-1.3.15+aio1.4/tools.c --- vdr-1.3.15/tools.c 2004-10-31 17:42:36.000000000 +0100 +++ vdr-1.3.15+aio1.4/tools.c 2004-11-01 16:56:39.000000000 +0100 @@ -516,7 +516,7 @@ time(&t); struct tm tm_r; tm *tm = localtime_r(&t, &tm_r); - snprintf(buffer, sizeof(buffer), "%s %2d.%02d %02d:%02d", WeekDayName(tm->tm_wday), tm->tm_mday, tm->tm_mon + 1, tm->tm_hour, tm->tm_min); + snprintf(buffer, sizeof(buffer), "%s %02d.%02d %02d:%02d", WeekDayName(tm->tm_wday), tm->tm_mday, tm->tm_mon + 1, tm->tm_hour, tm->tm_min); return buffer; }