summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Maass <mase@mase1.setho.org>2013-11-05 14:29:27 (GMT)
committerThomas Maass <mase@mase1.setho.org>2013-11-05 14:29:27 (GMT)
commitb866318464e9cd35847292117d1d6d241f452507 (patch)
tree39e08147de7a8dba02678370084b50dd798e9601
parentd23a34943ba61aef57f45f01109d74d093b011f8 (diff)
downloadvdr-plugin-hddarchive-b866318464e9cd35847292117d1d6d241f452507.tar.gz
vdr-plugin-hddarchive-b866318464e9cd35847292117d1d6d241f452507.tar.bz2
Added optional patch for VDR 2.0.4.
-rw-r--r--patches/vdr-2.0.4-hddarchive.patch96
1 files changed, 96 insertions, 0 deletions
diff --git a/patches/vdr-2.0.4-hddarchive.patch b/patches/vdr-2.0.4-hddarchive.patch
new file mode 100644
index 0000000..b5ad123
--- /dev/null
+++ b/patches/vdr-2.0.4-hddarchive.patch
@@ -0,0 +1,96 @@
+--- menu.c.orig 2013-10-16 11:46:24.000000000 +0200
++++ menu.c 2013-11-04 17:00:26.000000000 +0100
+@@ -51,6 +51,18 @@
+ #define CHNUMWIDTH (numdigits(Channels.MaxNumber()) + 1)
+ #define CHNAMWIDTH (min(MAXCHNAMWIDTH, Channels.MaxShortChannelNameLength() + 1))
+
++struct Hddarchive_archiveid_v1_0
++{
++ const cRecording *recording;
++ bool isarchive;
++ const char *archiveid;
++};
++
++struct Hddarchive_play_v1_0
++{
++ const cRecording *recording;
++};
++
+ // --- cMenuEditCaItem -------------------------------------------------------
+
+ class cMenuEditCaItem : public cMenuEditIntItem {
+@@ -2194,7 +2206,23 @@
+ level = Level;
+ name = NULL;
+ totalEntries = newEntries = 0;
+- SetText(Recording->Title('\t', true, Level));
++ // replace newindicator with '#' for archives
++ cPlugin *hddarchivePlugin = cPluginManager::GetPlugin("hddarchive");
++ Hddarchive_archiveid_v1_0 data;
++ data.recording = Recording;
++ data.isarchive = false;
++ if (hddarchivePlugin) {
++ hddarchivePlugin->Service("Hddarchive-archiveid_v1.0", &data);
++ }
++ if (data.isarchive && (level < 0 || level == recording->HierarchyLevels())) {
++ char *text = strdup(recording->Title('\t', true, level));
++ int nipos = strlen(strrchr(recording->Title('\t', true, level), '\t') + 1);
++ text[strlen(recording->Title('\t', true, level)) - nipos - 2] = '#';
++ SetText(text);
++ free(text);
++ }
++ else
++ SetText(Recording->Title('\t', true, Level));
+ if (*Text() == '\t')
+ name = strdup(Text() + 2); // 'Text() + 2' to skip the two '\t'
+ }
+@@ -2348,6 +2376,13 @@
+ if (ri->IsDirectory())
+ Open();
+ else {
++ cPlugin *hddarchivePlugin = cPluginManager::GetPlugin("hddarchive");
++ Hddarchive_play_v1_0 data;
++ data.recording = ri->Recording();
++ if (hddarchivePlugin) {
++ hddarchivePlugin->Service("Hddarchive-play_v1.0", &data);
++ return osEnd;
++ }
+ cReplayControl::SetRecording(ri->Recording()->FileName());
+ return osReplay;
+ }
+@@ -2374,6 +2409,17 @@
+ if (HasSubMenu() || Count() == 0)
+ return osContinue;
+ cMenuRecordingItem *ri = (cMenuRecordingItem *)Get(Current());
++ cPlugin *hddarchivePlugin = cPluginManager::GetPlugin("hddarchive");
++ Hddarchive_archiveid_v1_0 data;
++ data.recording = ri->Recording();
++ data.isarchive = false;
++ if (hddarchivePlugin) {
++ hddarchivePlugin->Service("Hddarchive-archiveid_v1.0", &data);
++ if (data.isarchive) {
++ Skins.Message(mtError, tr("Cannot delete archived recording!"));
++ return osContinue;
++ }
++ }
+ if (ri && !ri->IsDirectory()) {
+ if (Interface->Confirm(tr("Delete recording?"))) {
+ cRecordControl *rc = cRecordControls::GetRecordControl(ri->Recording()->FileName());
+@@ -4832,7 +4878,16 @@
+ if (*fileName) {
+ Hide();
+ if (!cCutter::Active()) {
+- if (!marks.Count())
++ cPlugin *hddarchivePlugin = cPluginManager::GetPlugin("hddarchive");
++ Hddarchive_archiveid_v1_0 data;
++ data.recording = GetRecording();
++ data.isarchive = false;
++ if (hddarchivePlugin) {
++ hddarchivePlugin->Service("Hddarchive-archiveid_v1.0", &data);
++ }
++ if (data.isarchive)
++ Skins.Message(mtError, tr("Cannot edit archived recording!"));
++ else if (!marks.Count())
+ Skins.Message(mtError, tr("No editing marks defined!"));
+ else if (!marks.GetNumSequences())
+ Skins.Message(mtError, tr("No editing sequences defined!"));