iMONDisplayWrapper.cpp
author sl
Mon, 17 Mar 2014 12:38:39 +0100
changeset 3 d5f6b2119a13
parent 0 523a7dc3469f
permissions -rw-r--r--
Fixing init result issue.
     1 //------------------------------------------------------------------------------
     2 #include <windows.h>
     3 #include "iMONDisplayWrapper.h"
     4 #include "IdwApi.h"
     5 //------------------------------------------------------------------------------
     6 IdwApi* pIdwApi = NULL;
     7 //------------------------------------------------------------------------------
     8 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
     9 	{
    10 	switch (fdwReason)
    11 		{
    12 	case DLL_PROCESS_ATTACH:
    13 		if (pIdwApi==NULL) //Defensive
    14 			{
    15 			pIdwApi = new IdwApi(hinstDLL);
    16 			}
    17 		break;
    18 	case DLL_PROCESS_DETACH:
    19 		delete pIdwApi;
    20 		pIdwApi=NULL;
    21 		break;
    22 		}
    23 	return TRUE;
    24 	}
    25 //------------------------------------------------------------------------------
    26 DSPResult IDW_Init(IDW_INITRESULT* pInitResult)
    27 {
    28   return pIdwApi->Init(pInitResult);
    29 }
    30 //------------------------------------------------------------------------------
    31 DSPResult IDW_Uninit()
    32 {
    33   return pIdwApi->Uninit();
    34 }
    35 //------------------------------------------------------------------------------
    36 DSPResult IDW_IsInitialized()
    37 {
    38   return pIdwApi->IsInitialized();
    39 }
    40 //------------------------------------------------------------------------------
    41 DSPResult IDW_IsPluginModeEnabled()
    42 {
    43   return pIdwApi->IsPluginModeEnabled();
    44 }
    45 
    46 /**
    47 */
    48 DSPResult IDW_GetStatus(IDW_STATUS* aStatus)
    49 	{
    50 	return pIdwApi->GetStatus(aStatus);
    51 	}
    52 
    53 //------------------------------------------------------------------------------
    54 DSPResult IDW_SetVfdText(LPCWSTR lpszLine1, LPCWSTR lpszLine2)
    55 {
    56 /*
    57 DSPEQDATA eqData;
    58 eqData.BandData[0] = 100;
    59 eqData.BandData[1] = 90;
    60 eqData.BandData[2] = 80;
    61 eqData.BandData[3] = 70;
    62 eqData.BandData[4] = 60;
    63 eqData.BandData[5] = 50;
    64 eqData.BandData[6] = 40;
    65 eqData.BandData[7] = 30;
    66 eqData.BandData[8] = 30;
    67 eqData.BandData[9] = 40;
    68 eqData.BandData[10] = 50;
    69 eqData.BandData[11] = 60;
    70 eqData.BandData[12] = 70;
    71 eqData.BandData[13] = 80;
    72 eqData.BandData[14] = 90;
    73 eqData.BandData[15] = 100;
    74 return pIdwApi->SetVfdEqData(&eqData);
    75 */
    76   return pIdwApi->SetVfdText(lpszLine1, lpszLine2);
    77 }
    78 //------------------------------------------------------------------------------
    79 DSPResult IDW_SetVfdEqData(PDSPEQDATA pEqData)
    80 {
    81   return pIdwApi->SetVfdEqData(pEqData);
    82 }
    83 //------------------------------------------------------------------------------
    84 DSPResult IDW_SetLcdText(LPCWSTR lpszLine1)
    85 {
    86   return pIdwApi->SetLcdText(lpszLine1);
    87 }
    88 //------------------------------------------------------------------------------
    89 DSPResult IDW_SetLcdEqData(PDSPEQDATA pEqDataL, PDSPEQDATA pEqDataR)
    90 {
    91   return pIdwApi->SetLcdEqData(pEqDataL, pEqDataR);
    92 }
    93 //------------------------------------------------------------------------------
    94 DSPResult IDW_SetLcdAllIcons(BOOL bOn)
    95 {
    96   return pIdwApi->SetLcdAllIcons(bOn);
    97 }
    98 //------------------------------------------------------------------------------
    99 DSPResult IDW_SetLcdOrangeIcon(BYTE btIconData1, BYTE btIconData2)
   100 {
   101   return pIdwApi->SetLcdOrangeIcon(btIconData1, btIconData2);
   102 }
   103 //------------------------------------------------------------------------------
   104 DSPResult IDW_SetLcdMediaTypeIcon(BYTE btIconData)
   105 {
   106 	return pIdwApi->SetLcdMediaTypeIcon(btIconData);
   107 }
   108 //------------------------------------------------------------------------------
   109 DSPResult IDW_SetLcdSpeakerIcon(BYTE btIconData1, BYTE btIconData2)
   110 {
   111   return pIdwApi->SetLcdSpeakerIcon(btIconData1, btIconData2);
   112 }
   113 //------------------------------------------------------------------------------
   114 DSPResult IDW_SetLcdVideoCodecIcon(BYTE btIconData)
   115 {
   116 	return pIdwApi->SetLcdVideoCodecIcon(btIconData);
   117 }
   118 //------------------------------------------------------------------------------
   119 DSPResult IDW_SetLcdAudioCodecIcon(BYTE btIconData)
   120 {
   121 	return pIdwApi->SetLcdAudioCodecIcon(btIconData);
   122 }
   123 //------------------------------------------------------------------------------
   124 DSPResult IDW_SetLcdAspectRatioIcon(BYTE btIconData)
   125 {
   126 	return pIdwApi->SetLcdAspectRatioIcon(btIconData);
   127 }
   128 //------------------------------------------------------------------------------
   129 DSPResult IDW_SetLcdEtcIcon(BYTE btIconData)
   130 {
   131 	return pIdwApi->SetLcdEtcIcon(btIconData);
   132 }
   133 //------------------------------------------------------------------------------
   134 DSPResult IDW_SetLcdProgress(int nCurPos, int nTotal)
   135 {
   136 	return pIdwApi->SetLcdProgress(nCurPos, nTotal);
   137 }
   138 //------------------------------------------------------------------------------