diff options
author | Thomas Maass <mase@mase1.setho.org> | 2013-09-22 18:25:31 +0200 |
---|---|---|
committer | Thomas Maass <mase@mase1.setho.org> | 2013-09-22 18:25:31 +0200 |
commit | e8d1ca5ff467ab26c94513ca671f7ea626d9a9c4 (patch) | |
tree | 75416d909f9424a11d104427ccbaf1e1f3c4cfb4 | |
parent | 8cc24eb1c96d0b5967de39dee9c4dc4a2ccc940f (diff) | |
download | vdr-plugin-hddarchive-e8d1ca5ff467ab26c94513ca671f7ea626d9a9c4.tar.gz vdr-plugin-hddarchive-e8d1ca5ff467ab26c94513ca671f7ea626d9a9c4.tar.bz2 |
Added VDR patches to integrate hddarchive plugin into VDRs recmenu.
-rw-r--r-- | patches/vdr-2.0.3-hddarchive-0.0.1.patch | 71 | ||||
-rw-r--r-- | patches/vdr-2.1.1-hddarchive-0.0.1.patch | 71 |
2 files changed, 142 insertions, 0 deletions
diff --git a/patches/vdr-2.0.3-hddarchive-0.0.1.patch b/patches/vdr-2.0.3-hddarchive-0.0.1.patch new file mode 100644 index 0000000..55cbef7 --- /dev/null +++ b/patches/vdr-2.0.3-hddarchive-0.0.1.patch @@ -0,0 +1,71 @@ +--- vdr-2.0.3-orig/menu.c 2013-04-27 12:32:28.000000000 +0200 ++++ vdr-2.0.3/menu.c 2013-09-22 18:22:19.440344000 +0200 +@@ -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 ++{ ++ cMenuRecordingItem *item; ++}; ++ + // --- cMenuEditCaItem ------------------------------------------------------- + + class cMenuEditCaItem : public cMenuEditIntItem { +@@ -2348,6 +2360,13 @@ + if (ri->IsDirectory()) + Open(); + else { ++ cPlugin *hddarchivePlugin = cPluginManager::GetPlugin("hddarchive"); ++ Hddarchive_play_v1_0 data; ++ data.item = ri; ++ if (hddarchivePlugin) { ++ hddarchivePlugin->Service("Hddarchive-play_v1.0", &data); ++ return osEnd; ++ } + cReplayControl::SetRecording(ri->Recording()->FileName()); + return osReplay; + } +@@ -2374,6 +2393,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 +4862,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!")); diff --git a/patches/vdr-2.1.1-hddarchive-0.0.1.patch b/patches/vdr-2.1.1-hddarchive-0.0.1.patch new file mode 100644 index 0000000..0226094 --- /dev/null +++ b/patches/vdr-2.1.1-hddarchive-0.0.1.patch @@ -0,0 +1,71 @@ +--- vdr-2.1.1-orig/menu.c 2013-08-21 12:45:11.000000000 +0200 ++++ vdr-2.1.1/menu.c 2013-09-20 15:33:04.629102337 +0200 +@@ -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 ++{ ++ cMenuRecordingItem *item; ++}; ++ + // --- cMenuEditCaItem ------------------------------------------------------- + + class cMenuEditCaItem : public cMenuEditIntItem { +@@ -2348,6 +2360,13 @@ + if (ri->IsDirectory()) + Open(); + else { ++ cPlugin *hddarchivePlugin = cPluginManager::GetPlugin("hddarchive"); ++ Hddarchive_play_v1_0 data; ++ data.item = ri; ++ if (hddarchivePlugin) { ++ hddarchivePlugin->Service("Hddarchive-play_v1.0", &data); ++ return osEnd; ++ } + cReplayControl::SetRecording(ri->Recording()->FileName()); + return osReplay; + } +@@ -2374,6 +2393,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()); +@@ -4854,7 +4884,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!")); |