IdwThread.h
author sl
Sun, 16 Mar 2014 19:50:21 +0100
changeset 1 d9a866996670
parent 0 523a7dc3469f
child 2 558712318e1b
permissions -rw-r--r--
Improved event framework.
Init now properly reporting notification.
     1 //------------------------------------------------------------------------------
     2 #ifndef IDWTHREAD_H_INCLUDED
     3 #define IDWTHREAD_H_INCLUDED
     4 //------------------------------------------------------------------------------
     5 #include <windows.h>
     6 #include "Thread.h"
     7 #include "Event.h"
     8 #include "Mutex.h"
     9 #include "iMONDisplayDefines.h"
    10 #include "iMONDisplayWrapper.h"
    11 //------------------------------------------------------------------------------
    12 class IdwThread : public Thread
    13 {
    14 public:
    15 	IdwThread(HINSTANCE hInstance);
    16 	virtual ~IdwThread();
    17 
    18 private:
    19 	IdwThread(const IdwThread& other) {}
    20 	IdwThread& operator=(const IdwThread& other) { return *this; }
    21 
    22 public:
    23 	virtual void Interrupt();
    24 	DSPResult Init(IDW_INITRESULT* pInitResult);
    25 	DSPResult Uninit();
    26 	DSPResult IsInited();
    27 	DSPResult IsPluginModeEnabled();
    28 	DSPResult SetVfdText(LPCWSTR lpszLine1, LPCWSTR lpszLine2);
    29 	DSPResult SetVfdEqData(PDSPEQDATA pEqData);
    30 	DSPResult SetLcdText(LPCWSTR lpszText);
    31 	DSPResult SetLcdEqData(PDSPEQDATA pEqDataL, PDSPEQDATA pEqDataR);
    32 	DSPResult SetLcdAllIcons(BOOL bOn);
    33 	DSPResult SetLcdOrangeIcon(BYTE btIconData1, BYTE btIconData2);
    34 	DSPResult SetLcdMediaTypeIcon(BYTE btIconData);
    35 	DSPResult SetLcdSpeakerIcon(BYTE btIconData1, BYTE btIconData2);
    36 	DSPResult SetLcdVideoCodecIcon(BYTE btIconData);
    37 	DSPResult SetLcdAudioCodecIcon(BYTE btIconData);
    38 	DSPResult SetLcdAspectRatioIcon(BYTE btIconData);
    39 	DSPResult SetLcdEtcIcon(BYTE btIconData);
    40 	DSPResult SetLcdProgress(int nCurPos, int nTotal);
    41 
    42 protected:
    43 	virtual void Run();
    44   
    45 private:
    46 	bool RegisterClass();
    47 	bool CreateMessageWindow();
    48 	void AllowImonMessages();
    49 	bool WaitForWindow();
    50 	static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
    51 	static void MapChars(LPWSTR lpszTarget, LPCWSTR lpszSource, int nMaxLength);
    52 	static wchar_t MapChar(wchar_t ch);
    53 
    54 private:
    55 	HINSTANCE m_hInstance;
    56 	HWND m_hWnd;
    57 	Event m_eventWindowCreationDone;
    58 };
    59 //------------------------------------------------------------------------------
    60 #endif
    61 //------------------------------------------------------------------------------