#include "boxstack.h"
-#include "command.h"
#include "messagequeue.h"
#include "input.h"
#include "log.h"
if (numBoxes == 1)
{
Message* m = new Message();
- m->to = Command::getInstance();
+ m->p_to = Message::CONTROL;
m->message = Message::LAST_VIEW_CLOSE;
MessageQueue::getInstance()->postMessage(m);
}
logger->log("Command", Log::DEBUG, "processing message %i", m->message);
- if (m->to == this)
+ if ((m->p_to == Message::CONTROL) || (m->to == this))
{
switch(m->message)
{
#include "wtabbar.h"
#include "message.h"
#include "messagequeue.h"
-#include "command.h" // FIXME - get rid after predefined message targets
#include "inputman.h"
#include "input.h"
{
Message* m = new Message();
m->message = Message::INPUT_EVENT;
- m->to = Command::getInstance();
+ m->p_to = Message::CONTROL;
m->from = this;
m->parameter = key;
MessageQueue::getInstance()->postMessage(m);
// 2. A thread wants its object/view deleting *after* the thread has exited
// Put a justification line after call to Message* m = new Message() line
-// So that the sources can be grepped for proper message useage
+// So that the sources can be grepped for proper message usage
class Message
{
public:
+
+ enum PreDefinedTarget
+ {
+ NA = 0,
+ CONTROL,
+ BOXSTACK
+ };
+
Message();
void* from{};
+ PreDefinedTarget p_to{NA}; // If this is set 'to' is ignored
void* to{};
ULONG message{};
ULONG parameter{};
const static ULONG NEW_PICTURE_STATIC = 37;
const static ULONG REDRAW = 38;
const static ULONG SHUTDOWN = 39;
+
};
#endif
#include "videoomx.h"
#include "surface.h"
#include "message.h"
-#include "command.h"
+#include "messagequeue.h"
#include "teletxt/txtfont.h"
#include "osdopenvg.h"
Message* m = new Message();
// We have a pictures! send a message to ourself, to switch to gui thread
m->from=this;
- m->to=Command::getInstance();
+ m->p_to = Message::CONTROL;
m->data = reinterpret_cast<void*>(handle);
if (!static_image) {
m->message=Message::NEW_PICTURE;
if (info->lindex & 0xffffffff) static_image=false;
Message* m = new Message();
m->from=this;
- m->to=Command::getInstance();
+ m->p_to = Message::CONTROL;
m->data = reinterpret_cast<void*>(info->handle);
if (!static_image) {
m->message=Message::NEW_PICTURE;
along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
+#include <wincodec.h>
-#include "osdwinvector.h"
#include "videowin.h"
#include "surfacewin.h"
-
-
#include "message.h"
#include "messagequeue.h"
-
#include "teletxt/txtfont.h"
-#include <wincodec.h>
-
#define OSD_BUFFER_WIDTH 1280
#define OSD_BUFFER_HEIGHT 720
#include "staticartwork.h"
+#include "osdwinvector.h"
+
#define EXTERNALPICTURE(name, fname, fileextension) #name,
char *ext_pict_name[] {
Message* m = new Message();
// We have a pictures! send a message to ourself, to switch to gui thread
m->from = this;
- m->to = Command::getInstance();
+ m->p_to = Message::CONTROL;
m->data = pict_inf.reference;
if (!static_image) {
m->message = Message::NEW_PICTURE;
logger->log("VConnect", Log::INFO, "Send VDR connected message");
Message* m = new Message(); // Must be done after this thread ends
m->from = this;
- m->to = Command::getInstance();
+ m->p_to = Message::CONTROL;
m->message = Message::VDR_CONNECTED;
MessageQueue::getInstance()->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 "vopts.h"
-
+#include "defines.h"
#include "colour.h"
#include "video.h"
#include "osd.h"
#include "log.h"
#include "option.h"
#include "vdr.h"
+#include "messagequeue.h"
+#include "message.h"
#include "command.h"
#include "staticartwork.h"
#ifdef VOMP_PLATTFORM_MVP
#include "mediaoptions.h"
#endif
-//#include "vdr.h"
-#include "command.h"
-#include "messagequeue.h"
+
+#include "vopts.h"
VOpts::VOpts()
{
info->setStaticArtwork(sa_properties);
setTitleBarIcon(info);
-
setSize(520, 360);
createBuffer();
if (Video::getInstance()->getFormat() == Video::PAL)
{
Message* m = new Message();
m->message = Message::CHANGE_LANGUAGE;
- m->to = Command::getInstance();
+ m->p_to = Message::CONTROL;
MessageQueue::getInstance()->postMessage(m);
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/>.
*/
#ifndef VOPTS_H
#define VOPTS_H
+#include <vector>
#include "tbboxx.h"
-#include "defines.h"
#include "wtabbar.h"
#include "i18n.h"
#include "option.h"
-#include <vector>
class Boxx;
-
+class Message;
class VOpts : public TBBoxx
{
{
// I can't handle this, send it to command
Message* m2 = new Message();
- m2->to = Command::getInstance();
+ m2->p_to = Message::CONTROL;
m2->message = Message::CONNECTION_LOST;
MessageQueue::getInstance()->postMessage(m2);
break;
{
// FIXME Obselete ish - improve this
Message* m2 = new Message(); // Must be done after this thread finishes, and must break into master mutex
- m2->to = Command::getInstance();
+ m2->p_to = Message::CONTROL;
m2->message = Message::STOP_PLAYBACK;
MessageQueue::getInstance()->postMessage(m2);
break;
#include "colour.h"
#include "video.h"
#include "boxstack.h"
-#include "command.h"
+#include "message.h"
#include "messagequeue.h"
Sleeptimer* Sleeptimer::instance = NULL;
{
Message* m2 = new Message();
m2->message = Message::INPUT_EVENT;
- m2->to = Command::getInstance();
+ m2->p_to = Message::CONTROL;
m2->from = this;
m2->parameter = Input::POWER;
MessageQueue::getInstance()->postMessage(m2);
#include "media.h"
#include "mediaplayer.h"
-#include "command.h"
#include "osd.h"
#include "wsymbol.h"
#include "audio.h"
{
// I can't handle this, send it to command
Message* m2 = new Message();
- m2->to = Command::getInstance();
+ m2->p_to = Message::CONTROL;
m2->message = Message::CONNECTION_LOST;
MessageQueue::getInstance()->postMessage(m2);
break;
{
// I can't handle this, send it to command
Message* m2 = new Message();
- m2->to = Command::getInstance();
+ m2->p_to = Message::CONTROL;
m2->message = Message::CONNECTION_LOST;
MessageQueue::getInstance()->postMessage(m2);
break;
{
// FIXME Obselete ish - improve this
Message* m2 = new Message(); // Must be done after this thread finishes, and must break into master mutex
- m2->to = Command::getInstance();
+ m2->p_to = Message::CONTROL;
m2->message = Message::STOP_PLAYBACK;
MessageQueue::getInstance()->postMessage(m2);
break;