while (input_bufs_omx_all.size()>0) {
if (input_bufs_omx_free.size()>0) {
// Destroy one buffer
- vector<OMX_BUFFERHEADERTYPE*>::iterator itty=input_bufs_omx_all.begin();
+ std::vector<OMX_BUFFERHEADERTYPE*>::iterator itty=input_bufs_omx_all.begin();
OMX_BUFFERHEADERTYPE* cur_buf=input_bufs_omx_free.front();
for (; itty!= input_bufs_omx_all.end();itty++) {
if ((*itty)==cur_buf) {
int ChangeAudioDestination();
long long correctAudioLatency(long long pts,int addsamples,int srate);
- vector<OMX_BUFFERHEADERTYPE*> input_bufs_omx_all;
- list<OMX_BUFFERHEADERTYPE*> input_bufs_omx_free;
+ std::vector<OMX_BUFFERHEADERTYPE*> input_bufs_omx_all;
+ std::list<OMX_BUFFERHEADERTYPE*> input_bufs_omx_free;
Mutex input_bufs_omx_mutex;
OMX_BUFFERHEADERTYPE* cur_input_buf_omx;
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef AUDIOWIN_H
char * displayname;
char * friendlyname;
};
-using namespace std;
-typedef vector<AudioFilterDesc> AudioFilterDescList;
+typedef std::vector<AudioFilterDesc> AudioFilterDescList;
class AudioWin : public Audio
{
int BoxStack::addVideoDisplay(Boxx* box,VideoDisplay vd)
{
boxLock.Lock();
- videoStack.push(pair<Boxx*,VideoDisplay>(box,vd));
+ videoStack.push(std::pair<Boxx*,VideoDisplay>(box,vd));
boxLock.Unlock();
Video::getInstance()->setVideoDisplay(vd);
return 1;
if (backgroundColourSet) fillColour(backgroundColour);
Boxx* currentBoxx;
- vector<Boxx*>::iterator j;
+ std::vector<Boxx*>::iterator j;
//int count=0;
for (j = children.begin(); j != children.end(); j++)
{
void Boxx::remove(Boxx* oldChild)
{
- for(vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
+ for(std::vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
{
if (*i == oldChild)
{
void Boxx::removeVisibleChilds(Region & r)
{
- for(vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
+ for(std::vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
{
if ((*i)->getVisible())
{
bool Boxx::getVideoDisplay(VideoDisplay &vd)
{
- for(vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
+ for(std::vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
{
if ((*i)->getVideoDisplay(vd)) return true;
}
#include <stdio.h>
#include <vector>
-using namespace std;
-
#include "colour.h"
#include "region.h"
#include "message.h"
Surface *getSurface();
Boxx* parent;
Region area;
- vector<Boxx*> children;
+ std::vector<Boxx*> children;
VideoDisplay vdisplay;
void setParent(Boxx*);
#include "defines.h"
-using namespace std;
// A struct to hold a audio pid pair
typedef struct _apid
ULONG data2;
} apid;
-typedef vector<apid> APidList;
+typedef std::vector<apid> APidList;
class Channel
{
/*
- Copyright 2004-2005 Chris Tallon
+ Copyright 2004-2020 Chris Tallon
This file is part of VOMP.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef WIN32
{
if (instance) return;
instance = this;
- initted = 0;
- isStandby = 0;
- firstBoot = 1;
- signals = 0;
- connLost = NULL;
- crashed = false;
- server = NULL;
- wallpaper = wallpaper_pict = NULL;
}
Command::~Command()
int Command::init(bool tcrashed, char* tServer)
{
if (initted) return 0;
- initted = 1;
+ initted = true;
crashed = tcrashed;
server = tServer;
if (!logger || !boxstack || !remote)
{
- initted = 0;
+ initted = false;
return 0;
}
#ifndef WIN32
pthread_mutex_init(&masterLock, NULL);
#else
- masterLock=CreateMutex(NULL,FALSE,NULL);
+ masterLock = CreateMutex(NULL, FALSE, NULL);
#endif
return 1;
int Command::shutdown()
{
if (!initted) return 0;
- initted = 0;
+ initted = false;
return 1;
}
void Command::stop()
{
-// VDR::getInstance()->cancelFindingServer();
- logger->log("Command", Log::NOTICE, "Command stop1...");
-
+ logger->log("Command", Log::NOTICE, "stop");
udp.shutdown();
- logger->log("Command", Log::NOTICE, "Command stop2...");
- irun = 0;
+ irun = false;
}
void Command::doWallpaper()
{
- Video* video = Video::getInstance();
-
- // Blue background
- Boxx* bbg = new Boxx();
- bbg->setSize(video->getScreenWidth(), video->getScreenHeight());
- bbg->createBuffer();
- bbg->fillColour(DrawStyle::WALLPAPER);
- boxstack->add(bbg);
- boxstack->update(bbg);
- boxstack->remove(bbg);
-
- // Wallpaper
- wallpaper = new Boxx();
- wallpaper->setSize(video->getScreenWidth(), video->getScreenHeight());
- wallpaper->createBuffer();
- wallpaper ->setBackgroundColour(DrawStyle::WALLPAPER);
-
-
+ Video* video = Video::getInstance();
+ // Blue background
+ Boxx* bbg = new Boxx();
+ bbg->setSize(video->getScreenWidth(), video->getScreenHeight());
+ bbg->createBuffer();
+ bbg->fillColour(DrawStyle::WALLPAPER);
+ boxstack->add(bbg);
+ boxstack->update(bbg);
+ boxstack->remove(bbg);
- wallpaper_pict = new WJpegTYPE();
- wallpaper_pict->setSize(video->getScreenWidth(), video->getScreenHeight());
+ // Wallpaper
+ wallpaper = new Boxx();
+ wallpaper->setSize(video->getScreenWidth(), video->getScreenHeight());
+ wallpaper->createBuffer();
+ wallpaper->setBackgroundColour(DrawStyle::WALLPAPER);
+ wallpaper_pict = new WJpegTYPE();
+ wallpaper_pict->setSize(video->getScreenWidth(), video->getScreenHeight());
- if (video->getFormat() == Video::PAL)
- {
- logger->log("Command", Log::DEBUG, "PAL wallpaper selected");
+ if (video->getFormat() == Video::PAL)
+ {
+ logger->log("Command", Log::DEBUG, "PAL wallpaper selected");
#ifndef _MIPS_ARCH
- wallpaper_pict->init("/wallpaperPAL.jpg");
+ wallpaper_pict->init("/wallpaperPAL.jpg");
#else
- wallpaper_pict->init("wallpaperPAL.jpg");
+ wallpaper_pict->init("wallpaperPAL.jpg");
#endif
- }
- else
- {
- logger->log("Command", Log::DEBUG, "NTSC wallpaper selected");
- wallpaper_pict->init("/wallpaperNTSC.jpg");
- }
- if (DrawStyle::WALLPAPER.alpha) {
- wallpaper_pict->setVisible(true);
- } else {
- wallpaper_pict->setVisible(false);
- }
- wallpaper->add(wallpaper_pict);
- wallpaper->draw();
-
- boxstack->add(wallpaper);
- boxstack->update(wallpaper);
-
- OsdVector* osdv=dynamic_cast<OsdVector*>(Osd::getInstance());
- if (osdv)
- {
- osdv->updateBackgroundColor(DrawStyle::WALLPAPER);
- }
+ }
+ else
+ {
+ logger->log("Command", Log::DEBUG, "NTSC wallpaper selected");
+ wallpaper_pict->init("/wallpaperNTSC.jpg");
+ }
+
+ if (DrawStyle::WALLPAPER.alpha)
+ wallpaper_pict->setVisible(true);
+ else
+ wallpaper_pict->setVisible(false);
+ wallpaper->add(wallpaper_pict);
+ wallpaper->draw();
+ boxstack->add(wallpaper);
+ boxstack->update(wallpaper);
+ OsdVector* osdv = dynamic_cast<OsdVector*>(Osd::getInstance());
+ if (osdv) osdv->updateBackgroundColor(DrawStyle::WALLPAPER);
}
void Command::run()
{
if (!initted) return;
- irun = 1;
+ irun = true;
#ifndef WIN32
mainPid = getpid();
#endif
doWallpaper();
// End of startup. Lock the mutex and put the first view up
-// logger->log("Command", Log::DEBUG, "WANT LOCK");
#ifndef WIN32
pthread_mutex_lock(&masterLock);
#else
WaitForSingleObject(masterLock, INFINITE );
#endif
- //logger->log("Command", Log::DEBUG, "LOCKED");
if (crashed)
{
while(irun)
{
// unlock and wait
- //logger->log("Command", Log::DEBUG, "UNLOCK");
#ifndef WIN32
pthread_mutex_unlock(&masterLock);
#else
// something happened, lock and process
if (signals) processSignals(); // If a signal arrived process now.
- // logger->log("Command", Log::DEBUG, "WANT LOCK");
#ifndef WIN32
pthread_mutex_lock(&masterLock);
#else
WaitForSingleObject(masterLock, INFINITE );
#endif
- // logger->log("Command", Log::DEBUG, "LOCK");
- if ((button == Remote::NA_NONE) /*|| (button == Remote::NA_UNKNOWN)*/) continue;
+ if (button == Remote::NA_NONE) continue;
if (button != Remote::NA_SIGNAL) handleCommand(button);
processMessageQueue();
-
}
- //logger->log("Command", Log::DEBUG, "UNLOCK");
#ifndef WIN32
pthread_mutex_unlock(&masterLock);
#else
ReleaseMutex(masterLock);
#endif
-
-
boxstack->removeAllExceptWallpaper();
boxstack->remove(wallpaper);
delete wallpaper_pict; wallpaper_pict = NULL; wallpaper = NULL;
-
}
void Command::setSignal(int signalReceived)
// locking the mutex ensures that the master thread is waiting on getButtonPress
- //logger->log("Command", Log::DEBUG, "WANT LOCK");
#ifndef WIN32
pthread_mutex_lock(&masterLock);
#else
WaitForSingleObject(masterLock, INFINITE );
#endif
- //logger->log("Command", Log::DEBUG, "LOCK");
MessageQueue::postMessage(m);
#ifndef WIN32
((RemoteWin*)Remote::getInstance())->Signal();
ReleaseMutex(masterLock);
#endif
- //logger->log("Command", Log::DEBUG, "UNLOCK");
}
-void Command::postMessageNoLock(Message* m)
+void Command::postMessageNoLock(Message* m) // FIXME - get rid of this if the sending-to-MessageQueue idea pans out
{
// As above but use this one if this message is being posted because of a button press
// the mutex is already locked, locking around postMessage is not needed as the
{
// Used for Windows mouse events
- //logger->log("Command", Log::DEBUG, "TRY LOCK");
#ifndef WIN32
if (pthread_mutex_trylock(&masterLock) != EBUSY)
{
- //logger->log("Command", Log::DEBUG, "LOCK");
MessageQueue::postMessage(m);
#ifndef __ANDROID__
kill(mainPid, SIGURG);
((RemoteAndroid*)Remote::getInstance())->Signal();
#endif
pthread_mutex_unlock(&masterLock);
- //logger->log("Command", Log::DEBUG, "UNLOCK");
return true;
}
else
case Message::VDR_CONNECTED:
{
- doJustConnected((VConnect*)m->from);
+ doJustConnected(static_cast<VConnect*>(m->from));
break;
}
case Message::SCREENSHOT:
}
case Message::NEW_PICTURE:
{
- //Log::getInstance()->log("Command", Log::DEBUG, "TVMedia NEW_PICTURE");
- OsdVector *osdv=dynamic_cast<OsdVector*>(Osd::getInstance());
- if (osdv) {
- osdv->informPicture(m->tag,m->parameter.handle);
- }
-
- } break;
+ //Log::getInstance()->log("Command", Log::DEBUG, "TVMedia NEW_PICTURE");
+ OsdVector* osdv = dynamic_cast<OsdVector*>(Osd::getInstance());
+ if (osdv) osdv->informPicture(m->tag, m->parameter.handle);
+ break;
+ }
case Message::NEW_PICTURE_STATIC:
{
- //Log::getInstance()->log("Command", Log::DEBUG, "TVMedia NEW_PICTURE %x %x",m->tag,m->parameter.num);
- OsdVector *osdv=dynamic_cast<OsdVector*>(Osd::getInstance());
- if (osdv) {
- osdv->informPicture(((unsigned long long)m->tag)<<32LL,m->parameter.handle);
- }
-
- } break;
+ //Log::getInstance()->log("Command", Log::DEBUG, "TVMedia NEW_PICTURE %x %x",m->tag,m->parameter.num);
+ OsdVector* osdv = dynamic_cast<OsdVector*>(Osd::getInstance());
+ if (osdv) osdv->informPicture(((unsigned long long)m->tag)<<32LL,m->parameter.handle);
+ break;
+ }
}
}
else
void Command::handleCommand(int button)
{
if (isStandby && (button != Remote::POWER)
- && (button != Remote::POWERON) && (button != Remote::POWEROFF)) return;
+ && (button != Remote::POWERON)
+ && (button != Remote::POWEROFF)) return;
+
if (!connLost && boxstack->handleCommand(button)) return; // don't send to boxstack if connLost
// command was not handled
case Remote::VOLUMEUP:
case Remote::VOLUMEDOWN:
{
- if (remote->handlesVolume()) {
- if (button==Remote::DF_LEFT || button==Remote::VOLUMEDOWN)
- remote->volumeDown();
- else remote->volumeUp();
- } else {
- VVolume* v = new VVolume();
- boxstack->add(v);
- v->handleCommand(button); // this will draw+show
- }
+ if (remote->handlesVolume())
+ {
+ if (button==Remote::DF_LEFT || button==Remote::VOLUMEDOWN)
+ remote->volumeDown();
+ else
+ remote->volumeUp();
+ }
+ else
+ {
+ VVolume* v = new VVolume();
+ boxstack->add(v);
+ v->handleCommand(button); // this will draw+show
+ }
return;
}
case Remote::MUTE:
{
- if (remote->handlesVolume()) {
- remote->volumeMute();
- } else {
- VMute* v = new VMute();
- v->draw();
- boxstack->add(v);
- boxstack->update(v);
- }
+ if (remote->handlesVolume())
+ {
+ remote->volumeMute();
+ }
+ else
+ {
+ VMute* v = new VMute();
+ v->draw();
+ boxstack->add(v);
+ boxstack->update(v);
+ }
return;
}
case Remote::POWER:
}
else
{
- doPowerOff();
+ doPowerOff();
}
}
Video::getInstance()->signalOn();
Led::getInstance()->on();
Remote::getInstance()->changePowerState(true);
- isStandby = 0;
-
+ isStandby = false;
VConnect* vconnect = new VConnect(server);
boxstack->add(vconnect);
VDR::getInstance()->disconnect();
Led::getInstance()->off();
Remote::getInstance()->changePowerState(false);
- isStandby = 1;
+ isStandby = true;
Sleeptimer::getInstance()->shutdown();
#ifdef WIN32
stop(); //different behavoiur on windows, we exit
boxstack->update(crash);
}
-int Command::getLangPref(bool subtitle,const char* langcode)
+int Command::getLangPref(bool subtitle, const char* langcode)
{
- vector<struct ASLPref>::iterator itty=langcodes.begin();
- char templangcode[4];
- templangcode[0]=langcode[0];
- templangcode[1]=langcode[1];
- templangcode[2]=langcode[2];
- templangcode[3]='\0';
- int langpos =0;
- while (itty != langcodes.end()) {
- size_t pos=(*itty).langcode.find(templangcode);
- if (pos != string::npos) {
- //vector<struct ASLPref>::iterator itty2=langcodes.begin();
- for (unsigned int i=0; i<langcodes.size();i++) {
- int pref=0;
- if (subtitle) {
- pref=langcodes[i].subtitlepref;
- } else {
- pref=langcodes[i].audiopref;
- }
- if (pref < 0) break;
-
- if (subtitle) {
- if (langcodes[i].subtitlepref==langpos) {
- return i;
- }
- } else {
- if (langcodes[i].audiopref==langpos) {
- return i;
- }
- }
- }
- break;
- }
- itty++;
- langpos++;
- }
- return langcodes.size(); //neutral
+ std::vector<struct ASLPref>::iterator itty=langcodes.begin();
+ char templangcode[4];
+ templangcode[0] = langcode[0];
+ templangcode[1] = langcode[1];
+ templangcode[2] = langcode[2];
+ templangcode[3] = '\0';
+ int langpos = 0;
+ while (itty != langcodes.end())
+ {
+ size_t pos = (*itty).langcode.find(templangcode);
+ if (pos != std::string::npos)
+ {
+ //vector<struct ASLPref>::iterator itty2=langcodes.begin();
+ for (unsigned int i = 0; i < langcodes.size(); i++)
+ {
+ int pref = 0;
+ if (subtitle)
+ pref = langcodes[i].subtitlepref;
+ else
+ pref = langcodes[i].audiopref;
+ if (pref < 0) break;
+
+ if (subtitle)
+ {
+ if (langcodes[i].subtitlepref==langpos) return i;
+ }
+ else
+ {
+ if (langcodes[i].audiopref==langpos) return i;
+ }
+ }
+ break;
+ }
+ itty++;
+ langpos++;
+ }
+ return langcodes.size(); //neutral
}
void Command::doJustConnected(VConnect* vconnect)
if (config) delete[] config;
config = vdr->configLoad("Advanced", "Skin Name");
- if (config) {
- const char **skinnames=SkinFactory::getSkinNames();
- for (int i=0;i<SkinFactory::getNumberofSkins();i++) {
- if (!STRCASECMP(config, skinnames[i])) {
- SkinFactory::InitSkin(i);
- break;
- }
- }
- delete[] config;
- if (wallpaper && wallpaper_pict) {
- if (DrawStyle::WALLPAPER.alpha) {
- wallpaper_pict->setVisible(true);
- } else {
- wallpaper_pict->setVisible(false);
- }
- wallpaper->draw();
- boxstack->update(wallpaper);
- }
-
- } else {
- SkinFactory::InitSkin(0);
+ if (config)
+ {
+ const char **skinnames=SkinFactory::getSkinNames();
+ for (int i=0;i<SkinFactory::getNumberofSkins();i++)
+ {
+ if (!STRCASECMP(config, skinnames[i]))
+ {
+ SkinFactory::InitSkin(i);
+ break;
+ }
+ }
+ delete[] config;
+
+ if (wallpaper && wallpaper_pict)
+ {
+ if (DrawStyle::WALLPAPER.alpha)
+ wallpaper_pict->setVisible(true);
+ else
+ wallpaper_pict->setVisible(false);
+
+ wallpaper->draw();
+ boxstack->update(wallpaper);
+ }
+ }
+ else
+ {
+ SkinFactory::InitSkin(0);
}
// See if config says to override video format (PAL/NTSC)
#ifndef __ANDROID__
//we do not init twice
- osd->init((char*)("/dev/stbgfx"));
+ osd->init();
#endif
// Put the wallpaper back
// Power off if first boot and config says so
if (firstBoot)
{
- firstBoot = 0;
+ firstBoot = false;
logger->log("Command", Log::DEBUG, "Load power after boot");
// Set recording list type
- advmenues=false;
-#ifdef ADVANCED_MENUES
+#ifdef ADVANCED_MENUES
config = vdr->configLoad("Advanced", "Menu type");
if (config)
{
- if (!STRCASECMP(config, "Advanced"))
- {
- logger->log("Command", Log::INFO, "Switching to Advanced menu");
- advmenues=true;
-
- }
- else
- {
- logger->log("Command", Log::INFO, "Switching to Classic menu");
- advmenues=false;
- }
- delete[] config;
+ if (!STRCASECMP(config, "Advanced"))
+ {
+ logger->log("Command", Log::INFO, "Switching to Advanced menu");
+ advMenus = true;
+ }
+ else
+ {
+ logger->log("Command", Log::INFO, "Switching to Classic menu");
+ advMenus = false;
+ }
+ delete[] config;
}
else
{
- logger->log("Command", Log::INFO, "Config General/menu type not found");
- advmenues=true;
+ logger->log("Command", Log::INFO, "Config General/menu type not found");
+ advMenus = true;
}
#endif
/*
- Copyright 2004-2005 Chris Tallon
+ Copyright 2004-2020 Chris Tallon
This file is part of VOMP.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef COMMAND_H
int subtitlepref;
};
-typedef vector<struct ASLPref> ASLPrefList;
-
-#define SIG_INT 1
-#define SIG_TERM 2
-#define SIG_USR1 4
-#define SIG_USR2 8
-#define SIG_URG 16
+typedef std::vector<struct ASLPref> ASLPrefList;
class Command : public MessageQueue
{
int init(bool crashed = false, char* server = NULL);
int shutdown();
void run();
- void stop();
void doReboot();
void postMessage(Message* m); // override of MessageQueue::postMessage
void postMessageNoLock(Message* m); // override of MessageQueue::postMessage
void setSignal(int signalReceived);
void connectionLost();
- void setAdvMenues(bool adv) {advmenues=adv;};
- bool advMenues() { return advmenues;};
+ void setAdvMenus(bool adv) { advMenus = adv; };
+ bool isAdvMenus() { return advMenus; };
int getLangPref(bool subtitle,const char* langcode);
void setSubDefault(int subon) {subdefault=subon;};
int getSubDefault() { return subdefault;};
ASLPrefList &getASLList(){return langcodes;};
private:
+ void stop();
void handleCommand(int);
void processSignals();
void doStandby();
HANDLE masterLock;
HANDLE mainPid; //Window
#endif
- UCHAR initted;
- UCHAR irun;
- UCHAR isStandby;
- UCHAR firstBoot;
- ULONG signals;
+ bool initted{};
+ bool irun{};
+ bool isStandby{};
+ bool firstBoot{true};
+ int signals{};
Log* logger;
BoxStack* boxstack;
Remote* remote;
- Boxx* wallpaper;
- WJpeg* wallpaper_pict;
- VInfo* connLost;
- bool crashed;
- char* server;
+ Boxx* wallpaper{};
+ WJpeg* wallpaper_pict{};
+ VInfo* connLost{};
+ bool crashed{};
+ char* server{};
- bool advmenues;
+ bool advMenus{};
ASLPrefList langcodes;
int subdefault;
UDP udp;
void processMessage(Message* m);
+
+ const static int SIG_INT{1};
+ const static int SIG_TERM{2};
+ const static int SIG_USR1{4};
+ const static int SIG_USR2{8};
+ const static int SIG_URG{16};
+
};
#endif
//lirc?
#define Led_TYPE LedRaspberry //this is device dependent
#define Osd_TYPE OsdOpenVG // This OpenGL ES 2.0, in the moment only for raspberry, but might be splitted for other devices
- #define OsdStartDev ""
#define Audio_TYPE AudioOMX // This is Audio based on OpenMax and libav for decoding
#define Video_TYPE VideoOMX // This is Video based on OpenMax
#define RemoteStartDev "/dev/rawir"
#define Led_TYPE
#define Osd_TYPE
- #define OsdStartDev "/dev/stbgfx"
#define Audio_TYPE
#define Video_TYPE
#define Surface_TYPE
#define RemoteStartDev "/dev/lircd"
#define Led_TYPE LedMVP
#define Osd_TYPE OsdDirectFB
- #define OsdStartDev ""
#define Audio_TYPE AudioNMT
#define Video_TYPE VideoNMT
#define Surface_TYPE SurfaceDirectFB //deprecated
void Directory::sort(bool chronoSortOrder)
{
// Sort the directory order
- ::sort(dirList.begin(), dirList.end(), DirectorySorter());
+ std::sort(dirList.begin(), dirList.end(), DirectorySorter());
// Sort the recordings order
if (chronoSortOrder)
- ::sort(recList.begin(), recList.end(), RecordingSorterChrono());
+ std::sort(recList.begin(), recList.end(), RecordingSorterChrono());
else
- ::sort(recList.begin(), recList.end(), RecordingSorterAlpha());
+ std::sort(recList.begin(), recList.end(), RecordingSorterAlpha());
// Now get the dirs to sort themselves! oh I love recursion.
for(UINT i = 0; i < dirList.size(); i++) dirList[i]->sort(chronoSortOrder);
#include <stdio.h>
#include <vector>
#include <algorithm>
-using namespace std;
#include "defines.h"
#include "recording.h"
class Directory;
-typedef vector<Directory*> DirectoryList;
-typedef vector<Recording*> RecordingList;
+typedef std::vector<Directory*> DirectoryList;
+typedef std::vector<Recording*> RecordingList;
class Directory
{
#endif
};
-using namespace std;
-typedef list<MediaPacket> MediaPacketList;
+typedef std::list<MediaPacket> MediaPacketList;
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef DSALLOCATOR_H
#define DSALLOCATOR_H
#include <queue>
#include <vector>
-
-using namespace std;
-
#include <winsock2.h>
#include <d3d9.h>
//The Allocator and Presenter for VMR9 is also a Presnter for EVR
class DsAllocator: public IVMRSurfaceAllocator9, IVMRImagePresenter9, Mutex,IMFVideoDeviceID,
- IMFTopologyServiceLookupClient,public IMFVideoPresenter,IMFGetService, IQualProp {
-public:
- DsAllocator();
- virtual ~DsAllocator();
-
- virtual HRESULT STDMETHODCALLTYPE StartPresenting(DWORD_PTR userid);
- virtual HRESULT STDMETHODCALLTYPE StopPresenting(DWORD_PTR userid);
- virtual HRESULT STDMETHODCALLTYPE PresentImage(DWORD_PTR userid,VMR9PresentationInfo* presinf);
-
- virtual HRESULT STDMETHODCALLTYPE InitializeDevice(DWORD_PTR userid,
- VMR9AllocationInfo* allocinf,DWORD* numbuf);
- virtual HRESULT STDMETHODCALLTYPE TerminateDevice(DWORD_PTR userid);
- virtual HRESULT STDMETHODCALLTYPE GetSurface(DWORD_PTR userid,DWORD surfindex,DWORD surfflags, IDirect3DSurface9** surf);
- virtual HRESULT STDMETHODCALLTYPE AdviseNotify(IVMRSurfaceAllocatorNotify9* allnoty);
-
-
- virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID refiid,void ** obj);
- virtual ULONG STDMETHODCALLTYPE AddRef();
- virtual ULONG STDMETHODCALLTYPE Release();
+ IMFTopologyServiceLookupClient,public IMFVideoPresenter,IMFGetService, IQualProp {
+ public:
+ DsAllocator();
+ virtual ~DsAllocator();
+
+ virtual HRESULT STDMETHODCALLTYPE StartPresenting(DWORD_PTR userid);
+ virtual HRESULT STDMETHODCALLTYPE StopPresenting(DWORD_PTR userid);
+ virtual HRESULT STDMETHODCALLTYPE PresentImage(DWORD_PTR userid,VMR9PresentationInfo* presinf);
+
+ virtual HRESULT STDMETHODCALLTYPE InitializeDevice(DWORD_PTR userid, VMR9AllocationInfo* allocinf,DWORD* numbuf);
+ virtual HRESULT STDMETHODCALLTYPE TerminateDevice(DWORD_PTR userid);
+ virtual HRESULT STDMETHODCALLTYPE GetSurface(DWORD_PTR userid,DWORD surfindex,DWORD surfflags, IDirect3DSurface9** surf);
+ virtual HRESULT STDMETHODCALLTYPE AdviseNotify(IVMRSurfaceAllocatorNotify9* allnoty);
+
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID refiid,void ** obj);
+ virtual ULONG STDMETHODCALLTYPE AddRef();
+ virtual ULONG STDMETHODCALLTYPE Release();
void LostDevice(IDirect3DDevice9 *d3ddev, IDirect3D9* d3d);
- /* EVR members */
- virtual HRESULT STDMETHODCALLTYPE GetDeviceID(IID *pDid);
+ /* EVR members */
+ virtual HRESULT STDMETHODCALLTYPE GetDeviceID(IID *pDid);
- virtual HRESULT STDMETHODCALLTYPE InitServicePointers(IMFTopologyServiceLookup *plooky);
- virtual HRESULT STDMETHODCALLTYPE ReleaseServicePointers();
+ virtual HRESULT STDMETHODCALLTYPE InitServicePointers(IMFTopologyServiceLookup *plooky);
+ virtual HRESULT STDMETHODCALLTYPE ReleaseServicePointers();
- virtual HRESULT STDMETHODCALLTYPE ProcessMessage(MFVP_MESSAGE_TYPE mess,ULONG_PTR mess_para);
+ virtual HRESULT STDMETHODCALLTYPE ProcessMessage(MFVP_MESSAGE_TYPE mess,ULONG_PTR mess_para);
- virtual HRESULT STDMETHODCALLTYPE OnClockStart(MFTIME systime,LONGLONG startoffset);
- virtual HRESULT STDMETHODCALLTYPE OnClockStop(MFTIME systime);
- virtual HRESULT STDMETHODCALLTYPE OnClockPause(MFTIME systime);
- virtual HRESULT STDMETHODCALLTYPE OnClockRestart(MFTIME systime);
- virtual HRESULT STDMETHODCALLTYPE OnClockSetRate(MFTIME systime,float rate);
- virtual HRESULT STDMETHODCALLTYPE GetCurrentMediaType(IMFVideoMediaType **mtype);
+ virtual HRESULT STDMETHODCALLTYPE OnClockStart(MFTIME systime,LONGLONG startoffset);
+ virtual HRESULT STDMETHODCALLTYPE OnClockStop(MFTIME systime);
+ virtual HRESULT STDMETHODCALLTYPE OnClockPause(MFTIME systime);
+ virtual HRESULT STDMETHODCALLTYPE OnClockRestart(MFTIME systime);
+ virtual HRESULT STDMETHODCALLTYPE OnClockSetRate(MFTIME systime,float rate);
+ virtual HRESULT STDMETHODCALLTYPE GetCurrentMediaType(IMFVideoMediaType **mtype);
- virtual HRESULT STDMETHODCALLTYPE GetService(const GUID &guid,const IID &iid,LPVOID *obj);
+ virtual HRESULT STDMETHODCALLTYPE GetService(const GUID &guid,const IID &iid,LPVOID *obj);
virtual HRESULT STDMETHODCALLTYPE get_FramesDrawn(int *val);
virtual HRESULT STDMETHODCALLTYPE get_AvgFrameRate(int *val);
virtual HRESULT STDMETHODCALLTYPE get_DevSyncOffset(int *val);
virtual HRESULT STDMETHODCALLTYPE get_FramesDroppedInRenderer(int *val);
- void GetNextSurface(LPDIRECT3DSURFACE9 *surf,DWORD *waittime);
- void DiscardSurfaceandgetWait(DWORD *waittime);
-
+ void GetNextSurface(LPDIRECT3DSURFACE9 *surf,DWORD *waittime);
+ void DiscardSurfaceandgetWait(DWORD *waittime);
protected:
- void RenegotiateEVRMediaType();
- void AllocateEVRSurfaces();
- void FlushEVRSamples();
- void GetEVRSamples();
-
- void ResetSyncOffsets();
- void CalcSyncOffsets(int sync);
- void CalcJitter(int jitter);
-
- vector<IDirect3DSurface9*> surfaces;
- queue<IMFSample*> emptyevrsamples;
- queue<IMFSample*> fullevrsamples;
- //CCritSec objCritSec;
- IVMRSurfaceAllocatorNotify9* surfallocnotify;
- void CleanupSurfaces();
- LONG refcount;
- DWORD vheight;
- DWORD vwidth;
- bool inevrmode;
- bool endofstream;
+ void RenegotiateEVRMediaType();
+ void AllocateEVRSurfaces();
+ void FlushEVRSamples();
+ void GetEVRSamples();
+
+ void ResetSyncOffsets();
+ void CalcSyncOffsets(int sync);
+ void CalcJitter(int jitter);
+
+ std::vector<IDirect3DSurface9*> surfaces;
+ std::queue<IMFSample*> emptyevrsamples;
+ std::queue<IMFSample*> fullevrsamples;
+ //CCritSec objCritSec;
+ IVMRSurfaceAllocatorNotify9* surfallocnotify;
+ void CleanupSurfaces();
+ LONG refcount;
+ DWORD vheight;
+ DWORD vwidth;
+ bool inevrmode;
+ bool endofstream;
bool start_get_evr_samples;
- IMFTransform* mftransform;
- IMediaEventSink* mediasink;
- IMFClock* mfclock;
- IMFMediaType *mfmediatype;
-
- static const int n_stats=126;
- int sync_offset[n_stats];
- int jitter_offset[n_stats];
- unsigned int sync_pos;
- unsigned int jitter_pos;
- int framesdrawn;
- int framesdropped;
- int avg_sync_offset;
- int dev_sync_offset;
- int jitter;
+ IMFTransform* mftransform;
+ IMediaEventSink* mediasink;
+ IMFClock* mfclock;
+ IMFMediaType *mfmediatype;
+
+ static const int n_stats=126;
+ int sync_offset[n_stats];
+ int jitter_offset[n_stats];
+ unsigned int sync_pos;
+ unsigned int jitter_pos;
+ int framesdrawn;
+ int framesdropped;
+ int avg_sync_offset;
+ int dev_sync_offset;
+ int jitter;
int avgfps;
LONGLONG lastdelframe;
-
-
-
};
-
-
-
-
-
-
-
#endif
#include "defines.h"
-using namespace std;
-
-
class EDReceiver //(implementation in eventdispatcher.cc)
{
friend class EventDispatcher;
{
public:
- typedef list<EDReceiver*> EDRL;
+ typedef std::list<EDReceiver*> EDRL;
EventDispatcher();
virtual ~EventDispatcher() {};
#include "vdr.h"
#include "log.h"
-using namespace std;
I18n::trans_table I18n::Translations;
int I18n::initialize(void)
VDR *vdr = VDR::getInstance();
char *lang = vdr->configLoad("General", "LangCode");
lang_code_list list = vdr->getLanguageList();
- string code;
+ std::string code;
if (lang && list.count(lang) > 0)
code = lang;
else
const char* I18n::translate(const char *s)
{
- string str = s;
+ std::string str = s;
if (Translations.count(str) == 0) return s;
return Translations[str].c_str();
// This isn't ideal. A call to initialize() invalidates
while (input_bufs_omx_all.size()>0) {
if (input_bufs_omx_free.size()>0) {
// Destroy one buffer
- vector<OMX_BUFFERHEADERTYPE*>::iterator itty=input_bufs_omx_all.begin();
+ std::vector<OMX_BUFFERHEADERTYPE*>::iterator itty=input_bufs_omx_all.begin();
OMX_BUFFERHEADERTYPE* cur_buf=input_bufs_omx_free.front();
for (; itty!= input_bufs_omx_all.end();itty++) {
if ((*itty)==cur_buf) {
private:
static OMX_ERRORTYPE EmptyBufferDone_OMX(OMX_IN OMX_HANDLETYPE hcomp,OMX_IN OMX_PTR appdata,OMX_IN OMX_BUFFERHEADERTYPE* bulibaver);
- static OMX_ERRORTYPE FillBufferDone_OMX(OMX_IN OMX_HANDLETYPE hcomp, OMX_IN OMX_PTR appdata,OMX_IN OMX_BUFFERHEADERTYPE* bulibaver);
+ static OMX_ERRORTYPE FillBufferDone_OMX(OMX_IN OMX_HANDLETYPE hcomp, OMX_IN OMX_PTR appdata,OMX_IN OMX_BUFFERHEADERTYPE* bulibaver);
- bool intDecodePicture(LoadIndex index, unsigned char * buffer, unsigned int length, EGLPictureCreator* egl_pict, VideoOMX *video);
+ bool intDecodePicture(LoadIndex index, unsigned char * buffer, unsigned int length, EGLPictureCreator* egl_pict, VideoOMX *video);
void ReturnEmptyOMXBuffer(OMX_BUFFERHEADERTYPE* bulibaver);
void ReturnFillOMXBuffer(OMX_BUFFERHEADERTYPE* buffer);
- OMX_HANDLETYPE omx_imag_decode;
- OMX_HANDLETYPE omx_egl_render;
+ OMX_HANDLETYPE omx_imag_decode;
+ OMX_HANDLETYPE omx_egl_render;
- OMX_U32 omx_image_input_port;
- OMX_U32 omx_image_output_port;
+ OMX_U32 omx_image_input_port;
+ OMX_U32 omx_image_output_port;
- OMX_U32 omx_egl_input_port;
- OMX_U32 omx_egl_output_port;
+ OMX_U32 omx_egl_input_port;
+ OMX_U32 omx_egl_output_port;
- int AllocateCodecsOMX( unsigned char * buffer, unsigned int length);
- int DeAllocateCodecsOMX();
+ int AllocateCodecsOMX( unsigned char * buffer, unsigned int length);
+ int DeAllocateCodecsOMX();
- int PrepareInputBufsOMX(bool setportdef, unsigned char * buffer, unsigned int length);
- int DestroyInputBufsOMX();
- int DestroyInputBufsOMXwhilePlaying();
+ int PrepareInputBufsOMX(bool setportdef, unsigned char * buffer, unsigned int length);
+ int DestroyInputBufsOMX();
+ int DestroyInputBufsOMXwhilePlaying();
- enum ImageFormats {
- Unsupported,
- Jpeg,
- PNG
- };
+ enum ImageFormats {
+ Unsupported,
+ Jpeg,
+ PNG
+ };
- enum ImageFormats curformat;
+ enum ImageFormats curformat;
- vector<OMX_BUFFERHEADERTYPE*> input_bufs_omx_all;
- list<OMX_BUFFERHEADERTYPE*> input_bufs_omx_free;
- //list<OMX_BUFFERHEADERTYPE*> output_bufs_omx_full;
- Mutex input_bufs_omx_mutex;
+ std::vector<OMX_BUFFERHEADERTYPE*> input_bufs_omx_all;
+ std::list<OMX_BUFFERHEADERTYPE*> input_bufs_omx_free;
+ //list<OMX_BUFFERHEADERTYPE*> output_bufs_omx_full;
+ Mutex input_bufs_omx_mutex;
bool omx_running;
bool omx_first_frame;
char L_VPE_OMX_EGL_REND[128];
protected:
- OsdVector::PictureInfo pictInf;
- bool pictInfValid;
+ OsdVector::PictureInfo pictInf;
+ bool pictInfValid;
};
shutdown(1);
}
- success = osd->init((void*)OsdStartDev);
+ success = osd->init();
if (success)
{
logger->log("Core", Log::INFO, "OSD module initialised");
#include "defines.h"
-using namespace std;
-
class Mark
{
public:
int pos;
};
-typedef vector<Mark*> MarkList;
+typedef std::vector<Mark*> MarkList;
#endif
#define MEDIA_H
-#include <vector>
-using namespace std;
#include <stdio.h>
#include <string.h>
+#include <vector>
+
#include "defines.h"
#include "serialize.h"
};
-typedef vector<Media*> MediaListI;
+typedef std::vector<Media*> MediaListI;
/**
* the MediaList - containing a root URI and
#include "log.h"
#include "abstractoption.h"
-using namespace std;
class WTabBar;
class VDR;
class Option;
bool setIntOption(const char * name, UINT value) ;
private:
bool saveOption(Option *option);
- vector<Option*> myOptions;
+ std::vector<Option*> myOptions;
Option * findOption(const char* name);
static MediaOptions * instance;
WOptionPane *pane;
#include <vector>
-using namespace std;
#include <stdio.h>
#include <string.h>
#include "mediaprovider.h"
private:
MediaProvider * providerById(ULONG id);
- typedef vector<MediaProviderHolder *> Tplist;
+ typedef std::vector<MediaProviderHolder *> Tplist;
Tplist plist;
struct channelInfo {
ULONG providerId;
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
#include "messagequeue.h"
#include "message.h"
#include "log.h"
+MessageQueue* MessageQueue::instance{};
+
+MessageQueue::MessageQueue() { instance = this; }
+
+MessageQueue::~MessageQueue() { instance = NULL; }
+
+MessageQueue* MessageQueue::getInstance() { return instance; }
+
void MessageQueue::postMessage(Message* m)
{
messages.push(m);
-// Log::getInstance()->log("MessageQueue", Log::DEBUG, "have stored message %lu in queue", m->message);
}
void MessageQueue::processMessageQueue()
{
m = messages.front();
messages.pop();
-// Log::getInstance()->log("MessageQueue", Log::DEBUG, "retrieved message from queue");
processMessage(m);
delete m;
}
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef MESSAGEQUEUE_H
#define MESSAGEQUEUE_H
#include <queue>
-using namespace std;
class Message;
-typedef queue<Message*> MQueue;
+typedef std::queue<Message*> MQueue;
class MessageQueue
{
public:
- MessageQueue() {};
- virtual ~MessageQueue() {};
+ MessageQueue();
+ virtual ~MessageQueue();
+
+ static MessageQueue* getInstance();
virtual void postMessage(Message* m);
virtual void postMessageNoLock(Message* m)=0;
virtual void processMessage(Message* m)=0;
private:
+ static MessageQueue* instance;
+
MQueue messages;
};
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef OPTION_H
#include <vector>
class Option;
-using namespace std;
-typedef vector<Option*> Options;
+typedef std::vector<Option*> Options;
class Option
{
virtual ~Osd();
static Osd* getInstance();
- virtual int init(void* device)=0;
+ virtual int init()=0;
virtual int shutdown()=0;
virtual int restore() { return 1; };
virtual int stopUpdate() { return 1; };
return 0;
}
-int OsdDirectFB::init(void* device)
+int OsdDirectFB::init()
{
if (initted) return 0;
OsdDirectFB();
~OsdDirectFB();
- int init(void* device);
+ int init();
int shutdown();
int getFD();
return (Surface*)new SurfaceOpenGL();
}
-int OsdOpenGL::init(void* device)
+int OsdOpenGL::init()
{
if (initted) return 0;
Video* video = Video::getInstance();
- //window=*((HWND*)device);
-
- // May be this device specific part should go to a device specific child class
//init broadcom chipset (Move to video?)
OsdOpenGL();
virtual ~OsdOpenGL();
- int init(void* device);
+ int init();
int shutdown();
int getFD();
// pointed at anyway, so it's correctly not working?!
if (!fontnames.size()) {
- vector<char*>::iterator itty=fontnames.begin();
+ std::vector<char*>::iterator itty=fontnames.begin();
while (itty!=fontnames.end()) {
free((void*)*itty);
if (fontnames_keys.size()) {
- vector<char*>::iterator itty=fontnames_keys.begin();
+ std::vector<char*>::iterator itty=fontnames_keys.begin();
while (itty!=fontnames_keys.end()) {
free((void*)*itty);
itty++;
-int OsdOpenVG::init(void* device)
+int OsdOpenVG::init()
{
if (initted) return 0;
reader.init();
- //Video* video = Video::getInstance();
- //window=*((HWND*)device);
-
- // May be this device specific part should go to a device specific child class
//init broadcom chipset (Move to video?)
FT_UInt glyph;
font_height=ft_face->size->metrics.height/256.f;
cur_char = FT_Get_First_Char(ft_face,&glyph);
- vector<VGubyte> segments;
- vector<VGfloat> coord;
+ std::vector<VGubyte> segments;
+ std::vector<VGfloat> coord;
segments.reserve(256);
coord.reserve(1024);
//Log::getInstance()->log("OSD", Log::DEBUG, "Create Glyph test %d %x %x %d",cur_char,font_data_end,font_data,glyph);
taskmutex.Lock();
if (vgresponses.size()>0)
{
- deque<OpenVGResponse>::iterator itty=vgresponses.begin();
+ std::deque<OpenVGResponse>::iterator itty=vgresponses.begin();
while (itty!=vgresponses.end())
{
if ((*itty).id==id) {
OsdOpenVG();
virtual ~OsdOpenVG();
- int init(void* device);
+ int init();
int shutdown();
int stopUpdate();
ImageIndex createMonoBitmap(void *base,int width,int height);
ImageIndex createImagePalette(int width,int height,const unsigned char *image_data,const unsigned int*palette_data);
void createPicture(struct PictureInfo& pict_inf);
- void destroyStyleRef(VectorHandle index);
- VectorHandle createStyleRef(const DrawStyle &c);
- bool getStaticImageData(unsigned int static_id, UCHAR **userdata, ULONG *length);
+ void destroyStyleRef(VectorHandle index);
+ VectorHandle createStyleRef(const DrawStyle &c);
+ bool getStaticImageData(unsigned int static_id, UCHAR **userdata, ULONG *length);
- void drawSetTrans(SurfaceCommands & sc);
- void executeDrawCommand(SVGCommand & command);
+ void drawSetTrans(SurfaceCommands & sc);
+ void executeDrawCommand(SVGCommand & command);
- void initPaths();
- void destroyPaths();
- VGPath std_paths[PIPoint+1];
- long long lastrendertime;
- void InternalRendering();
- void getScreenSize(int &width, int &height);
- void getRealScreenSize(int &width, int &height);
+ void initPaths();
+ void destroyPaths();
+ VGPath std_paths[PIPoint+1];
+ long long lastrendertime;
+ void InternalRendering();
+ void getScreenSize(int &width, int &height);
+ void getRealScreenSize(int &width, int &height);
- Mutex vgmutex;
- Mutex taskmutex;
- Signal vgtaskSignal;
- deque<OpenVGCommand> vgcommands;
- deque<OpenVGResponse> vgresponses;
+ Mutex vgmutex;
+ Mutex taskmutex;
+ Signal vgtaskSignal;
+ std::deque<OpenVGCommand> vgcommands;
+ std::deque<OpenVGResponse> vgresponses;
bool processTasks();
bool haveOpenVGResponse(unsigned int id,unsigned int * resp);
unsigned int putOpenVGCommand(OpenVGCommand& comm,bool wait);
VGFont vgfont;
VGFont vgttfont;
VGPaint vgttpaint;
- int loadFont(bool fontchange);
- map<unsigned int,float> font_exp_x;
- vector<char*> fontnames;
- vector<char*> fontnames_keys;
- char * cur_fontname;
+ int loadFont(bool fontchange);
+ std::map<unsigned int,float> font_exp_x;
+ std::vector<char*> fontnames;
+ std::vector<char*> fontnames_keys;
+ char* cur_fontname;
int clip_shift_x;
int clip_shift_y;
unsigned int loadTTchar(cTeletextChar c);
- map<unsigned int,int> tt_font_chars;
+ std::map<unsigned int,int> tt_font_chars;
-
- void threadMethod();
+ void threadMethod();
void threadPostStopCleanup();
-
- /* BCM specific */
+ /* BCM specific */
uint32_t display_height;
- uint32_t display_width;
- DISPMANX_DISPLAY_HANDLE_T bcm_display;
- DISPMANX_ELEMENT_HANDLE_T bcm_element;
- DISPMANX_ELEMENT_HANDLE_T bcm_background;
- DISPMANX_RESOURCE_HANDLE_T bcm_backres;
+ uint32_t display_width;
+ DISPMANX_DISPLAY_HANDLE_T bcm_display;
+ DISPMANX_ELEMENT_HANDLE_T bcm_element;
+ DISPMANX_ELEMENT_HANDLE_T bcm_background;
+ DISPMANX_RESOURCE_HANDLE_T bcm_backres;
- uint32_t mode;
+ uint32_t mode;
EGLDisplay egl_display;
surfaces_mutex.Lock();
//Now go through all surfaces and draw them
- list<SurfaceCommands>::iterator curdraw=scommands.begin();
+ std::list<SurfaceCommands>::iterator curdraw=scommands.begin();
while (curdraw!=scommands.end()) {
(*curdraw).commands.clear();
(*curdraw).commands.reserve(2048);
void OsdVector::drawSurfaces()
{
surfaces_mutex.Lock();
- list<SurfaceCommands*> todraw; //First figure out if a surfaces is below another surface
- list<SurfaceCommands>::iterator itty1=scommands.begin();
+ std::list<SurfaceCommands*> todraw; //First figure out if a surfaces is below another surface
+ std::list<SurfaceCommands>::iterator itty1=scommands.begin();
while (itty1!=scommands.end()) {
- list<SurfaceCommands>::iterator itty2=itty1;
+ std::list<SurfaceCommands>::iterator itty2=itty1;
itty2++;
bool hidden=false;
while (itty2!=scommands.end()) {
int swidth,sheight;
getScreenSize(swidth,sheight);
//Now go through all surfaces and draw them
- list<SurfaceCommands*>::iterator curdraw=todraw.begin();
+ std::list<SurfaceCommands*>::iterator curdraw=todraw.begin();
while (curdraw!=todraw.end()) {
drawSetTrans(*(*curdraw));
std::vector<SVGCommand>::iterator commands=(*(*curdraw)).commands.begin();
{
surfaces_mutex.Lock();
//First determine it is already in our system
- list<SurfaceCommands>::iterator itty=scommands.begin();
+ std::list<SurfaceCommands>::iterator itty=scommands.begin();
while (itty!=scommands.end()) {
if ((*itty).surf==surf) {
//decrease the references
{
surfaces_mutex.Lock();
//First determine it is already in our system
- list<SurfaceCommands>::iterator itty=scommands.begin();
+ std::list<SurfaceCommands>::iterator itty=scommands.begin();
while (itty!=scommands.end()) {
if ((*itty).surf==surf) {
dereferenceSVGCommand((*itty).commands);
loadindex_ref[ref]--;
if (loadindex_ref[ref]==0) {
//now check, if it is already loaded
- map<LoadIndex,ImageIndex>::iterator itty=tvmedias_loaded.find(ref);
+ std::map<LoadIndex,ImageIndex>::iterator itty=tvmedias_loaded.find(ref);
if ( itty != tvmedias_loaded.end()) {
removeImageRef((*itty).second); // remove lock
}
void OsdVector::cleanupOrphanedRefs()
{ // Do some garbage collection
- map<void *,ImageIndex>::iterator mitty=monobitmaps.begin();
+ std::map<void *,ImageIndex>::iterator mitty=monobitmaps.begin();
while (mitty!=monobitmaps.end()) {
- map<ImageIndex,int>::iterator curitty=images_ref.find((*mitty).second);
+ std::map<ImageIndex,int>::iterator curitty=images_ref.find((*mitty).second);
int count=(*curitty).second;
if (count==0) {
ImageIndex ref=(*curitty).first;
} else ++jitty;
}*/
- map<TVMediaInfo,ImageIndex>::iterator titty=tvmedias.begin();
+ std::map<TVMediaInfo,ImageIndex>::iterator titty=tvmedias.begin();
while (titty!=tvmedias.end()) {
- map<ImageIndex,int>::iterator curitty=images_ref.find((*titty).second);
+ std::map<ImageIndex,int>::iterator curitty=images_ref.find((*titty).second);
int count=(*curitty).second;
if (count==0) {
ImageIndex ref=(*curitty).first;
}
- map<TVMediaInfo,LoadIndex>::iterator litty=tvmedias_load.begin();
+ std::map<TVMediaInfo,LoadIndex>::iterator litty=tvmedias_load.begin();
while (litty!=tvmedias_load.end()) {
- map<LoadIndex,int>::iterator curitty=loadindex_ref.find((*litty).second);
+ std::map<LoadIndex,int>::iterator curitty=loadindex_ref.find((*litty).second);
int count=(*curitty).second;
if (count==0) {
tvmedias_load_inv.erase((*litty).second);
} else ++litty;
}
- list<ImageIndex>::iterator pitty=palettepics.begin();
+ std::list<ImageIndex>::iterator pitty=palettepics.begin();
while (pitty!=palettepics.end()) {
- map<ImageIndex,int>::iterator curitty=images_ref.find((*pitty));
+ std::map<ImageIndex,int>::iterator curitty=images_ref.find((*pitty));
int count=(*curitty).second;
if (count==0) {
ImageIndex ref=(*curitty).first;
} else ++pitty;
}
- map<ImageIndex,int>::iterator citty=images_ref.begin();
+ std::map<ImageIndex,int>::iterator citty=images_ref.begin();
while (citty!=images_ref.end()) {
int count=(*citty).second;
if (count==0) {
}
- map<DrawStyle, VectorHandle>::iterator sitty = styles.begin();
+ std::map<DrawStyle, VectorHandle>::iterator sitty = styles.begin();
while (sitty!=styles.end()) {
- map<VectorHandle, int>::iterator curitty = styles_ref.find((*sitty).second);
+ std::map<VectorHandle, int>::iterator curitty = styles_ref.find((*sitty).second);
int count=(*curitty).second;
if (count==0) {
VectorHandle ref = (*curitty).first;
surfaces_mutex.Lock();
TVMediaInfo tvmedia=tvmedias_load_inv[index];
if (imageIndex) {
- map<LoadIndex,int>::iterator itty=loadindex_ref.find(index);
+ std::map<LoadIndex,int>::iterator itty=loadindex_ref.find(index);
image_index=tvmedias[tvmedia]=imageIndex;
tvmedias_loaded[index]=image_index;
if (pict_incoming.size()) {
VDR_ResponsePacket *vresp=pict_incoming.front();
pict_incoming.pop();
- set<LoadIndex>::iterator setpos = invalid_loadindex.find(vresp->getStreamID());
+ std::set<LoadIndex>::iterator setpos = invalid_loadindex.find(vresp->getStreamID());
if (setpos != invalid_loadindex.end()) {
valid = false;
invalid_loadindex.erase(setpos);
} else if (pict_incoming_static.size()){
unsigned int static_id = pict_incoming_static.front();
pict_incoming_static.pop();
- set<LoadIndex>::iterator setpos = invalid_loadindex.find(((long long) static_id) << 32LL);
+ std::set<LoadIndex>::iterator setpos = invalid_loadindex.find(((long long) static_id) << 32LL);
if (setpos != invalid_loadindex.end()) {
valid = false;
invalid_loadindex.erase(setpos);
struct SurfaceCommands{
const SurfaceVector* surf;
- vector<SVGCommand> commands;
+ std::vector<SVGCommand> commands;
float x,y,w,h;
};
std::queue<unsigned int> pict_incoming_static;
std::list<PictureDecoder*> decoders;
std::map<LoadIndex,int> inform_fallback;
- set<LoadIndex> invalid_loadindex;
+ std::set<LoadIndex> invalid_loadindex;
bool picture_update;
- map<ImageIndex,int> images_ref;
- map<void *,ImageIndex> monobitmaps;
+ std::map<ImageIndex,int> images_ref;
+ std::map<void *,ImageIndex> monobitmaps;
//map<string,ImageIndex> jpegs;
- map<TVMediaInfo,ImageIndex> tvmedias;
- list<ImageIndex> palettepics;
+ std::map<TVMediaInfo,ImageIndex> tvmedias;
+ std::list<ImageIndex> palettepics;
- map<LoadIndex,int> loadindex_ref;
- map<TVMediaInfo,LoadIndex> tvmedias_load;
- map<LoadIndex,TVMediaInfo> tvmedias_load_inv;
- map<LoadIndex,ImageIndex> tvmedias_loaded;
+ std::map<LoadIndex,int> loadindex_ref;
+ std::map<TVMediaInfo,LoadIndex> tvmedias_load;
+ std::map<LoadIndex,TVMediaInfo> tvmedias_load_inv;
+ std::map<LoadIndex,ImageIndex> tvmedias_loaded;
virtual void destroyStyleRef(VectorHandle index) = 0;
- map<DrawStyle, VectorHandle> styles;
- map<VectorHandle, int> styles_ref;
- map<DrawStyle, VectorHandle>::iterator styles_lastit;
+ std::map<DrawStyle, VectorHandle> styles;
+ std::map<VectorHandle, int> styles_ref;
+ std::map<DrawStyle, VectorHandle>::iterator styles_lastit;
bool styles_lastit_valid;
- map<VectorHandle, int>::iterator styles_ref_lastit;
+ std::map<VectorHandle, int>::iterator styles_ref_lastit;
bool styles_ref_lastit_valid;
virtual VectorHandle createStyleRef(const DrawStyle &c) = 0;
virtual void executeDrawCommand(SVGCommand & command)=0;
-
-
std::list<SurfaceCommands> scommands;
Mutex surfaces_mutex;
void drawSurfaces();
};
-
-
-
#endif
return (Surface*)new SurfaceWin();
}
-int OsdWinPixel::init(void* device)
+int OsdWinPixel::init()
{
if (initted) return 0;
OsdWinPixel();
~OsdWinPixel();
- int init(void* device);
+ int init();
int shutdown();
int isInitialized() { return initted; }
-int OsdWinVector::init(void* device)
+int OsdWinVector::init()
{
if (initted) return 0;
reader.init();
OsdWinVector();
~OsdWinVector();
- int init(void* device);
+ int init();
int shutdown();
int isInitialized() { return initted; }
AFeed afeed;
ChannelList* chanList;
- queue<PLInstruction> instructions;
+ std::queue<PLInstruction> instructions;
const static UCHAR I_SETCHANNEL = 1;
const static UCHAR I_STOP = 2;
- queue<StreamChunk> streamChunks;
+ std::queue<StreamChunk> streamChunks;
bool initted;
TFeed tfeed;
ChannelList* chanList;
- queue<PLInstruction> instructions;
+ std::queue<PLInstruction> instructions;
const static UCHAR I_SETCHANNEL = 1;
const static UCHAR I_STOP = 2;
- queue<StreamChunk> streamChunks;
+ std::queue<StreamChunk> streamChunks;
bool initted;
char* c;
char* d;
- stack<char*> dirNamesStack;
+ std::stack<char*> dirNamesStack;
char* oneDirName;
bool gotProgName = false;
for(c = (name + strlen(name) - 1); c >= name; c--)
#include "abstractoption.h"
-using namespace std;
-typedef map<ULLONG,UCHAR> RemoteTranslationList;
+typedef std::map<ULLONG,UCHAR> RemoteTranslationList;
class Remote: public AbstractOption
{
#include <bcm_host.h>
-using namespace std;
using namespace CEC;
#include <libcec/cecloader.h>
-
-
-#define W_G_HCW(type,code) ( (((ULLONG)(type))<<32) | code)
+#define W_G_HCW(type,code) ((static_cast<ULLONG>(type) << 32) | code)
#define W_HCW_KC 1 /* key code as defined by kernel for keyboard and remotes through /dev/input */
#define W_HCW_CEC 2 /* HDMI_CEC */
// libcec4 API changed these params to pointers rather than copies, and the returns to void
// Otherwise, these two blocks of code are the same
-void RemoteLinux::cecLogMessage(void *param, const cec_log_message* message)
+void RemoteLinux::cecLogMessage(void* /* param */, const cec_log_message* message)
{
Log::getInstance()->log("Remote", Log::DEBUG, "CECLOG: %lld %d %s", message->time, message->level, message->message);
}
-void RemoteLinux::cecKeyPress(void*param, const cec_keypress* key)
+void RemoteLinux::cecKeyPress(void* /* param */, const cec_keypress* key)
{
//Log::getInstance()->log("Remote", Log::DEBUG, "Incoming cec key %d %d", key->keycode,key->duration);
- if (key->duration==0) ((RemoteLinux*)Remote::getInstance())->incomingCECkey(key->keycode);
+ if (key->duration==0) static_cast<RemoteLinux*>(Remote::getInstance())->incomingCECkey(key->keycode);
}
void RemoteLinux::cecCommand(void* /* param */, const cec_command* command)
switch (command->opcode) {
case CEC_OPCODE_STANDBY: {
if (command->initiator==CECDEVICE_TV) {
- ((RemoteLinux*)Remote::getInstance())->incomingPowerkey(POWEROFF);
+ static_cast<RemoteLinux*>(Remote::getInstance())->incomingPowerkey(POWEROFF);
}
} break;
case CEC_OPCODE_DECK_CONTROL: {
if (command->initiator==CECDEVICE_TV && command->parameters.size == 1
&& command->parameters[0]==CEC_DECK_CONTROL_MODE_STOP) {
- ((RemoteLinux*)Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_STOP);
+ static_cast<RemoteLinux*>(Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_STOP);
}
case CEC_OPCODE_PLAY: {
if (command->initiator==CECDEVICE_TV && command->parameters.size == 1) {
if (command->parameters[0]==CEC_PLAY_MODE_PLAY_FORWARD) {
- ((RemoteLinux*)Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PLAY);
+ static_cast<RemoteLinux*>(Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PLAY);
} else if (command->parameters[0]==CEC_PLAY_MODE_PLAY_STILL) {
- ((RemoteLinux*)Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PAUSE);
+ static_cast<RemoteLinux*>(Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PAUSE);
}
}
};
}
-void RemoteLinux::cecConfigurationChanged(void* /* param */, const libcec_configuration* config)
+void RemoteLinux::cecConfigurationChanged(void* /* param */, const libcec_configuration*)
{
Log::getInstance()->log("Remote", Log::DEBUG, "CECConfig:"/*,config->string()*/);
}
{
Log::getInstance()->log("Remote", Log::DEBUG, "CECSourceActivated: %d %d", address, activated);
if (activated==1) {
- ((RemoteLinux*)Remote::getInstance())->incomingPowerkey(POWERON);
+ static_cast<RemoteLinux*>(Remote::getInstance())->incomingPowerkey(POWERON);
}
}
{
curcec=keys;
hascurcec=true;
-
}
void RemoteLinux::incomingPowerkey(UCHAR key){
UCHAR TranslateHWCFixed(ULLONG code);
void InitKeymap();
- vector<int> devices;
+ std::vector<int> devices;
int num_loop;
CEC::ICECAdapter * cec_adap;
#ifndef SERIALIZE_H
#define SERIALIZE_H
-#include <vector>
-using namespace std;
+
#include <stdio.h>
#include <string.h>
+#include <vector>
+
#include "defines.h"
class SerializeBuffer {
int decodeByte(UCHAR &data);
private:
- UCHAR * start;
- UCHAR * end;
- UCHAR * current;
+ UCHAR* start;
+ UCHAR* end;
+ UCHAR* current;
ULONG size;
bool useMalloc;
bool owning;
TULONG,
TULLONG,
TCHAR } Ptypes;
- struct Pentry{
+ struct Pentry {
Ptypes ptype;
bool isDeserialized;
USHORT version;
}
bool isEqual(void *p,Ptypes t);
} ;
- vector<struct Pentry>list;
+ std::vector<struct Pentry>list;
Pentry *findEntry(void *p,Ptypes t);
};
SurfaceVector::~SurfaceVector()
{
osd->removeSurface(this);
- vector<SVGCommand>::iterator itty=commands.begin();
+ std::vector<SVGCommand>::iterator itty=commands.begin();
while (itty!=commands.end())
{
osd->removeStyleRef((*itty).getRef()); // We remove the Style reference, so that osd can free stuff
int SurfaceVector::removeCommands(float x,float y,float width,float height)
{
// we iterate through all old commands in order to remove commands hidden by this rectangle
- vector<SVGCommand>::iterator itty=commands.begin();
- vector<SVGCommand>::iterator remstart;
+ std::vector<SVGCommand>::iterator itty=commands.begin();
+ std::vector<SVGCommand>::iterator remstart;
bool remove=false;
float cx, cy, cw, ch;
cx = cy = 0.f;
void SurfaceVector::drawTTChar(int ox, int oy,int x, int y, cTeletextChar c)
{
command_mutex.Lock();
- vector<SVGCommand>::iterator itty=commands.begin();
+ std::vector<SVGCommand>::iterator itty=commands.begin();
while (itty!=commands.end())
{
if ((*itty).TTTest(ox,oy,x,y) ) {
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
/* Portions from vdr osdteletext plugin "txtrender.c": */
/***************************************************************************
{ return cTeletextChar((c&~CHAR)|chr); }
inline enumCharsets GetCharset()
- { return (enumCharsets)(c&CHARSET); }
+ { return static_cast<enumCharsets>(c&CHARSET); }
inline void SetCharset(enumCharsets charset)
{ c=(c&~CHARSET)|charset; }
inline cTeletextChar ToCharset(enumCharsets charset)
{ return cTeletextChar((c&~CHARSET)|charset); }
inline enumTeletextColor GetFGColor()
- { return (enumTeletextColor)((c&FGCOLOR) >> LowestSet32Bit(FGCOLOR)); }
+ { return static_cast<enumTeletextColor>((c&FGCOLOR) >> LowestSet32Bit(FGCOLOR)); }
inline void SetFGColor(enumTeletextColor fgc)
{ c=(c&~FGCOLOR) | (fgc << LowestSet32Bit(FGCOLOR)); }
inline cTeletextChar ToFGColor(enumTeletextColor fgc)
{ return cTeletextChar((c&~FGCOLOR) | (fgc << LowestSet32Bit(FGCOLOR))); }
inline enumTeletextColor GetBGColor()
- { return (enumTeletextColor)((c&BGCOLOR) >> LowestSet32Bit(BGCOLOR)); }
+ { return static_cast<enumTeletextColor>((c&BGCOLOR) >> LowestSet32Bit(BGCOLOR)); }
inline void SetBGColor(enumTeletextColor bgc)
{ c=(c&~BGCOLOR) | (bgc << LowestSet32Bit(BGCOLOR)); }
inline cTeletextChar ToBGColor(enumTeletextColor bgc)
{ return cTeletextChar((Dirty)?(c|DIRTY):(c&~DIRTY)); }
inline enumDblHeight GetDblHeight()
- { return (enumDblHeight)(c&DBLHEIGHT); }
+ { return static_cast<enumDblHeight>(c&DBLHEIGHT); }
inline void SetDblHeight(enumDblHeight dh)
{ c=(c&~(DBLHEIGHT)) | dh; }
inline cTeletextChar ToDblHeight(enumDblHeight dh)
{ return cTeletextChar((c&~(DBLHEIGHT)) | dh); }
inline enumDblWidth GetDblWidth()
- { return (enumDblWidth)(c&DBLWIDTH); }
+ { return static_cast<enumDblWidth>(c&DBLWIDTH); }
inline void SetDblWidth(enumDblWidth dw)
{ c=(c&~(DBLWIDTH)) | dw; }
inline cTeletextChar ToDblWidth(enumDblWidth dw)
};
-using namespace std;
-
-typedef list<TimerEvent*> TimerList;
+typedef std::list<TimerEvent*> TimerList;
class Timers : public Thread_TYPE
{
#include "boxstack.h"
#include "i18n.h"
#include "message.h"
-#include "command.h"
+#include "messagequeue.h"
#include "recinfo.h"
#include "log.h"
#include "channel.h"
m->from = this;
m->to = parent;
m->message = Message::CHILD_CLOSE;
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
}
void VAudioSelector::draw()
m->to = parent;
m->message = Message::SUBTITLE_CHANGE_CHANNEL;
m->parameter.num = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16 ;
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
} else {
asl.up();
asl.draw();
m->to = parent;
m->message = Message::AUDIO_CHANGE_CHANNEL;
m->parameter.num = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16 ;
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
}
return 2;
m->message = Message::SUBTITLE_CHANGE_CHANNEL;
m->parameter.num = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16
|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->streamtype &0xFF)<<24 ;
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
} else {
asl.down();
asl.draw();
m->message = Message::AUDIO_CHANGE_CHANNEL;
m->parameter.num = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16
|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->streamtype &0xFF)<<24 ;
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
}
return 2;
m2->to = parent;
m2->message = Message::AUDIO_CHANGE_CHANNEL;
m2->parameter.num = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16 ;
- Command::getInstance()->postMessageNoLock(m2);
+ MessageQueue::getInstance()->postMessageNoLock(m2);
}
return;
m2->to = parent;
m2->message = Message::SUBTITLE_CHANGE_CHANNEL;
m2->parameter.num = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16 ;
- Command::getInstance()->postMessageNoLock(m2);
+ MessageQueue::getInstance()->postMessageNoLock(m2);
}
return;
}
};
-
-typedef vector<AudioSubtitleChannel*> AudioSubtitleChannelList;
+typedef std::vector<AudioSubtitleChannel*> AudioSubtitleChannelList;
class VAudioSelector : public TBBoxx
{
void run();
void stop();
int numFound();
- vector<VDRServer>* getServers() { return &servers; }
+ std::vector<VDRServer>* getServers() { return &servers; }
private:
int pfds[2];
int sock;
std::thread receiveThread;
- vector<VDRServer> servers;
+ std::vector<VDRServer> servers;
};
#endif
return 1;
}
-void VDR::findServers(vector<VDRServer>& servers)
+void VDR::findServers(std::vector<VDRServer>& servers)
{
Wol* wol = Wol::getInstance();
findingServer = 1;
#if IPV6
vdp6.stop();
- vector<VDRServer>* servers6 = vdp6.getServers();
+ std::vector<VDRServer>* servers6 = vdp6.getServers();
// Add IPv6 found servers to servers vector, if not in servers already
// Free buffers from VDRServer objects if not taken. (Itching for that rewrite already).
{
char* c_code = vresp->extractString();
char* c_name = vresp->extractString();
- string code = c_code;
- string name = c_name;
+ std::string code = c_code;
+ std::string name = c_name;
CodeList[code] = name;
delete[] c_code;
delete[] c_name;
{
char* c_key = vresp->extractString();
char* c_text = vresp->extractString();
- string key = c_key;
- string text = c_text;
+ std::string key = c_key;
+ std::string text = c_text;
texts[key] = text;
delete[] c_key;
delete[] c_text;
class SeriesInfo;
class TVMediaInfo;
-
-using namespace std;
-
-typedef vector<Event*> EventList;
-typedef vector<Channel*> ChannelList;
-typedef vector<RecTimer*> RecTimerList;
+typedef std::vector<Event*> EventList;
+typedef std::vector<Channel*> ChannelList;
+typedef std::vector<RecTimer*> RecTimerList;
struct VDRServer
{
int init();
int shutdown();
- void findServers(vector<VDRServer>& servers);
+ void findServers(std::vector<VDRServer>& servers);
void cancelFindingServer();
void setServerIP(char*);
void setServerPort(USHORT);
I18n::lang_code_list getLanguageList();
- int getLanguageContent(const string code, I18n::trans_table&);
+ int getLanguageContent(const std::string code, I18n::trans_table&);
// end protocol functions
#include "remote.h"
#include "vchannellist.h"
-#include "command.h"
+#include "messagequeue.h"
#include "video.h"
#include "vepgsettimer.h"
#include "timers.h"
m->to = parent;
m->message = Message::CHANNEL_CHANGE;
m->parameter.num = (*chanList)[currentChannelIndex]->number;
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
}
setCurrentChannel();
m->to = parent;
m->message = Message::CHANNEL_CHANGE;
m->parameter.num = (*chanList)[currentChannelIndex]->number;
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
}
setCurrentChannel();
m->to = parent;
m->message = Message::CHANNEL_CHANGE;
m->parameter.num = (*chanList)[currentChannelIndex]->number;
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
}
setCurrentChannel();
Osd::getInstance()->shutdown();
selectVideoMode(0);
Osd::getInstance()->restore();
- Osd::getInstance()->init((void*) "");
+ Osd::getInstance()->init();
BoxStack::getInstance()->redrawAllBoxes();
initted = 1;
}
Log::getInstance()->log("Video", Log::NOTICE, "signalOn");
selectVideoMode(0);
Osd::getInstance()->restore();
- Osd::getInstance()->init((void*)"");
+ Osd::getInstance()->init();
BoxStack::getInstance()->redrawAllBoxes();
initted=1;
selectVideoMode(set_interlaced);
Osd::getInstance()->shutdown();
Osd::getInstance()->restore();
- Osd::getInstance()->init((void*)"");
+ Osd::getInstance()->init();
BoxStack::getInstance()->redrawAllBoxes();
initted=1;
}
int iend=(wait/5+1);
while (i<iend) {
omx_event_mutex.Lock();
- list<VPE_OMX_EVENT>::iterator itty=omx_events.begin();
+ std::list<VPE_OMX_EVENT>::iterator itty=omx_events.begin();
while (itty!=omx_events.end()) {
VPE_OMX_EVENT current=*itty;
int VideoOMX::clearEventsForComponent(OMX_HANDLETYPE handle)
{
omx_event_mutex.Lock();
- list<VPE_OMX_EVENT>::iterator itty=omx_events.begin();
+ std::list<VPE_OMX_EVENT>::iterator itty=omx_events.begin();
while (itty!=omx_events.end()) {
VPE_OMX_EVENT current=*itty;
if (current.handle==handle) { //this is ours
//Log::getInstance()->log("Video", Log::DEBUG, "Check stalled");
clock_mutex.Lock();
omx_event_mutex.Lock();
- list<VPE_OMX_EVENT>::iterator itty=omx_events.begin();
+ std::list<VPE_OMX_EVENT>::iterator itty=omx_events.begin();
while (itty!=omx_events.end()) {
VPE_OMX_EVENT current=*itty;
if (current.event_type==OMX_EventParamOrConfigChanged && current.data1==omx_codec_output_port
int i=0;
while (i<200/*1000*/) {
omx_event_mutex.Lock();
- list<VPE_OMX_EVENT>::iterator itty=omx_events.begin();
+ std::list<VPE_OMX_EVENT>::iterator itty=omx_events.begin();
while (itty!=omx_events.end()) {
VPE_OMX_EVENT current=*itty;
{
mediapackets.clear();
- list<MediaPacket>::const_iterator begin=mplist.begin();
- list<MediaPacket>::const_iterator itty=mplist.begin();
+ std::list<MediaPacket>::const_iterator begin=mplist.begin();
+ std::list<MediaPacket>::const_iterator itty=mplist.begin();
advance(itty,min(mplist.size(),10));
mediapackets.insert(mediapackets.begin(),begin,itty);//front
int setMode(UCHAR mode);
bool setVideoDisplay(VideoDisplay display);
int setTVsize(UCHAR size); // Is the TV a widescreen?
- UCHAR getTVsize();
+ UCHAR getTVsize();
void executePendingModeChanges();
int setDefaultAspect();
int DeAllocateCodecsOMX();
int FlushRenderingPipe();
- vector<OMX_BUFFERHEADERTYPE*> input_bufs_omx_all;
- list<OMX_BUFFERHEADERTYPE*> input_bufs_omx_free;
+ std::vector<OMX_BUFFERHEADERTYPE*> input_bufs_omx_all;
+ std::list<OMX_BUFFERHEADERTYPE*> input_bufs_omx_free;
Mutex input_bufs_omx_mutex;
OMX_BUFFERHEADERTYPE* cur_input_buf_omx;
Mutex omx_event_mutex;
Signal omx_event_ready_signal;
- list<VPE_OMX_EVENT> omx_events;
+ std::list<VPE_OMX_EVENT> omx_events;
bool omx_mpeg2;
bool omx_h264;
bool firstsynched;
- vector<MediaPacket> mediapackets;
+ std::vector<MediaPacket> mediapackets;
char L_VPE_OMX_CLOCK[128];
char L_VPE_OMX_H264_DECODER[128];
bool vmr9;
bool vmr9tested;
};
-using namespace std;
-typedef vector<VideoFilterDesc> VideoFilterDescList;
+typedef std::vector<VideoFilterDesc> VideoFilterDescList;
#endif
class DsSourceFilter;
#include "localmediafile.h"
#include "mediaoptions.h"
-using namespace std;
//a ref count holder
class MediaListHolder {
public:
}
};
-typedef vector<MediaDirectory*> MDirList;
+typedef std::vector<MediaDirectory*> MDirList;
class DirList {
private:
int current;
Timers::getInstance()->cancelTimer(this,1);
Timers::getInstance()->cancelTimer(this,2);
removeViewer();
- delete dirlist;
+ delete dirlist;
if (audiodirlist) delete audiodirlist;
Log::getInstance()->log("VMediaList::~VMediaList", Log::DEBUG, "finished");
}
playingAll=false;
switch(command)
{
- case Remote::ONE:
- {
+ case Remote::ONE:
+ {
sl.hintSetCurrent(0);
sl.draw();
updateSelection();
doShowingBar();
boxstack->update(this);
return 2;
- }
+ }
case Remote::DF_UP:
case Remote::UP:
{
#include "mediaoptions.h"
#endif
//#include "vdr.h"
-//#include "command.h"
+#include "command.h"
+#include "messagequeue.h"
VOpts::VOpts()
{
UINT suppconn = Video::getInstance()->getSupportedFormats();
if (suppconn) {
- int defaultch = 0;
+ UINT defaultch = 0;
if (suppconn & Video::COMPOSITERGB) {
defaultch = 0;
options3.push_back("RGB+composite");
UINT suppformats = Video::getInstance()->supportedTVFormats();
if (suppformats) {
- int defaultch = 0;
+ UINT defaultch = 0;
options16.push_back("NTSC");
options16keys.push_back("NTSC");
if (suppformats & Video::PAL) {
UINT supptvsize=Video::getInstance()->supportedTVsize();
if (supptvsize) {
- int defaultch=0;
+ UINT defaultch=0;
options4.push_back("4:3");
options4keys.push_back("4:3");
if (Video::ASPECT16X9 & supptvsize) {
// for (int i = 0; i < numPanes; i++) delete panes[i]; //Move to TabBar, Marten
delete[] panes;
- for(vector<Option*>::iterator j = options.begin(); j != options.end(); j++) delete *j;
+ for(std::vector<Option*>::iterator j = options.begin(); j != options.end(); j++) delete *j;
delete[] options2;
delete[] options2keys;
}
// Damn, and the dynamic idea was going *so* well...
//Whats about a check with typeid operator?
WOptionPane* wop;
- wop = (WOptionPane*)panes[0];
- wop->saveOpts();
- wop = (WOptionPane*)panes[1];
- wop->saveOpts();
- wop = (WOptionPane*)panes[2];
+ wop = static_cast<WOptionPane*>(panes[0]);
wop->saveOpts();
+ wop = static_cast<WOptionPane*>(panes[1]);
+ wop->saveOpts();
+ wop = static_cast<WOptionPane*>(panes[2]);
+ wop->saveOpts();
for (UINT i = 0; i < options.size(); i++)
Message* m = new Message();
m->message = Message::CHANGE_LANGUAGE;
m->to = Command::getInstance();
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
break;
}
case 3:
if (options[i]->userSetChoice == 1)
{
Log::getInstance()->log("Options", Log::DEBUG, "Setting classic menu");
- Command::getInstance()->setAdvMenues(false);
+ Command::getInstance()->setAdvMenus(false);
}
else
{
Log::getInstance()->log("Options", Log::DEBUG, "Setting advanced menu");
- Command::getInstance()->setAdvMenues(true);
+ Command::getInstance()->setAdvMenus(true);
}
break;
}
// be valid for the lifetime of the VOpts instance, because we
// create Option objects with pointers into LangCode's data.
- vector<const char*> options4; // this is for tv size
- vector<const char*> options4keys;
- vector<const char*> options3; // this is for tv size
- vector<const char*> options3keys;
- vector<const char*> options16; // this is for tv standard
- vector<const char*> options16keys;
+ std::vector<const char*> options4; // this is for tv size
+ std::vector<const char*> options4keys;
+ std::vector<const char*> options3; // this is for tv size
+ std::vector<const char*> options3keys;
+ std::vector<const char*> options16; // this is for tv standard
+ std::vector<const char*> options16keys;
};
#endif
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
#include "vquestion.h"
#include "boxstack.h"
#include "colour.h"
#include "i18n.h"
-#include "command.h"
+#include "messagequeue.h"
VQuestion::VQuestion(void* treplyTo)
{
m->from = this;
m->to = replyTo;
m->message = Message::QUESTION_YES;
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
return 4;
}
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef VQUESTION_H
virtual void quickUpdate()=0;
- stack<int> slIndexStack;
+ std::stack<int> slIndexStack;
};
#endif
#include "command.h"
-VServerSelect::VServerSelect(vector<VDRServer>& servers, void* treplyTo)
+VServerSelect::VServerSelect(std::vector<VDRServer>& servers, void* treplyTo)
{
// I tried the whole passing using a reference here, but
// the program segfaulted when settitletext tried to new
class Message;
-using namespace std;
-
class VServerSelect : public TBBoxx
{
public:
- VServerSelect(vector<VDRServer>& servers, void* replyTo);
+ VServerSelect(std::vector<VDRServer>& servers, void* replyTo);
~VServerSelect();
int handleCommand(int command);
#include "timers.h"
#include "boxstack.h"
#include "command.h"
+#include "messagequeue.h"
Sleeptimer* Sleeptimer::instance = NULL;
VCountdown* count = new VCountdown();
char* temp = (char*)malloc(20);
sprintf(temp, "0:%02d", sec);
- count->draw(temp);
+ count->drawClock(temp);
free(temp);
Message* m1 = new Message();
m1->message = Message::ADD_VIEW;
m1->to = BoxStack::getInstance();
m1->parameter.num = (ULONG)count;
- Command::getInstance()->postMessageNoLock(m1);
+ MessageQueue::getInstance()->postMessageNoLock(m1);
}
MILLISLEEP(1000);
m2->to = Command::getInstance();
m2->from = this;
m2->parameter.num = 61;
- Command::getInstance()->postMessageFromOuterSpace(m2);
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m2);
shutdown();
}
m->message = Message::CLOSE_ME;
m->to = BoxStack::getInstance();
m->from = this;
- Command::getInstance()->postMessageFromOuterSpace(m);
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m);
}
int VSleeptimer::handleCommand(int command)
Timers::getInstance()->cancelTimer(this, 1);
}
-void VCountdown::draw(const char* sec)
+void VCountdown::drawClock(const char* sec)
{
fillColour(DrawStyle::VIEWBACKGROUND);
m->message = Message::CLOSE_ME;
m->to = BoxStack::getInstance();
m->from = this;
- Command::getInstance()->postMessageFromOuterSpace(m);
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m);
}
public:
VCountdown();
~VCountdown();
- void draw(const char* sec);
+ void drawClock(const char* sec);
void timercall(int clientReference);
}
{
if (osd.getVisible()) clearScreen();
- if (!Command::getInstance()->advMenues())
+ if (!Command::getInstance()->isAdvMenus())
{
VEpg* vepg = new VEpg(this, currentChannelIndex, chanList);
vepg->draw();
#include "video.h"
#include "timers.h"
#include "boxstack.h"
-#include "command.h"
+#include "messagequeue.h"
VVolume::VVolume()
{
m->message = Message::CLOSE_ME;
m->to = BoxStack::getInstance();
m->from = this;
- Command::getInstance()->postMessageFromOuterSpace(m);
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m);
}
int VVolume::handleCommand(int command)
void VWelcome::doRecordingsList()
{
VRecordingList* vrec;
- if (Command::getInstance()->advMenues()) {
- vrec = new VRecordingListAdvanced();
- } else {
+ if (Command::getInstance()->isAdvMenus())
+ vrec = new VRecordingListAdvanced();
+ else
vrec = new VRecordingListClassic();
- }
+
vrec->draw();
boxstack->add(vrec);
boxstack->update(vrec);
}
dynamic_cast<WindowsOsd*>(osd)->setWindow(win);
- success = osd->init(NULL);
+ success = osd->init();
if (success)
{
logger->log("Core", Log::INFO, "OSD module initialised");
int numOptions;
int selectedOption;
- vector<Option*> options;
+ std::vector<Option*> options;
- vector<WTextbox*> textBoxes;
- vector<WOptionBox*> optionBoxes;
+ std::vector<WTextbox*> textBoxes;
+ std::vector<WOptionBox*> optionBoxes;
};
#endif
drawClippingRectangle(1,1,area.w-1,area.h-1);
- list<Picture>::iterator itty=pictures.begin();
+ std::list<Picture>::iterator itty=pictures.begin();
while (itty!=pictures.end())
{
// We now calculate the pictures in one row
- list<Picture*> cur_pict;
+ std::list<Picture*> cur_pict;
float cur_width=0;
float max_height=const_height;
itty++;
}
// ok now we have a list of pictures, let's draw them
- list<Picture*>::iterator citty=cur_pict.begin();
+ std::list<Picture*>::iterator citty=cur_pict.begin();
float xpos= (area.w - cur_width)*0.5f;
if (xpos < 0) xpos=0;
while (citty!=cur_pict.end())
float h;
bool banner;
};
- list<Picture> pictures;
+ std::list<Picture> pictures;
DrawStyle foreColour;
unsigned int cur_scroll_line;
#include "defines.h"
#include "boxx.h"
-using namespace std;
-
typedef struct
{
char* text;
void drawOptionLine(char* text, int xpos, int ypos, int width, const DrawStyle& colour, TVMediaInfo* pict);
int getMouseLine(int x, int y);
- vector<wsloption> options;
+ std::vector<wsloption> options;
UINT selectedOption;
int topOption;
UINT numOptionsDisplayable;
UINT visiblePane;
bool buttonBarActive;
- vector<TabDetails> tabs;
+ std::vector<TabDetails> tabs;
WSymbol symbolLeft;
WSymbol symbolRight;