audiomvp.o audiowin.o \
videomvp.o videowin.o \
osdmvp.o osdwin.o \
- surfacemvp.o surfacewin.o
+ surfacemvp.o surfacewin.o \
+ ledmvp.o ledwin.o
OBJECTS = $(OBJECTS1) $(OBJECTS2)
{
if (instance) return;
instance = this;
- initted = 0;
- device = 0;
}
Led::~Led()
{
return instance;
}
-
-int Led::init(int tdevice)
-{
- if (initted) return 0;
- initted = 1;
- device = tdevice;
- return 1;
-}
-
-int Led::shutdown()
-{
- if (!initted) return 0;
- initted = 0;
- device = 0;
- return 1;
-}
-
-int Led::on()
-{
- if (!initted) return 0;
-
- int result = ioctl(device, IR_SET_LED, 0);
- Log::getInstance()->log("LED", Log::DEBUG, "led on %i %i", device, result);
- if (result >= 0) return 1;
- else return 0;
-}
-
-int Led::off()
-{
- if (!initted) return 0;
-
- int result = ioctl(device, IR_SET_LED, 1);
- Log::getInstance()->log("LED", Log::DEBUG, "led off %i %i", device, result);
- if (result >= 0) return 1;
- else return 0;
-}
#define LED_H
#include <stdio.h>
-#include <sys/ioctl.h>
-
-#include "stb.h"
-
-#include "log.h" // temp while fix led on bug!
class Led
{
public:
Led();
- ~Led();
+ virtual ~Led();
static Led* getInstance();
- int init(int device);
- int shutdown();
+ virtual int init(int device)=0;
+ virtual int shutdown()=0;
- int on();
- int off();
+ virtual int on()=0;
+ virtual int off()=0;
- private:
+ protected:
static Led* instance;
- int initted;
- int device;
};
#endif
--- /dev/null
+/*
+ Copyright 2004-2005 Chris Tallon
+
+ This file is part of VOMP.
+
+ VOMP is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ VOMP is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with VOMP; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include "ledmvp.h"
+
+LedMVP::LedMVP()
+{
+ if (instance) return;
+ initted = 0;
+ device = 0;
+}
+
+LedMVP::~LedMVP()
+{
+}
+
+int LedMVP::init(int tdevice)
+{
+ if (initted) return 0;
+ initted = 1;
+ device = tdevice;
+ return 1;
+}
+
+int LedMVP::shutdown()
+{
+ if (!initted) return 0;
+ initted = 0;
+ device = 0;
+ return 1;
+}
+
+int LedMVP::on()
+{
+ if (!initted) return 0;
+
+ int result = ioctl(device, IR_SET_LED, 0);
+ if (result >= 0) return 1;
+ else return 0;
+}
+
+int LedMVP::off()
+{
+ if (!initted) return 0;
+
+ int result = ioctl(device, IR_SET_LED, 1);
+ if (result >= 0) return 1;
+ else return 0;
+}
--- /dev/null
+/*
+ Copyright 2004-2005 Chris Tallon
+
+ This file is part of VOMP.
+
+ VOMP is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ VOMP is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with VOMP; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#ifndef LEDMVP_H
+#define LEDMVP_H
+
+#include <stdio.h>
+#include <sys/ioctl.h>
+
+#include "led.h"
+#include "stb.h"
+
+class LedMVP : public Led
+{
+ public:
+ LedMVP();
+ ~LedMVP();
+
+ int init(int device);
+ int shutdown();
+
+ int on();
+ int off();
+
+ private:
+ int initted;
+ int device;
+};
+
+#endif
--- /dev/null
+/*
+ Copyright 2004-2005 Chris Tallon
+
+ This file is part of VOMP.
+
+ VOMP is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ VOMP is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with VOMP; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include "ledwin.h"
+
+LedWin::LedWin()
+{
+ if (instance) return;
+ initted = 0;
+}
+
+LedWin::~LedWin()
+{
+}
+
+int LedWin::init(int tdevice)
+{
+ if (initted) return 0;
+ initted = 1;
+ return 1;
+}
+
+int LedWin::shutdown()
+{
+ if (!initted) return 0;
+ initted = 0;
+ return 1;
+}
+
+int LedWin::on()
+{
+ if (!initted) return 0;
+ return 0;
+}
+
+int LedWin::off()
+{
+ if (!initted) return 0;
+ return 0;
+}
--- /dev/null
+/*
+ Copyright 2004-2005 Chris Tallon
+
+ This file is part of VOMP.
+
+ VOMP is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ VOMP is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with VOMP; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#ifndef LEDWIN_H
+#define LEDWIN_H
+
+#include <stdio.h>
+
+#include "led.h"
+
+class LedWin : public Led
+{
+ public:
+ LedWin();
+ ~LedWin();
+
+ int init(int device);
+ int shutdown();
+
+ int on();
+ int off();
+
+ private:
+ int initted;
+};
+
+#endif
#include "defines.h"
#include "log.h"
#include "remote.h"
-#include "led.h"
#include "mtd.h"
#include "timers.h"
#include "vdr.h"
#include "viewman.h"
#include "command.h"
-#ifndef WIN32
- #include "osdmvp.h"
- #include "audiomvp.h"
- #include "videomvp.h"
-#else
+#ifdef WIN32
+ #include "ledwin.h"
#include "osdwin.h"
#include "audiowin.h"
#include "videowin.h"
+#else
+ #include "ledmvp.h"
+ #include "osdmvp.h"
+ #include "audiomvp.h"
+ #include "videomvp.h"
#endif
void sighandler(int signalReceived);
logger = new Log();
remote = new Remote();
mtd = new Mtd();
- led = new Led();
timers = new Timers();
vdr = new VDR();
-#ifndef WIN32
- osd = new OsdMVP();
- audio = new AudioMVP();
- video = new VideoMVP();
-#else
+#ifdef WIN32
+ led = new LedWin();
osd = new OsdWin();
audio = new AudioWin();
video = new VideoWin();
+#else
+ led = new LedMVP();
+ osd = new OsdMVP();
+ audio = new AudioMVP();
+ video = new VideoMVP();
#endif
viewman = new ViewMan();
command = new Command();
#include "osd.h"
SurfaceMVP::SurfaceMVP(int id)
+: Surface(id)
{
- if (id == SCREEN) screen = this;
-
fdOsd = Osd::getInstance()->getFD();
memset(&surface, 0, sizeof(osd_surface_t));
memset(&surface.sfc, 0, sizeof(stbgfx_sfc_t));
#include "osd.h"
SurfaceWin::SurfaceWin(int id)
+: Surface(id)
{
}