#include "demuxeraudio.h"
#include "timers.h"
#include "video.h"
-#include "command.h"
+#include "messagequeue.h"
#include "i18n.h"
#include "boxx.h"
#include "log.h"
threadUnlock();
m->from = this;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = para;
- Command::getInstance()->postMessageFromOuterSpace(m);
+ m->parameter = para;
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m);
}
//open a new file
#include "boxstack.h"
#include "command.h"
+#include "messagequeue.h"
#include "remote.h"
#include "log.h"
Message* m = new Message();
m->to = Command::getInstance();
m->message = Message::LAST_VIEW_CLOSE;
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
}
if (!videoStack.empty() && videoStack.top().first==toDelete) {
remove((Boxx*)m->from);
break;
}
- case Message::ADD_VIEW: // currently not used by anything but it might come in useful again
+ case Message::ADD_VIEW:
{
- Boxx* toAdd = (Boxx*)m->parameter.num;
+ Boxx* toAdd = (Boxx*)m->parameter;
add(toAdd);
toAdd->draw();
update(toAdd);
/*
- Copyright 2007 Chris Tallon
+ Copyright 2007-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/>.
*/
#include <stdlib.h>
#include "boxx.h"
#include "surfacevector.h"
+
char Boxx::numBoxxes = 0;
Boxx::Boxx()
{
- // I want a parent box or a surface.
- parent = NULL;
- surface = NULL;
-
- area.x = 0;
- area.y = 0;
- area.w = 0;
- area.h = 0;
-
vdisplay.mode = None;
- paraVSpace = 6; // default gap for drawPara
-
- backgroundColourSet = false;
- visible = true;
-
numBoxxes++;
Log::getInstance()->log("Boxx", Log::DEBUG, "Construct, now %u", numBoxxes);
}
numBoxxes--;
Log::getInstance()->log("Boxx", Log::DEBUG, "Destruct, now %u", numBoxxes);
}
-#include <typeinfo>
+
void Boxx::draw()
{
- //Log::getInstance()->log("Boxx", Log::DEBUG, "Draw this %p surface %p", this, surface);
if (backgroundColourSet) fillColour(backgroundColour);
Boxx* currentBoxx;
std::vector<Boxx*>::iterator j;
- //int count=0;
for (j = children.begin(); j != children.end(); j++)
{
currentBoxx = *j;
- //Log::getInstance()->log("Boxx", Log::DEBUG, "Draw child %d %d %s", count,currentBoxx,typeid(*currentBoxx).name());
if (currentBoxx->getVisible()) currentBoxx->draw();
- //Log::getInstance()->log("Boxx", Log::DEBUG, "Draw child %d %d end", count,currentBoxx);
- // count++;
}
- // Log::getInstance()->log("Boxx", Log::DEBUG, "Draw this %p surface %p End", this, surface);
}
void Boxx::setSize(UINT w, UINT h)
void Boxx::removeVisibleChilds(Region & r)
{
- for(std::vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
- {
- if ((*i)->getVisible())
- {
- Region temp=(*i)->getRegionR();
- if (r.intersects(temp)) {
- r=r.subtract(temp);
- }
- }
- }
+ for(std::vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
+ {
+ if ((*i)->getVisible())
+ {
+ Region temp = (*i)->getRegionR();
+ if (r.intersects(temp)) r = r.subtract(temp);
+ }
+ }
}
void Boxx::setParent(Boxx* newParent)
void Boxx::setVideoBackground()
{
- vdisplay.mode=Window;
- vdisplay.fallbackMode=Fullscreen;
- vdisplay.x=getScreenX();
- vdisplay.y=getScreenY();
- vdisplay.width=getWidth();
- vdisplay.height=getHeight();
+ vdisplay.mode = Window;
+ vdisplay.fallbackMode = Fullscreen;
+ vdisplay.x = getScreenX();
+ vdisplay.y = getScreenY();
+ vdisplay.width = getWidth();
+ vdisplay.height = getHeight();
}
void Boxx::setVisible(bool isVisible)
r.y -= area.y;
surface->updateToScreen(r.x, r.y, r.w, r.h, area.x + r.x, area.y + r.y);
-
}
int Boxx::getScreenX()
bool Boxx::getVideoDisplay(VideoDisplay &vd)
{
- for(std::vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
- {
- if ((*i)->getVideoDisplay(vd)) return true;
- }
+ for(std::vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
+ {
+ if ((*i)->getVideoDisplay(vd)) return true;
+ }
- if (vdisplay.mode==None) return false;
- vd=vdisplay;
- return true;
+ if (vdisplay.mode == None) return false;
+ vd = vdisplay;
+ return true;
}
// Level 1 drawing functions
rectangle(0, 0, area.w, area.h, colour);
}
-int Boxx::drawPara(const char* text, int x, int y, const DrawStyle& colour,unsigned int skiplines)
+int Boxx::drawPara(const char* text, int x, int y, const DrawStyle& colour, unsigned int skiplines)
{
char line[256];
int lineHeight = getFontHeight() + paraVSpace;
ypos = y;
Region tester;
-
bool haschildren = true;
- if ( children.size() == 0) haschildren = false;
- bool mchar=false;
- Osd *osd=Osd::getInstance();
- if (osd->charSet()!=1) mchar=true;
- OsdVector *osdv=dynamic_cast<OsdVector*>(osd);
- float *charwidtharray=NULL;
- if (osdv) charwidtharray=osdv->getCharWidthArray();
+ if (children.size() == 0) haschildren = false;
+ bool mchar = false;
+ Osd *osd = Osd::getInstance();
+ if (osd->charSet() != 1) mchar = true;
+ OsdVector *osdv = dynamic_cast<OsdVector*>(osd);
+ float *charwidtharray = NULL;
+ if (osdv) charwidtharray = osdv->getCharWidthArray();
mbstate_t state;
- memset((void*)&state,0,sizeof(state));
+ memset((void*)&state, 0, sizeof(state));
while(1)
{
int cur_length = 1;
wchar_t cur_char;
if (*(text + textPos) == '\0') break;
- if (mchar) {
- cur_length = mbrtowc(&cur_char, text + textPos, textLength-textPos, &state);
- if (cur_length <= 0){
- cur_char='?';
- cur_length=1;
- }
- } else cur_char= *(text + textPos);
-
+ if (mchar)
+ {
+ cur_length = mbrtowc(&cur_char, text + textPos, textLength-textPos, &state);
+ if (cur_length <= 0)
+ {
+ cur_char = '?';
+ cur_length = 1;
+ }
+ }
+ else
+ {
+ cur_char = *(text + textPos);
+ }
if (cur_char == '\0') break;
printLine = 1;
break;
}
- if (charwidtharray) {
- thisCharWidth=charwidtharray[cur_char & 0xFF];
- if (cur_char && 0xFFFFFF00) thisCharWidth=osdv->getCharWidth(cur_char);
- } else thisCharWidth = charWidth(cur_char);
-
-
+ if (charwidtharray)
+ {
+ thisCharWidth = charwidtharray[cur_char & 0xFF];
+ if (cur_char && 0xFFFFFF00) thisCharWidth = osdv->getCharWidth(cur_char);
+ }
+ else
+ {
+ thisCharWidth = charWidth(cur_char);
+ }
if ((lineWidth + thisCharWidth + x) > tester.w)
while ((cur_char != ' ') && (linePos >= 0))
{
textPos -= cur_length;
- if (mchar) {
- cur_length = mbrtowc(&cur_char, text + textPos, textLength-textPos, &state);
- if (cur_length <= 0){
- cur_char='?';
- cur_length=1;
- }
- } else cur_char= *(text + textPos);
+ if (mchar)
+ {
+ cur_length = mbrtowc(&cur_char, text + textPos, textLength-textPos, &state);
+ if (cur_length <= 0)
+ {
+ cur_char='?';
+ cur_length=1;
+ }
+ }
+ else
+ {
+ cur_char = *(text + textPos);
+ }
linePos--;
}
// Now take the space we just found
textPos += cur_length;
}
-// line[linePos++] = '\0';
+// line[linePos++] = '\0';
if (linePos >= 0) line[linePos++] = '\0'; //Here is the change
if (printLine || (linePos > 1)) // if some text was put in line
{
- if (ypos <= (int)(area.h - lineHeight + paraVSpace)) {
- if (drawLinePos >= 0) {
- drawText(line, x, ypos, colour);
- ypos += lineHeight;
- }
- } else {
- leftlines++;
- }
+ if (ypos <= (int)(area.h - lineHeight + paraVSpace))
+ {
+ if (drawLinePos >= 0)
+ {
+ drawText(line, x, ypos, colour);
+ ypos += lineHeight;
+ }
+ }
+ else
+ {
+ leftlines++;
+ }
drawLinePos++;
}
else
void Boxx::drawTTChar(int ox, int oy,int x, int y, cTeletextChar c)
{
- if (parent) parent->drawTTChar(area.x + ox, area.y + oy, x,y,c);
- else if (surface) surface->drawTTChar(ox, oy,x,y,c);
-
+ if (parent) parent->drawTTChar(area.x + ox, area.y + oy, x,y,c);
+ else if (surface) surface->drawTTChar(ox, oy,x,y,c);
}
void Boxx::drawBitmap(UINT x, UINT y, const Bitmap& bm, const DisplayRegion & region)
void Boxx::drawTVMedia(TVMediaInfo & tvmedia,float x, float y, float width, float height, Corner corner)
{
- if (parent) parent->drawTVMedia(tvmedia,area.x + x,area.y + y,width, height, corner);
- else if (surface) {
- SurfaceVector * surfacevector=dynamic_cast<SurfaceVector*>(surface);
- if (surfacevector) surfacevector->drawTVMedia(tvmedia,x, y,width, height, corner);
- else surface->fillblt((int)x, (int)y, (int)width, (int)height, DrawStyle::RED); // Signal that something went wrong
- }
-
+ if (parent) parent->drawTVMedia(tvmedia,area.x + x,area.y + y,width, height, corner);
+ else if (surface)
+ {
+ SurfaceVector* surfacevector = dynamic_cast<SurfaceVector*>(surface);
+ if (surfacevector) surfacevector->drawTVMedia(tvmedia, x, y, width, height, corner);
+ else surface->fillblt((int)x, (int)y, (int)width, (int)height, DrawStyle::RED); // Signal that something went wrong
+ }
}
void Boxx::drawClippingRectangle(float x, float y, float w, float h)
{
- if (parent) parent->drawClippingRectangle(area.x + x, area.y + y, w, h);
- else if (surface) {
- SurfaceVector * surfacevector=dynamic_cast<SurfaceVector*>(surface);
- if (surfacevector) surfacevector->drawClippingRectangle(x, y, w, h);
-
- }
+ if (parent) parent->drawClippingRectangle(area.x + x, area.y + y, w, h);
+ else if (surface)
+ {
+ SurfaceVector* surfacevector = dynamic_cast<SurfaceVector*>(surface);
+ if (surfacevector) surfacevector->drawClippingRectangle(x, y, w, h);
+ }
}
int Boxx::getFontHeight()
else return 16.; //?
}
-
Surface* Boxx::getSurface()
{
if (parent) return parent->getSurface();
bool Boxx::mouseMove(int x, int y)
{
- if ((x >= (int)area.x) && (x<(int)area.x2())
- && (y >= (int)area.y) && (y < (int)area.y2()))
- {
- return true;
- }
- else
- {
- return false;
- }
+ if ((x >= (int)area.x) && (x<(int)area.x2())
+ && (y >= (int)area.y) && (y < (int)area.y2()))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
}
bool Boxx::mouseLBDOWN(int x, int y)
{
- if ((x >= (int)area.x) && (x<(int)area.x2())
- && (y >= (int)area.y) && (y < (int)area.y2()))
- {
- return true;
- }
- else
- {
- return false;
- }
+ if ((x >= (int)area.x) && (x<(int)area.x2())
+ && (y >= (int)area.y) && (y < (int)area.y2()))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
}
protected:
//get the surface this box is drawing to
Surface *getSurface();
- Boxx* parent;
+
+ // I want a parent box or a surface.
+ Boxx* parent{};
+ Surface* surface{};
+
Region area;
std::vector<Boxx*> children;
VideoDisplay vdisplay;
void removeVisibleChilds(Region & r);
static const int paraMargin = 10;
- UINT paraVSpace;
+ UINT paraVSpace{6}; // default gap for drawPara
DrawStyle backgroundColour;
- bool backgroundColourSet;
- bool visible;
+ bool backgroundColourSet{};
+ bool visible{true};
static char numBoxxes;
- Surface* surface;
};
#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 "channel.h"
Channel::Channel()
{
- number = 0;
- type = 0;
- name = NULL;
-
- index = -1;
- vpid = 0;
- tpid = 0;
- numAPids = 0;
- numDPids = 0;
- numSPids = 0;
-
- vstreamtype=2; //Mpeg2
-
}
Channel::~Channel()
{
if (name) delete[] name;
index = -1; // just in case
-
}
void Channel::loadPids()
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 CHANNEL_H
void loadPids();
- ULONG number;
- ULONG type;
- UCHAR vstreamtype;
- char* name;
+ int index{-1};
+ ULONG number{};
+ ULONG type{};
+ UCHAR vstreamtype{2}; //Mpeg2
+ char* name{};
- int index;
- ULONG vpid;
- ULONG numAPids;
+ ULONG vpid{};
+ ULONG numAPids{};
APidList apids;
- ULONG numDPids;
+ ULONG numDPids{};
APidList dpids;
- ULONG numSPids;
+ ULONG numSPids{};
APidList spids;
- ULONG tpid;
+ ULONG tpid{};
};
#endif
// remote->getButtonPress to break
// locking the mutex ensures that the master thread is waiting on getButtonPress
-
#ifndef WIN32
pthread_mutex_lock(&masterLock);
#else
}
case Message::UDP_BUTTON:
{
- handleCommand(m->parameter.num);
+ handleCommand(m->parameter);
break;
}
case Message::CHANGE_LANGUAGE:
{
//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);
+ if (osdv) osdv->informPicture(m->tag, reinterpret_cast<ImageIndex>(m->data));
break;
}
case Message::NEW_PICTURE_STATIC:
{
- //Log::getInstance()->log("Command", Log::DEBUG, "TVMedia NEW_PICTURE %x %x",m->tag,m->parameter.num);
+ //Log::getInstance()->log("Command", Log::DEBUG, "TVMedia NEW_PICTURE %x %x",m->tag,m->parameter);
OsdVector* osdv = dynamic_cast<OsdVector*>(Osd::getInstance());
- if (osdv) osdv->informPicture(((unsigned long long)m->tag)<<32LL,m->parameter.handle);
+ if (osdv) osdv->informPicture(static_cast<unsigned long long>(m->tag) << 32LL, reinterpret_cast<ImageIndex>(m->data));
break;
}
}
class VInfo;
class WJpeg;
-struct ASLPref {
- std::string langcode;
- int audiopref;
- int subtitlepref;
+struct ASLPref
+{
+ std::string langcode;
+ int audiopref;
+ int subtitlepref;
};
typedef std::vector<struct ASLPref> ASLPrefList;
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;};
+ void setSubDefault(int subon) { subdefault = subon; };
+ int getSubDefault() { return subdefault; };
+ ASLPrefList &getASLList() { return langcodes; };
private:
void stop();
HANDLE masterLock;
HANDLE mainPid; //Window
#endif
+
+ Log* logger;
+ BoxStack* boxstack;
+ Remote* remote;
+
bool initted{};
bool irun{};
bool isStandby{};
bool firstBoot{true};
int signals{};
-
- Log* logger;
- BoxStack* boxstack;
- Remote* remote;
Boxx* wallpaper{};
WJpeg* wallpaper_pict{};
VInfo* connLost{};
// add here defines for plattform specific objects
#ifdef VOMP_PLATFORM_RASPBERRY
- #define Remote_TYPE RemoteLinux // Generic Remote under Linux (Konsole!, not X) will support in the end:
- #define RemoteStartDev ""//No devices passed
+ #define Remote_TYPE RemoteLinux // Generic Remote under Linux (Konsole!, not X) will support in the end:
+ #define RemoteStartDev ""//No devices passed
// Keyboard
// remotes under /dev/event
// HDMI CEC
//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 Audio_TYPE AudioOMX // This is Audio based on OpenMax and libav for decoding
- #define Video_TYPE VideoOMX // This is Video based on OpenMax
-
-
-
- #define VPE_OMX_SUPPORT // Activate support for hardware codec using openmax il
- #define VPE_OMX_H264_DECODER "OMX.broadcom.video_decode"
- #define VPE_OMX_MPEG2_DECODER "OMX.broadcom.video_decode"
- #define VPE_OMX_VIDEO_SCHED "OMX.broadcom.video_scheduler"
- #define VPE_OMX_VIDEO_REND "OMX.broadcom.video_render"
- #define VPE_OMX_VIDEO_DEINTERLACE "OMX.broadcom.image_fx"
- #define VPE_OMX_CLOCK "OMX.broadcom.clock"
- #define VPE_OMX_AUDIO_DECODER "OMX.broadcom.audio_decode"
- #define VPE_OMX_AUDIO_REND "OMX.broadcom.audio_render"
- #define VPE_OMX_IMAGE_DECODER "OMX.broadcom.image_decode"
- #define VPE_OMX_EGL_REND "OMX.broadcom.egl_render"
+ #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 Audio_TYPE AudioOMX // This is Audio based on OpenMax and libav for decoding
+ #define Video_TYPE VideoOMX // This is Video based on OpenMax
+
+
+
+ #define VPE_OMX_SUPPORT // Activate support for hardware codec using openmax il
+ #define VPE_OMX_H264_DECODER "OMX.broadcom.video_decode"
+ #define VPE_OMX_MPEG2_DECODER "OMX.broadcom.video_decode"
+ #define VPE_OMX_VIDEO_SCHED "OMX.broadcom.video_scheduler"
+ #define VPE_OMX_VIDEO_REND "OMX.broadcom.video_render"
+ #define VPE_OMX_VIDEO_DEINTERLACE "OMX.broadcom.image_fx"
+ #define VPE_OMX_CLOCK "OMX.broadcom.clock"
+ #define VPE_OMX_AUDIO_DECODER "OMX.broadcom.audio_decode"
+ #define VPE_OMX_AUDIO_REND "OMX.broadcom.audio_render"
+ #define VPE_OMX_IMAGE_DECODER "OMX.broadcom.image_decode"
+ #define VPE_OMX_EGL_REND "OMX.broadcom.egl_render"
//#define VPE_LIBAV_SUPPORT
// #define VPE_LIBAV_MPEG2_TRANSCODING
/*
- 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/>.
*/
#include "directory.h"
Directory::Directory(const char* newName)
{
- index = -1;
-
name = new char[strlen(newName) + 1];
strcpy(name, newName);
-
- parent = NULL;
}
Directory::~Directory()
{
if (name) delete[] name;
name = NULL;
- index = -1; // just in case
+ index = -1; // just in case // FIXME remove this
UINT i;
for (i = 0; i < dirList.size(); i++)
/*
- 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 DIRECTORY_H
char* name;
- int index;
+ int index{-1};
- Directory* parent;
+ Directory* parent{};
DirectoryList dirList;
RecordingList recList;
*/
}
-int DatagramSocket::getDataLength(void) const
+UINT DatagramSocket::getDataLength(void) const
{
- return mlength;
+ return static_cast<UINT>(mlength);
}
-char *DatagramSocket::getData(void) { return buf; }
-char *DatagramSocket::getFromIPA(void) { return fromIPA; }
-short DatagramSocket::getFromPort(void) const { return fromPort; }
+const void* DatagramSocket::getData() const { return buf; }
+const char* DatagramSocket::getFromIPA() const { return fromIPA; }
+short DatagramSocket::getFromPort() const { return fromPort; }
void DatagramSocket::send(const char *ipa, short port, char *message, int length)
{
/*
- 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 DSOCK_H
int init();
void shutdown();
unsigned char waitforMessage(unsigned char); // int =0-block =1-new wait =2-continue wait
- int getDataLength(void) const;
- char *getData(void); // returns a pointer to the data
- char *getFromIPA(void); // returns a pointer to from IP address
- short getFromPort(void) const;
- void send(const char *, short, char *, int); // send wants: IP Address ddn style, port,
- // data, length of data
+ UINT getDataLength() const;
+ const void* getData() const; // returns a pointer to the data
+ const char* getFromIPA() const; // returns a pointer to from IP address
+ short getFromPort() const;
+ void send(const char *, short, char *, int); // send wants: IP Address ddn style, port, data, length of data
+
private:
bool initted;
ULONG getIPNumber(ULONG num);
/*
- 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/>.
*/
#include "message.h"
Message::Message()
{
- from = NULL;
- to = NULL;
- message = 0;
- parameter.num = 0;
- parameter.handle = 0;
- tag = 0;
}
/*
- Copyright 2004-2019 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 MESSAGE_H
#include <stdio.h>
-class Message;
+//class Message;
#include "defines.h"
// Usage of messages is more dubious now that the single master mutex lock
public:
Message();
- void* from;
- void* to;
- ULONG message;
- union {
- ULONG num;
- VectorHandle handle;
- } parameter;
- ULONG tag; // use this for identifying which object / question is being replied to
+ void* from{};
+ void* to{};
+ ULONG message{};
+ ULONG parameter{};
+ ULONG tag{}; // use this for identifying which object / question is being replied to
+ void* data{}; // Use this for anything. Int, pointer, pointer to memory to be freed by the recipient, etc.
const static ULONG QUESTION_YES = 1;
const static ULONG CLOSE_ME = 2;
const static ULONG ADD_VIEW = 12;
const static ULONG REDRAW_LANG = 14;
const static ULONG EPG = 16;
- //const static ULONG EPG_CLOSE = 17; // Not needed anymore
const static ULONG CHANGED_OPTIONS = 18;
const static ULONG CONNECTION_LOST = 19;
const static ULONG MOVE_RECORDING = 20;
};
#endif
+
+// FIXME idea - instead of always having to specify a real pointer in the "to" variable (meaning clients may have to
+// run Command::getInstance() for e.g.), how about having some constant values for well known targets. Then
+// clients may not need the #include "command.h"
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/>.
*/
// We have a pictures! send a message to ourself, to switch to gui thread
m->from=this;
m->to=Command::getInstance();
- m->parameter.handle = handle;
+ m->data = reinterpret_cast<void*>(handle);
if (!static_image) {
m->message=Message::NEW_PICTURE;
m->tag = info->lindex;
m->message=Message::NEW_PICTURE_STATIC;
m->tag = info->lindex>> 32LL;
}
- Command::getInstance()->postMessageFromOuterSpace(m); // inform command about new picture
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m); // inform command about new picture
delete info;
Message* m = new Message();
m->from=this;
m->to=Command::getInstance();
- m->parameter.handle = info->handle;
+ m->data = reinterpret_cast<void*>(info->handle);
if (!static_image) {
m->message=Message::NEW_PICTURE;
m->tag = info->lindex;
m->message=Message::NEW_PICTURE_STATIC;
m->tag = info->lindex>> 32LL;
}
- Command::getInstance()->postMessageFromOuterSpace(m); // inform command about new picture
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m); // inform command about new picture
delete info;
} break;
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 "message.h"
-#include "command.h"
+#include "messagequeue.h"
#include "teletxt/txtfont.h"
// We have a pictures! send a message to ourself, to switch to gui thread
m->from = this;
m->to = Command::getInstance();
- m->parameter.handle = pict_inf.reference;
+ m->data = pict_inf.reference;
if (!static_image) {
m->message = Message::NEW_PICTURE;
m->tag = pict_inf.lindex;
m->message = Message::NEW_PICTURE_STATIC;
m->tag = pict_inf.lindex >> 32LL;
}
- Command::getInstance()->postMessageFromOuterSpace(m); // inform command about new picture
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m); // inform command about new picture
} else {
pict_inf.decoder->freeReference(pict_inf.reference);
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 "player.h"
video = Video::getInstance();
logger = Log::getInstance();
vdr = VDR::getInstance();
- initted = false;
- lengthBytes = 0;
- lengthFrames = 0;
- currentFrameNumber = 0;
- state = S_STOP;
- ifactor = 4;
- is_pesrecording=true;
-
- subtitlesShowing = false;
- videoStartup = false;
- threadBuffer = NULL;
-
- blockSize = 100000;
- startupBlockSize = 250000;
video->turnVideoOn();
}
if (initted) shutdown();
}
-int Player::init(bool p_isPesRecording,double framespersecond)
+int Player::init(bool p_isPesRecording, double framespersecond)
{
if (initted) return 0;
#ifndef WIN32
mutex=CreateMutex(NULL,FALSE,NULL);
#endif
is_pesrecording = p_isPesRecording;
- fps=framespersecond;
+ fps = framespersecond;
if (is_pesrecording)
demuxer = new DemuxerVDR();
else
teletext = new TeletextDecoderVBIEBU();
if (!teletext) return 0;
teletext->setRecordigMode(true);
- unsigned int demux_video_size=2097152;
- unsigned int demux_audio_size=524288;
- if (video->supportsh264()) {
- demux_video_size*=5*2;//5;
-
+ unsigned int demux_video_size = 2097152;
+ unsigned int demux_audio_size = 524288;
+ if (video->supportsh264())
+ {
+ demux_video_size *= 5 * 2;
}
- if (audio->maysupportAc3()) {
- //demux_audio_size*=2;
+ if (audio->maysupportAc3())
+ {
+ //demux_audio_size*=2;
}
if (!demuxer->init(this, audio, video,teletext, demux_video_size,demux_audio_size,65536, framespersecond, subtitles))
video->blank();
audio->stop();
- if (Command::getInstance()->getSubDefault()) {
- turnSubtitlesOn(true);
- } else {
- turnSubtitlesOn(false);
- }
+ if (Command::getInstance()->getSubDefault())
+ turnSubtitlesOn(true);
+ else
+ turnSubtitlesOn(false);
initted = true;
return 1;
void Player::setStartFrame(ULONG startFrame)
{
- ULONG nextiframeNumber;
- ULONG iframeLength;
- ULONG iframeNumber;
- ULLONG filePos;
-
- // newFrame could be anywhere, go forwards to next I-Frame
- if (!vdr->getNextIFrame(startFrame, 1, &filePos, &nextiframeNumber, &iframeLength)) return;
+ ULONG nextiframeNumber;
+ ULONG iframeLength;
+ ULONG iframeNumber;
+ ULLONG filePos;
- // Now step back a GOP. This ensures we go to the greatest I-Frame equal to or less than the requested frame
- vdr->getNextIFrame(nextiframeNumber, 0, &filePos, &iframeNumber, &iframeLength);
+ // newFrame could be anywhere, go forwards to next I-Frame
+ if (!vdr->getNextIFrame(startFrame, 1, &filePos, &nextiframeNumber, &iframeLength)) return;
- logger->log("Player", Log::DEBUG, "setStartFrame %lu %lu %lu", startFrame, nextiframeNumber,iframeNumber);
- currentFrameNumber = iframeNumber;
+ // Now step back a GOP. This ensures we go to the greatest I-Frame equal to or less than the requested frame
+ vdr->getNextIFrame(nextiframeNumber, 0, &filePos, &iframeNumber, &iframeLength);
+ logger->log("Player", Log::DEBUG, "setStartFrame %lu %lu %lu", startFrame, nextiframeNumber,iframeNumber);
+ currentFrameNumber = iframeNumber;
}
void Player::setLengthBytes(ULLONG length)
int Player::getCurrentAudioChannel()
{
- if (is_pesrecording) {
- return demuxer->getselAudioChannel();
- } else {
- return ((DemuxerTS*)demuxer)->getAID();
- }
+ if (is_pesrecording)
+ return demuxer->getselAudioChannel();
+ else
+ return dynamic_cast<DemuxerTS*>(demuxer)->getAID();
}
int Player::getCurrentSubtitleChannel()
{
- if (is_pesrecording) {
- return demuxer->getselSubtitleChannel();
- } else {
- return ((DemuxerTS*)demuxer)->getSubID();
- }
+ if (is_pesrecording)
+ return demuxer->getselSubtitleChannel();
+ else
+ return dynamic_cast<DemuxerTS*>(demuxer)->getSubID();
}
void Player::setSubtitleChannel(int newChannel)
{
- if (is_pesrecording) {
- demuxer->setDVBSubtitleStream(newChannel);
- } else {
- ((DemuxerTS*)demuxer)->setSubID(newChannel);
- }
+ if (is_pesrecording)
+ demuxer->setDVBSubtitleStream(newChannel);
+ else
+ dynamic_cast<DemuxerTS*>(demuxer)->setSubID(newChannel);
}
int *Player::getTeletxtSubtitlePages()
{
- return teletext->getSubtitlePages();
+ return teletext->getSubtitlePages();
}
void Player::setAudioChannel(int newChannel, int type, int streamtype)
{
- if (is_pesrecording) {
- demuxer->setAudioStream(newChannel);
- return;
- } else {
- ((DemuxerTS*)demuxer)->setAID(newChannel,type,streamtype,false);
- return;
- }
+ if (is_pesrecording)
+ {
+ demuxer->setAudioStream(newChannel);
+ return;
+ }
+ else
+ {
+ dynamic_cast<DemuxerTS*>(demuxer)->setAID(newChannel,type,streamtype,false);
+ return;
+ }
}
bool Player::toggleSubtitles()
return subtitlesShowing;
}
-void Player::turnSubtitlesOn(bool ison) {
+void Player::turnSubtitlesOn(bool ison)
+{
if (ison)
{
subtitlesShowing = true;
subtitlesShowing = false;
subtitles->hide();
}
-
}
-void Player::tellSubtitlesOSDVisible(bool visible){
-subtitles->setOSDMenuVisibility(visible);
+void Player::tellSubtitlesOSDVisible(bool visible)
+{
+ subtitles->setOSDMenuVisibility(visible);
}
-Channel * Player::getDemuxerChannel() {
- if (!is_pesrecording) {
- return ((DemuxerTS*) demuxer)->getChannelInfo();
- }
- return NULL; //Should not happen!
+Channel * Player::getDemuxerChannel()
+{
+ if (!is_pesrecording)
+ {
+ return dynamic_cast<DemuxerTS*>(demuxer)->getChannelInfo();
+ }
+ return NULL; //Should not happen!
}
lock();
bool doUnlock = false;
- if (state==S_PLAY) {
- doUnlock=true;
- switchState(S_PAUSE_P);
- } else {
- if (state == S_PAUSE_P) doUnlock = true;
- switchState(S_PLAY);
+ if (state==S_PLAY)
+ {
+ doUnlock=true;
+ switchState(S_PAUSE_P);
+ }
+ else
+ {
+ if (state == S_PAUSE_P) doUnlock = true;
+ switchState(S_PLAY);
}
if (doUnlock) unLock();
-
}
-
-
-
void Player::stop()
{
if (!initted) return;
{
lock();
logger->log("Player", Log::DEBUG, "JUMP TO %f%%", percent);
- ULONG newFrame = (ULONG)(percent * lengthFrames / 100);
+ ULONG newFrame = static_cast<ULONG>(percent * lengthFrames / 100);
switchState(S_JUMP, newFrame);
// unLock(); - let thread unlock this
}
logger->log("Player", Log::DEBUG, "SKIP FORWARD %i SECONDS", seconds);
ULONG newFrame = getCurrentFrameNum();
if (newFrame == 0) { unLock(); return; } // Current pos from demuxer is not valid
- newFrame +=(ULONG) (((double)seconds) * fps);
+ newFrame += static_cast<ULONG>(static_cast<double>(seconds) * fps);
if (newFrame > lengthFrames) { switchState(S_PLAY); unLock(); }
else switchState(S_JUMP, newFrame);
// unLock(); - let thread unlock this
logger->log("Player", Log::DEBUG, "SKIP BACKWARD %i SECONDS", seconds);
long newFrame = getCurrentFrameNum();
if (newFrame == 0) { unLock(); return; } // Current pos from demuxer is not valid
- newFrame -= (ULONG) (((double)seconds) * fps);
+ newFrame -= static_cast<ULONG>(static_cast<double>(seconds) * fps);
if (newFrame < 0) newFrame = 0;
switchState(S_JUMP, newFrame);
// unLock(); - let thread unlock this
m->to = messageReceiver;
m->from = this;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = Player::CONNECTION_LOST;
+ m->parameter = Player::CONNECTION_LOST;
messageQueue->postMessage(m);
}
m->from = this;
m->to = messageReceiver;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = Player::ASPECT43;
+ m->parameter = Player::ASPECT43;
messageQueue->postMessageFromOuterSpace(m);
}
else if (dxCurrentAspect == Demuxer::ASPECT_16_9)
m->from = this;
m->to = messageReceiver;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = Player::ASPECT169;
+ m->parameter = Player::ASPECT169;
messageQueue->postMessageFromOuterSpace(m);
}
else
m->to = messageReceiver;
m->from = this;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = STOP_PLAYBACK;
+ m->parameter = STOP_PLAYBACK;
logger->log("Player", Log::DEBUG, "Posting message to %p...", messageQueue);
messageQueue->postMessage(m);
logger->log("Player", Log::DEBUG, "Message posted...");
m->to = messageReceiver;
m->from = this;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = Player::STOP_PLAYBACK;
+ m->parameter = Player::STOP_PLAYBACK;
logger->log("Player", Log::DEBUG, "Posting message to %p...", messageQueue);
messageQueue->postMessage(m);
}
void restartAtFrame(ULONG newFrame);
void restartAtFramePI(ULONG newFrame);
- bool subtitlesShowing;
+ bool subtitlesShowing{};
MessageQueue* messageQueue;
void* messageReceiver;
OSDReceiver* osdReceiver;
- bool initted;
+ bool initted{};
bool startup;
- bool videoStartup;
+ bool videoStartup{};
- bool is_pesrecording;
+ bool is_pesrecording{true};
double fps;
#ifndef WIN32
void lock();
void unLock();
- ULLONG lengthBytes;
- ULONG lengthFrames;
- ULONG currentFrameNumber;
- UINT blockSize;
- UINT startupBlockSize;
- UCHAR* threadBuffer;
- UCHAR state;
- UCHAR ifactor;
+ ULLONG lengthBytes{};
+ ULONG lengthFrames{};
+ ULONG currentFrameNumber{};
+ UINT blockSize{100000};
+ UINT startupBlockSize{250000};
+ UCHAR* threadBuffer{};
+ UCHAR state{S_STOP};
+ UCHAR ifactor{4};
};
#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 "playerliveradio.h"
m->from = this;
m->to = messageReceiver;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = PlayerLiveRadio::STREAM_END;
+ m->parameter = PlayerLiveRadio::STREAM_END;
messageQueue->postMessageFromOuterSpace(m);
}
m->from = this;
m->to = messageReceiver;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = PlayerLiveRadio::CONNECTION_LOST;
+ m->parameter = PlayerLiveRadio::CONNECTION_LOST;
messageQueue->postMessageFromOuterSpace(m);
return true;
m->from = this;
m->to = messageReceiver;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = PlayerLiveRadio::STREAM_END;
+ m->parameter = PlayerLiveRadio::STREAM_END;
messageQueue->postMessageFromOuterSpace(m);
}
}
m->from = this;
m->to = messageReceiver;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = PlayerLiveRadio::PREBUFFERING;
+ m->parameter = PlayerLiveRadio::PREBUFFERING;
m->tag = percentDone;
messageQueue->postMessageFromOuterSpace(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 PLAYERLIVERADIO_H
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 "playerlivetv.h"
#include "channel.h"
#include "dvbsubtitles.h"
#include "osdreceiver.h"
+#include "command.h"
// ----------------------------------- Called from outside, one offs or info funcs
m->from = this;
m->to = messageReceiver;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = PlayerLiveTV::ASPECT43;
+ m->parameter = PlayerLiveTV::ASPECT43;
messageQueue->postMessageFromOuterSpace(m);
}
else if (dxCurrentAspect == Demuxer::ASPECT_16_9)
m->from = this;
m->to = messageReceiver;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = PlayerLiveTV::ASPECT169;
+ m->parameter = PlayerLiveTV::ASPECT169;
messageQueue->postMessageFromOuterSpace(m);
}
else
m->from = this;
m->to = messageReceiver;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = PlayerLiveTV::STREAM_END;
+ m->parameter = PlayerLiveTV::STREAM_END;
messageQueue->postMessageFromOuterSpace(m);
}
m->from = this;
m->to = messageReceiver;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = PlayerLiveTV::CONNECTION_LOST;
+ m->parameter = PlayerLiveTV::CONNECTION_LOST;
messageQueue->postMessageFromOuterSpace(m);
return true;
m->from = this;
m->to = messageReceiver;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = PlayerLiveTV::STREAM_END;
+ m->parameter = PlayerLiveTV::STREAM_END;
messageQueue->postMessageFromOuterSpace(m);
}
}
m->from = this;
m->to = messageReceiver;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = PlayerLiveTV::PREBUFFERING;
+ m->parameter = PlayerLiveTV::PREBUFFERING;
m->tag = percentDone;
messageQueue->postMessageFromOuterSpace(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 PLAYERLIVETV_H
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 "playermedia.h"
#include "demuxermedia.h"
#include "timers.h"
#include "video.h"
-#include "command.h"
+#include "messagequeue.h"
#include "i18n.h"
#include "boxx.h"
#include "log.h"
threadUnlock();
m->from = this;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = para;
- Command::getInstance()->postMessageFromOuterSpace(m);
+ m->parameter = para;
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m);
}
//method called by the playing thread to handle
m->from = this;
m->to = frontend;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = PlayerMedia::ASPECT43;
- Command::getInstance()->postMessageFromOuterSpace(m);
+ m->parameter = PlayerMedia::ASPECT43;
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m);
}
else if (dxCurrentAspect == Demuxer::ASPECT_16_9)
{
m->from = this;
m->to = frontend;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = PlayerMedia::ASPECT169;
- Command::getInstance()->postMessageFromOuterSpace(m);
+ m->parameter = PlayerMedia::ASPECT169;
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m);
}
else
{
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 "playerradio.h"
m->to = messageReceiver;
m->from = this;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = PlayerRadio::CONNECTION_LOST;
+ m->parameter = PlayerRadio::CONNECTION_LOST;
messageQueue->postMessage(m);
}
m->to = messageReceiver;
m->from = this;
m->message = Message::PLAYER_EVENT;
- m->parameter.num = PlayerRadio::STOP_PLAYBACK;
+ m->parameter = PlayerRadio::STOP_PLAYBACK;
logger->log("PlayerRadio", Log::DEBUG, "Posting message to %p...", messageQueue);
messageQueue->postMessage(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/>.
*/
#include "recman.h"
RecMan::RecMan()
{
- totalSpace = 0;
- freeSpace = 0;
- usedPercent = 0;
-
rootDir = new Directory("/");
currentDir = rootDir;
-
- chronoSortOrder = false;
}
RecMan::~RecMan()
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 RECMAN_H
ULONG getUsedPercent();
private:
- ULONG totalSpace;
- ULONG freeSpace;
- ULONG usedPercent;
+ ULONG totalSpace{};
+ ULONG freeSpace{};
+ ULONG usedPercent{};
Directory* rootDir;
Directory* currentDir;
- bool chronoSortOrder;
+ bool chronoSortOrder{};
- void constructPath(char* target, Directory* dir) ;
+ void constructPath(char* target, Directory* dir);
};
#endif
{
logger = Log::getInstance();
vdr = VDR::getInstance();
-
- isNew = false;
- start = 0;
- progName = NULL;
- fileName = NULL;
- index = -1;
- markList = NULL;
- movieID = 0;
- seriesID = 0;
- episodeID = 0;
}
Recording::~Recording()
char* getProgName() const;
char* getFileName() const;
- int index;
+ int index{-1}; // FIXME make private?
void loadRecInfo();
void dropRecInfo();
bool hasMarks();
MarkList* getMarkList();
- int movieID;
- int seriesID;
- int episodeID;
+ int movieID{};
+ int seriesID{};
+ int episodeID{};
static RecInfo* recInfo;
static MovieInfo* movieInfo;
Log* logger;
VDR* vdr;
- bool isNew;
- ULONG start;
- char* progName;
- char* fileName;
+ bool isNew{};
+ ULONG start{};
+ char* progName{};
+ char* fileName{};
// I only want 1 RecInfo loaded at a time
// if (recInfoFor == this) then recInfo is valid
static Recording* recInfoFor;
- MarkList* markList;
+ MarkList* markList{};
};
#endif
-#include "region.h"
+/*
+ Copyright 2020 Chris Tallon
-Region::Region()
-{
- x = 0;
- y = 0;
- w = 0;
- h = 0;
- z = 0;
-}
+ 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, see <https://www.gnu.org/licenses/>.
+*/
+
+#include "region.h"
bool Region::overlappedBy(Region& d)
{
return toReturn;
}
-
-
Region Region::subtract(Region& other)
{
+/*
+ Copyright 2020 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, see <https://www.gnu.org/licenses/>.
+*/
+
#ifndef REGION_H
#define REGION_H
class Region
{
public:
- Region();
bool overlappedBy(Region& doesthisOverlap);
Region subtract(Region& other);
Region operator + (Region& other);
UINT x2();
UINT y2();
- UINT x;
- UINT y;
- UINT w;
- UINT h;
- int z;
+ UINT x{};
+ UINT y{};
+ UINT w{};
+ UINT h{};
+ int z{};
};
#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 "teletextdecodervbiebu.h"
#include "teletxt/tables.h"
#include "message.h"
-#include "command.h"
+#include "messagequeue.h"
#include "video.h"
#ifdef WIN32
m->message = Message::TELETEXTUPDATE;
m->to = txtview;
m->from = this;
- m->parameter.num = 0;
- Command::getInstance()->postMessageFromOuterSpace(m);
+ m->parameter = 0;
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m);
} else if (firstlineupdate==10) {
Message* m= new Message();
m->message = Message::TELETEXTUPDATEFIRSTLINE;
m->to = txtview;
m->from = this;
- m->parameter.num = 0;
- Command::getInstance()->postMessageFromOuterSpace(m);
+ m->parameter = 0;
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m);
firstlineupdate=0;
} else firstlineupdate++;
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 "udp.h"
#include "messagequeue.h"
#include "message.h"
#include "log.h"
+#include "command.h"
//void dump(unsigned char* data, USHORT size);
//unsigned char dcc(UCHAR c);
return 1;
}
-int UDP::run(MessageQueue* tcommandMessageQueue)
+int UDP::run(MessageQueue* tMessageQueue)
{
if (threadIsActive()) return 1;
log->log("UDP", Log::DEBUG, "Starting UDP command server");
initted = 1;
- commandMessageQueue = tcommandMessageQueue;
+ messageQueue = tMessageQueue;
ds = new DatagramSocket(2000);
if (!ds->init())
}
else
{
- processRequest((UCHAR*)ds->getData(), ds->getDataLength());
+ processRequest(ds->getData(), ds->getDataLength());
}
threadCheckExit();
}
}
-void UDP::processRequest(UCHAR* data, int length)
+void UDP::processRequest(const void* data, UINT length)
{
log->log("UDP", Log::DEBUG, "Got request");
char* temp = new char[length + 1];
memcpy(temp, data, length);
temp[length] = '\0';
- int command = atoi(temp);
+ UINT command = static_cast<UINT>(atoi(temp));
delete[] temp;
log->log("UDP", Log::DEBUG, "Command %i recieved", command);
Message *m = new Message();
- m->to = commandMessageQueue;
+ m->to = Command::getInstance();
m->message = Message::UDP_BUTTON;
- m->parameter.num = command;
- commandMessageQueue->postMessage(m);
+ m->parameter = command;
+ messageQueue->postMessage(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 UDP_H
UDP();
virtual ~UDP();
- int run(MessageQueue* commandMessageQueue);
+ int run(MessageQueue* messageQueue);
int shutdown();
private:
void threadPostStopCleanup() {};
void threadMethod();
- void processRequest(UCHAR* data, int length);
+ void processRequest(const void* data, UINT length);
int initted;
DatagramSocket* ds;
- MessageQueue* commandMessageQueue;
+ MessageQueue* messageQueue;
Log* log;
};
m->from = this;
m->to = parent;
m->message = Message::SUBTITLE_CHANGE_CHANNEL;
- m->parameter.num = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16 ;
+ m->parameter = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16 ;
MessageQueue::getInstance()->postMessageNoLock(m);
} else {
asl.up();
m->from = this;
m->to = parent;
m->message = Message::AUDIO_CHANGE_CHANNEL;
- m->parameter.num = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16 ;
+ m->parameter = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16 ;
MessageQueue::getInstance()->postMessageNoLock(m);
}
m->from = this;
m->to = parent;
m->message = Message::SUBTITLE_CHANGE_CHANNEL;
- m->parameter.num = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16
+ m->parameter = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16
|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->streamtype &0xFF)<<24 ;
MessageQueue::getInstance()->postMessageNoLock(m);
} else {
m->from = this;
m->to = parent;
m->message = Message::AUDIO_CHANGE_CHANNEL;
- m->parameter.num = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16
+ m->parameter = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16
|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->streamtype &0xFF)<<24 ;
MessageQueue::getInstance()->postMessageNoLock(m);
}
UINT lastsel=asl.getCurrentOption();
- if (((m->parameter.num>>16)-getScreenX()) < 200 && asl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (((m->parameter>>16)-getScreenX()) < 200 && asl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
editsubtitles=false;
ssl.setDarkSelOption(true);
m2->from = this;
m2->to = parent;
m2->message = Message::AUDIO_CHANGE_CHANNEL;
- m2->parameter.num = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16 ;
+ m2->parameter = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16 ;
MessageQueue::getInstance()->postMessageNoLock(m2);
}
return;
}
lastsel=ssl.getCurrentOption();
- if (ssl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (ssl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
editsubtitles=true;
ssl.setDarkSelOption(false);
m2->from = this;
m2->to = parent;
m2->message = Message::SUBTITLE_CHANGE_CHANNEL;
- m2->parameter.num = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16 ;
+ m2->parameter = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16 ;
MessageQueue::getInstance()->postMessageNoLock(m2);
}
return;
}
else if (m->message == Message::MOUSE_LBDOWN)
{
- if (asl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (asl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
editsubtitles=false;
ssl.setDarkSelOption(true);
ssl.draw();
BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
}
- else if (ssl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ else if (ssl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
editsubtitles=true;
ssl.setDarkSelOption(false);
}
else
{ //check if press is outside this view! then simulate cancel
- int x=(m->parameter.num>>16)-getScreenX();
- int y=(m->parameter.num&0xFFFF)-getScreenY();
+ int x=(m->parameter>>16)-getScreenX();
+ int y=(m->parameter&0xFFFF)-getScreenY();
if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
{
BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
{
/* if (m->message == Message::MOUSE_MOVE) {
if (sl.mouseAndroidScroll((m->tag >> 16),(m->tag & 0xFFFF),
- (m->parameter.num >> 16),(m->parameter.num & 0xFFFF))) {
+ (m->parameter >> 16),(m->parameter & 0xFFFF))) {
sl.draw();
doShowingBar();
boxstack->update(this);
}
else */if (m->message == Message::MOUSE_MOVE)
{
- if (sl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
quickUpdate();
boxstack->update(this);
}
else if (m->message == Message::MOUSE_LBDOWN)
{
- if (sl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
boxstack->handleCommand(Remote::OK); //simulate OK press
}
else
{ //check if press is outside this view! then simulate cancel
- int x=(m->parameter.num>>16)-getScreenX();
- int y=(m->parameter.num&0xFFFF)-getScreenY();
+ int x=(m->parameter>>16)-getScreenX();
+ int y=(m->parameter&0xFFFF)-getScreenY();
if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
{
boxstack->handleCommand(Remote::BACK); //simulate cancel press
Channel* chan = NULL;
for (UINT i = 0; i < chanList->size(); i++)
{
- if ((*chanList)[i]->number == m->parameter.num)
+ if ((*chanList)[i]->number == m->parameter)
{
chan = (*chanList)[i];
break;
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 "vchannelselect.h"
#include "colour.h"
#include "log.h"
#include "timers.h"
-#include "command.h"
#include "vdr.h"
+#include "messagequeue.h"
// this class only works as it does because the remote command
// values for the numbers are the numbers themselves !
m->from = this;
m->to = parent;
m->message = Message::CHANNEL_CHANGE;
- m->parameter.num = 0;
+ m->parameter = 0;
for(i = numGot - 1; i >= 0; i--)
{
- m->parameter.num += input[i] * (ULONG)pow(10., i);
+ m->parameter += input[i] * (ULONG)pow(10., i);
}
if (which)
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
else
- Command::getInstance()->postMessageFromOuterSpace(m);
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m);
}
// Close me
m->to = BoxStack::getInstance();
m->message = Message::CLOSE_ME;
if (which)
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
else
- Command::getInstance()->postMessageFromOuterSpace(m);
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m);
}
int VChannelSelect::handleCommand(int command)
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 VCHANNELSELECT_H
else if (m->message == Message::MOUSE_LBDOWN)
{
//check if press is outside this view! then simulate cancel
- int x=(m->parameter.num>>16)-getScreenX();
- int y=(m->parameter.num&0xFFFF)-getScreenY();
+ int x=(m->parameter>>16)-getScreenX();
+ int y=(m->parameter&0xFFFF)-getScreenY();
if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
{
BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
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 "vconnect.h"
#include "log.h"
#include "wol.h"
#include "vserverselect.h"
+#include "messagequeue.h"
VConnect::VConnect(char* tServer)
{
+ server = tServer;
+
boxstack = BoxStack::getInstance();
vdr = VDR::getInstance();
logger = Log::getInstance();
}
exitable = 0;
- irun = 0;
- server = tServer;
}
VConnect::~VConnect()
m->from = this;
m->to = Command::getInstance();
m->message = Message::VDR_CONNECTED;
- Command::getInstance()->postMessage(m);
+ MessageQueue::getInstance()->postMessage(m);
}
void VConnect::processMessage(Message* m)
{
if (m->message == Message::SERVER_SELECTED)
{
- selectedServer = m->parameter.num;
+ selectedServer = m->parameter;
threadSignal();
}
}
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 VCONNECT_H
void clearServerIPs();
BoxStack* boxstack;
- UCHAR irun;
+ UCHAR irun{};
VDR* vdr;
Log* logger;
std::vector<VDRServer> servers;
{
if (instance) return;
instance = this;
- initted = 0;
- findingServer = 0;
- tcp = NULL;
- connected = false;
- maxChannelNumber = 0;
- channelNumberWidth = 1;
- doVDRShutdown = false;
+
TEMP_SINGLE_VDR_PR = NULL;
#ifdef VOMP_MEDIAPLAYER
providerId=MPROVIDERID_VDR;
{
waitType = 2;
- char* vdpreply = ds.getData();
+ const char* vdpreply = static_cast<const char*>(ds.getData());
if ((ds.getDataLength() >= 24) && !strncmp(vdpreply, "VDP-0002", 8))
{
VDRServer newServer;
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/>.
*/
bool sendKA(ULONG timeStamp);
Log* logger;
- int initted;
- int findingServer;
- TCP* tcp;
+ int initted{};
+ int findingServer{};
+ TCP* tcp{};
char serverIP[40];
USHORT serverPort;
- bool connected;
- ULONG maxChannelNumber;
- bool doVDRShutdown;
- ULONG channelNumberWidth;
+ bool connected{};
+ ULONG maxChannelNumber{};
+ bool doVDRShutdown{};
+ ULONG channelNumberWidth{1};
VDR_PacketReceiver* TEMP_SINGLE_VDR_PR;
#ifdef VOMP_MEDIAPLAYER
m->from = this;
m->to = parent;
m->message = Message::CHANNEL_CHANGE;
- m->parameter.num = (*chanList)[currentChannelIndex]->number;
+ m->parameter = (*chanList)[currentChannelIndex]->number;
MessageQueue::getInstance()->postMessageNoLock(m);
}
m->from = this;
m->to = parent;
m->message = Message::CHANNEL_CHANGE;
- m->parameter.num = (*chanList)[currentChannelIndex]->number;
+ m->parameter = (*chanList)[currentChannelIndex]->number;
MessageQueue::getInstance()->postMessageNoLock(m);
}
m->from = this;
m->to = parent;
m->message = Message::CHANNEL_CHANGE;
- m->parameter.num = (*chanList)[currentChannelIndex]->number;
+ m->parameter = (*chanList)[currentChannelIndex]->number;
MessageQueue::getInstance()->postMessageNoLock(m);
}
{
if (m->message == Message::MOUSE_MOVE)
{
- if (chanListbox.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (chanListbox.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
drawData();
boxstack->update(this);
}
else if (m->message == Message::MOUSE_LBDOWN)
{
- if (chanListbox.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (chanListbox.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
boxstack->handleCommand(Remote::OK); //simulate OK press
}
else
{
//check if press is outside this view! then simulate cancel
- int x=(m->parameter.num>>16)-getScreenX();
- int y=(m->parameter.num&0xFFFF)-getScreenY();
+ int x=(m->parameter>>16)-getScreenX();
+ int y=(m->parameter&0xFFFF)-getScreenY();
int keyx = chanListbox.getRootBoxOffsetX();
int keyy = chanListbox.getRootBoxOffsetY() + chanListbox.getHeight() + 2;
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 "vepglistadvanced.h"
#include "colour.h"
#include "video.h"
#include "i18n.h"
-#include "command.h"
+#include "messagequeue.h"
#include "log.h"
#include "movieinfo.h"
#include "seriesinfo.h"
m->from = this;
m->to = videolive;
m->message = Message::CHANNEL_CHANGE;
- m->parameter.num = channelNumber;
+ m->parameter = channelNumber;
m->tag = 0;
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
}
}
if (m->message == Message::MOUSE_MOVE)
{
- if (sl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
quickUpdate();
boxstack->update(this);
}
else if (m->message == Message::MOUSE_LBDOWN)
{
- if (sl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
boxstack->handleCommand(Remote::OK); //simulate OK press
}
- else if (boxRed.mouseLBDOWN((m->parameter.num >> 16) - getScreenX(), (m->parameter.num & 0xFFFF) - getScreenY()))
+ else if (boxRed.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
{
boxstack->handleCommand(Remote::RED);
}
- else if (boxGreen.mouseLBDOWN((m->parameter.num >> 16) - getScreenX(), (m->parameter.num & 0xFFFF) - getScreenY()))
+ else if (boxGreen.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
{
boxstack->handleCommand(Remote::GREEN);
}
- else if (boxYellow.mouseLBDOWN((m->parameter.num >> 16) - getScreenX(), (m->parameter.num & 0xFFFF) - getScreenY()))
+ else if (boxYellow.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
{
boxstack->handleCommand(Remote::GREEN);
}
- else if (boxBlue.mouseLBDOWN((m->parameter.num >> 16) - getScreenX(), (m->parameter.num & 0xFFFF) - getScreenY()))
+ else if (boxBlue.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
{
boxstack->handleCommand(Remote::GREEN);
}
else
{
//check if press is outside this view! then simulate cancel
- int x=(m->parameter.num>>16)-getScreenX();
- int y=(m->parameter.num&0xFFFF)-getScreenY();
+ int x=(m->parameter>>16)-getScreenX();
+ int y=(m->parameter&0xFFFF)-getScreenY();
if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
{
boxstack->handleCommand(Remote::BACK); //simulate cancel press
#include "vinfo.h"
#include "message.h"
#include "command.h"
+#include "messagequeue.h"
#include "video.h"
#include "remote.h"
#include "i18n.h"
Message* m = new Message();
m->message = Message::ADD_VIEW;
m->to = boxstack;
- m->parameter.num = (ULONG)vi;
- Command::getInstance()->postMessageNoLock(m);
+ m->parameter = (ULONG)vi;
+ MessageQueue::getInstance()->postMessageNoLock(m);
}
void VEpgSetTimer::processMessage(Message* m)
{
if (m->message == Message::MOUSE_MOVE)
{
- if (buttonYes.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (buttonYes.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
buttonNo.setActive(0);
selectedOption = YES;
draw();
boxstack->update(this);
}
- else if (buttonNo.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ else if (buttonNo.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
buttonYes.setActive(0);
selectedOption = NO;
}
else if (m->message == Message::MOUSE_LBDOWN)
{
- if (buttonYes.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (buttonYes.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
boxstack->handleCommand(Remote::OK); //simulate OK press
}
- else if (buttonNo.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ else if (buttonNo.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
boxstack->handleCommand(Remote::OK); //simulate OK press
}
else
{
//check if press is outside this view! then simulate cancel
- int x=(m->parameter.num>>16)-getScreenX();
- int y=(m->parameter.num&0xFFFF)-getScreenY();
+ int x=(m->parameter>>16)-getScreenX();
+ int y=(m->parameter&0xFFFF)-getScreenY();
if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
{
boxstack->handleCommand(Remote::BACK); //simulate cancel press
{
if (m->message == Message::MOUSE_MOVE)
{
- if (tabbar.mouseMove((m->parameter.num >> 16) - getScreenX(), (m->parameter.num & 0xFFFF) - getScreenY()))
+ if (tabbar.mouseMove((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
{
BoxStack::getInstance()->update(this);
}
else if (m->message == Message::MOUSE_LBDOWN)
{
int cancel = true;
- int x = (m->parameter.num >> 16) - getScreenX();
- int y = (m->parameter.num & 0xFFFF) - getScreenY();
+ int x = (m->parameter >> 16) - getScreenX();
+ int y = (m->parameter & 0xFFFF) - getScreenY();
if ((boxRed.getX() <= x) && (boxRed.getX() + (int)boxRed.getWidth() >= x) &&
(boxRed.getY() <= y) && (boxRed.getY() + (int)boxRed.getHeight() >= y)) {
}
- if (cancel && tabbar.mouseLBDOWN((m->parameter.num >> 16) - getScreenX(), (m->parameter.num & 0xFFFF) - getScreenY()))
+ if (cancel && tabbar.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
{
BoxStack::getInstance()->update(this);
cancel = false;
if (cancel)
{
//check if press is outside this view! then simulate cancel
- int checkX=(m->parameter.num>>16)-getScreenX();
- int checkY=(m->parameter.num&0xFFFF)-getScreenY();
+ int checkX=(m->parameter>>16)-getScreenX();
+ int checkY=(m->parameter&0xFFFF)-getScreenY();
if (checkX<0 || checkY <0 || checkX>(int)getWidth() || checkY>(int)getHeight())
{
BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
} else if (m->message == Message::MOUSE_SCROLL)
{
if (tabbar.mouseAndroidScroll((m->tag >> 16) - getScreenX(), (m->tag & 0xFFFF) - getScreenY(),
- (short)(m->parameter.num >> 16), (short)(m->parameter.num & 0xFFFF)))
+ (short)(m->parameter >> 16), (short)(m->parameter & 0xFFFF)))
{
BoxStack::getInstance()->update(this);
return;
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 "video.h"
#include "i18n.h"
#include "vdr.h"
-#include "command.h"
+#include "messagequeue.h"
#include "vinfo.h"
#include "media.h"
#include "mediaplayer.h"
{
if (m->message == Message::MOUSE_MOVE)
{
- if (sl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
sl.draw();
doShowingBar();
}
else if (m->message == Message::MOUSE_LBDOWN)
{
- if (sl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
updateSelection();
boxstack->handleCommand(Remote::OK); //simulate OK press
}
else
{ //check if press is outside this view! then simulate cancel
- int x=(m->parameter.num>>16)-getScreenX();
- int y=(m->parameter.num&0xFFFF)-getScreenY();
+ int x=(m->parameter>>16)-getScreenX();
+ int y=(m->parameter&0xFFFF)-getScreenY();
if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
{
boxstack->handleCommand(Remote::BACK); //simulate cancel press
}
}
else if (m->message == Message::PLAYER_EVENT) {
- switch (m->parameter.num) {
+ switch (m->parameter) {
case 1:
directoryDone();
break;
Message* m = new Message();
m->message = Message::ADD_VIEW;
m->to = boxstack;
- m->parameter.num = (ULONG)vi;
- Command::getInstance()->postMessageNoLock(m);
+ m->parameter = (ULONG)vi;
+ MessageQueue::getInstance()->postMessageNoLock(m);
}
return 1;
}
Message* m = new Message();
m->message = Message::PLAYER_EVENT;
m->to = this;
- m->parameter.num = ref;
- Command::getInstance()->postMessageFromOuterSpace(m);
+ m->parameter = ref;
+ MessageQueue::getInstance()->postMessageFromOuterSpace(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/>.
*/
#include <time.h>
#include "mediaoptions.h"
#include "mediaplayer.h"
#include "log.h"
+#include "messagequeue.h"
const int VMediaView::EVENT_SLIDESHOW=100;
const int VMediaView::EVENT_DRAWINGDONE=101;
m->message = Message::PLAYER_EVENT;
m->to = _parent;
m->from = _parent;
- m->parameter.num = rt?VMediaView::EVENT_DRAWINGDONE:VMediaView::EVENT_DRAWINGERROR;
- Command::getInstance()->postMessageFromOuterSpace(m);
+ m->parameter = rt?VMediaView::EVENT_DRAWINGDONE:VMediaView::EVENT_DRAWINGERROR;
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m);
}
Log::getInstance()->log("DrawingThread",Log::DEBUG,"finishing interrupt=%d",(int)_interrupted);
}
{
//check if press is outside this view! then simulate cancel
- int x=(m->parameter.num>>16)-getScreenX();
- int y=(m->parameter.num&0xFFFF)-getScreenY();
+ int x=(m->parameter>>16)-getScreenX();
+ int y=(m->parameter&0xFFFF)-getScreenY();
if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
{
BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
}
}
else if (m->message = Message::PLAYER_EVENT) {
- switch (m->parameter.num) {
+ switch (m->parameter) {
case EVENT_SLIDESHOW:
if (! pictureEnabled) break; //old timer msg...
//if (! audioEnabled) {
m->message = Message::CLOSE_ME;
m->to = BoxStack::getInstance();
m->from = v;
- m->parameter.num=(ULONG)v;
- Command::getInstance()->postMessageFromOuterSpace(m);
+ m->parameter=(ULONG)v;
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m);
}
void VMediaView::sendCommandMsg(int command) {
Message* m = new Message();
m->message = Message::PLAYER_EVENT;
m->to = this;
m->from = this;
- m->parameter.num = command;
- Command::getInstance()->postMessageFromOuterSpace(m);
+ m->parameter = command;
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m);
}
void VMediaView::enableBanner(bool enable) {
#include "colour.h"
#include "timers.h"
#include "boxstack.h"
-#include "command.h"
+#include "messagequeue.h"
VMute::VMute()
{
m->message = Message::CLOSE_ME;
m->to = BoxStack::getInstance();
m->from = this;
- Command::getInstance()->postMessageFromOuterSpace(m);
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m);
}
int VMute::handleCommand(int command)
{
if (m->message == Message::MOUSE_MOVE)
{
- int x=(m->parameter.num>>16)-getScreenX();
- int y=(m->parameter.num&0xFFFF)-getScreenY();
+ int x=(m->parameter>>16)-getScreenX();
+ int y=(m->parameter&0xFFFF)-getScreenY();
if (tabbar.mouseMove(x,y))
{
BoxStack::getInstance()->update(this);
}
else if (m->message == Message::MOUSE_LBDOWN)
{
- int x=(m->parameter.num>>16)-getScreenX();
- int y=(m->parameter.num&0xFFFF)-getScreenY();
+ int x=(m->parameter>>16)-getScreenX();
+ int y=(m->parameter&0xFFFF)-getScreenY();
if (tabbar.mouseLBDOWN(x,y))
{
BoxStack::getInstance()->update(this);
else if (m->message == Message::MOUSE_LBDOWN)
{
//check if press is outside this view! then simulate cancel
- int x=(m->parameter.num>>16)-getScreenX();
- int y=(m->parameter.num&0xFFFF)-getScreenY();
+ int x=(m->parameter>>16)-getScreenX();
+ int y=(m->parameter&0xFFFF)-getScreenY();
if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
{
BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
{
if (m->message == Message::MOUSE_MOVE)
{
- if (buttonYes.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (buttonYes.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
buttonNo.setActive(0);
selectedOption = YES;
draw();
BoxStack::getInstance()->update(this);
}
- else if (buttonNo.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ else if (buttonNo.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
buttonYes.setActive(0);
selectedOption = NO;
}
else if (m->message == Message::MOUSE_LBDOWN)
{
- if (buttonYes.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (buttonYes.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
}
- else if (buttonNo.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ else if (buttonNo.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
}
else
{
//check if press is outside this view! then simulate cancel
- int x=(m->parameter.num>>16)-getScreenX();
- int y=(m->parameter.num&0xFFFF)-getScreenY();
+ int x=(m->parameter>>16)-getScreenX();
+ int y=(m->parameter&0xFFFF)-getScreenY();
if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
{
BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
#include "vinfo.h"
#include "i18n.h"
#include "log.h"
+#include "messagequeue.h"
VRadioRec::VRadioRec(Recording* rec)
{
m->message = Message::CLOSE_ME;
m->from = this;
m->to = boxstack;
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
VInfo* vi = new VInfo();
vi->setSize(400, 150);
m = new Message();
m->message = Message::ADD_VIEW;
m->to = boxstack;
- m->parameter.num = (ULONG)vi;
- Command::getInstance()->postMessageNoLock(m);
+ m->parameter = (ULONG)vi;
+ MessageQueue::getInstance()->postMessageNoLock(m);
}
}
{
if (m->message == Message::MOUSE_LBDOWN)
{
- int x=(m->parameter.num>>16)-(int)getScreenX();
- int y=(m->parameter.num&0xFFFF)-(int)getScreenY();
+ int x=(m->parameter>>16)-(int)getScreenX();
+ int y=(m->parameter&0xFFFF)-(int)getScreenY();
if (!barShowing)
{
boxstack->handleCommand(Remote::OK); //simulate rok press
Log::getInstance()->log("VRadioRec", Log::DEBUG, "Message received");
- switch(m->parameter.num)
+ switch(m->parameter)
{
case Player::CONNECTION_LOST: // connection lost detected
{
Message* m2 = new Message();
m2->to = Command::getInstance();
m2->message = Message::CONNECTION_LOST;
- Command::getInstance()->postMessageNoLock(m2);
+ MessageQueue::getInstance()->postMessageNoLock(m2);
break;
}
case Player::STOP_PLAYBACK:
Message* m2 = new Message(); // Must be done after this thread finishes, and must break into master mutex
m2->to = Command::getInstance();
m2->message = Message::STOP_PLAYBACK;
- Command::getInstance()->postMessageNoLock(m2);
+ MessageQueue::getInstance()->postMessageNoLock(m2);
break;
}
}
#include "colour.h"
#include "video.h"
#include "i18n.h"
-#include "command.h"
+#include "messagequeue.h"
#include "wsymbol.h"
#include "recman.h"
#include "directory.h"
Message* m = new Message();
m->message = Message::MOVE_RECORDING;
m->to = parent;
- m->parameter.num = sl.getCurrentOptionData();
- Command::getInstance()->postMessageNoLock(m);
+ m->parameter = sl.getCurrentOptionData();
+ MessageQueue::getInstance()->postMessageNoLock(m);
return 4;
}
{
if (m->message == Message::MOUSE_MOVE)
{
- if (sl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
sl.draw();
BoxStack::getInstance()->update(this);
}
else if (m->message == Message::MOUSE_LBDOWN)
{
- if (sl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
}
else
{
//check if press is outside this view! then simulate cancel
- int x=(m->parameter.num>>16)-getScreenX();
- int y=(m->parameter.num&0xFFFF)-getScreenY();
+ int x=(m->parameter>>16)-getScreenX();
+ int y=(m->parameter&0xFFFF)-getScreenY();
if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
{
BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
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 "vrecording.h"
#include "colour.h"
#include "video.h"
#include "i18n.h"
-#include "command.h"
+#include "messagequeue.h"
#include "vrecmove.h"
#include "boxstack.h"
#include "recman.h"
m->from = this;
m->to = vRecList;
m->message = Message::PLAY_SELECTED_RECORDING;
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
return 4;
}
m->from = this;
m->to = vRecList;
m->message = Message::RESUME_SELECTED_RECORDING;
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
return 4;
}
Message* m = new Message();
m->message = Message::ADD_VIEW;
m->to = BoxStack::getInstance();
- m->parameter.num = (ULONG)vi;
- Command::getInstance()->postMessageNoLock(m);
+ m->parameter = (ULONG)vi;
+ MessageQueue::getInstance()->postMessageNoLock(m);
if (ret == 1)
{
m2->from = this;
m2->to = vRecList;
m2->message = Message::REDRAW;
- Command::getInstance()->postMessageNoLock(m2);
+ MessageQueue::getInstance()->postMessageNoLock(m2);
}
return 2;
{
for (int i = PLAY; i < last; i++)
{
- if (button[i].mouseMove((m->parameter.num >> 16) - getScreenX(), (m->parameter.num & 0xFFFF) - getScreenY()))
+ if (button[i].mouseMove((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
{
for (int j = PLAY; j < last; j++)
button[j].setActive(0);
break;
}
}
- if (tabbar.mouseMove((m->parameter.num >> 16) - getScreenX(), (m->parameter.num & 0xFFFF) - getScreenY()))
+ if (tabbar.mouseMove((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
{
BoxStack::getInstance()->update(this);
return;
else if (m->message == Message::MOUSE_SCROLL)
{
if (tabbar.mouseAndroidScroll((m->tag >> 16) - getScreenX(), (m->tag & 0xFFFF) - getScreenY(),
- (short)(m->parameter.num >> 16), (short) (m->parameter.num & 0xFFFF)))
+ (short)(m->parameter >> 16), (short) (m->parameter & 0xFFFF)))
{
BoxStack::getInstance()->update(this);
return;
int cancel = true;
for (int i = PLAY; i < last; i++)
{
- if (button[i].mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (button[i].mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
buttons = true;
break;
}
}
- if (cancel && tabbar.mouseLBDOWN((m->parameter.num >> 16) - getScreenX(), (m->parameter.num & 0xFFFF) - getScreenY()))
+ if (cancel && tabbar.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
{
buttons = false;
button[selected].setActive(0);
if (cancel)
{
//check if press is outside this view! then simulate cancel
- int x=(m->parameter.num>>16)-getScreenX();
- int y=(m->parameter.num&0xFFFF)-getScreenY();
+ int x=(m->parameter>>16)-getScreenX();
+ int y=(m->parameter&0xFFFF)-getScreenY();
if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
{
BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
m2->from = this;
m2->to = BoxStack::getInstance();
m2->message = Message::CLOSE_ME;
- Command::getInstance()->postMessageNoLock(m2);
+ MessageQueue::getInstance()->postMessageNoLock(m2);
m2 = new Message(); // OK. Want this to delete before this message does its job
m2->from = this;
m2->to = vRecList;
m2->message = Message::DELETE_SELECTED_RECORDING;
- Command::getInstance()->postMessageNoLock(m2);
+ MessageQueue::getInstance()->postMessageNoLock(m2);
}
}
else if (m->message == Message::MOVE_RECORDING)
m2->from = this;
m2->to = BoxStack::getInstance();
m2->message = Message::CLOSE_ME;
- Command::getInstance()->postMessageNoLock(m2);
+ MessageQueue::getInstance()->postMessageNoLock(m2);
m2 = new Message();
m2->from = this;
m2->to = vRecList;
m2->message = Message::MOVE_RECORDING;
- m2->parameter.num = m->parameter.num;
- Command::getInstance()->postMessageNoLock(m2);
+ m2->parameter = m->parameter;
+ MessageQueue::getInstance()->postMessageNoLock(m2);
}
}
if (m->message == Message::MOUSE_MOVE)
{
- if (sl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
quickUpdate();
boxstack->update(this);
}
else if (m->message == Message::MOUSE_LBDOWN)
{
- if (sl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
boxstack->handleCommand(Remote::OK); //simulate OK press
}
else
{
//check if press is outside this view! then simulate cancel
- int x=(m->parameter.num>>16)-getScreenX();
- int y=(m->parameter.num&0xFFFF)-getScreenY();
+ int x=(m->parameter>>16)-getScreenX();
+ int y=(m->parameter&0xFFFF)-getScreenY();
if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
{
boxstack->handleCommand(Remote::BACK); //simulate cancel press
else if (m->message == Message::MOVE_RECORDING)
{
Log::getInstance()->log("VRecordingList", Log::DEBUG, "Doing move recording");
- doMoveRecording((Directory*)m->parameter.num);
+ doMoveRecording((Directory*)m->parameter);
}
else if (m->message == Message::PLAY_SELECTED_RECORDING)
{
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 "vrecordingmenu.h"
#include "colour.h"
#include "video.h"
#include "i18n.h"
-#include "command.h"
+#include "messagequeue.h"
#include "vrecmove.h"
#include "boxstack.h"
#include "recman.h"
m->from = this;
m->to = vRecList;
m->message = Message::PLAY_SELECTED_RECORDING;
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
return 4;
}
m->from = this;
m->to = vRecList;
m->message = Message::RESUME_SELECTED_RECORDING;
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
return 4;
}
{
if (m->message == Message::MOUSE_MOVE)
{
- if (sl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
sl.draw();
BoxStack::getInstance()->update(this);
}
else if (m->message == Message::MOUSE_LBDOWN)
{
- if (sl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
}
else
{
//check if press is outside this view! then simulate cancel
- int x=(m->parameter.num>>16)-getScreenX();
- int y=(m->parameter.num&0xFFFF)-getScreenY();
+ int x=(m->parameter>>16)-getScreenX();
+ int y=(m->parameter&0xFFFF)-getScreenY();
if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
{
BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
m2->from = this;
m2->to = BoxStack::getInstance();
m2->message = Message::CLOSE_ME;
- Command::getInstance()->postMessageNoLock(m2);
+ MessageQueue::getInstance()->postMessageNoLock(m2);
m2 = new Message(); // OK. Want this to delete before this message does its job
m2->from = this;
m2->to = vRecList;
m2->message = Message::DELETE_SELECTED_RECORDING;
- Command::getInstance()->postMessageNoLock(m2);
+ MessageQueue::getInstance()->postMessageNoLock(m2);
}
}
else if (m->message == Message::MOVE_RECORDING)
m2->from = this;
m2->to = BoxStack::getInstance();
m2->message = Message::CLOSE_ME;
- Command::getInstance()->postMessageNoLock(m2);
+ MessageQueue::getInstance()->postMessageNoLock(m2);
m2 = new Message();
m2->from = this;
m2->to = vRecList;
m2->message = Message::MOVE_RECORDING;
- m2->parameter.num = m->parameter.num;
- Command::getInstance()->postMessageNoLock(m2);
+ m2->parameter = m->parameter;
+ MessageQueue::getInstance()->postMessageNoLock(m2);
}
}
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 VRECORDINGMENU_H
#include "video.h"
#include "boxstack.h"
#include "i18n.h"
-#include "command.h"
+#include "messagequeue.h"
VServerSelect::VServerSelect(std::vector<VDRServer>& servers, void* treplyTo)
Message* m = new Message(); // Question/Answer mech. Better being messages
m->to = replyTo;
m->message = Message::SERVER_SELECTED;
- m->parameter.num = sl.getCurrentOption();
- Command::getInstance()->postMessageNoLock(m);
+ m->parameter = sl.getCurrentOption();
+ MessageQueue::getInstance()->postMessageNoLock(m);
return 4;
}
}
{
if (m->message == Message::MOUSE_MOVE)
{
- if (sl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
sl.draw();
BoxStack::getInstance()->update(this);
}
else if (m->message == Message::MOUSE_LBDOWN)
{
- if (sl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
}
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 "vsleeptimer.h"
Sleeptimer::Sleeptimer()
{
if (instance) return;
- sec = -1;
- active = false;
instance = this;
-
}
Sleeptimer::~Sleeptimer()
instance = NULL;
}
-
const char* Sleeptimer::SetTime()
{
- if (sec <890)
- {
- sec=900;
- if (active==false)
- {
- active = true;
- threadStart();
- }
-
- return "0:15";
- }
- else if (sec <1790)
- {
- sec = 1800;
- if (active==false)
- {
- active = true;
- threadStart();
- }
-
- return "0:30";
- }
- else if (sec < 2690)
- {
- sec = 2700;
- if (active==false)
- {
- active = true;
- threadStart();
- }
-
- return "0:45";
- }
- else if (sec < 3590)
- {
- sec = 3600;
- if (active==false)
- {
- active = true;
- threadStart();
- }
-
- return "1:00";
- }
- else if (sec < 4490)
- {
- sec = 4500;
- if (active==false)
- {
- active = true;
- threadStart();
- }
-
- return "1:15";
- }
- else if (sec < 5390)
- {
- sec = 5400;
- if (active==false)
- {
- active = true;
- threadStart();
- }
-
- return "1:30";
- }
- else if (sec < 6290)
- {
- sec = 6300;
- if (active==false)
- {
- active = true;
- threadStart();
- }
-
- return "1:45";
- }
- else if (sec < 7190)
- {
- sec = 7200;
- if (active==false)
- {
- active = true;
- threadStart();
- }
-
- return "2:00";
-
- }
- else
- {
- sec = -1;
- if (active==true)
- shutdown();
- return "AUS";
- }
-
+ if (sec < 890)
+ {
+ sec = 900;
+ if (active == false)
+ {
+ active = true;
+ threadStart();
+ }
+
+ return "0:15";
+ }
+ else if (sec <1790)
+ {
+ sec = 1800;
+ if (active == false)
+ {
+ active = true;
+ threadStart();
+ }
+
+ return "0:30";
+ }
+ else if (sec < 2690)
+ {
+ sec = 2700;
+ if (active==false)
+ {
+ active = true;
+ threadStart();
+ }
+
+ return "0:45";
+ }
+ else if (sec < 3590)
+ {
+ sec = 3600;
+ if (active==false)
+ {
+ active = true;
+ threadStart();
+ }
+
+ return "1:00";
+ }
+ else if (sec < 4490)
+ {
+ sec = 4500;
+ if (active==false)
+ {
+ active = true;
+ threadStart();
+ }
+
+ return "1:15";
+ }
+ else if (sec < 5390)
+ {
+ sec = 5400;
+ if (active==false)
+ {
+ active = true;
+ threadStart();
+ }
+
+ return "1:30";
+ }
+ else if (sec < 6290)
+ {
+ sec = 6300;
+ if (active==false)
+ {
+ active = true;
+ threadStart();
+ }
+
+ return "1:45";
+ }
+ else if (sec < 7190)
+ {
+ sec = 7200;
+ if (active==false)
+ {
+ active = true;
+ threadStart();
+ }
+
+ return "2:00";
+
+ }
+ else
+ {
+ sec = -1;
+ if (active==true)
+ shutdown();
+ return "AUS";
+ }
}
Sleeptimer* Sleeptimer::getInstance()
{
- return instance;
+ return instance;
}
void Sleeptimer::threadMethod()
{
-
- while (sec>-1 && active==true)
- {
- sec--;
- if (sec<31 && sec>-1)
- {
- VCountdown* count = new VCountdown();
- char* temp = (char*)malloc(20);
- sprintf(temp, "0:%02d", sec);
- count->drawClock(temp);
- free(temp);
- Message* m1 = new Message();
- m1->message = Message::ADD_VIEW;
- m1->to = BoxStack::getInstance();
- m1->parameter.num = (ULONG)count;
- MessageQueue::getInstance()->postMessageNoLock(m1);
- }
- MILLISLEEP(1000);
-
-
- if (sec==-1)
- {
- Message* m2 = new Message(); // Delete self
- m2->message = Message::UDP_BUTTON;
- m2->to = Command::getInstance();
- m2->from = this;
- m2->parameter.num = 61;
- MessageQueue::getInstance()->postMessageFromOuterSpace(m2);
- shutdown();
- }
-
- }
-
-
+ while (sec>-1 && active==true)
+ {
+ sec--;
+ if (sec<31 && sec>-1)
+ {
+ VCountdown* count = new VCountdown();
+ char temp[20];
+ sprintf(temp, "0:%02d", sec);
+ count->drawClock(temp);
+
+ Message* m1 = new Message();
+ m1->message = Message::ADD_VIEW;
+ m1->to = BoxStack::getInstance();
+ m1->parameter = (ULONG)count;
+ MessageQueue::getInstance()->postMessageNoLock(m1);
+ }
+ MILLISLEEP(1000);
+
+ if (sec == -1)
+ {
+ Message* m2 = new Message(); // Delete self
+ m2->message = Message::UDP_BUTTON;
+ m2->to = Command::getInstance();
+ m2->from = this;
+ m2->parameter = 61; // FIXME use constant name when they're sorted out
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m2);
+ shutdown();
+ }
+ }
}
void Sleeptimer::shutdown()
{
- if (active==true)
- {
- sec=-1;
- threadCancel();
- active = false;
- }
-
+ if (active)
+ {
+ sec = -1;
+ threadCancel();
+ active = false;
+ }
}
void VSleeptimer::draw()
{
- fillColour(DrawStyle::VIEWBACKGROUND);
- WSymbol w;
- TEMPADD(&w);
- w.nextSymbol = WSymbol::CLOCK;
- w.setPosition(3, 0);
- w.draw();
+ fillColour(DrawStyle::VIEWBACKGROUND);
+ WSymbol w;
+ TEMPADD(&w);
+ w.nextSymbol = WSymbol::CLOCK;
+ w.setPosition(3, 0);
+ w.draw();
- Boxx::draw();
- drawText(displaySleeptimer,50,2,DrawStyle::LIGHTTEXT);
- Timers::getInstance()->setTimerD(this, 1, 2);
+ Boxx::draw();
+ drawText(displaySleeptimer,50,2,DrawStyle::LIGHTTEXT);
+ Timers::getInstance()->setTimerD(this, 1, 2);
}
void VSleeptimer::timercall(int clientReference)
void VCountdown::drawClock(const char* sec)
{
-
- fillColour(DrawStyle::VIEWBACKGROUND);
- WSymbol w;
- TEMPADD(&w);
- w.nextSymbol = WSymbol::CLOCK;
- w.nextColour = DrawStyle::RED;
- w.setPosition(3, 0);
- w.draw();
-
- Boxx::draw();
- drawText(sec,50,2,DrawStyle::RED);
- Timers::getInstance()->setTimerD(this, 1, 1);
+ fillColour(DrawStyle::VIEWBACKGROUND);
+ WSymbol w;
+ TEMPADD(&w);
+ w.nextSymbol = WSymbol::CLOCK;
+ w.nextColour = DrawStyle::RED;
+ w.setPosition(3, 0);
+ w.draw();
+
+ Boxx::draw();
+ drawText(sec, 50, 2, DrawStyle::RED);
+ Timers::getInstance()->setTimerD(this, 1, 1);
}
void VCountdown::timercall(int clientReference)
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 VSLEEPTIMER_H
virtual void threadPostStopCleanup() {};
private:
- int sec;
- bool active;
+ int sec{-1};
+ bool active{};
static Sleeptimer* instance;
-
-
-
};
-
-
class VSleeptimer : public Boxx, public TimerReceiver
{
public:
void timercall(int clientReference);
private:
- const char* displaySleeptimer;
-
+ const char* displaySleeptimer;
};
class VCountdown : public Boxx, public TimerReceiver
{
-
- public:
- VCountdown();
- ~VCountdown();
- void drawClock(const char* sec);
- void timercall(int clientReference);
-
-}
-;
-
+ public:
+ VCountdown();
+ ~VCountdown();
+ void drawClock(const char* sec);
+ void timercall(int clientReference);
+};
#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 "vtimeredit.h"
#include "i18n.h"
#include "timers.h"
#include "vquestion.h"
-#include "command.h"
+#include "messagequeue.h"
#include "staticartwork.h"
VTimerEdit::VTimerEdit(RecTimer* trt)
{
if (m->message == Message::MOUSE_MOVE)
{
- int x=(m->parameter.num>>16)-getScreenX();
- int y=(m->parameter.num&0xFFFF)-getScreenY();
+ int x=(m->parameter>>16)-getScreenX();
+ int y=(m->parameter&0xFFFF)-getScreenY();
if (buttonBack.mouseMove(x,y)) {
selectedButton=0;
buttonDelete.setActive(false);
m2->from = this;
m2->to = BoxStack::getInstance();
m2->message = Message::CLOSE_ME;
- Command::getInstance()->postMessageNoLock(m2);
+ MessageQueue::getInstance()->postMessageNoLock(m2);
m2 = new Message(); // OK. Want this to delete before this message does its job
m2->from = this;
m2->to = vTimerList;
m2->message = Message::DELETE_SELECTED_TIMER;
- Command::getInstance()->postMessageNoLock(m2);
+ MessageQueue::getInstance()->postMessageNoLock(m2);
}
}
}
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 VTIMEREDIT_H
{
if (m->message == Message::MOUSE_MOVE)
{
- if (sl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
quickUpdate();
BoxStack::getInstance()->update(this);
}
else if (m->message == Message::MOUSE_LBDOWN)
{
- if (sl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
}
else
{
//check if press is outside this view! then simulate cancel
- int x=(m->parameter.num>>16)-getScreenX();
- int y=(m->parameter.num&0xFFFF)-getScreenY();
+ int x=(m->parameter>>16)-getScreenX();
+ int y=(m->parameter&0xFFFF)-getScreenY();
if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
{
BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
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 "vvideolivetv.h"
#include "vepglistadvanced.h"
#include "staticartwork.h"
#include "demuxer.h"
+#include "messagequeue.h"
#include <sstream>
Message* m = new Message();
m->message = Message::CHANNEL_CHANGE;
m->to = this;
- m->parameter.num = newChannel;
+ m->parameter = newChannel;
m->tag = 1; // signal to call displayOSD();
- Command::getInstance()->postMessageFromOuterSpace(m);
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m);
Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Timer Call 1 key end.");
}
else
if (m->message == Message::MOUSE_LBDOWN)
{
//check if press is outside this view! then simulate cancel
- int x = (m->parameter.num >> 16) - osd.getScreenX();
- int y = (m->parameter.num & 0xFFFF) - osd.getScreenY();
+ int x = (m->parameter >> 16) - osd.getScreenX();
+ int y = (m->parameter & 0xFFFF) - osd.getScreenY();
if (osd.getVisible())
{
if ((boxRed.getX()<=x) && (boxRed.getX()+(int)boxRed.getWidth()>=x ) &&
}
else if (m->message == Message::CHANNEL_CHANGE)
{
- channelChange(NUMBER, m->parameter.num);
+ channelChange(NUMBER, m->parameter);
osdChannelIndex = currentChannelIndex;
if (m->tag == 1) displayOSD(true);
}
}
else if (m->message == Message::AUDIO_CHANGE_CHANNEL)
{
- Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Received change audio channel to %x", m->parameter.num);
- player->setAudioChannel((m->parameter.num & 0xFFFF), (m->parameter.num & 0xFF0000) >> 16, (m->parameter.num & 0xFF000000) >> 24);
+ Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Received change audio channel to %x", m->parameter);
+ player->setAudioChannel((m->parameter & 0xFFFF), (m->parameter & 0xFF0000) >> 16, (m->parameter & 0xFF000000) >> 24);
}
else if (m->message == Message::SUBTITLE_CHANGE_CHANNEL)
{
if (streamType != VDR::VIDEO) return;
- Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Received change subtitle channel to %x", m->parameter.num);
- int type = (m->parameter.num & 0xFF0000) >> 16;
+ Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Received change subtitle channel to %x", m->parameter);
+ int type = (m->parameter & 0xFF0000) >> 16;
switch (type)
{
case 0x10:
//dvbsubtitle
if (streamType == VDR::VIDEO)
{
- player->setSubtitleChannel((m->parameter.num & 0xFFFF));
+ player->setSubtitleChannel((m->parameter & 0xFFFF));
(static_cast<PlayerLiveTV*>(player))->turnSubtitlesOn(true);
VTeletextView *vtxt=((PlayerLiveTV*)player)->getTeletextDecoder()->getTeletxtView();
if (vtxt && vtxt->isInSubtitleMode())
{ //videotext
(static_cast<PlayerLiveTV*>(player))->turnSubtitlesOn(false);
doTeletext(true);
- ((PlayerLiveTV*)player)->getTeletextDecoder()->setPage((m->parameter.num & 0xFFFF));
+ ((PlayerLiveTV*)player)->getTeletextDecoder()->setPage((m->parameter & 0xFFFF));
} break;
};
}
else if (m->message == Message::PLAYER_EVENT)
{
- switch (m->parameter.num)
+ switch (m->parameter)
{
case PlayerLiveTV::CONNECTION_LOST: // connection lost detected
{
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 "vvideomedia.h"
#include "i18n.h"
#include "log.h"
#include "recinfo.h"
+#include "messagequeue.h"
//use the picture channel
#define MEDIACHANNEL 1
m->message = Message::CLOSE_ME;
m->from = this;
m->to = boxstack;
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
VInfo* vi = new VInfo();
vi->setSize(400, 150);
m = new Message();
m->message = Message::ADD_VIEW;
m->to = boxstack;
- m->parameter.num = (ULONG)vi;
- Command::getInstance()->postMessageNoLock(m);
+ m->parameter = (ULONG)vi;
+ MessageQueue::getInstance()->postMessageNoLock(m);
}
}
if (m->message == Message::MOUSE_LBDOWN)
{
- UINT x = (m->parameter.num>>16) - getScreenX();
- UINT y = (m->parameter.num&0xFFFF) - getScreenY();
+ UINT x = (m->parameter>>16) - getScreenX();
+ UINT y = (m->parameter&0xFFFF) - getScreenY();
if (!barShowing)
{
}
else if (m->message == Message::PLAYER_EVENT)
{
- switch(m->parameter.num)
+ switch(m->parameter)
{
case PlayerMedia::CONNECTION_LOST: // connection lost detected
{
Message* m2 = new Message();
m2->to = Command::getInstance();
m2->message = Message::CONNECTION_LOST;
- Command::getInstance()->postMessageNoLock(m2);
+ MessageQueue::getInstance()->postMessageNoLock(m2);
break;
}
case PlayerMedia::STREAM_END:
Message* m2 = new Message(); // Must be done after this thread finishes, and must break into master mutex
m2->to = BoxStack::getInstance();
m2->message = Message::CLOSE_ME;
- Command::getInstance()->postMessageNoLock(m2);
+ MessageQueue::getInstance()->postMessageNoLock(m2);
break;
}
case PlayerMedia::STATUS_CHANGE:
else if (m->message == Message::AUDIO_CHANGE_CHANNEL)
{
Log::getInstance()->log("VVideoMedia", Log::DEBUG, "Received change audio channel to %i", m->parameter);
- player->setAudioChannel(m->parameter.num);
+ player->setAudioChannel(m->parameter);
}
else if (m->message == Message::CHILD_CLOSE)
{
m->message=Message::PLAYER_EVENT;
m->to=this;
m->from=this;
- m->parameter.num=PLAYER_TIMER_BASE+clientReference;
- Command::getInstance()->postMessageFromOuterSpace(m);
+ m->parameter=PLAYER_TIMER_BASE+clientReference;
+ MessageQueue::getInstance()->postMessageFromOuterSpace(m);
}
void VVideoMedia::drawBarClocks()
#include "log.h"
#include "channel.h"
#include "vteletextview.h"
+#include "messagequeue.h"
#include "vvideorec.h"
VVideoRec::VVideoRec(Recording* rec, bool ish264)
m->message = Message::CLOSE_ME;
m->from = this;
m->to = boxstack;
- Command::getInstance()->postMessageNoLock(m);
+ MessageQueue::getInstance()->postMessageNoLock(m);
VInfo* vi = new VInfo();
vi->setSize(360, 200);
m = new Message();
m->message = Message::ADD_VIEW;
m->to = boxstack;
- m->parameter.num = (ULONG)vi;
- Command::getInstance()->postMessageNoLock(m);
+ m->parameter = (ULONG)vi;
+ MessageQueue::getInstance()->postMessageNoLock(m);
}
}
if (m->message == Message::MOUSE_LBDOWN)
{
- UINT x = (m->parameter.num>>16) - getScreenX();
- UINT y = (m->parameter.num&0xFFFF) - getScreenY();
+ UINT x = (m->parameter>>16) - getScreenX();
+ UINT y = (m->parameter&0xFFFF) - getScreenY();
if (!barShowing)
{
else if (m->from == player)
{
if (m->message != Message::PLAYER_EVENT) return;
- switch(m->parameter.num)
+ switch(m->parameter)
{
case Player::CONNECTION_LOST: // connection lost detected
{
Message* m2 = new Message();
m2->to = Command::getInstance();
m2->message = Message::CONNECTION_LOST;
- Command::getInstance()->postMessageNoLock(m2);
+ MessageQueue::getInstance()->postMessageNoLock(m2);
break;
}
case Player::STOP_PLAYBACK:
Message* m2 = new Message(); // Must be done after this thread finishes, and must break into master mutex
m2->to = Command::getInstance();
m2->message = Message::STOP_PLAYBACK;
- Command::getInstance()->postMessageNoLock(m2);
+ MessageQueue::getInstance()->postMessageNoLock(m2);
break;
}
case Player::ASPECT43:
}
else if (m->message == Message::AUDIO_CHANGE_CHANNEL)
{
- Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received change audio channel to %i", m->parameter.num);
- player->setAudioChannel(m->parameter.num&0xFFFF,(m->parameter.num&0xFF0000)>> 16,(m->parameter.num&0xFF000000)>> 24 );
+ Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received change audio channel to %i", m->parameter);
+ player->setAudioChannel(m->parameter&0xFFFF,(m->parameter&0xFF0000)>> 16,(m->parameter&0xFF000000)>> 24 );
}
else if (m->message == Message::SUBTITLE_CHANGE_CHANNEL)
{
- Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received change subtitle channel to %i", m->parameter.num);
- int type=((m->parameter.num & 0xFF0000)>>16);
+ Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received change subtitle channel to %i", m->parameter);
+ int type=((m->parameter & 0xFF0000)>>16);
switch (type) {
case 0x10: { //dvbsubtitle
- player->setSubtitleChannel((m->parameter.num & 0xFFFF));
+ player->setSubtitleChannel((m->parameter & 0xFFFF));
player->turnSubtitlesOn(true);
VTeletextView *vtxt=((Player*)player)->getTeletextDecoder()->getTeletxtView();
if (vtxt && vtxt->isInSubtitleMode()) {
case 0x11: { //videotext
player->turnSubtitlesOn(false);
doTeletext();
- ((Player*)player)->getTeletextDecoder()->setPage((m->parameter.num & 0xFFFF));
+ ((Player*)player)->getTeletextDecoder()->setPage((m->parameter & 0xFFFF));
} break;
};
if (vas) {
{
if (m->message == Message::MOUSE_MOVE)
{
- if (sl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
sl.draw();
boxstack->update(this);
}
else if (m->message == Message::MOUSE_LBDOWN)
{
- if (sl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+ if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
boxstack->handleCommand(Remote::OK); //simulate OK press
}
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/>.
*/
#ifdef WIN32
#include <stdio.h>
#include "command.h"
#include "wol.h"
#include "vsleeptimer.h"
+#include "messagequeue.h"
void sighandler(int signalReceived);
void shutdown(int code);
DWORD lastmousemove;
+MessageQueue* messageQueue;
+
void MILLISLEEP(ULONG a)
{
return 0;
}
+ messageQueue = command;
+
// Get logging module started --------------------------------------------------------------------------------------
if (!logger->init(Log::DEBUG, "vompwin.log", true))
mousemes->message=Message::MOUSE_MOVE;
mousemes->from=NULL;
mousemes->to=BoxStack::getInstance();
- mousemes->parameter.num=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF);
+ mousemes->parameter=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF);
mousemes->tag=0;
//command->postMessageFromOuterSpace(mousemes);
- command->postMessageIfNotBusy(mousemes);
+ messageQueue->postMessageIfNotBusy(mousemes);
}
return 0;
mousemes->message=Message::MOUSE_LBDOWN;
mousemes->from=NULL;
mousemes->to=BoxStack::getInstance();
- mousemes->parameter.num=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF);
+ mousemes->parameter=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF);
mousemes->tag=0;
- command->postMessageFromOuterSpace(mousemes);
+ messageQueue->postMessageFromOuterSpace(mousemes);
}
}break;
case WM_MOUSEWHEEL:{
mousemes->message = Message::MOUSE_SCROLL;
mousemes->from = NULL;
mousemes->to = BoxStack::getInstance();
- mousemes->parameter.num = (0 & 0xFFFF) << 16 | (GET_WHEEL_DELTA_WPARAM(wparam) &0xFFFF);
+ mousemes->parameter = (0 & 0xFFFF) << 16 | (GET_WHEEL_DELTA_WPARAM(wparam) &0xFFFF);
mousemes->tag = (mpos.x & 0xFFFF) << 16 | (mpos.y & 0xFFFF);
- command->postMessageFromOuterSpace(mousemes);
+ messageQueue->postMessageFromOuterSpace(mousemes);
}
} break;
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 "wremoteconfig.h"
m->message = Message::CHANGED_REMOTECONTROL;
m->to = parent;
m->parameter = 0;
- Command::getInstance()->postMessageNoLock(m);
+ //Command::getInstance()->postMessageNoLock(m);
}
*/
m->message = Message::CLOSE_ME;
m->from = this;
m->to = viewman;
- Command::getInstance()->postMessageNoLock(m);
+ //Command::getInstance()->postMessageNoLock(m);
return 2;
*/
}
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 "wwinaudiofilter.h"
m->message = Message::CHANGED_DEVICEOPTIONS;
m->to = parent;
m->parameter = 0;
- Command::getInstance()->postMessageNoLock(m);
+ //Command::getInstance()->postMessageNoLock(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/>.
*/
#include "wwinmp3audiofilter.h"
m->message = Message::CHANGED_DEVICEOPTIONS;
m->to = parent;
m->parameter = 0;
- Command::getInstance()->postMessageNoLock(m);
+ //Command::getInstance()->postMessageNoLock(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/>.
*/
#include "wwinvideofilter.h"
m->message = Message::CHANGED_DEVICEOPTIONS;
m->to = parent;
m->parameter = 0;
- Command::getInstance()->postMessageNoLock(m);
+ //Command::getInstance()->postMessageNoLock(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/>.
*/
#include "wwinvideoh264filter.h"
m->message = Message::CHANGED_DEVICEOPTIONS;
m->to = parent;
m->parameter = 0;
- Command::getInstance()->postMessageNoLock(m);
+ //Command::getInstance()->postMessageNoLock(m);
}*/