diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2000-03-11 18:00:00 +0100 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2000-03-11 18:00:00 +0100 |
commit | 6feebe674c09b65e43012bf439c201cfb65aa82c (patch) | |
tree | 85cf564cd0f48e44431a93ea2f22bba7fc924e98 /osm.c | |
parent | c475c637aba78366763cb122673ff836dd9e7e85 (diff) | |
download | vdr-patch-lnbsharing-6feebe674c09b65e43012bf439c201cfb65aa82c.tar.gz vdr-patch-lnbsharing-6feebe674c09b65e43012bf439c201cfb65aa82c.tar.bz2 |
Version 0.02vdr_osm-0.02
- Fixed compilation with only DEBUG_REMOTE=1.
- Menus now use colors.
- Support for "Red", "Green", "Yellow", "Blue" buttons.
- Channels and Timers can now be added, deleted and moved.
- Basic record/play file handling support (no actual record/playback yet).
Diffstat (limited to 'osm.c')
-rw-r--r-- | osm.c | 57 |
1 files changed, 28 insertions, 29 deletions
@@ -22,13 +22,13 @@ * * The project's page is at http://www.cadsoft.de/people/kls/vdr * - * $Id: osm.c 1.1 2000/02/19 13:36:48 kls Exp $ + * $Id: osm.c 1.2 2000/03/05 17:18:15 kls Exp $ */ #include "config.h" -#include "dvbapi.h" #include "interface.h" #include "menu.h" +#include "recording.h" #include "tools.h" #ifdef DEBUG_REMOTE @@ -52,39 +52,39 @@ int main(int argc, char *argv[]) cMenuMain *Menu = NULL; cTimer *Timer = NULL; - cDvbRecorder *Recorder = NULL; + cRecording *Recording = NULL; for (;;) { - //TODO check for free disk space and delete files if necessary/possible - // in case there is an ongoing recording - if (!Timer && (Timer = cTimer::GetMatch()) != NULL) { + AssertFreeDiskSpace(); + if (!Recording && !Timer && (Timer = cTimer::GetMatch()) != NULL) { + DELETENULL(Menu); + // make sure the timer won't be deleted: + Timer->SetRecording(true); // switch to channel: - isyslog(LOG_INFO, "timer %d start", Timer->Index() + 1); - delete Menu; - Menu = NULL; cChannel::SwitchTo(Timer->channel - 1); ChannelLocked = true; // start recording: - delete Recorder; - Recorder = new cDvbRecorder; - //TODO special filename handling!!! - if (!Recorder->Record(Timer->file, Timer->quality)) { - delete Recorder; - Recorder = NULL; - } + Recording = new cRecording(Timer); + if (!Recording->Record()) + DELETENULL(Recording); } - if (Timer) { - if (!Timer->Matches()) { - // stop recording: - if (Recorder) - Recorder->Stop(); - // end timer: - ChannelLocked = false; - isyslog(LOG_INFO, "timer %d stop", Timer->Index() + 1); - Timer = NULL; - //TODO switch back to the previous channel??? - //TODO clear single event timer??? + if (Timer && !Timer->Matches()) { + // stop recording: + if (Recording) { + Recording->Stop(); + DELETENULL(Recording); + } + // release channel and timer: + ChannelLocked = false; + Timer->SetRecording(false); + // clear single event timer: + if (Timer->IsSingleEvent()) { + DELETENULL(Menu); // must make sure no menu uses it + isyslog(LOG_INFO, "deleting timer %d", Timer->Index() + 1); + Timers.Del(Timer); + Timers.Save(); } + Timer = NULL; } eKeys key = Interface.GetKey(); if (Menu) { @@ -92,8 +92,7 @@ int main(int argc, char *argv[]) default: if (key != kMenu) break; case osBack: - case osEnd: delete Menu; - Menu = NULL; + case osEnd: DELETENULL(Menu); break; } } |