OBJECTS2 = remote.o led.o mtd.o video.o audio.o osd.o surface.o \
remotemvp.o remotewin.o \
- audiomvp.o audiowin.o \
+ ledmvp.o ledwin.o \
+ mtdmvp.o mtdwin.o \
videomvp.o videowin.o \
+ audiomvp.o audiowin.o \
osdmvp.o osdwin.o \
- surfacemvp.o surfacewin.o \
- ledmvp.o ledwin.o
+ surfacemvp.o surfacewin.o
OBJECTS = $(OBJECTS1) $(OBJECTS2)
#include "defines.h"
#include "log.h"
-#include "mtd.h"
#include "timers.h"
#include "vdr.h"
#include "viewman.h"
#include "command.h"
#ifdef WIN32
+ #include "mtdwin.h"
#include "remotewin.h"
#include "ledwin.h"
#include "osdwin.h"
#include "audiowin.h"
#include "videowin.h"
#else
+ #include "mtdmvp.h"
#include "remotemvp.h"
#include "ledmvp.h"
#include "osdmvp.h"
// Init global vars ------------------------------------------------------------------------------------------------
logger = new Log();
- mtd = new Mtd();
timers = new Timers();
vdr = new VDR();
#ifdef WIN32
+ mtd = new MtdWin();
remote = new RemoteWin();
led = new LedWin();
osd = new OsdWin();
audio = new AudioWin();
video = new VideoWin();
#else
+ mtd = new MtdMVP();
remote = new RemoteMVP();
led = new LedMVP();
osd = new OsdMVP();
{
if (instance) return;
instance = this;
- initted = 0;
}
Mtd::~Mtd()
{
return instance;
}
-
-int Mtd::init(char* device)
-{
- if (initted) return 0;
- initted = 1;
-
- int fd;
-
- if ((fd = open(device, O_RDONLY)) < 0)
- {
- initted = 0;
- return 0;
- }
-
- if (read(fd, data, 8192) < 8192)
- {
- initted = 0;
- return 0;
- }
-
- close(fd);
-
- logit();
-
- return 1;
-}
-
-int Mtd::shutdown()
-{
- if (!initted) return 0;
- initted = 0;
- return 1;
-}
-
-short Mtd::getPALorNTSC()
-{
- return data[2119];
-}
-
-short Mtd::getAspect()
-{
- return data[2125];
-}
-
-short Mtd::getFlicker()
-{
- return data[2124];
-}
-
-short Mtd::getBootLogoOutput()
-{
- return data[2116];
-}
-
-short Mtd::getBootLogoDisplayVideoLeft()
-{
- return data[2120];
-}
-
-short Mtd::getBootLogoDisplayVideoUpper()
-{
- return data[2121];
-}
-
-short Mtd::getBootLogoDisplayVideoWidth()
-{
- return data[2122];
-}
-
-short Mtd::getBootLogoDisplayVideoHeight()
-{
- return data[2123];
-}
-
-void Mtd::logit()
-{
- Log* logger = Log::getInstance();
-
- logger->log("MTD", Log::DEBUG, "Mode: %i", getPALorNTSC());
- logger->log("MTD", Log::DEBUG, "Aspect: %i", getAspect());
- logger->log("MTD", Log::DEBUG, "Flicker: %i", getFlicker());
- logger->log("MTD", Log::DEBUG, "Bootlogo output: %i", getBootLogoOutput());
- logger->log("MTD", Log::DEBUG, "Bootlogo display video left: %i", getBootLogoDisplayVideoLeft());
- logger->log("MTD", Log::DEBUG, "Bootlogo display video upper: %i", getBootLogoDisplayVideoUpper());
- logger->log("MTD", Log::DEBUG, "Bootlogo display video width: %i", getBootLogoDisplayVideoWidth());
- logger->log("MTD", Log::DEBUG, "Bootlogo display video height: %i", getBootLogoDisplayVideoHeight());
-}
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-// Information for this class taken from the mvpmc project - thanks
-
-/*
- discussion on short positions:
- http://www.shspvr.com/smf/index.php?topic=3765.30
-
-It says:
-1 = NTSC/composite
-2 = PAL/Scart
-3 = PAL/Composite
-
-But with PAL/Scart/RGB I get a value of 1
-
-So, am assuming:
-0 = NTSC / composite
-1 = PAL / scart rgb
-2 = PAL / scart composite
-*/
-
#ifndef MTD_H
#define MTD_H
-#include <unistd.h>
-#include <fcntl.h>
-
-#include "log.h"
+#include <stdio.h>
class Mtd
{
public:
Mtd();
- ~Mtd();
+ virtual ~Mtd();
static Mtd* getInstance();
- int init(char* device);
- int shutdown();
+ virtual int init(char* device)=0;
+ virtual int shutdown()=0;
- short getPALorNTSC();
- short getAspect();
- short getFlicker();
- short getBootLogoOutput();
- short getBootLogoDisplayVideoLeft();
- short getBootLogoDisplayVideoUpper();
- short getBootLogoDisplayVideoWidth();
- short getBootLogoDisplayVideoHeight();
+ virtual short getPALorNTSC()=0;
- void logit();
-
- private:
+ protected:
static Mtd* instance;
- int initted;
-
- short data[4096];
};
#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 "mtdmvp.h"
+
+MtdMVP::MtdMVP()
+{
+ if (instance) return;
+ initted = 0;
+}
+
+MtdMVP::~MtdMVP()
+{
+}
+
+int MtdMVP::init(char* device)
+{
+ if (initted) return 0;
+ initted = 1;
+
+ int fd;
+
+ if ((fd = open(device, O_RDONLY)) < 0)
+ {
+ initted = 0;
+ return 0;
+ }
+
+ if (read(fd, data, 8192) < 8192)
+ {
+ initted = 0;
+ return 0;
+ }
+
+ close(fd);
+
+ //logit();
+
+ return 1;
+}
+
+int MtdMVP::shutdown()
+{
+ if (!initted) return 0;
+ initted = 0;
+ return 1;
+}
+
+short MtdMVP::getPALorNTSC()
+{
+ return data[2119];
+}
+
+/*
+short MtdMVP::getAspect()
+{
+ return data[2125];
+}
+
+short MtdMVP::getFlicker()
+{
+ return data[2124];
+}
+
+short MtdMVP::getBootLogoOutput()
+{
+ return data[2116];
+}
+
+short MtdMVP::getBootLogoDisplayVideoLeft()
+{
+ return data[2120];
+}
+
+short MtdMVP::getBootLogoDisplayVideoUpper()
+{
+ return data[2121];
+}
+
+short MtdMVP::getBootLogoDisplayVideoWidth()
+{
+ return data[2122];
+}
+
+short MtdMVP::getBootLogoDisplayVideoHeight()
+{
+ return data[2123];
+}
+
+void MtdMVP::logit()
+{
+ Log* logger = Log::getInstance();
+
+ logger->log("MTD", Log::DEBUG, "Mode: %i", getPALorNTSC());
+ logger->log("MTD", Log::DEBUG, "Aspect: %i", getAspect());
+ logger->log("MTD", Log::DEBUG, "Flicker: %i", getFlicker());
+ logger->log("MTD", Log::DEBUG, "Bootlogo output: %i", getBootLogoOutput());
+ logger->log("MTD", Log::DEBUG, "Bootlogo display video left: %i", getBootLogoDisplayVideoLeft());
+ logger->log("MTD", Log::DEBUG, "Bootlogo display video upper: %i", getBootLogoDisplayVideoUpper());
+ logger->log("MTD", Log::DEBUG, "Bootlogo display video width: %i", getBootLogoDisplayVideoWidth());
+ logger->log("MTD", Log::DEBUG, "Bootlogo display video height: %i", getBootLogoDisplayVideoHeight());
+}
+*/
--- /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
+*/
+
+// Information for this class taken from the mvpmc project - thanks
+
+/*
+ discussion on short positions:
+ http://www.shspvr.com/smf/index.php?topic=3765.30
+
+It says:
+1 = NTSC/composite
+2 = PAL/Scart
+3 = PAL/Composite
+
+But with PAL/Scart/RGB I get a value of 1
+
+So, am assuming:
+0 = NTSC / composite
+1 = PAL / scart rgb
+2 = PAL / scart composite
+*/
+
+#ifndef MTDMVP_H
+#define MTDMVP_H
+
+#include <unistd.h>
+#include <fcntl.h>
+
+#include "log.h"
+#include "mtd.h"
+
+class MtdMVP : public Mtd
+{
+ public:
+ MtdMVP();
+ ~MtdMVP();
+
+ int init(char* device);
+ int shutdown();
+
+ short getPALorNTSC();
+
+ /*
+ short getAspect();
+ short getFlicker();
+ short getBootLogoOutput();
+ short getBootLogoDisplayVideoLeft();
+ short getBootLogoDisplayVideoUpper();
+ short getBootLogoDisplayVideoWidth();
+ short getBootLogoDisplayVideoHeight();
+
+ void logit();
+ */
+
+ private:
+ int initted;
+
+ short data[4096];
+};
+
+#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 "mtdwin.h"
+
+MtdWin::MtdWin()
+{
+ if (instance) return;
+ initted = 0;
+}
+
+MtdWin::~MtdWin()
+{
+}
+
+int MtdWin::init(char* device)
+{
+ if (initted) return 0;
+ initted = 1;
+ return 1;
+}
+
+int MtdWin::shutdown()
+{
+ if (!initted) return 0;
+ initted = 0;
+ return 1;
+}
+
+short MtdWin::getPALorNTSC()
+{
+ 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 MTDWIN_H
+#define MTDWIN_H
+
+#include "mtd.h"
+
+class MtdWin : public Mtd
+{
+ public:
+ MtdWin();
+ ~MtdWin();
+
+ int init(char* device);
+ int shutdown();
+
+ short getPALorNTSC();
+
+ private:
+ int initted;
+};
+
+#endif