IdwThread.h
author sl
Sun, 16 Mar 2014 09:11:39 +0100
changeset 0 523a7dc3469f
child 1 d9a866996670
permissions -rw-r--r--
First contribution.
     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(
    51     HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
    52   static void MapChars(
    53     LPWSTR lpszTarget, LPCWSTR lpszSource, int nMaxLength);
    54   static wchar_t MapChar(wchar_t ch);
    55 
    56 private:
    57   HINSTANCE m_hInstance;
    58   HWND m_hWnd;
    59   Event m_eventWindowCreationDone;
    60 };
    61 //------------------------------------------------------------------------------
    62 #endif
    63 //------------------------------------------------------------------------------