(Gast)
n/a Beiträge
|
AW: case von to
11. Aug 2017, 11:51
Oder statt case einfach ein if verwenden:
Code:
if ((x >= ID_SELECTAUDIOSTREAM) && (x <= ID_SELECTAUDIOSTREAM_LAST)) {
}
EDIT:
Ok so geht's..
Code:
case WM_COMMAND:
{
wpItem = LOWORD(wParam);
if (wpItem == ID_SHOWPLAYBACKPOSITION)
{
if (bPBchecked)
{
CheckMenuItem(hMenu, ID_SHOWPLAYBACKPOSITION, MF_UNCHECKED);
bPBchecked = FALSE;
if (KVideo_HasOverlayImage())
KVideo_UpdateOverlayImage(0);
}
else
{
CheckMenuItem(hMenu, ID_SHOWPLAYBACKPOSITION, MF_CHECKED);
bPBchecked = TRUE;
}
}
else if (wpItem == ID_KEEPASPECTRATIO)
{
if (bARchecked)
{
CheckMenuItem(hMenu, ID_KEEPASPECTRATIO, MF_UNCHECKED);
KVideo_KeepAspectRatio(FALSE);
bARchecked = FALSE;
}
else
{
CheckMenuItem(hMenu, ID_KEEPASPECTRATIO, MF_CHECKED);
KVideo_KeepAspectRatio(TRUE);
bARchecked = TRUE;
}
}
else if (wpItem == ID_SHOWMEDIAFILEPROPERTY)
{
if (!bFullScreen)
KVideo_ShowMediaInfo();
}
else if ((wpItem >= ID_SELECTAUDIOSTREAM) && (wpItem <= ID_SELECTAUDIOSTREAM_LAST))
{
TPlayerState ps = KVideo_GetPlayerState();
if (ps == psNotReady)
return 0;
if (ps == psPlaying)
KVideo_Pause();
DWORD AudioSelectItem = (DWORD)wParam - ID_SELECTAUDIOSTREAM;
KVideo_SelectAudioStream(AudioSelectItem);
CheckMenuItem(hSubMenuAudio, (UINT)wParam, MF_CHECKED);
MenuAudioChecked = AudioSelectItem;
if (ps == psPlaying)
KVideo_Play();
}
else if ((wpItem >= ID_SELECTVIDEOSTREAM) && (wpItem <= ID_SELECTVIDEOSTREAM_LAST))
{
TPlayerState ps = KVideo_GetPlayerState();
if (ps == psNotReady)
return 0;
if (ps == psPlaying)
KVideo_Pause();
DWORD VideoSelectItem = (DWORD)wParam - ID_SELECTVIDEOSTREAM;
KVideo_SelectVideoStream(VideoSelectItem);
CheckMenuItem(hSubMenuVideo, (UINT)wParam, MF_CHECKED);
MenuVideoChecked = VideoSelectItem;
if (ps == psPlaying)
KVideo_Play();
}
else if (wpItem == ID_SUBTITLECONFIG)
{
if (KVideo_GetPlayerState() == psNotReady)
{
MessageBox(hWnd, L"Sub title configuration page can be shown after opening a media file.", L"Confirm", MB_OK);
return 0;
}
BOOL bRegistered = FALSE;
BOOL bLoaded = FALSE;
KVideo_XySubFilterState(&bRegistered, &bLoaded);
if (!bRegistered)
{
MessageBox(hWnd, L"Filter for sub title display (xySubFilter.dll) is not registered.", L"Confirm", MB_OK);
return 0;
}
if (!bLoaded)
MessageBox(hWnd, L"Filter for sub title display (xySubFilter.dll) is not loaded.", L"Confirm", MB_OK);
else
Show_XySubFilterPropertyPage();
}
}
Nur für WM_COMMAND den rest habe ich als Case belassen.
gruss
Geändert von EWeiss (11. Aug 2017 um 12:24 Uhr)
|
|
Zitat
|