diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2011-05-22 16:12:58 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2011-05-22 16:12:58 +0400 |
commit | 2d352c90ddd56dc2cdc5c39d64c4db31d39fdd20 (patch) | |
tree | 040cdb3b07c1a729931b4def6e571b99d2a334cb /src | |
parent | 31257173762f349071ce29ed232db880416330fa (diff) |
apply astyle, whitespace cleanup for consistency
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@3138 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src')
99 files changed, 4597 insertions, 4569 deletions
diff --git a/src/apps/mplayerc/AppSettings.cpp b/src/apps/mplayerc/AppSettings.cpp index b23060c01..4c5d28d62 100644 --- a/src/apps/mplayerc/AppSettings.cpp +++ b/src/apps/mplayerc/AppSettings.cpp @@ -360,27 +360,28 @@ void CAppSettings::CreateCommands() CAppSettings::~CAppSettings()
{
- if(hAccel) {
+ if (hAccel) {
DestroyAcceleratorTable(hAccel);
}
}
bool CAppSettings::IsD3DFullscreen() const
{
- if(nCLSwitches&CLSW_D3DFULLSCREEN) {
+ if (nCLSwitches&CLSW_D3DFULLSCREEN) {
return true;
} else if (iDSVideoRendererType == VIDRNDT_DS_VMR9RENDERLESS ||
iDSVideoRendererType == VIDRNDT_DS_EVR_CUSTOM ||
iDSVideoRendererType == VIDRNDT_DS_MADVR ||
iDSVideoRendererType == VIDRNDT_DS_SYNC) {
return fD3DFullscreen;
- } else
+ } else {
return false;
+ }
}
CString CAppSettings::SelectedAudioRenderer() const
{
CString strResult;
- if(AfxGetMyApp()->m_AudioRendererDisplayName_CL != _T("")) {
+ if (AfxGetMyApp()->m_AudioRendererDisplayName_CL != _T("")) {
strResult = AfxGetMyApp()->m_AudioRendererDisplayName_CL;
} else {
strResult = AfxGetAppSettings().strAudioRendererDisplayName;
@@ -485,8 +486,8 @@ void CAppSettings::UpdateData(bool fSave) UINT len;
BYTE* ptr = NULL;
- if(fSave) {
- if(!fInitialized) {
+ if (fSave) {
+ if (!fInitialized) {
return;
}
@@ -673,22 +674,22 @@ void CAppSettings::UpdateData(bool fSave) // CASIMIR666 : end of new settings
{
- for(int i = 0; ; i++) {
+ for (int i = 0; ; i++) {
CString key;
key.Format(_T("%s\\%04d"), IDS_R_FILTERS, i);
int j = pApp->GetProfileInt(key, _T("Enabled"), -1);
pApp->WriteProfileString(key, NULL, NULL);
- if(j < 0) {
+ if (j < 0) {
break;
}
}
pApp->WriteProfileString(IDS_R_FILTERS, NULL, NULL);
POSITION pos = m_filters.GetHeadPosition();
- for(int i = 0; pos; i++) {
+ for (int i = 0; pos; i++) {
FilterOverride* f = m_filters.GetNext(pos);
- if(f->fTemporary) {
+ if (f->fTemporary) {
continue;
}
@@ -697,22 +698,22 @@ void CAppSettings::UpdateData(bool fSave) pApp->WriteProfileInt(key, _T("SourceType"), (int)f->type);
pApp->WriteProfileInt(key, _T("Enabled"), (int)!f->fDisabled);
- if(f->type == FilterOverride::REGISTERED) {
+ if (f->type == FilterOverride::REGISTERED) {
pApp->WriteProfileString(key, _T("DisplayName"), CString(f->dispname));
pApp->WriteProfileString(key, _T("Name"), f->name);
- } else if(f->type == FilterOverride::EXTERNAL) {
+ } else if (f->type == FilterOverride::EXTERNAL) {
pApp->WriteProfileString(key, _T("Path"), f->path);
pApp->WriteProfileString(key, _T("Name"), f->name);
pApp->WriteProfileString(key, _T("CLSID"), CStringFromGUID(f->clsid));
}
POSITION pos2 = f->backup.GetHeadPosition();
- for(int i = 0; pos2; i++) {
+ for (int i = 0; pos2; i++) {
CString val;
val.Format(_T("org%04d"), i);
pApp->WriteProfileString(key, val, CStringFromGUID(f->backup.GetNext(pos2)));
}
pos2 = f->guids.GetHeadPosition();
- for(int i = 0; pos2; i++) {
+ for (int i = 0; pos2; i++) {
CString val;
val.Format(_T("mod%04d"), i);
pApp->WriteProfileString(key, val, CStringFromGUID(f->guids.GetNext(pos2)));
@@ -728,7 +729,7 @@ void CAppSettings::UpdateData(bool fSave) //pApp->WriteProfileInt(IDS_R_SETTINGS, IDS_RS_REALMEDIAFPS, *((DWORD*)&dRealMediaQuickTimeFPS));
pApp->WriteProfileString(IDS_R_SETTINGS _T("\\") IDS_RS_PNSPRESETS, NULL, NULL);
- for(int i = 0, j = m_pnspresets.GetCount(); i < j; i++) {
+ for (int i = 0, j = m_pnspresets.GetCount(); i < j; i++) {
CString str;
str.Format(_T("Preset%d"), i);
pApp->WriteProfileString(IDS_R_SETTINGS _T("\\") IDS_RS_PNSPRESETS, str, m_pnspresets[i]);
@@ -736,9 +737,9 @@ void CAppSettings::UpdateData(bool fSave) pApp->WriteProfileString(IDS_R_COMMANDS, NULL, NULL);
pos = wmcmds.GetHeadPosition();
- for(int i = 0; pos; ) {
+ for (int i = 0; pos; ) {
wmcmd& wc = wmcmds.GetNext(pos);
- if(wc.IsModified()) {
+ if (wc.IsModified()) {
CString str;
str.Format(_T("CommandMod%d"), i);
CString str2;
@@ -818,10 +819,10 @@ void CAppSettings::UpdateData(bool fSave) pos = m_shaders.GetHeadPosition();
- for(int i = 0; pos; i++) {
+ for (int i = 0; pos; i++) {
const Shader& s = m_shaders.GetNext(pos);
- if(!s.label.IsEmpty()) {
+ if (!s.label.IsEmpty()) {
CString index;
index.Format(_T("%d"), i);
CString srcdata = s.srcdata;
@@ -832,21 +833,21 @@ void CAppSettings::UpdateData(bool fSave) }
}
- if(pApp->m_pszRegistryKey) {
+ if (pApp->m_pszRegistryKey) {
// WINBUG: on win2k this would crash WritePrivateProfileString
pApp->WriteProfileInt(_T(""), _T(""), pApp->GetProfileInt(_T(""), _T(""), 0)?0:1);
}
} else {
- if(fInitialized) {
+ if (fInitialized) {
return;
}
iDXVer = 0;
CRegKey dxver;
- if(ERROR_SUCCESS == dxver.Open(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\DirectX"), KEY_READ)) {
+ if (ERROR_SUCCESS == dxver.Open(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\DirectX"), KEY_READ)) {
CString str;
ULONG len = 64;
- if(ERROR_SUCCESS == dxver.QueryStringValue(_T("Version"), str.GetBuffer(len), &len)) {
+ if (ERROR_SUCCESS == dxver.QueryStringValue(_T("Version"), str.GetBuffer(len), &len)) {
str.ReleaseBuffer(len);
int ver[4];
_stscanf_s(str, _T("%d.%d.%d.%d"), ver+0, ver+1, ver+2, ver+3);
@@ -960,7 +961,7 @@ void CAppSettings::UpdateData(bool fSave) {
CString temp = pApp->GetProfileString(IDS_R_SETTINGS, IDS_RS_SPLOGFONT, _T(""));
subdefstyle <<= temp;
- if(temp == _T("")) {
+ if (temp == _T("")) {
subdefstyle.relativeTo = 1; //default "Position subtitles relative to the video frame" option is checked
}
}
@@ -985,8 +986,8 @@ void CAppSettings::UpdateData(bool fSave) memcpy( pSpeakerToChannelMap, ptr, sizeof(pSpeakerToChannelMap) );
} else {
memset(pSpeakerToChannelMap, 0, sizeof(pSpeakerToChannelMap));
- for(int j = 0; j < 18; j++)
- for(int i = 0; i <= j; i++) {
+ for (int j = 0; j < 18; j++)
+ for (int i = 0; i <= j; i++) {
pSpeakerToChannelMap[j][i] = 1<<i;
}
@@ -1021,7 +1022,7 @@ void CAppSettings::UpdateData(bool fSave) nSpeakerChannels = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_SPEAKERCHANNELS, 2);
{
- for(int i = 0; ; i++) {
+ for (int i = 0; ; i++) {
CString key;
key.Format(_T("%s\\%04d"), IDS_R_FILTERS, i);
@@ -1030,11 +1031,11 @@ void CAppSettings::UpdateData(bool fSave) f->fDisabled = !pApp->GetProfileInt(key, _T("Enabled"), 0);
UINT j = pApp->GetProfileInt(key, _T("SourceType"), -1);
- if(j == 0) {
+ if (j == 0) {
f->type = FilterOverride::REGISTERED;
f->dispname = CStringW(pApp->GetProfileString(key, _T("DisplayName"), _T("")));
f->name = pApp->GetProfileString(key, _T("Name"), _T(""));
- } else if(j == 1) {
+ } else if (j == 1) {
f->type = FilterOverride::EXTERNAL;
f->path = pApp->GetProfileString(key, _T("Path"), _T(""));
f->name = pApp->GetProfileString(key, _T("Name"), _T(""));
@@ -1045,29 +1046,29 @@ void CAppSettings::UpdateData(bool fSave) }
f->backup.RemoveAll();
- for(int i = 0; ; i++) {
+ for (int i = 0; ; i++) {
CString val;
val.Format(_T("org%04d"), i);
CString guid = pApp->GetProfileString(key, val, _T(""));
- if(guid.IsEmpty()) {
+ if (guid.IsEmpty()) {
break;
}
f->backup.AddTail(GUIDFromCString(guid));
}
f->guids.RemoveAll();
- for(int i = 0; ; i++) {
+ for (int i = 0; ; i++) {
CString val;
val.Format(_T("mod%04d"), i);
CString guid = pApp->GetProfileString(key, val, _T(""));
- if(guid.IsEmpty()) {
+ if (guid.IsEmpty()) {
break;
}
f->guids.AddTail(GUIDFromCString(guid));
}
f->iLoadType = (int)pApp->GetProfileInt(key, _T("LoadType"), -1);
- if(f->iLoadType < 0) {
+ if (f->iLoadType < 0) {
break;
}
@@ -1084,16 +1085,16 @@ void CAppSettings::UpdateData(bool fSave) //*((DWORD*)&dRealMediaQuickTimeFPS) = pApp->GetProfileInt(IDS_R_SETTINGS, IDS_RS_REALMEDIAFPS, *((DWORD*)&dRealMediaQuickTimeFPS));
m_pnspresets.RemoveAll();
- for(int i = 0; i < (ID_PANNSCAN_PRESETS_END - ID_PANNSCAN_PRESETS_START); i++) {
+ for (int i = 0; i < (ID_PANNSCAN_PRESETS_END - ID_PANNSCAN_PRESETS_START); i++) {
CString str;
str.Format(_T("Preset%d"), i);
str = pApp->GetProfileString(IDS_R_SETTINGS _T("\\") IDS_RS_PNSPRESETS, str, _T(""));
- if(str.IsEmpty()) {
+ if (str.IsEmpty()) {
break;
}
m_pnspresets.Add(str);
}
- if(m_pnspresets.IsEmpty()) {
+ if (m_pnspresets.IsEmpty()) {
double _4p3 = 4.0/3.0;
double _16p9 = 16.0/9.0;
double _185p1 = 1.85/1.0;
@@ -1109,28 +1110,28 @@ void CAppSettings::UpdateData(bool fSave) m_pnspresets.Add(str);
}
- for(int i = 0; i < wmcmds.GetCount(); i++) {
+ for (int i = 0; i < wmcmds.GetCount(); i++) {
CString str;
str.Format(_T("CommandMod%d"), i);
str = pApp->GetProfileString(IDS_R_COMMANDS, str, _T(""));
- if(str.IsEmpty()) {
+ if (str.IsEmpty()) {
break;
}
int cmd, fVirt, key, repcnt, mouse, appcmd;
TCHAR buff[128];
int n;
- if(5 > (n = _stscanf_s(str, _T("%d %x %x %s %d %d %d"), &cmd, &fVirt, &key, buff, countof(buff), &repcnt, &mouse, &appcmd))) {
+ if (5 > (n = _stscanf_s(str, _T("%d %x %x %s %d %d %d"), &cmd, &fVirt, &key, buff, countof(buff), &repcnt, &mouse, &appcmd))) {
break;
}
- if(POSITION pos = wmcmds.Find(cmd)) {
+ if (POSITION pos = wmcmds.Find(cmd)) {
wmcmd& wc = wmcmds.GetAt(pos);
wc.cmd = cmd;
wc.fVirt = fVirt;
wc.key = key;
- if(n >= 6) {
+ if (n >= 6) {
wc.mouse = (UINT)mouse;
}
- if(n >= 7) {
+ if (n >= 7) {
wc.appcmd = (UINT)appcmd;
}
wc.rmcmd = CStringA(buff).Trim('\"');
@@ -1141,7 +1142,7 @@ void CAppSettings::UpdateData(bool fSave) CAtlArray<ACCEL> pAccel;
pAccel.SetCount(wmcmds.GetCount());
POSITION pos = wmcmds.GetHeadPosition();
- for(int i = 0; pos; i++) {
+ for (int i = 0; pos; i++) {
pAccel[i] = wmcmds.GetNext(pos);
}
hAccel = CreateAcceleratorTable(pAccel.GetData(), pAccel.GetCount());
@@ -1200,11 +1201,11 @@ void CAppSettings::UpdateData(bool fSave) CRegKey key;
// grrrrr
- // if(!SHGetSpecialFolderPath(NULL, MyPictures.GetBufferSetLength(_MAX_PATH), CSIDL_MYPICTURES, TRUE)) MyPictures.Empty();
+ // if (!SHGetSpecialFolderPath(NULL, MyPictures.GetBufferSetLength(_MAX_PATH), CSIDL_MYPICTURES, TRUE)) MyPictures.Empty();
// else MyPictures.ReleaseBuffer();
- if(ERROR_SUCCESS == key.Open(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"), KEY_READ)) {
+ if (ERROR_SUCCESS == key.Open(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"), KEY_READ)) {
ULONG len = _MAX_PATH;
- if(ERROR_SUCCESS == key.QueryStringValue(_T("My Pictures"), MyPictures.GetBuffer(_MAX_PATH), &len)) {
+ if (ERROR_SUCCESS == key.QueryStringValue(_T("My Pictures"), MyPictures.GetBuffer(_MAX_PATH), &len)) {
MyPictures.ReleaseBufferSetLength(len);
} else {
MyPictures.Empty();
@@ -1248,17 +1249,17 @@ void CAppSettings::UpdateData(bool fSave) shaders[_T("denoise")] = IDF_SHADER_DENOISE;
shaders[_T("YV12 Chroma Upsampling")] = IDF_SHADER_YV12CHROMAUP;
- for(int iShader=0; ; iShader++) {
+ for (int iShader=0; ; iShader++) {
CString str;
str.Format(_T("%d"), iShader);
str = pApp->GetProfileString(_T("Shaders"), str);
CAtlList<CString> sl;
CString label = Explode(str, sl, '|');
- if(label.IsEmpty()) {
+ if (label.IsEmpty()) {
break;
}
- if(sl.GetCount() < 3) {
+ if (sl.GetCount() < 3) {
continue;
}
@@ -1274,11 +1275,11 @@ void CAppSettings::UpdateData(bool fSave) }
pos = shaders.GetStartPosition();
- while(pos) {
+ while (pos) {
CAtlStringMap<UINT>::CPair* pPair = shaders.GetNext(pos);
CStringA srcdata;
- if(LoadResource(pPair->m_value, srcdata, _T("FILE"))) {
+ if (LoadResource(pPair->m_value, srcdata, _T("FILE"))) {
Shader s;
s.label = pPair->m_key;
@@ -1334,7 +1335,7 @@ void CAppSettings::UpdateData(bool fSave) fBDAIgnoreEncryptedChannels = !!pApp->GetProfileInt(IDS_RS_DVB, IDS_RS_BDA_IGNORE_ENCRYPTED_CHANNELS, 0);
nDVBLastChannel = pApp->GetProfileInt(IDS_RS_DVB, IDS_RS_DVB_LAST_CHANNEL, 1);
- for(int iChannel = 0; ; iChannel++) {
+ for (int iChannel = 0; ; iChannel++) {
CString strTemp;
CString strChannel;
CDVBChannel Channel;
@@ -1386,7 +1387,7 @@ void CAppSettings::UpdateData(bool fSave) strShadercombine = pApp->GetProfileString(_T("Shaders"), _T("Combine"), _T(""));
strShadercombineScreenSpace = pApp->GetProfileString(_T("Shaders"), _T("CombineScreenSpace"), _T(""));
- if(fLaunchfullscreen) {
+ if (fLaunchfullscreen) {
nCLSwitches |= CLSW_FULLSCREEN;
}
@@ -1399,7 +1400,7 @@ void CAppSettings::UpdateRenderersData(bool fSave) CWinApp* pApp = AfxGetApp();
CRenderersSettings& r = m_RenderersSettings;
- if(fSave) {
+ if (fSave) {
pApp->WriteProfileInt(IDS_R_SETTINGS, IDS_RS_APSURACEFUSAGE, r.iAPSurfaceUsage);
// pApp->WriteProfileInt(IDS_R_SETTINGS, IDS_RS_VMRSYNCFIX, fVMRSyncFix);
pApp->WriteProfileInt(IDS_R_SETTINGS, IDS_RS_DX9_RESIZER, r.iDX9Resizer);
@@ -1490,16 +1491,16 @@ void CAppSettings::UpdateRenderersData(bool fSave) double *dPtr;
UINT dSize;
- if(pApp->GetProfileBinary(IDS_R_SETTINGS, _T("CycleDelta"), (LPBYTE*)&dPtr, &dSize)) {
+ if (pApp->GetProfileBinary(IDS_R_SETTINGS, _T("CycleDelta"), (LPBYTE*)&dPtr, &dSize)) {
renderSettings.fCycleDelta = *dPtr;
delete [] dPtr;
}
- if(pApp->GetProfileBinary(IDS_R_SETTINGS, _T("TargetSyncOffset"), (LPBYTE*)&dPtr, &dSize)) {
+ if (pApp->GetProfileBinary(IDS_R_SETTINGS, _T("TargetSyncOffset"), (LPBYTE*)&dPtr, &dSize)) {
renderSettings.fTargetSyncOffset = *dPtr;
delete [] dPtr;
}
- if(pApp->GetProfileBinary(IDS_R_SETTINGS, _T("ControlLimit"), (LPBYTE*)&dPtr, &dSize)) {
+ if (pApp->GetProfileBinary(IDS_R_SETTINGS, _T("ControlLimit"), (LPBYTE*)&dPtr, &dSize)) {
renderSettings.fControlLimit = *dPtr;
delete [] dPtr;
}
@@ -1583,7 +1584,7 @@ __int64 CAppSettings::ConvertTimeToMSec(CString& time) const void CAppSettings::ExtractDVDStartPos(CString& strParam)
{
int i = 0, j = 0;
- for(CString token = strParam.Tokenize(_T("#"), i);
+ for (CString token = strParam.Tokenize(_T("#"), i);
j < 3 && !token.IsEmpty();
token = strParam.Tokenize(_T("#"), i), j++) {
switch (j) {
@@ -1622,107 +1623,107 @@ void CAppSettings::ParseCommandLine(CAtlList<CString>& cmdln) strPnSPreset.Empty();
POSITION pos = cmdln.GetHeadPosition();
- while(pos) {
+ while (pos) {
CString param = cmdln.GetNext(pos);
- if(param.IsEmpty()) {
+ if (param.IsEmpty()) {
continue;
}
- if((param[0] == '-' || param[0] == '/') && param.GetLength() > 1) {
+ if ((param[0] == '-' || param[0] == '/') && param.GetLength() > 1) {
CString sw = param.Mid(1).MakeLower();
- if(sw == _T("open")) {
+ if (sw == _T("open")) {
nCLSwitches |= CLSW_OPEN;
- } else if(sw == _T("play")) {
+ } else if (sw == _T("play")) {
nCLSwitches |= CLSW_PLAY;
- } else if(sw == _T("fullscreen")) {
+ } else if (sw == _T("fullscreen")) {
nCLSwitches |= CLSW_FULLSCREEN;
- } else if(sw == _T("minimized")) {
+ } else if (sw == _T("minimized")) {
nCLSwitches |= CLSW_MINIMIZED;
- } else if(sw == _T("new")) {
+ } else if (sw == _T("new")) {
nCLSwitches |= CLSW_NEW;
- } else if(sw == _T("help") || sw == _T("h") || sw == _T("?")) {
+ } else if (sw == _T("help") || sw == _T("h") || sw == _T("?")) {
nCLSwitches |= CLSW_HELP;
- } else if(sw == _T("dub") && pos) {
+ } else if (sw == _T("dub") && pos) {
slDubs.AddTail(cmdln.GetNext(pos));
- } else if(sw == _T("dubdelay") && pos) {
+ } else if (sw == _T("dubdelay") && pos) {
CString strFile = cmdln.GetNext(pos);
int nPos = strFile.Find (_T("DELAY"));
if (nPos != -1) {
rtShift = 10000 * _tstol(strFile.Mid(nPos + 6));
}
slDubs.AddTail(strFile);
- } else if(sw == _T("sub") && pos) {
+ } else if (sw == _T("sub") && pos) {
slSubs.AddTail(cmdln.GetNext(pos));
- } else if(sw == _T("filter") && pos) {
+ } else if (sw == _T("filter") && pos) {
slFilters.AddTail(cmdln.GetNext(pos));
- } else if(sw == _T("dvd")) {
+ } else if (sw == _T("dvd")) {
nCLSwitches |= CLSW_DVD;
- } else if(sw == _T("dvdpos")) {
+ } else if (sw == _T("dvdpos")) {
ExtractDVDStartPos(cmdln.GetNext(pos));
- } else if(sw == _T("cd")) {
+ } else if (sw == _T("cd")) {
nCLSwitches |= CLSW_CD;
- } else if(sw == _T("add")) {
+ } else if (sw == _T("add")) {
nCLSwitches |= CLSW_ADD;
- } else if(sw == _T("regvid")) {
+ } else if (sw == _T("regvid")) {
nCLSwitches |= CLSW_REGEXTVID;
- } else if(sw == _T("regaud")) {
+ } else if (sw == _T("regaud")) {
nCLSwitches |= CLSW_REGEXTAUD;
- } else if(sw == _T("unregall")) {
+ } else if (sw == _T("unregall")) {
nCLSwitches |= CLSW_UNREGEXT;
- } else if(sw == _T("unregvid")) {
+ } else if (sw == _T("unregvid")) {
nCLSwitches |= CLSW_UNREGEXT; /* keep for compatibility with old versions */
- } else if(sw == _T("unregaud")) {
+ } else if (sw == _T("unregaud")) {
nCLSwitches |= CLSW_UNREGEXT; /* keep for compatibility with old versions */
- } else if(sw == _T("start") && pos) {
+ } else if (sw == _T("start") && pos) {
rtStart = 10000i64*_tcstol(cmdln.GetNext(pos), NULL, 10);
nCLSwitches |= CLSW_STARTVALID;
- } else if(sw == _T("startpos") && pos) {
+ } else if (sw == _T("startpos") && pos) {
rtStart = 10000i64 * ConvertTimeToMSec(cmdln.GetNext(pos));
nCLSwitches |= CLSW_STARTVALID;
- } else if(sw == _T("nofocus")) {
+ } else if (sw == _T("nofocus")) {
nCLSwitches |= CLSW_NOFOCUS;
- } else if(sw == _T("close")) {
+ } else if (sw == _T("close")) {
nCLSwitches |= CLSW_CLOSE;
- } else if(sw == _T("standby")) {
+ } else if (sw == _T("standby")) {
nCLSwitches |= CLSW_STANDBY;
- } else if(sw == _T("hibernate")) {
+ } else if (sw == _T("hibernate")) {
nCLSwitches |= CLSW_HIBERNATE;
- } else if(sw == _T("shutdown")) {
+ } else if (sw == _T("shutdown")) {
nCLSwitches |= CLSW_SHUTDOWN;
- } else if(sw == _T("logoff")) {
+ } else if (sw == _T("logoff")) {
nCLSwitches |= CLSW_LOGOFF;
- } else if(sw == _T("d3dfs")) {
+ } else if (sw == _T("d3dfs")) {
nCLSwitches |= CLSW_D3DFULLSCREEN;
- } else if(sw == _T("adminoption")) {
+ } else if (sw == _T("adminoption")) {
nCLSwitches |= CLSW_ADMINOPTION;
iAdminOption = _ttoi (cmdln.GetNext(pos));
- } else if(sw == _T("slave")) {
+ } else if (sw == _T("slave")) {
nCLSwitches |= CLSW_SLAVE;
hMasterWnd = (HWND)_ttol (cmdln.GetNext(pos));
- } else if(sw == _T("fixedsize") && pos) {
+ } else if (sw == _T("fixedsize") && pos) {
CAtlList<CString> sl;
Explode(cmdln.GetNext(pos), sl, ',', 2);
- if(sl.GetCount() == 2) {
+ if (sl.GetCount() == 2) {
sizeFixedWindow.SetSize(_ttol(sl.GetHead()), _ttol(sl.GetTail()));
- if(sizeFixedWindow.cx > 0 && sizeFixedWindow.cy > 0) {
+ if (sizeFixedWindow.cx > 0 && sizeFixedWindow.cy > 0) {
nCLSwitches |= CLSW_FIXEDSIZE;
}
}
- } else if(sw == _T("monitor") && pos) {
+ } else if (sw == _T("monitor") && pos) {
iMonitor = _tcstol(cmdln.GetNext(pos), NULL, 10);
nCLSwitches |= CLSW_MONITOR;
- } else if(sw == _T("minidump")) {
+ } else if (sw == _T("minidump")) {
CMiniDump::Enable();
- } else if(sw == _T("pns")) {
+ } else if (sw == _T("pns")) {
strPnSPreset = cmdln.GetNext(pos);
- } else if(sw == _T("webport") && pos) {
+ } else if (sw == _T("webport") && pos) {
int tmpport = _tcstol(cmdln.GetNext(pos), NULL, 10);
if ( tmpport >= 0 && tmpport <= 65535 ) {
nCmdlnWebServerPort = tmpport;
}
- } else if(sw == _T("debug")) {
+ } else if (sw == _T("debug")) {
fShowDebugInfo = true;
- } else if(sw == _T("audiorenderer") && pos) {
+ } else if (sw == _T("audiorenderer") && pos) {
SetAudioRenderer(_ttoi(cmdln.GetNext(pos)));
} else {
nCLSwitches |= CLSW_HELP|CLSW_UNRECOGNIZEDSWITCH;
@@ -1739,7 +1740,7 @@ void CAppSettings::GetFav(favtype ft, CAtlList<CString>& sl) CString root;
- switch(ft) {
+ switch (ft) {
case FAV_FILE:
root = IDS_R_FAVFILES;
break;
@@ -1753,11 +1754,11 @@ void CAppSettings::GetFav(favtype ft, CAtlList<CString>& sl) return;
}
- for(int i = 0; ; i++) {
+ for (int i = 0; ; i++) {
CString s;
s.Format(_T("Name%d"), i);
s = AfxGetApp()->GetProfileString(root, s, NULL);
- if(s.IsEmpty()) {
+ if (s.IsEmpty()) {
break;
}
sl.AddTail(s);
@@ -1768,7 +1769,7 @@ void CAppSettings::SetFav(favtype ft, CAtlList<CString>& sl) {
CString root;
- switch(ft) {
+ switch (ft) {
case FAV_FILE:
root = IDS_R_FAVFILES;
break;
@@ -1786,7 +1787,7 @@ void CAppSettings::SetFav(favtype ft, CAtlList<CString>& sl) int i = 0;
POSITION pos = sl.GetHeadPosition();
- while(pos) {
+ while (pos) {
CString s;
s.Format(_T("Name%d"), i++);
AfxGetApp()->WriteProfileString(root, s, sl.GetNext(pos));
@@ -1797,7 +1798,7 @@ void CAppSettings::AddFav(favtype ft, CString s) {
CAtlList<CString> sl;
GetFav(ft, sl);
- if(sl.Find(s)) {
+ if (sl.Find(s)) {
return;
}
sl.AddTail(s);
@@ -1836,7 +1837,7 @@ void CAppSettings::CRecentFileAndURLList::Add(LPCTSTR lpszPathName) ASSERT(lpszPathName != NULL);
ASSERT(AfxIsValidString(lpszPathName));
- if(CString(lpszPathName).MakeLower().Find(_T("@device:")) >= 0) {
+ if (CString(lpszPathName).MakeLower().Find(_T("@device:")) >= 0) {
return;
}
@@ -1844,7 +1845,7 @@ void CAppSettings::CRecentFileAndURLList::Add(LPCTSTR lpszPathName) // fully qualify the path name
TCHAR szTemp[1024];
- if(fURL) {
+ if (fURL) {
_tcscpy_s(szTemp, lpszPathName);
} else {
AfxFullPath(szTemp, lpszPathName);
@@ -1853,7 +1854,7 @@ void CAppSettings::CRecentFileAndURLList::Add(LPCTSTR lpszPathName) // update the MRU list, if an existing MRU string matches file name
int iMRU;
for (iMRU = 0; iMRU < m_nSize-1; iMRU++) {
- if((fURL && !_tcscmp(m_arrNames[iMRU], szTemp))
+ if ((fURL && !_tcscmp(m_arrNames[iMRU], szTemp))
|| AfxComparePath(m_arrNames[iMRU], szTemp)) {
break; // iMRU will point to matching entry
}
diff --git a/src/apps/mplayerc/AppSettings.h b/src/apps/mplayerc/AppSettings.h index 300c2def9..f31b61d5e 100644 --- a/src/apps/mplayerc/AppSettings.h +++ b/src/apps/mplayerc/AppSettings.h @@ -76,7 +76,7 @@ enum { MODE_SHOWCAPTIONMENU,
MODE_HIDEMENU,
MODE_FRAMEONLY,
- MODE_BORDERLESS,
+ MODE_BORDERLESS,
MODE_COUNT
}; // flags for Caption & Menu Mode
diff --git a/src/apps/mplayerc/AuthDlg.cpp b/src/apps/mplayerc/AuthDlg.cpp index 29feb12c6..38c234042 100644 --- a/src/apps/mplayerc/AuthDlg.cpp +++ b/src/apps/mplayerc/AuthDlg.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -53,7 +53,7 @@ void CAuthDlg::DoDataExchange(CDataExchange* pDX) CString CAuthDlg::DEncrypt(CString str)
{
- for(int i = 0; i < str.GetLength(); i++) {
+ for (int i = 0; i < str.GetLength(); i++) {
str.SetAt(i, str[i]^5);
}
return str;
@@ -75,16 +75,16 @@ BOOL CAuthDlg::OnInitDialog() CWinApp* pApp = AfxGetApp();
- if(pApp->m_pszRegistryKey) {
+ if (pApp->m_pszRegistryKey) {
CRegKey hSecKey(pApp->GetSectionKey(IDS_R_LOGINS));
- if(hSecKey) {
+ if (hSecKey) {
int i = 0;
TCHAR username[256], password[256];
- while(1) {
+ while (1) {
DWORD unlen = countof(username);
DWORD pwlen = sizeof(password);
DWORD type = REG_SZ;
- if(ERROR_SUCCESS == RegEnumValue(
+ if (ERROR_SUCCESS == RegEnumValue(
hSecKey, i++, username, &unlen, 0, &type, (BYTE*)password, &pwlen)) {
m_logins[username] = DEncrypt(password);
m_usernamectrl.AddString(username);
@@ -101,13 +101,13 @@ BOOL CAuthDlg::OnInitDialog() IDS_R_LOGINS, buff, 32767/sizeof(TCHAR), pApp->m_pszProfileName);
TCHAR* p = buff;
- while(*p && len > 0) {
+ while (*p && len > 0) {
CString str = p;
p += str.GetLength()+1;
len -= str.GetLength()+1;
CAtlList<CString> sl;
Explode(str, sl, '=', 2);
- if(sl.GetCount() == 2) {
+ if (sl.GetCount() == 2) {
m_logins[sl.GetHead()] = DEncrypt(sl.GetTail());
m_usernamectrl.AddString(sl.GetHead());
}
@@ -124,7 +124,7 @@ void CAuthDlg::OnBnClickedOk() {
UpdateData();
- if(!m_username.IsEmpty()) {
+ if (!m_username.IsEmpty()) {
CWinApp* pApp = AfxGetApp();
pApp->WriteProfileString(IDS_R_LOGINS, m_username, m_remember ? DEncrypt(m_password) : _T(""));
}
@@ -139,7 +139,7 @@ void CAuthDlg::OnCbnSelchangeCombo1() m_usernamectrl.GetLBText(m_usernamectrl.GetCurSel(), username);
CString password;
- if(m_logins.Lookup(username, password)) {
+ if (m_logins.Lookup(username, password)) {
m_password = password;
m_remember = TRUE;
UpdateData(FALSE);
@@ -151,7 +151,7 @@ void CAuthDlg::OnEnSetfocusEdit3() UpdateData();
CString password;
- if(m_logins.Lookup(m_username, password)) {
+ if (m_logins.Lookup(m_username, password)) {
m_password = password;
m_remember = TRUE;
UpdateData(FALSE);
diff --git a/src/apps/mplayerc/BaseGraph.cpp b/src/apps/mplayerc/BaseGraph.cpp index 3f3c27c3c..e806700d9 100644 --- a/src/apps/mplayerc/BaseGraph.cpp +++ b/src/apps/mplayerc/BaseGraph.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -32,7 +32,7 @@ BOOL CPlayerWindow::PreCreateWindow(CREATESTRUCT& cs)
{
- if(!CWnd::PreCreateWindow(cs)) {
+ if (!CWnd::PreCreateWindow(cs)) {
return FALSE;
}
@@ -49,8 +49,8 @@ END_MESSAGE_MAP() BOOL CPlayerWindow::OnEraseBkgnd(CDC* pDC)
{
- for(CWnd* pChild = GetWindow(GW_CHILD); pChild; pChild = pChild->GetNextWindow()) {
- if(!pChild->IsWindowVisible()) {
+ for (CWnd* pChild = GetWindow(GW_CHILD); pChild; pChild = pChild->GetNextWindow()) {
+ if (!pChild->IsWindowVisible()) {
continue;
}
@@ -103,7 +103,7 @@ STDMETHODIMP CBaseGraph::NonDelegatingQueryInterface(REFIID riid, void** ppv) void CBaseGraph::ClearMessageQueue()
{
- while(!m_msgqueue.IsEmpty()) {
+ while (!m_msgqueue.IsEmpty()) {
GMSG msg = m_msgqueue.RemoveHead();
FreeEventParams(msg.m_lEventCode, msg.m_lParam1, msg.m_lParam2);
}
@@ -112,7 +112,7 @@ void CBaseGraph::ClearMessageQueue() void CBaseGraph::NotifyEvent(long lEventCode, LONG_PTR lParam1, LONG_PTR lParam2)
{
- if(!m_hNotifyWnd) {
+ if (!m_hNotifyWnd) {
return;
}
@@ -305,18 +305,18 @@ STDMETHODIMP CBaseGraph::GetEventHandle(OAEVENT* hEvent) }
STDMETHODIMP CBaseGraph::GetEvent(long* lEventCode, LONG_PTR* lParam1, LONG_PTR* lParam2, long msTimeout)
{
- if(m_msgqueue.IsEmpty()) {
+ if (m_msgqueue.IsEmpty()) {
return E_FAIL;
}
GMSG msg = m_msgqueue.RemoveHead();
- if(lEventCode) {
+ if (lEventCode) {
*lEventCode = msg.m_lEventCode;
}
- if(lParam1) {
+ if (lParam1) {
*lParam1 = msg.m_lParam1;
}
- if(lParam2) {
+ if (lParam2) {
*lParam2 = msg.m_lParam2;
}
@@ -336,8 +336,8 @@ STDMETHODIMP CBaseGraph::RestoreDefaultHandling(long lEvCode) }
STDMETHODIMP CBaseGraph::FreeEventParams(long lEvCode, LONG_PTR lParam1, LONG_PTR lParam2)
{
- if(EC_BG_ERROR == lEvCode) {
- if(lParam1) {
+ if (EC_BG_ERROR == lEvCode) {
+ if (lParam1) {
CoTaskMemFree((void*)lParam1);
}
}
@@ -352,7 +352,7 @@ STDMETHODIMP CBaseGraph::SetNotifyWindow(OAHWND hwnd, long lMsg, LONG_PTR lInsta m_lNotifyMsg = lMsg;
m_lNotifyInstData = lInstanceData;
- if(!IsWindow((HWND)m_hNotifyWnd)) {
+ if (!IsWindow((HWND)m_hNotifyWnd)) {
m_hNotifyWnd = NULL;
return E_FAIL;
}
@@ -377,7 +377,7 @@ STDMETHODIMP CBaseGraph::CheckCapabilities(DWORD* pCapabilities) {
CheckPointer(pCapabilities, E_POINTER);
- if(*pCapabilities == 0) {
+ if (*pCapabilities == 0) {
return S_OK;
}
diff --git a/src/apps/mplayerc/ChildView.cpp b/src/apps/mplayerc/ChildView.cpp index 597cacee9..8af6c27de 100644 --- a/src/apps/mplayerc/ChildView.cpp +++ b/src/apps/mplayerc/ChildView.cpp @@ -45,7 +45,7 @@ CChildView::~CChildView() BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs)
{
- if(!CWnd::PreCreateWindow(cs)) {
+ if (!CWnd::PreCreateWindow(cs)) {
return FALSE;
}
@@ -58,7 +58,7 @@ BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs) BOOL CChildView::PreTranslateMessage(MSG* pMsg)
{
- if(pMsg->message >= WM_MOUSEFIRST && pMsg->message <= WM_MYMOUSELAST) {
+ if (pMsg->message >= WM_MOUSEFIRST && pMsg->message <= WM_MYMOUSELAST) {
CWnd* pParent = GetParent();
CPoint p(pMsg->lParam);
::MapWindowPoints(pMsg->hwnd, pParent->m_hWnd, &p, 1);
@@ -67,11 +67,11 @@ BOOL CChildView::PreTranslateMessage(MSG* pMsg) bool fInteractiveVideo = ((CMainFrame*)AfxGetMainWnd())->IsInteractiveVideo();
/*
- if(fInteractiveVideo)
+ if (fInteractiveVideo)
{
- if(pMsg->message == WM_LBUTTONDOWN)
+ if (pMsg->message == WM_LBUTTONDOWN)
{
- if((pMsg->time - m_lastlmdowntime) <= GetDoubleClickTime()
+ if ((pMsg->time - m_lastlmdowntime) <= GetDoubleClickTime()
&& abs(pMsg->pt.x - m_lastlmdownpoint.x) <= GetSystemMetrics(SM_CXDOUBLECLK)
&& abs(pMsg->pt.y - m_lastlmdownpoint.y) <= GetSystemMetrics(SM_CYDOUBLECLK))
{
@@ -85,20 +85,20 @@ BOOL CChildView::PreTranslateMessage(MSG* pMsg) m_lastlmdownpoint = pMsg->pt;
}
}
- else if(pMsg->message == WM_LBUTTONDBLCLK)
+ else if (pMsg->message == WM_LBUTTONDBLCLK)
{
m_lastlmdowntime = pMsg->time;
m_lastlmdownpoint = pMsg->pt;
}
}
*/
- if((pMsg->message == WM_LBUTTONDOWN || pMsg->message == WM_LBUTTONUP || pMsg->message == WM_MOUSEMOVE)
+ if ((pMsg->message == WM_LBUTTONDOWN || pMsg->message == WM_LBUTTONUP || pMsg->message == WM_MOUSEMOVE)
&& fInteractiveVideo) {
- if(pMsg->message == WM_MOUSEMOVE) {
+ if (pMsg->message == WM_MOUSEMOVE) {
pParent->PostMessage(pMsg->message, pMsg->wParam, MAKELPARAM(p.x, p.y));
}
- if(fDblClick) {
+ if (fDblClick) {
pParent->PostMessage(WM_LBUTTONDOWN, pMsg->wParam, MAKELPARAM(p.x, p.y));
pParent->PostMessage(WM_LBUTTONDBLCLK, pMsg->wParam, MAKELPARAM(p.x, p.y));
}
@@ -127,11 +127,11 @@ void CChildView::LoadLogo() m_logo.Destroy();
- if(s.fLogoExternal) {
+ if (s.fLogoExternal) {
bHaveLogo = SUCCEEDED(m_logo.Load(s.strLogoFileName));
}
- if(!bHaveLogo) {
+ if (!bHaveLogo) {
s.fLogoExternal = false; // use the built-in logo instead
s.strLogoFileName = ""; // clear logo file name
@@ -140,7 +140,7 @@ void CChildView::LoadLogo() }
}
- if(m_hWnd) {
+ if (m_hWnd) {
Invalidate();
}
}
@@ -148,7 +148,7 @@ void CChildView::LoadLogo() CSize CChildView::GetLogoSize() const
{
CSize ret(0,0);
- if(!m_logo.IsNull()) {
+ if (!m_logo.IsNull()) {
ret.SetSize(m_logo.GetWidth(), m_logo.GetHeight());
}
return ret;
@@ -191,9 +191,9 @@ BOOL CChildView::OnEraseBkgnd(CDC* pDC) CAutoLock cAutoLock(&m_csLogo);
- if(((CMainFrame*)GetParentFrame())->IsSomethingLoaded()) {
+ if (((CMainFrame*)GetParentFrame())->IsSomethingLoaded()) {
pDC->ExcludeClipRect(m_vrect);
- } else if(!m_logo.IsNull() /*&& ((CMainFrame*)GetParentFrame())->IsPlaylistEmpty()*/) {
+ } else if (!m_logo.IsNull() /*&& ((CMainFrame*)GetParentFrame())->IsPlaylistEmpty()*/) {
BITMAP bm;
GetObject(m_logo, sizeof(bm), &bm);
@@ -229,22 +229,22 @@ void CChildView::OnSize(UINT nType, int cx, int cy) BOOL CChildView::OnPlayPlayPauseStop(UINT nID)
{
- if(nID == ID_PLAY_STOP) {
+ if (nID == ID_PLAY_STOP) {
SetVideoRect();
}
CString osd = ResStr(nID);
int i = osd.Find(_T("\n"));
- if(i > 0) {
+ if (i > 0) {
osd.Delete(i, osd.GetLength()-i);
}
CRect r1;
((CMainFrame*)AfxGetMainWnd())->GetClientRect(&r1);
- if((!r1.Width()) || (!r1.Height())) {
+ if ((!r1.Width()) || (!r1.Height())) {
return FALSE;
}
- if(!(((CMainFrame*)AfxGetMainWnd())->m_OpenFile)) {
+ if (!(((CMainFrame*)AfxGetMainWnd())->m_OpenFile)) {
((CMainFrame*)AfxGetMainWnd())->m_OSD.DisplayMessage(OSD_TOPLEFT, osd, 1500);
}
return FALSE;
@@ -252,11 +252,11 @@ BOOL CChildView::OnPlayPlayPauseStop(UINT nID) BOOL CChildView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
- if(((CMainFrame*)GetParentFrame())->m_fHideCursor) {
+ if (((CMainFrame*)GetParentFrame())->m_fHideCursor) {
SetCursor(NULL);
return TRUE;
}
- if(((CMainFrame*)GetParentFrame())->IsSomethingLoaded() && (nHitTest == HTCLIENT)) {
+ if (((CMainFrame*)GetParentFrame())->IsSomethingLoaded() && (nHitTest == HTCLIENT)) {
::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_HAND));
return TRUE;
}
@@ -269,7 +269,7 @@ LRESULT CChildView::OnNcHitTest(CPoint point) CMainFrame* pFrame = ((CMainFrame*)GetParentFrame());
bool fLeftMouseBtnUnassigned = !assignedToCmd(wmcmd::LDOWN);
- if(!pFrame->m_fFullScreen && (pFrame->IsCaptionHidden() || fLeftMouseBtnUnassigned)) {
+ if (!pFrame->m_fFullScreen && (pFrame->IsCaptionHidden() || fLeftMouseBtnUnassigned)) {
CRect rcClient, rcFrame;
GetWindowRect(&rcFrame);
rcClient = rcFrame;
@@ -279,26 +279,26 @@ LRESULT CChildView::OnNcHitTest(CPoint point) rcClient.InflateRect(-(5 * sizeBorder.cx), -(5 * sizeBorder.cy));
rcFrame.InflateRect(sizeBorder.cx, sizeBorder.cy);
- if(rcFrame.PtInRect(point)) {
- if(point.x > rcClient.right) {
- if(point.y < rcClient.top) {
+ if (rcFrame.PtInRect(point)) {
+ if (point.x > rcClient.right) {
+ if (point.y < rcClient.top) {
nHitTest = HTTOPRIGHT;
- } else if(point.y > rcClient.bottom) {
+ } else if (point.y > rcClient.bottom) {
nHitTest = HTBOTTOMRIGHT;
} else {
nHitTest = HTRIGHT;
}
- } else if(point.x < rcClient.left) {
- if(point.y < rcClient.top) {
+ } else if (point.x < rcClient.left) {
+ if (point.y < rcClient.top) {
nHitTest = HTTOPLEFT;
- } else if(point.y > rcClient.bottom) {
+ } else if (point.y > rcClient.bottom) {
nHitTest = HTBOTTOMLEFT;
} else {
nHitTest = HTLEFT;
}
- } else if(point.y < rcClient.top) {
+ } else if (point.y < rcClient.top) {
nHitTest = HTTOP;
- } else if(point.y > rcClient.bottom) {
+ } else if (point.y > rcClient.bottom) {
nHitTest = HTBOTTOM;
}
}
@@ -310,9 +310,9 @@ void CChildView::OnNcLButtonDown(UINT nHitTest, CPoint point) {
CMainFrame* pFrame = ((CMainFrame*)GetParentFrame());
bool fLeftMouseBtnUnassigned = !assignedToCmd(wmcmd::LDOWN);
- if(!pFrame->m_fFullScreen && (pFrame->IsCaptionHidden() || fLeftMouseBtnUnassigned)) {
+ if (!pFrame->m_fFullScreen && (pFrame->IsCaptionHidden() || fLeftMouseBtnUnassigned)) {
BYTE bFlag = 0;
- switch(nHitTest) {
+ switch (nHitTest) {
case HTTOP:
bFlag = WMSZ_TOP;
break;
@@ -338,7 +338,7 @@ void CChildView::OnNcLButtonDown(UINT nHitTest, CPoint point) bFlag = WMSZ_BOTTOMRIGHT;
break;
}
- if(bFlag) {
+ if (bFlag) {
pFrame->PostMessage(WM_SYSCOMMAND, (SC_SIZE | bFlag), (LPARAM)POINTTOPOINTS(point));
} else {
CWnd::OnNcLButtonDown(nHitTest, point);
diff --git a/src/apps/mplayerc/ComPropertyPage.cpp b/src/apps/mplayerc/ComPropertyPage.cpp index 90519a5a3..d66ff6873 100644 --- a/src/apps/mplayerc/ComPropertyPage.cpp +++ b/src/apps/mplayerc/ComPropertyPage.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -75,7 +75,7 @@ BOOL CComPropertyPage::OnSetActive() SetModified(S_OK == m_pPage->IsPageDirty());
CWnd* pParent = GetParent();
- if(pParent->IsKindOf(RUNTIME_CLASS(CComPropertySheet))) {
+ if (pParent->IsKindOf(RUNTIME_CLASS(CComPropertySheet))) {
CComPropertySheet* pSheet = static_cast<CComPropertySheet*>(pParent);
pSheet->OnActivated(this);
}
@@ -100,7 +100,7 @@ END_MESSAGE_MAP() void CComPropertyPage::OnOK()
{
- if(S_OK == m_pPage->IsPageDirty()) {
+ if (S_OK == m_pPage->IsPageDirty()) {
m_pPage->Apply();
}
SetModified(FALSE);
diff --git a/src/apps/mplayerc/ComPropertySheet.cpp b/src/apps/mplayerc/ComPropertySheet.cpp index dc9c47fe8..cfd066c1b 100644 --- a/src/apps/mplayerc/ComPropertySheet.cpp +++ b/src/apps/mplayerc/ComPropertySheet.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -46,11 +46,11 @@ public: // IPropertyPageSite
STDMETHODIMP OnStatusChange(DWORD flags) {
- if(m_pPPD) {
- if(flags&PROPPAGESTATUS_DIRTY) {
+ if (m_pPPD) {
+ if (flags&PROPPAGESTATUS_DIRTY) {
m_pPPD->OnSetDirty(true);
}
- if(flags&PROPPAGESTATUS_CLEAN) {
+ if (flags&PROPPAGESTATUS_CLEAN) {
m_pPPD->OnSetDirty(false);
}
}
@@ -92,18 +92,18 @@ CComPropertySheet::~CComPropertySheet() int CComPropertySheet::AddPages(ISpecifyPropertyPages* pSPP)
{
- if(!pSPP) {
+ if (!pSPP) {
return(0);
}
CAUUID caGUID;
caGUID.pElems = NULL;
- if(FAILED(pSPP->GetPages(&caGUID))) {
+ if (FAILED(pSPP->GetPages(&caGUID))) {
return(0);
}
IUnknown* lpUnk = NULL;
- if(FAILED(pSPP->QueryInterface(&lpUnk))) {
+ if (FAILED(pSPP->QueryInterface(&lpUnk))) {
return(0);
}
@@ -113,31 +113,31 @@ int CComPropertySheet::AddPages(ISpecifyPropertyPages* pSPP) CComQIPtr<IPersist> pPersist = pSPP;
ULONG nPages = 0;
- for(ULONG i = 0; i < caGUID.cElems; i++) {
+ for (ULONG i = 0; i < caGUID.cElems; i++) {
CComPtr<IPropertyPage> pPage;
HRESULT hr = E_FAIL;
- if(FAILED(hr) && !pPage && pSPP2) {
+ if (FAILED(hr) && !pPage && pSPP2) {
hr = pSPP2->CreatePage(caGUID.pElems[i], &pPage);
}
- if(FAILED(hr) && !pPage) {
+ if (FAILED(hr) && !pPage) {
hr = pPage.CoCreateInstance(caGUID.pElems[i]);
}
- if(FAILED(hr) && !pPage && pPersist) {
+ if (FAILED(hr) && !pPage && pPersist) {
hr = LoadExternalPropertyPage(pPersist, caGUID.pElems[i], &pPage);
}
- if(SUCCEEDED(hr)) {
- if(AddPage(pPage, lpUnk)) {
+ if (SUCCEEDED(hr)) {
+ if (AddPage(pPage, lpUnk)) {
nPages++;
}
}
}
- if(caGUID.pElems) {
+ if (caGUID.pElems) {
CoTaskMemFree(caGUID.pElems);
}
lpUnk->Release();
@@ -147,7 +147,7 @@ int CComPropertySheet::AddPages(ISpecifyPropertyPages* pSPP) bool CComPropertySheet::AddPage(IPropertyPage* pPage, IUnknown* pUnk)
{
- if(!pPage || !pUnk) {
+ if (!pPage || !pUnk) {
return false;
}
@@ -167,7 +167,7 @@ bool CComPropertySheet::AddPage(IPropertyPage* pPage, IUnknown* pUnk) void CComPropertySheet::OnActivated(CPropertyPage* pPage)
{
- if(!pPage) {
+ if (!pPage) {
return;
}
@@ -184,12 +184,12 @@ void CComPropertySheet::OnActivated(CPropertyPage* pPage) pTC->GetClientRect(tcr);
CSize tws = twr.Size(), tcs = tcr.Size();
- if(CWnd* pChild = pPage->GetWindow(GW_CHILD)) {
+ if (CWnd* pChild = pPage->GetWindow(GW_CHILD)) {
pChild->ModifyStyle(WS_CAPTION|WS_THICKFRAME, 0);
pChild->ModifyStyleEx(WS_EX_DLGMODALFRAME, WS_EX_CONTROLPARENT);
- for(CWnd* pGrandChild = pChild->GetWindow(GW_CHILD); pGrandChild; pGrandChild = pGrandChild->GetNextWindow()) {
- if(!(pGrandChild->GetStyle()&WS_VISIBLE)) {
+ for (CWnd* pGrandChild = pChild->GetWindow(GW_CHILD); pGrandChild; pGrandChild = pGrandChild->GetNextWindow()) {
+ if (!(pGrandChild->GetStyle()&WS_VISIBLE)) {
continue;
}
@@ -212,8 +212,8 @@ void CComPropertySheet::OnActivated(CPropertyPage* pPage) CSize diff = r.Size() - tws;
- if(!bounds.IsRectEmpty()) {
- if(CWnd* pChild = pPage->GetWindow(GW_CHILD)) {
+ if (!bounds.IsRectEmpty()) {
+ if (CWnd* pChild = pPage->GetWindow(GW_CHILD)) {
pChild->MoveWindow(bounds);
}
CRect r = twr;
@@ -223,8 +223,8 @@ void CComPropertySheet::OnActivated(CPropertyPage* pPage) }
int _afxPropSheetButtons[] = { IDOK, IDCANCEL, ID_APPLY_NOW, IDHELP };
- for(int i = 0; i < countof(_afxPropSheetButtons); i++) {
- if(CWnd* pWnd = GetDlgItem(_afxPropSheetButtons[i])) {
+ for (int i = 0; i < countof(_afxPropSheetButtons); i++) {
+ if (CWnd* pWnd = GetDlgItem(_afxPropSheetButtons[i])) {
pWnd->GetWindowRect(r);
ScreenToClient(r);
pWnd->MoveWindow(CRect(r.TopLeft() + diff, r.Size()));
diff --git a/src/apps/mplayerc/ComPropertySheet.h b/src/apps/mplayerc/ComPropertySheet.h index f96044980..65a8a65fb 100644 --- a/src/apps/mplayerc/ComPropertySheet.h +++ b/src/apps/mplayerc/ComPropertySheet.h @@ -53,7 +53,7 @@ public: // IComPropertyPageDirty
void OnSetDirty(bool fDirty) {
- if(CPropertyPage* p = GetActivePage()) {
+ if (CPropertyPage* p = GetActivePage()) {
p->SetModified(fDirty);
}
}
diff --git a/src/apps/mplayerc/DVBChannel.cpp b/src/apps/mplayerc/DVBChannel.cpp index 6a0d8bff4..f1984e34a 100644 --- a/src/apps/mplayerc/DVBChannel.cpp +++ b/src/apps/mplayerc/DVBChannel.cpp @@ -1,7 +1,7 @@ /*
* $Id$
*
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -77,14 +77,14 @@ void CDVBChannel::FromString(CString strValue) }
m_nSubtitleCount = _tstol(strValue.Tokenize(_T("|"), i));
- for(int j=0; j<m_nAudioCount; j++) {
+ for (int j=0; j<m_nAudioCount; j++) {
m_Audios[j].PID = _tstol(strValue.Tokenize(_T("|"), i));
m_Audios[j].Type = (DVB_STREAM_TYPE)_tstol(strValue.Tokenize(_T("|"), i));
m_Audios[j].PesType = (PES_STREAM_TYPE)_tstol(strValue.Tokenize(_T("|"), i));
m_Audios[j].Language = strValue.Tokenize(_T("|"), i);
}
- for(int j=0; j<m_nSubtitleCount; j++) {
+ for (int j=0; j<m_nSubtitleCount; j++) {
m_Subtitles[j].PID = _tstol(strValue.Tokenize(_T("|"), i));
m_Subtitles[j].Type = (DVB_STREAM_TYPE)_tstol(strValue.Tokenize(_T("|"), i));
m_Subtitles[j].PesType = (PES_STREAM_TYPE)_tstol(strValue.Tokenize(_T("|"), i));
@@ -115,11 +115,11 @@ CString CDVBChannel::ToString() m_nDefaultAudio,
m_nSubtitleCount);
- for(int i=0; i<m_nAudioCount; i++) {
+ for (int i=0; i<m_nAudioCount; i++) {
strValue.AppendFormat (_T("|%ld|%d|%d|%s"), m_Audios[i].PID, m_Audios[i].Type, m_Audios[i].PesType, m_Audios[i].Language);
}
- for(int i=0; i<m_nSubtitleCount; i++) {
+ for (int i=0; i<m_nSubtitleCount; i++) {
strValue.AppendFormat (_T("|%ld|%d|%d|%s"), m_Subtitles[i].PID, m_Subtitles[i].Type, m_Subtitles[i].PesType, m_Subtitles[i].Language);
}
diff --git a/src/apps/mplayerc/DeinterlacerFilter.cpp b/src/apps/mplayerc/DeinterlacerFilter.cpp index a6e531828..65b2173c2 100644 --- a/src/apps/mplayerc/DeinterlacerFilter.cpp +++ b/src/apps/mplayerc/DeinterlacerFilter.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -30,7 +30,7 @@ CDeinterlacerFilter::CDeinterlacerFilter(LPUNKNOWN punk, HRESULT* phr)
: CTransformFilter(NAME("CDeinterlacerFilter"), punk, __uuidof(CDeinterlacerFilter))
{
- if(phr) {
+ if (phr) {
*phr = S_OK;
}
}
@@ -43,7 +43,7 @@ HRESULT CDeinterlacerFilter::CheckConnect(PIN_DIRECTION dir, IPin* pPin) HRESULT CDeinterlacerFilter::CheckInputType(const CMediaType* mtIn)
{
BITMAPINFOHEADER bih;
- if(!ExtractBIH(mtIn, &bih) /*|| bih.biHeight <= 0*/ || bih.biHeight <= 288) {
+ if (!ExtractBIH(mtIn, &bih) /*|| bih.biHeight <= 0*/ || bih.biHeight <= 288) {
return E_FAIL;
}
@@ -63,19 +63,19 @@ HRESULT CDeinterlacerFilter::Transform(IMediaSample* pIn, IMediaSample* pOut) HRESULT hr;
AM_MEDIA_TYPE* pmt = NULL;
- if(SUCCEEDED(pOut->GetMediaType(&pmt)) && pmt) {
+ if (SUCCEEDED(pOut->GetMediaType(&pmt)) && pmt) {
CMediaType mt = *pmt;
m_pOutput->SetMediaType(&mt);
DeleteMediaType(pmt);
}
BYTE* pDataIn = NULL;
- if(FAILED(pIn->GetPointer(&pDataIn)) || !pDataIn) {
+ if (FAILED(pIn->GetPointer(&pDataIn)) || !pDataIn) {
return S_FALSE;
}
BYTE* pDataOut = NULL;
- if(FAILED(hr = pOut->GetPointer(&pDataOut)) || !pDataOut) {
+ if (FAILED(hr = pOut->GetPointer(&pDataOut)) || !pDataOut) {
return hr;
}
@@ -95,14 +95,14 @@ HRESULT CDeinterlacerFilter::Transform(IMediaSample* pIn, IMediaSample* pOut) int pitchIn = bihIn.biWidth*bppIn>>3;
int pitchOut = bihOut.biWidth*bppOut>>3;
BYTE* pDataOut2 = pDataOut;
- if(fFlip) {
+ if (fFlip) {
pDataOut2 += pitchOut*(bihIn.biHeight-1);
pitchOut = -pitchOut;
}
- if(mtIn.subtype == MEDIASUBTYPE_YUY2 || mtIn.subtype == MEDIASUBTYPE_UYVY) {
+ if (mtIn.subtype == MEDIASUBTYPE_YUY2 || mtIn.subtype == MEDIASUBTYPE_UYVY) {
DeinterlaceBlend(pDataOut, pDataIn, pitchIn, bihIn.biHeight, pitchOut, pitchIn);
- } else if(mtIn.subtype == MEDIASUBTYPE_I420 || mtIn.subtype == MEDIASUBTYPE_YV12 || mtIn.subtype == MEDIASUBTYPE_IYUV) {
+ } else if (mtIn.subtype == MEDIASUBTYPE_I420 || mtIn.subtype == MEDIASUBTYPE_YV12 || mtIn.subtype == MEDIASUBTYPE_IYUV) {
DeinterlaceBlend(pDataOut, pDataIn, pitchIn, bihIn.biHeight, pitchOut, pitchIn);
int sizeIn = bihIn.biHeight*pitchIn, sizeOut = abs(bihOut.biHeight)*pitchOut;
@@ -123,7 +123,7 @@ HRESULT CDeinterlacerFilter::Transform(IMediaSample* pIn, IMediaSample* pOut) HRESULT CDeinterlacerFilter::DecideBufferSize(IMemAllocator* pAllocator, ALLOCATOR_PROPERTIES* pProperties)
{
- if(m_pInput->IsConnected() == FALSE) {
+ if (m_pInput->IsConnected() == FALSE) {
return E_UNEXPECTED;
}
@@ -137,7 +137,7 @@ HRESULT CDeinterlacerFilter::DecideBufferSize(IMemAllocator* pAllocator, ALLOCAT HRESULT hr;
ALLOCATOR_PROPERTIES Actual;
- if(FAILED(hr = pAllocator->SetProperties(pProperties, &Actual))) {
+ if (FAILED(hr = pAllocator->SetProperties(pProperties, &Actual))) {
return hr;
}
@@ -148,13 +148,13 @@ HRESULT CDeinterlacerFilter::DecideBufferSize(IMemAllocator* pAllocator, ALLOCAT HRESULT CDeinterlacerFilter::GetMediaType(int iPosition, CMediaType* pmt)
{
- if(m_pInput->IsConnected() == FALSE) {
+ if (m_pInput->IsConnected() == FALSE) {
return E_UNEXPECTED;
}
- if(iPosition < 0) {
+ if (iPosition < 0) {
return E_INVALIDARG;
}
- if(iPosition > 0) {
+ if (iPosition > 0) {
return VFW_S_NO_MORE_ITEMS;
}
*pmt = m_pInput->CurrentMediaType();
diff --git a/src/apps/mplayerc/EditListEditor.cpp b/src/apps/mplayerc/EditListEditor.cpp index 061630170..6eeaf3fb8 100644 --- a/src/apps/mplayerc/EditListEditor.cpp +++ b/src/apps/mplayerc/EditListEditor.cpp @@ -1,7 +1,7 @@ /*
* $Id$
*
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -110,7 +110,7 @@ END_MESSAGE_MAP() BOOL CEditListEditor::Create(CWnd* pParentWnd)
{
- if(!CSizingControlBarG::Create(_T("Edit List Editor"), pParentWnd, ID_VIEW_EDITLISTEDITOR)) {
+ if (!CSizingControlBarG::Create(_T("Edit List Editor"), pParentWnd, ID_VIEW_EDITLISTEDITOR)) {
return FALSE;
}
@@ -151,7 +151,7 @@ void CEditListEditor::OnSize(UINT nType, int cx, int cy) void CEditListEditor::ResizeListColumn()
{
- if(::IsWindow(m_list.m_hWnd)) {
+ if (::IsWindow(m_list.m_hWnd)) {
CRect r;
GetClientRect(r);
r.DeflateRect(2, 2);
@@ -186,7 +186,7 @@ void CEditListEditor::SaveEditListToFile() }
POSITION pos = m_EditList.GetHeadPosition();
- for(int i = 0; pos; i++, m_EditList.GetNext(pos)) {
+ for (int i = 0; pos; i++, m_EditList.GetNext(pos)) {
CClip& CurClip = m_EditList.GetAt(pos);
if (CurClip.HaveIn() && CurClip.HaveOut()) {
@@ -260,7 +260,7 @@ void CEditListEditor::OpenFile(LPCTSTR lpFileName) CStdioFile NameFile;
CString str;
if (NameFile.Open (_T("EditListNames.txt"), CFile::modeRead)) {
- while(NameFile.ReadString(str)) {
+ while (NameFile.ReadString(str)) {
m_NameList.Add(str);
}
NameFile.Close();
@@ -345,7 +345,7 @@ POSITION CEditListEditor::InsertClip(POSITION pos, CClip& NewClip) void CEditListEditor::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
{
- if(nIDCtl != IDC_EDITLIST) {
+ if (nIDCtl != IDC_EDITLIST) {
return;
}
@@ -361,7 +361,7 @@ void CEditListEditor::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct) CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
- if(!!m_list.GetItemState(nItem, LVIS_SELECTED)) {
+ if (!!m_list.GetItemState(nItem, LVIS_SELECTED)) {
FillRect(pDC->m_hDC, rcItem, CBrush(0xf1dacc));
FrameRect(pDC->m_hDC, rcItem, CBrush(0xc56a31));
} else {
@@ -369,7 +369,7 @@ void CEditListEditor::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct) }
COLORREF textcolor = RGB(0,0,0);
- if(!CurClip.HaveIn() || !CurClip.HaveOut()) {
+ if (!CurClip.HaveIn() || !CurClip.HaveOut()) {
textcolor = RGB(255,0,0);
}
@@ -399,7 +399,7 @@ void CEditListEditor::OnLvnItemchanged(NMHDR *pNMHDR, LRESULT *pResult) {
LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
- if(pNMLV->iItem >= 0) {
+ if (pNMLV->iItem >= 0) {
m_CurPos = m_EditList.FindIndex (pNMLV->iItem);
}
}
@@ -410,11 +410,11 @@ void CEditListEditor::OnLvnKeyDown(NMHDR* pNMHDR, LRESULT* pResult) *pResult = FALSE;
- if(pLVKeyDown->wVKey == VK_DELETE) {
+ if (pLVKeyDown->wVKey == VK_DELETE) {
POSITION pos = m_list.GetFirstSelectedItemPosition();
POSITION ClipPos;
int nItem = -1;
- while(pos) {
+ while (pos) {
nItem = m_list.GetNextSelectedItem(pos);
ClipPos = m_EditList.FindIndex (nItem);
if (ClipPos) {
@@ -452,7 +452,7 @@ void CEditListEditor::OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult) void CEditListEditor::OnMouseMove(UINT nFlags, CPoint point)
{
- if(m_bDragging) {
+ if (m_bDragging) {
m_ptDropPoint = point;
ClientToScreen(&m_ptDropPoint);
@@ -468,13 +468,13 @@ void CEditListEditor::OnMouseMove(UINT nFlags, CPoint point) int iTopItem = m_list.GetTopIndex();
int iBottomItem = m_list.GetBottomIndex();
- if(iOverItem == iTopItem && iTopItem != 0) { // top of list
+ if (iOverItem == iTopItem && iTopItem != 0) { // top of list
SetTimer(1, 100, NULL);
} else {
KillTimer(1);
}
- if(iOverItem >= iBottomItem && iBottomItem != (m_list.GetItemCount() - 1)) { // bottom of list
+ if (iOverItem >= iBottomItem && iBottomItem != (m_list.GetItemCount() - 1)) { // bottom of list
SetTimer(2, 100, NULL);
} else {
KillTimer(2);
@@ -490,19 +490,19 @@ void CEditListEditor::OnTimer(UINT_PTR nIDEvent) int iTopItem = m_list.GetTopIndex();
int iBottomItem = iTopItem + m_list.GetCountPerPage() - 1;
- if(m_bDragging) {
+ if (m_bDragging) {
m_pDragImage->DragShowNolock(FALSE);
- if(nIDEvent == 1) {
+ if (nIDEvent == 1) {
m_list.EnsureVisible(iTopItem - 1, false);
m_list.UpdateWindow();
- if(m_list.GetTopIndex() == 0) {
+ if (m_list.GetTopIndex() == 0) {
KillTimer(1);
}
- } else if(nIDEvent == 2) {
+ } else if (nIDEvent == 2) {
m_list.EnsureVisible(iBottomItem + 1, false);
m_list.UpdateWindow();
- if(m_list.GetBottomIndex() == (m_list.GetItemCount() - 1)) {
+ if (m_list.GetBottomIndex() == (m_list.GetItemCount() - 1)) {
KillTimer(2);
}
}
@@ -515,7 +515,7 @@ void CEditListEditor::OnTimer(UINT_PTR nIDEvent) void CEditListEditor::OnLButtonUp(UINT nFlags, CPoint point)
{
- if(m_bDragging) {
+ if (m_bDragging) {
::ReleaseCapture();
m_bDragging = FALSE;
@@ -531,7 +531,7 @@ void CEditListEditor::OnLButtonUp(UINT nFlags, CPoint point) CPoint pt(point);
ClientToScreen(&pt);
- if(WindowFromPoint(pt) == &m_list) {
+ if (WindowFromPoint(pt) == &m_list) {
DropItemOnList();
}
}
@@ -564,11 +564,11 @@ void CEditListEditor::OnBeginlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) *pResult = FALSE;
- if(pItem->iItem < 0) {
+ if (pItem->iItem < 0) {
return;
}
- if(pItem->iSubItem == COL_NAME) {
+ if (pItem->iSubItem == COL_NAME) {
*pResult = TRUE;
}
}
@@ -580,7 +580,7 @@ void CEditListEditor::OnDolabeleditList(NMHDR* pNMHDR, LRESULT* pResult) *pResult = FALSE;
- if(pItem->iItem < 0) {
+ if (pItem->iItem < 0) {
return;
}
@@ -605,17 +605,17 @@ void CEditListEditor::OnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) *pResult = FALSE;
- if(!m_list.m_fInPlaceDirty) {
+ if (!m_list.m_fInPlaceDirty) {
return;
}
- if(pItem->iItem < 0) {
+ if (pItem->iItem < 0) {
return;
}
CString& CurName = m_NameList.GetAt(pItem->lParam);
- if(m_CurPos != NULL && pItem->iSubItem == COL_NAME) {
+ if (m_CurPos != NULL && pItem->iSubItem == COL_NAME) {
CClip& CurClip = m_EditList.GetAt (m_CurPos);
CurClip.SetName(CurName);
@@ -627,7 +627,7 @@ int CEditListEditor::FindNameIndex(LPCTSTR strName) {
int nResult = -1;
- for(int i = 0; i<m_NameList.GetCount(); i++) {
+ for (int i = 0; i<m_NameList.GetCount(); i++) {
CString& CurName = m_NameList.GetAt(i);
if (CurName == strName) {
@@ -648,7 +648,7 @@ void CEditListEditor::FillCombo(LPCTSTR strFileName, CComboBox& Combo, bool bAll Combo.AddString(_T(""));
}
- while(NameFile.ReadString(str)) {
+ while (NameFile.ReadString(str)) {
Combo.AddString(str);
}
NameFile.Close();
diff --git a/src/apps/mplayerc/FGFilter.cpp b/src/apps/mplayerc/FGFilter.cpp index 72623e3b7..b46e9795e 100644 --- a/src/apps/mplayerc/FGFilter.cpp +++ b/src/apps/mplayerc/FGFilter.cpp @@ -62,22 +62,22 @@ void CFGFilter::AddType(const GUID& majortype, const GUID& subtype) bool CFGFilter::CheckTypes(const CAtlArray<GUID>& types, bool fExactMatch)
{
POSITION pos = m_types.GetHeadPosition();
- while(pos) {
+ while (pos) {
const GUID& majortype = m_types.GetNext(pos);
- if(!pos) {
+ if (!pos) {
ASSERT(0);
break;
}
const GUID& subtype = m_types.GetNext(pos);
- for(int i = 0, len = types.GetCount() & ~1; i < len; i += 2) {
- if(fExactMatch) {
- if(majortype == types[i] && majortype != GUID_NULL
+ for (int i = 0, len = types.GetCount() & ~1; i < len; i += 2) {
+ if (fExactMatch) {
+ if (majortype == types[i] && majortype != GUID_NULL
&& subtype == types[i+1] && subtype != GUID_NULL) {
return true;
}
} else {
- if((majortype == GUID_NULL || types[i] == GUID_NULL || majortype == types[i])
+ if ((majortype == GUID_NULL || types[i] == GUID_NULL || majortype == types[i])
&& (subtype == GUID_NULL || types[i+1] == GUID_NULL || subtype == types[i+1])) {
return true;
}
@@ -96,12 +96,12 @@ CFGFilterRegistry::CFGFilterRegistry(IMoniker* pMoniker, UINT64 merit) : CFGFilter(GUID_NULL, L"", merit)
, m_pMoniker(pMoniker)
{
- if(!m_pMoniker) {
+ if (!m_pMoniker) {
return;
}
LPOLESTR str = NULL;
- if(FAILED(m_pMoniker->GetDisplayName(0, 0, &str))) {
+ if (FAILED(m_pMoniker->GetDisplayName(0, 0, &str))) {
return;
}
m_DisplayName = m_name = str;
@@ -109,7 +109,7 @@ CFGFilterRegistry::CFGFilterRegistry(IMoniker* pMoniker, UINT64 merit) QueryProperties();
- if(merit != MERIT64_DO_USE) {
+ if (merit != MERIT64_DO_USE) {
m_merit.val = merit;
}
}
@@ -118,7 +118,7 @@ CFGFilterRegistry::CFGFilterRegistry(CStringW DisplayName, UINT64 merit) : CFGFilter(GUID_NULL, L"", merit)
, m_DisplayName(DisplayName)
{
- if(m_DisplayName.IsEmpty()) {
+ if (m_DisplayName.IsEmpty()) {
return;
}
@@ -126,13 +126,13 @@ CFGFilterRegistry::CFGFilterRegistry(CStringW DisplayName, UINT64 merit) CreateBindCtx(0, &pBC);
ULONG chEaten;
- if(S_OK != MkParseDisplayName(pBC, CComBSTR(m_DisplayName), &chEaten, &m_pMoniker)) {
+ if (S_OK != MkParseDisplayName(pBC, CComBSTR(m_DisplayName), &chEaten, &m_pMoniker)) {
return;
}
QueryProperties();
- if(merit != MERIT64_DO_USE) {
+ if (merit != MERIT64_DO_USE) {
m_merit.val = merit;
}
}
@@ -141,21 +141,21 @@ void CFGFilterRegistry::QueryProperties() {
ASSERT(m_pMoniker);
CComPtr<IPropertyBag> pPB;
- if(SUCCEEDED(m_pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void**)&pPB))) {
+ if (SUCCEEDED(m_pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void**)&pPB))) {
CComVariant var;
- if(SUCCEEDED(pPB->Read(CComBSTR(_T("FriendlyName")), &var, NULL))) {
+ if (SUCCEEDED(pPB->Read(CComBSTR(_T("FriendlyName")), &var, NULL))) {
m_name = var.bstrVal;
var.Clear();
}
- if(SUCCEEDED(pPB->Read(CComBSTR(_T("CLSID")), &var, NULL))) {
+ if (SUCCEEDED(pPB->Read(CComBSTR(_T("CLSID")), &var, NULL))) {
CLSIDFromString(var.bstrVal, &m_clsid);
var.Clear();
}
- if(SUCCEEDED(pPB->Read(CComBSTR(_T("FilterData")), &var, NULL))) {
+ if (SUCCEEDED(pPB->Read(CComBSTR(_T("FilterData")), &var, NULL))) {
BSTR* pstr;
- if(SUCCEEDED(SafeArrayAccessData(var.parray, (void**)&pstr))) {
+ if (SUCCEEDED(SafeArrayAccessData(var.parray, (void**)&pstr))) {
ExtractFilterData((BYTE*)pstr, var.parray->cbElements*(var.parray->rgsabound[0].cElements));
SafeArrayUnaccessData(var.parray);
}
@@ -168,7 +168,7 @@ void CFGFilterRegistry::QueryProperties() CFGFilterRegistry::CFGFilterRegistry(const CLSID& clsid, UINT64 merit)
: CFGFilter(clsid, L"", merit)
{
- if(m_clsid == GUID_NULL) {
+ if (m_clsid == GUID_NULL) {
return;
}
@@ -176,11 +176,11 @@ CFGFilterRegistry::CFGFilterRegistry(const CLSID& clsid, UINT64 merit) CRegKey key;
- if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("CLSID\\") + guid, KEY_READ)) {
+ if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("CLSID\\") + guid, KEY_READ)) {
ULONG nChars = 0;
- if(ERROR_SUCCESS == key.QueryStringValue(NULL, NULL, &nChars)) {
+ if (ERROR_SUCCESS == key.QueryStringValue(NULL, NULL, &nChars)) {
CString name;
- if(ERROR_SUCCESS == key.QueryStringValue(NULL, name.GetBuffer(nChars), &nChars)) {
+ if (ERROR_SUCCESS == key.QueryStringValue(NULL, name.GetBuffer(nChars), &nChars)) {
name.ReleaseBuffer(nChars);
m_name = name;
}
@@ -191,18 +191,18 @@ CFGFilterRegistry::CFGFilterRegistry(const CLSID& clsid, UINT64 merit) CRegKey catkey;
- if(ERROR_SUCCESS == catkey.Open(HKEY_CLASSES_ROOT, _T("CLSID\\{083863F1-70DE-11d0-BD40-00A0C911CE86}\\Instance"), KEY_READ)) {
- if(ERROR_SUCCESS != key.Open(catkey, guid, KEY_READ)) {
+ if (ERROR_SUCCESS == catkey.Open(HKEY_CLASSES_ROOT, _T("CLSID\\{083863F1-70DE-11d0-BD40-00A0C911CE86}\\Instance"), KEY_READ)) {
+ if (ERROR_SUCCESS != key.Open(catkey, guid, KEY_READ)) {
// illiminable pack uses the name of the filter and not the clsid, have to enum all keys to find it...
FILETIME ft;
TCHAR buff[256];
DWORD len = countof(buff);
- for(DWORD i = 0; ERROR_SUCCESS == catkey.EnumKey(i, buff, &len, &ft); i++, len = countof(buff)) {
- if(ERROR_SUCCESS == key.Open(catkey, buff, KEY_READ)) {
+ for (DWORD i = 0; ERROR_SUCCESS == catkey.EnumKey(i, buff, &len, &ft); i++, len = countof(buff)) {
+ if (ERROR_SUCCESS == key.Open(catkey, buff, KEY_READ)) {
TCHAR clsid[256];
len = countof(clsid);
- if(ERROR_SUCCESS == key.QueryStringValue(_T("CLSID"), clsid, &len) && GUIDFromCString(clsid) == m_clsid) {
+ if (ERROR_SUCCESS == key.QueryStringValue(_T("CLSID"), clsid, &len) && GUIDFromCString(clsid) == m_clsid) {
break;
}
@@ -211,20 +211,20 @@ CFGFilterRegistry::CFGFilterRegistry(const CLSID& clsid, UINT64 merit) }
}
- if(key) {
+ if (key) {
ULONG nChars = 0;
- if(ERROR_SUCCESS == key.QueryStringValue(_T("FriendlyName"), NULL, &nChars)) {
+ if (ERROR_SUCCESS == key.QueryStringValue(_T("FriendlyName"), NULL, &nChars)) {
CString name;
- if(ERROR_SUCCESS == key.QueryStringValue(_T("FriendlyName"), name.GetBuffer(nChars), &nChars)) {
+ if (ERROR_SUCCESS == key.QueryStringValue(_T("FriendlyName"), name.GetBuffer(nChars), &nChars)) {
name.ReleaseBuffer(nChars);
m_name = name;
}
}
ULONG nBytes = 0;
- if(ERROR_SUCCESS == key.QueryBinaryValue(_T("FilterData"), NULL, &nBytes)) {
+ if (ERROR_SUCCESS == key.QueryBinaryValue(_T("FilterData"), NULL, &nBytes)) {
CAutoVectorPtr<BYTE> buff;
- if(buff.Allocate(nBytes) && ERROR_SUCCESS == key.QueryBinaryValue(_T("FilterData"), buff, &nBytes)) {
+ if (buff.Allocate(nBytes) && ERROR_SUCCESS == key.QueryBinaryValue(_T("FilterData"), buff, &nBytes)) {
ExtractFilterData(buff, nBytes);
}
}
@@ -233,7 +233,7 @@ CFGFilterRegistry::CFGFilterRegistry(const CLSID& clsid, UINT64 merit) }
}
- if(merit != MERIT64_DO_USE) {
+ if (merit != MERIT64_DO_USE) {
m_merit.val = merit;
}
}
@@ -244,14 +244,14 @@ HRESULT CFGFilterRegistry::Create(IBaseFilter** ppBF, CInterfaceList<IUnknown, & HRESULT hr = E_FAIL;
- if(m_pMoniker) {
- if(SUCCEEDED(hr = m_pMoniker->BindToObject(0, 0, IID_IBaseFilter, (void**)ppBF))) {
+ if (m_pMoniker) {
+ if (SUCCEEDED(hr = m_pMoniker->BindToObject(0, 0, IID_IBaseFilter, (void**)ppBF))) {
m_clsid = ::GetCLSID(*ppBF);
}
- } else if(m_clsid != GUID_NULL) {
+ } else if (m_clsid != GUID_NULL) {
CComQIPtr<IBaseFilter> pBF;
- if(FAILED(pBF.CoCreateInstance(m_clsid))) {
+ if (FAILED(pBF.CoCreateInstance(m_clsid))) {
return E_FAIL;
}
@@ -275,20 +275,20 @@ void CFGFilterRegistry::ExtractFilterData(BYTE* p, UINT len) CComPtr<IAMFilterData> pFD;
BYTE* ptr = NULL;
- if(SUCCEEDED(pFD.CoCreateInstance(CLSID_FilterMapper2))
+ if (SUCCEEDED(pFD.CoCreateInstance(CLSID_FilterMapper2))
&& SUCCEEDED(pFD->ParseFilterData(p, len, (BYTE**)&ptr))) {
REGFILTER2* prf = (REGFILTER2*)*(WPARAM*)ptr; // this is f*cked up
m_merit.mid = prf->dwMerit;
- if(prf->dwVersion == 1) {
- for(UINT i = 0; i < prf->cPins; i++) {
- if(prf->rgPins[i].bOutput) {
+ if (prf->dwVersion == 1) {
+ for (UINT i = 0; i < prf->cPins; i++) {
+ if (prf->rgPins[i].bOutput) {
continue;
}
- for(UINT j = 0; j < prf->rgPins[i].nMediaTypes; j++) {
- if(!prf->rgPins[i].lpMediaType[j].clsMajorType || !prf->rgPins[i].lpMediaType[j].clsMinorType) {
+ for (UINT j = 0; j < prf->rgPins[i].nMediaTypes; j++) {
+ if (!prf->rgPins[i].lpMediaType[j].clsMajorType || !prf->rgPins[i].lpMediaType[j].clsMinorType) {
break;
}
@@ -296,14 +296,14 @@ void CFGFilterRegistry::ExtractFilterData(BYTE* p, UINT len) AddType(*rpt.clsMajorType, *rpt.clsMinorType);
}
}
- } else if(prf->dwVersion == 2) {
- for(UINT i = 0; i < prf->cPins2; i++) {
- if(prf->rgPins2[i].dwFlags®_PINFLAG_B_OUTPUT) {
+ } else if (prf->dwVersion == 2) {
+ for (UINT i = 0; i < prf->cPins2; i++) {
+ if (prf->rgPins2[i].dwFlags®_PINFLAG_B_OUTPUT) {
continue;
}
- for(UINT j = 0; j < prf->rgPins2[i].nMediaTypes; j++) {
- if(!prf->rgPins2[i].lpMediaType[j].clsMajorType || !prf->rgPins2[i].lpMediaType[j].clsMinorType) {
+ for (UINT j = 0; j < prf->rgPins2[i].nMediaTypes; j++) {
+ if (!prf->rgPins2[i].lpMediaType[j].clsMajorType || !prf->rgPins2[i].lpMediaType[j].clsMinorType) {
break;
}
@@ -317,10 +317,10 @@ void CFGFilterRegistry::ExtractFilterData(BYTE* p, UINT len) } else {
BYTE* base = p;
-#define ChkLen(size) if(p - base + size > (int)len) return;
+#define ChkLen(size) if (p - base + size > (int)len) return;
ChkLen(4)
- if(*(DWORD*)p != 0x00000002) {
+ if (*(DWORD*)p != 0x00000002) {
return; // only version 2 supported, no samples found for 1
}
p += 4;
@@ -334,7 +334,7 @@ void CFGFilterRegistry::ExtractFilterData(BYTE* p, UINT len) ChkLen(8)
DWORD nPins = *(DWORD*)p;
p += 8;
- while(nPins-- > 0) {
+ while (nPins-- > 0) {
ChkLen(1)
BYTE n = *p-0x30;
p++;
@@ -359,7 +359,7 @@ void CFGFilterRegistry::ExtractFilterData(BYTE* p, UINT len) ChkLen(12)
DWORD nTypes = *(DWORD*)p;
p += 12;
- while(nTypes-- > 0) {
+ while (nTypes-- > 0) {
ChkLen(1)
BYTE n = *p-0x30;
p++;
@@ -379,7 +379,7 @@ void CFGFilterRegistry::ExtractFilterData(BYTE* p, UINT len) p += 4;
ChkLen(8)
- if(*(DWORD*)p < (p-base+8) || *(DWORD*)p >= len
+ if (*(DWORD*)p < (p-base+8) || *(DWORD*)p >= len
|| *(DWORD*)(p+4) < (p-base+8) || *(DWORD*)(p+4) >= len) {
p += 8;
continue;
@@ -388,7 +388,7 @@ void CFGFilterRegistry::ExtractFilterData(BYTE* p, UINT len) GUID majortype, subtype;
memcpy(&majortype, &base[*(DWORD*)p], sizeof(GUID));
p += 4;
- if(!fOutput) {
+ if (!fOutput) {
AddType(majortype, subtype);
}
}
@@ -436,28 +436,28 @@ HRESULT CFGFilterVideoRenderer::Create(IBaseFilter** ppBF, CInterfaceList<IUnkno CComPtr<ISubPicAllocatorPresenter> pCAP;
- if(m_clsid == CLSID_VMR7AllocatorPresenter
+ if (m_clsid == CLSID_VMR7AllocatorPresenter
|| m_clsid == CLSID_VMR9AllocatorPresenter
|| m_clsid == CLSID_DXRAllocatorPresenter
|| m_clsid == CLSID_madVRAllocatorPresenter
|| m_clsid == CLSID_EVRAllocatorPresenter
|| m_clsid == CLSID_SyncAllocatorPresenter) {
bool bFullscreen = (AfxGetApp()->m_pMainWnd != NULL) && (((CMainFrame*)AfxGetApp()->m_pMainWnd)->IsD3DFullScreenMode());
- if(SUCCEEDED(CreateAP7(m_clsid, m_hWnd, &pCAP))
+ if (SUCCEEDED(CreateAP7(m_clsid, m_hWnd, &pCAP))
|| SUCCEEDED(CreateAP9(m_clsid, m_hWnd, bFullscreen, &pCAP))
|| SUCCEEDED(CreateEVR(m_clsid, m_hWnd, bFullscreen, &pCAP))
|| SUCCEEDED(CreateSyncRenderer(m_clsid, m_hWnd, bFullscreen, &pCAP))) {
CComPtr<IUnknown> pRenderer;
- if(SUCCEEDED(hr = pCAP->CreateRenderer(&pRenderer))) {
+ if (SUCCEEDED(hr = pCAP->CreateRenderer(&pRenderer))) {
*ppBF = CComQIPtr<IBaseFilter>(pRenderer).Detach();
pUnks.AddTail(pCAP);
}
}
} else {
CComPtr<IBaseFilter> pBF;
- if(SUCCEEDED(pBF.CoCreateInstance(m_clsid))) {
+ if (SUCCEEDED(pBF.CoCreateInstance(m_clsid))) {
BeginEnumPins(pBF, pEP, pPin) {
- if(CComQIPtr<IMixerPinConfig, &IID_IMixerPinConfig> pMPC = pPin) {
+ if (CComQIPtr<IMixerPinConfig, &IID_IMixerPinConfig> pMPC = pPin) {
pUnks.AddTail(pMPC);
break;
}
@@ -468,7 +468,7 @@ HRESULT CFGFilterVideoRenderer::Create(IBaseFilter** ppBF, CInterfaceList<IUnkno }
}
- if(!*ppBF) {
+ if (!*ppBF) {
hr = E_FAIL;
}
@@ -490,9 +490,9 @@ CFGFilterList::~CFGFilterList() void CFGFilterList::RemoveAll()
{
- while(!m_filters.IsEmpty()) {
+ while (!m_filters.IsEmpty()) {
const filter_t& f = m_filters.RemoveHead();
- if(f.autodelete) {
+ if (f.autodelete) {
delete f.pFGF;
}
}
@@ -502,23 +502,23 @@ void CFGFilterList::RemoveAll() void CFGFilterList::Insert(CFGFilter* pFGF, int group, bool exactmatch, bool autodelete)
{
- if(CFGFilterRegistry* f1r = dynamic_cast<CFGFilterRegistry*>(pFGF)) {
+ if (CFGFilterRegistry* f1r = dynamic_cast<CFGFilterRegistry*>(pFGF)) {
POSITION pos = m_filters.GetHeadPosition();
- while(pos) {
+ while (pos) {
filter_t& f2 = m_filters.GetNext(pos);
- if(group != f2.group) {
+ if (group != f2.group) {
continue;
}
- if(CFGFilterRegistry* f2r = dynamic_cast<CFGFilterRegistry*>(f2.pFGF)) {
- if(f1r->GetMoniker() && f2r->GetMoniker() && S_OK == f1r->GetMoniker()->IsEqual(f2r->GetMoniker())
+ if (CFGFilterRegistry* f2r = dynamic_cast<CFGFilterRegistry*>(f2.pFGF)) {
+ if (f1r->GetMoniker() && f2r->GetMoniker() && S_OK == f1r->GetMoniker()->IsEqual(f2r->GetMoniker())
|| f1r->GetCLSID() != GUID_NULL && f1r->GetCLSID() == f2r->GetCLSID()) {
TRACE(_T("FGM: Inserting %d %d %016I64x '%s' NOT!\n"),
group, exactmatch, pFGF->GetMerit(),
pFGF->GetName().IsEmpty() ? CStringFromGUID(pFGF->GetCLSID()) : CString(pFGF->GetName()));
- if(autodelete) {
+ if (autodelete) {
delete pFGF;
}
return;
@@ -528,13 +528,13 @@ void CFGFilterList::Insert(CFGFilter* pFGF, int group, bool exactmatch, bool aut }
POSITION pos = m_filters.GetHeadPosition();
- while(pos) {
- if(m_filters.GetNext(pos).pFGF == pFGF) {
+ while (pos) {
+ if (m_filters.GetNext(pos).pFGF == pFGF) {
TRACE(_T("FGM: Inserting %d %d %016I64x '%s' DUP!\n"),
group, exactmatch, pFGF->GetMerit(),
pFGF->GetName().IsEmpty() ? CStringFromGUID(pFGF->GetCLSID()) : CString(pFGF->GetName()));
- if(autodelete) {
+ if (autodelete) {
delete pFGF;
}
return;
@@ -553,16 +553,16 @@ void CFGFilterList::Insert(CFGFilter* pFGF, int group, bool exactmatch, bool aut POSITION CFGFilterList::GetHeadPosition()
{
- if(m_sortedfilters.IsEmpty()) {
+ if (m_sortedfilters.IsEmpty()) {
CAtlArray<filter_t> sort;
sort.SetCount(m_filters.GetCount());
POSITION pos = m_filters.GetHeadPosition();
- for(int i = 0; pos; i++) {
+ for (int i = 0; pos; i++) {
sort[i] = m_filters.GetNext(pos);
}
qsort(&sort[0], sort.GetCount(), sizeof(sort[0]), filter_cmp);
- for(size_t i = 0; i < sort.GetCount(); i++)
- if(sort[i].pFGF->GetMerit() >= MERIT64_DO_USE) {
+ for (size_t i = 0; i < sort.GetCount(); i++)
+ if (sort[i].pFGF->GetMerit() >= MERIT64_DO_USE) {
m_sortedfilters.AddTail(sort[i].pFGF);
}
}
@@ -571,7 +571,7 @@ POSITION CFGFilterList::GetHeadPosition() TRACE(_T("FGM: Sorting filters\n"));
POSITION pos = m_sortedfilters.GetHeadPosition();
- while(pos) {
+ while (pos) {
CFGFilter* pFGF = m_sortedfilters.GetNext(pos);
TRACE(_T("FGM: - %016I64x '%s'\n"), pFGF->GetMerit(), pFGF->GetName().IsEmpty() ? CStringFromGUID(pFGF->GetCLSID()) : CString(pFGF->GetName()));
}
@@ -590,43 +590,43 @@ int CFGFilterList::filter_cmp(const void* a, const void* b) filter_t* fa = (filter_t*)a;
filter_t* fb = (filter_t*)b;
- if(fa->group < fb->group) {
+ if (fa->group < fb->group) {
return -1;
}
- if(fa->group > fb->group) {
+ if (fa->group > fb->group) {
return +1;
}
- if(fa->pFGF->GetCLSID() == fb->pFGF->GetCLSID()) {
+ if (fa->pFGF->GetCLSID() == fb->pFGF->GetCLSID()) {
CFGFilterFile* fgfa = dynamic_cast<CFGFilterFile*>(fa->pFGF);
CFGFilterFile* fgfb = dynamic_cast<CFGFilterFile*>(fb->pFGF);
- if(fgfa && !fgfb) {
+ if (fgfa && !fgfb) {
return -1;
}
- if(!fgfa && fgfb) {
+ if (!fgfa && fgfb) {
return +1;
}
}
- if(fa->pFGF->GetMerit() > fb->pFGF->GetMerit()) {
+ if (fa->pFGF->GetMerit() > fb->pFGF->GetMerit()) {
return -1;
}
- if(fa->pFGF->GetMerit() < fb->pFGF->GetMerit()) {
+ if (fa->pFGF->GetMerit() < fb->pFGF->GetMerit()) {
return +1;
}
- if(fa->exactmatch && !fb->exactmatch) {
+ if (fa->exactmatch && !fb->exactmatch) {
return -1;
}
- if(!fa->exactmatch && fb->exactmatch) {
+ if (!fa->exactmatch && fb->exactmatch) {
return +1;
}
- if(fa->index < fb->index) {
+ if (fa->index < fb->index) {
return -1;
}
- if(fa->index > fb->index) {
+ if (fa->index > fb->index) {
return +1;
}
diff --git a/src/apps/mplayerc/FGFilter.h b/src/apps/mplayerc/FGFilter.h index 7a4d89c8b..2eba643ad 100644 --- a/src/apps/mplayerc/FGFilter.h +++ b/src/apps/mplayerc/FGFilter.h @@ -109,7 +109,7 @@ public: HRESULT hr = S_OK;
CComPtr<IBaseFilter> pBF = DNew T(NULL, &hr);
- if(FAILED(hr)) {
+ if (FAILED(hr)) {
return hr;
}
diff --git a/src/apps/mplayerc/FGManager.cpp b/src/apps/mplayerc/FGManager.cpp index 13d9c71d6..ed296fcff 100644 --- a/src/apps/mplayerc/FGManager.cpp +++ b/src/apps/mplayerc/FGManager.cpp @@ -55,13 +55,13 @@ CFGManager::CFGManager(LPCTSTR pName, LPUNKNOWN pUnk) CFGManager::~CFGManager()
{
CAutoLock cAutoLock(this);
- while(!m_source.IsEmpty()) {
+ while (!m_source.IsEmpty()) {
delete m_source.RemoveHead();
}
- while(!m_transform.IsEmpty()) {
+ while (!m_transform.IsEmpty()) {
delete m_transform.RemoveHead();
}
- while(!m_override.IsEmpty()) {
+ while (!m_override.IsEmpty()) {
delete m_override.RemoveHead();
}
m_pUnks.RemoveAll();
@@ -98,13 +98,13 @@ bool CFGManager::CStreamPath::Compare(const CStreamPath& path) POSITION pos1 = GetHeadPosition();
POSITION pos2 = path.GetHeadPosition();
- while(pos1 && pos2) {
+ while (pos1 && pos2) {
const path_t& p1 = GetNext(pos1);
const path_t& p2 = path.GetNext(pos2);
- if(p1.filter != p2.filter) {
+ if (p1.filter != p2.filter) {
return true;
- } else if(p1.pin != p2.pin) {
+ } else if (p1.pin != p2.pin) {
return false;
}
}
@@ -119,7 +119,7 @@ bool CFGManager::CheckBytes(HANDLE hFile, CString chkbytes) CAtlList<CString> sl;
Explode(chkbytes, sl, ',');
- if(sl.GetCount() < 4) {
+ if (sl.GetCount() < 4) {
return false;
}
@@ -128,7 +128,7 @@ bool CFGManager::CheckBytes(HANDLE hFile, CString chkbytes) LARGE_INTEGER size = {0, 0};
size.LowPart = GetFileSize(hFile, (DWORD*)&size.HighPart);
- while(sl.GetCount() >= 4) {
+ while (sl.GetCount() >= 4) {
CString offsetstr = sl.RemoveHead();
CString cbstr = sl.RemoveHead();
CString maskstr = sl.RemoveHead();
@@ -136,7 +136,7 @@ bool CFGManager::CheckBytes(HANDLE hFile, CString chkbytes) long cb = _ttol(cbstr);
- if(offsetstr.IsEmpty() || cbstr.IsEmpty()
+ if (offsetstr.IsEmpty() || cbstr.IsEmpty()
|| valstr.IsEmpty() || (valstr.GetLength() & 1)
|| cb*2 != valstr.GetLength()) {
return false;
@@ -144,13 +144,13 @@ bool CFGManager::CheckBytes(HANDLE hFile, CString chkbytes) LARGE_INTEGER offset;
offset.QuadPart = _ttoi64(offsetstr);
- if(offset.QuadPart < 0) {
+ if (offset.QuadPart < 0) {
offset.QuadPart = size.QuadPart - offset.QuadPart;
}
SetFilePointer(hFile, offset.LowPart, &offset.HighPart, FILE_BEGIN);
// LAME
- while(maskstr.GetLength() < valstr.GetLength()) {
+ while (maskstr.GetLength() < valstr.GetLength()) {
maskstr += 'F';
}
@@ -158,10 +158,10 @@ bool CFGManager::CheckBytes(HANDLE hFile, CString chkbytes) CStringToBin(maskstr, mask);
CStringToBin(valstr, val);
- for(size_t i = 0; i < val.GetCount(); i++) {
+ for (size_t i = 0; i < val.GetCount(); i++) {
BYTE b;
DWORD r;
- if(!ReadFile(hFile, &b, 1, &r, NULL) || (b & mask[i]) != val[i]) {
+ if (!ReadFile(hFile, &b, 1, &r, NULL) || (b & mask[i]) != val[i]) {
return false;
}
}
@@ -174,7 +174,7 @@ CFGFilter *LookupFilterRegistry(const GUID &guid, CAtlList<CFGFilter*> &list, UI {
POSITION pos = list.GetHeadPosition();
CFGFilter *pFilter = NULL;
- while(pos) {
+ while (pos) {
CFGFilter* pFGF = list.GetNext(pos);
if (pFGF->GetCLSID() == guid) {
pFilter = pFGF;
@@ -202,30 +202,30 @@ HRESULT CFGManager::EnumSourceFilters(LPCWSTR lpcwstrFileName, CFGFilterList& fl HANDLE hFile = INVALID_HANDLE_VALUE;
- if(protocol.GetLength() <= 1 || protocol == L"file") {
+ if (protocol.GetLength() <= 1 || protocol == L"file") {
hFile = CreateFile(CString(fn), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, (HANDLE)NULL);
- if(hFile == INVALID_HANDLE_VALUE) {
+ if (hFile == INVALID_HANDLE_VALUE) {
return VFW_E_NOT_FOUND;
}
}
// exceptions first
- if(ext == _T(".dvr-ms") || ext == _T(".wtv")) { // doh, this is stupid
+ if (ext == _T(".dvr-ms") || ext == _T(".wtv")) { // doh, this is stupid
fl.Insert(LookupFilterRegistry(CLSID_StreamBufferSource, m_override, MERIT64_PREFERRED), 0);
}
TCHAR buff[256], buff2[256];
ULONG len, len2;
- if(hFile == INVALID_HANDLE_VALUE) {
+ if (hFile == INVALID_HANDLE_VALUE) {
// internal / protocol
POSITION pos = m_source.GetHeadPosition();
- while(pos) {
+ while (pos) {
CFGFilter* pFGF = m_source.GetNext(pos);
- if(pFGF->m_protocols.Find(CString(protocol))) {
+ if (pFGF->m_protocols.Find(CString(protocol))) {
fl.Insert(pFGF, 0, false, false);
}
}
@@ -233,12 +233,12 @@ HRESULT CFGManager::EnumSourceFilters(LPCWSTR lpcwstrFileName, CFGFilterList& fl // internal / check bytes
POSITION pos = m_source.GetHeadPosition();
- while(pos) {
+ while (pos) {
CFGFilter* pFGF = m_source.GetNext(pos);
POSITION pos2 = pFGF->m_chkbytes.GetHeadPosition();
- while(pos2) {
- if(CheckBytes(hFile, pFGF->m_chkbytes.GetNext(pos2))) {
+ while (pos2) {
+ if (CheckBytes(hFile, pFGF->m_chkbytes.GetNext(pos2))) {
fl.Insert(pFGF, 1, false, false);
break;
}
@@ -246,13 +246,13 @@ HRESULT CFGManager::EnumSourceFilters(LPCWSTR lpcwstrFileName, CFGFilterList& fl }
}
- if(!ext.IsEmpty()) {
+ if (!ext.IsEmpty()) {
// internal / file extension
POSITION pos = m_source.GetHeadPosition();
- while(pos) {
+ while (pos) {
CFGFilter* pFGF = m_source.GetNext(pos);
- if(pFGF->m_extensions.Find(CString(ext))) {
+ if (pFGF->m_extensions.Find(CString(ext))) {
fl.Insert(pFGF, 2, false, false);
}
}
@@ -262,29 +262,29 @@ HRESULT CFGManager::EnumSourceFilters(LPCWSTR lpcwstrFileName, CFGFilterList& fl // internal / the rest
POSITION pos = m_source.GetHeadPosition();
- while(pos) {
+ while (pos) {
CFGFilter* pFGF = m_source.GetNext(pos);
- if(pFGF->m_protocols.IsEmpty() && pFGF->m_chkbytes.IsEmpty() && pFGF->m_extensions.IsEmpty()) {
+ if (pFGF->m_protocols.IsEmpty() && pFGF->m_chkbytes.IsEmpty() && pFGF->m_extensions.IsEmpty()) {
fl.Insert(pFGF, 3, false, false);
}
}
}
- if(hFile == INVALID_HANDLE_VALUE) {
+ if (hFile == INVALID_HANDLE_VALUE) {
// protocol
CRegKey key;
- if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, CString(protocol), KEY_READ)) {
+ if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, CString(protocol), KEY_READ)) {
CRegKey exts;
- if(ERROR_SUCCESS == exts.Open(key, _T("Extensions"), KEY_READ)) {
+ if (ERROR_SUCCESS == exts.Open(key, _T("Extensions"), KEY_READ)) {
len = countof(buff);
- if(ERROR_SUCCESS == exts.QueryStringValue(CString(ext), buff, &len)) {
+ if (ERROR_SUCCESS == exts.QueryStringValue(CString(ext), buff, &len)) {
fl.Insert(LookupFilterRegistry(GUIDFromCString(buff), m_override), 4);
}
}
len = countof(buff);
- if(ERROR_SUCCESS == key.QueryStringValue(_T("Source Filter"), buff, &len)) {
+ if (ERROR_SUCCESS == key.QueryStringValue(_T("Source Filter"), buff, &len)) {
fl.Insert(LookupFilterRegistry(GUIDFromCString(buff), m_override), 5);
}
}
@@ -294,28 +294,28 @@ HRESULT CFGManager::EnumSourceFilters(LPCWSTR lpcwstrFileName, CFGFilterList& fl // check bytes
CRegKey key;
- if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("Media Type"), KEY_READ)) {
+ if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("Media Type"), KEY_READ)) {
FILETIME ft;
len = countof(buff);
- for(DWORD i = 0; ERROR_SUCCESS == key.EnumKey(i, buff, &len, &ft); i++, len = countof(buff)) {
+ for (DWORD i = 0; ERROR_SUCCESS == key.EnumKey(i, buff, &len, &ft); i++, len = countof(buff)) {
GUID majortype;
- if(FAILED(GUIDFromCString(buff, majortype))) {
+ if (FAILED(GUIDFromCString(buff, majortype))) {
continue;
}
CRegKey majorkey;
- if(ERROR_SUCCESS == majorkey.Open(key, buff, KEY_READ)) {
+ if (ERROR_SUCCESS == majorkey.Open(key, buff, KEY_READ)) {
len = countof(buff);
- for(DWORD j = 0; ERROR_SUCCESS == majorkey.EnumKey(j, buff, &len, &ft); j++, len = countof(buff)) {
+ for (DWORD j = 0; ERROR_SUCCESS == majorkey.EnumKey(j, buff, &len, &ft); j++, len = countof(buff)) {
GUID subtype;
- if(FAILED(GUIDFromCString(buff, subtype))) {
+ if (FAILED(GUIDFromCString(buff, subtype))) {
continue;
}
CRegKey subkey;
- if(ERROR_SUCCESS == subkey.Open(majorkey, buff, KEY_READ)) {
+ if (ERROR_SUCCESS == subkey.Open(majorkey, buff, KEY_READ)) {
len = countof(buff);
- if(ERROR_SUCCESS != subkey.QueryStringValue(_T("Source Filter"), buff, &len)) {
+ if (ERROR_SUCCESS != subkey.QueryStringValue(_T("Source Filter"), buff, &len)) {
continue;
}
@@ -323,10 +323,10 @@ HRESULT CFGManager::EnumSourceFilters(LPCWSTR lpcwstrFileName, CFGFilterList& fl len = countof(buff);
len2 = sizeof(buff2);
- for(DWORD k = 0, type;
+ for (DWORD k = 0, type;
clsid != GUID_NULL && ERROR_SUCCESS == RegEnumValue(subkey, k, buff2, &len2, 0, &type, (BYTE*)buff, &len);
k++, len = countof(buff), len2 = sizeof(buff2)) {
- if(CheckBytes(hFile, CString(buff))) {
+ if (CheckBytes(hFile, CString(buff))) {
CFGFilter* pFGF = LookupFilterRegistry(clsid, m_override);
pFGF->AddType(majortype, subtype);
fl.Insert(pFGF, 9);
@@ -340,26 +340,26 @@ HRESULT CFGManager::EnumSourceFilters(LPCWSTR lpcwstrFileName, CFGFilterList& fl }
}
- if(!ext.IsEmpty()) {
+ if (!ext.IsEmpty()) {
// file extension
CRegKey key;
- if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("Media Type\\Extensions\\") + CString(ext), KEY_READ)) {
+ if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("Media Type\\Extensions\\") + CString(ext), KEY_READ)) {
ULONG len = countof(buff);
memset(buff, 0, sizeof(buff));
LONG ret = key.QueryStringValue(_T("Source Filter"), buff, &len); // QueryStringValue can return ERROR_INVALID_DATA on bogus strings (radlight mpc v1003, fixed in v1004)
- if(ERROR_SUCCESS == ret || ERROR_INVALID_DATA == ret && GUIDFromCString(buff) != GUID_NULL) {
+ if (ERROR_SUCCESS == ret || ERROR_INVALID_DATA == ret && GUIDFromCString(buff) != GUID_NULL) {
GUID clsid = GUIDFromCString(buff);
GUID majortype = GUID_NULL;
GUID subtype = GUID_NULL;
len = countof(buff);
- if(ERROR_SUCCESS == key.QueryStringValue(_T("Media Type"), buff, &len)) {
+ if (ERROR_SUCCESS == key.QueryStringValue(_T("Media Type"), buff, &len)) {
majortype = GUIDFromCString(buff);
}
len = countof(buff);
- if(ERROR_SUCCESS == key.QueryStringValue(_T("Subtype"), buff, &len)) {
+ if (ERROR_SUCCESS == key.QueryStringValue(_T("Subtype"), buff, &len)) {
subtype = GUIDFromCString(buff);
}
@@ -370,7 +370,7 @@ HRESULT CFGManager::EnumSourceFilters(LPCWSTR lpcwstrFileName, CFGFilterList& fl }
}
- if(hFile != INVALID_HANDLE_VALUE) {
+ if (hFile != INVALID_HANDLE_VALUE) {
CloseHandle(hFile);
}
@@ -394,16 +394,16 @@ HRESULT CFGManager::AddSourceFilter(CFGFilter* pFGF, LPCWSTR lpcwstrFileName, LP CComPtr<IBaseFilter> pBF;
CInterfaceList<IUnknown, &IID_IUnknown> pUnks;
- if(FAILED(hr = pFGF->Create(&pBF, pUnks))) {
+ if (FAILED(hr = pFGF->Create(&pBF, pUnks))) {
return hr;
}
CComQIPtr<IFileSourceFilter> pFSF = pBF;
- if(!pFSF) {
+ if (!pFSF) {
return E_NOINTERFACE;
}
- if(FAILED(hr = AddFilter(pBF, lpcwstrFilterName))) {
+ if (FAILED(hr = AddFilter(pBF, lpcwstrFilterName))) {
return hr;
}
@@ -411,14 +411,14 @@ HRESULT CFGManager::AddSourceFilter(CFGFilter* pFGF, LPCWSTR lpcwstrFileName, LP CMediaType mt;
const CAtlList<GUID>& types = pFGF->GetTypes();
- if(types.GetCount() == 2 && (types.GetHead() != GUID_NULL || types.GetTail() != GUID_NULL)) {
+ if (types.GetCount() == 2 && (types.GetHead() != GUID_NULL || types.GetTail() != GUID_NULL)) {
mt.majortype = types.GetHead();
mt.subtype = types.GetTail();
pmt = &mt;
}
// sometimes looping with AviSynth
- if(FAILED(hr = pFSF->Load(lpcwstrFileName, pmt))) {
+ if (FAILED(hr = pFSF->Load(lpcwstrFileName, pmt))) {
RemoveFilter(pBF);
return hr;
}
@@ -432,7 +432,7 @@ HRESULT CFGManager::AddSourceFilter(CFGFilter* pFGF, LPCWSTR lpcwstrFileName, LP static const GUID guid3 =
{ 0xD51BD5AE, 0x7548, 0x11CF, { 0xA5, 0x20, 0x00, 0x80, 0xC7, 0x7E, 0xF5, 0x8A } };
- if(pmt->subtype == guid1 || pmt->subtype == guid2 || pmt->subtype == guid3) {
+ if (pmt->subtype == guid1 || pmt->subtype == guid2 || pmt->subtype == guid3) {
RemoveFilter(pBF);
pFGF = DNew CFGFilterRegistry(CLSID_NetShowSource);
hr = AddSourceFilter(pFGF, lpcwstrFileName, lpcwstrFilterName, ppBF);
@@ -453,7 +453,7 @@ HRESULT CFGManager::AddSourceFilter(CFGFilter* pFGF, LPCWSTR lpcwstrFileName, LP STDMETHODIMP CFGManager::AddFilter(IBaseFilter* pFilter, LPCWSTR pName)
{
- if(!m_pUnkInner) {
+ if (!m_pUnkInner) {
return E_UNEXPECTED;
}
@@ -461,7 +461,7 @@ STDMETHODIMP CFGManager::AddFilter(IBaseFilter* pFilter, LPCWSTR pName) HRESULT hr;
- if(FAILED(hr = CComQIPtr<IFilterGraph2>(m_pUnkInner)->AddFilter(pFilter, pName))) {
+ if (FAILED(hr = CComQIPtr<IFilterGraph2>(m_pUnkInner)->AddFilter(pFilter, pName))) {
return hr;
}
@@ -474,7 +474,7 @@ STDMETHODIMP CFGManager::AddFilter(IBaseFilter* pFilter, LPCWSTR pName) STDMETHODIMP CFGManager::RemoveFilter(IBaseFilter* pFilter)
{
- if(!m_pUnkInner) {
+ if (!m_pUnkInner) {
return E_UNEXPECTED;
}
@@ -485,7 +485,7 @@ STDMETHODIMP CFGManager::RemoveFilter(IBaseFilter* pFilter) STDMETHODIMP CFGManager::EnumFilters(IEnumFilters** ppEnum)
{
- if(!m_pUnkInner) {
+ if (!m_pUnkInner) {
return E_UNEXPECTED;
}
@@ -497,7 +497,7 @@ STDMETHODIMP CFGManager::EnumFilters(IEnumFilters** ppEnum) STDMETHODIMP CFGManager::FindFilterByName(LPCWSTR pName, IBaseFilter** ppFilter)
{
- if(!m_pUnkInner) {
+ if (!m_pUnkInner) {
return E_UNEXPECTED;
}
@@ -508,7 +508,7 @@ STDMETHODIMP CFGManager::FindFilterByName(LPCWSTR pName, IBaseFilter** ppFilter) STDMETHODIMP CFGManager::ConnectDirect(IPin* pPinOut, IPin* pPinIn, const AM_MEDIA_TYPE* pmt)
{
- if(!m_pUnkInner) {
+ if (!m_pUnkInner) {
return E_UNEXPECTED;
}
@@ -518,11 +518,11 @@ STDMETHODIMP CFGManager::ConnectDirect(IPin* pPinOut, IPin* pPinIn, const AM_MED CLSID clsid = GetCLSID(pBF);
// TODO: GetUpStreamFilter goes up on the first input pin only
- for(CComPtr<IBaseFilter> pBFUS = GetFilterFromPin(pPinOut); pBFUS; pBFUS = GetUpStreamFilter(pBFUS)) {
- if(pBFUS == pBF) {
+ for (CComPtr<IBaseFilter> pBFUS = GetFilterFromPin(pPinOut); pBFUS; pBFUS = GetUpStreamFilter(pBFUS)) {
+ if (pBFUS == pBF) {
return VFW_E_CIRCULAR_GRAPH;
}
- if(clsid!=CLSID_Proxy && GetCLSID(pBFUS) == clsid) {
+ if (clsid!=CLSID_Proxy && GetCLSID(pBFUS) == clsid) {
return VFW_E_CANNOT_CONNECT;
}
}
@@ -532,7 +532,7 @@ STDMETHODIMP CFGManager::ConnectDirect(IPin* pPinOut, IPin* pPinIn, const AM_MED STDMETHODIMP CFGManager::Reconnect(IPin* ppin)
{
- if(!m_pUnkInner) {
+ if (!m_pUnkInner) {
return E_UNEXPECTED;
}
@@ -543,7 +543,7 @@ STDMETHODIMP CFGManager::Reconnect(IPin* ppin) STDMETHODIMP CFGManager::Disconnect(IPin* ppin)
{
- if(!m_pUnkInner) {
+ if (!m_pUnkInner) {
return E_UNEXPECTED;
}
@@ -554,7 +554,7 @@ STDMETHODIMP CFGManager::Disconnect(IPin* ppin) STDMETHODIMP CFGManager::SetDefaultSyncSource()
{
- if(!m_pUnkInner) {
+ if (!m_pUnkInner) {
return E_UNEXPECTED;
}
@@ -578,29 +578,29 @@ HRESULT CFGManager::Connect(IPin* pPinOut, IPin* pPinIn, bool bContinueRender) HRESULT hr;
- if(S_OK != IsPinDirection(pPinOut, PINDIR_OUTPUT)
+ if (S_OK != IsPinDirection(pPinOut, PINDIR_OUTPUT)
|| pPinIn && S_OK != IsPinDirection(pPinIn, PINDIR_INPUT)) {
return VFW_E_INVALID_DIRECTION;
}
- if(S_OK == IsPinConnected(pPinOut)
+ if (S_OK == IsPinConnected(pPinOut)
|| pPinIn && S_OK == IsPinConnected(pPinIn)) {
return VFW_E_ALREADY_CONNECTED;
}
bool fDeadEnd = true;
- if(pPinIn) {
+ if (pPinIn) {
// 1. Try a direct connection between the filters, with no intermediate filters
- if(SUCCEEDED(hr = ConnectDirect(pPinOut, pPinIn, NULL))) {
+ if (SUCCEEDED(hr = ConnectDirect(pPinOut, pPinIn, NULL))) {
return hr;
}
} else {
// 1. Use IStreamBuilder
- if(CComQIPtr<IStreamBuilder> pSB = pPinOut) {
- if(SUCCEEDED(hr = pSB->Render(pPinOut, this))) {
+ if (CComQIPtr<IStreamBuilder> pSB = pPinOut) {
+ if (SUCCEEDED(hr = pSB->Render(pPinOut, this))) {
return hr;
}
@@ -610,9 +610,9 @@ HRESULT CFGManager::Connect(IPin* pPinOut, IPin* pPinIn, bool bContinueRender) // 2. Try cached filters
- if(CComQIPtr<IGraphConfig> pGC = (IGraphBuilder2*)this) {
+ if (CComQIPtr<IGraphConfig> pGC = (IGraphBuilder2*)this) {
BeginEnumCachedFilters(pGC, pEF, pBF) {
- if(pPinIn && GetFilterFromPin(pPinIn) == pBF) {
+ if (pPinIn && GetFilterFromPin(pPinIn) == pBF) {
continue;
}
@@ -620,12 +620,12 @@ HRESULT CFGManager::Connect(IPin* pPinOut, IPin* pPinIn, bool bContinueRender) // does RemoveFilterFromCache call AddFilter like AddFilterToCache calls RemoveFilter ?
- if(SUCCEEDED(hr = ConnectFilterDirect(pPinOut, pBF, NULL))) {
- if(!IsStreamEnd(pBF)) {
+ if (SUCCEEDED(hr = ConnectFilterDirect(pPinOut, pBF, NULL))) {
+ if (!IsStreamEnd(pBF)) {
fDeadEnd = false;
}
- if(SUCCEEDED(hr = ConnectFilter(pBF, pPinIn))) {
+ if (SUCCEEDED(hr = ConnectFilter(pBF, pPinIn))) {
return hr;
}
}
@@ -641,13 +641,13 @@ HRESULT CFGManager::Connect(IPin* pPinOut, IPin* pPinIn, bool bContinueRender) CInterfaceList<IBaseFilter> pBFs;
BeginEnumFilters(this, pEF, pBF) {
- if(pPinIn && GetFilterFromPin(pPinIn) == pBF
+ if (pPinIn && GetFilterFromPin(pPinIn) == pBF
|| GetFilterFromPin(pPinOut) == pBF) {
continue;
}
// HACK: ffdshow - audio capture filter
- if(GetCLSID(pPinOut) == GUIDFromCString(_T("{04FE9017-F873-410E-871E-AB91661A4EF7}"))
+ if (GetCLSID(pPinOut) == GUIDFromCString(_T("{04FE9017-F873-410E-871E-AB91661A4EF7}"))
&& GetCLSID(pBF) == GUIDFromCString(_T("{E30629D2-27E5-11CE-875D-00608CB78066}"))) {
continue;
}
@@ -657,15 +657,15 @@ HRESULT CFGManager::Connect(IPin* pPinOut, IPin* pPinIn, bool bContinueRender) EndEnumFilters;
POSITION pos = pBFs.GetHeadPosition();
- while(pos) {
+ while (pos) {
IBaseFilter* pBF = pBFs.GetNext(pos);
- if(SUCCEEDED(hr = ConnectFilterDirect(pPinOut, pBF, NULL))) {
- if(!IsStreamEnd(pBF)) {
+ if (SUCCEEDED(hr = ConnectFilterDirect(pPinOut, pBF, NULL))) {
+ if (!IsStreamEnd(pBF)) {
fDeadEnd = false;
}
- if(SUCCEEDED(hr = ConnectFilter(pBF, pPinIn))) {
+ if (SUCCEEDED(hr = ConnectFilter(pBF, pPinIn))) {
return hr;
}
}
@@ -683,70 +683,70 @@ HRESULT CFGManager::Connect(IPin* pPinOut, IPin* pPinIn, bool bContinueRender) ExtractMediaTypes(pPinOut, types);
POSITION pos = m_transform.GetHeadPosition();
- while(pos) {
+ while (pos) {
CFGFilter* pFGF = m_transform.GetNext(pos);
- if(pFGF->GetMerit() < MERIT64_DO_USE || pFGF->CheckTypes(types, false)) {
+ if (pFGF->GetMerit() < MERIT64_DO_USE || pFGF->CheckTypes(types, false)) {
fl.Insert(pFGF, 0, pFGF->CheckTypes(types, true), false);
}
}
pos = m_override.GetHeadPosition();
- while(pos) {
+ while (pos) {
CFGFilter* pFGF = m_override.GetNext(pos);
- if(pFGF->GetMerit() < MERIT64_DO_USE || pFGF->CheckTypes(types, false)) {
+ if (pFGF->GetMerit() < MERIT64_DO_USE || pFGF->CheckTypes(types, false)) {
fl.Insert(pFGF, 0, pFGF->CheckTypes(types, true), false);
}
}
CComPtr<IEnumMoniker> pEM;
- if(types.GetCount() > 0
+ if (types.GetCount() > 0
&& SUCCEEDED(m_pFM->EnumMatchingFilters(
&pEM, 0, FALSE, MERIT_DO_NOT_USE+1,
TRUE, types.GetCount()/2, types.GetData(), NULL, NULL, FALSE,
!!pPinIn, 0, NULL, NULL, NULL))) {
- for(CComPtr<IMoniker> pMoniker; S_OK == pEM->Next(1, &pMoniker, NULL); pMoniker = NULL) {
+ for (CComPtr<IMoniker> pMoniker; S_OK == pEM->Next(1, &pMoniker, NULL); pMoniker = NULL) {
CFGFilterRegistry* pFGF = DNew CFGFilterRegistry(pMoniker);
fl.Insert(pFGF, 0, pFGF->CheckTypes(types, true));
}
}
pos = fl.GetHeadPosition();
- while(pos) {
+ while (pos) {
CFGFilter* pFGF = fl.GetNext(pos);
TRACE(_T("FGM: Connecting '%s'\n"), pFGF->GetName());
CComPtr<IBaseFilter> pBF;
CInterfaceList<IUnknown, &IID_IUnknown> pUnks;
- if(FAILED(pFGF->Create(&pBF, pUnks))) {
+ if (FAILED(pFGF->Create(&pBF, pUnks))) {
continue;
}
- if(FAILED(hr = AddFilter(pBF, pFGF->GetName()))) {
+ if (FAILED(hr = AddFilter(pBF, pFGF->GetName()))) {
pBF.Release();
continue;
}
hr = ConnectFilterDirect(pPinOut, pBF, NULL);
/*
- if(FAILED(hr))
+ if (FAILED(hr))
{
- if(types.GetCount() >= 2 && types[0] == MEDIATYPE_Stream && types[1] != GUID_NULL)
+ if (types.GetCount() >= 2 && types[0] == MEDIATYPE_Stream && types[1] != GUID_NULL)
{
CMediaType mt;
mt.majortype = types[0];
mt.subtype = types[1];
mt.formattype = FORMAT_None;
- if(FAILED(hr)) hr = ConnectFilterDirect(pPinOut, pBF, &mt);
+ if (FAILED(hr)) hr = ConnectFilterDirect(pPinOut, pBF, &mt);
mt.formattype = GUID_NULL;
- if(FAILED(hr)) hr = ConnectFilterDirect(pPinOut, pBF, &mt);
+ if (FAILED(hr)) hr = ConnectFilterDirect(pPinOut, pBF, &mt);
}
}
*/
- if(SUCCEEDED(hr)) {
- if(!IsStreamEnd(pBF)) {
+ if (SUCCEEDED(hr)) {
+ if (!IsStreamEnd(pBF)) {
fDeadEnd = false;
}
@@ -754,35 +754,35 @@ HRESULT CFGManager::Connect(IPin* pPinOut, IPin* pPinIn, bool bContinueRender) hr = ConnectFilter(pBF, pPinIn);
}
- if(SUCCEEDED(hr)) {
+ if (SUCCEEDED(hr)) {
m_pUnks.AddTailList(&pUnks);
// maybe the application should do this...
POSITION pos = pUnks.GetHeadPosition();
- while(pos) {
- if(CComQIPtr<IMixerPinConfig, &IID_IMixerPinConfig> pMPC = pUnks.GetNext(pos)) {
+ while (pos) {
+ if (CComQIPtr<IMixerPinConfig, &IID_IMixerPinConfig> pMPC = pUnks.GetNext(pos)) {
pMPC->SetAspectRatioMode(AM_ARMODE_STRETCHED);
}
}
- if(CComQIPtr<IVMRAspectRatioControl> pARC = pBF) {
+ if (CComQIPtr<IVMRAspectRatioControl> pARC = pBF) {
pARC->SetAspectRatioMode(VMR_ARMODE_NONE);
}
- if(CComQIPtr<IVMRAspectRatioControl9> pARC = pBF) {
+ if (CComQIPtr<IVMRAspectRatioControl9> pARC = pBF) {
pARC->SetAspectRatioMode(VMR_ARMODE_NONE);
}
- if(CComQIPtr<IVMRMixerControl9> pMC = pBF) {
+ if (CComQIPtr<IVMRMixerControl9> pMC = pBF) {
m_pUnks.AddTail (pMC);
}
- if(CComQIPtr<IVMRMixerBitmap9> pMB = pBF) {
+ if (CComQIPtr<IVMRMixerBitmap9> pMB = pBF) {
m_pUnks.AddTail (pMB);
}
- if(CComQIPtr<IMFGetService, &__uuidof(IMFGetService)> pMFGS = pBF) {
+ if (CComQIPtr<IMFGetService, &__uuidof(IMFGetService)> pMFGS = pBF) {
CComPtr<IMFVideoDisplayControl> pMFVDC;
CComPtr<IMFVideoMixerBitmap> pMFMB;
if (SUCCEEDED (pMFGS->GetService (MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl, (void**)&pMFVDC))) {
@@ -809,18 +809,18 @@ HRESULT CFGManager::Connect(IPin* pPinOut, IPin* pPinIn, bool bContinueRender) }
}
- if(fDeadEnd) {
+ if (fDeadEnd) {
CAutoPtr<CStreamDeadEnd> psde(DNew CStreamDeadEnd());
psde->AddTailList(&m_streampath);
int skip = 0;
BeginEnumMediaTypes(pPinOut, pEM, pmt) {
- if(pmt->majortype == MEDIATYPE_Stream && pmt->subtype == MEDIASUBTYPE_NULL) {
+ if (pmt->majortype == MEDIATYPE_Stream && pmt->subtype == MEDIASUBTYPE_NULL) {
skip++;
}
psde->mts.AddTail(CMediaType(*pmt));
}
EndEnumMediaTypes(pmt)
- if(skip < psde->mts.GetCount()) {
+ if (skip < psde->mts.GetCount()) {
m_deadends.Add(psde);
}
}
@@ -847,14 +847,14 @@ STDMETHODIMP CFGManager::RenderFile(LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrPlay /*
CComPtr<IBaseFilter> pBF;
- if(FAILED(hr = AddSourceFilter(lpcwstrFile, lpcwstrFile, &pBF)))
+ if (FAILED(hr = AddSourceFilter(lpcwstrFile, lpcwstrFile, &pBF)))
return hr;
return ConnectFilter(pBF, NULL);
*/
CFGFilterList fl;
- if(FAILED(hr = EnumSourceFilters(lpcwstrFileName, fl))) {
+ if (FAILED(hr = EnumSourceFilters(lpcwstrFileName, fl))) {
return hr;
}
@@ -863,14 +863,14 @@ STDMETHODIMP CFGManager::RenderFile(LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrPlay hr = VFW_E_CANNOT_RENDER;
POSITION pos = fl.GetHeadPosition();
- while(pos) {
+ while (pos) {
CComPtr<IBaseFilter> pBF;
- if(SUCCEEDED(hr = AddSourceFilter(fl.GetNext(pos), lpcwstrFileName, lpcwstrFileName, &pBF))) {
+ if (SUCCEEDED(hr = AddSourceFilter(fl.GetNext(pos), lpcwstrFileName, lpcwstrFileName, &pBF))) {
m_streampath.RemoveAll();
m_deadends.RemoveAll();
- if(SUCCEEDED(hr = ConnectFilter(pBF, NULL))) {
+ if (SUCCEEDED(hr = ConnectFilter(pBF, NULL))) {
return hr;
}
@@ -893,13 +893,13 @@ STDMETHODIMP CFGManager::AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpcwst HRESULT hr;
CFGFilterList fl;
- if(FAILED(hr = EnumSourceFilters(lpcwstrFileName, fl))) {
+ if (FAILED(hr = EnumSourceFilters(lpcwstrFileName, fl))) {
return hr;
}
POSITION pos = fl.GetHeadPosition();
- while(pos) {
- if(SUCCEEDED(hr = AddSourceFilter(fl.GetNext(pos), lpcwstrFileName, lpcwstrFilterName, ppFilter))) {
+ while (pos) {
+ if (SUCCEEDED(hr = AddSourceFilter(fl.GetNext(pos), lpcwstrFileName, lpcwstrFilterName, ppFilter))) {
return hr;
}
}
@@ -909,7 +909,7 @@ STDMETHODIMP CFGManager::AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpcwst STDMETHODIMP CFGManager::SetLogFile(DWORD_PTR hFile)
{
- if(!m_pUnkInner) {
+ if (!m_pUnkInner) {
return E_UNEXPECTED;
}
@@ -920,7 +920,7 @@ STDMETHODIMP CFGManager::SetLogFile(DWORD_PTR hFile) STDMETHODIMP CFGManager::Abort()
{
- if(!m_pUnkInner) {
+ if (!m_pUnkInner) {
return E_UNEXPECTED;
}
@@ -931,7 +931,7 @@ STDMETHODIMP CFGManager::Abort() STDMETHODIMP CFGManager::ShouldOperationContinue()
{
- if(!m_pUnkInner) {
+ if (!m_pUnkInner) {
return E_UNEXPECTED;
}
@@ -944,7 +944,7 @@ STDMETHODIMP CFGManager::ShouldOperationContinue() STDMETHODIMP CFGManager::AddSourceFilterForMoniker(IMoniker* pMoniker, IBindCtx* pCtx, LPCWSTR lpcwstrFilterName, IBaseFilter** ppFilter)
{
- if(!m_pUnkInner) {
+ if (!m_pUnkInner) {
return E_UNEXPECTED;
}
@@ -955,7 +955,7 @@ STDMETHODIMP CFGManager::AddSourceFilterForMoniker(IMoniker* pMoniker, IBindCtx* STDMETHODIMP CFGManager::ReconnectEx(IPin* ppin, const AM_MEDIA_TYPE* pmt)
{
- if(!m_pUnkInner) {
+ if (!m_pUnkInner) {
return E_UNEXPECTED;
}
@@ -971,25 +971,25 @@ STDMETHODIMP CFGManager::RenderEx(IPin* pPinOut, DWORD dwFlags, DWORD* pvContext m_streampath.RemoveAll();
m_deadends.RemoveAll();
- if(!pPinOut || dwFlags > AM_RENDEREX_RENDERTOEXISTINGRENDERERS || pvContext) {
+ if (!pPinOut || dwFlags > AM_RENDEREX_RENDERTOEXISTINGRENDERERS || pvContext) {
return E_INVALIDARG;
}
HRESULT hr;
- if(dwFlags & AM_RENDEREX_RENDERTOEXISTINGRENDERERS) {
+ if (dwFlags & AM_RENDEREX_RENDERTOEXISTINGRENDERERS) {
CInterfaceList<IBaseFilter> pBFs;
BeginEnumFilters(this, pEF, pBF) {
- if(CComQIPtr<IAMFilterMiscFlags> pAMMF = pBF) {
- if(pAMMF->GetMiscFlags() & AM_FILTER_MISC_FLAGS_IS_RENDERER) {
+ if (CComQIPtr<IAMFilterMiscFlags> pAMMF = pBF) {
+ if (pAMMF->GetMiscFlags() & AM_FILTER_MISC_FLAGS_IS_RENDERER) {
pBFs.AddTail(pBF);
}
} else {
BeginEnumPins(pBF, pEP, pPin) {
CComPtr<IPin> pPinIn;
DWORD size = 1;
- if(SUCCEEDED(pPin->QueryInternalConnections(&pPinIn, &size)) && size == 0) {
+ if (SUCCEEDED(pPin->QueryInternalConnections(&pPinIn, &size)) && size == 0) {
pBFs.AddTail(pBF);
break;
}
@@ -999,8 +999,8 @@ STDMETHODIMP CFGManager::RenderEx(IPin* pPinOut, DWORD dwFlags, DWORD* pvContext }
EndEnumFilters;
- while(!pBFs.IsEmpty()) {
- if(SUCCEEDED(hr = ConnectFilter(pPinOut, pBFs.RemoveHead()))) {
+ while (!pBFs.IsEmpty()) {
+ if (SUCCEEDED(hr = ConnectFilter(pPinOut, pBFs.RemoveHead()))) {
return hr;
}
}
@@ -1020,7 +1020,7 @@ STDMETHODIMP CFGManager::IsPinDirection(IPin* pPin, PIN_DIRECTION dir1) CheckPointer(pPin, E_POINTER);
PIN_DIRECTION dir2;
- if(FAILED(pPin->QueryDirection(&dir2))) {
+ if (FAILED(pPin->QueryDirection(&dir2))) {
return E_FAIL;
}
@@ -1043,23 +1043,23 @@ STDMETHODIMP CFGManager::ConnectFilter(IBaseFilter* pBF, IPin* pPinIn) CheckPointer(pBF, E_POINTER);
- if(pPinIn && S_OK != IsPinDirection(pPinIn, PINDIR_INPUT)) {
+ if (pPinIn && S_OK != IsPinDirection(pPinIn, PINDIR_INPUT)) {
return VFW_E_INVALID_DIRECTION;
}
int nTotal = 0, nRendered = 0;
BeginEnumPins(pBF, pEP, pPin) {
- if(GetPinName(pPin)[0] != '~'
+ if (GetPinName(pPin)[0] != '~'
&& S_OK == IsPinDirection(pPin, PINDIR_OUTPUT)
&& S_OK != IsPinConnected(pPin)) {
m_streampath.Append(pBF, pPin);
HRESULT hr = Connect(pPin, pPinIn);
- if(SUCCEEDED(hr)) {
- for(int i = m_deadends.GetCount()-1; i >= 0; i--)
- if(m_deadends[i]->Compare(m_streampath)) {
+ if (SUCCEEDED(hr)) {
+ for (int i = m_deadends.GetCount()-1; i >= 0; i--)
+ if (m_deadends[i]->Compare(m_streampath)) {
m_deadends.RemoveAt(i);
}
@@ -1070,7 +1070,7 @@ STDMETHODIMP CFGManager::ConnectFilter(IBaseFilter* pBF, IPin* pPinIn) m_streampath.RemoveTail();
- if(SUCCEEDED(hr) && pPinIn) {
+ if (SUCCEEDED(hr) && pPinIn) {
return S_OK;
}
}
@@ -1090,16 +1090,16 @@ STDMETHODIMP CFGManager::ConnectFilter(IPin* pPinOut, IBaseFilter* pBF) CheckPointer(pPinOut, E_POINTER);
CheckPointer(pBF, E_POINTER);
- if(S_OK != IsPinDirection(pPinOut, PINDIR_OUTPUT)) {
+ if (S_OK != IsPinDirection(pPinOut, PINDIR_OUTPUT)) {
return VFW_E_INVALID_DIRECTION;
}
BeginEnumPins(pBF, pEP, pPin) {
- if(GetPinName(pPin)[0] != '~'
+ if (GetPinName(pPin)[0] != '~'
&& S_OK == IsPinDirection(pPin, PINDIR_INPUT)
&& S_OK != IsPinConnected(pPin)) {
HRESULT hr = Connect(pPinOut, pPin);
- if(SUCCEEDED(hr)) {
+ if (SUCCEEDED(hr)) {
return hr;
}
}
@@ -1116,16 +1116,16 @@ STDMETHODIMP CFGManager::ConnectFilterDirect(IPin* pPinOut, IBaseFilter* pBF, co CheckPointer(pPinOut, E_POINTER);
CheckPointer(pBF, E_POINTER);
- if(S_OK != IsPinDirection(pPinOut, PINDIR_OUTPUT)) {
+ if (S_OK != IsPinDirection(pPinOut, PINDIR_OUTPUT)) {
return VFW_E_INVALID_DIRECTION;
}
BeginEnumPins(pBF, pEP, pPin) {
- if(GetPinName(pPin)[0] != '~'
+ if (GetPinName(pPin)[0] != '~'
&& S_OK == IsPinDirection(pPin, PINDIR_INPUT)
&& S_OK != IsPinConnected(pPin)) {
HRESULT hr = ConnectDirect(pPinOut, pPin, pmt);
- if(SUCCEEDED(hr)) {
+ if (SUCCEEDED(hr)) {
return hr;
}
}
@@ -1139,16 +1139,16 @@ STDMETHODIMP CFGManager::NukeDownstream(IUnknown* pUnk) {
CAutoLock cAutoLock(this);
- if(CComQIPtr<IBaseFilter> pBF = pUnk) {
+ if (CComQIPtr<IBaseFilter> pBF = pUnk) {
BeginEnumPins(pBF, pEP, pPin) {
NukeDownstream(pPin);
}
EndEnumPins;
- } else if(CComQIPtr<IPin> pPin = pUnk) {
+ } else if (CComQIPtr<IPin> pPin = pUnk) {
CComPtr<IPin> pPinTo;
- if(S_OK == IsPinDirection(pPin, PINDIR_OUTPUT)
+ if (S_OK == IsPinDirection(pPin, PINDIR_OUTPUT)
&& SUCCEEDED(pPin->ConnectedTo(&pPinTo)) && pPinTo) {
- if(CComPtr<IBaseFilter> pBF = GetFilterFromPin(pPinTo)) {
+ if (CComPtr<IBaseFilter> pBF = GetFilterFromPin(pPinTo)) {
NukeDownstream(pBF);
Disconnect(pPinTo);
Disconnect(pPin);
@@ -1168,9 +1168,9 @@ STDMETHODIMP CFGManager::FindInterface(REFIID iid, void** ppv, BOOL bRemove) CheckPointer(ppv, E_POINTER);
- for(POSITION pos = m_pUnks.GetHeadPosition(); pos; m_pUnks.GetNext(pos)) {
- if(SUCCEEDED(m_pUnks.GetAt(pos)->QueryInterface(iid, ppv))) {
- if(bRemove) {
+ for (POSITION pos = m_pUnks.GetHeadPosition(); pos; m_pUnks.GetNext(pos)) {
+ if (SUCCEEDED(m_pUnks.GetAt(pos)->QueryInterface(iid, ppv))) {
+ if (bRemove) {
m_pUnks.RemoveAt(pos);
}
return S_OK;
@@ -1186,7 +1186,7 @@ STDMETHODIMP CFGManager::AddToROT() HRESULT hr;
- if(m_dwRegister) {
+ if (m_dwRegister) {
return S_FALSE;
}
@@ -1194,7 +1194,7 @@ STDMETHODIMP CFGManager::AddToROT() CComPtr<IMoniker> pMoniker;
WCHAR wsz[256];
swprintf(wsz, L"FilterGraph %08p pid %08x (MPC)", (DWORD_PTR)this, GetCurrentProcessId());
- if(SUCCEEDED(hr = GetRunningObjectTable(0, &pROT))
+ if (SUCCEEDED(hr = GetRunningObjectTable(0, &pROT))
&& SUCCEEDED(hr = CreateItemMoniker(L"!", wsz, &pMoniker))) {
hr = pROT->Register(ROTFLAGS_REGISTRATIONKEEPSALIVE, (IGraphBuilder2*)this, pMoniker, &m_dwRegister);
}
@@ -1208,12 +1208,12 @@ STDMETHODIMP CFGManager::RemoveFromROT() HRESULT hr;
- if(!m_dwRegister) {
+ if (!m_dwRegister) {
return S_FALSE;
}
CComPtr<IRunningObjectTable> pROT;
- if(SUCCEEDED(hr = GetRunningObjectTable(0, &pROT))
+ if (SUCCEEDED(hr = GetRunningObjectTable(0, &pROT))
&& SUCCEEDED(hr = pROT->Revoke(m_dwRegister))) {
m_dwRegister = 0;
}
@@ -1234,7 +1234,7 @@ STDMETHODIMP CFGManager::GetDeadEnd(int iIndex, CAtlList<CStringW>& path, CAtlLi {
CAutoLock cAutoLock(this);
- if(iIndex < 0 || iIndex >= m_deadends.GetCount()) {
+ if (iIndex < 0 || iIndex >= m_deadends.GetCount()) {
return E_FAIL;
}
@@ -1242,7 +1242,7 @@ STDMETHODIMP CFGManager::GetDeadEnd(int iIndex, CAtlList<CStringW>& path, CAtlLi mts.RemoveAll();
POSITION pos = m_deadends[iIndex]->GetHeadPosition();
- while(pos) {
+ while (pos) {
const path_t& p = m_deadends[iIndex]->GetNext(pos);
CStringW str;
@@ -1275,7 +1275,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) // Source filters
#if INTERNAL_SOURCEFILTER_SHOUTCAST
- if(src[SRC_SHOUTCAST]) {
+ if (src[SRC_SHOUTCAST]) {
pFGF = DNew CFGFilterInternal<CShoutcastSource>();
pFGF->m_protocols.AddTail(_T("http"));
m_source.AddTail(pFGF);
@@ -1283,7 +1283,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_UDP
- // if(src[SRC_UDP])
+ // if (src[SRC_UDP])
{
pFGF = DNew CFGFilterInternal<CUDPReader>();
pFGF->m_protocols.AddTail(_T("udp"));
@@ -1292,7 +1292,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_AVI
- if(src[SRC_AVI]) {
+ if (src[SRC_AVI]) {
pFGF = DNew CFGFilterInternal<CAviSourceFilter>();
pFGF->m_chkbytes.AddTail(_T("0,4,,52494646,8,4,,41564920"));
pFGF->m_chkbytes.AddTail(_T("0,4,,52494646,8,4,,41564958"));
@@ -1301,7 +1301,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_MP4
- if(src[SRC_MP4]) {
+ if (src[SRC_MP4]) {
pFGF = DNew CFGFilterInternal<CMP4SourceFilter>();
pFGF->m_chkbytes.AddTail(_T("4,4,,66747970")); // ftyp
pFGF->m_chkbytes.AddTail(_T("4,4,,6d6f6f76")); // moov
@@ -1315,7 +1315,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_FLV
- if(src[SRC_FLV]) {
+ if (src[SRC_FLV]) {
pFGF = DNew CFGFilterInternal<CFLVSourceFilter>();
pFGF->m_chkbytes.AddTail(_T("0,4,,464C5601")); // FLV (v1)
m_source.AddTail(pFGF);
@@ -1323,7 +1323,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_MATROSKA
- if(src[SRC_MATROSKA]) {
+ if (src[SRC_MATROSKA]) {
pFGF = DNew CFGFilterInternal<CMatroskaSourceFilter>();
pFGF->m_chkbytes.AddTail(_T("0,4,,1A45DFA3"));
m_source.AddTail(pFGF);
@@ -1331,7 +1331,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_REALMEDIA
- if(src[SRC_REALMEDIA]) {
+ if (src[SRC_REALMEDIA]) {
pFGF = DNew CFGFilterInternal<CRealMediaSourceFilter>();
pFGF->m_chkbytes.AddTail(_T("0,4,,2E524D46"));
m_source.AddTail(pFGF);
@@ -1339,7 +1339,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_DSM
- if(src[SRC_DSM]) {
+ if (src[SRC_DSM]) {
pFGF = DNew CFGFilterInternal<CDSMSourceFilter>();
pFGF->m_chkbytes.AddTail(_T("0,4,,44534D53"));
m_source.AddTail(pFGF);
@@ -1347,7 +1347,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_FLIC
- if(src[SRC_FLIC]) {
+ if (src[SRC_FLIC]) {
pFGF = DNew CFGFilterInternal<CFLICSource>();
pFGF->m_chkbytes.AddTail(_T("4,2,,11AF"));
pFGF->m_chkbytes.AddTail(_T("4,2,,12AF"));
@@ -1358,7 +1358,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_FLAC
- if(src[SRC_FLAC]) {
+ if (src[SRC_FLAC]) {
pFGF = DNew CFGFilterInternal<CFlacSource>();
pFGF->m_chkbytes.AddTail(_T("0,4,,664C6143"));
pFGF->m_extensions.AddTail(_T(".flac"));
@@ -1367,7 +1367,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_CDDA
- if(src[SRC_CDDA]) {
+ if (src[SRC_CDDA]) {
pFGF = DNew CFGFilterInternal<CCDDAReader>();
pFGF->m_extensions.AddTail(_T(".cda"));
m_source.AddTail(pFGF);
@@ -1375,7 +1375,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_CDXA
- if(src[SRC_CDXA]) {
+ if (src[SRC_CDXA]) {
pFGF = DNew CFGFilterInternal<CCDXAReader>();
pFGF->m_chkbytes.AddTail(_T("0,4,,52494646,8,4,,43445841"));
m_source.AddTail(pFGF);
@@ -1383,7 +1383,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_VTS
- if(src[SRC_VTS]) {
+ if (src[SRC_VTS]) {
pFGF = DNew CFGFilterInternal<CVTSReader>();
pFGF->m_chkbytes.AddTail(_T("0,12,,445644564944454F2D565453"));
m_source.AddTail(pFGF);
@@ -1394,7 +1394,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) // TODOX64 : fix DVSource internal filter
#ifndef _WIN64
__if_exists(CD2VSource) {
- if(src[SRC_D2V]) {
+ if (src[SRC_D2V]) {
pFGF = DNew CFGFilterInternal<CD2VSource>();
pFGF->m_chkbytes.AddTail(_T("0,18,,4456443241564950726F6A65637446696C65"));
pFGF->m_extensions.AddTail(_T(".d2v"));
@@ -1405,7 +1405,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_OGG
- if(src[SRC_OGG]) {
+ if (src[SRC_OGG]) {
pFGF = DNew CFGFilterInternal<COggSourceFilter>();
pFGF->m_chkbytes.AddTail(_T("0,4,,4F676753"));
m_source.AddTail(pFGF);
@@ -1413,7 +1413,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_MPEG
- if(src[SRC_MPEG]) {
+ if (src[SRC_MPEG]) {
pFGF = DNew CFGFilterInternal<CMpegSourceFilter>();
pFGF->m_chkbytes.AddTail(_T("0,16,FFFFFFFFF100010001800001FFFFFFFF,000001BA2100010001800001000001BB"));
pFGF->m_chkbytes.AddTail(_T("0,5,FFFFFFFFC0,000001BA40"));
@@ -1428,7 +1428,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_DTSAC3
- if(src[SRC_DTSAC3]) {
+ if (src[SRC_DTSAC3]) {
pFGF = DNew CFGFilterInternal<CDTSAC3Source>();
pFGF->m_chkbytes.AddTail(_T("0,4,,7FFE8001"));
pFGF->m_chkbytes.AddTail(_T("0,2,,0B77"));
@@ -1440,7 +1440,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_MPEGAUDIO
- if(src[SRC_MPA]) {
+ if (src[SRC_MPA]) {
pFGF = DNew CFGFilterInternal<CMpaSourceFilter>();
pFGF->m_chkbytes.AddTail(_T("0,2,FFE0,FFE0"));
pFGF->m_chkbytes.AddTail(_T("0,10,FFFFFF00000080808080,49443300000000000000"));
@@ -1448,7 +1448,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) }
#endif
- if(AfxGetAppSettings().fUseWMASFReader) {
+ if (AfxGetAppSettings().fUseWMASFReader) {
pFGF = DNew CFGFilterRegistry(CLSID_WMAsfReader);
pFGF->m_chkbytes.AddTail(_T("0,4,,3026B275"));
pFGF->m_chkbytes.AddTail(_T("0,4,,D129E2D6"));
@@ -1464,7 +1464,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_MATROSKA
- if(src[SRC_MATROSKA]) {
+ if (src[SRC_MATROSKA]) {
pFGF = DNew CFGFilterInternal<CMatroskaSplitterFilter>(L"Matroska Splitter", MERIT64_ABOVE_DSHOW);
} else {
pFGF = DNew CFGFilterInternal<CMatroskaSplitterFilter>(L"Matroska Splitter (low merit)", MERIT64_DO_USE);
@@ -1475,7 +1475,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_REALMEDIA
- if(src[SRC_REALMEDIA]) {
+ if (src[SRC_REALMEDIA]) {
pFGF = DNew CFGFilterInternal<CRealMediaSplitterFilter>(L"RealMedia Splitter", MERIT64_ABOVE_DSHOW);
} else {
pFGF = DNew CFGFilterInternal<CRealMediaSplitterFilter>(L"RealMedia Splitter (low merit)", MERIT64_DO_USE);
@@ -1486,7 +1486,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_AVI
- if(src[SRC_AVI]) {
+ if (src[SRC_AVI]) {
pFGF = DNew CFGFilterInternal<CAviSplitterFilter>(L"Avi Splitter", MERIT64_ABOVE_DSHOW);
} else {
pFGF = DNew CFGFilterInternal<CAviSplitterFilter>(L"Avi Splitter (low merit)", MERIT64_DO_USE);
@@ -1497,7 +1497,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_OGG
- if(src[SRC_OGG]) {
+ if (src[SRC_OGG]) {
pFGF = DNew CFGFilterInternal<COggSplitterFilter>(L"Ogg Splitter", MERIT64_ABOVE_DSHOW);
} else {
pFGF = DNew CFGFilterInternal<COggSplitterFilter>(L"Ogg Splitter (low merit)", MERIT64_DO_USE);
@@ -1508,7 +1508,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_MPEG
- if(src[SRC_MPEG]) {
+ if (src[SRC_MPEG]) {
pFGF = DNew CFGFilterInternal<CMpegSplitterFilter>(L"Mpeg Splitter", MERIT64_ABOVE_DSHOW);
} else {
pFGF = DNew CFGFilterInternal<CMpegSplitterFilter>(L"Mpeg Splitter (low merit)", MERIT64_DO_USE);
@@ -1522,7 +1522,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_MPEGAUDIO
- if(src[SRC_MPA]) {
+ if (src[SRC_MPA]) {
pFGF = DNew CFGFilterInternal<CMpaSplitterFilter>(L"Mpa Splitter", MERIT64_ABOVE_DSHOW);
} else {
pFGF = DNew CFGFilterInternal<CMpaSplitterFilter>(L"Mpa Splitter (low merit)", MERIT64_DO_USE);
@@ -1533,7 +1533,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_DSM
- if(src[SRC_DSM]) {
+ if (src[SRC_DSM]) {
pFGF = DNew CFGFilterInternal<CDSMSplitterFilter>(L"DSM Splitter", MERIT64_ABOVE_DSHOW);
} else {
pFGF = DNew CFGFilterInternal<CDSMSplitterFilter>(L"DSM Splitter (low merit)", MERIT64_DO_USE);
@@ -1544,7 +1544,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_MP4
- if(src[SRC_MP4]) {
+ if (src[SRC_MP4]) {
pFGF = DNew CFGFilterInternal<CMP4SplitterFilter>(L"MP4 Splitter", MERIT64_ABOVE_DSHOW);
} else {
pFGF = DNew CFGFilterInternal<CMP4SplitterFilter>(L"MP4 Splitter (low merit)", MERIT64_DO_USE);
@@ -1555,7 +1555,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) #endif
#if INTERNAL_SOURCEFILTER_FLV
- if(src[SRC_FLV]) {
+ if (src[SRC_FLV]) {
pFGF = DNew CFGFilterInternal<CFLVSplitterFilter>(L"FLV Splitter", MERIT64_ABOVE_DSHOW);
} else {
pFGF = DNew CFGFilterInternal<CFLVSplitterFilter>(L"FLV Splitter (low merit)", MERIT64_DO_USE);
@@ -2149,7 +2149,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) CMPCVideoDecFilter::DXVAFilters = (HAS_DXVA_VIDEO_DECODERS) ? s.DXVAFilters : NULL;
CMPCVideoDecFilter::m_ref_frame_count_check_skip = false;
- if((!IsVistaOrAbove()) && ((s.iDSVideoRendererType == VIDRNDT_DS_DEFAULT) || (s.iDSVideoRendererType == VIDRNDT_DS_DXR))) {
+ if ((!IsVistaOrAbove()) && ((s.iDSVideoRendererType == VIDRNDT_DS_DEFAULT) || (s.iDSVideoRendererType == VIDRNDT_DS_DXR))) {
CMPCVideoDecFilter::m_ref_frame_count_check_skip = true;
}
#endif
@@ -2187,7 +2187,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) CString clsid = _T("{B38C58A0-1809-11D6-A458-EDAE78F1DF12}");
- if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("CLSID\\") + clsid + _T("\\InprocServer32"), KEY_READ)
+ if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("CLSID\\") + clsid + _T("\\InprocServer32"), KEY_READ)
&& ERROR_SUCCESS == key.QueryStringValue(NULL, buff, &len)
&& GetFileVersion(buff) < 0x0001000000030000ui64) {
m_transform.AddTail(DNew CFGFilterRegistry(GUIDFromCString(clsid), MERIT64_DO_NOT_USE));
@@ -2203,8 +2203,8 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) m_transform.AddTail(DNew CFGFilterRegistry(GUIDFromCString(_T("{272D77A0-A852-4851-ADA4-9091FEAD4C86}")), MERIT64_DO_NOT_USE));
// Block VSFilter when internal subtitle renderer will get used
- if(s.fAutoloadSubtitles && s.fBlockVSFilter) {
- if(s.iDSVideoRendererType == VIDRNDT_DS_VMR7RENDERLESS || s.iDSVideoRendererType == VIDRNDT_DS_VMR9RENDERLESS || s.iDSVideoRendererType == VIDRNDT_DS_EVR_CUSTOM || s.iDSVideoRendererType == VIDRNDT_DS_DXR || s.iDSVideoRendererType == VIDRNDT_DS_SYNC || s.iDSVideoRendererType == VIDRNDT_DS_MADVR) {
+ if (s.fAutoloadSubtitles && s.fBlockVSFilter) {
+ if (s.iDSVideoRendererType == VIDRNDT_DS_VMR7RENDERLESS || s.iDSVideoRendererType == VIDRNDT_DS_VMR9RENDERLESS || s.iDSVideoRendererType == VIDRNDT_DS_EVR_CUSTOM || s.iDSVideoRendererType == VIDRNDT_DS_DXR || s.iDSVideoRendererType == VIDRNDT_DS_SYNC || s.iDSVideoRendererType == VIDRNDT_DS_MADVR) {
m_transform.AddTail(DNew CFGFilterRegistry(GUIDFromCString(_T("{9852A670-F845-491B-9BE6-EBD841B8A613}")), MERIT64_DO_NOT_USE));
}
}
@@ -2214,14 +2214,14 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) WORD merit_low = 1;
POSITION pos = s.m_filters.GetTailPosition();
- while(pos) {
+ while (pos) {
FilterOverride* fo = s.m_filters.GetPrev(pos);
if (!fo->fDisabled && fo->name == _T("Broadcom Video Decoder")) {
bOverrideBroadcom = true;
}
- if(fo->fDisabled || fo->type == FilterOverride::EXTERNAL && !CPath(MakeFullPath(fo->path)).FileExists()) {
+ if (fo->fDisabled || fo->type == FilterOverride::EXTERNAL && !CPath(MakeFullPath(fo->path)).FileExists()) {
continue;
}
@@ -2234,13 +2234,13 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) CFGFilter* pFGF = NULL;
- if(fo->type == FilterOverride::REGISTERED) {
+ if (fo->type == FilterOverride::REGISTERED) {
pFGF = DNew CFGFilterRegistry(fo->dispname, merit);
- } else if(fo->type == FilterOverride::EXTERNAL) {
+ } else if (fo->type == FilterOverride::EXTERNAL) {
pFGF = DNew CFGFilterFile(fo->clsid, fo->path, CStringW(fo->name), merit);
}
- if(pFGF) {
+ if (pFGF) {
pFGF->SetTypes(fo->guids);
m_override.AddTail(pFGF);
}
@@ -2281,20 +2281,20 @@ STDMETHODIMP CFGManagerCustom::AddFilter(IBaseFilter* pBF, LPCWSTR pName) HRESULT hr;
- if(FAILED(hr = __super::AddFilter(pBF, pName))) {
+ if (FAILED(hr = __super::AddFilter(pBF, pName))) {
return hr;
}
AppSettings& s = AfxGetAppSettings();
- if(GetCLSID(pBF) == CLSID_DMOWrapperFilter) {
- if(CComQIPtr<IPropertyBag> pPB = pBF) {
+ if (GetCLSID(pBF) == CLSID_DMOWrapperFilter) {
+ if (CComQIPtr<IPropertyBag> pPB = pBF) {
CComVariant var(true);
pPB->Write(CComBSTR(L"_HIRESOUTPUT"), &var);
}
}
- if(CComQIPtr<IAudioSwitcherFilter> pASF = pBF) {
+ if (CComQIPtr<IAudioSwitcherFilter> pASF = pBF) {
pASF->EnableDownSamplingTo441(s.fDownSampleTo441);
pASF->SetSpeakerConfig(s.fCustomChannelMapping, s.pSpeakerToChannelMap);
pASF->SetAudioTimeShift(s.fAudioTimeShift ? 10000i64*s.iAudioTimeShift : 0);
@@ -2319,14 +2319,14 @@ CFGManagerPlayer::CFGManagerPlayer(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd) AppSettings& s = AfxGetAppSettings();
- if(m_pFM) {
+ if (m_pFM) {
CComPtr<IEnumMoniker> pEM;
GUID guids[] = {MEDIATYPE_Video, MEDIASUBTYPE_NULL};
- if(SUCCEEDED(m_pFM->EnumMatchingFilters(&pEM, 0, FALSE, MERIT_DO_NOT_USE+1,
+ if (SUCCEEDED(m_pFM->EnumMatchingFilters(&pEM, 0, FALSE, MERIT_DO_NOT_USE+1,
TRUE, 1, guids, NULL, NULL, TRUE, FALSE, 0, NULL, NULL, NULL))) {
- for(CComPtr<IMoniker> pMoniker; S_OK == pEM->Next(1, &pMoniker, NULL); pMoniker = NULL) {
+ for (CComPtr<IMoniker> pMoniker; S_OK == pEM->Next(1, &pMoniker, NULL); pMoniker = NULL) {
CFGFilterRegistry f(pMoniker);
m_vrmerit = max(m_vrmerit, f.GetMerit());
}
@@ -2335,14 +2335,14 @@ CFGManagerPlayer::CFGManagerPlayer(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd) m_vrmerit += 0x100;
}
- if(m_pFM) {
+ if (m_pFM) {
CComPtr<IEnumMoniker> pEM;
GUID guids[] = {MEDIATYPE_Audio, MEDIASUBTYPE_NULL};
- if(SUCCEEDED(m_pFM->EnumMatchingFilters(&pEM, 0, FALSE, MERIT_DO_NOT_USE+1,
+ if (SUCCEEDED(m_pFM->EnumMatchingFilters(&pEM, 0, FALSE, MERIT_DO_NOT_USE+1,
TRUE, 1, guids, NULL, NULL, TRUE, FALSE, 0, NULL, NULL, NULL))) {
- for(CComPtr<IMoniker> pMoniker; S_OK == pEM->Next(1, &pMoniker, NULL); pMoniker = NULL) {
+ for (CComPtr<IMoniker> pMoniker; S_OK == pEM->Next(1, &pMoniker, NULL); pMoniker = NULL) {
CFGFilterRegistry f(pMoniker);
m_armerit = max(m_armerit, f.GetMerit());
}
@@ -2359,7 +2359,7 @@ CFGManagerPlayer::CFGManagerPlayer(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd) // Switchers
- if(s.fEnableAudioSwitcher) {
+ if (s.fEnableAudioSwitcher) {
pFGF = DNew CFGFilterInternal<CAudioSwitcherFilter>(L"Audio Switcher", m_armerit + 0x100);
pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_NULL);
m_transform.AddTail(pFGF);
@@ -2370,7 +2370,7 @@ CFGManagerPlayer::CFGManagerPlayer(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd) // Renderers
- switch(s.iDSVideoRendererType) {
+ switch (s.iDSVideoRendererType) {
case VIDRNDT_DS_OLDRENDERER:
m_transform.AddTail(DNew CFGFilterRegistry(CLSID_VideoRenderer, m_vrmerit));
break;
@@ -2417,19 +2417,19 @@ CFGManagerPlayer::CFGManagerPlayer(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd) }
CString SelAudioRenderer = s.SelectedAudioRenderer();
- if(SelAudioRenderer == AUDRNDT_NULL_COMP) {
+ if (SelAudioRenderer == AUDRNDT_NULL_COMP) {
pFGF = DNew CFGFilterInternal<CNullAudioRenderer>(AUDRNDT_NULL_COMP, MERIT64_ABOVE_DSHOW+2);
pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_NULL);
m_transform.AddTail(pFGF);
- } else if(SelAudioRenderer == AUDRNDT_NULL_UNCOMP) {
+ } else if (SelAudioRenderer == AUDRNDT_NULL_UNCOMP) {
pFGF = DNew CFGFilterInternal<CNullUAudioRenderer>(AUDRNDT_NULL_UNCOMP, MERIT64_ABOVE_DSHOW+2);
pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_NULL);
m_transform.AddTail(pFGF);
- } else if(SelAudioRenderer == AUDRNDT_MPC) {
+ } else if (SelAudioRenderer == AUDRNDT_MPC) {
pFGF = DNew CFGFilterInternal<CMpcAudioRenderer>(AUDRNDT_MPC, MERIT64_ABOVE_DSHOW+2);
pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_NULL);
m_transform.AddTail(pFGF);
- } else if(SelAudioRenderer!="") {
+ } else if (SelAudioRenderer!="") {
pFGF = DNew CFGFilterRegistry(SelAudioRenderer, m_armerit);
pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_NULL);
m_transform.AddTail(pFGF);
@@ -2440,10 +2440,10 @@ STDMETHODIMP CFGManagerPlayer::ConnectDirect(IPin* pPinOut, IPin* pPinIn, const {
CAutoLock cAutoLock(this);
- if(GetCLSID(pPinOut) == CLSID_MPEG2Demultiplexer) {
+ if (GetCLSID(pPinOut) == CLSID_MPEG2Demultiplexer) {
CComQIPtr<IMediaSeeking> pMS = pPinOut;
REFERENCE_TIME rtDur = 0;
- if(!pMS || FAILED(pMS->GetDuration(&rtDur)) || rtDur <= 0) {
+ if (!pMS || FAILED(pMS->GetDuration(&rtDur)) || rtDur <= 0) {
return E_FAIL;
}
}
@@ -2461,7 +2461,7 @@ CFGManagerDVD::CFGManagerDVD(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd) AppSettings& s = AfxGetAppSettings();
// have to avoid the old video renderer
- if(s.iDSVideoRendererType == VIDRNDT_DS_OLDRENDERER) {
+ if (s.iDSVideoRendererType == VIDRNDT_DS_OLDRENDERER) {
m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_OverlayMixer, L"Overlay Mixer", m_vrmerit-1));
}
@@ -2475,8 +2475,8 @@ class CResetDVD : public CDVDSession {
public:
CResetDVD(LPCTSTR path) {
- if(Open(path)) {
- if(BeginSession()) {
+ if (Open(path)) {
+ if (BeginSession()) {
Authenticate(); /*GetDiscKey();*/
EndSession();
}
@@ -2492,7 +2492,7 @@ STDMETHODIMP CFGManagerDVD::RenderFile(LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPlayL HRESULT hr;
CComPtr<IBaseFilter> pBF;
- if(FAILED(hr = AddSourceFilter(lpcwstrFile, lpcwstrFile, &pBF))) {
+ if (FAILED(hr = AddSourceFilter(lpcwstrFile, lpcwstrFile, &pBF))) {
return hr;
}
@@ -2515,7 +2515,7 @@ STDMETHODIMP CFGManagerDVD::AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpc GUID clsid = ext == L".ratdvd" ? GUIDFromCString(_T("{482d10b6-376e-4411-8a17-833800A065DB}")) : CLSID_DVDNavigator;
CComPtr<IBaseFilter> pBF;
- if(FAILED(hr = pBF.CoCreateInstance(clsid))
+ if (FAILED(hr = pBF.CoCreateInstance(clsid))
|| FAILED(hr = AddFilter(pBF, L"DVD Navigator"))) {
return VFW_E_CANNOT_LOAD_SOURCE_FILTER;
}
@@ -2523,13 +2523,13 @@ STDMETHODIMP CFGManagerDVD::AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpc CComQIPtr<IDvdControl2> pDVDC;
CComQIPtr<IDvdInfo2> pDVDI;
- if(!((pDVDC = pBF) && (pDVDI = pBF))) {
+ if (!((pDVDC = pBF) && (pDVDI = pBF))) {
return E_NOINTERFACE;
}
WCHAR buff[_MAX_PATH];
ULONG len;
- if((!fn.IsEmpty()
+ if ((!fn.IsEmpty()
&& FAILED(hr = pDVDC->SetDVDDirectory(fn))
&& FAILED(hr = pDVDC->SetDVDDirectory(fn + L"VIDEO_TS"))
&& FAILED(hr = pDVDC->SetDVDDirectory(fn + L"\\VIDEO_TS")))
@@ -2540,7 +2540,7 @@ STDMETHODIMP CFGManagerDVD::AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpc pDVDC->SetOption(DVD_ResetOnStop, FALSE);
pDVDC->SetOption(DVD_HMSF_TimeCodeEvents, TRUE);
- if(clsid == CLSID_DVDNavigator) {
+ if (clsid == CLSID_DVDNavigator) {
CResetDVD(CString(buff));
}
diff --git a/src/apps/mplayerc/FGManagerBDA.cpp b/src/apps/mplayerc/FGManagerBDA.cpp index 2d0ee5b81..6883c87fe 100644 --- a/src/apps/mplayerc/FGManagerBDA.cpp +++ b/src/apps/mplayerc/FGManagerBDA.cpp @@ -1,7 +1,7 @@ /*
* $Id$
*
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -270,9 +270,9 @@ CFGManagerBDA::CFGManagerBDA(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd) // Hack : remove audio switcher !
POSITION pos = m_transform.GetHeadPosition();
- while(pos) {
+ while (pos) {
CFGFilter* pFGF = m_transform.GetAt(pos);
- if(pFGF->GetCLSID() == __uuidof(CAudioSwitcherFilter)) {
+ if (pFGF->GetCLSID() == __uuidof(CAudioSwitcherFilter)) {
m_transform.RemoveAt (pos);
delete pFGF;
break;
@@ -361,10 +361,10 @@ HRESULT CFGManagerBDA::ConnectFilters(IBaseFilter* pOutFiter, IBaseFilter* pInFi {
HRESULT hr = VFW_E_CANNOT_CONNECT;
BeginEnumPins(pOutFiter, pEP, pOutPin) {
- if(S_OK == IsPinDirection(pOutPin, PINDIR_OUTPUT)
+ if (S_OK == IsPinDirection(pOutPin, PINDIR_OUTPUT)
&& S_OK != IsPinConnected(pOutPin)) {
BeginEnumPins(pInFilter, pEP, pInPin) {
- if(S_OK == IsPinDirection(pInPin, PINDIR_INPUT)
+ if (S_OK == IsPinDirection(pInPin, PINDIR_INPUT)
&& S_OK != IsPinConnected(pInPin)) {
hr = this->ConnectDirect(pOutPin, pInPin, NULL);
@@ -553,7 +553,7 @@ STDMETHODIMP CFGManagerBDA::Scan(ULONG ulFrequency, HWND hWnd) Parser.ParseNIT();
POSITION pos = Parser.Channels.GetStartPosition();
- while(pos) {
+ while (pos) {
CDVBChannel& Channel = Parser.Channels.GetNextValue(pos);
if (Channel.HasName()) {
::SendMessage (hWnd, WM_TUNER_NEW_CHANNEL, 0, (LPARAM)(LPCTSTR)Channel.ToString());
@@ -641,46 +641,46 @@ STDMETHODIMP CFGManagerBDA::Info(long lIndex, AM_MEDIA_TYPE** ppmt, DWORD* pdwFl if (lIndex>=0 && lIndex < pChannel->GetAudioCount()) {
pCurrentStream = &m_DVBStreams[m_nCurAudioType];
pStreamInfo = pChannel->GetAudio(lIndex);
- if(pStreamInfo) {
+ if (pStreamInfo) {
pStream = &m_DVBStreams[pStreamInfo->Type];
}
- if(pdwGroup) {
+ if (pdwGroup) {
*pdwGroup = 1; // Audio group
}
} else if (lIndex > 0 && lIndex < pChannel->GetAudioCount()+pChannel->GetSubtitleCount()) {
pCurrentStream = &m_DVBStreams[DVB_SUB];
pStreamInfo = pChannel->GetSubtitle(lIndex-pChannel->GetAudioCount());
- if(pStreamInfo) {
+ if (pStreamInfo) {
pStream = &m_DVBStreams[pStreamInfo->Type];
}
- if(pdwGroup) {
+ if (pdwGroup) {
*pdwGroup = 2; // Subtitle group
}
}
if (pStreamInfo && pStream && pCurrentStream) {
- if(ppmt) {
+ if (ppmt) {
*ppmt = CreateMediaType(pStream->GetMediaType());
}
- if(pdwFlags) {
+ if (pdwFlags) {
*pdwFlags = (pCurrentStream->GetMappedPID() == pStreamInfo->PID) ? AMSTREAMSELECTINFO_ENABLED|AMSTREAMSELECTINFO_EXCLUSIVE : 0;
}
- if(plcid) {
+ if (plcid) {
*plcid = pStreamInfo->GetLCID();
}
- if(ppObject) {
+ if (ppObject) {
*ppObject = NULL;
}
- if(ppUnk) {
+ if (ppUnk) {
*ppUnk = NULL;
}
- if(ppszName) {
+ if (ppszName) {
CStringW str;
str = StreamTypeToName(pStreamInfo->PesType);
*ppszName = (WCHAR*)CoTaskMemAlloc((str.GetLength()+1)*sizeof(WCHAR));
- if(*ppszName == NULL) {
+ if (*ppszName == NULL) {
return E_OUTOFMEMORY;
}
wcscpy_s(*ppszName, str.GetLength()+1, str);
diff --git a/src/apps/mplayerc/FGManagerBDA.h b/src/apps/mplayerc/FGManagerBDA.h index 12804ffb3..d9978b82e 100644 --- a/src/apps/mplayerc/FGManagerBDA.h +++ b/src/apps/mplayerc/FGManagerBDA.h @@ -196,7 +196,7 @@ static void LOG(LPCTSTR fmt, ...) TCHAR buff[3000];
FILE* f;
_vstprintf_s(buff, countof(buff), fmt, args);
- if(_tfopen_s(&f, LOG_FILE, _T("at")) == 0) {
+ if (_tfopen_s(&f, LOG_FILE, _T("at")) == 0) {
fseek(f, 0, 2);
_ftprintf(f, _T("%s\n"), buff);
fclose(f);
diff --git a/src/apps/mplayerc/FakeFilterMapper2.cpp b/src/apps/mplayerc/FakeFilterMapper2.cpp index e44b2b34b..739bc587e 100644 --- a/src/apps/mplayerc/FakeFilterMapper2.cpp +++ b/src/apps/mplayerc/FakeFilterMapper2.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -228,24 +228,24 @@ LONG (WINAPI * Real_RegSetValueA)(HKEY a0, LPCSTR a1, DWORD a2, LPCSTR a3, DWORD HRESULT WINAPI Mine_CoCreateInstance(IN REFCLSID rclsid, IN LPUNKNOWN pUnkOuter,
IN DWORD dwClsContext, IN REFIID riid, OUT LPVOID FAR* ppv)
{
- if(CFilterMapper2::m_pFilterMapper2) {
+ if (CFilterMapper2::m_pFilterMapper2) {
CheckPointer(ppv, E_POINTER);
- if(rclsid == CLSID_FilterMapper) {
+ if (rclsid == CLSID_FilterMapper) {
ASSERT(0);
return REGDB_E_CLASSNOTREG; // sorry...
}
- if(rclsid == CLSID_FilterMapper2) {
- if(pUnkOuter) {
+ if (rclsid == CLSID_FilterMapper2) {
+ if (pUnkOuter) {
return CLASS_E_NOAGGREGATION;
}
- if(riid == __uuidof(IUnknown)) {
+ if (riid == __uuidof(IUnknown)) {
CFilterMapper2::m_pFilterMapper2->AddRef();
*ppv = (IUnknown*)CFilterMapper2::m_pFilterMapper2;
return S_OK;
- } else if(riid == __uuidof(IFilterMapper2)) {
+ } else if (riid == __uuidof(IFilterMapper2)) {
CFilterMapper2::m_pFilterMapper2->AddRef();
*ppv = (IFilterMapper2*)CFilterMapper2::m_pFilterMapper2;
return S_OK;
@@ -256,7 +256,7 @@ HRESULT WINAPI Mine_CoCreateInstance(IN REFCLSID rclsid, IN LPUNKNOWN pUnkOuter, }
/* else
{
- if(rclsid == CLSID_FilterMapper2)
+ if (rclsid == CLSID_FilterMapper2)
{
CFilterMapper2* pFM2 = DNew CFilterMapper2(true, false, pUnkOuter);
CComPtr<IUnknown> pUnk = (IUnknown*)pFM2;
@@ -264,15 +264,15 @@ HRESULT WINAPI Mine_CoCreateInstance(IN REFCLSID rclsid, IN LPUNKNOWN pUnkOuter, }
}
*/
- if(!pUnkOuter)
- if(rclsid == CLSID_VideoMixingRenderer || rclsid == CLSID_VideoMixingRenderer9
+ if (!pUnkOuter)
+ if (rclsid == CLSID_VideoMixingRenderer || rclsid == CLSID_VideoMixingRenderer9
|| rclsid == CLSID_VideoRenderer || rclsid == CLSID_VideoRendererDefault
|| rclsid == CLSID_OverlayMixer) { // || rclsid == CLSID_OverlayMixer2 - where is this declared?)
CMacrovisionKicker* pMK = DNew CMacrovisionKicker(NAME("CMacrovisionKicker"), NULL);
CComPtr<IUnknown> pUnk = (IUnknown*)(INonDelegatingUnknown*)pMK;
CComPtr<IUnknown> pInner;
HRESULT hr;
- if(SUCCEEDED(hr = Real_CoCreateInstance(rclsid, pUnk, dwClsContext, __uuidof(IUnknown), (void**)&pInner))) {
+ if (SUCCEEDED(hr = Real_CoCreateInstance(rclsid, pUnk, dwClsContext, __uuidof(IUnknown), (void**)&pInner))) {
pMK->SetInner(pInner);
return pUnk->QueryInterface(riid, ppv);
}
@@ -285,21 +285,21 @@ HRESULT WINAPI Mine_CoCreateInstance(IN REFCLSID rclsid, IN LPUNKNOWN pUnkOuter, LONG WINAPI Mine_RegCloseKey(HKEY a0)
{
- if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
+ if (CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
return ERROR_SUCCESS;
}
return Real_RegCloseKey(a0);
}
LONG WINAPI Mine_RegFlushKey(HKEY a0)
{
- if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
+ if (CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
return ERROR_SUCCESS;
}
return Real_RegFlushKey(a0);
}
LONG WINAPI Mine_RegCreateKeyA(HKEY a0, LPCSTR a1, PHKEY a2)
{
- if(CFilterMapper2::m_pFilterMapper2) {
+ if (CFilterMapper2::m_pFilterMapper2) {
*a2 = FAKEHKEY;
return ERROR_SUCCESS;
}
@@ -307,7 +307,7 @@ LONG WINAPI Mine_RegCreateKeyA(HKEY a0, LPCSTR a1, PHKEY a2) }
LONG WINAPI Mine_RegCreateKeyW(HKEY a0, LPCWSTR a1, PHKEY a2)
{
- if(CFilterMapper2::m_pFilterMapper2) {
+ if (CFilterMapper2::m_pFilterMapper2) {
*a2 = FAKEHKEY;
return ERROR_SUCCESS;
}
@@ -315,7 +315,7 @@ LONG WINAPI Mine_RegCreateKeyW(HKEY a0, LPCWSTR a1, PHKEY a2) }
LONG WINAPI Mine_RegCreateKeyExA(HKEY a0, LPCSTR a1, DWORD a2, LPSTR a3, DWORD a4, REGSAM a5, LPSECURITY_ATTRIBUTES a6, PHKEY a7, LPDWORD a8)
{
- if(CFilterMapper2::m_pFilterMapper2) {
+ if (CFilterMapper2::m_pFilterMapper2) {
*a7 = FAKEHKEY;
return ERROR_SUCCESS;
}
@@ -323,7 +323,7 @@ LONG WINAPI Mine_RegCreateKeyExA(HKEY a0, LPCSTR a1, DWORD a2, LPSTR a3, DWORD a }
LONG WINAPI Mine_RegCreateKeyExW(HKEY a0, LPCWSTR a1, DWORD a2, LPWSTR a3, DWORD a4, REGSAM a5, LPSECURITY_ATTRIBUTES a6, PHKEY a7, LPDWORD a8)
{
- if(CFilterMapper2::m_pFilterMapper2) {
+ if (CFilterMapper2::m_pFilterMapper2) {
*a7 = FAKEHKEY;
return ERROR_SUCCESS;
}
@@ -331,63 +331,63 @@ LONG WINAPI Mine_RegCreateKeyExW(HKEY a0, LPCWSTR a1, DWORD a2, LPWSTR a3, DWORD }
LONG WINAPI Mine_RegDeleteKeyA(HKEY a0, LPCSTR a1)
{
- if(CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {
+ if (CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {
return ERROR_SUCCESS;
}
return Real_RegDeleteKeyA(a0, a1);
}
LONG WINAPI Mine_RegDeleteKeyW(HKEY a0, LPCWSTR a1)
{
- if(CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {
+ if (CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {
return ERROR_SUCCESS;
}
return Real_RegDeleteKeyW(a0, a1);
}
LONG WINAPI Mine_RegDeleteValueA(HKEY a0, LPCSTR a1)
{
- if(CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {
+ if (CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {
return ERROR_SUCCESS;
}
return Real_RegDeleteValueA(a0, a1);
}
LONG WINAPI Mine_RegDeleteValueW(HKEY a0, LPCWSTR a1)
{
- if(CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {
+ if (CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {
return ERROR_SUCCESS;
}
return Real_RegDeleteValueW(a0, a1);
}
LONG WINAPI Mine_RegEnumKeyExA(HKEY a0, DWORD a1, LPSTR a2, LPDWORD a3, LPDWORD a4, LPSTR a5, LPDWORD a6, struct _FILETIME* a7)
{
- if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
+ if (CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
return ERROR_NO_MORE_ITEMS;
}
return Real_RegEnumKeyExA(a0, a1, a2, a3, a4, a5, a6, a7);
}
LONG WINAPI Mine_RegEnumKeyExW(HKEY a0, DWORD a1, LPWSTR a2, LPDWORD a3, LPDWORD a4, LPWSTR a5, LPDWORD a6, struct _FILETIME* a7)
{
- if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
+ if (CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
return ERROR_NO_MORE_ITEMS;
}
return Real_RegEnumKeyExW(a0, a1, a2, a3, a4, a5, a6, a7);
}
LONG WINAPI Mine_RegEnumValueA(HKEY a0, DWORD a1, LPSTR a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPBYTE a6, LPDWORD a7)
{
- if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
+ if (CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
return ERROR_NO_MORE_ITEMS;
}
return Real_RegEnumValueA(a0, a1, a2, a3, a4, a5, a6, a7);
}
LONG WINAPI Mine_RegEnumValueW(HKEY a0, DWORD a1, LPWSTR a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPBYTE a6, LPDWORD a7)
{
- if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
+ if (CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
return ERROR_NO_MORE_ITEMS;
}
return Real_RegEnumValueW(a0, a1, a2, a3, a4, a5, a6, a7);
}
LONG WINAPI Mine_RegOpenKeyA(HKEY a0, LPCSTR a1, PHKEY a2)
{
- if(CFilterMapper2::m_pFilterMapper2) {
+ if (CFilterMapper2::m_pFilterMapper2) {
*a2 = FAKEHKEY;
return ERROR_SUCCESS;
}
@@ -395,7 +395,7 @@ LONG WINAPI Mine_RegOpenKeyA(HKEY a0, LPCSTR a1, PHKEY a2) }
LONG WINAPI Mine_RegOpenKeyW(HKEY a0, LPCWSTR a1, PHKEY a2)
{
- if(CFilterMapper2::m_pFilterMapper2) {
+ if (CFilterMapper2::m_pFilterMapper2) {
*a2 = FAKEHKEY;
return ERROR_SUCCESS;
}
@@ -403,7 +403,7 @@ LONG WINAPI Mine_RegOpenKeyW(HKEY a0, LPCWSTR a1, PHKEY a2) }
LONG WINAPI Mine_RegOpenKeyExA(HKEY a0, LPCSTR a1, DWORD a2, REGSAM a3, PHKEY a4)
{
- if(CFilterMapper2::m_pFilterMapper2 && (a3&(KEY_SET_VALUE|KEY_CREATE_SUB_KEY))) {
+ if (CFilterMapper2::m_pFilterMapper2 && (a3&(KEY_SET_VALUE|KEY_CREATE_SUB_KEY))) {
*a4 = FAKEHKEY;
return ERROR_SUCCESS;
}
@@ -411,7 +411,7 @@ LONG WINAPI Mine_RegOpenKeyExA(HKEY a0, LPCSTR a1, DWORD a2, REGSAM a3, PHKEY a4 }
LONG WINAPI Mine_RegOpenKeyExW(HKEY a0, LPCWSTR a1, DWORD a2, REGSAM a3, PHKEY a4)
{
- if(CFilterMapper2::m_pFilterMapper2 && (a3&(KEY_SET_VALUE|KEY_CREATE_SUB_KEY))) {
+ if (CFilterMapper2::m_pFilterMapper2 && (a3&(KEY_SET_VALUE|KEY_CREATE_SUB_KEY))) {
*a4 = FAKEHKEY;
return ERROR_SUCCESS;
}
@@ -419,21 +419,21 @@ LONG WINAPI Mine_RegOpenKeyExW(HKEY a0, LPCWSTR a1, DWORD a2, REGSAM a3, PHKEY a }
LONG WINAPI Mine_RegQueryInfoKeyA(HKEY a0, LPSTR a1, LPDWORD a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPDWORD a6, LPDWORD a7, LPDWORD a8, LPDWORD a9, LPDWORD a10, struct _FILETIME* a11)
{
- if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
+ if (CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
return ERROR_INVALID_HANDLE;
}
return Real_RegQueryInfoKeyA(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
}
LONG WINAPI Mine_RegQueryInfoKeyW(HKEY a0, LPWSTR a1, LPDWORD a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPDWORD a6, LPDWORD a7, LPDWORD a8, LPDWORD a9, LPDWORD a10, struct _FILETIME* a11)
{
- if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
+ if (CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
return ERROR_INVALID_HANDLE;
}
return Real_RegQueryInfoKeyW(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
}
LONG WINAPI Mine_RegQueryValueA(HKEY a0, LPCSTR a1, LPSTR a2, PLONG a3)
{
- if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
+ if (CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
*a3 = 0;
return ERROR_SUCCESS;
}
@@ -441,7 +441,7 @@ LONG WINAPI Mine_RegQueryValueA(HKEY a0, LPCSTR a1, LPSTR a2, PLONG a3) }
LONG WINAPI Mine_RegQueryValueW(HKEY a0, LPCWSTR a1, LPWSTR a2, PLONG a3)
{
- if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
+ if (CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
*a3 = 0;
return ERROR_SUCCESS;
}
@@ -449,7 +449,7 @@ LONG WINAPI Mine_RegQueryValueW(HKEY a0, LPCWSTR a1, LPWSTR a2, PLONG a3) }
LONG WINAPI Mine_RegQueryValueExA(HKEY a0, LPCSTR a1, LPDWORD a2, LPDWORD a3, LPBYTE a4, LPDWORD a5)
{
- if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
+ if (CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
*a5 = 0;
return ERROR_SUCCESS;
}
@@ -457,7 +457,7 @@ LONG WINAPI Mine_RegQueryValueExA(HKEY a0, LPCSTR a1, LPDWORD a2, LPDWORD a3, LP }
LONG WINAPI Mine_RegQueryValueExW(HKEY a0, LPCWSTR a1, LPDWORD a2, LPDWORD a3, LPBYTE a4, LPDWORD a5)
{
- if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
+ if (CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {
*a5 = 0;
return ERROR_SUCCESS;
}
@@ -465,28 +465,28 @@ LONG WINAPI Mine_RegQueryValueExW(HKEY a0, LPCWSTR a1, LPDWORD a2, LPDWORD a3, L }
LONG WINAPI Mine_RegSetValueA(HKEY a0, LPCSTR a1, DWORD a2, LPCSTR a3, DWORD a4)
{
- if(CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {
+ if (CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {
return ERROR_SUCCESS;
}
return Real_RegSetValueA(a0, a1, a2, a3, a4);
}
LONG WINAPI Mine_RegSetValueW(HKEY a0, LPCWSTR a1, DWORD a2, LPCWSTR a3, DWORD a4)
{
- if(CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {
+ if (CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {
return ERROR_SUCCESS;
}
return Real_RegSetValueW(a0, a1, a2, a3, a4);
}
LONG WINAPI Mine_RegSetValueExA(HKEY a0, LPCSTR a1, DWORD a2, DWORD a3, BYTE* a4, DWORD a5)
{
- if(CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {
+ if (CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {
return ERROR_SUCCESS;
}
return Real_RegSetValueExA(a0, a1, a2, a3, a4, a5);
}
LONG WINAPI Mine_RegSetValueExW(HKEY a0, LPCWSTR a1, DWORD a2, DWORD a3, BYTE* a4, DWORD a5)
{
- if(CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {
+ if (CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {
return ERROR_SUCCESS;
}
return Real_RegSetValueExW(a0, a1, a2, a3, a4, a5);
@@ -502,7 +502,7 @@ bool CFilterMapper2::fInitialized = false; void CFilterMapper2::Init()
{
- if(!fInitialized) {
+ if (!fInitialized) {
DetourAttach(&(PVOID&)Real_CoCreateInstance, (PVOID)Mine_CoCreateInstance);
DetourAttach(&(PVOID&)Real_RegCloseKey, (PVOID)Mine_RegCloseKey);
DetourAttach(&(PVOID&)Real_RegFlushKey, (PVOID)Mine_RegFlushKey);
@@ -548,7 +548,7 @@ CFilterMapper2::CFilterMapper2(bool fRefCounted, bool fAllowUnreg, LPUNKNOWN pUn HRESULT hr = Real_CoCreateInstance(
CLSID_FilterMapper2, (IUnknown*)(INonDelegatingUnknown*)this, CLSCTX_ALL,
__uuidof(IUnknown), (void**)&m_pFM2);
- if(FAILED(hr) || !m_pFM2) {
+ if (FAILED(hr) || !m_pFM2) {
ASSERT(0);
return;
}
@@ -557,14 +557,14 @@ CFilterMapper2::CFilterMapper2(bool fRefCounted, bool fAllowUnreg, LPUNKNOWN pUn CFilterMapper2::~CFilterMapper2()
{
POSITION pos = m_filters.GetHeadPosition();
- while(pos) {
+ while (pos) {
delete m_filters.GetNext(pos);
}
}
STDMETHODIMP CFilterMapper2::NonDelegatingQueryInterface(REFIID riid, void** ppv)
{
- if(riid == __uuidof(IFilterMapper2)) {
+ if (riid == __uuidof(IFilterMapper2)) {
return GetInterface((IFilterMapper2*)this, ppv);
}
@@ -583,9 +583,9 @@ void CFilterMapper2::Register(CString path) PathRemoveFileSpec(buffer);
SetDllDirectory(buffer);
// Load filter
- if(HMODULE h = LoadLibrary(path)) {
+ if (HMODULE h = LoadLibrary(path)) {
typedef HRESULT (__stdcall * PDllRegisterServer)();
- if(PDllRegisterServer p = (PDllRegisterServer)GetProcAddress(h, "DllRegisterServer")) {
+ if (PDllRegisterServer p = (PDllRegisterServer)GetProcAddress(h, "DllRegisterServer")) {
ASSERT(CFilterMapper2::m_pFilterMapper2 == NULL);
CFilterMapper2::m_pFilterMapper2 = this;
@@ -603,9 +603,9 @@ void CFilterMapper2::Register(CString path) STDMETHODIMP CFilterMapper2::CreateCategory(REFCLSID clsidCategory, DWORD dwCategoryMerit, LPCWSTR Description)
{
- if(!m_path.IsEmpty()) {
+ if (!m_path.IsEmpty()) {
return S_OK;
- } else if(CComQIPtr<IFilterMapper2> pFM2 = m_pFM2) {
+ } else if (CComQIPtr<IFilterMapper2> pFM2 = m_pFM2) {
return pFM2->CreateCategory(clsidCategory, dwCategoryMerit, Description);
}
@@ -614,9 +614,9 @@ STDMETHODIMP CFilterMapper2::CreateCategory(REFCLSID clsidCategory, DWORD dwCate STDMETHODIMP CFilterMapper2::UnregisterFilter(const CLSID* pclsidCategory, const OLECHAR* szInstance, REFCLSID Filter)
{
- if(!m_path.IsEmpty()) {
+ if (!m_path.IsEmpty()) {
return S_OK;
- } else if(CComQIPtr<IFilterMapper2> pFM2 = m_pFM2) {
+ } else if (CComQIPtr<IFilterMapper2> pFM2 = m_pFM2) {
return m_fAllowUnreg
? pFM2->UnregisterFilter(pclsidCategory, szInstance, Filter)
: S_OK;
@@ -627,8 +627,8 @@ STDMETHODIMP CFilterMapper2::UnregisterFilter(const CLSID* pclsidCategory, const STDMETHODIMP CFilterMapper2::RegisterFilter(REFCLSID clsidFilter, LPCWSTR Name, IMoniker** ppMoniker, const CLSID* pclsidCategory, const OLECHAR* szInstance, const REGFILTER2* prf2)
{
- if(!m_path.IsEmpty()) {
- if(FilterOverride* f = DNew FilterOverride) {
+ if (!m_path.IsEmpty()) {
+ if (FilterOverride* f = DNew FilterOverride) {
f->fDisabled = false;
f->type = FilterOverride::EXTERNAL;
f->path = m_path;
@@ -637,30 +637,30 @@ STDMETHODIMP CFilterMapper2::RegisterFilter(REFCLSID clsidFilter, LPCWSTR Name, f->iLoadType = FilterOverride::MERIT;
f->dwMerit = prf2->dwMerit;
- if(prf2->dwVersion == 1) {
- for(ULONG i = 0; i < prf2->cPins; i++) {
+ if (prf2->dwVersion == 1) {
+ for (ULONG i = 0; i < prf2->cPins; i++) {
const REGFILTERPINS& rgPin = prf2->rgPins[i];
- if(rgPin.bOutput) {
+ if (rgPin.bOutput) {
continue;
}
- for(UINT i = 0; i < rgPin.nMediaTypes; i++) {
- if(!rgPin.lpMediaType[i].clsMajorType || !rgPin.lpMediaType[i].clsMinorType) {
+ for (UINT i = 0; i < rgPin.nMediaTypes; i++) {
+ if (!rgPin.lpMediaType[i].clsMajorType || !rgPin.lpMediaType[i].clsMinorType) {
break;
}
f->guids.AddTail(*rgPin.lpMediaType[i].clsMajorType);
f->guids.AddTail(*rgPin.lpMediaType[i].clsMinorType);
}
}
- } else if(prf2->dwVersion == 2) {
- for(ULONG i = 0; i < prf2->cPins2; i++) {
+ } else if (prf2->dwVersion == 2) {
+ for (ULONG i = 0; i < prf2->cPins2; i++) {
const REGFILTERPINS2& rgPin = prf2->rgPins2[i];
- if(rgPin.dwFlags®_PINFLAG_B_OUTPUT) {
+ if (rgPin.dwFlags®_PINFLAG_B_OUTPUT) {
continue;
}
- for(UINT i = 0; i < rgPin.nMediaTypes; i++) {
- if(!rgPin.lpMediaType[i].clsMajorType || !rgPin.lpMediaType[i].clsMinorType) {
+ for (UINT i = 0; i < rgPin.nMediaTypes; i++) {
+ if (!rgPin.lpMediaType[i].clsMajorType || !rgPin.lpMediaType[i].clsMinorType) {
break;
}
f->guids.AddTail(*rgPin.lpMediaType[i].clsMajorType);
@@ -675,7 +675,7 @@ STDMETHODIMP CFilterMapper2::RegisterFilter(REFCLSID clsidFilter, LPCWSTR Name, }
return S_OK;
- } else if(CComQIPtr<IFilterMapper2> pFM2 = m_pFM2) {
+ } else if (CComQIPtr<IFilterMapper2> pFM2 = m_pFM2) {
return pFM2->RegisterFilter(clsidFilter, Name, ppMoniker, pclsidCategory, szInstance, prf2);
}
@@ -686,7 +686,7 @@ STDMETHODIMP CFilterMapper2::EnumMatchingFilters(IEnumMoniker** ppEnum, DWORD dw BOOL bInputNeeded, DWORD cInputTypes, const GUID* pInputTypes, const REGPINMEDIUM* pMedIn, const CLSID* pPinCategoryIn, BOOL bRender,
BOOL bOutputNeeded, DWORD cOutputTypes, const GUID* pOutputTypes, const REGPINMEDIUM* pMedOut, const CLSID* pPinCategoryOut)
{
- if(CComQIPtr<IFilterMapper2> pFM2 = m_pFM2) {
+ if (CComQIPtr<IFilterMapper2> pFM2 = m_pFM2) {
pFM2->EnumMatchingFilters(ppEnum, dwFlags, bExactMatch, dwMerit,
bInputNeeded, cInputTypes, pInputTypes, pMedIn, pPinCategoryIn, bRender,
bOutputNeeded, cOutputTypes, pOutputTypes, pMedOut, pPinCategoryOut);
diff --git a/src/apps/mplayerc/FavoriteOrganizeDlg.cpp b/src/apps/mplayerc/FavoriteOrganizeDlg.cpp index ca83c1315..a9441f599 100644 --- a/src/apps/mplayerc/FavoriteOrganizeDlg.cpp +++ b/src/apps/mplayerc/FavoriteOrganizeDlg.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -42,10 +42,10 @@ void CFavoriteOrganizeDlg::SetupList(bool fSave) {
int i = m_tab.GetCurSel();
- if(fSave) {
+ if (fSave) {
CAtlList<CString> sl;
- for(int j = 0; j < m_list.GetItemCount(); j++) {
+ for (int j = 0; j < m_list.GetItemCount(); j++) {
CString desc = m_list.GetItemText(j, 0);
desc.Remove(';');
CString str = m_sl[i].GetAt((POSITION)m_list.GetItemData(j));
@@ -58,11 +58,11 @@ void CFavoriteOrganizeDlg::SetupList(bool fSave) m_list.DeleteAllItems();
POSITION pos = m_sl[i].GetHeadPosition(), tmp;
- while(pos) {
+ while (pos) {
tmp = pos;
CString s = m_sl[i].GetNext(pos);
int i = s.Find(';');
- if(i >= 0) {
+ if (i >= 0) {
s = s.Left(i);
}
m_list.SetItemData(m_list.InsertItem(m_list.GetItemCount(), s), (DWORD_PTR)tmp);
@@ -145,7 +145,7 @@ void CFavoriteOrganizeDlg::OnTcnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult) void CFavoriteOrganizeDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
{
- if(nIDCtl != IDC_LIST2) {
+ if (nIDCtl != IDC_LIST2) {
return;
}
@@ -154,7 +154,7 @@ void CFavoriteOrganizeDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStr CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
- if(!!m_list.GetItemState(nItem, LVIS_SELECTED)) {
+ if (!!m_list.GetItemState(nItem, LVIS_SELECTED)) {
FillRect(pDC->m_hDC, rcItem, CBrush(0xf1dacc));
FrameRect(pDC->m_hDC, rcItem, CBrush(0xc56a31));
} else {
@@ -171,7 +171,7 @@ void CFavoriteOrganizeDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStr void CFavoriteOrganizeDlg::OnBnClickedButton1()
{
- if(POSITION pos = m_list.GetFirstSelectedItemPosition()) {
+ if (POSITION pos = m_list.GetFirstSelectedItemPosition()) {
m_list.SetFocus();
m_list.EditLabel(m_list.GetNextSelectedItem(pos));
}
@@ -180,7 +180,7 @@ void CFavoriteOrganizeDlg::OnBnClickedButton1() void CFavoriteOrganizeDlg::OnLvnEndlabeleditList2(NMHDR* pNMHDR, LRESULT* pResult)
{
NMLVDISPINFO* pDispInfo = reinterpret_cast<NMLVDISPINFO*>(pNMHDR);
- if(pDispInfo->item.iItem >= 0 && pDispInfo->item.pszText) {
+ if (pDispInfo->item.iItem >= 0 && pDispInfo->item.pszText) {
m_list.SetItemText(pDispInfo->item.iItem, 0, pDispInfo->item.pszText);
}
*pResult = 0;
@@ -188,9 +188,9 @@ void CFavoriteOrganizeDlg::OnLvnEndlabeleditList2(NMHDR* pNMHDR, LRESULT* pResul void CFavoriteOrganizeDlg::OnBnClickedButton2()
{
- if(POSITION pos = m_list.GetFirstSelectedItemPosition()) {
+ if (POSITION pos = m_list.GetFirstSelectedItemPosition()) {
int nItem = m_list.GetNextSelectedItem(pos);
- if(nItem < 0 || nItem >= m_list.GetItemCount()) {
+ if (nItem < 0 || nItem >= m_list.GetItemCount()) {
return;
}
@@ -205,9 +205,9 @@ void CFavoriteOrganizeDlg::OnBnClickedButton2() void CFavoriteOrganizeDlg::OnBnClickedButton3()
{
- if(POSITION pos = m_list.GetFirstSelectedItemPosition()) {
+ if (POSITION pos = m_list.GetFirstSelectedItemPosition()) {
int nItem = m_list.GetNextSelectedItem(pos);
- if(nItem <= 0) {
+ if (nItem <= 0) {
return;
}
@@ -227,9 +227,9 @@ void CFavoriteOrganizeDlg::OnBnClickedButton3() void CFavoriteOrganizeDlg::OnBnClickedButton7()
{
- if(POSITION pos = m_list.GetFirstSelectedItemPosition()) {
+ if (POSITION pos = m_list.GetFirstSelectedItemPosition()) {
int nItem = m_list.GetNextSelectedItem(pos);
- if(nItem < 0 || nItem >= m_list.GetItemCount()-1) {
+ if (nItem < 0 || nItem >= m_list.GetItemCount()-1) {
return;
}
@@ -269,7 +269,7 @@ void CFavoriteOrganizeDlg::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimi {
__super::OnActivate(nState, pWndOther, bMinimized);
- if(nState == WA_ACTIVE) {
+ if (nState == WA_ACTIVE) {
m_list.SetWindowPos(&wndTop, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
}
}
@@ -278,7 +278,7 @@ void CFavoriteOrganizeDlg::OnSize(UINT nType, int cx, int cy) {
__super::OnSize(nType, cx, cy);
- if(IsWindow(m_list)) {
+ if (IsWindow(m_list)) {
m_list.SetColumnWidth(0, LVSCW_AUTOSIZE_USEHEADER);
}
}
diff --git a/src/apps/mplayerc/FileDropTarget.cpp b/src/apps/mplayerc/FileDropTarget.cpp index 0dacf127f..998233003 100644 --- a/src/apps/mplayerc/FileDropTarget.cpp +++ b/src/apps/mplayerc/FileDropTarget.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -61,7 +61,7 @@ DROPEFFECT CFileDropTarget::OnDropEx(CWnd* pWnd, COleDataObject* pDataObject, DR void CFileDropTarget::OnDragLeave(CWnd* pWnd)
{
- if(m_pDropTarget) {
+ if (m_pDropTarget) {
m_pDropTarget->OnDragLeave();
}
}
diff --git a/src/apps/mplayerc/FloatEdit.cpp b/src/apps/mplayerc/FloatEdit.cpp index b3dbedddc..0aafb69c7 100644 --- a/src/apps/mplayerc/FloatEdit.cpp +++ b/src/apps/mplayerc/FloatEdit.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -58,21 +58,21 @@ END_MESSAGE_MAP() void CFloatEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
- if(!(nChar >= '0' && nChar <= '9' || nChar == '.' || nChar == '\b')) {
+ if (!(nChar >= '0' && nChar <= '9' || nChar == '.' || nChar == '\b')) {
return;
}
CString str;
GetWindowText(str);
- if(nChar == '.' && (str.Find('.') >= 0 || str.IsEmpty())) {
+ if (nChar == '.' && (str.Find('.') >= 0 || str.IsEmpty())) {
return;
}
int nStartChar, nEndChar;
GetSel(nStartChar, nEndChar);
- if(nChar == '\b' && nStartChar <= 0) {
+ if (nChar == '\b' && nStartChar <= 0) {
return;
}
@@ -89,25 +89,25 @@ END_MESSAGE_MAP() void CIntEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
- if(!(nChar >= '0' && nChar <= '9' || nChar == '-' || nChar == '\b')) {
+ if (!(nChar >= '0' && nChar <= '9' || nChar == '-' || nChar == '\b')) {
return;
}
CString str;
GetWindowText(str);
- if(nChar == '-' && !str.IsEmpty() && str[0] == '-') {
+ if (nChar == '-' && !str.IsEmpty() && str[0] == '-') {
return;
}
int nStartChar, nEndChar;
GetSel(nStartChar, nEndChar);
- if(nChar == '\b' && nStartChar <= 0) {
+ if (nChar == '\b' && nStartChar <= 0) {
return;
}
- if(nChar == '-' && (nStartChar != 0 || nEndChar != 0)) {
+ if (nChar == '-' && (nStartChar != 0 || nEndChar != 0)) {
return;
}
@@ -147,7 +147,7 @@ END_MESSAGE_MAP() void CHexEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
- if(!(nChar >= 'A' && nChar <= 'F' || nChar >= 'a' && nChar <= 'f'
+ if (!(nChar >= 'A' && nChar <= 'F' || nChar >= 'a' && nChar <= 'f'
|| nChar >= '0' && nChar <= '9' || nChar == '\b')) {
return;
}
@@ -158,11 +158,11 @@ void CHexEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) int nStartChar, nEndChar;
GetSel(nStartChar, nEndChar);
- if(nChar == '\b' && nStartChar <= 0) {
+ if (nChar == '\b' && nStartChar <= 0) {
return;
}
- if(nChar != '\b' && nEndChar - nStartChar == 0 && str.GetLength() >= 8) {
+ if (nChar != '\b' && nEndChar - nStartChar == 0 && str.GetLength() >= 8) {
return;
}
diff --git a/src/apps/mplayerc/FullscreenWnd.cpp b/src/apps/mplayerc/FullscreenWnd.cpp index 7127a4924..e31a8ffdb 100644 --- a/src/apps/mplayerc/FullscreenWnd.cpp +++ b/src/apps/mplayerc/FullscreenWnd.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -93,7 +93,7 @@ BOOL CFullscreenWnd::PreTranslateMessage(MSG* pMsg) BOOL CFullscreenWnd::PreCreateWindow(CREATESTRUCT& cs)
{
- if(!CWnd::PreCreateWindow(cs)) {
+ if (!CWnd::PreCreateWindow(cs)) {
return FALSE;
}
diff --git a/src/apps/mplayerc/GoToDlg.cpp b/src/apps/mplayerc/GoToDlg.cpp index 169f2cc08..4d898c579 100644 --- a/src/apps/mplayerc/GoToDlg.cpp +++ b/src/apps/mplayerc/GoToDlg.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -38,9 +38,9 @@ CGoToDlg::CGoToDlg(int time, float fps, CWnd* pParent /*=NULL*/) , m_time(time)
, m_fps(fps)
{
- if(m_fps == 0) {
+ if (m_fps == 0) {
CString str = AfxGetApp()->GetProfileString(IDS_R_SETTINGS, _T("fps"), _T("0"));
- if(_stscanf_s(str, _T("%f"), &m_fps) != 1) {
+ if (_stscanf_s(str, _T("%f"), &m_fps) != 1) {
m_fps = 0;
}
}
@@ -63,17 +63,17 @@ BOOL CGoToDlg::OnInitDialog() {
CDialog::OnInitDialog();
- if(m_time >= 0) {
+ if (m_time >= 0) {
m_timestr.Format(_T("%02d:%02d:%02d.%03d"),
(m_time/(1000*60*60))%60, (m_time/(1000*60))%60, (m_time/1000)%60, m_time%1000);
- if(m_fps > 0) {
+ if (m_fps > 0) {
m_framestr.Format(_T("%d, %.3f"), (int)(m_fps*m_time/1000), m_fps);
}
UpdateData(FALSE);
- switch(AfxGetApp()->GetProfileInt(IDS_R_SETTINGS, _T("gotoluf"), 0)) {
+ switch (AfxGetApp()->GetProfileInt(IDS_R_SETTINGS, _T("gotoluf"), 0)) {
default:
case 0:
m_timeedit.SetFocus();
@@ -112,17 +112,17 @@ void CGoToDlg::OnBnClickedOk1() CAtlRegExp<> re;
REParseError status = re.Parse(_T("{\\z}"), FALSE);
- if(REPARSE_ERROR_OK == status) {
+ if (REPARSE_ERROR_OK == status) {
m_timestr += 'A'; // HACK: Without this the while loop below would keep going on X64 on release builds...
CAtlREMatchContext<> mc;
const CAtlREMatchContext<>::RECHAR* s = m_timestr.GetBuffer();
const CAtlREMatchContext<>::RECHAR* e = NULL;
- while(s && re.Match(s, &mc, &e)) {
+ while (s && re.Match(s, &mc, &e)) {
const CAtlREMatchContext<>::RECHAR* szStart = 0;
const CAtlREMatchContext<>::RECHAR* szEnd = 0;
mc.GetMatch(0, &szStart, &szEnd);
- if(hh != 0 || hh > 59 || mm > 59 || ss > 59) {
+ if (hh != 0 || hh > 59 || mm > 59 || ss > 59) {
AfxMessageBox(_T("Error parsing entered time!"));
return;
}
@@ -154,11 +154,11 @@ void CGoToDlg::OnBnClickedOk2() CAtlRegExp<> re;
REParseError status = re.Parse(_T("{\\z}[^0-9\\.]+{[0-9\\.]+}"), FALSE);
- if(REPARSE_ERROR_OK == status) {
+ if (REPARSE_ERROR_OK == status) {
CAtlREMatchContext<> mc;
const CAtlREMatchContext<>::RECHAR* s = m_framestr.GetBuffer();
const CAtlREMatchContext<>::RECHAR* e = NULL;
- if(re.Match(s, &mc, &e)) {
+ if (re.Match(s, &mc, &e)) {
const CAtlREMatchContext<>::RECHAR* szStart = 0;
const CAtlREMatchContext<>::RECHAR* szEnd = 0;
@@ -166,7 +166,7 @@ void CGoToDlg::OnBnClickedOk2() frame = _tcstol(szStart, (TCHAR**)&szStart, 10);
mc.GetMatch(1, &szStart, &szEnd);
- if(_stscanf_s(szStart, _T("%f"), &fps) != 1) {
+ if (_stscanf_s(szStart, _T("%f"), &fps) != 1) {
fps = 0;
} else {
AfxGetApp()->WriteProfileString(IDS_R_SETTINGS, _T("fps"), szStart);
@@ -176,7 +176,7 @@ void CGoToDlg::OnBnClickedOk2() return;
}
- if(fps == 0) {
+ if (fps == 0) {
AfxMessageBox(_T("Error parsing entered frame rate!"));
return;
}
@@ -191,10 +191,10 @@ void CGoToDlg::OnBnClickedOk2() BOOL CGoToDlg::PreTranslateMessage(MSG* pMsg)
{
- if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN) {
- if(*GetFocus() == m_timeedit) {
+ if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN) {
+ if (*GetFocus() == m_timeedit) {
OnBnClickedOk1();
- } else if(*GetFocus() == m_frameedit) {
+ } else if (*GetFocus() == m_frameedit) {
OnBnClickedOk2();
}
diff --git a/src/apps/mplayerc/ISDb.cpp b/src/apps/mplayerc/ISDb.cpp index f05aa1d8d..c4f21b5ae 100644 --- a/src/apps/mplayerc/ISDb.cpp +++ b/src/apps/mplayerc/ISDb.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -30,7 +30,7 @@ bool hash(LPCTSTR fn, filehash& fh) {
CFile f;
CFileException fe;
- if(!f.Open(fn, CFile::modeRead|CFile::osSequentialScan|CFile::shareDenyNone, &fe)) {
+ if (!f.Open(fn, CFile::modeRead|CFile::osSequentialScan|CFile::shareDenyNone, &fe)) {
return false;
}
@@ -41,11 +41,11 @@ bool hash(LPCTSTR fn, filehash& fh) fh.size = f.GetLength();
fh.hash = fh.size;
- for(UINT64 tmp = 0, i = 0; i < 65536/sizeof(tmp) && f.Read(&tmp, sizeof(tmp)); fh.hash += tmp, i++) {
+ for (UINT64 tmp = 0, i = 0; i < 65536/sizeof(tmp) && f.Read(&tmp, sizeof(tmp)); fh.hash += tmp, i++) {
;
}
f.Seek(max(0, (INT64)fh.size - 65536), CFile::begin);
- for(UINT64 tmp = 0, i = 0; i < 65536/sizeof(tmp) && f.Read(&tmp, sizeof(tmp)); fh.hash += tmp, i++) {
+ for (UINT64 tmp = 0, i = 0; i < 65536/sizeof(tmp) && f.Read(&tmp, sizeof(tmp)); fh.hash += tmp, i++) {
;
}
@@ -57,14 +57,14 @@ void hash(CPlaylist& pl, CList<filehash>& fhs) fhs.RemoveAll();
POSITION pos = pl.GetHeadPosition();
- while(pos) {
+ while (pos) {
CString fn = pl.GetNext(pos).m_fns.GetHead();
- if(AfxGetAppSettings().m_Formats.FindExt(CPath(fn).GetExtension().MakeLower(), true)) {
+ if (AfxGetAppSettings().m_Formats.FindExt(CPath(fn).GetExtension().MakeLower(), true)) {
continue;
}
filehash fh;
- if(!hash(fn, fh)) {
+ if (!hash(fn, fh)) {
continue;
}
@@ -80,7 +80,7 @@ CStringA makeargs(CPlaylist& pl) CAtlList<CStringA> args;
POSITION pos = fhs.GetHeadPosition();
- for(int i = 0; pos; i++) {
+ for (int i = 0; pos; i++) {
filehash& fh = fhs.GetNext(pos);
CStringA str;
@@ -103,7 +103,7 @@ bool OpenUrl(CInternetSession& is, CString url, CStringA& str) CAutoPtr<CStdioFile> f(is.OpenURL(url, 1, INTERNET_FLAG_TRANSFER_BINARY|INTERNET_FLAG_EXISTING_CONNECT));
char buff[1024];
- for(int len; (len = f->Read(buff, sizeof(buff))) > 0; str += CStringA(buff, len)) {
+ for (int len; (len = f->Read(buff, sizeof(buff))) > 0; str += CStringA(buff, len)) {
;
}
diff --git a/src/apps/mplayerc/ISDb.h b/src/apps/mplayerc/ISDb.h index 3173380bc..9fe50988f 100644 --- a/src/apps/mplayerc/ISDb.h +++ b/src/apps/mplayerc/ISDb.h @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -50,7 +50,7 @@ struct isdb_movie { subs.RemoveAll();
}
isdb_movie& operator = (const struct isdb_movie& m) {
- if(this != &m) {
+ if (this != &m) {
titles.RemoveAll();
titles.AddTailList(&m.titles);
subs.RemoveAll();
diff --git a/src/apps/mplayerc/KeyProvider.cpp b/src/apps/mplayerc/KeyProvider.cpp index 36b38b3df..f1556a7e3 100644 --- a/src/apps/mplayerc/KeyProvider.cpp +++ b/src/apps/mplayerc/KeyProvider.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -41,11 +41,11 @@ STDMETHODIMP CKeyProvider::NonDelegatingQueryInterface(REFIID riid, void** ppv) STDMETHODIMP CKeyProvider::QueryService(REFIID siid, REFIID riid, void **ppv)
{
/*
- if(siid == __uuidof(IWMReader) && riid == IID_IUnknown)
+ if (siid == __uuidof(IWMReader) && riid == IID_IUnknown)
{
CComPtr<IUnknown> punkCert;
HRESULT hr = WMCreateCertificate(&punkCert);
- if(SUCCEEDED(hr))
+ if (SUCCEEDED(hr))
*ppv = (void*)punkCert.Detach();
return hr;
}
diff --git a/src/apps/mplayerc/LcdSupport.cpp b/src/apps/mplayerc/LcdSupport.cpp index b67d1cb83..81974d819 100644 --- a/src/apps/mplayerc/LcdSupport.cpp +++ b/src/apps/mplayerc/LcdSupport.cpp @@ -1,7 +1,7 @@ /*
* $Id$
*
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -157,7 +157,7 @@ HRESULT CLCDMyManager::Initialize() void CLCDMyManager::OnLCDButtonUp(int nButton)
{
- switch(nButton) {
+ switch (nButton) {
case LGLCDBUTTON_BUTTON0: {
/* LOGFONT lf;
HFONT hFont = m_Text1.GetFont();
diff --git a/src/apps/mplayerc/MainFrm.cpp b/src/apps/mplayerc/MainFrm.cpp index f8dba7b90..17e387d29 100644 --- a/src/apps/mplayerc/MainFrm.cpp +++ b/src/apps/mplayerc/MainFrm.cpp @@ -130,22 +130,22 @@ public: OAFilterState __fs = GetMediaState(); \
\
REFERENCE_TIME __rt = 0; \
- if(m_iMediaLoadState == MLS_LOADED) __rt = GetPos(); \
+ if (m_iMediaLoadState == MLS_LOADED) __rt = GetPos(); \
\
- if(__fs != State_Stopped) \
+ if (__fs != State_Stopped) \
SendMessage(WM_COMMAND, ID_PLAY_STOP); \
#define RestoreMediaState \
- if(m_iMediaLoadState == MLS_LOADED) \
+ if (m_iMediaLoadState == MLS_LOADED) \
{ \
SeekTo(__rt); \
\
- if(__fs == State_Stopped) \
+ if (__fs == State_Stopped) \
SendMessage(WM_COMMAND, ID_PLAY_STOP); \
- else if(__fs == State_Paused) \
+ else if (__fs == State_Paused) \
SendMessage(WM_COMMAND, ID_PLAY_PAUSE); \
- else if(__fs == State_Running) \
+ else if (__fs == State_Running) \
SendMessage(WM_COMMAND, ID_PLAY_PLAY); \
} \
@@ -517,7 +517,7 @@ END_MESSAGE_MAP() const TCHAR *GetEventString(LONG evCode)
{
#define UNPACK_VALUE(VALUE) case VALUE: return _T( #VALUE );
- switch(evCode) {
+ switch (evCode) {
UNPACK_VALUE(EC_COMPLETE);
UNPACK_VALUE(EC_USERABORT);
UNPACK_VALUE(EC_ERRORABORT);
@@ -646,7 +646,7 @@ CMainFrame::~CMainFrame() int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
- if(__super::OnCreate(lpCreateStruct) == -1) {
+ if (__super::OnCreate(lpCreateStruct) == -1) {
return -1;
}
@@ -656,7 +656,7 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) GetMenu()->ModifyMenu(ID_FAVORITES, MF_BYCOMMAND|MF_STRING, IDR_MAINFRAME, ResStr(IDS_FAVORITES_POPUP));
// create a view to occupy the client area of the frame
- if(!m_wndView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,
+ if (!m_wndView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,
CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL)) {
TRACE0("Failed to create view window\n");
return -1;
@@ -665,19 +665,19 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) // static bars
BOOL bResult = m_wndStatusBar.Create(this);
- if(bResult) {
+ if (bResult) {
bResult = m_wndStatsBar.Create(this);
}
- if(bResult) {
+ if (bResult) {
bResult = m_wndInfoBar.Create(this);
}
- if(bResult) {
+ if (bResult) {
bResult = m_wndToolBar.Create(this);
}
- if(bResult) {
+ if (bResult) {
bResult = m_wndSeekBar.Create(this);
}
- if(!bResult) {
+ if (!bResult) {
TRACE0("Failed to create all control bars\n");
return -1; // fail to create
}
@@ -748,14 +748,14 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) m_pGraphThread = (CGraphThread*)AfxBeginThread(RUNTIME_CLASS(CGraphThread));
- if(m_pGraphThread) {
+ if (m_pGraphThread) {
m_pGraphThread->SetMainFrame(this);
}
- if(s.nCmdlnWebServerPort != 0) {
- if(s.nCmdlnWebServerPort > 0) {
+ if (s.nCmdlnWebServerPort != 0) {
+ if (s.nCmdlnWebServerPort > 0) {
StartWebServer(s.nCmdlnWebServerPort);
- } else if(s.fEnableWebServer) {
+ } else if (s.fEnableWebServer) {
StartWebServer(s.nWebServerPort);
}
}
@@ -812,7 +812,7 @@ void CMainFrame::OnDestroy() if ( m_pGraphThread ) {
CAMEvent e;
m_pGraphThread->PostThreadMessage( CGraphThread::TM_EXIT, 0, (LPARAM)&e );
- if( !e.Wait(5000) ) {
+ if ( !e.Wait(5000) ) {
TRACE(_T("ERROR: Must call TerminateThread() on CMainFrame::m_pGraphThread->m_hThread\n"));
TerminateThread( m_pGraphThread->m_hThread, (DWORD)-1 );
}
@@ -837,7 +837,7 @@ void CMainFrame::OnClose() CString strList = "";
pos = m_shaderlabels.GetHeadPosition();
- while(pos) {
+ while (pos) {
strList += m_shaderlabels.GetAt (pos) + "|";
m_dockingbars.GetNext(pos);
}
@@ -848,7 +848,7 @@ void CMainFrame::OnClose() CString strList = "";
pos = m_shaderlabelsScreenSpace.GetHeadPosition();
- while(pos) {
+ while (pos) {
strList += m_shaderlabelsScreenSpace.GetAt (pos) + "|";
m_dockingbars.GetNext(pos);
}
@@ -886,11 +886,11 @@ BOOL CMainFrame::OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoi BOOL bResult = FALSE;
- if(pDataObject->IsDataAvailable(CF_URL)) {
+ if (pDataObject->IsDataAvailable(CF_URL)) {
FORMATETC fmt = {CF_URL, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
- if(HGLOBAL hGlobal = pDataObject->GetGlobalData(CF_URL, &fmt)) {
+ if (HGLOBAL hGlobal = pDataObject->GetGlobalData(CF_URL, &fmt)) {
LPCSTR pText = (LPCSTR)GlobalLock(hGlobal);
- if(AfxIsValidString(pText)) {
+ if (AfxIsValidString(pText)) {
CStringA url(pText);
SetForegroundWindow();
@@ -898,7 +898,7 @@ BOOL CMainFrame::OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoi CAtlList<CString> sl;
sl.AddTail(CString(url));
- if(m_wndPlaylistBar.IsWindowVisible()) {
+ if (m_wndPlaylistBar.IsWindowVisible()) {
m_wndPlaylistBar.Append(sl, true);
} else {
m_wndPlaylistBar.Open(sl, true);
@@ -932,8 +932,8 @@ LPCTSTR CMainFrame::GetRecentFile() {
CRecentFileList& MRU = AfxGetAppSettings().MRU;
MRU.ReadList();
- for(int i = 0; i < MRU.GetSize(); i++) {
- if(!MRU[i].IsEmpty()) {
+ for (int i = 0; i < MRU.GetSize(); i++) {
+ if (!MRU[i].IsEmpty()) {
return MRU[i].GetString();
}
}
@@ -942,13 +942,13 @@ LPCTSTR CMainFrame::GetRecentFile() void CMainFrame::LoadControlBar(CControlBar* pBar, UINT defDockBarID)
{
- if(!pBar) {
+ if (!pBar) {
return;
}
CString str;
pBar->GetWindowText(str);
- if(str.IsEmpty()) {
+ if (str.IsEmpty()) {
return;
}
CString section = _T("ToolBars\\") + str;
@@ -957,7 +957,7 @@ void CMainFrame::LoadControlBar(CControlBar* pBar, UINT defDockBarID) UINT nID = pApp->GetProfileInt(section, _T("DockState"), defDockBarID);
- if(nID != AFX_IDW_DOCKBAR_FLOAT) {
+ if (nID != AFX_IDW_DOCKBAR_FLOAT) {
DockControlBar(pBar, nID);
}
@@ -971,7 +971,7 @@ void CMainFrame::LoadControlBar(CControlBar* pBar, UINT defDockBarID) ? SW_SHOW
: SW_HIDE);
- if(CSizingControlBar* pSCB = dynamic_cast<CSizingControlBar*>(pBar)) {
+ if (CSizingControlBar* pSCB = dynamic_cast<CSizingControlBar*>(pBar)) {
pSCB->LoadState(section + _T("\\State"));
m_dockingbars.AddTail(pSCB);
}
@@ -985,34 +985,34 @@ void CMainFrame::RestoreFloatingControlBars() GetWindowRect(r);
POSITION pos = m_dockingbars.GetHeadPosition();
- while(pos) {
+ while (pos) {
CSizingControlBar* pBar = m_dockingbars.GetNext(pos);
CString str;
pBar->GetWindowText(str);
- if(str.IsEmpty()) {
+ if (str.IsEmpty()) {
return;
}
CString section = _T("ToolBars\\") + str;
- if((pBar == &m_wndPlaylistBar) && pApp->GetProfileInt(section, _T("Visible"), FALSE)) {
+ if ((pBar == &m_wndPlaylistBar) && pApp->GetProfileInt(section, _T("Visible"), FALSE)) {
pBar->ShowWindow(SW_SHOW);
}
- if(pApp->GetProfileInt(section, _T("DockState"), ~AFX_IDW_DOCKBAR_FLOAT) == AFX_IDW_DOCKBAR_FLOAT) {
+ if (pApp->GetProfileInt(section, _T("DockState"), ~AFX_IDW_DOCKBAR_FLOAT) == AFX_IDW_DOCKBAR_FLOAT) {
CPoint p;
p.x = pApp->GetProfileInt(section, _T("DockPosX"), r.right);
p.y = pApp->GetProfileInt(section, _T("DockPosY"), r.top);
- if(p.x < m_rcDesktop.left) {
+ if (p.x < m_rcDesktop.left) {
p.x = m_rcDesktop.left;
}
- if(p.y < m_rcDesktop.top) {
+ if (p.y < m_rcDesktop.top) {
p.y = m_rcDesktop.top;
}
- if(p.x >= m_rcDesktop.right) {
+ if (p.x >= m_rcDesktop.right) {
p.x = m_rcDesktop.right-1;
}
- if(p.y >= m_rcDesktop.bottom) {
+ if (p.y >= m_rcDesktop.bottom) {
p.y = m_rcDesktop.bottom-1;
}
FloatControlBar(pBar, p);
@@ -1025,25 +1025,25 @@ void CMainFrame::SaveControlBars() CWinApp* pApp = AfxGetApp();
POSITION pos = m_dockingbars.GetHeadPosition();
- while(pos) {
+ while (pos) {
CSizingControlBar* pBar = m_dockingbars.GetNext(pos);
CString str;
pBar->GetWindowText(str);
- if(str.IsEmpty()) {
+ if (str.IsEmpty()) {
return;
}
CString section = _T("ToolBars\\") + str;
pApp->WriteProfileInt(section, _T("Visible"), pBar->IsWindowVisible());
- if(CSizingControlBar* pSCB = dynamic_cast<CSizingControlBar*>(pBar)) {
+ if (CSizingControlBar* pSCB = dynamic_cast<CSizingControlBar*>(pBar)) {
pSCB->SaveState(section + _T("\\State"));
}
UINT nID = pBar->GetParent()->GetDlgCtrlID();
- if(nID == AFX_IDW_DOCKBAR_FLOAT) {
+ if (nID == AFX_IDW_DOCKBAR_FLOAT) {
CRect r;
pBar->GetParent()->GetParent()->GetWindowRect(r);
pApp->WriteProfileInt(section, _T("DockPosX"), r.left);
@@ -1064,11 +1064,11 @@ LRESULT CMainFrame::OnTaskBarRestart(WPARAM, LPARAM) LRESULT CMainFrame::OnNotifyIcon(WPARAM wParam, LPARAM lParam)
{
- if((UINT)wParam != IDR_MAINFRAME) {
+ if ((UINT)wParam != IDR_MAINFRAME) {
return -1;
}
- switch((UINT)lParam) {
+ switch ((UINT)lParam) {
case WM_LBUTTONDOWN:
ShowWindow(SW_SHOW);
MoveVideoWindow();
@@ -1117,8 +1117,8 @@ void CMainFrame::ShowTrayIcon(bool fShow) tnid.hWnd = m_hWnd;
tnid.uID = IDR_MAINFRAME;
- if(fShow) {
- if(!m_fTrayIcon) {
+ if (fShow) {
+ if (!m_fTrayIcon) {
tnid.hIcon = (HICON)LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
tnid.uFlags = NIF_MESSAGE|NIF_ICON|NIF_TIP;
tnid.uCallbackMessage = WM_NOTIFYICON;
@@ -1128,14 +1128,14 @@ void CMainFrame::ShowTrayIcon(bool fShow) m_fTrayIcon = true;
}
} else {
- if(m_fTrayIcon) {
+ if (m_fTrayIcon) {
Shell_NotifyIcon(NIM_DELETE, &tnid);
m_fTrayIcon = false;
}
}
- if(bWasVisible) {
+ if (bWasVisible) {
ShowWindow(SW_SHOW);
}
}
@@ -1153,7 +1153,7 @@ void CMainFrame::SetTrayTip(CString str) BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
- if(!__super::PreCreateWindow(cs)) {
+ if (!__super::PreCreateWindow(cs)) {
return FALSE;
}
@@ -1166,29 +1166,29 @@ BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
- if(pMsg->message == WM_KEYDOWN) {
- /* if(m_fShockwaveGraph
+ if (pMsg->message == WM_KEYDOWN) {
+ /* if (m_fShockwaveGraph
&& (pMsg->wParam == VK_LEFT || pMsg->wParam == VK_RIGHT
|| pMsg->wParam == VK_UP || pMsg->wParam == VK_DOWN))
return FALSE;
*/
- if(pMsg->wParam == VK_ESCAPE) {
+ if (pMsg->wParam == VK_ESCAPE) {
bool fEscapeNotAssigned = !assignedToCmd(VK_ESCAPE, false);
- if(fEscapeNotAssigned) {
- if(m_iMediaLoadState == MLS_LOADED && m_fFullScreen) {
+ if (fEscapeNotAssigned) {
+ if (m_iMediaLoadState == MLS_LOADED && m_fFullScreen) {
OnViewFullscreen();
PostMessage(WM_COMMAND, ID_PLAY_PAUSE);
return TRUE;
- } else if(IsCaptionHidden()) {
+ } else if (IsCaptionHidden()) {
PostMessage(WM_COMMAND, ID_VIEW_CAPTIONMENU);
return TRUE;
}
}
- } else if(pMsg->wParam == VK_LEFT && pAMTuner) {
+ } else if (pMsg->wParam == VK_LEFT && pAMTuner) {
PostMessage(WM_COMMAND, ID_NAVIGATE_SKIPBACK);
return TRUE;
- } else if(pMsg->wParam == VK_RIGHT && pAMTuner) {
+ } else if (pMsg->wParam == VK_RIGHT && pAMTuner) {
PostMessage(WM_COMMAND, ID_NAVIGATE_SKIPFORWARD);
return TRUE;
}
@@ -1233,7 +1233,7 @@ void CMainFrame::OnSetFocus(CWnd* pOldWnd) SetAlwaysOnTop(AfxGetAppSettings().iOnTop);
// forward focus to the view window
- if(IsWindow(m_wndView.m_hWnd)) {
+ if (IsWindow(m_wndView.m_hWnd)) {
m_wndView.SetFocus();
}
}
@@ -1241,20 +1241,20 @@ void CMainFrame::OnSetFocus(CWnd* pOldWnd) BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
// let the view have first crack at the command
- if(m_wndView.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo)) {
+ if (m_wndView.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo)) {
return TRUE;
}
POSITION pos = m_bars.GetHeadPosition();
- while(pos) {
- if(m_bars.GetNext(pos)->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo)) {
+ while (pos) {
+ if (m_bars.GetNext(pos)->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo)) {
return TRUE;
}
}
pos = m_dockingbars.GetHeadPosition();
- while(pos) {
- if(m_dockingbars.GetNext(pos)->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo)) {
+ while (pos) {
+ if (m_dockingbars.GetNext(pos)->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo)) {
return TRUE;
}
}
@@ -1283,14 +1283,15 @@ void CMainFrame::OnGetMinMaxInfo(MINMAXINFO* lpMMI) }
}
if ( IsWindow(m_wndToolBar.m_hWnd) && m_wndToolBar.IsVisible() ) {
- lpMMI->ptMinTrackSize.x = max( m_wndToolBar.GetMinWidth(), lpMMI->ptMinTrackSize.x );
+ lpMMI->ptMinTrackSize.x = max( m_wndToolBar.GetMinWidth(), lpMMI->ptMinTrackSize.x );
}
-
+
lpMMI->ptMinTrackSize.y = 0;
if ( style & WS_CAPTION ) {
lpMMI->ptMinTrackSize.y += GetSystemMetrics( SM_CYCAPTION );
- if(s.iCaptionMenuMode == MODE_SHOWCAPTIONMENU)
- lpMMI->ptMinTrackSize.y += GetSystemMetrics( SM_CYMENU ); //(mbi.rcBar.bottom - mbi.rcBar.top);
+ if (s.iCaptionMenuMode == MODE_SHOWCAPTIONMENU) {
+ lpMMI->ptMinTrackSize.y += GetSystemMetrics( SM_CYMENU ); //(mbi.rcBar.bottom - mbi.rcBar.top);
+ }
//else MODE_HIDEMENU
}
@@ -1315,7 +1316,9 @@ void CMainFrame::OnGetMinMaxInfo(MINMAXINFO* lpMMI) lpMMI->ptMinTrackSize.y += pCB->CalcFixedLayout(TRUE, TRUE).cy - 2; // 2 is a magic value from CSizingControlBar class, i guess this should be GetSystemMetrics( SM_CXBORDER ) or similar
}
}
- if (lpMMI->ptMinTrackSize.y<16) lpMMI->ptMinTrackSize.y = 16;
+ if (lpMMI->ptMinTrackSize.y<16) {
+ lpMMI->ptMinTrackSize.y = 16;
+ }
__super::OnGetMinMaxInfo( lpMMI );
}
@@ -1329,7 +1332,7 @@ void CMainFrame::OnMove(int x, int y) WINDOWPLACEMENT wp;
GetWindowPlacement(&wp);
- if(!m_fFirstFSAfterLaunchOnFS && !m_fFullScreen && wp.flags != WPF_RESTORETOMAXIMIZED && wp.showCmd != SW_SHOWMINIMIZED) {
+ if (!m_fFirstFSAfterLaunchOnFS && !m_fFullScreen && wp.flags != WPF_RESTORETOMAXIMIZED && wp.showCmd != SW_SHOWMINIMIZED) {
GetWindowRect(AfxGetAppSettings().rcLastWindowPos);
}
}
@@ -1338,7 +1341,7 @@ void CMainFrame::OnMoving(UINT fwSide, LPRECT pRect) {
__super::OnMoving(fwSide, pRect);
- if(AfxGetAppSettings().fSnapToDesktopEdges) {
+ if (AfxGetAppSettings().fSnapToDesktopEdges) {
const CPoint threshold(3, 3);
CRect r0 = m_rcDesktop;
@@ -1348,19 +1351,19 @@ void CMainFrame::OnMoving(UINT fwSide, LPRECT pRect) RECT& wr = *pRect;
CSize ws = CRect(wr).Size();
- if(wr.left < r1.left && wr.left > r2.left) {
+ if (wr.left < r1.left && wr.left > r2.left) {
wr.right = (wr.left = r0.left) + ws.cx;
}
- if(wr.top < r1.top && wr.top > r2.top) {
+ if (wr.top < r1.top && wr.top > r2.top) {
wr.bottom = (wr.top = r0.top) + ws.cy;
}
- if(wr.right < r1.right && wr.right > r2.right) {
+ if (wr.right < r1.right && wr.right > r2.right) {
wr.left = (wr.right = r0.right) - ws.cx;
}
- if(wr.bottom < r1.bottom && wr.bottom > r2.bottom) {
+ if (wr.bottom < r1.bottom && wr.bottom > r2.bottom) {
wr.top = (wr.bottom = r0.bottom) - ws.cy;
}
}
@@ -1372,13 +1375,13 @@ void CMainFrame::OnSize(UINT nType, int cx, int cy) m_OSD.OnSize (nType, cx, cy);
- if(nType == SIZE_RESTORED && m_fTrayIcon) {
+ if (nType == SIZE_RESTORED && m_fTrayIcon) {
ShowWindow(SW_SHOW);
}
- if(!m_fFirstFSAfterLaunchOnFS && IsWindowVisible() && !m_fFullScreen) {
+ if (!m_fFirstFSAfterLaunchOnFS && IsWindowVisible() && !m_fFullScreen) {
AppSettings& s = AfxGetAppSettings();
- if(nType != SIZE_MAXIMIZED && nType != SIZE_MINIMIZED) {
+ if (nType != SIZE_MAXIMIZED && nType != SIZE_MINIMIZED) {
GetWindowRect(s.rcLastWindowPos);
}
s.nLastWindowType = nType;
@@ -1393,7 +1396,7 @@ void CMainFrame::OnSizing(UINT fwSide, LPRECT pRect) bool fCtrl = !!(GetAsyncKeyState(VK_CONTROL)&0x80000000);
- if(m_iMediaLoadState != MLS_LOADED || m_fFullScreen
+ if (m_iMediaLoadState != MLS_LOADED || m_fFullScreen
|| s.iDefaultVideoSize == DVS_STRETCH
|| (fCtrl == s.fLimitWindowProportions)) { // remember that fCtrl is initialized with !!whatever(), same with fLimitWindowProportions
return;
@@ -1403,7 +1406,7 @@ void CMainFrame::OnSizing(UINT fwSide, LPRECT pRect) CSize vsize = GetVideoSize();
CSize fsize(0, 0);
- if(!vsize.cx || !vsize.cy) {
+ if (!vsize.cx || !vsize.cy) {
return;
}
@@ -1423,8 +1426,9 @@ void CMainFrame::OnSizing(UINT fwSide, LPRECT pRect) if ( style & WS_CAPTION ) {
fsize.cy += GetSystemMetrics( SM_CYCAPTION );
- if(s.iCaptionMenuMode == MODE_SHOWCAPTIONMENU)
- fsize.cy += GetSystemMetrics( SM_CYMENU ); //mbi.rcBar.bottom - mbi.rcBar.top;
+ if (s.iCaptionMenuMode == MODE_SHOWCAPTIONMENU) {
+ fsize.cy += GetSystemMetrics( SM_CYMENU ); //mbi.rcBar.bottom - mbi.rcBar.top;
+ }
//else MODE_HIDEMENU
}
if ( style & WS_THICKFRAME ) {
@@ -1463,13 +1467,13 @@ void CMainFrame::OnSizing(UINT fwSide, LPRECT pRect) wsize += fsize;
- if(fwSide == WMSZ_TOP || fwSide == WMSZ_BOTTOM || !fWider && (fwSide == WMSZ_TOPRIGHT || fwSide == WMSZ_BOTTOMRIGHT)) {
+ if (fwSide == WMSZ_TOP || fwSide == WMSZ_BOTTOM || !fWider && (fwSide == WMSZ_TOPRIGHT || fwSide == WMSZ_BOTTOMRIGHT)) {
pRect->right = pRect->left + wsize.cx;
- } else if(fwSide == WMSZ_LEFT || fwSide == WMSZ_RIGHT || fWider && (fwSide == WMSZ_BOTTOMLEFT || fwSide == WMSZ_BOTTOMRIGHT)) {
+ } else if (fwSide == WMSZ_LEFT || fwSide == WMSZ_RIGHT || fWider && (fwSide == WMSZ_BOTTOMLEFT || fwSide == WMSZ_BOTTOMRIGHT)) {
pRect->bottom = pRect->top + wsize.cy;
- } else if(!fWider && (fwSide == WMSZ_TOPLEFT || fwSide == WMSZ_BOTTOMLEFT)) {
+ } else if (!fWider && (fwSide == WMSZ_TOPLEFT || fwSide == WMSZ_BOTTOMLEFT)) {
pRect->left = pRect->right - wsize.cx;
- } else if(fWider && (fwSide == WMSZ_TOPLEFT || fwSide == WMSZ_TOPRIGHT)) {
+ } else if (fWider && (fwSide == WMSZ_TOPLEFT || fwSide == WMSZ_TOPRIGHT)) {
pRect->top = pRect->bottom - wsize.cy;
}
}
@@ -1478,7 +1482,7 @@ void CMainFrame::OnDisplayChange() // untested, not sure if it's working... {
TRACE(_T("*** CMainFrame::OnDisplayChange()\n"));
/*
- if(m_iMediaLoadState == MLS_LOADED && m_pCAP)
+ if (m_iMediaLoadState == MLS_LOADED && m_pCAP)
m_pCAP->OnDisplayChange();
*/
@@ -1501,9 +1505,9 @@ void CMainFrame::OnDisplayChange() // untested, not sure if it's working... MoveVideoWindow();
}
}
-
- if(m_iMediaLoadState == MLS_LOADED) {
- if(m_pGraphThread) {
+
+ if (m_iMediaLoadState == MLS_LOADED) {
+ if (m_pGraphThread) {
m_pGraphThread->PostThreadMessage(CGraphThread::TM_DISPLAY_CHANGE, 0, 0);
} else {
DisplayChange();
@@ -1519,7 +1523,7 @@ void CMainFrame::OnSysCommand(UINT nID, LPARAM lParam) if ((GetMediaState() == State_Running && !m_fAudioOnly) && (((nID & 0xFFF0) == SC_SCREENSAVE) || ((nID & 0xFFF0) == SC_MONITORPOWER))) {
TRACE(_T("SC_SCREENSAVE, nID = %d, lParam = %d\n"), nID, lParam);
return;
- } else if((nID & 0xFFF0) == SC_MINIMIZE && m_fTrayIcon) {
+ } else if ((nID & 0xFFF0) == SC_MINIMIZE && m_fTrayIcon) {
ShowWindow(SW_HIDE);
return;
}
@@ -1531,21 +1535,22 @@ void CMainFrame::OnActivateApp(BOOL bActive, DWORD dwThreadID) {
__super::OnActivateApp(bActive, dwThreadID);
- if(AfxGetAppSettings().iOnTop)
+ if (AfxGetAppSettings().iOnTop) {
return;
+ }
MONITORINFO mi;
mi.cbSize = sizeof(MONITORINFO);
GetMonitorInfo(MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST), &mi);
- if(!bActive && (mi.dwFlags&MONITORINFOF_PRIMARY) && m_fFullScreen && m_iMediaLoadState == MLS_LOADED) {
+ if (!bActive && (mi.dwFlags&MONITORINFOF_PRIMARY) && m_fFullScreen && m_iMediaLoadState == MLS_LOADED) {
bool fExitFullscreen = true;
- if(CWnd* pWnd = GetForegroundWindow()) {
+ if (CWnd* pWnd = GetForegroundWindow()) {
HMONITOR hMonitor1 = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST);
HMONITOR hMonitor2 = MonitorFromWindow(pWnd->m_hWnd, MONITOR_DEFAULTTONEAREST);
CMonitors monitors;
- if(hMonitor1 && hMonitor2 && ((hMonitor1 != hMonitor2) || (monitors.GetCount()>1))) {
+ if (hMonitor1 && hMonitor2 && ((hMonitor1 != hMonitor2) || (monitors.GetCount()>1))) {
fExitFullscreen = false;
}
@@ -1554,17 +1559,17 @@ void CMainFrame::OnActivateApp(BOOL bActive, DWORD dwThreadID) CString module;
- if(GetVersion()&0x80000000) {
+ if (GetVersion()&0x80000000) {
module.ReleaseBufferSetLength(GetWindowModuleFileName(pWnd->m_hWnd, module.GetBuffer(_MAX_PATH), _MAX_PATH));
} else {
DWORD pid;
GetWindowThreadProcessId(pWnd->m_hWnd, &pid);
- if(HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid)) {
+ if (HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid)) {
HMODULE hMod;
DWORD cbNeeded;
- if(EnumProcessModules(hProcess, &hMod, sizeof(hMod), &cbNeeded)) {
+ if (EnumProcessModules(hProcess, &hMod, sizeof(hMod), &cbNeeded)) {
module.ReleaseBufferSetLength(GetModuleFileNameEx(hProcess, hMod, module.GetBuffer(_MAX_PATH), _MAX_PATH));
}
@@ -1582,7 +1587,7 @@ void CMainFrame::OnActivateApp(BOOL bActive, DWORD dwThreadID) SendStatusMessage(str, 5000);
}
- if(fExitFullscreen) {
+ if (fExitFullscreen) {
OnViewFullscreen();
}
}
@@ -1593,7 +1598,7 @@ LRESULT CMainFrame::OnAppCommand(WPARAM wParam, LPARAM lParam) UINT cmd = GET_APPCOMMAND_LPARAM(lParam);
UINT uDevice = GET_DEVICE_LPARAM(lParam);
- if(uDevice != FAPPCOMMAND_OEM ||
+ if (uDevice != FAPPCOMMAND_OEM ||
cmd == APPCOMMAND_MEDIA_PLAY || cmd == APPCOMMAND_MEDIA_PAUSE || cmd == APPCOMMAND_MEDIA_CHANNEL_UP ||
cmd == APPCOMMAND_MEDIA_CHANNEL_DOWN || cmd == APPCOMMAND_MEDIA_RECORD ||
cmd == APPCOMMAND_MEDIA_FAST_FORWARD || cmd == APPCOMMAND_MEDIA_REWIND ) {
@@ -1602,14 +1607,14 @@ LRESULT CMainFrame::OnAppCommand(WPARAM wParam, LPARAM lParam) BOOL fRet = FALSE;
POSITION pos = s.wmcmds.GetHeadPosition();
- while(pos) {
+ while (pos) {
wmcmd& wc = s.wmcmds.GetNext(pos);
- if(wc.appcmd == cmd && TRUE == SendMessage(WM_COMMAND, wc.cmd)) {
+ if (wc.appcmd == cmd && TRUE == SendMessage(WM_COMMAND, wc.cmd)) {
fRet = TRUE;
}
}
- if(fRet) {
+ if (fRet) {
return TRUE;
}
}
@@ -1646,9 +1651,9 @@ void CMainFrame::OnRawInput(UINT nInputcode, HRAWINPUT hRawInput) case MCE_MEDIA_NEXTTRACK :
case MCE_MEDIA_PREVIOUSTRACK :
POSITION pos = s.wmcmds.GetHeadPosition();
- while(pos) {
+ while (pos) {
wmcmd& wc = s.wmcmds.GetNext(pos);
- if(wc.appcmd == nMceCmd) {
+ if (wc.appcmd == nMceCmd) {
SendMessage(WM_COMMAND, wc.cmd);
break;
}
@@ -1665,7 +1670,7 @@ LRESULT CMainFrame::OnHotKey(WPARAM wParam, LPARAM lParam) if (GetActiveWindow() == this || s.fGlobalMedia == TRUE) {
POSITION pos = s.wmcmds.GetHeadPosition();
- while(pos) {
+ while (pos) {
wmcmd& wc = s.wmcmds.GetNext(pos);
if (wc.appcmd == wParam && TRUE == SendMessage(WM_COMMAND, wc.cmd)) {
fRet = TRUE;
@@ -1683,10 +1688,10 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) {
switch (nIDEvent) {
case TIMER_STREAMPOSPOLLER:
- if(m_iMediaLoadState == MLS_LOADED) {
+ if (m_iMediaLoadState == MLS_LOADED) {
REFERENCE_TIME rtNow = 0, rtDur = 0;
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
pMS->GetCurrentPosition(&rtNow);
pMS->GetDuration(&rtDur);
@@ -1703,7 +1708,7 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) m_lSubtitleShift = 0;
}
- if(!m_fEndOfStream) {
+ if (!m_fEndOfStream) {
AppSettings& s = AfxGetAppSettings();
FILE_POSITION* FilePosition = s.CurrentFilePosition();
if (FilePosition) {
@@ -1713,7 +1718,7 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) QueryPerformanceCounter(&time);
LARGE_INTEGER freq;
QueryPerformanceFrequency(&freq);
- if((time.QuadPart - m_LastSaveTime.QuadPart) >= 30 * freq.QuadPart) { // save every half of minute
+ if ((time.QuadPart - m_LastSaveTime.QuadPart) >= 30 * freq.QuadPart) { // save every half of minute
m_LastSaveTime = time;
if (s.fKeepHistory && s.fRememberFilePos) {
s.SaveCurrentFilePosition();
@@ -1722,7 +1727,7 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) }
}
- if(m_rtDurationOverride >= 0) {
+ if (m_rtDurationOverride >= 0) {
rtDur = m_rtDurationOverride;
}
@@ -1734,16 +1739,16 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) m_OSD.SetPos (rtNow);
m_Lcd.SetMediaRange(0, rtDur);
m_Lcd.SetMediaPos(rtNow);
- } else if(GetPlaybackMode() == PM_CAPTURE) {
+ } else if (GetPlaybackMode() == PM_CAPTURE) {
pMS->GetCurrentPosition(&rtNow);
- if(m_fCapturing && m_wndCaptureBar.m_capdlg.m_pMux) {
+ if (m_fCapturing && m_wndCaptureBar.m_capdlg.m_pMux) {
CComQIPtr<IMediaSeeking> pMuxMS = m_wndCaptureBar.m_capdlg.m_pMux;
- if(!pMuxMS || FAILED(pMuxMS->GetCurrentPosition(&rtNow))) {
+ if (!pMuxMS || FAILED(pMuxMS->GetCurrentPosition(&rtNow))) {
rtNow = 0;
}
}
- if(m_rtDurationOverride >= 0) {
+ if (m_rtDurationOverride >= 0) {
rtDur = m_rtDurationOverride;
}
@@ -1756,9 +1761,9 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) m_Lcd.SetMediaRange(0, rtDur);
m_Lcd.SetMediaPos(rtNow);
/*
- if(m_fCapturing)
+ if (m_fCapturing)
{
- if(rtNow > 10000i64*1000*60*60*3)
+ if (rtNow > 10000i64*1000*60*60*3)
{
m_wndCaptureBar.m_capdlg.OnRecord();
}
@@ -1766,7 +1771,7 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) */
}
- if(m_pCAP && GetPlaybackMode() != PM_FILE) {
+ if (m_pCAP && GetPlaybackMode() != PM_FILE) {
g_bExternalSubtitleTime = true;
if (pDVDI) {
DVD_PLAYBACK_LOCATION2 Location;
@@ -1799,11 +1804,11 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) GUID tf;
pMS->GetTimeFormat(&tf);
- if(GetPlaybackMode() == PM_CAPTURE && !m_fCapturing) {
+ if (GetPlaybackMode() == PM_CAPTURE && !m_fCapturing) {
CString str = _T("Live");
long lChannel = 0, lVivSub = 0, lAudSub = 0;
- if(pAMTuner
+ if (pAMTuner
&& m_wndCaptureBar.m_capdlg.IsTunerActive()
&& SUCCEEDED(pAMTuner->get_Channel(&lChannel, &lVivSub, &lAudSub))) {
CString ch;
@@ -1822,7 +1827,7 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) m_wndSubresyncBar.SetTime(pos);
- if(m_pCAP && GetMediaState() == State_Paused) {
+ if (m_pCAP && GetMediaState() == State_Paused) {
m_pCAP->Paint(false);
}
}
@@ -1836,8 +1841,8 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) bool fCursorOutside = !r.PtInRect(p);
CWnd* pWnd = WindowFromPoint(p);
- if(pWnd && (m_wndView == *pWnd || m_wndView.IsChild(pWnd) || fCursorOutside)) {
- if(AfxGetAppSettings().nShowBarsWhenFullScreenTimeOut >= 0) {
+ if (pWnd && (m_wndView == *pWnd || m_wndView.IsChild(pWnd) || fCursorOutside)) {
+ if (AfxGetAppSettings().nShowBarsWhenFullScreenTimeOut >= 0) {
ShowControls(CS_NONE, false);
}
}
@@ -1859,7 +1864,7 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) KillTimer(TIMER_FULLSCREENMOUSEHIDER);
} else {
CWnd* pWnd = WindowFromPoint(p);
- if(pWnd && (m_wndView == *pWnd || m_wndView.IsChild(pWnd) || fCursorOutside)) {
+ if (pWnd && (m_wndView == *pWnd || m_wndView.IsChild(pWnd) || fCursorOutside)) {
m_fHideCursor = true;
SetCursor(NULL);
}
@@ -1867,15 +1872,15 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) }
break;
case TIMER_STATS: {
- if(pQP) {
+ if (pQP) {
CString rate;
- if(m_iSpeedLevel >= -11 && m_iSpeedLevel <= 3 && m_iSpeedLevel != -4) {
+ if (m_iSpeedLevel >= -11 && m_iSpeedLevel <= 3 && m_iSpeedLevel != -4) {
CString speeds[] = {_T("1/8"),_T("1/4"),_T("1/2"),_T("1"),_T("2"),_T("4"),_T("8")};
rate = speeds[(m_iSpeedLevel >= -3 ? m_iSpeedLevel : (-m_iSpeedLevel - 8)) + 3];
- if(m_iSpeedLevel < -4) {
+ if (m_iSpeedLevel < -4) {
rate = _T("-") + rate;
}
- if(!rate.IsEmpty()) {
+ if (!rate.IsEmpty()) {
rate = _T("(") + rate + _T("X)");
}
}
@@ -1904,19 +1909,19 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) m_wndStatsBar.SetLine(_T("Jitter"), info);
}
- if(pBI) {
+ if (pBI) {
CAtlList<CString> sl;
- for(int i = 0, j = pBI->GetCount(); i < j; i++) {
+ for (int i = 0, j = pBI->GetCount(); i < j; i++) {
int samples, size;
- if(S_OK == pBI->GetStatus(i, samples, size)) {
+ if (S_OK == pBI->GetStatus(i, samples, size)) {
CString str;
str.Format(_T("[%d]: %03d/%d KB"), i, samples, size / 1024);
sl.AddTail(str);
}
}
- if(!sl.IsEmpty()) {
+ if (!sl.IsEmpty()) {
CString str;
str.Format(_T("%s (p%d)"), Implode(sl, ' '), pBI->GetPriority());
@@ -1928,28 +1933,28 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) BeginEnumFilters(pGB, pEF, pBF) {
BeginEnumPins(pBF, pEP, pPin) {
- if(CComQIPtr<IBitRateInfo> pBRI = pPin) {
+ if (CComQIPtr<IBitRateInfo> pBRI = pPin) {
pBRIs.AddTail(pBRI);
}
}
EndEnumPins;
- if(!pBRIs.IsEmpty()) {
+ if (!pBRIs.IsEmpty()) {
CAtlList<CString> sl;
POSITION pos = pBRIs.GetHeadPosition();
- for(int i = 0; pos; i++) {
+ for (int i = 0; pos; i++) {
IBitRateInfo* pBRI = pBRIs.GetNext(pos);
DWORD cur = pBRI->GetCurrentBitRate() / 1000;
DWORD avg = pBRI->GetAverageBitRate() / 1000;
- if(avg == 0) {
+ if (avg == 0) {
continue;
}
CString str;
- if(cur != avg) {
+ if (cur != avg) {
str.Format(_T("[%d]: %d/%d Kb/s"), i, avg, cur);
} else {
str.Format(_T("[%d]: %d Kb/s"), i, avg);
@@ -1957,7 +1962,7 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) sl.AddTail(str);
}
- if(!sl.IsEmpty()) {
+ if (!sl.IsEmpty()) {
m_wndStatsBar.SetLine(_T("Bitrate"), Implode(sl, ' ') + _T(" (avg/cur)"));
}
@@ -1966,11 +1971,11 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) }
EndEnumFilters;
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
SetupChapters();
}
- if(GetPlaybackMode() == PM_DVD) { // we also use this timer to update the info panel for DVD playback
+ if (GetPlaybackMode() == PM_DVD) { // we also use this timer to update the info panel for DVD playback
ULONG ulAvailable, ulCurrent;
// Location
@@ -1983,7 +1988,7 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) ULONG ulNumOfTitles;
ULONG ulNumOfChapters;
- if(SUCCEEDED(pDVDI->GetCurrentLocation(&loc))
+ if (SUCCEEDED(pDVDI->GetCurrentLocation(&loc))
&& SUCCEEDED(pDVDI->GetNumberOfChapters(loc.TitleNum, &ulNumOfChapters))
&& SUCCEEDED(pDVDI->GetDVDVolumeInfo(&ulNumOfVolumes, &ulVolume, &Side, &ulNumOfTitles))) {
Location.Format(ResStr(IDS_MAINFRM_9),
@@ -2015,7 +2020,7 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) DVD_VideoAttributes VATR;
- if(SUCCEEDED(pDVDI->GetCurrentAngle(&ulAvailable, &ulCurrent))
+ if (SUCCEEDED(pDVDI->GetCurrentAngle(&ulAvailable, &ulCurrent))
&& SUCCEEDED(pDVDI->GetCurrentVideoAttributes(&VATR))) {
Video.Format(ResStr(IDS_MAINFRM_10),
ulAvailable, ulCurrent,
@@ -2031,13 +2036,13 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) DVD_AudioAttributes AATR;
- if(SUCCEEDED(pDVDI->GetCurrentAudio(&ulAvailable, &ulCurrent))
+ if (SUCCEEDED(pDVDI->GetCurrentAudio(&ulAvailable, &ulCurrent))
&& SUCCEEDED(pDVDI->GetAudioAttributes(ulCurrent, &AATR))) {
CString lang;
int len = GetLocaleInfo(AATR.Language, LOCALE_SENGLANGUAGE, lang.GetBuffer(64), 64);
lang.ReleaseBufferSetLength(max(len-1, 0));
- switch(AATR.LanguageExtension) {
+ switch (AATR.LanguageExtension) {
case DVD_AUD_EXT_NotSpecified:
default:
break;
@@ -2080,13 +2085,13 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) BOOL bIsDisabled;
DVD_SubpictureAttributes SATR;
- if(SUCCEEDED(pDVDI->GetCurrentSubpicture(&ulAvailable, &ulCurrent, &bIsDisabled))
+ if (SUCCEEDED(pDVDI->GetCurrentSubpicture(&ulAvailable, &ulCurrent, &bIsDisabled))
&& SUCCEEDED(pDVDI->GetSubpictureAttributes(ulCurrent, &SATR))) {
CString lang;
int len = GetLocaleInfo(SATR.Language, LOCALE_SENGLANGUAGE, lang.GetBuffer(64), 64);
lang.ReleaseBufferSetLength(max(len-1, 0));
- switch(SATR.LanguageExtension) {
+ switch (SATR.LanguageExtension) {
case DVD_SP_EXT_NotSpecified:
default:
break;
@@ -2122,7 +2127,7 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) break;
}
- if(bIsDisabled) {
+ if (bIsDisabled) {
lang = _T("-");
}
@@ -2133,15 +2138,15 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent) m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_SUBTITLES), Subtitles);
}
- if(GetMediaState() == State_Running && !m_fAudioOnly) {
+ if (GetMediaState() == State_Running && !m_fAudioOnly) {
UINT fSaverActive = 0;
- if(SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, (PVOID)&fSaverActive, 0)) {
+ if (SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, (PVOID)&fSaverActive, 0)) {
SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 0, 0, SPIF_SENDWININICHANGE); // this might not be needed at all...
SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, fSaverActive, 0, SPIF_SENDWININICHANGE);
}
fSaverActive = 0;
- if(SystemParametersInfo(SPI_GETPOWEROFFACTIVE, 0, (PVOID)&fSaverActive, 0)) {
+ if (SystemParametersInfo(SPI_GETPOWEROFFACTIVE, 0, (PVOID)&fSaverActive, 0)) {
SystemParametersInfo(SPI_SETPOWEROFFACTIVE, 0, 0, SPIF_SENDWININICHANGE); // this might not be needed at all...
SystemParametersInfo(SPI_SETPOWEROFFACTIVE, fSaverActive, 0, SPIF_SENDWININICHANGE);
}
@@ -2168,7 +2173,7 @@ static bool SetShutdownPrivilege() SetThreadExecutionState (ES_CONTINUOUS);
// Get a token for this process.
- if(!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) {
+ if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) {
return(false);
}
@@ -2183,7 +2188,7 @@ static bool SetShutdownPrivilege() AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES)NULL, 0);
- if(GetLastError() != ERROR_SUCCESS) {
+ if (GetLastError() != ERROR_SUCCESS) {
return false;
}
@@ -2196,29 +2201,29 @@ bool CMainFrame::DoAfterPlaybackEvent() bool fExit = false;
- if(s.nCLSwitches&CLSW_CLOSE || s.fExitAfterPlayback) {
+ if (s.nCLSwitches&CLSW_CLOSE || s.fExitAfterPlayback) {
fExit = true;
}
- if(s.nCLSwitches&CLSW_STANDBY) {
+ if (s.nCLSwitches&CLSW_STANDBY) {
SetShutdownPrivilege();
SetSystemPowerState(TRUE, FALSE);
fExit = true; // TODO: unless the app closes, it will call standby or hibernate once again forever, how to avoid that?
- } else if(s.nCLSwitches&CLSW_HIBERNATE) {
+ } else if (s.nCLSwitches&CLSW_HIBERNATE) {
SetShutdownPrivilege();
SetSystemPowerState(FALSE, FALSE);
fExit = true; // TODO: unless the app closes, it will call standby or hibernate once again forever, how to avoid that?
- } else if(s.nCLSwitches&CLSW_SHUTDOWN) {
+ } else if (s.nCLSwitches&CLSW_SHUTDOWN) {
SetShutdownPrivilege();
ExitWindowsEx(EWX_SHUTDOWN|EWX_POWEROFF|EWX_FORCEIFHUNG, 0);
fExit = true;
- } else if(s.nCLSwitches&CLSW_LOGOFF) {
+ } else if (s.nCLSwitches&CLSW_LOGOFF) {
SetShutdownPrivilege();
ExitWindowsEx(EWX_LOGOFF|EWX_FORCEIFHUNG, 0);
fExit = true;
}
- if(!fExit) {
+ if (!fExit) {
return false;
}
@@ -2243,21 +2248,21 @@ bool CMainFrame::GraphEventComplete( ) }
}
- if(m_wndPlaylistBar.GetCount() <= 1) {
+ if (m_wndPlaylistBar.GetCount() <= 1) {
m_nLoops++;
- if(DoAfterPlaybackEvent()) {
+ if (DoAfterPlaybackEvent()) {
return false;
}
- if(s.fLoopForever || m_nLoops < s.nLoops) {
- if(GetMediaState() == State_Stopped) {
+ if (s.fLoopForever || m_nLoops < s.nLoops) {
+ if (GetMediaState() == State_Stopped) {
SendMessage(WM_COMMAND, ID_PLAY_PLAY);
} else {
LONGLONG pos = 0;
pMS->SetPositions(&pos, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning);
- if(GetMediaState() == State_Paused) {
+ if (GetMediaState() == State_Paused) {
SendMessage(WM_COMMAND, ID_PLAY_PLAY);
}
}
@@ -2267,7 +2272,7 @@ bool CMainFrame::GraphEventComplete( ) NextMediaExist = SearchInDir(true);
}
if (!s.fNextInDirAfterPlayback || !(NextMediaExist>1)) {
- if(s.fRewind) {
+ if (s.fRewind) {
SendMessage(WM_COMMAND, ID_PLAY_STOP);
} else {
m_fEndOfStream = true;
@@ -2275,7 +2280,7 @@ bool CMainFrame::GraphEventComplete( ) }
m_OSD.ClearMessage();
- if(m_fFullScreen && s.fExitFullScreenAtTheEnd) {
+ if (m_fFullScreen && s.fExitFullScreenAtTheEnd) {
OnViewFullscreen();
}
}
@@ -2284,25 +2289,25 @@ bool CMainFrame::GraphEventComplete( ) // Don't move it. Else OSD message "Pause" will rewrite this message.
}
}
- } else if(m_wndPlaylistBar.GetCount() > 1) {
- if(m_wndPlaylistBar.IsAtEnd()) {
- if(DoAfterPlaybackEvent()) {
+ } else if (m_wndPlaylistBar.GetCount() > 1) {
+ if (m_wndPlaylistBar.IsAtEnd()) {
+ if (DoAfterPlaybackEvent()) {
return false;
}
m_nLoops++;
}
- if(s.fLoopForever || m_nLoops < s.nLoops) {
+ if (s.fLoopForever || m_nLoops < s.nLoops) {
int nLoops = m_nLoops;
PostMessage(WM_COMMAND, ID_NAVIGATE_SKIPFORWARD);
m_nLoops = nLoops;
} else {
- if(m_fFullScreen && s.fExitFullScreenAtTheEnd) {
+ if (m_fFullScreen && s.fExitFullScreenAtTheEnd) {
OnViewFullscreen();
}
- if(s.fRewind) {
+ if (s.fRewind) {
s.nCLSwitches |= CLSW_OPEN; // HACK
PostMessage(WM_COMMAND, ID_NAVIGATE_SKIPFORWARD);
} else {
@@ -2325,14 +2330,14 @@ LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam) LONG evCode;
LONG_PTR evParam1, evParam2;
- while(pME && SUCCEEDED(pME->GetEvent(&evCode, &evParam1, &evParam2, 0))) {
+ while (pME && SUCCEEDED(pME->GetEvent(&evCode, &evParam1, &evParam2, 0))) {
#ifdef _DEBUG
TRACE("--> CMainFrame::OnGraphNotify on thread: %d; event: 0x%08x (%ws)\n", GetCurrentThreadId(), evCode, GetEventString(evCode));
#endif
CString str;
- if(m_fCustomGraph) {
- if(EC_BG_ERROR == evCode) {
+ if (m_fCustomGraph) {
+ if (EC_BG_ERROR == evCode) {
str = CString((char*)evParam1);
}
}
@@ -2343,7 +2348,7 @@ LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam) hr = pME->FreeEventParams(evCode, evParam1, evParam2);
- switch(evCode) {
+ switch (evCode) {
case EC_COMPLETE:
if (!GraphEventComplete()) {
return hr;
@@ -2358,14 +2363,14 @@ LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam) m_fBuffering = ((HRESULT)evParam1 != S_OK);
break;
case EC_STEP_COMPLETE:
- if(m_fFrameSteppingActive) {
+ if (m_fFrameSteppingActive) {
m_nStepForwardCount++;
m_fFrameSteppingActive = false;
pBA->put_Volume(m_VolumeBeforeFrameStepping);
}
break;
case EC_DEVICE_LOST:
- if(GetPlaybackMode() == PM_CAPTURE && evParam2 == 0) {
+ if (GetPlaybackMode() == PM_CAPTURE && evParam2 == 0) {
CComQIPtr<IBaseFilter> pBF = (IUnknown*)evParam1;
if (!pVidCap && pVidCap == pBF || !pAudCap && pAudCap == pBF) {
SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA);
@@ -2379,12 +2384,12 @@ LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam) DvdPos->lTitle = (DWORD)evParam1;
}
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
SetupChapters();
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
m_iDVDTitle = (DWORD)evParam1;
- if(m_iDVDDomain == DVD_DOMAIN_Title) {
+ if (m_iDVDDomain == DVD_DOMAIN_Title) {
CString Domain;
Domain.Format(ResStr(IDS_AG_TITLE), m_iDVDTitle);
m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_DOMAIN), Domain);
@@ -2397,7 +2402,7 @@ LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam) CString Domain('-');
- switch(m_iDVDDomain) {
+ switch (m_iDVDDomain) {
case DVD_DOMAIN_FirstPlay:
ULONGLONG llDVDGuid;
@@ -2565,7 +2570,7 @@ LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam) DVD_HMSF_TIMECODE tcDur;
ULONG ulFlags;
- if(SUCCEEDED(pDVDI->GetTotalTitleTime(&tcDur, &ulFlags))) {
+ if (SUCCEEDED(pDVDI->GetTotalTitleTime(&tcDur, &ulFlags))) {
rtDur = HMSF2RT(tcDur, fps);
}
@@ -2587,7 +2592,7 @@ LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam) m_OSD.SetPos(rtNow);
m_Lcd.SetMediaPos(rtNow);
- if(m_pSubClock) {
+ if (m_pSubClock) {
m_pSubClock->SetTime(rtNow);
}
}
@@ -2597,7 +2602,7 @@ LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam) CString err;
- switch(evParam1) {
+ switch (evParam1) {
case DVD_ERROR_Unexpected:
default:
err = ResStr(IDS_MAINFRM_16);
@@ -2643,7 +2648,7 @@ LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam) CSize size(evParam1);
m_fAudioOnly = (size.cx <= 0 || size.cy <= 0);
- if(s.fRememberZoomLevel
+ if (s.fRememberZoomLevel
&& !(m_fFullScreen || wp.showCmd == SW_SHOWMAXIMIZED || wp.showCmd == SW_SHOWMINIMIZED)) {
ZoomVideoWindow();
} else {
@@ -2658,7 +2663,7 @@ LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam) }
break;
case EC_BG_AUDIO_CHANGED:
- if(m_fCustomGraph) {
+ if (m_fCustomGraph) {
int nAudioChannels = evParam1;
m_wndStatusBar.SetStatusBitmap(nAudioChannels == 1 ? IDB_MONO
@@ -2667,7 +2672,7 @@ LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam) }
break;
case EC_BG_ERROR:
- if(m_fCustomGraph) {
+ if (m_fCustomGraph) {
SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA);
m_closingmsg = !str.IsEmpty() ? str : _T("Unspecified graph error");
m_wndPlaylistBar.SetCurValid(false);
@@ -2675,7 +2680,7 @@ LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam) }
break;
case EC_DVD_PLAYBACK_RATE_CHANGE:
- if(m_fCustomGraph && s.AutoChangeFullscrRes.bEnabled &&
+ if (m_fCustomGraph && s.AutoChangeFullscrRes.bEnabled &&
m_fFullScreen && m_iDVDDomain == DVD_DOMAIN_Title) {
AutoChangeMonitorMode();
}
@@ -2690,7 +2695,7 @@ LRESULT CMainFrame::OnResetDevice( WPARAM wParam, LPARAM lParam ) {
OAFilterState fs = State_Stopped;
pMC->GetState(0, &fs);
- if(fs == State_Running) {
+ if (fs == State_Running) {
pMC->Pause();
}
@@ -2703,7 +2708,7 @@ LRESULT CMainFrame::OnResetDevice( WPARAM wParam, LPARAM lParam ) ResetDevice();
}
- if(fs == State_Running) {
+ if (fs == State_Running) {
pMC->Run();
}
return S_OK;
@@ -2719,15 +2724,15 @@ LRESULT CMainFrame::OnResumeFromState(WPARAM wParam, LPARAM lParam) {
int iPlaybackMode = (int)wParam;
- if(iPlaybackMode == PM_FILE) {
+ if (iPlaybackMode == PM_FILE) {
SeekTo(10000i64*int(lParam));
- } else if(iPlaybackMode == PM_DVD) {
+ } else if (iPlaybackMode == PM_DVD) {
CComPtr<IDvdState> pDvdState;
pDvdState.Attach((IDvdState*)lParam);
- if(pDVDC) {
+ if (pDVDC) {
pDVDC->SetState(pDvdState, DVD_CMD_FLAG_Block, NULL);
}
- } else if(iPlaybackMode == PM_CAPTURE) {
+ } else if (iPlaybackMode == PM_CAPTURE) {
// not implemented
} else {
ASSERT(0);
@@ -2749,14 +2754,14 @@ BOOL CMainFrame::OnButton(UINT id, UINT nFlags, CPoint point) m_wndView.MapWindowPoints(this, &r);
}
- if(id != wmcmd::WDOWN && id != wmcmd::WUP && !r.PtInRect(point)) {
+ if (id != wmcmd::WDOWN && id != wmcmd::WUP && !r.PtInRect(point)) {
return FALSE;
}
BOOL ret = FALSE;
WORD cmd = assignedToCmd(id);
- if(cmd) {
+ if (cmd) {
SendMessage(WM_COMMAND, cmd);
ret = TRUE;
}
@@ -2773,24 +2778,24 @@ void CMainFrame::OnLButtonDown(UINT nFlags, CPoint point) bool fClicked = false;
- if(GetPlaybackMode() == PM_DVD) {
+ if (GetPlaybackMode() == PM_DVD) {
CPoint p = point - m_wndView.GetVideoRect().TopLeft();
- if(SUCCEEDED(pDVDC->ActivateAtPosition(p))
+ if (SUCCEEDED(pDVDC->ActivateAtPosition(p))
|| m_iDVDDomain == DVD_DOMAIN_VideoManagerMenu
|| m_iDVDDomain == DVD_DOMAIN_VideoTitleSetMenu) {
fClicked = true;
}
}
- if(!fClicked) {
+ if (!fClicked) {
bool fLeftMouseBtnUnassigned = !assignedToCmd(wmcmd::LDOWN);
- if(!m_fFullScreen && ((IsCaptionHidden() && AfxGetAppSettings().nCS<=CS_SEEKBAR) || fLeftMouseBtnUnassigned)) {
+ if (!m_fFullScreen && ((IsCaptionHidden() && AfxGetAppSettings().nCS<=CS_SEEKBAR) || fLeftMouseBtnUnassigned)) {
PostMessage(WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(point.x, point.y));
} else {
s_fLDown = true;
- if(OnButton(wmcmd::LDOWN, nFlags, point)) {
+ if (OnButton(wmcmd::LDOWN, nFlags, point)) {
return;
}
}
@@ -2803,7 +2808,7 @@ void CMainFrame::OnLButtonDown(UINT nFlags, CPoint point) void CMainFrame::OnLButtonUp(UINT nFlags, CPoint point)
{
if (!m_pFullscreenWnd->IsWindow() || !m_OSD.OnLButtonUp (nFlags, point)) {
- if(!OnButton(wmcmd::LUP, nFlags, point)) {
+ if (!OnButton(wmcmd::LUP, nFlags, point)) {
__super::OnLButtonUp(nFlags, point);
}
}
@@ -2811,11 +2816,11 @@ void CMainFrame::OnLButtonUp(UINT nFlags, CPoint point) void CMainFrame::OnLButtonDblClk(UINT nFlags, CPoint point)
{
- if(s_fLDown) {
+ if (s_fLDown) {
SendMessage(WM_LBUTTONDOWN, nFlags, MAKELPARAM(point.x, point.y));
s_fLDown = false;
}
- if(!OnButton(wmcmd::LDBLCLK, nFlags, point)) {
+ if (!OnButton(wmcmd::LDBLCLK, nFlags, point)) {
__super::OnLButtonDblClk(nFlags, point);
}
}
@@ -2823,14 +2828,14 @@ void CMainFrame::OnLButtonDblClk(UINT nFlags, CPoint point) void CMainFrame::OnMButtonDown(UINT nFlags, CPoint point)
{
SendMessage(WM_CANCELMODE);
- if(!OnButton(wmcmd::MDOWN, nFlags, point)) {
+ if (!OnButton(wmcmd::MDOWN, nFlags, point)) {
__super::OnMButtonDown(nFlags, point);
}
}
void CMainFrame::OnMButtonUp(UINT nFlags, CPoint point)
{
- if(!OnButton(wmcmd::MUP, nFlags, point)) {
+ if (!OnButton(wmcmd::MUP, nFlags, point)) {
__super::OnMButtonUp(nFlags, point);
}
}
@@ -2838,21 +2843,21 @@ void CMainFrame::OnMButtonUp(UINT nFlags, CPoint point) void CMainFrame::OnMButtonDblClk(UINT nFlags, CPoint point)
{
SendMessage(WM_MBUTTONDOWN, nFlags, MAKELPARAM(point.x, point.y));
- if(!OnButton(wmcmd::MDBLCLK, nFlags, point)) {
+ if (!OnButton(wmcmd::MDBLCLK, nFlags, point)) {
__super::OnMButtonDblClk(nFlags, point);
}
}
void CMainFrame::OnRButtonDown(UINT nFlags, CPoint point)
{
- if(!OnButton(wmcmd::RDOWN, nFlags, point)) {
+ if (!OnButton(wmcmd::RDOWN, nFlags, point)) {
__super::OnRButtonDown(nFlags, point);
}
}
void CMainFrame::OnRButtonUp(UINT nFlags, CPoint point)
{
- if(!OnButton(wmcmd::RUP, nFlags, point)) {
+ if (!OnButton(wmcmd::RUP, nFlags, point)) {
__super::OnRButtonUp(nFlags, point);
}
}
@@ -2860,7 +2865,7 @@ void CMainFrame::OnRButtonUp(UINT nFlags, CPoint point) void CMainFrame::OnRButtonDblClk(UINT nFlags, CPoint point)
{
SendMessage(WM_RBUTTONDOWN, nFlags, MAKELPARAM(point.x, point.y));
- if(!OnButton(wmcmd::RDBLCLK, nFlags, point)) {
+ if (!OnButton(wmcmd::RDBLCLK, nFlags, point)) {
__super::OnRButtonDblClk(nFlags, point);
}
}
@@ -2909,7 +2914,7 @@ void CMainFrame::OnMouseMove(UINT nFlags, CPoint point) }
if (!m_OSD.OnMouseMove (nFlags, point)) {
- if(GetPlaybackMode() == PM_DVD) {
+ if (GetPlaybackMode() == PM_DVD) {
CPoint vp = point - m_wndView.GetVideoRect().TopLeft();
pDVDC->SelectAtPosition(vp);
}
@@ -2926,12 +2931,12 @@ void CMainFrame::OnMouseMove(UINT nFlags, CPoint point) KillTimer(TIMER_FULLSCREENMOUSEHIDER);
SetTimer(TIMER_FULLSCREENMOUSEHIDER, 2000, NULL);
}
- } else if(m_fFullScreen && (abs(diff.cx)+abs(diff.cy)) >= 1) {
+ } else if (m_fFullScreen && (abs(diff.cx)+abs(diff.cy)) >= 1) {
int nTimeOut = s.nShowBarsWhenFullScreenTimeOut;
- if(nTimeOut < 0) {
+ if (nTimeOut < 0) {
m_fHideCursor = false;
- if(s.fShowBarsWhenFullScreen) {
+ if (s.fShowBarsWhenFullScreen) {
ShowControls(s.nCS);
if (GetPlaybackMode() == PM_CAPTURE && !s.fHideNavigation && s.iDefaultCaptureDevice == 1) {
m_wndNavigationBar.m_navdlg.UpdateElementList();
@@ -2941,23 +2946,23 @@ void CMainFrame::OnMouseMove(UINT nFlags, CPoint point) KillTimer(TIMER_FULLSCREENCONTROLBARHIDER);
SetTimer(TIMER_FULLSCREENMOUSEHIDER, 2000, NULL);
- } else if(nTimeOut == 0) {
+ } else if (nTimeOut == 0) {
CRect r;
GetClientRect(r);
r.top = r.bottom;
POSITION pos = m_bars.GetHeadPosition();
- for(int i = 1; pos; i <<= 1) {
+ for (int i = 1; pos; i <<= 1) {
CControlBar* pNext = m_bars.GetNext(pos);
CSize size = pNext->CalcFixedLayout(FALSE, TRUE);
- if(s.nCS&i) {
+ if (s.nCS&i) {
r.top -= size.cy;
}
}
// HACK: the controls would cover the menu too early hiding some buttons
- if(GetPlaybackMode() == PM_DVD
+ if (GetPlaybackMode() == PM_DVD
&& (m_iDVDDomain == DVD_DOMAIN_VideoManagerMenu
|| m_iDVDDomain == DVD_DOMAIN_VideoTitleSetMenu)) {
r.top = r.bottom - 10;
@@ -2965,12 +2970,12 @@ void CMainFrame::OnMouseMove(UINT nFlags, CPoint point) m_fHideCursor = false;
- if(r.PtInRect(point)) {
- if(s.fShowBarsWhenFullScreen) {
+ if (r.PtInRect(point)) {
+ if (s.fShowBarsWhenFullScreen) {
ShowControls(s.nCS);
}
} else {
- if(s.fShowBarsWhenFullScreen) {
+ if (s.fShowBarsWhenFullScreen) {
ShowControls(CS_NONE, false);
}
}
@@ -2985,13 +2990,13 @@ void CMainFrame::OnMouseMove(UINT nFlags, CPoint point) m_fHideCursor = false;
- if(rLeft.PtInRect(point)) {
- if(s.fShowBarsWhenFullScreen) {
+ if (rLeft.PtInRect(point)) {
+ if (s.fShowBarsWhenFullScreen) {
m_wndNavigationBar.m_navdlg.UpdateElementList();
m_wndNavigationBar.ShowControls(this, TRUE);
}
} else {
- if(s.fShowBarsWhenFullScreen) {
+ if (s.fShowBarsWhenFullScreen) {
m_wndNavigationBar.ShowControls(this, FALSE);
}
}
@@ -3000,7 +3005,7 @@ void CMainFrame::OnMouseMove(UINT nFlags, CPoint point) SetTimer(TIMER_FULLSCREENMOUSEHIDER, 2000, NULL);
} else {
m_fHideCursor = false;
- if(s.fShowBarsWhenFullScreen) {
+ if (s.fShowBarsWhenFullScreen) {
ShowControls(s.nCS);
}
@@ -3024,12 +3029,13 @@ LRESULT CMainFrame::OnNcHitTest(CPoint point) void CMainFrame::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
bool Shift_State = !!(::GetKeyState(VK_SHIFT)&0x8000);
- if(AfxGetAppSettings().fFastSeek)
+ if (AfxGetAppSettings().fFastSeek) {
Shift_State = !Shift_State;
+ }
- if(pScrollBar->IsKindOf(RUNTIME_CLASS(CVolumeCtrl))) {
+ if (pScrollBar->IsKindOf(RUNTIME_CLASS(CVolumeCtrl))) {
OnPlayVolume(0);
- } else if(pScrollBar->IsKindOf(RUNTIME_CLASS(CPlayerSeekBar)) && m_iMediaLoadState == MLS_LOADED) {
+ } else if (pScrollBar->IsKindOf(RUNTIME_CLASS(CPlayerSeekBar)) && m_iMediaLoadState == MLS_LOADED) {
SeekTo(m_wndSeekBar.GetPos(), Shift_State);
} else if (m_pVideoWnd == m_pVideoWnd) {
SeekTo(m_OSD.GetPos(), Shift_State);
@@ -3045,22 +3051,22 @@ void CMainFrame::OnInitMenu(CMenu* pMenu) MENUITEMINFO mii;
mii.cbSize = sizeof(mii);
- for(UINT i = 0, j = pMenu->GetMenuItemCount(); i < j; i++) {
+ for (UINT i = 0, j = pMenu->GetMenuItemCount(); i < j; i++) {
CString str;
pMenu->GetMenuString(i, str, MF_BYPOSITION);
CMenu* pSubMenu = NULL;
- if(str == ResStr(IDS_FAVORITES_POPUP)) {
+ if (str == ResStr(IDS_FAVORITES_POPUP)) {
SetupFavoritesSubMenu();
pSubMenu = &m_favorites;
}
- if(str == ResStr(IDS_RECENT_FILES_POPUP)) {
+ if (str == ResStr(IDS_RECENT_FILES_POPUP)) {
SetupRecentFilesSubMenu();
pSubMenu = &m_recentfiles;
}
- if(pSubMenu) {
+ if (pSubMenu) {
mii.fMask = MIIM_STATE|MIIM_SUBMENU;
mii.fType = MF_POPUP;
mii.hSubMenu = pSubMenu->m_hMenu;
@@ -3076,7 +3082,7 @@ void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu) static CAtlStringMap<UINT> transl;
- //if(transl.IsEmpty())
+ //if (transl.IsEmpty())
{
transl[ResStr(IDS_AG_NAVIGATE)] = IDS_NAVIGATE_POPUP;
transl[ResStr(IDS_AG_OPEN_DISC)] = IDS_OPENCDROM_POPUP;
@@ -3099,7 +3105,7 @@ void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu) MENUITEMINFO mii;
mii.cbSize = sizeof(mii);
- for(UINT i = 0, j = pPopupMenu->GetMenuItemCount(); i < j; i++) {
+ for (UINT i = 0, j = pPopupMenu->GetMenuItemCount(); i < j; i++) {
CString str;
pPopupMenu->GetMenuString(i, str, MF_BYPOSITION);
@@ -3109,7 +3115,7 @@ void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu) CMenu* pSubMenu = NULL;
UINT id;
- if(transl.Lookup(lookupstr, id)) {
+ if (transl.Lookup(lookupstr, id)) {
str = ResStr(id);
// pPopupMenu->ModifyMenu(i, MF_BYPOSITION|MF_STRING, 0, str);
MENUITEMINFO mii;
@@ -3119,14 +3125,14 @@ void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu) pPopupMenu->SetMenuItemInfo(i, &mii, TRUE);
}
- if(str == ResStr(IDS_NAVIGATE_POPUP)) {
+ if (str == ResStr(IDS_NAVIGATE_POPUP)) {
UINT fState = (m_iMediaLoadState == MLS_LOADED
&& (1/*GetPlaybackMode() == PM_DVD *//*|| (GetPlaybackMode() == PM_FILE && m_PlayList.GetCount() > 0)*/))
? MF_ENABLED
: (MF_DISABLED|MF_GRAYED);
pPopupMenu->EnableMenuItem(i, MF_BYPOSITION|fState);
- } else if(str == ResStr(IDS_VIDEOFRAME_POPUP)
+ } else if (str == ResStr(IDS_VIDEOFRAME_POPUP)
|| str == ResStr(IDS_PANSCAN_POPUP)
|| str == ResStr(IDS_ASPECTRATIO_POPUP)
|| str == ResStr(IDS_ZOOM_POPUP)) {
@@ -3135,42 +3141,42 @@ void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu) : (MF_DISABLED|MF_GRAYED);
pPopupMenu->EnableMenuItem(i, MF_BYPOSITION|fState);
- } else if(str == ResStr(IDS_OPENCDROM_POPUP)) {
+ } else if (str == ResStr(IDS_OPENCDROM_POPUP)) {
SetupOpenCDSubMenu();
pSubMenu = &m_opencds;
- } else if(str == ResStr(IDS_FILTERS_POPUP)) {
+ } else if (str == ResStr(IDS_FILTERS_POPUP)) {
SetupFiltersSubMenu();
pSubMenu = &m_filters;
- } else if(str == ResStr(IDS_AUDIO_POPUP)) {
+ } else if (str == ResStr(IDS_AUDIO_POPUP)) {
SetupAudioSwitcherSubMenu();
pSubMenu = &m_audios;
- } else if(str == ResStr(IDS_SUBTITLES_POPUP)) {
+ } else if (str == ResStr(IDS_SUBTITLES_POPUP)) {
SetupSubtitlesSubMenu();
pSubMenu = &m_subtitles;
- } else if(str == ResStr(IDS_AUDIOLANGUAGE_POPUP)) {
+ } else if (str == ResStr(IDS_AUDIOLANGUAGE_POPUP)) {
SetupNavAudioSubMenu();
pSubMenu = &m_navaudio;
- } else if(str == ResStr(IDS_SUBTITLELANGUAGE_POPUP)) {
+ } else if (str == ResStr(IDS_SUBTITLELANGUAGE_POPUP)) {
SetupNavSubtitleSubMenu();
pSubMenu = &m_navsubtitle;
- } else if(str == ResStr(IDS_VIDEOANGLE_POPUP)) {
+ } else if (str == ResStr(IDS_VIDEOANGLE_POPUP)) {
SetupNavAngleSubMenu();
pSubMenu = &m_navangle;
- } else if(str == ResStr(IDS_JUMPTO_POPUP)) {
+ } else if (str == ResStr(IDS_JUMPTO_POPUP)) {
SetupNavChaptersSubMenu();
pSubMenu = &m_navchapters;
- } else if(str == ResStr(IDS_FAVORITES_POPUP)) {
+ } else if (str == ResStr(IDS_FAVORITES_POPUP)) {
SetupFavoritesSubMenu();
pSubMenu = &m_favorites;
- } else if(str == ResStr(IDS_RECENT_FILES_POPUP)) {
+ } else if (str == ResStr(IDS_RECENT_FILES_POPUP)) {
SetupRecentFilesSubMenu();
pSubMenu = &m_recentfiles;
- } else if(str == ResStr(IDS_SHADER_POPUP)) {
+ } else if (str == ResStr(IDS_SHADER_POPUP)) {
SetupShadersSubMenu();
pSubMenu = &m_shaders;
}
- if(pSubMenu) {
+ if (pSubMenu) {
mii.fMask = MIIM_STATE|MIIM_SUBMENU;
mii.fType = MF_POPUP;
mii.hSubMenu = pSubMenu->m_hMenu;
@@ -3181,9 +3187,9 @@ void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu) //
- for(UINT i = 0, j = pPopupMenu->GetMenuItemCount(); i < j; i++) {
+ for (UINT i = 0, j = pPopupMenu->GetMenuItemCount(); i < j; i++) {
UINT nID = pPopupMenu->GetMenuItemID(i);
- if(nID == ID_SEPARATOR || nID == -1
+ if (nID == ID_SEPARATOR || nID == -1
|| nID >= ID_FAVORITES_FILE_START && nID <= ID_FAVORITES_FILE_END
|| nID >= ID_RECENT_FILE_START && nID <= ID_RECENT_FILE_END
|| nID >= ID_NAVIGATE_CHAP_SUBITEM_START && nID <= ID_NAVIGATE_CHAP_SUBITEM_END) {
@@ -3193,16 +3199,16 @@ void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu) CString str;
pPopupMenu->GetMenuString(i, str, MF_BYPOSITION);
int k = str.Find('\t');
- if(k > 0) {
+ if (k > 0) {
str = str.Left(k);
}
CString key = CPPageAccelTbl::MakeAccelShortcutLabel(nID);
- if(!key.IsEmpty()) {
+ if (!key.IsEmpty()) {
str += _T("\t") + key;
}
- if(key.IsEmpty() && i < 0) {
+ if (key.IsEmpty() && i < 0) {
continue;
}
@@ -3222,33 +3228,33 @@ void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu) bool fPnSPresets = false;
- for(UINT i = 0, j = pPopupMenu->GetMenuItemCount(); i < j; i++) {
+ for (UINT i = 0, j = pPopupMenu->GetMenuItemCount(); i < j; i++) {
UINT nID = pPopupMenu->GetMenuItemID(i);
- if(nID >= ID_PANNSCAN_PRESETS_START && nID < ID_PANNSCAN_PRESETS_END) {
+ if (nID >= ID_PANNSCAN_PRESETS_START && nID < ID_PANNSCAN_PRESETS_END) {
do {
nID = pPopupMenu->GetMenuItemID(i);
pPopupMenu->DeleteMenu(i, MF_BYPOSITION);
j--;
- } while(i < j && nID >= ID_PANNSCAN_PRESETS_START && nID < ID_PANNSCAN_PRESETS_END);
+ } while (i < j && nID >= ID_PANNSCAN_PRESETS_START && nID < ID_PANNSCAN_PRESETS_END);
nID = pPopupMenu->GetMenuItemID(i);
}
- if(nID == ID_VIEW_RESET) {
+ if (nID == ID_VIEW_RESET) {
fPnSPresets = true;
}
}
- if(fPnSPresets) {
+ if (fPnSPresets) {
AppSettings& s = AfxGetAppSettings();
int i = 0, j = s.m_pnspresets.GetCount();
- for(; i < j; i++) {
+ for (; i < j; i++) {
int k = 0;
CString label = s.m_pnspresets[i].Tokenize(_T(","), k);
pPopupMenu->InsertMenu(ID_VIEW_RESET, MF_BYCOMMAND, ID_PANNSCAN_PRESETS_START+i, label);
}
- // if(j > 0)
+ // if (j > 0)
{
pPopupMenu->InsertMenu(ID_VIEW_RESET, MF_BYCOMMAND, ID_PANNSCAN_PRESETS_START+i, ResStr(IDS_PANSCAN_EDIT));
pPopupMenu->InsertMenu(ID_VIEW_RESET, MF_BYCOMMAND|MF_SEPARATOR);
@@ -3258,7 +3264,7 @@ void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu) BOOL CMainFrame::OnMenu(CMenu* pMenu)
{
- if(!pMenu) {
+ if (!pMenu) {
return FALSE;
}
AppSettings& s = AfxGetAppSettings();
@@ -3281,7 +3287,7 @@ BOOL CMainFrame::OnMenu(CMenu* pMenu) void CMainFrame::OnMenuPlayerShort()
{
- if(IsMenuHidden() || m_pFullscreenWnd->IsWindow()) {
+ if (IsMenuHidden() || m_pFullscreenWnd->IsWindow()) {
OnMenu(m_popupmain.GetSubMenu(0));
} else {
OnMenu(m_popup.GetSubMenu(0));
@@ -3301,26 +3307,26 @@ void CMainFrame::OnMenuFilters() void CMainFrame::OnUpdatePlayerStatus(CCmdUI* pCmdUI)
{
- if(m_iMediaLoadState == MLS_LOADING) {
+ if (m_iMediaLoadState == MLS_LOADING) {
pCmdUI->SetText(ResStr(IDS_CONTROLS_OPENING));
- if((AfxGetAppSettings().fUseWin7TaskBar) && (m_pTaskbarList)) {
+ if ((AfxGetAppSettings().fUseWin7TaskBar) && (m_pTaskbarList)) {
m_pTaskbarList->SetProgressState(m_hWnd, TBPF_INDETERMINATE);
}
- } else if(m_iMediaLoadState == MLS_LOADED) {
+ } else if (m_iMediaLoadState == MLS_LOADED) {
CString msg;
- if(!m_playingmsg.IsEmpty()) {
+ if (!m_playingmsg.IsEmpty()) {
msg = m_playingmsg;
- } else if(m_fCapturing) {
+ } else if (m_fCapturing) {
msg = ResStr(IDS_CONTROLS_CAPTURING);
- if(pAMDF) {
+ if (pAMDF) {
long lDropped = 0;
pAMDF->GetNumDropped(&lDropped);
long lNotDropped = 0;
pAMDF->GetNumNotDropped(&lNotDropped);
- if((lDropped + lNotDropped) > 0) {
+ if ((lDropped + lNotDropped) > 0) {
CString str;
str.Format(ResStr(IDS_MAINFRM_37), lDropped + lNotDropped, lDropped);
msg += str;
@@ -3328,20 +3334,20 @@ void CMainFrame::OnUpdatePlayerStatus(CCmdUI* pCmdUI) }
CComPtr<IPin> pPin;
- if(SUCCEEDED(pCGB->FindPin(m_wndCaptureBar.m_capdlg.m_pDst, PINDIR_INPUT, NULL, NULL, FALSE, 0, &pPin))) {
+ if (SUCCEEDED(pCGB->FindPin(m_wndCaptureBar.m_capdlg.m_pDst, PINDIR_INPUT, NULL, NULL, FALSE, 0, &pPin))) {
LONGLONG size = 0;
- if(CComQIPtr<IStream> pStream = pPin) {
+ if (CComQIPtr<IStream> pStream = pPin) {
pStream->Commit(STGC_DEFAULT);
WIN32_FIND_DATA findFileData;
HANDLE h = FindFirstFile(m_wndCaptureBar.m_capdlg.m_file, &findFileData);
- if(h != INVALID_HANDLE_VALUE) {
+ if (h != INVALID_HANDLE_VALUE) {
size = ((LONGLONG)findFileData.nFileSizeHigh << 32) | findFileData.nFileSizeLow;
CString str;
- if(size < 1024i64*1024) {
+ if (size < 1024i64*1024) {
str.Format(ResStr(IDS_MAINFRM_38), size/1024);
- } else { //if(size < 1024i64*1024*1024)
+ } else { //if (size < 1024i64*1024*1024)
str.Format(ResStr(IDS_MAINFRM_39), size/1024/1024);
}
msg += str;
@@ -3351,36 +3357,36 @@ void CMainFrame::OnUpdatePlayerStatus(CCmdUI* pCmdUI) }
ULARGE_INTEGER FreeBytesAvailable, TotalNumberOfBytes, TotalNumberOfFreeBytes;
- if(GetDiskFreeSpaceEx(
+ if (GetDiskFreeSpaceEx(
m_wndCaptureBar.m_capdlg.m_file.Left(m_wndCaptureBar.m_capdlg.m_file.ReverseFind('\\')+1),
&FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes)) {
CString str;
- if(FreeBytesAvailable.QuadPart < 1024i64*1024) {
+ if (FreeBytesAvailable.QuadPart < 1024i64*1024) {
str.Format(ResStr(IDS_MAINFRM_40), FreeBytesAvailable.QuadPart/1024);
- } else { //if(FreeBytesAvailable.QuadPart < 1024i64*1024*1024)
+ } else { //if (FreeBytesAvailable.QuadPart < 1024i64*1024*1024)
str.Format(ResStr(IDS_MAINFRM_41), FreeBytesAvailable.QuadPart/1024/1024);
}
msg += str;
}
- if(m_wndCaptureBar.m_capdlg.m_pMux) {
+ if (m_wndCaptureBar.m_capdlg.m_pMux) {
__int64 pos = 0;
CComQIPtr<IMediaSeeking> pMuxMS = m_wndCaptureBar.m_capdlg.m_pMux;
- if(pMuxMS && SUCCEEDED(pMuxMS->GetCurrentPosition(&pos)) && pos > 0) {
+ if (pMuxMS && SUCCEEDED(pMuxMS->GetCurrentPosition(&pos)) && pos > 0) {
double bytepersec = 10000000.0 * size / pos;
- if(bytepersec > 0) {
+ if (bytepersec > 0) {
m_rtDurationOverride = __int64(10000000.0 * (FreeBytesAvailable.QuadPart+size) / bytepersec);
}
}
}
- if(m_wndCaptureBar.m_capdlg.m_pVidBuffer
+ if (m_wndCaptureBar.m_capdlg.m_pVidBuffer
|| m_wndCaptureBar.m_capdlg.m_pAudBuffer) {
int nFreeVidBuffers = 0, nFreeAudBuffers = 0;
- if(CComQIPtr<IBufferFilter> pVB = m_wndCaptureBar.m_capdlg.m_pVidBuffer) {
+ if (CComQIPtr<IBufferFilter> pVB = m_wndCaptureBar.m_capdlg.m_pVidBuffer) {
nFreeVidBuffers = pVB->GetFreeBuffers();
}
- if(CComQIPtr<IBufferFilter> pAB = m_wndCaptureBar.m_capdlg.m_pAudBuffer) {
+ if (CComQIPtr<IBufferFilter> pAB = m_wndCaptureBar.m_capdlg.m_pAudBuffer) {
nFreeAudBuffers = pAB->GetFreeBuffers();
}
@@ -3389,11 +3395,11 @@ void CMainFrame::OnUpdatePlayerStatus(CCmdUI* pCmdUI) msg += str;
}
}
- } else if(m_fBuffering) {
+ } else if (m_fBuffering) {
BeginEnumFilters(pGB, pEF, pBF) {
- if(CComQIPtr<IAMNetworkStatus, &IID_IAMNetworkStatus> pAMNS = pBF) {
+ if (CComQIPtr<IAMNetworkStatus, &IID_IAMNetworkStatus> pAMNS = pBF) {
long BufferingProgress = 0;
- if(SUCCEEDED(pAMNS->get_BufferingProgress(&BufferingProgress)) && BufferingProgress > 0) {
+ if (SUCCEEDED(pAMNS->get_BufferingProgress(&BufferingProgress)) && BufferingProgress > 0) {
msg.Format(ResStr(IDS_CONTROLS_BUFFERING), BufferingProgress);
__int64 start = 0, stop = 0;
@@ -3404,13 +3410,13 @@ void CMainFrame::OnUpdatePlayerStatus(CCmdUI* pCmdUI) }
}
EndEnumFilters;
- } else if(pAMOP) {
+ } else if (pAMOP) {
__int64 t = 0, c = 0;
- if(SUCCEEDED(pAMOP->QueryProgress(&t, &c)) && t > 0 && c < t) {
+ if (SUCCEEDED(pAMOP->QueryProgress(&t, &c)) && t > 0 && c < t) {
msg.Format(ResStr(IDS_CONTROLS_BUFFERING), c*100/t);
}
- if(m_fUpdateInfoBar) {
+ if (m_fUpdateInfoBar) {
OpenSetupInfoBar();
}
}
@@ -3422,16 +3428,16 @@ void CMainFrame::OnUpdatePlayerStatus(CCmdUI* pCmdUI) (fs == State_Paused || m_fFrameSteppingActive) ? ResStr(IDS_CONTROLS_PAUSED) :
fs == State_Running ? ResStr(IDS_CONTROLS_PLAYING) :
_T("");
- if((!m_fAudioOnly) && (UI_Text == ResStr(IDS_CONTROLS_PLAYING))) {
+ if ((!m_fAudioOnly) && (UI_Text == ResStr(IDS_CONTROLS_PLAYING))) {
CString DXVA_Text = GetDXVADecoderDescription();
- if(!(_T("Not using DXVA")==DXVA_Text) || (_T("Unknown")==DXVA_Text)) {
+ if (!(_T("Not using DXVA")==DXVA_Text) || (_T("Unknown")==DXVA_Text)) {
UI_Text += _T(" [DXVA]");
}
}
pCmdUI->SetText(UI_Text);
- } else if(m_iMediaLoadState == MLS_CLOSING) {
+ } else if (m_iMediaLoadState == MLS_CLOSING) {
pCmdUI->SetText(ResStr(IDS_CONTROLS_CLOSING));
- if((AfxGetAppSettings().fUseWin7TaskBar) && (m_pTaskbarList)) {
+ if ((AfxGetAppSettings().fUseWin7TaskBar) && (m_pTaskbarList)) {
m_pTaskbarList->SetProgressState(m_hWnd, TBPF_INDETERMINATE);
}
} else {
@@ -3455,7 +3461,7 @@ void CMainFrame::OnFilePostOpenmedia() pMS->GetDuration(&rtDur);
m_wndPlaylistBar.SetCurTime(rtDur);
- if(GetPlaybackMode() == PM_CAPTURE) {
+ if (GetPlaybackMode() == PM_CAPTURE) {
ShowControlBar(&m_wndSubresyncBar, FALSE, TRUE);
// ShowControlBar(&m_wndPlaylistBar, FALSE, TRUE);
// ShowControlBar(&m_wndCaptureBar, TRUE, TRUE);
@@ -3463,7 +3469,7 @@ void CMainFrame::OnFilePostOpenmedia() m_nCurSubtitle = -1;
m_lSubtitleShift = 0;
- if(m_pCAP) {
+ if (m_pCAP) {
m_pCAP->SetSubtitleDelay(0);
}
@@ -3481,7 +3487,7 @@ void CMainFrame::OnFilePostOpenmedia() GetWindowPlacement(&wp);
// Workaround to avoid MadVR freezing when switching channels in PM_CAPTURE mode:
- if(IsWindowVisible() && s.fRememberZoomLevel
+ if (IsWindowVisible() && s.fRememberZoomLevel
&& !(m_fFullScreen || wp.showCmd == SW_SHOWMAXIMIZED || wp.showCmd == SW_SHOWMINIMIZED)
&& GetPlaybackMode() == PM_CAPTURE && s.iDSVideoRendererType == VIDRNDT_DS_MADVR) {
ShowWindow(SW_MAXIMIZE);
@@ -3490,19 +3496,19 @@ void CMainFrame::OnFilePostOpenmedia() // restore magnification
- if(IsWindowVisible() && s.fRememberZoomLevel
+ if (IsWindowVisible() && s.fRememberZoomLevel
&& !(m_fFullScreen || wp.showCmd == SW_SHOWMAXIMIZED || wp.showCmd == SW_SHOWMINIMIZED)) {
ZoomVideoWindow(false);
}
}
// Waffs : PnS command line
- if(!s.strPnSPreset.IsEmpty()) {
- for(int i = 0; i < s.m_pnspresets.GetCount(); i++) {
+ if (!s.strPnSPreset.IsEmpty()) {
+ for (int i = 0; i < s.m_pnspresets.GetCount(); i++) {
int j = 0;
CString str = s.m_pnspresets[i];
CString label = str.Tokenize(_T(","), j);
- if(s.strPnSPreset == label) {
+ if (s.strPnSPreset == label) {
OnViewPanNScanPresets(i+ID_PANNSCAN_PRESETS_START);
}
}
@@ -3537,12 +3543,12 @@ void CMainFrame::OnFilePostClosemedia() m_wndEditListEditor.CloseFile();
}
- if(IsWindow(m_wndSubresyncBar.m_hWnd)) {
+ if (IsWindow(m_wndSubresyncBar.m_hWnd)) {
ShowControlBar(&m_wndSubresyncBar, FALSE, TRUE);
SetSubtitle(NULL);
}
- if(IsWindow(m_wndCaptureBar.m_hWnd)) {
+ if (IsWindow(m_wndCaptureBar.m_hWnd)) {
ShowControlBar(&m_wndCaptureBar, FALSE, TRUE);
m_wndCaptureBar.m_capdlg.SetupVideoControls(_T(""), NULL, NULL, NULL);
m_wndCaptureBar.m_capdlg.SetupAudioControls(_T(""), NULL, CInterfaceArray<IAMAudioInputMixer>());
@@ -3577,7 +3583,7 @@ void CMainFrame::OnUpdateFilePostClosemedia(CCmdUI* pCmdUI) void CMainFrame::OnBossKey()
{
SendMessage(WM_COMMAND, ID_PLAY_PAUSE);
- if(m_fFullScreen) {
+ if (m_fFullScreen) {
SendMessage(WM_COMMAND, ID_VIEW_FULLSCREEN);
}
SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, -1);
@@ -3587,55 +3593,55 @@ void CMainFrame::OnStreamAudio(UINT nID) {
nID -= ID_STREAM_AUDIO_NEXT;
- if(m_iMediaLoadState != MLS_LOADED) {
+ if (m_iMediaLoadState != MLS_LOADED) {
return;
}
CComQIPtr<IAMStreamSelect> pSS = FindFilter(__uuidof(CAudioSwitcherFilter), pGB);
- if(!pSS) {
+ if (!pSS) {
pSS = FindFilter(L"{D3CD7858-971A-4838-ACEC-40CA5D529DC8}", pGB); // morgan's switcher
}
DWORD cStreams = 0;
- if(pSS && SUCCEEDED(pSS->Count(&cStreams)) && cStreams > 1) {
+ if (pSS && SUCCEEDED(pSS->Count(&cStreams)) && cStreams > 1) {
nID = m_iAudioStreams.GetAt(m_iAudioStreams.FindIndex(nID)); // remember that the audio streams are reordered according to user preference, so have to figure out which stream from the original order was clicked
- for(int i = 0; i < (int)cStreams; i++) {
+ for (int i = 0; i < (int)cStreams; i++) {
AM_MEDIA_TYPE* pmt = NULL;
DWORD dwFlags = 0;
LCID lcid = 0;
DWORD dwGroup = 0;
WCHAR* pszName = NULL;
- if(FAILED(pSS->Info(i, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) {
+ if (FAILED(pSS->Info(i, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) {
return;
}
- if(pmt) {
+ if (pmt) {
DeleteMediaType(pmt);
}
- if(pszName) {
+ if (pszName) {
CoTaskMemFree(pszName);
}
- if(dwFlags&(AMSTREAMSELECTINFO_ENABLED|AMSTREAMSELECTINFO_EXCLUSIVE)) {
+ if (dwFlags&(AMSTREAMSELECTINFO_ENABLED|AMSTREAMSELECTINFO_EXCLUSIVE)) {
long stream_index = (i+(nID==0?1:cStreams-1))%cStreams;
pSS->Enable(stream_index, AMSTREAMSELECTENABLE_ENABLE);
- if(SUCCEEDED(pSS->Info(stream_index, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) {
+ if (SUCCEEDED(pSS->Info(stream_index, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) {
CString strMessage = ResStr(IDS_AUDIO_STREAM);
strMessage.Append(pszName);
m_OSD.DisplayMessage (OSD_TOPLEFT, strMessage);
- if(pmt) {
+ if (pmt) {
DeleteMediaType(pmt);
}
- if(pszName) {
+ if (pszName) {
CoTaskMemFree(pszName);
}
}
break;
}
}
- } else if(GetPlaybackMode() == PM_FILE) {
+ } else if (GetPlaybackMode() == PM_FILE) {
SendMessage(WM_COMMAND, ID_OGM_AUDIO_NEXT+nID);
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
SendMessage(WM_COMMAND, ID_DVD_AUDIO_NEXT+nID);
}
}
@@ -3643,41 +3649,41 @@ void CMainFrame::OnStreamAudio(UINT nID) void CMainFrame::OnStreamSub(UINT nID)
{
nID -= ID_STREAM_SUB_NEXT;
- if(m_iMediaLoadState != MLS_LOADED) {
+ if (m_iMediaLoadState != MLS_LOADED) {
return;
}
int cnt = 0;
POSITION pos = m_pSubStreams.GetHeadPosition();
- while(pos) {
+ while (pos) {
cnt += m_pSubStreams.GetNext(pos)->GetStreamCount();
}
- if(cnt > 1) {
+ if (cnt > 1) {
int i = ((m_iSubtitleSel&0x7fffffff)+(nID==0?1:cnt-1))%cnt;
m_iSubtitleSel = i | (m_iSubtitleSel&0x80000000);
UpdateSubtitle(true);
SetFocus();
- } else if(GetPlaybackMode() == PM_FILE) {
+ } else if (GetPlaybackMode() == PM_FILE) {
SendMessage(WM_COMMAND, ID_OGM_SUB_NEXT+nID);
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
SendMessage(WM_COMMAND, ID_DVD_SUB_NEXT+nID);
}
}
void CMainFrame::OnStreamSubOnOff()
{
- if(m_iMediaLoadState != MLS_LOADED) {
+ if (m_iMediaLoadState != MLS_LOADED) {
return;
}
int cnt = 0;
POSITION pos = m_pSubStreams.GetHeadPosition();
- while(pos) {
+ while (pos) {
cnt += m_pSubStreams.GetNext(pos)->GetStreamCount();
}
- if(cnt > 0) {
+ if (cnt > 0) {
if (m_iSubtitleSel == -1) {
m_iSubtitleSel = 0;
} else {
@@ -3686,7 +3692,7 @@ void CMainFrame::OnStreamSubOnOff() UpdateSubtitle(true);
SetFocus();
AfxGetAppSettings().fEnableSubtitles = !(m_iSubtitleSel & 0x80000000);
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
SendMessage(WM_COMMAND, ID_DVD_SUB_ONOFF);
}
}
@@ -3695,12 +3701,12 @@ void CMainFrame::OnOgmAudio(UINT nID) {
nID -= ID_OGM_AUDIO_NEXT;
- if(m_iMediaLoadState != MLS_LOADED) {
+ if (m_iMediaLoadState != MLS_LOADED) {
return;
}
CComQIPtr<IAMStreamSelect> pSS = FindSourceSelectableFilter();
- if(!pSS) {
+ if (!pSS) {
return;
}
@@ -3708,35 +3714,35 @@ void CMainFrame::OnOgmAudio(UINT nID) int iSel = -1;
DWORD cStreams = 0;
- if(SUCCEEDED(pSS->Count(&cStreams)) && cStreams > 1) {
- for(int i = 0; i < (int)cStreams; i++) {
+ if (SUCCEEDED(pSS->Count(&cStreams)) && cStreams > 1) {
+ for (int i = 0; i < (int)cStreams; i++) {
AM_MEDIA_TYPE* pmt = NULL;
DWORD dwFlags = 0;
LCID lcid = 0;
DWORD dwGroup = 0;
WCHAR* pszName = NULL;
- if(FAILED(pSS->Info(i, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) {
+ if (FAILED(pSS->Info(i, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) {
return;
}
- if(dwGroup == 1) {
- if(dwFlags&(AMSTREAMSELECTINFO_ENABLED|AMSTREAMSELECTINFO_EXCLUSIVE)) {
+ if (dwGroup == 1) {
+ if (dwFlags&(AMSTREAMSELECTINFO_ENABLED|AMSTREAMSELECTINFO_EXCLUSIVE)) {
iSel = snds.GetCount();
}
snds.Add(i);
}
- if(pmt) {
+ if (pmt) {
DeleteMediaType(pmt);
}
- if(pszName) {
+ if (pszName) {
CoTaskMemFree(pszName);
}
}
int cnt = snds.GetCount();
- if(cnt > 1 && iSel >= 0) {
+ if (cnt > 1 && iSel >= 0) {
int nNewStream = snds[(iSel+(nID==0?1:cnt-1))%cnt];
pSS->Enable(nNewStream, AMSTREAMSELECTENABLE_ENABLE);
@@ -3746,20 +3752,20 @@ void CMainFrame::OnOgmAudio(UINT nID) DWORD dwGroup = 0;
WCHAR* pszName = NULL;
- if(SUCCEEDED(pSS->Info(nNewStream, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) {
+ if (SUCCEEDED(pSS->Info(nNewStream, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) {
CString strMessage;
CString audio_stream = pszName;
int k = audio_stream.Find(_T("Audio - "));
- if(k>=0) {
+ if (k>=0) {
audio_stream = audio_stream.Right(audio_stream.GetLength() - k - 8);
}
strMessage.Format (_T("%s%s"), ResStr(IDS_AUDIO_STREAM), audio_stream);
m_OSD.DisplayMessage (OSD_TOPLEFT, strMessage);
- if(pmt) {
+ if (pmt) {
DeleteMediaType(pmt);
}
- if(pszName) {
+ if (pszName) {
CoTaskMemFree(pszName);
}
}
@@ -3771,12 +3777,12 @@ void CMainFrame::OnOgmSub(UINT nID) {
nID -= ID_OGM_SUB_NEXT;
- if(m_iMediaLoadState != MLS_LOADED) {
+ if (m_iMediaLoadState != MLS_LOADED) {
return;
}
CComQIPtr<IAMStreamSelect> pSS = FindSourceSelectableFilter();
- if(!pSS) {
+ if (!pSS) {
return;
}
@@ -3784,35 +3790,35 @@ void CMainFrame::OnOgmSub(UINT nID) int iSel = -1;
DWORD cStreams = 0;
- if(SUCCEEDED(pSS->Count(&cStreams)) && cStreams > 1) {
- for(int i = 0; i < (int)cStreams; i++) {
+ if (SUCCEEDED(pSS->Count(&cStreams)) && cStreams > 1) {
+ for (int i = 0; i < (int)cStreams; i++) {
AM_MEDIA_TYPE* pmt = NULL;
DWORD dwFlags = 0;
LCID lcid = 0;
DWORD dwGroup = 0;
WCHAR* pszName = NULL;
- if(FAILED(pSS->Info(i, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) {
+ if (FAILED(pSS->Info(i, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) {
return;
}
- if(dwGroup == 2) {
- if(dwFlags&(AMSTREAMSELECTINFO_ENABLED|AMSTREAMSELECTINFO_EXCLUSIVE)) {
+ if (dwGroup == 2) {
+ if (dwFlags&(AMSTREAMSELECTINFO_ENABLED|AMSTREAMSELECTINFO_EXCLUSIVE)) {
iSel = subs.GetCount();
}
subs.Add(i);
}
- if(pmt) {
+ if (pmt) {
DeleteMediaType(pmt);
}
- if(pszName) {
+ if (pszName) {
CoTaskMemFree(pszName);
}
}
int cnt = subs.GetCount();
- if(cnt > 1 && iSel >= 0) {
+ if (cnt > 1 && iSel >= 0) {
int nNewStream = subs[(iSel+(nID==0?1:cnt-1))%cnt];
pSS->Enable(nNewStream, AMSTREAMSELECTENABLE_ENABLE);
@@ -3821,7 +3827,7 @@ void CMainFrame::OnOgmSub(UINT nID) LCID lcid = 0;
DWORD dwGroup = 0;
WCHAR* pszName = NULL;
- if(SUCCEEDED(pSS->Info(nNewStream, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) {
+ if (SUCCEEDED(pSS->Info(nNewStream, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) {
CString lang;
CString strMessage;
if (lcid == 0) {
@@ -3833,10 +3839,10 @@ void CMainFrame::OnOgmSub(UINT nID) strMessage.Format (ResStr(IDS_MAINFRM_45), lang, _T(""));
m_OSD.DisplayMessage (OSD_TOPLEFT, strMessage);
- if(pmt) {
+ if (pmt) {
DeleteMediaType(pmt);
}
- if(pszName) {
+ if (pszName) {
CoTaskMemFree(pszName);
}
}
@@ -3848,17 +3854,17 @@ void CMainFrame::OnDvdAngle(UINT nID) {
nID -= ID_DVD_ANGLE_NEXT;
- if(m_iMediaLoadState != MLS_LOADED) {
+ if (m_iMediaLoadState != MLS_LOADED) {
return;
}
- if(pDVDI && pDVDC) {
+ if (pDVDI && pDVDC) {
ULONG ulAnglesAvailable, ulCurrentAngle;
- if(SUCCEEDED(pDVDI->GetCurrentAngle(&ulAnglesAvailable, &ulCurrentAngle)) && ulAnglesAvailable > 1) {
+ if (SUCCEEDED(pDVDI->GetCurrentAngle(&ulAnglesAvailable, &ulCurrentAngle)) && ulAnglesAvailable > 1) {
ulCurrentAngle += nID==0 ? 1 : ulAnglesAvailable-1;
- if(ulCurrentAngle > ulAnglesAvailable) {
+ if (ulCurrentAngle > ulAnglesAvailable) {
ulCurrentAngle = 1;
- } else if(ulCurrentAngle < 1) {
+ } else if (ulCurrentAngle < 1) {
ulCurrentAngle = ulAnglesAvailable;
}
pDVDC->SelectAngle(ulCurrentAngle, DVD_CMD_FLAG_Block, NULL);
@@ -3871,13 +3877,13 @@ void CMainFrame::OnDvdAudio(UINT nID) HRESULT hr;
nID -= ID_DVD_AUDIO_NEXT;
- if(m_iMediaLoadState != MLS_LOADED) {
+ if (m_iMediaLoadState != MLS_LOADED) {
return;
}
- if(pDVDI && pDVDC) {
+ if (pDVDI && pDVDC) {
ULONG nStreamsAvailable, nCurrentStream;
- if(SUCCEEDED(pDVDI->GetCurrentAudio(&nStreamsAvailable, &nCurrentStream)) && nStreamsAvailable > 1) {
+ if (SUCCEEDED(pDVDI->GetCurrentAudio(&nStreamsAvailable, &nCurrentStream)) && nStreamsAvailable > 1) {
DVD_AudioAttributes AATR;
UINT nNextStream = (nCurrentStream+(nID==0?1:nStreamsAvailable-1))%nStreamsAvailable;
@@ -3899,14 +3905,14 @@ void CMainFrame::OnDvdSub(UINT nID) HRESULT hr;
nID -= ID_DVD_SUB_NEXT;
- if(m_iMediaLoadState != MLS_LOADED) {
+ if (m_iMediaLoadState != MLS_LOADED) {
return;
}
- if(pDVDI && pDVDC) {
+ if (pDVDI && pDVDC) {
ULONG ulStreamsAvailable, ulCurrentStream;
BOOL bIsDisabled;
- if(SUCCEEDED(pDVDI->GetCurrentSubpicture(&ulStreamsAvailable, &ulCurrentStream, &bIsDisabled))
+ if (SUCCEEDED(pDVDI->GetCurrentSubpicture(&ulStreamsAvailable, &ulCurrentStream, &bIsDisabled))
&& ulStreamsAvailable > 1) {
// UINT nNextStream = (ulCurrentStream+(nID==0?1:ulStreamsAvailable-1))%ulStreamsAvailable;
int nNextStream;
@@ -3925,7 +3931,7 @@ void CMainFrame::OnDvdSub(UINT nID) DVD_SubpictureAttributes SATR;
pDVDC->SetSubpictureState(TRUE, DVD_CMD_FLAG_Block, NULL);
- if(SUCCEEDED(pDVDI->GetSubpictureAttributes(nNextStream, &SATR))) {
+ if (SUCCEEDED(pDVDI->GetSubpictureAttributes(nNextStream, &SATR))) {
CString lang;
CString strMessage;
int len = GetLocaleInfo(SATR.Language, LOCALE_SENGLANGUAGE, lang.GetBuffer(64), 64);
@@ -3940,14 +3946,14 @@ void CMainFrame::OnDvdSub(UINT nID) void CMainFrame::OnDvdSubOnOff()
{
- if(m_iMediaLoadState != MLS_LOADED) {
+ if (m_iMediaLoadState != MLS_LOADED) {
return;
}
- if(pDVDI && pDVDC) {
+ if (pDVDI && pDVDC) {
ULONG ulStreamsAvailable, ulCurrentStream;
BOOL bIsDisabled;
- if(SUCCEEDED(pDVDI->GetCurrentSubpicture(&ulStreamsAvailable, &ulCurrentStream, &bIsDisabled))) {
+ if (SUCCEEDED(pDVDI->GetCurrentSubpicture(&ulStreamsAvailable, &ulCurrentStream, &bIsDisabled))) {
pDVDC->SetSubpictureState(bIsDisabled, DVD_CMD_FLAG_Block, NULL);
}
}
@@ -3961,7 +3967,7 @@ void CMainFrame::OnDvdSubOnOff() void CMainFrame::OnFileOpenQuick()
{
- if(m_iMediaLoadState == MLS_LOADING || !IsWindow(m_wndPlaylistBar)) {
+ if (m_iMediaLoadState == MLS_LOADING || !IsWindow(m_wndPlaylistBar)) {
return;
}
@@ -3972,24 +3978,25 @@ void CMainFrame::OnFileOpenQuick() s.m_Formats.GetFilter(filter, mask);
DWORD dwFlags = OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_ALLOWMULTISELECT|OFN_ENABLEINCLUDENOTIFY|OFN_NOCHANGEDIR;
- if (!s.fKeepHistory)
+ if (!s.fKeepHistory) {
dwFlags |= OFN_DONTADDTORECENT;
+ }
COpenFileDlg fd(mask, true, NULL, NULL, dwFlags, filter, GetModalParent());
- if(fd.DoModal() != IDOK) {
+ if (fd.DoModal() != IDOK) {
return;
}
CAtlList<CString> fns;
POSITION pos = fd.GetStartPosition();
- while(pos) {
+ while (pos) {
fns.AddTail(fd.GetNextPathName(pos));
}
bool fMultipleFiles = false;
- if(fns.GetCount() > 1
+ if (fns.GetCount() > 1
|| fns.GetCount() == 1
&& (fns.GetHead()[fns.GetHead().GetLength()-1] == '\\'
|| fns.GetHead()[fns.GetHead().GetLength()-1] == '*')) {
@@ -4003,7 +4010,7 @@ void CMainFrame::OnFileOpenQuick() m_wndPlaylistBar.Open(fns, fMultipleFiles);
- if(m_wndPlaylistBar.GetCount() == 1 && m_wndPlaylistBar.IsWindowVisible() && !m_wndPlaylistBar.IsFloating()) {
+ if (m_wndPlaylistBar.GetCount() == 1 && m_wndPlaylistBar.IsWindowVisible() && !m_wndPlaylistBar.IsFloating()) {
ShowControlBar(&m_wndPlaylistBar, FALSE, TRUE);
}
@@ -4012,30 +4019,30 @@ void CMainFrame::OnFileOpenQuick() void CMainFrame::OnFileOpenmedia()
{
- if(m_iMediaLoadState == MLS_LOADING || !IsWindow(m_wndPlaylistBar) || m_pFullscreenWnd->IsWindow()) {
+ if (m_iMediaLoadState == MLS_LOADING || !IsWindow(m_wndPlaylistBar) || m_pFullscreenWnd->IsWindow()) {
return;
}
COpenDlg dlg;
- if(dlg.DoModal() != IDOK || dlg.m_fns.GetCount() == 0) {
+ if (dlg.DoModal() != IDOK || dlg.m_fns.GetCount() == 0) {
return;
}
- if(!dlg.m_fAppendPlaylist) {
+ if (!dlg.m_fAppendPlaylist) {
SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA);
}
ShowWindow(SW_SHOW);
SetForegroundWindow();
- if(dlg.m_fAppendPlaylist) {
+ if (dlg.m_fAppendPlaylist) {
m_wndPlaylistBar.Append(dlg.m_fns, dlg.m_fMultipleFiles);
return;
}
m_wndPlaylistBar.Open(dlg.m_fns, dlg.m_fMultipleFiles);
- if(m_wndPlaylistBar.GetCount() == 1 && m_wndPlaylistBar.IsWindowVisible() && !m_wndPlaylistBar.IsFloating()) {
+ if (m_wndPlaylistBar.GetCount() == 1 && m_wndPlaylistBar.IsWindowVisible() && !m_wndPlaylistBar.IsFloating()) {
ShowControlBar(&m_wndPlaylistBar, FALSE, TRUE);
}
@@ -4064,11 +4071,11 @@ BOOL CMainFrame::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCDS) }
/*
- if(m_iMediaLoadState == MLS_LOADING || !IsWindow(m_wndPlaylistBar))
+ if (m_iMediaLoadState == MLS_LOADING || !IsWindow(m_wndPlaylistBar))
return FALSE;
*/
- if(pCDS->dwData != 0x6ABE51 || pCDS->cbData < sizeof(DWORD)) {
+ if (pCDS->dwData != 0x6ABE51 || pCDS->cbData < sizeof(DWORD)) {
return FALSE;
}
@@ -4078,9 +4085,9 @@ BOOL CMainFrame::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCDS) CAtlList<CString> cmdln;
- while(len-- > 0) {
+ while (len-- > 0) {
CString str;
- while(pBuff < pBuffEnd && *pBuff) {
+ while (pBuff < pBuffEnd && *pBuff) {
str += *pBuff++;
}
pBuff++;
@@ -4089,12 +4096,12 @@ BOOL CMainFrame::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCDS) s.ParseCommandLine(cmdln);
- if(s.nCLSwitches&CLSW_SLAVE) {
+ if (s.nCLSwitches&CLSW_SLAVE) {
SendAPICommand (CMD_CONNECT, L"%d", GetSafeHwnd());
}
POSITION pos = s.slFilters.GetHeadPosition();
- while(pos) {
+ while (pos) {
CString fullpath = MakeFullPath(s.slFilters.GetNext(pos));
CPath tmp(fullpath);
@@ -4104,36 +4111,36 @@ BOOL CMainFrame::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCDS) WIN32_FIND_DATA fd = {0};
HANDLE hFind = FindFirstFile(fullpath, &fd);
- if(hFind != INVALID_HANDLE_VALUE) {
+ if (hFind != INVALID_HANDLE_VALUE) {
do {
- if(fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {
+ if (fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {
continue;
}
CFilterMapper2 fm2(false);
fm2.Register(path + fd.cFileName);
- while(!fm2.m_filters.IsEmpty()) {
- if(FilterOverride* f = fm2.m_filters.RemoveTail()) {
+ while (!fm2.m_filters.IsEmpty()) {
+ if (FilterOverride* f = fm2.m_filters.RemoveTail()) {
f->fTemporary = true;
bool fFound = false;
POSITION pos2 = s.m_filters.GetHeadPosition();
- while(pos2) {
+ while (pos2) {
FilterOverride* f2 = s.m_filters.GetNext(pos2);
- if(f2->type == FilterOverride::EXTERNAL && !f2->path.CompareNoCase(f->path)) {
+ if (f2->type == FilterOverride::EXTERNAL && !f2->path.CompareNoCase(f->path)) {
fFound = true;
break;
}
}
- if(!fFound) {
+ if (!fFound) {
CAutoPtr<FilterOverride> p(f);
s.m_filters.AddHead(p);
}
}
}
- } while(FindNextFile(hFind, &fd));
+ } while (FindNextFile(hFind, &fd));
FindClose(hFind);
}
@@ -4141,23 +4148,23 @@ BOOL CMainFrame::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCDS) bool fSetForegroundWindow = false;
- if((s.nCLSwitches&CLSW_DVD) && !s.slFiles.IsEmpty()) {
+ if ((s.nCLSwitches&CLSW_DVD) && !s.slFiles.IsEmpty()) {
SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA);
fSetForegroundWindow = true;
CAutoPtr<OpenDVDData> p(DNew OpenDVDData());
- if(p) {
+ if (p) {
p->path = s.slFiles.GetHead();
p->subs.AddTailList(&s.slSubs);
}
OpenMedia(p);
- } else if(s.nCLSwitches&CLSW_CD) {
+ } else if (s.nCLSwitches&CLSW_CD) {
SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA);
fSetForegroundWindow = true;
CAtlList<CString> sl;
- if(!s.slFiles.IsEmpty()) {
+ if (!s.slFiles.IsEmpty()) {
GetCDROMType(s.slFiles.GetHead()[0], sl);
} else {
CString dir;
@@ -4165,19 +4172,19 @@ BOOL CMainFrame::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCDS) GetCDROMType(dir[0], sl);
- for(TCHAR drive = 'C'; sl.IsEmpty() && drive <= 'Z'; drive++) {
+ for (TCHAR drive = 'C'; sl.IsEmpty() && drive <= 'Z'; drive++) {
GetCDROMType(drive, sl);
}
}
m_wndPlaylistBar.Open(sl, true);
OpenCurPlaylistItem();
- } else if(!s.slFiles.IsEmpty()) {
+ } else if (!s.slFiles.IsEmpty()) {
bool fMulti = s.slFiles.GetCount() > 1;
CAtlList<CString> sl;
sl.AddTailList(&s.slFiles);
- if(!fMulti) {
+ if (!fMulti) {
sl.AddTailList(&s.slDubs);
}
@@ -4185,7 +4192,7 @@ BOOL CMainFrame::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCDS) CString strPlaylistFile;
CAtlList<CHdmvClipInfo::PlaylistItem> MainPlaylist;
- if(!fMulti && is_dir(s.slFiles.GetHead() + _T("\\BDMV")) && SUCCEEDED(ClipInfo.FindMainMovie (s.slFiles.GetHead(), strPlaylistFile, MainPlaylist))) {
+ if (!fMulti && is_dir(s.slFiles.GetHead() + _T("\\BDMV")) && SUCCEEDED(ClipInfo.FindMainMovie (s.slFiles.GetHead(), strPlaylistFile, MainPlaylist))) {
SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA);
fSetForegroundWindow = true;
@@ -4193,26 +4200,26 @@ BOOL CMainFrame::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCDS) CAutoPtr<OpenFileData> p(DNew OpenFileData());
p->fns.AddTail(strPlaylistFile);
OpenMedia(p);
- } else if(!fMulti && is_dir(s.slFiles.GetHead() + _T("\\VIDEO_TS"))) {
+ } else if (!fMulti && is_dir(s.slFiles.GetHead() + _T("\\VIDEO_TS"))) {
SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA);
fSetForegroundWindow = true;
CAutoPtr<OpenDVDData> p(DNew OpenDVDData());
- if(p) {
+ if (p) {
p->path = s.slFiles.GetHead();
p->subs.AddTailList(&s.slSubs);
}
OpenMedia(p);
} else {
- if(last_run && ((GetTickCount()-last_run)<500)) {
+ if (last_run && ((GetTickCount()-last_run)<500)) {
s.nCLSwitches |= CLSW_ADD;
}
last_run = GetTickCount();
- if((s.nCLSwitches&CLSW_ADD) && m_wndPlaylistBar.GetCount() > 0) {
+ if ((s.nCLSwitches&CLSW_ADD) && m_wndPlaylistBar.GetCount() > 0) {
m_wndPlaylistBar.Append(sl, fMulti, &s.slSubs);
- if(s.nCLSwitches&(CLSW_OPEN|CLSW_PLAY)) {
+ if (s.nCLSwitches&(CLSW_OPEN|CLSW_PLAY)) {
m_wndPlaylistBar.SetLast();
OpenCurPlaylistItem();
}
@@ -4231,7 +4238,7 @@ BOOL CMainFrame::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCDS) s.nCLSwitches = CLSW_NONE;
}
- if(fSetForegroundWindow && !(s.nCLSwitches&CLSW_NOFOCUS)) {
+ if (fSetForegroundWindow && !(s.nCLSwitches&CLSW_NOFOCUS)) {
SetForegroundWindow();
}
@@ -4242,7 +4249,7 @@ BOOL CMainFrame::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCDS) int CALLBACK BrowseCallbackProc(HWND hwnd,UINT uMsg,LPARAM lp, LPARAM pData)
{
- switch(uMsg) {
+ switch (uMsg) {
case BFFM_INITIALIZED:
//Initial directory is set here
SendMessage(hwnd, BFFM_SETSELECTION, TRUE,(LPARAM)(LPCTSTR)AfxGetAppSettings().strDVDPath);
@@ -4268,14 +4275,14 @@ void CMainFrame::OnFileOpendvd() ShowWindow(SW_SHOW);
CAutoPtr<OpenDVDData> p(DNew OpenDVDData());
- if(p)
+ if (p)
{
AppSettings& s = AfxGetAppSettings();
- if(s.fUseDVDPath && !s.strDVDPath.IsEmpty())
+ if (s.fUseDVDPath && !s.strDVDPath.IsEmpty())
{
p->path = s.strDVDPath;
p->path.Replace('/', '\\');
- if(p->path[p->path.GetLength()-1] != '\\') p->path += '\\';
+ if (p->path[p->path.GetLength()-1] != '\\') p->path += '\\';
}
}
OpenMedia(p);*/
@@ -4296,7 +4303,7 @@ void CMainFrame::OnFileOpendvd() static LPITEMIDLIST iil;
iil = SHBrowseForFolder(&bi);
- if(iil) {
+ if (iil) {
CHdmvClipInfo ClipInfo;
CString strPlaylistFile;
CAtlList<CHdmvClipInfo::PlaylistItem> MainPlaylist;
@@ -4312,7 +4319,7 @@ void CMainFrame::OnFileOpendvd() CAutoPtr<OpenDVDData> p(DNew OpenDVDData());
p->path = path;
p->path.Replace('/', '\\');
- if(p->path[p->path.GetLength()-1] != '\\') {
+ if (p->path[p->path.GetLength()-1] != '\\') {
p->path += '\\';
}
@@ -4325,7 +4332,7 @@ void CMainFrame::OnFileOpendevice() {
AppSettings& s = AfxGetAppSettings();
- if(m_iMediaLoadState == MLS_LOADING) {
+ if (m_iMediaLoadState == MLS_LOADING) {
return;
}
@@ -4337,7 +4344,7 @@ void CMainFrame::OnFileOpendevice() m_wndPlaylistBar.Empty();
CAutoPtr<OpenDeviceData> p(DNew OpenDeviceData());
- if(p) {
+ if (p) {
p->DisplayName[0] = s.strAnalogVideo;
p->DisplayName[1] = s.strAnalogAudio;
}
@@ -4353,10 +4360,10 @@ void CMainFrame::OnFileOpenCD(UINT nID) nID -= ID_FILE_OPEN_CD_START;
nID++;
- for(TCHAR drive = 'C'; drive <= 'Z'; drive++) {
+ for (TCHAR drive = 'C'; drive <= 'Z'; drive++) {
CAtlList<CString> sl;
- switch(GetCDROMType(drive, sl)) {
+ switch (GetCDROMType(drive, sl)) {
case CDROM_Audio:
case CDROM_VideoCD:
case CDROM_DVDVideo:
@@ -4366,7 +4373,7 @@ void CMainFrame::OnFileOpenCD(UINT nID) break;
}
- if(nID == 0) {
+ if (nID == 0) {
SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA);
SetForegroundWindow();
@@ -4389,7 +4396,7 @@ void CMainFrame::OnDropFiles(HDROP hDropInfo) {
SetForegroundWindow();
- if(m_wndPlaylistBar.IsWindowVisible()) {
+ if (m_wndPlaylistBar.IsWindowVisible()) {
m_wndPlaylistBar.OnDropFiles(hDropInfo);
return;
}
@@ -4398,16 +4405,16 @@ void CMainFrame::OnDropFiles(HDROP hDropInfo) UINT nFiles = ::DragQueryFile(hDropInfo, (UINT)-1, NULL, 0);
- for(UINT iFile = 0; iFile < nFiles; iFile++) {
+ for (UINT iFile = 0; iFile < nFiles; iFile++) {
CString fn;
fn.ReleaseBuffer(::DragQueryFile(hDropInfo, iFile, fn.GetBuffer(_MAX_PATH), _MAX_PATH));
sl.AddTail(fn);
WIN32_FIND_DATA fd = {0};
HANDLE hFind = FindFirstFile(fn, &fd);
- if(hFind != INVALID_HANDLE_VALUE) {
- if(fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {
- if(fn[fn.GetLength()-1] != '\\') {
+ if (hFind != INVALID_HANDLE_VALUE) {
+ if (fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {
+ if (fn[fn.GetLength()-1] != '\\') {
fn += '\\';
}
COpenDirHelper::RecurseAddDir(fn, &sl);
@@ -4418,13 +4425,13 @@ void CMainFrame::OnDropFiles(HDROP hDropInfo) ::DragFinish(hDropInfo);
- if(sl.IsEmpty()) {
+ if (sl.IsEmpty()) {
return;
}
- if(sl.GetCount() == 1 && m_iMediaLoadState == MLS_LOADED && m_pCAP) {
+ if (sl.GetCount() == 1 && m_iMediaLoadState == MLS_LOADED && m_pCAP) {
ISubStream *pSubStream = NULL;
- if(LoadSubtitle(sl.GetHead(), &pSubStream)) {
+ if (LoadSubtitle(sl.GetHead(), &pSubStream)) {
SetSubtitle(pSubStream); // the subtitle at the insert position according to LoadSubtitle()
CPath p(sl.GetHead());
p.StripPath();
@@ -4441,11 +4448,11 @@ void CMainFrame::OnFileSaveAs() {
CString ext, in = m_wndPlaylistBar.GetCurFileName(), out = in;
- if(out.Find(_T("://")) < 0) {
+ if (out.Find(_T("://")) < 0) {
ext = CString(CPath(out).GetExtension()).MakeLower();
- if(ext == _T(".cda")) {
+ if (ext == _T(".cda")) {
out = out.Left(out.GetLength()-4) + _T(".wav");
- } else if(ext == _T(".ifo")) {
+ } else if (ext == _T(".ifo")) {
out = out.Left(out.GetLength()-4) + _T(".vob");
}
} else {
@@ -4455,32 +4462,32 @@ void CMainFrame::OnFileSaveAs() CFileDialog fd(FALSE, 0, out,
OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST|OFN_NOCHANGEDIR,
ResStr(IDS_MAINFRM_48), GetModalParent(), 0);
- if(fd.DoModal() != IDOK || !in.CompareNoCase(fd.GetPathName())) {
+ if (fd.DoModal() != IDOK || !in.CompareNoCase(fd.GetPathName())) {
return;
}
CPath p(fd.GetPathName());
- if(!ext.IsEmpty()) {
+ if (!ext.IsEmpty()) {
p.AddExtension(ext);
}
OAFilterState fs = State_Stopped;
pMC->GetState(0, &fs);
- if(fs == State_Running) {
+ if (fs == State_Running) {
pMC->Pause();
}
CSaveDlg dlg(in, p);
dlg.DoModal();
- if(fs == State_Running) {
+ if (fs == State_Running) {
pMC->Run();
}
}
void CMainFrame::OnUpdateFileSaveAs(CCmdUI* pCmdUI)
{
- if(m_iMediaLoadState != MLS_LOADED || GetPlaybackMode() != PM_FILE) {
+ if (m_iMediaLoadState != MLS_LOADED || GetPlaybackMode() != PM_FILE) {
pCmdUI->Enable(FALSE);
return;
}
@@ -4488,12 +4495,12 @@ void CMainFrame::OnUpdateFileSaveAs(CCmdUI* pCmdUI) CString fn = m_wndPlaylistBar.GetCurFileName();
CString ext = fn.Mid(fn.ReverseFind('.')+1).MakeLower();
- if(fn.Find(_T("://")) >= 0) {
+ if (fn.Find(_T("://")) >= 0) {
pCmdUI->Enable(FALSE);
return;
}
- if((GetVersion()&0x80000000) && (ext == _T("cda") || ext == _T("ifo"))) {
+ if ((GetVersion()&0x80000000) && (ext == _T("cda") || ext == _T("ifo"))) {
pCmdUI->Enable(FALSE);
return;
}
@@ -4503,7 +4510,7 @@ void CMainFrame::OnUpdateFileSaveAs(CCmdUI* pCmdUI) bool CMainFrame::GetDIB(BYTE** ppData, long& size, bool fSilent)
{
- if(!ppData) {
+ if (!ppData) {
return false;
}
@@ -4514,11 +4521,11 @@ bool CMainFrame::GetDIB(BYTE** ppData, long& size, bool fSilent) OAFilterState fs = GetMediaState();
- if(!(m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly && (fs == State_Paused || fs == State_Running))) {
+ if (!(m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly && (fs == State_Paused || fs == State_Running))) {
return false;
}
- if(fs == State_Running && fNeedsToPause) {
+ if (fs == State_Running && fNeedsToPause) {
pMC->Pause();
GetMediaState(); // wait for completion of the pause command
}
@@ -4527,33 +4534,33 @@ bool CMainFrame::GetDIB(BYTE** ppData, long& size, bool fSilent) CString errmsg;
do {
- if(m_pCAP) {
+ if (m_pCAP) {
hr = m_pCAP->GetDIB(NULL, (DWORD*)&size);
- if(FAILED(hr)) {
+ if (FAILED(hr)) {
errmsg.Format(ResStr(IDS_MAINFRM_49), hr);
break;
}
*ppData = DNew BYTE[size];
- if(!(*ppData)) {
+ if (!(*ppData)) {
return false;
}
hr = m_pCAP->GetDIB(*ppData, (DWORD*)&size);
- // if(FAILED(hr)) {errmsg.Format(_T("GetDIB failed, hr = %08x"), hr); break;}
- if(FAILED(hr)) {
+ // if (FAILED(hr)) {errmsg.Format(_T("GetDIB failed, hr = %08x"), hr); break;}
+ if (FAILED(hr)) {
OnPlayPause();
GetMediaState(); // Pause and retry to support ffdshow queuing.
int retry = 0;
- while(FAILED(hr) && retry < 20) {
+ while (FAILED(hr) && retry < 20) {
hr = m_pCAP->GetDIB(*ppData, (DWORD*)&size);
- if(SUCCEEDED(hr)) {
+ if (SUCCEEDED(hr)) {
break;
}
Sleep(1);
retry++;
}
- if(FAILED(hr)) {
+ if (FAILED(hr)) {
errmsg.Format(ResStr(IDS_MAINFRM_49), hr);
break;
}
@@ -4565,14 +4572,14 @@ bool CMainFrame::GetDIB(BYTE** ppData, long& size, bool fSilent) DWORD dwSize;
REFERENCE_TIME rtImage = 0;
hr = m_pMFVDC->GetCurrentImage (&bih, &pDib, &dwSize, &rtImage);
- if(FAILED(hr) || dwSize == 0) {
+ if (FAILED(hr) || dwSize == 0) {
errmsg.Format(ResStr(IDS_MAINFRM_51), hr);
break;
}
size = (long)dwSize+sizeof(BITMAPINFOHEADER);
*ppData = DNew BYTE[size];
- if(!(*ppData)) {
+ if (!(*ppData)) {
return false;
}
memcpy_s (*ppData, size, &bih, sizeof(BITMAPINFOHEADER));
@@ -4580,36 +4587,36 @@ bool CMainFrame::GetDIB(BYTE** ppData, long& size, bool fSilent) CoTaskMemFree (pDib);
} else {
hr = pBV->GetCurrentImage(&size, NULL);
- if(FAILED(hr) || size == 0) {
+ if (FAILED(hr) || size == 0) {
errmsg.Format(ResStr(IDS_MAINFRM_51), hr);
break;
}
*ppData = DNew BYTE[size];
- if(!(*ppData)) {
+ if (!(*ppData)) {
return false;
}
hr = pBV->GetCurrentImage(&size, (long*)*ppData);
- if(FAILED(hr)) {
+ if (FAILED(hr)) {
errmsg.Format(ResStr(IDS_MAINFRM_51), hr);
break;
}
}
- } while(0);
+ } while (0);
- if(!fSilent) {
- if(!errmsg.IsEmpty()) {
+ if (!fSilent) {
+ if (!errmsg.IsEmpty()) {
AfxMessageBox(errmsg, MB_OK);
}
}
- if(fs == State_Running && GetMediaState() != State_Running) {
+ if (fs == State_Running && GetMediaState() != State_Running) {
pMC->Run();
}
- if(FAILED(hr)) {
- if(*ppData) {
+ if (FAILED(hr)) {
+ if (*ppData) {
ASSERT(0); // huh?
delete [] *ppData;
*ppData = NULL;
@@ -4627,8 +4634,8 @@ void CMainFrame::SaveDIB(LPCTSTR fn, BYTE* pData, long size) {
CString ext = CString(CPath(fn).GetExtension()).MakeLower();
- if(ext == _T(".bmp")) {
- if(FILE* f = _tfopen(fn, _T("wb"))) {
+ if (ext == _T(".bmp")) {
+ if (FILE* f = _tfopen(fn, _T("wb"))) {
BITMAPINFO* bi = (BITMAPINFO*)pData;
BITMAPFILEHEADER bfh;
@@ -4637,8 +4644,8 @@ void CMainFrame::SaveDIB(LPCTSTR fn, BYTE* pData, long size) bfh.bfSize = sizeof(bfh) + size;
bfh.bfReserved1 = bfh.bfReserved2 = 0;
- if(bi->bmiHeader.biBitCount <= 8) {
- if(bi->bmiHeader.biClrUsed) {
+ if (bi->bmiHeader.biBitCount <= 8) {
+ if (bi->bmiHeader.biClrUsed) {
bfh.bfOffBits += bi->bmiHeader.biClrUsed * sizeof(bi->bmiColors[0]);
} else {
bfh.bfOffBits += (1 << bi->bmiHeader.biBitCount) * DWORD(sizeof(bi->bmiColors[0]));
@@ -4652,7 +4659,7 @@ void CMainFrame::SaveDIB(LPCTSTR fn, BYTE* pData, long size) } else {
AfxMessageBox(ResStr(IDS_MAINFRM_53), MB_OK);
}
- } else if(ext == _T(".png")) {
+ } else if (ext == _T(".png")) {
DWORD bmpsize = size;
LPBITMAPINFOHEADER pdib;
LPBITMAPFILEHEADER pbmfh;
@@ -4668,8 +4675,8 @@ void CMainFrame::SaveDIB(LPCTSTR fn, BYTE* pData, long size) bfh.bfSize = sizeof(bfh) + size;
bfh.bfReserved1 = bfh.bfReserved2 = 0;
- if(bi->bmiHeader.biBitCount <= 8) {
- if(bi->bmiHeader.biClrUsed) {
+ if (bi->bmiHeader.biBitCount <= 8) {
+ if (bi->bmiHeader.biClrUsed) {
bfh.bfOffBits += bi->bmiHeader.biClrUsed * sizeof(bi->bmiColors[0]);
} else {
bfh.bfOffBits += (1 << bi->bmiHeader.biBitCount) * DWORD(sizeof(bi->bmiColors[0]));
@@ -4684,18 +4691,18 @@ void CMainFrame::SaveDIB(LPCTSTR fn, BYTE* pData, long size) pngdib_d2p_set_gamma_label(pngdib, 1, PNGDIB_DEFAULT_FILE_GAMMA);
ret = pngdib_d2p_run(pngdib);
pngdib_done(pngdib);
- if(ret) {
+ if (ret) {
CString err_str;
err_str.Format(_T("%s\n%s (%d)"), IDS_MAINFRM_53, pngdib_get_error_msg(pngdib), ret);
AfxMessageBox(err_str, MB_OK);
}
- } else if(ext == _T(".jpg")) {
+ } else if (ext == _T(".jpg")) {
CJpegEncoderFile(fn).Encode(pData);
}
CPath p(fn);
- if(CDC* pDC = m_wndStatusBar.m_status.GetDC()) {
+ if (CDC* pDC = m_wndStatusBar.m_status.GetDC()) {
CRect r;
m_wndStatusBar.m_status.GetClientRect(r);
p.CompactPath(pDC->m_hDC, r.Width());
@@ -4710,7 +4717,7 @@ void CMainFrame::SaveImage(LPCTSTR fn) BYTE* pData = NULL;
long size = 0;
- if(GetDIB(&pData, size)) {
+ if (GetDIB(&pData, size)) {
SaveDIB(fn, pData, size);
delete [] pData;
}
@@ -4718,14 +4725,14 @@ void CMainFrame::SaveImage(LPCTSTR fn) void CMainFrame::SaveThumbnails(LPCTSTR fn)
{
- if(!pMC || !pMS || GetPlaybackMode() != PM_FILE /*&& GetPlaybackMode() != PM_DVD*/) {
+ if (!pMC || !pMS || GetPlaybackMode() != PM_FILE /*&& GetPlaybackMode() != PM_DVD*/) {
return;
}
REFERENCE_TIME rtPos = GetPos();
REFERENCE_TIME rtDur = GetDur();
- if(rtDur <= 0) {
+ if (rtDur <= 0) {
AfxMessageBox(ResStr(IDS_MAINFRM_54));
return;
}
@@ -4739,7 +4746,7 @@ void CMainFrame::SaveThumbnails(LPCTSTR fn) if (m_pMFVDC) {
m_pMFVDC->GetNativeVideoSize(&wh, &arxy);
- } else if(m_pCAP) {
+ } else if (m_pCAP) {
wh = m_pCAP->GetVideoSize(false);
arxy = m_pCAP->GetVideoSize(true);
} else {
@@ -4747,19 +4754,19 @@ void CMainFrame::SaveThumbnails(LPCTSTR fn) long arx = 0, ary = 0;
CComQIPtr<IBasicVideo2> pBV2 = pBV;
- if(pBV2 && SUCCEEDED(pBV2->GetPreferredAspectRatio(&arx, &ary)) && arx > 0 && ary > 0) {
+ if (pBV2 && SUCCEEDED(pBV2->GetPreferredAspectRatio(&arx, &ary)) && arx > 0 && ary > 0) {
arxy.SetSize(arx, ary);
}
}
- if(wh.cx <= 0 || wh.cy <= 0) {
+ if (wh.cx <= 0 || wh.cy <= 0) {
AfxMessageBox(ResStr(IDS_MAINFRM_55));
return;
}
// with the overlay mixer IBasicVideo2 won't tell the new AR when changed dynamically
DVD_VideoAttributes VATR;
- if(GetPlaybackMode() == PM_DVD && SUCCEEDED(pDVDI->GetCurrentVideoAttributes(&VATR))) {
+ if (GetPlaybackMode() == PM_DVD && SUCCEEDED(pDVDI->GetCurrentVideoAttributes(&VATR))) {
arxy.SetSize(VATR.ulAspectX, VATR.ulAspectY);
}
@@ -4779,7 +4786,7 @@ void CMainFrame::SaveThumbnails(LPCTSTR fn) int dibsize = sizeof(BITMAPINFOHEADER) + width*height*4;
CAutoVectorPtr<BYTE> dib;
- if(!dib.Allocate(dibsize)) {
+ if (!dib.Allocate(dibsize)) {
AfxMessageBox(ResStr(IDS_MAINFRM_56));
return;
}
@@ -4805,8 +4812,8 @@ void CMainFrame::SaveThumbnails(LPCTSTR fn) {
BYTE* p = (BYTE*)spd.bits;
- for(int y = 0; y < spd.h; y++, p += spd.pitch)
- for(int x = 0; x < spd.w; x++) {
+ for (int y = 0; y < spd.h; y++, p += spd.pitch)
+ for (int x = 0; x < spd.w; x++) {
((DWORD*)p)[x] = 0x010101 * (0xe0 + 0x08*y/spd.h + 0x18*(spd.w-x)/spd.w);
}
}
@@ -4814,7 +4821,7 @@ void CMainFrame::SaveThumbnails(LPCTSTR fn) CCritSec csSubLock;
RECT bbox;
- for(int i = 1, pics = cols*rows; i <= pics; i++) {
+ for (int i = 1, pics = cols*rows; i <= pics; i++) {
REFERENCE_TIME rt = rtDur * i / (pics+1);
DVD_HMSF_TIMECODE hmsf = RT2HMSF(rt, 25);
@@ -4825,7 +4832,7 @@ void CMainFrame::SaveThumbnails(LPCTSTR fn) HRESULT hr = pFS ? pFS->Step(1, NULL) : E_FAIL;
- if(FAILED(hr)) {
+ if (FAILED(hr)) {
pBA->put_Volume(m_VolumeBeforeFrameStepping);
AfxMessageBox(_T("Cannot frame step, try a different video renderer."));
return;
@@ -4834,11 +4841,11 @@ void CMainFrame::SaveThumbnails(LPCTSTR fn) HANDLE hGraphEvent = NULL;
pME->GetEventHandle((OAEVENT*)&hGraphEvent);
- while(hGraphEvent && WaitForSingleObject(hGraphEvent, INFINITE) == WAIT_OBJECT_0) {
+ while (hGraphEvent && WaitForSingleObject(hGraphEvent, INFINITE) == WAIT_OBJECT_0) {
LONG evCode = 0, evParam1, evParam2;
- while(SUCCEEDED(pME->GetEvent(&evCode, (LONG_PTR*)&evParam1, (LONG_PTR*)&evParam2, 0))) {
+ while (SUCCEEDED(pME->GetEvent(&evCode, (LONG_PTR*)&evParam1, (LONG_PTR*)&evParam2, 0))) {
pME->FreeEventParams(evCode, evParam1, evParam2);
- if(EC_STEP_COMPLETE == evCode) {
+ if (EC_STEP_COMPLETE == evCode) {
hGraphEvent = NULL;
}
}
@@ -4873,13 +4880,13 @@ void CMainFrame::SaveThumbnails(LPCTSTR fn) BYTE* pData = NULL;
long size = 0;
- if(!GetDIB(&pData, size)) {
+ if (!GetDIB(&pData, size)) {
return;
}
BITMAPINFO* bi = (BITMAPINFO*)pData;
- if(bi->bmiHeader.biBitCount != 32) {
+ if (bi->bmiHeader.biBitCount != 32) {
delete [] pData;
CString str;
str.Format(ResStr(IDS_MAINFRM_57), bi->bmiHeader.biBitCount);
@@ -4891,7 +4898,7 @@ void CMainFrame::SaveThumbnails(LPCTSTR fn) int sh = abs(bi->bmiHeader.biHeight);
int sp = sw*4;
const BYTE* src = pData + sizeof(bi->bmiHeader);
- if(bi->bmiHeader.biHeight >= 0) {
+ if (bi->bmiHeader.biHeight >= 0) {
src += sp*(sh-1);
sp = -sp;
}
@@ -4899,7 +4906,7 @@ void CMainFrame::SaveThumbnails(LPCTSTR fn) int dp = spd.pitch;
BYTE* dst = (BYTE*)spd.bits + spd.pitch*r.top + r.left*4;
- for(DWORD h = r.bottom - r.top, y = 0, yd = (sh<<8)/h; h > 0; y += yd, h--) {
+ for (DWORD h = r.bottom - r.top, y = 0, yd = (sh<<8)/h; h > 0; y += yd, h--) {
DWORD yf = y&0xff;
DWORD yi = y>>8;
@@ -4907,7 +4914,7 @@ void CMainFrame::SaveThumbnails(LPCTSTR fn) DWORD* s1 = (DWORD*)(src + (int)yi*sp + sp);
DWORD* d = (DWORD*)dst;
- for(DWORD w = r.right - r.left, x = 0, xd = (sw<<8)/w; w > 0; x += xd, w--) {
+ for (DWORD w = r.right - r.left, x = 0, xd = (sw<<8)/w; w > 0; x += xd, w--) {
DWORD xf = x&0xff;
DWORD xi = x>>8;
@@ -4958,7 +4965,7 @@ void CMainFrame::SaveThumbnails(LPCTSTR fn) CStringW fs;
WIN32_FIND_DATA wfd;
HANDLE hFind = FindFirstFile(m_wndPlaylistBar.GetCurFileName(), &wfd);
- if(hFind != INVALID_HANDLE_VALUE) {
+ if (hFind != INVALID_HANDLE_VALUE) {
FindClose(hFind);
__int64 size = (__int64(wfd.nFileSizeHigh)<<32)|wfd.nFileSizeLow;
@@ -4969,7 +4976,7 @@ void CMainFrame::SaveThumbnails(LPCTSTR fn) }
CStringW ar;
- if(arxy.cx > 0 && arxy.cy > 0 && arxy.cx != wh.cx && arxy.cy != wh.cy) {
+ if (arxy.cx > 0 && arxy.cy > 0 && arxy.cx != wh.cx && arxy.cy != wh.cy) {
ar.Format(L"(%d:%d)", arxy.cx, arxy.cy);
}
@@ -4998,23 +5005,23 @@ BOOL CMainFrame::IsRendererCompatibleWithSaveImage() BOOL result = TRUE;
AppSettings& s = AfxGetAppSettings();
- if(m_fRealMediaGraph) {
- if(s.iRMVideoRendererType == VIDRNDT_RM_DEFAULT) {
+ if (m_fRealMediaGraph) {
+ if (s.iRMVideoRendererType == VIDRNDT_RM_DEFAULT) {
AfxMessageBox(_T("The 'Save Image' and 'Save Thumbnails' functions do not work with the default video renderer for RealMedia.\nSelect one of the DirectX renderers for RealMedia in MPC's output options and reopen the file."));
result = FALSE;
}
} else {
- if(m_fQuicktimeGraph) {
- if(s.iQTVideoRendererType == VIDRNDT_QT_DEFAULT) {
+ if (m_fQuicktimeGraph) {
+ if (s.iQTVideoRendererType == VIDRNDT_QT_DEFAULT) {
AfxMessageBox(_T("The 'Save Image and 'Save Thumbnails' functions do not work with the default video renderer for QuickTime.\nSelect one of the DirectX renderers for QuickTime in MPC's output options and reopen the file."));
result = FALSE;
}
} else {
- if(m_fShockwaveGraph) {
+ if (m_fShockwaveGraph) {
AfxMessageBox(_T("The 'Save Image' and 'Save Thumbnails' functions do not work for Shockwave files."));
result = FALSE;
} else {
- if(s.iDSVideoRendererType == VIDRNDT_DS_OVERLAYMIXER) {
+ if (s.iDSVideoRendererType == VIDRNDT_DS_OVERLAYMIXER) {
AfxMessageBox(_T("The 'Save Image' and 'Save Thumbnails' functions do not work with the Overlay Mixer video renderer.\nChange the video renderer in MPC's output options and reopen the file."));
result = FALSE;
}
@@ -5027,7 +5034,7 @@ BOOL CMainFrame::IsRendererCompatibleWithSaveImage() CString CMainFrame::GetVidPos()
{
CString posstr = _T("");
- if((GetPlaybackMode() == PM_FILE) || (GetPlaybackMode() == PM_DVD)) {
+ if ((GetPlaybackMode() == PM_FILE) || (GetPlaybackMode() == PM_DVD)) {
__int64 start, stop, pos;
m_wndSeekBar.GetRange(start, stop);
pos = m_wndSeekBar.GetPosReal();
@@ -5035,7 +5042,7 @@ CString CMainFrame::GetVidPos() DVD_HMSF_TIMECODE tcNow = RT2HMSF(pos);
DVD_HMSF_TIMECODE tcDur = RT2HMSF(stop);
- if(tcDur.bHours > 0 || (pos >= stop && tcNow.bHours > 0)) {
+ if (tcDur.bHours > 0 || (pos >= stop && tcNow.bHours > 0)) {
posstr.Format(_T("%02d.%02d.%02d"), tcNow.bHours, tcNow.bMinutes, tcNow.bSeconds);
} else {
posstr.Format(_T("%02d.%02d"), tcNow.bMinutes, tcNow.bSeconds);
@@ -5050,18 +5057,18 @@ void CMainFrame::OnFileSaveImage() AppSettings& s = AfxGetAppSettings();
/* Check if a compatible renderer is being used */
- if(!IsRendererCompatibleWithSaveImage()) {
+ if (!IsRendererCompatibleWithSaveImage()) {
return;
}
CPath psrc(s.strSnapShotPath);
CStringW prefix = _T("snapshot");
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
CPath path(m_wndPlaylistBar.GetCurFileName());
path.StripPath();
prefix.Format(_T("%s_snapshot_%s"), path, GetVidPos());
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
prefix.Format(_T("snapshot_dvd_%s"), GetVidPos());
}
psrc.Combine(s.strSnapShotPath, MakeSnapshotFileName(prefix));
@@ -5070,21 +5077,21 @@ void CMainFrame::OnFileSaveImage() OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST|OFN_NOCHANGEDIR,
_T("BMP - Windows Bitmap (*.bmp)|*.bmp|JPG - JPEG Image (*.jpg)|*.jpg|PNG - Portable Network Graphics (*.png)|*.png||"), GetModalParent(), 0);
- if(s.strSnapShotExt == _T(".bmp")) {
+ if (s.strSnapShotExt == _T(".bmp")) {
fd.m_pOFN->nFilterIndex = 1;
- } else if(s.strSnapShotExt == _T(".jpg")) {
+ } else if (s.strSnapShotExt == _T(".jpg")) {
fd.m_pOFN->nFilterIndex = 2;
- } else if(s.strSnapShotExt == _T(".png")) {
+ } else if (s.strSnapShotExt == _T(".png")) {
fd.m_pOFN->nFilterIndex = 3;
}
- if(fd.DoModal() != IDOK) {
+ if (fd.DoModal() != IDOK) {
return;
}
- if(fd.m_pOFN->nFilterIndex == 1) {
+ if (fd.m_pOFN->nFilterIndex == 1) {
s.strSnapShotExt = _T(".bmp");
- } else if(fd.m_pOFN->nFilterIndex == 2) {
+ } else if (fd.m_pOFN->nFilterIndex == 2) {
s.strSnapShotExt = _T(".jpg");
} else {
fd.m_pOFN->nFilterIndex = 3;
@@ -5092,7 +5099,7 @@ void CMainFrame::OnFileSaveImage() }
CPath pdst(fd.GetPathName());
- if(pdst.GetExtension().MakeLower() != s.strSnapShotExt) {
+ if (pdst.GetExtension().MakeLower() != s.strSnapShotExt) {
pdst.RenameExtension(s.strSnapShotExt);
}
CString path = (LPCTSTR)pdst;
@@ -5107,16 +5114,16 @@ void CMainFrame::OnFileSaveImageAuto() AppSettings& s = AfxGetAppSettings();
/* Check if a compatible renderer is being used */
- if(!IsRendererCompatibleWithSaveImage()) {
+ if (!IsRendererCompatibleWithSaveImage()) {
return;
}
CStringW prefix = _T("snapshot");
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
CPath path(m_wndPlaylistBar.GetCurFileName());
path.StripPath();
prefix.Format(_T("%s_snapshot_%s"), path, GetVidPos());
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
prefix.Format(_T("snapshot_dvd_%s"), GetVidPos());
}
@@ -5136,13 +5143,13 @@ void CMainFrame::OnFileSaveThumbnails() AppSettings& s = AfxGetAppSettings();
/* Check if a compatible renderer is being used */
- if(!IsRendererCompatibleWithSaveImage()) {
+ if (!IsRendererCompatibleWithSaveImage()) {
return;
}
CPath psrc(s.strSnapShotPath);
CStringW prefix = _T("thumbs");
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
CPath path(m_wndPlaylistBar.GetCurFileName());
path.StripPath();
prefix.Format(_T("%s_thumbs"), path);
@@ -5154,21 +5161,21 @@ void CMainFrame::OnFileSaveThumbnails() 0, (LPCTSTR)psrc,
_T("BMP - Windows Bitmap (*.bmp)|*.bmp|JPG - JPEG Image (*.jpg)|*.jpg|PNG - Portable Network Graphics (*.png)|*.png||"), GetModalParent());
- if(s.strSnapShotExt == _T(".bmp")) {
+ if (s.strSnapShotExt == _T(".bmp")) {
fd.m_pOFN->nFilterIndex = 1;
- } else if(s.strSnapShotExt == _T(".jpg")) {
+ } else if (s.strSnapShotExt == _T(".jpg")) {
fd.m_pOFN->nFilterIndex = 2;
- } else if(s.strSnapShotExt == _T(".png")) {
+ } else if (s.strSnapShotExt == _T(".png")) {
fd.m_pOFN->nFilterIndex = 3;
}
- if(fd.DoModal() != IDOK) {
+ if (fd.DoModal() != IDOK) {
return;
}
- if(fd.m_pOFN->nFilterIndex == 1) {
+ if (fd.m_pOFN->nFilterIndex == 1) {
s.strSnapShotExt = _T(".bmp");
- } else if(fd.m_pOFN->nFilterIndex == 2) {
+ } else if (fd.m_pOFN->nFilterIndex == 2) {
s.strSnapShotExt = _T(".jpg");
} else {
fd.m_pOFN->nFilterIndex = 3;
@@ -5180,7 +5187,7 @@ void CMainFrame::OnFileSaveThumbnails() s.iThumbWidth = fd.m_width;
CPath pdst(fd.GetPathName());
- if(pdst.GetExtension().MakeLower() != s.strSnapShotExt) {
+ if (pdst.GetExtension().MakeLower() != s.strSnapShotExt) {
pdst.RenameExtension(s.strSnapShotExt);
}
CString path = (LPCTSTR)pdst;
@@ -5210,7 +5217,7 @@ void CMainFrame::OnUpdateFileConvert(CCmdUI* pCmdUI) */
void CMainFrame::OnFileLoadsubtitle()
{
- if(!m_pCAP) {
+ if (!m_pCAP) {
AfxMessageBox(ResStr(IDS_MAINFRM_60)+
ResStr(IDS_MAINFRM_61)+
ResStr(IDS_MAINFRM_62)+
@@ -5228,12 +5235,12 @@ void CMainFrame::OnFileLoadsubtitle() OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY|OFN_NOCHANGEDIR,
szFilter, GetModalParent(), 0);
- if(fd.DoModal() != IDOK) {
+ if (fd.DoModal() != IDOK) {
return;
}
ISubStream *pSubStream = NULL;
- if(LoadSubtitle(fd.GetPathName(), &pSubStream)) {
+ if (LoadSubtitle(fd.GetPathName(), &pSubStream)) {
SetSubtitle(pSubStream); // the subtitle at the insert position according to LoadSubtitle()
}
}
@@ -5248,24 +5255,24 @@ void CMainFrame::OnFileSavesubtitle() int i = m_iSubtitleSel;
POSITION pos = m_pSubStreams.GetHeadPosition();
- while(pos && i >= 0) {
+ while (pos && i >= 0) {
CComPtr<ISubStream> pSubStream = m_pSubStreams.GetNext(pos);
- if(i < pSubStream->GetStreamCount()) {
+ if (i < pSubStream->GetStreamCount()) {
CLSID clsid;
- if(FAILED(pSubStream->GetClassID(&clsid))) {
+ if (FAILED(pSubStream->GetClassID(&clsid))) {
continue;
}
OpenMediaData *pOMD = m_wndPlaylistBar.GetCurOMD();
CString suggestedFileName("");
- if(OpenFileData* p = dynamic_cast<OpenFileData*>(pOMD)) {
+ if (OpenFileData* p = dynamic_cast<OpenFileData*>(pOMD)) {
// HACK: get the file name from the current playlist item
suggestedFileName = m_wndPlaylistBar.GetCurFileName();
suggestedFileName = suggestedFileName.Left(suggestedFileName.ReverseFind('.')); // exclude the extension, it will be auto completed
}
- if(clsid == __uuidof(CVobSubFile)) {
+ if (clsid == __uuidof(CVobSubFile)) {
CVobSubFile* pVSF = (CVobSubFile*)(ISubStream*)pSubStream;
// remember to set lpszDefExt to the first extension in the filter so that the save dialog autocompletes the extension
@@ -5274,13 +5281,13 @@ void CMainFrame::OnFileSavesubtitle() OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST|OFN_NOCHANGEDIR,
_T("VobSub (*.idx, *.sub)|*.idx;*.sub||"), GetModalParent(), 0);
- if(fd.DoModal() == IDOK) {
+ if (fd.DoModal() == IDOK) {
CAutoLock cAutoLock(&m_csSubLock);
pVSF->Save(fd.GetPathName());
}
return;
- } else if(clsid == __uuidof(CRenderedTextSubtitle)) {
+ } else if (clsid == __uuidof(CRenderedTextSubtitle)) {
CRenderedTextSubtitle* pRTS = (CRenderedTextSubtitle*)(ISubStream*)pSubStream;
CString filter;
@@ -5296,7 +5303,7 @@ void CMainFrame::OnFileSavesubtitle() // same thing as in the case of CVobSubFile above for lpszDefExt
CSaveTextFileDialog fd(pRTS->m_encoding, _T("srt"), suggestedFileName, filter, GetModalParent());
- if(fd.DoModal() == IDOK) {
+ if (fd.DoModal() == IDOK) {
CAutoLock cAutoLock(&m_csSubLock);
pRTS->SaveAs(fd.GetPathName(), (exttype)(fd.m_ofn.nFilterIndex-1), m_pCAP->GetFPS(), fd.GetEncoding());
}
@@ -5347,7 +5354,7 @@ void CMainFrame::OnFileISDBDownload() {
AppSettings& s = AfxGetAppSettings();
filehash fh;
- if(!::hash((CString)m_wndPlaylistBar.GetCurFileName(), fh)) {
+ if (!::hash((CString)m_wndPlaylistBar.GetCurFileName(), fh)) {
MessageBeep((UINT)-1);
return;
}
@@ -5363,7 +5370,7 @@ void CMainFrame::OnFileISDBDownload() CInternetSession is;
CStringA str;
- if(!OpenUrl(is, CString(url+args), str)) {
+ if (!OpenUrl(is, CString(url+args), str)) {
AfxMessageBox(_T("Cannot connect to subtitle database site"), MB_OK);
return;
}
@@ -5377,74 +5384,74 @@ void CMainFrame::OnFileISDBDownload() Explode(str, sl, '\n');
POSITION pos = sl.GetHeadPosition();
- while(pos) {
+ while (pos) {
str = sl.GetNext(pos);
CStringA param = str.Left(max(0, str.Find('=')));
CStringA value = str.Mid(str.Find('=')+1);
- if(param == "ticket") {
+ if (param == "ticket") {
ticket = value;
- } else if(param == "movie") {
+ } else if (param == "movie") {
m.reset();
Explode(value, m.titles, '|');
- } else if(param == "subtitle") {
+ } else if (param == "subtitle") {
sub.reset();
sub.id = atoi(value);
- } else if(param == "name") {
+ } else if (param == "name") {
sub.name = value;
- } else if(param == "discs") {
+ } else if (param == "discs") {
sub.discs = atoi(value);
- } else if(param == "disc_no") {
+ } else if (param == "disc_no") {
sub.disc_no = atoi(value);
- } else if(param == "format") {
+ } else if (param == "format") {
sub.format = value;
- } else if(param == "iso639_2") {
+ } else if (param == "iso639_2") {
sub.iso639_2 = value;
- } else if(param == "language") {
+ } else if (param == "language") {
sub.language = value;
- } else if(param == "nick") {
+ } else if (param == "nick") {
sub.nick = value;
- } else if(param == "email") {
+ } else if (param == "email") {
sub.email = value;
- } else if(param == "" && value == "endsubtitle") {
+ } else if (param == "" && value == "endsubtitle") {
m.subs.AddTail(sub);
- } else if(param == "" && value == "endmovie") {
+ } else if (param == "" && value == "endmovie") {
movies.AddTail(m);
- } else if(param == "" && value == "end") {
+ } else if (param == "" && value == "end") {
break;
}
}
CSubtitleDlDlg dlg(movies, GetModalParent());
- if(IDOK == dlg.DoModal()) {
- if(dlg.m_fReplaceSubs) {
+ if (IDOK == dlg.DoModal()) {
+ if (dlg.m_fReplaceSubs) {
m_pSubStreams.RemoveAll();
}
CComPtr<ISubStream> pSubStreamToSet;
POSITION pos = dlg.m_selsubs.GetHeadPosition();
- while(pos) {
+ while (pos) {
isdb_subtitle& sub = dlg.m_selsubs.GetNext(pos);
CStringA url = "http://" + s.strISDb + "/dl.php?";
CStringA args;
args.Format("id=%d&ticket=%s", sub.id, UrlEncode(ticket));
- if(OpenUrl(is, CString(url+args), str)) {
+ if (OpenUrl(is, CString(url+args), str)) {
CAutoPtr<CRenderedTextSubtitle> pRTS(DNew CRenderedTextSubtitle(&m_csSubLock, &s.subdefstyle, s.fUseDefaultSubtitlesStyle));
- if(pRTS && pRTS->Open((BYTE*)(LPCSTR)str, str.GetLength(), DEFAULT_CHARSET, CString(sub.name)) && pRTS->GetStreamCount() > 0) {
+ if (pRTS && pRTS->Open((BYTE*)(LPCSTR)str, str.GetLength(), DEFAULT_CHARSET, CString(sub.name)) && pRTS->GetStreamCount() > 0) {
CComPtr<ISubStream> pSubStream = pRTS.Detach();
m_pSubStreams.AddTail(pSubStream);
- if(!pSubStreamToSet) {
+ if (!pSubStreamToSet) {
pSubStreamToSet = pSubStream;
}
}
}
}
- if(pSubStreamToSet) {
+ if (pSubStreamToSet) {
SetSubtitle(pSubStreamToSet);
}
}
@@ -6197,7 +6204,9 @@ void CMainFrame::OnViewFullFloatingPointProcessing() {
CRenderersSettings& s = AfxGetAppSettings().m_RenderersSettings;
s.m_RenderSettings.iVMR9FullFloatingPointProcessing = !s.m_RenderSettings.iVMR9FullFloatingPointProcessing;
- if(s.m_RenderSettings.iVMR9FullFloatingPointProcessing) s.m_RenderSettings.iVMR9HalfFloatingPointProcessing = false;
+ if (s.m_RenderSettings.iVMR9FullFloatingPointProcessing) {
+ s.m_RenderSettings.iVMR9HalfFloatingPointProcessing = false;
+ }
s.UpdateData(true);
CString Format;
Format.Format(L"Full Floating Point Processing: %s", s.m_RenderSettings.iVMR9FullFloatingPointProcessing? L"On":L"Off");
@@ -6208,7 +6217,9 @@ void CMainFrame::OnViewHalfFloatingPointProcessing() {
CRenderersSettings& s = AfxGetAppSettings().m_RenderersSettings;
s.m_RenderSettings.iVMR9HalfFloatingPointProcessing = !s.m_RenderSettings.iVMR9HalfFloatingPointProcessing;
- if(s.m_RenderSettings.iVMR9HalfFloatingPointProcessing) s.m_RenderSettings.iVMR9FullFloatingPointProcessing = false;
+ if (s.m_RenderSettings.iVMR9HalfFloatingPointProcessing) {
+ s.m_RenderSettings.iVMR9FullFloatingPointProcessing = false;
+ }
s.UpdateData(true);
CString Format;
Format.Format(L"Half Floating Point Processing: %s", s.m_RenderSettings.iVMR9HalfFloatingPointProcessing? L"On":L"Off");
@@ -6358,7 +6369,7 @@ void CMainFrame::OnViewCaptionmenu() CRect wr;
GetWindowRect( &wr );
- switch(s.iCaptionMenuMode) {
+ switch (s.iCaptionMenuMode) {
case MODE_SHOWCAPTIONMENU: // borderless -> normal
dwAdd = WS_CAPTION | WS_THICKFRAME;
hMenu = m_hMenuDefault;
@@ -6447,7 +6458,7 @@ void CMainFrame::OnViewEditListEditor() void CMainFrame::OnEDLIn()
{
- if(AfxGetAppSettings().fEnableEDLEditor && (m_iMediaLoadState == MLS_LOADED) && (GetPlaybackMode() == PM_FILE)) {
+ if (AfxGetAppSettings().fEnableEDLEditor && (m_iMediaLoadState == MLS_LOADED) && (GetPlaybackMode() == PM_FILE)) {
REFERENCE_TIME rt;
pMS->GetCurrentPosition(&rt);
@@ -6462,7 +6473,7 @@ void CMainFrame::OnUpdateEDLIn(CCmdUI* pCmdUI) void CMainFrame::OnEDLOut()
{
- if(AfxGetAppSettings().fEnableEDLEditor && (m_iMediaLoadState == MLS_LOADED) && (GetPlaybackMode() == PM_FILE)) {
+ if (AfxGetAppSettings().fEnableEDLEditor && (m_iMediaLoadState == MLS_LOADED) && (GetPlaybackMode() == PM_FILE)) {
REFERENCE_TIME rt;
pMS->GetCurrentPosition(&rt);
@@ -6477,7 +6488,7 @@ void CMainFrame::OnUpdateEDLOut(CCmdUI* pCmdUI) void CMainFrame::OnEDLNewClip()
{
- if(AfxGetAppSettings().fEnableEDLEditor && (m_iMediaLoadState == MLS_LOADED) && (GetPlaybackMode() == PM_FILE)) {
+ if (AfxGetAppSettings().fEnableEDLEditor && (m_iMediaLoadState == MLS_LOADED) && (GetPlaybackMode() == PM_FILE)) {
REFERENCE_TIME rt;
pMS->GetCurrentPosition(&rt);
@@ -6492,7 +6503,7 @@ void CMainFrame::OnUpdateEDLNewClip(CCmdUI* pCmdUI) void CMainFrame::OnEDLSave()
{
- if(AfxGetAppSettings().fEnableEDLEditor && (m_iMediaLoadState == MLS_LOADED) && (GetPlaybackMode() == PM_FILE)) {
+ if (AfxGetAppSettings().fEnableEDLEditor && (m_iMediaLoadState == MLS_LOADED) && (GetPlaybackMode() == PM_FILE)) {
m_wndEditListEditor.Save();
}
}
@@ -6543,7 +6554,7 @@ void CMainFrame::OnUpdateViewShaderEditor(CCmdUI* pCmdUI) void CMainFrame::OnViewMinimal()
{
- while(AfxGetAppSettings().iCaptionMenuMode!=MODE_BORDERLESS) {
+ while (AfxGetAppSettings().iCaptionMenuMode!=MODE_BORDERLESS) {
SendMessage(WM_COMMAND, ID_VIEW_CAPTIONMENU);
}
ShowControls(CS_NONE);
@@ -6555,7 +6566,7 @@ void CMainFrame::OnUpdateViewMinimal(CCmdUI* pCmdUI) void CMainFrame::OnViewCompact()
{
- while(AfxGetAppSettings().iCaptionMenuMode!=MODE_FRAMEONLY) {
+ while (AfxGetAppSettings().iCaptionMenuMode!=MODE_FRAMEONLY) {
SendMessage(WM_COMMAND, ID_VIEW_CAPTIONMENU);
}
ShowControls(CS_TOOLBAR);
@@ -6567,7 +6578,7 @@ void CMainFrame::OnUpdateViewCompact(CCmdUI* pCmdUI) void CMainFrame::OnViewNormal()
{
- while(AfxGetAppSettings().iCaptionMenuMode!=MODE_SHOWCAPTIONMENU) {
+ while (AfxGetAppSettings().iCaptionMenuMode!=MODE_SHOWCAPTIONMENU) {
SendMessage(WM_COMMAND, ID_VIEW_CAPTIONMENU);
}
ShowControls(CS_SEEKBAR|CS_TOOLBAR|CS_STATUSBAR|CS_INFOBAR);
@@ -6635,7 +6646,7 @@ void CMainFrame::OnViewSwitchVideoFrame() } else {
vs++;
}
- switch(vs) { // TODO: Read messages from resource file
+ switch (vs) { // TODO: Read messages from resource file
case DVS_STRETCH:
m_OSD.DisplayMessage (OSD_TOPLEFT, ResStr(IDS_STRETCH_TO_WINDOW));
break;
@@ -6684,14 +6695,14 @@ void CMainFrame::OnUpdateViewCompMonDeskARDiff(CCmdUI* pCmdUI) void CMainFrame::OnViewPanNScan(UINT nID)
{
- if(m_iMediaLoadState != MLS_LOADED) {
+ if (m_iMediaLoadState != MLS_LOADED) {
return;
}
int x = 0, y = 0;
int dx = 0, dy = 0;
- switch(nID) {
+ switch (nID) {
case ID_VIEW_RESET:
m_ZoomX = m_ZoomY = 1.0;
m_PosX = m_PosY = 0.5;
@@ -6748,29 +6759,29 @@ void CMainFrame::OnViewPanNScan(UINT nID) break;
}
- if(x > 0 && m_ZoomX < 3) {
+ if (x > 0 && m_ZoomX < 3) {
m_ZoomX *= 1.02;
}
- if(x < 0 && m_ZoomX > 0.2) {
+ if (x < 0 && m_ZoomX > 0.2) {
m_ZoomX /= 1.02;
}
- if(y > 0 && m_ZoomY < 3) {
+ if (y > 0 && m_ZoomY < 3) {
m_ZoomY *= 1.02;
}
- if(y < 0 && m_ZoomY > 0.2) {
+ if (y < 0 && m_ZoomY > 0.2) {
m_ZoomY /= 1.02;
}
- if(dx < 0 && m_PosX > 0) {
+ if (dx < 0 && m_PosX > 0) {
m_PosX = max(m_PosX - 0.005*m_ZoomX, 0);
}
- if(dx > 0 && m_PosX < 1) {
+ if (dx > 0 && m_PosX < 1) {
m_PosX = min(m_PosX + 0.005*m_ZoomX, 1);
}
- if(dy < 0 && m_PosY > 0) {
+ if (dy < 0 && m_PosY > 0) {
m_PosY = max(m_PosY - 0.005*m_ZoomY, 0);
}
- if(dy > 0 && m_PosY < 1) {
+ if (dy > 0 && m_PosY < 1) {
m_PosY = min(m_PosY + 0.005*m_ZoomY, 1);
}
@@ -6784,7 +6795,7 @@ void CMainFrame::OnUpdateViewPanNScan(CCmdUI* pCmdUI) void CMainFrame::OnViewPanNScanPresets(UINT nID)
{
- if(m_iMediaLoadState != MLS_LOADED) {
+ if (m_iMediaLoadState != MLS_LOADED) {
return;
}
@@ -6792,10 +6803,10 @@ void CMainFrame::OnViewPanNScanPresets(UINT nID) nID -= ID_PANNSCAN_PRESETS_START;
- if((INT_PTR)nID == s.m_pnspresets.GetCount()) {
+ if ((INT_PTR)nID == s.m_pnspresets.GetCount()) {
CPnSPresetsDlg dlg;
dlg.m_pnspresets.Copy(s.m_pnspresets);
- if(dlg.DoModal() == IDOK) {
+ if (dlg.DoModal() == IDOK) {
s.m_pnspresets.Copy(dlg.m_pnspresets);
s.UpdateData(true);
}
@@ -6810,13 +6821,13 @@ void CMainFrame::OnViewPanNScanPresets(UINT nID) CString str = s.m_pnspresets[nID];
int i = 0, j = 0;
- for(CString token = str.Tokenize(_T(","), i); !token.IsEmpty(); token = str.Tokenize(_T(","), i), j++) {
+ for (CString token = str.Tokenize(_T(","), i); !token.IsEmpty(); token = str.Tokenize(_T(","), i), j++) {
float f = 0;
- if(_stscanf_s(token, _T("%f"), &f) != 1) {
+ if (_stscanf_s(token, _T("%f"), &f) != 1) {
continue;
}
- switch(j) {
+ switch (j) {
case 0:
break;
case 1:
@@ -6836,7 +6847,7 @@ void CMainFrame::OnViewPanNScanPresets(UINT nID) }
}
- if(j != 5) {
+ if (j != 5) {
return;
}
@@ -6857,11 +6868,11 @@ void CMainFrame::OnUpdateViewPanNScanPresets(CCmdUI* pCmdUI) void CMainFrame::OnViewRotate(UINT nID)
{
- if(!m_pCAP) {
+ if (!m_pCAP) {
return;
}
- switch(nID) {
+ switch (nID) {
case ID_PANSCAN_ROTATEXP:
m_AngleX += 2;
break;
@@ -6906,7 +6917,7 @@ void CMainFrame::OnViewAspectRatio(UINT nID) ar = s_ar[nID - ID_ASPECTRATIO_START];
CString info;
- if(ar.cx && ar.cy) {
+ if (ar.cx && ar.cy) {
info.Format(ResStr(IDS_MAINFRM_68), ar.cx, ar.cy);
} else {
info.Format(ResStr(IDS_MAINFRM_69));
@@ -6930,8 +6941,8 @@ void CMainFrame::OnViewAspectRatioNext() UINT nID = ID_ASPECTRATIO_START;
- for(int i = 0; i < countof(s_ar); i++) {
- if(ar == s_ar[i]) {
+ for (int i = 0; i < countof(s_ar); i++) {
+ if (ar == s_ar[i]) {
nID += (i + 1) % countof(s_ar);
break;
}
@@ -6943,7 +6954,7 @@ void CMainFrame::OnViewAspectRatioNext() void CMainFrame::OnViewOntop(UINT nID)
{
nID -= ID_ONTOP_NEVER;
- if(AfxGetAppSettings().iOnTop == (int)nID) {
+ if (AfxGetAppSettings().iOnTop == (int)nID) {
nID = !nID;
}
SetAlwaysOnTop(nID);
@@ -6965,31 +6976,31 @@ void CMainFrame::OnViewOptions() void CMainFrame::OnPlayPlay()
{
- if(m_iMediaLoadState == MLS_CLOSED) {
+ if (m_iMediaLoadState == MLS_CLOSED) {
OpenCurPlaylistItem();
return;
}
- if(m_iMediaLoadState == MLS_LOADED) {
- if(GetMediaState() == State_Stopped) {
+ if (m_iMediaLoadState == MLS_LOADED) {
+ if (GetMediaState() == State_Stopped) {
m_iSpeedLevel = 0;
}
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
m_iSpeedLevel = 0;
- if(m_fEndOfStream) {
+ if (m_fEndOfStream) {
SendMessage(WM_COMMAND, ID_PLAY_STOP);
}
pMS->SetRate (1.0);
pMC->Run();
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
double dRate = 1.0;
m_iSpeedLevel = 0;
pDVDC->PlayForwards(dRate, DVD_CMD_FLAG_Block, NULL);
pDVDC->Pause(FALSE);
pMC->Run();
- } else if(GetPlaybackMode() == PM_CAPTURE) {
+ } else if (GetPlaybackMode() == PM_CAPTURE) {
pMC->Stop(); // audio preview won't be in sync if we run it from paused state
pMC->Run();
if (AfxGetAppSettings().iDefaultCaptureDevice == 1) {
@@ -7002,7 +7013,7 @@ void CMainFrame::OnPlayPlay() }
SetTimersPlay();
- if(m_fFrameSteppingActive) { // FIXME
+ if (m_fFrameSteppingActive) { // FIXME
m_fFrameSteppingActive = false;
pBA->put_Volume(m_VolumeBeforeFrameStepping);
} else {
@@ -7021,14 +7032,14 @@ void CMainFrame::OnPlayPlay() void CMainFrame::OnPlayPauseI()
{
- if(m_iMediaLoadState == MLS_LOADED) {
+ if (m_iMediaLoadState == MLS_LOADED) {
//SetAlwaysOnTop(AfxGetAppSettings().iOnTop);
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
pMC->Pause();
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
pMC->Pause();
- } else if(GetPlaybackMode() == PM_CAPTURE) {
+ } else if (GetPlaybackMode() == PM_CAPTURE) {
pMC->Pause();
}
@@ -7045,7 +7056,7 @@ void CMainFrame::OnPlayPause() {
// Support ffdshow queuing.
// To avoid black out on pause, we have to lock g_ffdshowReceive to synchronize with ReceiveMine.
- if(queue_ffdshow_support) {
+ if (queue_ffdshow_support) {
CAutoLock lck(&g_ffdshowReceive);
return OnPlayPauseI();
}
@@ -7056,17 +7067,17 @@ void CMainFrame::OnPlayPause() void CMainFrame::OnPlayPlaypause()
{
OAFilterState fs = GetMediaState();
- if(fs == State_Running) {
+ if (fs == State_Running) {
SendMessage(WM_COMMAND, ID_PLAY_PAUSE);
- } else if(fs == State_Stopped || fs == State_Paused) {
+ } else if (fs == State_Stopped || fs == State_Paused) {
SendMessage(WM_COMMAND, ID_PLAY_PLAY);
}
}
void CMainFrame::OnPlayStop()
{
- if(m_iMediaLoadState == MLS_LOADED) {
- if(GetPlaybackMode() == PM_FILE) {
+ if (m_iMediaLoadState == MLS_LOADED) {
+ if (GetPlaybackMode() == PM_FILE) {
LONGLONG pos = 0;
pMS->SetPositions(&pos, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning);
pMC->Stop();
@@ -7079,10 +7090,10 @@ void CMainFrame::OnPlayStop() BeginEnumFilters(pGB, pEF, pBF) {
CComQIPtr<IAMNetworkStatus, &IID_IAMNetworkStatus> pAMNS = pBF;
CComQIPtr<IFileSourceFilter> pFSF = pBF;
- if(pAMNS && pFSF) {
+ if (pAMNS && pFSF) {
WCHAR* pFN = NULL;
AM_MEDIA_TYPE mt;
- if(SUCCEEDED(pFSF->GetCurFile(&pFN, &mt)) && pFN && *pFN) {
+ if (SUCCEEDED(pFSF->GetCurFile(&pFN, &mt)) && pFN && *pFN) {
pFSF->Load(pFN, NULL);
CoTaskMemFree(pFN);
}
@@ -7090,17 +7101,17 @@ void CMainFrame::OnPlayStop() }
}
EndEnumFilters;
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
pDVDC->SetOption(DVD_ResetOnStop, TRUE);
pMC->Stop();
pDVDC->SetOption(DVD_ResetOnStop, FALSE);
- } else if(GetPlaybackMode() == PM_CAPTURE) {
+ } else if (GetPlaybackMode() == PM_CAPTURE) {
pMC->Stop();
}
m_iSpeedLevel = 0;
- if(m_fFrameSteppingActive) { // FIXME
+ if (m_fFrameSteppingActive) { // FIXME
m_fFrameSteppingActive = false;
pBA->put_Volume(m_VolumeBeforeFrameStepping);
}
@@ -7110,11 +7121,11 @@ void CMainFrame::OnPlayStop() m_nLoops = 0;
- if(m_hWnd) {
+ if (m_hWnd) {
KillTimersStop();
MoveVideoWindow();
- if(m_iMediaLoadState == MLS_LOADED) {
+ if (m_iMediaLoadState == MLS_LOADED) {
__int64 start, stop;
m_wndSeekBar.GetRange(start, stop);
GUID tf;
@@ -7142,22 +7153,22 @@ void CMainFrame::OnUpdatePlayPauseStop(CCmdUI* pCmdUI) bool fEnable = false;
- if(fs >= 0) {
- if(GetPlaybackMode() == PM_FILE || GetPlaybackMode() == PM_CAPTURE) {
+ if (fs >= 0) {
+ if (GetPlaybackMode() == PM_FILE || GetPlaybackMode() == PM_CAPTURE) {
fEnable = true;
- if(fs == State_Stopped && pCmdUI->m_nID == ID_PLAY_PAUSE && m_fRealMediaGraph) {
+ if (fs == State_Stopped && pCmdUI->m_nID == ID_PLAY_PAUSE && m_fRealMediaGraph) {
fEnable = false; // can't go into paused state from stopped with rm
- } else if(m_fCapturing) {
+ } else if (m_fCapturing) {
fEnable = false;
- } else if(m_fLiveWM && pCmdUI->m_nID == ID_PLAY_PAUSE) {
+ } else if (m_fLiveWM && pCmdUI->m_nID == ID_PLAY_PAUSE) {
fEnable = false;
}
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
fEnable = m_iDVDDomain != DVD_DOMAIN_VideoManagerMenu
&& m_iDVDDomain != DVD_DOMAIN_VideoTitleSetMenu;
- if(fs == State_Stopped && pCmdUI->m_nID == ID_PLAY_PAUSE) {
+ if (fs == State_Stopped && pCmdUI->m_nID == ID_PLAY_PAUSE) {
fEnable = false;
}
}
@@ -7172,14 +7183,14 @@ void CMainFrame::OnPlayFramestep(UINT nID) {
REFERENCE_TIME rt;
- if(pFS && m_fQuicktimeGraph) {
- if(GetMediaState() != State_Paused) {
+ if (pFS && m_fQuicktimeGraph) {
+ if (GetMediaState() != State_Paused) {
SendMessage(WM_COMMAND, ID_PLAY_PAUSE);
}
pFS->Step(nID == ID_PLAY_FRAMESTEP ? 1 : -1, NULL);
- } else if(pFS && nID == ID_PLAY_FRAMESTEP) {
- if(GetMediaState() != State_Paused && !queue_ffdshow_support) {
+ } else if (pFS && nID == ID_PLAY_FRAMESTEP) {
+ if (GetMediaState() != State_Paused && !queue_ffdshow_support) {
SendMessage(WM_COMMAND, ID_PLAY_PAUSE);
}
@@ -7195,22 +7206,22 @@ void CMainFrame::OnPlayFramestep(UINT nID) pBA->put_Volume(-10000);
pFS->Step(1, NULL);
- } else if(S_OK == pMS->IsFormatSupported(&TIME_FORMAT_FRAME)) {
- if(GetMediaState() != State_Paused) {
+ } else if (S_OK == pMS->IsFormatSupported(&TIME_FORMAT_FRAME)) {
+ if (GetMediaState() != State_Paused) {
SendMessage(WM_COMMAND, ID_PLAY_PAUSE);
}
pMS->SetTimeFormat(&TIME_FORMAT_FRAME);
pMS->GetCurrentPosition(&rt);
- if(nID == ID_PLAY_FRAMESTEP) {
+ if (nID == ID_PLAY_FRAMESTEP) {
rt++;
- } else if(nID == ID_PLAY_FRAMESTEPCANCEL) {
+ } else if (nID == ID_PLAY_FRAMESTEPCANCEL) {
rt--;
}
pMS->SetPositions(&rt, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning);
pMS->SetTimeFormat(&TIME_FORMAT_MEDIA_TIME);
} else { //if (s.iDSVideoRendererType != VIDRNDT_DS_VMR9WINDOWED && s.iDSVideoRendererType != VIDRNDT_DS_VMR9RENDERLESS)
- if(GetMediaState() != State_Paused) {
+ if (GetMediaState() != State_Paused) {
SendMessage(WM_COMMAND, ID_PLAY_PAUSE);
}
@@ -7220,9 +7231,9 @@ void CMainFrame::OnPlayFramestep(UINT nID) AM_MEDIA_TYPE mt;
pPin->ConnectionMediaType(&mt);
- if(mt.majortype == MEDIATYPE_Video && mt.formattype == FORMAT_VideoInfo) {
+ if (mt.majortype == MEDIATYPE_Video && mt.formattype == FORMAT_VideoInfo) {
rtAvgTime = ((VIDEOINFOHEADER*)mt.pbFormat)->AvgTimePerFrame;
- } else if(mt.majortype == MEDIATYPE_Video && mt.formattype == FORMAT_VideoInfo2) {
+ } else if (mt.majortype == MEDIATYPE_Video && mt.formattype == FORMAT_VideoInfo2) {
rtAvgTime = ((VIDEOINFOHEADER2*)mt.pbFormat)->AvgTimePerFrame;
}
}
@@ -7238,9 +7249,9 @@ void CMainFrame::OnPlayFramestep(UINT nID) } else {
pMS->GetCurrentPosition(&rt);
}
- if(nID == ID_PLAY_FRAMESTEP) {
+ if (nID == ID_PLAY_FRAMESTEP) {
rt += rtAvgTime;
- } else if(nID == ID_PLAY_FRAMESTEPCANCEL) {
+ } else if (nID == ID_PLAY_FRAMESTEPCANCEL) {
rt -= rtAvgTime;
}
pMS->SetPositions(&rt, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning);
@@ -7251,17 +7262,17 @@ void CMainFrame::OnUpdatePlayFramestep(CCmdUI* pCmdUI) {
bool fEnable = false;
- if(m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly &&
+ if (m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly &&
(GetPlaybackMode() != PM_DVD || m_iDVDDomain == DVD_DOMAIN_Title) &&
GetPlaybackMode() != PM_CAPTURE &&
!m_fLiveWM) {
- if(S_OK == pMS->IsFormatSupported(&TIME_FORMAT_FRAME)) {
+ if (S_OK == pMS->IsFormatSupported(&TIME_FORMAT_FRAME)) {
fEnable = true;
- } else if(pCmdUI->m_nID == ID_PLAY_FRAMESTEP) {
+ } else if (pCmdUI->m_nID == ID_PLAY_FRAMESTEP) {
fEnable = true;
- } else if(pCmdUI->m_nID == ID_PLAY_FRAMESTEPCANCEL && pFS && pFS->CanStep(0, NULL) == S_OK) {
+ } else if (pCmdUI->m_nID == ID_PLAY_FRAMESTEPCANCEL && pFS && pFS->CanStep(0, NULL) == S_OK) {
fEnable = true;
- } else if(m_fQuicktimeGraph && pFS) {
+ } else if (m_fQuicktimeGraph && pFS) {
fEnable = true;
}
}
@@ -7282,12 +7293,12 @@ void CMainFrame::OnPlaySeek(UINT nID) nID == ID_PLAY_SEEKFORWARDLARGE ? +10000i64*s.nJumpDistL :
0;
- if(!dt) {
+ if (!dt) {
return;
}
// HACK: the custom graph should support frame based seeking instead
- if(m_fShockwaveGraph) {
+ if (m_fShockwaveGraph) {
dt /= 10000i64*100;
}
@@ -7312,25 +7323,25 @@ static int rangebsearch(REFERENCE_TIME val, CAtlArray<REFERENCE_TIME>& rta) {
int i = 0, j = rta.GetCount() - 1, ret = -1;
- if(j >= 0 && val >= rta[j]) {
+ if (j >= 0 && val >= rta[j]) {
return(j);
}
- while(i < j) {
+ while (i < j) {
int mid = (i + j) >> 1;
REFERENCE_TIME midt = rta[mid];
- if(val == midt) {
+ if (val == midt) {
ret = mid;
break;
- } else if(val < midt) {
+ } else if (val < midt) {
ret = -1;
- if(j == mid) {
+ if (j == mid) {
mid--;
}
j = mid;
- } else if(val > midt) {
+ } else if (val > midt) {
ret = mid;
- if(i == mid) {
+ if (i == mid) {
mid++;
}
i = mid;
@@ -7342,10 +7353,10 @@ static int rangebsearch(REFERENCE_TIME val, CAtlArray<REFERENCE_TIME>& rta) void CMainFrame::OnPlaySeekKey(UINT nID)
{
- if(m_kfs.GetCount() > 0) {
+ if (m_kfs.GetCount() > 0) {
HRESULT hr;
- if(GetMediaState() == State_Stopped) {
+ if (GetMediaState() == State_Stopped) {
SendMessage(WM_COMMAND, ID_PLAY_PAUSE);
}
@@ -7355,7 +7366,7 @@ void CMainFrame::OnPlaySeekKey(UINT nID) int dec = 1;
int i = rangebsearch(rtCurrent, m_kfs);
- if(i > 0) {
+ if (i > 0) {
dec = (UINT)max(min(rtCurrent - m_kfs[i-1], 10000000), 0);
}
@@ -7365,9 +7376,9 @@ void CMainFrame::OnPlaySeekKey(UINT nID) i = rangebsearch(rtCurrent, m_kfs);
- if(nID == ID_PLAY_SEEKKEYBACKWARD) {
+ if (nID == ID_PLAY_SEEKKEYBACKWARD) {
rtCurrent = m_kfs[max(i, 0)];
- } else if(nID == ID_PLAY_SEEKKEYFORWARD && i < m_kfs.GetCount()-1) {
+ } else if (nID == ID_PLAY_SEEKKEYFORWARD && i < m_kfs.GetCount()-1) {
rtCurrent = m_kfs[i+1];
} else {
return;
@@ -7393,11 +7404,11 @@ void CMainFrame::OnUpdatePlaySeek(CCmdUI* pCmdUI) OAFilterState fs = GetMediaState();
- if(m_iMediaLoadState == MLS_LOADED && (fs == State_Paused || fs == State_Running)) {
+ if (m_iMediaLoadState == MLS_LOADED && (fs == State_Paused || fs == State_Running)) {
fEnable = true;
- if(GetPlaybackMode() == PM_DVD && (m_iDVDDomain != DVD_DOMAIN_Title || fs != State_Running)) {
+ if (GetPlaybackMode() == PM_DVD && (m_iDVDDomain != DVD_DOMAIN_Title || fs != State_Running)) {
fEnable = false;
- } else if(GetPlaybackMode() == PM_CAPTURE) {
+ } else if (GetPlaybackMode() == PM_CAPTURE) {
fEnable = false;
}
}
@@ -7412,25 +7423,25 @@ void CMainFrame::OnPlayGoto() }
REFTIME atpf = 0;
- if(FAILED(pBV->get_AvgTimePerFrame(&atpf)) || atpf < 0) {
+ if (FAILED(pBV->get_AvgTimePerFrame(&atpf)) || atpf < 0) {
atpf = 0;
BeginEnumFilters(pGB, pEF, pBF) {
- if(atpf > 0) {
+ if (atpf > 0) {
break;
}
BeginEnumPins(pBF, pEP, pPin) {
- if(atpf > 0) {
+ if (atpf > 0) {
break;
}
AM_MEDIA_TYPE mt;
pPin->ConnectionMediaType(&mt);
- if(mt.majortype == MEDIATYPE_Video && mt.formattype == FORMAT_VideoInfo) {
+ if (mt.majortype == MEDIATYPE_Video && mt.formattype == FORMAT_VideoInfo) {
atpf = (REFTIME)((VIDEOINFOHEADER*)mt.pbFormat)->AvgTimePerFrame / 10000000i64;
- } else if(mt.majortype == MEDIATYPE_Video && mt.formattype == FORMAT_VideoInfo2) {
+ } else if (mt.majortype == MEDIATYPE_Video && mt.formattype == FORMAT_VideoInfo2) {
atpf = (REFTIME)((VIDEOINFOHEADER2*)mt.pbFormat)->AvgTimePerFrame / 10000000i64;
}
}
@@ -7440,7 +7451,7 @@ void CMainFrame::OnPlayGoto() }
CGoToDlg dlg((int)(m_wndSeekBar.GetPos()/10000), atpf > 0 ? (float)(1.0/atpf) : 0);
- if(IDOK != dlg.DoModal() || dlg.m_time < 0) {
+ if (IDOK != dlg.DoModal() || dlg.m_time < 0) {
return;
}
@@ -7451,11 +7462,11 @@ void CMainFrame::OnUpdateGoto(CCmdUI* pCmdUI) {
bool fEnable = false;
- if(m_iMediaLoadState == MLS_LOADED) {
+ if (m_iMediaLoadState == MLS_LOADED) {
fEnable = true;
- if(GetPlaybackMode() == PM_DVD && m_iDVDDomain != DVD_DOMAIN_Title) {
+ if (GetPlaybackMode() == PM_DVD && m_iDVDDomain != DVD_DOMAIN_Title) {
fEnable = false;
- } else if(GetPlaybackMode() == PM_CAPTURE) {
+ } else if (GetPlaybackMode() == PM_CAPTURE) {
fEnable = false;
}
}
@@ -7465,12 +7476,12 @@ void CMainFrame::OnUpdateGoto(CCmdUI* pCmdUI) void CMainFrame::OnPlayChangeRate(UINT nID)
{
- if(m_iMediaLoadState != MLS_LOADED) {
+ if (m_iMediaLoadState != MLS_LOADED) {
return;
}
- if(GetPlaybackMode() == PM_CAPTURE) {
- if(GetMediaState() != State_Running) {
+ if (GetPlaybackMode() == PM_CAPTURE) {
+ if (GetMediaState() != State_Running) {
SendMessage(WM_COMMAND, ID_PLAY_PLAY);
}
@@ -7484,20 +7495,20 @@ void CMainFrame::OnPlayChangeRate(UINT nID) // long lSignalStrength;
do {
- if(nID == ID_PLAY_DECRATE) {
+ if (nID == ID_PLAY_DECRATE) {
lChannel--;
- } else if(nID == ID_PLAY_INCRATE) {
+ } else if (nID == ID_PLAY_INCRATE) {
lChannel++;
}
- // if(lChannel < lChannelMin) lChannel = lChannelMax;
- // if(lChannel > lChannelMax) lChannel = lChannelMin;
+ // if (lChannel < lChannelMin) lChannel = lChannelMax;
+ // if (lChannel > lChannelMax) lChannel = lChannelMin;
- if(lChannel < lChannelMin || lChannel > lChannelMax) {
+ if (lChannel < lChannelMin || lChannel > lChannelMax) {
break;
}
- if(FAILED(pAMTuner->put_Channel(lChannel, AMTUNER_SUBCHAN_DEFAULT, AMTUNER_SUBCHAN_DEFAULT))) {
+ if (FAILED(pAMTuner->put_Channel(lChannel, AMTUNER_SUBCHAN_DEFAULT, AMTUNER_SUBCHAN_DEFAULT))) {
break;
}
@@ -7505,7 +7516,7 @@ void CMainFrame::OnPlayChangeRate(UINT nID) pAMTuner->AutoTune(lChannel, &flFoundSignal);
pAMTuner->get_VideoFrequency(&lFreqNew);
- } while(FALSE);
+ } while (FALSE);
/* SUCCEEDED(pAMTuner->SignalPresent(&lSignalStrength))
&& (lSignalStrength != AMTUNER_SIGNALPRESENT || lFreqNew == lFreqOrg));*/
@@ -7513,9 +7524,9 @@ void CMainFrame::OnPlayChangeRate(UINT nID) int iNewSpeedLevel;
// Cap the max FFWD and RWD rates to 128x.
- if(nID == ID_PLAY_INCRATE) {
+ if (nID == ID_PLAY_INCRATE) {
iNewSpeedLevel = (m_iSpeedLevel < 7 ? m_iSpeedLevel+1 : 7);
- } else if(nID == ID_PLAY_DECRATE) {
+ } else if (nID == ID_PLAY_DECRATE) {
iNewSpeedLevel = (m_iSpeedLevel > -7 ? m_iSpeedLevel-1 : -7);
} else {
return;
@@ -7523,37 +7534,37 @@ void CMainFrame::OnPlayChangeRate(UINT nID) HRESULT hr = E_FAIL;
- if((iNewSpeedLevel == -4) && (GetPlaybackMode() == PM_FILE)) {
- if(GetMediaState() != State_Paused) {
+ if ((iNewSpeedLevel == -4) && (GetPlaybackMode() == PM_FILE)) {
+ if (GetMediaState() != State_Paused) {
SendMessage(WM_COMMAND, ID_PLAY_PAUSE);
}
- if(GetMediaState() == State_Paused) {
+ if (GetMediaState() == State_Paused) {
hr = S_OK;
}
} else {
double dRate = 1.0;
- if(GetMediaState() != State_Running) {
+ if (GetMediaState() != State_Running) {
SendMessage(WM_COMMAND, ID_PLAY_PLAY);
}
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
dRate = pow(2.0, iNewSpeedLevel >= -3 ? iNewSpeedLevel : (-iNewSpeedLevel - 8));
- if(fabs(dRate - 1.0) < 0.01) {
+ if (fabs(dRate - 1.0) < 0.01) {
dRate = 1.0;
}
hr = pMS->SetRate(dRate);
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
dRate = pow(2.0, abs(iNewSpeedLevel));
- if(iNewSpeedLevel >= 0) {
+ if (iNewSpeedLevel >= 0) {
hr = pDVDC->PlayForwards(dRate, DVD_CMD_FLAG_Block, NULL);
} else {
hr = pDVDC->PlayBackwards(dRate, DVD_CMD_FLAG_Block, NULL);
}
}
- if(SUCCEEDED(hr)) {
+ if (SUCCEEDED(hr)) {
CString strMessage;
m_iSpeedLevel = iNewSpeedLevel;
@@ -7573,23 +7584,23 @@ void CMainFrame::OnUpdatePlayChangeRate(CCmdUI* pCmdUI) {
bool fEnable = false;
- if(m_iMediaLoadState == MLS_LOADED) {
+ if (m_iMediaLoadState == MLS_LOADED) {
bool fInc = pCmdUI->m_nID == ID_PLAY_INCRATE;
fEnable = true;
- if(fInc && m_iSpeedLevel >= 7) {
+ if (fInc && m_iSpeedLevel >= 7) {
fEnable = false;
- } else if(!fInc && GetPlaybackMode() == PM_FILE && m_iSpeedLevel <= -4) {
+ } else if (!fInc && GetPlaybackMode() == PM_FILE && m_iSpeedLevel <= -4) {
fEnable = false;
- } else if(!fInc && GetPlaybackMode() == PM_DVD && m_iSpeedLevel <= -11) {
+ } else if (!fInc && GetPlaybackMode() == PM_DVD && m_iSpeedLevel <= -11) {
fEnable = false;
- } else if(GetPlaybackMode() == PM_DVD && m_iDVDDomain != DVD_DOMAIN_Title) {
+ } else if (GetPlaybackMode() == PM_DVD && m_iDVDDomain != DVD_DOMAIN_Title) {
fEnable = false;
- } else if(m_fRealMediaGraph || m_fShockwaveGraph) {
+ } else if (m_fRealMediaGraph || m_fShockwaveGraph) {
fEnable = false;
- } else if(GetPlaybackMode() == PM_CAPTURE && (!m_wndCaptureBar.m_capdlg.IsTunerActive() || m_fCapturing)) {
+ } else if (GetPlaybackMode() == PM_CAPTURE && (!m_wndCaptureBar.m_capdlg.IsTunerActive() || m_fCapturing)) {
fEnable = false;
- } else if(m_fLiveWM) {
+ } else if (m_fLiveWM) {
fEnable = false;
}
}
@@ -7599,23 +7610,23 @@ void CMainFrame::OnUpdatePlayChangeRate(CCmdUI* pCmdUI) void CMainFrame::OnPlayResetRate()
{
- if(m_iMediaLoadState != MLS_LOADED) {
+ if (m_iMediaLoadState != MLS_LOADED) {
return;
}
HRESULT hr = E_FAIL;
- if(GetMediaState() != State_Running) {
+ if (GetMediaState() != State_Running) {
SendMessage(WM_COMMAND, ID_PLAY_PLAY);
}
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
hr = pMS->SetRate(1.0);
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
hr = pDVDC->PlayForwards(1.0, DVD_CMD_FLAG_Block, NULL);
}
- if(SUCCEEDED(hr)) {
+ if (SUCCEEDED(hr)) {
m_iSpeedLevel = 0;
}
}
@@ -7628,7 +7639,7 @@ void CMainFrame::OnUpdatePlayResetRate(CCmdUI* pCmdUI) void CMainFrame::SetAudioDelay(REFERENCE_TIME rtShift)
{
- if(CComQIPtr<IAudioSwitcherFilter> pASF = FindFilter(__uuidof(CAudioSwitcherFilter), pGB)) {
+ if (CComQIPtr<IAudioSwitcherFilter> pASF = FindFilter(__uuidof(CAudioSwitcherFilter), pGB)) {
pASF->SetAudioTimeShift(rtShift);
CString str;
@@ -7640,7 +7651,7 @@ void CMainFrame::SetAudioDelay(REFERENCE_TIME rtShift) void CMainFrame::SetSubtitleDelay(int delay_ms)
{
- if(m_pCAP) {
+ if (m_pCAP) {
m_pCAP->SetSubtitleDelay(delay_ms);
CString strSubDelay;
@@ -7652,7 +7663,7 @@ void CMainFrame::SetSubtitleDelay(int delay_ms) void CMainFrame::OnPlayChangeAudDelay(UINT nID)
{
- if(CComQIPtr<IAudioSwitcherFilter> pASF = FindFilter(__uuidof(CAudioSwitcherFilter), pGB)) {
+ if (CComQIPtr<IAudioSwitcherFilter> pASF = FindFilter(__uuidof(CAudioSwitcherFilter), pGB)) {
REFERENCE_TIME rtShift = pASF->GetAudioTimeShift();
rtShift +=
nID == ID_PLAY_INCAUDDELAY ? 100000 :
@@ -7676,17 +7687,17 @@ void CMainFrame::OnPlayFilters(UINT nID) CComPropertySheet ps(ResStr(IDS_PROPSHEET_PROPERTIES), GetModalParent());
- if(CComQIPtr<ISpecifyPropertyPages> pSPP = pUnk) {
+ if (CComQIPtr<ISpecifyPropertyPages> pSPP = pUnk) {
ps.AddPages(pSPP);
}
- if(CComQIPtr<IBaseFilter> pBF = pUnk) {
+ if (CComQIPtr<IBaseFilter> pBF = pUnk) {
HRESULT hr;
CComPtr<IPropertyPage> pPP = DNew CInternalPropertyPageTempl<CPinInfoWnd>(NULL, &hr);
ps.AddPage(pPP, pBF);
}
- if(ps.GetPageCount() > 0) {
+ if (ps.GetPageCount() > 0) {
ps.DoModal();
OpenSetupStatusBar();
}
@@ -7710,28 +7721,28 @@ enum { void CMainFrame::OnPlayShaders(UINT nID)
{
- if(nID == ID_SHADERS_EDIT) {
+ if (nID == ID_SHADERS_EDIT) {
ShowControlBar(&m_wndShaderEditorBar, TRUE, TRUE);
return;
}
- if(!m_pCAP) {
+ if (!m_pCAP) {
return;
}
- if(nID == ID_SHADERS_OFF) {
+ if (nID == ID_SHADERS_OFF) {
m_shaderlabels.RemoveAll();
- } else if(nID == ID_SHADERS_OFFSCR) {
+ } else if (nID == ID_SHADERS_OFFSCR) {
m_shaderlabelsScreenSpace.RemoveAll();
- } else if(nID == ID_SHADERS_COMBINE) {
- if(IDOK != CShaderCombineDlg(m_shaderlabels, GetModalParent(), false).DoModal()) {
+ } else if (nID == ID_SHADERS_COMBINE) {
+ if (IDOK != CShaderCombineDlg(m_shaderlabels, GetModalParent(), false).DoModal()) {
return;
}
- } else if(nID == ID_SHADERS_COMBINESCR) {
- if(IDOK != CShaderCombineDlg(m_shaderlabelsScreenSpace, GetModalParent(), true).DoModal()) {
+ } else if (nID == ID_SHADERS_COMBINESCR) {
+ if (IDOK != CShaderCombineDlg(m_shaderlabelsScreenSpace, GetModalParent(), true).DoModal()) {
return;
}
- } else if(nID >= ID_SHADERS_DYNAMIC) {
+ } else if (nID >= ID_SHADERS_DYNAMIC) {
MENUITEMINFO mii;
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
@@ -7747,14 +7758,14 @@ void CMainFrame::OnPlayShaders(UINT nID) void CMainFrame::OnUpdatePlayShaders(CCmdUI* pCmdUI)
{
- if(pCmdUI->m_nID >= ID_SHADERS_START) {
+ if (pCmdUI->m_nID >= ID_SHADERS_START) {
if (pCmdUI->m_nID >= ID_SHADERS_STARTSCR && pCmdUI->m_nID < ID_SHADERS_ENDSCR ) {
pCmdUI->Enable(!!m_pCAP2);
} else {
pCmdUI->Enable(!!m_pCAP);
}
- switch(pCmdUI->m_nID) {
+ switch (pCmdUI->m_nID) {
case ID_SHADERS_OFF:
pCmdUI->SetRadio(m_shaderlabels.IsEmpty());
break;
@@ -7790,13 +7801,13 @@ void CMainFrame::OnPlayAudio(UINT nID) int i = (int)nID - (1 + ID_AUDIO_SUBITEM_START);
CComQIPtr<IAMStreamSelect> pSS = FindFilter(__uuidof(CAudioSwitcherFilter), pGB);
- if(!pSS) {
+ if (!pSS) {
pSS = FindFilter(L"{D3CD7858-971A-4838-ACEC-40CA5D529DC8}", pGB);
}
- if(i == -1) {
+ if (i == -1) {
ShowOptions(CPPageAudioSwitcher::IDD);
- } else if(i >= 0 && pSS) {
+ } else if (i >= 0 && pSS) {
i = m_iAudioStreams.GetAt(m_iAudioStreams.FindIndex(i)); // don't forget that the audio streams are reordered, so have to figure which one from the initial order is used here
pSS->Enable(i, AMSTREAMSELECTENABLE_ENABLE);
}
@@ -7808,23 +7819,23 @@ void CMainFrame::OnUpdatePlayAudio(CCmdUI* pCmdUI) int i = (int)nID - (1 + ID_AUDIO_SUBITEM_START);
CComQIPtr<IAMStreamSelect> pSS = FindFilter(__uuidof(CAudioSwitcherFilter), pGB);
- if(!pSS) {
+ if (!pSS) {
pSS = FindFilter(L"{D3CD7858-971A-4838-ACEC-40CA5D529DC8}", pGB);
}
- /*if(i == -1)
+ /*if (i == -1)
{
// TODO****
}
else*/
- if(i >= 0 && pSS) {
+ if (i >= 0 && pSS) {
i = m_iAudioStreams.GetAt(m_iAudioStreams.FindIndex(i)); // audio streams are reordered, so figure out which one from the initial order is used here
DWORD flags = 0;
- if(SUCCEEDED(pSS->Info(i, NULL, &flags, NULL, NULL, NULL, NULL, NULL))) {
- if(flags&AMSTREAMSELECTINFO_EXCLUSIVE) {
+ if (SUCCEEDED(pSS->Info(i, NULL, &flags, NULL, NULL, NULL, NULL, NULL))) {
+ if (flags&AMSTREAMSELECTINFO_EXCLUSIVE) {
pCmdUI->SetRadio(TRUE);
- } else if(flags&AMSTREAMSELECTINFO_ENABLED) {
+ } else if (flags&AMSTREAMSELECTINFO_ENABLED) {
pCmdUI->SetCheck(TRUE);
} else {
pCmdUI->SetCheck(FALSE);
@@ -7839,31 +7850,31 @@ void CMainFrame::OnPlaySubtitles(UINT nID) {
int i = (int)nID - (5 + ID_SUBTITLES_SUBITEM_START); // currently the subtitles submenu contains 5 items, apart from the actual subtitles list
- if(i == -5) {
+ if (i == -5) {
// options
ShowOptions(CPPageSubtitles::IDD);
- } else if(i == -4) {
+ } else if (i == -4) {
// styles
int i = m_iSubtitleSel;
POSITION pos = m_pSubStreams.GetHeadPosition();
- while(pos && i >= 0) {
+ while (pos && i >= 0) {
CComPtr<ISubStream> pSubStream = m_pSubStreams.GetNext(pos);
- if(i < pSubStream->GetStreamCount()) {
+ if (i < pSubStream->GetStreamCount()) {
CLSID clsid;
- if(FAILED(pSubStream->GetClassID(&clsid))) {
+ if (FAILED(pSubStream->GetClassID(&clsid))) {
continue;
}
- if(clsid == __uuidof(CRenderedTextSubtitle)) {
+ if (clsid == __uuidof(CRenderedTextSubtitle)) {
CRenderedTextSubtitle* pRTS = (CRenderedTextSubtitle*)(ISubStream*)pSubStream;
CAutoPtrArray<CPPageSubStyle> pages;
CAtlArray<STSStyle*> styles;
POSITION pos = pRTS->m_styles.GetStartPosition();
- for(int i = 0; pos; i++) {
+ for (int i = 0; pos; i++) {
CString key;
STSStyle* val;
pRTS->m_styles.GetNextAssoc(pos, key, val);
@@ -7876,16 +7887,16 @@ void CMainFrame::OnPlaySubtitles(UINT nID) CString m_style = ResStr(IDS_SUBTITLES_STYLES);
int i = m_style.Find(_T("&"));
- if(i!=-1 ) {
+ if (i!=-1 ) {
m_style.Delete(i, 1);
}
CPropertySheet dlg(m_style, GetModalParent());
- for(int i = 0; i < (int)pages.GetCount(); i++) {
+ for (int i = 0; i < (int)pages.GetCount(); i++) {
dlg.AddPage(pages[i]);
}
- if(dlg.DoModal() == IDOK) {
- for(int j = 0; j < (int)pages.GetCount(); j++) {
+ if (dlg.DoModal() == IDOK) {
+ for (int j = 0; j < (int)pages.GetCount(); j++) {
pages[j]->GetStyle(*styles[j]);
}
UpdateSubtitle(false, false);
@@ -7897,23 +7908,23 @@ void CMainFrame::OnPlaySubtitles(UINT nID) i -= pSubStream->GetStreamCount();
}
- } else if(i == -3) {
+ } else if (i == -3) {
// reload
ReloadSubtitle();
- } else if(i == -2) {
+ } else if (i == -2) {
// enable
- if(m_iSubtitleSel == -1) {
+ if (m_iSubtitleSel == -1) {
m_iSubtitleSel = 0;
} else {
m_iSubtitleSel ^= (1<<31);
}
UpdateSubtitle();
- } else if(i == -1) {
+ } else if (i == -1) {
// override default style
// TODO: default subtitles style toggle here
AfxGetAppSettings().fUseDefaultSubtitlesStyle = !AfxGetAppSettings().fUseDefaultSubtitlesStyle;
UpdateSubtitle();
- } else if(i >= 0) {
+ } else if (i >= 0) {
// this is an actual item from the subtitles list
m_iSubtitleSel = i;
UpdateSubtitle();
@@ -7929,23 +7940,23 @@ void CMainFrame::OnUpdatePlaySubtitles(CCmdUI* pCmdUI) pCmdUI->Enable(m_pCAP && !m_fAudioOnly);
- if(i == -4) {
+ if (i == -4) {
// styles
pCmdUI->Enable(FALSE);
int i = m_iSubtitleSel;
POSITION pos = m_pSubStreams.GetHeadPosition();
- while(pos && i >= 0) {
+ while (pos && i >= 0) {
CComPtr<ISubStream> pSubStream = m_pSubStreams.GetNext(pos);
- if(i < pSubStream->GetStreamCount()) {
+ if (i < pSubStream->GetStreamCount()) {
CLSID clsid;
- if(FAILED(pSubStream->GetClassID(&clsid))) {
+ if (FAILED(pSubStream->GetClassID(&clsid))) {
continue;
}
- if(clsid == __uuidof(CRenderedTextSubtitle)) {
+ if (clsid == __uuidof(CRenderedTextSubtitle)) {
pCmdUI->Enable(TRUE);
break;
}
@@ -7953,15 +7964,15 @@ void CMainFrame::OnUpdatePlaySubtitles(CCmdUI* pCmdUI) i -= pSubStream->GetStreamCount();
}
- } else if(i == -2) {
+ } else if (i == -2) {
// enabled
pCmdUI->SetCheck(AfxGetAppSettings().fEnableSubtitles);
- } else if(i == -1) {
+ } else if (i == -1) {
// override
// TODO: foxX - default subtitles style toggle here; still wip
pCmdUI->SetCheck(AfxGetAppSettings().fUseDefaultSubtitlesStyle);
pCmdUI->Enable(AfxGetAppSettings().fEnableSubtitles);
- } else if(i >= 0) {
+ } else if (i >= 0) {
pCmdUI->SetRadio(i == abs(m_iSubtitleSel));
}
}
@@ -7971,10 +7982,10 @@ void CMainFrame::OnPlayLanguage(UINT nID) nID -= ID_FILTERSTREAMS_SUBITEM_START;
CComPtr<IAMStreamSelect> pAMSS = m_ssarray[nID];
UINT i = nID;
- while(i > 0 && pAMSS == m_ssarray[i-1]) {
+ while (i > 0 && pAMSS == m_ssarray[i-1]) {
i--;
}
- if(FAILED(pAMSS->Enable(nID-i, AMSTREAMSELECTENABLE_ENABLE))) {
+ if (FAILED(pAMSS->Enable(nID-i, AMSTREAMSELECTENABLE_ENABLE))) {
MessageBeep((UINT)-1);
}
@@ -7987,14 +7998,14 @@ void CMainFrame::OnUpdatePlayLanguage(CCmdUI* pCmdUI) nID -= ID_FILTERSTREAMS_SUBITEM_START;
CComPtr<IAMStreamSelect> pAMSS = m_ssarray[nID];
UINT i = nID;
- while(i > 0 && pAMSS == m_ssarray[i-1]) {
+ while (i > 0 && pAMSS == m_ssarray[i-1]) {
i--;
}
DWORD flags = 0;
pAMSS->Info(nID-i, NULL, &flags, NULL, NULL, NULL, NULL, NULL);
- if(flags&AMSTREAMSELECTINFO_EXCLUSIVE) {
+ if (flags&AMSTREAMSELECTINFO_EXCLUSIVE) {
pCmdUI->SetRadio(TRUE);
- } else if(flags&AMSTREAMSELECTINFO_ENABLED) {
+ } else if (flags&AMSTREAMSELECTINFO_ENABLED) {
pCmdUI->SetCheck(TRUE);
} else {
pCmdUI->SetCheck(FALSE);
@@ -8003,12 +8014,12 @@ void CMainFrame::OnUpdatePlayLanguage(CCmdUI* pCmdUI) void CMainFrame::OnPlayVolume(UINT nID)
{
- if(m_iMediaLoadState == MLS_LOADED) {
+ if (m_iMediaLoadState == MLS_LOADED) {
CString strVolume;
pBA->put_Volume(m_wndToolBar.Volume);
//strVolume.Format (L"Vol : %d dB", m_wndToolBar.Volume / 100);
- if(m_wndToolBar.Volume == -10000) {
+ if (m_wndToolBar.Volume == -10000) {
strVolume.Format(ResStr(IDS_VOLUME_OSD), 0);
} else {
strVolume.Format(ResStr(IDS_VOLUME_OSD), m_wndToolBar.m_volctrl.GetPos());
@@ -8025,7 +8036,7 @@ void CMainFrame::OnPlayVolumeBoost(UINT nID) int i = (int)(s.dAudioBoost_dB*10+0.1);
- switch(nID) {
+ switch (nID) {
case ID_VOLUME_BOOST_INC:
i = min(i+10, 100);
break;
@@ -8051,7 +8062,7 @@ void CMainFrame::SetVolumeBoost(float fAudioBoost_dB) s.dAudioBoost_dB = fAudioBoost_dB;
strBoost.Format(ResStr(IDS_BOOST_OSD), s.dAudioBoost_dB);
- if(CComQIPtr<IAudioSwitcherFilter> pASF = FindFilter(__uuidof(CAudioSwitcherFilter), pGB)) {
+ if (CComQIPtr<IAudioSwitcherFilter> pASF = FindFilter(__uuidof(CAudioSwitcherFilter), pGB)) {
bool fNormalize, fNormalizeRecover;
float boost;
pASF->GetNormalizeBoost(fNormalize, fNormalizeRecover, boost);
@@ -8071,7 +8082,7 @@ void CMainFrame::OnAfterplayback(UINT nID) s.nCLSwitches &= ~CLSW_AFTERPLAYBACK_MASK;
- switch(nID) {
+ switch (nID) {
case ID_AFTERPLAYBACK_NEXT :
s.fNextInDirAfterPlayback = true;
s.fExitAfterPlayback = false;
@@ -8108,7 +8119,7 @@ void CMainFrame::OnUpdateAfterplayback(CCmdUI* pCmdUI) bool fChecked = false;
- switch(pCmdUI->m_nID) {
+ switch (pCmdUI->m_nID) {
case ID_AFTERPLAYBACK_EXIT:
fChecked = !!s.fExitAfterPlayback;
break;
@@ -8141,14 +8152,14 @@ void CMainFrame::OnUpdateAfterplayback(CCmdUI* pCmdUI) // navigate
void CMainFrame::OnNavigateSkip(UINT nID)
{
- if(GetPlaybackMode() == PM_FILE) {
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
SetupChapters();
}
flast_nID = nID;
- if(DWORD nChapters = m_pCB->ChapGetCount()) {
+ if (DWORD nChapters = m_pCB->ChapGetCount()) {
REFERENCE_TIME rtCur;
pMS->GetCurrentPosition(&rtCur);
@@ -8156,18 +8167,18 @@ void CMainFrame::OnNavigateSkip(UINT nID) CComBSTR name;
long i = 0;
- if(nID == ID_NAVIGATE_SKIPBACK) {
+ if (nID == ID_NAVIGATE_SKIPBACK) {
rt -= 30000000;
i = m_pCB->ChapLookup(&rt, &name);
- } else if(nID == ID_NAVIGATE_SKIPFORWARD) {
+ } else if (nID == ID_NAVIGATE_SKIPFORWARD) {
i = m_pCB->ChapLookup(&rt, &name) + 1;
name.Empty();
- if(i < nChapters) {
+ if (i < nChapters) {
m_pCB->ChapGet(i, &rt, &name);
}
}
- if(i >= 0 && i < nChapters) {
+ if (i >= 0 && i < nChapters) {
SeekTo(rt);
SendStatusMessage(ResStr(IDS_AG_CHAPTER2) + CString(name), 3000);
@@ -8181,27 +8192,27 @@ void CMainFrame::OnNavigateSkip(UINT nID) }
- if(m_wndPlaylistBar.GetCount() != 1) {
- if(nID == ID_NAVIGATE_SKIPBACK) {
+ if (m_wndPlaylistBar.GetCount() != 1) {
+ if (nID == ID_NAVIGATE_SKIPBACK) {
SendMessage(WM_COMMAND, ID_NAVIGATE_SKIPBACKPLITEM);
- } else if(nID == ID_NAVIGATE_SKIPFORWARD) {
+ } else if (nID == ID_NAVIGATE_SKIPFORWARD) {
SendMessage(WM_COMMAND, ID_NAVIGATE_SKIPFORWARDPLITEM);
}
} else if ((m_wndPlaylistBar.GetCount() == 1) && !AfxGetAppSettings().fDontUseSearchInFolder) {
- if(nID == ID_NAVIGATE_SKIPBACK) {
+ if (nID == ID_NAVIGATE_SKIPBACK) {
if (!SearchInDir(false)) {
m_OSD.DisplayMessage(OSD_TOPLEFT, ResStr(IDS_FIRST_IN_FOLDER));
}
- } else if(nID == ID_NAVIGATE_SKIPFORWARD) {
+ } else if (nID == ID_NAVIGATE_SKIPFORWARD) {
if (!SearchInDir(true)) {
m_OSD.DisplayMessage(OSD_TOPLEFT, ResStr(IDS_LAST_IN_FOLDER));
}
}
}
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
m_iSpeedLevel = 0;
- if(GetMediaState() != State_Running) {
+ if (GetMediaState() != State_Running) {
SendMessage(WM_COMMAND, ID_PLAY_PLAY);
}
@@ -8216,8 +8227,8 @@ void CMainFrame::OnNavigateSkip(UINT nID) ULONG ulNumOfChapters = 0;
pDVDI->GetNumberOfChapters(Location.TitleNum, &ulNumOfChapters);
- if(nID == ID_NAVIGATE_SKIPBACK) {
- if(Location.ChapterNum == 1 && Location.TitleNum > 1) {
+ if (nID == ID_NAVIGATE_SKIPBACK) {
+ if (Location.ChapterNum == 1 && Location.TitleNum > 1) {
pDVDI->GetNumberOfChapters(Location.TitleNum-1, &ulNumOfChapters);
pDVDC->PlayChapterInTitle(Location.TitleNum-1, ulNumOfChapters, DVD_CMD_FLAG_Block|DVD_CMD_FLAG_Flush, NULL);
} else {
@@ -8235,15 +8246,15 @@ void CMainFrame::OnNavigateSkip(UINT nID) pDVDC->ReplayChapter(DVD_CMD_FLAG_Block|DVD_CMD_FLAG_Flush, NULL);
}
}
- } else if(nID == ID_NAVIGATE_SKIPFORWARD) {
- if(Location.ChapterNum == ulNumOfChapters && Location.TitleNum < ulNumOfTitles) {
+ } else if (nID == ID_NAVIGATE_SKIPFORWARD) {
+ if (Location.ChapterNum == ulNumOfChapters && Location.TitleNum < ulNumOfTitles) {
pDVDC->PlayChapterInTitle(Location.TitleNum+1, 1, DVD_CMD_FLAG_Block|DVD_CMD_FLAG_Flush, NULL);
} else {
pDVDC->PlayNextChapter(DVD_CMD_FLAG_Block|DVD_CMD_FLAG_Flush, NULL);
}
}
- if((pDVDI->GetCurrentLocation(&Location) == S_OK)) {
+ if ((pDVDI->GetCurrentLocation(&Location) == S_OK)) {
pDVDI->GetNumberOfChapters(Location.TitleNum, &ulNumOfChapters);
CString m_strTitle;
m_strTitle.Format(IDS_AG_TITLE, Location.TitleNum);
@@ -8251,7 +8262,7 @@ void CMainFrame::OnNavigateSkip(UINT nID) m_wndSeekBar.GetRange(start, stop);
CString m_strOSD;
- if(stop>0)
+ if (stop>0)
m_strOSD.Format(_T("%02d:%02d:%02d/%s %s, %s%d/%d"), Location.TimeCode.bHours, Location.TimeCode.bMinutes, Location.TimeCode.bSeconds,
DVDtimeToString(RT2HMSF(stop)), m_strTitle, ResStr(IDS_AG_CHAPTER2), Location.ChapterNum, ulNumOfChapters);
else {
@@ -8262,12 +8273,12 @@ void CMainFrame::OnNavigateSkip(UINT nID) }
/*
- if(nID == ID_NAVIGATE_SKIPBACK)
+ if (nID == ID_NAVIGATE_SKIPBACK)
pDVDC->PlayPrevChapter(DVD_CMD_FLAG_Block, NULL);
- else if(nID == ID_NAVIGATE_SKIPFORWARD)
+ else if (nID == ID_NAVIGATE_SKIPFORWARD)
pDVDC->PlayNextChapter(DVD_CMD_FLAG_Block, NULL);
*/
- } else if(GetPlaybackMode() == PM_CAPTURE) {
+ } else if (GetPlaybackMode() == PM_CAPTURE) {
if (AfxGetAppSettings().iDefaultCaptureDevice == 1) {
CComQIPtr<IBDATuner> pTun = pGB;
if (pTun) {
@@ -8276,13 +8287,13 @@ void CMainFrame::OnNavigateSkip(UINT nID) nCurrentChannel = s.nDVBLastChannel;
- if(nID == ID_NAVIGATE_SKIPBACK) {
+ if (nID == ID_NAVIGATE_SKIPBACK) {
pTun->SetChannel (nCurrentChannel - 1);
DisplayCurrentChannelOSD();
if (m_wndNavigationBar.IsVisible()) {
m_wndNavigationBar.m_navdlg.UpdatePos(nCurrentChannel - 1);
}
- } else if(nID == ID_NAVIGATE_SKIPFORWARD) {
+ } else if (nID == ID_NAVIGATE_SKIPFORWARD) {
pTun->SetChannel (nCurrentChannel + 1);
DisplayCurrentChannelOSD();
if (m_wndNavigationBar.IsVisible()) {
@@ -8299,7 +8310,7 @@ void CMainFrame::OnNavigateSkip(UINT nID) void CMainFrame::OnUpdateNavigateSkip(CCmdUI* pCmdUI)
{
// moved to the timer callback function, that runs less frequent
- // if(GetPlaybackMode() == PM_FILE) SetupChapters();
+ // if (GetPlaybackMode() == PM_FILE) SetupChapters();
pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED
&& ((GetPlaybackMode() == PM_DVD
@@ -8312,14 +8323,14 @@ void CMainFrame::OnUpdateNavigateSkip(CCmdUI* pCmdUI) void CMainFrame::OnNavigateSkipPlaylistItem(UINT nID)
{
- if(GetPlaybackMode() == PM_FILE || GetPlaybackMode() == PM_CAPTURE) {
- if(m_wndPlaylistBar.GetCount() == 1) {
+ if (GetPlaybackMode() == PM_FILE || GetPlaybackMode() == PM_CAPTURE) {
+ if (m_wndPlaylistBar.GetCount() == 1) {
SendMessage(WM_COMMAND, ID_PLAY_STOP); // do not remove this, unless you want a circular call with OnPlayPlay()
SendMessage(WM_COMMAND, ID_PLAY_PLAY);
} else {
- if(nID == ID_NAVIGATE_SKIPBACKPLITEM) {
+ if (nID == ID_NAVIGATE_SKIPBACKPLITEM) {
m_wndPlaylistBar.SetPrev();
- } else if(nID == ID_NAVIGATE_SKIPFORWARDPLITEM) {
+ } else if (nID == ID_NAVIGATE_SKIPFORWARDPLITEM) {
m_wndPlaylistBar.SetNext();
}
@@ -8338,13 +8349,13 @@ void CMainFrame::OnNavigateMenu(UINT nID) {
nID -= ID_NAVIGATE_TITLEMENU;
- if(m_iMediaLoadState != MLS_LOADED || GetPlaybackMode() != PM_DVD) {
+ if (m_iMediaLoadState != MLS_LOADED || GetPlaybackMode() != PM_DVD) {
return;
}
m_iSpeedLevel = 0;
- if(GetMediaState() != State_Running) {
+ if (GetMediaState() != State_Running) {
SendMessage(WM_COMMAND, ID_PLAY_PLAY);
}
@@ -8356,7 +8367,7 @@ void CMainFrame::OnUpdateNavigateMenu(CCmdUI* pCmdUI) UINT nID = pCmdUI->m_nID - ID_NAVIGATE_TITLEMENU;
ULONG ulUOPs;
- if(m_iMediaLoadState != MLS_LOADED || GetPlaybackMode() != PM_DVD
+ if (m_iMediaLoadState != MLS_LOADED || GetPlaybackMode() != PM_DVD
|| FAILED(pDVDI->GetCurrentUOPS(&ulUOPs))) {
pCmdUI->Enable(FALSE);
return;
@@ -8369,24 +8380,24 @@ void CMainFrame::OnNavigateAudio(UINT nID) {
nID -= ID_NAVIGATE_AUDIO_SUBITEM_START;
- if(GetPlaybackMode() == PM_FILE || (GetPlaybackMode() == PM_CAPTURE && AfxGetAppSettings().iDefaultCaptureDevice == 1)) {
+ if (GetPlaybackMode() == PM_FILE || (GetPlaybackMode() == PM_CAPTURE && AfxGetAppSettings().iDefaultCaptureDevice == 1)) {
OnNavStreamSelectSubMenu(nID, 1);
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
pDVDC->SelectAudioStream(nID, DVD_CMD_FLAG_Block, NULL);
}
}
void CMainFrame::OnNavigateSubpic(UINT nID)
{
- if(GetPlaybackMode() == PM_FILE || (GetPlaybackMode() == PM_CAPTURE && AfxGetAppSettings().iDefaultCaptureDevice == 1)) {
+ if (GetPlaybackMode() == PM_FILE || (GetPlaybackMode() == PM_CAPTURE && AfxGetAppSettings().iDefaultCaptureDevice == 1)) {
OnNavStreamSelectSubMenu(nID - ID_NAVIGATE_SUBP_SUBITEM_START, 2);
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
int i = (int)nID - (1 + ID_NAVIGATE_SUBP_SUBITEM_START);
- if(i == -1) {
+ if (i == -1) {
ULONG ulStreamsAvailable, ulCurrentStream;
BOOL bIsDisabled;
- if(SUCCEEDED(pDVDI->GetCurrentSubpicture(&ulStreamsAvailable, &ulCurrentStream, &bIsDisabled))) {
+ if (SUCCEEDED(pDVDI->GetCurrentSubpicture(&ulStreamsAvailable, &ulCurrentStream, &bIsDisabled))) {
pDVDC->SetSubpictureState(bIsDisabled, DVD_CMD_FLAG_Block, NULL);
}
} else {
@@ -8400,9 +8411,9 @@ void CMainFrame::OnNavigateAngle(UINT nID) {
nID -= ID_NAVIGATE_ANGLE_SUBITEM_START;
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
OnNavStreamSelectSubMenu(nID, 0);
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
pDVDC->SelectAngle(nID+1, DVD_CMD_FLAG_Block, NULL);
}
}
@@ -8411,11 +8422,11 @@ void CMainFrame::OnNavigateChapters(UINT nID) {
nID -= ID_NAVIGATE_CHAP_SUBITEM_START;
- if(GetPlaybackMode() == PM_FILE) {
- if((int)nID >= 0 && nID < m_pCB->ChapGetCount()) {
+ if (GetPlaybackMode() == PM_FILE) {
+ if ((int)nID >= 0 && nID < m_pCB->ChapGetCount()) {
REFERENCE_TIME rt;
CComBSTR name;
- if(SUCCEEDED(m_pCB->ChapGet(nID, &rt, &name))) {
+ if (SUCCEEDED(m_pCB->ChapGet(nID, &rt, &name))) {
SeekTo(rt);
SendStatusMessage(ResStr(IDS_AG_CHAPTER2) + CString(name), 3000);
@@ -8430,12 +8441,12 @@ void CMainFrame::OnNavigateChapters(UINT nID) nID -= m_pCB->ChapGetCount();
- if((int)nID >= 0 && (int)nID < m_wndPlaylistBar.GetCount()
+ if ((int)nID >= 0 && (int)nID < m_wndPlaylistBar.GetCount()
&& m_wndPlaylistBar.GetSelIdx() != (int)nID) {
m_wndPlaylistBar.SetSelIdx(nID);
OpenCurPlaylistItem();
}
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
ULONG ulNumOfVolumes, ulVolume;
DVD_DISC_SIDE Side;
ULONG ulNumOfTitles = 0;
@@ -8449,18 +8460,18 @@ void CMainFrame::OnNavigateChapters(UINT nID) nID++;
- if(nID > 0 && nID <= ulNumOfTitles) {
+ if (nID > 0 && nID <= ulNumOfTitles) {
pDVDC->PlayTitle(nID, DVD_CMD_FLAG_Block|DVD_CMD_FLAG_Flush, NULL); // sometimes this does not do anything ...
pDVDC->PlayChapterInTitle(nID, 1, DVD_CMD_FLAG_Block|DVD_CMD_FLAG_Flush, NULL); // ... but this does!
} else {
nID -= ulNumOfTitles;
- if(nID > 0 && nID <= ulNumOfChapters) {
+ if (nID > 0 && nID <= ulNumOfChapters) {
pDVDC->PlayChapter(nID, DVD_CMD_FLAG_Block|DVD_CMD_FLAG_Flush, NULL);
}
}
- if((pDVDI->GetCurrentLocation(&Location) == S_OK)) {
+ if ((pDVDI->GetCurrentLocation(&Location) == S_OK)) {
pDVDI->GetNumberOfChapters(Location.TitleNum, &ulNumOfChapters);
CString m_strTitle;
m_strTitle.Format(IDS_AG_TITLE, Location.TitleNum);
@@ -8468,7 +8479,7 @@ void CMainFrame::OnNavigateChapters(UINT nID) m_wndSeekBar.GetRange(start, stop);
CString m_strOSD;
- if(stop>0)
+ if (stop>0)
m_strOSD.Format(_T("%02d:%02d:%02d/%s %s, %s%d/%d"), Location.TimeCode.bHours, Location.TimeCode.bMinutes, Location.TimeCode.bSeconds,
DVDtimeToString(RT2HMSF(stop)), m_strTitle, ResStr(IDS_AG_CHAPTER2), Location.ChapterNum, ulNumOfChapters);
else {
@@ -8477,7 +8488,7 @@ void CMainFrame::OnNavigateChapters(UINT nID) m_OSD.DisplayMessage(OSD_TOPLEFT, m_strOSD, 3000);
}
- } else if(GetPlaybackMode() == PM_CAPTURE) {
+ } else if (GetPlaybackMode() == PM_CAPTURE) {
AppSettings& s = AfxGetAppSettings();
if (s.iDefaultCaptureDevice == 1) {
@@ -8499,8 +8510,8 @@ void CMainFrame::OnNavigateMenuItem(UINT nID) {
nID -= ID_NAVIGATE_MENU_LEFT;
- if(GetPlaybackMode() == PM_DVD) {
- switch(nID) {
+ if (GetPlaybackMode() == PM_DVD) {
+ switch (nID) {
case 0:
pDVDC->SelectRelativeButton(DVD_Relative_Left);
break;
@@ -8578,7 +8589,7 @@ public: __int64 cbRead = min(m_data.GetCount() - m_pos, (__int64)cb);
cbRead = max(cbRead, 0);
memcpy(pv, &m_data[(INT_PTR)m_pos], (int)cbRead);
- if(pcbRead) {
+ if (pcbRead) {
*pcbRead = (ULONG)cbRead;
}
m_pos += cbRead;
@@ -8587,10 +8598,10 @@ public: STDMETHODIMP Write(const void* pv, ULONG cb, ULONG* pcbWritten) {
BYTE* p = (BYTE*)pv;
ULONG cbWritten = (ULONG)-1;
- while(++cbWritten < cb) {
+ while (++cbWritten < cb) {
m_data.Add(*p++);
}
- if(pcbWritten) {
+ if (pcbWritten) {
*pcbWritten = cbWritten;
}
return S_OK;
@@ -8631,23 +8642,23 @@ void CMainFrame::OnFavoritesAdd() {
AppSettings& s = AfxGetAppSettings();
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
CString fn = m_wndPlaylistBar.GetCurFileName();
- if(fn.IsEmpty()) {
+ if (fn.IsEmpty()) {
return;
}
CString desc = fn;
desc.Replace('\\', '/');
int i = desc.Find(_T("://")), j = desc.Find(_T("?")), k = desc.ReverseFind('/');
- if(i >= 0) {
+ if (i >= 0) {
desc = j >= 0 ? desc.Left(j) : desc;
- } else if(k >= 0) {
+ } else if (k >= 0) {
desc = desc.Mid(k+1);
}
CFavoriteAddDlg dlg(desc, fn);
- if(dlg.DoModal() != IDOK) {
+ if (dlg.DoModal() != IDOK) {
return;
}
@@ -8657,7 +8668,7 @@ void CMainFrame::OnFavoritesAdd() // RememberPos
CString pos(_T("0"));
- if(dlg.m_bRememberPos) {
+ if (dlg.m_bRememberPos) {
pos.Format(_T("%I64d"), GetPos());
}
@@ -8673,15 +8684,15 @@ void CMainFrame::OnFavoritesAdd() // Paths
CPlaylistItem pli;
- if(m_wndPlaylistBar.GetCur(pli)) {
+ if (m_wndPlaylistBar.GetCur(pli)) {
POSITION pos = pli.m_fns.GetHeadPosition();
- while(pos) {
+ while (pos) {
str += _T(";") + pli.m_fns.GetNext(pos);
}
}
s.AddFav(FAV_FILE, str);
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
WCHAR path[_MAX_PATH];
ULONG len = 0;
pDVDI->GetDVDDirectory(path, _MAX_PATH, &len);
@@ -8695,7 +8706,7 @@ void CMainFrame::OnFavoritesAdd() Location.TimeCode.bHours, Location.TimeCode.bMinutes, Location.TimeCode.bSeconds);
CFavoriteAddDlg dlg(fn, desc);
- if(dlg.DoModal() != IDOK) {
+ if (dlg.DoModal() != IDOK) {
return;
}
@@ -8705,13 +8716,13 @@ void CMainFrame::OnFavoritesAdd() // RememberPos
CString pos(_T("0"));
- if(dlg.m_bRememberPos) {
+ if (dlg.m_bRememberPos) {
CDVDStateStream stream;
stream.AddRef();
CComPtr<IDvdState> pStateData;
CComQIPtr<IPersistStream> pPersistStream;
- if(SUCCEEDED(pDVDI->GetState(&pStateData))
+ if (SUCCEEDED(pDVDI->GetState(&pStateData))
&& (pPersistStream = pStateData)
&& SUCCEEDED(OleSaveToStream(pPersistStream, (IStream*)&stream))) {
pos = BinToCString(stream.m_data.GetData(), stream.m_data.GetCount());
@@ -8726,7 +8737,7 @@ void CMainFrame::OnFavoritesAdd() str += fn;
s.AddFav(FAV_DVD, str);
- } else if(GetPlaybackMode() == PM_CAPTURE) {
+ } else if (GetPlaybackMode() == PM_CAPTURE) {
// TODO
}
}
@@ -8741,23 +8752,23 @@ void CMainFrame::OnFavoritesQuickAddFavorite() {
AppSettings& s = AfxGetAppSettings();
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
CString fn = m_wndPlaylistBar.GetCurFileName();
- if(fn.IsEmpty()) {
+ if (fn.IsEmpty()) {
return;
}
CString desc = fn;
desc.Replace('\\', '/');
int i = desc.Find(_T("://")), j = desc.Find(_T("?")), k = desc.ReverseFind('/');
- if(i >= 0) {
+ if (i >= 0) {
desc = j >= 0 ? desc.Left(j) : desc;
- } else if(k >= 0) {
+ } else if (k >= 0) {
desc = desc.Mid(k+1);
}
CString fn_with_pos(desc);
- if(s.bFavRememberPos) {
+ if (s.bFavRememberPos) {
fn_with_pos.Format(_T("%s_%s"), desc, GetVidPos()); // Add file position (time format) so it will be easier to organize later
}
@@ -8767,7 +8778,7 @@ void CMainFrame::OnFavoritesQuickAddFavorite() // RememberPos
CString pos(_T("0"));
- if(s.bFavRememberPos) {
+ if (s.bFavRememberPos) {
pos.Format(_T("%I64d"), GetPos());
}
@@ -8783,15 +8794,15 @@ void CMainFrame::OnFavoritesQuickAddFavorite() // Paths
CPlaylistItem pli;
- if(m_wndPlaylistBar.GetCur(pli)) {
+ if (m_wndPlaylistBar.GetCur(pli)) {
POSITION pos = pli.m_fns.GetHeadPosition();
- while(pos) {
+ while (pos) {
str += _T(";") + pli.m_fns.GetNext(pos);
}
}
s.AddFav(FAV_FILE, str);
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
WCHAR path[_MAX_PATH];
ULONG len = 0;
pDVDI->GetDVDDirectory(path, _MAX_PATH, &len);
@@ -8810,13 +8821,13 @@ void CMainFrame::OnFavoritesQuickAddFavorite() // RememberPos
CString pos(_T("0"));
- if(s.bFavRememberPos) {
+ if (s.bFavRememberPos) {
CDVDStateStream stream;
stream.AddRef();
CComPtr<IDvdState> pStateData;
CComQIPtr<IPersistStream> pPersistStream;
- if(SUCCEEDED(pDVDI->GetState(&pStateData))
+ if (SUCCEEDED(pDVDI->GetState(&pStateData))
&& (pPersistStream = pStateData)
&& SUCCEEDED(OleSaveToStream(pPersistStream, (IStream*)&stream))) {
pos = BinToCString(stream.m_data.GetData(), stream.m_data.GetCount());
@@ -8831,7 +8842,7 @@ void CMainFrame::OnFavoritesQuickAddFavorite() str += fn;
s.AddFav(FAV_DVD, str);
- } else if(GetPlaybackMode() == PM_CAPTURE) {
+ } else if (GetPlaybackMode() == PM_CAPTURE) {
// TODO
}
}
@@ -8849,16 +8860,16 @@ void CMainFrame::OnUpdateFavoritesOrganize(CCmdUI* pCmdUI) void CMainFrame::OnRecentFileClear()
{
- if(IDYES != AfxMessageBox(ResStr(IDS_RECENT_FILES_QUESTION), MB_YESNO)) {
+ if (IDYES != AfxMessageBox(ResStr(IDS_RECENT_FILES_QUESTION), MB_YESNO)) {
return;
}
AppSettings& s = AfxGetAppSettings();
- for(int i = 0; i < s.MRU.GetSize(); i++) {
+ for (int i = 0; i < s.MRU.GetSize(); i++) {
s.MRU[i] = _T("");
}
- for(int i = 0; i < s.MRUDub.GetSize(); i++) {
+ for (int i = 0; i < s.MRUDub.GetSize(); i++) {
s.MRUDub[i] = _T("");
}
s.MRU.WriteList();
@@ -8877,20 +8888,20 @@ void CMainFrame::OnFavoritesFile(UINT nID) CAtlList<CString> sl;
AfxGetAppSettings().GetFav(FAV_FILE, sl);
- if(POSITION pos = sl.FindIndex(nID)) {
+ if (POSITION pos = sl.FindIndex(nID)) {
CAtlList<CString> fns;
REFERENCE_TIME rtStart = 0;
BOOL bRelativeDrive = FALSE;
int i = 0, j = 0;
- for(CString s1 = sl.GetAt(pos), s2 = s1.Tokenize(_T(";"), i);
+ for (CString s1 = sl.GetAt(pos), s2 = s1.Tokenize(_T(";"), i);
!s2.IsEmpty();
s2 = s1.Tokenize(_T(";"), i), j++) {
- if(j == 0) {
+ if (j == 0) {
; // desc / name
- } else if(j == 1) {
+ } else if (j == 1) {
_stscanf_s(s2, _T("%I64d"), &rtStart); // pos
- } else if(j == 2) {
+ } else if (j == 2) {
_stscanf_s(s2, _T("%d"), &bRelativeDrive); // relative drive
} else {
fns.AddTail(s2); // paths
@@ -8967,21 +8978,21 @@ void CMainFrame::OnFavoritesDVD(UINT nID) CAtlList<CString> sl;
AfxGetAppSettings().GetFav(FAV_DVD, sl);
- if(POSITION pos = sl.FindIndex(nID)) {
+ if (POSITION pos = sl.FindIndex(nID)) {
CString fn;
CDVDStateStream stream;
stream.AddRef();
int i = 0, j = 0;
- for(CString s1 = sl.GetAt(pos), s2 = s1.Tokenize(_T(";"), i);
+ for (CString s1 = sl.GetAt(pos), s2 = s1.Tokenize(_T(";"), i);
!s2.IsEmpty();
s2 = s1.Tokenize(_T(";"), i), j++) {
- if(j == 0) {
+ if (j == 0) {
; // desc
- } else if(j == 1 && s2 != _T("0")) { // state
+ } else if (j == 1 && s2 != _T("0")) { // state
CStringToBin(s2, stream.m_data);
- } else if(j == 2) {
+ } else if (j == 2) {
fn = s2; // path
}
}
@@ -8993,7 +9004,7 @@ void CMainFrame::OnFavoritesDVD(UINT nID) UNUSED_ALWAYS(hr);
CAutoPtr<OpenDVDData> p(DNew OpenDVDData());
- if(p) {
+ if (p) {
p->path = fn;
p->pDvdState = pDvdState;
}
@@ -9038,7 +9049,7 @@ void CMainFrame::OnHelpToolbarImages() void CMainFrame::OnHelpDonate()
{
const TCHAR URL[] = _T("http://sourceforge.net/project/showfiles.php?group_id=170561");
- if(CString(URL).Find(CString(_T("A4N")).MakeReverse()) >= 0) {
+ if (CString(URL).Find(CString(_T("A4N")).MakeReverse()) >= 0) {
ShellExecute(m_hWnd, _T("open"), URL, NULL, NULL, SW_SHOWDEFAULT);
}
}
@@ -9058,10 +9069,10 @@ void CMainFrame::SetDefaultWindowRect(int iMonitor) AppSettings& s = AfxGetAppSettings();
int w, h, x, y;
- if(s.HasFixedWindowSize()) {
+ if (s.HasFixedWindowSize()) {
w = s.sizeFixedWindow.cx;
h = s.sizeFixedWindow.cy;
- } else if(s.fRememberWindowSize) {
+ } else if (s.fRememberWindowSize) {
w = s.rcLastWindowPos.Width();
h = s.rcLastWindowPos.Height();
} else {
@@ -9073,7 +9084,7 @@ void CMainFrame::SetDefaultWindowRect(int iMonitor) int _DEFCLIENTW = max(logosize.cx, DEFCLIENTW);
int _DEFCLIENTH = max(logosize.cy, DEFCLIENTH);
- if(GetSystemMetrics(SM_REMOTESESSION)) {
+ if (GetSystemMetrics(SM_REMOTESESSION)) {
_DEFCLIENTH = 0;
}
@@ -9084,26 +9095,27 @@ void CMainFrame::SetDefaultWindowRect(int iMonitor) h = _DEFCLIENTH + ((style&WS_THICKFRAME) ? GetSystemMetrics(SM_CYSIZEFRAME)*2 : 0)
+ r1.Height() - r2.Height();
- if(style & WS_CAPTION) {
+ if (style & WS_CAPTION) {
h += GetSystemMetrics(SM_CYCAPTION);
- if(s.iCaptionMenuMode == MODE_SHOWCAPTIONMENU)
+ if (s.iCaptionMenuMode == MODE_SHOWCAPTIONMENU) {
h += GetSystemMetrics(SM_CYMENU);
+ }
//else MODE_HIDEMENU
}
}
bool inmonitor = false;
- if(s.fRememberWindowPos) {
+ if (s.fRememberWindowPos) {
CMonitor monitor;
CMonitors monitors;
POINT ptA;
ptA.x = s.rcLastWindowPos.TopLeft().x;
ptA.y = s.rcLastWindowPos.TopLeft().y;
inmonitor = (ptA.x<0 || ptA.y<0);
- if(!inmonitor) {
+ if (!inmonitor) {
for ( int i = 0; i < monitors.GetCount(); i++ ) {
monitor = monitors.GetMonitor( i );
- if(monitor.IsOnMonitor(ptA)) {
+ if (monitor.IsOnMonitor(ptA)) {
inmonitor = true;
break;
}
@@ -9111,17 +9123,17 @@ void CMainFrame::SetDefaultWindowRect(int iMonitor) }
}
- if(s.fRememberWindowPos && inmonitor) {
+ if (s.fRememberWindowPos && inmonitor) {
x = s.rcLastWindowPos.TopLeft().x;
y = s.rcLastWindowPos.TopLeft().y;
} else {
HMONITOR hMonitor = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST);
- if(iMonitor > 0) {
+ if (iMonitor > 0) {
iMonitor--;
CAtlArray<HMONITOR> ml;
EnumDisplayMonitors(NULL, NULL, MonitorEnumProc, (LPARAM)&ml);
- if(iMonitor < ml.GetCount()) {
+ if (iMonitor < ml.GetCount()) {
hMonitor = ml[iMonitor];
}
}
@@ -9138,30 +9150,31 @@ void CMainFrame::SetDefaultWindowRect(int iMonitor) MoveWindow(x, y, w, h);
if (s.iCaptionMenuMode!=MODE_SHOWCAPTIONMENU) {
- if (s.iCaptionMenuMode==MODE_FRAMEONLY)
+ if (s.iCaptionMenuMode==MODE_FRAMEONLY) {
ModifyStyle(WS_CAPTION, 0, SWP_NOZORDER);
- else if (s.iCaptionMenuMode==MODE_BORDERLESS)
+ } else if (s.iCaptionMenuMode==MODE_BORDERLESS) {
ModifyStyle(WS_CAPTION | WS_THICKFRAME, 0, SWP_NOZORDER);
+ }
::SetMenu(m_hWnd, NULL);
SetWindowPos(NULL, 0, 0, 0, 0, SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER);
}
- if(!s.fRememberWindowPos) {
+ if (!s.fRememberWindowPos) {
CenterWindow();
}
// Waffs : fullscreen command line
- if(!(s.nCLSwitches&CLSW_ADD) && (s.nCLSwitches&CLSW_FULLSCREEN) && !s.slFiles.IsEmpty()) {
+ if (!(s.nCLSwitches&CLSW_ADD) && (s.nCLSwitches&CLSW_FULLSCREEN) && !s.slFiles.IsEmpty()) {
ToggleFullscreen(true, true);
SetCursor(NULL);
AfxGetAppSettings().nCLSwitches &= ~CLSW_FULLSCREEN;
m_fFirstFSAfterLaunchOnFS = true;
}
- if(s.fRememberWindowSize && s.fRememberWindowPos) {
- if(lastWindowType == SIZE_MAXIMIZED) {
+ if (s.fRememberWindowSize && s.fRememberWindowPos) {
+ if (lastWindowType == SIZE_MAXIMIZED) {
ShowWindow(SW_MAXIMIZE);
- } else if(lastWindowType == SIZE_MINIMIZED) {
+ } else if (lastWindowType == SIZE_MINIMIZED) {
ShowWindow(SW_MINIMIZE);
}
@@ -9178,12 +9191,12 @@ void CMainFrame::RestoreDefaultWindowRect() WINDOWPLACEMENT wp;
GetWindowPlacement(&wp);
- if(!m_fFullScreen && wp.showCmd != SW_SHOWMAXIMIZED && wp.showCmd != SW_SHOWMINIMIZED
+ if (!m_fFullScreen && wp.showCmd != SW_SHOWMAXIMIZED && wp.showCmd != SW_SHOWMINIMIZED
// && (GetExStyle()&WS_EX_APPWINDOW)
&& !s.fRememberWindowSize) {
int x, y, w, h;
- if(s.HasFixedWindowSize()) {
+ if (s.HasFixedWindowSize()) {
w = s.sizeFixedWindow.cx;
h = s.sizeFixedWindow.cy;
} else {
@@ -9201,15 +9214,16 @@ void CMainFrame::RestoreDefaultWindowRect() h = _DEFCLIENTH + ((style&WS_THICKFRAME) ? GetSystemMetrics(SM_CYSIZEFRAME)*2 : 0)
+ r1.Height() - r2.Height();
- if(style & WS_CAPTION) {
+ if (style & WS_CAPTION) {
h += GetSystemMetrics(SM_CYCAPTION);
- if(s.iCaptionMenuMode == MODE_SHOWCAPTIONMENU)
+ if (s.iCaptionMenuMode == MODE_SHOWCAPTIONMENU) {
h += GetSystemMetrics(SM_CYMENU);
+ }
//else MODE_HIDEMENU
}
}
- if(s.fRememberWindowPos) {
+ if (s.fRememberWindowPos) {
x = s.rcLastWindowPos.TopLeft().x;
y = s.rcLastWindowPos.TopLeft().y;
} else {
@@ -9222,7 +9236,7 @@ void CMainFrame::RestoreDefaultWindowRect() MoveWindow(x, y, w, h);
- if(!s.fRememberWindowPos) {
+ if (!s.fRememberWindowPos) {
CenterWindow();
}
}
@@ -9231,7 +9245,7 @@ void CMainFrame::RestoreDefaultWindowRect() OAFilterState CMainFrame::GetMediaState()
{
OAFilterState ret = -1;
- if(m_iMediaLoadState == MLS_LOADED) {
+ if (m_iMediaLoadState == MLS_LOADED) {
pMC->GetState(0, &ret);
}
return(ret);
@@ -9251,7 +9265,7 @@ CSize CMainFrame::GetVideoSize() bool fCompMonDeskARDiff = AfxGetAppSettings().fCompMonDeskARDiff;
CSize ret(0,0);
- if(m_iMediaLoadState != MLS_LOADED || m_fAudioOnly) {
+ if (m_iMediaLoadState != MLS_LOADED || m_fAudioOnly) {
return ret;
}
@@ -9259,7 +9273,7 @@ CSize CMainFrame::GetVideoSize() if (m_pMFVDC) {
m_pMFVDC->GetNativeVideoSize(&wh, &arxy); // TODO : check AR !!
- } else if(m_pCAP) {
+ } else if (m_pCAP) {
wh = m_pCAP->GetVideoSize(false);
arxy = m_pCAP->GetVideoSize(fKeepAspectRatio);
} else {
@@ -9269,23 +9283,23 @@ CSize CMainFrame::GetVideoSize() CComQIPtr<IBasicVideo2> pBV2 = pBV;
// FIXME: It can hang here, for few seconds (CPU goes to 100%), after the window have been moving over to another screen,
// due to GetPreferredAspectRatio, if it happens before CAudioSwitcherFilter::DeliverEndFlush, it seems.
- if(pBV2 && SUCCEEDED(pBV2->GetPreferredAspectRatio(&arx, &ary)) && arx > 0 && ary > 0) {
+ if (pBV2 && SUCCEEDED(pBV2->GetPreferredAspectRatio(&arx, &ary)) && arx > 0 && ary > 0) {
arxy.SetSize(arx, ary);
}
}
- if(wh.cx <= 0 || wh.cy <= 0) {
+ if (wh.cx <= 0 || wh.cy <= 0) {
return ret;
}
// with the overlay mixer IBasicVideo2 won't tell the new AR when changed dynamically
DVD_VideoAttributes VATR;
- if(GetPlaybackMode() == PM_DVD && SUCCEEDED(pDVDI->GetCurrentVideoAttributes(&VATR))) {
+ if (GetPlaybackMode() == PM_DVD && SUCCEEDED(pDVDI->GetCurrentVideoAttributes(&VATR))) {
arxy.SetSize(VATR.ulAspectX, VATR.ulAspectY);
}
CSize& ar = AfxGetAppSettings().sizeAspectRatio;
- if(ar.cx && ar.cy) {
+ if (ar.cx && ar.cy) {
arxy = ar;
}
@@ -9293,20 +9307,20 @@ CSize CMainFrame::GetVideoSize() ? wh
: CSize(MulDiv(wh.cy, arxy.cx, arxy.cy), wh.cy);
- if(fCompMonDeskARDiff)
- if(HDC hDC = ::GetDC(0)) {
+ if (fCompMonDeskARDiff)
+ if (HDC hDC = ::GetDC(0)) {
int _HORZSIZE = GetDeviceCaps(hDC, HORZSIZE);
int _VERTSIZE = GetDeviceCaps(hDC, VERTSIZE);
int _HORZRES = GetDeviceCaps(hDC, HORZRES);
int _VERTRES = GetDeviceCaps(hDC, VERTRES);
- if(_HORZSIZE > 0 && _VERTSIZE > 0 && _HORZRES > 0 && _VERTRES > 0) {
+ if (_HORZSIZE > 0 && _VERTSIZE > 0 && _HORZRES > 0 && _VERTRES > 0) {
double a = 1.0*_HORZSIZE/_VERTSIZE;
double b = 1.0*_HORZRES/_VERTRES;
- if(b < a) {
+ if (b < a) {
ret.cy = (DWORD)(1.0*ret.cy * a / b);
- } else if(a < b) {
+ } else if (a < b) {
ret.cx = (DWORD)(1.0*ret.cx * b / a);
}
}
@@ -9319,7 +9333,9 @@ CSize CMainFrame::GetVideoSize() void CMainFrame::ToggleFullscreen(bool fToNearest, bool fSwitchScreenResWhenHasTo)
{
- if(m_pFullscreenWnd->IsWindow()) return;
+ if (m_pFullscreenWnd->IsWindow()) {
+ return;
+ }
AppSettings& s = AfxGetAppSettings();
CRect r;
@@ -9335,48 +9351,48 @@ void CMainFrame::ToggleFullscreen(bool fToNearest, bool fSwitchScreenResWhenHasT CMonitors monitors;
static bool m_PlayListBarVisible = false;
- if(!m_fFullScreen) {
+ if (!m_fFullScreen) {
m_PlayListBarVisible = m_wndPlaylistBar.IsVisible();
- if(s.bHidePlaylistFullScreen && m_PlayListBarVisible) {
+ if (s.bHidePlaylistFullScreen && m_PlayListBarVisible) {
ShowControlBar(&m_wndPlaylistBar, !m_PlayListBarVisible, TRUE);
}
- if(!m_fFirstFSAfterLaunchOnFS) {
+ if (!m_fFirstFSAfterLaunchOnFS) {
GetWindowRect(&m_lastWindowRect);
}
- if(s.AutoChangeFullscrRes.bEnabled && fSwitchScreenResWhenHasTo && (GetPlaybackMode() != PM_NONE)) {
+ if (s.AutoChangeFullscrRes.bEnabled && fSwitchScreenResWhenHasTo && (GetPlaybackMode() != PM_NONE)) {
AutoChangeMonitorMode();
}
m_LastWindow_HM = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST);
CString str;
CMonitor monitor;
- if(s.strFullScreenMonitor == _T("Current")) {
+ if (s.strFullScreenMonitor == _T("Current")) {
hm = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST);
} else {
for ( int i = 0; i < monitors.GetCount(); i++ ) {
monitor = monitors.GetMonitor( i );
monitor.GetName(str);
- if((monitor.IsMonitor()) && (s.strFullScreenMonitor == str)) {
+ if ((monitor.IsMonitor()) && (s.strFullScreenMonitor == str)) {
hm = monitor;
break;
}
}
- if(!hm) {
+ if (!hm) {
hm = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST);
}
}
dwRemove = WS_CAPTION|WS_THICKFRAME;
GetMonitorInfo(hm, &mi);
- if(fToNearest) {
+ if (fToNearest) {
r = mi.rcMonitor;
} else {
GetDesktopWindow()->GetWindowRect(&r);
}
hMenu = NULL;
} else {
- if(s.AutoChangeFullscrRes.bEnabled && s.AutoChangeFullscrRes.bApplyDefault) {
+ if (s.AutoChangeFullscrRes.bEnabled && s.AutoChangeFullscrRes.bApplyDefault) {
SetDispMode(s.AutoChangeFullscrRes.dmFullscreenResOther, s.strFullScreenMonitor);
}
@@ -9386,7 +9402,7 @@ void CMainFrame::ToggleFullscreen(bool fToNearest, bool fSwitchScreenResWhenHasT }
hMenu = (s.iCaptionMenuMode==MODE_SHOWCAPTIONMENU) ? m_hMenuDefault: NULL;
- if(s.bHidePlaylistFullScreen) {
+ if (s.bHidePlaylistFullScreen) {
ShowControlBar(&m_wndPlaylistBar, m_PlayListBarVisible, TRUE);
}
}
@@ -9407,35 +9423,35 @@ void CMainFrame::ToggleFullscreen(bool fToNearest, bool fSwitchScreenResWhenHasT static bool m_Change_Monitor = false;
// try disable shader when move from one monitor to other ...
- if(m_fFullScreen) {
+ if (m_fFullScreen) {
m_Change_Monitor = (hm != hm_cur);
- if((m_Change_Monitor) && (!m_bToggleShader)) {
+ if ((m_Change_Monitor) && (!m_bToggleShader)) {
if (m_pCAP) {
m_pCAP->SetPixelShader(NULL, NULL);
}
}
- if((m_Change_Monitor) && (!m_bToggleShaderScreenSpace)) {
+ if ((m_Change_Monitor) && (!m_bToggleShaderScreenSpace)) {
if (m_pCAP2) {
m_pCAP2->SetPixelShader2(NULL, NULL, 1);
}
}
} else {
- if((m_Change_Monitor) && (!m_bToggleShader)) {
+ if ((m_Change_Monitor) && (!m_bToggleShader)) {
if (m_pCAP) {
m_pCAP->SetPixelShader(NULL, NULL);
}
}
}
- if(m_fFullScreen) {
+ if (m_fFullScreen) {
m_fHideCursor = true;
- if(s.fShowBarsWhenFullScreen) {
+ if (s.fShowBarsWhenFullScreen) {
int nTimeOut = s.nShowBarsWhenFullScreenTimeOut;
- if(nTimeOut == 0) {
+ if (nTimeOut == 0) {
ShowControls(CS_NONE, false);
ShowControlBar(&m_wndNavigationBar, false, TRUE);
- } else if(nTimeOut > 0) {
+ } else if (nTimeOut > 0) {
SetTimer(TIMER_FULLSCREENCONTROLBARHIDER, nTimeOut*1000, NULL);
SetTimer(TIMER_FULLSCREENMOUSEHIDER, max(nTimeOut*1000, 2000), NULL);
}
@@ -9444,8 +9460,8 @@ void CMainFrame::ToggleFullscreen(bool fToNearest, bool fSwitchScreenResWhenHasT ShowControlBar(&m_wndNavigationBar, false, TRUE);
}
- if(s.fPreventMinimize) {
- if(hm != hm_cur) {
+ if (s.fPreventMinimize) {
+ if (hm != hm_cur) {
ModifyStyle(WS_MINIMIZEBOX, 0, SWP_NOZORDER);
}
}
@@ -9463,9 +9479,9 @@ void CMainFrame::ToggleFullscreen(bool fToNearest, bool fSwitchScreenResWhenHasT m_fAudioOnly = fAudioOnly;
if (m_fFirstFSAfterLaunchOnFS) { //Play started in Fullscreen
- if(s.fRememberWindowSize || s.fRememberWindowPos) {
+ if (s.fRememberWindowSize || s.fRememberWindowPos) {
r = s.rcLastWindowPos;
- if(!s.fRememberWindowPos) {
+ if (!s.fRememberWindowPos) {
hm = MonitorFromPoint( CPoint( 0,0 ), MONITOR_DEFAULTTOPRIMARY );
GetMonitorInfo(hm, &mi);
CRect m_r = mi.rcMonitor;
@@ -9473,25 +9489,25 @@ void CMainFrame::ToggleFullscreen(bool fToNearest, bool fSwitchScreenResWhenHasT int top = m_r.top + (m_r.Height() - r.Height())/2;
r = CRect(left, top, left + r.Width(), top + r.Height());
}
- if(!s.fRememberWindowSize) {
+ if (!s.fRememberWindowSize) {
CSize vsize = GetVideoSize();
r = CRect(r.left, r.top, r.left + vsize.cx, r.top + vsize.cy);
ShowWindow(SW_HIDE);
}
SetWindowPos(NULL, r.left, r.top, r.Width(), r.Height(), SWP_NOZORDER|SWP_NOSENDCHANGING);
- if(!s.fRememberWindowSize) {
+ if (!s.fRememberWindowSize) {
ZoomVideoWindow();
ShowWindow(SW_SHOW);
}
} else {
- if(m_LastWindow_HM != hm_cur) {
+ if (m_LastWindow_HM != hm_cur) {
GetMonitorInfo(m_LastWindow_HM, &mi);
r = mi.rcMonitor;
ShowWindow(SW_HIDE);
SetWindowPos(NULL, r.left, r.top, r.Width(), r.Height(), SWP_NOZORDER|SWP_NOSENDCHANGING);
}
ZoomVideoWindow();
- if(m_LastWindow_HM != hm_cur) {
+ if (m_LastWindow_HM != hm_cur) {
ShowWindow(SW_SHOW);
}
}
@@ -9502,7 +9518,7 @@ void CMainFrame::ToggleFullscreen(bool fToNearest, bool fSwitchScreenResWhenHasT MoveVideoWindow();
- if((m_Change_Monitor) && (!m_bToggleShader || !m_bToggleShaderScreenSpace)) { // Enabled shader ...
+ if ((m_Change_Monitor) && (!m_bToggleShader || !m_bToggleShaderScreenSpace)) { // Enabled shader ...
SetShaders();
}
}
@@ -9521,7 +9537,7 @@ void CMainFrame::AutoChangeMonitorMode() BeginEnumPins(pBF, pEP, pPin) {
CMediaTypeEx mt;
PIN_DIRECTION dir;
- if(FAILED(pPin->QueryDirection(&dir)) || dir != PINDIR_OUTPUT
+ if (FAILED(pPin->QueryDirection(&dir)) || dir != PINDIR_OUTPUT
|| FAILED(pPin->ConnectionMediaType(&mt))) {
continue;
}
@@ -9575,11 +9591,11 @@ void CMainFrame::AutoChangeMonitorMode() void CMainFrame::MoveVideoWindow(bool fShowStats)
{
- if(m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly && IsWindowVisible()) {
+ if (m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly && IsWindowVisible()) {
CRect wr;
if (m_pFullscreenWnd->IsWindow()) {
m_pFullscreenWnd->GetClientRect(&wr);
- } else if(!m_fFullScreen) {
+ } else if (!m_fFullScreen) {
m_wndView.GetClientRect(&wr);
} else {
GetWindowRect(&wr);
@@ -9593,7 +9609,7 @@ void CMainFrame::MoveVideoWindow(bool fShowStats) CRect vr = CRect(0,0,0,0);
OAFilterState fs = GetMediaState();
- if(fs == State_Paused || fs == State_Running || fs == State_Stopped && (m_fShockwaveGraph || m_fQuicktimeGraph)) {
+ if (fs == State_Paused || fs == State_Running || fs == State_Stopped && (m_fShockwaveGraph || m_fQuicktimeGraph)) {
CSize arxy = GetVideoSize();
dvstype iDefaultVideoSize = (dvstype)AfxGetAppSettings().iDefaultVideoSize;
@@ -9607,14 +9623,14 @@ void CMainFrame::MoveVideoWindow(bool fShowStats) int w = ws.cx;
int h = ws.cy;
- if(!m_fShockwaveGraph) { //&& !m_fQuicktimeGraph)
- if(iDefaultVideoSize == DVS_FROMINSIDE || iDefaultVideoSize == DVS_FROMOUTSIDE ||
+ if (!m_fShockwaveGraph) { //&& !m_fQuicktimeGraph)
+ if (iDefaultVideoSize == DVS_FROMINSIDE || iDefaultVideoSize == DVS_FROMOUTSIDE ||
iDefaultVideoSize == DVS_ZOOM1 || iDefaultVideoSize == DVS_ZOOM2) {
int dh = ws.cy;
int dw = MulDiv(dh, arxy.cx, arxy.cy);
int i = 0;
- switch(iDefaultVideoSize) {
+ switch (iDefaultVideoSize) {
case DVS_ZOOM1:
i = 1;
break;
@@ -9627,9 +9643,9 @@ void CMainFrame::MoveVideoWindow(bool fShowStats) }
int minw = dw;
int maxw = dw;
- if(ws.cx < dw) {
+ if (ws.cx < dw) {
minw = ws.cx;
- } else if(ws.cx > dw) {
+ } else if (ws.cx > dw) {
maxw = ws.cx;
}
@@ -9660,7 +9676,7 @@ void CMainFrame::MoveVideoWindow(bool fShowStats) //wr |= CRect(0,0,0,0);
//vr |= CRect(0,0,0,0);
- if(m_pCAP) {
+ if (m_pCAP) {
m_pCAP->SetPosition(wr, vr);
m_pCAP->SetVideoAngle(Vector(DegToRad(m_AngleX), DegToRad(m_AngleY), DegToRad(m_AngleZ)));
} else {
@@ -9676,7 +9692,7 @@ void CMainFrame::MoveVideoWindow(bool fShowStats) m_wndView.SetVideoRect(wr);
- if(fShowStats && vr.Height() > 0) {
+ if (fShowStats && vr.Height() > 0) {
CString info;
info.Format(_T("Pos %.2f %.2f, Zoom %.2f %.2f, AR %.2f"), m_PosX, m_PosY, m_ZoomX, m_ZoomY, (float)vr.Width()/vr.Height());
SendStatusMessage(info, 3000);
@@ -9693,7 +9709,7 @@ void CMainFrame::HideVideoWindow(bool fHide) CRect wr;
if (m_pFullscreenWnd->IsWindow()) {
m_pFullscreenWnd->GetClientRect(&wr);
- } else if(!m_fFullScreen) {
+ } else if (!m_fFullScreen) {
m_wndView.GetClientRect(&wr);
} else {
GetWindowRect(&wr);
@@ -9705,7 +9721,7 @@ void CMainFrame::HideVideoWindow(bool fHide) }
CRect vr = CRect(0,0,0,0);
- if(m_pCAP) {
+ if (m_pCAP) {
if (fHide) {
m_pCAP->SetPosition(wr, vr); //hide
} else {
@@ -9717,13 +9733,13 @@ void CMainFrame::HideVideoWindow(bool fHide) void CMainFrame::ZoomVideoWindow(bool snap, double scale)
{
- if(m_iMediaLoadState != MLS_LOADED) {
+ if (m_iMediaLoadState != MLS_LOADED) {
return;
}
AppSettings& s = AfxGetAppSettings();
- if(scale <= 0) {
+ if (scale <= 0) {
scale =
s.iZoomLevel == 0 ? 0.5 :
s.iZoomLevel == 1 ? 1.0 :
@@ -9732,7 +9748,7 @@ void CMainFrame::ZoomVideoWindow(bool snap, double scale) 1.0;
}
- if(m_fFullScreen) {
+ if (m_fFullScreen) {
OnViewFullscreen();
}
@@ -9743,7 +9759,7 @@ void CMainFrame::ZoomVideoWindow(bool snap, double scale) GetWindowRect(r);
int w = 0, h = 0;
- if(!m_fAudioOnly) {
+ if (!m_fAudioOnly) {
CSize arxy = GetVideoSize();
long lWidth = int(arxy.cx * scale + 0.5);
@@ -9765,8 +9781,9 @@ void CMainFrame::ZoomVideoWindow(bool snap, double scale) if ( style & WS_CAPTION ) {
h += GetSystemMetrics( SM_CYCAPTION );
- if(s.iCaptionMenuMode == MODE_SHOWCAPTIONMENU)
+ if (s.iCaptionMenuMode == MODE_SHOWCAPTIONMENU) {
h += GetSystemMetrics( SM_CYMENU );
+ }
//else MODE_HIDEMENU
}
@@ -9789,22 +9806,22 @@ void CMainFrame::ZoomVideoWindow(bool snap, double scale) w = min(w, (mi.rcWork.right - mi.rcWork.left));
h = min(h, (mi.rcWork.bottom - mi.rcWork.top));
- if(!s.fRememberWindowPos) {
+ if (!s.fRememberWindowPos) {
bool isSnapped = false;
- if(snap && s.fSnapToDesktopEdges) { // check if snapped to edges
+ if (snap && s.fSnapToDesktopEdges) { // check if snapped to edges
isSnapped = (r.left == mi.rcWork.left) || (r.top == mi.rcWork.top)
|| (r.right == mi.rcWork.right) || (r.bottom == mi.rcWork.bottom);
}
- if(isSnapped) { // prefer left, top snap to right, bottom snap
- if(r.left == mi.rcWork.left) {}
- else if(r.right == mi.rcWork.right) {
+ if (isSnapped) { // prefer left, top snap to right, bottom snap
+ if (r.left == mi.rcWork.left) {}
+ else if (r.right == mi.rcWork.right) {
r.left = r.right - w;
}
- if(r.top == mi.rcWork.top) {}
- else if(r.bottom == mi.rcWork.bottom) {
+ if (r.top == mi.rcWork.top) {}
+ else if (r.bottom == mi.rcWork.bottom) {
r.top = r.bottom - h;
}
} else { // center window
@@ -9817,20 +9834,20 @@ void CMainFrame::ZoomVideoWindow(bool snap, double scale) r.right = r.left + w;
r.bottom = r.top + h;
- if(r.right > mi.rcWork.right) {
+ if (r.right > mi.rcWork.right) {
r.OffsetRect(mi.rcWork.right-r.right, 0);
}
- if(r.left < mi.rcWork.left) {
+ if (r.left < mi.rcWork.left) {
r.OffsetRect(mi.rcWork.left-r.left, 0);
}
- if(r.bottom > mi.rcWork.bottom) {
+ if (r.bottom > mi.rcWork.bottom) {
r.OffsetRect(0, mi.rcWork.bottom-r.bottom);
}
- if(r.top < mi.rcWork.top) {
+ if (r.top < mi.rcWork.top) {
r.OffsetRect(0, mi.rcWork.top-r.top);
}
- if((m_fFullScreen || !s.HasFixedWindowSize()) && !m_pFullscreenWnd->IsWindow()) {
+ if ((m_fFullScreen || !s.HasFixedWindowSize()) && !m_pFullscreenWnd->IsWindow()) {
MoveWindow(r);
}
@@ -9841,7 +9858,7 @@ void CMainFrame::ZoomVideoWindow(bool snap, double scale) double CMainFrame::GetZoomAutoFitScale()
{
- if(m_iMediaLoadState != MLS_LOADED || m_fAudioOnly) {
+ if (m_iMediaLoadState != MLS_LOADED || m_fAudioOnly) {
return 1.0;
}
@@ -9855,14 +9872,14 @@ double CMainFrame::GetZoomAutoFitScale() void CMainFrame::RepaintVideo()
{
- if(m_pCAP) {
+ if (m_pCAP) {
m_pCAP->Paint(false);
}
}
void CMainFrame::SetShaders()
{
- if(!m_pCAP) {
+ if (!m_pCAP) {
return;
}
@@ -9871,7 +9888,7 @@ void CMainFrame::SetShaders() CAtlStringMap<const AppSettings::Shader*> s2s;
POSITION pos = s.m_shaders.GetHeadPosition();
- while(pos) {
+ while (pos) {
const AppSettings::Shader* pShader = &s.m_shaders.GetNext(pos);
s2s[pShader->label] = pShader;
}
@@ -9901,9 +9918,9 @@ void CMainFrame::SetShaders() }
pos = pLabels->GetHeadPosition();
- while(pos) {
+ while (pos) {
const AppSettings::Shader* pShader = NULL;
- if(s2s.Lookup(pLabels->GetNext(pos), pShader)) {
+ if (s2s.Lookup(pLabels->GetNext(pos), pShader)) {
CStringA target = pShader->target;
CStringA srcdata = pShader->srcdata;
@@ -9914,7 +9931,7 @@ void CMainFrame::SetShaders() hr = m_pCAP2->SetPixelShader2(srcdata, target, true);
}
- if(FAILED(hr)) {
+ if (FAILED(hr)) {
m_pCAP->SetPixelShader(NULL, NULL);
if (m_pCAP2) {
m_pCAP2->SetPixelShader2(NULL, NULL, true);
@@ -9927,7 +9944,7 @@ void CMainFrame::SetShaders() }
}
- if(m_iMediaLoadState == MLS_LOADED) {
+ if (m_iMediaLoadState == MLS_LOADED) {
CString str = Implode(labels, '|');
str.Replace(_T("|"), _T(", "));
SendStatusMessage(ResStr(IDS_AG_SHADER) + str, 3000);
@@ -9937,29 +9954,29 @@ void CMainFrame::SetShaders() void CMainFrame::UpdateShaders(CString label)
{
- if(!m_pCAP) {
+ if (!m_pCAP) {
return;
}
- if(m_shaderlabels.GetCount() <= 1) {
+ if (m_shaderlabels.GetCount() <= 1) {
m_shaderlabels.RemoveAll();
}
- if(m_shaderlabels.IsEmpty() && !label.IsEmpty()) {
+ if (m_shaderlabels.IsEmpty() && !label.IsEmpty()) {
m_shaderlabels.AddTail(label);
}
bool fUpdate = m_shaderlabels.IsEmpty();
POSITION pos = m_shaderlabels.GetHeadPosition();
- while(pos) {
- if(label == m_shaderlabels.GetNext(pos)) {
+ while (pos) {
+ if (label == m_shaderlabels.GetNext(pos)) {
fUpdate = true;
break;
}
}
- if(fUpdate) {
+ if (fUpdate) {
SetShaders();
}
@@ -9971,22 +9988,24 @@ void CMainFrame::SetBalance(int balance) int sign = balance>0?-1:1; // -1: invert sign for more right channel
int balance_dB;
- if (balance > -100 && balance < 100)
+ if (balance > -100 && balance < 100) {
balance_dB = sign*(int)(100*20*log10(1-abs(balance)/100.0f));
- else
- balance_dB = sign*(-10000);// -10000: only left, 10000: only right
+ } else {
+ balance_dB = sign*(-10000); // -10000: only left, 10000: only right
+ }
- if(m_iMediaLoadState == MLS_LOADED) {
+ if (m_iMediaLoadState == MLS_LOADED) {
CString strBalance, strBalanceOSD;
pBA->put_Balance(balance_dB);
- if (balance == 0)
+ if (balance == 0) {
strBalance = L"L = R";
- else if (balance < 0)
+ } else if (balance < 0) {
strBalance.Format(L"L +%d%%", -balance);
- else //if (m_nBalance > 0)
+ } else { //if (m_nBalance > 0)
strBalance.Format(L"R +%d%%", balance);
+ }
strBalanceOSD.Format(ResStr(IDS_BALANCE_OSD), strBalance);
m_OSD.DisplayMessage(OSD_TOPLEFT, strBalanceOSD);
@@ -9995,18 +10014,18 @@ void CMainFrame::SetBalance(int balance) void CMainFrame::SetupIViAudReg()
{
- if(!AfxGetAppSettings().fAutoSpeakerConf) {
+ if (!AfxGetAppSettings().fAutoSpeakerConf) {
return;
}
DWORD spc = 0, defchnum = 0;
- if(AfxGetAppSettings().fAutoSpeakerConf) {
+ if (AfxGetAppSettings().fAutoSpeakerConf) {
CComPtr<IDirectSound> pDS;
- if(SUCCEEDED(DirectSoundCreate(NULL, &pDS, NULL))
+ if (SUCCEEDED(DirectSoundCreate(NULL, &pDS, NULL))
&& SUCCEEDED(pDS->SetCooperativeLevel(m_hWnd, DSSCL_NORMAL))) {
- if(SUCCEEDED(pDS->GetSpeakerConfig(&spc))) {
- switch(spc) {
+ if (SUCCEEDED(pDS->GetSpeakerConfig(&spc))) {
+ switch (spc) {
case DSSPEAKER_DIRECTOUT:
defchnum = 6;
break;
@@ -10040,12 +10059,12 @@ void CMainFrame::SetupIViAudReg() }
CRegKey iviaud;
- if(ERROR_SUCCESS == iviaud.Create(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\InterVideo\\Common\\AudioDec"))) {
+ if (ERROR_SUCCESS == iviaud.Create(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\InterVideo\\Common\\AudioDec"))) {
DWORD chnum = 0;
- if(FAILED(iviaud.QueryDWORDValue(_T("AUDIO"), chnum))) {
+ if (FAILED(iviaud.QueryDWORDValue(_T("AUDIO"), chnum))) {
chnum = 0;
}
- if(chnum <= defchnum) { // check if the user has already set it..., but we won't skip if it's lower than sensible :P
+ if (chnum <= defchnum) { // check if the user has already set it..., but we won't skip if it's lower than sensible :P
iviaud.SetDWORDValue(_T("AUDIO"), defchnum);
}
}
@@ -10058,7 +10077,7 @@ void CMainFrame::SetupIViAudReg() bool CMainFrame::IsRealEngineCompatible(CString strFilename) const
{
// Real Media engine didn't support Unicode filename (nor filenames with # characters)
- for(int i=0; i<strFilename.GetLength(); i++) {
+ for (int i=0; i<strFilename.GetLength(); i++) {
WCHAR Char = strFilename[i];
if (Char<32 || Char>126 || Char==35) {
return false;
@@ -10089,14 +10108,14 @@ void CMainFrame::OpenCreateGraphObject(OpenMediaData* pOMD) m_pVideoWnd = &m_wndView;
}
- if(OpenFileData* p = dynamic_cast<OpenFileData*>(pOMD)) {
+ if (OpenFileData* p = dynamic_cast<OpenFileData*>(pOMD)) {
engine_t engine = s.m_Formats.GetEngine(p->fns.GetHead());
CStringA ct = GetContentType(p->fns.GetHead());
- if(ct == "video/x-ms-asf") {
+ if (ct == "video/x-ms-asf") {
// TODO: put something here to make the windows media source filter load later
- } else if(ct == "audio/x-pn-realaudio"
+ } else if (ct == "audio/x-pn-realaudio"
|| ct == "audio/x-pn-realaudio-plugin"
|| ct == "audio/x-realaudio-secure"
|| ct == "video/vnd.rn-realvideo-secure"
@@ -10105,9 +10124,9 @@ void CMainFrame::OpenCreateGraphObject(OpenMediaData* pOMD) || ct.Find("realaudio") >= 0
|| ct.Find("realvideo") >= 0) {
engine = RealMedia;
- } else if(ct == "application/x-shockwave-flash") {
+ } else if (ct == "application/x-shockwave-flash") {
engine = ShockWave;
- } else if(ct == "video/quicktime"
+ } else if (ct == "video/quicktime"
|| ct == "application/x-quicktimeplayer") {
engine = QuickTime;
}
@@ -10115,47 +10134,47 @@ void CMainFrame::OpenCreateGraphObject(OpenMediaData* pOMD) HRESULT hr = E_FAIL;
CComPtr<IUnknown> pUnk;
- if(engine == RealMedia) {
+ if (engine == RealMedia) {
// TODO : see why Real SDK crash here ...
//if (!IsRealEngineCompatible(p->fns.GetHead()))
// throw ResStr(IDS_REALVIDEO_INCOMPATIBLE);
pUnk = (IUnknown*)(INonDelegatingUnknown*)DNew CRealMediaGraph(m_pVideoWnd->m_hWnd, hr);
- if(!pUnk) {
+ if (!pUnk) {
throw ResStr(IDS_AG_OUT_OF_MEMORY);
}
- if(SUCCEEDED(hr)) {
+ if (SUCCEEDED(hr)) {
pGB = CComQIPtr<IGraphBuilder>(pUnk);
- if(pGB) {
+ if (pGB) {
m_fRealMediaGraph = true;
}
}
- } else if(engine == ShockWave) {
+ } else if (engine == ShockWave) {
pUnk = (IUnknown*)(INonDelegatingUnknown*)DNew CShockwaveGraph(m_pVideoWnd->m_hWnd, hr);
- if(!pUnk) {
+ if (!pUnk) {
throw ResStr(IDS_AG_OUT_OF_MEMORY);
}
- if(SUCCEEDED(hr)) {
+ if (SUCCEEDED(hr)) {
pGB = CComQIPtr<IGraphBuilder>(pUnk);
}
- if(FAILED(hr) || !pGB) {
+ if (FAILED(hr) || !pGB) {
throw ResStr(IDS_MAINFRM_77);
}
m_fShockwaveGraph = true;
- } else if(engine == QuickTime) {
+ } else if (engine == QuickTime) {
#ifdef _WIN64 // TODOX64
// MessageBox (ResStr(IDS_MAINFRM_78), _T(""), MB_OK);
#else
pUnk = (IUnknown*)(INonDelegatingUnknown*)DNew CQuicktimeGraph(m_pVideoWnd->m_hWnd, hr);
- if(!pUnk) {
+ if (!pUnk) {
throw ResStr(IDS_AG_OUT_OF_MEMORY);
}
- if(SUCCEEDED(hr)) {
+ if (SUCCEEDED(hr)) {
pGB = CComQIPtr<IGraphBuilder>(pUnk);
- if(pGB) {
+ if (pGB) {
m_fQuicktimeGraph = true;
}
}
@@ -10164,12 +10183,12 @@ void CMainFrame::OpenCreateGraphObject(OpenMediaData* pOMD) m_fCustomGraph = m_fRealMediaGraph || m_fShockwaveGraph || m_fQuicktimeGraph;
- if(!m_fCustomGraph) {
+ if (!m_fCustomGraph) {
pGB = DNew CFGManagerPlayer(_T("CFGManagerPlayer"), NULL, m_pVideoWnd->m_hWnd);
}
- } else if(OpenDVDData* p = dynamic_cast<OpenDVDData*>(pOMD)) {
+ } else if (OpenDVDData* p = dynamic_cast<OpenDVDData*>(pOMD)) {
pGB = DNew CFGManagerDVD(_T("CFGManagerDVD"), NULL, m_pVideoWnd->m_hWnd);
- } else if(OpenDeviceData* p = dynamic_cast<OpenDeviceData*>(pOMD)) {
+ } else if (OpenDeviceData* p = dynamic_cast<OpenDeviceData*>(pOMD)) {
if (s.iDefaultCaptureDevice == 1) {
pGB = DNew CFGManagerBDA(_T("CFGManagerBDA"), NULL, m_pVideoWnd->m_hWnd);
} else {
@@ -10177,7 +10196,7 @@ void CMainFrame::OpenCreateGraphObject(OpenMediaData* pOMD) }
}
- if(!pGB) {
+ if (!pGB) {
throw ResStr(IDS_MAINFRM_80);
}
@@ -10191,19 +10210,19 @@ void CMainFrame::OpenCreateGraphObject(OpenMediaData* pOMD) pBA = pGB; // audio
pFS = pGB;
- if(!(pMC && pME && pMS)
+ if (!(pMC && pME && pMS)
|| !(pVW && pBV)
|| !(pBA)) {
throw _T("Failed to query the needed interfaces for playback");
}
- if(FAILED(pME->SetNotifyWindow((OAHWND)m_hWnd, WM_GRAPHNOTIFY, 0))) {
+ if (FAILED(pME->SetNotifyWindow((OAHWND)m_hWnd, WM_GRAPHNOTIFY, 0))) {
throw _T("Could not set target window for graph notification");
}
m_pProv = (IUnknown*)DNew CKeyProvider();
- if(CComQIPtr<IObjectWithSite> pObjectWithSite = pGB) {
+ if (CComQIPtr<IObjectWithSite> pObjectWithSite = pGB) {
pObjectWithSite->SetSite(m_pProv);
}
@@ -10222,7 +10241,7 @@ CWnd *CMainFrame::GetModalParent() void CMainFrame::OpenFile(OpenFileData* pOFD)
{
- if(pOFD->fns.IsEmpty()) {
+ if (pOFD->fns.IsEmpty()) {
throw ResStr(IDS_MAINFRM_81);
}
@@ -10231,11 +10250,11 @@ void CMainFrame::OpenFile(OpenFileData* pOFD) bool fFirst = true;
POSITION pos = pOFD->fns.GetHeadPosition();
- while(pos) {
+ while (pos) {
CString fn = pOFD->fns.GetNext(pos);
fn.Trim();
- if(fn.IsEmpty() && !fFirst) {
+ if (fn.IsEmpty() && !fFirst) {
break;
}
@@ -10249,18 +10268,18 @@ void CMainFrame::OpenFile(OpenFileData* pOFD) }
QueryPerformanceCounter(&m_LastSaveTime);
- if(FAILED(hr)) {
- if(fFirst) {
- if(s.fReportFailedPins) {
+ if (FAILED(hr)) {
+ if (fFirst) {
+ if (s.fReportFailedPins) {
CComQIPtr<IGraphBuilderDeadEnd> pGBDE = pGB;
- if(pGBDE && pGBDE->GetCount()) {
+ if (pGBDE && pGBDE->GetCount()) {
CMediaTypesDlg(pGBDE, GetModalParent()).DoModal();
}
}
CString err;
- switch(hr) {
+ switch (hr) {
case E_ABORT:
err = ResStr(IDS_MAINFRM_82);
break;
@@ -10302,7 +10321,7 @@ void CMainFrame::OpenFile(OpenFileData* pOFD) }
}
- if(s.fKeepHistory) {
+ if (s.fKeepHistory) {
CRecentFileList* pMRU = fFirst ? &s.MRU : &s.MRUDub;
pMRU->ReadList();
pMRU->Add(fn);
@@ -10310,33 +10329,33 @@ void CMainFrame::OpenFile(OpenFileData* pOFD) SHAddToRecentDocs(SHARD_PATH, fn);
}
- if(fFirst) {
+ if (fFirst) {
pOFD->title = fn;
}
fFirst = false;
- if(m_fCustomGraph) {
+ if (m_fCustomGraph) {
break;
}
}
- if(s.fReportFailedPins) {
+ if (s.fReportFailedPins) {
CComQIPtr<IGraphBuilderDeadEnd> pGBDE = pGB;
- if(pGBDE && pGBDE->GetCount()) {
+ if (pGBDE && pGBDE->GetCount()) {
CMediaTypesDlg(pGBDE, GetModalParent()).DoModal();
}
}
- if(!(pAMOP = pGB)) {
+ if (!(pAMOP = pGB)) {
BeginEnumFilters(pGB, pEF, pBF)
- if(pAMOP = pBF) {
+ if (pAMOP = pBF) {
break;
}
EndEnumFilters;
}
- if(FindFilter(__uuidof(CShoutcastSource), pGB)) {
+ if (FindFilter(__uuidof(CShoutcastSource), pGB)) {
m_fUpdateInfoBar = true;
}
@@ -10344,14 +10363,14 @@ void CMainFrame::OpenFile(OpenFileData* pOFD) CComQIPtr<IKeyFrameInfo> pKFI;
BeginEnumFilters(pGB, pEF, pBF)
- if(pKFI = pBF) {
+ if (pKFI = pBF) {
break;
}
EndEnumFilters;
UINT nKFs = 0, nKFsTmp = 0;
- if(pKFI && S_OK == pKFI->GetKeyFrameCount(nKFs) && nKFs > 0) {
+ if (pKFI && S_OK == pKFI->GetKeyFrameCount(nKFs) && nKFs > 0) {
m_kfs.SetCount(nKFsTmp = nKFs);
- if(S_OK != pKFI->GetKeyFrames(&TIME_FORMAT_MEDIA_TIME, m_kfs.GetData(), nKFsTmp) || nKFsTmp != nKFs) {
+ if (S_OK != pKFI->GetKeyFrames(&TIME_FORMAT_MEDIA_TIME, m_kfs.GetData(), nKFsTmp) || nKFsTmp != nKFs) {
m_kfs.RemoveAll();
}
}
@@ -10373,45 +10392,45 @@ void CMainFrame::SetupChapters() POSITION pos;
pos = pBFs.GetHeadPosition();
- while(pos && !m_pCB->ChapGetCount()) {
+ while (pos && !m_pCB->ChapGetCount()) {
IBaseFilter* pBF = pBFs.GetNext(pos);
CComQIPtr<IDSMChapterBag> pCB = pBF;
- if(!pCB) {
+ if (!pCB) {
continue;
}
- for(DWORD i = 0, cnt = pCB->ChapGetCount(); i < cnt; i++) {
+ for (DWORD i = 0, cnt = pCB->ChapGetCount(); i < cnt; i++) {
REFERENCE_TIME rt;
CComBSTR name;
- if(SUCCEEDED(pCB->ChapGet(i, &rt, &name))) {
+ if (SUCCEEDED(pCB->ChapGet(i, &rt, &name))) {
m_pCB->ChapAppend(rt, name);
}
}
}
pos = pBFs.GetHeadPosition();
- while(pos && !m_pCB->ChapGetCount()) {
+ while (pos && !m_pCB->ChapGetCount()) {
IBaseFilter* pBF = pBFs.GetNext(pos);
CComQIPtr<IChapterInfo> pCI = pBF;
- if(!pCI) {
+ if (!pCI) {
continue;
}
CHAR iso6391[3];
::GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SISO639LANGNAME, iso6391, 3);
CStringA iso6392 = ISO6391To6392(iso6391);
- if(iso6392.GetLength() < 3) {
+ if (iso6392.GetLength() < 3) {
iso6392 = "eng";
}
UINT cnt = pCI->GetChapterCount(CHAPTER_ROOT_ID);
- for(UINT i = 1; i <= cnt; i++) {
+ for (UINT i = 1; i <= cnt; i++) {
UINT cid = pCI->GetChapterId(CHAPTER_ROOT_ID, i);
ChapterElement ce;
- if(pCI->GetChapterInfo(cid, &ce)) {
+ if (pCI->GetChapterInfo(cid, &ce)) {
char pl[3] = {iso6392[0], iso6392[1], iso6392[2]};
char cc[] = " ";
CComBSTR name;
@@ -10422,24 +10441,24 @@ void CMainFrame::SetupChapters() }
pos = pBFs.GetHeadPosition();
- while(pos && !m_pCB->ChapGetCount()) {
+ while (pos && !m_pCB->ChapGetCount()) {
IBaseFilter* pBF = pBFs.GetNext(pos);
CComQIPtr<IAMExtendedSeeking, &IID_IAMExtendedSeeking> pES = pBF;
- if(!pES) {
+ if (!pES) {
continue;
}
long MarkerCount = 0;
- if(SUCCEEDED(pES->get_MarkerCount(&MarkerCount))) {
- for(long i = 1; i <= MarkerCount; i++) {
+ if (SUCCEEDED(pES->get_MarkerCount(&MarkerCount))) {
+ for (long i = 1; i <= MarkerCount; i++) {
double MarkerTime = 0;
- if(SUCCEEDED(pES->GetMarkerTime(i, &MarkerTime))) {
+ if (SUCCEEDED(pES->GetMarkerTime(i, &MarkerTime))) {
CStringW name;
name.Format(L"Chapter %d", i);
CComBSTR bstr;
- if(S_OK == pES->GetMarkerName(i, &bstr)) {
+ if (S_OK == pES->GetMarkerName(i, &bstr)) {
name = bstr;
}
@@ -10450,32 +10469,32 @@ void CMainFrame::SetupChapters() }
pos = pBFs.GetHeadPosition();
- while(pos && !m_pCB->ChapGetCount()) {
+ while (pos && !m_pCB->ChapGetCount()) {
IBaseFilter* pBF = pBFs.GetNext(pos);
- if(GetCLSID(pBF) != CLSID_OggSplitter) {
+ if (GetCLSID(pBF) != CLSID_OggSplitter) {
continue;
}
BeginEnumPins(pBF, pEP, pPin) {
- if(m_pCB->ChapGetCount()) {
+ if (m_pCB->ChapGetCount()) {
break;
}
- if(CComQIPtr<IPropertyBag> pPB = pPin) {
- for(int i = 1; ; i++) {
+ if (CComQIPtr<IPropertyBag> pPB = pPin) {
+ for (int i = 1; ; i++) {
CStringW str;
CComVariant var;
var.Clear();
str.Format(L"CHAPTER%02d", i);
- if(S_OK != pPB->Read(str, &var, NULL)) {
+ if (S_OK != pPB->Read(str, &var, NULL)) {
break;
}
int h, m, s, ms;
WCHAR wc;
- if(7 != swscanf_s(CStringW(var), L"%d%c%d%c%d%c%d", &h, &wc, &m, &wc, &s, &wc, &ms)) {
+ if (7 != swscanf_s(CStringW(var), L"%d%c%d%c%d%c%d", &h, &wc, &m, &wc, &s, &wc, &ms)) {
break;
}
@@ -10483,7 +10502,7 @@ void CMainFrame::SetupChapters() name.Format(L"Chapter %d", i);
var.Clear();
str += L"NAME";
- if(S_OK == pPB->Read(str, &var, NULL)) {
+ if (S_OK == pPB->Read(str, &var, NULL)) {
name = var;
}
@@ -10503,37 +10522,37 @@ void CMainFrame::OpenDVD(OpenDVDData* pODD) AppSettings& s = AfxGetAppSettings();
- if(s.fReportFailedPins) {
+ if (s.fReportFailedPins) {
CComQIPtr<IGraphBuilderDeadEnd> pGBDE = pGB;
- if(pGBDE && pGBDE->GetCount()) {
+ if (pGBDE && pGBDE->GetCount()) {
CMediaTypesDlg(pGBDE, GetModalParent()).DoModal();
}
}
BeginEnumFilters(pGB, pEF, pBF) {
- if((pDVDC = pBF) && (pDVDI = pBF)) {
+ if ((pDVDC = pBF) && (pDVDI = pBF)) {
break;
}
}
EndEnumFilters;
- if(hr == E_INVALIDARG) {
+ if (hr == E_INVALIDARG) {
throw ResStr(IDS_MAINFRM_93);
- } else if(hr == VFW_E_CANNOT_RENDER) {
+ } else if (hr == VFW_E_CANNOT_RENDER) {
throw _T("Failed to render all pins of the DVD Navigator filter");
- } else if(hr == VFW_S_PARTIAL_RENDER) {
+ } else if (hr == VFW_S_PARTIAL_RENDER) {
throw _T("Failed to render some of the pins of the DVD Navigator filter");
- } else if(hr == E_NOINTERFACE || !pDVDC || !pDVDI) {
+ } else if (hr == E_NOINTERFACE || !pDVDC || !pDVDI) {
throw _T("Failed to query the needed interfaces for DVD playback");
- } else if(hr == VFW_E_CANNOT_LOAD_SOURCE_FILTER) {
+ } else if (hr == VFW_E_CANNOT_LOAD_SOURCE_FILTER) {
throw ResStr(IDS_MAINFRM_94);
- } else if(FAILED(hr)) {
+ } else if (FAILED(hr)) {
throw ResStr(IDS_AG_FAILED);
}
WCHAR buff[_MAX_PATH];
ULONG len = 0;
- if(SUCCEEDED(hr = pDVDI->GetDVDDirectory(buff, countof(buff), &len))) {
+ if (SUCCEEDED(hr = pDVDI->GetDVDDirectory(buff, countof(buff), &len))) {
pODD->title = CString(CStringW(buff));
}
@@ -10541,13 +10560,13 @@ void CMainFrame::OpenDVD(OpenDVDData* pODD) pDVDC->SetOption(DVD_ResetOnStop, FALSE);
pDVDC->SetOption(DVD_HMSF_TimeCodeEvents, TRUE);
- if(s.idMenuLang) {
+ if (s.idMenuLang) {
pDVDC->SelectDefaultMenuLanguage(s.idMenuLang);
}
- if(s.idAudioLang) {
+ if (s.idAudioLang) {
pDVDC->SelectDefaultAudioLanguage(s.idAudioLang, DVD_AUD_EXT_NotSpecified);
}
- if(s.idSubtitlesLang) {
+ if (s.idSubtitlesLang) {
pDVDC->SelectDefaultSubpictureLanguage(s.idSubtitlesLang, DVD_SP_EXT_NotSpecified);
}
@@ -10573,21 +10592,21 @@ void CMainFrame::OpenCapture(OpenDeviceData* pODD) m_VidDispName = pODD->DisplayName[0];
- if(!m_VidDispName.IsEmpty()) {
- if(!CreateFilter(m_VidDispName, &pVidCapTmp, vidfrname)) {
+ if (!m_VidDispName.IsEmpty()) {
+ if (!CreateFilter(m_VidDispName, &pVidCapTmp, vidfrname)) {
throw ResStr(IDS_MAINFRM_96);
}
}
m_AudDispName = pODD->DisplayName[1];
- if(!m_AudDispName.IsEmpty()) {
- if(!CreateFilter(m_AudDispName, &pAudCapTmp, audfrname)) {
+ if (!m_AudDispName.IsEmpty()) {
+ if (!CreateFilter(m_AudDispName, &pAudCapTmp, audfrname)) {
throw ResStr(IDS_MAINFRM_96);
}
}
- if(!pVidCapTmp && !pAudCapTmp) {
+ if (!pVidCapTmp && !pAudCapTmp) {
throw ResStr(IDS_MAINFRM_98);
}
@@ -10595,7 +10614,7 @@ void CMainFrame::OpenCapture(OpenDeviceData* pODD) pVidCap = NULL;
pAudCap = NULL;
- if(FAILED(pCGB.CoCreateInstance(CLSID_CaptureGraphBuilder2))) {
+ if (FAILED(pCGB.CoCreateInstance(CLSID_CaptureGraphBuilder2))) {
throw ResStr(IDS_MAINFRM_99);
}
@@ -10603,53 +10622,53 @@ void CMainFrame::OpenCapture(OpenDeviceData* pODD) pCGB->SetFiltergraph(pGB);
- if(pVidCapTmp) {
- if(FAILED(hr = pGB->AddFilter(pVidCapTmp, vidfrname))) {
+ if (pVidCapTmp) {
+ if (FAILED(hr = pGB->AddFilter(pVidCapTmp, vidfrname))) {
throw _T("Can't add video capture filter to the graph");
}
pVidCap = pVidCapTmp;
- if(!pAudCapTmp) {
- if(FAILED(pCGB->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Interleaved, pVidCap, IID_IAMStreamConfig, (void **)&pAMVSCCap))
+ if (!pAudCapTmp) {
+ if (FAILED(pCGB->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Interleaved, pVidCap, IID_IAMStreamConfig, (void **)&pAMVSCCap))
&& FAILED(pCGB->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, pVidCap, IID_IAMStreamConfig, (void **)&pAMVSCCap))) {
TRACE(_T("Warning: No IAMStreamConfig interface for vidcap capture"));
}
- if(FAILED(pCGB->FindInterface(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Interleaved, pVidCap, IID_IAMStreamConfig, (void **)&pAMVSCPrev))
+ if (FAILED(pCGB->FindInterface(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Interleaved, pVidCap, IID_IAMStreamConfig, (void **)&pAMVSCPrev))
&& FAILED(pCGB->FindInterface(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, pVidCap, IID_IAMStreamConfig, (void **)&pAMVSCPrev))) {
TRACE(_T("Warning: No IAMStreamConfig interface for vidcap capture"));
}
- if(FAILED(pCGB->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Audio, pVidCap, IID_IAMStreamConfig, (void **)&pAMASC))
+ if (FAILED(pCGB->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Audio, pVidCap, IID_IAMStreamConfig, (void **)&pAMASC))
&& FAILED(pCGB->FindInterface(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Audio, pVidCap, IID_IAMStreamConfig, (void **)&pAMASC))) {
TRACE(_T("Warning: No IAMStreamConfig interface for vidcap"));
} else {
pAudCap = pVidCap;
}
} else {
- if(FAILED(pCGB->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, pVidCap, IID_IAMStreamConfig, (void **)&pAMVSCCap))) {
+ if (FAILED(pCGB->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, pVidCap, IID_IAMStreamConfig, (void **)&pAMVSCCap))) {
TRACE(_T("Warning: No IAMStreamConfig interface for vidcap capture"));
}
- if(FAILED(pCGB->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, pVidCap, IID_IAMStreamConfig, (void **)&pAMVSCPrev))) {
+ if (FAILED(pCGB->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, pVidCap, IID_IAMStreamConfig, (void **)&pAMVSCPrev))) {
TRACE(_T("Warning: No IAMStreamConfig interface for vidcap capture"));
}
}
- if(FAILED(pCGB->FindInterface(&LOOK_UPSTREAM_ONLY, NULL, pVidCap, IID_IAMCrossbar, (void**)&pAMXBar))) {
+ if (FAILED(pCGB->FindInterface(&LOOK_UPSTREAM_ONLY, NULL, pVidCap, IID_IAMCrossbar, (void**)&pAMXBar))) {
TRACE(_T("Warning: No IAMCrossbar interface was found\n"));
}
- if(FAILED(pCGB->FindInterface(&LOOK_UPSTREAM_ONLY, NULL, pVidCap, IID_IAMTVTuner, (void**)&pAMTuner))) {
+ if (FAILED(pCGB->FindInterface(&LOOK_UPSTREAM_ONLY, NULL, pVidCap, IID_IAMTVTuner, (void**)&pAMTuner))) {
TRACE(_T("Warning: No IAMTVTuner interface was found\n"));
}
/*
- if(pAMVSCCap)
+ if (pAMVSCCap)
{
//DumpStreamConfig(_T("c:\\mpclog.txt"), pAMVSCCap);
CComQIPtr<IAMVfwCaptureDialogs> pVfwCD = pVidCap;
- if(!pAMXBar && pVfwCD)
+ if (!pAMXBar && pVfwCD)
{
m_wndCaptureBar.m_capdlg.SetupVideoControls(viddispname, pAMVSCCap, pVfwCD);
}
@@ -10661,35 +10680,35 @@ void CMainFrame::OpenCapture(OpenDeviceData* pODD) */
// TODO: init pAMXBar
- if(pAMTuner) { // load saved channel
+ if (pAMTuner) { // load saved channel
pAMTuner->put_CountryCode(AfxGetApp()->GetProfileInt(_T("Capture"), _T("Country"), 1));
int vchannel = pODD->vchannel;
- if(vchannel < 0) {
+ if (vchannel < 0) {
vchannel = AfxGetApp()->GetProfileInt(_T("Capture\\") + CString(m_VidDispName), _T("Channel"), -1);
}
- if(vchannel >= 0) {
+ if (vchannel >= 0) {
OAFilterState fs = State_Stopped;
pMC->GetState(0, &fs);
- if(fs == State_Running) {
+ if (fs == State_Running) {
pMC->Pause();
}
pAMTuner->put_Channel(vchannel, AMTUNER_SUBCHAN_DEFAULT, AMTUNER_SUBCHAN_DEFAULT);
- if(fs == State_Running) {
+ if (fs == State_Running) {
pMC->Run();
}
}
}
}
- if(pAudCapTmp) {
- if(FAILED(hr = pGB->AddFilter(pAudCapTmp, CStringW(audfrname)))) {
+ if (pAudCapTmp) {
+ if (FAILED(hr = pGB->AddFilter(pAudCapTmp, CStringW(audfrname)))) {
throw _T("Can't add audio capture filter to the graph");
}
pAudCap = pAudCapTmp;
- if(FAILED(pCGB->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Audio, pAudCap, IID_IAMStreamConfig, (void **)&pAMASC))
+ if (FAILED(pCGB->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Audio, pAudCap, IID_IAMStreamConfig, (void **)&pAMASC))
&& FAILED(pCGB->FindInterface(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Audio, pAudCap, IID_IAMStreamConfig, (void **)&pAMASC))) {
TRACE(_T("Warning: No IAMStreamConfig interface for vidcap"));
}
@@ -10699,22 +10718,22 @@ void CMainFrame::OpenCapture(OpenDeviceData* pODD) BeginEnumPins(pAudCap, pEP, pPin)
{
PIN_DIRECTION dir;
- if(FAILED(pPin->QueryDirection(&dir)) || dir != PINDIR_INPUT)
+ if (FAILED(pPin->QueryDirection(&dir)) || dir != PINDIR_INPUT)
continue;
- if(CComQIPtr<IAMAudioInputMixer> pAIM = pPin)
+ if (CComQIPtr<IAMAudioInputMixer> pAIM = pPin)
pAMAIM.Add(pAIM);
}
EndEnumPins;
- if(pAMASC)
+ if (pAMASC)
{
m_wndCaptureBar.m_capdlg.SetupAudioControls(auddispname, pAMASC, pAMAIM);
}
*/
}
- if(!(pVidCap || pAudCap)) {
+ if (!(pVidCap || pAudCap)) {
throw ResStr(IDS_MAINFRM_108);
}
@@ -10725,14 +10744,14 @@ void CMainFrame::OpenCapture(OpenDeviceData* pODD) void CMainFrame::OpenCustomizeGraph()
{
- if(GetPlaybackMode() == PM_CAPTURE) {
+ if (GetPlaybackMode() == PM_CAPTURE) {
return;
}
CleanGraph();
- if(GetPlaybackMode() == PM_FILE) {
- if(m_pCAP && AfxGetAppSettings().fAutoloadSubtitles) {
+ if (GetPlaybackMode() == PM_FILE) {
+ if (m_pCAP && AfxGetAppSettings().fAutoloadSubtitles) {
AddTextPassThruFilter();
}
}
@@ -10762,14 +10781,14 @@ void CMainFrame::OpenCustomizeGraph() }
}
- if(GetPlaybackMode() == PM_DVD) {
+ if (GetPlaybackMode() == PM_DVD) {
BeginEnumFilters(pGB, pEF, pBF) {
- if(CComQIPtr<IDirectVobSub2> pDVS2 = pBF) {
+ if (CComQIPtr<IDirectVobSub2> pDVS2 = pBF) {
// pDVS2->AdviseSubClock(m_pSubClock = DNew CSubClock);
// break;
// TODO: test multiple dvobsub instances with one clock
- if(!m_pSubClock) {
+ if (!m_pSubClock) {
m_pSubClock = DNew CSubClock;
}
pDVS2->AdviseSubClock(m_pSubClock);
@@ -10779,49 +10798,49 @@ void CMainFrame::OpenCustomizeGraph() }
BeginEnumFilters(pGB, pEF, pBF) {
- if(GetCLSID(pBF) == CLSID_OggSplitter) {
- if(CComQIPtr<IAMStreamSelect> pSS = pBF) {
+ if (GetCLSID(pBF) == CLSID_OggSplitter) {
+ if (CComQIPtr<IAMStreamSelect> pSS = pBF) {
LCID idAudio = s.idAudioLang;
- if(!idAudio) {
+ if (!idAudio) {
idAudio = GetUserDefaultLCID();
}
LCID idSub = s.idSubtitlesLang;
- if(!idSub) {
+ if (!idSub) {
idSub = GetUserDefaultLCID();
}
DWORD cnt = 0;
pSS->Count(&cnt);
- for(DWORD i = 0; i < cnt; i++) {
+ for (DWORD i = 0; i < cnt; i++) {
AM_MEDIA_TYPE* pmt = NULL;
DWORD dwFlags = 0;
LCID lcid = 0;
DWORD dwGroup = 0;
WCHAR* pszName = NULL;
- if(SUCCEEDED(pSS->Info((long)i, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) {
+ if (SUCCEEDED(pSS->Info((long)i, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) {
CStringW name(pszName), sound(ResStr(IDS_AG_SOUND)), subtitle(L"Subtitle");
- if(idAudio != (LCID)-1 && (idAudio&0x3ff) == (lcid&0x3ff) // sublang seems to be zeroed out in ogm...
+ if (idAudio != (LCID)-1 && (idAudio&0x3ff) == (lcid&0x3ff) // sublang seems to be zeroed out in ogm...
&& name.GetLength() > sound.GetLength()
&& !name.Left(sound.GetLength()).CompareNoCase(sound)) {
- if(SUCCEEDED(pSS->Enable(i, AMSTREAMSELECTENABLE_ENABLE))) {
+ if (SUCCEEDED(pSS->Enable(i, AMSTREAMSELECTENABLE_ENABLE))) {
idAudio = (LCID)-1;
}
}
- if(idSub != (LCID)-1 && (idSub&0x3ff) == (lcid&0x3ff) // sublang seems to be zeroed out in ogm...
+ if (idSub != (LCID)-1 && (idSub&0x3ff) == (lcid&0x3ff) // sublang seems to be zeroed out in ogm...
&& name.GetLength() > subtitle.GetLength()
&& !name.Left(subtitle.GetLength()).CompareNoCase(subtitle)
&& name.Mid(subtitle.GetLength()).Trim().CompareNoCase(L"off")) {
- if(SUCCEEDED(pSS->Enable(i, AMSTREAMSELECTENABLE_ENABLE))) {
+ if (SUCCEEDED(pSS->Enable(i, AMSTREAMSELECTENABLE_ENABLE))) {
idSub = (LCID)-1;
}
}
- if(pmt) {
+ if (pmt) {
DeleteMediaType(pmt);
}
- if(pszName) {
+ if (pszName) {
CoTaskMemFree(pszName);
}
}
@@ -10840,29 +10859,29 @@ void CMainFrame::OpenSetupVideo() if (m_pMFVDC) { // EVR
m_fAudioOnly = false;
- } else if(m_pCAP) {
+ } else if (m_pCAP) {
CSize vs = m_pCAP->GetVideoSize();
m_fAudioOnly = (vs.cx <= 0 || vs.cy <= 0);
} else {
{
long w = 0, h = 0;
- if(CComQIPtr<IBasicVideo> pBV = pGB) {
+ if (CComQIPtr<IBasicVideo> pBV = pGB) {
pBV->GetVideoSize(&w, &h);
}
- if(w > 0 && h > 0) {
+ if (w > 0 && h > 0) {
m_fAudioOnly = false;
}
}
- if(m_fAudioOnly) {
+ if (m_fAudioOnly) {
BeginEnumFilters(pGB, pEF, pBF) {
long w = 0, h = 0;
- if(CComQIPtr<IVideoWindow> pVW = pBF) {
+ if (CComQIPtr<IVideoWindow> pVW = pBF) {
long lVisible;
- if(FAILED(pVW->get_Visible(&lVisible))) {
+ if (FAILED(pVW->get_Visible(&lVisible))) {
continue;
}
@@ -10870,7 +10889,7 @@ void CMainFrame::OpenSetupVideo() pVW->get_Height(&h);
}
- if(w > 0 && h > 0) {
+ if (w > 0 && h > 0) {
m_fAudioOnly = false;
break;
}
@@ -10879,11 +10898,11 @@ void CMainFrame::OpenSetupVideo() }
}
- if(m_fShockwaveGraph) {
+ if (m_fShockwaveGraph) {
m_fAudioOnly = false;
}
- if(m_pCAP) {
+ if (m_pCAP) {
SetShaders();
}
// else
@@ -10894,7 +10913,7 @@ void CMainFrame::OpenSetupVideo() pVW->put_WindowStyle(WS_CHILD|WS_CLIPSIBLINGS|WS_CLIPCHILDREN);
pVW->put_MessageDrain((OAHWND)m_hWnd);
- for(CWnd* pWnd = m_wndView.GetWindow(GW_CHILD); pWnd; pWnd = pWnd->GetNextWindow()) {
+ for (CWnd* pWnd = m_wndView.GetWindow(GW_CHILD); pWnd; pWnd = pWnd->GetNextWindow()) {
pWnd->EnableWindow(FALSE); // little trick to let WM_SETCURSOR thru
}
}
@@ -10912,10 +10931,11 @@ void CMainFrame::OpenSetupAudio() int balance = AfxGetAppSettings().nBalance;
int sign = balance>0?-1:1; // -1: invert sign for more right channel
- if (balance > -100 && balance < 100)
+ if (balance > -100 && balance < 100) {
balance = sign*(int)(100*20*log10(1-abs(balance)/100.0f));
- else
- balance = sign*(-10000);// -10000: only left, 10000: only right
+ } else {
+ balance = sign*(-10000); // -10000: only left, 10000: only right
+ }
pBA->put_Balance(balance);
}
@@ -10928,22 +10948,22 @@ void CMainFrame::OpenSetupToolBar() */
void CMainFrame::OpenSetupCaptureBar()
{
- if(GetPlaybackMode() == PM_CAPTURE) {
- if(pVidCap && pAMVSCCap) {
+ if (GetPlaybackMode() == PM_CAPTURE) {
+ if (pVidCap && pAMVSCCap) {
CComQIPtr<IAMVfwCaptureDialogs> pVfwCD = pVidCap;
- if(!pAMXBar && pVfwCD) {
+ if (!pAMXBar && pVfwCD) {
m_wndCaptureBar.m_capdlg.SetupVideoControls(m_VidDispName, pAMVSCCap, pVfwCD);
} else {
m_wndCaptureBar.m_capdlg.SetupVideoControls(m_VidDispName, pAMVSCCap, pAMXBar, pAMTuner);
}
}
- if(pAudCap && pAMASC) {
+ if (pAudCap && pAMASC) {
CInterfaceArray<IAMAudioInputMixer> pAMAIM;
BeginEnumPins(pAudCap, pEP, pPin) {
- if(CComQIPtr<IAMAudioInputMixer> pAIM = pPin) {
+ if (CComQIPtr<IAMAudioInputMixer> pAIM = pPin) {
pAMAIM.Add(pAIM);
}
}
@@ -10960,54 +10980,54 @@ void CMainFrame::OpenSetupCaptureBar() void CMainFrame::OpenSetupInfoBar()
{
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
bool fEmpty = true;
BeginEnumFilters(pGB, pEF, pBF) {
- if(CComQIPtr<IAMMediaContent, &IID_IAMMediaContent> pAMMC = pBF) {
+ if (CComQIPtr<IAMMediaContent, &IID_IAMMediaContent> pAMMC = pBF) {
CComBSTR bstr;
- if(SUCCEEDED(pAMMC->get_Title(&bstr))) {
+ if (SUCCEEDED(pAMMC->get_Title(&bstr))) {
m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_TITLE), bstr.m_str);
- if(bstr.Length()) {
+ if (bstr.Length()) {
fEmpty = false;
}
}
bstr.Empty();
- if(SUCCEEDED(pAMMC->get_AuthorName(&bstr))) {
+ if (SUCCEEDED(pAMMC->get_AuthorName(&bstr))) {
m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_AUTHOR), bstr.m_str);
- if(bstr.Length()) {
+ if (bstr.Length()) {
fEmpty = false;
}
}
bstr.Empty();
- if(SUCCEEDED(pAMMC->get_Copyright(&bstr))) {
+ if (SUCCEEDED(pAMMC->get_Copyright(&bstr))) {
m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_COPYRIGHT), bstr.m_str);
- if(bstr.Length()) {
+ if (bstr.Length()) {
fEmpty = false;
}
}
bstr.Empty();
- if(SUCCEEDED(pAMMC->get_Rating(&bstr))) {
+ if (SUCCEEDED(pAMMC->get_Rating(&bstr))) {
m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_RATING), bstr.m_str);
- if(bstr.Length()) {
+ if (bstr.Length()) {
fEmpty = false;
}
}
bstr.Empty();
- if(SUCCEEDED(pAMMC->get_Description(&bstr))) {
+ if (SUCCEEDED(pAMMC->get_Description(&bstr))) {
m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_DESCRIPTION), bstr.m_str);
- if(bstr.Length()) {
+ if (bstr.Length()) {
fEmpty = false;
}
}
bstr.Empty();
- if(!fEmpty) {
+ if (!fEmpty) {
RecalcLayout();
break;
}
}
}
EndEnumFilters;
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
CString info('-');
m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_DOMAIN), info);
m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_LOCATION), info);
@@ -11023,7 +11043,7 @@ void CMainFrame::OpenSetupStatsBar() CString info('-');
BeginEnumFilters(pGB, pEF, pBF) {
- if(!pQP && (pQP = pBF)) {
+ if (!pQP && (pQP = pBF)) {
m_wndStatsBar.SetLine(ResStr(IDS_AG_FRAMERATE), info);
m_wndStatsBar.SetLine(_T("Sync Offset"), info);
m_wndStatsBar.SetLine(ResStr(IDS_AG_FRAMES), info);
@@ -11033,7 +11053,7 @@ void CMainFrame::OpenSetupStatsBar() RecalcLayout();
}
- if(!pBI && (pBI = pBF)) {
+ if (!pBI && (pBI = pBF)) {
m_wndStatsBar.SetLine(ResStr(IDS_AG_BUFFERS), info);
m_wndStatsBar.SetLine(_T("Bitrate"), info); // FIXME: shouldn't be here
RecalcLayout();
@@ -11048,24 +11068,24 @@ void CMainFrame::OpenSetupStatusBar() //
- if(!m_fCustomGraph) {
+ if (!m_fCustomGraph) {
UINT id = IDB_NOAUDIO;
BeginEnumFilters(pGB, pEF, pBF) {
CComQIPtr<IBasicAudio> pBA = pBF;
- if(!pBA) {
+ if (!pBA) {
continue;
}
BeginEnumPins(pBF, pEP, pPin) {
- if(S_OK == pGB->IsPinDirection(pPin, PINDIR_INPUT)
+ if (S_OK == pGB->IsPinDirection(pPin, PINDIR_INPUT)
&& S_OK == pGB->IsPinConnected(pPin)) {
AM_MEDIA_TYPE mt;
memset(&mt, 0, sizeof(mt));
pPin->ConnectionMediaType(&mt);
- if(mt.majortype == MEDIATYPE_Audio && mt.formattype == FORMAT_WaveFormatEx) {
- switch(((WAVEFORMATEX*)mt.pbFormat)->nChannels) {
+ if (mt.majortype == MEDIATYPE_Audio && mt.formattype == FORMAT_WaveFormatEx) {
+ switch (((WAVEFORMATEX*)mt.pbFormat)->nChannels) {
case 1:
id = IDB_MONO;
break;
@@ -11075,7 +11095,7 @@ void CMainFrame::OpenSetupStatusBar() break;
}
break;
- } else if(mt.majortype == MEDIATYPE_Midi) {
+ } else if (mt.majortype == MEDIATYPE_Midi) {
id = NULL;
break;
}
@@ -11083,7 +11103,7 @@ void CMainFrame::OpenSetupStatusBar() }
EndEnumPins;
- if(id != IDB_NOAUDIO) {
+ if (id != IDB_NOAUDIO) {
break;
}
}
@@ -11096,13 +11116,13 @@ void CMainFrame::OpenSetupStatusBar() HICON hIcon = NULL;
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
CString fn = m_wndPlaylistBar.GetCurFileName();
CString ext = fn.Mid(fn.ReverseFind('.')+1);
hIcon = LoadIcon(ext, true);
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
hIcon = LoadIcon(_T(".ifo"), true);
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
// hIcon = ; // TODO
}
@@ -11117,19 +11137,19 @@ void CMainFrame::OpenSetupWindowTitle(CString fn) int i = s.iTitleBarTextStyle;
- if(!fn.IsEmpty() && (i == 0 || i == 1)) {
- if(i == 1) {
- if(GetPlaybackMode() == PM_FILE) {
+ if (!fn.IsEmpty() && (i == 0 || i == 1)) {
+ if (i == 1) {
+ if (GetPlaybackMode() == PM_FILE) {
fn.Replace('\\', '/');
CString fn2 = fn.Mid(fn.ReverseFind('/')+1);
- if(!fn2.IsEmpty()) {
+ if (!fn2.IsEmpty()) {
fn = fn2;
}
- if(s.fTitleBarTextTitle) {
+ if (s.fTitleBarTextTitle) {
BeginEnumFilters(pGB, pEF, pBF) {
- if(CComQIPtr<IAMMediaContent, &IID_IAMMediaContent> pAMMC = pBF) {
+ if (CComQIPtr<IAMMediaContent, &IID_IAMMediaContent> pAMMC = pBF) {
CComBSTR bstr;
- if(SUCCEEDED(pAMMC->get_Title(&bstr)) && bstr.Length()) {
+ if (SUCCEEDED(pAMMC->get_Title(&bstr)) && bstr.Length()) {
fn = CString(bstr.m_str);
break;
}
@@ -11137,9 +11157,9 @@ void CMainFrame::OpenSetupWindowTitle(CString fn) }
EndEnumFilters;
}
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
fn = _T("DVD");
- } else if(GetPlaybackMode() == PM_CAPTURE) {
+ } else if (GetPlaybackMode() == PM_CAPTURE) {
fn = _T("Live");
}
}
@@ -11155,13 +11175,13 @@ void CMainFrame::OpenSetupWindowTitle(CString fn) bool DoesAudioPrecede(const CComPtr<IAMStreamSelect> &pSS, int a, int b)
{
WCHAR* pName = NULL;
- if(FAILED(pSS->Info(a, NULL, NULL, NULL, NULL, &pName, NULL, NULL))) {
+ if (FAILED(pSS->Info(a, NULL, NULL, NULL, NULL, &pName, NULL, NULL))) {
return false;
}
CString nameA(pName);
CoTaskMemFree(pName);
- if(FAILED(pSS->Info(b, NULL, NULL, NULL, NULL, &pName, NULL, NULL))) {
+ if (FAILED(pSS->Info(b, NULL, NULL, NULL, NULL, &pName, NULL, NULL))) {
return false;
}
CString nameB(pName);
@@ -11172,17 +11192,17 @@ bool DoesAudioPrecede(const CComPtr<IAMStreamSelect> &pSS, int a, int b) CStringW alo = AfxGetAppSettings().strAudiosLanguageOrder;
int tPos = 0;
CStringW lang = alo.Tokenize(_T(",; "), tPos);
- while(tPos != -1 && ia == -1 && ib == -1) {
+ while (tPos != -1 && ia == -1 && ib == -1) {
int ll = lang.GetLength();
- if(nameA.Left(ll).CompareNoCase(lang) == 0) {
+ if (nameA.Left(ll).CompareNoCase(lang) == 0) {
ia = tPos;
}
- if(nameB.Left(ll).CompareNoCase(lang) == 0) {
+ if (nameB.Left(ll).CompareNoCase(lang) == 0) {
ib = tPos;
}
lang = alo.Tokenize(_T(",; "), tPos);
}
- if(ia != -1 && ib == -1) {
+ if (ia != -1 && ib == -1) {
return true;
}
return false;
@@ -11194,11 +11214,11 @@ void CMainFrame::InsertAudioStream(const CComQIPtr<IAMStreamSelect> &pSS, int i) {
POSITION pos = m_iAudioStreams.GetHeadPosition();
bool processed = false;
- while(!processed && pos) {
+ while (!processed && pos) {
POSITION prevPos = pos;
int j = m_iAudioStreams.GetNext(pos);
- if(DoesAudioPrecede(pSS, i, j)) {
- if(prevPos == m_iAudioStreams.GetHeadPosition()) {
+ if (DoesAudioPrecede(pSS, i, j)) {
+ if (prevPos == m_iAudioStreams.GetHeadPosition()) {
m_iAudioStreams.AddHead(i);
} else {
m_iAudioStreams.InsertBefore(prevPos, i);
@@ -11206,7 +11226,7 @@ void CMainFrame::InsertAudioStream(const CComQIPtr<IAMStreamSelect> &pSS, int i) processed = true;
}
}
- if(!processed) {
+ if (!processed) {
m_iAudioStreams.AddTail(i);
}
}
@@ -11214,20 +11234,20 @@ void CMainFrame::InsertAudioStream(const CComQIPtr<IAMStreamSelect> &pSS, int i) // foxX: creates a mapping of audio streams, where they're ordered based on their language and the user language order options
void CMainFrame::SetupAudioStreams()
{
- if(m_iMediaLoadState != MLS_LOADED) {
+ if (m_iMediaLoadState != MLS_LOADED) {
return;
}
m_iAudioStreams.RemoveAll();
CComQIPtr<IAMStreamSelect> pSS = FindFilter(__uuidof(CAudioSwitcherFilter), pGB);
- if(!pSS) {
+ if (!pSS) {
pSS = FindFilter(L"{D3CD7858-971A-4838-ACEC-40CA5D529DC8}", pGB); // morgan's switcher
}
DWORD cStreams = 0;
- if(pSS && SUCCEEDED(pSS->Count(&cStreams)) && cStreams > 0) {
- for(int i = 0; i < (int)cStreams; i++) {
+ if (pSS && SUCCEEDED(pSS->Count(&cStreams)) && cStreams > 0) {
+ for (int i = 0; i < (int)cStreams; i++) {
InsertAudioStream(pSS, i);
}
}
@@ -11237,7 +11257,7 @@ bool CMainFrame::OpenMediaPrivate(CAutoPtr<OpenMediaData> pOMD) {
AppSettings& s = AfxGetAppSettings();
- if(m_iMediaLoadState != MLS_CLOSED) {
+ if (m_iMediaLoadState != MLS_CLOSED) {
ASSERT(0);
return(false);
}
@@ -11245,7 +11265,7 @@ bool CMainFrame::OpenMediaPrivate(CAutoPtr<OpenMediaData> pOMD) OpenFileData *pFileData = dynamic_cast<OpenFileData *>(pOMD.m_p);
OpenDVDData* pDVDData = dynamic_cast<OpenDVDData*>(pOMD.m_p);
OpenDeviceData* pDeviceData = dynamic_cast<OpenDeviceData*>(pOMD.m_p);
- if(!pFileData && !pDVDData && !pDeviceData) {
+ if (!pFileData && !pDVDData && !pDeviceData) {
ASSERT(0);
return(false);
}
@@ -11266,24 +11286,24 @@ bool CMainFrame::OpenMediaPrivate(CAutoPtr<OpenMediaData> pOMD) // Debug trace code - End
#endif
- if(pFileData) {
- if(pFileData->fns.IsEmpty()) {
+ if (pFileData) {
+ if (pFileData->fns.IsEmpty()) {
return(false);
}
CString fn = pFileData->fns.GetHead();
int i = fn.Find(_T(":\\"));
- if(i > 0) {
+ if (i > 0) {
CString drive = fn.Left(i+2);
UINT type = GetDriveType(drive);
CAtlList<CString> sl;
- if(type == DRIVE_REMOVABLE || type == DRIVE_CDROM && GetCDROMType(drive[0], sl) != CDROM_Audio) {
+ if (type == DRIVE_REMOVABLE || type == DRIVE_CDROM && GetCDROMType(drive[0], sl) != CDROM_Audio) {
int ret = IDRETRY;
- while(ret == IDRETRY) {
+ while (ret == IDRETRY) {
WIN32_FIND_DATA findFileData;
HANDLE h = FindFirstFile(fn, &findFileData);
- if(h != INVALID_HANDLE_VALUE) {
+ if (h != INVALID_HANDLE_VALUE) {
FindClose(h);
ret = IDOK;
} else {
@@ -11293,7 +11313,7 @@ bool CMainFrame::OpenMediaPrivate(CAutoPtr<OpenMediaData> pOMD) }
}
- if(ret != IDOK) {
+ if (ret != IDOK) {
return(false);
}
}
@@ -11314,27 +11334,27 @@ bool CMainFrame::OpenMediaPrivate(CAutoPtr<OpenMediaData> pOMD) CComPtr<IVMRMixerBitmap9> pVMB;
CComPtr<IMFVideoMixerBitmap> pMFVMB;
CComPtr<IMadVRTextOsd> pMVTO;
- if(m_fOpeningAborted) {
+ if (m_fOpeningAborted) {
throw aborted;
}
OpenCreateGraphObject(pOMD);
- if(m_fOpeningAborted) {
+ if (m_fOpeningAborted) {
throw aborted;
}
SetupIViAudReg();
- if(m_fOpeningAborted) {
+ if (m_fOpeningAborted) {
throw aborted;
}
- if(pFileData) {
+ if (pFileData) {
OpenFile(pFileData);
- } else if(pDVDData) {
+ } else if (pDVDData) {
OpenDVD(pDVDData);
- } else if(pDeviceData) {
+ } else if (pDeviceData) {
if (s.iDefaultCaptureDevice == 1) {
HRESULT hr = OpenBDAGraph();
if FAILED(hr) {
@@ -11381,32 +11401,32 @@ bool CMainFrame::OpenMediaPrivate(CAutoPtr<OpenMediaData> pOMD) m_pMFVDC->SetVideoPosition(NULL, &Rect);
}
- if(m_fOpeningAborted) {
+ if (m_fOpeningAborted) {
throw aborted;
}
OpenCustomizeGraph();
- if(m_fOpeningAborted) {
+ if (m_fOpeningAborted) {
throw aborted;
}
OpenSetupVideo();
- if(m_fOpeningAborted) {
+ if (m_fOpeningAborted) {
throw aborted;
}
OpenSetupAudio();
- if(m_fOpeningAborted) {
+ if (m_fOpeningAborted) {
throw aborted;
}
- if(m_pCAP && (!m_fAudioOnly || m_fRealMediaGraph)) {
+ if (m_pCAP && (!m_fAudioOnly || m_fRealMediaGraph)) {
int nInternalSubCount = m_pSubStreams.GetCount();
- if(s.fDisableInternalSubtitles && nInternalSubCount > 0) {
+ if (s.fDisableInternalSubtitles && nInternalSubCount > 0) {
m_pSubStreams.RemoveAll(); // Needs to be replaced with code that checks for forced subtitles.
// Update the the internal subtitle count
@@ -11414,23 +11434,23 @@ bool CMainFrame::OpenMediaPrivate(CAutoPtr<OpenMediaData> pOMD) }
POSITION pos = pOMD->subs.GetHeadPosition();
- while(pos) {
+ while (pos) {
LoadSubtitle(pOMD->subs.GetNext(pos));
}
- if(AfxGetAppSettings().fEnableSubtitles && m_pSubStreams.GetCount() > 0) {
+ if (AfxGetAppSettings().fEnableSubtitles && m_pSubStreams.GetCount() > 0) {
CComPtr<ISubStream> pSub = m_pSubStreams.GetHead();
- if(s.fPrioritizeExternalSubtitles && m_pSubStreams.GetCount() > nInternalSubCount) {
+ if (s.fPrioritizeExternalSubtitles && m_pSubStreams.GetCount() > nInternalSubCount) {
int nCurrentSubIndex = -1;
POSITION pos = m_pSubStreams.GetHeadPosition();
- while(pos) {
+ while (pos) {
pSub = m_pSubStreams.GetNext(pos);
nCurrentSubIndex++;
- if(nCurrentSubIndex == nInternalSubCount) {
+ if (nCurrentSubIndex == nInternalSubCount) {
break;
}
}
@@ -11440,7 +11460,7 @@ bool CMainFrame::OpenMediaPrivate(CAutoPtr<OpenMediaData> pOMD) }
}
- if(m_fOpeningAborted) {
+ if (m_fOpeningAborted) {
throw aborted;
}
@@ -11450,17 +11470,17 @@ bool CMainFrame::OpenMediaPrivate(CAutoPtr<OpenMediaData> pOMD) m_wndEditListEditor.OpenFile(pOMD->title);
}
- if(pFileData) {
+ if (pFileData) {
m_OpenFile = true;
}
- if(::GetCurrentThreadId() == AfxGetApp()->m_nThreadID) {
+ if (::GetCurrentThreadId() == AfxGetApp()->m_nThreadID) {
OnFilePostOpenmedia();
} else {
PostMessage(WM_COMMAND, ID_FILE_POST_OPENMEDIA);
}
- while(m_iMediaLoadState != MLS_LOADED
+ while (m_iMediaLoadState != MLS_LOADED
&& m_iMediaLoadState != MLS_CLOSING // FIXME
) {
Sleep(50);
@@ -11472,27 +11492,27 @@ bool CMainFrame::OpenMediaPrivate(CAutoPtr<OpenMediaData> pOMD) PostMessage(WM_COMMAND, ID_PLAY_PAUSE);
- if(!(AfxGetAppSettings().nCLSwitches&CLSW_OPEN) && (AfxGetAppSettings().nLoops > 0)) {
+ if (!(AfxGetAppSettings().nCLSwitches&CLSW_OPEN) && (AfxGetAppSettings().nLoops > 0)) {
PostMessage(WM_COMMAND, ID_PLAY_PLAY);
}
// Casimir666 : audio selection should be done before running the graph to prevent an
// unnecessary seek when a file is opened (PostMessage ID_AUDIO_SUBITEM_START removed)
- if(m_iAudioStreams.GetCount() > 0) {
+ if (m_iAudioStreams.GetCount() > 0) {
OnPlayAudio (ID_AUDIO_SUBITEM_START + 1);
}
AfxGetAppSettings().nCLSwitches &= ~CLSW_OPEN;
- if(pFileData) {
- if(pFileData->rtStart > 0) {
+ if (pFileData) {
+ if (pFileData->rtStart > 0) {
PostMessage(WM_RESUMEFROMSTATE, (WPARAM)PM_FILE, (LPARAM)(pFileData->rtStart/10000)); // REFERENCE_TIME doesn't fit in LPARAM under a 32bit env.
}
- } else if(pDVDData) {
- if(pDVDData->pDvdState) {
+ } else if (pDVDData) {
+ if (pDVDData->pDvdState) {
PostMessage(WM_RESUMEFROMSTATE, (WPARAM)PM_DVD, (LPARAM)(CComPtr<IDvdState>(pDVDData->pDvdState).Detach())); // must be released by the called message handler
}
- } else if(pDeviceData) {
+ } else if (pDeviceData) {
m_wndCaptureBar.m_capdlg.SetVideoInput(pDeviceData->vinput);
m_wndCaptureBar.m_capdlg.SetVideoChannel(pDeviceData->vchannel);
m_wndCaptureBar.m_capdlg.SetAudioInput(pDeviceData->ainput);
@@ -11505,15 +11525,15 @@ bool CMainFrame::OpenMediaPrivate(CAutoPtr<OpenMediaData> pOMD) EndWaitCursor();
- if(!err.IsEmpty()) {
+ if (!err.IsEmpty()) {
CloseMediaPrivate();
m_closingmsg = err;
- if(err != aborted) {
- if(pFileData) {
+ if (err != aborted) {
+ if (pFileData) {
m_wndPlaylistBar.SetCurValid(false);
- if(m_wndPlaylistBar.GetCount() > 1) {
- if(flast_nID == ID_NAVIGATE_SKIPBACK) {
+ if (m_wndPlaylistBar.GetCount() > 1) {
+ if (flast_nID == ID_NAVIGATE_SKIPBACK) {
m_wndPlaylistBar.SetPrev();
} else {
m_wndPlaylistBar.SetNext();
@@ -11548,29 +11568,29 @@ bool CMainFrame::OpenMediaPrivate(CAutoPtr<OpenMediaData> pOMD) PostMessage(WM_KICKIDLE); // calls main thread to update things
CString m_strOSD = _T("");
- if(pFileData) {
+ if (pFileData) {
m_strOSD = m_wndPlaylistBar.GetCurFileName();
- if(m_strOSD != _T("")) {
+ if (m_strOSD != _T("")) {
m_strOSD.TrimRight('/');
m_strOSD.Replace('\\', '/');
m_strOSD = m_strOSD.Mid(m_strOSD.ReverseFind('/')+1);
} else {
m_strOSD = ResStr(ID_PLAY_PLAY);
int i = m_strOSD.Find(_T("\n"));
- if(i > 0) {
+ if (i > 0) {
m_strOSD.Delete(i, m_strOSD.GetLength()-i);
}
m_strOSD += _T(" BD");
}
- } else if(pDVDData) {
+ } else if (pDVDData) {
m_strOSD = ResStr(ID_PLAY_PLAY);
int i = m_strOSD.Find(_T("\n"));
- if(i > 0) {
+ if (i > 0) {
m_strOSD.Delete(i, m_strOSD.GetLength()-i);
}
m_strOSD += _T(" DVD");
}
- if(m_strOSD != _T("")) {
+ if (m_strOSD != _T("")) {
Sleep(500);
m_OSD.DisplayMessage(OSD_TOPLEFT, m_strOSD, 3000);
}
@@ -11598,8 +11618,8 @@ void CMainFrame::CloseMediaPrivate() m_pCB = NULL;
- // if(pVW) pVW->put_Visible(OAFALSE);
- // if(pVW) pVW->put_MessageDrain((OAHWND)NULL), pVW->put_Owner((OAHWND)NULL);
+ // if (pVW) pVW->put_Visible(OAFALSE);
+ // if (pVW) pVW->put_MessageDrain((OAHWND)NULL), pVW->put_Owner((OAHWND)NULL);
m_pCAP = NULL; // IMPORTANT: IVMRSurfaceAllocatorNotify/IVMRSurfaceAllocatorNotify9 has to be released before the VMR/VMR9, otherwise it will crash in Release()
m_pCAP2 = NULL;
@@ -11632,7 +11652,7 @@ void CMainFrame::CloseMediaPrivate() pBV.Release();
pBA.Release();
- if(pGB) {
+ if (pGB) {
pGB->RemoveFromROT();
pGB.Release();
}
@@ -11685,30 +11705,30 @@ int CMainFrame::SearchInDir(bool DirForward) CString mask = dir + _T("*.*");
WIN32_FIND_DATA fd;
HANDLE h = FindFirstFile(mask, &fd);
- if(h != INVALID_HANDLE_VALUE) {
+ if (h != INVALID_HANDLE_VALUE) {
do {
- if(fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {
+ if (fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {
continue;
}
CString fn = fd.cFileName;
CString ext = fn.Mid(fn.ReverseFind('.')).MakeLower();
CString path = dir + fd.cFileName;
- if(mf.FindExt(ext) && mf.GetCount() > 0) {
+ if (mf.FindExt(ext) && mf.GetCount() > 0) {
fileName f_name;
f_name.fn = path;
f_array.Add(f_name);
}
- } while(FindNextFile(h, &fd));
+ } while (FindNextFile(h, &fd));
FindClose(h);
}
- if(f_array.GetCount() == 1) {
+ if (f_array.GetCount() == 1) {
return true;
}
qsort(f_array.GetData(), f_array.GetCount(), sizeof(fileName), compare);
- for(int i = 0; i < f_array.GetCount(); i++) {
+ for (int i = 0; i < f_array.GetCount(); i++) {
sl.AddTail(f_array[i].fn);
}
@@ -11734,7 +11754,7 @@ int CMainFrame::SearchInDir(bool DirForward) void CMainFrame::DoTunerScan(TunerScanData* pTSD)
{
- if(GetPlaybackMode() == PM_CAPTURE) {
+ if (GetPlaybackMode() == PM_CAPTURE) {
CComQIPtr<IBDATuner> pTun = pGB;
if (pTun) {
BOOLEAN bPresent;
@@ -11747,7 +11767,7 @@ void CMainFrame::DoTunerScan(TunerScanData* pTSD) bool bSucceeded;
m_bStopTunerScan = false;
- for(ULONG ulFrequency = pTSD->FrequencyStart; ulFrequency <= pTSD->FrequencyStop; ulFrequency += pTSD->Bandwidth) {
+ for (ULONG ulFrequency = pTSD->FrequencyStart; ulFrequency <= pTSD->FrequencyStop; ulFrequency += pTSD->Bandwidth) {
bSucceeded = false;
for (int nOffsetPos = 0; nOffsetPos < nOffset && !bSucceeded; nOffsetPos++) {
pTun->SetFrequency (ulFrequency + lOffsets[nOffsetPos]);
@@ -11777,28 +11797,28 @@ void CMainFrame::DoTunerScan(TunerScanData* pTSD) void CMainFrame::SendNowPlayingToMSN()
{
- if(!AfxGetAppSettings().fNotifyMSN) {
+ if (!AfxGetAppSettings().fNotifyMSN) {
return;
}
CString title, author;
- if(m_iMediaLoadState == MLS_LOADED) {
+ if (m_iMediaLoadState == MLS_LOADED) {
m_wndInfoBar.GetLine(ResStr(IDS_INFOBAR_TITLE), title);
m_wndInfoBar.GetLine(ResStr(IDS_INFOBAR_AUTHOR), author);
- if(title.IsEmpty()) {
+ if (title.IsEmpty()) {
CPlaylistItem pli;
m_wndPlaylistBar.GetCur(pli);
- if(!pli.m_fns.IsEmpty()) {
+ if (!pli.m_fns.IsEmpty()) {
CString label = !pli.m_label.IsEmpty() ? pli.m_label : pli.m_fns.GetHead();
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
CString fn = label;
- if(fn.Find(_T("://")) >= 0) {
+ if (fn.Find(_T("://")) >= 0) {
int i = fn.Find('?');
- if(i >= 0) {
+ if (i >= 0) {
fn = fn.Left(i);
}
}
@@ -11808,10 +11828,10 @@ void CMainFrame::SendNowPlayingToMSN() path.RemoveExtension();
title = (LPCTSTR)path;
author.Empty();
- } else if(GetPlaybackMode() == PM_CAPTURE) {
+ } else if (GetPlaybackMode() == PM_CAPTURE) {
title = label != pli.m_fns.GetHead() ? label : _T("Live");
author.Empty();
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
title = _T("DVD");
author.Empty();
}
@@ -11825,7 +11845,7 @@ void CMainFrame::SendNowPlayingToMSN() buff += L"\\0";
buff += author.IsEmpty() ? L"{0}" : L"{0} - {1}";
buff += L"\\0";
- if(!author.IsEmpty()) {
+ if (!author.IsEmpty()) {
buff += CStringW(author) + L"\\0";
}
buff += CStringW(title) + L"\\0";
@@ -11837,7 +11857,7 @@ void CMainFrame::SendNowPlayingToMSN() data.cbData = buff.GetLength() * 2 + 2;
HWND hWnd = ::FindWindowEx(NULL, NULL, _T("MsnMsgrUIManager"), NULL);
- while(hWnd) {
+ while (hWnd) {
::SendMessage(hWnd, WM_COPYDATA, (WPARAM)NULL, (LPARAM)&data);
hWnd = ::FindWindowEx(NULL, hWnd, _T("MsnMsgrUIManager"), NULL);
}
@@ -11847,27 +11867,27 @@ void CMainFrame::SendNowPlayingToMSN() void CMainFrame::SendNowPlayingTomIRC()
{
- if(!AfxGetAppSettings().fNotifyGTSdll) {
+ if (!AfxGetAppSettings().fNotifyGTSdll) {
return;
}
- for(int i = 0; i < 20; i++) {
+ for (int i = 0; i < 20; i++) {
HANDLE hFMap = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 1024, _T("mIRC"));
- if(!hFMap) {
+ if (!hFMap) {
return;
}
- if(GetLastError() == ERROR_ALREADY_EXISTS) {
+ if (GetLastError() == ERROR_ALREADY_EXISTS) {
CloseHandle(hFMap);
Sleep(50);
continue;
}
- if(LPVOID lpMappingAddress = MapViewOfFile(hFMap, FILE_MAP_WRITE, 0, 0, 0)) {
+ if (LPVOID lpMappingAddress = MapViewOfFile(hFMap, FILE_MAP_WRITE, 0, 0, 0)) {
LPCSTR cmd = m_fAudioOnly ? "/.timerAUDGTS 1 5 mpcaud" : "/.timerVIDGTS 1 5 mpcvid";
strcpy((char*)lpMappingAddress, cmd);
- if(HWND hWnd = ::FindWindow(_T("mIRC"), NULL)) {
+ if (HWND hWnd = ::FindWindow(_T("mIRC"), NULL)) {
::SendMessage(hWnd, (WM_USER + 200), (WPARAM)1, (LPARAM)0);
}
@@ -11886,41 +11906,41 @@ void CMainFrame::SetupOpenCDSubMenu() {
CMenu* pSub = &m_opencds;
- if(!IsMenu(pSub->m_hMenu)) {
+ if (!IsMenu(pSub->m_hMenu)) {
pSub->CreatePopupMenu();
- } else while(pSub->RemoveMenu(0, MF_BYPOSITION)) {
+ } else while (pSub->RemoveMenu(0, MF_BYPOSITION)) {
;
}
- if(m_iMediaLoadState == MLS_LOADING) {
+ if (m_iMediaLoadState == MLS_LOADING) {
return;
}
- if(AfxGetAppSettings().fHideCDROMsSubMenu) {
+ if (AfxGetAppSettings().fHideCDROMsSubMenu) {
return;
}
UINT id = ID_FILE_OPEN_CD_START;
- for(TCHAR drive = 'C'; drive <= 'Z'; drive++) {
+ for (TCHAR drive = 'C'; drive <= 'Z'; drive++) {
CString label = GetDriveLabel(drive), str;
CAtlList<CString> files;
- switch(GetCDROMType(drive, files)) {
+ switch (GetCDROMType(drive, files)) {
case CDROM_Audio:
- if(label.IsEmpty()) {
+ if (label.IsEmpty()) {
label = _T("Audio CD");
}
str.Format(_T("%s (%c:)"), label, drive);
break;
case CDROM_VideoCD:
- if(label.IsEmpty()) {
+ if (label.IsEmpty()) {
label = _T("(S)VCD");
}
str.Format(_T("%s (%c:)"), label, drive);
break;
case CDROM_DVDVideo:
- if(label.IsEmpty()) {
+ if (label.IsEmpty()) {
label = _T("DVD Video");
}
str.Format(_T("%s (%c:)"), label, drive);
@@ -11929,7 +11949,7 @@ void CMainFrame::SetupOpenCDSubMenu() break;
}
- if(!str.IsEmpty()) {
+ if (!str.IsEmpty()) {
pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, id++, str);
}
}
@@ -11939,9 +11959,9 @@ void CMainFrame::SetupFiltersSubMenu() {
CMenu* pSub = &m_filters;
- if(!IsMenu(pSub->m_hMenu)) {
+ if (!IsMenu(pSub->m_hMenu)) {
pSub->CreatePopupMenu();
- } else while(pSub->RemoveMenu(0, MF_BYPOSITION)) {
+ } else while (pSub->RemoveMenu(0, MF_BYPOSITION)) {
;
}
@@ -11950,24 +11970,24 @@ void CMainFrame::SetupFiltersSubMenu() m_pparray.RemoveAll();
m_ssarray.RemoveAll();
- if(m_iMediaLoadState == MLS_LOADED) {
+ if (m_iMediaLoadState == MLS_LOADED) {
UINT idf = 0;
UINT ids = ID_FILTERS_SUBITEM_START;
UINT idl = ID_FILTERSTREAMS_SUBITEM_START;
BeginEnumFilters(pGB, pEF, pBF) {
CString name(GetFilterName(pBF));
- if(name.GetLength() >= 43) {
+ if (name.GetLength() >= 43) {
name = name.Left(40) + _T("...");
}
CLSID clsid = GetCLSID(pBF);
- if(clsid == CLSID_AVIDec) {
+ if (clsid == CLSID_AVIDec) {
CComPtr<IPin> pPin = GetFirstPin(pBF);
AM_MEDIA_TYPE mt;
- if(pPin && SUCCEEDED(pPin->ConnectionMediaType(&mt))) {
+ if (pPin && SUCCEEDED(pPin->ConnectionMediaType(&mt))) {
DWORD c = ((VIDEOINFOHEADER*)mt.pbFormat)->bmiHeader.biCompression;
- switch(c) {
+ switch (c) {
case BI_RGB:
name += _T(" (RGB)");
break;
@@ -11986,14 +12006,14 @@ void CMainFrame::SetupFiltersSubMenu() break;
}
}
- } else if(clsid == CLSID_ACMWrapper) {
+ } else if (clsid == CLSID_ACMWrapper) {
CComPtr<IPin> pPin = GetFirstPin(pBF);
AM_MEDIA_TYPE mt;
- if(pPin && SUCCEEDED(pPin->ConnectionMediaType(&mt))) {
+ if (pPin && SUCCEEDED(pPin->ConnectionMediaType(&mt))) {
WORD c = ((WAVEFORMATEX*)mt.pbFormat)->wFormatTag;
name.Format(_T("%s (0x%04x)"), CString(name), (int)c);
}
- } else if(clsid == __uuidof(CTextPassThruFilter) || clsid == __uuidof(CNullTextRenderer)
+ } else if (clsid == __uuidof(CTextPassThruFilter) || clsid == __uuidof(CNullTextRenderer)
|| clsid == GUIDFromCString(_T("{48025243-2D39-11CE-875D-00608CB78066}"))) { // ISCR
// hide these
continue;
@@ -12006,17 +12026,17 @@ void CMainFrame::SetupFiltersSubMenu() CComQIPtr<ISpecifyPropertyPages> pSPP = pBF;
- /* if(pSPP)
+ /* if (pSPP)
{
CAUUID caGUID;
caGUID.pElems = NULL;
- if(SUCCEEDED(pSPP->GetPages(&caGUID)) && caGUID.cElems > 0)
+ if (SUCCEEDED(pSPP->GetPages(&caGUID)) && caGUID.cElems > 0)
{
*/
m_pparray.Add(pBF);
pSubSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, ids, ResStr(IDS_MAINFRM_116));
/*
- if(caGUID.pElems) CoTaskMemFree(caGUID.pElems);
+ if (caGUID.pElems) CoTaskMemFree(caGUID.pElems);
*/
nPPages++;
/* }
@@ -12026,14 +12046,14 @@ void CMainFrame::SetupFiltersSubMenu() CString name = GetPinName(pPin);
name.Replace(_T("&"), _T("&&"));
- if(pSPP = pPin) {
+ if (pSPP = pPin) {
CAUUID caGUID;
caGUID.pElems = NULL;
- if(SUCCEEDED(pSPP->GetPages(&caGUID)) && caGUID.cElems > 0) {
+ if (SUCCEEDED(pSPP->GetPages(&caGUID)) && caGUID.cElems > 0) {
m_pparray.Add(pPin);
pSubSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, ids+nPPages, name + ResStr(IDS_MAINFRM_117));
- if(caGUID.pElems) {
+ if (caGUID.pElems) {
CoTaskMemFree(caGUID.pElems);
}
@@ -12044,7 +12064,7 @@ void CMainFrame::SetupFiltersSubMenu() EndEnumPins;
CComQIPtr<IAMStreamSelect> pSS = pBF;
- if(pSS) {
+ if (pSS) {
DWORD nStreams = 0;
DWORD flags = (DWORD)-1;
DWORD group = (DWORD)-1;
@@ -12055,29 +12075,29 @@ void CMainFrame::SetupFiltersSubMenu() pSS->Count(&nStreams);
- if(nStreams > 0 && nPPages > 0) {
+ if (nStreams > 0 && nPPages > 0) {
pSubSub->AppendMenu(MF_SEPARATOR|MF_ENABLED);
}
UINT idlstart = idl;
- for(DWORD i = 0; i < nStreams; i++, pObj = NULL, pUnk = NULL) {
+ for (DWORD i = 0; i < nStreams; i++, pObj = NULL, pUnk = NULL) {
m_ssarray.Add(pSS);
flags = group = 0;
wname = NULL;
pSS->Info(i, NULL, &flags, &lcid, &group, &wname, &pObj, &pUnk);
- if(group != prevgroup && idl > idlstart) {
+ if (group != prevgroup && idl > idlstart) {
pSubSub->AppendMenu(MF_SEPARATOR|MF_ENABLED);
}
prevgroup = group;
- if(flags & AMSTREAMSELECTINFO_EXCLUSIVE) {
- } else if(flags & AMSTREAMSELECTINFO_ENABLED) {
+ if (flags & AMSTREAMSELECTINFO_EXCLUSIVE) {
+ } else if (flags & AMSTREAMSELECTINFO_ENABLED) {
}
- if(!wname) {
+ if (!wname) {
CStringW stream(ResStr(IDS_AG_UNKNOWN_STREAM));
wname = (WCHAR*)CoTaskMemAlloc((stream.GetLength()+3+1)*sizeof(WCHAR));
swprintf(wname, L"%s %d", stream, min(i+1,999));
@@ -12091,17 +12111,17 @@ void CMainFrame::SetupFiltersSubMenu() CoTaskMemFree(wname);
}
- if(nStreams == 0) {
+ if (nStreams == 0) {
pSS.Release();
}
}
- if(nPPages == 1 && !pSS) {
+ if (nPPages == 1 && !pSS) {
pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, ids, name);
} else {
pSub->AppendMenu(MF_BYPOSITION|MF_STRING|MF_DISABLED|MF_GRAYED, idf, name);
- if(nPPages > 0 || pSS) {
+ if (nPPages > 0 || pSS) {
MENUITEMINFO mii;
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_STATE|MIIM_SUBMENU;
@@ -12125,31 +12145,31 @@ void CMainFrame::SetupAudioSwitcherSubMenu() {
CMenu* pSub = &m_audios;
- if(!IsMenu(pSub->m_hMenu)) {
+ if (!IsMenu(pSub->m_hMenu)) {
pSub->CreatePopupMenu();
- } else while(pSub->RemoveMenu(0, MF_BYPOSITION)) {
+ } else while (pSub->RemoveMenu(0, MF_BYPOSITION)) {
;
}
- if(m_iMediaLoadState == MLS_LOADED) {
+ if (m_iMediaLoadState == MLS_LOADED) {
UINT id = ID_AUDIO_SUBITEM_START;
CComQIPtr<IAMStreamSelect> pSS = FindFilter(__uuidof(CAudioSwitcherFilter), pGB);
- if(!pSS) {
+ if (!pSS) {
pSS = FindFilter(L"{D3CD7858-971A-4838-ACEC-40CA5D529DC8}", pGB);
}
- if(pSS) {
+ if (pSS) {
DWORD cStreams = 0;
- if(SUCCEEDED(pSS->Count(&cStreams)) && cStreams > 0) {
+ if (SUCCEEDED(pSS->Count(&cStreams)) && cStreams > 0) {
pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, id++, ResStr(IDS_SUBTITLES_OPTIONS));
pSub->AppendMenu(MF_SEPARATOR|MF_ENABLED);
- for(int i = 0; i < (int)cStreams; i++) {
+ for (int i = 0; i < (int)cStreams; i++) {
WCHAR* pName = NULL;
POSITION idx = m_iAudioStreams.FindIndex(i);
int iStream = m_iAudioStreams.GetAt(idx);
- if(FAILED(pSS->Info(iStream, NULL, NULL, NULL, NULL, &pName, NULL, NULL))) { // audio streams are reordered, so find the index from the initial order
+ if (FAILED(pSS->Info(iStream, NULL, NULL, NULL, NULL, &pName, NULL, NULL))) { // audio streams are reordered, so find the index from the initial order
break;
}
@@ -12169,13 +12189,13 @@ void CMainFrame::SetupSubtitlesSubMenu() {
CMenu* pSub = &m_subtitles;
- if(!IsMenu(pSub->m_hMenu)) {
+ if (!IsMenu(pSub->m_hMenu)) {
pSub->CreatePopupMenu();
- } else while(pSub->RemoveMenu(0, MF_BYPOSITION)) {
+ } else while (pSub->RemoveMenu(0, MF_BYPOSITION)) {
;
}
- if(m_iMediaLoadState != MLS_LOADED || m_fAudioOnly || !m_pCAP) {
+ if (m_iMediaLoadState != MLS_LOADED || m_fAudioOnly || !m_pCAP) {
return;
}
@@ -12183,7 +12203,7 @@ void CMainFrame::SetupSubtitlesSubMenu() POSITION pos = m_pSubStreams.GetHeadPosition();
- if(pos) {
+ if (pos) {
pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, id++, ResStr(IDS_SUBTITLES_OPTIONS));
pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, id++, ResStr(IDS_SUBTITLES_STYLES));
pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, id++, ResStr(IDS_SUBTITLES_RELOAD));
@@ -12194,15 +12214,15 @@ void CMainFrame::SetupSubtitlesSubMenu() pSub->AppendMenu(MF_SEPARATOR);
}
- while(pos) {
+ while (pos) {
CComPtr<ISubStream> pSubStream = m_pSubStreams.GetNext(pos);
- if(!pSubStream) {
+ if (!pSubStream) {
continue;
}
- for(int i = 0, j = pSubStream->GetStreamCount(); i < j; i++) {
+ for (int i = 0, j = pSubStream->GetStreamCount(); i < j; i++) {
WCHAR* pName = NULL;
- if(SUCCEEDED(pSubStream->GetStreamInfo(i, &pName, NULL))) {
+ if (SUCCEEDED(pSubStream->GetStreamInfo(i, &pName, NULL))) {
CString name(pName);
name.Replace(_T("&"), _T("&&"));
@@ -12214,12 +12234,12 @@ void CMainFrame::SetupSubtitlesSubMenu() }
// TODO: find a better way to group these entries
- if(pos && m_pSubStreams.GetAt(pos)) {
+ if (pos && m_pSubStreams.GetAt(pos)) {
CLSID cur, next;
pSubStream->GetClassID(&cur);
m_pSubStreams.GetAt(pos)->GetClassID(&next);
- if(cur != next) {
+ if (cur != next) {
pSub->AppendMenu(MF_SEPARATOR);
}
}
@@ -12230,55 +12250,55 @@ void CMainFrame::SetupNavAudioSubMenu() {
CMenu* pSub = &m_navaudio;
- if(!IsMenu(pSub->m_hMenu)) {
+ if (!IsMenu(pSub->m_hMenu)) {
pSub->CreatePopupMenu();
- } else while(pSub->RemoveMenu(0, MF_BYPOSITION)) {
+ } else while (pSub->RemoveMenu(0, MF_BYPOSITION)) {
;
}
- if(m_iMediaLoadState != MLS_LOADED) {
+ if (m_iMediaLoadState != MLS_LOADED) {
return;
}
UINT id = ID_NAVIGATE_AUDIO_SUBITEM_START;
- if(GetPlaybackMode() == PM_FILE || (GetPlaybackMode() == PM_CAPTURE && AfxGetAppSettings().iDefaultCaptureDevice == 1)) {
+ if (GetPlaybackMode() == PM_FILE || (GetPlaybackMode() == PM_CAPTURE && AfxGetAppSettings().iDefaultCaptureDevice == 1)) {
SetupNavStreamSelectSubMenu(pSub, id, 1);
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
ULONG ulStreamsAvailable, ulCurrentStream;
- if(FAILED(pDVDI->GetCurrentAudio(&ulStreamsAvailable, &ulCurrentStream))) {
+ if (FAILED(pDVDI->GetCurrentAudio(&ulStreamsAvailable, &ulCurrentStream))) {
return;
}
LCID DefLanguage;
DVD_AUDIO_LANG_EXT ext;
- if(FAILED(pDVDI->GetDefaultAudioLanguage(&DefLanguage, &ext))) {
+ if (FAILED(pDVDI->GetDefaultAudioLanguage(&DefLanguage, &ext))) {
return;
}
- for(ULONG i = 0; i < ulStreamsAvailable; i++) {
+ for (ULONG i = 0; i < ulStreamsAvailable; i++) {
LCID Language;
- if(FAILED(pDVDI->GetAudioLanguage(i, &Language))) {
+ if (FAILED(pDVDI->GetAudioLanguage(i, &Language))) {
continue;
}
UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED;
- if(Language == DefLanguage) {
+ if (Language == DefLanguage) {
flags |= MF_DEFAULT;
}
- if(i == ulCurrentStream) {
+ if (i == ulCurrentStream) {
flags |= MF_CHECKED;
}
CString str(ResStr(IDS_AG_UNKNOWN));
- if(Language) {
+ if (Language) {
int len = GetLocaleInfo(Language, LOCALE_SENGLANGUAGE, str.GetBuffer(256), 256);
str.ReleaseBufferSetLength(max(len-1, 0));
}
DVD_AudioAttributes ATR;
- if(SUCCEEDED(pDVDI->GetAudioAttributes(i, &ATR))) {
- switch(ATR.LanguageExtension) {
+ if (SUCCEEDED(pDVDI->GetAudioAttributes(i, &ATR))) {
+ switch (ATR.LanguageExtension) {
case DVD_AUD_EXT_NotSpecified:
default:
break;
@@ -12298,7 +12318,7 @@ void CMainFrame::SetupNavAudioSubMenu() CString format = GetDVDAudioFormatName(ATR);
- if(!format.IsEmpty()) {
+ if (!format.IsEmpty()) {
str.Format(ResStr(IDS_MAINFRM_11),
CString(str),
format,
@@ -12320,60 +12340,60 @@ void CMainFrame::SetupNavSubtitleSubMenu() {
CMenu* pSub = &m_navsubtitle;
- if(!IsMenu(pSub->m_hMenu)) {
+ if (!IsMenu(pSub->m_hMenu)) {
pSub->CreatePopupMenu();
- } else while(pSub->RemoveMenu(0, MF_BYPOSITION)) {
+ } else while (pSub->RemoveMenu(0, MF_BYPOSITION)) {
;
}
- if(m_iMediaLoadState != MLS_LOADED) {
+ if (m_iMediaLoadState != MLS_LOADED) {
return;
}
UINT id = ID_NAVIGATE_SUBP_SUBITEM_START;
- if(GetPlaybackMode() == PM_FILE || (GetPlaybackMode() == PM_CAPTURE && AfxGetAppSettings().iDefaultCaptureDevice == 1)) {
+ if (GetPlaybackMode() == PM_FILE || (GetPlaybackMode() == PM_CAPTURE && AfxGetAppSettings().iDefaultCaptureDevice == 1)) {
SetupNavStreamSelectSubMenu(pSub, id, 2);
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
ULONG ulStreamsAvailable, ulCurrentStream;
BOOL bIsDisabled;
- if(FAILED(pDVDI->GetCurrentSubpicture(&ulStreamsAvailable, &ulCurrentStream, &bIsDisabled))
+ if (FAILED(pDVDI->GetCurrentSubpicture(&ulStreamsAvailable, &ulCurrentStream, &bIsDisabled))
|| ulStreamsAvailable == 0) {
return;
}
LCID DefLanguage;
DVD_SUBPICTURE_LANG_EXT ext;
- if(FAILED(pDVDI->GetDefaultSubpictureLanguage(&DefLanguage, &ext))) {
+ if (FAILED(pDVDI->GetDefaultSubpictureLanguage(&DefLanguage, &ext))) {
return;
}
pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|(bIsDisabled?0:MF_CHECKED), id++, ResStr(IDS_AG_ENABLED));
pSub->AppendMenu(MF_BYCOMMAND|MF_SEPARATOR|MF_ENABLED);
- for(ULONG i = 0; i < ulStreamsAvailable; i++) {
+ for (ULONG i = 0; i < ulStreamsAvailable; i++) {
LCID Language;
- if(FAILED(pDVDI->GetSubpictureLanguage(i, &Language))) {
+ if (FAILED(pDVDI->GetSubpictureLanguage(i, &Language))) {
continue;
}
UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED;
- if(Language == DefLanguage) {
+ if (Language == DefLanguage) {
flags |= MF_DEFAULT;
}
- if(i == ulCurrentStream) {
+ if (i == ulCurrentStream) {
flags |= MF_CHECKED;
}
CString str(ResStr(IDS_AG_UNKNOWN));
- if(Language) {
+ if (Language) {
int len = GetLocaleInfo(Language, LOCALE_SENGLANGUAGE, str.GetBuffer(256), 256);
str.ReleaseBufferSetLength(max(len-1, 0));
}
DVD_SubpictureAttributes ATR;
- if(SUCCEEDED(pDVDI->GetSubpictureAttributes(i, &ATR))) {
- switch(ATR.LanguageExtension) {
+ if (SUCCEEDED(pDVDI->GetSubpictureAttributes(i, &ATR))) {
+ switch (ATR.LanguageExtension) {
case DVD_SP_EXT_NotSpecified:
default:
break;
@@ -12421,33 +12441,33 @@ void CMainFrame::SetupNavAngleSubMenu() {
CMenu* pSub = &m_navangle;
- if(!IsMenu(pSub->m_hMenu)) {
+ if (!IsMenu(pSub->m_hMenu)) {
pSub->CreatePopupMenu();
- } else while(pSub->RemoveMenu(0, MF_BYPOSITION)) {
+ } else while (pSub->RemoveMenu(0, MF_BYPOSITION)) {
;
}
- if(m_iMediaLoadState != MLS_LOADED) {
+ if (m_iMediaLoadState != MLS_LOADED) {
return;
}
UINT id = ID_NAVIGATE_ANGLE_SUBITEM_START;
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
SetupNavStreamSelectSubMenu(pSub, id, 0);
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
ULONG ulStreamsAvailable, ulCurrentStream;
- if(FAILED(pDVDI->GetCurrentAngle(&ulStreamsAvailable, &ulCurrentStream))) {
+ if (FAILED(pDVDI->GetCurrentAngle(&ulStreamsAvailable, &ulCurrentStream))) {
return;
}
- if(ulStreamsAvailable < 2) {
+ if (ulStreamsAvailable < 2) {
return; // one choice is not a choice...
}
- for(ULONG i = 1; i <= ulStreamsAvailable; i++) {
+ for (ULONG i = 1; i <= ulStreamsAvailable; i++) {
UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED;
- if(i == ulCurrentStream) {
+ if (i == ulCurrentStream) {
flags |= MF_CHECKED;
}
@@ -12463,28 +12483,28 @@ void CMainFrame::SetupNavChaptersSubMenu() {
CMenu* pSub = &m_navchapters;
- if(!IsMenu(pSub->m_hMenu)) {
+ if (!IsMenu(pSub->m_hMenu)) {
pSub->CreatePopupMenu();
- } else while(pSub->RemoveMenu(0, MF_BYPOSITION)) {
+ } else while (pSub->RemoveMenu(0, MF_BYPOSITION)) {
;
}
- if(m_iMediaLoadState != MLS_LOADED) {
+ if (m_iMediaLoadState != MLS_LOADED) {
return;
}
UINT id = ID_NAVIGATE_CHAP_SUBITEM_START;
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
SetupChapters();
REFERENCE_TIME rt = GetPos();
DWORD j = m_pCB->ChapLookup(&rt, NULL);
- for(DWORD i = 0; i < m_pCB->ChapGetCount(); i++, id++) {
+ for (DWORD i = 0; i < m_pCB->ChapGetCount(); i++, id++) {
rt = 0;
CComBSTR bstr;
- if(FAILED(m_pCB->ChapGet(i, &rt, &bstr))) {
+ if (FAILED(m_pCB->ChapGet(i, &rt, &bstr))) {
continue;
}
@@ -12500,23 +12520,23 @@ void CMainFrame::SetupNavChaptersSubMenu() name.Replace(_T("\t"), _T(" "));
UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED;
- if(i == j) {
+ if (i == j) {
flags |= MF_CHECKED;
}
- if(id != ID_NAVIGATE_CHAP_SUBITEM_START && i == 0) {
+ if (id != ID_NAVIGATE_CHAP_SUBITEM_START && i == 0) {
pSub->AppendMenu(MF_SEPARATOR);
}
pSub->AppendMenu(flags, id, name + '\t' + time);
}
- if(m_wndPlaylistBar.GetCount() > 1) {
+ if (m_wndPlaylistBar.GetCount() > 1) {
POSITION pos = m_wndPlaylistBar.m_pl.GetHeadPosition();
- while(pos) {
+ while (pos) {
UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED;
- if(pos == m_wndPlaylistBar.m_pl.GetPos()) {
+ if (pos == m_wndPlaylistBar.m_pl.GetPos()) {
flags |= MF_CHECKED;
}
- if(id != ID_NAVIGATE_CHAP_SUBITEM_START && pos == m_wndPlaylistBar.m_pl.GetHeadPosition()) {
+ if (id != ID_NAVIGATE_CHAP_SUBITEM_START && pos == m_wndPlaylistBar.m_pl.GetHeadPosition()) {
pSub->AppendMenu(MF_SEPARATOR);
}
CPlaylistItem& pli = m_wndPlaylistBar.m_pl.GetNext(pos);
@@ -12525,7 +12545,7 @@ void CMainFrame::SetupNavChaptersSubMenu() pSub->AppendMenu(flags, id++, name);
}
}
- } else if(GetPlaybackMode() == PM_DVD) {
+ } else if (GetPlaybackMode() == PM_DVD) {
ULONG ulNumOfVolumes, ulVolume;
DVD_DISC_SIDE Side;
ULONG ulNumOfTitles = 0;
@@ -12540,12 +12560,12 @@ void CMainFrame::SetupNavChaptersSubMenu() ULONG ulUOPs = 0;
pDVDI->GetCurrentUOPS(&ulUOPs);
- for(ULONG i = 1; i <= ulNumOfTitles; i++) {
+ for (ULONG i = 1; i <= ulNumOfTitles; i++) {
UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED;
- if(i == Location.TitleNum) {
+ if (i == Location.TitleNum) {
flags |= MF_CHECKED;
}
- if(ulUOPs&UOP_FLAG_Play_Title) {
+ if (ulUOPs&UOP_FLAG_Play_Title) {
flags |= MF_DISABLED|MF_GRAYED;
}
@@ -12555,15 +12575,15 @@ void CMainFrame::SetupNavChaptersSubMenu() pSub->AppendMenu(flags, id++, str);
}
- for(ULONG i = 1; i <= ulNumOfChapters; i++) {
+ for (ULONG i = 1; i <= ulNumOfChapters; i++) {
UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED;
- if(i == Location.ChapterNum) {
+ if (i == Location.ChapterNum) {
flags |= MF_CHECKED;
}
- if(ulUOPs&UOP_FLAG_Play_Chapter) {
+ if (ulUOPs&UOP_FLAG_Play_Chapter) {
flags |= MF_DISABLED|MF_GRAYED;
}
- if(i == 1) {
+ if (i == 1) {
flags |= MF_MENUBARBREAK;
}
@@ -12572,7 +12592,7 @@ void CMainFrame::SetupNavChaptersSubMenu() pSub->AppendMenu(flags, id++, str);
}
- } else if(GetPlaybackMode() == PM_CAPTURE && AfxGetAppSettings().iDefaultCaptureDevice == 1) {
+ } else if (GetPlaybackMode() == PM_CAPTURE && AfxGetAppSettings().iDefaultCaptureDevice == 1) {
AppSettings& s = AfxGetAppSettings();
POSITION pos = s.m_DVBChannels.GetHeadPosition();
@@ -12593,25 +12613,25 @@ IBaseFilter* CMainFrame::FindSourceSelectableFilter() IBaseFilter* pSF = NULL;
pSF = FindFilter(CLSID_OggSplitter, pGB);
- if(!pSF) {
+ if (!pSF) {
pSF = FindFilter(L"{171252A0-8820-4AFE-9DF8-5C92B2D66B04}", pGB); // LAV Splitter
}
- if(!pSF) {
+ if (!pSF) {
pSF = FindFilter(L"{B98D13E7-55DB-4385-A33D-09FD1BA26338}", pGB); // LAV Splitter Source
}
- if(!pSF) {
+ if (!pSF) {
pSF = FindFilter(L"{55DA30FC-F16B-49fc-BAA5-AE59FC65F82D}", pGB);
}
- if(!pSF) {
+ if (!pSF) {
pSF = FindFilter(L"{529A00DB-0C43-4f5b-8EF2-05004CBE0C6F}", pGB); // AV Splitter
}
- if(!pSF) {
+ if (!pSF) {
pSF = FindFilter(L"{D8980E15-E1F6-4916-A10F-D7EB4E9E10B8}", pGB); // AV Source
}
- if(!pSF) {
+ if (!pSF) {
pSF = FindFilter(__uuidof(CMpegSplitterFilter), pGB);
}
- if(!pSF) {
+ if (!pSF) {
pSF = FindFilter(__uuidof(CMpegSourceFilter), pGB);
}
@@ -12626,23 +12646,23 @@ void CMainFrame::SetupNavStreamSelectSubMenu(CMenu* pSub, UINT id, DWORD dwSelGr if (!pSS) {
pSS = pGB;
}
- if(!pSS) {
+ if (!pSS) {
return;
}
DWORD cStreams;
- if(FAILED(pSS->Count(&cStreams))) {
+ if (FAILED(pSS->Count(&cStreams))) {
return;
}
DWORD dwPrevGroup = (DWORD)-1;
- for(int i = 0, j = cStreams; i < j; i++) {
+ for (int i = 0, j = cStreams; i < j; i++) {
DWORD dwFlags, dwGroup;
LCID lcid;
WCHAR* pszName = NULL;
- if(FAILED(pSS->Info(i, NULL, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))
+ if (FAILED(pSS->Info(i, NULL, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))
|| !pszName) {
continue;
}
@@ -12650,25 +12670,25 @@ void CMainFrame::SetupNavStreamSelectSubMenu(CMenu* pSub, UINT id, DWORD dwSelGr CString name(pszName);
CString lcname = CString(name).MakeLower();
- if(pszName) {
+ if (pszName) {
CoTaskMemFree(pszName);
}
- if(dwGroup != dwSelGroup) {
+ if (dwGroup != dwSelGroup) {
continue;
}
- if(dwPrevGroup != -1 && dwPrevGroup != dwGroup) {
+ if (dwPrevGroup != -1 && dwPrevGroup != dwGroup) {
pSub->AppendMenu(MF_SEPARATOR);
}
dwPrevGroup = dwGroup;
CString str;
- if(lcname.Find(_T(" off")) >= 0) {
+ if (lcname.Find(_T(" off")) >= 0) {
str = ResStr(IDS_AG_DISABLED);
} else {
- if(lcid == 0) {
+ if (lcid == 0) {
str.Format(ResStr(IDS_AG_UNKNOWN), id - baseid);
} else {
int len = GetLocaleInfo(lcid, LOCALE_SENGLANGUAGE, str.GetBuffer(64), 64);
@@ -12677,15 +12697,15 @@ void CMainFrame::SetupNavStreamSelectSubMenu(CMenu* pSub, UINT id, DWORD dwSelGr CString lcstr = CString(str).MakeLower();
- if(str.IsEmpty() || lcname.Find(lcstr) >= 0) {
+ if (str.IsEmpty() || lcname.Find(lcstr) >= 0) {
str = name;
- } else if(!name.IsEmpty()) {
+ } else if (!name.IsEmpty()) {
str = CString(name) + _T(" (") + str + _T(")");
}
}
UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED;
- if(dwFlags) {
+ if (dwFlags) {
flags |= MF_CHECKED;
}
@@ -12700,34 +12720,34 @@ void CMainFrame::OnNavStreamSelectSubMenu(UINT id, DWORD dwSelGroup) if (!pSS) {
pSS = pGB;
}
- if(!pSS) {
+ if (!pSS) {
return;
}
DWORD cStreams;
- if(FAILED(pSS->Count(&cStreams))) {
+ if (FAILED(pSS->Count(&cStreams))) {
return;
}
- for(int i = 0, j = cStreams; i < j; i++) {
+ for (int i = 0, j = cStreams; i < j; i++) {
DWORD dwFlags, dwGroup;
LCID lcid;
WCHAR* pszName = NULL;
- if(FAILED(pSS->Info(i, NULL, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))
+ if (FAILED(pSS->Info(i, NULL, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))
|| !pszName) {
continue;
}
- if(pszName) {
+ if (pszName) {
CoTaskMemFree(pszName);
}
- if(dwGroup != dwSelGroup) {
+ if (dwGroup != dwSelGroup) {
continue;
}
- if(id == 0) {
+ if (id == 0) {
pSS->Enable(i, AMSTREAMSELECTENABLE_ENABLE);
break;
}
@@ -12740,9 +12760,9 @@ void CMainFrame::SetupRecentFilesSubMenu() {
CMenu* pSub = &m_recentfiles;
- if(!IsMenu(pSub->m_hMenu)) {
+ if (!IsMenu(pSub->m_hMenu)) {
pSub->CreatePopupMenu();
- } else while(pSub->RemoveMenu(0, MF_BYPOSITION)) {
+ } else while (pSub->RemoveMenu(0, MF_BYPOSITION)) {
;
}
@@ -12751,20 +12771,20 @@ void CMainFrame::SetupRecentFilesSubMenu() MRU.ReadList();
int mru_count=0;
- for(int i = 0; i < MRU.GetSize(); i++) {
- if(!MRU[i].IsEmpty()) {
+ for (int i = 0; i < MRU.GetSize(); i++) {
+ if (!MRU[i].IsEmpty()) {
mru_count++;
break;
}
}
- if(mru_count) {
+ if (mru_count) {
pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, ID_RECENT_FILES_CLEAR, ResStr(IDS_RECENT_FILES_CLEAR));
pSub->AppendMenu(MF_SEPARATOR|MF_ENABLED);
}
- for(int i = 0; i < MRU.GetSize(); i++) {
+ for (int i = 0; i < MRU.GetSize(); i++) {
UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED;
- if(!MRU[i].IsEmpty()) {
+ if (!MRU[i].IsEmpty()) {
pSub->AppendMenu(flags, id, MRU[i]);
}
id++;
@@ -12775,9 +12795,9 @@ void CMainFrame::SetupFavoritesSubMenu() {
CMenu* pSub = &m_favorites;
- if(!IsMenu(pSub->m_hMenu)) {
+ if (!IsMenu(pSub->m_hMenu)) {
pSub->CreatePopupMenu();
- } else while(pSub->RemoveMenu(0, MF_BYPOSITION)) {
+ } else while (pSub->RemoveMenu(0, MF_BYPOSITION)) {
;
}
@@ -12794,7 +12814,7 @@ void CMainFrame::SetupFavoritesSubMenu() AfxGetAppSettings().GetFav(FAV_FILE, sl);
POSITION pos = sl.GetHeadPosition();
- while(pos) {
+ while (pos) {
UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED;
CString f_str = sl.GetNext(pos);
@@ -12805,15 +12825,15 @@ void CMainFrame::SetupFavoritesSubMenu() Explode(f_str, sl, ';', 3);
f_str = sl.RemoveHead();
-
+
CString str;
- if(!sl.IsEmpty()) {
+ if (!sl.IsEmpty()) {
bool bPositionDataPresent = false;
// pos
REFERENCE_TIME rt = 0;
- if(1 == _stscanf_s(sl.GetHead(), _T("%I64d"), &rt) && rt > 0) {
+ if (1 == _stscanf_s(sl.GetHead(), _T("%I64d"), &rt) && rt > 0) {
DVD_HMSF_TIMECODE hmsf = RT2HMSF(rt, 0);
str.Format(_T("[%02d:%02d:%02d]"), hmsf.bHours, hmsf.bMinutes, hmsf.bSeconds);
bPositionDataPresent = true;
@@ -12825,24 +12845,24 @@ void CMainFrame::SetupFavoritesSubMenu() BOOL bRelativeDrive = FALSE;
if ( _stscanf_s(sl.GetHead(), _T("%d"), &bRelativeDrive) == 1 ) {
- if(bRelativeDrive) {
+ if (bRelativeDrive) {
str.Format(_T("[RD]%s"), CString(str));
- }
+ }
}
}
- if(!str.IsEmpty()) {
+ if (!str.IsEmpty()) {
f_str.Format(_T("%s\t%.14s"), CString(f_str), CString(str));
}
}
- if(!f_str.IsEmpty()) {
+ if (!f_str.IsEmpty()) {
pSub->AppendMenu(flags, id, f_str);
}
id++;
}
- if(id > ID_FAVORITES_FILE_START) {
+ if (id > ID_FAVORITES_FILE_START) {
pSub->InsertMenu(nLastGroupStart, MF_SEPARATOR|MF_ENABLED|MF_BYPOSITION);
}
@@ -12853,7 +12873,7 @@ void CMainFrame::SetupFavoritesSubMenu() s.GetFav(FAV_DVD, sl);
pos = sl.GetHeadPosition();
- while(pos) {
+ while (pos) {
UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED;
CString str = sl.GetNext(pos);
@@ -12864,18 +12884,18 @@ void CMainFrame::SetupFavoritesSubMenu() str = sl.RemoveHead();
- if(!sl.IsEmpty()) {
+ if (!sl.IsEmpty()) {
// TODO
}
- if(!str.IsEmpty()) {
+ if (!str.IsEmpty()) {
pSub->AppendMenu(flags, id, str);
}
id++;
}
- if(id > ID_FAVORITES_DVD_START) {
+ if (id > ID_FAVORITES_DVD_START) {
pSub->InsertMenu(nLastGroupStart, MF_SEPARATOR|MF_ENABLED|MF_BYPOSITION);
}
@@ -12886,7 +12906,7 @@ void CMainFrame::SetupFavoritesSubMenu() s.GetFav(FAV_DEVICE, sl);
pos = sl.GetHeadPosition();
- while(pos) {
+ while (pos) {
UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED;
CString str = sl.GetNext(pos);
@@ -12897,7 +12917,7 @@ void CMainFrame::SetupFavoritesSubMenu() str = sl.RemoveHead();
- if(!str.IsEmpty()) {
+ if (!str.IsEmpty()) {
pSub->AppendMenu(flags, id, str);
}
@@ -12910,16 +12930,16 @@ void CMainFrame::SetupShadersSubMenu() {
CMenu* pSub = &m_shaders;
- if(!IsMenu(pSub->m_hMenu)) {
+ if (!IsMenu(pSub->m_hMenu)) {
pSub->CreatePopupMenu();
- } else while(pSub->RemoveMenu(0, MF_BYPOSITION)) {
+ } else while (pSub->RemoveMenu(0, MF_BYPOSITION)) {
;
}
pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, ID_SHADERS_OFF, ResStr(IDS_SHADER_OFF));
- if(POSITION pos = AfxGetAppSettings().m_shaders.GetHeadPosition()) {
+ if (POSITION pos = AfxGetAppSettings().m_shaders.GetHeadPosition()) {
pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, ID_SHADERS_COMBINE, ResStr(IDS_SHADER_COMBINE));
pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, ID_SHADERS_EDIT, ResStr(IDS_SHADER_EDIT));
pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, ID_SHADER_TOGGLE, ResStr(IDS_SHADER_TOGGLE));
@@ -12936,7 +12956,7 @@ void CMainFrame::SetupShadersSubMenu() mii.cbSize = sizeof(mii);
mii.fMask |= MIIM_DATA;
- while(pos) {
+ while (pos) {
const AppSettings::Shader& s = AfxGetAppSettings().m_shaders.GetNext(pos);
CString label = s.label;
label.Replace(_T("&"), _T("&&"));
@@ -12958,18 +12978,18 @@ void CMainFrame::ShowControls(int nCS, bool fSave) m_pLastBar = NULL;
POSITION pos = m_bars.GetHeadPosition();
- for(int i = 1; pos; i <<= 1) {
+ for (int i = 1; pos; i <<= 1) {
CControlBar* pNext = m_bars.GetNext(pos);
ShowControlBar(pNext, !!(nCS&i), TRUE);
- if(nCS&i) {
+ if (nCS&i) {
m_pLastBar = pNext;
}
CSize s = pNext->CalcFixedLayout(FALSE, TRUE);
- if(nCSprev&i) {
+ if (nCSprev&i) {
hbefore += s.cy;
}
- if(nCS&i) {
+ if (nCS&i) {
hafter += s.cy;
}
}
@@ -12978,13 +12998,13 @@ void CMainFrame::ShowControls(int nCS, bool fSave) wp.length = sizeof(wp);
GetWindowPlacement(&wp);
- if(wp.showCmd != SW_SHOWMAXIMIZED && !m_fFullScreen) {
+ if (wp.showCmd != SW_SHOWMAXIMIZED && !m_fFullScreen) {
CRect r;
GetWindowRect(r);
MoveWindow(r.left, r.top, r.Width(), r.Height()+(hafter-hbefore));
}
- if(fSave) {
+ if (fSave) {
AfxGetAppSettings().nCS = nCS;
}
@@ -12995,19 +13015,19 @@ void CMainFrame::SetAlwaysOnTop(int i) {
AfxGetAppSettings().iOnTop = i;
- if(!m_fFullScreen) {
+ if (!m_fFullScreen) {
const CWnd* pInsertAfter = NULL;
- if(i == 0) {
+ if (i == 0) {
pInsertAfter = &wndNoTopMost;
- } else if(i == 1) {
+ } else if (i == 1) {
pInsertAfter = &wndTopMost;
- } else { // if(i == 2)
+ } else { // if (i == 2)
pInsertAfter = GetMediaState() == State_Running ? &wndTopMost : &wndNoTopMost;
}
SetWindowPos(pInsertAfter, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
- } else if(!(GetWindowLong(m_hWnd, GWL_EXSTYLE)&WS_EX_TOPMOST)) {
+ } else if (!(GetWindowLong(m_hWnd, GWL_EXSTYLE)&WS_EX_TOPMOST)) {
if (!AfxGetAppSettings().IsD3DFullscreen()) {
SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
}
@@ -13019,13 +13039,13 @@ void CMainFrame::SetAlwaysOnTop(int i) bool DoesSubPrecede(const CComPtr<ISubStream> &a, const CComPtr<ISubStream> &b)
{
WCHAR *pName;
- if(!SUCCEEDED(a->GetStreamInfo(0, &pName, NULL))) {
+ if (!SUCCEEDED(a->GetStreamInfo(0, &pName, NULL))) {
return false;
}
CStringW nameA(pName);
CoTaskMemFree(pName);
- if(!SUCCEEDED(b->GetStreamInfo(0, &pName, NULL))) {
+ if (!SUCCEEDED(b->GetStreamInfo(0, &pName, NULL))) {
return false;
}
CStringW nameB(pName);
@@ -13036,17 +13056,17 @@ bool DoesSubPrecede(const CComPtr<ISubStream> &a, const CComPtr<ISubStream> &b) CStringW slo = AfxGetAppSettings().strSubtitlesLanguageOrder;
int tPos = 0;
CStringW lang = slo.Tokenize(_T(",; "), tPos);
- while(tPos != -1 && ia == -1 && ib == -1) {
+ while (tPos != -1 && ia == -1 && ib == -1) {
int ll = lang.GetLength();
- if(nameA.Left(ll).CompareNoCase(lang) == 0) {
+ if (nameA.Left(ll).CompareNoCase(lang) == 0) {
ia = tPos;
}
- if(nameB.Left(ll).CompareNoCase(lang) == 0) {
+ if (nameB.Left(ll).CompareNoCase(lang) == 0) {
ib = tPos;
}
lang = slo.Tokenize(_T(",; "), tPos);
}
- if(ia != -1 && ib == -1) {
+ if (ia != -1 && ib == -1) {
return true;
}
return false;
@@ -13058,11 +13078,11 @@ ISubStream *InsertSubStream(CInterfaceList<ISubStream> *subStreams, const CComPt POSITION pos = subStreams->GetHeadPosition();
POSITION newPos = NULL;
bool processed = false;
- while(!processed && pos) {
+ while (!processed && pos) {
POSITION prevPos = pos;
CComPtr<ISubStream> pSubStream = subStreams->GetNext(pos);
- if(DoesSubPrecede(theSubStream, pSubStream)) {
- if(prevPos == subStreams->GetHeadPosition()) {
+ if (DoesSubPrecede(theSubStream, pSubStream)) {
+ if (prevPos == subStreams->GetHeadPosition()) {
newPos = subStreams->AddHead(theSubStream);
} else {
newPos = subStreams->InsertBefore(prevPos, theSubStream);
@@ -13070,13 +13090,13 @@ ISubStream *InsertSubStream(CInterfaceList<ISubStream> *subStreams, const CComPt processed = true;
}
}
- if(!processed) {
+ if (!processed) {
newPos = subStreams->AddTail(theSubStream);
}
- if(newPos == NULL) {
+ if (newPos == NULL) {
newPos = subStreams->GetTailPosition();
}
- if(newPos == NULL) {
+ if (newPos == NULL) {
return NULL;
}
return subStreams->GetAt(newPos);
@@ -13085,14 +13105,14 @@ ISubStream *InsertSubStream(CInterfaceList<ISubStream> *subStreams, const CComPt void CMainFrame::AddTextPassThruFilter()
{
BeginEnumFilters(pGB, pEF, pBF) {
- if(!IsSplitter(pBF)) {
+ if (!IsSplitter(pBF)) {
continue;
}
BeginEnumPins(pBF, pEP, pPin) {
CComPtr<IPin> pPinTo;
AM_MEDIA_TYPE mt;
- if(FAILED(pPin->ConnectedTo(&pPinTo)) || !pPinTo
+ if (FAILED(pPin->ConnectedTo(&pPinTo)) || !pPinTo
|| FAILED(pPin->ConnectionMediaType(&mt))
|| mt.majortype != MEDIATYPE_Text && mt.majortype != MEDIATYPE_Subtitle) {
continue;
@@ -13101,7 +13121,7 @@ void CMainFrame::AddTextPassThruFilter() CComQIPtr<IBaseFilter> pTPTF = DNew CTextPassThruFilter(this);
CStringW name;
name.Format(L"TextPassThru%08x", pTPTF);
- if(FAILED(pGB->AddFilter(pTPTF, name))) {
+ if (FAILED(pGB->AddFilter(pTPTF, name))) {
continue;
}
@@ -13110,7 +13130,7 @@ void CMainFrame::AddTextPassThruFilter() hr = pPinTo->Disconnect();
hr = pPin->Disconnect();
- if(FAILED(hr = pGB->ConnectDirect(pPin, GetFirstPin(pTPTF, PINDIR_INPUT), NULL))
+ if (FAILED(hr = pGB->ConnectDirect(pPin, GetFirstPin(pTPTF, PINDIR_INPUT), NULL))
|| FAILED(hr = pGB->ConnectDirect(GetFirstPin(pTPTF, PINDIR_OUTPUT), pPinTo, NULL))) {
hr = pGB->ConnectDirect(pPin, pPinTo, NULL);
} else {
@@ -13128,16 +13148,16 @@ bool CMainFrame::LoadSubtitle(CString fn, ISubStream **actualStream) // TMP: maybe this will catch something for those who get a runtime error dialog when opening subtitles from cds
try {
- if(!pSubStream) {
+ if (!pSubStream) {
CAutoPtr<CVobSubFile> pVSF(DNew CVobSubFile(&m_csSubLock));
- if(CString(CPath(fn).GetExtension()).MakeLower() == _T(".idx") && pVSF && pVSF->Open(fn) && pVSF->GetStreamCount() > 0) {
+ if (CString(CPath(fn).GetExtension()).MakeLower() == _T(".idx") && pVSF && pVSF->Open(fn) && pVSF->GetStreamCount() > 0) {
pSubStream = pVSF.Detach();
}
}
- if(!pSubStream) {
+ if (!pSubStream) {
CAutoPtr<CRenderedTextSubtitle> pRTS(DNew CRenderedTextSubtitle(&m_csSubLock, &AfxGetAppSettings().subdefstyle, AfxGetAppSettings().fUseDefaultSubtitlesStyle));
- if(pRTS && pRTS->Open(fn, DEFAULT_CHARSET) && pRTS->GetStreamCount() > 0) {
+ if (pRTS && pRTS->Open(fn, DEFAULT_CHARSET) && pRTS->GetStreamCount() > 0) {
pSubStream = pRTS.Detach();
}
}
@@ -13145,10 +13165,10 @@ bool CMainFrame::LoadSubtitle(CString fn, ISubStream **actualStream) e->Delete();
}
- if(pSubStream) {
+ if (pSubStream) {
//m_pSubStreams.AddTail(pSubStream);
ISubStream *r = InsertSubStream(&m_pSubStreams, pSubStream);
- if(actualStream != NULL) {
+ if (actualStream != NULL) {
*actualStream = r;
}
}
@@ -13158,24 +13178,24 @@ bool CMainFrame::LoadSubtitle(CString fn, ISubStream **actualStream) void CMainFrame::UpdateSubtitle(bool fDisplayMessage, bool fApplyDefStyle)
{
- if(!m_pCAP) {
+ if (!m_pCAP) {
return;
}
int i = m_iSubtitleSel;
POSITION pos = m_pSubStreams.GetHeadPosition();
- while(pos && i >= 0) {
+ while (pos && i >= 0) {
CComPtr<ISubStream> pSubStream = m_pSubStreams.GetNext(pos);
- if(i < pSubStream->GetStreamCount()) {
+ if (i < pSubStream->GetStreamCount()) {
CAutoLock cAutoLock(&m_csSubLock);
pSubStream->SetStream(i);
SetSubtitle(pSubStream, fApplyDefStyle);
if (fDisplayMessage) {
WCHAR* pName = NULL;
- if(SUCCEEDED(pSubStream->GetStreamInfo(0, &pName, NULL))) {
+ if (SUCCEEDED(pSubStream->GetStreamInfo(0, &pName, NULL))) {
CString strMessage;
strMessage.Format(ResStr(IDS_MAINFRM_45), pName, _T(""));
m_OSD.DisplayMessage (OSD_TOPLEFT, strMessage);
@@ -13198,31 +13218,31 @@ void CMainFrame::SetSubtitle(ISubStream* pSubStream, bool fApplyDefStyle) {
AppSettings& s = AfxGetAppSettings();
- if(pSubStream) {
+ if (pSubStream) {
CLSID clsid;
pSubStream->GetClassID(&clsid);
- if(clsid == __uuidof(CVobSubFile)) {
+ if (clsid == __uuidof(CVobSubFile)) {
CVobSubFile* pVSF = (CVobSubFile*)(ISubStream*)pSubStream;
- if(fApplyDefStyle) {
+ if (fApplyDefStyle) {
pVSF->SetAlignment(s.fOverridePlacement, s.nHorPos, s.nVerPos, 1, 1);
}
- } else if(clsid == __uuidof(CVobSubStream)) {
+ } else if (clsid == __uuidof(CVobSubStream)) {
CVobSubStream* pVSS = (CVobSubStream*)(ISubStream*)pSubStream;
- if(fApplyDefStyle) {
+ if (fApplyDefStyle) {
pVSS->SetAlignment(s.fOverridePlacement, s.nHorPos, s.nVerPos, 1, 1);
}
- } else if(clsid == __uuidof(CRenderedTextSubtitle)) {
+ } else if (clsid == __uuidof(CRenderedTextSubtitle)) {
CRenderedTextSubtitle* pRTS = (CRenderedTextSubtitle*)(ISubStream*)pSubStream;
STSStyle style;
- if(fApplyDefStyle || pRTS->m_fUsingAutoGeneratedDefaultStyle) {
+ if (fApplyDefStyle || pRTS->m_fUsingAutoGeneratedDefaultStyle) {
style = s.subdefstyle;
- if(s.fOverridePlacement) {
+ if (s.fOverridePlacement) {
style.scrAlignment = 2;
int w = pRTS->m_dstScreenSize.cx;
int h = pRTS->m_dstScreenSize.cy;
@@ -13236,7 +13256,7 @@ void CMainFrame::SetSubtitle(ISubStream* pSubStream, bool fApplyDefStyle) UNUSED_ALWAYS(res);
}
- if(pRTS->GetDefaultStyle(style) && style.relativeTo == 2) {
+ if (pRTS->GetDefaultStyle(style) && style.relativeTo == 2) {
style.relativeTo = s.subdefstyle.relativeTo;
pRTS->SetDefaultStyle(style);
}
@@ -13247,18 +13267,18 @@ void CMainFrame::SetSubtitle(ISubStream* pSubStream, bool fApplyDefStyle) }
}
- if(!fApplyDefStyle) {
+ if (!fApplyDefStyle) {
m_iSubtitleSel = -1;
- if(pSubStream) {
+ if (pSubStream) {
int i = 0;
POSITION pos = m_pSubStreams.GetHeadPosition();
- while(pos) {
+ while (pos) {
CComPtr<ISubStream> pSubStream2 = m_pSubStreams.GetNext(pos);
- if(pSubStream == pSubStream2) {
+ if (pSubStream == pSubStream2) {
m_iSubtitleSel = i + pSubStream2->GetStream();
break;
}
@@ -13271,7 +13291,7 @@ void CMainFrame::SetSubtitle(ISubStream* pSubStream, bool fApplyDefStyle) m_nSubtitleId = (DWORD_PTR)pSubStream;
- if(m_pCAP) {
+ if (m_pCAP) {
m_pCAP->SetSubPicProvider(CComQIPtr<ISubPicProvider>(pSubStream));
m_wndSubresyncBar.SetSubtitle(pSubStream, m_pCAP->GetFPS());
}
@@ -13280,9 +13300,9 @@ void CMainFrame::SetSubtitle(ISubStream* pSubStream, bool fApplyDefStyle) void CMainFrame::ReplaceSubtitle(ISubStream* pSubStreamOld, ISubStream* pSubStreamNew)
{
POSITION pos = m_pSubStreams.GetHeadPosition();
- while(pos) {
+ while (pos) {
POSITION cur = pos;
- if(pSubStreamOld == m_pSubStreams.GetNext(pos)) {
+ if (pSubStreamOld == m_pSubStreams.GetNext(pos)) {
m_pSubStreams.SetAt(cur, pSubStreamNew);
UpdateSubtitle();
break;
@@ -13292,8 +13312,8 @@ void CMainFrame::ReplaceSubtitle(ISubStream* pSubStreamOld, ISubStream* pSubStre void CMainFrame::InvalidateSubtitle(DWORD_PTR nSubtitleId, REFERENCE_TIME rtInvalidate)
{
- if(m_pCAP) {
- if(nSubtitleId == -1 || nSubtitleId == m_nSubtitleId) {
+ if (m_pCAP) {
+ if (nSubtitleId == -1 || nSubtitleId == m_nSubtitleId) {
m_pCAP->Invalidate(rtInvalidate);
}
}
@@ -13302,7 +13322,7 @@ void CMainFrame::InvalidateSubtitle(DWORD_PTR nSubtitleId, REFERENCE_TIME rtInva void CMainFrame::ReloadSubtitle()
{
POSITION pos = m_pSubStreams.GetHeadPosition();
- while(pos) {
+ while (pos) {
m_pSubStreams.GetNext(pos)->Reload();
}
UpdateSubtitle();
@@ -13310,12 +13330,12 @@ void CMainFrame::ReloadSubtitle() void CMainFrame::SetSubtitleTrackIdx(int index)
{
- if(m_iMediaLoadState == MLS_LOADED) {
+ if (m_iMediaLoadState == MLS_LOADED) {
if (index < 0) {
m_iSubtitleSel ^= 0x80000000;
} else {
POSITION pos = m_pSubStreams.FindIndex(index);
- if(pos) {
+ if (pos) {
m_iSubtitleSel = index;
}
}
@@ -13326,16 +13346,16 @@ void CMainFrame::SetSubtitleTrackIdx(int index) void CMainFrame::SetAudioTrackIdx(int index)
{
- if(m_iMediaLoadState == MLS_LOADED) {
+ if (m_iMediaLoadState == MLS_LOADED) {
CComQIPtr<IAMStreamSelect> pSS = FindFilter(__uuidof(CAudioSwitcherFilter), pGB);
- if(!pSS) {
+ if (!pSS) {
pSS = FindFilter(L"{D3CD7858-971A-4838-ACEC-40CA5D529DC8}", pGB); // morgan's switcher
}
DWORD cStreams = 0;
DWORD dwFlags = AMSTREAMSELECTENABLE_ENABLE;
- if(pSS && SUCCEEDED(pSS->Count(&cStreams)))
- if((index >= 0) && (index < ((int)cStreams))) {
+ if (pSS && SUCCEEDED(pSS->Count(&cStreams)))
+ if ((index >= 0) && (index < ((int)cStreams))) {
pSS->Enable(index, dwFlags);
}
}
@@ -13357,49 +13377,51 @@ void CMainFrame::SeekTo(REFERENCE_TIME rtPos, bool fSeekToKeyFrame) {
OAFilterState fs = GetMediaState();
- if(rtPos < 0) {
+ if (rtPos < 0) {
rtPos = 0;
}
m_nStepForwardCount = 0;
- if(GetPlaybackMode() != PM_CAPTURE) {
+ if (GetPlaybackMode() != PM_CAPTURE) {
__int64 start, stop;
m_wndSeekBar.GetRange(start, stop);
GUID tf;
pMS->GetTimeFormat(&tf);
- if(rtPos > stop && stop != 100) rtPos = stop;
+ if (rtPos > stop && stop != 100) {
+ rtPos = stop;
+ }
m_wndStatusBar.SetStatusTimer(rtPos, stop, !!m_wndSubresyncBar.IsWindowVisible(), &tf);
m_OSD.DisplayMessage(OSD_TOPLEFT, m_wndStatusBar.GetStatusTimer(), 1500);
}
- if(GetPlaybackMode() == PM_FILE) {
- if(fs == State_Stopped) {
+ if (GetPlaybackMode() == PM_FILE) {
+ if (fs == State_Stopped) {
SendMessage(WM_COMMAND, ID_PLAY_PAUSE);
}
HRESULT hr;
- if(fSeekToKeyFrame) {
- if(!m_kfs.IsEmpty()) {
+ if (fSeekToKeyFrame) {
+ if (!m_kfs.IsEmpty()) {
int i = rangebsearch(rtPos, m_kfs);
- if(i >= 0 && i < m_kfs.GetCount()) {
+ if (i >= 0 && i < m_kfs.GetCount()) {
rtPos = m_kfs[i];
}
}
}
hr = pMS->SetPositions(&rtPos, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning);
- } else if(GetPlaybackMode() == PM_DVD && m_iDVDDomain == DVD_DOMAIN_Title) {
- if(fs != State_Running) {
+ } else if (GetPlaybackMode() == PM_DVD && m_iDVDDomain == DVD_DOMAIN_Title) {
+ if (fs != State_Running) {
SendMessage(WM_COMMAND, ID_PLAY_PLAY);
}
DVD_HMSF_TIMECODE tc = RT2HMSF(rtPos);
pDVDC->PlayAtTime(&tc, DVD_CMD_FLAG_Block|DVD_CMD_FLAG_Flush, NULL);
- // if(fs != State_Running)
+ // if (fs != State_Running)
// SendMessage(WM_COMMAND, ID_PLAY_PAUSE);
- } else if(GetPlaybackMode() == PM_CAPTURE) {
+ } else if (GetPlaybackMode() == PM_CAPTURE) {
TRACE(_T("Warning (CMainFrame::SeekTo): Trying to seek in capture mode"));
}
m_fEndOfStream = false;
@@ -13409,28 +13431,28 @@ void CMainFrame::SeekTo(REFERENCE_TIME rtPos, bool fSeekToKeyFrame) void CMainFrame::CleanGraph()
{
- if(!pGB) {
+ if (!pGB) {
return;
}
BeginEnumFilters(pGB, pEF, pBF) {
CComQIPtr<IAMFilterMiscFlags> pAMMF(pBF);
- if(pAMMF && (pAMMF->GetMiscFlags()&AM_FILTER_MISC_FLAGS_IS_SOURCE)) {
+ if (pAMMF && (pAMMF->GetMiscFlags()&AM_FILTER_MISC_FLAGS_IS_SOURCE)) {
continue;
}
// some capture filters forget to set AM_FILTER_MISC_FLAGS_IS_SOURCE
// or to implement the IAMFilterMiscFlags interface
- if(pBF == pVidCap || pBF == pAudCap) {
+ if (pBF == pVidCap || pBF == pAudCap) {
continue;
}
- if(CComQIPtr<IFileSourceFilter>(pBF)) {
+ if (CComQIPtr<IFileSourceFilter>(pBF)) {
continue;
}
int nIn, nOut, nInC, nOutC;
- if(CountPins(pBF, nIn, nOut, nInC, nOutC) > 0 && (nInC+nOutC) == 0) {
+ if (CountPins(pBF, nIn, nOut, nInC, nOutC) > 0 && (nInC+nOutC) == 0) {
TRACE(CStringW(L"Removing: ") + GetFilterName(pBF) + '\n');
pGB->RemoveFilter(pBF);
@@ -13445,7 +13467,7 @@ void CMainFrame::CleanGraph() static void SetLatency(IBaseFilter* pBF, int cbBuffer)
{
BeginEnumPins(pBF, pEP, pPin) {
- if(CComQIPtr<IAMBufferNegotiation> pAMBN = pPin) {
+ if (CComQIPtr<IAMBufferNegotiation> pAMBN = pPin) {
ALLOCATOR_PROPERTIES ap;
ap.cbAlign = -1; // -1 means no preference.
ap.cbBuffer = cbBuffer;
@@ -13463,7 +13485,7 @@ HRESULT CMainFrame::BuildCapture(IPin* pPin, IBaseFilter* pBF[3], const GUID& ma IBaseFilter* pEnc = pBF[1];
IBaseFilter* pMux = pBF[2];
- if(!pPin || !pMux) {
+ if (!pPin || !pMux) {
return E_FAIL;
}
@@ -13472,29 +13494,29 @@ HRESULT CMainFrame::BuildCapture(IPin* pPin, IBaseFilter* pBF[3], const GUID& ma HRESULT hr = S_OK;
CFilterInfo fi;
- if(FAILED(pMux->QueryFilterInfo(&fi)) || !fi.pGraph) {
+ if (FAILED(pMux->QueryFilterInfo(&fi)) || !fi.pGraph) {
pGB->AddFilter(pMux, L"Multiplexer");
}
CStringW prefix, prefixl;
- if(majortype == MEDIATYPE_Video) {
+ if (majortype == MEDIATYPE_Video) {
prefix = L"Video ";
- } else if(majortype == MEDIATYPE_Audio) {
+ } else if (majortype == MEDIATYPE_Audio) {
prefix = L"Audio ";
}
prefixl = prefix;
prefixl.MakeLower();
- if(pBuff) {
+ if (pBuff) {
hr = pGB->AddFilter(pBuff, prefix + L"Buffer");
- if(FAILED(hr)) {
+ if (FAILED(hr)) {
err = _T("Can't add ") + CString(prefixl) + _T("buffer filter");
AfxMessageBox(err);
return hr;
}
hr = pGB->ConnectFilter(pPin, pBuff);
- if(FAILED(hr)) {
+ if (FAILED(hr)) {
err = _T("Error connecting the ") + CString(prefixl) + _T("buffer filter");
AfxMessageBox(err);
return(hr);
@@ -13503,16 +13525,16 @@ HRESULT CMainFrame::BuildCapture(IPin* pPin, IBaseFilter* pBF[3], const GUID& ma pPin = GetFirstPin(pBuff, PINDIR_OUTPUT);
}
- if(pEnc) {
+ if (pEnc) {
hr = pGB->AddFilter(pEnc, prefix + L"Encoder");
- if(FAILED(hr)) {
+ if (FAILED(hr)) {
err = _T("Can't add ") + CString(prefixl) + _T("encoder filter");
AfxMessageBox(err);
return hr;
}
hr = pGB->ConnectFilter(pPin, pEnc);
- if(FAILED(hr)) {
+ if (FAILED(hr)) {
err = _T("Error connecting the ") + CString(prefixl) + _T("encoder filter");
AfxMessageBox(err);
return(hr);
@@ -13520,10 +13542,10 @@ HRESULT CMainFrame::BuildCapture(IPin* pPin, IBaseFilter* pBF[3], const GUID& ma pPin = GetFirstPin(pEnc, PINDIR_OUTPUT);
- if(CComQIPtr<IAMStreamConfig> pAMSC = pPin) {
- if(pmt->majortype == majortype) {
+ if (CComQIPtr<IAMStreamConfig> pAMSC = pPin) {
+ if (pmt->majortype == majortype) {
hr = pAMSC->SetFormat(pmt);
- if(FAILED(hr)) {
+ if (FAILED(hr)) {
err = _T("Can't set compression format on the ") + CString(prefixl) + _T("encoder filter");
AfxMessageBox(err);
return(hr);
@@ -13533,10 +13555,10 @@ HRESULT CMainFrame::BuildCapture(IPin* pPin, IBaseFilter* pBF[3], const GUID& ma }
- // if(pMux)
+ // if (pMux)
{
hr = pGB->ConnectFilter(pPin, pMux);
- if(FAILED(hr)) {
+ if (FAILED(hr)) {
err = _T("Error connecting ") + CString(prefixl) + _T(" to the muliplexer filter");
AfxMessageBox(err);
return(hr);
@@ -13559,9 +13581,9 @@ bool CMainFrame::BuildToCapturePreviewPin( CComPtr<IPin> pDVAudPin;
- if(pVidCap) {
+ if (pVidCap) {
CComPtr<IPin> pPin;
- if(!pAudCap // only look for interleaved stream when we don't use any other audio capture source
+ if (!pAudCap // only look for interleaved stream when we don't use any other audio capture source
&& SUCCEEDED(pCGB->FindPin(pVidCap, PINDIR_OUTPUT, &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Interleaved, TRUE, 0, &pPin))) {
CComPtr<IBaseFilter> pDVSplitter;
hr = pDVSplitter.CoCreateInstance(CLSID_DVSplitter);
@@ -13581,7 +13603,7 @@ bool CMainFrame::BuildToCapturePreviewPin( pPin = NULL;
hr = pCGB->FindPin(pDVDec, PINDIR_OUTPUT, NULL, &MEDIATYPE_Video, TRUE, 0, &pPin);
- } else if(SUCCEEDED(pCGB->FindPin(pVidCap, PINDIR_OUTPUT, &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, TRUE, 0, &pPin))) {
+ } else if (SUCCEEDED(pCGB->FindPin(pVidCap, PINDIR_OUTPUT, &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, TRUE, 0, &pPin))) {
} else {
AfxMessageBox(_T("No video capture pin was found"));
return(false);
@@ -13597,11 +13619,11 @@ bool CMainFrame::BuildToCapturePreviewPin( hr = pSmartTee->FindPin(L"Capture", ppVidCapPin);
}
- if(pAudCap || pDVAudPin) {
+ if (pAudCap || pDVAudPin) {
CComPtr<IPin> pPin;
- if(pDVAudPin) {
+ if (pDVAudPin) {
pPin = pDVAudPin;
- } else if(SUCCEEDED(pCGB->FindPin(pAudCap, PINDIR_OUTPUT, &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Audio, TRUE, 0, &pPin))) {
+ } else if (SUCCEEDED(pCGB->FindPin(pAudCap, PINDIR_OUTPUT, &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Audio, TRUE, 0, &pPin))) {
} else {
AfxMessageBox(_T("No audio capture pin was found"));
return(false);
@@ -13622,7 +13644,7 @@ bool CMainFrame::BuildToCapturePreviewPin( bool CMainFrame::BuildGraphVideoAudio(int fVPreview, bool fVCapture, int fAPreview, bool fACapture)
{
- if(!pCGB) {
+ if (!pCGB) {
return(false);
}
@@ -13635,13 +13657,13 @@ bool CMainFrame::BuildGraphVideoAudio(int fVPreview, bool fVCapture, int fAPrevi CleanGraph();
- if(pAMVSCCap) {
+ if (pAMVSCCap) {
hr = pAMVSCCap->SetFormat(&m_wndCaptureBar.m_capdlg.m_mtv);
}
- if(pAMVSCPrev) {
+ if (pAMVSCPrev) {
hr = pAMVSCPrev->SetFormat(&m_wndCaptureBar.m_capdlg.m_mtv);
}
- if(pAMASC) {
+ if (pAMASC) {
hr = pAMASC->SetFormat(&m_wndCaptureBar.m_capdlg.m_mta);
}
@@ -13657,12 +13679,12 @@ bool CMainFrame::BuildGraphVideoAudio(int fVPreview, bool fVCapture, int fAPrevi bool fFileOutput = (pMux && pDst) || (pAudMux && pAudDst);
bool fCapture = (fVCapture || fACapture);
- if(pAudCap) {
+ if (pAudCap) {
AM_MEDIA_TYPE* pmt = &m_wndCaptureBar.m_capdlg.m_mta;
int ms = (fACapture && fFileOutput && m_wndCaptureBar.m_capdlg.m_fAudOutput) ? AUDIOBUFFERLEN : 60;
- if(pMux != pAudMux && fACapture) {
+ if (pMux != pAudMux && fACapture) {
SetLatency(pAudCap, -1);
- } else if(pmt->pbFormat) {
+ } else if (pmt->pbFormat) {
SetLatency(pAudCap, ((WAVEFORMATEX*)pmt->pbFormat)->nAvgBytesPerSec * ms / 1000);
}
}
@@ -13670,17 +13692,17 @@ bool CMainFrame::BuildGraphVideoAudio(int fVPreview, bool fVCapture, int fAPrevi CComPtr<IPin> pVidCapPin, pVidPrevPin, pAudCapPin, pAudPrevPin;
BuildToCapturePreviewPin(pVidCap, &pVidCapPin, &pVidPrevPin, pAudCap, &pAudCapPin, &pAudPrevPin);
- // if(pVidCap)
+ // if (pVidCap)
{
bool fVidPrev = pVidPrevPin && fVPreview;
bool fVidCap = pVidCapPin && fVCapture && fFileOutput && m_wndCaptureBar.m_capdlg.m_fVidOutput;
- if(fVPreview == 2 && !fVidCap && pVidCapPin) {
+ if (fVPreview == 2 && !fVidCap && pVidCapPin) {
pVidPrevPin = pVidCapPin;
pVidCapPin = NULL;
}
- if(fVidPrev) {
+ if (fVidPrev) {
m_pCAP = NULL;
m_pCAP2 = NULL;
pGB->Render(pVidPrevPin);
@@ -13688,7 +13710,7 @@ bool CMainFrame::BuildGraphVideoAudio(int fVPreview, bool fVCapture, int fAPrevi pGB->FindInterface(__uuidof(ISubPicAllocatorPresenter2), (void**)&m_pCAP2, TRUE);
}
- if(fVidCap) {
+ if (fVidCap) {
IBaseFilter* pBF[3] = {pVidBuffer, pVidEnc, pMux};
HRESULT hr = BuildCapture(pVidCapPin, pBF, MEDIATYPE_Video, &m_wndCaptureBar.m_capdlg.m_mtcv);
UNUSED_ALWAYS(hr);
@@ -13698,34 +13720,34 @@ bool CMainFrame::BuildGraphVideoAudio(int fVPreview, bool fVCapture, int fAPrevi pCGB->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, pVidCap, IID_IAMDroppedFrames, (void**)&pAMDF);
}
- // if(pAudCap)
+ // if (pAudCap)
{
bool fAudPrev = pAudPrevPin && fAPreview;
bool fAudCap = pAudCapPin && fACapture && fFileOutput && m_wndCaptureBar.m_capdlg.m_fAudOutput;
- if(fAPreview == 2 && !fAudCap && pAudCapPin) {
+ if (fAPreview == 2 && !fAudCap && pAudCapPin) {
pAudPrevPin = pAudCapPin;
pAudCapPin = NULL;
}
- if(fAudPrev) {
+ if (fAudPrev) {
pGB->Render(pAudPrevPin);
}
- if(fAudCap) {
+ if (fAudCap) {
IBaseFilter* pBF[3] = {pAudBuffer, pAudEnc, pAudMux ? pAudMux : pMux};
HRESULT hr = BuildCapture(pAudCapPin, pBF, MEDIATYPE_Audio, &m_wndCaptureBar.m_capdlg.m_mtca);
UNUSED_ALWAYS(hr);
}
}
- if((pVidCap || pAudCap) && fCapture && fFileOutput) {
- if(pMux != pDst) {
+ if ((pVidCap || pAudCap) && fCapture && fFileOutput) {
+ if (pMux != pDst) {
hr = pGB->AddFilter(pDst, L"File Writer V/A");
hr = pGB->ConnectFilter(GetFirstPin(pMux, PINDIR_OUTPUT), pDst);
}
- if(CComQIPtr<IConfigAviMux> pCAM = pMux) {
+ if (CComQIPtr<IConfigAviMux> pCAM = pMux) {
int nIn, nOut, nInC, nOutC;
CountPins(pMux, nIn, nOut, nInC, nOutC);
pCAM->SetMasterStream(nInC-1);
@@ -13733,9 +13755,9 @@ bool CMainFrame::BuildGraphVideoAudio(int fVPreview, bool fVCapture, int fAPrevi pCAM->SetOutputCompatibilityIndex(FALSE);
}
- if(CComQIPtr<IConfigInterleaving> pCI = pMux) {
- // if(FAILED(pCI->put_Mode(INTERLEAVE_CAPTURE)))
- if(FAILED(pCI->put_Mode(INTERLEAVE_NONE_BUFFERED))) {
+ if (CComQIPtr<IConfigInterleaving> pCI = pMux) {
+ // if (FAILED(pCI->put_Mode(INTERLEAVE_CAPTURE)))
+ if (FAILED(pCI->put_Mode(INTERLEAVE_NONE_BUFFERED))) {
pCI->put_Mode(INTERLEAVE_NONE);
}
@@ -13743,7 +13765,7 @@ bool CMainFrame::BuildGraphVideoAudio(int fVPreview, bool fVCapture, int fAPrevi pCI->put_Interleaving(&rtInterleave, &rtPreroll);
}
- if(pMux != pAudMux && pAudMux != pAudDst) {
+ if (pMux != pAudMux && pAudMux != pAudDst) {
hr = pGB->AddFilter(pAudDst, L"File Writer A");
hr = pGB->ConnectFilter(GetFirstPin(pAudMux, PINDIR_OUTPUT), pAudDst);
}
@@ -13766,11 +13788,11 @@ bool CMainFrame::BuildGraphVideoAudio(int fVPreview, bool fVCapture, int fAPrevi bool CMainFrame::StartCapture()
{
- if(!pCGB || m_fCapturing) {
+ if (!pCGB || m_fCapturing) {
return(false);
}
- if(!m_wndCaptureBar.m_capdlg.m_pMux && !m_wndCaptureBar.m_capdlg.m_pDst) {
+ if (!m_wndCaptureBar.m_capdlg.m_pMux && !m_wndCaptureBar.m_capdlg.m_pDst) {
return(false);
}
@@ -13796,11 +13818,11 @@ bool CMainFrame::StartCapture() bool CMainFrame::StopCapture()
{
- if(!pCGB || !m_fCapturing) {
+ if (!pCGB || !m_fCapturing) {
return(false);
}
- if(!m_wndCaptureBar.m_capdlg.m_pMux && !m_wndCaptureBar.m_capdlg.m_pDst) {
+ if (!m_wndCaptureBar.m_capdlg.m_pMux && !m_wndCaptureBar.m_capdlg.m_pDst) {
return(false);
}
@@ -13832,9 +13854,9 @@ void CMainFrame::ShowOptions(int idPage) CPPageSheet options(ResStr(IDS_OPTIONS_CAPTION), pGB, GetModalParent(), idPage);
m_bInOptions = true;
- if(options.DoModal() == IDOK) {
+ if (options.DoModal() == IDOK) {
m_bInOptions = false;
- if(!m_fFullScreen) {
+ if (!m_fFullScreen) {
SetAlwaysOnTop(s.iOnTop);
}
@@ -13849,14 +13871,14 @@ void CMainFrame::ShowOptions(int idPage) void CMainFrame::StartWebServer(int nPort)
{
- if(!m_pWebServer) {
+ if (!m_pWebServer) {
m_pWebServer.Attach(DNew CWebServer(this, nPort));
}
}
void CMainFrame::StopWebServer()
{
- if(m_pWebServer) {
+ if (m_pWebServer) {
m_pWebServer.Free();
}
}
@@ -13873,7 +13895,7 @@ void CMainFrame::SendStatusMessage(CString msg, int nTimeOut) KillTimer(TIMER_STATUSERASER);
m_playingmsg.Empty();
- if(nTimeOut <= 0) {
+ if (nTimeOut <= 0) {
return;
}
@@ -13884,27 +13906,27 @@ void CMainFrame::SendStatusMessage(CString msg, int nTimeOut) void CMainFrame::OpenCurPlaylistItem(REFERENCE_TIME rtStart)
{
- if(m_wndPlaylistBar.GetCount() == 0) {
+ if (m_wndPlaylistBar.GetCount() == 0) {
return;
}
CPlaylistItem pli;
- if(!m_wndPlaylistBar.GetCur(pli)) {
+ if (!m_wndPlaylistBar.GetCur(pli)) {
m_wndPlaylistBar.SetFirstSelected();
}
- if(!m_wndPlaylistBar.GetCur(pli)) {
+ if (!m_wndPlaylistBar.GetCur(pli)) {
return;
}
CAutoPtr<OpenMediaData> p(m_wndPlaylistBar.GetCurOMD(rtStart));
- if(p) {
+ if (p) {
OpenMedia(p);
}
}
void CMainFrame::AddCurDevToPlaylist()
{
- if(GetPlaybackMode() == PM_CAPTURE) {
+ if (GetPlaybackMode() == PM_CAPTURE) {
m_wndPlaylistBar.Append(
m_VidDispName,
m_AudDispName,
@@ -13918,8 +13940,8 @@ void CMainFrame::AddCurDevToPlaylist() void CMainFrame::OpenMedia(CAutoPtr<OpenMediaData> pOMD)
{
// shortcut
- if(OpenDeviceData* p = dynamic_cast<OpenDeviceData*>(pOMD.m_p)) {
- if(m_iMediaLoadState == MLS_LOADED && pAMTuner
+ if (OpenDeviceData* p = dynamic_cast<OpenDeviceData*>(pOMD.m_p)) {
+ if (m_iMediaLoadState == MLS_LOADED && pAMTuner
&& m_VidDispName == p->DisplayName[0] && m_AudDispName == p->DisplayName[1]) {
m_wndCaptureBar.m_capdlg.SetVideoInput(p->vinput);
m_wndCaptureBar.m_capdlg.SetVideoChannel(p->vchannel);
@@ -13930,7 +13952,7 @@ void CMainFrame::OpenMedia(CAutoPtr<OpenMediaData> pOMD) }
}
- if(m_iMediaLoadState != MLS_CLOSED) {
+ if (m_iMediaLoadState != MLS_CLOSED) {
CloseMedia();
}
@@ -13939,21 +13961,21 @@ void CMainFrame::OpenMedia(CAutoPtr<OpenMediaData> pOMD) AppSettings& s = AfxGetAppSettings();
bool fUseThread = m_pGraphThread && AfxGetAppSettings().fEnableWorkerThreadForOpening
- // don't use a worker thread in D3DFullscreen mode except madVR
- && (!AfxGetAppSettings().IsD3DFullscreen() || AfxGetAppSettings().iDSVideoRendererType==VIDRNDT_DS_MADVR);
+ // don't use a worker thread in D3DFullscreen mode except madVR
+ && (!AfxGetAppSettings().IsD3DFullscreen() || AfxGetAppSettings().iDSVideoRendererType==VIDRNDT_DS_MADVR);
- if(OpenFileData* p = dynamic_cast<OpenFileData*>(pOMD.m_p)) {
- if(p->fns.GetCount() > 0) {
+ if (OpenFileData* p = dynamic_cast<OpenFileData*>(pOMD.m_p)) {
+ if (p->fns.GetCount() > 0) {
engine_t e = s.m_Formats.GetEngine(p->fns.GetHead());
if (e != DirectShow /*&& e != RealMedia && e != QuickTime*/) {
fUseThread = false;
}
}
- } else if(OpenDeviceData* p = dynamic_cast<OpenDeviceData*>(pOMD.m_p)) {
+ } else if (OpenDeviceData* p = dynamic_cast<OpenDeviceData*>(pOMD.m_p)) {
fUseThread = false;
}
- if(fUseThread) {
+ if (fUseThread) {
m_pGraphThread->PostThreadMessage(CGraphThread::TM_OPEN, 0, (LPARAM)pOMD.Detach());
m_bOpenedThruThread = true;
} else {
@@ -13980,21 +14002,21 @@ bool CMainFrame::DisplayChange() void CMainFrame::CloseMedia()
{
- if(m_iMediaLoadState == MLS_CLOSING) {
+ if (m_iMediaLoadState == MLS_CLOSING) {
TRACE(_T("WARNING: CMainFrame::CloseMedia() called twice or more\n"));
return;
}
int nTimeWaited = 0;
- while(m_iMediaLoadState == MLS_LOADING) {
+ while (m_iMediaLoadState == MLS_LOADING) {
m_fOpeningAborted = true;
- if(pGB) {
+ if (pGB) {
pGB->Abort(); // TODO: lock on graph objects somehow, this is not thread safe
}
- if(nTimeWaited > 5*1000 && m_pGraphThread) {
+ if (nTimeWaited > 5*1000 && m_pGraphThread) {
MessageBeep(MB_ICONEXCLAMATION);
TRACE(_T("CRITICAL ERROR: !!! Must kill opener thread !!!"));
TerminateThread(m_pGraphThread->m_hThread, (DWORD)-1);
@@ -14016,7 +14038,7 @@ void CMainFrame::CloseMedia() OnFilePostClosemedia();
- if(m_pGraphThread && m_bOpenedThruThread) {
+ if (m_pGraphThread && m_bOpenedThruThread) {
CAMEvent e;
m_pGraphThread->PostThreadMessage(CGraphThread::TM_CLOSE, 0, (LPARAM)&e);
e.Wait(); // either opening or closing has to be blocked to prevent reentering them, closing is the better choice
@@ -14033,7 +14055,7 @@ void CMainFrame::CloseMedia() void CMainFrame::StartTunerScan(CAutoPtr<TunerScanData> pTSD)
{
- if(m_pGraphThread) {
+ if (m_pGraphThread) {
m_pGraphThread->PostThreadMessage(CGraphThread::TM_TUNER_SCAN, 0, (LPARAM)pTSD.Detach());
} else {
DoTunerScan(pTSD);
@@ -14061,7 +14083,7 @@ void CMainFrame::DisplayCurrentChannelOSD() }
NowNext.cPresent.Insert(0,_T(" "));
osd = pChannel->GetName()+ NowNext.cPresent;
- if(i > 0) {
+ if (i > 0) {
osd.Delete(i, osd.GetLength()-i);
}
m_OSD.DisplayMessage(OSD_TOPLEFT, osd ,3500);
@@ -14084,7 +14106,7 @@ void CMainFrame::DisplayCurrentChannelInfo() osd = NowNext.cPresent + _T(". ") + NowNext.StartTime + _T(" - ") + NowNext.Duration + _T(". ") + NowNext.SummaryDesc +_T(" ");
int i = osd.Find(_T("\n"));
- if(i > 0) {
+ if (i > 0) {
osd.Delete(i, osd.GetLength()-i);
}
m_OSD.DisplayMessage(OSD_TOPLEFT, osd ,8000, 12);
@@ -14122,7 +14144,7 @@ END_MESSAGE_MAP() void CGraphThread::OnExit(WPARAM wParam, LPARAM lParam)
{
PostQuitMessage(0);
- if(CAMEvent* e = (CAMEvent*)lParam) {
+ if (CAMEvent* e = (CAMEvent*)lParam) {
e->Set();
}
}
@@ -14130,7 +14152,7 @@ void CGraphThread::OnExit(WPARAM wParam, LPARAM lParam) void CGraphThread::OnOpen(WPARAM wParam, LPARAM lParam)
{
TRACE("--> CGraphThread::OnOpen on thread: %d\n", GetCurrentThreadId());
- if(m_pMainFrame) {
+ if (m_pMainFrame) {
CAutoPtr<OpenMediaData> pOMD((OpenMediaData*)lParam);
m_pMainFrame->OpenMediaPrivate(pOMD);
}
@@ -14138,31 +14160,31 @@ void CGraphThread::OnOpen(WPARAM wParam, LPARAM lParam) void CGraphThread::OnClose(WPARAM wParam, LPARAM lParam)
{
- if(m_pMainFrame) {
+ if (m_pMainFrame) {
m_pMainFrame->CloseMediaPrivate();
}
- if(CAMEvent* e = (CAMEvent*)lParam) {
+ if (CAMEvent* e = (CAMEvent*)lParam) {
e->Set();
}
}
void CGraphThread::OnReset(WPARAM wParam, LPARAM lParam)
{
- if(m_pMainFrame) {
+ if (m_pMainFrame) {
BOOL* b = (BOOL*)wParam;
BOOL bResult = m_pMainFrame->ResetDevice();
if (b) {
*b = bResult;
}
}
- if(CAMEvent* e = (CAMEvent*)lParam) {
+ if (CAMEvent* e = (CAMEvent*)lParam) {
e->Set();
}
}
void CGraphThread::OnTunerScan(WPARAM wParam, LPARAM lParam)
{
- if(m_pMainFrame) {
+ if (m_pMainFrame) {
CAutoPtr<TunerScanData> pTSD((TunerScanData*)lParam);
m_pMainFrame->DoTunerScan(pTSD);
}
@@ -14170,7 +14192,7 @@ void CGraphThread::OnTunerScan(WPARAM wParam, LPARAM lParam) void CGraphThread::OnDisplayChange(WPARAM wParam, LPARAM lParam)
{
- if(m_pMainFrame) {
+ if (m_pMainFrame) {
m_pMainFrame->DisplayChange();
}
}
@@ -14192,7 +14214,7 @@ void CMainFrame::SetPlayState(MPC_PLAYSTATE iState) }
// Prevent sleep when playing audio and/or video, but allow screensaver when only audio
- if(!m_fAudioOnly) {
+ if (!m_fAudioOnly) {
SetThreadExecutionState (iState == PS_PLAY ? ES_CONTINUOUS | ES_DISPLAY_REQUIRED | ES_SYSTEM_REQUIRED : ES_CONTINUOUS);
} else {
SetThreadExecutionState (iState == PS_PLAY ? ES_CONTINUOUS | ES_SYSTEM_REQUIRED : ES_CONTINUOUS);
@@ -14221,20 +14243,20 @@ bool CMainFrame::CreateFullScreenWindow() AppSettings& s = AfxGetAppSettings();
hMonitor = NULL;
- if(!s.iMonitor) {
- if(s.strFullScreenMonitor == _T("Current")) {
+ if (!s.iMonitor) {
+ if (s.strFullScreenMonitor == _T("Current")) {
hMonitor = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST);
} else {
for ( int i = 0; i < monitors.GetCount(); i++ ) {
monitor = monitors.GetMonitor( i );
monitor.GetName(str);
- if((monitor.IsMonitor()) && (s.strFullScreenMonitor == str)) {
+ if ((monitor.IsMonitor()) && (s.strFullScreenMonitor == str)) {
hMonitor = monitor;
break;
}
}
- if(!hMonitor) {
+ if (!hMonitor) {
hMonitor = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST);
}
}
@@ -14277,7 +14299,7 @@ void CMainFrame::SetVMR9ColorControl(float dBrightness, float dContrast, float d {
VMR9ProcAmpControl ClrControl;
- if(m_pMC && !AfxGetAppSettings().m_RenderersSettings.fVMR9MixerYUV) {
+ if (m_pMC && !AfxGetAppSettings().m_RenderersSettings.fVMR9MixerYUV) {
ClrControl.dwSize = sizeof(ClrControl);
ClrControl.dwFlags = ProcAmpControl9_Mask;
ClrControl.Brightness = dBrightness;
@@ -14291,7 +14313,7 @@ void CMainFrame::SetVMR9ColorControl(float dBrightness, float dContrast, float d LPCTSTR CMainFrame::GetDVDAudioFormatName (DVD_AudioAttributes& ATR) const
{
- switch(ATR.AudioFormat) {
+ switch (ATR.AudioFormat) {
case DVD_AudioFormat_AC3:
return _T("AC3");
case DVD_AudioFormat_MPEG1:
@@ -14346,7 +14368,7 @@ afx_msg void CMainFrame::OnShiftSubtitle(UINT nID) afx_msg void CMainFrame::OnSubtitleDelay(UINT nID)
{
- if(m_pCAP) {
+ if (m_pCAP) {
if (m_pSubStreams.IsEmpty()) {
SendStatusMessage(ResStr(IDS_SUBTITLES_ERROR), 3000);
return;
@@ -14355,7 +14377,7 @@ afx_msg void CMainFrame::OnSubtitleDelay(UINT nID) int newDelay;
int oldDelay = m_pCAP->GetSubtitleDelay();
- if(nID == ID_SUB_DELAY_DOWN) {
+ if (nID == ID_SUB_DELAY_DOWN) {
newDelay = oldDelay-AfxGetAppSettings().nSubDelayInterval;
} else {
newDelay = oldDelay+AfxGetAppSettings().nSubDelayInterval;
@@ -14462,11 +14484,11 @@ void CMainFrame::ProcessAPICommand(COPYDATASTRUCT* pCDS) // imianz: quick and dirty trick
// Pause->SeekTo->Play (in place of SeekTo only) seems to prevents in most cases
// some strange video effects on avi files (ex. locks a while and than running fast).
- if(!m_fAudioOnly) {
+ if (!m_fAudioOnly) {
SendMessage(WM_COMMAND, ID_PLAY_PAUSE);
}
SeekTo(rtPos);
- if(!m_fAudioOnly) {
+ if (!m_fAudioOnly) {
SendMessage(WM_COMMAND, ID_PLAY_PLAY);
// show current position overridden by play command
m_OSD.DisplayMessage(OSD_TOPLEFT, m_wndStatusBar.GetStatusTimer(), 2000);
@@ -14556,12 +14578,12 @@ void CMainFrame::SendAPICommand (MPCAPI_COMMAND nCommand, LPCWSTR fmt, ...) void CMainFrame::SendNowPlayingToApi()
{
- if(!AfxGetAppSettings().hMasterWnd) {
+ if (!AfxGetAppSettings().hMasterWnd) {
return;
}
- if(m_iMediaLoadState == MLS_LOADED) {
+ if (m_iMediaLoadState == MLS_LOADED) {
CPlaylistItem pli;
CString title, author, description;
CString label;
@@ -14573,19 +14595,19 @@ void CMainFrame::SendNowPlayingToApi() m_wndInfoBar.GetLine(ResStr(IDS_INFOBAR_DESCRIPTION), description);
m_wndPlaylistBar.GetCur(pli);
- if(!pli.m_fns.IsEmpty()) {
+ if (!pli.m_fns.IsEmpty()) {
label = !pli.m_label.IsEmpty() ? pli.m_label : pli.m_fns.GetHead();
- if(GetPlaybackMode() == PM_FILE) {
+ if (GetPlaybackMode() == PM_FILE) {
pMS->GetDuration(&rtDur);
DVD_HMSF_TIMECODE tcDur = RT2HMSF(rtDur);
lDuration = tcDur.bHours*60*60 + tcDur.bMinutes*60 + tcDur.bSeconds;
}
/*CString label = !pli.m_label.IsEmpty() ? pli.m_label : pli.m_fns.GetHead();
- if(GetPlaybackMode() == PM_FILE)
+ if (GetPlaybackMode() == PM_FILE)
{
CString fn = label;
- if(fn.Find(_T("://")) >= 0) {int i = fn.Find('?'); if(i >= 0) fn = fn.Left(i);}
+ if (fn.Find(_T("://")) >= 0) {int i = fn.Find('?'); if (i >= 0) fn = fn.Left(i);}
CPath path(fn);
path.StripPath();
path.MakePretty();
@@ -14593,12 +14615,12 @@ void CMainFrame::SendNowPlayingToApi() title = (LPCTSTR)path;
author.Empty();
}
- else if(GetPlaybackMode() == PM_CAPTURE)
+ else if (GetPlaybackMode() == PM_CAPTURE)
{
title = label != pli.m_fns.GetHead() ? label : _T("Live");
author.Empty();
}
- else if(GetPlaybackMode() == PM_DVD)
+ else if (GetPlaybackMode() == PM_DVD)
{
title = _T("DVD");
author.Empty();
@@ -14625,14 +14647,14 @@ void CMainFrame::SendSubtitleTracksToApi() CStringW strSubs;
POSITION pos = m_pSubStreams.GetHeadPosition();
- if(m_iMediaLoadState == MLS_LOADED) {
+ if (m_iMediaLoadState == MLS_LOADED) {
if (pos) {
- while(pos) {
+ while (pos) {
CComPtr<ISubStream> pSubStream = m_pSubStreams.GetNext(pos);
- for(int i = 0, j = pSubStream->GetStreamCount(); i < j; i++) {
+ for (int i = 0, j = pSubStream->GetStreamCount(); i < j; i++) {
WCHAR* pName = NULL;
- if(SUCCEEDED(pSubStream->GetStreamInfo(i, &pName, NULL))) {
+ if (SUCCEEDED(pSubStream->GetStreamInfo(i, &pName, NULL))) {
CString name(pName);
if (!strSubs.IsEmpty()) {
strSubs.Append (L"|");
@@ -14643,8 +14665,8 @@ void CMainFrame::SendSubtitleTracksToApi() }
}
}
- if(AfxGetAppSettings().fEnableSubtitles) {
- if(m_iSubtitleSel >= 0) {
+ if (AfxGetAppSettings().fEnableSubtitles) {
+ if (m_iSubtitleSel >= 0) {
strSubs.AppendFormat(L"|%i", m_iSubtitleSel);
} else {
strSubs.Append(L"|-1");
@@ -14666,25 +14688,25 @@ void CMainFrame::SendAudioTracksToApi() {
CStringW strAudios;
- if(m_iMediaLoadState == MLS_LOADED) {
+ if (m_iMediaLoadState == MLS_LOADED) {
CComQIPtr<IAMStreamSelect> pSS = FindFilter(__uuidof(CAudioSwitcherFilter), pGB);
- if(!pSS) {
+ if (!pSS) {
pSS = FindFilter(L"{D3CD7858-971A-4838-ACEC-40CA5D529DC8}", pGB); // morgan's switcher
}
DWORD cStreams = 0;
- if(pSS && SUCCEEDED(pSS->Count(&cStreams))) {
+ if (pSS && SUCCEEDED(pSS->Count(&cStreams))) {
int currentStream = -1;
- for(int i = 0; i < (int)cStreams; i++) {
+ for (int i = 0; i < (int)cStreams; i++) {
AM_MEDIA_TYPE* pmt = NULL;
DWORD dwFlags = 0;
LCID lcid = 0;
DWORD dwGroup = 0;
WCHAR* pszName = NULL;
- if(FAILED(pSS->Info(i, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) {
+ if (FAILED(pSS->Info(i, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) {
return;
}
- if(dwFlags == AMSTREAMSELECTINFO_EXCLUSIVE) {
+ if (dwFlags == AMSTREAMSELECTINFO_EXCLUSIVE) {
currentStream = i;
}
CString name(pszName);
@@ -14693,10 +14715,10 @@ void CMainFrame::SendAudioTracksToApi() }
name.Replace(L"|", L"\\|");
strAudios.AppendFormat(L"%s", name);
- if(pmt) {
+ if (pmt) {
DeleteMediaType(pmt);
}
- if(pszName) {
+ if (pszName) {
CoTaskMemFree(pszName);
}
}
@@ -14719,12 +14741,12 @@ void CMainFrame::SendPlaylistToApi() int index;
POSITION pos = m_wndPlaylistBar.m_pl.GetHeadPosition(), pos2;
- while(pos) {
+ while (pos) {
CPlaylistItem& pli = m_wndPlaylistBar.m_pl.GetNext(pos);
- if(pli.m_type == CPlaylistItem::file) {
+ if (pli.m_type == CPlaylistItem::file) {
pos2 = pli.m_fns.GetHeadPosition();
- while(pos2) {
+ while (pos2) {
CString fn = pli.m_fns.GetNext(pos2);
if (!strPlaylist.IsEmpty()) {
strPlaylist.Append (L"|");
@@ -14745,15 +14767,15 @@ void CMainFrame::SendPlaylistToApi() void CMainFrame::SendCurrentPositionToApi(bool fNotifySeek)
{
- if(!AfxGetAppSettings().hMasterWnd) {
+ if (!AfxGetAppSettings().hMasterWnd) {
return;
}
- if(m_iMediaLoadState == MLS_LOADED) {
+ if (m_iMediaLoadState == MLS_LOADED) {
long lPosition = 0;
REFERENCE_TIME rtCur;
- if(m_iPlaybackMode == PM_FILE) {
+ if (m_iPlaybackMode == PM_FILE) {
pMS->GetCurrentPosition(&rtCur);
DVD_HMSF_TIMECODE tcCur = RT2HMSF(rtCur);
lPosition = tcCur.bHours*60*60 + tcCur.bMinutes*60 + tcCur.bSeconds;
@@ -14773,11 +14795,11 @@ void CMainFrame::ShowOSDCustomMessageApi(MPC_OSDDATA *osdData) void CMainFrame::JumpOfNSeconds(int nSeconds)
{
- if(m_iMediaLoadState == MLS_LOADED) {
+ if (m_iMediaLoadState == MLS_LOADED) {
long lPosition = 0;
REFERENCE_TIME rtCur;
- if(m_iPlaybackMode == PM_FILE) {
+ if (m_iPlaybackMode == PM_FILE) {
pMS->GetCurrentPosition(&rtCur);
DVD_HMSF_TIMECODE tcCur = RT2HMSF(rtCur);
lPosition = tcCur.bHours*60*60 + tcCur.bMinutes*60 + tcCur.bSeconds + nSeconds;
@@ -14791,11 +14813,11 @@ void CMainFrame::JumpOfNSeconds(int nSeconds) // quick and dirty trick:
// pause->seekto->play seems to prevents some strange
// video effect (ex. locks for a while and than running fast)
- if(!m_fAudioOnly) {
+ if (!m_fAudioOnly) {
SendMessage(WM_COMMAND, ID_PLAY_PAUSE);
}
SeekTo(rtCur);
- if(!m_fAudioOnly) {
+ if (!m_fAudioOnly) {
SendMessage(WM_COMMAND, ID_PLAY_PLAY);
// show current position overridden by play command
m_OSD.DisplayMessage(OSD_TOPLEFT, m_wndStatusBar.GetStatusTimer(), 2000);
@@ -14814,38 +14836,38 @@ void CMainFrame::JumpOfNSeconds(int nSeconds) // int DefSubtitleLanguageIndex[2] = {-1, -1};
// LCID Language = MAKELCID( MAKELANGID(LANG_FRENCH, SUBLANG_DEFAULT), SORT_DEFAULT);
//
-// if((m_iMediaLoadState == MLS_LOADING) || (m_iMediaLoadState == MLS_LOADED))
+// if ((m_iMediaLoadState == MLS_LOADING) || (m_iMediaLoadState == MLS_LOADED))
// {
-// if(GetPlaybackMode() == PM_FILE)
+// if (GetPlaybackMode() == PM_FILE)
// {
// CComQIPtr<IAMStreamSelect> pSS = FindFilter(__uuidof(CAudioSwitcherFilter), pGB);
-// if(!pSS) pSS = FindFilter(L"{D3CD7858-971A-4838-ACEC-40CA5D529DC8}", pGB); // morgan's switcher
+// if (!pSS) pSS = FindFilter(L"{D3CD7858-971A-4838-ACEC-40CA5D529DC8}", pGB); // morgan's switcher
//
// DWORD cStreams = 0;
-// if(pSS && SUCCEEDED(pSS->Count(&cStreams)))
+// if (pSS && SUCCEEDED(pSS->Count(&cStreams)))
// {
-// for(int i = 0; i < (int)cStreams; i++)
+// for (int i = 0; i < (int)cStreams; i++)
// {
// AM_MEDIA_TYPE* pmt = NULL;
// DWORD dwFlags = 0;
// LCID lcid = 0;
// DWORD dwGroup = 0;
// WCHAR* pszName = NULL;
-// if(FAILED(pSS->Info(i, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL)))
+// if (FAILED(pSS->Info(i, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL)))
// return;
// }
// }
//
// POSITION pos = m_pSubStreams.GetHeadPosition();
-// while(pos)
+// while (pos)
// {
// CComPtr<ISubStream> pSubStream = m_pSubStreams.GetNext(pos);
-// if(!pSubStream) continue;
+// if (!pSubStream) continue;
//
-// for(int i = 0, j = pSubStream->GetStreamCount(); i < j; i++)
+// for (int i = 0, j = pSubStream->GetStreamCount(); i < j; i++)
// {
// WCHAR* pName = NULL;
-// if(SUCCEEDED(pSubStream->GetStreamInfo(i, &pName, &Language)))
+// if (SUCCEEDED(pSubStream->GetStreamInfo(i, &pName, &Language)))
// {
// if (DefAudioLanguageLcid[0] == Language) DefSubtitleLanguageIndex[0] = i;
// if (DefSubtitleLanguageLcid[1] == Language) DefSubtitleLanguageIndex[1] = i;
@@ -14854,17 +14876,17 @@ void CMainFrame::JumpOfNSeconds(int nSeconds) // }
// }
// }
-// else if(GetPlaybackMode() == PM_DVD)
+// else if (GetPlaybackMode() == PM_DVD)
// {
// ULONG ulStreamsAvailable, ulCurrentStream;
// BOOL bIsDisabled;
//
-// if(SUCCEEDED(pDVDI->GetCurrentSubpicture(&ulStreamsAvailable, &ulCurrentStream, &bIsDisabled)))
+// if (SUCCEEDED(pDVDI->GetCurrentSubpicture(&ulStreamsAvailable, &ulCurrentStream, &bIsDisabled)))
// {
-// for(ULONG i = 0; i < ulStreamsAvailable; i++)
+// for (ULONG i = 0; i < ulStreamsAvailable; i++)
// {
// DVD_SubpictureAttributes ATR;
-// if(SUCCEEDED(pDVDI->GetSubpictureLanguage(i, &Language)))
+// if (SUCCEEDED(pDVDI->GetSubpictureLanguage(i, &Language)))
// {
// // Auto select forced subtitle
// if ((DefAudioLanguageLcid[0] == Language) && (ATR.LanguageExtension == DVD_SP_EXT_Forced))
@@ -14875,11 +14897,11 @@ void CMainFrame::JumpOfNSeconds(int nSeconds) // }
// }
//
-// if(SUCCEEDED(pDVDI->GetCurrentAudio(&ulStreamsAvailable, &ulCurrentStream)))
+// if (SUCCEEDED(pDVDI->GetCurrentAudio(&ulStreamsAvailable, &ulCurrentStream)))
// {
-// for(ULONG i = 0; i < ulStreamsAvailable; i++)
+// for (ULONG i = 0; i < ulStreamsAvailable; i++)
// {
-// if(SUCCEEDED(pDVDI->GetAudioLanguage(i, &Language)))
+// if (SUCCEEDED(pDVDI->GetAudioLanguage(i, &Language)))
// {
// if (DefAudioLanguageLcid[0] == Language) DefAudioLanguageIndex[0] = i;
// if (DefAudioLanguageLcid[1] == Language) DefAudioLanguageIndex[1] = i;
@@ -14907,7 +14929,7 @@ void CMainFrame::JumpOfNSeconds(int nSeconds) void CMainFrame::OnFileOpendirectory()
{
- if(m_iMediaLoadState == MLS_LOADING || !IsWindow(m_wndPlaylistBar)) {
+ if (m_iMediaLoadState == MLS_LOADING || !IsWindow(m_wndPlaylistBar)) {
return;
}
@@ -14935,22 +14957,22 @@ void CMainFrame::OnFileOpendirectory() static LPITEMIDLIST iil;
iil = SHBrowseForFolder(&bi);
- if(iil) {
+ if (iil) {
SHGetPathFromIDList(iil, path);
CString _path = path;
_path.Replace('/', '\\');
- if(_path[_path.GetLength()-1] != '\\') {
+ if (_path[_path.GetLength()-1] != '\\') {
_path += '\\';
}
s.strLastOpenDir = _path;
CAtlList<CString> sl;
sl.AddTail(_path);
- if(COpenDirHelper::m_incl_subdir) {
+ if (COpenDirHelper::m_incl_subdir) {
COpenDirHelper::RecurseAddDir(_path, &sl);
}
- if(m_wndPlaylistBar.IsWindowVisible()) {
+ if (m_wndPlaylistBar.IsWindowVisible()) {
m_wndPlaylistBar.Append(sl, true);
} else {
m_wndPlaylistBar.Open(sl, true);
@@ -14963,7 +14985,7 @@ void CMainFrame::OnFileOpendirectory() HRESULT CMainFrame::CreateThumbnailToolbar()
{
- if(!AfxGetAppSettings().fUseWin7TaskBar) {
+ if (!AfxGetAppSettings().fUseWin7TaskBar) {
return E_FAIL;
}
@@ -14973,7 +14995,7 @@ HRESULT CMainFrame::CreateThumbnailToolbar() return E_FAIL;
}
- if(m_pTaskbarList) {
+ if (m_pTaskbarList) {
m_pTaskbarList->Release();
}
HRESULT hr = CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&m_pTaskbarList));
@@ -15217,9 +15239,9 @@ HRESULT CMainFrame::UpdateThumbnailClip() LRESULT CMainFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
- if((message == WM_COMMAND) && (THBN_CLICKED == HIWORD(wParam))) {
+ if ((message == WM_COMMAND) && (THBN_CLICKED == HIWORD(wParam))) {
int const wmId = LOWORD(wParam);
- switch(wmId) {
+ switch (wmId) {
case IDTB_BUTTON1:
SendMessage(WM_COMMAND, ID_PLAY_STOP);
break;
@@ -15239,7 +15261,7 @@ LRESULT CMainFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) case IDTB_BUTTON5:
WINDOWPLACEMENT wp;
GetWindowPlacement(&wp);
- if(wp.showCmd == SW_SHOWMINIMIZED) {
+ if (wp.showCmd == SW_SHOWMINIMIZED) {
SendMessage(WM_SYSCOMMAND, SC_RESTORE, -1);
}
SetForegroundWindow();
diff --git a/src/apps/mplayerc/MainFrm.h b/src/apps/mplayerc/MainFrm.h index d936b9c4f..44095c8cd 100644 --- a/src/apps/mplayerc/MainFrm.h +++ b/src/apps/mplayerc/MainFrm.h @@ -221,7 +221,7 @@ class CMainFrame : public CFrameWnd, public CDropTarget CCritSec m_csSubLock;
CInterfaceList<ISubStream> m_pSubStreams;
CAtlList<int> m_iAudioStreams; // foxX uses this to keep a mapping of audio streams, in which they're ordered based by language user preference
- int m_iSubtitleSel; // if(m_iSubtitleSel&(1<<31)): disabled
+ int m_iSubtitleSel; // if (m_iSubtitleSel&(1<<31)): disabled
DWORD_PTR m_nSubtitleId;
friend class CTextPassThruFilter;
diff --git a/src/apps/mplayerc/MediaFormats.cpp b/src/apps/mplayerc/MediaFormats.cpp index 2310e9e01..aa36ed81e 100644 --- a/src/apps/mplayerc/MediaFormats.cpp +++ b/src/apps/mplayerc/MediaFormats.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -54,7 +54,7 @@ CMediaFormatCategory::CMediaFormatCategory( m_label = label;
ExplodeMin(exts, m_exts, ' ');
POSITION pos = m_exts.GetHeadPosition();
- while(pos) {
+ while (pos) {
m_exts.GetNext(pos).TrimLeft('.');
}
@@ -70,7 +70,7 @@ CMediaFormatCategory::~CMediaFormatCategory() void CMediaFormatCategory::UpdateData(bool fSave)
{
- if(fSave) {
+ if (fSave) {
AfxGetApp()->WriteProfileString(_T("FileFormats"), m_label, GetExts(true));
} else {
SetExts(AfxGetApp()->GetProfileString(_T("FileFormats"), m_label, GetExts(true)));
@@ -84,7 +84,7 @@ CMediaFormatCategory::CMediaFormatCategory(const CMediaFormatCategory& mfc) CMediaFormatCategory& CMediaFormatCategory::operator = (const CMediaFormatCategory& mfc)
{
- if(this != &mfc) {
+ if (this != &mfc) {
m_label = mfc.m_label;
m_specreqnote = mfc.m_specreqnote;
m_exts.RemoveAll();
@@ -114,10 +114,10 @@ void CMediaFormatCategory::SetExts(CString exts) m_exts.RemoveAll();
ExplodeMin(exts, m_exts, ' ');
POSITION pos = m_exts.GetHeadPosition();
- while(pos) {
+ while (pos) {
POSITION cur = pos;
CString& ext = m_exts.GetNext(pos);
- if(ext[0] == '\\') {
+ if (ext[0] == '\\') {
m_engine = (engine_t)_tcstol(ext.TrimLeft('\\'), NULL, 10);
m_exts.RemoveAt(cur);
} else {
@@ -130,7 +130,7 @@ CString CMediaFormatCategory::GetFilter() {
CString filter;
POSITION pos = m_exts.GetHeadPosition();
- while(pos) {
+ while (pos) {
filter += _T("*.") + m_exts.GetNext(pos) + _T(";");
}
filter.TrimRight(_T(";")); // cheap...
@@ -140,7 +140,7 @@ CString CMediaFormatCategory::GetFilter() CString CMediaFormatCategory::GetExts(bool fAppendEngine)
{
CString exts = Implode(m_exts, ' ');
- if(fAppendEngine) {
+ if (fAppendEngine) {
exts += CString(_T(" \\")) + (TCHAR)(0x30 + (int)m_engine);
}
return(exts);
@@ -150,11 +150,11 @@ CString CMediaFormatCategory::GetExtsWithPeriod(bool fAppendEngine) {
CString exts;
POSITION pos = m_exts.GetHeadPosition();
- while(pos) {
+ while (pos) {
exts += _T(".") + m_exts.GetNext(pos) + _T(" ");
}
exts.TrimRight(_T(" ")); // cheap...
- if(fAppendEngine) {
+ if (fAppendEngine) {
exts += CString(_T(" \\")) + (TCHAR)(0x30 + (int)m_engine);
}
return(exts);
@@ -164,11 +164,11 @@ CString CMediaFormatCategory::GetBackupExtsWithPeriod(bool fAppendEngine) {
CString exts;
POSITION pos = m_backupexts.GetHeadPosition();
- while(pos) {
+ while (pos) {
exts += _T(".") + m_backupexts.GetNext(pos) + _T(" ");
}
exts.TrimRight(_T(" ")); // cheap...
- if(fAppendEngine) {
+ if (fAppendEngine) {
exts += CString(_T(" \\")) + (TCHAR)(0x30 + (int)m_engine);
}
return(exts);
@@ -188,7 +188,7 @@ CMediaFormats::~CMediaFormats() void CMediaFormats::UpdateData(bool fSave)
{
- if(fSave) {
+ if (fSave) {
AfxGetApp()->WriteProfileString(_T("FileFormats"), NULL, NULL);
AfxGetApp()->WriteProfileInt(_T("FileFormats"), _T("RtspHandler"), m_iRtspHandler);
@@ -261,7 +261,7 @@ void CMediaFormats::UpdateData(bool fSave) m_fRtspFileExtFirst = !!AfxGetApp()->GetProfileInt(_T("FileFormats"), _T("RtspFileExtFirst"), 1);
}
- for(int i = 0; i < GetCount(); i++) {
+ for (int i = 0; i < GetCount(); i++) {
GetAt(i).UpdateData(fSave);
}
}
@@ -287,31 +287,31 @@ engine_t CMediaFormats::GetEngine(CString path) {
path.Trim().MakeLower();
- if(!m_fRtspFileExtFirst && path.Find(_T("rtsp://")) == 0) {
+ if (!m_fRtspFileExtFirst && path.Find(_T("rtsp://")) == 0) {
return m_iRtspHandler;
}
CString ext = CPath(path).GetExtension();
ext.MakeLower();
- if(!ext.IsEmpty()) {
- if(path.Find(_T("rtsp://")) == 0) {
- if(ext == _T(".ram") || ext == _T(".rm") || ext == _T(".ra")) {
+ if (!ext.IsEmpty()) {
+ if (path.Find(_T("rtsp://")) == 0) {
+ if (ext == _T(".ram") || ext == _T(".rm") || ext == _T(".ra")) {
return RealMedia;
}
- if(ext == _T(".qt") || ext == _T(".mov")) {
+ if (ext == _T(".qt") || ext == _T(".mov")) {
return QuickTime;
}
}
- for(int i = 0; i < GetCount(); i++) {
+ for (int i = 0; i < GetCount(); i++) {
CMediaFormatCategory& mfc = GetAt(i);
- if(mfc.FindExt(ext)) {
+ if (mfc.FindExt(ext)) {
return mfc.GetEngineType();
}
}
}
- if(m_fRtspFileExtFirst && path.Find(_T("rtsp://")) == 0) {
+ if (m_fRtspFileExtFirst && path.Find(_T("rtsp://")) == 0) {
return m_iRtspHandler;
}
@@ -322,10 +322,10 @@ bool CMediaFormats::FindExt(CString ext, bool fAudioOnly) {
ext.TrimLeft(_T("."));
- if(!ext.IsEmpty()) {
- for(int i = 0; i < GetCount(); i++) {
+ if (!ext.IsEmpty()) {
+ for (int i = 0; i < GetCount(); i++) {
CMediaFormatCategory& mfc = GetAt(i);
- if((!fAudioOnly || mfc.IsAudioOnly()) && mfc.FindExt(ext)) {
+ if ((!fAudioOnly || mfc.IsAudioOnly()) && mfc.FindExt(ext)) {
return(true);
}
}
@@ -341,7 +341,7 @@ void CMediaFormats::GetFilter(CString& filter, CAtlArray<CString>& mask) filter += ResStr(IDS_MEDIAFORMATS_34);
mask.Add(_T(""));
- for(int i = 0; i < GetCount(); i++) {
+ for (int i = 0; i < GetCount(); i++) {
strTemp = GetAt(i).GetFilter() + _T(";");
mask[0] += strTemp;
filter += strTemp;
@@ -350,7 +350,7 @@ void CMediaFormats::GetFilter(CString& filter, CAtlArray<CString>& mask) filter.TrimRight(_T(";"));
filter += _T("|");
- for(int i = 0; i < GetCount(); i++) {
+ for (int i = 0; i < GetCount(); i++) {
CMediaFormatCategory& mfc = GetAt(i);
filter += mfc.GetLabel() + _T("|" + GetAt(i).GetFilter() + _T("|"));
mask.Add(mfc.GetFilter());
@@ -368,9 +368,9 @@ void CMediaFormats::GetAudioFilter(CString& filter, CAtlArray<CString>& mask) filter += ResStr(IDS_MEDIAFORMATS_36);
mask.Add(_T(""));
- for(int i = 0; i < GetCount(); i++) {
+ for (int i = 0; i < GetCount(); i++) {
CMediaFormatCategory& mfc = GetAt(i);
- if(!mfc.IsAudioOnly() || mfc.GetEngineType() != DirectShow) {
+ if (!mfc.IsAudioOnly() || mfc.GetEngineType() != DirectShow) {
continue;
}
strTemp = GetAt(i).GetFilter() + _T(";");
@@ -382,9 +382,9 @@ void CMediaFormats::GetAudioFilter(CString& filter, CAtlArray<CString>& mask) filter.TrimRight(_T(";"));
filter += _T("|");
- for(int i = 0; i < GetCount(); i++) {
+ for (int i = 0; i < GetCount(); i++) {
CMediaFormatCategory& mfc = GetAt(i);
- if(!mfc.IsAudioOnly() || mfc.GetEngineType() != DirectShow) {
+ if (!mfc.IsAudioOnly() || mfc.GetEngineType() != DirectShow) {
continue;
}
filter += mfc.GetLabel() + _T("|") + GetAt(i).GetFilter() + _T("|");
diff --git a/src/apps/mplayerc/MediaTypesDlg.cpp b/src/apps/mplayerc/MediaTypesDlg.cpp index 9512ef25f..330c3f203 100644 --- a/src/apps/mplayerc/MediaTypesDlg.cpp +++ b/src/apps/mplayerc/MediaTypesDlg.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -61,9 +61,9 @@ void CMediaTypesDlg::AddLine(CString str) void CMediaTypesDlg::AddMediaType(AM_MEDIA_TYPE* pmt)
{
m_subtype = pmt->subtype;
- if(pmt->majortype == MEDIATYPE_Video) {
+ if (pmt->majortype == MEDIATYPE_Video) {
m_type = VIDEO;
- } else if(pmt->majortype == MEDIATYPE_Audio) {
+ } else if (pmt->majortype == MEDIATYPE_Audio) {
m_type = AUDIO;
} else {
m_type = UNKNOWN;
@@ -72,7 +72,7 @@ void CMediaTypesDlg::AddMediaType(AM_MEDIA_TYPE* pmt) CAtlList<CString> sl;
CMediaTypeEx(*pmt).Dump(sl);
POSITION pos = sl.GetHeadPosition();
- while(pos) {
+ while (pos) {
AddLine(sl.GetNext(pos) + '\n');
}
}
@@ -91,8 +91,8 @@ BOOL CMediaTypesDlg::OnInitDialog() CAtlList<CStringW> path;
CAtlList<CMediaType> mts;
- for(int i = 0; S_OK == m_pGBDE->GetDeadEnd(i, path, mts); i++) {
- if(!path.GetCount()) {
+ for (int i = 0; S_OK == m_pGBDE->GetDeadEnd(i, path, mts); i++) {
+ if (!path.GetCount()) {
continue;
}
m_pins.SetItemData(m_pins.AddString(CString(path.GetTail())), (DWORD_PTR)i);
@@ -118,27 +118,27 @@ void CMediaTypesDlg::OnCbnSelchangeCombo1() m_report.SetWindowText(_T(""));
int i = m_pins.GetCurSel();
- if(i < 0) {
+ if (i < 0) {
return;
}
CAtlList<CStringW> path;
CAtlList<CMediaType> mts;
- if(FAILED(m_pGBDE->GetDeadEnd(i, path, mts)) || !path.GetCount()) {
+ if (FAILED(m_pGBDE->GetDeadEnd(i, path, mts)) || !path.GetCount()) {
return;
}
POSITION pos = path.GetHeadPosition();
- while(pos) {
+ while (pos) {
AddLine(CString(path.GetNext(pos)) + _T("\n"));
- if(!pos) {
+ if (!pos) {
AddLine(_T("\n"));
}
}
pos = mts.GetHeadPosition();
- for(int j = 0; pos; j++) {
+ for (int j = 0; pos; j++) {
CString str;
str.Format(_T("Media Type %d:\n"), j);
AddLine(str);
diff --git a/src/apps/mplayerc/Mpeg2SectionData.cpp b/src/apps/mplayerc/Mpeg2SectionData.cpp index 9460cd87f..8a415796e 100644 --- a/src/apps/mplayerc/Mpeg2SectionData.cpp +++ b/src/apps/mplayerc/Mpeg2SectionData.cpp @@ -90,7 +90,7 @@ CString CMpeg2DataParser::ConvertString (BYTE* pBuffer, int nLength) }
nDestSize = MultiByteToWideChar (cp, MB_PRECOMPOSED, (LPCSTR)pBuffer, nLength, NULL, 0);
- if(nDestSize < 0) {
+ if (nDestSize < 0) {
return strResult;
}
diff --git a/src/apps/mplayerc/OpenDirHelper.cpp b/src/apps/mplayerc/OpenDirHelper.cpp index 170565e2c..727347521 100644 --- a/src/apps/mplayerc/OpenDirHelper.cpp +++ b/src/apps/mplayerc/OpenDirHelper.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -45,7 +45,7 @@ void COpenDirHelper::SetFont(HWND hwnd,LPTSTR FontName,int FontSize) hfOld = (HFONT)SendMessage(hwnd,WM_GETFONT,NULL,NULL); //get old font
SendMessage(hwnd,WM_SETFONT,(WPARAM)hf,TRUE); // set new font
- if(!hfOld && (hfOld!=hf)) {
+ if (!hfOld && (hfOld!=hf)) {
DeleteObject(hfOld); //if the old font is not system font or the same as newfont, release it.
}
ReleaseDC(hwnd,hdc);
@@ -55,8 +55,8 @@ void COpenDirHelper::SetFont(HWND hwnd,LPTSTR FontName,int FontSize) // Subclass procedure
LRESULT APIENTRY COpenDirHelper::CheckBoxSubclassProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
- if(uMsg==WM_LBUTTONUP) {
- if((SendMessage(hwnd,BM_GETCHECK,0,0))==1) {
+ if (uMsg == WM_LBUTTONUP) {
+ if ((SendMessage(hwnd,BM_GETCHECK,0,0) )== 1) {
m_incl_subdir = FALSE;
} else {
m_incl_subdir = TRUE;
@@ -70,7 +70,7 @@ int __stdcall COpenDirHelper::BrowseCallbackProcDIR(HWND hwnd,UINT uMsg,LPARAM HWND checkbox;
//Initialization callback message
- if(uMsg==BFFM_INITIALIZED) {
+ if (uMsg == BFFM_INITIALIZED) {
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)(LPCTSTR)strLastOpenDir);
RECT ListViewRect;
@@ -117,12 +117,12 @@ void COpenDirHelper::RecurseAddDir(CString path, CAtlList<CString>* sl) WIN32_FIND_DATA fd = {0};
HANDLE hFind = FindFirstFile(path + _T("*.*"), &fd);
- if(hFind != INVALID_HANDLE_VALUE) {
+ if (hFind != INVALID_HANDLE_VALUE) {
do {
CString f_name = fd.cFileName;
- if((fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && (f_name!=_T(".")) && (f_name!=_T(".."))) {
+ if ((fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && (f_name!=_T(".")) && (f_name!=_T(".."))) {
CString fullpath = path + f_name;
- if(fullpath[fullpath.GetLength()-1] != '\\') {
+ if (fullpath[fullpath.GetLength()-1] != '\\') {
fullpath += '\\';
}
sl->AddTail(fullpath);
@@ -130,7 +130,7 @@ void COpenDirHelper::RecurseAddDir(CString path, CAtlList<CString>* sl) } else {
continue;
}
- } while(FindNextFile(hFind, &fd));
+ } while (FindNextFile(hFind, &fd));
FindClose(hFind);
}
}
diff --git a/src/apps/mplayerc/OpenDlg.cpp b/src/apps/mplayerc/OpenDlg.cpp index 42d91f4ed..4f45785dc 100644 --- a/src/apps/mplayerc/OpenDlg.cpp +++ b/src/apps/mplayerc/OpenDlg.cpp @@ -74,8 +74,8 @@ BOOL COpenDlg::OnInitDialog() CRecentFileList& MRU = AfxGetAppSettings().MRU;
MRU.ReadList();
m_mrucombo.ResetContent();
- for(int i = 0; i < MRU.GetSize(); i++)
- if(!MRU[i].IsEmpty()) {
+ for (int i = 0; i < MRU.GetSize(); i++)
+ if (!MRU[i].IsEmpty()) {
m_mrucombo.AddString(MRU[i]);
}
CorrectComboListWidth(m_mrucombo, GetFont());
@@ -83,13 +83,13 @@ BOOL COpenDlg::OnInitDialog() CRecentFileList& MRUDub = AfxGetAppSettings().MRUDub;
MRUDub.ReadList();
m_mrucombo2.ResetContent();
- for(int i = 0; i < MRUDub.GetSize(); i++)
- if(!MRUDub[i].IsEmpty()) {
+ for (int i = 0; i < MRUDub.GetSize(); i++)
+ if (!MRUDub[i].IsEmpty()) {
m_mrucombo2.AddString(MRUDub[i]);
}
CorrectComboListWidth(m_mrucombo2, GetFont());
- if(m_mrucombo.GetCount() > 0) {
+ if (m_mrucombo.GetCount() > 0) {
m_mrucombo.SetCurSel(0);
}
@@ -130,30 +130,31 @@ void COpenDlg::OnBnClickedBrowsebutton() s.m_Formats.GetFilter(filter, mask);
DWORD dwFlags = OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_ALLOWMULTISELECT|OFN_ENABLEINCLUDENOTIFY|OFN_NOCHANGEDIR;
- if (!s.fKeepHistory)
+ if (!s.fKeepHistory) {
dwFlags |= OFN_DONTADDTORECENT;
+ }
COpenFileDlg fd(mask, true, NULL, m_path, dwFlags, filter, this);
- if(fd.DoModal() != IDOK) {
+ if (fd.DoModal() != IDOK) {
return;
}
m_fns.RemoveAll();
POSITION pos = fd.GetStartPosition();
- while(pos) {
+ while (pos) {
/*
CString str = fd.GetNextPathName(pos);
POSITION insertpos = m_fns.GetTailPosition();
- while(insertpos && GetFileName(str).CompareNoCase(GetFileName(m_fns.GetAt(insertpos))) <= 0)
+ while (insertpos && GetFileName(str).CompareNoCase(GetFileName(m_fns.GetAt(insertpos))) <= 0)
m_fns.GetPrev(insertpos);
- if(!insertpos) m_fns.AddHead(str);
+ if (!insertpos) m_fns.AddHead(str);
else m_fns.InsertAfter(insertpos, str);
*/
m_fns.AddTail(fd.GetNextPathName(pos));
}
- if(m_fns.GetCount() > 1
+ if (m_fns.GetCount() > 1
|| m_fns.GetCount() == 1
&& (m_fns.GetHead()[m_fns.GetHead().GetLength()-1] == '\\'
|| m_fns.GetHead()[m_fns.GetHead().GetLength()-1] == '*')) {
@@ -176,12 +177,13 @@ void COpenDlg::OnBnClickedBrowsebutton2() s.m_Formats.GetAudioFilter(filter, mask);
DWORD dwFlags = OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_ENABLEINCLUDENOTIFY|OFN_NOCHANGEDIR;
- if (!s.fKeepHistory)
+ if (!s.fKeepHistory) {
dwFlags |= OFN_DONTADDTORECENT;
+ }
COpenFileDlg fd(mask, false, NULL, m_path2, dwFlags, filter, this);
- if(fd.DoModal() != IDOK) {
+ if (fd.DoModal() != IDOK) {
return;
}
@@ -194,7 +196,7 @@ void COpenDlg::OnBnClickedOk() m_fns.RemoveAll();
m_fns.AddTail(m_path);
- if(m_mrucombo2.IsWindowEnabled()) {
+ if (m_mrucombo2.IsWindowEnabled()) {
m_fns.AddTail(m_path2);
}
diff --git a/src/apps/mplayerc/OpenFileDlg.cpp b/src/apps/mplayerc/OpenFileDlg.cpp index bb471d95d..085f6ab5c 100644 --- a/src/apps/mplayerc/OpenFileDlg.cpp +++ b/src/apps/mplayerc/OpenFileDlg.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -63,12 +63,12 @@ END_MESSAGE_MAP() LRESULT CALLBACK COpenFileDlg::WindowProcNew(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- if(message == WM_COMMAND && HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDOK
+ if (message == WM_COMMAND && HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDOK
&& m_fAllowDirSelection) {
CAutoVectorPtr<TCHAR> path;
path.Allocate(_MAX_PATH+1); // _MAX_PATH should be bigger for multiple selection, but we are only interested if it's zero length
// note: allocating _MAX_PATH only will cause a buffer overrun for too long strings, and will result in a silent app disappearing crash, 100% reproducible
- if(::GetDlgItemText(hwnd, cmb13, (TCHAR*)path, _MAX_PATH) == 0) {
+ if (::GetDlgItemText(hwnd, cmb13, (TCHAR*)path, _MAX_PATH) == 0) {
::SendMessage(hwnd, CDM_SETCONTROLTEXT, edt1, (LPARAM)__DUMMY__);
}
}
@@ -89,7 +89,7 @@ BOOL COpenFileDlg::OnInitDialog() void COpenFileDlg::OnDestroy()
{
int i = GetPathName().Find(__DUMMY__);
- if(i >= 0) {
+ if (i >= 0) {
m_pOFN->lpstrFile[i] = m_pOFN->lpstrFile[i+1] = 0;
}
@@ -107,9 +107,9 @@ BOOL COpenFileDlg::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) return TRUE;
}
- switch(pNotify->hdr.code) {
+ switch (pNotify->hdr.code) {
case CDN_INCLUDEITEM:
- if(OnIncludeItem((OFNOTIFYEX*)lParam, pResult)) {
+ if (OnIncludeItem((OFNOTIFYEX*)lParam, pResult)) {
return TRUE;
}
break;
@@ -121,13 +121,13 @@ BOOL COpenFileDlg::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) BOOL COpenFileDlg::OnIncludeItem(OFNOTIFYEX* pOFNEx, LRESULT* pResult)
{
TCHAR buff[_MAX_PATH];
- if(!SHGetPathFromIDList((LPCITEMIDLIST)pOFNEx->pidl, buff)) {
+ if (!SHGetPathFromIDList((LPCITEMIDLIST)pOFNEx->pidl, buff)) {
STRRET s;
HRESULT hr = ((IShellFolder*)pOFNEx->psf)->GetDisplayNameOf((LPCITEMIDLIST)pOFNEx->pidl, SHGDN_NORMAL|SHGDN_FORPARSING, &s);
- if(S_OK != hr) {
+ if (S_OK != hr) {
return FALSE;
}
- switch(s.uType) {
+ switch (s.uType) {
case STRRET_CSTR:
_tcscpy(buff, CString(s.cStr));
break;
@@ -143,12 +143,12 @@ BOOL COpenFileDlg::OnIncludeItem(OFNOTIFYEX* pOFNEx, LRESULT* pResult) CString fn(buff);
/*
WIN32_FILE_ATTRIBUTE_DATA fad;
- if(GetFileAttributesEx(fn, GetFileExInfoStandard, &fad)
+ if (GetFileAttributesEx(fn, GetFileExInfoStandard, &fad)
&& (fad.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY))
return FALSE;
*/
int i = fn.ReverseFind('.'), j = fn.ReverseFind('\\');
- if(i < 0 || i < j) {
+ if (i < 0 || i < j) {
return FALSE;
}
diff --git a/src/apps/mplayerc/PPageAccelTbl.cpp b/src/apps/mplayerc/PPageAccelTbl.cpp index c1e41aba6..f73728256 100644 --- a/src/apps/mplayerc/PPageAccelTbl.cpp +++ b/src/apps/mplayerc/PPageAccelTbl.cpp @@ -131,7 +131,7 @@ CPPageAccelTbl::~CPPageAccelTbl() BOOL CPPageAccelTbl::PreTranslateMessage(MSG* pMsg)
{
- if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN
+ if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN
&& (pMsg->hwnd == m_WinLircEdit.m_hWnd || pMsg->hwnd == m_UIceEdit.m_hWnd)) {
OnApply();
return TRUE;
@@ -143,7 +143,7 @@ BOOL CPPageAccelTbl::PreTranslateMessage(MSG* pMsg) void CPPageAccelTbl::SetupList()
{
- for(int row = 0; row < m_list.GetItemCount(); row++) {
+ for (int row = 0; row < m_list.GetItemCount(); row++) {
wmcmd& wc = m_wmcmds.GetAt((POSITION)m_list.GetItemData(row));
CString mod = MakeAccelModLabel(wc.fVirt);
@@ -174,25 +174,25 @@ void CPPageAccelTbl::SetupList() CString CPPageAccelTbl::MakeAccelModLabel(BYTE fVirt)
{
CString str;
- if(fVirt&FCONTROL) {
- if(!str.IsEmpty()) {
+ if (fVirt&FCONTROL) {
+ if (!str.IsEmpty()) {
str += _T(" + ");
}
str += _T("Ctrl");
}
- if(fVirt&FALT) {
- if(!str.IsEmpty()) {
+ if (fVirt&FALT) {
+ if (!str.IsEmpty()) {
str += _T(" + ");
}
str += _T("Alt");
}
- if(fVirt&FSHIFT) {
- if(!str.IsEmpty()) {
+ if (fVirt&FSHIFT) {
+ if (!str.IsEmpty()) {
str += _T(" + ");
}
str += _T("Shift");
}
- if(str.IsEmpty()) {
+ if (str.IsEmpty()) {
str = ResStr(IDS_AG_NONE);
}
return(str);
@@ -203,7 +203,7 @@ CString CPPageAccelTbl::MakeAccelVkeyLabel(WORD key, bool fVirtKey) // Reference page for Virtual-Key Codes: http://msdn.microsoft.com/en-us/library/ms645540
CString str;
- switch(key) {
+ switch (key) {
case VK_LBUTTON:
str = _T("VK_LBUTTON");
break;
@@ -748,7 +748,7 @@ CString CPPageAccelTbl::MakeAccelVkeyLabel(WORD key, bool fVirtKey) str = _T("Multimedia keys");
break;
default:
- // if('0' <= key && key <= '9' || 'A' <= key && key <= 'Z')
+ // if ('0' <= key && key <= '9' || 'A' <= key && key <= 'Z')
str.Format(_T("%c"), (TCHAR)key);
break;
}
@@ -760,9 +760,9 @@ CString CPPageAccelTbl::MakeAccelShortcutLabel(UINT id) {
CList<wmcmd>& wmcmds = AfxGetAppSettings().wmcmds;
POSITION pos = wmcmds.GetHeadPosition();
- while(pos) {
+ while (pos) {
ACCEL& a = wmcmds.GetNext(pos);
- if(a.cmd == id) {
+ if (a.cmd == id) {
return(MakeAccelShortcutLabel(a));
}
}
@@ -775,7 +775,7 @@ CString CPPageAccelTbl::MakeAccelShortcutLabel(ACCEL& a) // Reference page for Virtual-Key Codes: http://msdn.microsoft.com/en-us/library/ms645540
CString str;
- switch(a.key) {
+ switch (a.key) {
case VK_LBUTTON:
str = _T("LBtn");
break;
@@ -1320,12 +1320,12 @@ CString CPPageAccelTbl::MakeAccelShortcutLabel(ACCEL& a) str = _T("Multimedia keys");
break;
default:
- // if('0' <= a.key && a.key <= '9' || 'A' <= a.key && a.key <= 'Z')
+ // if ('0' <= a.key && a.key <= '9' || 'A' <= a.key && a.key <= 'Z')
str.Format(_T("%c"), (TCHAR)a.key);
break;
}
- if(a.fVirt&(FCONTROL|FALT|FSHIFT)) {
+ if (a.fVirt&(FCONTROL|FALT|FSHIFT)) {
str = MakeAccelModLabel(a.fVirt) + _T(" + ") + str;
}
@@ -1337,7 +1337,7 @@ CString CPPageAccelTbl::MakeAccelShortcutLabel(ACCEL& a) CString CPPageAccelTbl::MakeMouseButtonLabel(UINT mouse)
{
CString ret;
- switch(mouse) {
+ switch (mouse) {
case wmcmd::NONE:
default:
ret = ResStr(IDS_AG_NONE);
@@ -1435,11 +1435,11 @@ END_MESSAGE_MAP() static WNDPROC OldControlProc;
static LRESULT CALLBACK ControlProc(HWND control, UINT message, WPARAM wParam, LPARAM lParam)
{
- if(message == WM_KEYDOWN) {
+ if (message == WM_KEYDOWN) {
if ((LOWORD(wParam)== 'A' || LOWORD(wParam) == 'a') &&(GetKeyState(VK_CONTROL) < 0)) {
CPlayerListCtrl *pList = (CPlayerListCtrl*)CWnd::FromHandle(control);
- for(int i = 0, j = pList->GetItemCount(); i < j; i++) {
+ for (int i = 0, j = pList->GetItemCount(); i < j; i++) {
pList->SetItemState(i, LVIS_SELECTED, LVIS_SELECTED);
}
@@ -1477,7 +1477,7 @@ BOOL CPPageAccelTbl::OnInitDialog() m_list.SetExtendedStyle(m_list.GetExtendedStyle()|LVS_EX_FULLROWSELECT|LVS_EX_DOUBLEBUFFER|LVS_EX_GRIDLINES);
- for(int i = 0, j = m_list.GetHeaderCtrl()->GetItemCount(); i < j; i++) {
+ for (int i = 0, j = m_list.GetHeaderCtrl()->GetItemCount(); i < j; i++) {
m_list.DeleteColumn(0);
}
m_list.InsertColumn(COL_CMD, ResStr(IDS_AG_COMMAND), LVCFMT_LEFT, 80);
@@ -1491,7 +1491,7 @@ BOOL CPPageAccelTbl::OnInitDialog() m_list.InsertColumn(COL_RMREPCNT, _T("RepCnt"), LVCFMT_CENTER, 60);
POSITION pos = m_wmcmds.GetHeadPosition();
- for(int i = 0; pos; i++) {
+ for (int i = 0; pos; i++) {
int row = m_list.InsertItem(m_list.GetItemCount(), m_wmcmds.GetAt(pos).GetName(), COL_CMD);
m_list.SetItemData(row, (DWORD_PTR)pos);
m_wmcmds.GetNext(pos);
@@ -1525,10 +1525,10 @@ BOOL CPPageAccelTbl::OnApply() CAtlArray<ACCEL> pAccel;
pAccel.SetCount(m_wmcmds.GetCount());
POSITION pos = m_wmcmds.GetHeadPosition();
- for(int i = 0; pos; i++) {
+ for (int i = 0; pos; i++) {
pAccel[i] = m_wmcmds.GetNext(pos);
}
- if(s.hAccel) {
+ if (s.hAccel) {
DestroyAcceleratorTable(s.hAccel);
}
s.hAccel = CreateAcceleratorTable(pAccel.GetData(), pAccel.GetCount());
@@ -1537,12 +1537,12 @@ BOOL CPPageAccelTbl::OnApply() s.fWinLirc = !!m_fWinLirc;
s.strWinLircAddr = m_WinLircAddr;
- if(s.fWinLirc) {
+ if (s.fWinLirc) {
s.WinLircClient.Connect(m_WinLircAddr);
}
s.fUIce = !!m_fUIce;
s.strUIceAddr = m_UIceAddr;
- if(s.fUIce) {
+ if (s.fUIce) {
s.UIceClient.Connect(m_UIceAddr);
}
s.fGlobalMedia = !!m_fGlobalMedia;
@@ -1556,7 +1556,7 @@ void CPPageAccelTbl::OnBnClickedButton1() {
m_list.SetFocus();
- for(int i = 0, j = m_list.GetItemCount(); i < j; i++) {
+ for (int i = 0, j = m_list.GetItemCount(); i < j; i++) {
m_list.SetItemState(i, LVIS_SELECTED, LVIS_SELECTED);
}
}
@@ -1566,11 +1566,11 @@ void CPPageAccelTbl::OnBnClickedButton2() m_list.SetFocus();
POSITION pos = m_list.GetFirstSelectedItemPosition();
- if(!pos) {
+ if (!pos) {
return;
}
- while(pos) {
+ while (pos) {
int ni = m_list.GetNextSelectedItem(pos);
POSITION pi = (POSITION)m_list.GetItemData(ni);
wmcmd& wc = m_wmcmds.GetAt(pi);
@@ -1589,11 +1589,11 @@ void CPPageAccelTbl::OnBeginlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) *pResult = FALSE;
- if(pItem->iItem < 0) {
+ if (pItem->iItem < 0) {
return;
}
- if(pItem->iSubItem == COL_MOD || pItem->iSubItem == COL_KEY || pItem->iSubItem == COL_TYPE
+ if (pItem->iSubItem == COL_MOD || pItem->iSubItem == COL_KEY || pItem->iSubItem == COL_TYPE
|| pItem->iSubItem == COL_MOUSE || pItem->iSubItem == COL_APPCMD
|| pItem->iSubItem == COL_RMCMD || pItem->iSubItem == COL_RMREPCNT) {
*pResult = TRUE;
@@ -1607,7 +1607,7 @@ void CPPageAccelTbl::OnDolabeleditList(NMHDR* pNMHDR, LRESULT* pResult) LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR;
LV_ITEM* pItem = &pDispInfo->item;
- if(pItem->iItem < 0) {
+ if (pItem->iItem < 0) {
*pResult = FALSE;
return;
}
@@ -1620,11 +1620,11 @@ void CPPageAccelTbl::OnDolabeleditList(NMHDR* pNMHDR, LRESULT* pResult) CAtlList<CString> sl;
int nSel = -1;
- switch(pItem->iSubItem) {
+ switch (pItem->iSubItem) {
case COL_MOD:
- for(int i = 0; i < countof(s_mods); i++) {
+ for (int i = 0; i < countof(s_mods); i++) {
sl.AddTail(MakeAccelModLabel(s_mods[i]));
- if((a.fVirt&~3) == s_mods[i]) {
+ if ((a.fVirt&~3) == s_mods[i]) {
nSel = i;
}
}
@@ -1632,9 +1632,9 @@ void CPPageAccelTbl::OnDolabeleditList(NMHDR* pNMHDR, LRESULT* pResult) m_list.ShowInPlaceComboBox(pItem->iItem, pItem->iSubItem, sl, nSel);
break;
case COL_KEY:
- for(int i = 0; i < 256; i++) {
+ for (int i = 0; i < 256; i++) {
sl.AddTail(MakeAccelVkeyLabel(i, a.fVirt&FVIRTKEY));
- if(a.key == i) {
+ if (a.key == i) {
nSel = i;
}
}
@@ -1650,9 +1650,9 @@ void CPPageAccelTbl::OnDolabeleditList(NMHDR* pNMHDR, LRESULT* pResult) m_list.ShowInPlaceComboBox(pItem->iItem, pItem->iSubItem, sl, nSel);
break;
case COL_MOUSE:
- for(UINT i = 0; i < wmcmd::LAST; i++) {
+ for (UINT i = 0; i < wmcmd::LAST; i++) {
sl.AddTail(MakeMouseButtonLabel(i));
- if(wc.mouse == i) {
+ if (wc.mouse == i) {
nSel = i;
}
}
@@ -1660,9 +1660,9 @@ void CPPageAccelTbl::OnDolabeleditList(NMHDR* pNMHDR, LRESULT* pResult) m_list.ShowInPlaceComboBox(pItem->iItem, pItem->iSubItem, sl, nSel);
break;
case COL_APPCMD:
- for(int i = 0; i < countof(g_CommandList); i++) {
+ for (int i = 0; i < countof(g_CommandList); i++) {
sl.AddTail(g_CommandList[i].cmdname);
- if(wc.appcmd == g_CommandList[i].appcmd) {
+ if (wc.appcmd == g_CommandList[i].appcmd) {
nSel = i;
}
}
@@ -1688,19 +1688,19 @@ void CPPageAccelTbl::OnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) *pResult = FALSE;
- if(!m_list.m_fInPlaceDirty) {
+ if (!m_list.m_fInPlaceDirty) {
return;
}
- if(pItem->iItem < 0) {
+ if (pItem->iItem < 0) {
return;
}
wmcmd& wc = m_wmcmds.GetAt((POSITION)m_list.GetItemData(pItem->iItem));
- switch(pItem->iSubItem) {
+ switch (pItem->iSubItem) {
case COL_MOD:
- if(pItem->lParam >= 0 && pItem->lParam < countof(s_mods)) {
+ if (pItem->lParam >= 0 && pItem->lParam < countof(s_mods)) {
wc.fVirt = (wc.fVirt&3) | (s_mods[pItem->lParam]&~3);
m_list.SetItemText(pItem->iItem, COL_MOD, pItem->pszText);
*pResult = TRUE;
@@ -1708,7 +1708,7 @@ void CPPageAccelTbl::OnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) break;
case COL_KEY: {
int i = pItem->lParam;
- if(i >= 0 && i < 256) {
+ if (i >= 0 && i < 256) {
wc.key = (WORD)i;
m_list.SetItemText(pItem->iItem, COL_KEY, pItem->pszText);
*pResult = TRUE;
@@ -1717,7 +1717,7 @@ void CPPageAccelTbl::OnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) break;
case COL_TYPE: {
int i = pItem->lParam;
- if(i >= 0 && i < 2) {
+ if (i >= 0 && i < 2) {
wc.fVirt = (wc.fVirt&~FVIRTKEY) | (i == 0 ? FVIRTKEY : 0);
m_list.SetItemText(pItem->iItem, COL_KEY, MakeAccelVkeyLabel(wc.key, wc.fVirt&FVIRTKEY));
m_list.SetItemText(pItem->iItem, COL_TYPE, (wc.fVirt&FVIRTKEY)?_T("VIRTKEY"):_T("ASCII"));
@@ -1727,7 +1727,7 @@ void CPPageAccelTbl::OnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) break;
case COL_APPCMD: {
int i = pItem->lParam;
- if(i >= 0 && i < countof(g_CommandList)) {
+ if (i >= 0 && i < countof(g_CommandList)) {
wc.appcmd = g_CommandList[i].appcmd;
m_list.SetItemText(pItem->iItem, COL_APPCMD, pItem->pszText);
*pResult = TRUE;
@@ -1753,7 +1753,7 @@ void CPPageAccelTbl::OnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) break;
}
- if(*pResult) {
+ if (*pResult) {
SetModified();
}
}
@@ -1763,7 +1763,7 @@ void CPPageAccelTbl::OnTimer(UINT_PTR nIDEvent) {
UpdateData();
- if(m_fWinLirc) {
+ if (m_fWinLirc) {
CString addr;
m_WinLircEdit.GetWindowText(addr);
AfxGetAppSettings().WinLircClient.Connect(addr);
@@ -1771,7 +1771,7 @@ void CPPageAccelTbl::OnTimer(UINT_PTR nIDEvent) m_WinLircEdit.Invalidate();
- if(m_fUIce) {
+ if (m_fUIce) {
CString addr;
m_UIceEdit.GetWindowText(addr);
AfxGetAppSettings().UIceClient.Connect(addr);
@@ -1790,15 +1790,15 @@ HBRUSH CPPageAccelTbl::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) int status = -1;
- if(*pWnd == m_WinLircEdit) {
+ if (*pWnd == m_WinLircEdit) {
status = AfxGetAppSettings().WinLircClient.GetStatus();
- } else if(*pWnd == m_UIceEdit) {
+ } else if (*pWnd == m_UIceEdit) {
status = AfxGetAppSettings().UIceClient.GetStatus();
}
- if(status == 0 || status == 2 && (m_counter&1)) {
+ if (status == 0 || status == 2 && (m_counter&1)) {
pDC->SetTextColor(0x0000ff);
- } else if(status == 1) {
+ } else if (status == 1) {
pDC->SetTextColor(0x008000);
}
diff --git a/src/apps/mplayerc/PPageAudioSwitcher.cpp b/src/apps/mplayerc/PPageAudioSwitcher.cpp index b51470915..373d861c2 100644 --- a/src/apps/mplayerc/PPageAudioSwitcher.cpp +++ b/src/apps/mplayerc/PPageAudioSwitcher.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -117,14 +117,14 @@ BOOL CPPageAudioSwitcher::OnInitDialog() m_fCustomChannelMapping = s.fCustomChannelMapping;
memcpy(m_pSpeakerToChannelMap, s.pSpeakerToChannelMap, sizeof(s.pSpeakerToChannelMap));
- if(m_pASF) {
+ if (m_pASF) {
m_pASF->GetInputSpeakerConfig(&m_dwChannelMask);
}
m_nChannels = s.nSpeakerChannels;
m_nChannelsSpinCtrl.SetRange(1, 18);
- if(m_pASF) {
+ if (m_pASF) {
m_nChannels = m_pASF->GetNumberOfInputChannels();
}
@@ -150,7 +150,7 @@ BOOL CPPageAudioSwitcher::OnInitDialog() m_list.InsertItem(18, ResStr(IDS_TOP_BACK_RIGHT));
m_list.SetColumnWidth(0, LVSCW_AUTOSIZE);
- for(int i = 1; i <= 18; i++) {
+ for (int i = 1; i <= 18; i++) {
m_list.InsertColumn(i, _T(""), LVCFMT_CENTER, 16);
CString n;
n.Format(_T("%d"), i);
@@ -184,7 +184,7 @@ BOOL CPPageAudioSwitcher::OnApply() s.fCustomChannelMapping = !!m_fCustomChannelMapping;
memcpy(s.pSpeakerToChannelMap, m_pSpeakerToChannelMap, sizeof(m_pSpeakerToChannelMap));
- if(m_pASF) {
+ if (m_pASF) {
m_pASF->SetSpeakerConfig(s.fCustomChannelMapping, s.pSpeakerToChannelMap);
m_pASF->EnableDownSamplingTo441(s.fDownSampleTo441);
m_pASF->SetAudioTimeShift(s.fAudioTimeShift ? 10000i64*s.iAudioTimeShift : 0);
@@ -200,13 +200,13 @@ void CPPageAudioSwitcher::OnNMClickList1(NMHDR* pNMHDR, LRESULT* pResult) {
LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)pNMHDR;
- if(lpnmlv->iItem > 0 && lpnmlv->iSubItem > 0 && lpnmlv->iSubItem <= m_nChannels) {
+ if (lpnmlv->iItem > 0 && lpnmlv->iSubItem > 0 && lpnmlv->iSubItem <= m_nChannels) {
UpdateData();
m_pSpeakerToChannelMap[m_nChannels-1][lpnmlv->iItem-1] ^= 1<<(lpnmlv->iSubItem-1);
m_list.RedrawItems(lpnmlv->iItem, lpnmlv->iItem);
SetModified();
- if(GetKeyState(VK_SHIFT) & 0x8000) {
+ if (GetKeyState(VK_SHIFT) & 0x8000) {
OnApply();
}
}
@@ -216,7 +216,7 @@ void CPPageAudioSwitcher::OnNMClickList1(NMHDR* pNMHDR, LRESULT* pResult) void CPPageAudioSwitcher::OnEnChangeEdit1()
{
- if(IsWindow(m_list.m_hWnd)) {
+ if (IsWindow(m_list.m_hWnd)) {
UpdateData();
m_list.Invalidate();
SetModified();
@@ -227,11 +227,11 @@ void CPPageAudioSwitcher::OnEnChangeEdit1() void CPPageAudioSwitcher::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
{
- if(nIDCtl != IDC_LIST1) {
+ if (nIDCtl != IDC_LIST1) {
return;
}
- // if(lpDrawItemStruct->itemID == 0)
+ // if (lpDrawItemStruct->itemID == 0)
// UpdateData();
CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
@@ -247,7 +247,7 @@ void CPPageAudioSwitcher::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStru CHeaderCtrl* pHeader = m_list.GetHeaderCtrl();
int nColumnCount = pHeader->GetItemCount();
- for(int i = 0; i < nColumnCount; i++) {
+ for (int i = 0; i < nColumnCount; i++) {
CRect r, rb;
m_list.GetSubItemRect(lpDrawItemStruct->itemID, i, LVIR_BOUNDS, rb);
m_list.GetSubItemRect(lpDrawItemStruct->itemID, i, LVIR_LABEL, r);
@@ -257,10 +257,10 @@ void CPPageAudioSwitcher::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStru CSize s = pDC->GetTextExtent(m_list.GetItemText(lpDrawItemStruct->itemID, i));
- if(i == 0) {
+ if (i == 0) {
r.left = rb.left;
- if(lpDrawItemStruct->itemID == 0) {
+ if (lpDrawItemStruct->itemID == 0) {
pDC->MoveTo(0, 0);
pDC->LineTo(r.right, r.bottom-1);
} else {
@@ -270,19 +270,19 @@ void CPPageAudioSwitcher::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStru } else {
pDC->SetTextColor(i > m_nChannels ? 0xe0e0e0 : (!m_list.IsWindowEnabled() ? 0xb0b0b0 : 0));
- if(lpDrawItemStruct->itemID == 0) {
+ if (lpDrawItemStruct->itemID == 0) {
pDC->TextOut((r.left+r.right-s.cx)/2, (r.top+r.bottom-s.cy)/2, m_list.GetItemText(lpDrawItemStruct->itemID, i));
} else {
- if(m_dwChannelMask & (1<<(lpDrawItemStruct->itemID-1))) {
+ if (m_dwChannelMask & (1<<(lpDrawItemStruct->itemID-1))) {
int nBitsSet = 0;
- for(int j = 1; j <= (1<<(lpDrawItemStruct->itemID-1)); j <<= 1) {
- if(m_dwChannelMask & j) {
+ for (int j = 1; j <= (1<<(lpDrawItemStruct->itemID-1)); j <<= 1) {
+ if (m_dwChannelMask & j) {
nBitsSet++;
}
}
- if(nBitsSet == i) {
+ if (nBitsSet == i) {
COLORREF tmp = pDC->GetTextColor();
pDC->SetTextColor(0xe0e0e0);
@@ -297,7 +297,7 @@ void CPPageAudioSwitcher::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStru }
}
- if(m_pSpeakerToChannelMap[m_nChannels-1][lpDrawItemStruct->itemID-1] & (1<<(i-1))) {
+ if (m_pSpeakerToChannelMap[m_nChannels-1][lpDrawItemStruct->itemID-1] & (1<<(i-1))) {
CFont f;
f.CreatePointFont(MulDiv(100, 96, pDC->GetDeviceCaps(LOGPIXELSX)), _T("Marlett"));
CFont* old = pDC->SelectObject(&f);
@@ -327,7 +327,7 @@ void CPPageAudioSwitcher::OnUpdateChannelMapping(CCmdUI* pCmdUI) void CPPageAudioSwitcher::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
- if(*pScrollBar == m_AudioBoostCtrl) {
+ if (*pScrollBar == m_AudioBoostCtrl) {
UpdateData();
((CMainFrame*)GetParentFrame())->SetVolumeBoost(m_AudioBoostPos/10.0); // nice shortcut...
}
@@ -347,7 +347,7 @@ BOOL CPPageAudioSwitcher::OnToolTipNotify(UINT id, NMHDR * pNMHDR, LRESULT * pRe nID = ::GetDlgCtrlID((HWND)nID);
}
- if(nID == 0) {
+ if (nID == 0) {
return FALSE;
}
@@ -355,7 +355,7 @@ BOOL CPPageAudioSwitcher::OnToolTipNotify(UINT id, NMHDR * pNMHDR, LRESULT * pRe m_strTipTextW.Format(L"+%.1f dB", m_AudioBoostCtrl.GetPos()/10.0);
- if(pNMHDR->code == TTN_NEEDTEXTW) { //?possible check is not needed
+ if (pNMHDR->code == TTN_NEEDTEXTW) { //?possible check is not needed
pTTTW->lpszText = (LPWSTR)(LPCWSTR)m_strTipTextW;
}
diff --git a/src/apps/mplayerc/PPageBase.cpp b/src/apps/mplayerc/PPageBase.cpp index de49f2931..e58b539a8 100644 --- a/src/apps/mplayerc/PPageBase.cpp +++ b/src/apps/mplayerc/PPageBase.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -49,9 +49,9 @@ void CPPageBase::CreateToolTip() m_wndToolTip.Activate(TRUE);
m_wndToolTip.SetMaxTipWidth(300);
m_wndToolTip.SetDelayTime(TTDT_AUTOPOP, 10000);
- for(CWnd* pChild = GetWindow(GW_CHILD); pChild; pChild = pChild->GetWindow(GW_HWNDNEXT)) {
+ for (CWnd* pChild = GetWindow(GW_CHILD); pChild; pChild = pChild->GetWindow(GW_HWNDNEXT)) {
CString strToolTip;
- if(strToolTip.LoadString(pChild->GetDlgCtrlID())) {
+ if (strToolTip.LoadString(pChild->GetDlgCtrlID())) {
m_wndToolTip.AddTool(pChild, strToolTip);
}
}
@@ -59,17 +59,17 @@ void CPPageBase::CreateToolTip() BOOL CPPageBase::PreTranslateMessage(MSG* pMsg)
{
- if(IsWindow(m_wndToolTip))
- if(pMsg->message >= WM_MOUSEFIRST && pMsg->message <= WM_MOUSELAST) {
+ if (IsWindow(m_wndToolTip))
+ if (pMsg->message >= WM_MOUSEFIRST && pMsg->message <= WM_MOUSELAST) {
MSG msg;
memcpy(&msg, pMsg, sizeof(MSG));
- for(HWND hWndParent = ::GetParent(msg.hwnd);
+ for (HWND hWndParent = ::GetParent(msg.hwnd);
hWndParent && hWndParent != m_hWnd;
hWndParent = ::GetParent(hWndParent)) {
msg.hwnd = hWndParent;
}
- if(msg.hwnd) {
+ if (msg.hwnd) {
m_wndToolTip.RelayEvent(&msg);
}
}
diff --git a/src/apps/mplayerc/PPageCapture.cpp b/src/apps/mplayerc/PPageCapture.cpp index 17d1ede17..22ae4d016 100644 --- a/src/apps/mplayerc/PPageCapture.cpp +++ b/src/apps/mplayerc/PPageCapture.cpp @@ -354,9 +354,9 @@ void CPPageCapture::FindAnalogDevices() int i = m_cbAnalogVideo.AddString(CString(var.bstrVal));
LPOLESTR strName = NULL;
- if(SUCCEEDED(pMoniker->GetDisplayName(NULL, NULL, &strName))) {
+ if (SUCCEEDED(pMoniker->GetDisplayName(NULL, NULL, &strName))) {
m_vidnames.Add(CString(strName));
- if(s.strAnalogVideo == CString(strName)) {
+ if (s.strAnalogVideo == CString(strName)) {
iSel = i;
}
CoTaskMemFree(strName);
@@ -367,12 +367,12 @@ void CPPageCapture::FindAnalogDevices() {
int i = m_cbAnalogAudio.AddString(_T("<Video Capture Device>"));
m_audnames.Add(_T(""));
- if(s.strAnalogAudio.IsEmpty()) {
+ if (s.strAnalogAudio.IsEmpty()) {
iSel = i;
}
}
- if(m_cbAnalogVideo.GetCount()) {
+ if (m_cbAnalogVideo.GetCount()) {
m_cbAnalogVideo.SetCurSel(iSel);
}
@@ -387,24 +387,24 @@ void CPPageCapture::FindAnalogDevices() int i = m_cbAnalogAudio.AddString(CString(var.bstrVal));
LPOLESTR strName = NULL;
- if(SUCCEEDED(pMoniker->GetDisplayName(NULL, NULL, &strName))) {
+ if (SUCCEEDED(pMoniker->GetDisplayName(NULL, NULL, &strName))) {
m_audnames.Add(CString(strName));
- if(s.strAnalogAudio == CString(strName)) {
+ if (s.strAnalogAudio == CString(strName)) {
iSel = i;
}
CoTaskMemFree(strName);
}
}
EndEnumSysDev
- if(m_cbAnalogAudio.GetCount()) {
+ if (m_cbAnalogAudio.GetCount()) {
m_cbAnalogAudio.SetCurSel(iSel);
}
// Fill country
iSel = 0;
- for(int j = 0; j < countof(s_countrycodes); j++) {
+ for (int j = 0; j < countof(s_countrycodes); j++) {
CString standard;
- switch(s_countrycodes[j].standard) {
+ switch (s_countrycodes[j].standard) {
case AnalogVideo_NTSC_M:
standard = _T("NTSC M");
break;
@@ -472,12 +472,12 @@ void CPPageCapture::FindAnalogDevices() int i = m_cbAnalogCountry.AddString(str);
m_cbAnalogCountry.SetItemDataPtr(i, &s_countrycodes[j]);
- if(s.iAnalogCountry == s_countrycodes[j].code) {
+ if (s.iAnalogCountry == s_countrycodes[j].code) {
iSel = i;
}
}
- if(m_cbAnalogCountry.GetCount()) {
+ if (m_cbAnalogCountry.GetCount()) {
m_cbAnalogCountry.SetCurSel(iSel);
}
}
@@ -496,7 +496,7 @@ void CPPageCapture::FindDigitalDevices() int i = m_cbDigitalNetworkProvider.AddString(CString(var.bstrVal));
LPOLESTR strName = NULL;
- if(SUCCEEDED(pMoniker->GetDisplayName(NULL, NULL, &strName))) {
+ if (SUCCEEDED(pMoniker->GetDisplayName(NULL, NULL, &strName))) {
m_providernames.Add(CString(strName));
if (s.strBDANetworkProvider == CString(strName)) {
iSel = i;
@@ -505,7 +505,7 @@ void CPPageCapture::FindDigitalDevices() }
}
EndEnumSysDev
- if(m_cbDigitalNetworkProvider.GetCount()) {
+ if (m_cbDigitalNetworkProvider.GetCount()) {
m_cbDigitalNetworkProvider.SetCurSel(iSel);
}
@@ -520,7 +520,7 @@ void CPPageCapture::FindDigitalDevices() int i = m_cbDigitalTuner.AddString(CString(var.bstrVal));
LPOLESTR strName = NULL;
- if(SUCCEEDED(pMoniker->GetDisplayName(NULL, NULL, &strName))) {
+ if (SUCCEEDED(pMoniker->GetDisplayName(NULL, NULL, &strName))) {
m_tunernames.Add(CString(strName));
if (s.strBDATuner == CString(strName)) {
iSel = i;
@@ -529,7 +529,7 @@ void CPPageCapture::FindDigitalDevices() }
}
EndEnumSysDev
- if(m_cbDigitalTuner.GetCount()) {
+ if (m_cbDigitalTuner.GetCount()) {
m_cbDigitalTuner.SetCurSel(iSel);
}
@@ -543,7 +543,7 @@ void CPPageCapture::FindDigitalDevices() int i = m_cbDigitalReceiver.AddString(CString(var.bstrVal));
LPOLESTR strName = NULL;
- if(SUCCEEDED(pMoniker->GetDisplayName(NULL, NULL, &strName))) {
+ if (SUCCEEDED(pMoniker->GetDisplayName(NULL, NULL, &strName))) {
m_receivernames.Add(CString(strName));
if (s.strBDAReceiver == CString(strName)) {
iSel = i;
@@ -552,7 +552,7 @@ void CPPageCapture::FindDigitalDevices() }
}
EndEnumSysDev
- if(m_cbDigitalReceiver.GetCount()) {
+ if (m_cbDigitalReceiver.GetCount()) {
m_cbDigitalReceiver.SetCurSel(iSel);
}
}
diff --git a/src/apps/mplayerc/PPageCasimir.cpp b/src/apps/mplayerc/PPageCasimir.cpp index 49760cc1d..c52c54579 100644 --- a/src/apps/mplayerc/PPageCasimir.cpp +++ b/src/apps/mplayerc/PPageCasimir.cpp @@ -1,7 +1,7 @@ /*
* $Id$
*
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -126,16 +126,16 @@ BOOL CPPageCasimir::OnApply() void CPPageCasimir::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
- if(*pScrollBar == m_SliContrast) {
+ if (*pScrollBar == m_SliContrast) {
UpdateData();
m_dContrast = (float)(m_SliContrast.GetPos()/100.0);
- } else if(*pScrollBar == m_SliBrightness) {
+ } else if (*pScrollBar == m_SliBrightness) {
UpdateData();
m_dBrightness = (float)m_SliBrightness.GetPos();
- } else if(*pScrollBar == m_SliHue) {
+ } else if (*pScrollBar == m_SliHue) {
UpdateData();
m_dHue = (float)m_SliHue.GetPos();
- } else if(*pScrollBar == m_SliSaturation) {
+ } else if (*pScrollBar == m_SliSaturation) {
UpdateData();
m_dSaturation = (float)(m_SliSaturation.GetPos()/100.0);
}
diff --git a/src/apps/mplayerc/PPageDVD.cpp b/src/apps/mplayerc/PPageDVD.cpp index 33adb2695..f13c81a1b 100644 --- a/src/apps/mplayerc/PPageDVD.cpp +++ b/src/apps/mplayerc/PPageDVD.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -210,8 +210,8 @@ void CPPageDVD::UpdateLCIDList() : m_iDVDLangType == 1 ? m_idAudioLang
: m_idSubtitlesLang;
- for(int i = 0; i < m_lcids.GetCount(); i++) {
- if(m_lcids.GetItemData(i) == lcid) {
+ for (int i = 0; i < m_lcids.GetCount(); i++) {
+ if (m_lcids.GetItemData(i) == lcid) {
m_lcids.SetCurSel(i);
m_lcids.SetTopIndex(i);
break;
@@ -247,7 +247,7 @@ BOOL CPPageDVD::OnInitDialog() UpdateData(FALSE);
- for(int i = 0; i < countof(LCIDNameList); i++) {
+ for (int i = 0; i < countof(LCIDNameList); i++) {
m_lcids.AddString(CString(LCIDNameList[i].name));
m_lcids.SetItemData(i, LCIDNameList[i].lcid);
}
@@ -289,7 +289,7 @@ void CPPageDVD::OnBnClickedButton1() bi.iImage = 0;
LPITEMIDLIST iil = SHBrowseForFolder(&bi);
- if(iil) {
+ if (iil) {
SHGetPathFromIDList(iil, path);
m_dvdpath = path;
diff --git a/src/apps/mplayerc/PPageExternalFilters.cpp b/src/apps/mplayerc/PPageExternalFilters.cpp index 672037df3..e5e61b990 100644 --- a/src/apps/mplayerc/PPageExternalFilters.cpp +++ b/src/apps/mplayerc/PPageExternalFilters.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -60,7 +60,7 @@ void CPPageExternalFilters::DoDataExchange(CDataExchange* pDX) void CPPageExternalFilters::StepUp(CCheckListBox& list)
{
int i = list.GetCurSel();
- if(i < 1) {
+ if (i < 1) {
return;
}
@@ -79,7 +79,7 @@ void CPPageExternalFilters::StepUp(CCheckListBox& list) void CPPageExternalFilters::StepDown(CCheckListBox& list)
{
int i = list.GetCurSel();
- if(i < 0 || i >= list.GetCount()-1) {
+ if (i < 0 || i >= list.GetCount()-1) {
return;
}
@@ -291,22 +291,22 @@ BOOL CPPageExternalFilters::OnInitDialog() m_pFilters.RemoveAll();
POSITION pos = s.m_filters.GetHeadPosition();
- while(pos) {
+ while (pos) {
CAutoPtr<FilterOverride> f(DNew FilterOverride(s.m_filters.GetNext(pos)));
CString name(_T("<unknown>"));
- if(f->type == FilterOverride::REGISTERED) {
+ if (f->type == FilterOverride::REGISTERED) {
name = CFGFilterRegistry(f->dispname).GetName();
- if(name.IsEmpty()) {
+ if (name.IsEmpty()) {
name = f->name + _T(" <not registered>");
}
- } else if(f->type == FilterOverride::EXTERNAL) {
+ } else if (f->type == FilterOverride::EXTERNAL) {
name = f->name;
- if(f->fTemporary) {
+ if (f->fTemporary) {
name += _T(" <temporary>");
}
- if(!CPath(MakeFullPath(f->path)).FileExists()) {
+ if (!CPath(MakeFullPath(f->path)).FileExists()) {
name += _T(" <not found!>");
}
}
@@ -330,8 +330,8 @@ BOOL CPPageExternalFilters::OnApply() s.m_filters.RemoveAll();
- for(int i = 0; i < m_filters.GetCount(); i++) {
- if(POSITION pos = (POSITION)m_filters.GetItemData(i)) {
+ for (int i = 0; i < m_filters.GetCount(); i++) {
+ if (POSITION pos = (POSITION)m_filters.GetItemData(i)) {
CAutoPtr<FilterOverride> f(DNew FilterOverride(m_pFilters.GetAt(pos)));
f->fDisabled = !m_filters.GetCheck(i);
s.m_filters.AddTail(f);
@@ -343,7 +343,7 @@ BOOL CPPageExternalFilters::OnApply() void CPPageExternalFilters::OnUpdateFilter(CCmdUI* pCmdUI)
{
- if(FilterOverride* f = GetCurFilter()) {
+ if (FilterOverride* f = GetCurFilter()) {
pCmdUI->Enable(!(pCmdUI->m_nID == IDC_RADIO2 && f->type == FilterOverride::EXTERNAL));
} else {
pCmdUI->Enable(FALSE);
@@ -380,15 +380,15 @@ void CPPageExternalFilters::OnUpdateDeleteType(CCmdUI* pCmdUI) void CPPageExternalFilters::OnAddRegistered()
{
CRegFilterChooserDlg dlg(this);
- if(dlg.DoModal() == IDOK) {
- while(!dlg.m_filters.IsEmpty()) {
- if(FilterOverride* f = dlg.m_filters.RemoveHead()) {
+ if (dlg.DoModal() == IDOK) {
+ while (!dlg.m_filters.IsEmpty()) {
+ if (FilterOverride* f = dlg.m_filters.RemoveHead()) {
CAutoPtr<FilterOverride> p(f);
CString name = f->name;
- if(f->type == FilterOverride::EXTERNAL) {
- if(!CPath(MakeFullPath(f->path)).FileExists()) {
+ if (f->type == FilterOverride::EXTERNAL) {
+ if (!CPath(MakeFullPath(f->path)).FileExists()) {
name += _T(" <not found!>");
}
}
@@ -397,7 +397,7 @@ void CPPageExternalFilters::OnAddRegistered() m_filters.SetItemDataPtr(i, m_pFilters.AddTail(p));
m_filters.SetCheck(i, 1);
- if(dlg.m_filters.IsEmpty()) {
+ if (dlg.m_filters.IsEmpty()) {
m_filters.SetCurSel(i);
OnLbnSelchangeList1();
}
@@ -411,7 +411,7 @@ void CPPageExternalFilters::OnRemoveFilter() int i = m_filters.GetCurSel();
m_pFilters.RemoveAt((POSITION)m_filters.GetItemDataPtr(i));
m_filters.DeleteString(i);
- if(i >= m_filters.GetCount()) {
+ if (i >= m_filters.GetCount()) {
i--;
}
m_filters.SetCurSel(i);
@@ -430,26 +430,26 @@ void CPPageExternalFilters::OnMoveFilterDown() void CPPageExternalFilters::OnLbnDblclkFilter()
{
- if(FilterOverride* f = GetCurFilter()) {
+ if (FilterOverride* f = GetCurFilter()) {
CComPtr<IBaseFilter> pBF;
CString name;
- if(f->type == FilterOverride::REGISTERED) {
+ if (f->type == FilterOverride::REGISTERED) {
CStringW namew;
- if(CreateFilter(f->dispname, &pBF, namew)) {
+ if (CreateFilter(f->dispname, &pBF, namew)) {
name = namew;
}
- } else if(f->type == FilterOverride::EXTERNAL) {
- if(SUCCEEDED(LoadExternalFilter(f->path, f->clsid, &pBF))) {
+ } else if (f->type == FilterOverride::EXTERNAL) {
+ if (SUCCEEDED(LoadExternalFilter(f->path, f->clsid, &pBF))) {
name = f->name;
}
}
- if(CComQIPtr<ISpecifyPropertyPages> pSPP = pBF) {
+ if (CComQIPtr<ISpecifyPropertyPages> pSPP = pBF) {
CComPropertySheet ps(name, this);
- if(ps.AddPages(pSPP) > 0) {
+ if (ps.AddPages(pSPP) > 0) {
CComPtr<IFilterGraph> pFG;
- if(SUCCEEDED(pFG.CoCreateInstance(CLSID_FilterGraph))) {
+ if (SUCCEEDED(pFG.CoCreateInstance(CLSID_FilterGraph))) {
pFG->AddFilter(pBF, L"");
}
@@ -462,7 +462,7 @@ void CPPageExternalFilters::OnLbnDblclkFilter() void CPPageExternalFilters::OnAddMajorType()
{
FilterOverride* f = GetCurFilter();
- if(!f) {
+ if (!f) {
return;
}
@@ -470,10 +470,10 @@ void CPPageExternalFilters::OnAddMajorType() SetupMajorTypes(guids);
CSelectMediaType dlg(guids, MEDIATYPE_NULL, this);
- if(dlg.DoModal() == IDOK) {
+ if (dlg.DoModal() == IDOK) {
POSITION pos = f->guids.GetHeadPosition();
- while(pos) {
- if(f->guids.GetNext(pos) == dlg.m_guid) {
+ while (pos) {
+ if (f->guids.GetNext(pos) == dlg.m_guid) {
AfxMessageBox(_T("Already on the list!"));
return;
}
@@ -498,17 +498,17 @@ void CPPageExternalFilters::OnAddMajorType() void CPPageExternalFilters::OnAddSubType()
{
FilterOverride* f = GetCurFilter();
- if(!f) {
+ if (!f) {
return;
}
HTREEITEM node = m_tree.GetSelectedItem();
- if(!node) {
+ if (!node) {
return;
}
HTREEITEM child = m_tree.GetChildItem(node);
- if(!child) {
+ if (!child) {
return;
}
@@ -519,11 +519,11 @@ void CPPageExternalFilters::OnAddSubType() SetupSubTypes(guids);
CSelectMediaType dlg(guids, MEDIASUBTYPE_NULL, this);
- if(dlg.DoModal() == IDOK) {
- for(child = m_tree.GetChildItem(node); child; child = m_tree.GetNextSiblingItem(child)) {
+ if (dlg.DoModal() == IDOK) {
+ for (child = m_tree.GetChildItem(node); child; child = m_tree.GetNextSiblingItem(child)) {
pos = (POSITION)m_tree.GetItemData(child);
f->guids.GetNext(pos);
- if(f->guids.GetAt(pos) == dlg.m_guid) {
+ if (f->guids.GetAt(pos) == dlg.m_guid) {
AfxMessageBox(_T("Already on the list!"));
return;
}
@@ -542,16 +542,16 @@ void CPPageExternalFilters::OnAddSubType() void CPPageExternalFilters::OnDeleteType()
{
- if(FilterOverride* f = GetCurFilter()) {
+ if (FilterOverride* f = GetCurFilter()) {
HTREEITEM node = m_tree.GetSelectedItem();
- if(!node) {
+ if (!node) {
return;
}
POSITION pos = (POSITION)m_tree.GetItemData(node);
- if(pos == NULL) {
- for(HTREEITEM child = m_tree.GetChildItem(node); child; child = m_tree.GetNextSiblingItem(child)) {
+ if (pos == NULL) {
+ for (HTREEITEM child = m_tree.GetChildItem(node); child; child = m_tree.GetNextSiblingItem(child)) {
pos = (POSITION)m_tree.GetItemData(child);
POSITION pos1 = pos;
@@ -574,7 +574,7 @@ void CPPageExternalFilters::OnDeleteType() m_tree.DeleteItem(node);
- if(!m_tree.ItemHasChildren(parent)) {
+ if (!m_tree.ItemHasChildren(parent)) {
f->guids.SetAt(pos2, GUID_NULL);
node = m_tree.InsertItem(GetMediaTypeName(GUID_NULL), parent);
m_tree.SetItemData(node, (DWORD_PTR)pos1);
@@ -588,7 +588,7 @@ void CPPageExternalFilters::OnDeleteType() void CPPageExternalFilters::OnResetTypes()
{
- if(FilterOverride* f = GetCurFilter()) {
+ if (FilterOverride* f = GetCurFilter()) {
f->guids.RemoveAll();
f->guids.AddTailList(&f->backup);
@@ -599,8 +599,8 @@ void CPPageExternalFilters::OnResetTypes() void CPPageExternalFilters::OnLbnSelchangeList1()
{
- if(FilterOverride* f = GetCurFilter()) {
- if(m_pLastSelFilter == f) {
+ if (FilterOverride* f = GetCurFilter()) {
+ if (m_pLastSelFilter == f) {
return;
}
m_pLastSelFilter = f;
@@ -610,15 +610,15 @@ void CPPageExternalFilters::OnLbnSelchangeList1() m_dwMerit = f->dwMerit;
HTREEITEM dummy_item = m_tree.InsertItem(_T(""), 0,0, NULL, TVI_FIRST);
- if(dummy_item)
- for(HTREEITEM item = m_tree.GetNextVisibleItem(dummy_item); item; item = m_tree.GetNextVisibleItem(dummy_item)) {
+ if (dummy_item)
+ for (HTREEITEM item = m_tree.GetNextVisibleItem(dummy_item); item; item = m_tree.GetNextVisibleItem(dummy_item)) {
m_tree.DeleteItem(item);
}
CMapStringToPtr map;
POSITION pos = f->guids.GetHeadPosition();
- while(pos) {
+ while (pos) {
POSITION tmp = pos;
CString major = GetMediaTypeName(f->guids.GetNext(pos));
CString sub = GetMediaTypeName(f->guids.GetNext(pos));
@@ -626,7 +626,7 @@ void CPPageExternalFilters::OnLbnSelchangeList1() HTREEITEM node = NULL;
void* val = NULL;
- if(map.Lookup(major, val)) {
+ if (map.Lookup(major, val)) {
node = (HTREEITEM)val;
} else {
map[major] = node = m_tree.InsertItem(major);
@@ -639,7 +639,7 @@ void CPPageExternalFilters::OnLbnSelchangeList1() m_tree.DeleteItem(dummy_item);
- for(HTREEITEM item = m_tree.GetFirstVisibleItem(); item; item = m_tree.GetNextVisibleItem(item)) {
+ for (HTREEITEM item = m_tree.GetFirstVisibleItem(); item; item = m_tree.GetNextVisibleItem(item)) {
m_tree.Expand(item, TVE_EXPAND);
}
@@ -658,7 +658,7 @@ void CPPageExternalFilters::OnLbnSelchangeList1() void CPPageExternalFilters::OnBnClickedRadio()
{
UpdateData();
- if(FilterOverride* f = GetCurFilter()) {
+ if (FilterOverride* f = GetCurFilter()) {
f->iLoadType = m_iLoadType;
}
}
@@ -666,9 +666,9 @@ void CPPageExternalFilters::OnBnClickedRadio() void CPPageExternalFilters::OnEnChangeEdit1()
{
UpdateData();
- if(FilterOverride* f = GetCurFilter()) {
+ if (FilterOverride* f = GetCurFilter()) {
DWORD dw;
- if(m_dwMerit.GetDWORD(dw)) {
+ if (m_dwMerit.GetDWORD(dw)) {
f->dwMerit = dw;
}
}
@@ -678,19 +678,19 @@ void CPPageExternalFilters::OnNMDblclkTree2(NMHDR *pNMHDR, LRESULT *pResult) {
*pResult = 0;
- if(FilterOverride* f = GetCurFilter()) {
+ if (FilterOverride* f = GetCurFilter()) {
HTREEITEM node = m_tree.GetSelectedItem();
- if(!node) {
+ if (!node) {
return;
}
POSITION pos = (POSITION)m_tree.GetItemData(node);
- if(!pos) {
+ if (!pos) {
return;
}
f->guids.GetNext(pos);
- if(!pos) {
+ if (!pos) {
return;
}
@@ -698,7 +698,7 @@ void CPPageExternalFilters::OnNMDblclkTree2(NMHDR *pNMHDR, LRESULT *pResult) SetupSubTypes(guids);
CSelectMediaType dlg(guids, f->guids.GetAt(pos), this);
- if(dlg.DoModal() == IDOK) {
+ if (dlg.DoModal() == IDOK) {
f->guids.SetAt(pos, dlg.m_guid);
m_tree.SetItemText(node, GetMediaTypeName(dlg.m_guid));
}
@@ -710,21 +710,21 @@ void CPPageExternalFilters::OnDropFiles(HDROP hDropInfo) SetActiveWindow();
UINT nFiles = ::DragQueryFile(hDropInfo, (UINT)-1, NULL, 0);
- for(UINT iFile = 0; iFile < nFiles; iFile++) {
+ for (UINT iFile = 0; iFile < nFiles; iFile++) {
TCHAR szFileName[_MAX_PATH];
::DragQueryFile(hDropInfo, iFile, szFileName, _MAX_PATH);
CFilterMapper2 fm2(false);
fm2.Register(szFileName);
- while(!fm2.m_filters.IsEmpty()) {
- if(FilterOverride* f = fm2.m_filters.RemoveHead()) {
+ while (!fm2.m_filters.IsEmpty()) {
+ if (FilterOverride* f = fm2.m_filters.RemoveHead()) {
CAutoPtr<FilterOverride> p(f);
int i = m_filters.AddString(f->name);
m_filters.SetItemDataPtr(i, m_pFilters.AddTail(p));
m_filters.SetCheck(i, 1);
- if(fm2.m_filters.IsEmpty()) {
+ if (fm2.m_filters.IsEmpty()) {
m_filters.SetCurSel(i);
OnLbnSelchangeList1();
}
diff --git a/src/apps/mplayerc/PPageFileInfoClip.cpp b/src/apps/mplayerc/PPageFileInfoClip.cpp index 357e88a84..1266b22b4 100644 --- a/src/apps/mplayerc/PPageFileInfoClip.cpp +++ b/src/apps/mplayerc/PPageFileInfoClip.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -47,7 +47,7 @@ CPPageFileInfoClip::CPPageFileInfoClip(CString fn, IFilterGraph* pFG) CPPageFileInfoClip::~CPPageFileInfoClip()
{
- if(m_hIcon) {
+ if (m_hIcon) {
DestroyIcon(m_hIcon);
}
}
@@ -75,13 +75,13 @@ BOOL CPPageFileInfoClip::OnInitDialog() {
__super::OnInitDialog();
- if(m_fn == _T("")) {
+ if (m_fn == _T("")) {
BeginEnumFilters(m_pFG, pEF, pBF) {
CComQIPtr<IFileSourceFilter> pFSF = pBF;
- if(pFSF) {
+ if (pFSF) {
LPOLESTR pFN = NULL;
AM_MEDIA_TYPE mt;
- if(SUCCEEDED(pFSF->GetCurFile(&pFN, &mt)) && pFN && *pFN) {
+ if (SUCCEEDED(pFSF->GetCurFile(&pFN, &mt)) && pFN && *pFN) {
m_fn = CStringW(pFN);
CoTaskMemFree(pFN);
}
@@ -92,46 +92,46 @@ BOOL CPPageFileInfoClip::OnInitDialog() }
m_hIcon = LoadIcon(m_fn, false);
- if(m_hIcon) {
+ if (m_hIcon) {
m_icon.SetIcon(m_hIcon);
}
m_fn.TrimRight('/');
int i = max(m_fn.ReverseFind('\\'), m_fn.ReverseFind('/'));
- if(i >= 0 && i < m_fn.GetLength()-1) {
+ if (i >= 0 && i < m_fn.GetLength()-1) {
m_location = m_fn.Left(i);
m_fn = m_fn.Mid(i+1);
- if(m_location.GetLength() == 2 && m_location[1] == ':') {
+ if (m_location.GetLength() == 2 && m_location[1] == ':') {
m_location += '\\';
}
}
bool fEmpty = true;
BeginEnumFilters(m_pFG, pEF, pBF) {
- if(CComQIPtr<IAMMediaContent, &IID_IAMMediaContent> pAMMC = pBF) {
+ if (CComQIPtr<IAMMediaContent, &IID_IAMMediaContent> pAMMC = pBF) {
CComBSTR bstr;
- if(SUCCEEDED(pAMMC->get_Title(&bstr)) && wcslen(bstr.m_str) > 0) {
+ if (SUCCEEDED(pAMMC->get_Title(&bstr)) && wcslen(bstr.m_str) > 0) {
m_clip = bstr.m_str;
fEmpty = false;
}
- if(SUCCEEDED(pAMMC->get_AuthorName(&bstr)) && wcslen(bstr.m_str) > 0) {
+ if (SUCCEEDED(pAMMC->get_AuthorName(&bstr)) && wcslen(bstr.m_str) > 0) {
m_author = bstr.m_str;
fEmpty = false;
}
- if(SUCCEEDED(pAMMC->get_Copyright(&bstr)) && wcslen(bstr.m_str) > 0) {
+ if (SUCCEEDED(pAMMC->get_Copyright(&bstr)) && wcslen(bstr.m_str) > 0) {
m_copyright = bstr.m_str;
fEmpty = false;
}
- if(SUCCEEDED(pAMMC->get_Rating(&bstr)) && wcslen(bstr.m_str) > 0) {
+ if (SUCCEEDED(pAMMC->get_Rating(&bstr)) && wcslen(bstr.m_str) > 0) {
m_rating = bstr.m_str;
fEmpty = false;
}
- if(SUCCEEDED(pAMMC->get_Description(&bstr)) && wcslen(bstr.m_str) > 0) {
+ if (SUCCEEDED(pAMMC->get_Description(&bstr)) && wcslen(bstr.m_str) > 0) {
m_desc.SetWindowText(CString(bstr.m_str));
fEmpty = false;
}
- if(!fEmpty) {
+ if (!fEmpty) {
break;
}
}
diff --git a/src/apps/mplayerc/PPageFileInfoDetails.cpp b/src/apps/mplayerc/PPageFileInfoDetails.cpp index 23fa18487..e2eb793f1 100644 --- a/src/apps/mplayerc/PPageFileInfoDetails.cpp +++ b/src/apps/mplayerc/PPageFileInfoDetails.cpp @@ -50,7 +50,7 @@ CPPageFileInfoDetails::CPPageFileInfoDetails(CString fn, IFilterGraph* pFG, ISub CPPageFileInfoDetails::~CPPageFileInfoDetails()
{
- if(m_hIcon) {
+ if (m_hIcon) {
DestroyIcon(m_hIcon);
}
}
@@ -76,8 +76,8 @@ END_MESSAGE_MAP() static bool GetProperty(IFilterGraph* pFG, LPCOLESTR propName, VARIANT* vt)
{
BeginEnumFilters(pFG, pEF, pBF) {
- if(CComQIPtr<IPropertyBag> pPB = pBF)
- if(SUCCEEDED(pPB->Read(propName, vt, NULL))) {
+ if (CComQIPtr<IPropertyBag> pPB = pBF)
+ if (SUCCEEDED(pPB->Read(propName, vt, NULL))) {
return true;
}
}
@@ -103,13 +103,13 @@ BOOL CPPageFileInfoDetails::OnInitDialog() {
__super::OnInitDialog();
- if(m_fn == _T("")) {
+ if (m_fn == _T("")) {
BeginEnumFilters(m_pFG, pEF, pBF) {
CComQIPtr<IFileSourceFilter> pFSF = pBF;
- if(pFSF) {
+ if (pFSF) {
LPOLESTR pFN = NULL;
AM_MEDIA_TYPE mt;
- if(SUCCEEDED(pFSF->GetCurFile(&pFN, &mt)) && pFN && *pFN) {
+ if (SUCCEEDED(pFSF->GetCurFile(&pFN, &mt)) && pFN && *pFN) {
m_fn = CStringW(pFN);
CoTaskMemFree(pFN);
}
@@ -120,22 +120,22 @@ BOOL CPPageFileInfoDetails::OnInitDialog() }
CString ext = m_fn.Left(m_fn.Find(_T("://"))+1).TrimRight(':');
- if(ext.IsEmpty() || !ext.CompareNoCase(_T("file"))) {
+ if (ext.IsEmpty() || !ext.CompareNoCase(_T("file"))) {
ext = _T(".") + m_fn.Mid(m_fn.ReverseFind('.')+1);
}
m_hIcon = LoadIcon(m_fn, false);
- if(m_hIcon) {
+ if (m_hIcon) {
m_icon.SetIcon(m_hIcon);
}
- if(!LoadType(ext, m_type)) {
+ if (!LoadType(ext, m_type)) {
m_type = ResStr(IDS_AG_NOT_KNOWN);
}
CComVariant vt;
- if(::GetProperty(m_pFG, L"CurFile.TimeCreated", &vt)) {
- if(V_VT(&vt) == VT_UI8) {
+ if (::GetProperty(m_pFG, L"CurFile.TimeCreated", &vt)) {
+ if (V_VT(&vt) == VT_UI8) {
ULARGE_INTEGER uli;
uli.QuadPart = V_UI8(&vt);
@@ -149,7 +149,7 @@ BOOL CPPageFileInfoDetails::OnInitDialog() WIN32_FIND_DATA wfd;
HANDLE hFind = FindFirstFile(m_fn, &wfd);
- if(hFind != INVALID_HANDLE_VALUE) {
+ if (hFind != INVALID_HANDLE_VALUE) {
FindClose(hFind);
__int64 size = (__int64(wfd.nFileSizeHigh)<<32)|wfd.nFileSizeLow;
@@ -158,14 +158,14 @@ BOOL CPPageFileInfoDetails::OnInitDialog() StrFormatByteSizeW(size, szFileSize, sizeof(szFileSize));
m_size.Format(_T("%s (%I64d bytes)"), szFileSize, size);
- if(m_created.IsEmpty()) {
+ if (m_created.IsEmpty()) {
m_created = FormatDateTime(wfd.ftCreationTime);
}
}
REFERENCE_TIME rtDur = 0;
CComQIPtr<IMediaSeeking> pMS = m_pFG;
- if(pMS && SUCCEEDED(pMS->GetDuration(&rtDur)) && rtDur > 0) {
+ if (pMS && SUCCEEDED(pMS->GetDuration(&rtDur)) && rtDur > 0) {
m_time.Format(_T("%02d:%02d:%02d"),
int(rtDur/10000000/60/60),
int((rtDur/10000000/60)%60),
@@ -174,13 +174,13 @@ BOOL CPPageFileInfoDetails::OnInitDialog() CSize wh(0, 0), arxy(0, 0);
- if(m_pCAP) {
+ if (m_pCAP) {
wh = m_pCAP->GetVideoSize(false);
arxy = m_pCAP->GetVideoSize(true);
} else {
- if(CComQIPtr<IBasicVideo> pBV = m_pFG) {
- if(SUCCEEDED(pBV->GetVideoSize(&wh.cx, &wh.cy))) {
- if(CComQIPtr<IBasicVideo2> pBV2 = m_pFG) {
+ if (CComQIPtr<IBasicVideo> pBV = m_pFG) {
+ if (SUCCEEDED(pBV->GetVideoSize(&wh.cx, &wh.cy))) {
+ if (CComQIPtr<IBasicVideo2> pBV2 = m_pFG) {
pBV2->GetPreferredAspectRatio(&arxy.cx, &arxy.cy);
}
} else {
@@ -188,18 +188,18 @@ BOOL CPPageFileInfoDetails::OnInitDialog() }
}
- if(wh.cx == 0 && wh.cy == 0) {
+ if (wh.cx == 0 && wh.cy == 0) {
BeginEnumFilters(m_pFG, pEF, pBF) {
- if(CComQIPtr<IBasicVideo> pBV = pBF) {
+ if (CComQIPtr<IBasicVideo> pBV = pBF) {
pBV->GetVideoSize(&wh.cx, &wh.cy);
- if(CComQIPtr<IBasicVideo2> pBV2 = pBF) {
+ if (CComQIPtr<IBasicVideo2> pBV2 = pBF) {
pBV2->GetPreferredAspectRatio(&arxy.cx, &arxy.cy);
}
break;
- } else if(CComQIPtr<IVMRWindowlessControl> pWC = pBF) {
+ } else if (CComQIPtr<IVMRWindowlessControl> pWC = pBF) {
pWC->GetNativeVideoSize(&wh.cx, &wh.cy, &arxy.cx, &arxy.cy);
break;
- } else if(CComQIPtr<IVMRWindowlessControl9> pWC = pBF) {
+ } else if (CComQIPtr<IVMRWindowlessControl9> pWC = pBF) {
pWC->GetNativeVideoSize(&wh.cx, &wh.cy, &arxy.cx, &arxy.cy);
break;
}
@@ -208,15 +208,15 @@ BOOL CPPageFileInfoDetails::OnInitDialog() }
}
- if(wh.cx > 0 && wh.cy > 0) {
+ if (wh.cx > 0 && wh.cy > 0) {
m_res.Format(_T("%d x %d"), wh.cx, wh.cy);
int lnko = LNKO(arxy.cx, arxy.cy);
- if(lnko > 1) {
+ if (lnko > 1) {
arxy.cx /= lnko, arxy.cy /= lnko;
}
- if(arxy.cx > 0 && arxy.cy > 0 && arxy.cx*wh.cy != arxy.cy*wh.cx) {
+ if (arxy.cx > 0 && arxy.cy > 0 && arxy.cx*wh.cy != arxy.cy*wh.cx) {
CString ar;
ar.Format(_T(" (AR %d:%d)"), arxy.cx, arxy.cy);
m_res += ar;
@@ -245,19 +245,19 @@ void CPPageFileInfoDetails::InitEncoding() BeginEnumFilters(m_pFG, pEF, pBF) {
CComPtr<IBaseFilter> pUSBF = GetUpStreamFilter(pBF);
- if(GetCLSID(pBF) == CLSID_NetShowSource) {
+ if (GetCLSID(pBF) == CLSID_NetShowSource) {
continue;
- } else if(GetCLSID(pUSBF) != CLSID_NetShowSource) {
- if(IPin* pPin = GetFirstPin(pBF, PINDIR_INPUT)) {
+ } else if (GetCLSID(pUSBF) != CLSID_NetShowSource) {
+ if (IPin* pPin = GetFirstPin(pBF, PINDIR_INPUT)) {
CMediaType mt;
- if(FAILED(pPin->ConnectionMediaType(&mt)) || mt.majortype != MEDIATYPE_Stream) {
+ if (FAILED(pPin->ConnectionMediaType(&mt)) || mt.majortype != MEDIATYPE_Stream) {
continue;
}
}
- if(IPin* pPin = GetFirstPin(pBF, PINDIR_OUTPUT)) {
+ if (IPin* pPin = GetFirstPin(pBF, PINDIR_OUTPUT)) {
CMediaType mt;
- if(SUCCEEDED(pPin->ConnectionMediaType(&mt)) && mt.majortype == MEDIATYPE_Stream) {
+ if (SUCCEEDED(pPin->ConnectionMediaType(&mt)) && mt.majortype == MEDIATYPE_Stream) {
continue;
}
}
@@ -266,14 +266,14 @@ void CPPageFileInfoDetails::InitEncoding() BeginEnumPins(pBF, pEP, pPin) {
CMediaTypeEx mt;
PIN_DIRECTION dir;
- if(FAILED(pPin->QueryDirection(&dir)) || dir != PINDIR_OUTPUT
+ if (FAILED(pPin->QueryDirection(&dir)) || dir != PINDIR_OUTPUT
|| FAILED(pPin->ConnectionMediaType(&mt))) {
continue;
}
CString str = mt.ToString();
- if(!str.IsEmpty()) {
+ if (!str.IsEmpty()) {
sl.AddTail(mt.ToString() + CString(L" [" + GetPinName(pPin) + L"]"));
}
}
diff --git a/src/apps/mplayerc/PPageFileInfoRes.cpp b/src/apps/mplayerc/PPageFileInfoRes.cpp index 9ca363825..93679a2dd 100644 --- a/src/apps/mplayerc/PPageFileInfoRes.cpp +++ b/src/apps/mplayerc/PPageFileInfoRes.cpp @@ -39,7 +39,7 @@ CPPageFileInfoRes::CPPageFileInfoRes(CString fn, IFilterGraph* pFG) CPPageFileInfoRes::~CPPageFileInfoRes()
{
- if(m_hIcon) {
+ if (m_hIcon) {
DestroyIcon(m_hIcon);
}
}
@@ -65,13 +65,13 @@ BOOL CPPageFileInfoRes::OnInitDialog() __super::OnInitDialog();
m_hIcon = LoadIcon(m_fn, false);
- if(m_hIcon) {
+ if (m_hIcon) {
m_icon.SetIcon(m_hIcon);
}
m_fn.TrimRight('/');
int i = max(m_fn.ReverseFind('\\'), m_fn.ReverseFind('/'));
- if(i >= 0 && i < m_fn.GetLength()-1) {
+ if (i >= 0 && i < m_fn.GetLength()-1) {
m_fn = m_fn.Mid(i+1);
}
@@ -81,13 +81,13 @@ BOOL CPPageFileInfoRes::OnInitDialog() m_list.InsertColumn(1, _T("Mime Type"), LVCFMT_LEFT, 127);
BeginEnumFilters(m_pFG, pEF, pBF) {
- if(CComQIPtr<IDSMResourceBag> pRB = pBF)
- if(pRB && pRB->ResGetCount() > 0) {
- for(DWORD i = 0; i < pRB->ResGetCount(); i++) {
+ if (CComQIPtr<IDSMResourceBag> pRB = pBF)
+ if (pRB && pRB->ResGetCount() > 0) {
+ for (DWORD i = 0; i < pRB->ResGetCount(); i++) {
CComBSTR name, desc, mime;
BYTE* pData = NULL;
DWORD len = 0;
- if(SUCCEEDED(pRB->ResGet(i, &name, &desc, &mime, &pData, &len, NULL))) {
+ if (SUCCEEDED(pRB->ResGet(i, &name, &desc, &mime, &pData, &len, NULL))) {
CDSMResource r;
r.name = name;
r.desc = desc;
@@ -114,7 +114,7 @@ BOOL CPPageFileInfoRes::OnInitDialog() void CPPageFileInfoRes::OnSaveAs()
{
int i = m_list.GetSelectionMark();
- if(i < 0) {
+ if (i < 0) {
return;
}
@@ -123,8 +123,8 @@ void CPPageFileInfoRes::OnSaveAs() CFileDialog fd(FALSE, NULL, CString(r.name),
OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_NOCHANGEDIR,
_T("All files|*.*||"), this, 0);
- if(fd.DoModal() == IDOK) {
- if(FILE* f = _tfopen(fd.GetPathName(), _T("wb"))) {
+ if (fd.DoModal() == IDOK) {
+ if (FILE* f = _tfopen(fd.GetPathName(), _T("wb"))) {
fwrite(r.data.GetData(), 1, r.data.GetCount(), f);
fclose(f);
}
@@ -139,7 +139,7 @@ void CPPageFileInfoRes::OnUpdateSaveAs(CCmdUI* pCmdUI) void CPPageFileInfoRes::OnNMDblclkList1(NMHDR *pNMHDR, LRESULT *pResult)
{
int i = m_list.GetSelectionMark();
- if(i < 0) {
+ if (i < 0) {
return;
}
diff --git a/src/apps/mplayerc/PPageFileInfoSheet.cpp b/src/apps/mplayerc/PPageFileInfoSheet.cpp index 632f314a8..6e0ed5e3d 100644 --- a/src/apps/mplayerc/PPageFileInfoSheet.cpp +++ b/src/apps/mplayerc/PPageFileInfoSheet.cpp @@ -42,8 +42,8 @@ CPPageFileInfoSheet::CPPageFileInfoSheet(CString fn, CMainFrame* pMainFrame, CWn AddPage(&m_clip);
BeginEnumFilters(pMainFrame->pGB, pEF, pBF) {
- if(CComQIPtr<IDSMResourceBag> pRB = pBF)
- if(pRB && pRB->ResGetCount() > 0) {
+ if (CComQIPtr<IDSMResourceBag> pRB = pBF)
+ if (pRB && pRB->ResGetCount() > 0) {
AddPage(&m_res);
break;
}
@@ -73,7 +73,7 @@ BOOL CPPageFileInfoSheet::OnInitDialog() m_fn.TrimRight('/');
int i = max(m_fn.ReverseFind('\\'), m_fn.ReverseFind('/'));
- if(i >= 0 && i < m_fn.GetLength()-1) {
+ if (i >= 0 && i < m_fn.GetLength()-1) {
m_fn = m_fn.Mid(i+1);
}
m_fn = m_fn+_T(".MediaInfo.txt");
@@ -105,7 +105,7 @@ void CPPageFileInfoSheet::OnSaveAs() if (filedlg.DoModal() == IDOK) { // user has chosen a file, so
_TCHAR bom = (_TCHAR)0xFEFF;
CFile mFile;
- if(mFile.Open(filedlg.GetPathName(), CFile::modeCreate | CFile::modeWrite)) {
+ if (mFile.Open(filedlg.GetPathName(), CFile::modeCreate | CFile::modeWrite)) {
mFile.Write(&bom, sizeof(_TCHAR));
mFile.Write(LPCTSTR(m_mi.MI_Text), m_mi.MI_Text.GetLength()*sizeof(_TCHAR));
mFile.Close();
diff --git a/src/apps/mplayerc/PPageFileMediaInfo.cpp b/src/apps/mplayerc/PPageFileMediaInfo.cpp index 285109d20..50faf9b85 100644 --- a/src/apps/mplayerc/PPageFileMediaInfo.cpp +++ b/src/apps/mplayerc/PPageFileMediaInfo.cpp @@ -1,7 +1,7 @@ /*
* $Id$
*
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -68,7 +68,7 @@ END_MESSAGE_MAP() static WNDPROC OldControlProc;
static LRESULT CALLBACK ControlProc(HWND control, UINT message, WPARAM wParam, LPARAM lParam)
{
- if(message == WM_KEYDOWN) {
+ if (message == WM_KEYDOWN) {
if ((LOWORD(wParam)== 'A' || LOWORD(wParam) == 'a')
&&(GetKeyState(VK_CONTROL) < 0)) {
CEdit *pEdit = (CEdit*)CWnd::FromHandle(control);
@@ -84,20 +84,20 @@ BOOL CPPageFileMediaInfo::OnInitDialog() {
__super::OnInitDialog();
- if(!m_pCFont) {
+ if (!m_pCFont) {
m_pCFont = DNew CFont;
}
- if(!m_pCFont) {
+ if (!m_pCFont) {
return TRUE;
}
- if(m_fn == _T("")) {
+ if (m_fn == _T("")) {
BeginEnumFilters(m_pFG, pEF, pBF) {
CComQIPtr<IFileSourceFilter> pFSF = pBF;
- if(pFSF) {
+ if (pFSF) {
LPOLESTR pFN = NULL;
AM_MEDIA_TYPE mt;
- if(SUCCEEDED(pFSF->GetCurFile(&pFN, &mt)) && pFN && *pFN) {
+ if (SUCCEEDED(pFSF->GetCurFile(&pFN, &mt)) && pFN && *pFN) {
m_fn = CStringW(pFN);
CoTaskMemFree(pFN);
}
@@ -119,7 +119,7 @@ BOOL CPPageFileMediaInfo::OnInitDialog() MI.Option(_T("Complete"));
MI_Text = MI.Inform().c_str();
MI.Close();
- if(!MI_Text.Find(_T("Unable to load"))) {
+ if (!MI_Text.Find(_T("Unable to load"))) {
MI_Text = _T("");
}
@@ -142,7 +142,7 @@ BOOL CPPageFileMediaInfo::OnInitDialog() void CPPageFileMediaInfo::OnShowWindow(BOOL bShow, UINT nStatus)
{
__super::OnShowWindow(bShow, nStatus);
- if(bShow) {
+ if (bShow) {
GetParent()->GetDlgItem(IDC_BUTTON_MI)->ShowWindow(SW_SHOW);
} else {
GetParent()->GetDlgItem(IDC_BUTTON_MI)->ShowWindow(SW_HIDE);
diff --git a/src/apps/mplayerc/PPageFormats.cpp b/src/apps/mplayerc/PPageFormats.cpp index e4cb26116..6a2506eef 100644 --- a/src/apps/mplayerc/PPageFormats.cpp +++ b/src/apps/mplayerc/PPageFormats.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -109,7 +109,7 @@ CString CPPageFormats::GetEnqueueCommand() CString path;
TCHAR buff[_MAX_PATH];
- if(::GetModuleFileName(AfxGetInstanceHandle(), buff, _MAX_PATH) == 0) {
+ if (::GetModuleFileName(AfxGetInstanceHandle(), buff, _MAX_PATH) == 0) {
return _T("");
}
@@ -122,7 +122,7 @@ CString CPPageFormats::GetOpenCommand() CString path;
TCHAR buff[_MAX_PATH];
- if(::GetModuleFileName(AfxGetInstanceHandle(), buff, _MAX_PATH) == 0) {
+ if (::GetModuleFileName(AfxGetInstanceHandle(), buff, _MAX_PATH) == 0) {
return _T("");
}
@@ -155,22 +155,22 @@ bool CPPageFormats::IsRegistered(CString ext) ULONG len = sizeof(buff)/sizeof(buff[0]);
memset(buff, 0, sizeof(buff));
- if(ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, ext)) {
+ if (ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, ext)) {
return false;
}
- if(ERROR_SUCCESS != key.QueryStringValue(NULL, buff, &len) && !CString(buff).Trim().IsEmpty()) {
+ if (ERROR_SUCCESS != key.QueryStringValue(NULL, buff, &len) && !CString(buff).Trim().IsEmpty()) {
return false;
}
bIsDefault = (buff == strProgID);
}
- if(!f_setContextFiles) {
+ if (!f_setContextFiles) {
CRegKey key;
TCHAR buff[_MAX_PATH];
ULONG len = sizeof(buff)/sizeof(buff[0]);
- if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\open"), KEY_READ)) {
+ if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\open"), KEY_READ)) {
CString strCommand = ResStr(IDS_OPEN_WITH_MPC);
if (ERROR_SUCCESS == key.QueryStringValue(NULL, buff, &len)) {
f_setContextFiles = (strCommand.CompareNoCase(CString(buff)) == 0);
@@ -185,7 +185,7 @@ bool CPPageFormats::IsRegistered(CString ext) ULONG len = sizeof(buff)/sizeof(buff[0]);
bIsDefault = FALSE;
- if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\open\\command"), KEY_READ)) {
+ if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\open\\command"), KEY_READ)) {
CString strCommand = GetOpenCommand();
if (ERROR_SUCCESS == key.QueryStringValue(NULL, buff, &len)) {
bIsDefault = (strCommand.CompareNoCase(CString(buff)) == 0);
@@ -224,9 +224,9 @@ int GetIconIndex(CString ext) int iconindex = -1;
GetIconIndexFunc _getIconIndexFunc;
HINSTANCE mpciconlib = LoadLibrary(_T("mpciconlib.dll"));
- if(mpciconlib) {
+ if (mpciconlib) {
_getIconIndexFunc = (GetIconIndexFunc) GetProcAddress(mpciconlib, "get_icon_index");
- if(_getIconIndexFunc) {
+ if (_getIconIndexFunc) {
iconindex = _getIconIndexFunc(ext);
}
FreeLibrary(mpciconlib);
@@ -241,8 +241,8 @@ bool CPPageFormats::RegisterExt(CString ext, CString strLabel, bool fRegister) bool bSetValue;
CString strProgID = _T("mplayerc") + ext;
- if(!fRegister) {
- if(fRegister != IsRegistered(ext)) {
+ if (!fRegister) {
+ if (fRegister != IsRegistered(ext)) {
SetFileAssociation (ext, strProgID, fRegister);
}
key.Attach(HKEY_CLASSES_ROOT);
@@ -253,26 +253,26 @@ bool CPPageFormats::RegisterExt(CString ext, CString strLabel, bool fRegister) bSetValue = fRegister || (ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\open\\command"), KEY_READ));
// Create ProgID for this file type
- if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID)) {
+ if (ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID)) {
return(false);
}
- if(ERROR_SUCCESS != key.SetStringValue(NULL, strLabel)) {
+ if (ERROR_SUCCESS != key.SetStringValue(NULL, strLabel)) {
return(false);
}
// Add to playlist option
- if(f_setContextFiles) {
- if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\enqueue"))) {
+ if (f_setContextFiles) {
+ if (ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\enqueue"))) {
return(false);
}
- if(ERROR_SUCCESS != key.SetStringValue(NULL, ResStr(IDS_ADD_TO_PLAYLIST))) {
+ if (ERROR_SUCCESS != key.SetStringValue(NULL, ResStr(IDS_ADD_TO_PLAYLIST))) {
return(false);
}
- if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\enqueue\\command"))) {
+ if (ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\enqueue\\command"))) {
return(false);
}
- if(bSetValue && (ERROR_SUCCESS != key.SetStringValue(NULL, GetEnqueueCommand()))) {
+ if (bSetValue && (ERROR_SUCCESS != key.SetStringValue(NULL, GetEnqueueCommand()))) {
return(false);
}
} else {
@@ -282,61 +282,61 @@ bool CPPageFormats::RegisterExt(CString ext, CString strLabel, bool fRegister) }
// Play option
- if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\open"))) {
+ if (ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\open"))) {
return(false);
}
- if(f_setContextFiles) {
- if(ERROR_SUCCESS != key.SetStringValue(NULL, ResStr(IDS_OPEN_WITH_MPC))) {
+ if (f_setContextFiles) {
+ if (ERROR_SUCCESS != key.SetStringValue(NULL, ResStr(IDS_OPEN_WITH_MPC))) {
return(false);
}
} else {
- if(ERROR_SUCCESS != key.SetStringValue(NULL, _T(""))) {
+ if (ERROR_SUCCESS != key.SetStringValue(NULL, _T(""))) {
return(false);
}
}
- if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\open\\command"))) {
+ if (ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\open\\command"))) {
return(false);
}
- if(bSetValue && (ERROR_SUCCESS != key.SetStringValue(NULL, GetOpenCommand()))) {
+ if (bSetValue && (ERROR_SUCCESS != key.SetStringValue(NULL, GetOpenCommand()))) {
return(false);
}
- if(ERROR_SUCCESS != key.Create(HKEY_LOCAL_MACHINE, g_strRegisteredKey + _T("\\FileAssociations"))) {
+ if (ERROR_SUCCESS != key.Create(HKEY_LOCAL_MACHINE, g_strRegisteredKey + _T("\\FileAssociations"))) {
return(false);
}
- if(ERROR_SUCCESS != key.SetStringValue(ext, strProgID)) {
+ if (ERROR_SUCCESS != key.SetStringValue(ext, strProgID)) {
return(false);
}
- if(f_setAssociatedWithIcon) {
+ if (f_setAssociatedWithIcon) {
CString AppIcon = _T("");
TCHAR buff[_MAX_PATH];
CString mpciconlib = GetProgramDir() + _T("\\mpciconlib.dll");
- if(FileExists(mpciconlib)) {
+ if (FileExists(mpciconlib)) {
int icon_index = GetIconIndex(ext);
CString m_typeicon = mpciconlib;
/* icon_index value -1 means no icon was found in the iconlib for the file extension */
- if((icon_index >= 0) && ExtractIcon(AfxGetApp()->m_hInstance,(LPCWSTR)m_typeicon, icon_index)) {
+ if ((icon_index >= 0) && ExtractIcon(AfxGetApp()->m_hInstance,(LPCWSTR)m_typeicon, icon_index)) {
m_typeicon = "\""+mpciconlib+"\"";
AppIcon.Format(_T("%s,%d"), m_typeicon, icon_index);
}
}
/* no icon was found for the file extension, so use MPC's icon */
- if((AppIcon.IsEmpty()) && (::GetModuleFileName(AfxGetInstanceHandle(), buff, _MAX_PATH))) {
+ if ((AppIcon.IsEmpty()) && (::GetModuleFileName(AfxGetInstanceHandle(), buff, _MAX_PATH))) {
AppIcon = buff;
AppIcon = "\""+AppIcon+"\"";
AppIcon += _T(",0");
}
- if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\DefaultIcon"))) {
+ if (ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\DefaultIcon"))) {
return(false);
}
- if(bSetValue && (ERROR_SUCCESS != key.SetStringValue(NULL, AppIcon))) {
+ if (bSetValue && (ERROR_SUCCESS != key.SetStringValue(NULL, AppIcon))) {
return(false);
}
} else {
@@ -344,7 +344,7 @@ bool CPPageFormats::RegisterExt(CString ext, CString strLabel, bool fRegister) key.RecurseDeleteKey(strProgID + _T("\\DefaultIcon"));
}
- if(fRegister != IsRegistered(ext)) {
+ if (fRegister != IsRegistered(ext)) {
SetFileAssociation (ext, strProgID, fRegister);
}
@@ -364,32 +364,32 @@ static struct { void CPPageFormats::AddAutoPlayToRegistry(autoplay_t ap, bool fRegister)
{
TCHAR buff[_MAX_PATH];
- if(::GetModuleFileName(AfxGetInstanceHandle(), buff, _MAX_PATH) == 0) {
+ if (::GetModuleFileName(AfxGetInstanceHandle(), buff, _MAX_PATH) == 0) {
return;
}
CString exe = buff;
int i = (int)ap;
- if(i < 0 || i >= countof(handlers)) {
+ if (i < 0 || i >= countof(handlers)) {
return;
}
CRegKey key;
- if(fRegister) {
- if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, _T("MediaPlayerClassic.Autorun"))) {
+ if (fRegister) {
+ if (ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, _T("MediaPlayerClassic.Autorun"))) {
return;
}
key.Close();
- if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT,
+ if (ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT,
CString(CStringA("MediaPlayerClassic.Autorun\\Shell\\Play") + handlers[i].verb + "\\Command"))) {
return;
}
key.SetStringValue(NULL, _T("\"") + exe + _T("\"") + handlers[i].cmd);
key.Close();
- if(ERROR_SUCCESS != key.Create(HKEY_LOCAL_MACHINE,
+ if (ERROR_SUCCESS != key.Create(HKEY_LOCAL_MACHINE,
CString(CStringA("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\AutoplayHandlers\\Handlers\\MPCPlay") + handlers[i].verb + "OnArrival"))) {
return;
}
@@ -400,14 +400,14 @@ void CPPageFormats::AddAutoPlayToRegistry(autoplay_t ap, bool fRegister) key.SetStringValue(_T("DefaultIcon"), exe + _T(",0"));
key.Close();
- if(ERROR_SUCCESS != key.Create(HKEY_LOCAL_MACHINE,
+ if (ERROR_SUCCESS != key.Create(HKEY_LOCAL_MACHINE,
CString(CStringA("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\AutoplayHandlers\\EventHandlers\\Play") + handlers[i].verb + "OnArrival"))) {
return;
}
key.SetStringValue(CString(CStringA("MPCPlay") + handlers[i].verb + "OnArrival"), _T(""));
key.Close();
} else {
- if(ERROR_SUCCESS != key.Create(HKEY_LOCAL_MACHINE,
+ if (ERROR_SUCCESS != key.Create(HKEY_LOCAL_MACHINE,
CString(CStringA("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\AutoplayHandlers\\EventHandlers\\Play") + handlers[i].verb + "OnArrival"))) {
return;
}
@@ -420,41 +420,41 @@ bool CPPageFormats::IsAutoPlayRegistered(autoplay_t ap) {
ULONG len;
TCHAR buff[_MAX_PATH];
- if(::GetModuleFileName(AfxGetInstanceHandle(), buff, _MAX_PATH) == 0) {
+ if (::GetModuleFileName(AfxGetInstanceHandle(), buff, _MAX_PATH) == 0) {
return(false);
}
CString exe = buff;
int i = (int)ap;
- if(i < 0 || i >= countof(handlers)) {
+ if (i < 0 || i >= countof(handlers)) {
return(false);
}
CRegKey key;
- if(ERROR_SUCCESS != key.Open(HKEY_LOCAL_MACHINE,
+ if (ERROR_SUCCESS != key.Open(HKEY_LOCAL_MACHINE,
CString(CStringA("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\AutoplayHandlers\\EventHandlers\\Play") + handlers[i].verb + "OnArrival"),
KEY_READ)) {
return(false);
}
len = countof(buff);
- if(ERROR_SUCCESS != key.QueryStringValue(
+ if (ERROR_SUCCESS != key.QueryStringValue(
CString(_T("MPCPlay")) + handlers[i].verb + _T("OnArrival"),
buff, &len)) {
return(false);
}
key.Close();
- if(ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT,
+ if (ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT,
CString(CStringA("MediaPlayerClassic.Autorun\\Shell\\Play") + handlers[i].verb + "\\Command"),
KEY_READ)) {
return(false);
}
len = countof(buff);
- if(ERROR_SUCCESS != key.QueryStringValue(NULL, buff, &len)) {
+ if (ERROR_SUCCESS != key.QueryStringValue(NULL, buff, &len)) {
return(false);
}
- if(_tcsnicmp(_T("\"") + exe, buff, exe.GetLength() + 1)) {
+ if (_tcsnicmp(_T("\"") + exe, buff, exe.GetLength() + 1)) {
return(false);
}
key.Close();
@@ -464,7 +464,7 @@ bool CPPageFormats::IsAutoPlayRegistered(autoplay_t ap) void CPPageFormats::SetListItemState(int nItem)
{
- if(nItem < 0) {
+ if (nItem < 0) {
return;
}
@@ -476,7 +476,7 @@ void CPPageFormats::SetListItemState(int nItem) int cnt = 0;
POSITION pos = exts.GetHeadPosition();
- while(pos) if(IsRegistered(exts.GetNext(pos))) {
+ while (pos) if (IsRegistered(exts.GetNext(pos))) {
cnt++;
}
@@ -518,7 +518,7 @@ BOOL CPPageFormats::OnInitDialog() CMediaFormats& mf = AfxGetAppSettings().m_Formats;
mf.UpdateData(FALSE);
- for(int i = 0; i < (int)mf.GetCount(); i++) {
+ for (int i = 0; i < (int)mf.GetCount(); i++) {
CString label;
label.Format (_T("%s (%s)"), mf[i].GetLabel(), mf[i].GetExts());
@@ -549,7 +549,7 @@ BOOL CPPageFormats::OnInitDialog() f_setContextFiles = 0;
- for(int i = 0; i < m_list.GetItemCount(); i++) {
+ for (int i = 0; i < m_list.GetItemCount(); i++) {
SetListItemState(i);
}
m_fContextFiles.SetCheck(f_setContextFiles);
@@ -590,7 +590,7 @@ BOOL CPPageFormats::OnInitDialog() ULONG len = sizeof(buff)/sizeof(buff[0]);
int fContextDir = 0;
- if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("Directory\\shell\\mplayerc.play\\command"), KEY_READ)) {
+ if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("Directory\\shell\\mplayerc.play\\command"), KEY_READ)) {
CString strCommand = GetOpenCommand();
if (ERROR_SUCCESS == key.QueryStringValue(NULL, buff, &len)) {
fContextDir = (strCommand.CompareNoCase(CString(buff)) == 0);
@@ -628,14 +628,14 @@ BOOL CPPageFormats::SetFileAssociation(CString strExt, CString strProgID, bool f CString strNewApp;
if (fRegister) {
// Create non existing file type
- if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strExt)) {
+ if (ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strExt)) {
return(false);
}
WCHAR* pszCurrentAssociation;
// Save current application associated
if (SUCCEEDED (m_pAAR->QueryCurrentDefault (strExt, AT_FILEEXTENSION, AL_EFFECTIVE, &pszCurrentAssociation))) {
- if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID)) {
+ if (ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID)) {
return(false);
}
@@ -647,7 +647,7 @@ BOOL CPPageFormats::SetFileAssociation(CString strExt, CString strProgID, bool f {
len = sizeof(buff);
memset(buff, 0, len);
- if(ERROR_SUCCESS == key.QueryStringValue(NULL, buff, &len) && !CString(buff).Trim().IsEmpty())
+ if (ERROR_SUCCESS == key.QueryStringValue(NULL, buff, &len) && !CString(buff).Trim().IsEmpty())
{
if (ERROR_SUCCESS == key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\DefaultIcon")))
key.SetStringValue (NULL, buff);
@@ -658,11 +658,11 @@ BOOL CPPageFormats::SetFileAssociation(CString strExt, CString strProgID, bool f }
strNewApp = g_strRegisteredAppName;
} else {
- if(ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, strProgID)) {
+ if (ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, strProgID)) {
return(false);
}
- if(ERROR_SUCCESS == key.QueryStringValue(g_strOldAssoc, buff, &len)) {
+ if (ERROR_SUCCESS == key.QueryStringValue(g_strOldAssoc, buff, &len)) {
strNewApp = buff;
}
@@ -674,16 +674,16 @@ BOOL CPPageFormats::SetFileAssociation(CString strExt, CString strProgID, bool f // The 2000/XP way
if (fRegister) {
// Set new association
- if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strExt)) {
+ if (ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strExt)) {
return(false);
}
len = sizeof(buff)/sizeof(buff[0]);
memset(buff, 0, sizeof(buff));
- if(ERROR_SUCCESS == key.QueryStringValue(NULL, buff, &len) && !CString(buff).Trim().IsEmpty()) {
+ if (ERROR_SUCCESS == key.QueryStringValue(NULL, buff, &len) && !CString(buff).Trim().IsEmpty()) {
extoldreg = buff;
}
- if(ERROR_SUCCESS != key.SetStringValue(NULL, strProgID)) {
+ if (ERROR_SUCCESS != key.SetStringValue(NULL, strProgID)) {
return(false);
}
@@ -695,14 +695,14 @@ BOOL CPPageFormats::SetFileAssociation(CString strExt, CString strProgID, bool f {
len = sizeof(buff);
memset(buff, 0, len);
- if(ERROR_SUCCESS == key.QueryStringValue(NULL, buff, &len) && !CString(buff).Trim().IsEmpty())
+ if (ERROR_SUCCESS == key.QueryStringValue(NULL, buff, &len) && !CString(buff).Trim().IsEmpty())
extOldIcon = buff;
}
}
*/
// Save old association
- if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID)) {
+ if (ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID)) {
return(false);
}
key.SetStringValue(g_strOldAssoc, extoldreg);
@@ -715,15 +715,15 @@ BOOL CPPageFormats::SetFileAssociation(CString strExt, CString strProgID, bool f // Get previous association
len = sizeof(buff)/sizeof(buff[0]);
memset(buff, 0, sizeof(buff));
- if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID)) {
+ if (ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID)) {
return(false);
}
- if(ERROR_SUCCESS == key.QueryStringValue(g_strOldAssoc, buff, &len) && !CString(buff).Trim().IsEmpty()) {
+ if (ERROR_SUCCESS == key.QueryStringValue(g_strOldAssoc, buff, &len) && !CString(buff).Trim().IsEmpty()) {
extoldreg = buff;
}
// Set previous association
- if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strExt)) {
+ if (ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strExt)) {
return(false);
}
key.SetStringValue(NULL, extoldreg);
@@ -741,10 +741,10 @@ BOOL CPPageFormats::OnApply() {
int i = m_list.GetSelectionMark();
- if(i >= 0) {
+ if (i >= 0) {
i = (int)m_list.GetItemData(i);
}
- if(i >= 0) {
+ if (i >= 0) {
CMediaFormats& mf = AfxGetAppSettings().m_Formats;
mf[i].SetExts(m_exts);
m_exts = mf[i].GetExtsWithPeriod();
@@ -757,7 +757,7 @@ BOOL CPPageFormats::OnApply() CString AppIcon = _T("");
TCHAR buff[_MAX_PATH];
- if(::GetModuleFileName(AfxGetInstanceHandle(), buff, _MAX_PATH)) {
+ if (::GetModuleFileName(AfxGetInstanceHandle(), buff, _MAX_PATH)) {
AppIcon = buff;
AppIcon = "\""+AppIcon+"\"";
AppIcon += _T(",0");
@@ -767,10 +767,10 @@ BOOL CPPageFormats::OnApply() // Register MPC for the windows "Default application" manager
CRegKey key;
- if(ERROR_SUCCESS == key.Open(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\RegisteredApplications"))) {
+ if (ERROR_SUCCESS == key.Open(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\RegisteredApplications"))) {
key.SetStringValue(_T("Media Player Classic"), g_strRegisteredKey);
- if(ERROR_SUCCESS != key.Create(HKEY_LOCAL_MACHINE, g_strRegisteredKey)) {
+ if (ERROR_SUCCESS != key.Create(HKEY_LOCAL_MACHINE, g_strRegisteredKey)) {
return(false);
}
@@ -784,9 +784,9 @@ BOOL CPPageFormats::OnApply() f_setContextFiles = m_fContextFiles.GetCheck();
f_setAssociatedWithIcon = m_fAssociatedWithIcons.GetCheck();
- for(int i = 0; i < m_list.GetItemCount(); i++) {
+ for (int i = 0; i < m_list.GetItemCount(); i++) {
int iChecked = GetChecked(i);
- if(iChecked == 2) {
+ if (iChecked == 2) {
continue;
}
@@ -794,26 +794,26 @@ BOOL CPPageFormats::OnApply() Explode(mf[(int)m_list.GetItemData(i)].GetExtsWithPeriod(), exts, ' ');
POSITION pos = exts.GetHeadPosition();
- while(pos) {
+ while (pos) {
RegisterExt(exts.GetNext(pos), mf[(int)m_list.GetItemData(i)].GetLabel(), !!iChecked);
}
}
CRegKey key;
- if(m_fContextDir.GetCheck()) {
- if(ERROR_SUCCESS == key.Create(HKEY_CLASSES_ROOT, _T("Directory\\shell\\mplayerc.enqueue"))) {
+ if (m_fContextDir.GetCheck()) {
+ if (ERROR_SUCCESS == key.Create(HKEY_CLASSES_ROOT, _T("Directory\\shell\\mplayerc.enqueue"))) {
key.SetStringValue(NULL, ResStr(IDS_ADD_TO_PLAYLIST));
}
- if(ERROR_SUCCESS == key.Create(HKEY_CLASSES_ROOT, _T("Directory\\shell\\mplayerc.enqueue\\command"))) {
+ if (ERROR_SUCCESS == key.Create(HKEY_CLASSES_ROOT, _T("Directory\\shell\\mplayerc.enqueue\\command"))) {
key.SetStringValue(NULL, GetEnqueueCommand());
}
- if(ERROR_SUCCESS == key.Create(HKEY_CLASSES_ROOT, _T("Directory\\shell\\mplayerc.play"))) {
+ if (ERROR_SUCCESS == key.Create(HKEY_CLASSES_ROOT, _T("Directory\\shell\\mplayerc.play"))) {
key.SetStringValue(NULL, ResStr(IDS_OPEN_WITH_MPC));
}
- if(ERROR_SUCCESS == key.Create(HKEY_CLASSES_ROOT, _T("Directory\\shell\\mplayerc.play\\command"))) {
+ if (ERROR_SUCCESS == key.Create(HKEY_CLASSES_ROOT, _T("Directory\\shell\\mplayerc.play\\command"))) {
key.SetStringValue(NULL, GetOpenCommand());
}
} else {
@@ -844,10 +844,10 @@ void CPPageFormats::OnNMClickList1(NMHDR* pNMHDR, LRESULT* pResult) {
LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)pNMHDR;
- if(lpnmlv->iItem >= 0 && lpnmlv->iSubItem == COL_CATEGORY) {
+ if (lpnmlv->iItem >= 0 && lpnmlv->iSubItem == COL_CATEGORY) {
CRect r;
m_list.GetItemRect(lpnmlv->iItem, r, LVIR_ICON);
- if(r.PtInRect(lpnmlv->ptAction)) {
+ if (r.PtInRect(lpnmlv->ptAction)) {
if (m_bInsufficientPrivileges) {
MessageBox (ResStr (IDS_CANNOT_CHANGE_FORMAT));
} else {
@@ -864,7 +864,7 @@ void CPPageFormats::OnLvnItemchangedList1(NMHDR *pNMHDR, LRESULT *pResult) {
LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
- if(pNMLV->iItem >= 0 && pNMLV->iSubItem == COL_CATEGORY
+ if (pNMLV->iItem >= 0 && pNMLV->iSubItem == COL_CATEGORY
&& (pNMLV->uChanged&LVIF_STATE) && (pNMLV->uNewState&LVIS_SELECTED)) {
m_exts = AfxGetAppSettings().m_Formats[(int)m_list.GetItemData(pNMLV->iItem)].GetExtsWithPeriod();
UpdateData(FALSE);
@@ -880,11 +880,11 @@ void CPPageFormats::OnBeginlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) *pResult = FALSE;
- if(pItem->iItem < 0) {
+ if (pItem->iItem < 0) {
return;
}
- if(pItem->iSubItem == COL_ENGINE) {
+ if (pItem->iSubItem == COL_ENGINE) {
*pResult = TRUE;
}
}
@@ -896,7 +896,7 @@ void CPPageFormats::OnDolabeleditList(NMHDR* pNMHDR, LRESULT* pResult) *pResult = FALSE;
- if(pItem->iItem < 0) {
+ if (pItem->iItem < 0) {
return;
}
@@ -905,7 +905,7 @@ void CPPageFormats::OnDolabeleditList(NMHDR* pNMHDR, LRESULT* pResult) CAtlList<CString> sl;
int nSel = -1;
- if(pItem->iSubItem == COL_ENGINE) {
+ if (pItem->iSubItem == COL_ENGINE) {
sl.AddTail(_T("DirectShow"));
sl.AddTail(_T("RealMedia"));
sl.AddTail(_T("QuickTime"));
@@ -926,30 +926,30 @@ void CPPageFormats::OnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) *pResult = FALSE;
- if(!m_list.m_fInPlaceDirty) {
+ if (!m_list.m_fInPlaceDirty) {
return;
}
- if(pItem->iItem < 0) {
+ if (pItem->iItem < 0) {
return;
}
CMediaFormatCategory& mfc = AfxGetAppSettings().m_Formats[m_list.GetItemData(pItem->iItem)];
- if(pItem->iSubItem == COL_ENGINE && pItem->lParam >= 0) {
+ if (pItem->iSubItem == COL_ENGINE && pItem->lParam >= 0) {
mfc.SetEngineType((engine_t)pItem->lParam);
m_list.SetItemText(pItem->iItem, pItem->iSubItem, pItem->pszText);
*pResult = TRUE;
}
- if(*pResult) {
+ if (*pResult) {
SetModified();
}
}
void CPPageFormats::OnBnClickedButton1()
{
- for(int i = 0, j = m_list.GetItemCount(); i < j; i++) {
+ for (int i = 0, j = m_list.GetItemCount(); i < j; i++) {
SetChecked(i, 1);
}
@@ -965,8 +965,8 @@ void CPPageFormats::OnBnClickedButton14() {
CMediaFormats& mf = AfxGetAppSettings().m_Formats;
- for(int i = 0, j = m_list.GetItemCount(); i < j; i++) {
- if(!mf[m_list.GetItemData(i)].GetLabel().CompareNoCase(ResStr(IDS_AG_PLAYLIST_FILE))) {
+ for (int i = 0, j = m_list.GetItemCount(); i < j; i++) {
+ if (!mf[m_list.GetItemData(i)].GetLabel().CompareNoCase(ResStr(IDS_AG_PLAYLIST_FILE))) {
SetChecked(i, 0);
continue;
}
@@ -985,7 +985,7 @@ void CPPageFormats::OnBnClickedButton13() {
CMediaFormats& mf = AfxGetAppSettings().m_Formats;
- for(int i = 0, j = m_list.GetItemCount(); i < j; i++) {
+ for (int i = 0, j = m_list.GetItemCount(); i < j; i++) {
SetChecked(i, mf[(int)m_list.GetItemData(i)].IsAudioOnly()?1:0);
}
@@ -1007,7 +1007,7 @@ void CPPageFormats::OnBnVistaModify() AfxGetMyApp()->RunAsAdministrator (strApp, strCmd, true);
- for(int i = 0; i < m_list.GetItemCount(); i++) {
+ for (int i = 0; i < m_list.GetItemCount(); i++) {
SetListItemState(i);
}
}
@@ -1015,7 +1015,7 @@ void CPPageFormats::OnBnVistaModify() void CPPageFormats::OnBnClickedButton12()
{
int i = m_list.GetSelectionMark();
- if(i < 0) {
+ if (i < 0) {
return;
}
i = (int)m_list.GetItemData(i);
@@ -1032,7 +1032,7 @@ void CPPageFormats::OnBnClickedButton11() {
UpdateData();
int i = m_list.GetSelectionMark();
- if(i < 0) {
+ if (i < 0) {
return;
}
i = (int)m_list.GetItemData(i);
@@ -1048,7 +1048,7 @@ void CPPageFormats::OnBnClickedButton11() void CPPageFormats::OnUpdateButtonDefault(CCmdUI* pCmdUI)
{
int i = m_list.GetSelectionMark();
- if(i < 0) {
+ if (i < 0) {
pCmdUI->Enable(FALSE);
return;
}
@@ -1065,7 +1065,7 @@ void CPPageFormats::OnUpdateButtonDefault(CCmdUI* pCmdUI) void CPPageFormats::OnUpdateButtonSet(CCmdUI* pCmdUI)
{
int i = m_list.GetSelectionMark();
- if(i < 0) {
+ if (i < 0) {
pCmdUI->Enable(FALSE);
return;
}
diff --git a/src/apps/mplayerc/PPageFullscreen.cpp b/src/apps/mplayerc/PPageFullscreen.cpp index 670151bdb..40365d3fc 100644 --- a/src/apps/mplayerc/PPageFullscreen.cpp +++ b/src/apps/mplayerc/PPageFullscreen.cpp @@ -110,7 +110,7 @@ BOOL CPPageFullscreen::OnInitDialog() m_iMonitorTypeCtrl.AddString(ResStr(IDS_FULLSCREENMONITOR_CURRENT));
m_MonitorDisplayNames.Add(_T("Current"));
- if(m_f_hmonitor == _T("Current")) {
+ if (m_f_hmonitor == _T("Current")) {
m_iMonitorType = m_iMonitorTypeCtrl.GetCount()-1;
}
@@ -118,7 +118,7 @@ BOOL CPPageFullscreen::OnInitDialog() monitor = monitors.GetMonitor( i );
monitor.GetName(str);
- if(monitor.IsMonitor()) {
+ if (monitor.IsMonitor()) {
DISPLAY_DEVICE displayDevice;
ZeroMemory(&displayDevice, sizeof(displayDevice));
displayDevice.cb = sizeof(displayDevice);
@@ -127,13 +127,13 @@ BOOL CPPageFullscreen::OnInitDialog() m_iMonitorTypeCtrl.AddString(str+_T(" - ")+displayDevice.DeviceString);
m_MonitorDisplayNames.Add(str);
- if(m_f_hmonitor == str && m_iMonitorType == 0) {
+ if (m_f_hmonitor == str && m_iMonitorType == 0) {
m_iMonitorType = m_iMonitorTypeCtrl.GetCount()-1;
}
}
}
- if(m_iMonitorTypeCtrl.GetCount() > 2) {
+ if (m_iMonitorTypeCtrl.GetCount() > 2) {
GetDlgItem(IDC_COMBO1)->EnableWindow(TRUE);
} else {
m_iMonitorType = 0;
@@ -161,22 +161,22 @@ BOOL CPPageFullscreen::OnApply() m_AutoChangeFullscrRes.bEnabled = !!m_fSetFullscreenRes;
if (m_AutoChangeFullscrRes.bEnabled) {
- if(iSel_24 >= 0 && iSel_24 < m_dms.GetCount()) {
+ if (iSel_24 >= 0 && iSel_24 < m_dms.GetCount()) {
m_AutoChangeFullscrRes.dmFullscreenRes24Hz = m_dms[m_dispmode24combo.GetCurSel()];
}
- if(iSel_25 >= 0 && iSel_25 < m_dms.GetCount()) {
+ if (iSel_25 >= 0 && iSel_25 < m_dms.GetCount()) {
m_AutoChangeFullscrRes.dmFullscreenRes25Hz = m_dms[m_dispmode25combo.GetCurSel()];
}
- if(iSel_30 >= 0 && iSel_30 < m_dms.GetCount()) {
+ if (iSel_30 >= 0 && iSel_30 < m_dms.GetCount()) {
m_AutoChangeFullscrRes.dmFullscreenRes30Hz = m_dms[m_dispmode30combo.GetCurSel()];
}
- if(iSel_Other >= 0 && iSel_Other < m_dms.GetCount()) {
+ if (iSel_Other >= 0 && iSel_Other < m_dms.GetCount()) {
m_AutoChangeFullscrRes.dmFullscreenResOther = m_dms[m_dispmodeOthercombo.GetCurSel()];
}
- if(iSel_23 >= 0 && iSel_23 < m_dms.GetCount()) {
+ if (iSel_23 >= 0 && iSel_23 < m_dms.GetCount()) {
m_AutoChangeFullscrRes.dmFullscreenRes23d976Hz = m_dms[m_dispmode23d976combo.GetCurSel()];
}
- if(iSel_29 >= 0 && iSel_29 < m_dms.GetCount()) {
+ if (iSel_29 >= 0 && iSel_29 < m_dms.GetCount()) {
m_AutoChangeFullscrRes.dmFullscreenRes29d97Hz = m_dms[m_dispmode29d97combo.GetCurSel()];
}
}
@@ -237,7 +237,7 @@ void CPPageFullscreen::OnUpdateFullScrCombo() {
CMonitors monitors;
m_f_hmonitor = m_MonitorDisplayNames[m_iMonitorTypeCtrl.GetCurSel()];
- if(AfxGetAppSettings().strFullScreenMonitor != m_f_hmonitor) {
+ if (AfxGetAppSettings().strFullScreenMonitor != m_f_hmonitor) {
m_AutoChangeFullscrRes.bEnabled = false;
}
ModesUpdate();
@@ -263,7 +263,7 @@ void CPPageFullscreen::ModesUpdate() dmtoset23 = m_AutoChangeFullscrRes.dmFullscreenRes23d976Hz,
dmtoset29 = m_AutoChangeFullscrRes.dmFullscreenRes29d97Hz;
- if(!m_AutoChangeFullscrRes.bEnabled) {
+ if (!m_AutoChangeFullscrRes.bEnabled) {
GetCurDispMode(dmtoset24, m_f_hmonitor);
dmtoset29 = dmtoset23 = dmtosetOther = dmtoset30 = dmtoset25 = dmtoset24;
}
@@ -277,12 +277,14 @@ void CPPageFullscreen::ModesUpdate() ComboBox_ResetContent(m_dispmode29d97combo);
m_dms.RemoveAll();
- for(int i = 0, j = 0, ModeExist = true; ; i++) {
+ for (int i = 0, j = 0, ModeExist = true; ; i++) {
ModeExist = GetDispMode(i, dm, m_f_hmonitor);
if (!ModeExist) {
break;
}
- if(dm.bpp != 32) continue; // skip non 32bpp mode
+ if (dm.bpp != 32) {
+ continue; // skip non 32bpp mode
+ }
//skip doubles (check previous only)
if (j>0 && (dm.bpp == m_dms[j-1].bpp && dm.dmDisplayFlags == m_dms[j-1].dmDisplayFlags
&& dm.freq == m_dms[j-1].freq && dm.fValid == m_dms[j-1].fValid
@@ -308,27 +310,27 @@ void CPPageFullscreen::ModesUpdate() m_dispmode23d976combo.AddString(str);
m_dispmode29d97combo.AddString(str);
- if(iSel_24 < 0 && dmtoset24.fValid && dm.size == dmtoset24.size
+ if (iSel_24 < 0 && dmtoset24.fValid && dm.size == dmtoset24.size
&& dm.bpp == dmtoset24.bpp && dm.freq == dmtoset24.freq) {
iSel_24 = j;
}
- if(iSel_25 < 0 && dmtoset25.fValid && dm.size == dmtoset25.size
+ if (iSel_25 < 0 && dmtoset25.fValid && dm.size == dmtoset25.size
&& dm.bpp == dmtoset25.bpp && dm.freq == dmtoset25.freq) {
iSel_25 = j;
}
- if(iSel_30 < 0 && dmtoset30.fValid && dm.size == dmtoset30.size
+ if (iSel_30 < 0 && dmtoset30.fValid && dm.size == dmtoset30.size
&& dm.bpp == dmtoset30.bpp && dm.freq == dmtoset30.freq) {
iSel_30 = j;
}
- if(iSel_Other < 0 && dmtosetOther.fValid && dm.size == dmtosetOther.size
+ if (iSel_Other < 0 && dmtosetOther.fValid && dm.size == dmtosetOther.size
&& dm.bpp == dmtosetOther.bpp && dm.freq == dmtosetOther.freq) {
iSel_Other = j;
}
- if(iSel_23 < 0 && dmtoset23.fValid && dm.size == dmtoset23.size
+ if (iSel_23 < 0 && dmtoset23.fValid && dm.size == dmtoset23.size
&& dm.bpp == dmtoset23.bpp && dm.freq == dmtoset23.freq) {
iSel_23 = j;
}
- if(iSel_29 < 0 && dmtoset29.fValid && dm.size == dmtoset29.size
+ if (iSel_29 < 0 && dmtoset29.fValid && dm.size == dmtoset29.size
&& dm.bpp == dmtoset29.bpp && dm.freq == dmtoset29.freq) {
iSel_29 = j;
}
diff --git a/src/apps/mplayerc/PPageInternalFilters.cpp b/src/apps/mplayerc/PPageInternalFilters.cpp index 999c76ea4..b2586f25a 100644 --- a/src/apps/mplayerc/PPageInternalFilters.cpp +++ b/src/apps/mplayerc/PPageInternalFilters.cpp @@ -202,7 +202,7 @@ INT_PTR CPPageInternalFiltersListBox::OnToolHitTest(CPoint point, TOOLINFO* pTI) {
BOOL b = FALSE;
int row = ItemFromPoint(point, b);
- if(row < 0) {
+ if (row < 0) {
return -1;
}
@@ -227,7 +227,7 @@ BOOL CPPageInternalFiltersListBox::OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESU TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR;
filter_t* f = (filter_t*)GetItemDataPtr(pNMHDR->idFrom);
- if(f->nHintID == 0) {
+ if (f->nHintID == 0) {
return FALSE;
}
@@ -237,7 +237,7 @@ BOOL CPPageInternalFiltersListBox::OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESU m_strTipTextW = CString(MAKEINTRESOURCE(f->nHintID));
- if(pNMHDR->code == TTN_NEEDTEXTW) { //?possible check is not needed
+ if (pNMHDR->code == TTN_NEEDTEXTW) { //?possible check is not needed
pTTTW->lpszText = (LPWSTR)(LPCWSTR)m_strTipTextW;
}
@@ -252,8 +252,8 @@ void CPPageInternalFiltersListBox::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) CFont* pOldFont = NULL;
- if((lpDrawItemStruct->itemData != 0) && ((filter_t*)lpDrawItemStruct->itemData)->CreateInstance) {
- if(!(HFONT)m_bold) {
+ if ((lpDrawItemStruct->itemData != 0) && ((filter_t*)lpDrawItemStruct->itemData)->CreateInstance) {
+ if (!(HFONT)m_bold) {
CFont* pFont = pDC->GetCurrentFont();
LOGFONT lf;
@@ -263,14 +263,14 @@ void CPPageInternalFiltersListBox::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) m_bold.CreateFontIndirect(&lf);
}
- if((HFONT)m_bold) {
+ if ((HFONT)m_bold) {
pOldFont = pDC->SelectObject(&m_bold);
}
}
__super::DrawItem(lpDrawItemStruct);
- if(pOldFont) {
+ if (pOldFont) {
pDC->SelectObject(pOldFont);
}
}
@@ -312,8 +312,8 @@ void CPPageInternalFiltersListBox::OnRButtonDown(UINT nFlags, CPoint point) }
int Index = 0;
- for(int i = 0; i < countof(s_filters); i++) {
- switch(s_filters[i].type) {
+ for (int i = 0; i < countof(s_filters); i++) {
+ switch (s_filters[i].type) {
case 0: // source filter
if (m_n == 1) {
continue;
@@ -330,7 +330,7 @@ void CPPageInternalFiltersListBox::OnRButtonDown(UINT nFlags, CPoint point) continue;
}
- switch(id) {
+ switch (id) {
case ENABLEALL:
SetCheck(Index, TRUE);
break;
@@ -338,22 +338,22 @@ void CPPageInternalFiltersListBox::OnRButtonDown(UINT nFlags, CPoint point) SetCheck(Index, FALSE);
break;
case ENABLEFFDSHOW:
- if(s_filters[i].type == 3) {
+ if (s_filters[i].type == 3) {
SetCheck(Index, TRUE);
}
break;
case DISABLEFFDSHOW:
- if(s_filters[i].type == 3) {
+ if (s_filters[i].type == 3) {
SetCheck(Index, FALSE);
}
break;
case ENABLEDXVA:
- if(s_filters[i].type == 2) {
+ if (s_filters[i].type == 2) {
SetCheck(Index, TRUE);
}
break;
case DISABLEDXVA:
- if(s_filters[i].type == 2) {
+ if (s_filters[i].type == 2) {
SetCheck(Index, FALSE);
}
break;
@@ -397,11 +397,11 @@ BOOL CPPageInternalFilters::OnInitDialog() AppSettings& s = AfxGetAppSettings();
- for(int i = 0; i < countof(s_filters)-1; i++) {
+ for (int i = 0; i < countof(s_filters)-1; i++) {
CCheckListBox* l;
bool checked;
- switch(s_filters[i].type) {
+ switch (s_filters[i].type) {
case SOURCE_FILTER: // source filter
l = &m_listSrc;
checked = s.SrcFilters[s_filters[i].flag];
@@ -444,10 +444,10 @@ BOOL CPPageInternalFilters::OnApply() CPPageInternalFiltersListBox* list = &m_listSrc;
for (int l=0; l<2; l++) {
- for(int i = 0; i < list->GetCount(); i++) {
+ for (int i = 0; i < list->GetCount(); i++) {
filter_t* f = (filter_t*) list->GetItemDataPtr(i);
- switch(f->type) {
+ switch (f->type) {
case SOURCE_FILTER:
s.SrcFilters[f->flag] = list->GetCheck(i);
break;
@@ -471,25 +471,25 @@ BOOL CPPageInternalFilters::OnApply() void CPPageInternalFilters::ShowPPage(CPPageInternalFiltersListBox& l)
{
int i = l.GetCurSel();
- if(i < 0) {
+ if (i < 0) {
return;
}
filter_t* f = (filter_t*)l.GetItemDataPtr(i);
- if(!f || !f->CreateInstance) {
+ if (!f || !f->CreateInstance) {
return;
}
HRESULT hr;
CUnknown* pObj = f->CreateInstance(NULL, &hr);
- if(!pObj) {
+ if (!pObj) {
return;
}
CComPtr<IUnknown> pUnk = (IUnknown*)(INonDelegatingUnknown*)pObj;
- if(SUCCEEDED(hr)) {
- if(CComQIPtr<ISpecifyPropertyPages> pSPP = pUnk) {
+ if (SUCCEEDED(hr)) {
+ if (CComQIPtr<ISpecifyPropertyPages> pSPP = pUnk) {
CComPropertySheet ps(ResStr(IDS_PROPSHEET_PROPERTIES), this);
ps.AddPages(pSPP);
ps.DoModal();
diff --git a/src/apps/mplayerc/PPageLogo.cpp b/src/apps/mplayerc/PPageLogo.cpp index f4cd2fa14..9b47fdc68 100644 --- a/src/apps/mplayerc/PPageLogo.cpp +++ b/src/apps/mplayerc/PPageLogo.cpp @@ -78,14 +78,14 @@ BOOL CPPageLogo::OnInitDialog() UpdateData(FALSE);
m_logoidpos = m_logoids.GetHeadPosition();
- for(POSITION pos = m_logoids.GetHeadPosition(); pos; m_logoids.GetNext(pos)) {
- if(m_logoids.GetAt(pos) == s.nLogoId) {
+ for (POSITION pos = m_logoids.GetHeadPosition(); pos; m_logoids.GetNext(pos)) {
+ if (m_logoids.GetAt(pos) == s.nLogoId) {
m_logoidpos = pos;
break;
}
}
- if(!m_intext) {
+ if (!m_intext) {
OnBnClickedRadio1();
} else {
OnBnClickedRadio2();
@@ -146,14 +146,14 @@ void CPPageLogo::OnDeltaposSpin1(NMHDR *pNMHDR, LRESULT *pResult) {
LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
- if(pNMUpDown->iDelta < 0) {
+ if (pNMUpDown->iDelta < 0) {
m_logoids.GetNext(m_logoidpos);
- if(!m_logoidpos) {
+ if (!m_logoidpos) {
m_logoidpos = m_logoids.GetHeadPosition();
}
} else {
m_logoids.GetPrev(m_logoidpos);
- if(!m_logoidpos) {
+ if (!m_logoidpos) {
m_logoidpos = m_logoids.GetTailPosition();
}
}
@@ -172,7 +172,7 @@ void CPPageLogo::OnBnClickedButton2() _T("Images (*.bmp;*.gif;*.jpg;*.png)|*.bmp;*.gif;*.jpg;*.png|All files (*.*)|*.*||"),
this, 0);
- if(dlg.DoModal() == IDOK) {
+ if (dlg.DoModal() == IDOK) {
m_logofn = dlg.GetPathName();
UpdateData(FALSE);
OnBnClickedRadio2();
@@ -185,9 +185,9 @@ void CPPageLogo::GetDataFromRes() m_logobm.Destroy();
UINT id = m_logoids.GetAt(m_logoidpos);
- if(IDF_LOGO0 != id) {
+ if (IDF_LOGO0 != id) {
m_logobm.LoadFromResource(id);
- if(!m_author.LoadString(id)) {
+ if (!m_author.LoadString(id)) {
m_author = ResStr(IDS_LOGO_AUTHOR);
}
}
diff --git a/src/apps/mplayerc/PPageOutput.cpp b/src/apps/mplayerc/PPageOutput.cpp index 08fe12956..8c09615c8 100644 --- a/src/apps/mplayerc/PPageOutput.cpp +++ b/src/apps/mplayerc/PPageOutput.cpp @@ -91,7 +91,7 @@ END_MESSAGE_MAP() void CPPageOutput::DisableRadioButton(UINT nID, UINT nDefID)
{
- if(IsDlgButtonChecked(nID)) {
+ if (IsDlgButtonChecked(nID)) {
CheckDlgButton(nID, BST_UNCHECKED);
CheckDlgButton(nDefID, BST_CHECKED);
}
@@ -132,7 +132,7 @@ BOOL CPPageOutput::OnInitDialog() BeginEnumSysDev(CLSID_AudioRendererCategory, pMoniker) {
LPOLESTR olestr = NULL;
- if(FAILED(pMoniker->GetDisplayName(0, 0, &olestr))) {
+ if (FAILED(pMoniker->GetDisplayName(0, 0, &olestr))) {
continue;
}
@@ -142,16 +142,16 @@ BOOL CPPageOutput::OnInitDialog() m_AudioRendererDisplayNames.Add(CString(str));
CComPtr<IPropertyBag> pPB;
- if(SUCCEEDED(pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void**)&pPB))) {
+ if (SUCCEEDED(pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void**)&pPB))) {
CComVariant var;
pPB->Read(CComBSTR(_T("FriendlyName")), &var, NULL);
CString fstr(var.bstrVal);
var.Clear();
- if(SUCCEEDED(pPB->Read(CComBSTR(_T("FilterData")), &var, NULL))) {
+ if (SUCCEEDED(pPB->Read(CComBSTR(_T("FilterData")), &var, NULL))) {
BSTR* pbstr;
- if(SUCCEEDED(SafeArrayAccessData(var.parray, (void**)&pbstr))) {
+ if (SUCCEEDED(SafeArrayAccessData(var.parray, (void**)&pbstr))) {
fstr.Format(_T("%s (%08x)"), CString(fstr), *((DWORD*)pbstr + 1));
SafeArrayUnaccessData(var.parray);
}
@@ -162,7 +162,7 @@ BOOL CPPageOutput::OnInitDialog() }
m_iAudioRendererTypeCtrl.AddString(Cbstr);
- if(s.strAudioRendererDisplayName == str && m_iAudioRendererType == 0) {
+ if (s.strAudioRendererDisplayName == str && m_iAudioRendererType == 0) {
m_iAudioRendererType = m_iAudioRendererTypeCtrl.GetCount()-1;
}
i++;
@@ -172,21 +172,21 @@ BOOL CPPageOutput::OnInitDialog() Cbstr.Format(_T("%d: %s"), i++, AUDRNDT_NULL_COMP);
m_AudioRendererDisplayNames.Add(AUDRNDT_NULL_COMP);
m_iAudioRendererTypeCtrl.AddString(Cbstr);
- if(s.strAudioRendererDisplayName == AUDRNDT_NULL_COMP && m_iAudioRendererType == 0) {
+ if (s.strAudioRendererDisplayName == AUDRNDT_NULL_COMP && m_iAudioRendererType == 0) {
m_iAudioRendererType = m_iAudioRendererTypeCtrl.GetCount()-1;
}
Cbstr.Format(_T("%d: %s"), i++, AUDRNDT_NULL_UNCOMP);
m_AudioRendererDisplayNames.Add(AUDRNDT_NULL_UNCOMP);
m_iAudioRendererTypeCtrl.AddString(Cbstr);
- if(s.strAudioRendererDisplayName == AUDRNDT_NULL_UNCOMP && m_iAudioRendererType == 0) {
+ if (s.strAudioRendererDisplayName == AUDRNDT_NULL_UNCOMP && m_iAudioRendererType == 0) {
m_iAudioRendererType = m_iAudioRendererTypeCtrl.GetCount()-1;
}
Cbstr.Format(_T("%d: %s"), i++, AUDRNDT_MPC);
m_AudioRendererDisplayNames.Add(AUDRNDT_MPC);
m_iAudioRendererTypeCtrl.AddString(Cbstr);
- if(s.strAudioRendererDisplayName == AUDRNDT_MPC && m_iAudioRendererType == 0) {
+ if (s.strAudioRendererDisplayName == AUDRNDT_MPC && m_iAudioRendererType == 0) {
m_iAudioRendererType = m_iAudioRendererTypeCtrl.GetCount()-1;
}
@@ -203,7 +203,7 @@ BOOL CPPageOutput::OnInitDialog() D3DADAPTER_IDENTIFIER9 adapterIdentifier;
- for(UINT adp = 0, num_adp = pD3D->GetAdapterCount(); adp < num_adp; ++adp) {
+ for (UINT adp = 0, num_adp = pD3D->GetAdapterCount(); adp < num_adp; ++adp) {
if (pD3D->GetAdapterIdentifier(adp, 0, &adapterIdentifier) == S_OK) {
d3ddevice_str = adapterIdentifier.Description;
d3ddevice_str += _T(" - ");
@@ -212,14 +212,14 @@ BOOL CPPageOutput::OnInitDialog() if (::StringFromGUID2(adapterIdentifier.DeviceIdentifier, strGUID, 50) > 0) {
cstrGUID = strGUID;
}
- if((cstrGUID != _T(""))) {
+ if ((cstrGUID != _T(""))) {
boolean m_find = false;
- for(i = 0; (!m_find) && (i < m_D3D9GUIDNames.GetCount()); i++) {
- if(m_D3D9GUIDNames.GetAt(i) == cstrGUID) {
+ for (i = 0; (!m_find) && (i < m_D3D9GUIDNames.GetCount()); i++) {
+ if (m_D3D9GUIDNames.GetAt(i) == cstrGUID) {
m_find = true;
}
}
- if(!m_find) {
+ if (!m_find) {
m_iD3D9RenderDeviceCtrl.AddString(d3ddevice_str);
m_D3D9GUIDNames.Add(cstrGUID);
if (renderersSettings.D3D9RenderDevice == cstrGUID) {
@@ -236,29 +236,29 @@ BOOL CPPageOutput::OnInitDialog() UpdateData(FALSE);
- if(!IsCLSIDRegistered(CLSID_VideoMixingRenderer)) {
+ if (!IsCLSIDRegistered(CLSID_VideoMixingRenderer)) {
DisableRadioButton(IDC_DSVMR7WIN, IDC_DSSYSDEF);
DisableRadioButton(IDC_DSVMR7REN, IDC_DSSYSDEF);
}
- if(!IsCLSIDRegistered(CLSID_VideoMixingRenderer9)) {
+ if (!IsCLSIDRegistered(CLSID_VideoMixingRenderer9)) {
DisableRadioButton(IDC_DSVMR9WIN, IDC_DSSYSDEF);
DisableRadioButton(IDC_DSVMR9REN, IDC_DSSYSDEF);
DisableRadioButton(IDC_RMDX9, IDC_RMSYSDEF);
DisableRadioButton(IDC_QTDX9, IDC_QTSYSDEF);
}
- if(!IsCLSIDRegistered(CLSID_EnhancedVideoRenderer)) {
+ if (!IsCLSIDRegistered(CLSID_EnhancedVideoRenderer)) {
DisableRadioButton(IDC_EVR, IDC_DSSYSDEF);
DisableRadioButton(IDC_EVR_CUSTOM, IDC_DSSYSDEF);
DisableRadioButton(IDC_DSSYNC, IDC_DSSYSDEF); // EVR Sync
}
- if(!IsCLSIDRegistered(CLSID_DXR)) {
+ if (!IsCLSIDRegistered(CLSID_DXR)) {
DisableRadioButton(IDC_DSDXR, IDC_DSSYSDEF);
}
- if(!IsCLSIDRegistered(CLSID_madVR)) {
+ if (!IsCLSIDRegistered(CLSID_madVR)) {
DisableRadioButton(IDC_DSMADVR, IDC_DSSYSDEF);
}
@@ -273,18 +273,18 @@ BOOL CPPageOutput::OnInitDialog() GetDlgItem(IDC_D3D9DEVICE)->EnableWindow(TRUE);
GetDlgItem(IDC_D3D9DEVICE_COMBO)->EnableWindow(TRUE);
- if((m_iDSVideoRendererType == 6 || m_iDSVideoRendererType == 11) && (m_iD3D9RenderDeviceCtrl.GetCount() > 1)) {
+ if ((m_iDSVideoRendererType == 6 || m_iDSVideoRendererType == 11) && (m_iD3D9RenderDeviceCtrl.GetCount() > 1)) {
GetDlgItem(IDC_D3D9DEVICE)->EnableWindow(TRUE);
GetDlgItem(IDC_D3D9DEVICE_COMBO)->EnableWindow(FALSE);
CheckDlgButton(IDC_D3D9DEVICE, BST_UNCHECKED);
- if(m_iD3D9RenderDevice != -1) {
+ if (m_iD3D9RenderDevice != -1) {
CheckDlgButton(IDC_D3D9DEVICE, BST_CHECKED);
GetDlgItem(IDC_D3D9DEVICE_COMBO)->EnableWindow(TRUE);
}
} else {
GetDlgItem(IDC_D3D9DEVICE)->EnableWindow(FALSE);
GetDlgItem(IDC_D3D9DEVICE_COMBO)->EnableWindow(FALSE);
- if(m_iD3D9RenderDevice == -1) {
+ if (m_iD3D9RenderDevice == -1) {
CheckDlgButton(IDC_D3D9DEVICE, BST_UNCHECKED);
}
}
@@ -360,7 +360,7 @@ void CPPageOutput::OnDSRendererChange(UINT nIDbutton) GetDlgItem(IDC_DX_SURFACE)->EnableWindow(TRUE);
break;
case 6 : // VMR9 renderless
- if(m_iD3D9RenderDeviceCtrl.GetCount()>1) {
+ if (m_iD3D9RenderDeviceCtrl.GetCount()>1) {
GetDlgItem(IDC_D3D9DEVICE)->EnableWindow(TRUE);
GetDlgItem(IDC_D3D9DEVICE_COMBO)->EnableWindow(IsDlgButtonChecked(IDC_D3D9DEVICE));
}
@@ -370,7 +370,7 @@ void CPPageOutput::OnDSRendererChange(UINT nIDbutton) GetDlgItem(IDC_DSVMR9ALTERNATIVEVSYNC)->EnableWindow(TRUE);
GetDlgItem(IDC_RESETDEVICE)->EnableWindow(TRUE);
case 11 : // EVR custom presenter
- if(m_iD3D9RenderDeviceCtrl.GetCount()>1) {
+ if (m_iD3D9RenderDeviceCtrl.GetCount()>1) {
GetDlgItem(IDC_D3D9DEVICE)->EnableWindow(TRUE);
GetDlgItem(IDC_D3D9DEVICE_COMBO)->EnableWindow(IsDlgButtonChecked(IDC_D3D9DEVICE));
}
diff --git a/src/apps/mplayerc/PPagePlayback.cpp b/src/apps/mplayerc/PPagePlayback.cpp index cac28e157..bbf0c780c 100644 --- a/src/apps/mplayerc/PPagePlayback.cpp +++ b/src/apps/mplayerc/PPagePlayback.cpp @@ -149,7 +149,7 @@ BOOL CPPagePlayback::OnApply() LRESULT CPPagePlayback::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
- if(message == WM_HSCROLL || message == WM_VSCROLL) {
+ if (message == WM_HSCROLL || message == WM_VSCROLL) {
SetModified();
}
@@ -158,10 +158,10 @@ LRESULT CPPagePlayback::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam void CPPagePlayback::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
- if(*pScrollBar == m_volumectrl) {
+ if (*pScrollBar == m_volumectrl) {
UpdateData();
((CMainFrame*)GetParentFrame())->m_wndToolBar.Volume = m_nVolume; // nice shortcut...
- } else if(*pScrollBar == m_balancectrl) {
+ } else if (*pScrollBar == m_balancectrl) {
UpdateData();
((CMainFrame*)GetParentFrame())->SetBalance(m_nBalance); // see prev note...
}
@@ -204,24 +204,27 @@ BOOL CPPagePlayback::OnToolTipNotify(UINT id, NMHDR * pNMHDR, LRESULT * pResult) nID = ::GetDlgCtrlID((HWND)nID);
}
- if(nID == 0) return FALSE;
+ if (nID == 0) {
+ return FALSE;
+ }
static CStringW m_strTipTextW;
if (nID == IDC_SLIDER1) {
m_strTipTextW.Format(L"%d%%", m_nVolume);
- }
- else if (nID == IDC_SLIDER2) {
- if (m_nBalance == 0)
+ } else if (nID == IDC_SLIDER2) {
+ if (m_nBalance == 0) {
m_strTipTextW = L"L = R";
- else if (m_nBalance < 0)
+ } else if (m_nBalance < 0) {
m_strTipTextW.Format(L"L +%d%%", -m_nBalance);
- else //if (m_nBalance > 0)
+ } else { //if (m_nBalance > 0)
m_strTipTextW.Format(L"R +%d%%", m_nBalance);
+ }
+ } else {
+ return FALSE;
}
- else return FALSE;
- if(pNMHDR->code == TTN_NEEDTEXTW) { //?possible check is not needed
+ if (pNMHDR->code == TTN_NEEDTEXTW) { //?possible check is not needed
pTTTW->lpszText = (LPWSTR)(LPCWSTR)m_strTipTextW;
}
@@ -242,7 +245,7 @@ BOOL CPPagePlayback::OnSetActive() BOOL CPPagePlayback::OnKillActive()
{
AppSettings& s = AfxGetAppSettings();
- if(s.fRememberZoomLevel) {
+ if (s.fRememberZoomLevel) {
s.fRememberWindowSize = false;
}
diff --git a/src/apps/mplayerc/PPagePlayer.cpp b/src/apps/mplayerc/PPagePlayer.cpp index 021a75152..4d853ed81 100644 --- a/src/apps/mplayerc/PPagePlayer.cpp +++ b/src/apps/mplayerc/PPagePlayer.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -139,11 +139,11 @@ BOOL CPPagePlayer::OnApply() s.fRememberDVDPos = m_fRememberDVDPos ? true : false;
s.fRememberFilePos = m_fRememberFilePos ? true : false;
- if(!m_fKeepHistory) {
- for(int i = 0; i < s.MRU.GetSize(); i++) {
+ if (!m_fKeepHistory) {
+ for (int i = 0; i < s.MRU.GetSize(); i++) {
s.MRU.Remove(i);
}
- for(int i = 0; i < s.MRUDub.GetSize(); i++) {
+ for (int i = 0; i < s.MRUDub.GetSize(); i++) {
s.MRUDub.Remove(i);
}
s.MRU.WriteList();
@@ -164,7 +164,7 @@ void CPPagePlayer::OnBnClickedCheck8() {
UpdateData();
- if(m_fUseIni) {
+ if (m_fUseIni) {
((CMPlayerCApp*)AfxGetApp())->StoreSettingsToIni();
} else {
((CMPlayerCApp*)AfxGetApp())->StoreSettingsToRegistry();
@@ -199,7 +199,7 @@ BOOL CPPagePlayer::OnSetActive() BOOL CPPagePlayer::OnKillActive()
{
AppSettings& s = AfxGetAppSettings();
- if(s.fRememberWindowSize) {
+ if (s.fRememberWindowSize) {
s.fRememberZoomLevel = false;
}
diff --git a/src/apps/mplayerc/PPageSheet.cpp b/src/apps/mplayerc/PPageSheet.cpp index 38ed358a0..b7a463e47 100644 --- a/src/apps/mplayerc/PPageSheet.cpp +++ b/src/apps/mplayerc/PPageSheet.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -62,12 +62,12 @@ CPPageSheet::CPPageSheet(LPCTSTR pszCaption, IFilterGraph* pFG, CWnd* pParentWnd SetTreeViewMode(TRUE, TRUE, FALSE);
- if(!idPage) {
+ if (!idPage) {
idPage = AfxGetAppSettings().nLastUsedPage;
}
- if(idPage) {
- for(int i = 0; i < GetPageCount(); i++) {
- if(GetPage(i)->m_pPSP->pszTemplate == MAKEINTRESOURCE(idPage)) {
+ if (idPage) {
+ for (int i = 0; i < GetPageCount(); i++) {
+ if (GetPage(i)->m_pPSP->pszTemplate == MAKEINTRESOURCE(idPage)) {
SetActivePage(i);
break;
}
@@ -92,8 +92,8 @@ BOOL CPPageSheet::OnInitDialog() {
BOOL bResult = __super::OnInitDialog();
- if(CTreeCtrl* pTree = GetPageTreeControl()) {
- for(HTREEITEM node = pTree->GetRootItem(); node; node = pTree->GetNextSiblingItem(node)) {
+ if (CTreeCtrl* pTree = GetPageTreeControl()) {
+ for (HTREEITEM node = pTree->GetRootItem(); node; node = pTree->GetNextSiblingItem(node)) {
pTree->Expand(node, TVE_EXPAND);
}
}
diff --git a/src/apps/mplayerc/PPageSubMisc.cpp b/src/apps/mplayerc/PPageSubMisc.cpp index 605a80cbe..bebd47088 100644 --- a/src/apps/mplayerc/PPageSubMisc.cpp +++ b/src/apps/mplayerc/PPageSubMisc.cpp @@ -1,7 +1,7 @@ /*
* $Id$
*
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -65,7 +65,7 @@ BOOL CPPageSubMisc::OnInitDialog() m_ISDb = s.strISDb;
m_ISDbCombo.AddString(m_ISDb);
- if(m_ISDb.CompareNoCase(_T("www.opensubtitles.org/isdb"))) {
+ if (m_ISDb.CompareNoCase(_T("www.opensubtitles.org/isdb"))) {
m_ISDbCombo.AddString(_T("www.opensubtitles.org/isdb"));
}
@@ -117,9 +117,9 @@ void CPPageSubMisc::OnBnClickedButton2() ver.Format(_T("ISDb v%d"), ISDb_PROTOCOL_VERSION);
CWebTextFile wtf;
- if(wtf.Open(_T("http://") + ISDb + _T("/test.php")) && wtf.ReadString(str) && str == ver) {
+ if (wtf.Open(_T("http://") + ISDb + _T("/test.php")) && wtf.ReadString(str) && str == ver) {
msg = ResStr(IDS_PPSDB_URLCORRECT);
- } else if(str.Find(_T("ISDb v")) == 0) {
+ } else if (str.Find(_T("ISDb v")) == 0) {
msg = ResStr(IDS_PPSDB_PROTOCOLERR);
} else {
msg = ResStr(IDS_PPSDB_BADURL);
diff --git a/src/apps/mplayerc/PPageSubStyle.cpp b/src/apps/mplayerc/PPageSubStyle.cpp index 52ba434de..205650ef3 100644 --- a/src/apps/mplayerc/PPageSubStyle.cpp +++ b/src/apps/mplayerc/PPageSubStyle.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -74,7 +74,7 @@ void CPPageSubStyle::AskColor(int i) {
CColorDialog dlg(m_stss.colors[i]);
dlg.m_cc.Flags |= CC_FULLOPEN;
- if(dlg.DoModal() == IDOK) {
+ if (dlg.DoModal() == IDOK) {
m_stss.colors[i] = dlg.m_cc.rgbResult;
m_color[i].Invalidate();
}
@@ -146,12 +146,12 @@ BOOL CPPageSubStyle::OnInitDialog() m_font.SetWindowText(m_stss.fontName);
m_iCharset = -1;
- for(int i = 0; i < CharSetLen; i++) {
+ for (int i = 0; i < CharSetLen; i++) {
CString str;
str.Format(_T("%s (%d)"), CharSetNames[i], CharSetList[i]);
m_charset.AddString(str);
m_charset.SetItemData(i, CharSetList[i]);
- if(m_stss.charSet == CharSetList[i]) {
+ if (m_stss.charSet == CharSetList[i]) {
m_iCharset = i;
}
}
@@ -159,7 +159,7 @@ BOOL CPPageSubStyle::OnInitDialog() // TODO: allow floats in these edit boxes
m_spacing = (int)m_stss.fontSpacing;
m_spacingspin.SetRange32(-10000, 10000);
- while(m_stss.fontAngleZ < 0) {
+ while (m_stss.fontAngleZ < 0) {
m_stss.fontAngleZ += 360;
}
m_angle = (int)fmod(m_stss.fontAngleZ, 360);
@@ -183,7 +183,7 @@ BOOL CPPageSubStyle::OnInitDialog() m_marginbottomspin.SetRange32(-10000, 10000);
m_relativeTo = m_stss.relativeTo;
- for(int i = 0; i < 4; i++) {
+ for (int i = 0; i < 4; i++) {
m_color[i].SetColorPtr(&m_stss.colors[i]);
m_alpha[i] = 255-m_stss.alpha[i];
m_alphasliders[i].SetRange(0, 255);
@@ -203,7 +203,7 @@ BOOL CPPageSubStyle::OnApply() {
UpdateData();
- if(m_iCharset >= 0) {
+ if (m_iCharset >= 0) {
m_stss.charSet = m_charset.GetItemData(m_iCharset);
}
m_stss.fontSpacing = m_spacing;
@@ -219,15 +219,15 @@ BOOL CPPageSubStyle::OnApply() m_stss.marginRect = m_margin;
m_stss.relativeTo = m_relativeTo;
- for(int i = 0; i < 4; i++) {
+ for (int i = 0; i < 4; i++) {
m_stss.alpha[i] = 255-m_alpha[i];
}
- if(m_fUseDefaultStyle) {
+ if (m_fUseDefaultStyle) {
STSStyle& stss = AfxGetAppSettings().subdefstyle;
- if(!(stss == m_stss)) {
+ if (!(stss == m_stss)) {
stss = m_stss;
- if(CMainFrame* pFrame = dynamic_cast<CMainFrame*>(AfxGetMainWnd())) {
+ if (CMainFrame* pFrame = dynamic_cast<CMainFrame*>(AfxGetMainWnd())) {
pFrame->UpdateSubtitle(false, true);
}
}
@@ -242,15 +242,15 @@ void CPPageSubStyle::OnBnClickedButton1() lf <<= m_stss;
CFontDialog dlg(&lf, CF_SCREENFONTS|CF_INITTOLOGFONTSTRUCT|CF_FORCEFONTEXIST|CF_SCALABLEONLY|CF_EFFECTS);
- if(dlg.DoModal() == IDOK) {
+ if (dlg.DoModal() == IDOK) {
CString str(lf.lfFaceName);
- if(str.GetLength() > 16) {
+ if (str.GetLength() > 16) {
str = str.Left(14) + _T("...");
}
m_font.SetWindowText(str);
- for(int i = 0, j = m_charset.GetCount(); i < j; i++) {
- if(m_charset.GetItemData(i) == lf.lfCharSet) {
+ for (int i = 0, j = m_charset.GetCount(); i < j; i++) {
+ if (m_charset.GetItemData(i) == lf.lfCharSet) {
m_charset.SetCurSel(i);
break;
}
@@ -287,11 +287,11 @@ void CPPageSubStyle::OnBnClickedCheck1() UpdateData();
int avg = 0;
- for(int i = 0; i < 4; i++) {
+ for (int i = 0; i < 4; i++) {
avg += m_alphasliders[i].GetPos();
}
avg /= 4;
- for(int i = 0; i < 4; i++) {
+ for (int i = 0; i < 4; i++) {
m_alphasliders[i].SetPos(avg);
}
@@ -300,9 +300,9 @@ void CPPageSubStyle::OnBnClickedCheck1() void CPPageSubStyle::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
- if(m_linkalphasliders && pScrollBar) {
+ if (m_linkalphasliders && pScrollBar) {
int pos = ((CSliderCtrl*)pScrollBar)->GetPos();
- for(int i = 0; i < 4; i++) {
+ for (int i = 0; i < 4; i++) {
m_alphasliders[i].SetPos(pos);
}
}
diff --git a/src/apps/mplayerc/PPageSubtitles.cpp b/src/apps/mplayerc/PPageSubtitles.cpp index 7b35285ac..dfd7ba08a 100644 --- a/src/apps/mplayerc/PPageSubtitles.cpp +++ b/src/apps/mplayerc/PPageSubtitles.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -164,7 +164,7 @@ BOOL CPPageSubtitles::OnApply() AppSettings& s = AfxGetAppSettings();
- if(s.fOverridePlacement != !!m_fOverridePlacement
+ if (s.fOverridePlacement != !!m_fOverridePlacement
|| s.nHorPos != m_nHorPos
|| s.nVerPos != m_nVerPos
|| s.m_RenderersSettings.nSPCSize != m_nSPCSize
@@ -181,7 +181,7 @@ BOOL CPPageSubtitles::OnApply() s.m_RenderersSettings.fSPCPow2Tex = !!m_fSPCPow2Tex;
s.m_RenderersSettings.fSPCAllowAnimationWhenBuffering = !!m_fSPCAllowAnimationWhenBuffering;
- if(CMainFrame* pFrame = (CMainFrame*)GetParentFrame()) {
+ if (CMainFrame* pFrame = (CMainFrame*)GetParentFrame()) {
pFrame->UpdateSubtitle(true);
}
}
diff --git a/src/apps/mplayerc/PPageTweaks.cpp b/src/apps/mplayerc/PPageTweaks.cpp index 4c82ba797..b81f441c1 100644 --- a/src/apps/mplayerc/PPageTweaks.cpp +++ b/src/apps/mplayerc/PPageTweaks.cpp @@ -77,7 +77,7 @@ void CPPageTweaks::DoDataExchange(CDataExchange* pDX) int CALLBACK EnumFontProc(ENUMLOGFONT FAR* lf, NEWTEXTMETRIC FAR* tm, int FontType, LPARAM dwData)
{
CAtlArray<CString>* fntl = (CAtlArray<CString>*)dwData;
- if(FontType == TRUETYPE_FONTTYPE) {
+ if (FontType == TRUETYPE_FONTTYPE) {
fntl->Add(lf->elfFullName);
}
return true;
@@ -168,7 +168,7 @@ BOOL CPPageTweaks::OnApply() s.fFastSeek = !!m_fFastSeek;
CMainFrame* pFrame = ((CMainFrame*)GetParentFrame());
- if(m_fUseWin7TaskBar) {
+ if (m_fUseWin7TaskBar) {
pFrame->CreateThumbnailToolbar();
}
pFrame->UpdateThumbarButton();
diff --git a/src/apps/mplayerc/PPageWebServer.cpp b/src/apps/mplayerc/PPageWebServer.cpp index 3586c5f6b..9543efd96 100644 --- a/src/apps/mplayerc/PPageWebServer.cpp +++ b/src/apps/mplayerc/PPageWebServer.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -67,14 +67,14 @@ void CPPageWebServer::DoDataExchange(CDataExchange* pDX) BOOL CPPageWebServer::PreTranslateMessage(MSG* pMsg)
{
- if(pMsg->message == WM_LBUTTONDOWN && pMsg->hwnd == m_launch.m_hWnd) {
+ if (pMsg->message == WM_LBUTTONDOWN && pMsg->hwnd == m_launch.m_hWnd) {
UpdateData();
AppSettings& s = AfxGetAppSettings();
- if(CMainFrame* pWnd = (CMainFrame*)AfxGetMainWnd()) {
- if(m_fEnableWebServer) {
- if(s.nWebServerPort != m_nWebServerPort) {
+ if (CMainFrame* pWnd = (CMainFrame*)AfxGetMainWnd()) {
+ if (m_fEnableWebServer) {
+ if (s.nWebServerPort != m_nWebServerPort) {
AfxMessageBox(_T("Press apply first, before testing the new settings!"), MB_OK);
return TRUE;
}
@@ -117,7 +117,7 @@ BOOL CPPageWebServer::OnApply() AppSettings& s = AfxGetAppSettings();
CString NewWebRoot = m_WebRoot;
- if(!m_fWebRoot) {
+ if (!m_fWebRoot) {
NewWebRoot = _T("*") + NewWebRoot;
}
@@ -133,9 +133,9 @@ BOOL CPPageWebServer::OnApply() s.strWebDefIndex = m_WebDefIndex;
s.strWebServerCGI = m_WebServerCGI;
- if(CMainFrame* pWnd = (CMainFrame*)AfxGetMainWnd()) {
- if(m_fEnableWebServer) {
- if(fRestart) {
+ if (CMainFrame* pWnd = (CMainFrame*)AfxGetMainWnd()) {
+ if (m_fEnableWebServer) {
+ if (fRestart) {
pWnd->StopWebServer();
}
pWnd->StartWebServer(m_nWebServerPort);
@@ -170,7 +170,7 @@ CString CPPageWebServer::GetCurWebRoot() static int __stdcall BrowseCtrlCallback(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
{
- if(uMsg == BFFM_INITIALIZED && lpData) {
+ if (uMsg == BFFM_INITIALIZED && lpData) {
::SendMessage(hwnd, BFFM_SETSELECTION, TRUE, lpData);
}
return 0;
@@ -191,7 +191,7 @@ bool CPPageWebServer::PickDir(CString& dir) bi.iImage = 0;
LPITEMIDLIST iil = SHBrowseForFolder(&bi);
- if(iil) {
+ if (iil) {
SHGetPathFromIDList(iil, buff);
dir = buff;
return true;
@@ -225,9 +225,9 @@ void CPPageWebServer::OnEnChangeEdit1() void CPPageWebServer::OnBnClickedButton1()
{
CString dir = GetCurWebRoot();
- if(PickDir(dir)) {
+ if (PickDir(dir)) {
CPath path;
- if(path.RelativePathTo(GetMPCDir(), FILE_ATTRIBUTE_DIRECTORY, dir, FILE_ATTRIBUTE_DIRECTORY)) {
+ if (path.RelativePathTo(GetMPCDir(), FILE_ATTRIBUTE_DIRECTORY, dir, FILE_ATTRIBUTE_DIRECTORY)) {
dir = (LPCTSTR)path;
}
m_WebRoot = dir;
@@ -238,7 +238,7 @@ void CPPageWebServer::OnBnClickedButton1() void CPPageWebServer::OnBnClickedButton2()
{
CString dir;
- if(PickDir(dir)) {
+ if (PickDir(dir)) {
dir += _T("\\");
CWebServer::Deploy(dir);
}
diff --git a/src/apps/mplayerc/PlayerCaptureBar.cpp b/src/apps/mplayerc/PlayerCaptureBar.cpp index 07b3301f7..9ecd6aa0a 100644 --- a/src/apps/mplayerc/PlayerCaptureBar.cpp +++ b/src/apps/mplayerc/PlayerCaptureBar.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -40,7 +40,7 @@ CPlayerCaptureBar::~CPlayerCaptureBar() BOOL CPlayerCaptureBar::Create(CWnd* pParentWnd)
{
- if(!baseCPlayerCaptureBar::Create(_T("Capture Settings"), pParentWnd, ID_VIEW_CAPTURE)) {
+ if (!baseCPlayerCaptureBar::Create(_T("Capture Settings"), pParentWnd, ID_VIEW_CAPTURE)) {
return FALSE;
}
@@ -60,8 +60,8 @@ BOOL CPlayerCaptureBar::Create(CWnd* pParentWnd) BOOL CPlayerCaptureBar::PreTranslateMessage(MSG* pMsg)
{
- if(IsWindow(pMsg->hwnd) && IsVisible() && pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST) {
- if(IsDialogMessage(pMsg)) {
+ if (IsWindow(pMsg->hwnd) && IsVisible() && pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST) {
+ if (IsDialogMessage(pMsg)) {
return TRUE;
}
}
diff --git a/src/apps/mplayerc/PlayerCaptureDialog.cpp b/src/apps/mplayerc/PlayerCaptureDialog.cpp index 713ed6374..5b1cd4bda 100644 --- a/src/apps/mplayerc/PlayerCaptureDialog.cpp +++ b/src/apps/mplayerc/PlayerCaptureDialog.cpp @@ -36,12 +36,12 @@ static bool LoadMediaType(CStringW DisplayName, AM_MEDIA_TYPE** ppmt) {
bool fRet = false;
- if(!ppmt) {
+ if (!ppmt) {
return(fRet);
}
*ppmt = (AM_MEDIA_TYPE*)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
- if(!*ppmt) {
+ if (!*ppmt) {
return(fRet);
}
@@ -49,7 +49,7 @@ static bool LoadMediaType(CStringW DisplayName, AM_MEDIA_TYPE** ppmt) BYTE* pData;
UINT len;
- if(AfxGetApp()->GetProfileBinary(IDS_RS_CAPTURE _T("\\") + CString(DisplayName), _T("MediaType"), &pData, &len)) {
+ if (AfxGetApp()->GetProfileBinary(IDS_RS_CAPTURE _T("\\") + CString(DisplayName), _T("MediaType"), &pData, &len)) {
if ( len != sizeof(AM_MEDIA_TYPE) ) {
delete [] pData;
return(fRet);
@@ -62,7 +62,7 @@ static bool LoadMediaType(CStringW DisplayName, AM_MEDIA_TYPE** ppmt) fRet = true;
- if(AfxGetApp()->GetProfileBinary(IDS_RS_CAPTURE _T("\\") + CString(DisplayName), _T("Format"), &pData, &len)) {
+ if (AfxGetApp()->GetProfileBinary(IDS_RS_CAPTURE _T("\\") + CString(DisplayName), _T("Format"), &pData, &len)) {
if ( !len ) {
delete [] pData;
return(fRet);
@@ -80,7 +80,7 @@ static bool LoadMediaType(CStringW DisplayName, AM_MEDIA_TYPE** ppmt) static void SaveMediaType(CStringW DisplayName, AM_MEDIA_TYPE* pmt)
{
- if(DisplayName.IsEmpty() || !pmt) {
+ if (DisplayName.IsEmpty() || !pmt) {
return;
}
@@ -91,26 +91,26 @@ static void SaveMediaType(CStringW DisplayName, AM_MEDIA_TYPE* pmt) static void LoadDefaultCodec(CAtlArray<Codec>& codecs, CComboBox& box, const GUID& cat)
{
int len = box.GetCount();
- if(len >= 0) {
+ if (len >= 0) {
box.SetCurSel(0);
}
- if(cat == GUID_NULL) {
+ if (cat == GUID_NULL) {
return;
}
CString DisplayName = AfxGetApp()->GetProfileString(IDS_RS_CAPTURE _T("\\") + CStringFromGUID(cat), _T("DisplayName"));
- for(int i = 0; i < len; i++) {
+ for (int i = 0; i < len; i++) {
int iSel = box.GetItemData(i);
- if(iSel < 0) {
+ if (iSel < 0) {
continue;
}
Codec& c = codecs[iSel];
- if(DisplayName == c.DisplayName) {
+ if (DisplayName == c.DisplayName) {
box.SetCurSel(i);
- if(!c.pBF) {
+ if (!c.pBF) {
c.pMoniker->BindToObject(NULL, NULL, __uuidof(IBaseFilter), (void**)&c.pBF);
}
break;
@@ -120,7 +120,7 @@ static void LoadDefaultCodec(CAtlArray<Codec>& codecs, CComboBox& box, const GUI static void SaveDefaultCodec(CAtlArray<Codec>& codecs, CComboBox& box, const GUID& cat)
{
- if(cat == GUID_NULL) {
+ if (cat == GUID_NULL) {
return;
}
@@ -129,11 +129,11 @@ static void SaveDefaultCodec(CAtlArray<Codec>& codecs, CComboBox& box, const GUI AfxGetApp()->WriteProfileString(IDS_RS_CAPTURE _T("\\") + guid, NULL, NULL);
int iSel = box.GetCurSel();
- if(iSel < 0) {
+ if (iSel < 0) {
return;
}
iSel = box.GetItemData(iSel);
- if(iSel < 0) {
+ if (iSel < 0) {
return;
}
@@ -146,7 +146,7 @@ static void SetupDefaultCaps(AM_MEDIA_TYPE* pmt, VIDEO_STREAM_CONFIG_CAPS& caps) {
memset(&caps, 0, sizeof(caps));
- if(!pmt) {
+ if (!pmt) {
return;
}
@@ -181,7 +181,7 @@ static void SetupDefaultCaps(AM_MEDIA_TYPE* pmt, AUDIO_STREAM_CONFIG_CAPS& caps) {
memset(&caps, 0, sizeof(caps));
- if(!pmt) {
+ if (!pmt) {
return;
}
@@ -205,7 +205,7 @@ static void SetupMediaTypes(IAMStreamConfig* pAMSC, CFormatArray<T>& tfa, CCombo type.EnableWindow(FALSE);
dim.EnableWindow(FALSE);
- if(!pAMSC) {
+ if (!pAMSC) {
return;
}
@@ -213,25 +213,25 @@ static void SetupMediaTypes(IAMStreamConfig* pAMSC, CFormatArray<T>& tfa, CCombo pAMSC->GetFormat(&pcurmt);
int iCount = 0, iSize;
- if(SUCCEEDED(pAMSC->GetNumberOfCapabilities(&iCount, &iSize))
+ if (SUCCEEDED(pAMSC->GetNumberOfCapabilities(&iCount, &iSize))
&& iSize == sizeof(T) && iCount > 0) {
- for(int i = 0; i < iCount; i++) {
+ for (int i = 0; i < iCount; i++) {
T caps;
AM_MEDIA_TYPE* pmt = NULL;
- if(SUCCEEDED(pAMSC->GetStreamCaps(i, &pmt, (BYTE*)&caps))) {
+ if (SUCCEEDED(pAMSC->GetStreamCaps(i, &pmt, (BYTE*)&caps))) {
tfa.AddFormat(pmt, caps);
}
}
- if(iSize == sizeof(VIDEO_STREAM_CONFIG_CAPS)) {
- for(int i = 0, cnt = tfa.GetCount(); i < cnt; i++) {
- if(tfa[i]->GetCount() != 1) {
+ if (iSize == sizeof(VIDEO_STREAM_CONFIG_CAPS)) {
+ for (int i = 0, cnt = tfa.GetCount(); i < cnt; i++) {
+ if (tfa[i]->GetCount() != 1) {
continue;
}
CFormatElem<T>* pfe = tfa[i]->GetAt(0);
- if(pfe->mt.formattype != FORMAT_VideoInfo
+ if (pfe->mt.formattype != FORMAT_VideoInfo
&& pfe->mt.formattype != FORMAT_VideoInfo2) {
continue;
}
@@ -255,8 +255,8 @@ static void SetupMediaTypes(IAMStreamConfig* pAMSC, CFormatArray<T>& tfa, CCombo BITMAPINFOHEADER bihCur;
ExtractBIH(&pfe->mt, &bihCur);
- for(int j = 0; j < countof(presets); j++) {
- if(presets[j].cx == bihCur.biWidth
+ for (int j = 0; j < countof(presets); j++) {
+ if (presets[j].cx == bihCur.biWidth
&& presets[j].cy == abs(bihCur.biHeight)
|| presets[j].cx < pcaps->MinOutputSize.cx
|| presets[j].cx > pcaps->MaxOutputSize.cx
@@ -269,9 +269,9 @@ static void SetupMediaTypes(IAMStreamConfig* pAMSC, CFormatArray<T>& tfa, CCombo CMediaType mt = pfe->mt;
- if(mt.formattype == FORMAT_VideoInfo) {
+ if (mt.formattype == FORMAT_VideoInfo) {
VIDEOINFOHEADER* vih = (VIDEOINFOHEADER*)mt.pbFormat;
- if(!vih->bmiHeader.biHeight) {
+ if (!vih->bmiHeader.biHeight) {
vih->bmiHeader.biHeight = 1;
}
vih->bmiHeader.biWidth = presets[j].cx;
@@ -282,7 +282,7 @@ static void SetupMediaTypes(IAMStreamConfig* pAMSC, CFormatArray<T>& tfa, CCombo CopyMediaType(pmt, &mt);
tfa.AddFormat(pmt, pcaps, sizeof(*pcaps));
- if(presets[j].cx*3 != presets[j].cy*4) {
+ if (presets[j].cx*3 != presets[j].cy*4) {
int extra = mt.cbFormat - sizeof(VIDEOINFOHEADER);
int bmiHeaderSize = sizeof(vih->bmiHeader) + extra;
BYTE* pbmiHeader = DNew BYTE[bmiHeaderSize];
@@ -300,9 +300,9 @@ static void SetupMediaTypes(IAMStreamConfig* pAMSC, CFormatArray<T>& tfa, CCombo CopyMediaType(pmt, &mt);
tfa.AddFormat(pmt, pcaps, sizeof(*pcaps));
}
- } else if(mt.formattype == FORMAT_VideoInfo2) {
+ } else if (mt.formattype == FORMAT_VideoInfo2) {
VIDEOINFOHEADER2* vih2 = (VIDEOINFOHEADER2*)mt.pbFormat;
- if(!vih2->bmiHeader.biHeight) {
+ if (!vih2->bmiHeader.biHeight) {
vih2->bmiHeader.biHeight = 1;
}
vih2->bmiHeader.biWidth = presets[j].cx;
@@ -320,8 +320,8 @@ static void SetupMediaTypes(IAMStreamConfig* pAMSC, CFormatArray<T>& tfa, CCombo }
}
- if(tfa.GetCount() == 0) {
- if(pcurmt && (pcurmt->majortype == MEDIATYPE_Video || pcurmt->majortype == MEDIATYPE_Audio)) {
+ if (tfa.GetCount() == 0) {
+ if (pcurmt && (pcurmt->majortype == MEDIATYPE_Video || pcurmt->majortype == MEDIATYPE_Audio)) {
AM_MEDIA_TYPE* pmt = (AM_MEDIA_TYPE*)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
CopyMediaType(pmt, pcurmt);
T caps;
@@ -329,14 +329,14 @@ static void SetupMediaTypes(IAMStreamConfig* pAMSC, CFormatArray<T>& tfa, CCombo tfa.AddFormat(pmt, caps);
} else {
mt.majortype = GUID_NULL;
- if(pcurmt) {
+ if (pcurmt) {
DeleteMediaType(pcurmt);
}
return;
}
}
- for(int i = 0; i < (int)tfa.GetCount(); i++) {
+ for (int i = 0; i < (int)tfa.GetCount(); i++) {
CFormat<T>* pf = tfa[i];
int j = type.AddString(pf->name);
type.SetItemData(j, (DWORD_PTR)pf);
@@ -345,42 +345,42 @@ static void SetupMediaTypes(IAMStreamConfig* pAMSC, CFormatArray<T>& tfa, CCombo CFormat<T>* pf = NULL;
CFormatElem<T>* pfe = NULL;
- if(!pcurmt) {
+ if (!pcurmt) {
pf = tfa[0];
pfe = pf->GetAt(0);
- } else if(!tfa.FindFormat(pcurmt, NULL, &pf, &pfe) && !tfa.FindFormat(pcurmt, &pf)) {
- if(pcurmt) {
+ } else if (!tfa.FindFormat(pcurmt, NULL, &pf, &pfe) && !tfa.FindFormat(pcurmt, &pf)) {
+ if (pcurmt) {
DeleteMediaType(pcurmt);
}
return;
}
- for(int i = 0; i < (int)pf->GetCount(); i++) {
+ for (int i = 0; i < (int)pf->GetCount(); i++) {
CFormatElem<T>* pfe = pf->GetAt(i);
int j = dim.AddString(tfa.MakeDimensionName(pfe));
dim.SetItemData(j, (DWORD_PTR)pfe);
}
int iType = type.SetCurSel(type.FindStringExact(0, pf->name));
- if(iType < 0 && type.GetCount()) {
+ if (iType < 0 && type.GetCount()) {
type.SetCurSel(0);
}
int iDim = dim.SetCurSel(dim.FindStringExact(0, tfa.MakeDimensionName(pfe)));
- // if(iDim < 0 && dim.GetCount()) dim.SetCurSel(iDim = 0);
+ // if (iDim < 0 && dim.GetCount()) dim.SetCurSel(iDim = 0);
CorrectComboListWidth(type, type.GetParent()->GetFont());
CorrectComboListWidth(dim, dim.GetParent()->GetFont());
- if(iDim >= 0) {
+ if (iDim >= 0) {
mt = ((CFormatElem<T>*)dim.GetItemData(iDim))->mt;
- } else if(pcurmt) {
+ } else if (pcurmt) {
mt = *pcurmt;
}
type.EnableWindow(type.GetCount() > 0);
dim.EnableWindow(dim.GetCount() > 0);
- if(pcurmt) {
+ if (pcurmt) {
DeleteMediaType(pcurmt);
}
}
@@ -395,13 +395,13 @@ static bool SetupDimension(CFormatArray<T>& tfa, CComboBox& type, CComboBox& dim dim.EnableWindow(FALSE);
int iSel = type.GetCurSel();
- if(iSel < 0) {
+ if (iSel < 0) {
return(false);
}
CFormat<T>* pf = (CFormat<T>*)type.GetItemData(iSel);
- for(int i = 0; i < (int)pf->GetCount(); i++) {
+ for (int i = 0; i < (int)pf->GetCount(); i++) {
CFormatElem<T>* pfe = pf->GetAt(i);
dim.SetItemData(dim.AddString(tfa.MakeDimensionName(pfe)), (DWORD_PTR)pfe);
}
@@ -428,13 +428,13 @@ static void InitCodecList(CAtlArray<Codec>& codecs, CComboBox& box, const GUID& c.pMoniker = pMoniker;
/*
CComPtr<IBaseFilter> pBF;
- if(FAILED(pMoniker->BindToObject(0, 0, IID_IBaseFilter, (void**)&pBF)) || !pBF)
+ if (FAILED(pMoniker->BindToObject(0, 0, IID_IBaseFilter, (void**)&pBF)) || !pBF)
continue;
c.pBF = pBF;
*/
LPOLESTR strName = NULL;
- if(FAILED(pMoniker->GetDisplayName(NULL, NULL, &strName))) {
+ if (FAILED(pMoniker->GetDisplayName(NULL, NULL, &strName))) {
continue;
}
@@ -445,18 +445,18 @@ static void InitCodecList(CAtlArray<Codec>& codecs, CComboBox& box, const GUID& pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void**)&pPB);
CComVariant var;
- if(FAILED(pPB->Read(CComBSTR(_T("FriendlyName")), &var, NULL))) {
+ if (FAILED(pPB->Read(CComBSTR(_T("FriendlyName")), &var, NULL))) {
continue;
}
c.FriendlyName = var.bstrVal;
CStringW str = CStringW(c.DisplayName).MakeLower();
- if(str.Find(L"@device:dmo:") == 0) {
+ if (str.Find(L"@device:dmo:") == 0) {
c.FriendlyName = _T("(DMO) ") + c.FriendlyName;
- } else if(str.Find(L"@device:sw:") == 0) {
+ } else if (str.Find(L"@device:sw:") == 0) {
c.FriendlyName = _T("(DS) ") + c.FriendlyName;
- } else if(str.Find(L"@device:cm:") == 0) {
+ } else if (str.Find(L"@device:cm:") == 0) {
c.FriendlyName = _T("(VfW) ") + c.FriendlyName;
}
@@ -476,25 +476,25 @@ static void InitCodecList(CAtlArray<Codec>& codecs, CComboBox& box, const GUID& static int ShowPPage(CAtlArray<Codec>& codecs, CComboBox& box, HWND hWnd = NULL)
{
int iSel = box.GetCurSel();
- if(iSel < 0) {
+ if (iSel < 0) {
return(-1);
}
iSel = box.GetItemData(iSel);
- if(iSel < 0) {
+ if (iSel < 0) {
return(-1);
}
Codec& c = codecs[iSel];
- if(!c.pBF) {
+ if (!c.pBF) {
c.pMoniker->BindToObject(NULL, NULL, __uuidof(IBaseFilter), (void**)&c.pBF);
}
- if(CComQIPtr<ISpecifyPropertyPages> pSPP = c.pBF) {
+ if (CComQIPtr<ISpecifyPropertyPages> pSPP = c.pBF) {
CAUUID caGUID;
caGUID.pElems = NULL;
- if(SUCCEEDED(pSPP->GetPages(&caGUID))) {
+ if (SUCCEEDED(pSPP->GetPages(&caGUID))) {
IUnknown* lpUnk = NULL;
pSPP.QueryInterface(&lpUnk);
OleCreatePropertyFrame(
@@ -504,12 +504,12 @@ static int ShowPPage(CAtlArray<Codec>& codecs, CComboBox& box, HWND hWnd = NULL) 0, 0, NULL);
lpUnk->Release();
- if(caGUID.pElems) {
+ if (caGUID.pElems) {
CoTaskMemFree(caGUID.pElems);
}
}
- } else if(CComQIPtr<IAMVfwCompressDialogs> pAMVfWCD = c.pBF) {
- if(pAMVfWCD->ShowDialog(VfwCompressDialog_QueryConfig, NULL) == S_OK) {
+ } else if (CComQIPtr<IAMVfwCompressDialogs> pAMVfWCD = c.pBF) {
+ if (pAMVfWCD->ShowDialog(VfwCompressDialog_QueryConfig, NULL) == S_OK) {
pAMVfWCD->ShowDialog(VfwCompressDialog_Config, hWnd);
}
}
@@ -545,7 +545,7 @@ CPlayerCaptureDialog::~CPlayerCaptureDialog() BOOL CPlayerCaptureDialog::Create(CWnd* pParent)
{
- if(!__super::Create(IDD, pParent)) {
+ if (!__super::Create(IDD, pParent)) {
return FALSE;
}
@@ -595,10 +595,10 @@ void CPlayerCaptureDialog::DoDataExchange(CDataExchange* pDX) BOOL CPlayerCaptureDialog::PreTranslateMessage(MSG* pMsg)
{
- if(pMsg->message == WM_KEYDOWN) {
- if(pMsg->wParam == VK_RETURN) {
+ if (pMsg->message == WM_KEYDOWN) {
+ if (pMsg->wParam == VK_RETURN) {
CWnd* pFocused = GetFocus();
- if(pFocused && pFocused->m_hWnd == m_vidfpsedit.m_hWnd) {
+ if (pFocused && pFocused->m_hWnd == m_vidfpsedit.m_hWnd) {
UpdateGraph();
}
}
@@ -612,7 +612,7 @@ void CPlayerCaptureDialog::EmptyVideo() {
// first save channel from previous session
- if(m_pAMTuner && !m_VidDisplayName.IsEmpty()) {
+ if (m_pAMTuner && !m_VidDisplayName.IsEmpty()) {
long lChannel = 0, lVivSub = 0, lAudSub = 0;
m_pAMTuner->get_Channel(&lChannel, &lVivSub, &lAudSub);
AfxGetApp()->WriteProfileInt(IDS_RS_CAPTURE _T("\\") + CString(m_VidDisplayName), _T("Channel"), lChannel);
@@ -626,7 +626,7 @@ void CPlayerCaptureDialog::EmptyVideo() m_pAMTuner = NULL;
m_pAMVSC = NULL;
- if(IsWindow(m_hWnd)) {
+ if (IsWindow(m_hWnd)) {
m_vidinput.ResetContent();
m_vidinput.EnableWindow(FALSE);
m_vidtype.ResetContent();
@@ -651,7 +651,7 @@ void CPlayerCaptureDialog::EmptyAudio() m_pAMASC = NULL;
m_pAMAIM.RemoveAll();
- if(IsWindow(m_hWnd)) {
+ if (IsWindow(m_hWnd)) {
m_audinput.ResetContent();
m_audinput.EnableWindow(FALSE);
m_audtype.ResetContent();
@@ -670,10 +670,10 @@ void CPlayerCaptureDialog::UpdateMediaTypes() CString fps;
m_vidfpsedit.GetWindowText(fps);
- if(!fps.IsEmpty()) {
+ if (!fps.IsEmpty()) {
float ffps;
_stscanf_s(fps, _T("%f"), &ffps);
- if(ffps > 0) {
+ if (ffps > 0) {
m_vidfps = ffps;
}
}
@@ -685,26 +685,26 @@ void CPlayerCaptureDialog::UpdateMediaTypes() VIDEO_STREAM_CONFIG_CAPS* pcaps = NULL;
int i = m_viddimension.GetCurSel();
- if(i >= 0) {
+ if (i >= 0) {
pmt = (AM_MEDIA_TYPE*)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
CopyMediaType(pmt, &((CVidFormatElem*)m_viddimension.GetItemData(i))->mt);
pcaps = &((CVidFormatElem*)m_viddimension.GetItemData(i))->caps;
- } else if(m_pAMVSC) {
+ } else if (m_pAMVSC) {
m_pAMVSC->GetFormat(&pmt);
}
- if(pmt) {
- if(m_vidfps > 0) {
+ if (pmt) {
+ if (m_vidfps > 0) {
REFERENCE_TIME atpf = (REFERENCE_TIME)(10000000.0 / m_vidfps);
- if(pcaps) {
+ if (pcaps) {
// FIXME: some drivers do not set the interval right and they still accept the preferable but unfortunately out-of-range fps
// atpf = min(max(atpf, pcaps->MinFrameInterval), pcaps->MaxFrameInterval);
}
- if(pmt->formattype == FORMAT_VideoInfo) {
+ if (pmt->formattype == FORMAT_VideoInfo) {
((VIDEOINFOHEADER*)pmt->pbFormat)->AvgTimePerFrame = atpf;
- } else if(pmt->formattype == FORMAT_VideoInfo2) {
+ } else if (pmt->formattype == FORMAT_VideoInfo2) {
((VIDEOINFOHEADER2*)pmt->pbFormat)->AvgTimePerFrame = atpf;
}
}
@@ -732,14 +732,14 @@ void CPlayerCaptureDialog::UpdateMediaTypes() AM_MEDIA_TYPE* pmt = NULL;
int i = m_auddimension.GetCurSel();
- if(i >= 0) {
+ if (i >= 0) {
pmt = (AM_MEDIA_TYPE*)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
CopyMediaType(pmt, &((CAudFormatElem*)m_auddimension.GetItemData(i))->mt);
- } else if(m_pAMASC) {
+ } else if (m_pAMASC) {
m_pAMASC->GetFormat(&pmt);
}
- if(pmt) {
+ if (pmt) {
SaveMediaType(m_AudDisplayName, pmt);
m_mta = *pmt;
@@ -751,22 +751,22 @@ void CPlayerCaptureDialog::UpdateMediaTypes() void CPlayerCaptureDialog::UpdateUserDefinableControls()
{
int iSel = m_viddimension.GetCurSel();
- if(iSel < 0) {
+ if (iSel < 0) {
return;
}
CVidFormatElem* pvfe = (CVidFormatElem*)m_viddimension.GetItemData(iSel);
- if(!pvfe) {
+ if (!pvfe) {
return;
}
- if(!m_pAMVSC) {
+ if (!m_pAMVSC) {
return;
}
AM_MEDIA_TYPE* pmt = NULL;
m_pAMVSC->GetFormat(&pmt);
- if(!pmt) {
+ if (!pmt) {
return;
}
@@ -776,7 +776,7 @@ void CPlayerCaptureDialog::UpdateUserDefinableControls() ? &((VIDEOINFOHEADER2*)pmt->pbFormat)->bmiHeader
: NULL;
- if(!bih) {
+ if (!bih) {
return;
}
@@ -787,7 +787,7 @@ void CPlayerCaptureDialog::UpdateUserDefinableControls() UNUSED_ALWAYS(h);
m_vidhor.SetRange((short)pvfe->caps.MinOutputSize.cx, (short)pvfe->caps.MaxOutputSize.cx);
- /* if(bih->biCompression == mmioFOURCC('Y','U','Y','2')) // FIXME: bt8x8 drivers seem to crop the right side in yuv2 mode if the width is not dividable by 64
+ /* if (bih->biCompression == mmioFOURCC('Y','U','Y','2')) // FIXME: bt8x8 drivers seem to crop the right side in yuv2 mode if the width is not dividable by 64
pvfe->caps.OutputGranularityX = 64;
*/
ua[0].nInc = pvfe->caps.OutputGranularityX;
@@ -814,7 +814,7 @@ void CPlayerCaptureDialog::UpdateUserDefinableControls() void CPlayerCaptureDialog::UpdateVideoCodec()
{
int iSel = m_vidcodec.GetCurSel();
- if(iSel >= 0) {
+ if (iSel >= 0) {
iSel = m_vidcodec.GetItemData(iSel);
}
@@ -834,7 +834,7 @@ void CPlayerCaptureDialog::UpdateVideoCodec() void CPlayerCaptureDialog::UpdateAudioCodec()
{
int iSel = m_audcodec.GetCurSel();
- if(iSel >= 0) {
+ if (iSel >= 0) {
iSel = m_audcodec.GetItemData(iSel);
}
@@ -860,19 +860,19 @@ void CPlayerCaptureDialog::UpdateMuxer() HRESULT hr;
- if(m_muxtype == 0) {
+ if (m_muxtype == 0) {
m_pMux.CoCreateInstance(CLSID_AviDest);
- } else if(m_muxtype == 1) {
+ } else if (m_muxtype == 1) {
m_pMux.CoCreateInstance(CLSID_OggMux);
- } else if(m_muxtype == 2) {
+ } else if (m_muxtype == 2) {
m_pMux = DNew CMatroskaMuxerFilter(NULL, &hr);
- } else if(m_muxtype == 3) {
+ } else if (m_muxtype == 3) {
m_pMux = DNew CDSMMuxerFilter(NULL, &hr);
} else {
return;
}
- if(m_fSepAudio) {
+ if (m_fSepAudio) {
m_pAudMux = DNew CWavDestFilter(NULL, &hr);
}
}
@@ -899,26 +899,26 @@ void CPlayerCaptureDialog::UpdateGraph() void CPlayerCaptureDialog::EnableControls(CWnd* pWnd, bool fEnable)
{
- if(fEnable) {
- for(CWnd* pChild = pWnd->GetWindow(GW_CHILD); pChild; pChild = pChild->GetNextWindow()) {
+ if (fEnable) {
+ for (CWnd* pChild = pWnd->GetWindow(GW_CHILD); pChild; pChild = pChild->GetNextWindow()) {
BOOL fEnabled;
- if(m_wndenabledmap.Lookup(pChild->m_hWnd, fEnabled)) {
+ if (m_wndenabledmap.Lookup(pChild->m_hWnd, fEnabled)) {
pChild->EnableWindow(fEnabled);
}
EnableControls(pChild, fEnable);
}
- if(pWnd->m_hWnd == m_hWnd) {
+ if (pWnd->m_hWnd == m_hWnd) {
m_wndenabledmap.RemoveAll();
}
m_recordbtn.SetWindowText(_T("Record"));
} else {
- if(pWnd->m_hWnd == m_hWnd) {
+ if (pWnd->m_hWnd == m_hWnd) {
m_wndenabledmap.RemoveAll();
}
- for(CWnd* pChild = pWnd->GetWindow(GW_CHILD); pChild; pChild = pChild->GetNextWindow()) {
+ for (CWnd* pChild = pWnd->GetWindow(GW_CHILD); pChild; pChild = pChild->GetNextWindow()) {
m_wndenabledmap[pChild->m_hWnd] = pChild->IsWindowEnabled();
pChild->EnableWindow(FALSE);
EnableControls(pChild, fEnable);
@@ -937,21 +937,21 @@ void CPlayerCaptureDialog::SetupVideoControls( // crossbar
- if(m_pAMXB = pAMXB) {
+ if (m_pAMXB = pAMXB) {
long OutputPinCount, InputPinCount;
- if(SUCCEEDED(pAMXB->get_PinCounts(&OutputPinCount, &InputPinCount))) {
- for(int i = 0; i < InputPinCount; i++) {
+ if (SUCCEEDED(pAMXB->get_PinCounts(&OutputPinCount, &InputPinCount))) {
+ for (int i = 0; i < InputPinCount; i++) {
long PinIndexRelated, PhysicalType;
- if(FAILED(pAMXB->get_CrossbarPinInfo(TRUE, i, &PinIndexRelated, &PhysicalType))) {
+ if (FAILED(pAMXB->get_CrossbarPinInfo(TRUE, i, &PinIndexRelated, &PhysicalType))) {
continue;
}
- if(PhysicalType >= PhysConn_Audio_Tuner) {
+ if (PhysicalType >= PhysConn_Audio_Tuner) {
continue;
}
CString str;
- switch(PhysicalType) {
+ switch (PhysicalType) {
case PhysConn_Video_Tuner:
str = _T("Tuner");
break;
@@ -1004,16 +1004,16 @@ void CPlayerCaptureDialog::SetupVideoControls( }
}
- if(m_vidinput.GetCount() > 0) {
+ if (m_vidinput.GetCount() > 0) {
m_vidinput.EnableWindow(TRUE);
long OutputPinCount, InputPinCount;
- if(SUCCEEDED(pAMXB->get_PinCounts(&OutputPinCount, &InputPinCount))) {
- for(int i = 0; i < OutputPinCount; i++) {
+ if (SUCCEEDED(pAMXB->get_PinCounts(&OutputPinCount, &InputPinCount))) {
+ for (int i = 0; i < OutputPinCount; i++) {
long InputPinIndex;
- if(S_OK == pAMXB->get_IsRoutedTo(i, &InputPinIndex)) {
- for(int j = 0; j < m_vidinput.GetCount(); j++) {
- if(m_vidinput.GetItemData(j) == (DWORD_PTR)InputPinIndex) {
+ if (S_OK == pAMXB->get_IsRoutedTo(i, &InputPinIndex)) {
+ for (int j = 0; j < m_vidinput.GetCount(); j++) {
+ if (m_vidinput.GetItemData(j) == (DWORD_PTR)InputPinIndex) {
m_vidinput.SetCurSel(j);
i = OutputPinCount;
break;
@@ -1027,17 +1027,17 @@ void CPlayerCaptureDialog::SetupVideoControls( // tuner
- if(m_pAMTuner = pAMTuner) {
+ if (m_pAMTuner = pAMTuner) {
// TODO:...
}
// streamconfig
- if(m_pAMVSC = pAMSC) {
+ if (m_pAMVSC = pAMSC) {
m_VidDisplayName = DisplayName;
AM_MEDIA_TYPE* pmt;
- if(LoadMediaType(DisplayName, &pmt)) {
+ if (LoadMediaType(DisplayName, &pmt)) {
pAMSC->SetFormat(pmt);
DeleteMediaType(pmt);
}
@@ -1045,7 +1045,7 @@ void CPlayerCaptureDialog::SetupVideoControls( SetupMediaTypes(pAMSC, m_vfa, m_vidtype, m_viddimension, m_mtv);
}
- if(m_vidtype.GetCount() > 0) {
+ if (m_vidtype.GetCount() > 0) {
m_vidfpsedit.EnableWindow(TRUE);
m_vidhor.EnableWindow(TRUE);
m_vidver.EnableWindow(TRUE);
@@ -1072,18 +1072,18 @@ void CPlayerCaptureDialog::SetupVideoControls( {
EmptyVideo();
- if(m_pAMVfwCD = pAMVfwCD) {
- if(S_OK == m_pAMVfwCD->HasDialog(VfwCaptureDialog_Source)) {
+ if (m_pAMVfwCD = pAMVfwCD) {
+ if (S_OK == m_pAMVfwCD->HasDialog(VfwCaptureDialog_Source)) {
m_vidinput.SetItemData(m_vidinput.AddString(_T("Source")), (DWORD_PTR)VfwCaptureDialog_Source);
}
- if(S_OK == m_pAMVfwCD->HasDialog(VfwCaptureDialog_Format)) {
+ if (S_OK == m_pAMVfwCD->HasDialog(VfwCaptureDialog_Format)) {
m_vidinput.SetItemData(m_vidinput.AddString(_T("Format")), (DWORD_PTR)VfwCaptureDialog_Format);
}
- if(S_OK == m_pAMVfwCD->HasDialog(VfwCaptureDialog_Display)) {
+ if (S_OK == m_pAMVfwCD->HasDialog(VfwCaptureDialog_Display)) {
m_vidinput.SetItemData(m_vidinput.AddString(_T("Display")), (DWORD_PTR)VfwCaptureDialog_Display);
}
- if(m_vidinput.GetCount() > 0) {
+ if (m_vidinput.GetCount() > 0) {
m_vidinput.EnableWindow(TRUE);
m_vidinput.SetCurSel(0);
}
@@ -1091,11 +1091,11 @@ void CPlayerCaptureDialog::SetupVideoControls( // streamconfig
- if(m_pAMVSC = pAMSC) {
+ if (m_pAMVSC = pAMSC) {
m_VidDisplayName = DisplayName;
AM_MEDIA_TYPE* pmt;
- if(LoadMediaType(DisplayName, &pmt)) {
+ if (LoadMediaType(DisplayName, &pmt)) {
pAMSC->SetFormat(pmt);
DeleteMediaType(pmt);
}
@@ -1103,7 +1103,7 @@ void CPlayerCaptureDialog::SetupVideoControls( SetupMediaTypes(pAMSC, m_vfa, m_vidtype, m_viddimension, m_mtv);
}
- if(m_vidtype.GetCount() > 0) {
+ if (m_vidtype.GetCount() > 0) {
m_vidfpsedit.EnableWindow(TRUE);
m_vidhor.EnableWindow(TRUE);
m_vidver.EnableWindow(TRUE);
@@ -1132,24 +1132,24 @@ void CPlayerCaptureDialog::SetupAudioControls( // input selection
- if(pAMAIM.GetCount() > 0) {
+ if (pAMAIM.GetCount() > 0) {
m_pAMAIM.Copy(pAMAIM);
int iSel = -1;
- for(int i = 0; i < (int)m_pAMAIM.GetCount(); i++) {
+ for (int i = 0; i < (int)m_pAMAIM.GetCount(); i++) {
CComQIPtr<IPin> pPin = m_pAMAIM[i];
m_audinput.SetItemData(m_audinput.AddString(CString(GetPinName(pPin))), (DWORD_PTR)i);
BOOL fEnable;
- if(SUCCEEDED(m_pAMAIM[i]->get_Enable(&fEnable)) && fEnable) {
+ if (SUCCEEDED(m_pAMAIM[i]->get_Enable(&fEnable)) && fEnable) {
iSel = i;
}
}
- if(m_audinput.GetCount() > 0) {
- for(int i = 0; i < m_audinput.GetCount(); i++) {
- if(m_audinput.GetItemData(i) == (DWORD_PTR)iSel) {
+ if (m_audinput.GetCount() > 0) {
+ for (int i = 0; i < m_audinput.GetCount(); i++) {
+ if (m_audinput.GetItemData(i) == (DWORD_PTR)iSel) {
m_audinput.SetCurSel(i);
break;
}
@@ -1161,11 +1161,11 @@ void CPlayerCaptureDialog::SetupAudioControls( // stream config
- if(m_pAMASC = pAMSC) {
+ if (m_pAMASC = pAMSC) {
m_AudDisplayName = DisplayName;
AM_MEDIA_TYPE* pmt;
- if(LoadMediaType(DisplayName, &pmt)) {
+ if (LoadMediaType(DisplayName, &pmt)) {
pAMSC->SetFormat(pmt);
DeleteMediaType(pmt);
}
@@ -1173,7 +1173,7 @@ void CPlayerCaptureDialog::SetupAudioControls( SetupMediaTypes(pAMSC, m_afa, m_audtype, m_auddimension, m_mta);
}
- // if(m_audtype.GetCount() > 0)
+ // if (m_audtype.GetCount() > 0)
{
m_audoutput.EnableWindow(TRUE);
m_audpreview.EnableWindow(TRUE);
@@ -1189,11 +1189,11 @@ void CPlayerCaptureDialog::SetupAudioControls( bool CPlayerCaptureDialog::IsTunerActive()
{
int iSel = m_vidinput.GetCurSel();
- if(iSel < 0) {
+ if (iSel < 0) {
return(false);
}
iSel = m_vidinput.GetItemData(iSel);
- if(iSel < 0) {
+ if (iSel < 0) {
return(false);
}
@@ -1205,12 +1205,12 @@ bool CPlayerCaptureDialog::IsTunerActive() bool CPlayerCaptureDialog::SetVideoInput(int input)
{
- if(!m_pAMXB || input < 0) {
+ if (!m_pAMXB || input < 0) {
return false;
}
- for(int i = 0; i < m_vidinput.GetCount(); i++) {
- if(m_vidinput.GetItemData(i) == (DWORD_PTR)input) {
+ for (int i = 0; i < m_vidinput.GetCount(); i++) {
+ if (m_vidinput.GetItemData(i) == (DWORD_PTR)input) {
m_vidinput.SetCurSel(i);
OnVideoInput();
return true;
@@ -1222,7 +1222,7 @@ bool CPlayerCaptureDialog::SetVideoInput(int input) bool CPlayerCaptureDialog::SetVideoChannel(int channel)
{
- if(!m_pAMTuner || channel < 0) {
+ if (!m_pAMTuner || channel < 0) {
return false;
}
@@ -1231,12 +1231,12 @@ bool CPlayerCaptureDialog::SetVideoChannel(int channel) bool CPlayerCaptureDialog::SetAudioInput(int input)
{
- if(input < 0) {
+ if (input < 0) {
return false;
}
- for(int i = 0; i < m_audinput.GetCount(); i++) {
- if(m_audinput.GetItemData(i) == (DWORD_PTR)input) {
+ for (int i = 0; i < m_audinput.GetCount(); i++) {
+ if (m_audinput.GetItemData(i) == (DWORD_PTR)input) {
m_audinput.SetCurSel(i);
OnAudioInput();
return true;
@@ -1249,7 +1249,7 @@ bool CPlayerCaptureDialog::SetAudioInput(int input) int CPlayerCaptureDialog::GetVideoInput()
{
int i = m_vidinput.GetCurSel();
- if(i < 0) {
+ if (i < 0) {
return -1;
}
return m_vidinput.GetItemData(i);
@@ -1264,7 +1264,7 @@ int CPlayerCaptureDialog::GetVideoChannel() int CPlayerCaptureDialog::GetAudioInput()
{
int i = m_audinput.GetCurSel();
- if(i < 0) {
+ if (i < 0) {
return -1;
}
return m_audinput.GetItemData(i);
@@ -1356,51 +1356,51 @@ void CPlayerCaptureDialog::OnDestroy() void CPlayerCaptureDialog::OnVideoInput()
{
int iSel = m_vidinput.GetCurSel();
- if(iSel < 0) {
+ if (iSel < 0) {
return;
}
iSel = m_vidinput.GetItemData(iSel);
- if(iSel < 0) {
+ if (iSel < 0) {
return;
}
- if(m_pAMXB) {
+ if (m_pAMXB) {
long PinIndexRelated, PhysicalType;
- if(FAILED(m_pAMXB->get_CrossbarPinInfo(TRUE, iSel, &PinIndexRelated, &PhysicalType))) {
+ if (FAILED(m_pAMXB->get_CrossbarPinInfo(TRUE, iSel, &PinIndexRelated, &PhysicalType))) {
return;
}
long OutputPinCount, InputPinCount;
- if(FAILED(m_pAMXB->get_PinCounts(&OutputPinCount, &InputPinCount))) {
+ if (FAILED(m_pAMXB->get_PinCounts(&OutputPinCount, &InputPinCount))) {
return;
}
- for(int i = 0; i < OutputPinCount; i++) {
- if(S_OK == m_pAMXB->CanRoute(i, iSel)) {
+ for (int i = 0; i < OutputPinCount; i++) {
+ if (S_OK == m_pAMXB->CanRoute(i, iSel)) {
m_pAMXB->Route(i, iSel);
break;
}
}
- if(PinIndexRelated >= 0) {
- for(int i = 0; i < OutputPinCount; i++) {
- if(S_OK == m_pAMXB->CanRoute(i, PinIndexRelated)) {
+ if (PinIndexRelated >= 0) {
+ for (int i = 0; i < OutputPinCount; i++) {
+ if (S_OK == m_pAMXB->CanRoute(i, PinIndexRelated)) {
m_pAMXB->Route(i, PinIndexRelated);
break;
}
}
}
- } else if(m_pAMVfwCD) {
- if(S_OK == m_pAMVfwCD->HasDialog(iSel)) {
+ } else if (m_pAMVfwCD) {
+ if (S_OK == m_pAMVfwCD->HasDialog(iSel)) {
HRESULT hr = m_pAMVfwCD->ShowDialog(iSel, m_hWnd);
- if(VFW_E_NOT_STOPPED == hr) {
+ if (VFW_E_NOT_STOPPED == hr) {
((CMainFrame*)AfxGetMainWnd())->SendMessage(WM_COMMAND, ID_PLAY_STOP);
hr = m_pAMVfwCD->ShowDialog(iSel, m_hWnd);
((CMainFrame*)AfxGetMainWnd())->SendMessage(WM_COMMAND, ID_PLAY_PLAY);
}
- if(VFW_E_CANNOT_CONNECT == hr) {
+ if (VFW_E_CANNOT_CONNECT == hr) {
UpdateGraph();
}
}
@@ -1409,7 +1409,7 @@ void CPlayerCaptureDialog::OnVideoInput() void CPlayerCaptureDialog::OnVideoType()
{
- if(SetupDimension(m_vfa, m_vidtype, m_viddimension)) {
+ if (SetupDimension(m_vfa, m_vidtype, m_viddimension)) {
OnVideoDimension();
}
}
@@ -1417,12 +1417,12 @@ void CPlayerCaptureDialog::OnVideoType() void CPlayerCaptureDialog::OnVideoDimension()
{
int iSel = m_viddimension.GetCurSel();
- if(iSel < 0) {
+ if (iSel < 0) {
return;
}
CVidFormatElem* pvfe = (CVidFormatElem*)m_viddimension.GetItemData(iSel);
- if(!pvfe) {
+ if (!pvfe) {
return;
}
@@ -1452,14 +1452,14 @@ void CPlayerCaptureDialog::OnAudioInput() {
int iSel = m_audinput.GetCurSel();
- for(int i = 0; i < (int)m_pAMAIM.GetCount(); i++) {
+ for (int i = 0; i < (int)m_pAMAIM.GetCount(); i++) {
m_pAMAIM[m_audinput.GetItemData(i)]->put_Enable(i == iSel ? TRUE : FALSE);
}
}
void CPlayerCaptureDialog::OnAudioType()
{
- if(SetupDimension(m_afa, m_audtype, m_auddimension)) {
+ if (SetupDimension(m_afa, m_audtype, m_auddimension)) {
OnAudioDimension();
}
}
@@ -1482,7 +1482,7 @@ void CPlayerCaptureDialog::OnVideoCodec() void CPlayerCaptureDialog::OnVideoCodecType()
{
- if(SetupDimension(m_vcfa, m_vidcodectype, m_vidcodecdimension)) {
+ if (SetupDimension(m_vcfa, m_vidcodectype, m_vidcodecdimension)) {
OnVideoCodecDimension();
}
}
@@ -1490,7 +1490,7 @@ void CPlayerCaptureDialog::OnVideoCodecType() void CPlayerCaptureDialog::OnVideoCodecDimension()
{
int i = m_vidcodecdimension.GetCurSel();
- if(i >= 0) {
+ if (i >= 0) {
m_mtcv = ((CVidFormatElem*)m_vidcodecdimension.GetItemData(i))->mt;
// we have to recreate the encoder, otherwise it will accept the new media type for only the first time
@@ -1512,7 +1512,7 @@ void CPlayerCaptureDialog::OnAudioCodec() void CPlayerCaptureDialog::OnAudioCodecType()
{
- if(SetupDimension(m_acfa, m_audcodectype, m_audcodecdimension)) {
+ if (SetupDimension(m_acfa, m_audcodectype, m_audcodecdimension)) {
OnAudioCodecDimension();
}
}
@@ -1520,7 +1520,7 @@ void CPlayerCaptureDialog::OnAudioCodecType() void CPlayerCaptureDialog::OnAudioCodecDimension()
{
int i = m_audcodecdimension.GetCurSel();
- if(i >= 0) {
+ if (i >= 0) {
m_mtca = ((CAudFormatElem*)m_audcodecdimension.GetItemData(i))->mt;
// we have to recreate the encoder, otherwise it will accept the new media type for only the first time
@@ -1540,26 +1540,26 @@ void CPlayerCaptureDialog::OnOpenFile() OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_NOCHANGEDIR,
_T("Media files (*.avi,*.ogm,*.mkv,*.dsm)|*.avi;*.ogm;*.mkv;*.dsm|"), this, 0);
- if(fd.DoModal() == IDOK) {
+ if (fd.DoModal() == IDOK) {
CString str = fd.GetPathName();
CString ext = str.Mid(str.ReverseFind('.')+1).MakeLower();
- if(ext == _T("avi")) {
+ if (ext == _T("avi")) {
m_muxtype = 0;
- } else if(ext == _T("ogm")) {
+ } else if (ext == _T("ogm")) {
m_muxtype = 1;
- } else if(ext == _T("mkv")) {
+ } else if (ext == _T("mkv")) {
m_muxtype = 2;
- } else if(ext == _T("dsm")) {
+ } else if (ext == _T("dsm")) {
m_muxtype = 3;
} else {
- if(m_muxtype == 0) {
+ if (m_muxtype == 0) {
str += _T(".avi");
- } else if(m_muxtype == 1) {
+ } else if (m_muxtype == 1) {
str += _T(".ogm");
- } else if(m_muxtype == 2) {
+ } else if (m_muxtype == 2) {
str += _T(".mkv");
- } else if(m_muxtype == 3) {
+ } else if (m_muxtype == 3) {
str += _T(".dsm");
}
}
@@ -1577,15 +1577,15 @@ void CPlayerCaptureDialog::OnRecord() UpdateData();
CMainFrame* pFrame = (CMainFrame*)AfxGetMainWnd();
- if(!pFrame) {
+ if (!pFrame) {
return;
}
- if(!pFrame->m_fCapturing) {
+ if (!pFrame->m_fCapturing) {
UpdateMuxer();
CComQIPtr<IFileSinkFilter2> pFSF = m_pMux;
- if(pFSF) {
+ if (pFSF) {
m_pDst = m_pMux;
} else {
m_pDst = NULL;
@@ -1593,7 +1593,7 @@ void CPlayerCaptureDialog::OnRecord() pFSF = m_pDst;
}
- if(!pFSF
+ if (!pFSF
|| FAILED(pFSF->SetFileName(CStringW(m_file), NULL))
|| FAILED(pFSF->SetMode(AM_FILE_OVERWRITE))) {
AfxMessageBox(_T("Error initializing the output file"));
@@ -1601,11 +1601,11 @@ void CPlayerCaptureDialog::OnRecord() }
CString audfn = m_file.Left(m_file.ReverseFind('.')+1);
- if(m_fSepAudio && m_fAudOutput && m_pAudMux && !audfn.IsEmpty()) {
+ if (m_fSepAudio && m_fAudOutput && m_pAudMux && !audfn.IsEmpty()) {
audfn += _T("wav");
CComQIPtr<IFileSinkFilter2> pFSF = m_pAudMux;
- if(pFSF) {
+ if (pFSF) {
m_pAudDst = m_pAudMux;
} else {
m_pAudDst = NULL;
@@ -1613,7 +1613,7 @@ void CPlayerCaptureDialog::OnRecord() pFSF = m_pAudDst;
}
- if(!pFSF
+ if (!pFSF
|| FAILED(pFSF->SetFileName(CStringW(audfn), NULL))
|| FAILED(pFSF->SetMode(AM_FILE_OVERWRITE))) {
AfxMessageBox(_T("Error initializing the audio output file"));
@@ -1622,13 +1622,13 @@ void CPlayerCaptureDialog::OnRecord() }
m_pVidBuffer = m_fVidOutput && m_nVidBuffers > 0 && m_muxtype != 2 && m_muxtype != 3 ? DNew CBufferFilter(NULL, NULL) : NULL;
- if(CComQIPtr<IBufferFilter> pVB = m_pVidBuffer) {
+ if (CComQIPtr<IBufferFilter> pVB = m_pVidBuffer) {
pVB->SetBuffers(m_nVidBuffers);
pVB->SetPriority(THREAD_PRIORITY_NORMAL);
}
m_pAudBuffer = m_fAudOutput && m_nAudBuffers > 0 && m_muxtype != 2 && m_muxtype != 3 ? DNew CBufferFilter(NULL, NULL) : NULL;
- if(CComQIPtr<IBufferFilter> pAB = m_pAudBuffer) {
+ if (CComQIPtr<IBufferFilter> pAB = m_pAudBuffer) {
pAB->SetBuffers(m_nAudBuffers);
pAB->SetPriority(THREAD_PRIORITY_ABOVE_NORMAL);
}
@@ -1644,7 +1644,7 @@ void CPlayerCaptureDialog::OnRecord() pFrame->StopCapture();
/*
{
- if(FILE* f = _tfopen(m_file, _T("rb+")))
+ if (FILE* f = _tfopen(m_file, _T("rb+")))
{
fseek(f, 0x20, SEEK_SET);
unsigned short mspf = (unsigned short)(((VIDEOINFOHEADER*)m_mtv.pbFormat)->AvgTimePerFrame / 10);
@@ -1674,10 +1674,10 @@ void CPlayerCaptureDialog::OnEnChangeEdit12() void CPlayerCaptureDialog::OnTimer(UINT_PTR nIDEvent)
{
- if(nIDEvent == 1) {
- if(((CMainFrame*)AfxGetMainWnd())->m_fCapturing) {
+ if (nIDEvent == 1) {
+ if (((CMainFrame*)AfxGetMainWnd())->m_fCapturing) {
ULARGE_INTEGER FreeBytesAvailable, TotalNumberOfBytes, TotalNumberOfFreeBytes;
- if(GetDiskFreeSpaceEx(m_file.Left(m_file.ReverseFind('\\')+1), &FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes)
+ if (GetDiskFreeSpaceEx(m_file.Left(m_file.ReverseFind('\\')+1), &FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes)
&& FreeBytesAvailable.QuadPart < 1024i64*1024*10) {
OnRecord();
}
@@ -1704,13 +1704,13 @@ void CPlayerCaptureDialog::OnCbnSelchangeCombo14() CString ext = m_file.Mid(m_file.ReverseFind('.')+1).MakeLower();
- if(m_muxtype == 0 && ext != _T("avi")) {
+ if (m_muxtype == 0 && ext != _T("avi")) {
m_file = m_file.Left(m_file.GetLength()-4) + _T(".avi");
- } else if(m_muxtype == 1 && ext != _T("ogm")) {
+ } else if (m_muxtype == 1 && ext != _T("ogm")) {
m_file = m_file.Left(m_file.GetLength()-4) + _T(".ogm");
- } else if(m_muxtype == 2 && ext != _T("mkv")) {
+ } else if (m_muxtype == 2 && ext != _T("mkv")) {
m_file = m_file.Left(m_file.GetLength()-4) + _T(".mkv");
- } else if(m_muxtype == 3 && ext != _T("dsm")) {
+ } else if (m_muxtype == 3 && ext != _T("dsm")) {
m_file = m_file.Left(m_file.GetLength()-4) + _T(".dsm");
}
diff --git a/src/apps/mplayerc/PlayerCaptureDialog.h b/src/apps/mplayerc/PlayerCaptureDialog.h index cab61cc2c..fd8932986 100644 --- a/src/apps/mplayerc/PlayerCaptureDialog.h +++ b/src/apps/mplayerc/PlayerCaptureDialog.h @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -57,13 +57,13 @@ public: virtual ~CFormatArray() {}
CFormat<T>* Find(CString name, bool fCreate = false) {
- for(size_t i = 0; i < GetCount(); ++i) {
- if(GetAt(i)->name == name) {
+ for (size_t i = 0; i < GetCount(); ++i) {
+ if (GetAt(i)->name == name) {
return(GetAt(i));
}
}
- if(fCreate) {
+ if (fCreate) {
CAutoPtr<CFormat<T> > pf(DNew CFormat<T>(name));
CFormat<T>* tmp = pf;
Add(pf);
@@ -74,16 +74,16 @@ public: }
bool FindFormat(AM_MEDIA_TYPE* pmt, CFormat<T>** ppf) {
- if(!pmt) {
+ if (!pmt) {
return(false);
}
- for(size_t i = 0; i < GetCount(); ++i) {
+ for (size_t i = 0; i < GetCount(); ++i) {
CFormat<T>* pf = GetAt(i);
- for(size_t j = 0; j < pf->GetCount(); ++j) {
+ for (size_t j = 0; j < pf->GetCount(); ++j) {
CFormatElem<T>* pfe = pf->GetAt(j);
- if(!pmt || (pfe->mt.majortype == pmt->majortype && pfe->mt.subtype == pmt->subtype)) {
- if(ppf) {
+ if (!pmt || (pfe->mt.majortype == pmt->majortype && pfe->mt.subtype == pmt->subtype)) {
+ if (ppf) {
*ppf = pf;
}
return(true);
@@ -95,19 +95,19 @@ public: }
bool FindFormat(AM_MEDIA_TYPE* pmt, T* pcaps, CFormat<T>** ppf, CFormatElem<T>** ppfe) {
- if(!pmt && !pcaps) {
+ if (!pmt && !pcaps) {
return(false);
}
- for(size_t i = 0; i < GetCount(); ++i) {
+ for (size_t i = 0; i < GetCount(); ++i) {
CFormat<T>* pf = GetAt(i);
- for(size_t j = 0; j < pf->GetCount(); ++j) {
+ for (size_t j = 0; j < pf->GetCount(); ++j) {
CFormatElem<T>* pfe = pf->GetAt(j);
- if((!pmt || pfe->mt == *pmt) && (!pcaps || !memcmp(pcaps, &pfe->caps, sizeof(T)))) {
- if(ppf) {
+ if ((!pmt || pfe->mt == *pmt) && (!pcaps || !memcmp(pcaps, &pfe->caps, sizeof(T)))) {
+ if (ppf) {
*ppf = pf;
}
- if(ppfe) {
+ if (ppfe) {
*ppfe = pfe;
}
return(true);
@@ -119,18 +119,18 @@ public: }
bool AddFormat(AM_MEDIA_TYPE* pmt, T caps) {
- if(!pmt) {
+ if (!pmt) {
return(false);
}
- if(FindFormat(pmt, NULL, NULL, NULL)) {
+ if (FindFormat(pmt, NULL, NULL, NULL)) {
DeleteMediaType(pmt);
return(false);
}
- // if(pmt->formattype == FORMAT_VideoInfo2) {DeleteMediaType(pmt); return(false);} // TODO
+ // if (pmt->formattype == FORMAT_VideoInfo2) {DeleteMediaType(pmt); return(false);} // TODO
CFormat<T>* pf = Find(MakeFormatName(pmt), true);
- if(!pf) {
+ if (!pf) {
DeleteMediaType(pmt);
return(false);
}
@@ -144,7 +144,7 @@ public: }
bool AddFormat(AM_MEDIA_TYPE* pmt, void* pcaps, int size) {
- if(!pcaps) {
+ if (!pcaps) {
return false;
}
ASSERT(size == sizeof(T));
@@ -164,7 +164,7 @@ public: CString MakeFormatName(AM_MEDIA_TYPE* pmt) {
CString str(_T("Default"));
- if(!pmt) {
+ if (!pmt) {
return(str);
}
@@ -174,14 +174,14 @@ public: ? &((VIDEOINFOHEADER2*)pmt->pbFormat)->bmiHeader
: NULL;
- if(!bih) {
+ if (!bih) {
// it may have a fourcc in the mediasubtype, let's check that
WCHAR guid[100];
memset(guid, 0, 100*sizeof(WCHAR));
StringFromGUID2(pmt->subtype, guid, 100);
- if(CStringW(guid).MakeUpper().Find(L"0000-0010-8000-00AA00389B71") >= 0) {
+ if (CStringW(guid).MakeUpper().Find(L"0000-0010-8000-00AA00389B71") >= 0) {
str.Format(_T("%c%c%c%c"),
(TCHAR)((pmt->subtype.Data1>>0)&0xff), (TCHAR)((pmt->subtype.Data1>>8)&0xff),
(TCHAR)((pmt->subtype.Data1>>16)&0xff), (TCHAR)((pmt->subtype.Data1>>24)&0xff));
@@ -190,7 +190,7 @@ public: return(str);
}
- switch(bih->biCompression) {
+ switch (bih->biCompression) {
case BI_RGB:
str.Format(_T("RGB%d"), bih->biBitCount);
break;
@@ -222,7 +222,7 @@ public: CString MakeDimensionName(CVidFormatElem* pfe) {
CString str(_T("Default"));
- if(!pfe) {
+ if (!pfe) {
return(str);
}
@@ -232,13 +232,13 @@ public: ? &((VIDEOINFOHEADER2*)pfe->mt.pbFormat)->bmiHeader
: NULL;
- if(bih == NULL) {
+ if (bih == NULL) {
return(str);
}
str.Format(_T("%dx%d %.2f"), bih->biWidth, bih->biHeight, (float)10000000/((VIDEOINFOHEADER*)pfe->mt.pbFormat)->AvgTimePerFrame);
- if(pfe->mt.formattype == FORMAT_VideoInfo2) {
+ if (pfe->mt.formattype == FORMAT_VideoInfo2) {
VIDEOINFOHEADER2* vih2 = (VIDEOINFOHEADER2*)pfe->mt.pbFormat;
CString str2;
str2.Format(_T(" i%02x %d:%d"), vih2->dwInterlaceFlags, vih2->dwPictAspectRatioX, vih2->dwPictAspectRatioY);
@@ -258,7 +258,7 @@ public: CString MakeFormatName(AM_MEDIA_TYPE* pmt) {
CString str(_T("Unknown"));
- if(!pmt) {
+ if (!pmt) {
return(str);
}
@@ -266,19 +266,19 @@ public: ? (WAVEFORMATEX*)pmt->pbFormat
: NULL;
- if(!wfe) {
+ if (!wfe) {
WCHAR guid[100];
memset(guid, 0, 100*sizeof(WCHAR));
StringFromGUID2(pmt->subtype, guid, 100);
- if(CStringW(guid).MakeUpper().Find(L"0000-0010-8000-00AA00389B71") >= 0) {
+ if (CStringW(guid).MakeUpper().Find(L"0000-0010-8000-00AA00389B71") >= 0) {
str.Format(_T("0x%04x"), pmt->subtype.Data1);
}
return(str);
}
- switch(wfe->wFormatTag) {
+ switch (wfe->wFormatTag) {
case 1:
str = _T("PCM ");
break;
@@ -293,7 +293,7 @@ public: CString MakeDimensionName(CAudFormatElem* pfe) {
CString str(_T("Unknown"));
- if(!pfe) {
+ if (!pfe) {
return(str);
}
@@ -301,7 +301,7 @@ public: ? (WAVEFORMATEX*)pfe->mt.pbFormat
: NULL;
- if(!wfe) {
+ if (!wfe) {
return(str);
}
@@ -314,7 +314,7 @@ public: str2.Format(_T("%dbps "), wfe->wBitsPerSample);
str += str2;
- switch(wfe->nChannels) {
+ switch (wfe->nChannels) {
case 1:
str += _T("mono ");
break;
diff --git a/src/apps/mplayerc/PlayerInfoBar.cpp b/src/apps/mplayerc/PlayerInfoBar.cpp index db31eb165..3595a298e 100644 --- a/src/apps/mplayerc/PlayerInfoBar.cpp +++ b/src/apps/mplayerc/PlayerInfoBar.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -40,17 +40,17 @@ CPlayerInfoBar::~CPlayerInfoBar() void CPlayerInfoBar::SetLine(CString label, CString info)
{
- if(info.IsEmpty()) {
+ if (info.IsEmpty()) {
RemoveLine(label);
return;
}
- for(size_t idx = 0; idx < m_label.GetCount(); idx++) {
+ for (size_t idx = 0; idx < m_label.GetCount(); idx++) {
CString tmp;
m_label[idx]->GetWindowText(tmp);
- if(label == tmp) {
+ if (label == tmp) {
m_info[idx]->GetWindowText(tmp);
- if(info != tmp) {
+ if (info != tmp) {
m_info[idx]->SetWindowText(info);
}
return;
@@ -72,10 +72,10 @@ void CPlayerInfoBar::GetLine(CString label, CString& info) {
info.Empty();
- for(size_t idx = 0; idx < m_label.GetCount(); idx++) {
+ for (size_t idx = 0; idx < m_label.GetCount(); idx++) {
CString tmp;
m_label[idx]->GetWindowText(tmp);
- if(label == tmp) {
+ if (label == tmp) {
m_info[idx]->GetWindowText(tmp);
info = tmp;
return;
@@ -85,10 +85,10 @@ void CPlayerInfoBar::GetLine(CString label, CString& info) void CPlayerInfoBar::RemoveLine(CString label)
{
- for(size_t i = 0; i < m_label.GetCount(); i++) {
+ for (size_t i = 0; i < m_label.GetCount(); i++) {
CString tmp;
m_label[i]->GetWindowText(tmp);
- if(label == tmp) {
+ if (label == tmp) {
m_label.RemoveAt(i);
m_info.RemoveAt(i);
break;
@@ -113,7 +113,7 @@ BOOL CPlayerInfoBar::Create(CWnd* pParentWnd) BOOL CPlayerInfoBar::PreCreateWindow(CREATESTRUCT& cs)
{
- if(!CDialogBar::PreCreateWindow(cs)) {
+ if (!CDialogBar::PreCreateWindow(cs)) {
return FALSE;
}
@@ -138,7 +138,7 @@ void CPlayerInfoBar::Relayout() int w = m_nFirstColWidth, h = 17, y = 2;
- for(size_t i = 0; i < m_label.GetCount(); i++) {
+ for (size_t i = 0; i < m_label.GetCount(); i++) {
CDC* pDC = m_label[i]->GetDC();
CString str;
m_label[i]->GetWindowText(str);
@@ -146,7 +146,7 @@ void CPlayerInfoBar::Relayout() m_label[i]->ReleaseDC(pDC);
}
- for(size_t i = 0; i < m_label.GetCount(); i++, y += h) {
+ for (size_t i = 0; i < m_label.GetCount(); i++, y += h) {
m_label[i]->MoveWindow(1, y, w - 10, h);
m_info[i]->MoveWindow(w + 10, y, r.Width()-(w+10)-1, h);
}
@@ -164,7 +164,7 @@ END_MESSAGE_MAP() BOOL CPlayerInfoBar::OnEraseBkgnd(CDC* pDC)
{
- for(CWnd* pChild = GetWindow(GW_CHILD); pChild; pChild = pChild->GetNextWindow()) {
+ for (CWnd* pChild = GetWindow(GW_CHILD); pChild; pChild = pChild->GetNextWindow()) {
CRect r;
pChild->GetClientRect(&r);
pChild->MapWindowPoints(this, &r);
@@ -176,11 +176,11 @@ BOOL CPlayerInfoBar::OnEraseBkgnd(CDC* pDC) CMainFrame* pFrame = ((CMainFrame*)GetParentFrame());
- if(pFrame->m_pLastBar != this || pFrame->m_fFullScreen) {
+ if (pFrame->m_pLastBar != this || pFrame->m_fFullScreen) {
r.InflateRect(0, 0, 0, 1);
}
- if(pFrame->m_fFullScreen) {
+ if (pFrame->m_fFullScreen) {
r.InflateRect(1, 0, 1, 0);
}
@@ -205,7 +205,7 @@ void CPlayerInfoBar::OnSize(UINT nType, int cx, int cy) void CPlayerInfoBar::OnLButtonDown(UINT nFlags, CPoint point)
{
CMainFrame* pFrame = ((CMainFrame*)GetParentFrame());
- if(!pFrame->m_fFullScreen) {
+ if (!pFrame->m_fFullScreen) {
MapWindowPoints(pFrame, &point, 1);
pFrame->PostMessage(WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(point.x, point.y));
}
diff --git a/src/apps/mplayerc/PlayerListCtrl.cpp b/src/apps/mplayerc/PlayerListCtrl.cpp index c1c6fdce7..90a7dd2f9 100644 --- a/src/apps/mplayerc/PlayerListCtrl.cpp +++ b/src/apps/mplayerc/PlayerListCtrl.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -54,8 +54,8 @@ END_MESSAGE_MAP() BOOL CInPlaceEdit::PreTranslateMessage(MSG* pMsg)
{
- if(pMsg->message == WM_KEYDOWN) {
- if(pMsg->wParam == VK_RETURN
+ if (pMsg->message == WM_KEYDOWN) {
+ if (pMsg->wParam == VK_RETURN
|| pMsg->wParam == VK_DELETE
|| pMsg->wParam == VK_ESCAPE
|| GetKeyState(VK_CONTROL)) {
@@ -99,8 +99,8 @@ void CInPlaceEdit::OnNcDestroy() void CInPlaceEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
- if(nChar == VK_ESCAPE || nChar == VK_RETURN) {
- if(nChar == VK_ESCAPE) {
+ if (nChar == VK_ESCAPE || nChar == VK_RETURN) {
+ if (nChar == VK_ESCAPE) {
m_bESC = TRUE;
}
GetParent()->SetFocus();
@@ -112,7 +112,7 @@ void CInPlaceEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) int CInPlaceEdit::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
- if(CEdit::OnCreate(lpCreateStruct) == -1) {
+ if (CEdit::OnCreate(lpCreateStruct) == -1) {
return -1;
}
@@ -165,7 +165,7 @@ int CInPlaceComboBox::OnCreate(LPCREATESTRUCT lpCreateStruct) CFont* font = GetParent()->GetFont();
SetFont(font);
- for(POSITION pos = m_lstItems.GetHeadPosition(); pos != NULL;) {
+ for (POSITION pos = m_lstItems.GetHeadPosition(); pos != NULL;) {
AddString((LPCTSTR)(m_lstItems.GetNext(pos)));
}
@@ -176,8 +176,8 @@ int CInPlaceComboBox::OnCreate(LPCREATESTRUCT lpCreateStruct) BOOL CInPlaceComboBox::PreTranslateMessage(MSG* pMsg)
{
- if(pMsg->message == WM_KEYDOWN) {
- if(pMsg->wParam == VK_RETURN
+ if (pMsg->message == WM_KEYDOWN) {
+ if (pMsg->wParam == VK_RETURN
|| pMsg->wParam == VK_ESCAPE) {
::TranslateMessage(pMsg);
::DispatchMessage(pMsg);
@@ -212,8 +212,8 @@ void CInPlaceComboBox::OnKillFocus(CWnd* pNewWnd) void CInPlaceComboBox::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
- if(nChar == VK_ESCAPE || nChar == VK_RETURN) {
- if(nChar == VK_ESCAPE) {
+ if (nChar == VK_ESCAPE || nChar == VK_RETURN) {
+ if (nChar == VK_ESCAPE) {
m_bESC = TRUE;
}
GetParent()->SetFocus();
@@ -265,7 +265,7 @@ END_MESSAGE_MAP() int CInPlaceListBox::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
- if(CListBox::OnCreate(lpCreateStruct) == -1) {
+ if (CListBox::OnCreate(lpCreateStruct) == -1) {
return -1;
}
@@ -273,7 +273,7 @@ int CInPlaceListBox::OnCreate(LPCREATESTRUCT lpCreateStruct) CFont* font = GetParent()->GetFont();
SetFont(font);
- for(POSITION pos = m_lstItems.GetHeadPosition(); pos != NULL;) {
+ for (POSITION pos = m_lstItems.GetHeadPosition(); pos != NULL;) {
AddString( (LPCTSTR) (m_lstItems.GetNext( pos )) );
}
SetCurSel( m_nSel );
@@ -283,8 +283,8 @@ int CInPlaceListBox::OnCreate(LPCREATESTRUCT lpCreateStruct) BOOL CInPlaceListBox::PreTranslateMessage(MSG* pMsg)
{
- if(pMsg->message == WM_KEYDOWN) {
- if(pMsg->wParam == VK_RETURN
+ if (pMsg->message == WM_KEYDOWN) {
+ if (pMsg->wParam == VK_RETURN
|| pMsg->wParam == VK_ESCAPE) {
::TranslateMessage(pMsg);
::DispatchMessage(pMsg);
@@ -319,8 +319,8 @@ void CInPlaceListBox::OnKillFocus(CWnd* pNewWnd) void CInPlaceListBox::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
- if(nChar == VK_ESCAPE || nChar == VK_RETURN) {
- if(nChar == VK_ESCAPE) {
+ if (nChar == VK_ESCAPE || nChar == VK_RETURN) {
+ if (nChar == VK_ESCAPE) {
m_bESC = TRUE;
}
GetParent()->SetFocus();
@@ -361,28 +361,28 @@ void CPlayerListCtrl::PreSubclassWindow() int CPlayerListCtrl::HitTestEx(CPoint& point, int* col) const
{
- if(col) {
+ if (col) {
*col = 0;
}
int row = HitTest(CPoint(0, point.y), NULL);
- if((GetWindowLong(m_hWnd, GWL_STYLE) & LVS_TYPEMASK) != LVS_REPORT) {
+ if ((GetWindowLong(m_hWnd, GWL_STYLE) & LVS_TYPEMASK) != LVS_REPORT) {
return row;
}
int nColumnCount = ((CHeaderCtrl*)GetDlgItem(0))->GetItemCount();
- for(int top = GetTopIndex(), bottom = GetBottomIndex(); top <= bottom; top++) {
+ for (int top = GetTopIndex(), bottom = GetBottomIndex(); top <= bottom; top++) {
CRect r;
GetItemRect(top, &r, LVIR_BOUNDS);
- if(r.top <= point.y && point.y < r.bottom) {
- for(int colnum = 0; colnum < nColumnCount; colnum++) {
+ if (r.top <= point.y && point.y < r.bottom) {
+ for (int colnum = 0; colnum < nColumnCount; colnum++) {
int colwidth = GetColumnWidth(colnum);
- if(point.x >= r.left && point.x <= (r.left + colwidth)) {
- if(col) {
+ if (point.x >= r.left && point.x <= (r.left + colwidth)) {
+ if (col) {
*col = colnum;
}
return top;
@@ -403,13 +403,13 @@ int CPlayerListCtrl::GetBottomIndex() const int nBottomIndex = GetTopIndex() + GetCountPerPage() - 1;
- if(nBottomIndex >= GetItemCount()) {
+ if (nBottomIndex >= GetItemCount()) {
nBottomIndex = GetItemCount() - 1;
- } else if(nBottomIndex < GetItemCount()) {
+ } else if (nBottomIndex < GetItemCount()) {
CRect br;
GetItemRect(nBottomIndex, br, LVIR_BOUNDS);
- if(br.bottom < r.bottom) {
+ if (br.bottom < r.bottom) {
nBottomIndex++;
}
}
@@ -419,7 +419,7 @@ int CPlayerListCtrl::GetBottomIndex() const CImageList* CPlayerListCtrl::CreateDragImageEx(LPPOINT lpPoint)
{
- if(GetSelectedCount() <= 0) {
+ if (GetSelectedCount() <= 0) {
return NULL;
}
@@ -433,17 +433,17 @@ CImageList* CPlayerListCtrl::CreateDragImageEx(LPPOINT lpPoint) // Determine the size of the drag image (limited for
// rows visible and Client width)
- while((nIndex = GetNextItem(nIndex, LVNI_SELECTED)) != -1 && nIndex <= nBottomIndex) {
+ while ((nIndex = GetNextItem(nIndex, LVNI_SELECTED)) != -1 && nIndex <= nBottomIndex) {
GetItemRect(nIndex, cSingleRect, LVIR_BOUNDS);
/*
CRect r;
GetItemRect(nIndex, r, LVIR_LABEL);
cSingleRect.left = r.left;
*/
- if(cSingleRect.left < 0) {
+ if (cSingleRect.left < 0) {
cSingleRect.left = 0;
}
- if(cSingleRect.right > nWidth) {
+ if (cSingleRect.right > nWidth) {
cSingleRect.right = nWidth;
}
@@ -457,11 +457,11 @@ CImageList* CPlayerListCtrl::CreateDragImageEx(LPPOINT lpPoint) CDC cMemDC;
CBitmap cBitmap;
- if(!cMemDC.CreateCompatibleDC(&cDc)) {
+ if (!cMemDC.CreateCompatibleDC(&cDc)) {
return NULL;
}
- if(!cBitmap.CreateCompatibleBitmap(&cDc, cCompleteRect.Width(), cCompleteRect.Height())) {
+ if (!cBitmap.CreateCompatibleBitmap(&cDc, cCompleteRect.Width(), cCompleteRect.Height())) {
return NULL;
}
@@ -471,11 +471,11 @@ CImageList* CPlayerListCtrl::CreateDragImageEx(LPPOINT lpPoint) // Paint each DragImage in the DC
nIndex = GetTopIndex() - 1;
- while((nIndex = GetNextItem(nIndex, LVNI_SELECTED)) != -1 && nIndex <= nBottomIndex) {
+ while ((nIndex = GetNextItem(nIndex, LVNI_SELECTED)) != -1 && nIndex <= nBottomIndex) {
CPoint pt;
CImageList* pSingleImageList = CreateDragImage(nIndex, &pt);
- if(pSingleImageList) {
+ if (pSingleImageList) {
GetItemRect(nIndex, cSingleRect, LVIR_BOUNDS);
pSingleImageList->Draw(&cMemDC,
@@ -507,7 +507,7 @@ CImageList* CPlayerListCtrl::CreateDragImageEx(LPPOINT lpPoint) // Find the offset of the current mouse cursor to the image list
// this we can use in BeginDrag()
//
- if(lpPoint) {
+ if (lpPoint) {
lpPoint->x = cCompleteRect.left;
lpPoint->y = cCompleteRect.top;
}
@@ -517,17 +517,17 @@ CImageList* CPlayerListCtrl::CreateDragImageEx(LPPOINT lpPoint) bool CPlayerListCtrl::PrepareInPlaceControl(int nRow, int nCol, CRect& rect)
{
- if(!EnsureVisible(nRow, TRUE)) {
+ if (!EnsureVisible(nRow, TRUE)) {
return(false);
}
int nColumnCount = ((CHeaderCtrl*)GetDlgItem(0))->GetItemCount();
- if(nCol >= nColumnCount || GetColumnWidth(nCol) < 5) {
+ if (nCol >= nColumnCount || GetColumnWidth(nCol) < 5) {
return(false);
}
int offset = 0;
- for(int i = 0; i < nCol; i++) {
+ for (int i = 0; i < nCol; i++) {
offset += GetColumnWidth(i);
}
@@ -535,7 +535,7 @@ bool CPlayerListCtrl::PrepareInPlaceControl(int nRow, int nCol, CRect& rect) CRect rcClient;
GetClientRect(&rcClient);
- if(offset + rect.left < 0 || offset + rect.left > rcClient.right) {
+ if (offset + rect.left < 0 || offset + rect.left > rcClient.right) {
CSize size(offset + rect.left, 0);
Scroll(size);
rect.left -= size.cx;
@@ -543,13 +543,13 @@ bool CPlayerListCtrl::PrepareInPlaceControl(int nRow, int nCol, CRect& rect) rect.left += offset;
rect.right = rect.left + GetColumnWidth(nCol);
- if(rect.right > rcClient.right) {
+ if (rect.right > rcClient.right) {
rect.right = rcClient.right;
}
rect.DeflateRect(1, 0, 0, 1);
- if(nCol == 0) {
+ if (nCol == 0) {
CRect r;
GetItemRect(nRow, r, LVIR_LABEL);
rect.left = r.left-1;
@@ -561,7 +561,7 @@ bool CPlayerListCtrl::PrepareInPlaceControl(int nRow, int nCol, CRect& rect) CEdit* CPlayerListCtrl::ShowInPlaceEdit(int nItem, int nCol)
{
CRect rect;
- if(!PrepareInPlaceControl(nItem, nCol, rect)) {
+ if (!PrepareInPlaceControl(nItem, nCol, rect)) {
return(NULL);
}
@@ -585,7 +585,7 @@ CEdit* CPlayerListCtrl::ShowInPlaceEdit(int nItem, int nCol) CComboBox* CPlayerListCtrl::ShowInPlaceComboBox(int nItem, int nCol, CAtlList<CString>& lstItems, int nSel, bool bShowDropDown)
{
CRect rect;
- if(!PrepareInPlaceControl(nItem, nCol, rect)) {
+ if (!PrepareInPlaceControl(nItem, nCol, rect)) {
return(NULL);
}
@@ -597,7 +597,7 @@ CComboBox* CPlayerListCtrl::ShowInPlaceComboBox(int nItem, int nCol, CAtlList<CS CorrectComboListWidth(*pComboBox, GetFont());
int width = GetColumnWidth(nCol);
- if(pComboBox->GetDroppedWidth() < width) {
+ if (pComboBox->GetDroppedWidth() < width) {
pComboBox->SetDroppedWidth(width);
}
@@ -613,7 +613,7 @@ CComboBox* CPlayerListCtrl::ShowInPlaceComboBox(int nItem, int nCol, CAtlList<CS CListBox* CPlayerListCtrl::ShowInPlaceListBox(int nItem, int nCol, CAtlList<CString>& lstItems, int nSel)
{
CRect rect;
- if(!PrepareInPlaceControl(nItem, nCol, rect)) {
+ if (!PrepareInPlaceControl(nItem, nCol, rect)) {
return(NULL);
}
@@ -631,9 +631,9 @@ CListBox* CPlayerListCtrl::ShowInPlaceListBox(int nItem, int nCol, CAtlList<CStr pDC->SelectObject(pWndFont);
int width = GetColumnWidth(nCol);
POSITION pos = lstItems.GetHeadPosition();
- while(pos) {
+ while (pos) {
int w = pDC->GetTextExtent(lstItems.GetNext(pos)).cx + 16;
- if(width < w) {
+ if (width < w) {
width = w;
}
}
@@ -675,7 +675,7 @@ END_MESSAGE_MAP() void CPlayerListCtrl::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
- if(GetFocus() != this) {
+ if (GetFocus() != this) {
SetFocus();
}
CListCtrl::OnVScroll(nSBCode, nPos, pScrollBar);
@@ -683,7 +683,7 @@ void CPlayerListCtrl::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) void CPlayerListCtrl::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
- if(GetFocus() != this) {
+ if (GetFocus() != this) {
SetFocus();
}
CListCtrl::OnHScroll(nSBCode, nPos, pScrollBar);
@@ -691,7 +691,7 @@ void CPlayerListCtrl::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) BOOL CPlayerListCtrl::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
{
- if(GetFocus() != this) {
+ if (GetFocus() != this) {
SetFocus();
}
return CListCtrl::OnMouseWheel(nFlags, zDelta, pt);
@@ -701,7 +701,7 @@ void CPlayerListCtrl::OnLButtonDown(UINT nFlags, CPoint point) {
CListCtrl::OnLButtonDown(nFlags, point);
- if(GetFocus() != this) {
+ if (GetFocus() != this) {
SetFocus();
}
@@ -709,9 +709,9 @@ void CPlayerListCtrl::OnLButtonDown(UINT nFlags, CPoint point) int m_nItemClickedNow, m_nSubItemClickedNow;
- if((m_nItemClickedNow = HitTestEx(point, &m_nSubItemClickedNow)) < 0) {
+ if ((m_nItemClickedNow = HitTestEx(point, &m_nSubItemClickedNow)) < 0) {
m_nItemClicked = -1;
- } else if(m_nItemClicked == m_nItemClickedNow /*&& m_nSubItemClicked == m_nSubItemClickedNow*/) {
+ } else if (m_nItemClicked == m_nItemClickedNow /*&& m_nSubItemClicked == m_nSubItemClickedNow*/) {
m_nSubItemClicked = m_nSubItemClickedNow;
LV_DISPINFO dispinfo;
@@ -721,8 +721,8 @@ void CPlayerListCtrl::OnLButtonDown(UINT nFlags, CPoint point) dispinfo.item.mask = 0;
dispinfo.item.iItem = m_nItemClicked;
dispinfo.item.iSubItem = m_nSubItemClicked;
- if(GetParent()->SendMessage(WM_NOTIFY, GetDlgCtrlID(), (LPARAM)&dispinfo)) {
- if(m_tStartEditingDelay > 0) {
+ if (GetParent()->SendMessage(WM_NOTIFY, GetDlgCtrlID(), (LPARAM)&dispinfo)) {
+ if (m_tStartEditingDelay > 0) {
SetTimer(1, m_tStartEditingDelay, NULL);
} else {
dispinfo.hdr.code = LVN_DOLABELEDIT;
@@ -739,11 +739,11 @@ void CPlayerListCtrl::OnLButtonDown(UINT nFlags, CPoint point) void CPlayerListCtrl::OnTimer(UINT_PTR nIDEvent)
{
- if(nIDEvent == 1) {
+ if (nIDEvent == 1) {
KillTimer(1);
UINT flag = LVIS_FOCUSED;
- if((GetItemState(m_nItemClicked, flag) & flag) == flag && m_nSubItemClicked >= 0) {
+ if ((GetItemState(m_nItemClicked, flag) & flag) == flag && m_nSubItemClicked >= 0) {
LV_DISPINFO dispinfo;
dispinfo.hdr.hwndFrom = m_hWnd;
dispinfo.hdr.idFrom = GetDlgCtrlID();
@@ -831,7 +831,7 @@ INT_PTR CPlayerListCtrl::OnToolHitTest(CPoint point, TOOLINFO* pTI) const {
int col;
int row = HitTestEx(point, &col);
- if(row == -1) {
+ if (row == -1) {
return -1;
}
@@ -841,10 +841,10 @@ INT_PTR CPlayerListCtrl::OnToolHitTest(CPoint point, TOOLINFO* pTI) const CRect rect;
GetItemRect(row, &rect, LVIR_BOUNDS);
- for(int colnum = 0; colnum < nColumnCount; colnum++) {
+ for (int colnum = 0; colnum < nColumnCount; colnum++) {
int colwidth = GetColumnWidth(colnum);
- if(colnum == col) {
+ if (colnum == col) {
rect.right = rect.left + colwidth;
break;
}
@@ -871,11 +871,11 @@ BOOL CPlayerListCtrl::OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESULT* pResult) nID = ::GetDlgCtrlID((HWND)nID);
}
- if(nID == 0) { // Notification in NT from automatically
+ if (nID == 0) { // Notification in NT from automatically
return FALSE; // created tooltip
}
- if(pNMHDR->code == TTN_NEEDTEXTW) { //?possible check is not needed
+ if (pNMHDR->code == TTN_NEEDTEXTW) { //?possible check is not needed
pTTTW->lParam = (LPARAM)m_hWnd;
}
diff --git a/src/apps/mplayerc/PlayerNavigationBar.cpp b/src/apps/mplayerc/PlayerNavigationBar.cpp index 13b8c383b..1f7cc5bf7 100644 --- a/src/apps/mplayerc/PlayerNavigationBar.cpp +++ b/src/apps/mplayerc/PlayerNavigationBar.cpp @@ -40,7 +40,7 @@ CPlayerNavigationBar::~CPlayerNavigationBar() BOOL CPlayerNavigationBar::Create(CWnd* pParentWnd)
{
- if(!baseCPlayerNavigationBar::Create(_T("Navigation bar"), pParentWnd, ID_VIEW_NAVIGATION)) {
+ if (!baseCPlayerNavigationBar::Create(_T("Navigation bar"), pParentWnd, ID_VIEW_NAVIGATION)) {
return FALSE;
}
@@ -61,8 +61,8 @@ BOOL CPlayerNavigationBar::Create(CWnd* pParentWnd) BOOL CPlayerNavigationBar::PreTranslateMessage(MSG* pMsg)
{
- if(IsWindow(pMsg->hwnd) && IsVisible() && pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST) {
- if(IsDialogMessage(pMsg)) {
+ if (IsWindow(pMsg->hwnd) && IsVisible() && pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST) {
+ if (IsDialogMessage(pMsg)) {
return TRUE;
}
}
@@ -81,7 +81,7 @@ void CPlayerNavigationBar::OnSize(UINT nType, int cx, int cy) {
__super::OnSize(nType, cx, cy);
- if(::IsWindow(m_navdlg.m_hWnd)) {
+ if (::IsWindow(m_navdlg.m_hWnd)) {
CRect r, rectComboAudio, rectButtonInfo, rectButtonScan;
LONG totalsize, separation, sizeComboAudio, sizeButtonInfo, sizeButtonScan;
GetClientRect(r);
@@ -97,8 +97,9 @@ void CPlayerNavigationBar::OnSize(UINT nType, int cx, int cy) sizeButtonScan = rectButtonScan.right - rectButtonScan.left;
totalsize = r.right - r.left;
separation = (totalsize - sizeComboAudio - sizeButtonInfo - sizeButtonScan) / 2;
- if (separation < 0)
+ if (separation < 0) {
separation = 0;
+ }
m_navdlg.m_ComboAudio.SetWindowPos(NULL, r.left, r.bottom+6, 0,0, SWP_NOSIZE | SWP_NOZORDER);
m_navdlg.m_ButtonInfo.SetWindowPos(NULL, r.left + sizeComboAudio + separation, r.bottom +5, 0,0, SWP_NOSIZE | SWP_NOZORDER);
m_navdlg.m_ButtonScan.SetWindowPos(NULL, r.left + sizeComboAudio + sizeButtonInfo + 2 * separation, r.bottom +5, 0,0, SWP_NOSIZE | SWP_NOZORDER);
diff --git a/src/apps/mplayerc/PlayerNavigationDialog.cpp b/src/apps/mplayerc/PlayerNavigationDialog.cpp index 9e731371b..4f1cea984 100644 --- a/src/apps/mplayerc/PlayerNavigationDialog.cpp +++ b/src/apps/mplayerc/PlayerNavigationDialog.cpp @@ -1,7 +1,7 @@ /*
* $Id$
*
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -43,7 +43,7 @@ CPlayerNavigationDialog::~CPlayerNavigationDialog() BOOL CPlayerNavigationDialog::Create(CWnd* pParent)
{
- if(!__super::Create(IDD, pParent)) {
+ if (!__super::Create(IDD, pParent)) {
return FALSE;
}
m_pParent = pParent;
@@ -63,8 +63,8 @@ void CPlayerNavigationDialog::DoDataExchange(CDataExchange* pDX) BOOL CPlayerNavigationDialog::PreTranslateMessage(MSG* pMsg)
{
- if(pMsg->message == WM_KEYDOWN) {
- if(pMsg->wParam == VK_RETURN) {
+ if (pMsg->message == WM_KEYDOWN) {
+ if (pMsg->wParam == VK_RETURN) {
CWnd* pFocused = GetFocus();
if (pFocused && pFocused->m_hWnd == m_ChannelList.m_hWnd) {
return TRUE;
diff --git a/src/apps/mplayerc/PlayerPlaylistBar.cpp b/src/apps/mplayerc/PlayerPlaylistBar.cpp index 741537c48..56427c0e8 100644 --- a/src/apps/mplayerc/PlayerPlaylistBar.cpp +++ b/src/apps/mplayerc/PlayerPlaylistBar.cpp @@ -48,7 +48,7 @@ CPlayerPlaylistBar::~CPlayerPlaylistBar() BOOL CPlayerPlaylistBar::Create(CWnd* pParentWnd)
{
- if(!CSizingControlBarG::Create(_T("Playlist"), pParentWnd, ID_VIEW_PLAYLIST)) {
+ if (!CSizingControlBarG::Create(_T("Playlist"), pParentWnd, ID_VIEW_PLAYLIST)) {
return FALSE;
}
@@ -80,7 +80,7 @@ BOOL CPlayerPlaylistBar::Create(CWnd* pParentWnd) BOOL CPlayerPlaylistBar::PreCreateWindow(CREATESTRUCT& cs)
{
- if(!CSizingControlBarG::PreCreateWindow(cs)) {
+ if (!CSizingControlBarG::PreCreateWindow(cs)) {
return FALSE;
}
@@ -91,13 +91,13 @@ BOOL CPlayerPlaylistBar::PreCreateWindow(CREATESTRUCT& cs) BOOL CPlayerPlaylistBar::PreTranslateMessage(MSG* pMsg)
{
- if(IsWindow(pMsg->hwnd) && IsVisible() && pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST) {
- if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE) {
+ if (IsWindow(pMsg->hwnd) && IsVisible() && pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST) {
+ if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE) {
GetParentFrame()->ShowControlBar(this, FALSE, TRUE);
return TRUE;
}
- if(IsDialogMessage(pMsg)) {
+ if (IsDialogMessage(pMsg)) {
return TRUE;
}
}
@@ -117,18 +117,18 @@ void CPlayerPlaylistBar::AddItem(CAtlList<CString>& fns, CAtlList<CString>* subs CPlaylistItem pli;
POSITION pos = fns.GetHeadPosition();
- while(pos) {
+ while (pos) {
CString fn = fns.GetNext(pos);
- if(!fn.Trim().IsEmpty()) {
+ if (!fn.Trim().IsEmpty()) {
pli.m_fns.AddTail(fn);
}
}
- if(subs) {
+ if (subs) {
POSITION pos = subs->GetHeadPosition();
- while(pos) {
+ while (pos) {
CString fn = subs->GetNext(pos);
- if(!fn.Trim().IsEmpty()) {
+ if (!fn.Trim().IsEmpty()) {
pli.m_subs.AddTail(fn);
}
}
@@ -141,7 +141,7 @@ void CPlayerPlaylistBar::AddItem(CAtlList<CString>& fns, CAtlList<CString>* subs static bool SearchFiles(CString mask, CAtlList<CString>& sl)
{
- if(mask.Find(_T("://")) >= 0) {
+ if (mask.Find(_T("://")) >= 0) {
return(false);
}
@@ -162,9 +162,9 @@ static bool SearchFiles(CString mask, CAtlList<CString>& sl) WIN32_FIND_DATA fd;
HANDLE h = FindFirstFile(mask, &fd);
- if(h != INVALID_HANDLE_VALUE) {
+ if (h != INVALID_HANDLE_VALUE) {
do {
- if(fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {
+ if (fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {
continue;
}
@@ -173,22 +173,22 @@ static bool SearchFiles(CString mask, CAtlList<CString>& sl) CString ext = fn.Mid(fn.ReverseFind('.')).MakeLower();
CString path = dir + fd.cFileName;
- if(!fFilterKnownExts || mf.FindExt(ext)) {
- for(int i = 0; i < mf.GetCount(); i++) {
+ if (!fFilterKnownExts || mf.FindExt(ext)) {
+ for (int i = 0; i < mf.GetCount(); i++) {
CMediaFormatCategory& mfc = mf.GetAt(i);
/* playlist files are skipped when playing the contents of an entire directory */
- if((mfc.FindExt(ext)) && (mf[i].GetLabel().CompareNoCase(ResStr(IDS_AG_PLAYLIST_FILE)) != 0)) {
+ if ((mfc.FindExt(ext)) && (mf[i].GetLabel().CompareNoCase(ResStr(IDS_AG_PLAYLIST_FILE)) != 0)) {
sl.AddTail(path);
break;
}
}
}
- } while(FindNextFile(h, &fd));
+ } while (FindNextFile(h, &fd));
FindClose(h);
- if(sl.GetCount() == 0 && mask.Find(_T(":\\")) == 1) {
+ if (sl.GetCount() == 0 && mask.Find(_T(":\\")) == 1) {
GetCDROMType(mask[0], sl);
}
}
@@ -215,10 +215,10 @@ void CPlayerPlaylistBar::ResolveLinkFiles( CAtlList<CString> &fns ) CComQIPtr<IPersistFile> pPF = pSL;
POSITION pos = fns.GetHeadPosition();
- while(pSL && pPF && pos) {
+ while (pSL && pPF && pos) {
CString& fn = fns.GetNext(pos);
TCHAR buff[_MAX_PATH];
- if(CPath(fn).GetExtension().MakeLower() != _T(".lnk")
+ if (CPath(fn).GetExtension().MakeLower() != _T(".lnk")
|| FAILED(pPF->Load(CStringW(fn), STGM_READ))
|| FAILED(pSL->Resolve(NULL, SLR_ANY_MATCH|SLR_NO_UI))
|| FAILED(pSL->GetPath(buff, countof(buff), NULL, 0))) {
@@ -231,21 +231,21 @@ void CPlayerPlaylistBar::ResolveLinkFiles( CAtlList<CString> &fns ) void CPlayerPlaylistBar::ParsePlayList(CAtlList<CString>& fns, CAtlList<CString>* subs)
{
- if(fns.IsEmpty()) {
+ if (fns.IsEmpty()) {
return;
}
- AppSettings& s = AfxGetAppSettings();
+ AppSettings& s = AfxGetAppSettings();
ResolveLinkFiles(fns);
CAtlList<CString> sl;
- if(SearchFiles(fns.GetHead(), sl)) {
- if(sl.GetCount() > 1) {
+ if (SearchFiles(fns.GetHead(), sl)) {
+ if (sl.GetCount() > 1) {
subs = NULL;
}
POSITION pos = sl.GetHeadPosition();
- while(pos) {
+ while (pos) {
ParsePlayList(sl.GetNext(pos), subs);
}
return;
@@ -253,20 +253,20 @@ void CPlayerPlaylistBar::ParsePlayList(CAtlList<CString>& fns, CAtlList<CString> CAtlList<CString> redir;
CStringA ct = GetContentType(fns.GetHead(), &redir);
- if(!redir.IsEmpty()) {
+ if (!redir.IsEmpty()) {
POSITION pos = redir.GetHeadPosition();
- while(pos) {
+ while (pos) {
ParsePlayList(sl.GetNext(pos), subs);
}
return;
}
- if(ct == "application/x-mpc-playlist") {
+ if (ct == "application/x-mpc-playlist") {
ParseMPCPlayList(fns.GetHead());
return;
} else {
#if INTERNAL_SOURCEFILTER_MPEG
- if(ct == "application/x-bdmv-playlist" && s.SrcFilters[SRC_MPEG]) {
+ if (ct == "application/x-bdmv-playlist" && s.SrcFilters[SRC_MPEG]) {
ParseBDMVPlayList(fns.GetHead());
return;
}
@@ -283,7 +283,7 @@ static int s_int_comp(const void* i1, const void* i2) static CString CombinePath(CPath p, CString fn)
{
- if(fn.Find(':') >= 0 || fn.Find(_T("\\")) == 0) {
+ if (fn.Find(':') >= 0 || fn.Find(_T("\\")) == 0) {
return fn;
}
p.Append(CPath(fn));
@@ -316,63 +316,63 @@ bool CPlayerPlaylistBar::ParseMPCPlayList(CString fn) CAtlArray<int> idx;
CWebTextFile f;
- if(!f.Open(fn) || !f.ReadString(str) || str != _T("MPCPLAYLIST")) {
+ if (!f.Open(fn) || !f.ReadString(str) || str != _T("MPCPLAYLIST")) {
return false;
}
- if(f.GetEncoding() == CTextFile::ASCII) {
+ if (f.GetEncoding() == CTextFile::ASCII) {
f.SetEncoding(CTextFile::ANSI);
}
CPath base(fn);
base.RemoveFileSpec();
- while(f.ReadString(str)) {
+ while (f.ReadString(str)) {
CAtlList<CString> sl;
Explode(str, sl, ',', 3);
- if(sl.GetCount() != 3) {
+ if (sl.GetCount() != 3) {
continue;
}
- if(int i = _ttoi(sl.RemoveHead())) {
+ if (int i = _ttoi(sl.RemoveHead())) {
CString key = sl.RemoveHead();
CString value = sl.RemoveHead();
- if(key == _T("type")) {
+ if (key == _T("type")) {
pli[i].m_type = (CPlaylistItem::type_t)_ttol(value);
idx.Add(i);
- } else if(key == _T("label")) {
+ } else if (key == _T("label")) {
pli[i].m_label = value;
- } else if(key == _T("filename")) {
+ } else if (key == _T("filename")) {
value = CombinePath(base, value);
pli[i].m_fns.AddTail(value);
- } else if(key == _T("subtitle")) {
+ } else if (key == _T("subtitle")) {
value = CombinePath(base, value);
pli[i].m_subs.AddTail(value);
- } else if(key == _T("video")) {
- while(pli[i].m_fns.GetCount() < 2) {
+ } else if (key == _T("video")) {
+ while (pli[i].m_fns.GetCount() < 2) {
pli[i].m_fns.AddTail(_T(""));
}
pli[i].m_fns.GetHead() = value;
- } else if(key == _T("audio")) {
- while(pli[i].m_fns.GetCount() < 2) {
+ } else if (key == _T("audio")) {
+ while (pli[i].m_fns.GetCount() < 2) {
pli[i].m_fns.AddTail(_T(""));
}
pli[i].m_fns.GetTail() = value;
- } else if(key == _T("vinput")) {
+ } else if (key == _T("vinput")) {
pli[i].m_vinput = _ttol(value);
- } else if(key == _T("vchannel")) {
+ } else if (key == _T("vchannel")) {
pli[i].m_vchannel = _ttol(value);
- } else if(key == _T("ainput")) {
+ } else if (key == _T("ainput")) {
pli[i].m_ainput = _ttol(value);
- } else if(key == _T("country")) {
+ } else if (key == _T("country")) {
pli[i].m_country = _ttol(value);
}
}
}
qsort(idx.GetData(), idx.GetCount(), sizeof(int), s_int_comp);
- for(int i = 0; i < idx.GetCount(); i++) {
+ for (int i = 0; i < idx.GetCount(); i++) {
m_pl.AddTail(pli[idx[i]]);
}
@@ -382,14 +382,14 @@ bool CPlayerPlaylistBar::ParseMPCPlayList(CString fn) bool CPlayerPlaylistBar::SaveMPCPlayList(CString fn, CTextFile::enc e, bool fRemovePath)
{
CTextFile f;
- if(!f.Save(fn, e)) {
+ if (!f.Save(fn, e)) {
return false;
}
f.WriteString(_T("MPCPLAYLIST\n"));
POSITION pos = m_pl.GetHeadPosition(), pos2;
- for(int i = 1; pos; i++) {
+ for (int i = 1; pos; i++) {
CPlaylistItem& pli = m_pl.GetNext(pos);
CString idx;
@@ -399,15 +399,15 @@ bool CPlayerPlaylistBar::SaveMPCPlayList(CString fn, CTextFile::enc e, bool fRem str.Format(_T("%d,type,%d"), i, pli.m_type);
f.WriteString(str + _T("\n"));
- if(!pli.m_label.IsEmpty()) {
+ if (!pli.m_label.IsEmpty()) {
f.WriteString(idx + _T(",label,") + pli.m_label + _T("\n"));
}
- if(pli.m_type == CPlaylistItem::file) {
+ if (pli.m_type == CPlaylistItem::file) {
pos2 = pli.m_fns.GetHeadPosition();
- while(pos2) {
+ while (pos2) {
CString fn = pli.m_fns.GetNext(pos2);
- if(fRemovePath) {
+ if (fRemovePath) {
CPath p(fn);
p.StripPath();
fn = (LPCTSTR)p;
@@ -416,16 +416,16 @@ bool CPlayerPlaylistBar::SaveMPCPlayList(CString fn, CTextFile::enc e, bool fRem }
pos2 = pli.m_subs.GetHeadPosition();
- while(pos2) {
+ while (pos2) {
CString fn = pli.m_subs.GetNext(pos2);
- if(fRemovePath) {
+ if (fRemovePath) {
CPath p(fn);
p.StripPath();
fn = (LPCTSTR)p;
}
f.WriteString(idx + _T(",subtitle,") + fn + _T("\n"));
}
- } else if(pli.m_type == CPlaylistItem::device && pli.m_fns.GetCount() == 2) {
+ } else if (pli.m_type == CPlaylistItem::device && pli.m_fns.GetCount() == 2) {
f.WriteString(idx + _T(",video,") + pli.m_fns.GetHead() + _T("\n"));
f.WriteString(idx + _T(",audio,") + pli.m_fns.GetTail() + _T("\n"));
str.Format(_T("%d,vinput,%d"), i, pli.m_vinput);
@@ -466,10 +466,10 @@ void CPlayerPlaylistBar::Open(CAtlList<CString>& fns, bool fMulti, CAtlList<CStr void CPlayerPlaylistBar::Append(CAtlList<CString>& fns, bool fMulti, CAtlList<CString>* subs)
{
- if(fMulti) {
+ if (fMulti) {
ASSERT(subs == NULL || subs->GetCount() == 0);
POSITION pos = fns.GetHeadPosition();
- while(pos) {
+ while (pos) {
ParsePlayList(fns.GetNext(pos), NULL);
}
} else {
@@ -498,10 +498,10 @@ void CPlayerPlaylistBar::Append(CStringW vdn, CStringW adn, int vinput, int vcha CAtlList<CStringW> sl;
CStringW vfn = GetFriendlyName(vdn);
CStringW afn = GetFriendlyName(adn);
- if(!vfn.IsEmpty()) {
+ if (!vfn.IsEmpty()) {
sl.AddTail(vfn);
}
- if(!afn.IsEmpty()) {
+ if (!afn.IsEmpty()) {
sl.AddTail(afn);
}
CStringW label = Implode(sl, '|');
@@ -518,7 +518,7 @@ void CPlayerPlaylistBar::SetupList() m_list.DeleteAllItems();
POSITION pos = m_pl.GetHeadPosition();
- for(int i = 0; pos; i++) {
+ for (int i = 0; pos; i++) {
CPlaylistItem& pli = m_pl.GetAt(pos);
m_list.SetItemData(m_list.InsertItem(i, pli.GetLabel()), (DWORD_PTR)pos);
m_list.SetItemText(i, COL_TIME, pli.GetLabel(1));
@@ -529,7 +529,7 @@ void CPlayerPlaylistBar::SetupList() void CPlayerPlaylistBar::UpdateList()
{
POSITION pos = m_pl.GetHeadPosition();
- for(int i = 0, j = m_list.GetItemCount(); pos && i < j; i++) {
+ for (int i = 0, j = m_list.GetItemCount(); pos && i < j; i++) {
CPlaylistItem& pli = m_pl.GetAt(pos);
m_list.SetItemData(i, (DWORD_PTR)pos);
m_list.SetItemText(i, COL_NAME, pli.GetLabel(0));
@@ -541,7 +541,7 @@ void CPlayerPlaylistBar::UpdateList() void CPlayerPlaylistBar::EnsureVisible(POSITION pos)
{
int i = FindItem(m_pl.GetPos());
- if(i < 0) {
+ if (i < 0) {
return;
}
m_list.EnsureVisible(i, TRUE);
@@ -550,8 +550,8 @@ void CPlayerPlaylistBar::EnsureVisible(POSITION pos) int CPlayerPlaylistBar::FindItem(POSITION pos)
{
- for(int i = 0; i < m_list.GetItemCount(); i++)
- if((POSITION)m_list.GetItemData(i) == pos) {
+ for (int i = 0; i < m_list.GetItemCount(); i++)
+ if ((POSITION)m_list.GetItemData(i) == pos) {
return(i);
}
return(-1);
@@ -559,7 +559,7 @@ int CPlayerPlaylistBar::FindItem(POSITION pos) POSITION CPlayerPlaylistBar::FindPos(int i)
{
- if(i < 0) {
+ if (i < 0) {
return(NULL);
}
return((POSITION)m_list.GetItemData(i));
@@ -587,7 +587,7 @@ bool CPlayerPlaylistBar::IsAtEnd() bool CPlayerPlaylistBar::GetCur(CPlaylistItem& pli)
{
- if(!m_pl.GetPos()) {
+ if (!m_pl.GetPos()) {
return(false);
}
pli = m_pl.GetAt(m_pl.GetPos());
@@ -596,7 +596,7 @@ bool CPlayerPlaylistBar::GetCur(CPlaylistItem& pli) CPlaylistItem* CPlayerPlaylistBar::GetCur()
{
- if(!m_pl.GetPos()) {
+ if (!m_pl.GetPos()) {
return NULL;
}
return &m_pl.GetAt(m_pl.GetPos());
@@ -606,7 +606,7 @@ CString CPlayerPlaylistBar::GetCurFileName() {
CString fn;
CPlaylistItem* pli = GetCur();
- if(pli && !pli->m_fns.IsEmpty()) {
+ if (pli && !pli->m_fns.IsEmpty()) {
fn = pli->m_fns.GetHead();
}
return(fn);
@@ -615,7 +615,7 @@ CString CPlayerPlaylistBar::GetCurFileName() void CPlayerPlaylistBar::SetNext()
{
POSITION pos = m_pl.GetPos(), org = pos;
- while(m_pl.GetNextWrap(pos).m_fInvalid && pos != org) {
+ while (m_pl.GetNextWrap(pos).m_fInvalid && pos != org) {
;
}
UpdateList();
@@ -626,7 +626,7 @@ void CPlayerPlaylistBar::SetNext() void CPlayerPlaylistBar::SetPrev()
{
POSITION pos = m_pl.GetPos(), org = pos;
- while(m_pl.GetPrevWrap(pos).m_fInvalid && pos != org) {
+ while (m_pl.GetPrevWrap(pos).m_fInvalid && pos != org) {
;
}
m_pl.SetPos(pos);
@@ -636,12 +636,12 @@ void CPlayerPlaylistBar::SetPrev() void CPlayerPlaylistBar::SetFirstSelected()
{
POSITION pos = m_list.GetFirstSelectedItemPosition();
- if(pos) {
+ if (pos) {
pos = FindPos(m_list.GetNextSelectedItem(pos));
} else {
pos = m_pl.GetTailPosition();
POSITION org = pos;
- while(m_pl.GetNextWrap(pos).m_fInvalid && pos != org) {
+ while (m_pl.GetNextWrap(pos).m_fInvalid && pos != org) {
;
}
}
@@ -653,7 +653,7 @@ void CPlayerPlaylistBar::SetFirstSelected() void CPlayerPlaylistBar::SetFirst()
{
POSITION pos = m_pl.GetTailPosition(), org = pos;
- while(m_pl.GetNextWrap(pos).m_fInvalid && pos != org) {
+ while (m_pl.GetNextWrap(pos).m_fInvalid && pos != org) {
;
}
UpdateList();
@@ -664,7 +664,7 @@ void CPlayerPlaylistBar::SetFirst() void CPlayerPlaylistBar::SetLast()
{
POSITION pos = m_pl.GetHeadPosition(), org = pos;
- while(m_pl.GetPrevWrap(pos).m_fInvalid && pos != org) {
+ while (m_pl.GetPrevWrap(pos).m_fInvalid && pos != org) {
;
}
m_pl.SetPos(pos);
@@ -674,9 +674,9 @@ void CPlayerPlaylistBar::SetLast() void CPlayerPlaylistBar::SetCurValid(bool fValid)
{
POSITION pos = m_pl.GetPos();
- if(pos) {
+ if (pos) {
m_pl.GetAt(pos).m_fInvalid = !fValid;
- if(!fValid) {
+ if (!fValid) {
int i = FindItem(pos);
m_list.RedrawItems(i, i);
}
@@ -686,7 +686,7 @@ void CPlayerPlaylistBar::SetCurValid(bool fValid) void CPlayerPlaylistBar::SetCurTime(REFERENCE_TIME rt)
{
POSITION pos = m_pl.GetPos();
- if(pos) {
+ if (pos) {
CPlaylistItem& pli = m_pl.GetAt(pos);
pli.m_duration = rt;
m_list.SetItemText(FindItem(pos), COL_TIME, pli.GetLabel(1));
@@ -696,7 +696,7 @@ void CPlayerPlaylistBar::SetCurTime(REFERENCE_TIME rt) OpenMediaData* CPlayerPlaylistBar::GetCurOMD(REFERENCE_TIME rtStart)
{
CPlaylistItem* pli = GetCur();
- if(pli == NULL) {
+ if (pli == NULL) {
return NULL;
}
@@ -704,19 +704,19 @@ OpenMediaData* CPlayerPlaylistBar::GetCurOMD(REFERENCE_TIME rtStart) CString fn = CString(pli->m_fns.GetHead()).MakeLower();
- if(fn.Find(_T("video_ts.ifo")) >= 0
+ if (fn.Find(_T("video_ts.ifo")) >= 0
|| fn.Find(_T(".ratdvd")) >= 0) {
- if(OpenDVDData* p = DNew OpenDVDData()) {
+ if (OpenDVDData* p = DNew OpenDVDData()) {
p->path = pli->m_fns.GetHead();
p->subs.AddTailList(&pli->m_subs);
return p;
}
}
- if(pli->m_type == CPlaylistItem::device) {
- if(OpenDeviceData* p = DNew OpenDeviceData()) {
+ if (pli->m_type == CPlaylistItem::device) {
+ if (OpenDeviceData* p = DNew OpenDeviceData()) {
POSITION pos = pli->m_fns.GetHeadPosition();
- for(int i = 0; i < countof(p->DisplayName) && pos; i++) {
+ for (int i = 0; i < countof(p->DisplayName) && pos; i++) {
p->DisplayName[i] = pli->m_fns.GetNext(pos);
}
p->vinput = pli->m_vinput;
@@ -725,7 +725,7 @@ OpenMediaData* CPlayerPlaylistBar::GetCurOMD(REFERENCE_TIME rtStart) return p;
}
} else {
- if(OpenFileData* p = DNew OpenFileData()) {
+ if (OpenFileData* p = DNew OpenFileData()) {
p->fns.AddTailList(&pli->m_fns);
p->subs.AddTailList(&pli->m_subs);
p->rtStart = rtStart;
@@ -742,7 +742,7 @@ bool CPlayerPlaylistBar::SelectFileInPlaylist(LPCTSTR filename) return false;
}
POSITION pos = m_pl.GetHeadPosition();
- while(pos) {
+ while (pos) {
CPlaylistItem& pli = m_pl.GetAt(pos);
if (pli.FindFile(filename)) {
m_pl.SetPos(pos);
@@ -758,12 +758,12 @@ void CPlayerPlaylistBar::LoadPlaylist(LPCTSTR filename) {
CString base;
- if(AfxGetMyApp()->GetAppSavePath(base)) {
+ if (AfxGetMyApp()->GetAppSavePath(base)) {
CPath p;
p.Combine(base, _T("default.mpcpl"));
- if(p.FileExists()) {
- if(AfxGetAppSettings().bRememberPlaylistItems) {
+ if (p.FileExists()) {
+ if (AfxGetAppSettings().bRememberPlaylistItems) {
ParseMPCPlayList(p);
Refresh();
SelectFileInPlaylist(filename);
@@ -778,18 +778,18 @@ void CPlayerPlaylistBar::SavePlaylist() {
CString base;
- if(AfxGetMyApp()->GetAppSavePath(base)) {
+ if (AfxGetMyApp()->GetAppSavePath(base)) {
CPath p;
p.Combine(base, _T("default.mpcpl"));
- if(AfxGetAppSettings().bRememberPlaylistItems) {
+ if (AfxGetAppSettings().bRememberPlaylistItems) {
// Only create this folder when needed
- if(!::PathFileExists(base)) {
+ if (!::PathFileExists(base)) {
::CreateDirectory(base, NULL);
}
SaveMPCPlayList(p, CTextFile::UTF8, false);
- } else if(p.FileExists()) {
+ } else if (p.FileExists()) {
::DeleteFile(p);
}
}
@@ -818,7 +818,7 @@ END_MESSAGE_MAP() void CPlayerPlaylistBar::ResizeListColumn()
{
- if(::IsWindow(m_list.m_hWnd)) {
+ if (::IsWindow(m_list.m_hWnd)) {
CRect r;
GetClientRect(r);
r.DeflateRect(2, 2);
@@ -845,15 +845,15 @@ void CPlayerPlaylistBar::OnLvnKeyDown(NMHDR* pNMHDR, LRESULT* pResult) CList<int> items;
POSITION pos = m_list.GetFirstSelectedItemPosition();
- while(pos) {
+ while (pos) {
items.AddHead(m_list.GetNextSelectedItem(pos));
}
- if(pLVKeyDown->wVKey == VK_DELETE && items.GetCount() > 0) {
+ if (pLVKeyDown->wVKey == VK_DELETE && items.GetCount() > 0) {
pos = items.GetHeadPosition();
- while(pos) {
+ while (pos) {
int i = items.GetNext(pos);
- if(m_pl.RemoveAt(FindPos(i))) {
+ if (m_pl.RemoveAt(FindPos(i))) {
((CMainFrame*)AfxGetMainWnd())->CloseMedia();
}
m_list.DeleteItem(i);
@@ -867,7 +867,7 @@ void CPlayerPlaylistBar::OnLvnKeyDown(NMHDR* pNMHDR, LRESULT* pResult) ResizeListColumn();
*pResult = TRUE;
- } else if(pLVKeyDown->wVKey == VK_SPACE && items.GetCount() == 1) {
+ } else if (pLVKeyDown->wVKey == VK_SPACE && items.GetCount() == 1) {
m_pl.SetPos(FindPos(items.GetHead()));
((CMainFrame*)AfxGetMainWnd())->OpenCurPlaylistItem();
@@ -880,7 +880,7 @@ void CPlayerPlaylistBar::OnNMDblclkList(NMHDR* pNMHDR, LRESULT* pResult) {
LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)pNMHDR;
- if(lpnmlv->iItem >= 0 && lpnmlv->iSubItem >= 0) {
+ if (lpnmlv->iItem >= 0 && lpnmlv->iSubItem >= 0) {
AppSettings& s = AfxGetAppSettings();
FILE_POSITION* FilePosition = s.CurrentFilePosition();
if (FilePosition) {
@@ -901,11 +901,11 @@ void CPlayerPlaylistBar::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult) *pResult = CDRF_DODEFAULT;
- if(CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
+ if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
{
*pResult = CDRF_NOTIFYPOSTPAINT|CDRF_NOTIFYITEMDRAW;
}
- else if(CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
+ else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
{
pLVCD->nmcd.uItemState &= ~CDIS_SELECTED;
pLVCD->nmcd.uItemState &= ~CDIS_FOCUS;
@@ -915,11 +915,11 @@ void CPlayerPlaylistBar::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult) *pResult = CDRF_NOTIFYPOSTPAINT;
}
- else if(CDDS_ITEMPOSTPAINT == pLVCD->nmcd.dwDrawStage)
+ else if (CDDS_ITEMPOSTPAINT == pLVCD->nmcd.dwDrawStage)
{
int nItem = static_cast<int>(pLVCD->nmcd.dwItemSpec);
- if(m_list.GetItemState(pLVCD->nmcd.dwItemSpec, LVIS_SELECTED))
+ if (m_list.GetItemState(pLVCD->nmcd.dwItemSpec, LVIS_SELECTED))
{
CRect r, r2;
m_list.GetItemRect(nItem, &r, LVIR_BOUNDS);
@@ -930,7 +930,7 @@ void CPlayerPlaylistBar::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult) *pResult = CDRF_SKIPDEFAULT;
}
- else if(CDDS_POSTPAINT == pLVCD->nmcd.dwDrawStage)
+ else if (CDDS_POSTPAINT == pLVCD->nmcd.dwDrawStage)
{
}
}
@@ -938,7 +938,7 @@ void CPlayerPlaylistBar::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult) void CPlayerPlaylistBar::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
{
- if(nIDCtl != IDC_PLAYLIST) {
+ if (nIDCtl != IDC_PLAYLIST) {
return;
}
@@ -950,7 +950,7 @@ void CPlayerPlaylistBar::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruc CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
- if(!!m_list.GetItemState(nItem, LVIS_SELECTED)) {
+ if (!!m_list.GetItemState(nItem, LVIS_SELECTED)) {
FillRect(pDC->m_hDC, rcItem, CBrush(0xf1dacc));
FrameRect(pDC->m_hDC, rcItem, CBrush(0xc56a31));
} else {
@@ -958,16 +958,16 @@ void CPlayerPlaylistBar::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruc }
COLORREF textcolor = fSelected?0xff:0;
- if(pli.m_fInvalid) {
+ if (pli.m_fInvalid) {
textcolor |= 0xA0A0A0;
}
CString time = !pli.m_fInvalid ? m_list.GetItemText(nItem, COL_TIME) : _T("Invalid");
CSize timesize(0, 0);
CPoint timept(rcItem.right, 0);
- if(time.GetLength() > 0) {
+ if (time.GetLength() > 0) {
timesize = pDC->GetTextExtent(time);
- if((3+timesize.cx+3) < rcItem.Width()/2) {
+ if ((3+timesize.cx+3) < rcItem.Width()/2) {
timept = CPoint(rcItem.right-(3+timesize.cx+3), (rcItem.top+rcItem.bottom-timesize.cy)/2);
pDC->SetTextColor(textcolor);
@@ -979,12 +979,12 @@ void CPlayerPlaylistBar::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruc fmt.Format(_T("%%0%dd. %%s"), (int)log10(0.1+m_pl.GetCount())+1);
file.Format(fmt, nItem+1, m_list.GetItemText(nItem, COL_NAME));
CSize filesize = pDC->GetTextExtent(file);
- while(3+filesize.cx+6 > timept.x && file.GetLength() > 3) {
+ while (3+filesize.cx+6 > timept.x && file.GetLength() > 3) {
file = file.Left(file.GetLength()-4) + _T("...");
filesize = pDC->GetTextExtent(file);
}
- if(file.GetLength() > 3) {
+ if (file.GetLength() > 3) {
pDC->SetTextColor(textcolor);
pDC->TextOut(rcItem.left+3, (rcItem.top+rcItem.bottom-filesize.cy)/2, file);
}
@@ -1009,7 +1009,7 @@ void CPlayerPlaylistBar::OnDropFiles(HDROP hDropInfo) CAtlList<CString> sl;
UINT nFiles = ::DragQueryFile(hDropInfo, (UINT)-1, NULL, 0);
- for(UINT iFile = 0; iFile < nFiles; iFile++) {
+ for (UINT iFile = 0; iFile < nFiles; iFile++) {
TCHAR szFileName[_MAX_PATH];
::DragQueryFile(hDropInfo, iFile, szFileName, _MAX_PATH);
sl.AddTail(szFileName);
@@ -1041,7 +1041,7 @@ void CPlayerPlaylistBar::OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult) void CPlayerPlaylistBar::OnMouseMove(UINT nFlags, CPoint point)
{
- if(m_bDragging) {
+ if (m_bDragging) {
m_ptDropPoint = point;
ClientToScreen(&m_ptDropPoint);
@@ -1057,13 +1057,13 @@ void CPlayerPlaylistBar::OnMouseMove(UINT nFlags, CPoint point) int iTopItem = m_list.GetTopIndex();
int iBottomItem = m_list.GetBottomIndex();
- if(iOverItem == iTopItem && iTopItem != 0) { // top of list
+ if (iOverItem == iTopItem && iTopItem != 0) { // top of list
SetTimer(1, 100, NULL);
} else {
KillTimer(1);
}
- if(iOverItem >= iBottomItem && iBottomItem != (m_list.GetItemCount() - 1)) { // bottom of list
+ if (iOverItem >= iBottomItem && iBottomItem != (m_list.GetItemCount() - 1)) { // bottom of list
SetTimer(2, 100, NULL);
} else {
KillTimer(2);
@@ -1079,19 +1079,19 @@ void CPlayerPlaylistBar::OnTimer(UINT_PTR nIDEvent) int iTopItem = m_list.GetTopIndex();
int iBottomItem = iTopItem + m_list.GetCountPerPage() - 1;
- if(m_bDragging) {
+ if (m_bDragging) {
m_pDragImage->DragShowNolock(FALSE);
- if(nIDEvent == 1) {
+ if (nIDEvent == 1) {
m_list.EnsureVisible(iTopItem - 1, false);
m_list.UpdateWindow();
- if(m_list.GetTopIndex() == 0) {
+ if (m_list.GetTopIndex() == 0) {
KillTimer(1);
}
- } else if(nIDEvent == 2) {
+ } else if (nIDEvent == 2) {
m_list.EnsureVisible(iBottomItem + 1, false);
m_list.UpdateWindow();
- if(m_list.GetBottomIndex() == (m_list.GetItemCount() - 1)) {
+ if (m_list.GetBottomIndex() == (m_list.GetItemCount() - 1)) {
KillTimer(2);
}
}
@@ -1104,7 +1104,7 @@ void CPlayerPlaylistBar::OnTimer(UINT_PTR nIDEvent) void CPlayerPlaylistBar::OnLButtonUp(UINT nFlags, CPoint point)
{
- if(m_bDragging) {
+ if (m_bDragging) {
::ReleaseCapture();
m_bDragging = FALSE;
@@ -1120,7 +1120,7 @@ void CPlayerPlaylistBar::OnLButtonUp(UINT nFlags, CPoint point) CPoint pt(point);
ClientToScreen(&pt);
- if(WindowFromPoint(pt) == &m_list) {
+ if (WindowFromPoint(pt) == &m_list) {
DropItemOnList();
}
}
@@ -1145,7 +1145,7 @@ void CPlayerPlaylistBar::DropItemOnList() lvi.cchTextMax = _MAX_PATH;
m_list.GetItem(&lvi);
- if(m_nDropIndex < 0) {
+ if (m_nDropIndex < 0) {
m_nDropIndex = m_list.GetItemCount();
}
lvi.iItem = m_nDropIndex;
@@ -1156,10 +1156,10 @@ void CPlayerPlaylistBar::DropItemOnList() lvi.mask = LVIF_TEXT;
lvi.iItem = m_nDropIndex;
//INDEX OF DRAGGED ITEM WILL CHANGE IF ITEM IS DROPPED ABOVE ITSELF
- if(m_nDropIndex < m_nDragIndex) {
+ if (m_nDropIndex < m_nDragIndex) {
m_nDragIndex++;
}
- for(int col=1; col < nColumnCount; col++) {
+ for (int col=1; col < nColumnCount; col++) {
_tcscpy(lvi.pszText, (LPCTSTR)(m_list.GetItemText(m_nDragIndex, col)));
lvi.iSubItem = col;
m_list.SetItem(&lvi);
@@ -1169,20 +1169,20 @@ void CPlayerPlaylistBar::DropItemOnList() CList<CPlaylistItem> tmp;
UINT id = (UINT)-1;
- for(int i = 0; i < m_list.GetItemCount(); i++) {
+ for (int i = 0; i < m_list.GetItemCount(); i++) {
POSITION pos = (POSITION)m_list.GetItemData(i);
CPlaylistItem& pli = m_pl.GetAt(pos);
tmp.AddTail(pli);
- if(pos == m_pl.GetPos()) {
+ if (pos == m_pl.GetPos()) {
id = pli.m_id;
}
}
m_pl.RemoveAll();
POSITION pos = tmp.GetHeadPosition();
- for(int i = 0; pos; i++) {
+ for (int i = 0; pos; i++) {
CPlaylistItem& pli = tmp.GetNext(pos);
m_pl.AddTail(pli);
- if(pli.m_id == id) {
+ if (pli.m_id == id) {
m_pl.SetPos(m_pl.GetTailPosition());
}
m_list.SetItemData(i, (DWORD_PTR)m_pl.GetTailPosition());
@@ -1202,7 +1202,7 @@ BOOL CPlayerPlaylistBar::OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESULT* pResul int row = ((pNMHDR->idFrom-1) >> 10) & 0x3fffff;
int col = (pNMHDR->idFrom-1) & 0x3ff;
- if(row < 0 || row >= m_pl.GetCount()) {
+ if (row < 0 || row >= m_pl.GetCount()) {
return FALSE;
}
@@ -1210,37 +1210,37 @@ BOOL CPlayerPlaylistBar::OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESULT* pResul CString strTipText;
- if(col == COL_NAME) {
+ if (col == COL_NAME) {
POSITION pos = pli.m_fns.GetHeadPosition();
- while(pos) {
+ while (pos) {
strTipText += _T("\n") + pli.m_fns.GetNext(pos);
}
strTipText.Trim();
- if(pli.m_type == CPlaylistItem::device) {
+ if (pli.m_type == CPlaylistItem::device) {
CString str;
str.Format(_T("Video Input %d"), pli.m_vinput);
- if(pli.m_vinput >= 0) {
+ if (pli.m_vinput >= 0) {
strTipText += _T("\n") + str;
}
str.Format(_T("Video Channel %d"), pli.m_vchannel);
- if(pli.m_vchannel >= 0) {
+ if (pli.m_vchannel >= 0) {
strTipText += _T("\n") + str;
}
str.Format(_T("Audio Input %d"), pli.m_ainput);
- if(pli.m_ainput >= 0) {
+ if (pli.m_ainput >= 0) {
strTipText += _T("\n") + str;
}
}
::SendMessage(pNMHDR->hwndFrom, TTM_SETMAXTIPWIDTH, 0, (LPARAM)(INT)1000);
- } else if(col == COL_TIME) {
+ } else if (col == COL_TIME) {
return FALSE;
}
static CStringW m_strTipTextW;
- if(pNMHDR->code == TTN_NEEDTEXTW) { //?possible check is not needed
+ if (pNMHDR->code == TTN_NEEDTEXTW) { //?possible check is not needed
m_strTipTextW = strTipText;
pTTTW->lpszText = (LPWSTR)(LPCWSTR)m_strTipTextW;
}
@@ -1273,7 +1273,7 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p) AppSettings& s = AfxGetAppSettings();
m.AppendMenu(MF_STRING|(!fOnItem?(MF_DISABLED|MF_GRAYED):MF_ENABLED), M_OPEN, ResStr(IDS_PLAYLIST_OPEN));
- if(((CMainFrame*)AfxGetMainWnd())->GetPlaybackMode() == PM_CAPTURE) {
+ if (((CMainFrame*)AfxGetMainWnd())->GetPlaybackMode() == PM_CAPTURE) {
m.AppendMenu(MF_STRING|MF_ENABLED, M_ADD, ResStr(IDS_PLAYLIST_ADD));
}
m.AppendMenu(MF_STRING|(/*fSelected||*/!fOnItem?(MF_DISABLED|MF_GRAYED):MF_ENABLED), M_REMOVE, ResStr(IDS_PLAYLIST_REMOVE));
@@ -1296,7 +1296,7 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p) CMainFrame* pMainFrm = (CMainFrame*)AfxGetMainWnd();
int nID = (int)m.TrackPopupMenu(TPM_LEFTBUTTON|TPM_RETURNCMD, p.x, p.y, this);
- switch(nID) {
+ switch (nID) {
case M_OPEN:
m_pl.SetPos(pos);
m_list.Invalidate();
@@ -1307,15 +1307,16 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p) m_pl.SetPos(m_pl.GetTailPosition());
break;
case M_REMOVE:
- if(m_pl.RemoveAt(pos)) {
+ if (m_pl.RemoveAt(pos)) {
pMainFrm->CloseMedia();
}
m_list.DeleteItem(lvhti.iItem);
SavePlaylist();
break;
case M_CLEAR:
- if (Empty())
+ if (Empty()) {
pMainFrm->CloseMedia();
+ }
break;
case M_SORTBYID:
m_pl.SortById();
@@ -1338,18 +1339,18 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p) SavePlaylist();
break;
case M_CLIPBOARD:
- if(OpenClipboard() && EmptyClipboard()) {
+ if (OpenClipboard() && EmptyClipboard()) {
CString str;
CPlaylistItem& pli = m_pl.GetAt(pos);
POSITION pos = pli.m_fns.GetHeadPosition();
- while(pos) {
+ while (pos) {
str += _T("\r\n") + pli.m_fns.GetNext(pos);
}
str.Trim();
- if(HGLOBAL h = GlobalAlloc(GMEM_MOVEABLE, (str.GetLength()+1)*sizeof(TCHAR))) {
- if(TCHAR* s = (TCHAR*)GlobalLock(h)) {
+ if (HGLOBAL h = GlobalAlloc(GMEM_MOVEABLE, (str.GetLength()+1)*sizeof(TCHAR))) {
+ if (TCHAR* s = (TCHAR*)GlobalLock(h)) {
_tcscpy(s, str);
GlobalUnlock(h);
#ifdef UNICODE
@@ -1368,12 +1369,12 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p) _T("Media Player Classic playlist (*.mpcpl)|*.mpcpl|Playlist (*.pls)|*.pls|Winamp playlist (*.m3u)|*.m3u|Windows Media playlist (*.asx)|*.asx||"),
this);
- if(fd.DoModal() != IDOK) {
+ if (fd.DoModal() != IDOK) {
break;
}
CTextFile::enc encoding = (CTextFile::enc)fd.GetEncoding();
- if(encoding == CTextFile::ASCII) {
+ if (encoding == CTextFile::ASCII) {
encoding = CTextFile::ANSI;
}
@@ -1381,7 +1382,7 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p) CPath path(fd.GetPathName());
- switch(idx) {
+ switch (idx) {
case 1:
path.AddExtension(_T(".mpcpl"));
break;
@@ -1405,45 +1406,45 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p) CString base = (LPCTSTR)p;
pos = m_pl.GetHeadPosition();
- while(pos && fRemovePath) {
+ while (pos && fRemovePath) {
CPlaylistItem& pli = m_pl.GetNext(pos);
- if(pli.m_type != CPlaylistItem::file) {
+ if (pli.m_type != CPlaylistItem::file) {
fRemovePath = false;
} else {
POSITION pos;
pos = pli.m_fns.GetHeadPosition();
- while(pos && fRemovePath) {
+ while (pos && fRemovePath) {
CString fn = pli.m_fns.GetNext(pos);
CPath p(fn);
p.RemoveFileSpec();
- if(base != (LPCTSTR)p) {
+ if (base != (LPCTSTR)p) {
fRemovePath = false;
}
}
pos = pli.m_subs.GetHeadPosition();
- while(pos && fRemovePath) {
+ while (pos && fRemovePath) {
CString fn = pli.m_subs.GetNext(pos);
CPath p(fn);
p.RemoveFileSpec();
- if(base != (LPCTSTR)p) {
+ if (base != (LPCTSTR)p) {
fRemovePath = false;
}
}
}
}
- if(idx == 1) {
+ if (idx == 1) {
SaveMPCPlayList(path, encoding, fRemovePath);
break;
}
CTextFile f;
- if(!f.Save(path, encoding)) {
+ if (!f.Save(path, encoding)) {
break;
}
@@ -1456,17 +1457,17 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p) pos = m_pl.GetHeadPosition();
CString str;
int i;
- for(i = 0; pos; i++) {
+ for (i = 0; pos; i++) {
CPlaylistItem& pli = m_pl.GetNext(pos);
- if(pli.m_type != CPlaylistItem::file) {
+ if (pli.m_type != CPlaylistItem::file) {
continue;
}
CString fn = pli.m_fns.GetHead();
/*
- if(fRemovePath)
+ if (fRemovePath)
{
CPath p(path);
p.StripPath();
@@ -1474,7 +1475,7 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p) }
*/
- switch(idx) {
+ switch (idx) {
case 2:
str.Format(_T("File%d=%s\n"), i+1, fn);
break;
@@ -1517,7 +1518,7 @@ void CPlayerPlaylistBar::OnLvnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) {
NMLVDISPINFO* pDispInfo = reinterpret_cast<NMLVDISPINFO*>(pNMHDR);
- if(pDispInfo->item.iItem >= 0 && pDispInfo->item.pszText) {
+ if (pDispInfo->item.iItem >= 0 && pDispInfo->item.pszText) {
CPlaylistItem& pli = m_pl.GetAt((POSITION)m_list.GetItemData(pDispInfo->item.iItem));
pli.m_label = pDispInfo->item.pszText;
m_list.SetItemText(pDispInfo->item.iItem, 0, pDispInfo->item.pszText);
diff --git a/src/apps/mplayerc/PlayerSeekBar.cpp b/src/apps/mplayerc/PlayerSeekBar.cpp index 2a4693f9c..571a6d93f 100644 --- a/src/apps/mplayerc/PlayerSeekBar.cpp +++ b/src/apps/mplayerc/PlayerSeekBar.cpp @@ -43,7 +43,7 @@ CPlayerSeekBar::~CPlayerSeekBar() BOOL CPlayerSeekBar::Create(CWnd* pParentWnd)
{
- if(!CDialogBar::Create(pParentWnd, IDD_PLAYERSEEKBAR, WS_CHILD|WS_VISIBLE|CBRS_ALIGN_BOTTOM, IDD_PLAYERSEEKBAR)) {
+ if (!CDialogBar::Create(pParentWnd, IDD_PLAYERSEEKBAR, WS_CHILD|WS_VISIBLE|CBRS_ALIGN_BOTTOM, IDD_PLAYERSEEKBAR)) {
return FALSE;
}
@@ -52,7 +52,7 @@ BOOL CPlayerSeekBar::Create(CWnd* pParentWnd) BOOL CPlayerSeekBar::PreCreateWindow(CREATESTRUCT& cs)
{
- if(!CDialogBar::PreCreateWindow(cs)) {
+ if (!CDialogBar::PreCreateWindow(cs)) {
return FALSE;
}
@@ -77,12 +77,12 @@ void CPlayerSeekBar::GetRange(__int64& start, __int64& stop) void CPlayerSeekBar::SetRange(__int64 start, __int64 stop)
{
- if(start > stop) {
+ if (start > stop) {
start ^= stop, stop ^= start, start ^= stop;
}
m_start = start;
m_stop = stop;
- if(m_pos < m_start || m_pos >= m_stop) {
+ if (m_pos < m_start || m_pos >= m_stop) {
SetPos(m_start);
}
}
@@ -100,7 +100,7 @@ __int64 CPlayerSeekBar::GetPosReal() void CPlayerSeekBar::SetPos(__int64 pos)
{
CWnd* w = GetCapture();
- if(w && w->m_hWnd == m_hWnd) {
+ if (w && w->m_hWnd == m_hWnd) {
return;
}
@@ -109,7 +109,7 @@ void CPlayerSeekBar::SetPos(__int64 pos) void CPlayerSeekBar::SetPosInternal(__int64 pos)
{
- if(m_pos == pos) {
+ if (m_pos == pos) {
return;
}
@@ -118,11 +118,11 @@ void CPlayerSeekBar::SetPosInternal(__int64 pos) m_posreal = pos;
CRect after = GetThumbRect();
- if(before != after) {
+ if (before != after) {
InvalidateRect(before | after);
CMainFrame* pFrame = ((CMainFrame*)GetParentFrame());
- if((AfxGetAppSettings().fUseWin7TaskBar)&&(pFrame->m_pTaskbarList)) {
+ if ((AfxGetAppSettings().fUseWin7TaskBar)&&(pFrame->m_pTaskbarList)) {
pFrame->m_pTaskbarList->SetProgressValue ( pFrame->m_hWnd, pos, m_stop );
}
}
@@ -166,17 +166,17 @@ void CPlayerSeekBar::MoveThumb(CPoint point) {
CRect r = GetChannelRect();
- if(r.left >= r.right) {
+ if (r.left >= r.right) {
return;
}
- if(point.x < r.left) {
+ if (point.x < r.left) {
SetPos(m_start);
- } else if(point.x >= r.right) {
+ } else if (point.x >= r.right) {
SetPos(m_stop);
} else {
__int64 w = r.right - r.left;
- if(m_start < m_stop) {
+ if (m_start < m_stop) {
SetPosInternal(m_start + ((m_stop - m_start) * (point.x - r.left) + (w/2)) / w);
}
}
@@ -229,7 +229,7 @@ void CPlayerSeekBar::OnPaint() r.DeflateRect(1, 1, 0, 0);
dc.Draw3dRect(&r, shadow, bkg);
- if(fEnabled) {
+ if (fEnabled) {
r.DeflateRect(1, 1, 1, 2);
CPen white(PS_INSIDEFRAME, 1, white);
CPen* old = dc.SelectObject(&white);
@@ -285,13 +285,13 @@ void CPlayerSeekBar::OnSize(UINT nType, int cx, int cy) void CPlayerSeekBar::OnLButtonDown(UINT nFlags, CPoint point)
{
- if(m_fEnabled && (GetChannelRect() | GetThumbRect()).PtInRect(point)) {
+ if (m_fEnabled && (GetChannelRect() | GetThumbRect()).PtInRect(point)) {
SetCapture();
MoveThumb(point);
GetParent()->PostMessage(WM_HSCROLL, MAKEWPARAM((short)m_pos, SB_THUMBPOSITION), (LPARAM)m_hWnd);
} else {
CMainFrame* pFrame = ((CMainFrame*)GetParentFrame());
- if(!pFrame->m_fFullScreen) {
+ if (!pFrame->m_fFullScreen) {
MapWindowPoints(pFrame, &point, 1);
pFrame->PostMessage(WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(point.x, point.y));
}
@@ -310,7 +310,7 @@ void CPlayerSeekBar::OnLButtonUp(UINT nFlags, CPoint point) void CPlayerSeekBar::OnMouseMove(UINT nFlags, CPoint point)
{
CWnd* w = GetCapture();
- if(w && w->m_hWnd == m_hWnd && (nFlags & MK_LBUTTON)) {
+ if (w && w->m_hWnd == m_hWnd && (nFlags & MK_LBUTTON)) {
MoveThumb(point);
GetParent()->PostMessage(WM_HSCROLL, MAKEWPARAM((short)m_pos, SB_THUMBTRACK), (LPARAM)m_hWnd);
}
@@ -327,7 +327,7 @@ BOOL CPlayerSeekBar::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) {
bool fEnabled = m_fEnabled && m_start < m_stop;
- if(fEnabled) {
+ if (fEnabled) {
::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_HAND));
return TRUE;
}
diff --git a/src/apps/mplayerc/PlayerShaderEditorBar.cpp b/src/apps/mplayerc/PlayerShaderEditorBar.cpp index 79d2c397e..9e18e1cf8 100644 --- a/src/apps/mplayerc/PlayerShaderEditorBar.cpp +++ b/src/apps/mplayerc/PlayerShaderEditorBar.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -38,7 +38,7 @@ CPlayerShaderEditorBar::~CPlayerShaderEditorBar() BOOL CPlayerShaderEditorBar::Create(CWnd* pParentWnd)
{
- if(!__super::Create(_T("Shader Editor"), pParentWnd, ID_VIEW_SHADEREDITOR)) {
+ if (!__super::Create(_T("Shader Editor"), pParentWnd, ID_VIEW_SHADEREDITOR)) {
return FALSE;
}
@@ -57,13 +57,13 @@ BOOL CPlayerShaderEditorBar::Create(CWnd* pParentWnd) BOOL CPlayerShaderEditorBar::PreTranslateMessage(MSG* pMsg)
{
- if(IsWindow(pMsg->hwnd) && IsVisible() && pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST) {
- if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE) {
+ if (IsWindow(pMsg->hwnd) && IsVisible() && pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST) {
+ if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE) {
GetParentFrame()->ShowControlBar(this, FALSE, TRUE);
return TRUE;
}
- if(IsDialogMessage(pMsg)) {
+ if (IsDialogMessage(pMsg)) {
return TRUE;
}
}
@@ -81,7 +81,7 @@ void CPlayerShaderEditorBar::OnSize(UINT nType, int cx, int cy) {
__super::OnSize(nType, cx, cy);
- if(::IsWindow(m_dlg.m_hWnd)) {
+ if (::IsWindow(m_dlg.m_hWnd)) {
CRect r;
GetClientRect(r);
m_dlg.MoveWindow(r);
diff --git a/src/apps/mplayerc/PlayerStatusBar.cpp b/src/apps/mplayerc/PlayerStatusBar.cpp index fda6816c4..702c193c3 100644 --- a/src/apps/mplayerc/PlayerStatusBar.cpp +++ b/src/apps/mplayerc/PlayerStatusBar.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -42,7 +42,7 @@ CPlayerStatusBar::CPlayerStatusBar() CPlayerStatusBar::~CPlayerStatusBar()
{
- if(m_hIcon) {
+ if (m_hIcon) {
DestroyIcon(m_hIcon);
}
}
@@ -54,7 +54,7 @@ BOOL CPlayerStatusBar::Create(CWnd* pParentWnd) BOOL CPlayerStatusBar::PreCreateWindow(CREATESTRUCT& cs)
{
- if(!CDialogBar::PreCreateWindow(cs)) {
+ if (!CDialogBar::PreCreateWindow(cs)) {
return FALSE;
}
@@ -66,7 +66,7 @@ BOOL CPlayerStatusBar::PreCreateWindow(CREATESTRUCT& cs) int CPlayerStatusBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
- if(CDialogBar::OnCreate(lpCreateStruct) == -1) {
+ if (CDialogBar::OnCreate(lpCreateStruct) == -1) {
return -1;
}
@@ -93,7 +93,7 @@ void CPlayerStatusBar::Relayout() {
BITMAP bm;
memset(&bm, 0, sizeof(bm));
- if(m_bm.m_hObject) {
+ if (m_bm.m_hObject) {
m_bm.GetBitmap(&bm);
}
@@ -105,7 +105,7 @@ void CPlayerStatusBar::Relayout() CString str;
m_time.GetWindowText(str);
- if(CDC* pDC = m_time.GetDC()) {
+ if (CDC* pDC = m_time.GetDC()) {
CFont* pOld = pDC->SelectObject(&m_time.GetFont());
div = r.right - pDC->GetTextExtent(str).cx;
pDC->SelectObject(pOld);
@@ -139,14 +139,14 @@ void CPlayerStatusBar::Clear() void CPlayerStatusBar::SetStatusBitmap(UINT id)
{
- if(m_bmid == id) {
+ if (m_bmid == id) {
return;
}
- if(m_bm.m_hObject) {
+ if (m_bm.m_hObject) {
m_bm.DeleteObject();
}
- if(id) {
+ if (id) {
m_bm.LoadBitmap(id);
}
m_bmid = id;
@@ -156,11 +156,11 @@ void CPlayerStatusBar::SetStatusBitmap(UINT id) void CPlayerStatusBar::SetStatusTypeIcon(HICON hIcon)
{
- if(m_hIcon == hIcon) {
+ if (m_hIcon == hIcon) {
return;
}
- if(m_hIcon) {
+ if (m_hIcon) {
DestroyIcon(m_hIcon);
}
m_type.SetIcon(m_hIcon = hIcon);
@@ -187,7 +187,7 @@ void CPlayerStatusBar::SetStatusTimer(CString str) {
CString tmp;
m_time.GetWindowText(tmp);
- if(tmp == str) {
+ if (tmp == str) {
return;
}
@@ -205,30 +205,30 @@ void CPlayerStatusBar::SetStatusTimer(REFERENCE_TIME rtNow, REFERENCE_TIME rtDur CString str;
CString posstr, durstr;
- if(*pTimeFormat == TIME_FORMAT_MEDIA_TIME) {
+ if (*pTimeFormat == TIME_FORMAT_MEDIA_TIME) {
DVD_HMSF_TIMECODE tcNow = RT2HMSF(rtNow);
DVD_HMSF_TIMECODE tcDur = RT2HMSF(rtDur);
- if(tcDur.bHours > 0 || (rtNow >= rtDur && tcNow.bHours > 0)) {
+ if (tcDur.bHours > 0 || (rtNow >= rtDur && tcNow.bHours > 0)) {
posstr.Format(_T("%02d:%02d:%02d"), tcNow.bHours, tcNow.bMinutes, tcNow.bSeconds);
} else {
posstr.Format(_T("%02d:%02d"), tcNow.bMinutes, tcNow.bSeconds);
}
- if(tcDur.bHours > 0) {
+ if (tcDur.bHours > 0) {
durstr.Format(_T("%02d:%02d:%02d"), tcDur.bHours, tcDur.bMinutes, tcDur.bSeconds);
} else {
durstr.Format(_T("%02d:%02d"), tcDur.bMinutes, tcDur.bSeconds);
}
- if(fHighPrecision) {
+ if (fHighPrecision) {
str.Format(_T("%s.%03d"), posstr, (rtNow/10000)%1000);
posstr = str;
str.Format(_T("%s.%03d"), durstr, (rtDur/10000)%1000);
durstr = str;
str.Empty();
}
- } else if(*pTimeFormat == TIME_FORMAT_FRAME) {
+ } else if (*pTimeFormat == TIME_FORMAT_FRAME) {
posstr.Format(_T("%I64d"), rtNow);
durstr.Format(_T("%I64d"), rtDur);
}
@@ -261,8 +261,8 @@ END_MESSAGE_MAP() BOOL CPlayerStatusBar::OnEraseBkgnd(CDC* pDC)
{
- for(CWnd* pChild = GetWindow(GW_CHILD); pChild; pChild = pChild->GetNextWindow()) {
- if(!pChild->IsWindowVisible()) {
+ for (CWnd* pChild = GetWindow(GW_CHILD); pChild; pChild = pChild->GetNextWindow()) {
+ if (!pChild->IsWindowVisible()) {
continue;
}
@@ -277,11 +277,11 @@ BOOL CPlayerStatusBar::OnEraseBkgnd(CDC* pDC) CMainFrame* pFrame = ((CMainFrame*)GetParentFrame());
- if(pFrame->m_pLastBar != this || pFrame->m_fFullScreen) {
+ if (pFrame->m_pLastBar != this || pFrame->m_fFullScreen) {
r.InflateRect(0, 0, 0, 1);
}
- if(pFrame->m_fFullScreen) {
+ if (pFrame->m_fFullScreen) {
r.InflateRect(1, 0, 1, 0);
}
@@ -300,7 +300,7 @@ void CPlayerStatusBar::OnPaint() CRect r;
- if(m_bm.m_hObject) {
+ if (m_bm.m_hObject) {
BITMAP bm;
m_bm.GetBitmap(&bm);
CDC memdc;
@@ -312,7 +312,7 @@ void CPlayerStatusBar::OnPaint() //
}
/*
- if(m_hIcon)
+ if (m_hIcon)
{
GetClientRect(&r);
r.SetRect(6, r.top+4, 22-1, r.bottom-4-1);
@@ -337,7 +337,7 @@ void CPlayerStatusBar::OnLButtonDown(UINT nFlags, CPoint point) wp.length = sizeof(wp);
pFrame->GetWindowPlacement(&wp);
- if(!pFrame->m_fFullScreen && wp.showCmd != SW_SHOWMAXIMIZED) {
+ if (!pFrame->m_fFullScreen && wp.showCmd != SW_SHOWMAXIMIZED) {
CRect r;
GetClientRect(r);
CPoint p = point;
@@ -359,14 +359,14 @@ BOOL CPlayerStatusBar::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) wp.length = sizeof(wp);
pFrame->GetWindowPlacement(&wp);
- if(!pFrame->m_fFullScreen && wp.showCmd != SW_SHOWMAXIMIZED) {
+ if (!pFrame->m_fFullScreen && wp.showCmd != SW_SHOWMAXIMIZED) {
CRect r;
GetClientRect(r);
CPoint p;
GetCursorPos(&p);
ScreenToClient(&p);
- // if(p.x+p.y >= r.Width())
- if(p.x >= r.Width()-r.Height() && !pFrame->IsCaptionHidden()) {
+ // if (p.x+p.y >= r.Width())
+ if (p.x >= r.Width()-r.Height() && !pFrame->IsCaptionHidden()) {
SetCursor(LoadCursor(NULL, IDC_SIZENWSE));
return TRUE;
}
@@ -379,7 +379,7 @@ HBRUSH CPlayerStatusBar::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) {
HBRUSH hbr = CDialogBar::OnCtlColor(pDC, pWnd, nCtlColor);
- if(*pWnd == m_type) {
+ if (*pWnd == m_type) {
hbr = GetStockBrush(BLACK_BRUSH);
}
diff --git a/src/apps/mplayerc/PlayerSubresyncBar.cpp b/src/apps/mplayerc/PlayerSubresyncBar.cpp index 77d3ee306..57d88282f 100644 --- a/src/apps/mplayerc/PlayerSubresyncBar.cpp +++ b/src/apps/mplayerc/PlayerSubresyncBar.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -43,7 +43,7 @@ CPlayerSubresyncBar::~CPlayerSubresyncBar() BOOL CPlayerSubresyncBar::Create(CWnd* pParentWnd, CCritSec* pSubLock)
{
- if(!CSizingControlBarG::Create(_T("Subresync"), pParentWnd, ID_VIEW_SUBRESYNC)) {
+ if (!CSizingControlBarG::Create(_T("Subresync"), pParentWnd, ID_VIEW_SUBRESYNC)) {
return FALSE;
}
@@ -61,7 +61,7 @@ BOOL CPlayerSubresyncBar::Create(CWnd* pParentWnd, CCritSec* pSubLock) BOOL CPlayerSubresyncBar::PreCreateWindow(CREATESTRUCT& cs)
{
- if(!CSizingControlBarG::PreCreateWindow(cs)) {
+ if (!CSizingControlBarG::PreCreateWindow(cs)) {
return FALSE;
}
@@ -70,13 +70,13 @@ BOOL CPlayerSubresyncBar::PreCreateWindow(CREATESTRUCT& cs) BOOL CPlayerSubresyncBar::PreTranslateMessage(MSG* pMsg)
{
- if(IsWindow(pMsg->hwnd) && IsVisible() && pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST) {
- if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE) {
+ if (IsWindow(pMsg->hwnd) && IsVisible() && pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST) {
+ if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE) {
GetParentFrame()->ShowControlBar(this, FALSE, TRUE);
return TRUE;
}
- if(IsShortCut(pMsg) || IsDialogMessage(pMsg)) {
+ if (IsShortCut(pMsg) || IsDialogMessage(pMsg)) {
return TRUE;
}
}
@@ -90,11 +90,11 @@ void CPlayerSubresyncBar::SetTime(__int64 rt) int curSegment;
- if(!m_sts.SearchSubs((int)(rt/10000), 25, &curSegment)) {
+ if (!m_sts.SearchSubs((int)(rt/10000), 25, &curSegment)) {
curSegment = -1;
}
- if(m_lastSegment != curSegment) {
+ if (m_lastSegment != curSegment) {
m_list.Invalidate();
}
m_lastSegment = curSegment;
@@ -110,14 +110,14 @@ void CPlayerSubresyncBar::SetSubtitle(ISubStream* pSubStream, double fps) ResetSubtitle();
- if(!m_pSubStream) {
+ if (!m_pSubStream) {
return;
}
CLSID clsid;
m_pSubStream->GetClassID(&clsid);
- if(clsid == __uuidof(CVobSubFile)) {
+ if (clsid == __uuidof(CVobSubFile)) {
CVobSubFile* pVSF = (CVobSubFile*)(ISubStream*)m_pSubStream;
m_mode = VOBSUB;
@@ -125,7 +125,7 @@ void CPlayerSubresyncBar::SetSubtitle(ISubStream* pSubStream, double fps) _ASSERT(pVSF->m_iLang >= 0);
CAtlArray<CVobSubFile::SubPos>& sp = pVSF->m_langs[pVSF->m_iLang].subpos;
- for(int i = 0, j = sp.GetCount(); i < j; i++) {
+ for (int i = 0, j = sp.GetCount(); i < j; i++) {
CString str;
str.Format(_T("%d,%d,%d,%d"), sp[i].vobid, sp[i].cellid, sp[i].fForced, i);
m_sts.Add(TToW(str), false, (int)sp[i].start, (int)sp[i].stop);
@@ -135,7 +135,7 @@ void CPlayerSubresyncBar::SetSubtitle(ISubStream* pSubStream, double fps) pVSF->m_fOnlyShowForcedSubs = false;
- for(int i = 0, j = m_list.GetHeaderCtrl()->GetItemCount(); i < j; i++) {
+ for (int i = 0, j = m_list.GetHeaderCtrl()->GetItemCount(); i < j; i++) {
m_list.DeleteColumn(0);
}
m_list.InsertColumn(COL_START, _T("Time"), LVCFMT_LEFT, 80);
@@ -145,7 +145,7 @@ void CPlayerSubresyncBar::SetSubtitle(ISubStream* pSubStream, double fps) m_list.InsertColumn(COL_VOBID, _T("Vob ID"), LVCFMT_CENTER, 60);
m_list.InsertColumn(COL_CELLID, _T("Cell ID"), LVCFMT_CENTER, 60);
m_list.InsertColumn(COL_FORCED, _T("Forced"), LVCFMT_CENTER, 60);
- } else if(clsid == __uuidof(CRenderedTextSubtitle)) {
+ } else if (clsid == __uuidof(CRenderedTextSubtitle)) {
CRenderedTextSubtitle* pRTS = (CRenderedTextSubtitle*)(ISubStream*)m_pSubStream;
m_mode = TEXTSUB;
@@ -155,7 +155,7 @@ void CPlayerSubresyncBar::SetSubtitle(ISubStream* pSubStream, double fps) m_sts.Sort(true); /*!!m_fUnlink*/
#ifndef UNICODE
- if(!m_sts.IsEntryUnicode(0)) {
+ if (!m_sts.IsEntryUnicode(0)) {
CFont* f = m_list.GetFont();
LOGFONT lf;
f->GetLogFont(&lf);
@@ -165,7 +165,7 @@ void CPlayerSubresyncBar::SetSubtitle(ISubStream* pSubStream, double fps) m_list.SetFont(&m_font);
}
#endif
- for(int i = 0, j = m_list.GetHeaderCtrl()->GetItemCount(); i < j; i++) {
+ for (int i = 0, j = m_list.GetHeaderCtrl()->GetItemCount(); i < j; i++) {
m_list.DeleteColumn(0);
}
m_list.InsertColumn(COL_START, _T("Time"), LVCFMT_LEFT, 90);
@@ -184,7 +184,7 @@ void CPlayerSubresyncBar::SetSubtitle(ISubStream* pSubStream, double fps) m_subtimes.SetCount(m_sts.GetCount());
- for(int i = 0, j = m_sts.GetCount(); i < j; i++) {
+ for (int i = 0, j = m_sts.GetCount(); i < j; i++) {
m_subtimes[i].orgstart = m_sts[i].start;
m_subtimes[i].orgend = m_sts[i].end;
}
@@ -196,12 +196,12 @@ void CPlayerSubresyncBar::ResetSubtitle() {
m_list.DeleteAllItems();
- if(m_mode == VOBSUB || m_mode == TEXTSUB) {
+ if (m_mode == VOBSUB || m_mode == TEXTSUB) {
TCHAR buff[32];
int prevstart = INT_MIN;
- for(int i = 0, j = m_sts.GetCount(); i < j; i++) {
+ for (int i = 0, j = m_sts.GetCount(); i < j; i++) {
m_subtimes[i].newstart = m_subtimes[i].orgstart;
m_subtimes[i].newend = m_subtimes[i].orgend;
FormatTime(i, buff, 0, false);
@@ -209,7 +209,7 @@ void CPlayerSubresyncBar::ResetSubtitle() FormatTime(i, buff, 0, true);
m_list.SetItemText(i, COL_END, buff);
- if(prevstart > m_subtimes[i].orgstart) {
+ if (prevstart > m_subtimes[i].orgstart) {
m_list.SetItemData(i, (DWORD_PTR)TSEP);
}
prevstart = m_subtimes[i].orgstart;
@@ -229,14 +229,14 @@ void CPlayerSubresyncBar::ResetSubtitle() void CPlayerSubresyncBar::SaveSubtitle()
{
CMainFrame* pFrame = ((CMainFrame*)AfxGetMainWnd());
- if(!pFrame) {
+ if (!pFrame) {
return;
}
CLSID clsid;
m_pSubStream->GetClassID(&clsid);
- if(clsid == __uuidof(CVobSubFile) && m_mode == VOBSUB) {
+ if (clsid == __uuidof(CVobSubFile) && m_mode == VOBSUB) {
CVobSubFile* pVSF = (CVobSubFile*)(ISubStream*)m_pSubStream;
CAutoLock cAutoLock(m_pSubLock);
@@ -244,20 +244,20 @@ void CPlayerSubresyncBar::SaveSubtitle() _ASSERT(pVSF->m_iLang >= 0);
CAtlArray<CVobSubFile::SubPos>& sp = pVSF->m_langs[pVSF->m_iLang].subpos;
- for(int i = 0, j = sp.GetCount(); i < j; i++) {
+ for (int i = 0, j = sp.GetCount(); i < j; i++) {
sp[i].fValid = false;
}
- for(int i = 0, j = m_sts.GetCount(); i < j; i++) {
+ for (int i = 0, j = m_sts.GetCount(); i < j; i++) {
int vobid, cellid, forced, spnum, c;
- if(_stscanf(m_sts.GetStr(i), _T("%d%c%d%c%d%c%d"), &vobid, &c, &cellid, &c, &forced, &c, &spnum) != 7) {
+ if (_stscanf(m_sts.GetStr(i), _T("%d%c%d%c%d%c%d"), &vobid, &c, &cellid, &c, &forced, &c, &spnum) != 7) {
continue;
}
sp[spnum].start = m_sts[i].start;
sp[spnum].stop = m_sts[i].end;
sp[spnum].fValid = true;
}
- } else if(clsid == __uuidof(CRenderedTextSubtitle) && m_mode == TEXTSUB) {
+ } else if (clsid == __uuidof(CRenderedTextSubtitle) && m_mode == TEXTSUB) {
CRenderedTextSubtitle* pRTS = (CRenderedTextSubtitle*)(ISubStream*)m_pSubStream;
CAutoLock cAutoLock(m_pSubLock);
@@ -272,9 +272,9 @@ void CPlayerSubresyncBar::SaveSubtitle() void CPlayerSubresyncBar::UpdatePreview()
{
- if(m_mode == VOBSUB || m_mode == TEXTSUB) {
- if(0/*m_fUnlink*/) {
- for(int i = 0, j = m_sts.GetCount(); i < j; i++) {
+ if (m_mode == VOBSUB || m_mode == TEXTSUB) {
+ if (0/*m_fUnlink*/) {
+ for (int i = 0, j = m_sts.GetCount(); i < j; i++) {
bool fStartMod, fEndMod, fStartAdj, fEndAdj;
GetCheck(i, fStartMod, fEndMod, fStartAdj, fEndAdj);
m_sts[i].start = (fStartMod||fStartAdj) ? m_subtimes[i].newstart : m_subtimes[i].orgstart;
@@ -283,36 +283,36 @@ void CPlayerSubresyncBar::UpdatePreview() } else {
CAtlArray<int> schk;
- for(int i = 0, j = m_sts.GetCount(); i < j;) {
+ for (int i = 0, j = m_sts.GetCount(); i < j;) {
schk.RemoveAll();
int start = i, end;
- for(end = i; end < j; end++) {
+ for (end = i; end < j; end++) {
int data = (int)m_list.GetItemData(end);
- if((data&TSEP) && end > i) {
+ if ((data&TSEP) && end > i) {
break;
}
- if(data&(TSMOD|TSADJ)) {
+ if (data&(TSMOD|TSADJ)) {
schk.Add(end);
}
}
- if(schk.GetCount() == 0) {
- for(; start < end; start++) {
+ if (schk.GetCount() == 0) {
+ for (; start < end; start++) {
m_sts[start].start = m_subtimes[start].orgstart;
m_sts[start].end = m_subtimes[start].orgend;
}
- } else if(schk.GetCount() == 1) {
+ } else if (schk.GetCount() == 1) {
int k = schk[0];
int dt = m_subtimes[k].newstart - m_subtimes[k].orgstart;
- for(; start < end; start++) {
+ for (; start < end; start++) {
m_sts[start].start = m_subtimes[start].orgstart + dt;
m_sts[start].end = (m_list.GetItemData(start)&TEMOD)
? m_subtimes[start].newend
: (m_subtimes[start].orgend + dt);
}
- } else if(schk.GetCount() >= 2) {
+ } else if (schk.GetCount() >= 2) {
int i0 = 0;
int i1 = 0;
int ti0 = 0;
@@ -320,7 +320,7 @@ void CPlayerSubresyncBar::UpdatePreview() double m = 0;
int k, l;
- for(k = 0, l = schk.GetCount()-1; k < l; k++) {
+ for (k = 0, l = schk.GetCount()-1; k < l; k++) {
i0 = schk[k];
i1 = schk[k+1];
@@ -350,7 +350,7 @@ void CPlayerSubresyncBar::UpdatePreview() m_sts.CreateSegments();
- for(int i = 0, j = m_sts.GetCount(); i < j; i++) {
+ for (int i = 0, j = m_sts.GetCount(); i < j; i++) {
TCHAR buff[32];
FormatTime(i, buff, 2, false);
m_list.SetItemText(i, COL_PREVSTART, buff);
@@ -358,7 +358,7 @@ void CPlayerSubresyncBar::UpdatePreview() m_list.SetItemText(i, COL_PREVEND, buff);
}
- if(IsWindowVisible()) {
+ if (IsWindowVisible()) {
SaveSubtitle();
}
}
@@ -366,7 +366,7 @@ void CPlayerSubresyncBar::UpdatePreview() void CPlayerSubresyncBar::SetSTS0( int &start, int end, int ti0 )
{
- for(; start < end; start++) {
+ for (; start < end; start++) {
m_sts[start].start = ti0;
int endpos;
if (m_list.GetItemData(start)&TEMOD) {
@@ -380,7 +380,7 @@ void CPlayerSubresyncBar::SetSTS0( int &start, int end, int ti0 ) void CPlayerSubresyncBar::SetSTS1( int &start, int end, int ti0, double m, int i0 )
{
- for(; start < end; start++) {
+ for (; start < end; start++) {
m_sts[start].start = int((m_subtimes[start].orgstart - ti0)*m + m_subtimes[i0].newstart);
int endpos;
if (m_list.GetItemData(start)&TEMOD) {
@@ -401,8 +401,8 @@ void CPlayerSubresyncBar::UpdateStrings() {
CString str;
- if(m_mode == TEXTSUB) {
- for(int i = 0, j = m_sts.GetCount(); i < j; i++) {
+ if (m_mode == TEXTSUB) {
+ for (int i = 0, j = m_sts.GetCount(); i < j; i++) {
STSStyle stss;
m_sts.GetStyle(i, stss);
@@ -417,19 +417,19 @@ void CPlayerSubresyncBar::UpdateStrings() m_list.SetItemText(i, COL_ACTOR, m_sts[i].actor);
m_list.SetItemText(i, COL_EFFECT, m_sts[i].effect);
}
- } else if(m_mode == VOBSUB) {
- for(int i = 0, j = m_sts.GetCount(); i < j; i++) {
+ } else if (m_mode == VOBSUB) {
+ for (int i = 0, j = m_sts.GetCount(); i < j; i++) {
int vobid, cellid, forced, c;
- if(_stscanf(m_sts.GetStr(i), _T("%d%c%d%c%d"), &vobid, &c, &cellid, &c, &forced) != 5) {
+ if (_stscanf(m_sts.GetStr(i), _T("%d%c%d%c%d"), &vobid, &c, &cellid, &c, &forced) != 5) {
continue;
}
- if(vobid < 0) {
+ if (vobid < 0) {
str = _T("-");
} else {
str.Format(_T("%d"), vobid);
}
m_list.SetItemText(i, COL_VOBID, str);
- if(cellid < 0) {
+ if (cellid < 0) {
str = _T("-");
} else {
str.Format(_T("%d"), cellid);
@@ -443,7 +443,7 @@ void CPlayerSubresyncBar::UpdateStrings() void CPlayerSubresyncBar::GetCheck(int iItem, bool& fStartMod, bool& fEndMod, bool& fStartAdj, bool& fEndAdj)
{
- if(0 <= iItem && iItem < m_sts.GetCount()) {
+ if (0 <= iItem && iItem < m_sts.GetCount()) {
int nCheck = (int)m_list.GetItemData(iItem);
fStartMod = !!(nCheck&TSMOD);
fEndMod = !!(nCheck&TEMOD);
@@ -454,19 +454,19 @@ void CPlayerSubresyncBar::GetCheck(int iItem, bool& fStartMod, bool& fEndMod, bo void CPlayerSubresyncBar::SetCheck(int iItem, bool fStart, bool fEnd)
{
- if(0 <= iItem && iItem < m_sts.GetCount()) {
+ if (0 <= iItem && iItem < m_sts.GetCount()) {
SubTime& st = m_subtimes[iItem];
int nCheck = (int)m_list.GetItemData(iItem) & TSEP;
- if(fStart) {
+ if (fStart) {
nCheck |= TSMOD;
- } else if(abs(st.orgstart-st.newstart)) {
+ } else if (abs(st.orgstart-st.newstart)) {
nCheck |= TSADJ;
}
- if(fEnd) {
+ if (fEnd) {
nCheck |= TEMOD;
- } else if(abs(st.orgend-st.newend)) {
+ } else if (abs(st.orgend-st.newend)) {
nCheck |= TEADJ;
}
@@ -489,14 +489,14 @@ bool CPlayerSubresyncBar::ModStart(int iItem, int t, bool fReset) SubTime& st = m_subtimes[iItem];
- // if(fStartMod || fStartAdj || st.orgstart != t || fReset)
+ // if (fStartMod || fStartAdj || st.orgstart != t || fReset)
{
fRet = (st.newstart != t);
st.newstart = t;
- if(!fEndMod) {
+ if (!fEndMod) {
st.newend = st.newstart + (st.orgend - st.orgstart);
- } else if(fReset) {
+ } else if (fReset) {
st.newstart = st.newend - (st.orgend - st.orgstart);
}
@@ -515,14 +515,14 @@ bool CPlayerSubresyncBar::ModEnd(int iItem, int t, bool fReset) SubTime& st = m_subtimes[iItem];
- // if(fEndMod || fEndAdj || st.orgend != t || fReset)
+ // if (fEndMod || fEndAdj || st.orgend != t || fReset)
{
fRet = (st.newend != t);
st.newend = t;
- if(!fStartMod) {
+ if (!fStartMod) {
st.newstart = st.newend - (st.orgend - st.orgstart);
- } else if(fReset) {
+ } else if (fReset) {
st.newend = st.newstart + (st.orgend - st.orgstart);
}
@@ -570,7 +570,7 @@ void CPlayerSubresyncBar::OnSize(UINT nType, int cx, int cy) {
CSizingControlBarG::OnSize(nType, cx, cy);
- if(::IsWindow(m_list.m_hWnd)) {
+ if (::IsWindow(m_list.m_hWnd)) {
CRect r;
GetClientRect(r);
r.DeflateRect(2, 2);
@@ -584,7 +584,7 @@ static bool ParseTime(CString str, int& ret, bool fWarn = true) TCHAR c;
str.Trim();
- if(str.GetLength() > 0 && str[0] == '-') {
+ if (str.GetLength() > 0 && str[0] == '-') {
sign = -1;
}
@@ -592,7 +592,7 @@ static bool ParseTime(CString str, int& ret, bool fWarn = true) h = abs(h);
- if(n == 7
+ if (n == 7
&& 0 <= h && h < 24
&& 0 <= m && m < 60
&& 0 <= s && s < 60
@@ -601,7 +601,7 @@ static bool ParseTime(CString str, int& ret, bool fWarn = true) return(true);
}
- if(fWarn) {
+ if (fWarn) {
AfxMessageBox(_T("The correct time format is [-]hh:mm:ss.ms\n(e.g. 01:23:45.678)"));
}
return(false);
@@ -614,13 +614,13 @@ void CPlayerSubresyncBar::OnBeginlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) *pResult = FALSE;
- if(pItem->iItem >= 0) {
- if((pItem->iSubItem == COL_START || pItem->iSubItem == COL_END || pItem->iSubItem == COL_TEXT
+ if (pItem->iItem >= 0) {
+ if ((pItem->iSubItem == COL_START || pItem->iSubItem == COL_END || pItem->iSubItem == COL_TEXT
|| pItem->iSubItem == COL_STYLE || pItem->iSubItem == COL_LAYER
|| pItem->iSubItem == COL_ACTOR || pItem->iSubItem == COL_EFFECT)
&& m_mode == TEXTSUB) {
*pResult = TRUE;
- } else if((pItem->iSubItem == COL_START)
+ } else if ((pItem->iSubItem == COL_START)
&& m_mode == VOBSUB) {
*pResult = TRUE;
}
@@ -634,14 +634,14 @@ void CPlayerSubresyncBar::OnDolabeleditList(NMHDR* pNMHDR, LRESULT* pResult) *pResult = FALSE;
- if(pItem->iItem >= 0) {
- if((pItem->iSubItem == COL_START || pItem->iSubItem == COL_END || pItem->iSubItem == COL_TEXT
+ if (pItem->iItem >= 0) {
+ if ((pItem->iSubItem == COL_START || pItem->iSubItem == COL_END || pItem->iSubItem == COL_TEXT
|| pItem->iSubItem == COL_STYLE || pItem->iSubItem == COL_LAYER
|| pItem->iSubItem == COL_ACTOR || pItem->iSubItem == COL_EFFECT)
&& m_mode == TEXTSUB) {
m_list.ShowInPlaceEdit(pItem->iItem, pItem->iSubItem);
*pResult = TRUE;
- } else if((pItem->iSubItem == COL_START)
+ } else if ((pItem->iSubItem == COL_START)
&& m_mode == VOBSUB) {
m_list.ShowInPlaceEdit(pItem->iItem, pItem->iSubItem);
*pResult = TRUE;
@@ -656,17 +656,17 @@ void CPlayerSubresyncBar::OnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) *pResult = FALSE;
- if(!m_list.m_fInPlaceDirty) {
+ if (!m_list.m_fInPlaceDirty) {
return;
}
bool fNeedsUpdate = false;
- if(pItem->iItem >= 0 && pItem->pszText && (m_mode == VOBSUB || m_mode == TEXTSUB)) {
- switch(pItem->iSubItem) {
+ if (pItem->iItem >= 0 && pItem->pszText && (m_mode == VOBSUB || m_mode == TEXTSUB)) {
+ switch (pItem->iSubItem) {
case COL_START: {
int t;
- if(ParseTime(pItem->pszText, t)) {
+ if (ParseTime(pItem->pszText, t)) {
fNeedsUpdate = ModStart(pItem->iItem, t);
*pResult = TRUE;
@@ -674,9 +674,9 @@ void CPlayerSubresyncBar::OnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) }
break;
case COL_END:
- if(m_mode == TEXTSUB) {
+ if (m_mode == TEXTSUB) {
int t;
- if(ParseTime(pItem->pszText, t)) {
+ if (ParseTime(pItem->pszText, t)) {
fNeedsUpdate = ModEnd(pItem->iItem, t);
*pResult = TRUE;
@@ -684,10 +684,10 @@ void CPlayerSubresyncBar::OnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) }
break;
case COL_TEXT:
- if(m_mode == TEXTSUB) {
+ if (m_mode == TEXTSUB) {
CString str = m_sts.GetStr(pItem->iItem, true);
- if(str != pItem->pszText) {
+ if (str != pItem->pszText) {
fNeedsUpdate = true;
m_sts.SetStr(pItem->iItem, CString(pItem->pszText), true);
m_list.SetItemText(pItem->iItem, pItem->iSubItem, m_sts.GetStr(pItem->iItem, true));
@@ -695,14 +695,14 @@ void CPlayerSubresyncBar::OnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) }
break;
case COL_STYLE:
- if(m_mode == TEXTSUB) {
+ if (m_mode == TEXTSUB) {
CString str(pItem->pszText);
str.Trim();
- if(!str.IsEmpty() && m_sts[pItem->iItem].style != str) {
+ if (!str.IsEmpty() && m_sts[pItem->iItem].style != str) {
fNeedsUpdate = true;
- if(!m_sts.m_styles.Lookup(str)) {
+ if (!m_sts.m_styles.Lookup(str)) {
m_sts.AddStyle(str, DNew STSStyle());
}
@@ -713,9 +713,9 @@ void CPlayerSubresyncBar::OnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) }
break;
case COL_LAYER:
- if(m_mode == TEXTSUB) {
+ if (m_mode == TEXTSUB) {
int l;
- if(_stscanf_s(pItem->pszText, _T("%d"), &l) == 1) {
+ if (_stscanf_s(pItem->pszText, _T("%d"), &l) == 1) {
fNeedsUpdate = true;
m_sts[pItem->iItem].layer = l;
CString str;
@@ -725,10 +725,10 @@ void CPlayerSubresyncBar::OnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) }
break;
case COL_ACTOR:
- if(m_mode == TEXTSUB) {
+ if (m_mode == TEXTSUB) {
CString str(pItem->pszText);
str.Trim();
- if(!str.IsEmpty()) {
+ if (!str.IsEmpty()) {
fNeedsUpdate = true;
m_sts[pItem->iItem].actor = str;
m_list.SetItemText(pItem->iItem, pItem->iSubItem, str);
@@ -736,10 +736,10 @@ void CPlayerSubresyncBar::OnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) }
break;
case COL_EFFECT:
- if(m_mode == TEXTSUB) {
+ if (m_mode == TEXTSUB) {
CString str(pItem->pszText);
str.Trim();
- if(!str.IsEmpty()) {
+ if (!str.IsEmpty()) {
fNeedsUpdate = true;
m_sts[pItem->iItem].effect = str;
m_list.SetItemText(pItem->iItem, pItem->iSubItem, str);
@@ -749,7 +749,7 @@ void CPlayerSubresyncBar::OnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult) }
}
- if(fNeedsUpdate) {
+ if (fNeedsUpdate) {
UpdatePreview();
}
}
@@ -763,7 +763,7 @@ void CPlayerSubresyncBar::OnRclickList(NMHDR* pNMHDR, LRESULT* pResult) {
LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)pNMHDR;
- if(lpnmlv->iItem >= 0 && lpnmlv->iSubItem >= 0) {
+ if (lpnmlv->iItem >= 0 && lpnmlv->iSubItem >= 0) {
enum {
TOGSEP=1,
DUPITEM, DELITEM,
@@ -782,18 +782,18 @@ void CPlayerSubresyncBar::OnRclickList(NMHDR* pNMHDR, LRESULT* pResult) CMenu m;
m.CreatePopupMenu();
- if(m_mode == VOBSUB || m_mode == TEXTSUB) {
+ if (m_mode == VOBSUB || m_mode == TEXTSUB) {
m.AppendMenu(MF_STRING|MF_ENABLED, TOGSEP, ResStr(IDS_SUBRESYNC_SEPARATOR));
m.AppendMenu(MF_SEPARATOR);
- if(m_mode == TEXTSUB) {
+ if (m_mode == TEXTSUB) {
m.AppendMenu(MF_STRING|MF_ENABLED, DUPITEM, ResStr(IDS_SUBRESYNC_DUPLICATE));
}
m.AppendMenu(MF_STRING|MF_ENABLED, DELITEM, ResStr(IDS_SUBRESYNC_DELETE));
}
- switch(lpnmlv->iSubItem) {
+ switch (lpnmlv->iSubItem) {
case COL_START:
- if(m_mode == VOBSUB || m_mode == TEXTSUB) {
+ if (m_mode == VOBSUB || m_mode == TEXTSUB) {
m.AppendMenu(MF_SEPARATOR);
m.AppendMenu(MF_STRING|MF_ENABLED, RESETS, ResStr(IDS_SUBRESYNC_RESET) + _T("\tF1"));
m.AppendMenu(MF_STRING|MF_ENABLED, SETOS, ResStr(IDS_SUBRESYNC_ORIGINAL) + _T("\tF3"));
@@ -801,7 +801,7 @@ void CPlayerSubresyncBar::OnRclickList(NMHDR* pNMHDR, LRESULT* pResult) }
break;
case COL_END:
- if(m_mode == TEXTSUB) {
+ if (m_mode == TEXTSUB) {
m.AppendMenu(MF_SEPARATOR);
m.AppendMenu(MF_STRING|MF_ENABLED, RESETE, ResStr(IDS_SUBRESYNC_RESET) + _T("\tF2"));
m.AppendMenu(MF_STRING|MF_ENABLED, SETOE, ResStr(IDS_SUBRESYNC_ORIGINAL) + _T("\tF4"));
@@ -809,13 +809,13 @@ void CPlayerSubresyncBar::OnRclickList(NMHDR* pNMHDR, LRESULT* pResult) }
break;
case COL_STYLE:
- if(m_mode == TEXTSUB) {
+ if (m_mode == TEXTSUB) {
m.AppendMenu(MF_SEPARATOR);
int id = STYLEFIRST;
POSITION pos = m_sts.m_styles.GetStartPosition();
- while(pos && id <= STYLELAST) {
+ while (pos && id <= STYLELAST) {
CString key;
STSStyle* val;
m_sts.m_styles.GetNextAssoc(pos, key, val);
@@ -823,43 +823,43 @@ void CPlayerSubresyncBar::OnRclickList(NMHDR* pNMHDR, LRESULT* pResult) m.AppendMenu(MF_STRING|MF_ENABLED, id++, key);
}
- if(id > STYLEFIRST && m_list.GetSelectedCount() == 1) {
+ if (id > STYLEFIRST && m_list.GetSelectedCount() == 1) {
m.AppendMenu(MF_SEPARATOR);
m.AppendMenu(MF_STRING|MF_ENABLED, STYLEEDIT, ResStr(IDS_SUBRESYNC_EDIT));
}
}
break;
case COL_UNICODE:
- if(m_mode == TEXTSUB) {
+ if (m_mode == TEXTSUB) {
m.AppendMenu(MF_SEPARATOR);
m.AppendMenu(MF_STRING|MF_ENABLED, UNICODEYES, ResStr(IDS_SUBRESYNC_YES));
m.AppendMenu(MF_STRING|MF_ENABLED, UNICODENO, ResStr(IDS_SUBRESYNC_NO));
}
break;
case COL_LAYER:
- if(m_mode == TEXTSUB) {
+ if (m_mode == TEXTSUB) {
m.AppendMenu(MF_SEPARATOR);
m.AppendMenu(MF_STRING|MF_ENABLED, LAYERDEC, ResStr(IDS_SUBRESYNC_DECREASE));
m.AppendMenu(MF_STRING|MF_ENABLED, LAYERINC, ResStr(IDS_SUBRESYNC_INCREASE));
}
break;
case COL_ACTOR:
- if(m_mode == TEXTSUB) {
+ if (m_mode == TEXTSUB) {
CMapStringToPtr actormap;
- for(int i = 0, j = m_sts.GetCount(); i < j; i++) {
+ for (int i = 0, j = m_sts.GetCount(); i < j; i++) {
actormap[m_sts[i].actor] = NULL;
}
actormap.RemoveKey(_T(""));
- if(actormap.GetCount() > 0) {
+ if (actormap.GetCount() > 0) {
m.AppendMenu(MF_SEPARATOR);
int id = ACTORFIRST;
POSITION pos = actormap.GetStartPosition();
- while(pos && id <= ACTORLAST) {
+ while (pos && id <= ACTORLAST) {
CString key;
void* val;
actormap.GetNextAssoc(pos, key, val);
@@ -872,22 +872,22 @@ void CPlayerSubresyncBar::OnRclickList(NMHDR* pNMHDR, LRESULT* pResult) }
break;
case COL_EFFECT:
- if(m_mode == TEXTSUB) {
+ if (m_mode == TEXTSUB) {
CMapStringToPtr effectmap;
- for(int i = 0, j = m_sts.GetCount(); i < j; i++) {
+ for (int i = 0, j = m_sts.GetCount(); i < j; i++) {
effectmap[m_sts[i].effect] = NULL;
}
effectmap.RemoveKey(_T(""));
- if(effectmap.GetCount() > 0) {
+ if (effectmap.GetCount() > 0) {
m.AppendMenu(MF_SEPARATOR);
int id = EFFECTFIRST;
POSITION pos = effectmap.GetStartPosition();
- while(pos && id <= EFFECTLAST) {
+ while (pos && id <= EFFECTLAST) {
CString key;
void* val;
effectmap.GetNextAssoc(pos, key, val);
@@ -909,12 +909,12 @@ void CPlayerSubresyncBar::OnRclickList(NMHDR* pNMHDR, LRESULT* pResult) bool fNeedsUpdate = false;
POSITION pos = m_list.GetFirstSelectedItemPosition();
- while(pos) {
+ while (pos) {
int iItem = m_list.GetNextSelectedItem(pos);
SubTime& st = m_subtimes[iItem];
- switch(id) {
+ switch (id) {
case TOGSEP:
m_list.SetItemData(iItem, m_list.GetItemData(iItem)^TSEP);
m_list.Invalidate();
@@ -923,13 +923,13 @@ void CPlayerSubresyncBar::OnRclickList(NMHDR* pNMHDR, LRESULT* pResult) case DUPITEM: {
CUIntArray items;
pos = m_list.GetFirstSelectedItemPosition();
- while(pos) {
+ while (pos) {
items.Add(m_list.GetNextSelectedItem(pos));
}
qsort(items.GetData(), items.GetCount(), sizeof(UINT), uintcomp);
- for(int i = 0; i < items.GetCount(); i++) {
+ for (int i = 0; i < items.GetCount(); i++) {
iItem = items[i];
STSEntry stse = m_sts[iItem];
@@ -943,14 +943,14 @@ void CPlayerSubresyncBar::OnRclickList(NMHDR* pNMHDR, LRESULT* pResult) CStringArray sa;
sa.SetSize(nColumnCount);
- for(int col = 0; col < nColumnCount; col++) {
+ for (int col = 0; col < nColumnCount; col++) {
sa[col] = m_list.GetItemText(iItem, col);
}
DWORD data = m_list.GetItemData(iItem);
m_list.InsertItem(iItem+1, sa[0]);
m_list.SetItemData(iItem+1, data);
- for(int col = 1; col < nColumnCount; col++) {
+ for (int col = 1; col < nColumnCount; col++) {
m_list.SetItemText(iItem+1, col, sa[col]);
}
}
@@ -961,13 +961,13 @@ void CPlayerSubresyncBar::OnRclickList(NMHDR* pNMHDR, LRESULT* pResult) case DELITEM: {
CUIntArray items;
pos = m_list.GetFirstSelectedItemPosition();
- while(pos) {
+ while (pos) {
items.Add(m_list.GetNextSelectedItem(pos));
}
qsort(items.GetData(), items.GetCount(), sizeof(UINT), uintcomp);
- for(int i = 0; i < items.GetCount(); i++) {
+ for (int i = 0; i < items.GetCount(); i++) {
iItem = items[i];
m_sts.RemoveAt(iItem);
m_subtimes.RemoveAt(iItem);
@@ -975,7 +975,7 @@ void CPlayerSubresyncBar::OnRclickList(NMHDR* pNMHDR, LRESULT* pResult) }
iItem = items[items.GetCount()-1];
- if(iItem >= m_list.GetItemCount()) {
+ if (iItem >= m_list.GetItemCount()) {
iItem = m_list.GetItemCount()-1;
}
@@ -983,39 +983,39 @@ void CPlayerSubresyncBar::OnRclickList(NMHDR* pNMHDR, LRESULT* pResult) }
fNeedsUpdate = true;
break;
- case RESETS: /*if(*/
+ case RESETS: /*if (*/
ModStart(iItem, st.orgstart, true);/*)*/
fNeedsUpdate = true;
break;
- case SETOS: /*if(*/
+ case SETOS: /*if (*/
ModStart(iItem, st.orgstart);/*)*/
fNeedsUpdate = true;
break;
- case SETCS: /*if(*/
+ case SETCS: /*if (*/
ModStart(iItem, (int)(m_rt/10000));/*)*/
fNeedsUpdate = true;
break;
- case RESETE: /*if(*/
+ case RESETE: /*if (*/
ModEnd(iItem, st.orgend, true);/*)*/
fNeedsUpdate = true;
break;
- case SETOE: /*if(*/
+ case SETOE: /*if (*/
ModEnd(iItem, st.orgend);/*)*/
fNeedsUpdate = true;
break;
- case SETCE: /*if(*/
+ case SETCE: /*if (*/
ModEnd(iItem, (int)(m_rt/10000));/*)*/
fNeedsUpdate = true;
break;
default:
- if(STYLEFIRST <= id && id <= STYLELAST) {
+ if (STYLEFIRST <= id && id <= STYLELAST) {
CString s = styles[id - STYLEFIRST];
- if(m_sts[iItem].style != s) {
+ if (m_sts[iItem].style != s) {
fNeedsUpdate = true;
}
m_sts[iItem].style = s;
m_list.SetItemText(iItem, lpnmlv->iSubItem, s);
- } else if(id == STYLEEDIT) {
+ } else if (id == STYLEEDIT) {
CAutoPtrArray<CPPageSubStyle> pages;
CAtlArray<STSStyle*> styles;
@@ -1023,7 +1023,7 @@ void CPlayerSubresyncBar::OnRclickList(NMHDR* pNMHDR, LRESULT* pResult) int iSelPage = 0;
POSITION pos = m_sts.m_styles.GetStartPosition();
- for(int i = 0; pos; i++) {
+ for (int i = 0; pos; i++) {
CString key;
STSStyle* val;
m_sts.m_styles.GetNextAssoc(pos, key, val);
@@ -1033,23 +1033,23 @@ void CPlayerSubresyncBar::OnRclickList(NMHDR* pNMHDR, LRESULT* pResult) pages.Add(page);
styles.Add(val);
- if(stss == val) {
+ if (stss == val) {
iSelPage = i;
}
}
CPropertySheet dlg(_T("Styles..."), this, iSelPage);
- for(int i = 0; i < (int)pages.GetCount(); i++) {
+ for (int i = 0; i < (int)pages.GetCount(); i++) {
dlg.AddPage(pages[i]);
}
- if(dlg.DoModal() == IDOK) {
- for(int j = 0; j < (int)pages.GetCount(); j++) {
+ if (dlg.DoModal() == IDOK) {
+ for (int j = 0; j < (int)pages.GetCount(); j++) {
stss = styles[j];
pages[j]->GetStyle(*stss);
- for(int i = 0; i < m_sts.GetCount(); i++) {
- if(m_sts.GetStyle(i) == stss) {
+ for (int i = 0; i < m_sts.GetCount(); i++) {
+ if (m_sts.GetStyle(i) == stss) {
CString str;
m_list.SetItemText(i, COL_TEXT, m_sts.GetStr(i, true));
m_list.SetItemText(i, COL_FONT, stss->fontName);
@@ -1062,30 +1062,30 @@ void CPlayerSubresyncBar::OnRclickList(NMHDR* pNMHDR, LRESULT* pResult) fNeedsUpdate = true;
}
- } else if(id == UNICODEYES || id == UNICODENO) {
+ } else if (id == UNICODEYES || id == UNICODENO) {
m_sts.ConvertUnicode(iItem, id == UNICODEYES);
m_list.SetItemText(iItem, COL_TEXT, m_sts.GetStr(iItem, true));
m_list.SetItemText(iItem, COL_UNICODE, m_sts.IsEntryUnicode(iItem) ? _T("yes") : _T("no"));
fNeedsUpdate = true;
- } else if(id == LAYERDEC || id == LAYERINC) {
+ } else if (id == LAYERDEC || id == LAYERINC) {
int d = (id == LAYERDEC) ? -1 : (id == LAYERINC) ? +1 : 0;
- if(d != 0) {
+ if (d != 0) {
fNeedsUpdate = true;
}
m_sts[iItem].layer += d;
CString s;
s.Format(_T("%d"), m_sts[iItem].layer);
m_list.SetItemText(iItem, lpnmlv->iSubItem, s);
- } else if(ACTORFIRST <= id && id <= ACTORLAST) {
+ } else if (ACTORFIRST <= id && id <= ACTORLAST) {
CString s = actors[id - ACTORFIRST];
- if(m_sts[iItem].actor != s) {
+ if (m_sts[iItem].actor != s) {
fNeedsUpdate = true;
}
m_sts[iItem].actor = s;
m_list.SetItemText(iItem, lpnmlv->iSubItem, s);
- } else if(EFFECTFIRST <= id && id <= EFFECTLAST) {
+ } else if (EFFECTFIRST <= id && id <= EFFECTLAST) {
CString s = effects[id - EFFECTFIRST];
- if(m_sts[iItem].effect != s) {
+ if (m_sts[iItem].effect != s) {
fNeedsUpdate = true;
}
m_sts[iItem].effect = s;
@@ -1095,7 +1095,7 @@ void CPlayerSubresyncBar::OnRclickList(NMHDR* pNMHDR, LRESULT* pResult) }
}
- if(fNeedsUpdate) {
+ if (fNeedsUpdate) {
UpdatePreview();
}
}
@@ -1107,10 +1107,10 @@ void CPlayerSubresyncBar::OnNMDblclkList(NMHDR* pNMHDR, LRESULT* pResult) {
LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)pNMHDR;
- if(lpnmlv->iItem >= 0 && lpnmlv->iSubItem >= 0 && (m_mode == VOBSUB || m_mode == TEXTSUB)) {
- if(CMainFrame* pFrame = (CMainFrame*)AfxGetMainWnd()) {
+ if (lpnmlv->iItem >= 0 && lpnmlv->iSubItem >= 0 && (m_mode == VOBSUB || m_mode == TEXTSUB)) {
+ if (CMainFrame* pFrame = (CMainFrame*)AfxGetMainWnd()) {
int t = 0;
- if(!ParseTime(m_list.GetItemText(lpnmlv->iItem, lpnmlv->iSubItem), t, false)) {
+ if (!ParseTime(m_list.GetItemText(lpnmlv->iItem, lpnmlv->iSubItem), t, false)) {
t = m_sts[lpnmlv->iItem].start;
}
@@ -1145,30 +1145,30 @@ void CPlayerSubresyncBar::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult) *pResult = CDRF_DODEFAULT;
- if(CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage) {
+ if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage) {
m_itemGroups.SetSize(m_list.GetItemCount());
m_totalGroups = 0;
- for(int i = 0, j = m_list.GetItemCount(); i < j; i++) {
- if(m_list.GetItemData(i)&TSEP) {
+ for (int i = 0, j = m_list.GetItemCount(); i < j; i++) {
+ if (m_list.GetItemData(i)&TSEP) {
m_totalGroups++;
}
m_itemGroups[i] = m_totalGroups;
}
*pResult = CDRF_NOTIFYPOSTPAINT|CDRF_NOTIFYITEMDRAW;
- } else if(CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage) {
+ } else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage) {
pLVCD->nmcd.uItemState &= ~CDIS_FOCUS;
*pResult = CDRF_NOTIFYPOSTPAINT|CDRF_NOTIFYSUBITEMDRAW;
- } else if((CDDS_ITEMPREPAINT|CDDS_SUBITEM) == pLVCD->nmcd.dwDrawStage) {
+ } else if ((CDDS_ITEMPREPAINT|CDDS_SUBITEM) == pLVCD->nmcd.dwDrawStage) {
COLORREF clrText;
COLORREF clrTextBk;
- if((pLVCD->iSubItem == COL_START || pLVCD->iSubItem == COL_END || pLVCD->iSubItem == COL_TEXT || pLVCD->iSubItem == COL_STYLE
+ if ((pLVCD->iSubItem == COL_START || pLVCD->iSubItem == COL_END || pLVCD->iSubItem == COL_TEXT || pLVCD->iSubItem == COL_STYLE
|| pLVCD->iSubItem == COL_LAYER || pLVCD->iSubItem == COL_ACTOR || pLVCD->iSubItem == COL_EFFECT)
&& m_mode == TEXTSUB) {
clrText = 0;
- } else if((pLVCD->iSubItem == COL_START)
+ } else if ((pLVCD->iSubItem == COL_START)
&& m_mode == VOBSUB) {
clrText = 0;
} else {
@@ -1176,24 +1176,24 @@ void CPlayerSubresyncBar::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult) }
clrTextBk = 0xffffff;
- // if(m_totalGroups > 0)
+ // if (m_totalGroups > 0)
clrTextBk -= ((m_itemGroups[pLVCD->nmcd.dwItemSpec]&1) ? 0x100010 : 0x200020);
- if(m_sts[pLVCD->nmcd.dwItemSpec].start <= m_rt/10000 && m_rt/10000 < m_sts[pLVCD->nmcd.dwItemSpec].end) {
+ if (m_sts[pLVCD->nmcd.dwItemSpec].start <= m_rt/10000 && m_rt/10000 < m_sts[pLVCD->nmcd.dwItemSpec].end) {
clrText |= 0xFF;
}
int nCheck = (int)m_list.GetItemData(pLVCD->nmcd.dwItemSpec);
- if((nCheck&1) && (pLVCD->iSubItem == COL_START || pLVCD->iSubItem == COL_PREVSTART)) {
+ if ((nCheck&1) && (pLVCD->iSubItem == COL_START || pLVCD->iSubItem == COL_PREVSTART)) {
clrTextBk = 0xffddbb;
- } else if((nCheck&4) && (/*pLVCD->iSubItem == COL_START ||*/ pLVCD->iSubItem == COL_PREVSTART)) {
+ } else if ((nCheck&4) && (/*pLVCD->iSubItem == COL_START ||*/ pLVCD->iSubItem == COL_PREVSTART)) {
clrTextBk = 0xffeedd;
}
- if((nCheck&2) && (pLVCD->iSubItem == COL_END || pLVCD->iSubItem == COL_PREVEND)) {
+ if ((nCheck&2) && (pLVCD->iSubItem == COL_END || pLVCD->iSubItem == COL_PREVEND)) {
clrTextBk = 0xffddbb;
- } else if((nCheck&8) && (/*pLVCD->iSubItem == COL_END ||*/ pLVCD->iSubItem == COL_PREVEND)) {
+ } else if ((nCheck&8) && (/*pLVCD->iSubItem == COL_END ||*/ pLVCD->iSubItem == COL_PREVEND)) {
clrTextBk = 0xffeedd;
}
@@ -1201,9 +1201,9 @@ void CPlayerSubresyncBar::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult) pLVCD->clrTextBk = clrTextBk;
*pResult = CDRF_NOTIFYPOSTPAINT;
- } else if((CDDS_ITEMPOSTPAINT|CDDS_SUBITEM) == pLVCD->nmcd.dwDrawStage) {
+ } else if ((CDDS_ITEMPOSTPAINT|CDDS_SUBITEM) == pLVCD->nmcd.dwDrawStage) {
// *pResult = CDRF_DODEFAULT;
- } else if(CDDS_ITEMPOSTPAINT == pLVCD->nmcd.dwDrawStage) {
+ } else if (CDDS_ITEMPOSTPAINT == pLVCD->nmcd.dwDrawStage) {
int nItem = static_cast<int>(pLVCD->nmcd.dwItemSpec);
LVITEM rItem;
@@ -1237,7 +1237,7 @@ void CPlayerSubresyncBar::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult) // Get the column offset
int offset = rcItem.left;
- for(int i = 0; i < nColumnCount; i++) {
+ for (int i = 0; i < nColumnCount; i++) {
offset += m_list.GetColumnWidth(i);
pDC->MoveTo(CPoint(offset, rcItem.top));
pDC->LineTo(CPoint(offset, rcItem.bottom));
@@ -1248,55 +1248,55 @@ void CPlayerSubresyncBar::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult) *pResult = CDRF_SKIPDEFAULT;
}
- } else if(CDDS_POSTPAINT == pLVCD->nmcd.dwDrawStage) {
+ } else if (CDDS_POSTPAINT == pLVCD->nmcd.dwDrawStage) {
}
}
bool CPlayerSubresyncBar::IsShortCut(MSG* pMsg)
{
- if(pMsg->message == WM_KEYDOWN && VK_F1 <= pMsg->wParam && pMsg->wParam <= VK_F6) {
+ if (pMsg->message == WM_KEYDOWN && VK_F1 <= pMsg->wParam && pMsg->wParam <= VK_F6) {
int iItem = -1;
bool fNeedsUpdate = false;
bool fStep = false;
POSITION pos = m_list.GetFirstSelectedItemPosition();
- while(pos) {
+ while (pos) {
iItem = m_list.GetNextSelectedItem(pos);
SubTime& st = m_subtimes[iItem];
- switch(pMsg->wParam) {
- case VK_F1: /*if(*/
+ switch (pMsg->wParam) {
+ case VK_F1: /*if (*/
ModStart(iItem, st.orgstart, true);/*)*/
fNeedsUpdate = true;
break;
- case VK_F3: /*if(*/
+ case VK_F3: /*if (*/
ModStart(iItem, st.orgstart);/*)*/
fNeedsUpdate = true;
break;
- case VK_F5: /*if(*/
+ case VK_F5: /*if (*/
ModStart(iItem, (int)(m_rt/10000));/*)*/
fNeedsUpdate = true;
break;
- case VK_F2: /*if(*/
+ case VK_F2: /*if (*/
ModEnd(iItem, st.orgend, true);/*)*/
fNeedsUpdate = true;
break;
- case VK_F4: /*if(*/
+ case VK_F4: /*if (*/
ModEnd(iItem, st.orgend);/*)*/
fNeedsUpdate = true;
break;
- case VK_F6: /*if(*/
+ case VK_F6: /*if (*/
ModEnd(iItem, (int)(m_rt/10000));/*)*/
fNeedsUpdate = fStep = true;
break;
}
}
- if(fNeedsUpdate) {
- if(fStep && m_list.GetSelectedCount() == 1 && iItem < m_list.GetItemCount()-1) {
+ if (fNeedsUpdate) {
+ if (fStep && m_list.GetSelectedCount() == 1 && iItem < m_list.GetItemCount()-1) {
m_list.SetItemState(iItem, 0, LVIS_SELECTED);
m_list.SetItemState(iItem+1, LVIS_SELECTED, LVIS_SELECTED);
m_list.SetSelectionMark(iItem+1);
@@ -1327,7 +1327,7 @@ int CPlayerSubresyncBar::FindNearestSub(__int64& rtPos, bool bForward) return 0;
}
- for(int i = 1, j = m_sts.GetCount(); i < j; i++) {
+ for (int i = 1, j = m_sts.GetCount(); i < j; i++) {
if ((lCurTime >= m_subtimes[i-1].newstart) && (lCurTime < m_subtimes[i].newstart)) {
rtPos = bForward ? (__int64)m_subtimes[i].newstart * 10000 : (__int64)m_subtimes[i-1].newstart * 10000;
return bForward ? i : i-1;
diff --git a/src/apps/mplayerc/PlayerToolBar.cpp b/src/apps/mplayerc/PlayerToolBar.cpp index 29b4c212d..0da5bf3c9 100644 --- a/src/apps/mplayerc/PlayerToolBar.cpp +++ b/src/apps/mplayerc/PlayerToolBar.cpp @@ -46,12 +46,12 @@ CPlayerToolBar::~CPlayerToolBar() BOOL CPlayerToolBar::Create(CWnd* pParentWnd)
{
- if(!__super::CreateEx(pParentWnd,
+ if (!__super::CreateEx(pParentWnd,
TBSTYLE_FLAT|TBSTYLE_TRANSPARENT|TBSTYLE_AUTOSIZE,
WS_CHILD|WS_VISIBLE|CBRS_ALIGN_BOTTOM|CBRS_TOOLTIPS, CRect(2,2,0,3))) {
return FALSE;
}
- if(!LoadToolBar(IDB_PLAYERTOOLBAR)) {
+ if (!LoadToolBar(IDB_PLAYERTOOLBAR)) {
return FALSE;
}
@@ -75,17 +75,17 @@ BOOL CPlayerToolBar::Create(CWnd* pParentWnd) /*TBBS_SEPARATOR,*/
};
- for(int i = 0; i < countof(styles); i++) {
+ for (int i = 0; i < countof(styles); i++) {
SetButtonStyle(i, styles[i]|TBBS_DISABLED);
}
m_volctrl.Create(this);
m_volctrl.SetRange(0, 100);
- if(AfxGetAppSettings().fDisableXPToolbars) {
- if(HMODULE h = LoadLibrary(_T("uxtheme.dll"))) {
+ if (AfxGetAppSettings().fDisableXPToolbars) {
+ if (HMODULE h = LoadLibrary(_T("uxtheme.dll"))) {
SetWindowThemeFunct f = (SetWindowThemeFunct)GetProcAddress(h, "SetWindowTheme");
- if(f) {
+ if (f) {
f(m_hWnd, L" ", L" ");
}
FreeLibrary(h);
@@ -95,12 +95,12 @@ BOOL CPlayerToolBar::Create(CWnd* pParentWnd) // quick and dirty code from foxx1337; will leak, but don't care yet
m_nButtonHeight = 16; //reset m_nButtonHeight
HBITMAP hBmp = static_cast<HBITMAP>(::LoadImage(NULL, _T("toolbar.bmp"), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION));
- if(NULL != hBmp) {
+ if (NULL != hBmp) {
CBitmap *bmp = new CBitmap();
bmp->Attach(hBmp);
BITMAP bitmapBmp;
bmp->GetBitmap(&bitmapBmp);
- if(bitmapBmp.bmWidth == bitmapBmp.bmHeight * 15) {
+ if (bitmapBmp.bmWidth == bitmapBmp.bmHeight * 15) {
// the manual specifies that sizeButton should be sizeImage inflated by (7, 6)
SetSizes(CSize(bitmapBmp.bmHeight + 7, bitmapBmp.bmHeight + 6), CSize(bitmapBmp.bmHeight, bitmapBmp.bmHeight));
@@ -112,7 +112,7 @@ BOOL CPlayerToolBar::Create(CWnd* pParentWnd) GetDIBits(dc, hBmp, 0, 0, NULL, reinterpret_cast<BITMAPINFO*>(&bih), DIB_RGB_COLORS);
int fileDepth = bih.biBitCount;
CImageList *imageList = new CImageList();
- if(32 == fileDepth) {
+ if (32 == fileDepth) {
imageList->Create(bitmapBmp.bmHeight, bitmapBmp.bmHeight, ILC_COLOR32 | ILC_MASK, 1, 0);
imageList->Add(bmp, static_cast<CBitmap*>(0)); // alpha is the mask
} else {
@@ -131,7 +131,7 @@ BOOL CPlayerToolBar::Create(CWnd* pParentWnd) BOOL CPlayerToolBar::PreCreateWindow(CREATESTRUCT& cs)
{
- if(!__super::PreCreateWindow(cs)) {
+ if (!__super::PreCreateWindow(cs)) {
return FALSE;
}
@@ -144,7 +144,7 @@ BOOL CPlayerToolBar::PreCreateWindow(CREATESTRUCT& cs) void CPlayerToolBar::ArrangeControls()
{
- if(!::IsWindow(m_volctrl.m_hWnd)) {
+ if (!::IsWindow(m_volctrl.m_hWnd)) {
return;
}
@@ -230,7 +230,7 @@ END_MESSAGE_MAP() void CPlayerToolBar::OnPaint()
{
- if(m_bDelayedButtonLayout) {
+ if (m_bDelayedButtonLayout) {
Layout();
}
@@ -305,10 +305,10 @@ void CPlayerToolBar::OnMouseMove(UINT nFlags, CPoint point) {
int i = getHitButtonIdx(point);
- if((i==-1) || (GetButtonStyle(i)&(TBBS_SEPARATOR|TBBS_DISABLED))) {
+ if ((i==-1) || (GetButtonStyle(i)&(TBBS_SEPARATOR|TBBS_DISABLED))) {
;
} else {
- if((i>11) || ((i<10) && ((CMainFrame*)GetParentFrame())->IsSomethingLoaded())) {
+ if ((i>11) || ((i<10) && ((CMainFrame*)GetParentFrame())->IsSomethingLoaded())) {
::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_HAND));
}
}
@@ -320,13 +320,13 @@ void CPlayerToolBar::OnLButtonDown(UINT nFlags, CPoint point) int i = getHitButtonIdx(point);
CMainFrame* pFrame = ((CMainFrame*)GetParentFrame());
- if((i==-1) || (GetButtonStyle(i)&(TBBS_SEPARATOR|TBBS_DISABLED))) {
- if(!pFrame->m_fFullScreen) {
+ if ((i==-1) || (GetButtonStyle(i)&(TBBS_SEPARATOR|TBBS_DISABLED))) {
+ if (!pFrame->m_fFullScreen) {
MapWindowPoints(pFrame, &point, 1);
pFrame->PostMessage(WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(point.x, point.y));
}
} else {
- if((i>11) || ((i<10) && pFrame->IsSomethingLoaded())) {
+ if ((i>11) || ((i<10) && pFrame->IsSomethingLoaded())) {
::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_HAND));
}
@@ -339,10 +339,10 @@ int CPlayerToolBar::getHitButtonIdx(CPoint point) int hit = -1; // -1 means not on any buttons, mute button is 12/13, others < 10, 11 is empty space between
CRect r;
- for(int i = 0, j = GetToolBarCtrl().GetButtonCount(); i < j; i++) {
+ for (int i = 0, j = GetToolBarCtrl().GetButtonCount(); i < j; i++) {
GetItemRect(i, r);
- if(r.PtInRect(point)) {
+ if (r.PtInRect(point)) {
hit = i;
break;
}
diff --git a/src/apps/mplayerc/Playlist.cpp b/src/apps/mplayerc/Playlist.cpp index 62108ebf9..34f103408 100644 --- a/src/apps/mplayerc/Playlist.cpp +++ b/src/apps/mplayerc/Playlist.cpp @@ -55,7 +55,7 @@ CPlaylistItem::CPlaylistItem(const CPlaylistItem& pli) CPlaylistItem& CPlaylistItem::operator = (const CPlaylistItem& pli)
{
- if(this != &pli) {
+ if (this != &pli) {
m_id = pli.m_id;
m_label = pli.m_label;
m_fns.RemoveAll();
@@ -76,7 +76,7 @@ CPlaylistItem& CPlaylistItem::operator = (const CPlaylistItem& pli) POSITION CPlaylistItem::FindFile(LPCTSTR path)
{
POSITION pos = m_fns.GetHeadPosition();
- while(pos) {
+ while (pos) {
if (m_fns.GetAt(pos).CompareNoCase(path) == 0) {
return pos;
}
@@ -97,21 +97,21 @@ CString CPlaylistItem::GetLabel(int i) {
CString str;
- if(i == 0) {
- if(!m_label.IsEmpty()) {
+ if (i == 0) {
+ if (!m_label.IsEmpty()) {
str = m_label;
- } else if(!m_fns.IsEmpty()) {
+ } else if (!m_fns.IsEmpty()) {
str = StripPath(m_fns.GetHead());
}
- } else if(i == 1) {
- if(m_fInvalid) {
+ } else if (i == 1) {
+ if (m_fInvalid) {
return _T("Invalid");
}
- if(m_type == file) {
+ if (m_type == file) {
REFERENCE_TIME rt = m_duration;
- if(rt > 0) {
+ if (rt > 0) {
rt /= 10000000;
int ss = int(rt%60);
rt /= 60;
@@ -121,7 +121,7 @@ CString CPlaylistItem::GetLabel(int i) str.Format(_T("%02d:%02d:%02d"), hh, mm, ss);
}
- } else if(m_type == device) {
+ } else if (m_type == device) {
// TODO
}
@@ -134,8 +134,8 @@ bool FindFileInList(CAtlList<CString>& sl, CString fn) {
bool fFound = false;
POSITION pos = sl.GetHeadPosition();
- while(pos && !fFound) {
- if(!sl.GetNext(pos).CompareNoCase(fn)) {
+ while (pos && !fFound) {
+ if (!sl.GetNext(pos).CompareNoCase(fn)) {
fFound = true;
}
}
@@ -144,39 +144,39 @@ bool FindFileInList(CAtlList<CString>& sl, CString fn) void CPlaylistItem::AutoLoadFiles()
{
- if(m_fns.IsEmpty()) {
+ if (m_fns.IsEmpty()) {
return;
}
CString fn = m_fns.GetHead();
- if(AfxGetAppSettings().fAutoloadAudio && fn.Find(_T("://")) < 0) {
+ if (AfxGetAppSettings().fAutoloadAudio && fn.Find(_T("://")) < 0) {
int i = fn.ReverseFind('.');
- if(i > 0) {
+ if (i > 0) {
CMediaFormats& mf = AfxGetAppSettings().m_Formats;
CString ext = fn.Mid(i+1).MakeLower();
- if(!mf.FindExt(ext, true)) {
+ if (!mf.FindExt(ext, true)) {
CString path = fn;
path.Replace('/', '\\');
path = path.Left(path.ReverseFind('\\')+1);
WIN32_FIND_DATA fd = {0};
HANDLE hFind = FindFirstFile(fn.Left(i) + _T("*.*"), &fd);
- if(hFind != INVALID_HANDLE_VALUE) {
+ if (hFind != INVALID_HANDLE_VALUE) {
do {
- if(fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {
+ if (fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {
continue;
}
CString fullpath = path + fd.cFileName;
CString ext2 = fullpath.Mid(fullpath.ReverseFind('.')+1).MakeLower();
- if(!FindFileInList(m_fns, fullpath) && ext != ext2
+ if (!FindFileInList(m_fns, fullpath) && ext != ext2
&& mf.FindExt(ext2, true) && mf.IsUsingEngine(fullpath, DirectShow)) {
m_fns.AddTail(fullpath);
}
- } while(FindNextFile(hFind, &fd));
+ } while (FindNextFile(hFind, &fd));
FindClose(hFind);
}
@@ -184,7 +184,7 @@ void CPlaylistItem::AutoLoadFiles() }
}
- if(AfxGetAppSettings().fAutoloadSubtitles) {
+ if (AfxGetAppSettings().fAutoloadSubtitles) {
CString& pathList = AfxGetAppSettings().strSubtitlePaths;
CAtlArray<CString> paths;
@@ -193,14 +193,14 @@ void CPlaylistItem::AutoLoadFiles() do {
CString path = pathList.Tokenize(_T(";"), pos);
paths.Add(path);
- } while(pos != -1);
+ } while (pos != -1);
CString dir = fn;
dir.Replace('\\', '/');
int l = fn.GetLength(), l2 = l;
l2 = dir.ReverseFind('.');
l = dir.ReverseFind('/') + 1;
- if(l2 < l) {
+ if (l2 < l) {
l2 = l;
}
CString title = dir.Mid(l, l2-l);
@@ -209,8 +209,8 @@ void CPlaylistItem::AutoLoadFiles() CAtlArray<SubFile> ret;
GetSubFileNames(fn, paths, ret);
- for(int i = 0; i < ret.GetCount(); i++) {
- if(!FindFileInList(m_subs, ret[i].fn)) {
+ for (int i = 0; i < ret.GetCount(); i++) {
+ if (!FindFileInList(m_subs, ret[i].fn)) {
m_subs.AddTail(ret[i].fn);
}
}
@@ -240,9 +240,9 @@ bool CPlaylist::RemoveAll() bool CPlaylist::RemoveAt(POSITION pos)
{
- if(pos) {
+ if (pos) {
__super::RemoveAt(pos);
- if(m_pos == pos) {
+ if (m_pos == pos) {
m_pos = NULL;
return(true);
}
@@ -278,14 +278,14 @@ void CPlaylist::SortById() CAtlArray<plsort_t> a;
a.SetCount(GetCount());
POSITION pos = GetHeadPosition();
- for(int i = 0; pos; i++, GetNext(pos)) {
+ for (int i = 0; pos; i++, GetNext(pos)) {
a[i].n = GetAt(pos).m_id, a[i].pos = pos;
}
qsort(a.GetData(), a.GetCount(), sizeof(plsort_t), compare);
- for(int i = 0; i < a.GetCount(); i++) {
+ for (int i = 0; i < a.GetCount(); i++) {
AddTail(GetAt(a[i].pos));
__super::RemoveAt(a[i].pos);
- if(m_pos == a[i].pos) {
+ if (m_pos == a[i].pos) {
m_pos = GetTailPosition();
}
}
@@ -296,16 +296,16 @@ void CPlaylist::SortByName() CAtlArray<plsort2_t> a;
a.SetCount(GetCount());
POSITION pos = GetHeadPosition();
- for(int i = 0; pos; i++, GetNext(pos)) {
+ for (int i = 0; pos; i++, GetNext(pos)) {
CString& fn = GetAt(pos).m_fns.GetHead();
a[i].str = (LPCTSTR)fn + max(fn.ReverseFind('/'), fn.ReverseFind('\\')) + 1;
a[i].pos = pos;
}
qsort(a.GetData(), a.GetCount(), sizeof(plsort2_t), compare2);
- for(int i = 0; i < a.GetCount(); i++) {
+ for (int i = 0; i < a.GetCount(); i++) {
AddTail(GetAt(a[i].pos));
__super::RemoveAt(a[i].pos);
- if(m_pos == a[i].pos) {
+ if (m_pos == a[i].pos) {
m_pos = GetTailPosition();
}
}
@@ -316,14 +316,14 @@ void CPlaylist::SortByPath() CAtlArray<plsort2_t> a;
a.SetCount(GetCount());
POSITION pos = GetHeadPosition();
- for(int i = 0; pos; i++, GetNext(pos)) {
+ for (int i = 0; pos; i++, GetNext(pos)) {
a[i].str = GetAt(pos).m_fns.GetHead(), a[i].pos = pos;
}
qsort(a.GetData(), a.GetCount(), sizeof(plsort2_t), compare2);
- for(int i = 0; i < a.GetCount(); i++) {
+ for (int i = 0; i < a.GetCount(); i++) {
AddTail(GetAt(a[i].pos));
__super::RemoveAt(a[i].pos);
- if(m_pos == a[i].pos) {
+ if (m_pos == a[i].pos) {
m_pos = GetTailPosition();
}
}
@@ -335,15 +335,15 @@ void CPlaylist::Randomize() a.SetCount(GetCount());
srand((unsigned int)time(NULL));
POSITION pos = GetHeadPosition();
- for(int i = 0; pos; i++, GetNext(pos)) {
+ for (int i = 0; pos; i++, GetNext(pos)) {
a[i].n = rand(), a[i].pos = pos;
}
qsort(a.GetData(), a.GetCount(), sizeof(plsort_t), compare);
CList<CPlaylistItem> pl;
- for(int i = 0; i < a.GetCount(); i++) {
+ for (int i = 0; i < a.GetCount(); i++) {
AddTail(GetAt(a[i].pos));
__super::RemoveAt(a[i].pos);
- if(m_pos == a[i].pos) {
+ if (m_pos == a[i].pos) {
m_pos = GetTailPosition();
}
}
@@ -367,13 +367,13 @@ POSITION CPlaylist::Shuffle() ASSERT(GetCount() > 2);
// insert or remove items in playlist, or index out of bounds then recalculate
- if((count != GetCount()) || (idx >= GetCount())) {
+ if ((count != GetCount()) || (idx >= GetCount())) {
a.RemoveAll();
idx = 0;
a.SetCount(count = GetCount());
POSITION pos = GetHeadPosition();
- for(INT_PTR i = 0; pos; i++, GetNext(pos)) {
+ for (INT_PTR i = 0; pos; i++, GetNext(pos)) {
a[i].pos = pos; // initialize position array
}
@@ -392,11 +392,11 @@ POSITION CPlaylist::Shuffle() CPlaylistItem& CPlaylist::GetNextWrap(POSITION& pos)
{
- if(AfxGetAppSettings().bShufflePlaylistItems && GetCount() > 2) {
+ if (AfxGetAppSettings().bShufflePlaylistItems && GetCount() > 2) {
pos = Shuffle();
} else {
GetNext(pos);
- if(!pos) {
+ if (!pos) {
pos = GetHeadPosition();
}
}
@@ -407,7 +407,7 @@ CPlaylistItem& CPlaylist::GetNextWrap(POSITION& pos) CPlaylistItem& CPlaylist::GetPrevWrap(POSITION& pos)
{
GetPrev(pos);
- if(!pos) {
+ if (!pos) {
pos = GetTailPosition();
}
return(GetAt(pos));
diff --git a/src/apps/mplayerc/PnSPresetsDlg.cpp b/src/apps/mplayerc/PnSPresetsDlg.cpp index 17ee7423e..4d2429514 100644 --- a/src/apps/mplayerc/PnSPresetsDlg.cpp +++ b/src/apps/mplayerc/PnSPresetsDlg.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -54,14 +54,14 @@ BOOL CPnSPresetsDlg::OnInitDialog() {
__super::OnInitDialog();
- for(int i = 0, j = m_pnspresets.GetCount(); i < j; i++) {
+ for (int i = 0, j = m_pnspresets.GetCount(); i < j; i++) {
CString label;
double PosX, PosY, ZoomX, ZoomY;
StringToParams(m_pnspresets[i], label, PosX, PosY, ZoomX, ZoomY);
m_list.AddString(label);
- if(i == 0) {
+ if (i == 0) {
m_list.SetCurSel(0);
OnLbnSelchangeList1();
}
@@ -76,16 +76,16 @@ void CPnSPresetsDlg::StringToParams(CString str, CString& label, double& PosX, d {
int i = 0, j = 0;
- for(CString token = str.Tokenize(_T(","), i); !token.IsEmpty(); token = str.Tokenize(_T(","), i), j++) {
- if(j == 0) {
+ for (CString token = str.Tokenize(_T(","), i); !token.IsEmpty(); token = str.Tokenize(_T(","), i), j++) {
+ if (j == 0) {
label = token;
} else {
float f = 0;
- if(_stscanf_s(token, _T("%f"), &f) != 1) {
+ if (_stscanf_s(token, _T("%f"), &f) != 1) {
continue;
}
- switch(j) {
+ switch (j) {
case 1:
PosX = f;
break;
@@ -131,7 +131,7 @@ END_MESSAGE_MAP() void CPnSPresetsDlg::OnLbnSelchangeList1()
{
int i = m_list.GetCurSel();
- if(i >= 0 && i < m_pnspresets.GetCount()) {
+ if (i >= 0 && i < m_pnspresets.GetCount()) {
double PosX, PosY, ZoomX, ZoomY;
StringToParams(m_pnspresets[i], m_label, PosX, PosY, ZoomX, ZoomY);
m_PosX = PosX;
@@ -160,7 +160,7 @@ void CPnSPresetsDlg::OnUpdateButton2(CCmdUI* pCmdUI) {
CString str;
int len = m_list.GetCount();
- if(len > 0) {
+ if (len > 0) {
m_list.GetText(len-1, str);
}
pCmdUI->Enable(str != _T("New"));
@@ -171,7 +171,7 @@ void CPnSPresetsDlg::OnBnClickedButton6() // del int i = m_list.GetCurSel();
m_list.DeleteString(i);
m_pnspresets.RemoveAt(i);
- if(i == m_list.GetCount()) {
+ if (i == m_list.GetCount()) {
i--;
}
m_list.SetCurSel(i);
@@ -225,7 +225,7 @@ void CPnSPresetsDlg::OnBnClickedButton1() // set {
int i = m_list.GetCurSel();
UpdateData();
- /*if(m_label.Remove(',') > 0)
+ /*if (m_label.Remove(',') > 0)
UpdateData(FALSE);*/
m_label.Replace(',', '.'); // Replace any ',' with '.' as ',' is used as tokeniser
m_pnspresets[i] = ParamsToString(m_label, m_PosX, m_PosY, m_ZoomX, m_ZoomY);
@@ -247,7 +247,7 @@ void CPnSPresetsDlg::OnUpdateButton1(CCmdUI* pCmdUI) void CPnSPresetsDlg::OnOK()
{
- if(m_list.GetCurSel() >= 0) {
+ if (m_list.GetCurSel() >= 0) {
OnBnClickedButton1();
}
diff --git a/src/apps/mplayerc/QuicktimeGraph.cpp b/src/apps/mplayerc/QuicktimeGraph.cpp index fbe7ce673..eb7472f37 100644 --- a/src/apps/mplayerc/QuicktimeGraph.cpp +++ b/src/apps/mplayerc/QuicktimeGraph.cpp @@ -50,35 +50,35 @@ CQuicktimeGraph::CQuicktimeGraph(HWND hWndParent, HRESULT& hr) AppSettings& s = AfxGetAppSettings();
- if(s.iQTVideoRendererType == VIDRNDT_QT_DX7) {
- if(SUCCEEDED(CreateAP7(CLSID_QT7AllocatorPresenter, hWndParent, &m_pQTAP))) {
+ if (s.iQTVideoRendererType == VIDRNDT_QT_DX7) {
+ if (SUCCEEDED(CreateAP7(CLSID_QT7AllocatorPresenter, hWndParent, &m_pQTAP))) {
dwStyle &= ~WS_VISIBLE;
}
- } else if(s.iQTVideoRendererType == VIDRNDT_QT_DX9) {
+ } else if (s.iQTVideoRendererType == VIDRNDT_QT_DX9) {
bool bFullscreen = (AfxGetApp()->m_pMainWnd != NULL) && (((CMainFrame*)AfxGetApp()->m_pMainWnd)->IsD3DFullScreenMode());
- if(SUCCEEDED(CreateAP9(CLSID_QT9AllocatorPresenter, hWndParent, bFullscreen, &m_pQTAP))) {
+ if (SUCCEEDED(CreateAP9(CLSID_QT9AllocatorPresenter, hWndParent, bFullscreen, &m_pQTAP))) {
dwStyle &= ~WS_VISIBLE;
}
}
m_fQtInitialized = false;
- if(InitializeQTML(0) != 0) {
+ if (InitializeQTML(0) != 0) {
hr = E_FAIL;
return;
}
- if(EnterMovies() != 0) {
+ if (EnterMovies() != 0) {
TerminateQTML();
hr = E_FAIL;
return;
}
m_fQtInitialized = true;
- if(!m_wndWindowFrame.CreateEx(WS_EX_NOPARENTNOTIFY, NULL, NULL, dwStyle, CRect(0, 0, 0, 0), CWnd::FromHandle(hWndParent), 0)) {
+ if (!m_wndWindowFrame.CreateEx(WS_EX_NOPARENTNOTIFY, NULL, NULL, dwStyle, CRect(0, 0, 0, 0), CWnd::FromHandle(hWndParent), 0)) {
hr = E_FAIL;
return;
}
- if(!m_wndDestFrame.Create(NULL, NULL, dwStyle, CRect(0, 0, 0, 0), &m_wndWindowFrame, 0)) {
+ if (!m_wndDestFrame.Create(NULL, NULL, dwStyle, CRect(0, 0, 0, 0), &m_wndWindowFrame, 0)) {
hr = E_FAIL;
return;
}
@@ -89,7 +89,7 @@ CQuicktimeGraph::~CQuicktimeGraph() m_wndDestFrame.DestroyWindow();
m_wndWindowFrame.DestroyWindow();
- if(m_fQtInitialized) {
+ if (m_fQtInitialized) {
ExitMovies();
TerminateQTML();
}
@@ -110,17 +110,17 @@ STDMETHODIMP CQuicktimeGraph::RenderFile(LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPla {
bool fRet = m_wndDestFrame.OpenMovie(CString(lpcwstrFile));
- if(fRet) {
- for(int i = 1, cnt = GetMovieTrackCount(m_wndDestFrame.theMovie); i <= cnt; i++) {
+ if (fRet) {
+ for (int i = 1, cnt = GetMovieTrackCount(m_wndDestFrame.theMovie); i <= cnt; i++) {
Track aTrack = GetMovieIndTrack(m_wndDestFrame.theMovie, i);
Media aMedia = GetTrackMedia(aTrack);
OSType aTrackType;
GetMediaHandlerDescription(aMedia, &aTrackType, 0, 0);
- if(aTrackType == SoundMediaType) {
+ if (aTrackType == SoundMediaType) {
SampleDescriptionHandle aDesc = (SampleDescriptionHandle)NewHandle(sizeof(aDesc));
GetMediaSampleDescription(aMedia, 1, aDesc);
- if(GetMoviesError() == noErr) {
+ if (GetMoviesError() == noErr) {
SoundDescription& desc = **(SoundDescriptionHandle)aDesc;
NotifyEvent(EC_BG_AUDIO_CHANGED, desc.numChannels, 0);
i = cnt;
@@ -162,12 +162,12 @@ STDMETHODIMP CQuicktimeGraph::GetDuration(LONGLONG* pDuration) *pDuration = 0;
- if(!m_wndDestFrame.theMovie) {
+ if (!m_wndDestFrame.theMovie) {
return E_UNEXPECTED;
}
TimeScale ts = GetMovieTimeScale(m_wndDestFrame.theMovie);
- if(ts == 0) {
+ if (ts == 0) {
return E_FAIL;
}
@@ -181,12 +181,12 @@ STDMETHODIMP CQuicktimeGraph::GetCurrentPosition(LONGLONG* pCurrent) *pCurrent = 0;
- if(!m_wndDestFrame.theMovie) {
+ if (!m_wndDestFrame.theMovie) {
return E_UNEXPECTED;
}
TimeScale ts = GetMovieTimeScale(m_wndDestFrame.theMovie);
- if(ts == 0) {
+ if (ts == 0) {
return E_FAIL;
}
@@ -199,22 +199,22 @@ STDMETHODIMP CQuicktimeGraph::SetPositions(LONGLONG* pCurrent, DWORD dwCurrentFl {
CheckPointer(pCurrent, E_POINTER);
- if(!(dwCurrentFlags&AM_SEEKING_AbsolutePositioning)) {
+ if (!(dwCurrentFlags&AM_SEEKING_AbsolutePositioning)) {
return E_INVALIDARG;
}
- if(!m_wndDestFrame.theMovie) {
+ if (!m_wndDestFrame.theMovie) {
return E_UNEXPECTED;
}
TimeScale ts = GetMovieTimeScale(m_wndDestFrame.theMovie);
- if(ts == 0) {
+ if (ts == 0) {
return E_FAIL;
}
SetMovieTimeValue(m_wndDestFrame.theMovie, (TimeValue)(*pCurrent*ts/1000/10000i64));
- if(!m_wndDestFrame.theMC) {
+ if (!m_wndDestFrame.theMC) {
UpdateMovie(m_wndDestFrame.theMovie);
MoviesTask(m_wndDestFrame.theMovie, 0L);
}
@@ -235,7 +235,7 @@ STDMETHODIMP CQuicktimeGraph::GetRate(double* pdRate) // IVideoWindow
STDMETHODIMP CQuicktimeGraph::SetWindowPosition(long Left, long Top, long Width, long Height)
{
- if(IsWindow(m_wndWindowFrame.m_hWnd)) {
+ if (IsWindow(m_wndWindowFrame.m_hWnd)) {
m_wndWindowFrame.MoveWindow(Left, Top, Width, Height);
}
@@ -245,10 +245,10 @@ STDMETHODIMP CQuicktimeGraph::SetWindowPosition(long Left, long Top, long Width, // IBasicVideo
STDMETHODIMP CQuicktimeGraph::SetDestinationPosition(long Left, long Top, long Width, long Height)// {return E_NOTIMPL;}
{
- if(!m_pQTAP && IsWindow(m_wndDestFrame.m_hWnd)) {
+ if (!m_pQTAP && IsWindow(m_wndDestFrame.m_hWnd)) {
m_wndDestFrame.MoveWindow(Left, Top, Width, Height);
- if(m_wndDestFrame.theMC) {
+ if (m_wndDestFrame.theMC) {
Rect bounds = {0,0,(short)Height,(short)Width};
MCPositionController(m_wndDestFrame.theMC, &bounds, NULL, mcTopLeftMovie|mcScaleMovieToFit);
}
@@ -258,7 +258,7 @@ STDMETHODIMP CQuicktimeGraph::SetDestinationPosition(long Left, long Top, long W }
STDMETHODIMP CQuicktimeGraph::GetVideoSize(long* pWidth, long* pHeight)
{
- if(!pWidth || !pHeight) {
+ if (!pWidth || !pHeight) {
return E_POINTER;
}
@@ -271,7 +271,7 @@ STDMETHODIMP CQuicktimeGraph::GetVideoSize(long* pWidth, long* pHeight) // IBasicAudio
STDMETHODIMP CQuicktimeGraph::put_Volume(long lVolume)
{
- if(m_wndDestFrame.theMovie) {
+ if (m_wndDestFrame.theMovie) {
short volume = (lVolume <= -10000) ? 0 : (short)(pow(10.0, lVolume/4000.0)*256);
volume = max(min(volume, 256), 0);
SetMovieVolume(m_wndDestFrame.theMovie, volume);
@@ -284,7 +284,7 @@ STDMETHODIMP CQuicktimeGraph::get_Volume(long* plVolume) {
CheckPointer(plVolume, E_POINTER);
- if(m_wndDestFrame.theMovie) {
+ if (m_wndDestFrame.theMovie) {
*plVolume = (long)GetMovieVolume(m_wndDestFrame.theMovie);
*plVolume = (long)(4000*log10(*plVolume/256.0f));
*plVolume = max(min(*plVolume, 0), -10000);
@@ -297,13 +297,13 @@ STDMETHODIMP CQuicktimeGraph::get_Volume(long* plVolume) // IVideoFrameStep
STDMETHODIMP CQuicktimeGraph::Step(DWORD dwFrames, IUnknown* pStepObject)
{
- if(pStepObject) {
+ if (pStepObject) {
return E_INVALIDARG;
}
- if(dwFrames == 0) {
+ if (dwFrames == 0) {
return S_OK;
}
- if(!m_wndDestFrame.theMovie) {
+ if (!m_wndDestFrame.theMovie) {
return E_UNEXPECTED;
}
@@ -313,23 +313,23 @@ STDMETHODIMP CQuicktimeGraph::Step(DWORD dwFrames, IUnknown* pStepObject) TimeValue myCurrTime = GetMovieTime(m_wndDestFrame.theMovie, NULL);
Fixed theRate = (int)dwFrames > 0 ? 0x00010000 : 0xffff0000;
- for(int nSteps = abs((int)dwFrames); nSteps > 0; nSteps--) {
+ for (int nSteps = abs((int)dwFrames); nSteps > 0; nSteps--) {
TimeValue myNextTime;
GetMovieNextInterestingTime(m_wndDestFrame.theMovie, nextTimeStep, 1, myTypes, myCurrTime, theRate, &myNextTime, NULL);
- if(GetMoviesError() != noErr) {
+ if (GetMoviesError() != noErr) {
return E_FAIL;
}
myCurrTime = myNextTime;
}
- if(myCurrTime >= 0 && myCurrTime < GetMovieDuration(m_wndDestFrame.theMovie)) {
+ if (myCurrTime >= 0 && myCurrTime < GetMovieDuration(m_wndDestFrame.theMovie)) {
SetMovieTimeValue(m_wndDestFrame.theMovie, myCurrTime);
- if(GetMoviesError() != noErr) {
+ if (GetMoviesError() != noErr) {
return E_FAIL;
}
// the rest is not needed when we also have m_wndDestFrame.theMC:
UpdateMovie(m_wndDestFrame.theMovie);
- if(GetMoviesError() != noErr) {
+ if (GetMoviesError() != noErr) {
return E_FAIL;
}
MoviesTask(m_wndDestFrame.theMovie, 0L);
@@ -379,7 +379,7 @@ CQuicktimeWindow::CQuicktimeWindow(CQuicktimeGraph* pGraph) void CQuicktimeWindow::ProcessMovieEvent(unsigned int message, unsigned int wParam, long lParam)
{
- if(message >= WM_MOUSEFIRST && message <= WM_MOUSELAST
+ if (message >= WM_MOUSEFIRST && message <= WM_MOUSELAST
|| message >= WM_KEYFIRST && message <= WM_KEYLAST) {
return;
}
@@ -406,7 +406,7 @@ void CQuicktimeWindow::ProcessMovieEvent(unsigned int message, unsigned int wPar LRESULT CQuicktimeWindow::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
- if(message == WM_ERASEBKGND) {
+ if (message == WM_ERASEBKGND) {
LRESULT theResult = __super::WindowProc(message, wParam, lParam);
ProcessMovieEvent(message, wParam, lParam);
return theResult;
@@ -419,16 +419,16 @@ LRESULT CQuicktimeWindow::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) OSErr CQuicktimeWindow::MyMovieDrawingCompleteProc(Movie theMovie, long refCon)
{
CQuicktimeWindow* pQW = (CQuicktimeWindow*)refCon;
- if(!pQW) {
+ if (!pQW) {
return noErr;
}
CQuicktimeGraph* pGraph = pQW->m_pGraph;
- if(!pGraph) {
+ if (!pGraph) {
return noErr;
}
- if(CComQIPtr<IQTVideoSurface> pQTVS = (IUnknown*)(INonDelegatingUnknown*)pGraph) {
+ if (CComQIPtr<IQTVideoSurface> pQTVS = (IUnknown*)(INonDelegatingUnknown*)pGraph) {
BITMAP bm;
pQW->m_bm.GetObject(sizeof(bm), &bm);
bm.bmWidth = pQW->m_size.cx;
@@ -449,16 +449,16 @@ bool CQuicktimeWindow::OpenMovie(CString fn) CComQIPtr<IQTVideoSurface> pQTVS = (IUnknown*)(INonDelegatingUnknown*)m_pGraph;
- if(!pQTVS) {
+ if (!pQTVS) {
// Set the port
SetGWorld((CGrafPtr)GetHWNDPort(m_hWnd), NULL);
}
- if(fn.Find(_T("://")) > 0) {
+ if (fn.Find(_T("://")) > 0) {
Handle myHandle = NULL;
Size mySize = fn.GetLength()+1;
myHandle = NewHandleClear(mySize);
- if(!myHandle) {
+ if (!myHandle) {
return(false);
}
@@ -468,11 +468,11 @@ bool CQuicktimeWindow::OpenMovie(CString fn) DisposeHandle(myHandle);
- if(err != noErr) {
+ if (err != noErr) {
return(false);
}
} else {
- if(!(fn.GetLength() > 0 && fn.GetLength() < 255)) {
+ if (!(fn.GetLength() > 0 && fn.GetLength() < 255)) {
return(false);
}
@@ -491,11 +491,11 @@ bool CQuicktimeWindow::OpenMovie(CString fn) // Open the movie file
short movieResFile;
OSErr err = OpenMovieFile(&sfFile, &movieResFile, fsRdPerm);
- if(err == noErr) {
+ if (err == noErr) {
err = NewMovieFromFile(&theMovie, movieResFile, 0, 0, newMovieActive, 0);
CloseMovieFile(movieResFile);
}
- if(err != noErr) {
+ if (err != noErr) {
return(false);
}
}
@@ -509,14 +509,14 @@ bool CQuicktimeWindow::OpenMovie(CString fn) Rect nrect;
GetMovieNaturalBoundsRect(theMovie, &nrect);
- if(!pQTVS) {
+ if (!pQTVS) {
theMC = NewMovieController(theMovie, &rect, mcTopLeftMovie|mcNotVisible);
- } else if(m_size.cx > 0 && m_size.cy > 0) {
+ } else if (m_size.cx > 0 && m_size.cy > 0) {
SetMovieDrawingCompleteProc(theMovie,
movieDrawingCallWhenChanged,//|movieDrawingCallAlways,
MyMovieDrawingCompleteProc, (long)this);
- if(CDC* pDC = GetDC()) {
+ if (CDC* pDC = GetDC()) {
m_dc.CreateCompatibleDC(pDC);
ReleaseDC(pDC);
@@ -560,16 +560,16 @@ bool CQuicktimeWindow::OpenMovie(CString fn) void CQuicktimeWindow::CloseMovie()
{
- if(theMC) {
+ if (theMC) {
DisposeMovieController(theMC), theMC = NULL;
}
- if(theMovie) {
+ if (theMovie) {
DisposeMovie(theMovie), theMovie = NULL;
}
m_size.SetSize(0, 0);
m_fs = State_Stopped;
- if(m_offscreenGWorld) {
+ if (m_offscreenGWorld) {
DisposeGWorld(m_offscreenGWorld), m_offscreenGWorld = NULL;
}
m_dc.DeleteDC();
@@ -578,9 +578,9 @@ void CQuicktimeWindow::CloseMovie() void CQuicktimeWindow::Run()
{
- if(theMovie) {
+ if (theMovie) {
StartMovie(theMovie);
- if(!m_idEndPoller) {
+ if (!m_idEndPoller) {
m_idEndPoller = SetTimer(1, 10, NULL); // 10ms -> 100fps max
}
}
@@ -590,9 +590,9 @@ void CQuicktimeWindow::Run() void CQuicktimeWindow::Pause()
{
- if(theMovie) {
+ if (theMovie) {
StopMovie(theMovie);
- if(m_idEndPoller) {
+ if (m_idEndPoller) {
KillTimer(m_idEndPoller), m_idEndPoller = 0;
}
}
@@ -602,10 +602,10 @@ void CQuicktimeWindow::Pause() void CQuicktimeWindow::Stop()
{
- if(theMovie) {
+ if (theMovie) {
StopMovie(theMovie);
GoToBeginningOfMovie(theMovie);
- if(m_idEndPoller) {
+ if (m_idEndPoller) {
KillTimer(m_idEndPoller), m_idEndPoller = 0;
}
}
@@ -627,13 +627,13 @@ END_MESSAGE_MAP() int CQuicktimeWindow::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
- if(__super::OnCreate(lpCreateStruct) == -1) {
+ if (__super::OnCreate(lpCreateStruct) == -1) {
return -1;
}
CComQIPtr<IQTVideoSurface> pQTVS = (IUnknown*)(INonDelegatingUnknown*)m_pGraph;
- if(!pQTVS) {
+ if (!pQTVS) {
// Create GrafPort <-> HWND association
CreatePortAssociation(m_hWnd, NULL, 0);
}
@@ -650,10 +650,10 @@ void CQuicktimeWindow::OnDestroy() CComQIPtr<IQTVideoSurface> pQTVS = (IUnknown*)(INonDelegatingUnknown*)m_pGraph;
- if(!pQTVS) {
+ if (!pQTVS) {
// Destroy the view's GrafPort <-> HWND association
- if(m_hWnd)
- if(CGrafPtr windowPort = (CGrafPtr)GetHWNDPort(m_hWnd)) {
+ if (m_hWnd)
+ if (CGrafPtr windowPort = (CGrafPtr)GetHWNDPort(m_hWnd)) {
DestroyPortAssociation(windowPort);
}
}
@@ -666,11 +666,11 @@ BOOL CQuicktimeWindow::OnEraseBkgnd(CDC* pDC) void CQuicktimeWindow::OnTimer(UINT_PTR nIDEvent)
{
- if(nIDEvent == m_idEndPoller && theMovie) {
- if(IsMovieDone(theMovie)) {
+ if (nIDEvent == m_idEndPoller && theMovie) {
+ if (IsMovieDone(theMovie)) {
Pause();
m_pGraph->NotifyEvent(EC_COMPLETE);
- } else if(CComQIPtr<IQTVideoSurface> pQTVS = (IUnknown*)(INonDelegatingUnknown*)m_pGraph) {
+ } else if (CComQIPtr<IQTVideoSurface> pQTVS = (IUnknown*)(INonDelegatingUnknown*)m_pGraph) {
MoviesTask(theMovie, 0);
/*
long duration = 0, scale = 1000;
diff --git a/src/apps/mplayerc/RealMediaGraph.cpp b/src/apps/mplayerc/RealMediaGraph.cpp index 44ffdd302..035298f63 100644 --- a/src/apps/mplayerc/RealMediaGraph.cpp +++ b/src/apps/mplayerc/RealMediaGraph.cpp @@ -62,20 +62,20 @@ bool CRealMediaPlayer::Init() CRegKey key;
- if(ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, prefs + _T("\\DT_Common"), KEY_READ)) {
+ if (ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, prefs + _T("\\DT_Common"), KEY_READ)) {
return(false);
}
TCHAR buff[_MAX_PATH];
ULONG len = sizeof(buff)/sizeof(buff[0]);
- if(ERROR_SUCCESS != key.QueryStringValue(NULL, buff, &len)) {
+ if (ERROR_SUCCESS != key.QueryStringValue(NULL, buff, &len)) {
return(false);
}
key.Close();
m_hRealMediaCore = LoadLibrary(CString(buff) + _T("pnen3260.dll"));
- if(!m_hRealMediaCore) {
+ if (!m_hRealMediaCore) {
return(false);
}
@@ -83,19 +83,19 @@ bool CRealMediaPlayer::Init() m_fpCloseEngine = (FPRMCLOSEENGINE)GetProcAddress(m_hRealMediaCore, "CloseEngine");
m_fpSetDLLAccessPath = (FPRMSETDLLACCESSPATH)GetProcAddress(m_hRealMediaCore, "SetDLLAccessPath");
- if(!m_fpCreateEngine || !m_fpCloseEngine || !m_fpSetDLLAccessPath) {
+ if (!m_fpCreateEngine || !m_fpCloseEngine || !m_fpSetDLLAccessPath) {
return(false);
}
- if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, prefs, KEY_READ)) {
+ if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, prefs, KEY_READ)) {
CString dllpaths;
len = sizeof(buff)/sizeof(buff[0]);
- for(int i = 0; ERROR_SUCCESS == key.EnumKey(i, buff, &len); i++,len = sizeof(buff)/sizeof(buff[0])) {
+ for (int i = 0; ERROR_SUCCESS == key.EnumKey(i, buff, &len); i++,len = sizeof(buff)/sizeof(buff[0])) {
CRegKey key2;
TCHAR buff2[_MAX_PATH];
ULONG len2 = sizeof(buff2)/sizeof(buff2[0]);
- if(ERROR_SUCCESS != key2.Open(HKEY_CLASSES_ROOT, prefs + _T("\\") + buff, KEY_READ)
+ if (ERROR_SUCCESS != key2.Open(HKEY_CLASSES_ROOT, prefs + _T("\\") + buff, KEY_READ)
|| ERROR_SUCCESS != key2.QueryStringValue(NULL, buff2, &len2)) {
continue;
}
@@ -105,11 +105,11 @@ bool CRealMediaPlayer::Init() key.Close();
- if(!dllpaths.IsEmpty()) {
+ if (!dllpaths.IsEmpty()) {
char* s = DNew char[dllpaths.GetLength()+1];
strcpy(s, CStringA(dllpaths));
- for(int i = 0, j = strlen(s); i < j; i++) {
- if(s[i] == '|') {
+ for (int i = 0, j = strlen(s); i < j; i++) {
+ if (s[i] == '|') {
s[i] = '\0';
}
}
@@ -118,15 +118,15 @@ bool CRealMediaPlayer::Init() }
}
- if(PNR_OK != m_fpCreateEngine(&m_pEngine)) {
+ if (PNR_OK != m_fpCreateEngine(&m_pEngine)) {
return(false);
}
- if(PNR_OK != m_pEngine->CreatePlayer(*&m_pPlayer)) {
+ if (PNR_OK != m_pEngine->CreatePlayer(*&m_pPlayer)) {
return(false);
}
- if(!(m_pSiteManager = m_pPlayer) || !(m_pCommonClassFactory = m_pPlayer)) {
+ if (!(m_pSiteManager = m_pPlayer) || !(m_pCommonClassFactory = m_pPlayer)) {
return(false);
}
@@ -138,26 +138,26 @@ bool CRealMediaPlayer::Init() // IRMAVolume::SetVolume has a huge latency when used via GetAudioVolume,
// but by lowering this audio pushdown thing it can get better
CComQIPtr<IRMAAudioPushdown, &IID_IRMAAudioPushdown> pAP = m_pAudioPlayer;
- if(pAP) {
+ if (pAP) {
pAP->SetAudioPushdown(300); // 100ms makes the playback sound choppy, 200ms looks ok, but for safety we set this to 300ms... :P
}
CComQIPtr<IRMAErrorSinkControl, &IID_IRMAErrorSinkControl> pErrorSinkControl = m_pPlayer;
- if(pErrorSinkControl) {
+ if (pErrorSinkControl) {
pErrorSinkControl->AddErrorSink(static_cast<IRMAErrorSink*>(this), PNLOG_EMERG, PNLOG_INFO);
}
- if(PNR_OK != m_pPlayer->AddAdviseSink(static_cast<IRMAClientAdviseSink*>(this))) {
+ if (PNR_OK != m_pPlayer->AddAdviseSink(static_cast<IRMAClientAdviseSink*>(this))) {
return(false);
}
- if(PNR_OK != m_pPlayer->SetClientContext((IUnknown*)(INonDelegatingUnknown*)(this))) {
+ if (PNR_OK != m_pPlayer->SetClientContext((IUnknown*)(INonDelegatingUnknown*)(this))) {
return(false);
}
// TODO
/*
- if(CComQIPtr<IRMAPreferences, &IID_IRMAPreferences> pPrefs = m_pPlayer)
+ if (CComQIPtr<IRMAPreferences, &IID_IRMAPreferences> pPrefs = m_pPlayer)
{
CComPtr<IRMABuffer> pBuffer;
HRESULT hr = pPrefs->ReadPref("HTTPProxyHost", *&pBuffer);
@@ -187,11 +187,11 @@ bool CRealMediaPlayer::Init() void CRealMediaPlayer::Deinit()
{
- if(m_pPlayer) {
+ if (m_pPlayer) {
m_pPlayer->Stop();
CComQIPtr<IRMAErrorSinkControl, &IID_IRMAErrorSinkControl> pErrorSinkControl = m_pPlayer;
- if(pErrorSinkControl) {
+ if (pErrorSinkControl) {
pErrorSinkControl->RemoveErrorSink(static_cast<IRMAErrorSink*>(this));
}
@@ -209,12 +209,12 @@ void CRealMediaPlayer::Deinit() m_pPlayer = NULL;
}
- if(m_pEngine) {
+ if (m_pEngine) {
m_fpCloseEngine(m_pEngine);
m_pEngine.Detach();
}
- if(m_hRealMediaCore) {
+ if (m_hRealMediaCore) {
FreeLibrary(m_hRealMediaCore);
m_hRealMediaCore = NULL;
}
@@ -238,7 +238,7 @@ char* AllocateErrorMessage(const char* msg) {
char* errmsg = NULL;
int len = strlen(msg);
- if(len > 0) {
+ if (len > 0) {
errmsg = (char*)CoTaskMemAlloc(len+1);
if (errmsg) {
strcpy(errmsg, msg);
@@ -252,16 +252,16 @@ STDMETHODIMP CRealMediaPlayer::ErrorOccurred(const UINT8 unSeverity, const UINT3 {
char* errmsg = NULL;
- if(unSeverity < 5) {
- if(CComQIPtr<IRMAErrorMessages, &IID_IRMAErrorMessages> pErrorMessages = m_pPlayer) {
+ if (unSeverity < 5) {
+ if (CComQIPtr<IRMAErrorMessages, &IID_IRMAErrorMessages> pErrorMessages = m_pPlayer) {
CComPtr<IRMABuffer> pBuffer = pErrorMessages->GetErrorText(ulRMACode);
- if(pBuffer) {
+ if (pBuffer) {
char* buff = (char*)pBuffer->GetBuffer();
errmsg = AllocateErrorMessage(buff);
}
}
- if(!errmsg) {
+ if (!errmsg) {
errmsg = AllocateErrorMessage("RealMedia error");
TRACE("RealMedia error\n");
}
@@ -306,7 +306,7 @@ STDMETHODIMP CRealMediaPlayer::OnStop() {
m_nCurrent = 0;
m_State = State_Stopped;
- if(m_UserState != State_Stopped) {
+ if (m_UserState != State_Stopped) {
m_pRMG->NotifyEvent(EC_COMPLETE);
}
return PNR_OK;
@@ -336,7 +336,7 @@ STDMETHODIMP CRealMediaPlayer::HandleAuthenticationRequest(IRMAAuthenticationMan {
CAuthDlg dlg;
- if(dlg.DoModal() == IDOK) {
+ if (dlg.DoModal() == IDOK) {
pResponse->AuthenticationRequestDone(
PNR_OK, CStringA(dlg.m_username), CStringA(dlg.m_password));
return PNR_OK;
@@ -348,29 +348,29 @@ STDMETHODIMP CRealMediaPlayer::HandleAuthenticationRequest(IRMAAuthenticationMan // IRMASiteSupplier
STDMETHODIMP CRealMediaPlayer::SitesNeeded(UINT32 uRequestID, IRMAValues* pProps)
{
- if(!pProps) {
+ if (!pProps) {
return PNR_INVALID_PARAMETER;
}
- if(m_pTheSite || m_pTheSite2 || !m_hWndParent) {
+ if (m_pTheSite || m_pTheSite2 || !m_hWndParent) {
return PNR_UNEXPECTED;
}
HRESULT hr = PNR_OK;
- if(!CreateSite(&m_pTheSite)) {
+ if (!CreateSite(&m_pTheSite)) {
return E_FAIL;
}
ULONG refc = ((IRMASite*)m_pTheSite)->AddRef();
refc = ((IRMASite*)m_pTheSite)->Release();
- if(!(m_pTheSite2 = m_pTheSite)) {
+ if (!(m_pTheSite2 = m_pTheSite)) {
return E_NOINTERFACE;
}
CComQIPtr<IRMAValues, &IID_IRMAValues> pSiteProps = m_pTheSite;
- if(!pSiteProps) {
+ if (!pSiteProps) {
return E_NOINTERFACE;
}
@@ -378,12 +378,12 @@ STDMETHODIMP CRealMediaPlayer::SitesNeeded(UINT32 uRequestID, IRMAValues* pProps // no idea what these supposed to do... but they were in the example
hr = pProps->GetPropertyCString("playto", pValue);
- if(PNR_OK == hr) {
+ if (PNR_OK == hr) {
pSiteProps->SetPropertyCString("channel", pValue);
pValue->Release();
} else {
hr = pProps->GetPropertyCString("name", pValue);
- if(PNR_OK == hr) {
+ if (PNR_OK == hr) {
pSiteProps->SetPropertyCString("LayoutGroup", pValue);
pValue->Release();
}
@@ -392,7 +392,7 @@ STDMETHODIMP CRealMediaPlayer::SitesNeeded(UINT32 uRequestID, IRMAValues* pProps m_pTheSite2->AddPassiveSiteWatcher(static_cast<IRMAPassiveSiteWatcher*>(this));
hr = m_pSiteManager->AddSite(m_pTheSite);
- if(PNR_OK != hr) {
+ if (PNR_OK != hr) {
return hr;
}
@@ -404,7 +404,7 @@ STDMETHODIMP CRealMediaPlayer::SitesNeeded(UINT32 uRequestID, IRMAValues* pProps STDMETHODIMP CRealMediaPlayer::SitesNotNeeded(UINT32 uRequestID)
{
IRMASite* pSite;
- if(!m_CreatedSites.Lookup(uRequestID, pSite)) {
+ if (!m_CreatedSites.Lookup(uRequestID, pSite)) {
return PNR_INVALID_PARAMETER;
}
@@ -427,7 +427,7 @@ STDMETHODIMP CRealMediaPlayer::BeginChangeLayout() }
STDMETHODIMP CRealMediaPlayer::DoneChangeLayout()
{
- if(m_fVideoSizeChanged) {
+ if (m_fVideoSizeChanged) {
m_pRMG->NotifyEvent(EC_VIDEO_SIZE_CHANGED, MAKELPARAM(m_VideoSize.cx, m_VideoSize.cy), 0);
m_fVideoSizeChanged = false;
}
@@ -442,7 +442,7 @@ STDMETHODIMP CRealMediaPlayer::PositionChanged(PNxPoint* pos) }
STDMETHODIMP CRealMediaPlayer::SizeChanged(PNxSize* size)
{
- if(m_VideoSize.cx == 0 || m_VideoSize.cy == 0) {
+ if (m_VideoSize.cx == 0 || m_VideoSize.cy == 0) {
m_fVideoSizeChanged = true;
m_VideoSize.cx = size->cx;
m_VideoSize.cy = size->cy;
@@ -468,12 +468,12 @@ STDMETHODIMP CRealMediaPlayer::OnInit(RMAAudioFormat* pFormat) CRealMediaPlayerWindowed::CRealMediaPlayerWindowed(HWND hWndParent, CRealMediaGraph* pRMG)
: CRealMediaPlayer(hWndParent, pRMG)
{
- if(!m_wndWindowFrame.CreateEx(WS_EX_NOPARENTNOTIFY, NULL, NULL, WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_VISIBLE,
+ if (!m_wndWindowFrame.CreateEx(WS_EX_NOPARENTNOTIFY, NULL, NULL, WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_VISIBLE,
CRect(0, 0, 0, 0), CWnd::FromHandle(m_hWndParent), 0, NULL)) {
return;
}
- if(!m_wndDestFrame.Create(NULL, NULL, WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN,
+ if (!m_wndDestFrame.Create(NULL, NULL, WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN,
CRect(0, 0, 0, 0), &m_wndWindowFrame, 0, NULL)) {
return;
}
@@ -487,18 +487,18 @@ CRealMediaPlayerWindowed::~CRealMediaPlayerWindowed() void CRealMediaPlayerWindowed::SetWindowRect(CRect r)
{
- if(IsWindow(m_wndWindowFrame.m_hWnd)) {
+ if (IsWindow(m_wndWindowFrame.m_hWnd)) {
m_wndWindowFrame.MoveWindow(r);
}
}
void CRealMediaPlayerWindowed::SetDestRect(CRect r)
{
- if(IsWindow(m_wndDestFrame.m_hWnd)) {
+ if (IsWindow(m_wndDestFrame.m_hWnd)) {
m_wndDestFrame.MoveWindow(r);
}
- if(m_pTheSite) {
+ if (m_pTheSite) {
PNxSize s = {r.Width(), r.Height()};
m_pTheSite->SetSize(s);
}
@@ -506,20 +506,20 @@ void CRealMediaPlayerWindowed::SetDestRect(CRect r) bool CRealMediaPlayerWindowed::CreateSite(IRMASite** ppSite)
{
- if(!ppSite) {
+ if (!ppSite) {
return(false);
}
CComPtr<IRMASiteWindowed> pSiteWindowed;
- if(PNR_OK != m_pCommonClassFactory->CreateInstance(CLSID_IRMASiteWindowed, (void**)&pSiteWindowed)) {
+ if (PNR_OK != m_pCommonClassFactory->CreateInstance(CLSID_IRMASiteWindowed, (void**)&pSiteWindowed)) {
return(false);
}
DWORD style = WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN;
- if(!AfxGetAppSettings().fIntRealMedia) {
+ if (!AfxGetAppSettings().fIntRealMedia) {
style |= WS_DISABLED;
}
- if(PNR_OK != pSiteWindowed->Create(m_wndDestFrame.m_hWnd, style)) {
+ if (PNR_OK != pSiteWindowed->Create(m_wndDestFrame.m_hWnd, style)) {
return(false);
}
@@ -529,7 +529,7 @@ bool CRealMediaPlayerWindowed::CreateSite(IRMASite** ppSite) void CRealMediaPlayerWindowed::DestroySite(IRMASite* pSite)
{
- if(CComQIPtr<IRMASiteWindowed, &IID_IRMASiteWindowed> pRMASiteWindowed = pSite) {
+ if (CComQIPtr<IRMASiteWindowed, &IID_IRMASiteWindowed> pRMASiteWindowed = pSite) {
pRMASiteWindowed->Destroy();
}
}
@@ -543,15 +543,15 @@ CRealMediaPlayerWindowless::CRealMediaPlayerWindowless(HWND hWndParent, CRealMed AppSettings& s = AfxGetAppSettings();
bool bFullscreen = (AfxGetApp()->m_pMainWnd != NULL) && (((CMainFrame*)AfxGetApp()->m_pMainWnd)->IsD3DFullScreenMode());
- switch(s.iRMVideoRendererType) {
+ switch (s.iRMVideoRendererType) {
default:
case VIDRNDT_RM_DX7:
- if(FAILED(CreateAP7(CLSID_RM7AllocatorPresenter, hWndParent, &m_pRMAP))) {
+ if (FAILED(CreateAP7(CLSID_RM7AllocatorPresenter, hWndParent, &m_pRMAP))) {
return;
}
break;
case VIDRNDT_RM_DX9:
- if(FAILED(CreateAP9(CLSID_RM9AllocatorPresenter, hWndParent, bFullscreen, &m_pRMAP))) {
+ if (FAILED(CreateAP9(CLSID_RM9AllocatorPresenter, hWndParent, bFullscreen, &m_pRMAP))) {
return;
}
break;
@@ -573,7 +573,7 @@ STDMETHODIMP CRealMediaPlayerWindowless::NonDelegatingQueryInterface(REFIID riid bool CRealMediaPlayerWindowless::CreateSite(IRMASite** ppSite)
{
- if(!ppSite || !m_pRMAP) {
+ if (!ppSite || !m_pRMAP) {
return(false);
}
@@ -583,7 +583,7 @@ bool CRealMediaPlayerWindowless::CreateSite(IRMASite** ppSite) CComPtr<IRMASiteWindowless> pSiteWindowless;
pSiteWindowless = (IRMASiteWindowless*)(pWMWlS = DNew CRealMediaWindowlessSite(hr, m_pPlayer, NULL, NULL));
- if(FAILED(hr)) {
+ if (FAILED(hr)) {
return(false);
}
@@ -599,7 +599,7 @@ void CRealMediaPlayerWindowless::DestroySite(IRMASite* pSite) STDMETHODIMP CRealMediaPlayerWindowless::SizeChanged(PNxSize* size)
{
- if(CComQIPtr<IRMAVideoSurface, &IID_IRMAVideoSurface> pRMAVS = m_pRMAP) {
+ if (CComQIPtr<IRMAVideoSurface, &IID_IRMAVideoSurface> pRMAVS = m_pRMAP) {
RMABitmapInfoHeader BitmapInfo;
memset(&BitmapInfo, 0, sizeof(BitmapInfo));
BitmapInfo.biWidth = size->cx;
@@ -622,12 +622,12 @@ CRealMediaGraph::CRealMediaGraph(HWND hWndParent, HRESULT& hr) ? (CRealMediaPlayer*)DNew CRealMediaPlayerWindowed(hWndParent, this)
: (CRealMediaPlayer*)DNew CRealMediaPlayerWindowless(hWndParent, this);
- if(!m_pRMP) {
+ if (!m_pRMP) {
hr = E_OUTOFMEMORY;
return;
}
- if(!m_pRMP->Init()) {
+ if (!m_pRMP->Init()) {
delete m_pRMP, m_pRMP = NULL;
hr = E_FAIL;
return;
@@ -638,7 +638,7 @@ CRealMediaGraph::CRealMediaGraph(HWND hWndParent, HRESULT& hr) CRealMediaGraph::~CRealMediaGraph()
{
- if(m_pRMP) {
+ if (m_pRMP) {
m_pRMP->Deinit();
m_pRMP->Release();
m_pRMP = NULL;
@@ -663,7 +663,7 @@ STDMETHODIMP CRealMediaGraph::RenderFile(LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPla WideCharToMultiByte(GetACP(), 0, lpcwstrFile, -1, buff, _MAX_PATH, 0, 0);
CStringA fn(buff);
- if(fn.Find("://") < 0) {
+ if (fn.Find("://") < 0) {
fn = "file://" + fn;
}
@@ -671,7 +671,7 @@ STDMETHODIMP CRealMediaGraph::RenderFile(LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPla ClearMessageQueue();
- if(PNR_OK != m_pRMP->m_pPlayer->OpenURL(fn)) {
+ if (PNR_OK != m_pRMP->m_pPlayer->OpenURL(fn)) {
return E_FAIL;
}
@@ -683,7 +683,7 @@ STDMETHODIMP CRealMediaGraph::RenderFile(LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPla // IMediaControl
STDMETHODIMP CRealMediaGraph::Run()
{
- if(m_pRMP->m_pPlayer->IsDone()) {
+ if (m_pRMP->m_pPlayer->IsDone()) {
RenderFile(m_fn, NULL);
}
@@ -723,7 +723,7 @@ STDMETHODIMP CRealMediaGraph::SetPositions(LONGLONG* pCurrent, DWORD dwCurrentFl // IVideoWindow
STDMETHODIMP CRealMediaGraph::SetWindowPosition(long Left, long Top, long Width, long Height)
{
- if(m_pRMP) {
+ if (m_pRMP) {
m_pRMP->SetWindowRect(CRect(CPoint(Left, Top), CSize(Width, Height)));
}
@@ -738,7 +738,7 @@ STDMETHODIMP CRealMediaGraph::SetDestinationPosition(long Left, long Top, long W }
STDMETHODIMP CRealMediaGraph::GetVideoSize(long* pWidth, long* pHeight)
{
- if(!pWidth || !pHeight) {
+ if (!pWidth || !pHeight) {
return E_POINTER;
}
*pWidth = m_pRMP->GetVideoSize().cx;
@@ -749,7 +749,9 @@ STDMETHODIMP CRealMediaGraph::GetVideoSize(long* pWidth, long* pHeight) // IBasicAudio
STDMETHODIMP CRealMediaGraph::put_Volume(long lVolume)
{
- if(!m_pRMP->m_pVolume) return E_UNEXPECTED;
+ if (!m_pRMP->m_pVolume) {
+ return E_UNEXPECTED;
+ }
UINT16 volume = (lVolume <= -10000) ? 0 : (UINT16)(pow(10.0, lVolume/4000.0)*100);
volume = max(min(volume, 100), 0);
@@ -758,7 +760,9 @@ STDMETHODIMP CRealMediaGraph::put_Volume(long lVolume) }
STDMETHODIMP CRealMediaGraph::get_Volume(long* plVolume)
{
- if(!m_pRMP->m_pVolume) return E_UNEXPECTED;
+ if (!m_pRMP->m_pVolume) {
+ return E_UNEXPECTED;
+ }
CheckPointer(plVolume, E_POINTER);
diff --git a/src/apps/mplayerc/RealMediaWindowlessSite.cpp b/src/apps/mplayerc/RealMediaWindowlessSite.cpp index 7fe4085bb..14d6b38bc 100644 --- a/src/apps/mplayerc/RealMediaWindowlessSite.cpp +++ b/src/apps/mplayerc/RealMediaWindowlessSite.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -49,12 +49,12 @@ void DSObjects::ExtractRects(REGION* pRegion) pRegion->extents.right = lpRgnData->rdh.rcBound.right;
pRegion->extents.bottom = lpRgnData->rdh.rcBound.bottom;
- if(lpRgnData->rdh.nCount) {
+ if (lpRgnData->rdh.nCount) {
pRegion->rects = DNew PNxRect[lpRgnData->rdh.nCount];
// now extract the information.
- for(int j = 0; j < (int) lpRgnData->rdh.nCount; j++) {
+ for (int j = 0; j < (int) lpRgnData->rdh.nCount; j++) {
RECT* pRect = (RECT*)lpRgnData->Buffer;
pRegion->rects[j].left = pRect[j].left;
pRegion->rects[j].top = pRect[j].top;
@@ -94,7 +94,7 @@ BOOL DSObjects::RMAEqualRegion(REGION* reg1, REGION* reg2) }
void DSObjects::RMADestroyRegion(REGION* reg)
{
- if(reg) DeleteObject((HRGN)reg->pOSRegion),
+ if (reg) DeleteObject((HRGN)reg->pOSRegion),
PN_VECTOR_DELETE(reg->rects);
PN_DELETE(reg);
}
@@ -123,7 +123,7 @@ CRealMediaWindowlessSite::CRealMediaWindowlessSite(HRESULT& hr, IUnknown* pConte hr = S_OK;
- if(!m_pContext || !m_pCCF) {
+ if (!m_pContext || !m_pCCF) {
hr = E_POINTER;
return;
}
@@ -134,7 +134,7 @@ CRealMediaWindowlessSite::CRealMediaWindowlessSite(HRESULT& hr, IUnknown* pConte CRealMediaWindowlessSite::~CRealMediaWindowlessSite()
{
POSITION pos = m_pChildren.GetHeadPosition();
- while(pos) {
+ while (pos) {
DestroyChild(m_pChildren.GetNext(pos));
}
@@ -160,7 +160,7 @@ void CRealMediaWindowlessSite::GetTopLeft(PNxPoint* pPoint) pPoint->x += m_position.x;
pPoint->y += m_position.y;
- if(m_pParentSite) {
+ if (m_pParentSite) {
m_pParentSite->GetTopLeft(pPoint);
}
}
@@ -174,7 +174,7 @@ REGION* CRealMediaWindowlessSite::GetRegion() void CRealMediaWindowlessSite::RecomputeRegion()
{
- if(m_pParentSite) {
+ if (m_pParentSite) {
m_pParentSite->RecomputeRegion();
} else {
InternalRecomputeRegion();
@@ -186,9 +186,9 @@ void CRealMediaWindowlessSite::InternalRecomputeRegion() ComputeRegion();
POSITION pos = m_pChildren.GetHeadPosition();
- while(pos) {
+ while (pos) {
CRealMediaWindowlessSite* pSite = (CRealMediaWindowlessSite*)(IRMASite*)m_pChildren.GetNext(pos);
- if(pSite) {
+ if (pSite) {
pSite->InternalRecomputeRegion();
}
}
@@ -198,33 +198,33 @@ void CRealMediaWindowlessSite::ComputeRegion() {
REGION* pTempRegion = NULL;
- if(m_pRegion) {
+ if (m_pRegion) {
pTempRegion = RMACreateRegion();
RMAUnionRegion(pTempRegion, m_pRegion, pTempRegion);
RMADestroyRegion(m_pRegion);
}
- if(m_pRegionWithoutChildren) {
+ if (m_pRegionWithoutChildren) {
RMADestroyRegion(m_pRegionWithoutChildren);
}
PNxPoint topleft = {0,0};
GetTopLeft(&topleft);
- if(IsSiteVisible()) {
+ if (IsSiteVisible()) {
m_pRegionWithoutChildren = RMACreateRectRegion(topleft.x, topleft.y, topleft.x + m_size.cx, topleft.y + m_size.cy);
- if(m_pParentSite) {
+ if (m_pParentSite) {
RMAIntersectRegion(m_pRegionWithoutChildren, m_pParentSite->m_pRegionWithoutChildren, m_pRegionWithoutChildren);
POSITION pos = m_pParentSite->m_pChildren.GetHeadPosition();
- while(pos) {
+ while (pos) {
CRealMediaWindowlessSite* pSiblingSite = (CRealMediaWindowlessSite*)(IRMASite*)m_pParentSite->m_pChildren.GetNext(pos);
- if(pSiblingSite != this) {
+ if (pSiblingSite != this) {
INT32 zOrder;
pSiblingSite->GetZOrder(zOrder);
- if(zOrder > m_lZOrder && pSiblingSite->IsSiteVisible()) {
+ if (zOrder > m_lZOrder && pSiblingSite->IsSiteVisible()) {
pSiblingSite->SubtractSite(m_pRegionWithoutChildren);
}
}
@@ -235,9 +235,9 @@ void CRealMediaWindowlessSite::ComputeRegion() RMAUnionRegion(m_pRegion, m_pRegionWithoutChildren, m_pRegion);
POSITION pos = m_pChildren.GetHeadPosition();
- while(pos) {
+ while (pos) {
CRealMediaWindowlessSite* pChildSite = (CRealMediaWindowlessSite*)(IRMASite*)m_pChildren.GetNext(pos);
- if(pChildSite->IsSiteVisible()) {
+ if (pChildSite->IsSiteVisible()) {
pChildSite->SubtractSite(m_pRegion);
}
}
@@ -246,7 +246,7 @@ void CRealMediaWindowlessSite::ComputeRegion() m_pRegion = RMACreateRectRegion(0,0,0,0);
}
- if(pTempRegion && !RMAEqualRegion(m_pRegion, pTempRegion)) {
+ if (pTempRegion && !RMAEqualRegion(m_pRegion, pTempRegion)) {
ForceRedraw();
}
@@ -268,19 +268,19 @@ void CRealMediaWindowlessSite::SubtractSite(REGION* pRegion) void CRealMediaWindowlessSite::UpdateZOrder(CRealMediaWindowlessSite* pUpdatedChildSite, INT32 lOldZOrder, INT32 lNewZOrder)
{
POSITION pos = m_pChildren.GetHeadPosition();
- while(pos) {
+ while (pos) {
CRealMediaWindowlessSite* pSite = (CRealMediaWindowlessSite*)(IRMASite*)m_pChildren.GetNext(pos);
INT32 lItsOldZOrder;
pSite->GetZOrder(lItsOldZOrder);
- if(pSite != pUpdatedChildSite) {
- if(lOldZOrder < lNewZOrder) {
- if(lItsOldZOrder >= lOldZOrder && lItsOldZOrder < lNewZOrder) {
+ if (pSite != pUpdatedChildSite) {
+ if (lOldZOrder < lNewZOrder) {
+ if (lItsOldZOrder >= lOldZOrder && lItsOldZOrder < lNewZOrder) {
pSite->SetInternalZOrder(lItsOldZOrder-1);
}
} else {
- if(lItsOldZOrder >= lNewZOrder && lItsOldZOrder < lOldZOrder) {
+ if (lItsOldZOrder >= lNewZOrder && lItsOldZOrder < lOldZOrder) {
pSite->SetInternalZOrder(lItsOldZOrder+1);
}
}
@@ -313,15 +313,15 @@ STDMETHODIMP CRealMediaWindowlessSite::AttachUser(IRMASiteUser* /*IN*/ pUser) {
HRESULT hr = PNR_FAIL;
- if(m_pUser) {
+ if (m_pUser) {
return PNR_UNEXPECTED;
}
- if(CComQIPtr<IRMASite, &IID_IRMASite> pOuterSite = GetOwner()) {
+ if (CComQIPtr<IRMASite, &IID_IRMASite> pOuterSite = GetOwner()) {
hr = pUser->AttachSite(pOuterSite);
}
- if(PNR_OK == hr) {
+ if (PNR_OK == hr) {
m_pUser = pUser;
}
@@ -332,13 +332,13 @@ STDMETHODIMP CRealMediaWindowlessSite::DetachUser() {
HRESULT hr = PNR_OK;
- if(!m_pUser) {
+ if (!m_pUser) {
return PNR_UNEXPECTED;
}
hr = m_pUser->DetachSite();
- if(PNR_OK == hr) {
+ if (PNR_OK == hr) {
m_pUser = NULL;
}
@@ -349,7 +349,7 @@ STDMETHODIMP CRealMediaWindowlessSite::GetUser(REF(IRMASiteUser*) /*OUT*/ pUser) {
HRESULT hr = PNR_OK;
- if(!m_pUser) {
+ if (!m_pUser) {
return PNR_UNEXPECTED;
}
@@ -365,7 +365,7 @@ STDMETHODIMP CRealMediaWindowlessSite::CreateChild(REF(IRMASite*) /*OUT*/ pChild CComPtr<IRMASite> pSite =
(IRMASite*)DNew CRealMediaWindowlessSite(hr, m_pContext, this);
- if(FAILED(hr) || !pSite) {
+ if (FAILED(hr) || !pSite) {
return E_FAIL;
}
@@ -378,7 +378,7 @@ STDMETHODIMP CRealMediaWindowlessSite::CreateChild(REF(IRMASite*) /*OUT*/ pChild STDMETHODIMP CRealMediaWindowlessSite::DestroyChild(IRMASite* /*IN*/ pChildSite)
{
- if(POSITION pos = m_pChildren.Find(pChildSite)) {
+ if (POSITION pos = m_pChildren.Find(pChildSite)) {
m_pChildren.RemoveAt(pos);
return PNR_OK;
}
@@ -388,11 +388,11 @@ STDMETHODIMP CRealMediaWindowlessSite::DestroyChild(IRMASite* /*IN*/ pChildSite) STDMETHODIMP CRealMediaWindowlessSite::AttachWatcher(IRMASiteWatcher* /*IN*/ pWatcher)
{
- if(m_pWatcher) {
+ if (m_pWatcher) {
return PNR_UNEXPECTED;
}
- if(m_pWatcher = pWatcher) {
+ if (m_pWatcher = pWatcher) {
m_pWatcher->AttachSite((IRMASite*)this);
}
@@ -401,7 +401,7 @@ STDMETHODIMP CRealMediaWindowlessSite::AttachWatcher(IRMASiteWatcher* /*IN*/ pWa STDMETHODIMP CRealMediaWindowlessSite::DetachWatcher()
{
- if(!m_pWatcher) {
+ if (!m_pWatcher) {
return PNR_UNEXPECTED;
}
@@ -415,15 +415,15 @@ STDMETHODIMP CRealMediaWindowlessSite::SetPosition(PNxPoint position) {
HRESULT hr = PNR_OK;
- if(m_pWatcher) {
+ if (m_pWatcher) {
hr = m_pWatcher->ChangingPosition(m_position, position);
}
- if(PNR_OK == hr) {
+ if (PNR_OK == hr) {
m_position = position;
POSITION pos = m_pPassiveWatchers.GetHeadPosition();
- while(pos) {
+ while (pos) {
m_pPassiveWatchers.GetNext(pos)->PositionChanged(&position);
}
@@ -443,15 +443,15 @@ STDMETHODIMP CRealMediaWindowlessSite::SetSize(PNxSize size) {
HRESULT hr = PNR_OK;
- if(m_pWatcher) {
+ if (m_pWatcher) {
hr = m_pWatcher->ChangingSize(m_size, size);
}
- if(PNR_OK == hr && size.cx != 0 && size.cy != 0) {
+ if (PNR_OK == hr && size.cx != 0 && size.cy != 0) {
m_size = size;
POSITION pos = m_pPassiveWatchers.GetHeadPosition();
- while(pos) {
+ while (pos) {
m_pPassiveWatchers.GetNext(pos)->SizeChanged(&size);
}
@@ -482,7 +482,7 @@ STDMETHODIMP CRealMediaWindowlessSite::DamageRegion(PNxRegion region) STDMETHODIMP CRealMediaWindowlessSite::ForceRedraw()
{
// make sure we have a visible window and are not re-entering and we have damage
- if(!m_fInRedraw && m_fDamaged && m_fIsVisible) {
+ if (!m_fInRedraw && m_fDamaged && m_fIsVisible) {
m_fInRedraw = TRUE;
PNxEvent event = {RMA_SURFACE_UPDATE, NULL, (IRMAVideoSurface*)this, NULL, 0, 0};
@@ -512,7 +512,7 @@ STDMETHODIMP CRealMediaWindowlessSite::ShowSite(BOOL bShow) STDMETHODIMP_(BOOL) CRealMediaWindowlessSite::IsSiteVisible()
{
BOOL fIsVisible = m_fIsVisible;
- if(m_pParentSite) {
+ if (m_pParentSite) {
fIsVisible = fIsVisible && m_pParentSite->IsSiteVisible();
}
return fIsVisible;
@@ -520,15 +520,15 @@ STDMETHODIMP_(BOOL) CRealMediaWindowlessSite::IsSiteVisible() STDMETHODIMP CRealMediaWindowlessSite::SetZOrder(INT32 lZOrder)
{
- if(!m_pParentSite) {
+ if (!m_pParentSite) {
return PNR_UNEXPECTED;
}
- if(lZOrder == -1 || lZOrder >= (INT32)m_pParentSite->GetNumberOfChildSites()) {
+ if (lZOrder == -1 || lZOrder >= (INT32)m_pParentSite->GetNumberOfChildSites()) {
lZOrder = m_pParentSite->GetNumberOfChildSites() - 1;
}
- if(m_lZOrder != lZOrder) {
+ if (m_lZOrder != lZOrder) {
m_pParentSite->UpdateZOrder(this, m_lZOrder, lZOrder);
}
@@ -539,7 +539,7 @@ STDMETHODIMP CRealMediaWindowlessSite::SetZOrder(INT32 lZOrder) STDMETHODIMP CRealMediaWindowlessSite::GetZOrder(REF(INT32) lZOrder)
{
- if(!m_pParentSite) {
+ if (!m_pParentSite) {
return PNR_UNEXPECTED;
}
lZOrder = m_lZOrder;
@@ -548,7 +548,7 @@ STDMETHODIMP CRealMediaWindowlessSite::GetZOrder(REF(INT32) lZOrder) STDMETHODIMP CRealMediaWindowlessSite::MoveSiteToTop()
{
- if(!m_pParentSite) {
+ if (!m_pParentSite) {
return PNR_UNEXPECTED;
}
return PNR_NOTIMPL;
@@ -573,7 +573,7 @@ STDMETHODIMP CRealMediaWindowlessSite::AddPassiveSiteWatcher(IRMAPassiveSiteWatc STDMETHODIMP CRealMediaWindowlessSite::RemovePassiveSiteWatcher(IRMAPassiveSiteWatcher* pWatcher)
{
- if(POSITION pos = m_pPassiveWatchers.Find(pWatcher)) {
+ if (POSITION pos = m_pPassiveWatchers.Find(pWatcher)) {
m_pPassiveWatchers.RemoveAt(pos);
return PNR_OK;
}
@@ -602,10 +602,10 @@ bool CRealMediaWindowlessSite::GetBltService(IRMAVideoSurface** ppBltService) {
bool fRet = false;
- if(ppBltService) {
- if(m_pParentSite) {
+ if (ppBltService) {
+ if (m_pParentSite) {
fRet = m_pParentSite->GetBltService(ppBltService);
- } else if(m_pBltService) {
+ } else if (m_pBltService) {
(*ppBltService = m_pBltService)->AddRef();
fRet = true;
}
@@ -629,7 +629,7 @@ STDMETHODIMP CRealMediaWindowlessSite::Blt(UCHAR* /*IN*/ pImageData, RMABitmapIn STDMETHODIMP CRealMediaWindowlessSite::BeginOptimizedBlt(RMABitmapInfoHeader* /*IN*/ pBitmapInfo)
{
- if(memcmp(&m_bitmapInfo, pBitmapInfo, sizeof(RMABitmapInfoHeader))) {
+ if (memcmp(&m_bitmapInfo, pBitmapInfo, sizeof(RMABitmapInfoHeader))) {
memcpy(&m_bitmapInfo, pBitmapInfo, sizeof(RMABitmapInfoHeader));
// format of image has changed somehow.
@@ -639,13 +639,13 @@ STDMETHODIMP CRealMediaWindowlessSite::BeginOptimizedBlt(RMABitmapInfoHeader* /* /*
CComPtr<IRMAVideoSurface> pBltService;
GetBltService(&pBltService);
- if(!pBltService)
+ if (!pBltService)
return PNR_UNEXPECTED;
RMA_COMPRESSION_TYPE ulType = (RMA_COMPRESSION_TYPE)-1;
pBltService->GetPreferredFormat(ulType);
- if(pBitmapInfo->biCompression != ulType)
+ if (pBitmapInfo->biCompression != ulType)
return PNR_UNEXPECTED;
*/
return PNR_OK;
@@ -658,7 +658,7 @@ STDMETHODIMP CRealMediaWindowlessSite::OptimizedBlt(UCHAR* /*IN*/ pImageBits, RE REGION* pRegion = GetRegion();
- if(!pBltService || !pRegion) {
+ if (!pBltService || !pRegion) {
return PNR_UNEXPECTED;
}
@@ -671,7 +671,7 @@ STDMETHODIMP CRealMediaWindowlessSite::OptimizedBlt(UCHAR* /*IN*/ pImageBits, RE adjustedDestRect.right = rDestRect.right + origin.x;
adjustedDestRect.bottom = rDestRect.bottom + origin.y;
- for(int i = 0; i < pRegion->numRects; i++) {
+ for (int i = 0; i < pRegion->numRects; i++) {
PNxRect* pRect = pRegion->rects+i;
// intersect the dest rect with the rect from the
@@ -711,7 +711,7 @@ STDMETHODIMP CRealMediaWindowlessSite::GetPreferredFormat(REF(RMA_COMPRESSION_TY {
CComPtr<IRMAVideoSurface> pBltService;
GetBltService(&pBltService);
- if(!pBltService) {
+ if (!pBltService) {
return PNR_UNEXPECTED;
}
diff --git a/src/apps/mplayerc/RegFilterChooserDlg.cpp b/src/apps/mplayerc/RegFilterChooserDlg.cpp index d99fb16a3..ae55f3034 100644 --- a/src/apps/mplayerc/RegFilterChooserDlg.cpp +++ b/src/apps/mplayerc/RegFilterChooserDlg.cpp @@ -40,7 +40,7 @@ CRegFilterChooserDlg::CRegFilterChooserDlg(CWnd* pParent /*=NULL*/) CRegFilterChooserDlg::~CRegFilterChooserDlg()
{
POSITION pos = m_filters.GetHeadPosition();
- while(pos) {
+ while (pos) {
delete m_filters.GetNext(pos);
}
}
@@ -54,9 +54,9 @@ void CRegFilterChooserDlg::DoDataExchange(CDataExchange* pDX) void CRegFilterChooserDlg::AddToList(IMoniker* pMoniker)
{
CComPtr<IPropertyBag> pPB;
- if(SUCCEEDED(pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void**)&pPB))) {
+ if (SUCCEEDED(pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void**)&pPB))) {
CComVariant var;
- if(SUCCEEDED(pPB->Read(CComBSTR(_T("FriendlyName")), &var, NULL))) {
+ if (SUCCEEDED(pPB->Read(CComBSTR(_T("FriendlyName")), &var, NULL))) {
m_list.SetItemData(
m_list.InsertItem(-1, CString(CStringW(var.bstrVal))),
(DWORD_PTR)m_monikers.AddTail(pMoniker));
@@ -122,13 +122,13 @@ void CRegFilterChooserDlg::OnBnClickedOk() CComPtr<IMoniker> pMoniker;
POSITION pos = m_list.GetFirstSelectedItemPosition();
- if(pos) {
+ if (pos) {
pos = (POSITION)m_list.GetItemData(m_list.GetNextSelectedItem(pos));
}
- if(pos) {
+ if (pos) {
pMoniker = m_monikers.GetAt(pos);
}
- if(pMoniker) {
+ if (pMoniker) {
CFGFilterRegistry fgf(pMoniker);
FilterOverride* f = DNew FilterOverride;
f->fDisabled = false;
@@ -151,7 +151,7 @@ void CRegFilterChooserDlg::OnBnClickedButton1() OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_NOCHANGEDIR,
_T("DirectShow Filters (*.dll,*.ax)|*.dll;*.ax|"), this, 0);
- if(dlg.DoModal() == IDOK) {
+ if (dlg.DoModal() == IDOK) {
CFilterMapper2 fm2(false);
fm2.Register(dlg.GetPathName());
m_filters.AddTail(&fm2.m_filters);
@@ -163,7 +163,7 @@ void CRegFilterChooserDlg::OnBnClickedButton1() void CRegFilterChooserDlg::OnNMDblclkList2(NMHDR *pNMHDR, LRESULT *pResult)
{
- if(m_list.GetFirstSelectedItemPosition()) {
+ if (m_list.GetFirstSelectedItemPosition()) {
OnBnClickedOk();
}
diff --git a/src/apps/mplayerc/SaveDlg.cpp b/src/apps/mplayerc/SaveDlg.cpp index 5d59e0d36..a3c6f0a1d 100644 --- a/src/apps/mplayerc/SaveDlg.cpp +++ b/src/apps/mplayerc/SaveDlg.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -68,10 +68,10 @@ BOOL CSaveDlg::OnInitDialog() m_anim.Play(0, (UINT)-1, (UINT)-1);
CString str, in = m_in, out = m_out;
- if(in.GetLength() > 60) {
+ if (in.GetLength() > 60) {
in = in.Left(17) + _T("..") + in.Right(43);
}
- if(out.GetLength() > 60) {
+ if (out.GetLength() > 60) {
out = out.Left(17) + _T("..") + out.Right(43);
}
str.Format(_T("%s\r\n%s"), in, out);
@@ -79,7 +79,7 @@ BOOL CSaveDlg::OnInitDialog() m_progress.SetRange(0, 100);
- if(FAILED(pGB.CoCreateInstance(CLSID_FilterGraph)) || !(pMC = pGB) || !(pME = pGB) || !(pMS = pGB)
+ if (FAILED(pGB.CoCreateInstance(CLSID_FilterGraph)) || !(pMC = pGB) || !(pME = pGB) || !(pMS = pGB)
|| FAILED(pME->SetNotifyWindow((OAHWND)m_hWnd, WM_GRAPHNOTIFY, 0))) {
m_report.SetWindowText(_T("Error"));
return FALSE;
@@ -91,30 +91,30 @@ BOOL CSaveDlg::OnInitDialog() CComPtr<IFileSourceFilter> pReader;
#if INTERNAL_SOURCEFILTER_CDDA
- if(!pReader && m_in.Mid(m_in.ReverseFind('.')+1).MakeLower() == _T("cda")) {
+ if (!pReader && m_in.Mid(m_in.ReverseFind('.')+1).MakeLower() == _T("cda")) {
hr = S_OK;
CComPtr<IUnknown> pUnk = (IUnknown*)(INonDelegatingUnknown*)DNew CCDDAReader(NULL, &hr);
- if(FAILED(hr) || !(pReader = pUnk) || FAILED(pReader->Load(fnw, NULL))) {
+ if (FAILED(hr) || !(pReader = pUnk) || FAILED(pReader->Load(fnw, NULL))) {
pReader.Release();
}
}
#endif
#if INTERNAL_SOURCEFILTER_CDXA
- if(!pReader) {
+ if (!pReader) {
hr = S_OK;
CComPtr<IUnknown> pUnk = (IUnknown*)(INonDelegatingUnknown*)DNew CCDXAReader(NULL, &hr);
- if(FAILED(hr) || !(pReader = pUnk) || FAILED(pReader->Load(fnw, NULL))) {
+ if (FAILED(hr) || !(pReader = pUnk) || FAILED(pReader->Load(fnw, NULL))) {
pReader.Release();
}
}
#endif
#if INTERNAL_SOURCEFILTER_VTS
- if(!pReader /*&& ext == _T("ifo")*/) {
+ if (!pReader /*&& ext == _T("ifo")*/) {
hr = S_OK;
CComPtr<IUnknown> pUnk = (IUnknown*)(INonDelegatingUnknown*)DNew CVTSReader(NULL, &hr);
- if(FAILED(hr) || !(pReader = pUnk) || FAILED(pReader->Load(fnw, NULL))) {
+ if (FAILED(hr) || !(pReader = pUnk) || FAILED(pReader->Load(fnw, NULL))) {
pReader.Release();
} else {
CPath pout(m_out);
@@ -124,22 +124,22 @@ BOOL CSaveDlg::OnInitDialog() }
#endif
- if(!pReader) {
+ if (!pReader) {
hr = S_OK;
CComPtr<IUnknown> pUnk;
pUnk.CoCreateInstance(CLSID_AsyncReader);
- if(FAILED(hr) || !(pReader = pUnk) || FAILED(pReader->Load(fnw, NULL))) {
+ if (FAILED(hr) || !(pReader = pUnk) || FAILED(pReader->Load(fnw, NULL))) {
pReader.Release();
}
}
- if(!pReader) {
+ if (!pReader) {
hr = S_OK;
CComPtr<IUnknown> pUnk;
pUnk.CoCreateInstance(CLSID_URLReader);
- if(CComQIPtr<IBaseFilter> pSrc = pUnk) { // url reader has to be in the graph to load the file
+ if (CComQIPtr<IBaseFilter> pSrc = pUnk) { // url reader has to be in the graph to load the file
pGB->AddFilter(pSrc, fnw);
- if(FAILED(hr) || !(pReader = pUnk) || FAILED(hr = pReader->Load(fnw, NULL))) {
+ if (FAILED(hr) || !(pReader = pUnk) || FAILED(hr = pReader->Load(fnw, NULL))) {
pReader.Release();
pGB->RemoveFilter(pSrc);
}
@@ -147,13 +147,13 @@ BOOL CSaveDlg::OnInitDialog() }
CComQIPtr<IBaseFilter> pSrc = pReader;
- if(FAILED(pGB->AddFilter(pSrc, fnw))) {
+ if (FAILED(pGB->AddFilter(pSrc, fnw))) {
m_report.SetWindowText(_T("Sorry, can't save this file, press cancel"));
return FALSE;
}
CComQIPtr<IBaseFilter> pMid = DNew CStreamDriveThruFilter(NULL, &hr);
- if(FAILED(pGB->AddFilter(pMid, L"StreamDriveThru"))) {
+ if (FAILED(pGB->AddFilter(pMid, L"StreamDriveThru"))) {
m_report.SetWindowText(_T("Error"));
return FALSE;
}
@@ -163,7 +163,7 @@ BOOL CSaveDlg::OnInitDialog() CComQIPtr<IFileSinkFilter2> pFSF = pDst;
pFSF->SetFileName(CStringW(m_out), NULL);
pFSF->SetMode(AM_FILE_OVERWRITE);
- if(FAILED(pGB->AddFilter(pDst, L"File Writer"))) {
+ if (FAILED(pGB->AddFilter(pDst, L"File Writer"))) {
m_report.SetWindowText(_T("Error"));
return FALSE;
}
@@ -171,7 +171,7 @@ BOOL CSaveDlg::OnInitDialog() hr = pGB->Connect(
GetFirstPin((pSrc), PINDIR_OUTPUT),
GetFirstPin((pMid), PINDIR_INPUT));
-
+
if (FAILED(hr)) {
m_report.SetWindowText(_T("Error Connect pSrc / pMid"));
return FALSE;
@@ -197,7 +197,7 @@ BOOL CSaveDlg::OnInitDialog() void CSaveDlg::OnBnClickedCancel()
{
- if(pMC) {
+ if (pMC) {
pMC->Stop();
}
@@ -207,13 +207,13 @@ void CSaveDlg::OnBnClickedCancel() LRESULT CSaveDlg::OnGraphNotify(WPARAM wParam, LPARAM lParam)
{
LONG evCode, evParam1, evParam2;
- while(pME && SUCCEEDED(pME->GetEvent(&evCode, (LONG_PTR*)&evParam1, (LONG_PTR*)&evParam2, 0))) {
+ while (pME && SUCCEEDED(pME->GetEvent(&evCode, (LONG_PTR*)&evParam1, (LONG_PTR*)&evParam2, 0))) {
HRESULT hr = pME->FreeEventParams(evCode, evParam1, evParam2);
UNUSED_ALWAYS(hr);
- if(EC_COMPLETE == evCode) {
+ if (EC_COMPLETE == evCode) {
EndDialog(IDOK);
- } else if(EC_ERRORABORT == evCode) {
+ } else if (EC_ERRORABORT == evCode) {
TRACE(_T("CSaveDlg::OnGraphNotify / EC_ERRORABORT, hr = %08x\n"), (HRESULT)evParam1);
m_report.SetWindowText(_T("Copying unexpectedly terminated!"));
}
@@ -224,8 +224,8 @@ LRESULT CSaveDlg::OnGraphNotify(WPARAM wParam, LPARAM lParam) void CSaveDlg::OnTimer(UINT_PTR nIDEvent)
{
- if(nIDEvent == m_nIDTimerEvent && pGB) {
- if(pMS) {
+ if (nIDEvent == m_nIDTimerEvent && pGB) {
+ if (pMS) {
CString str;
REFERENCE_TIME pos = 0, dur = 0;
pMS->GetCurrentPosition(&pos);
diff --git a/src/apps/mplayerc/SaveTextFileDialog.cpp b/src/apps/mplayerc/SaveTextFileDialog.cpp index 8faafe0f5..bb97d31cf 100644 --- a/src/apps/mplayerc/SaveTextFileDialog.cpp +++ b/src/apps/mplayerc/SaveTextFileDialog.cpp @@ -38,9 +38,9 @@ CSaveTextFileDialog::CSaveTextFileDialog( lpszFilter, pParentWnd, 0, FALSE),
m_e(e)
{
- if(m_ofn.lStructSize == sizeof(OPENFILENAME)) {
+ if (m_ofn.lStructSize == sizeof(OPENFILENAME)) {
SetTemplate(0, IDD_SAVETEXTFILEDIALOGTEMPL);
- } else { /*if(m_ofn.lStructSize == OPENFILENAME_SIZE_VERSION_400)*/
+ } else { /*if (m_ofn.lStructSize == OPENFILENAME_SIZE_VERSION_400)*/
SetTemplate(0, IDD_SAVETEXTFILEDIALOGTEMPL_400);
}
}
@@ -64,7 +64,7 @@ BOOL CSaveTextFileDialog::OnInitDialog() m_encoding.SetItemData(m_encoding.AddString(_T("Unicode 16-BE")), CTextFile::BE16);
m_encoding.SetItemData(m_encoding.AddString(_T("UTF-8")), CTextFile::UTF8);
- switch(m_e) {
+ switch (m_e) {
default:
case CTextFile::ASCII:
m_encoding.SetCurSel(0);
diff --git a/src/apps/mplayerc/SaveThumbnailsDialog.cpp b/src/apps/mplayerc/SaveThumbnailsDialog.cpp index ded2ffe6a..81156e59b 100644 --- a/src/apps/mplayerc/SaveThumbnailsDialog.cpp +++ b/src/apps/mplayerc/SaveThumbnailsDialog.cpp @@ -38,9 +38,9 @@ CSaveThumbnailsDialog::CSaveThumbnailsDialog( lpszFilter, pParentWnd, 0, FALSE),
m_rows(rows), m_cols(cols), m_width(width)
{
- if(m_ofn.lStructSize == sizeof(OPENFILENAME)) {
+ if (m_ofn.lStructSize == sizeof(OPENFILENAME)) {
SetTemplate(0, IDD_SAVETHUMBSDIALOGTEMPL);
- } else { /*if(m_ofn.lStructSize == OPENFILENAME_SIZE_VERSION_400)*/
+ } else { /*if (m_ofn.lStructSize == OPENFILENAME_SIZE_VERSION_400)*/
SetTemplate(0, IDD_SAVETHUMBSDIALOGTEMPL_400);
}
}
diff --git a/src/apps/mplayerc/SelectMediaType.cpp b/src/apps/mplayerc/SelectMediaType.cpp index fe4de822c..c585f9199 100644 --- a/src/apps/mplayerc/SelectMediaType.cpp +++ b/src/apps/mplayerc/SelectMediaType.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -61,7 +61,7 @@ BOOL CSelectMediaType::OnInitDialog() {
CCmdUIDialog::OnInitDialog();
- for(int i = 0; i < m_guids.GetCount(); i++) {
+ for (int i = 0; i < m_guids.GetCount(); i++) {
m_guidsctrl.AddString(GetMediaTypeName(m_guids[i]));
}
@@ -73,7 +73,7 @@ void CSelectMediaType::OnCbnEditchangeCombo1() {
UpdateData();
int i = m_guidsctrl.FindStringExact(0, m_guidstr);
- if(i >= 0) {
+ if (i >= 0) {
DWORD sel = m_guidsctrl.GetEditSel();
m_guidsctrl.SetCurSel(i);
m_guidsctrl.SetEditSel(sel,sel);
diff --git a/src/apps/mplayerc/ShaderAutoCompleteDlg.cpp b/src/apps/mplayerc/ShaderAutoCompleteDlg.cpp index b0b9eb9e9..ea977957c 100644 --- a/src/apps/mplayerc/ShaderAutoCompleteDlg.cpp +++ b/src/apps/mplayerc/ShaderAutoCompleteDlg.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -170,16 +170,16 @@ void CShaderAutoCompleteDlg::OnLbnSelchangeList1() ::SendMessage(m_hToolTipWnd, TTM_TRACKACTIVATE, FALSE, (LPARAM)&m_ti);
int i = m_list.GetCurSel();
- if(i < 0) {
+ if (i < 0) {
return;
}
- if(POSITION pos = (POSITION)m_list.GetItemData(i)) {
+ if (POSITION pos = (POSITION)m_list.GetItemData(i)) {
CString str, desc;
m_inst.GetNextAssoc(pos, str, desc);
CAtlList<CString> sl;
Explode(desc, sl, '|', 2);
- if(sl.GetCount() != 2) {
+ if (sl.GetCount() != 2) {
return;
}
_tcscpy(m_ti.lpszText, sl.RemoveTail());
@@ -195,7 +195,7 @@ void CShaderAutoCompleteDlg::OnShowWindow(BOOL bShow, UINT nStatus) {
CResizableDialog::OnShowWindow(bShow, nStatus);
- if(!bShow) {
+ if (!bShow) {
::SendMessage(m_hToolTipWnd, TTM_TRACKACTIVATE, FALSE, (LPARAM)&m_ti);
}
}
diff --git a/src/apps/mplayerc/ShaderCombineDlg.cpp b/src/apps/mplayerc/ShaderCombineDlg.cpp index 550c5379d..15322f9c2 100644 --- a/src/apps/mplayerc/ShaderCombineDlg.cpp +++ b/src/apps/mplayerc/ShaderCombineDlg.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -78,20 +78,20 @@ BOOL CShaderCombineDlg::OnInitDialog() }
CAtlList<CString> sl;
- if(!str.IsEmpty()) {
+ if (!str.IsEmpty()) {
Explode(str, sl, '|');
}
POSITION pos = sl.GetHeadPosition();
- while(pos) {
+ while (pos) {
m_list.AddString(sl.GetNext(pos));
}
pos = s.m_shaders.GetHeadPosition();
- while(pos) {
+ while (pos) {
m_combo.AddString(s.m_shaders.GetNext(pos).label);
}
- if(m_combo.GetCount()) {
+ if (m_combo.GetCount()) {
m_combo.SetCurSel(0);
}
@@ -105,7 +105,7 @@ void CShaderCombineDlg::OnOK() CAtlList<CString> sl;
- for(int i = 0, j = m_list.GetCount(); i < j; i++) {
+ for (int i = 0, j = m_list.GetCount(); i < j; i++) {
CString label;
m_list.GetText(i, label);
sl.AddTail(label);
@@ -124,7 +124,7 @@ void CShaderCombineDlg::OnOK() void CShaderCombineDlg::OnBnClickedButton12()
{
int i = m_combo.GetCurSel();
- if(i < 0) {
+ if (i < 0) {
return;
}
@@ -136,15 +136,15 @@ void CShaderCombineDlg::OnBnClickedButton12() void CShaderCombineDlg::OnBnClickedButton13()
{
int i = m_list.GetCurSel();
- if(i < 0) {
+ if (i < 0) {
return;
}
m_list.DeleteString(i);
- if(i == m_list.GetCount()) {
+ if (i == m_list.GetCount()) {
i--;
}
- if(i >= 0) {
+ if (i >= 0) {
m_list.SetCurSel(i);
}
}
@@ -152,7 +152,7 @@ void CShaderCombineDlg::OnBnClickedButton13() void CShaderCombineDlg::OnBnClickedButton1()
{
int i = m_list.GetCurSel();
- if(i < 1) {
+ if (i < 1) {
return;
}
@@ -167,14 +167,14 @@ void CShaderCombineDlg::OnBnClickedButton1() void CShaderCombineDlg::OnBnClickedButton11()
{
int i = m_list.GetCurSel();
- if(i < 0 || i >= m_list.GetCount()-1) {
+ if (i < 0 || i >= m_list.GetCount()-1) {
return;
}
CString label;
m_list.GetText(i, label);
m_list.DeleteString(i);
- if(++i == m_list.GetCount()) {
+ if (++i == m_list.GetCount()) {
m_list.AddString(label);
} else {
m_list.InsertString(i, label);
diff --git a/src/apps/mplayerc/ShaderEditorDlg.cpp b/src/apps/mplayerc/ShaderEditorDlg.cpp index d1111e0ef..58663fa6a 100644 --- a/src/apps/mplayerc/ShaderEditorDlg.cpp +++ b/src/apps/mplayerc/ShaderEditorDlg.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -39,8 +39,8 @@ END_MESSAGE_MAP() HBRUSH CShaderLabelComboBox::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
- if(nCtlColor == CTLCOLOR_EDIT) {
- if(m_edit.GetSafeHwnd() == NULL) {
+ if (nCtlColor == CTLCOLOR_EDIT) {
+ if (m_edit.GetSafeHwnd() == NULL) {
m_edit.SubclassWindow(pWnd->GetSafeHwnd());
}
}
@@ -50,7 +50,7 @@ HBRUSH CShaderLabelComboBox::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) void CShaderLabelComboBox::OnDestroy()
{
- if(m_edit.GetSafeHwnd() != NULL) {
+ if (m_edit.GetSafeHwnd() != NULL) {
m_edit.UnsubclassWindow();
}
@@ -74,18 +74,18 @@ CShaderEdit::~CShaderEdit() BOOL CShaderEdit::PreTranslateMessage(MSG* pMsg)
{
- if(m_acdlg.IsWindowVisible()
+ if (m_acdlg.IsWindowVisible()
&& pMsg->message == WM_KEYDOWN
&& (pMsg->wParam == VK_UP || pMsg->wParam == VK_DOWN
|| pMsg->wParam == VK_PRIOR || pMsg->wParam == VK_NEXT
|| pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE)) {
int i = m_acdlg.m_list.GetCurSel();
- if(pMsg->wParam == VK_RETURN && i >= 0) {
+ if (pMsg->wParam == VK_RETURN && i >= 0) {
CString str;
m_acdlg.m_list.GetText(i, str);
i = str.Find('(')+1;
- if(i > 0) {
+ if (i > 0) {
str = str.Left(i);
}
@@ -94,13 +94,13 @@ BOOL CShaderEdit::PreTranslateMessage(MSG* pMsg) CString text;
GetWindowText(text);
- while(nStartChar > 0 && _istalnum(text.GetAt(nStartChar-1))) {
+ while (nStartChar > 0 && _istalnum(text.GetAt(nStartChar-1))) {
nStartChar--;
}
SetSel(nStartChar, nEndChar);
ReplaceSel(str, TRUE);
- } else if(pMsg->wParam == VK_ESCAPE) {
+ } else if (pMsg->wParam == VK_ESCAPE) {
m_acdlg.ShowWindow(SW_HIDE);
return GetParent()->PreTranslateMessage(pMsg);
} else {
@@ -121,7 +121,7 @@ END_MESSAGE_MAP() void CShaderEdit::OnUpdate()
{
- if(m_nIDEvent == (UINT_PTR)-1) {
+ if (m_nIDEvent == (UINT_PTR)-1) {
m_nIDEvent = SetTimer(1, 100, NULL);
}
@@ -129,14 +129,14 @@ void CShaderEdit::OnUpdate() int nStartChar = 0, nEndChar = -1;
GetSel(nStartChar, nEndChar);
- if(nStartChar == nEndChar) {
+ if (nStartChar == nEndChar) {
GetWindowText(text);
- while(nStartChar > 0 && _istalnum(text.GetAt(nStartChar-1))) {
+ while (nStartChar > 0 && _istalnum(text.GetAt(nStartChar-1))) {
nStartChar--;
}
}
- if(nStartChar < nEndChar) {
+ if (nStartChar < nEndChar) {
text = text.Mid(nStartChar, nEndChar - nStartChar);
text.TrimRight('(');
text.MakeLower();
@@ -145,14 +145,14 @@ void CShaderEdit::OnUpdate() CString key, value;
POSITION pos = m_acdlg.m_inst.GetStartPosition();
- while(pos) {
+ while (pos) {
POSITION cur = pos;
m_acdlg.m_inst.GetNextAssoc(pos, key, value);
- if(key.Find(text) == 0) {
+ if (key.Find(text) == 0) {
CAtlList<CString> sl;
Explode(value, sl, '|', 2);
- if(sl.GetCount() != 2) {
+ if (sl.GetCount() != 2) {
continue;
}
CString name = sl.RemoveHead();
@@ -162,7 +162,7 @@ void CShaderEdit::OnUpdate() }
}
- if(m_acdlg.m_list.GetCount() > 0) {
+ if (m_acdlg.m_list.GetCount() > 0) {
int lineheight = GetLineHeight();
CPoint p = PosFromChar(nStartChar);
@@ -195,10 +195,10 @@ void CShaderEdit::OnKillFocus(CWnd* pNewWnd) void CShaderEdit::OnTimer(UINT_PTR nIDEvent)
{
- if(m_nIDEvent == nIDEvent) {
+ if (m_nIDEvent == nIDEvent) {
int nStartChar = 0, nEndChar = -1;
GetSel(nStartChar, nEndChar);
- if(nStartChar != nEndChar || m_nEndChar != nEndChar) {
+ if (nStartChar != nEndChar || m_nEndChar != nEndChar) {
m_acdlg.ShowWindow(SW_HIDE);
}
}
@@ -223,7 +223,7 @@ CShaderEditorDlg::~CShaderEditorDlg() BOOL CShaderEditorDlg::Create(CWnd* pParent)
{
- if(!__super::Create(IDD, pParent)) {
+ if (!__super::Create(IDD, pParent)) {
return FALSE;
}
@@ -244,7 +244,7 @@ BOOL CShaderEditorDlg::Create(CWnd* pParent) m_targets.AddString(_T("ps_3_sw"));
POSITION pos = AfxGetAppSettings().m_shaders.GetHeadPosition();
- while(pos) {
+ while (pos) {
const AppSettings::Shader& s = AfxGetAppSettings().m_shaders.GetNext(pos);
m_labels.SetItemDataPtr(m_labels.AddString(s.label), (void*)&s);
}
@@ -292,20 +292,20 @@ END_MESSAGE_MAP() BOOL CShaderEditorDlg::PreTranslateMessage(MSG* pMsg)
{
- if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN
+ if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN
&& pMsg->hwnd == m_labels.m_edit.GetSafeHwnd()) {
OnCbnSelchangeCombo1();
return TRUE;
- } else if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_TAB
+ } else if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_TAB
&& pMsg->hwnd == m_srcdata.GetSafeHwnd()) {
int nStartChar, nEndChar;
m_srcdata.GetSel(nStartChar, nEndChar);
- if(nStartChar == nEndChar) {
+ if (nStartChar == nEndChar) {
m_srcdata.ReplaceSel(_T("\t"));
}
return TRUE;
- } else if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE) {
+ } else if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE) {
return GetParent()->PreTranslateMessage(pMsg);
}
@@ -316,12 +316,12 @@ void CShaderEditorDlg::OnCbnSelchangeCombo1() {
int i = m_labels.GetCurSel();
- if(i < 0) {
+ if (i < 0) {
CString label;
m_labels.GetWindowText(label);
label.Trim();
- if(label.IsEmpty()) {
+ if (label.IsEmpty()) {
return;
}
@@ -353,22 +353,22 @@ void CShaderEditorDlg::OnCbnSelchangeCombo1() void CShaderEditorDlg::OnBnClickedButton2()
{
- if(!m_pShader) {
+ if (!m_pShader) {
return;
}
- if(IDYES != AfxMessageBox(ResStr(IDS_SHADEREDITORDLG_0), MB_YESNO)) {
+ if (IDYES != AfxMessageBox(ResStr(IDS_SHADEREDITORDLG_0), MB_YESNO)) {
return;
}
AppSettings& s = AfxGetAppSettings();
- for(POSITION pos = s.m_shaders.GetHeadPosition(); pos; s.m_shaders.GetNext(pos)) {
- if(m_pShader == &s.m_shaders.GetAt(pos)) {
+ for (POSITION pos = s.m_shaders.GetHeadPosition(); pos; s.m_shaders.GetNext(pos)) {
+ if (m_pShader == &s.m_shaders.GetAt(pos)) {
m_pShader = NULL;
s.m_shaders.RemoveAt(pos);
int i = m_labels.GetCurSel();
- if(i >= 0) {
+ if (i >= 0) {
m_labels.DeleteString(i);
}
m_labels.SetWindowText(_T(""));
@@ -383,7 +383,7 @@ void CShaderEditorDlg::OnBnClickedButton2() void CShaderEditorDlg::OnTimer(UINT_PTR nIDEvent)
{
- if(nIDEvent == m_nIDEventShader && IsWindowVisible() && m_pShader) {
+ if (nIDEvent == m_nIDEventShader && IsWindowVisible() && m_pShader) {
CString srcdata;
m_srcdata.GetWindowText(srcdata);
srcdata.Replace(_T("\r"), _T(""));
@@ -393,20 +393,20 @@ void CShaderEditorDlg::OnTimer(UINT_PTR nIDEvent) m_targets.GetWindowText(target);
target.Trim();
- if(!srcdata.IsEmpty() && !target.IsEmpty() && (m_pShader->srcdata != srcdata || m_pShader->target != target)) {
+ if (!srcdata.IsEmpty() && !target.IsEmpty() && (m_pShader->srcdata != srcdata || m_pShader->target != target)) {
KillTimer(m_nIDEventShader);
m_pShader->srcdata = srcdata;
m_pShader->target = target;
- if(!m_pPSC) {
+ if (!m_pPSC) {
m_pPSC = DNew CPixelShaderCompiler(NULL);
}
CString disasm, errmsg;
HRESULT hr = m_pPSC->CompileShader(CStringA(srcdata), "main", CStringA(target), D3DXSHADER_DEBUG, NULL, &disasm, &errmsg);
- if(SUCCEEDED(hr)) {
+ if (SUCCEEDED(hr)) {
errmsg = _T("D3DXCompileShader succeeded\n");
errmsg += _T("\n");
errmsg += disasm;
@@ -429,7 +429,7 @@ void CShaderEditorDlg::OnTimer(UINT_PTR nIDEvent) void CShaderEditorDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
- if(HitTestSplitter(point)) {
+ if (HitTestSplitter(point)) {
m_fSplitterGrabbed = true;
SetCapture();
}
@@ -439,7 +439,7 @@ void CShaderEditorDlg::OnLButtonDown(UINT nFlags, CPoint point) void CShaderEditorDlg::OnLButtonUp(UINT nFlags, CPoint point)
{
- if(m_fSplitterGrabbed) {
+ if (m_fSplitterGrabbed) {
ReleaseCapture();
m_fSplitterGrabbed = false;
}
@@ -449,7 +449,7 @@ void CShaderEditorDlg::OnLButtonUp(UINT nFlags, CPoint point) void CShaderEditorDlg::OnMouseMove(UINT nFlags, CPoint point)
{
- if(m_fSplitterGrabbed) {
+ if (m_fSplitterGrabbed) {
CRect r, rs, ro;
GetClientRect(&r);
m_srcdata.GetWindowRect(&rs);
@@ -481,7 +481,7 @@ BOOL CShaderEditorDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) CPoint p;
GetCursorPos(&p);
ScreenToClient(&p);
- if(HitTestSplitter(p)) {
+ if (HitTestSplitter(p)) {
::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_SIZENS));
return TRUE;
}
diff --git a/src/apps/mplayerc/ShockwaveGraph.cpp b/src/apps/mplayerc/ShockwaveGraph.cpp index d7467dbcc..73d6b6d02 100644 --- a/src/apps/mplayerc/ShockwaveGraph.cpp +++ b/src/apps/mplayerc/ShockwaveGraph.cpp @@ -33,13 +33,13 @@ CShockwaveGraph::CShockwaveGraph(HWND hParent, HRESULT& hr) {
hr = S_OK;
- if(!m_wndWindowFrame.Create(NULL, NULL, WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN,
+ if (!m_wndWindowFrame.Create(NULL, NULL, WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN,
CRect(0, 0, 0, 0), CWnd::FromHandle(hParent), 0, NULL)) {
hr = E_FAIL;
return;
}
- if(!m_wndDestFrame.Create(NULL, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS,
+ if (!m_wndDestFrame.Create(NULL, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS,
CRect(0, 0, 0, 0), &m_wndWindowFrame, 0)) {
hr = E_FAIL;
return;
@@ -73,7 +73,7 @@ STDMETHODIMP CShockwaveGraph::Run() // or is the variable unused?
/*long scale_mode = */this->m_wndDestFrame.get_ScaleMode();
- if(m_fs != State_Running) {
+ if (m_fs != State_Running) {
m_wndDestFrame.Play();
}
} catch(CException* e) {
@@ -88,7 +88,7 @@ STDMETHODIMP CShockwaveGraph::Run() STDMETHODIMP CShockwaveGraph::Pause()
{
try {
- if(m_fs == State_Running) {
+ if (m_fs == State_Running) {
m_wndDestFrame.Stop();
}
} catch(CException* e) {
@@ -114,9 +114,9 @@ STDMETHODIMP CShockwaveGraph::GetState(LONG msTimeout, OAFilterState* pfs) OAFilterState fs = m_fs;
try {
- if(m_wndDestFrame.IsPlaying() && m_fs == State_Stopped) {
+ if (m_wndDestFrame.IsPlaying() && m_fs == State_Stopped) {
m_fs = State_Running;
- } else if(!m_wndDestFrame.IsPlaying() && m_fs == State_Running) {
+ } else if (!m_wndDestFrame.IsPlaying() && m_fs == State_Running) {
m_fs = State_Stopped;
}
fs = m_fs;
@@ -144,7 +144,7 @@ STDMETHODIMP CShockwaveGraph::GetDuration(LONGLONG* pDuration) CheckPointer(pDuration, E_POINTER);
*pDuration = 0;
try {
- if(m_wndDestFrame.get_ReadyState() >= READYSTATE_COMPLETE) {
+ if (m_wndDestFrame.get_ReadyState() >= READYSTATE_COMPLETE) {
*pDuration = m_wndDestFrame.get_TotalFrames();
}
} catch(CException* e) {
@@ -158,7 +158,7 @@ STDMETHODIMP CShockwaveGraph::GetCurrentPosition(LONGLONG* pCurrent) CheckPointer(pCurrent, E_POINTER);
*pCurrent = 0;
try {
- if(m_wndDestFrame.get_ReadyState() >= READYSTATE_COMPLETE) {
+ if (m_wndDestFrame.get_ReadyState() >= READYSTATE_COMPLETE) {
*pCurrent = m_wndDestFrame.get_FrameNum();
}
} catch(CException* e) {
@@ -169,12 +169,12 @@ STDMETHODIMP CShockwaveGraph::GetCurrentPosition(LONGLONG* pCurrent) }
STDMETHODIMP CShockwaveGraph::SetPositions(LONGLONG* pCurrent, DWORD dwCurrentFlags, LONGLONG* pStop, DWORD dwStopFlags)
{
- if(dwCurrentFlags&AM_SEEKING_AbsolutePositioning) {
+ if (dwCurrentFlags&AM_SEEKING_AbsolutePositioning) {
m_wndDestFrame.put_FrameNum(*pCurrent);
- if(m_fs == State_Running && !m_wndDestFrame.IsPlaying()) {
+ if (m_fs == State_Running && !m_wndDestFrame.IsPlaying()) {
m_wndDestFrame.Play();
- } else if((m_fs == State_Paused || m_fs == State_Stopped) && m_wndDestFrame.IsPlaying()) {
+ } else if ((m_fs == State_Paused || m_fs == State_Stopped) && m_wndDestFrame.IsPlaying()) {
m_wndDestFrame.Stop();
}
@@ -189,7 +189,7 @@ STDMETHODIMP CShockwaveGraph::SetPositions(LONGLONG* pCurrent, DWORD dwCurrentFl // IVideoWindow
STDMETHODIMP CShockwaveGraph::put_Visible(long Visible)
{
- if(IsWindow(m_wndDestFrame.m_hWnd)) {
+ if (IsWindow(m_wndDestFrame.m_hWnd)) {
m_wndDestFrame.ShowWindow(Visible == OATRUE ? SW_SHOWNORMAL : SW_HIDE);
}
return S_OK;
@@ -200,7 +200,7 @@ return pVisible ? *pVisible = (m_wndDestFrame.IsWindowVisible() ? OATRUE : OAFAL }
STDMETHODIMP CShockwaveGraph::SetWindowPosition(long Left, long Top, long Width, long Height)
{
- if(IsWindow(m_wndWindowFrame.m_hWnd)) {
+ if (IsWindow(m_wndWindowFrame.m_hWnd)) {
m_wndWindowFrame.MoveWindow(Left, Top, Width, Height);
}
@@ -210,7 +210,7 @@ STDMETHODIMP CShockwaveGraph::SetWindowPosition(long Left, long Top, long Width, // IBasicVideo
STDMETHODIMP CShockwaveGraph::SetDestinationPosition(long Left, long Top, long Width, long Height)// {return E_NOTIMPL;}
{
- if(IsWindow(m_wndDestFrame.m_hWnd)) {
+ if (IsWindow(m_wndDestFrame.m_hWnd)) {
m_wndDestFrame.MoveWindow(Left, Top, Width, Height);
}
@@ -218,13 +218,13 @@ STDMETHODIMP CShockwaveGraph::SetDestinationPosition(long Left, long Top, long W }
STDMETHODIMP CShockwaveGraph::GetVideoSize(long* pWidth, long* pHeight)
{
- if(!pWidth || !pHeight) {
+ if (!pWidth || !pHeight) {
return E_POINTER;
}
CRect r;
m_wndWindowFrame.GetWindowRect(r);
- if(!r.IsRectEmpty()) {
+ if (!r.IsRectEmpty()) {
*pWidth = r.Width();
*pHeight = r.Height();
} else {
diff --git a/src/apps/mplayerc/StatusLabel.cpp b/src/apps/mplayerc/StatusLabel.cpp index 2129107af..90c3d5bb6 100644 --- a/src/apps/mplayerc/StatusLabel.cpp +++ b/src/apps/mplayerc/StatusLabel.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -39,11 +39,11 @@ CStatusLabel::CStatusLabel(bool fRightAlign, bool fAddEllipses) m_font.m_hObject = NULL;
- if(!(::GetVersion()&0x80000000))
+ if (!(::GetVersion()&0x80000000))
m_font.CreateFont(int(14.0 * scale), 0, 0, 0, FW_NORMAL, 0, 0, 0, DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH|FF_DONTCARE,
_T("Microsoft Sans Serif"));
- if(!m_font.m_hObject)
+ if (!m_font.m_hObject)
m_font.CreateFont(int(14.0 * scale), 0, 0, 0, FW_NORMAL, 0, 0, 0, DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH|FF_DONTCARE,
_T("MS Sans Serif"));
@@ -73,8 +73,8 @@ void CStatusLabel::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) CSize size = dc.GetTextExtent(str);
CPoint p = CPoint(m_fRightAlign ? r.Width() - size.cx : 0, (r.Height()-size.cy)/2);
- if(m_fAddEllipses)
- while(size.cx > r.Width()-3 && str.GetLength() > 3) {
+ if (m_fAddEllipses)
+ while (size.cx > r.Width()-3 && str.GetLength() > 3) {
str = str.Left(str.GetLength()-4) + _T("...");
size = dc.GetTextExtent(str);
}
diff --git a/src/apps/mplayerc/SubtitleDlDlg.cpp b/src/apps/mplayerc/SubtitleDlDlg.cpp index 576c34db7..2673884e3 100644 --- a/src/apps/mplayerc/SubtitleDlDlg.cpp +++ b/src/apps/mplayerc/SubtitleDlDlg.cpp @@ -32,15 +32,14 @@ //IMPLEMENT_DYNAMIC(CSubtitleDlDlg, CResizableDialog)
CSubtitleDlDlg::CSubtitleDlDlg(CList<isdb_movie>& movies, CWnd* pParent /*=NULL*/)
: CResizableDialog(CSubtitleDlDlg::IDD, pParent),
- iColumn(-1),
- bSortDirection(false)
+ iColumn(-1),
+ bSortDirection(false)
{
m_movies.AddTail(&movies);
// Parse
POSITION pos = m_movies.GetHeadPosition();
- while (pos)
- {
+ while (pos) {
isdb_movie& m = m_movies.GetNext(pos);
isdb_movie_Parsed p;
@@ -110,8 +109,7 @@ BOOL CSubtitleDlDlg::OnInitDialog() void CSubtitleDlDlg::OnOK()
{
- for (int i = 0; i < m_list.GetItemCount(); ++i)
- {
+ for (int i = 0; i < m_list.GetItemCount(); ++i) {
if (m_list.GetCheck(i)) {
m_selsubs.AddTail(*(isdb_subtitle*)m_list.GetItemData(i));
}
@@ -137,14 +135,11 @@ void CSubtitleDlDlg::OnHdnItemclickList1(NMHDR *pNMHDR, LRESULT *pResult) {
LPNMHEADER phdr = reinterpret_cast<LPNMHEADER>(pNMHDR);
*pResult = 0;
-
- if ( phdr->iItem != iColumn )
- {
+
+ if ( phdr->iItem != iColumn ) {
iColumn = phdr->iItem;
bSortDirection = false;
- }
- else
- {
+ } else {
bSortDirection = !bSortDirection;
}
@@ -153,8 +148,7 @@ void CSubtitleDlDlg::OnHdnItemclickList1(NMHDR *pNMHDR, LRESULT *pResult) void CSubtitleDlDlg::BuildList( void )
{
- for (INT_PTR i = 0; i < m_moviesParsed.GetCount(); ++i)
- {
+ for (INT_PTR i = 0; i < m_moviesParsed.GetCount(); ++i) {
isdb_movie_Parsed& m = m_moviesParsed[i];
int iItem = m_list.InsertItem(i, _T(""));
@@ -171,34 +165,32 @@ void CSubtitleDlDlg::BuildList( void ) struct sort_cmp {
sort_cmp(int col, bool dir) : iColumn(col), bSortDirection(dir) {}
- bool operator()(const CSubtitleDlDlg::isdb_movie_Parsed& a, const CSubtitleDlDlg::isdb_movie_Parsed& b) const
- {
+ bool operator()(const CSubtitleDlDlg::isdb_movie_Parsed& a, const CSubtitleDlDlg::isdb_movie_Parsed& b) const {
bool result = false;
// Should this macro be a function instead ?
#define dir_cmp(l, r) bSortDirection ? (r) < (l) : (l) < (r)
-
- switch (iColumn)
- {
- case CSubtitleDlDlg::COL_FILENAME:
- result = dir_cmp(a.name, b.name);
- break;
- case CSubtitleDlDlg::COL_LANGUAGE:
- result = dir_cmp(a.language, b.language);
- break;
- case CSubtitleDlDlg::COL_FORMAT:
- result = dir_cmp(a.format, b.format);
- break;
- case CSubtitleDlDlg::COL_DISC:
- result = dir_cmp(a.disc, b.disc);
- break;
- case CSubtitleDlDlg::COL_TITLES:
- result = dir_cmp(a.titles, b.titles);
- break;
+
+ switch (iColumn) {
+ case CSubtitleDlDlg::COL_FILENAME:
+ result = dir_cmp(a.name, b.name);
+ break;
+ case CSubtitleDlDlg::COL_LANGUAGE:
+ result = dir_cmp(a.language, b.language);
+ break;
+ case CSubtitleDlDlg::COL_FORMAT:
+ result = dir_cmp(a.format, b.format);
+ break;
+ case CSubtitleDlDlg::COL_DISC:
+ result = dir_cmp(a.disc, b.disc);
+ break;
+ case CSubtitleDlDlg::COL_TITLES:
+ result = dir_cmp(a.titles, b.titles);
+ break;
}
-
+
#undef dir_cmp
-
+
return result;
}
@@ -209,8 +201,7 @@ struct sort_cmp { void CSubtitleDlDlg::SortList( void )
{
// Save checked state
- for (INT_PTR i = 0; i < m_moviesParsed.GetCount(); ++i)
- {
+ for (INT_PTR i = 0; i < m_moviesParsed.GetCount(); ++i) {
m_moviesParsed[i].checked = m_list.GetCheck(i);
}
diff --git a/src/apps/mplayerc/TextPassThruFilter.cpp b/src/apps/mplayerc/TextPassThruFilter.cpp index b9ef84e86..e4c68d686 100644 --- a/src/apps/mplayerc/TextPassThruFilter.cpp +++ b/src/apps/mplayerc/TextPassThruFilter.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -42,8 +42,8 @@ class CTextPassThruInputPin : public CSubtitleInputPin protected:
void AddSubStream(ISubStream* pSubStream) {
- if(m_pSubStreamOld) {
- if(pSubStream) {
+ if (m_pSubStreamOld) {
+ if (pSubStream) {
m_pTPTFilter->m_pMainFrame->ReplaceSubtitle(m_pSubStreamOld, pSubStream);
}
m_pSubStreamOld = NULL;
@@ -99,7 +99,7 @@ CTextPassThruInputPin::CTextPassThruInputPin(CTextPassThruFilter* pTPTFilter, CC STDMETHODIMP CTextPassThruInputPin::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
{
HRESULT hr = __super::NewSegment(tStart, tStop, dRate);
- if(FAILED(hr)) {
+ if (FAILED(hr)) {
return hr;
}
return m_pTPTFilter->m_pOutput->DeliverNewSegment(tStart, tStop, dRate);
@@ -108,7 +108,7 @@ STDMETHODIMP CTextPassThruInputPin::NewSegment(REFERENCE_TIME tStart, REFERENCE_ STDMETHODIMP CTextPassThruInputPin::Receive(IMediaSample* pSample)
{
HRESULT hr = __super::Receive(pSample);
- if(FAILED(hr)) {
+ if (FAILED(hr)) {
return hr;
}
return m_pTPTFilter->m_pOutput->Deliver(pSample);
@@ -117,7 +117,7 @@ STDMETHODIMP CTextPassThruInputPin::Receive(IMediaSample* pSample) STDMETHODIMP CTextPassThruInputPin::EndOfStream()
{
HRESULT hr = __super::EndOfStream();
- if(FAILED(hr)) {
+ if (FAILED(hr)) {
return hr;
}
return m_pTPTFilter->m_pOutput->DeliverEndOfStream();
@@ -126,7 +126,7 @@ STDMETHODIMP CTextPassThruInputPin::EndOfStream() STDMETHODIMP CTextPassThruInputPin::BeginFlush()
{
HRESULT hr = __super::BeginFlush();
- if(FAILED(hr)) {
+ if (FAILED(hr)) {
return hr;
}
return m_pTPTFilter->m_pOutput->DeliverBeginFlush();
@@ -135,7 +135,7 @@ STDMETHODIMP CTextPassThruInputPin::BeginFlush() STDMETHODIMP CTextPassThruInputPin::EndFlush()
{
HRESULT hr = __super::EndFlush();
- if(FAILED(hr)) {
+ if (FAILED(hr)) {
return hr;
}
return m_pTPTFilter->m_pOutput->DeliverEndFlush();
@@ -144,7 +144,7 @@ STDMETHODIMP CTextPassThruInputPin::EndFlush() HRESULT CTextPassThruInputPin::CompleteConnect(IPin* pReceivePin)
{
HRESULT hr = __super::CompleteConnect(pReceivePin);
- if(FAILED(hr) || !m_pTPTFilter->m_pOutput->IsConnected()) {
+ if (FAILED(hr) || !m_pTPTFilter->m_pOutput->IsConnected()) {
return hr;
}
return m_pTPTFilter->ReconnectPin(m_pTPTFilter->m_pOutput, &m_mt);
@@ -168,13 +168,13 @@ HRESULT CTextPassThruOutputPin::CheckMediaType(const CMediaType* mtOut) HRESULT CTextPassThruOutputPin::DecideBufferSize(IMemAllocator* pAllocator, ALLOCATOR_PROPERTIES* pProperties)
{
- if(m_pTPTFilter->m_pInput->IsConnected() == FALSE) {
+ if (m_pTPTFilter->m_pInput->IsConnected() == FALSE) {
return E_UNEXPECTED;
}
CComPtr<IMemAllocator> pAllocatorIn;
m_pTPTFilter->m_pInput->GetAllocator(&pAllocatorIn);
- if(!pAllocatorIn) {
+ if (!pAllocatorIn) {
return E_UNEXPECTED;
}
@@ -182,7 +182,7 @@ HRESULT CTextPassThruOutputPin::DecideBufferSize(IMemAllocator* pAllocator, ALLO HRESULT hr;
ALLOCATOR_PROPERTIES Actual;
- if(FAILED(hr = pAllocator->SetProperties(pProperties, &Actual))) {
+ if (FAILED(hr = pAllocator->SetProperties(pProperties, &Actual))) {
return hr;
}
@@ -193,14 +193,14 @@ HRESULT CTextPassThruOutputPin::DecideBufferSize(IMemAllocator* pAllocator, ALLO HRESULT CTextPassThruOutputPin::GetMediaType(int iPosition, CMediaType* pmt)
{
- if(m_pTPTFilter->m_pInput->IsConnected() == FALSE) {
+ if (m_pTPTFilter->m_pInput->IsConnected() == FALSE) {
return E_UNEXPECTED;
}
- if(iPosition < 0) {
+ if (iPosition < 0) {
return E_INVALIDARG;
}
- if(iPosition > 0) {
+ if (iPosition > 0) {
return VFW_S_NO_MORE_ITEMS;
}
@@ -232,8 +232,8 @@ CTextPassThruFilter::~CTextPassThruFilter() STDMETHODIMP CTextPassThruFilter::NonDelegatingQueryInterface(REFIID riid, void** ppv)
{
- if(m_pInput && riid == __uuidof(ISubStream)) {
- if(CComPtr<ISubStream> pSubStream = m_pInput->GetSubStream()) {
+ if (m_pInput && riid == __uuidof(ISubStream)) {
+ if (CComPtr<ISubStream> pSubStream = m_pInput->GetSubStream()) {
*ppv = pSubStream.Detach();
return S_OK;
}
@@ -249,9 +249,9 @@ int CTextPassThruFilter::GetPinCount() CBasePin* CTextPassThruFilter::GetPin(int n)
{
- if(n == 0) {
+ if (n == 0) {
return m_pInput;
- } else if(n == 1) {
+ } else if (n == 1) {
return m_pOutput;
}
return NULL;
diff --git a/src/apps/mplayerc/VMROSD.cpp b/src/apps/mplayerc/VMROSD.cpp index d33276fc0..ac1bf6492 100644 --- a/src/apps/mplayerc/VMROSD.cpp +++ b/src/apps/mplayerc/VMROSD.cpp @@ -131,7 +131,7 @@ void CVMROSD::UpdateBitmap() m_MemDC.SetBkMode(TRANSPARENT);
}
- if(m_MainFont.GetSafeHandle()) {
+ if (m_MainFont.GetSafeHandle()) {
m_MemDC.SelectObject(m_MainFont);
}
@@ -171,13 +171,13 @@ void CVMROSD::Start (CWnd* pWnd, IMadVRTextOsd* pMVTO) void CVMROSD::Stop()
{
- if(m_pVMB) {
+ if (m_pVMB) {
m_pVMB.Release();
}
- if(m_pMFVMB) {
+ if (m_pMFVMB) {
m_pMFVMB.Release();
}
- if(m_pMVTO) {
+ if (m_pMVTO) {
m_pMVTO.Release();
}
m_pWnd = NULL;
@@ -256,7 +256,7 @@ void CVMROSD::DrawMessage() }
DrawRect (&rectMessages, &m_brushBack, &m_penBorder);
DWORD uFormat = DT_SINGLELINE|DT_CENTER|DT_VCENTER|DT_NOPREFIX;
- if(rectText.right > (m_rectWnd.right - 20)) {
+ if (rectText.right > (m_rectWnd.right - 20)) {
m_strMessage = _T(" ") + m_strMessage;
uFormat = uFormat|DT_END_ELLIPSIS;
}
@@ -272,7 +272,7 @@ void CVMROSD::DrawDebug() pos = m_debugMessages.GetHeadPosition();
msg.Format(_T("%s"), m_debugMessages.GetNext(pos));
- while(pos) {
+ while (pos) {
tmp = m_debugMessages.GetNext(pos);
if ( !tmp.IsEmpty() ) {
msg.AppendFormat(_T("\r\n%s"), tmp);
@@ -465,8 +465,8 @@ void CVMROSD::DisplayMessage (OSD_MESSAGEPOS nPos, LPCTSTR strMsg, int nDuration m_OSD_Font = OSD_Font;
}
- if((temp_m_FontSize != m_FontSize) || (temp_m_OSD_Font != m_OSD_Font)) {
- if(m_MainFont.GetSafeHandle()) {
+ if ((temp_m_FontSize != m_FontSize) || (temp_m_OSD_Font != m_OSD_Font)) {
+ if (m_MainFont.GetSafeHandle()) {
m_MainFont.DeleteObject();
}
diff --git a/src/apps/mplayerc/VolumeCtrl.cpp b/src/apps/mplayerc/VolumeCtrl.cpp index 2a0580522..50545e1cb 100644 --- a/src/apps/mplayerc/VolumeCtrl.cpp +++ b/src/apps/mplayerc/VolumeCtrl.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -39,7 +39,7 @@ CVolumeCtrl::~CVolumeCtrl() bool CVolumeCtrl::Create(CWnd* pParentWnd)
{
- if(!CSliderCtrl::Create(WS_CHILD|WS_VISIBLE|TBS_NOTICKS|TBS_HORZ, CRect(0,0,0,0), pParentWnd, IDC_SLIDER1)) {
+ if (!CSliderCtrl::Create(WS_CHILD|WS_VISIBLE|TBS_NOTICKS|TBS_HORZ, CRect(0,0,0,0), pParentWnd, IDC_SLIDER1)) {
return(false);
}
@@ -84,14 +84,14 @@ void CVolumeCtrl::OnNMCustomdraw(NMHDR* pNMHDR, LRESULT* pResult) LRESULT lr = CDRF_DODEFAULT;
- if(m_fSelfDrawn)
- switch(pNMCD->dwDrawStage) {
+ if (m_fSelfDrawn)
+ switch (pNMCD->dwDrawStage) {
case CDDS_PREPAINT:
lr = CDRF_NOTIFYITEMDRAW;
break;
case CDDS_ITEMPREPAINT:
- if(pNMCD->dwItemSpec == TBCD_CHANNEL) {
+ if (pNMCD->dwItemSpec == TBCD_CHANNEL) {
CDC dc;
dc.Attach(pNMCD->hdc);
@@ -111,7 +111,7 @@ void CVolumeCtrl::OnNMCustomdraw(NMHDR* pNMHDR, LRESULT* pResult) dc.Detach();
lr = CDRF_SKIPDEFAULT;
- } else if(pNMCD->dwItemSpec == TBCD_THUMB) {
+ } else if (pNMCD->dwItemSpec == TBCD_THUMB) {
CDC dc;
dc.Attach(pNMCD->hdc);
pNMCD->rc.bottom--;
@@ -144,7 +144,7 @@ void CVolumeCtrl::OnLButtonDown(UINT nFlags, CPoint point) CRect r;
GetChannelRect(&r);
- if(r.left >= r.right) {
+ if (r.left >= r.right) {
return;
}
@@ -154,13 +154,13 @@ void CVolumeCtrl::OnLButtonDown(UINT nFlags, CPoint point) r.left += 3;
r.right -= 4;
- if(point.x < r.left) {
+ if (point.x < r.left) {
SetPos(start);
- } else if(point.x >= r.right) {
+ } else if (point.x >= r.right) {
SetPos(stop);
} else {
int w = r.right - r.left;
- if(start < stop) {
+ if (start < stop) {
SetPosInternal(start + ((stop - start) * (point.x - r.left) + (w/2)) / w);
}
}
@@ -180,7 +180,7 @@ void CVolumeCtrl::HScroll(UINT nSBCode, UINT nPos) AfxGetAppSettings().nVolume = GetPos();
CFrameWnd* pFrame = GetParentFrame();
- if(pFrame && pFrame != GetParent()) {
+ if (pFrame && pFrame != GetParent()) {
pFrame->PostMessage(WM_HSCROLL, MAKEWPARAM((short)nPos, nSBCode), (LPARAM)m_hWnd);
}
}
diff --git a/src/apps/mplayerc/WebClientSocket.cpp b/src/apps/mplayerc/WebClientSocket.cpp index 16f6e2798..cdca6aec9 100644 --- a/src/apps/mplayerc/WebClientSocket.cpp +++ b/src/apps/mplayerc/WebClientSocket.cpp @@ -42,10 +42,10 @@ CWebClientSocket::~CWebClientSocket() bool CWebClientSocket::SetCookie(CString name, CString value, __time64_t expire, CString path, CString domain)
{
- if(name.IsEmpty()) {
+ if (name.IsEmpty()) {
return(false);
}
- if(value.IsEmpty()) {
+ if (value.IsEmpty()) {
m_cookie.RemoveKey(name);
return true;
}
@@ -55,7 +55,7 @@ bool CWebClientSocket::SetCookie(CString name, CString value, __time64_t expire, m_cookieattribs[name].path = path;
m_cookieattribs[name].domain = domain;
- if(expire >= 0) {
+ if (expire >= 0) {
CTime t(expire);
SYSTEMTIME st;
t.GetAsSystemTime(st);
@@ -84,8 +84,8 @@ void CWebClientSocket::Clear() void CWebClientSocket::Header()
{
- if(m_cmd.IsEmpty()) {
- if(m_hdr.IsEmpty()) {
+ if (m_cmd.IsEmpty()) {
+ if (m_hdr.IsEmpty()) {
return;
}
@@ -101,9 +101,9 @@ void CWebClientSocket::Header() ASSERT(sl.GetCount() == 0);
POSITION pos = lines.GetHeadPosition();
- while(pos) {
+ while (pos) {
Explode(lines.GetNext(pos), sl, ':', 2);
- if(sl.GetCount() == 2) {
+ if (sl.GetCount() == 2) {
m_hdrlines[sl.GetHead().MakeLower()] = sl.GetTail();
}
}
@@ -112,15 +112,15 @@ void CWebClientSocket::Header() // remember new cookies
POSITION pos = m_hdrlines.GetStartPosition();
- while(pos) {
+ while (pos) {
CString key, value;
m_hdrlines.GetNextAssoc(pos, key, value);
- if(key == _T("cookie")) {
+ if (key == _T("cookie")) {
CAtlList<CString> sl;
Explode(value, sl, ';');
POSITION pos2 = sl.GetHeadPosition();
- while(pos2) {
+ while (pos2) {
CAtlList<CString> sl2;
Explode(sl.GetNext(pos2), sl2, '=', 2);
m_cookie[sl2.GetHead()] = sl2.GetCount() == 2 ? sl2.GetTail() : _T("");
@@ -130,7 +130,7 @@ void CWebClientSocket::Header() // start new session
- if(!m_cookie.Lookup(_T("MPCSESSIONID"), m_sessid)) {
+ if (!m_cookie.Lookup(_T("MPCSESSIONID"), m_sessid)) {
srand((unsigned int)time(NULL));
m_sessid.Format(_T("%08x"), rand()*0x12345678);
SetCookie(_T("MPCSESSIONID"), m_sessid);
@@ -140,9 +140,9 @@ void CWebClientSocket::Header() CStringA reshdr, resbody;
- if(m_cmd == _T("POST")) {
+ if (m_cmd == _T("POST")) {
CString str;
- if(m_hdrlines.Lookup(_T("content-length"), str)) {
+ if (m_hdrlines.Lookup(_T("content-length"), str)) {
int len = _tcstol(str, NULL, 10);
str.Empty();
@@ -152,17 +152,17 @@ void CWebClientSocket::Header() int timeout = 1000;
do {
- for(; len > 0 && (err = Receive(&c, 1)) > 0; len--) {
+ for (; len > 0 && (err = Receive(&c, 1)) > 0; len--) {
m_data += c;
- if(c == '\r') {
+ if (c == '\r') {
continue;
}
str += c;
- if(c == '\n' || len == 1) {
+ if (c == '\n' || len == 1) {
CAtlList<CString> sl;
Explode(AToT(UrlDecode(TToA(str))), sl, '&'); // FIXME
POSITION pos = sl.GetHeadPosition();
- while(pos) {
+ while (pos) {
CAtlList<CString> sl2;
Explode(sl.GetNext(pos), sl2, '=', 2);
m_post[sl2.GetHead().MakeLower()] = sl2.GetCount() == 2 ? sl2.GetTail() : _T("");
@@ -171,10 +171,10 @@ void CWebClientSocket::Header() }
}
- if(err == SOCKET_ERROR) {
+ if (err == SOCKET_ERROR) {
Sleep(1);
}
- } while(err == SOCKET_ERROR && GetLastError() == WSAEWOULDBLOCK
+ } while (err == SOCKET_ERROR && GetLastError() == WSAEWOULDBLOCK
&& timeout-- > 0); // FIXME: this is just a dirty fix now
// FIXME: with IE it will only work if I read +2 bytes (?), btw Receive will just return -1
@@ -183,20 +183,20 @@ void CWebClientSocket::Header() }
}
- if(m_cmd == _T("GET") || m_cmd == _T("HEAD") || m_cmd == _T("POST")) {
+ if (m_cmd == _T("GET") || m_cmd == _T("HEAD") || m_cmd == _T("POST")) {
CAtlList<CString> sl;
Explode(m_path, sl, '?', 2);
m_path = sl.RemoveHead();
m_query.Empty();
- if(!sl.IsEmpty()) {
+ if (!sl.IsEmpty()) {
m_query = sl.GetTail();
Explode(Explode(m_query, sl, '#', 2), sl, '&'); // oh yeah
// Explode(AToT(UrlDecode(TToA(Explode(m_query, sl, '#', 2)))), sl, '&'); // oh yeah
POSITION pos = sl.GetHeadPosition();
- while(pos) {
+ while (pos) {
CAtlList<CString> sl2;
Explode(AToT(UrlDecode(TToA(sl.GetNext(pos)))), sl2, '=', 2);
// Explode(sl.GetNext(pos), sl2, '=', 2);
@@ -209,17 +209,17 @@ void CWebClientSocket::Header() CString key, value;
POSITION pos;
pos = m_get.GetStartPosition();
- while(pos) {
+ while (pos) {
m_get.GetNextAssoc(pos, key, value);
m_request[key] = value;
}
pos = m_post.GetStartPosition();
- while(pos) {
+ while (pos) {
m_post.GetNextAssoc(pos, key, value);
m_request[key] = value;
}
pos = m_cookie.GetStartPosition();
- while(pos) {
+ while (pos) {
m_cookie.GetNextAssoc(pos, key, value);
m_request[key] = value;
}
@@ -230,26 +230,26 @@ void CWebClientSocket::Header() reshdr = "HTTP/1.0 400 Bad Request\r\n";
}
- if(!reshdr.IsEmpty()) {
+ if (!reshdr.IsEmpty()) {
// cookies
{
POSITION pos = m_cookie.GetStartPosition();
- while(pos) {
+ while (pos) {
CString key, value;
m_cookie.GetNextAssoc(pos, key, value);
reshdr += "Set-Cookie: " + key + "=" + value;
POSITION pos2 = m_cookieattribs.GetStartPosition();
- while(pos2) {
+ while (pos2) {
CString key;
cookie_attribs value;
m_cookieattribs.GetNextAssoc(pos2, key, value);
- if(!value.path.IsEmpty()) {
+ if (!value.path.IsEmpty()) {
reshdr += " path=" + value.path;
}
- if(!value.expire.IsEmpty()) {
+ if (!value.expire.IsEmpty()) {
reshdr += " expire=" + value.expire;
}
- if(!value.domain.IsEmpty()) {
+ if (!value.domain.IsEmpty()) {
reshdr += " domain=" + value.domain;
}
}
@@ -264,7 +264,7 @@ void CWebClientSocket::Header() Send(reshdr, reshdr.GetLength());
- if(m_cmd != _T("HEAD") && reshdr.Find("HTTP/1.0 200 OK") == 0 && !resbody.IsEmpty()) {
+ if (m_cmd != _T("HEAD") && reshdr.Find("HTTP/1.0 200 OK") == 0 && !resbody.IsEmpty()) {
Send(resbody, resbody.GetLength());
}
@@ -274,7 +274,7 @@ void CWebClientSocket::Header() Clear();
// TODO
- // if(connection == _T("close"))
+ // if (connection == _T("close"))
OnClose(0);
}
}
@@ -283,17 +283,17 @@ void CWebClientSocket::Header() void CWebClientSocket::OnReceive(int nErrorCode)
{
- if(nErrorCode == 0) {
+ if (nErrorCode == 0) {
char c;
- while(Receive(&c, 1) > 0) {
- if(c == '\r') {
+ while (Receive(&c, 1) > 0) {
+ if (c == '\r') {
continue;
} else {
m_hdr += c;
}
int len = m_hdr.GetLength();
- if(len >= 2 && m_hdr[len-2] == '\n' && m_hdr[len-1] == '\n') {
+ if (len >= 2 && m_hdr[len-2] == '\n' && m_hdr[len-1] == '\n') {
Header();
return;
}
@@ -315,34 +315,34 @@ void CWebClientSocket::OnClose(int nErrorCode) bool CWebClientSocket::OnCommand(CStringA& hdr, CStringA& body, CStringA& mime)
{
CString arg;
- if(m_request.Lookup(_T("wm_command"), arg)) {
+ if (m_request.Lookup(_T("wm_command"), arg)) {
int id = _ttol(arg);
- if(id > 0) {
- if(id == ID_FILE_EXIT) {
+ if (id > 0) {
+ if (id == ID_FILE_EXIT) {
m_pMainFrame->PostMessage(WM_COMMAND, id);
} else {
m_pMainFrame->SendMessage(WM_COMMAND, id);
}
} else {
- if(arg == CMD_SETPOS && m_request.Lookup(_T("position"), arg)) {
+ if (arg == CMD_SETPOS && m_request.Lookup(_T("position"), arg)) {
int h, m, s, ms = 0;
TCHAR c;
- if(_stscanf(arg, _T("%d%c%d%c%d%c%d"), &h, &c, &m, &c, &s, &c, &ms) >= 5) {
+ if (_stscanf(arg, _T("%d%c%d%c%d%c%d"), &h, &c, &m, &c, &s, &c, &ms) >= 5) {
REFERENCE_TIME rtPos = 10000i64*(((h*60+m)*60+s)*1000+ms);
m_pMainFrame->SeekTo(rtPos);
- for(int retries = 20; retries-- > 0; Sleep(50)) {
- if(abs((int)((rtPos - m_pMainFrame->GetPos())/10000)) < 100) {
+ for (int retries = 20; retries-- > 0; Sleep(50)) {
+ if (abs((int)((rtPos - m_pMainFrame->GetPos())/10000)) < 100) {
break;
}
}
}
- } else if(arg == CMD_SETPOS && m_request.Lookup(_T("percent"), arg)) {
+ } else if (arg == CMD_SETPOS && m_request.Lookup(_T("percent"), arg)) {
float percent = 0;
- if(_stscanf_s(arg, _T("%f"), &percent) == 1) {
+ if (_stscanf_s(arg, _T("%f"), &percent) == 1) {
m_pMainFrame->SeekTo((REFERENCE_TIME)(percent / 100 * m_pMainFrame->GetDur()));
}
- } else if(arg == CMD_SETVOLUME && m_request.Lookup(_T("volume"), arg)) {
+ } else if (arg == CMD_SETVOLUME && m_request.Lookup(_T("volume"), arg)) {
int volume = _tcstol(arg, NULL, 10);
m_pMainFrame->m_wndToolBar.Volume = min(max(volume, 0), 100);
m_pMainFrame->OnPlayVolume(0);
@@ -351,7 +351,7 @@ bool CWebClientSocket::OnCommand(CStringA& hdr, CStringA& body, CStringA& mime) }
CString ref;
- if(!m_hdrlines.Lookup(_T("referer"), ref)) {
+ if (!m_hdrlines.Lookup(_T("referer"), ref)) {
return true;
}
@@ -370,7 +370,7 @@ bool CWebClientSocket::OnIndex(CStringA& hdr, CStringA& body, CStringA& mime) AppSettings& s = AfxGetAppSettings();
POSITION pos = s.wmcmds.GetHeadPosition();
- while(pos) {
+ while (pos) {
wmcmd& wc = s.wmcmds.GetNext(pos);
CStringA str;
str.Format("%d", wc.cmd);
@@ -387,8 +387,8 @@ bool CWebClientSocket::OnIndex(CStringA& hdr, CStringA& body, CStringA& mime) bool CWebClientSocket::OnBrowser(CStringA& hdr, CStringA& body, CStringA& mime)
{
CAtlList<CStringA> rootdrives;
- for(TCHAR drive[] = _T("A:"); drive[0] <= 'Z'; drive[0]++)
- if(GetDriveType(drive) != DRIVE_NO_ROOT_DIR) {
+ for (TCHAR drive[] = _T("A:"); drive[0] <= 'Z'; drive[0]++)
+ if (GetDriveType(drive) != DRIVE_NO_ROOT_DIR) {
rootdrives.AddTail(CStringA(drive) + '\\');
}
@@ -396,10 +396,10 @@ bool CWebClientSocket::OnBrowser(CStringA& hdr, CStringA& body, CStringA& mime) CString path;
CFileStatus fs;
- if(m_get.Lookup(_T("path"), path)) {
+ if (m_get.Lookup(_T("path"), path)) {
path = WToT(UTF8To16(TToA(path)));
- if(CFileGetStatus(path, fs) && !(fs.m_attribute&CFile::directory)) {
+ if (CFileGetStatus(path, fs) && !(fs.m_attribute&CFile::directory)) {
// TODO: make a new message for just opening files, this is a bit overkill now...
CAtlList<CString> cmdln;
@@ -407,26 +407,26 @@ bool CWebClientSocket::OnBrowser(CStringA& hdr, CStringA& body, CStringA& mime) cmdln.AddTail(path);
CString focus;
- if(m_get.Lookup(_T("focus"), focus) && !focus.CompareNoCase(_T("no"))) {
+ if (m_get.Lookup(_T("focus"), focus) && !focus.CompareNoCase(_T("no"))) {
cmdln.AddTail(_T("/nofocus"));
}
int len = 0;
POSITION pos = cmdln.GetHeadPosition();
- while(pos) {
+ while (pos) {
CString& str = cmdln.GetNext(pos);
len += (str.GetLength()+1)*sizeof(TCHAR);
}
CAutoVectorPtr<BYTE> buff;
- if(buff.Allocate(4+len)) {
+ if (buff.Allocate(4+len)) {
BYTE* p = buff;
*(DWORD*)p = cmdln.GetCount();
p += sizeof(DWORD);
POSITION pos = cmdln.GetHeadPosition();
- while(pos) {
+ while (pos) {
CString& str = cmdln.GetNext(pos);
len = (str.GetLength()+1)*sizeof(TCHAR);
memcpy(p, (LPCTSTR)str, len);
@@ -447,18 +447,18 @@ bool CWebClientSocket::OnBrowser(CStringA& hdr, CStringA& body, CStringA& mime) } else {
path = m_pMainFrame->m_wndPlaylistBar.GetCurFileName();
- if(CFileGetStatus(path, fs) && !(fs.m_attribute&CFile::directory)) {
+ if (CFileGetStatus(path, fs) && !(fs.m_attribute&CFile::directory)) {
CPath p(path);
p.RemoveFileSpec();
path = (LPCTSTR)p;
}
}
- if(path.Find(_T("://")) >= 0) {
+ if (path.Find(_T("://")) >= 0) {
path.Empty();
}
- if(CFileGetStatus(path, fs) && (fs.m_attribute&CFile::directory)
+ if (CFileGetStatus(path, fs) && (fs.m_attribute&CFile::directory)
|| path.Find(_T("\\")) == 0) { // FIXME
CPath p(path);
p.Canonicalize();
@@ -469,9 +469,9 @@ bool CWebClientSocket::OnBrowser(CStringA& hdr, CStringA& body, CStringA& mime) CStringA files;
- if(path.IsEmpty()) {
+ if (path.IsEmpty()) {
POSITION pos = rootdrives.GetHeadPosition();
- while(pos) {
+ while (pos) {
CStringA& drive = rootdrives.GetNext(pos);
files += "<tr class=\"dir\">\r\n";
@@ -487,7 +487,7 @@ bool CWebClientSocket::OnBrowser(CStringA& hdr, CStringA& body, CStringA& mime) } else {
CString parent;
- if(path.GetLength() > 3) {
+ if (path.GetLength() > 3) {
CPath p(path + "..");
p.Canonicalize();
p.AddBackslash();
@@ -505,9 +505,9 @@ bool CWebClientSocket::OnBrowser(CStringA& hdr, CStringA& body, CStringA& mime) WIN32_FIND_DATA fd = {0};
HANDLE hFind = FindFirstFile(path + "*.*", &fd);
- if(hFind != INVALID_HANDLE_VALUE) {
+ if (hFind != INVALID_HANDLE_VALUE) {
do {
- if(!(fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) || fd.cFileName[0] == '.') {
+ if (!(fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) || fd.cFileName[0] == '.') {
continue;
}
@@ -520,15 +520,15 @@ bool CWebClientSocket::OnBrowser(CStringA& hdr, CStringA& body, CStringA& mime) "<td class=\"dirsize\"> </td>\r\n"
"<td class=\"dirdate\"><nobr>" + CStringA(CTime(fd.ftLastWriteTime).Format(_T("%Y.%m.%d %H:%M"))) + "</nobr></td>";
files += "</tr>\r\n";
- } while(FindNextFile(hFind, &fd));
+ } while (FindNextFile(hFind, &fd));
FindClose(hFind);
}
hFind = FindFirstFile(path + "*.*", &fd);
- if(hFind != INVALID_HANDLE_VALUE) {
+ if (hFind != INVALID_HANDLE_VALUE) {
do {
- if(fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {
+ if (fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {
continue;
}
@@ -555,7 +555,7 @@ bool CWebClientSocket::OnBrowser(CStringA& hdr, CStringA& body, CStringA& mime) "<td class=\"filesize\" align=\"right\"><nobr>" + size + "</nobr></td>\r\n"
"<td class=\"filedate\"><nobr>" + CStringA(CTime(fd.ftLastWriteTime).Format(_T("%Y.%m.%d %H:%M"))) + "</nobr></td>";
files += "</tr>\r\n";
- } while(FindNextFile(hFind, &fd));
+ } while (FindNextFile(hFind, &fd));
FindClose(hFind);
}
@@ -574,7 +574,7 @@ bool CWebClientSocket::OnControls(CStringA& hdr, CStringA& body, CStringA& mime) CString path = m_pMainFrame->m_wndPlaylistBar.GetCurFileName();
CString dir;
- if(!path.IsEmpty()) {
+ if (!path.IsEmpty()) {
CPath p(path);
p.RemoveFileSpec();
dir = (LPCTSTR)p;
@@ -584,7 +584,7 @@ bool CWebClientSocket::OnControls(CStringA& hdr, CStringA& body, CStringA& mime) CString state;
state.Format(_T("%d"), fs);
CString statestring;
- switch(fs) {
+ switch (fs) {
case State_Stopped:
statestring = ResStr(IDS_CONTROLS_STOPPED);
break;
@@ -636,84 +636,84 @@ bool CWebClientSocket::OnControls(CStringA& hdr, CStringA& body, CStringA& mime) body.Replace("[playbackrate]", UTF8(playbackrate));
body.Replace("[reloadtime]", UTF8(reloadtime));
- return true; -} - -bool CWebClientSocket::OnVariables(CStringA& hdr, CStringA& body, CStringA& mime) -{ - CString path = m_pMainFrame->m_wndPlaylistBar.GetCurFileName(); - CString dir; - - if(!path.IsEmpty()) { - CPath p(path); - p.RemoveFileSpec(); - dir = (LPCTSTR)p; - } - - OAFilterState fs = m_pMainFrame->GetMediaState(); - CString state; - state.Format(_T("%d"), fs); - CString statestring; - switch(fs) { - case State_Stopped: - statestring = ResStr(IDS_CONTROLS_STOPPED); - break; - case State_Paused: - statestring = ResStr(IDS_CONTROLS_PAUSED); - break; - case State_Running: - statestring = ResStr(IDS_CONTROLS_PLAYING); - break; - default: - statestring = _T("n/a"); - break; - } - - int pos = (int)(m_pMainFrame->GetPos()/10000); - int dur = (int)(m_pMainFrame->GetDur()/10000); - - CString position, duration; - position.Format(_T("%d"), pos); - duration.Format(_T("%d"), dur); - - CString positionstring, durationstring, playbackrate; - // positionstring.Format(_T("%02d:%02d:%02d.%03d"), (pos/3600000), (pos/60000)%60, (pos/1000)%60, pos%1000); - // durationstring.Format(_T("%02d:%02d:%02d.%03d"), (dur/3600000), (dur/60000)%60, (dur/1000)%60, dur%1000); - positionstring.Format(_T("%02d:%02d:%02d"), (pos/3600000), (pos/60000)%60, (pos/1000)%60); - durationstring.Format(_T("%02d:%02d:%02d"), (dur/3600000), (dur/60000)%60, (dur/1000)%60); - playbackrate = _T("1"); // TODO - - CString volumelevel, muted; - volumelevel.Format(_T("%d"), m_pMainFrame->m_wndToolBar.m_volctrl.GetPos()); - muted.Format(_T("%d"), m_pMainFrame->m_wndToolBar.Volume == -10000 ? 1 : 0); - - CString reloadtime(_T("0")); // TODO - - m_pWebServer->LoadPage(IDR_HTML_VARIABLES, body, m_path); - body.Replace("[charset]", "UTF-8"); // FIXME: win9x build... - body.Replace("[filepatharg]", UTF8Arg(path)); - body.Replace("[filepath]", UTF8(path)); - body.Replace("[filedirarg]", UTF8Arg(dir)); - body.Replace("[filedir]", UTF8(dir)); - body.Replace("[state]", UTF8(state)); - body.Replace("[statestring]", UTF8(statestring)); - body.Replace("[position]", UTF8(position)); - body.Replace("[positionstring]", UTF8(positionstring)); - body.Replace("[duration]", UTF8(duration)); - body.Replace("[durationstring]", UTF8(durationstring)); - body.Replace("[volumelevel]", UTF8(volumelevel)); - body.Replace("[muted]", UTF8(muted)); - body.Replace("[playbackrate]", UTF8(playbackrate)); - body.Replace("[reloadtime]", UTF8(reloadtime)); - - return true; -} - -bool CWebClientSocket::OnStatus(CStringA& hdr, CStringA& body, CStringA& mime) -{ - /* + return true;
+}
+
+bool CWebClientSocket::OnVariables(CStringA& hdr, CStringA& body, CStringA& mime)
+{
+ CString path = m_pMainFrame->m_wndPlaylistBar.GetCurFileName();
+ CString dir;
+
+ if (!path.IsEmpty()) {
+ CPath p(path);
+ p.RemoveFileSpec();
+ dir = (LPCTSTR)p;
+ }
+
+ OAFilterState fs = m_pMainFrame->GetMediaState();
+ CString state;
+ state.Format(_T("%d"), fs);
+ CString statestring;
+ switch (fs) {
+ case State_Stopped:
+ statestring = ResStr(IDS_CONTROLS_STOPPED);
+ break;
+ case State_Paused:
+ statestring = ResStr(IDS_CONTROLS_PAUSED);
+ break;
+ case State_Running:
+ statestring = ResStr(IDS_CONTROLS_PLAYING);
+ break;
+ default:
+ statestring = _T("n/a");
+ break;
+ }
+
+ int pos = (int)(m_pMainFrame->GetPos()/10000);
+ int dur = (int)(m_pMainFrame->GetDur()/10000);
+
+ CString position, duration;
+ position.Format(_T("%d"), pos);
+ duration.Format(_T("%d"), dur);
+
+ CString positionstring, durationstring, playbackrate;
+ // positionstring.Format(_T("%02d:%02d:%02d.%03d"), (pos/3600000), (pos/60000)%60, (pos/1000)%60, pos%1000);
+ // durationstring.Format(_T("%02d:%02d:%02d.%03d"), (dur/3600000), (dur/60000)%60, (dur/1000)%60, dur%1000);
+ positionstring.Format(_T("%02d:%02d:%02d"), (pos/3600000), (pos/60000)%60, (pos/1000)%60);
+ durationstring.Format(_T("%02d:%02d:%02d"), (dur/3600000), (dur/60000)%60, (dur/1000)%60);
+ playbackrate = _T("1"); // TODO
+
+ CString volumelevel, muted;
+ volumelevel.Format(_T("%d"), m_pMainFrame->m_wndToolBar.m_volctrl.GetPos());
+ muted.Format(_T("%d"), m_pMainFrame->m_wndToolBar.Volume == -10000 ? 1 : 0);
+
+ CString reloadtime(_T("0")); // TODO
+
+ m_pWebServer->LoadPage(IDR_HTML_VARIABLES, body, m_path);
+ body.Replace("[charset]", "UTF-8"); // FIXME: win9x build...
+ body.Replace("[filepatharg]", UTF8Arg(path));
+ body.Replace("[filepath]", UTF8(path));
+ body.Replace("[filedirarg]", UTF8Arg(dir));
+ body.Replace("[filedir]", UTF8(dir));
+ body.Replace("[state]", UTF8(state));
+ body.Replace("[statestring]", UTF8(statestring));
+ body.Replace("[position]", UTF8(position));
+ body.Replace("[positionstring]", UTF8(positionstring));
+ body.Replace("[duration]", UTF8(duration));
+ body.Replace("[durationstring]", UTF8(durationstring));
+ body.Replace("[volumelevel]", UTF8(volumelevel));
+ body.Replace("[muted]", UTF8(muted));
+ body.Replace("[playbackrate]", UTF8(playbackrate));
+ body.Replace("[reloadtime]", UTF8(reloadtime));
+
+ return true;
+}
+
+bool CWebClientSocket::OnStatus(CStringA& hdr, CStringA& body, CStringA& mime)
+{
+ /*
CString path = m_pMainFrame->m_wndPlaylistBar.GetCur(), dir;
- if(!path.IsEmpty()) {CPath p(path); p.RemoveFileSpec(); dir = (LPCTSTR)p;}
+ if (!path.IsEmpty()) {CPath p(path); p.RemoveFileSpec(); dir = (LPCTSTR)p;}
path.Replace(_T("'"), _T("\\'"));
dir.Replace(_T("'"), _T("\\'"));
@@ -787,8 +787,8 @@ bool CWebClientSocket::OnSnapShotJpeg(CStringA& hdr, CStringA& body, CStringA& m BYTE* pData = NULL;
long size = 0;
CAtlArray<BYTE> jpeg;
- if(m_pMainFrame->GetDIB(&pData, size, true)) {
- if(CJpegEncoderMem().Encode(pData, jpeg)) {
+ if (m_pMainFrame->GetDIB(&pData, size, true)) {
+ if (CJpegEncoderMem().Encode(pData, jpeg)) {
hdr +=
"Expires: Thu, 19 Nov 1981 08:52:00 GMT\r\n"
"Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0\r\n"
@@ -807,19 +807,19 @@ bool CWebClientSocket::OnSnapShotJpeg(CStringA& hdr, CStringA& body, CStringA& m bool CWebClientSocket::OnConvRes(CStringA& hdr, CStringA& body, CStringA& mime)
{
CString id;
- if(!m_get.Lookup(_T("id"), id)) {
+ if (!m_get.Lookup(_T("id"), id)) {
return false;
}
DWORD key = 0;
- if(1 != _stscanf_s(id, _T("%x"), &key) || key == 0) {
+ if (1 != _stscanf_s(id, _T("%x"), &key) || key == 0) {
return false;
}
CAutoLock cAutoLock(&CDSMResource::m_csResources);
CDSMResource* res = NULL;
- if(!CDSMResource::m_resources.Lookup(key, res) || !res) {
+ if (!CDSMResource::m_resources.Lookup(key, res) || !res) {
return false;
}
diff --git a/src/apps/mplayerc/WebClientSocket.h b/src/apps/mplayerc/WebClientSocket.h index 089be21bd..b2714b086 100644 --- a/src/apps/mplayerc/WebClientSocket.h +++ b/src/apps/mplayerc/WebClientSocket.h @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -58,13 +58,13 @@ public: CAtlStringMap<> m_request;
bool OnCommand(CStringA& hdr, CStringA& body, CStringA& mime);
- bool OnIndex(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnBrowser(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnControls(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnVariables(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnStatus(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnError404(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnPlayer(CStringA& hdr, CStringA& body, CStringA& mime); + bool OnIndex(CStringA& hdr, CStringA& body, CStringA& mime);
+ bool OnBrowser(CStringA& hdr, CStringA& body, CStringA& mime);
+ bool OnControls(CStringA& hdr, CStringA& body, CStringA& mime);
+ bool OnVariables(CStringA& hdr, CStringA& body, CStringA& mime);
+ bool OnStatus(CStringA& hdr, CStringA& body, CStringA& mime);
+ bool OnError404(CStringA& hdr, CStringA& body, CStringA& mime);
+ bool OnPlayer(CStringA& hdr, CStringA& body, CStringA& mime);
bool OnSnapShotJpeg(CStringA& hdr, CStringA& body, CStringA& mime);
bool OnConvRes(CStringA& hdr, CStringA& body, CStringA& mime);
};
diff --git a/src/apps/mplayerc/WebServer.cpp b/src/apps/mplayerc/WebServer.cpp index ed5148c43..a050c30b2 100644 --- a/src/apps/mplayerc/WebServer.cpp +++ b/src/apps/mplayerc/WebServer.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -39,21 +39,21 @@ CWebServer::CWebServer(CMainFrame* pMainFrame, int nPort) : m_pMainFrame(pMainFrame)
, m_nPort(nPort)
{
- if(m_internalpages.IsEmpty()) {
+ if (m_internalpages.IsEmpty()) {
m_internalpages[_T("/")] = &CWebClientSocket::OnIndex;
m_internalpages[_T("/index.html")] = &CWebClientSocket::OnIndex;
m_internalpages[_T("/browser.html")] = &CWebClientSocket::OnBrowser;
m_internalpages[_T("/controls.html")] = &CWebClientSocket::OnControls;
- m_internalpages[_T("/command.html")] = &CWebClientSocket::OnCommand; - m_internalpages[_T("/status.html")] = &CWebClientSocket::OnStatus; - m_internalpages[_T("/player.html")] = &CWebClientSocket::OnPlayer; - m_internalpages[_T("/variables.html")] = &CWebClientSocket::OnVariables; - m_internalpages[_T("/snapshot.jpg")] = &CWebClientSocket::OnSnapShotJpeg; - m_internalpages[_T("/404.html")] = &CWebClientSocket::OnError404; - m_internalpages[_T("/convres.html")] = &CWebClientSocket::OnConvRes; + m_internalpages[_T("/command.html")] = &CWebClientSocket::OnCommand;
+ m_internalpages[_T("/status.html")] = &CWebClientSocket::OnStatus;
+ m_internalpages[_T("/player.html")] = &CWebClientSocket::OnPlayer;
+ m_internalpages[_T("/variables.html")] = &CWebClientSocket::OnVariables;
+ m_internalpages[_T("/snapshot.jpg")] = &CWebClientSocket::OnSnapShotJpeg;
+ m_internalpages[_T("/404.html")] = &CWebClientSocket::OnError404;
+ m_internalpages[_T("/convres.html")] = &CWebClientSocket::OnConvRes;
}
- if(m_downloads.IsEmpty()) {
+ if (m_downloads.IsEmpty()) {
m_downloads[_T("/default.css")] = IDF_DEFAULT_CSS;
m_downloads[_T("/vbg.gif")] = IDF_VBR_GIF;
m_downloads[_T("/vbs.gif")] = IDF_VBS_GIF;
@@ -91,14 +91,14 @@ CWebServer::CWebServer(CMainFrame* pMainFrame, int nPort) CRegKey key;
CString str(_T("MIME\\Database\\Content Type"));
- if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, str, KEY_READ)) {
+ if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, str, KEY_READ)) {
TCHAR buff[256];
DWORD len = countof(buff);
- for(int i = 0; ERROR_SUCCESS == key.EnumKey(i, buff, &len); i++, len = countof(buff)) {
+ for (int i = 0; ERROR_SUCCESS == key.EnumKey(i, buff, &len); i++, len = countof(buff)) {
CRegKey mime;
TCHAR ext[64];
ULONG len = countof(ext);
- if(ERROR_SUCCESS == mime.Open(HKEY_CLASSES_ROOT, str + _T("\\") + buff, KEY_READ)
+ if (ERROR_SUCCESS == mime.Open(HKEY_CLASSES_ROOT, str + _T("\\") + buff, KEY_READ)
&& ERROR_SUCCESS == mime.QueryStringValue(_T("Extension"), ext, &len)) {
m_mimes[CStringA(ext).MakeLower()] = CStringA(buff).MakeLower();
}
@@ -109,13 +109,13 @@ CWebServer::CWebServer(CMainFrame* pMainFrame, int nPort) m_mimes[".txt"] = "text/plain";
m_mimes[".css"] = "text/css";
m_mimes[".gif"] = "image/gif";
- m_mimes[".jpeg"] = "image/jpeg"; - m_mimes[".jpg"] = "image/jpeg"; - m_mimes[".png"] = "image/png"; - m_mimes[".js"] = "text/javascript"; - - GetModuleFileName(AfxGetInstanceHandle(), str.GetBuffer(_MAX_PATH), _MAX_PATH); - str.ReleaseBuffer(); + m_mimes[".jpeg"] = "image/jpeg";
+ m_mimes[".jpg"] = "image/jpeg";
+ m_mimes[".png"] = "image/png";
+ m_mimes[".js"] = "text/javascript";
+
+ GetModuleFileName(AfxGetInstanceHandle(), str.GetBuffer(_MAX_PATH), _MAX_PATH);
+ str.ReleaseBuffer();
m_webroot = CPath(str);
m_webroot.RemoveFileSpec();
@@ -123,24 +123,24 @@ CWebServer::CWebServer(CMainFrame* pMainFrame, int nPort) WebRoot.Replace('/', '\\');
WebRoot.Trim();
CPath p(WebRoot);
- if(WebRoot.Find(_T(":\\")) < 0 && WebRoot.Find(_T("\\\\")) < 0) {
+ if (WebRoot.Find(_T(":\\")) < 0 && WebRoot.Find(_T("\\\\")) < 0) {
m_webroot.Append(WebRoot);
} else {
m_webroot = p;
}
m_webroot.Canonicalize();
m_webroot.MakePretty();
- if(!m_webroot.IsDirectory()) {
+ if (!m_webroot.IsDirectory()) {
m_webroot = CPath();
}
CAtlList<CString> sl;
Explode(AfxGetAppSettings().strWebServerCGI, sl, ';');
POSITION pos = sl.GetHeadPosition();
- while(pos) {
+ while (pos) {
CAtlList<CString> sl2;
CString ext = Explode(sl.GetNext(pos), sl2, '=', 2);
- if(sl2.GetCount() < 2) {
+ if (sl2.GetCount() < 2) {
continue;
}
m_cgi[ext] = sl2.GetTail();
@@ -152,7 +152,7 @@ CWebServer::CWebServer(CMainFrame* pMainFrame, int nPort) CWebServer::~CWebServer()
{
- if(m_hThread != NULL) {
+ if (m_hThread != NULL) {
PostThreadMessage(m_ThreadId, WM_QUIT, 0, 0);
if (WaitForSingleObject(m_hThread, 10000) == WAIT_TIMEOUT) {
TerminateThread (m_hThread, 0xDEAD);
@@ -168,14 +168,14 @@ DWORD WINAPI CWebServer::StaticThreadProc(LPVOID lpParam) DWORD CWebServer::ThreadProc()
{
- if(!AfxSocketInit(NULL)) {
+ if (!AfxSocketInit(NULL)) {
return (DWORD)-1;
}
CWebServerSocket s(this, m_nPort);
MSG msg;
- while((int)GetMessage(&msg, NULL, 0, 0) > 0) {
+ while ((int)GetMessage(&msg, NULL, 0, 0) > 0) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
@@ -185,7 +185,7 @@ DWORD CWebServer::ThreadProc() static void PutFileContents(LPCTSTR fn, const CStringA& data)
{
- if(FILE* f = _tfopen(fn, _T("wb"))) {
+ if (FILE* f = _tfopen(fn, _T("wb"))) {
fwrite((LPCSTR)data, 1, data.GetLength(), f);
fclose(f);
}
@@ -194,31 +194,31 @@ static void PutFileContents(LPCTSTR fn, const CStringA& data) void CWebServer::Deploy(CString dir)
{
CStringA data;
- if(LoadResource(IDR_HTML_INDEX, data, RT_HTML)) {
+ if (LoadResource(IDR_HTML_INDEX, data, RT_HTML)) {
PutFileContents(dir + _T("index.html"), data);
}
- if(LoadResource(IDR_HTML_BROWSER, data, RT_HTML)) {
+ if (LoadResource(IDR_HTML_BROWSER, data, RT_HTML)) {
PutFileContents(dir + _T("browser.html"), data);
}
- if(LoadResource(IDR_HTML_CONTROLS, data, RT_HTML)) { - PutFileContents(dir + _T("controls.html"), data); - } - if(LoadResource(IDR_HTML_VARIABLES, data, RT_HTML)) { - PutFileContents(dir + _T("variables.html"), data); - } - if(LoadResource(IDR_HTML_404, data, RT_HTML)) { - PutFileContents(dir + _T("404.html"), data); - } - if(LoadResource(IDR_HTML_PLAYER, data, RT_HTML)) {
+ if (LoadResource(IDR_HTML_CONTROLS, data, RT_HTML)) {
+ PutFileContents(dir + _T("controls.html"), data);
+ }
+ if (LoadResource(IDR_HTML_VARIABLES, data, RT_HTML)) {
+ PutFileContents(dir + _T("variables.html"), data);
+ }
+ if (LoadResource(IDR_HTML_404, data, RT_HTML)) {
+ PutFileContents(dir + _T("404.html"), data);
+ }
+ if (LoadResource(IDR_HTML_PLAYER, data, RT_HTML)) {
PutFileContents(dir + _T("player.html"), data);
}
POSITION pos = m_downloads.GetStartPosition();
- while(pos) {
+ while (pos) {
CString fn;
UINT id;
m_downloads.GetNextAssoc(pos, fn, id);
- if(LoadResource(id, data, _T("FILE"))) {
+ if (LoadResource(id, data, _T("FILE"))) {
PutFileContents(dir + fn, data);
}
}
@@ -226,7 +226,7 @@ void CWebServer::Deploy(CString dir) bool CWebServer::ToLocalPath(CString& path, CString& redir)
{
- if(!path.IsEmpty() && m_webroot.IsDirectory()) {
+ if (!path.IsEmpty() && m_webroot.IsDirectory()) {
CString str = path;
str.Replace('/', '\\');
str.TrimLeft('\\');
@@ -235,18 +235,18 @@ bool CWebServer::ToLocalPath(CString& path, CString& redir) p.Combine(m_webroot, str);
p.Canonicalize();
- if(p.IsDirectory()) {
+ if (p.IsDirectory()) {
CAtlList<CString> sl;
Explode(AfxGetAppSettings().strWebDefIndex, sl, ';');
POSITION pos = sl.GetHeadPosition();
- while(pos) {
+ while (pos) {
str = sl.GetNext(pos);
CPath p2 = p;
p2.Append(str);
- if(p2.FileExists()) {
+ if (p2.FileExists()) {
p = p2;
redir = path;
- if(redir.GetAt(redir.GetLength()-1) != '/') {
+ if (redir.GetAt(redir.GetLength()-1) != '/') {
redir += '/';
}
redir += str;
@@ -255,7 +255,7 @@ bool CWebServer::ToLocalPath(CString& path, CString& redir) }
}
- if(_tcslen(p) > _tcslen(m_webroot) && p.FileExists()) {
+ if (_tcslen(p) > _tcslen(m_webroot) && p.FileExists()) {
path = (LPCTSTR)p;
return true;
}
@@ -267,8 +267,8 @@ bool CWebServer::ToLocalPath(CString& path, CString& redir) bool CWebServer::LoadPage(UINT resid, CStringA& str, CString path)
{
CString redir;
- if(ToLocalPath(path, redir)) {
- if(FILE* f = _tfopen(path, _T("rb"))) {
+ if (ToLocalPath(path, redir)) {
+ if (FILE* f = _tfopen(path, _T("rb"))) {
fseek(f, 0, 2);
char* buff = str.GetBufferSetLength(ftell(f));
fseek(f, 0, 0);
@@ -284,10 +284,10 @@ bool CWebServer::LoadPage(UINT resid, CStringA& str, CString path) void CWebServer::OnAccept(CWebServerSocket* pServer)
{
CAutoPtr<CWebClientSocket> p(DNew CWebClientSocket(this, m_pMainFrame));
- if(pServer->Accept(*p)) {
+ if (pServer->Accept(*p)) {
CString name;
UINT port;
- if(AfxGetAppSettings().fWebServerLocalhostOnly && p->GetPeerName(name, port) && name != _T("127.0.0.1")) {
+ if (AfxGetAppSettings().fWebServerLocalhostOnly && p->GetPeerName(name, port) && name != _T("127.0.0.1")) {
p->Close();
return;
}
@@ -299,9 +299,9 @@ void CWebServer::OnAccept(CWebServerSocket* pServer) void CWebServer::OnClose(CWebClientSocket* pClient)
{
POSITION pos = m_clients.GetHeadPosition();
- while(pos) {
+ while (pos) {
POSITION cur = pos;
- if(m_clients.GetNext(pos) == pClient) {
+ if (m_clients.GetNext(pos) == pClient) {
m_clients.RemoveAt(cur);
break;
}
@@ -313,7 +313,7 @@ void CWebServer::OnRequest(CWebClientSocket* pClient, CStringA& hdr, CStringA& b CPath p(pClient->m_path);
CStringA ext = p.GetExtension().MakeLower();
CStringA mime;
- if(ext.IsEmpty()) {
+ if (ext.IsEmpty()) {
mime = "text/html";
} else {
m_mimes.Lookup(ext, mime);
@@ -323,27 +323,27 @@ void CWebServer::OnRequest(CWebClientSocket* pClient, CStringA& hdr, CStringA& b bool fHandled = false, fCGI = false;
- if(!fHandled && m_webroot.IsDirectory()) {
+ if (!fHandled && m_webroot.IsDirectory()) {
CStringA tmphdr;
fHandled = fCGI = CallCGI(pClient, tmphdr, body, mime);
- if(fHandled) {
+ if (fHandled) {
tmphdr.Replace("\r\n", "\n");
CAtlList<CStringA> hdrlines;
ExplodeMin(tmphdr, hdrlines, '\n');
POSITION pos = hdrlines.GetHeadPosition();
- while(pos) {
+ while (pos) {
POSITION cur = pos;
CAtlList<CStringA> sl;
CStringA key = Explode(hdrlines.GetNext(pos), sl, ':', 2);
- if(sl.GetCount() < 2) {
+ if (sl.GetCount() < 2) {
continue;
}
key.Trim().MakeLower();
- if(key == "content-type") {
+ if (key == "content-type") {
mime = sl.GetTail().Trim();
hdrlines.RemoveAt(cur);
- } else if(key == "content-length") {
+ } else if (key == "content-length") {
hdrlines.RemoveAt(cur);
}
}
@@ -354,15 +354,15 @@ void CWebServer::OnRequest(CWebClientSocket* pClient, CStringA& hdr, CStringA& b }
RequestHandler rh = NULL;
- if(!fHandled && m_internalpages.Lookup(pClient->m_path, rh) && (pClient->*rh)(hdr, body, mime)) {
- if(mime.IsEmpty()) {
+ if (!fHandled && m_internalpages.Lookup(pClient->m_path, rh) && (pClient->*rh)(hdr, body, mime)) {
+ if (mime.IsEmpty()) {
mime = "text/html";
}
CString redir;
- if(pClient->m_get.Lookup(_T("redir"), redir)
+ if (pClient->m_get.Lookup(_T("redir"), redir)
|| pClient->m_post.Lookup(_T("redir"), redir)) {
- if(redir.IsEmpty()) {
+ if (redir.IsEmpty()) {
redir = '/';
}
@@ -375,40 +375,40 @@ void CWebServer::OnRequest(CWebClientSocket* pClient, CStringA& hdr, CStringA& b fHandled = true;
}
- if(!fHandled && m_webroot.IsDirectory()) {
+ if (!fHandled && m_webroot.IsDirectory()) {
fHandled = LoadPage(0, body, pClient->m_path);
}
UINT resid;
CStringA res;
- if(!fHandled && m_downloads.Lookup(pClient->m_path, resid) && LoadResource(resid, res, _T("FILE"))) {
- if(mime.IsEmpty()) {
+ if (!fHandled && m_downloads.Lookup(pClient->m_path, resid) && LoadResource(resid, res, _T("FILE"))) {
+ if (mime.IsEmpty()) {
mime = "application/octet-stream";
}
memcpy(body.GetBufferSetLength(res.GetLength()), res.GetBuffer(), res.GetLength());
fHandled = true;
}
- if(!fHandled) {
+ if (!fHandled) {
hdr = mime == "text/html"
? "HTTP/1.0 301 Moved Permanently\r\n" "Location: /404.html\r\n"
: "HTTP/1.0 404 Not Found\r\n";
return;
}
- if(mime == "text/html" && !fCGI) {
+ if (mime == "text/html" && !fCGI) {
hdr +=
"Expires: Thu, 19 Nov 1981 08:52:00 GMT\r\n"
"Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0\r\n"
"Pragma: no-cache\r\n";
CStringA debug;
- if(AfxGetAppSettings().fWebServerPrintDebugInfo) {
+ if (AfxGetAppSettings().fWebServerPrintDebugInfo) {
debug += "<hr>\r\n";
CString key, value;
POSITION pos;
pos = pClient->m_hdrlines.GetStartPosition();
- while(pos) {
+ while (pos) {
pClient->m_hdrlines.GetNextAssoc(pos, key, value);
debug += "HEADER[" + key + "] = " + value + "<br>\r\n";
}
@@ -416,22 +416,22 @@ void CWebServer::OnRequest(CWebClientSocket* pClient, CStringA& hdr, CStringA& b debug += "path: " + pClient->m_path + "<br>\r\n";
debug += "ver: " + pClient->m_ver + "<br>\r\n";
pos = pClient->m_get.GetStartPosition();
- while(pos) {
+ while (pos) {
pClient->m_get.GetNextAssoc(pos, key, value);
debug += "GET[" + key + "] = " + value + "<br>\r\n";
}
pos = pClient->m_post.GetStartPosition();
- while(pos) {
+ while (pos) {
pClient->m_post.GetNextAssoc(pos, key, value);
debug += "POST[" + key + "] = " + value + "<br>\r\n";
}
pos = pClient->m_cookie.GetStartPosition();
- while(pos) {
+ while (pos) {
pClient->m_cookie.GetNextAssoc(pos, key, value);
debug += "COOKIE[" + key + "] = " + value + "<br>\r\n";
}
pos = pClient->m_request.GetStartPosition();
- while(pos) {
+ while (pos) {
pClient->m_request.GetNextAssoc(pos, key, value);
debug += "REQUEST[" + key + "] = " + value + "<br>\r\n";
}
@@ -450,25 +450,25 @@ void CWebServer::OnRequest(CWebClientSocket* pClient, CStringA& hdr, CStringA& b }
// gzip
- if(AfxGetAppSettings().fWebServerUseCompression && hdr.Find("Content-Encoding:") < 0)
+ if (AfxGetAppSettings().fWebServerUseCompression && hdr.Find("Content-Encoding:") < 0)
do {
CString accept_encoding;
pClient->m_hdrlines.Lookup(_T("accept-encoding"), accept_encoding);
accept_encoding.MakeLower();
CAtlList<CString> sl;
ExplodeMin(accept_encoding, sl, ',');
- if(!sl.Find(_T("gzip"))) {
+ if (!sl.Find(_T("gzip"))) {
break;
}
CHAR path[_MAX_PATH], fn[_MAX_PATH];
- if(!GetTempPathA(_MAX_PATH, path) || !GetTempFileNameA(path, "mpc_gz", 0, fn)) {
+ if (!GetTempPathA(_MAX_PATH, path) || !GetTempFileNameA(path, "mpc_gz", 0, fn)) {
break;
}
gzFile gf = gzopen(fn, "wb9");
- if(!gf || gzwrite(gf, (LPVOID)(LPCSTR)body, body.GetLength()) != body.GetLength()) {
- if(gf) {
+ if (!gf || gzwrite(gf, (LPVOID)(LPCSTR)body, body.GetLength()) != body.GetLength()) {
+ if (gf) {
gzclose(gf);
}
DeleteFileA(fn);
@@ -477,7 +477,7 @@ void CWebServer::OnRequest(CWebClientSocket* pClient, CStringA& hdr, CStringA& b gzclose(gf);
FILE* f = fopen(fn, "rb");
- if(!f) {
+ if (!f) {
DeleteFileA(fn);
break;
}
@@ -491,7 +491,7 @@ void CWebServer::OnRequest(CWebClientSocket* pClient, CStringA& hdr, CStringA& b DeleteFileA(fn);
hdr += "Content-Encoding: gzip\r\n";
- } while(0);
+ } while (0);
CStringA content;
content.Format(
@@ -504,7 +504,7 @@ void CWebServer::OnRequest(CWebClientSocket* pClient, CStringA& hdr, CStringA& b static DWORD WINAPI KillCGI(LPVOID lParam)
{
HANDLE hProcess = (HANDLE)lParam;
- if(WaitForSingleObject(hProcess, 30000) == WAIT_TIMEOUT) {
+ if (WaitForSingleObject(hProcess, 30000) == WAIT_TIMEOUT) {
TerminateProcess(hProcess, 0);
}
return 0;
@@ -513,7 +513,7 @@ static DWORD WINAPI KillCGI(LPVOID lParam) bool CWebServer::CallCGI(CWebClientSocket* pClient, CStringA& hdr, CStringA& body, CStringA& mime)
{
CString path = pClient->m_path, redir = path;
- if(!ToLocalPath(path, redir)) {
+ if (!ToLocalPath(path, redir)) {
return false;
}
CString ext = CPath(path).GetExtension().MakeLower();
@@ -521,7 +521,7 @@ bool CWebServer::CallCGI(CWebClientSocket* pClient, CStringA& hdr, CStringA& bod dir.RemoveFileSpec();
CString cgi;
- if(!m_cgi.Lookup(ext, cgi) || !CPath(cgi).FileExists()) {
+ if (!m_cgi.Lookup(ext, cgi) || !CPath(cgi).FileExists()) {
return false;
}
@@ -534,13 +534,13 @@ bool CWebServer::CallCGI(CWebClientSocket* pClient, CStringA& hdr, CStringA& bod saAttr.nLength = sizeof(saAttr);
saAttr.bInheritHandle = TRUE;
- if(CreatePipe(&hChildStdoutRd, &hChildStdoutWr, &saAttr, 0)) {
+ if (CreatePipe(&hChildStdoutRd, &hChildStdoutWr, &saAttr, 0)) {
BOOL fSuccess = DuplicateHandle(hProcess, hChildStdoutRd, hProcess, &hChildStdoutRdDup, 0, FALSE, DUPLICATE_SAME_ACCESS);
UNUSED_ALWAYS(fSuccess);
CloseHandle(hChildStdoutRd);
}
- if(CreatePipe(&hChildStdinRd, &hChildStdinWr, &saAttr, 0)) {
+ if (CreatePipe(&hChildStdinRd, &hChildStdinWr, &saAttr, 0)) {
BOOL fSuccess = DuplicateHandle(hProcess, hChildStdinWr, hProcess, &hChildStdinWrDup, 0, FALSE, DUPLICATE_SAME_ACCESS);
UNUSED_ALWAYS(fSuccess);
CloseHandle(hChildStdinWr);
@@ -561,12 +561,12 @@ bool CWebServer::CallCGI(CWebClientSocket* pClient, CStringA& hdr, CStringA& bod CStringA envstr;
LPVOID lpvEnv = GetEnvironmentStrings();
- if(lpvEnv) {
+ if (lpvEnv) {
CString str;
CAtlList<CString> env;
- for(LPTSTR lpszVariable = (LPTSTR)lpvEnv; *lpszVariable; lpszVariable += _tcslen(lpszVariable)+1)
- if(lpszVariable != (LPTSTR)lpvEnv) {
+ for (LPTSTR lpszVariable = (LPTSTR)lpvEnv; *lpszVariable; lpszVariable += _tcslen(lpszVariable)+1)
+ if (lpszVariable != (LPTSTR)lpvEnv) {
env.AddTail(lpszVariable);
}
@@ -579,15 +579,15 @@ bool CWebServer::CallCGI(CWebClientSocket* pClient, CStringA& hdr, CStringA& bod env.AddTail(_T("SCRIPT_NAME=") + redir);
env.AddTail(_T("QUERY_STRING=") + pClient->m_query);
- if(pClient->m_hdrlines.Lookup(_T("content-type"), str)) {
+ if (pClient->m_hdrlines.Lookup(_T("content-type"), str)) {
env.AddTail(_T("CONTENT_TYPE=") + str);
}
- if(pClient->m_hdrlines.Lookup(_T("content-length"), str)) {
+ if (pClient->m_hdrlines.Lookup(_T("content-length"), str)) {
env.AddTail(_T("CONTENT_LENGTH=") + str);
}
POSITION pos = pClient->m_hdrlines.GetStartPosition();
- while(pos) {
+ while (pos) {
CString key = pClient->m_hdrlines.GetKeyAt(pos);
CString value = pClient->m_hdrlines.GetNextValue(pos);
key.Replace(_T("-"), _T("_"));
@@ -598,14 +598,14 @@ bool CWebServer::CallCGI(CWebClientSocket* pClient, CStringA& hdr, CStringA& bod CString name;
UINT port;
- if(pClient->GetPeerName(name, port)) {
+ if (pClient->GetPeerName(name, port)) {
str.Format(_T("%d"), port);
env.AddTail(_T("REMOTE_ADDR=")+name);
env.AddTail(_T("REMOTE_HOST=")+name);
env.AddTail(_T("REMOTE_PORT=")+str);
}
- if(pClient->GetSockName(name, port)) {
+ if (pClient->GetSockName(name, port)) {
str.Format(_T("%d"), port);
env.AddTail(_T("SERVER_NAME=")+name);
env.AddTail(_T("SERVER_PORT=")+str);
@@ -622,8 +622,8 @@ bool CWebServer::CallCGI(CWebClientSocket* pClient, CStringA& hdr, CStringA& bod TCHAR* cmdln = DNew TCHAR[32768];
_sntprintf(cmdln, 32768, _T("\"%s\" \"%s\""), cgi, path);
- if(hChildStdinRd && hChildStdoutWr)
- if(CreateProcess(
+ if (hChildStdinRd && hChildStdoutWr)
+ if (CreateProcess(
NULL, cmdln, NULL, NULL, TRUE, 0,
envstr.GetLength() ? (LPVOID)(LPCSTR)envstr : NULL,
dir, &siStartInfo, &piProcInfo)) {
@@ -634,8 +634,8 @@ bool CWebServer::CallCGI(CWebClientSocket* pClient, CStringA& hdr, CStringA& bod DWORD dwRead, dwWritten = 0;
int i = 0, len = pClient->m_data.GetLength();
- for(; i < len; i += dwWritten)
- if(!WriteFile(hChildStdinWrDup, (LPCSTR)pClient->m_data + i, min(len - i, BUFFSIZE), &dwWritten, NULL)) {
+ for (; i < len; i += dwWritten)
+ if (!WriteFile(hChildStdinWrDup, (LPCSTR)pClient->m_data + i, min(len - i, BUFFSIZE), &dwWritten, NULL)) {
break;
}
@@ -645,13 +645,13 @@ bool CWebServer::CallCGI(CWebClientSocket* pClient, CStringA& hdr, CStringA& bod body.Empty();
CStringA buff;
- while(i == len && ReadFile(hChildStdoutRdDup, buff.GetBuffer(BUFFSIZE), BUFFSIZE, &dwRead, NULL) && dwRead) {
+ while (i == len && ReadFile(hChildStdoutRdDup, buff.GetBuffer(BUFFSIZE), BUFFSIZE, &dwRead, NULL) && dwRead) {
buff.ReleaseBufferSetLength(dwRead);
body += buff;
}
int hdrend = body.Find("\r\n\r\n");
- if(hdrend >= 0) {
+ if (hdrend >= 0) {
hdr = body.Left(hdrend+2);
body = body.Mid(hdrend+4);
}
diff --git a/src/apps/mplayerc/WebServerSocket.cpp b/src/apps/mplayerc/WebServerSocket.cpp index 4810aa6c5..f502023c4 100644 --- a/src/apps/mplayerc/WebServerSocket.cpp +++ b/src/apps/mplayerc/WebServerSocket.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -38,7 +38,7 @@ CWebServerSocket::~CWebServerSocket() void CWebServerSocket::OnAccept(int nErrorCode)
{
- if(nErrorCode == 0 && m_pWebServer) {
+ if (nErrorCode == 0 && m_pWebServer) {
m_pWebServer->OnAccept(this);
}
diff --git a/src/apps/mplayerc/jpeg.cpp b/src/apps/mplayerc/jpeg.cpp index bcb32c098..85164bb0a 100644 --- a/src/apps/mplayerc/jpeg.cpp +++ b/src/apps/mplayerc/jpeg.cpp @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -29,7 +29,7 @@ bool CJpegEncoder::PutBit(int b, int n)
{
- if(n > 24 || n <= 0) {
+ if (n > 24 || n <= 0) {
return(false);
}
@@ -37,10 +37,10 @@ bool CJpegEncoder::PutBit(int b, int n) m_bbuff |= b & ((1 << n) - 1);
m_bwidth += n;
- while(m_bwidth >= 8) {
+ while (m_bwidth >= 8) {
BYTE c = (BYTE)(m_bbuff >> (m_bwidth - 8));
PutByte(c);
- if(c == 0xff) {
+ if (c == 0xff) {
PutByte(0);
}
m_bwidth -= 8;
@@ -51,10 +51,10 @@ bool CJpegEncoder::PutBit(int b, int n) void CJpegEncoder::Flush()
{
- if(m_bwidth > 0) {
+ if (m_bwidth > 0) {
BYTE c = m_bbuff << (8 - m_bwidth);
PutByte(c);
- if(c == 0xff) {
+ if (c == 0xff) {
PutByte(0);
}
}
@@ -66,15 +66,15 @@ void CJpegEncoder::Flush() int CJpegEncoder::GetBitWidth(short q)
{
- if(q == 0) {
+ if (q == 0) {
return(0);
}
- if(q < 0) {
+ if (q < 0) {
q = -q;
}
int width = 15;
- for(; !(q&0x4000); q <<= 1, width--) {
+ for (; !(q&0x4000); q <<= 1, width--) {
;
}
return(width);
@@ -97,7 +97,7 @@ void CJpegEncoder::WriteDQT() PutByte(size>>8);
PutByte(size&0xff);
- for(int c = 0; c < 2; c++) {
+ for (int c = 0; c < 2; c++) {
PutByte(c);
PutBytes(quanttbl[c], 64);
}
@@ -145,13 +145,13 @@ void CJpegEncoder::WriteDHT() PutByte(0x00); // tbl class (DC) | tbl id
PutBytes(DCVLC_NumByLength[0], 16);
- for(int i = 0; i < 12; i++) {
+ for (int i = 0; i < 12; i++) {
PutByte(i);
}
PutByte(0x01); // tbl class (DC) | tbl id
PutBytes(DCVLC_NumByLength[1], 16);
- for(int i = 0; i < 12; i++) {
+ for (int i = 0; i < 12; i++) {
PutByte(i);
}
@@ -196,41 +196,41 @@ void CJpegEncoder::WriteSOS() static float cosuv[8][8][8][8];
// oh yeah, we don't need no fast dct :)
- for(int v = 0; v < 8; v++)
- for(int u = 0; u < 8; u++)
- for(int j = 0; j < 8; j++)
- for(int i = 0; i < 8; i++) {
+ for (int v = 0; v < 8; v++)
+ for (int u = 0; u < 8; u++)
+ for (int j = 0; j < 8; j++)
+ for (int i = 0; i < 8; i++) {
cosuv[v][u][j][i] = (float)(cos((2*i+1)*u*PI/16) * cos((2*j+1)*v*PI/16));
}
int prevDC[3] = {0, 0, 0};
- for(int y = 0; y < m_h; y += 8) {
+ for (int y = 0; y < m_h; y += 8) {
int jj = min(m_h - y, 8);
- for(int x = 0; x < m_w; x += 8) {
+ for (int x = 0; x < m_w; x += 8) {
int ii = min(m_w - x, 8);
- for(int c = 0; c < ColorComponents; c++) {
+ for (int c = 0; c < ColorComponents; c++) {
int cc = !!c;
int ACs = 0;
static short block[64];
- for(int zigzag = 0; zigzag < 64; zigzag++) {
+ for (int zigzag = 0; zigzag < 64; zigzag++) {
BYTE u = zigzagU[zigzag];
BYTE v = zigzagV[zigzag];
float F = 0;
/*
- for(int j = 0; j < jj; j++)
- for(int i = 0; i < ii; i++)
+ for (int j = 0; j < jj; j++)
+ for (int i = 0; i < ii; i++)
F += (signed char)m_p[((y+j)*m_w + (x+i))*4 + c] * cosuv[v][u][j][i];
*/
- for(int j = 0; j < jj; j++) {
+ for (int j = 0; j < jj; j++) {
signed char* p = (signed char*)&m_p[((y+j)*m_w + x)*4 + c];
- for(int i = 0; i < ii; i++, p += 4) {
+ for (int i = 0; i < ii; i++, p += 4) {
F += *p * cosuv[v][u][j][i];
}
}
@@ -247,21 +247,21 @@ void CJpegEncoder::WriteSOS() int size = GetBitWidth(DC);
PutBit(DCVLC[cc][size], DCVLC_Size[cc][size]);
- if(DC < 0) {
+ if (DC < 0) {
DC = DC - 1;
}
PutBit(DC, size);
int j;
- for(j = 64; j > 1 && !block[j-1]; j--) {
+ for (j = 64; j > 1 && !block[j-1]; j--) {
;
}
- for(int i = 1; i < j; i++) {
+ for (int i = 1; i < j; i++) {
short AC = block[i];
- if(AC == 0) {
- if(++ACs == 16) {
+ if (AC == 0) {
+ if (++ACs == 16) {
PutBit(ACVLC[cc][15][0], ACVLC_Size[cc][15][0]);
ACs = 0;
}
@@ -269,7 +269,7 @@ void CJpegEncoder::WriteSOS() int size = GetBitWidth(AC);
PutBit(ACVLC[cc][ACs][size], ACVLC_Size[cc][ACs][size]);
- if(AC < 0) {
+ if (AC < 0) {
AC--;
}
PutBit(AC, size);
@@ -278,7 +278,7 @@ void CJpegEncoder::WriteSOS() }
}
- if(j < 64) {
+ if (j < 64) {
PutBit(ACVLC[cc][0][0], ACVLC_Size[cc][0][0]);
}
}
@@ -308,7 +308,7 @@ bool CJpegEncoder::Encode(const BYTE* dib) int bpp = bi->bmiHeader.biBitCount;
- if(bpp != 16 && bpp != 24 && bpp != 32) { // 16 & 24 not tested!!! there may be some alignment problems when the row size is not 4*something in bytes
+ if (bpp != 16 && bpp != 24 && bpp != 32) { // 16 & 24 not tested!!! there may be some alignment problems when the row size is not 4*something in bytes
return false;
}
@@ -317,8 +317,8 @@ bool CJpegEncoder::Encode(const BYTE* dib) m_p = DNew BYTE[m_w*m_h*4];
const BYTE* src = dib + sizeof(bi->bmiHeader);
- if(bi->bmiHeader.biBitCount <= 8) {
- if(bi->bmiHeader.biClrUsed) {
+ if (bi->bmiHeader.biBitCount <= 8) {
+ if (bi->bmiHeader.biClrUsed) {
src += bi->bmiHeader.biClrUsed * sizeof(bi->bmiColors[0]);
} else {
src += (1 << bi->bmiHeader.biBitCount) * DWORD(sizeof(bi->bmiColors[0]));
@@ -334,7 +334,7 @@ bool CJpegEncoder::Encode(const BYTE* dib) (BYTE*)src + srcpitch*(m_h-1), -srcpitch, bpp);
BYTE* p = m_p;
- for(BYTE* e = p + m_h*dstpitch; p < e; p += 4) {
+ for (BYTE* e = p + m_h*dstpitch; p < e; p += 4) {
int r = p[2], g = p[1], b = p[0];
p[0] = (BYTE)min(max(0.2990*r+0.5870*g+0.1140*b, 0), 255) - 128;
@@ -342,9 +342,9 @@ bool CJpegEncoder::Encode(const BYTE* dib) p[2] = (BYTE)min(max(0.5000*r-0.4187*g-0.0813*b + 128, 0), 255) - 128;
}
- if(quanttbl[0][0] == 16) {
- for(int i = 0; i < countof(quanttbl); i++)
- for(int j = 0; j < countof(quanttbl[0]); j++) {
+ if (quanttbl[0][0] == 16) {
+ for (int i = 0; i < countof(quanttbl); i++)
+ for (int j = 0; j < countof(quanttbl[0]); j++) {
quanttbl[i][j] >>= 2; // the default quantization table contains a little too large values
}
}
@@ -382,7 +382,7 @@ bool CJpegEncoderFile::PutBytes(const void* pData, size_t len) bool CJpegEncoderFile::Encode(const BYTE* dib)
{
m_file = _tfopen(m_fn, _T("wb"));
- if(!m_file) {
+ if (!m_file) {
return false;
}
bool ret = __super::Encode(dib);
diff --git a/src/apps/mplayerc/libpng.c b/src/apps/mplayerc/libpng.c index eb5dd89fa..8a10c00e1 100644 --- a/src/apps/mplayerc/libpng.c +++ b/src/apps/mplayerc/libpng.c @@ -31,7 +31,7 @@ static void read_data_fn(png_structp png_ptr, png_bytep data, png_size_t length)
{
struct png_t* png = (struct png_t*)png_get_progressive_ptr(png_ptr);
- if(png->pos + length > png->size) {
+ if (png->pos + length > png->size) {
png_error(png_ptr, "Read Error");
}
memcpy(data, &png->data[png->pos], length);
@@ -48,7 +48,7 @@ unsigned char* DecompressPNG(struct png_t* png, int* w, int* h) unsigned char* row;
unsigned int x, y, c;
- if(png_sig_cmp(png->data, 0, 8) != 0) {
+ if (png_sig_cmp(png->data, 0, 8) != 0) {
return NULL;
}
@@ -56,25 +56,25 @@ unsigned char* DecompressPNG(struct png_t* png, int* w, int* h) png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
// (png_voidp)user_error_ptr, user_error_fn, user_warning_fn);
- if(!png_ptr) {
+ if (!png_ptr) {
return NULL;
}
png_set_read_fn(png_ptr, (png_voidp)png, read_data_fn);
info_ptr = png_create_info_struct(png_ptr);
- if(!info_ptr) {
+ if (!info_ptr) {
png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL);
return NULL;
}
end_info = png_create_info_struct(png_ptr);
- if(!end_info) {
+ if (!end_info) {
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
return NULL;
}
- if(setjmp(png_jmpbuf(png_ptr))) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
return NULL;
}
@@ -90,7 +90,7 @@ unsigned char* DecompressPNG(struct png_t* png, int* w, int* h) PNG_TRANSFORM_BGR,
NULL);
- if(png_get_channels(png_ptr, info_ptr) != 3) {
+ if (png_get_channels(png_ptr, info_ptr) != 3) {
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
return NULL;
}
@@ -100,11 +100,11 @@ unsigned char* DecompressPNG(struct png_t* png, int* w, int* h) *w = info_ptr->width;
*h = info_ptr->height;
- for(y = 0; y < info_ptr->height; y++) {
+ for (y = 0; y < info_ptr->height; y++) {
row = &pic[y * info_ptr->width * 4];
- for(x = 0; x < info_ptr->width*3; row += 4) {
- for(c = 0; c < 3; c++) {
+ for (x = 0; x < info_ptr->width*3; row += 4) {
+ for (c = 0; c < 3; c++) {
row[c] = info_ptr->row_pointers[y][x++];
}
}
diff --git a/src/apps/mplayerc/libpng.h b/src/apps/mplayerc/libpng.h index 7a5cf8aaa..de82b27bb 100644 --- a/src/apps/mplayerc/libpng.h +++ b/src/apps/mplayerc/libpng.h @@ -2,7 +2,7 @@ * $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -42,14 +42,14 @@ public: bool ret = false;
CStringA str;
- if(LoadResource(id, str, _T("FILE"))) {
+ if (LoadResource(id, str, _T("FILE"))) {
struct png_t png;
png.data = (unsigned char*)(LPCSTR)str;
png.size = str.GetLength();
int w, h;
- if(BYTE* p = DecompressPNG(&png, &w, &h)) {
- if(Create(w, -h, 32)) {
- for(int y = 0; y < h; y++) {
+ if (BYTE* p = DecompressPNG(&png, &w, &h)) {
+ if (Create(w, -h, 32)) {
+ for (int y = 0; y < h; y++) {
memcpy(GetPixelAddress(0, y), &p[w*4*y], w*4);
}
ret = true;
diff --git a/src/apps/mplayerc/mplayerc.cpp b/src/apps/mplayerc/mplayerc.cpp index 6b996a755..e83b6fb46 100644 --- a/src/apps/mplayerc/mplayerc.cpp +++ b/src/apps/mplayerc/mplayerc.cpp @@ -40,7 +40,7 @@ extern "C" { void CorrectComboListWidth(CComboBox& box, CFont* pWndFont)
{
int cnt = box.GetCount();
- if(cnt <= 0) {
+ if (cnt <= 0) {
return;
}
@@ -49,11 +49,11 @@ void CorrectComboListWidth(CComboBox& box, CFont* pWndFont) int maxw = box.GetDroppedWidth();
- for(int i = 0; i < cnt; i++) {
+ for (int i = 0; i < cnt; i++) {
CString str;
box.GetLBText(i, str);
int w = pDC->GetTextExtent(str).cx + 22;
- if(maxw < w) {
+ if (maxw < w) {
maxw = w;
}
}
@@ -65,25 +65,25 @@ void CorrectComboListWidth(CComboBox& box, CFont* pWndFont) HICON LoadIcon(CString fn, bool fSmall)
{
- if(fn.IsEmpty()) {
+ if (fn.IsEmpty()) {
return(NULL);
}
CString ext = fn.Left(fn.Find(_T("://"))+1).TrimRight(':');
- if(ext.IsEmpty() || !ext.CompareNoCase(_T("file"))) {
+ if (ext.IsEmpty() || !ext.CompareNoCase(_T("file"))) {
ext = _T(".") + fn.Mid(fn.ReverseFind('.')+1);
}
CSize size(fSmall?16:32,fSmall?16:32);
- if(!ext.CompareNoCase(_T(".ifo"))) {
- if(HICON hIcon = (HICON)LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_DVD), IMAGE_ICON, size.cx, size.cy, 0)) {
+ if (!ext.CompareNoCase(_T(".ifo"))) {
+ if (HICON hIcon = (HICON)LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_DVD), IMAGE_ICON, size.cx, size.cy, 0)) {
return(hIcon);
}
}
- if(!ext.CompareNoCase(_T(".cda"))) {
- if(HICON hIcon = (HICON)LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_AUDIOCD), IMAGE_ICON, size.cx, size.cy, 0)) {
+ if (!ext.CompareNoCase(_T(".cda"))) {
+ if (HICON hIcon = (HICON)LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_AUDIOCD), IMAGE_ICON, size.cx, size.cy, 0)) {
return(hIcon);
}
}
@@ -94,18 +94,18 @@ HICON LoadIcon(CString fn, bool fSmall) TCHAR buff[256];
ULONG len;
- if(ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, ext + _T("\\DefaultIcon"), KEY_READ)) {
- if(ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, ext, KEY_READ)) {
+ if (ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, ext + _T("\\DefaultIcon"), KEY_READ)) {
+ if (ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, ext, KEY_READ)) {
break;
}
len = sizeof(buff)/sizeof(buff[0]);
memset(buff, 0, sizeof(buff));
- if(ERROR_SUCCESS != key.QueryStringValue(NULL, buff, &len) || (ext = buff).Trim().IsEmpty()) {
+ if (ERROR_SUCCESS != key.QueryStringValue(NULL, buff, &len) || (ext = buff).Trim().IsEmpty()) {
break;
}
- if(ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, ext + _T("\\DefaultIcon"), KEY_READ)) {
+ if (ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, ext + _T("\\DefaultIcon"), KEY_READ)) {
break;
}
}
@@ -114,17 +114,17 @@ HICON LoadIcon(CString fn, bool fSmall) len = sizeof(buff)/sizeof(buff[0]);
memset(buff, 0, sizeof(buff));
- if(ERROR_SUCCESS != key.QueryStringValue(NULL, buff, &len) || (icon = buff).Trim().IsEmpty()) {
+ if (ERROR_SUCCESS != key.QueryStringValue(NULL, buff, &len) || (icon = buff).Trim().IsEmpty()) {
break;
}
int i = icon.ReverseFind(',');
- if(i < 0) {
+ if (i < 0) {
break;
}
int id = 0;
- if(_stscanf_s(icon.Mid(i+1), _T("%d"), &id) != 1) {
+ if (_stscanf_s(icon.Mid(i+1), _T("%d"), &id) != 1) {
break;
}
@@ -135,10 +135,10 @@ HICON LoadIcon(CString fn, bool fSmall) ? ExtractIconEx(icon, id, NULL, &hIcon, 1)
: ExtractIconEx(icon, id, &hIcon, NULL, 1);
UNUSED_ALWAYS(cnt);
- if(hIcon) {
+ if (hIcon) {
return hIcon;
}
- } while(0);
+ } while (0);
return((HICON)LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_UNKNOWN), IMAGE_ICON, size.cx, size.cy, 0));
}
@@ -150,41 +150,41 @@ bool LoadType(CString fn, CString& type) TCHAR buff[256];
ULONG len;
- if(fn.IsEmpty()) {
+ if (fn.IsEmpty()) {
return(NULL);
}
CString ext = fn.Left(fn.Find(_T("://"))+1).TrimRight(':');
- if(ext.IsEmpty() || !ext.CompareNoCase(_T("file"))) {
+ if (ext.IsEmpty() || !ext.CompareNoCase(_T("file"))) {
ext = _T(".") + fn.Mid(fn.ReverseFind('.')+1);
}
CString tmp = _T("");
CString mplayerc_ext = _T("mplayerc") + ext;
- if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, mplayerc_ext)) {
+ if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, mplayerc_ext)) {
tmp = mplayerc_ext;
}
- if((tmp == _T("")) && (ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, ext))) {
+ if ((tmp == _T("")) && (ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, ext))) {
return(false);
}
- if(tmp == _T("")) {
+ if (tmp == _T("")) {
tmp = ext;
}
- while(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, tmp)) {
+ while (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, tmp)) {
len = sizeof(buff)/sizeof(buff[0]);
memset(buff, 0, sizeof(buff));
- if(ERROR_SUCCESS != key.QueryStringValue(NULL, buff, &len)) {
+ if (ERROR_SUCCESS != key.QueryStringValue(NULL, buff, &len)) {
break;
}
CString str(buff);
str.Trim();
- if(str.IsEmpty() || str == tmp) {
+ if (str.IsEmpty() || str == tmp) {
break;
}
@@ -200,35 +200,36 @@ bool LoadResource(UINT resid, CStringA& str, LPCTSTR restype) {
str.Empty();
HRSRC hrsrc = FindResource(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(resid), restype);
- if(!hrsrc) {
+ if (!hrsrc) {
return(false);
}
HGLOBAL hGlobal = LoadResource(AfxGetApp()->m_hInstance, hrsrc);
- if(!hGlobal) {
+ if (!hGlobal) {
return(false);
}
DWORD size = SizeofResource(AfxGetApp()->m_hInstance, hrsrc);
- if(!size) {
+ if (!size) {
return(false);
}
memcpy(str.GetBufferSetLength(size), LockResource(hGlobal), size);
return(true);
}
-WORD assignedToCmd(UINT keyOrMouseValue, bool bCheckMouse) {
+WORD assignedToCmd(UINT keyOrMouseValue, bool bCheckMouse)
+{
WORD assignTo = 0;
AppSettings& s = AfxGetAppSettings();
POSITION pos = s.wmcmds.GetHeadPosition();
- while(pos && (!assignTo)) {
+ while (pos && (!assignTo)) {
wmcmd& wc = s.wmcmds.GetNext(pos);
- if(bCheckMouse) {
- if(wc.mouse == keyOrMouseValue) {
+ if (bCheckMouse) {
+ if (wc.mouse == keyOrMouseValue) {
assignTo = wc.cmd;
break;
}
} else {
- if(wc.key == keyOrMouseValue) {
+ if (wc.key == keyOrMouseValue) {
assignTo = wc.cmd;
break;
}
@@ -404,9 +405,9 @@ void CMPlayerCApp::ShowCmdlnSwitches() const {
CString s;
- if(m_s.nCLSwitches&CLSW_UNRECOGNIZEDSWITCH) {
+ if (m_s.nCLSwitches&CLSW_UNRECOGNIZEDSWITCH) {
CAtlList<CString> sl;
- for(int i = 0; i < __argc; i++) {
+ for (int i = 0; i < __argc; i++) {
sl.AddTail(__targv[i]);
}
s += ResStr(IDS_UNKNOWN_SWITCH) + Implode(sl, ' ') + _T("\n\n");
@@ -429,7 +430,7 @@ bool CMPlayerCApp::StoreSettingsToIni() CString ini = GetIniPath();
/*
FILE* f;
- if(!(f = _tfopen(ini, _T("r+"))) && !(f = _tfopen(ini, _T("w"))))
+ if (!(f = _tfopen(ini, _T("r+"))) && !(f = _tfopen(ini, _T("w"))))
return StoreSettingsToRegistry();
fclose(f);
*/
@@ -444,14 +445,14 @@ bool CMPlayerCApp::StoreSettingsToIni() // If you want to try unicode ini, uncomment following code block.
/*
- if(!::PathFileExists(m_pszProfileName)) // don't overwrite existing ini file
+ if (!::PathFileExists(m_pszProfileName)) // don't overwrite existing ini file
{
LPTSTR pszComments = _T("; Media Player Classic - Home Cinema");
WORD wBOM = 0xFEFF;// UTF16-LE BOM(FFFE)
DWORD nBytes;
HANDLE hFile = ::CreateFile(m_pszProfileName, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
- if(hFile != INVALID_HANDLE_VALUE)
+ if (hFile != INVALID_HANDLE_VALUE)
{
::WriteFile(hFile, &wBOM, sizeof(WORD), &nBytes, NULL);
::WriteFile(hFile, pszComments, (_tcslen(pszComments)+1)*(sizeof(TCHAR)), &nBytes, NULL);
@@ -494,20 +495,20 @@ bool CMPlayerCApp::GetAppSavePath(CString& path) {
path.Empty();
- if(IsIniValid()) { // If settings ini file found, store stuff in the same folder as the exe file
+ if (IsIniValid()) { // If settings ini file found, store stuff in the same folder as the exe file
GetModuleFileName(AfxGetInstanceHandle(), path.GetBuffer(_MAX_PATH), _MAX_PATH);
path.ReleaseBuffer();
path = path.Left(path.ReverseFind('\\'));
} else {
CRegKey key;
- if(ERROR_SUCCESS == key.Open(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"), KEY_READ)) {
+ if (ERROR_SUCCESS == key.Open(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"), KEY_READ)) {
ULONG len = _MAX_PATH;
- if(ERROR_SUCCESS == key.QueryStringValue(_T("AppData"), path.GetBuffer(_MAX_PATH), &len)) {
+ if (ERROR_SUCCESS == key.QueryStringValue(_T("AppData"), path.GetBuffer(_MAX_PATH), &len)) {
path.ReleaseBufferSetLength(len);
}
}
- if(path.IsEmpty()) {
+ if (path.IsEmpty()) {
return(false);
}
@@ -523,15 +524,15 @@ bool CMPlayerCApp::GetAppSavePath(CString& path) void CMPlayerCApp::PreProcessCommandLine()
{
m_cmdln.RemoveAll();
- for(int i = 1; i < __argc; i++) {
+ for (int i = 1; i < __argc; i++) {
CString str = CString(__targv[i]).Trim(_T(" \""));
- if(str[0] != '/' && str[0] != '-' && str.Find(_T(":")) < 0) {
+ if (str[0] != '/' && str[0] != '-' && str.Find(_T(":")) < 0) {
LPTSTR p = NULL;
CString str2;
str2.ReleaseBuffer(GetFullPathName(str, _MAX_PATH, str2.GetBuffer(_MAX_PATH), &p));
CFileStatus fs;
- if(!str2.IsEmpty() && CFileGetStatus(str2, fs)) {
+ if (!str2.IsEmpty() && CFileGetStatus(str2, fs)) {
str = str2;
}
}
@@ -542,19 +543,19 @@ void CMPlayerCApp::PreProcessCommandLine() void CMPlayerCApp::SendCommandLine(HWND hWnd)
{
- if(m_cmdln.IsEmpty()) {
+ if (m_cmdln.IsEmpty()) {
return;
}
int bufflen = sizeof(DWORD);
POSITION pos = m_cmdln.GetHeadPosition();
- while(pos) {
+ while (pos) {
bufflen += (m_cmdln.GetNext(pos).GetLength()+1)*sizeof(TCHAR);
}
CAutoVectorPtr<BYTE> buff;
- if(!buff.Allocate(bufflen)) {
+ if (!buff.Allocate(bufflen)) {
return;
}
@@ -564,7 +565,7 @@ void CMPlayerCApp::SendCommandLine(HWND hWnd) p += sizeof(DWORD);
pos = m_cmdln.GetHeadPosition();
- while(pos) {
+ while (pos) {
CString s = m_cmdln.GetNext(pos);
int len = (s.GetLength()+1)*sizeof(TCHAR);
memcpy(p, s, len);
@@ -680,18 +681,18 @@ NTSTATUS WINAPI Mine_NtQueryInformationProcess(HANDLE ProcessHandle, PROCESSINFO LONG WINAPI Mine_ChangeDisplaySettingsEx(LONG ret, DWORD dwFlags, LPVOID lParam)
{
- if(dwFlags&CDS_VIDEOPARAMETERS) {
+ if (dwFlags&CDS_VIDEOPARAMETERS) {
VIDEOPARAMETERS* vp = (VIDEOPARAMETERS*)lParam;
- if(vp->Guid == GUIDFromCString(_T("{02C62061-1097-11d1-920F-00A024DF156E}"))
+ if (vp->Guid == GUIDFromCString(_T("{02C62061-1097-11d1-920F-00A024DF156E}"))
&& (vp->dwFlags&VP_FLAGS_COPYPROTECT)) {
- if(vp->dwCommand == VP_COMMAND_GET) {
- if((vp->dwTVStandard&VP_TV_STANDARD_WIN_VGA)
+ if (vp->dwCommand == VP_COMMAND_GET) {
+ if ((vp->dwTVStandard&VP_TV_STANDARD_WIN_VGA)
&& vp->dwTVStandard != VP_TV_STANDARD_WIN_VGA) {
TRACE(_T("Ooops, tv-out enabled? macrovision checks suck..."));
vp->dwTVStandard = VP_TV_STANDARD_WIN_VGA;
}
- } else if(vp->dwCommand == VP_COMMAND_SET) {
+ } else if (vp->dwCommand == VP_COMMAND_SET) {
TRACE(_T("Ooops, as I already told ya, no need for any macrovision bs here"));
return 0;
}
@@ -720,7 +721,7 @@ HANDLE WINAPI Mine_CreateFileA(LPCSTR p1, DWORD p2, DWORD p3, LPSECURITY_ATTRIBU //CStringA fn(p1);
//fn.MakeLower();
//int i = fn.Find(".part");
- //if(i > 0 && i == fn.GetLength() - 5)
+ //if (i > 0 && i == fn.GetLength() - 5)
p3 |= FILE_SHARE_WRITE;
return Real_CreateFileA(p1, p2, p3, p4, p5, p6, p7);
@@ -774,7 +775,7 @@ HANDLE WINAPI Mine_CreateFileW(LPCWSTR p1, DWORD p2, DWORD p3, LPSECURITY_ATTRIB MMRESULT WINAPI Mine_mixerSetControlDetails(HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails)
{
- if(fdwDetails == (MIXER_OBJECTF_HMIXER|MIXER_SETCONTROLDETAILSF_VALUE)) {
+ if (fdwDetails == (MIXER_OBJECTF_HMIXER|MIXER_SETCONTROLDETAILSF_VALUE)) {
return MMSYSERR_NOERROR; // don't touch the mixer, kthx
}
return Real_mixerSetControlDetails(hmxobj, pmxcd, fdwDetails);
@@ -784,7 +785,7 @@ BOOL WINAPI Mine_DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l {
BOOL ret = Real_DeviceIoControl(hDevice, dwIoControlCode, lpInBuffer, nInBufferSize, lpOutBuffer, nOutBufferSize, lpBytesReturned, lpOverlapped);
- if(IOCTL_DVD_GET_REGION == dwIoControlCode && lpOutBuffer
+ if (IOCTL_DVD_GET_REGION == dwIoControlCode && lpOutBuffer
&& lpBytesReturned && *lpBytesReturned == sizeof(DVD_REGION)) {
DVD_REGION* pDVDRegion = (DVD_REGION*)lpOutBuffer;
pDVDRegion->SystemRegion = ~pDVDRegion->RegionData;
@@ -821,7 +822,7 @@ public: CRenderedTextSubtitle s(&csLock);
s.Open(_T("../../Subtitles/libssf/demo/demo.ssa"), 1);
- for(int i = 2*60*1000+2000; i < 2*60*1000+17000; i += 10)
+ for (int i = 2*60*1000+2000; i < 2*60*1000+17000; i += 10)
{
memsetd(spd.bits, 0xff000000, spd.pitch*spd.h);
CRect bbox;
@@ -833,9 +834,9 @@ public: ssf::CRenderer s(&csLock);
s.Open(_T("../../Subtitles/libssf/demo/demo.ssf"));
- for(int i = 2*60*1000+2000; i < 2*60*1000+17000; i += 40)
- //for(int i = 2*60*1000+2000; i < 2*60*1000+17000; i += 1000)
- //for(int i = 0; i < 5000; i += 40)
+ for (int i = 2*60*1000+2000; i < 2*60*1000+17000; i += 40)
+ //for (int i = 2*60*1000+2000; i < 2*60*1000+17000; i += 1000)
+ //for (int i = 0; i < 5000; i += 40)
{
memsetd(spd.bits, 0xff000000, spd.pitch*spd.h);
CRect bbox;
@@ -905,7 +906,7 @@ BOOL CMPlayerCApp::InitInstance() }
#endif
- if(SetHeapOptions()) {
+ if (SetHeapOptions()) {
TRACE(_T("Terminate on corruption enabled\n"));
} else {
CString heap_err;
@@ -943,7 +944,7 @@ BOOL CMPlayerCApp::InitInstance() ASSERT (lError == NOERROR);
HRESULT hr;
- if(FAILED(hr = OleInitialize(0))) {
+ if (FAILED(hr = OleInitialize(0))) {
AfxMessageBox(_T("OleInitialize failed!"));
return FALSE;
}
@@ -959,19 +960,19 @@ BOOL CMPlayerCApp::InitInstance() wndcls.lpszMenuName = NULL;
wndcls.lpszClassName = MPC_WND_CLASS_NAME;
- if(!AfxRegisterClass(&wndcls)) {
+ if (!AfxRegisterClass(&wndcls)) {
AfxMessageBox(_T("MainFrm class registration failed!"));
return FALSE;
}
- if(!AfxSocketInit(NULL)) {
+ if (!AfxSocketInit(NULL)) {
AfxMessageBox(_T("AfxSocketInit failed!"));
return FALSE;
}
PreProcessCommandLine();
- if(IsIniValid()) {
+ if (IsIniValid()) {
StoreSettingsToIni();
} else {
StoreSettingsToRegistry();
@@ -979,23 +980,23 @@ BOOL CMPlayerCApp::InitInstance() m_s.ParseCommandLine(m_cmdln);
- if(m_s.nCLSwitches&(CLSW_HELP|CLSW_UNRECOGNIZEDSWITCH)) {
+ if (m_s.nCLSwitches&(CLSW_HELP|CLSW_UNRECOGNIZEDSWITCH)) {
m_s.UpdateData(false);
ShowCmdlnSwitches();
return FALSE;
}
- if((m_s.nCLSwitches&CLSW_CLOSE) && m_s.slFiles.IsEmpty()) {
+ if ((m_s.nCLSwitches&CLSW_CLOSE) && m_s.slFiles.IsEmpty()) {
return FALSE;
}
m_s.UpdateData(false);
- if((m_s.nCLSwitches&CLSW_REGEXTVID) || (m_s.nCLSwitches&CLSW_REGEXTAUD)) {
+ if ((m_s.nCLSwitches&CLSW_REGEXTVID) || (m_s.nCLSwitches&CLSW_REGEXTAUD)) {
CMediaFormats& mf = m_s.m_Formats;
- for(int i = 0; i < (int)mf.GetCount(); i++) {
- if(!mf[i].GetLabel().CompareNoCase(ResStr(IDS_AG_PLAYLIST_FILE))) {
+ for (int i = 0; i < (int)mf.GetCount(); i++) {
+ if (!mf[i].GetLabel().CompareNoCase(ResStr(IDS_AG_PLAYLIST_FILE))) {
continue;
}
@@ -1003,8 +1004,8 @@ BOOL CMPlayerCApp::InitInstance() int j = 0;
CString str = mf[i].GetExtsWithPeriod();
- for(CString ext = str.Tokenize(_T(" "), j); !ext.IsEmpty(); ext = str.Tokenize(_T(" "), j)) {
- if(((m_s.nCLSwitches&CLSW_REGEXTVID) && !fAudioOnly) || ((m_s.nCLSwitches&CLSW_REGEXTAUD) && fAudioOnly)) {
+ for (CString ext = str.Tokenize(_T(" "), j); !ext.IsEmpty(); ext = str.Tokenize(_T(" "), j)) {
+ if (((m_s.nCLSwitches&CLSW_REGEXTVID) && !fAudioOnly) || ((m_s.nCLSwitches&CLSW_REGEXTAUD) && fAudioOnly)) {
CPPageFormats::RegisterExt(ext, mf[i].GetLabel(), true);
}
}
@@ -1014,13 +1015,13 @@ BOOL CMPlayerCApp::InitInstance() return FALSE;
}
- if((m_s.nCLSwitches&CLSW_UNREGEXT)) {
+ if ((m_s.nCLSwitches&CLSW_UNREGEXT)) {
CMediaFormats& mf = m_s.m_Formats;
- for(int i = 0; i < (int)mf.GetCount(); i++) {
+ for (int i = 0; i < (int)mf.GetCount(); i++) {
int j = 0;
CString str = mf[i].GetExtsWithPeriod();
- for(CString ext = str.Tokenize(_T(" "), j); !ext.IsEmpty(); ext = str.Tokenize(_T(" "), j)) {
+ for (CString ext = str.Tokenize(_T(" "), j); !ext.IsEmpty(); ext = str.Tokenize(_T(" "), j)) {
CPPageFormats::RegisterExt(ext, mf[i].GetLabel(), false);
}
}
@@ -1047,19 +1048,19 @@ BOOL CMPlayerCApp::InitInstance() m_mutexOneInstance.Create(NULL, TRUE, MPC_WND_CLASS_NAME);
- if(GetLastError() == ERROR_ALREADY_EXISTS
+ if (GetLastError() == ERROR_ALREADY_EXISTS
&& (!(m_s.fAllowMultipleInst || (m_s.nCLSwitches&CLSW_NEW) || m_cmdln.IsEmpty())
|| (m_s.nCLSwitches&CLSW_ADD))) {
int wait_count = 0;
HWND hWnd = ::FindWindow(MPC_WND_CLASS_NAME, NULL);
- while(!hWnd && (wait_count++<200)) {
+ while (!hWnd && (wait_count++<200)) {
Sleep(100);
hWnd = ::FindWindow(MPC_WND_CLASS_NAME, NULL);
}
- if(hWnd && (wait_count<200)) {
+ if (hWnd && (wait_count<200)) {
SetForegroundWindow(hWnd);
- if(!(m_s.nCLSwitches&CLSW_MINIMIZED) && IsIconic(hWnd)) {
+ if (!(m_s.nCLSwitches&CLSW_MINIMIZED) && IsIconic(hWnd)) {
ShowWindow(hWnd, SW_RESTORE);
}
@@ -1071,13 +1072,13 @@ BOOL CMPlayerCApp::InitInstance() AfxGetMyApp()->m_AudioRendererDisplayName_CL = _T("");
- if(!__super::InitInstance()) {
+ if (!__super::InitInstance()) {
AfxMessageBox(_T("InitInstance failed!"));
return FALSE;
}
CRegKey key;
- if(ERROR_SUCCESS == key.Create(HKEY_LOCAL_MACHINE, _T("Software\\Gabest\\Media Player Classic"))) {
+ if (ERROR_SUCCESS == key.Create(HKEY_LOCAL_MACHINE, _T("Software\\Gabest\\Media Player Classic"))) {
CString path;
GetModuleFileName(AfxGetInstanceHandle(), path.GetBuffer(_MAX_PATH), _MAX_PATH);
path.ReleaseBuffer();
@@ -1100,11 +1101,11 @@ BOOL CMPlayerCApp::InitInstance() pFrame->UpdateWindow();
pFrame->m_hAccelTable = m_s.hAccel;
m_s.WinLircClient.SetHWND(m_pMainWnd->m_hWnd);
- if(m_s.fWinLirc) {
+ if (m_s.fWinLirc) {
m_s.WinLircClient.Connect(m_s.strWinLircAddr);
}
m_s.UIceClient.SetHWND(m_pMainWnd->m_hWnd);
- if(m_s.fUIce) {
+ if (m_s.fUIce) {
m_s.UIceClient.Connect(m_s.strUIceAddr);
}
@@ -1128,7 +1129,7 @@ UINT CMPlayerCApp::GetRemoteControlCodeMicrosoft(UINT nInputcode, HRAWINPUT hRaw pRawBuffer = DNew BYTE[dwSize];
if (GetRawInputData(hRawInput, RID_INPUT, pRawBuffer, &dwSize, sizeof(RAWINPUTHEADER)) != -1) {
RAWINPUT* raw = (RAWINPUT*) pRawBuffer;
- if(raw->header.dwType == RIM_TYPEHID) {
+ if (raw->header.dwType == RIM_TYPEHID) {
nMceCmd = 0x10000 + (raw->data.hid.bRawData[1] | raw->data.hid.bRawData[2] << 8);
}
}
@@ -1151,7 +1152,7 @@ UINT CMPlayerCApp::GetRemoteControlCodeSRM7500(UINT nInputcode, HRAWINPUT hRawIn RAWINPUT* raw = (RAWINPUT*) pRawBuffer;
// data.hid.bRawData[21] set to one when key is pressed
- if(raw->header.dwType == RIM_TYPEHID && raw->data.hid.bRawData[21] == 1) {
+ if (raw->header.dwType == RIM_TYPEHID && raw->data.hid.bRawData[21] == 1) {
// data.hid.bRawData[21] has keycode
switch (raw->data.hid.bRawData[20]) {
case 0x0033 :
@@ -1230,7 +1231,7 @@ void CMPlayerCApp::RegisterHotkeys() if (m_s.fGlobalMedia) {
POSITION pos = m_s.wmcmds.GetHeadPosition();
- while(pos) {
+ while (pos) {
wmcmd& wc = m_s.wmcmds.GetNext(pos);
if (wc.appcmd != 0) {
RegisterHotKey(m_pMainWnd->m_hWnd, wc.appcmd, 0, GetVKFromAppCommand (wc.appcmd));
@@ -1244,7 +1245,7 @@ void CMPlayerCApp::UnregisterHotkeys() if (m_s.fGlobalMedia) {
POSITION pos = m_s.wmcmds.GetHeadPosition();
- while(pos) {
+ while (pos) {
wmcmd& wc = m_s.wmcmds.GetNext(pos);
if (wc.appcmd != 0) {
UnregisterHotKey(m_pMainWnd->m_hWnd, wc.appcmd);
@@ -1340,12 +1341,12 @@ void CRemoteCtrlClient::Connect(CString addr) {
CAutoLock cAutoLock(&m_csLock);
- if(m_nStatus == CONNECTING && m_addr == addr) {
+ if (m_nStatus == CONNECTING && m_addr == addr) {
TRACE(_T("CRemoteCtrlClient (Connect): already connecting to %s\n"), addr);
return;
}
- if(m_nStatus == CONNECTED && m_addr == addr) {
+ if (m_nStatus == CONNECTED && m_addr == addr) {
TRACE(_T("CRemoteCtrlClient (Connect): already connected to %s\n"), addr);
return;
}
@@ -1379,7 +1380,7 @@ void CRemoteCtrlClient::OnClose(int nErrorCode) {
CAutoLock cAutoLock(&m_csLock);
- if(m_hSocket != INVALID_SOCKET && m_nStatus == CONNECTED) {
+ if (m_hSocket != INVALID_SOCKET && m_nStatus == CONNECTED) {
TRACE(_T("CRemoteCtrlClient (OnClose): connection lost\n"));
}
@@ -1390,13 +1391,13 @@ void CRemoteCtrlClient::OnClose(int nErrorCode) void CRemoteCtrlClient::OnReceive(int nErrorCode)
{
- if(nErrorCode != 0 || !m_pWnd) {
+ if (nErrorCode != 0 || !m_pWnd) {
return;
}
CStringA str;
int ret = Receive(str.GetBuffer(256), 255, 0);
- if(ret <= 0) {
+ if (ret <= 0) {
return;
}
str.ReleaseBuffer(ret);
@@ -1411,7 +1412,7 @@ void CRemoteCtrlClient::OnReceive(int nErrorCode) void CRemoteCtrlClient::ExecuteCommand(CStringA cmd, int repcnt)
{
cmd.Trim();
- if(cmd.IsEmpty()) {
+ if (cmd.IsEmpty()) {
return;
}
cmd.Replace(' ', '_');
@@ -1419,11 +1420,11 @@ void CRemoteCtrlClient::ExecuteCommand(CStringA cmd, int repcnt) CAppSettings& s = AfxGetAppSettings();
POSITION pos = s.wmcmds.GetHeadPosition();
- while(pos) {
+ while (pos) {
wmcmd wc = s.wmcmds.GetNext(pos);
CStringA name = TToA(wc.GetName());
name.Replace(' ', '_');
- if((repcnt == 0 && wc.rmrepcnt == 0 || wc.rmrepcnt > 0 && (repcnt%wc.rmrepcnt) == 0)
+ if ((repcnt == 0 && wc.rmrepcnt == 0 || wc.rmrepcnt > 0 && (repcnt%wc.rmrepcnt) == 0)
&& (!name.CompareNoCase(cmd) || !wc.rmcmd.CompareNoCase(cmd) || wc.cmd == (WORD)strtol(cmd, NULL, 10))) {
CAutoLock cAutoLock(&m_csLock);
TRACE(_T("CRemoteCtrlClient (calling command): %s\n"), wc.GetName());
@@ -1444,12 +1445,12 @@ void CWinLircClient::OnCommand(CStringA str) TRACE(_T("CWinLircClient (OnCommand): %s\n"), CString(str));
int i = 0, j = 0, repcnt = 0;
- for(CStringA token = str.Tokenize(" ", i);
+ for (CStringA token = str.Tokenize(" ", i);
!token.IsEmpty();
token = str.Tokenize(" ", i), j++) {
- if(j == 1) {
+ if (j == 1) {
repcnt = strtol(token, NULL, 16);
- } else if(j == 2) {
+ } else if (j == 2) {
ExecuteCommand(token, repcnt);
}
}
@@ -1467,12 +1468,12 @@ void CUIceClient::OnCommand(CStringA str) CStringA cmd;
int i = 0, j = 0;
- for(CStringA token = str.Tokenize("|", i);
+ for (CStringA token = str.Tokenize("|", i);
!token.IsEmpty();
token = str.Tokenize("|", i), j++) {
- if(j == 0) {
+ if (j == 0) {
cmd = token;
- } else if(j == 1) {
+ } else if (j == 1) {
ExecuteCommand(cmd, strtol(token, NULL, 16));
}
}
@@ -1495,7 +1496,7 @@ void GetCurDispMode(dispmode& dm, CString& DisplayName) monitor.GetName(DisplayName1);
}
hDC = CreateDC(DisplayName1, NULL, NULL, NULL);
- if(hDC) {
+ if (hDC) {
dm.fValid = true;
dm.size = CSize(GetDeviceCaps(hDC, HORZRES), GetDeviceCaps(hDC, VERTRES));
dm.bpp = GetDeviceCaps(hDC, BITSPIXEL);
@@ -1515,7 +1516,7 @@ bool GetDispMode(int i, dispmode& dm, CString& DisplayName) monitor = monitors.GetNearestMonitor(AfxGetApp()->m_pMainWnd);
monitor.GetName(DisplayName1);
}
- if(!EnumDisplaySettings(DisplayName1, i, &devmode)) {
+ if (!EnumDisplaySettings(DisplayName1, i, &devmode)) {
return(false);
}
dm.fValid = true;
@@ -1534,7 +1535,7 @@ void SetDispMode(dispmode& dm, CString& DisplayName) return;
}
- if(!dm.fValid) {
+ if (!dm.fValid) {
return;
}
DEVMODE dmScreenSettings;
@@ -1553,7 +1554,7 @@ void SetDispMode(dispmode& dm, CString& DisplayName) monitor = monitors.GetNearestMonitor(AfxGetApp()->m_pMainWnd);
monitor.GetName(DisplayName1);
}
- if(AfxGetAppSettings().fRestoreResAfterExit) {
+ if (AfxGetAppSettings().fRestoreResAfterExit) {
ChangeDisplaySettingsEx(DisplayName1, &dmScreenSettings, NULL, CDS_FULLSCREEN, NULL);
} else {
ChangeDisplaySettingsEx(DisplayName1, &dmScreenSettings, NULL, NULL, NULL);
@@ -1569,7 +1570,7 @@ void SetAudioRenderer(int AudioDevNo) BeginEnumSysDev(CLSID_AudioRendererCategory, pMoniker) {
LPOLESTR olestr = NULL;
- if(FAILED(pMoniker->GetDisplayName(0, 0, &olestr))) {
+ if (FAILED(pMoniker->GetDisplayName(0, 0, &olestr))) {
continue;
}
CStringW str(olestr);
@@ -1604,13 +1605,13 @@ typedef CAtlREMatchContext<CAtlRECharTraits> CAtlREMatchContextT; bool FindRedir(CUrl& src, CString ct, CString& body, CAtlList<CString>& urls, CAutoPtrList<CAtlRegExpT>& res)
{
POSITION pos = res.GetHeadPosition();
- while(pos) {
+ while (pos) {
CAtlRegExpT* re = res.GetNext(pos);
CAtlREMatchContextT mc;
const CAtlREMatchContextT::RECHAR* s = (LPCTSTR)body;
const CAtlREMatchContextT::RECHAR* e = NULL;
- for(; s && re->Match(s, &mc, &e); s = e) {
+ for (; s && re->Match(s, &mc, &e); s = e) {
const CAtlREMatchContextT::RECHAR* szStart = 0;
const CAtlREMatchContextT::RECHAR* szEnd = 0;
mc.GetMatch(0, &szStart, &szEnd);
@@ -1619,13 +1620,13 @@ bool FindRedir(CUrl& src, CString ct, CString& body, CAtlList<CString>& urls, CA url.Format(_T("%.*s"), szEnd - szStart, szStart);
url.Trim();
- if(url.CompareNoCase(_T("asf path")) == 0) {
+ if (url.CompareNoCase(_T("asf path")) == 0) {
continue;
}
CUrl dst;
dst.CrackUrl(CString(url));
- if(_tcsicmp(src.GetSchemeName(), dst.GetSchemeName())
+ if (_tcsicmp(src.GetSchemeName(), dst.GetSchemeName())
|| _tcsicmp(src.GetHostName(), dst.GetHostName())
|| _tcsicmp(src.GetUrlPath(), dst.GetUrlPath())) {
urls.AddTail(url);
@@ -1645,20 +1646,20 @@ bool FindRedir(CString& fn, CString ct, CAtlList<CString>& fns, CAutoPtrList<CAt CString body;
CTextFile f(CTextFile::ANSI);
- if(f.Open(fn)) for(CString tmp; f.ReadString(tmp); body += tmp + '\n') {
+ if (f.Open(fn)) for (CString tmp; f.ReadString(tmp); body += tmp + '\n') {
;
}
CString dir = fn.Left(max(fn.ReverseFind('/'), fn.ReverseFind('\\'))+1); // "ReverseFindOneOf"
POSITION pos = res.GetHeadPosition();
- while(pos) {
+ while (pos) {
CAtlRegExpT* re = res.GetNext(pos);
CAtlREMatchContextT mc;
const CAtlREMatchContextT::RECHAR* s = (LPCTSTR)body;
const CAtlREMatchContextT::RECHAR* e = NULL;
- for(; s && re->Match(s, &mc, &e); s = e) {
+ for (; s && re->Match(s, &mc, &e); s = e) {
const CAtlREMatchContextT::RECHAR* szStart = 0;
const CAtlREMatchContextT::RECHAR* szEnd = 0;
mc.GetMatch(0, &szStart, &szEnd);
@@ -1667,20 +1668,20 @@ bool FindRedir(CString& fn, CString ct, CAtlList<CString>& fns, CAutoPtrList<CAt fn2.Format(_T("%.*s"), szEnd - szStart, szStart);
fn2.Trim();
- if(!fn2.CompareNoCase(_T("asf path"))) {
+ if (!fn2.CompareNoCase(_T("asf path"))) {
continue;
}
- if(fn2.Find(_T("EXTM3U")) == 0 || fn2.Find(_T("#EXTINF")) == 0) {
+ if (fn2.Find(_T("EXTM3U")) == 0 || fn2.Find(_T("#EXTINF")) == 0) {
continue;
}
- if(fn2.Find(_T(":")) < 0 && fn2.Find(_T("\\\\")) != 0 && fn2.Find(_T("//")) != 0) {
+ if (fn2.Find(_T(":")) < 0 && fn2.Find(_T("\\\\")) != 0 && fn2.Find(_T("//")) != 0) {
CPath p;
p.Combine(dir, fn2);
fn2 = (LPCTSTR)p;
}
- if(!fn2.CompareNoCase(fn)) {
+ if (!fn2.CompareNoCase(fn)) {
continue;
}
@@ -1696,18 +1697,18 @@ CStringA GetContentType(CString fn, CAtlList<CString>* redir) CUrl url;
CString ct, body;
- if(fn.Find(_T("://")) >= 0) {
+ if (fn.Find(_T("://")) >= 0) {
url.CrackUrl(fn);
- if(_tcsicmp(url.GetSchemeName(), _T("pnm")) == 0) {
+ if (_tcsicmp(url.GetSchemeName(), _T("pnm")) == 0) {
return "audio/x-pn-realaudio";
}
- if(_tcsicmp(url.GetSchemeName(), _T("mms")) == 0) {
+ if (_tcsicmp(url.GetSchemeName(), _T("mms")) == 0) {
return "video/x-ms-asf";
}
- if(_tcsicmp(url.GetSchemeName(), _T("http")) != 0) {
+ if (_tcsicmp(url.GetSchemeName(), _T("http")) != 0) {
return "";
}
@@ -1717,18 +1718,18 @@ CStringA GetContentType(CString fn, CAtlList<CString>* redir) ULONG len = 256+1;
CRegKey key;
- if(ERROR_SUCCESS == key.Open(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"), KEY_READ)
+ if (ERROR_SUCCESS == key.Open(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"), KEY_READ)
&& ERROR_SUCCESS == key.QueryDWORDValue(_T("ProxyEnable"), ProxyEnable) && ProxyEnable
&& ERROR_SUCCESS == key.QueryStringValue(_T("ProxyServer"), ProxyServer.GetBufferSetLength(256), &len)) {
ProxyServer.ReleaseBufferSetLength(len);
CAtlList<CString> sl;
ProxyServer = Explode(ProxyServer, sl, ';');
- if(sl.GetCount() > 1) {
+ if (sl.GetCount() > 1) {
POSITION pos = sl.GetHeadPosition();
- while(pos) {
+ while (pos) {
CAtlList<CString> sl2;
- if(!Explode(sl.GetNext(pos), sl2, '=', 2).CompareNoCase(_T("http"))
+ if (!Explode(sl.GetNext(pos), sl2, '=', 2).CompareNoCase(_T("http"))
&& sl2.GetCount() == 2) {
ProxyServer = sl2.GetTail();
break;
@@ -1737,20 +1738,20 @@ CStringA GetContentType(CString fn, CAtlList<CString>* redir) }
ProxyServer = Explode(ProxyServer, sl, ':');
- if(sl.GetCount() > 1) {
+ if (sl.GetCount() > 1) {
ProxyPort = _tcstol(sl.GetTail(), NULL, 10);
}
}
CSocket s;
s.Create();
- if(s.Connect(
+ if (s.Connect(
ProxyEnable ? ProxyServer : url.GetHostName(),
ProxyEnable ? ProxyPort : url.GetPortNumber())) {
CStringA host = CStringA(url.GetHostName());
CStringA path = CStringA(url.GetUrlPath()) + CStringA(url.GetExtraInfo());
- if(ProxyEnable) {
+ if (ProxyEnable) {
path = "http://" + host + path;
}
@@ -1764,20 +1765,20 @@ CStringA GetContentType(CString fn, CAtlList<CString>* redir) // MessageBox(NULL, CString(hdr), _T("Sending..."), MB_OK);
- if(s.Send((LPCSTR)hdr, hdr.GetLength()) < hdr.GetLength()) {
+ if (s.Send((LPCSTR)hdr, hdr.GetLength()) < hdr.GetLength()) {
return "";
}
hdr.Empty();
- while(1) {
+ while (1) {
CStringA str;
str.ReleaseBuffer(s.Receive(str.GetBuffer(256), 256)); // SOCKET_ERROR == -1, also suitable for ReleaseBuffer
- if(str.IsEmpty()) {
+ if (str.IsEmpty()) {
break;
}
hdr += str;
int hdrend = hdr.Find("\r\n\r\n");
- if(hdrend >= 0) {
+ if (hdrend >= 0) {
body = hdr.Mid(hdrend+4);
hdr = hdr.Left(hdrend);
break;
@@ -1789,73 +1790,73 @@ CStringA GetContentType(CString fn, CAtlList<CString>* redir) CAtlList<CStringA> sl;
Explode(hdr, sl, '\n');
POSITION pos = sl.GetHeadPosition();
- while(pos) {
+ while (pos) {
CStringA& hdrline = sl.GetNext(pos);
CAtlList<CStringA> sl2;
Explode(hdrline, sl2, ':', 2);
CStringA field = sl2.RemoveHead().MakeLower();
- if(field == "location" && !sl2.IsEmpty()) {
+ if (field == "location" && !sl2.IsEmpty()) {
return GetContentType(CString(sl2.GetHead()), redir);
}
- if(field == "content-type" && !sl2.IsEmpty()) {
+ if (field == "content-type" && !sl2.IsEmpty()) {
ct = sl2.GetHead();
}
}
- while(body.GetLength() < 256) {
+ while (body.GetLength() < 256) {
CStringA str;
str.ReleaseBuffer(s.Receive(str.GetBuffer(256), 256)); // SOCKET_ERROR == -1, also suitable for ReleaseBuffer
- if(str.IsEmpty()) {
+ if (str.IsEmpty()) {
break;
}
body += str;
}
- if(body.GetLength() >= 8) {
+ if (body.GetLength() >= 8) {
CStringA str = TToA(body);
- if(!strncmp((LPCSTR)str, ".ra", 3)) {
+ if (!strncmp((LPCSTR)str, ".ra", 3)) {
return "audio/x-pn-realaudio";
}
- if(!strncmp((LPCSTR)str, ".RMF", 4)) {
+ if (!strncmp((LPCSTR)str, ".RMF", 4)) {
return "audio/x-pn-realaudio";
}
- if(*(DWORD*)(LPCSTR)str == 0x75b22630) {
+ if (*(DWORD*)(LPCSTR)str == 0x75b22630) {
return "video/x-ms-wmv";
}
- if(!strncmp((LPCSTR)str+4, "moov", 4)) {
+ if (!strncmp((LPCSTR)str+4, "moov", 4)) {
return "video/quicktime";
}
}
- if(redir && (ct == _T("audio/x-scpls") || ct == _T("audio/x-mpegurl"))) {
- while(body.GetLength() < 4*1024) { // should be enough for a playlist...
+ if (redir && (ct == _T("audio/x-scpls") || ct == _T("audio/x-mpegurl"))) {
+ while (body.GetLength() < 4*1024) { // should be enough for a playlist...
CStringA str;
str.ReleaseBuffer(s.Receive(str.GetBuffer(256), 256)); // SOCKET_ERROR == -1, also suitable for ReleaseBuffer
- if(str.IsEmpty()) {
+ if (str.IsEmpty()) {
break;
}
body += str;
}
}
}
- } else if(!fn.IsEmpty()) {
+ } else if (!fn.IsEmpty()) {
CPath p(fn);
CString ext = p.GetExtension().MakeLower();
- if(ext == _T(".asx")) {
+ if (ext == _T(".asx")) {
ct = _T("video/x-ms-asf");
- } else if(ext == _T(".pls")) {
+ } else if (ext == _T(".pls")) {
ct = _T("audio/x-scpls");
- } else if(ext == _T(".m3u")) {
+ } else if (ext == _T(".m3u")) {
ct = _T("audio/x-mpegurl");
- } else if(ext == _T(".qtl")) {
+ } else if (ext == _T(".qtl")) {
ct = _T("application/x-quicktimeplayer");
- } else if(ext == _T(".mpcpl")) {
+ } else if (ext == _T(".mpcpl")) {
ct = _T("application/x-mpc-playlist");
- } else if(ext == _T(".bdmv")) {
+ } else if (ext == _T(".bdmv")) {
ct = _T("application/x-bdmv-playlist");
}
- if(FILE* f = _tfopen(fn, _T("rb"))) {
+ if (FILE* f = _tfopen(fn, _T("rb"))) {
CStringA str;
str.ReleaseBufferSetLength(fread(str.GetBuffer(10240), 1, 10240, f));
body = AToT(str);
@@ -1863,55 +1864,55 @@ CStringA GetContentType(CString fn, CAtlList<CString>* redir) }
}
- if(body.GetLength() >= 4) { // here only those which cannot be opened through dshow
+ if (body.GetLength() >= 4) { // here only those which cannot be opened through dshow
CStringA str = TToA(body);
- if(!strncmp((LPCSTR)str, ".ra", 3)) {
+ if (!strncmp((LPCSTR)str, ".ra", 3)) {
return "audio/x-pn-realaudio";
}
- if(!strncmp((LPCSTR)str, "FWS", 3)) {
+ if (!strncmp((LPCSTR)str, "FWS", 3)) {
return "application/x-shockwave-flash";
}
}
- if(redir && !ct.IsEmpty()) {
+ if (redir && !ct.IsEmpty()) {
CAutoPtrList<CAtlRegExpT> res;
CAutoPtr<CAtlRegExpT> re;
- if(ct == _T("video/x-ms-asf")) {
+ if (ct == _T("video/x-ms-asf")) {
// ...://..."/>
re.Attach(DNew CAtlRegExpT());
- if(re && REPARSE_ERROR_OK == re->Parse(_T("{[a-zA-Z]+://[^\n\">]*}"), FALSE)) {
+ if (re && REPARSE_ERROR_OK == re->Parse(_T("{[a-zA-Z]+://[^\n\">]*}"), FALSE)) {
res.AddTail(re);
}
// Ref#n= ...://...\n
re.Attach(DNew CAtlRegExpT());
- if(re && REPARSE_ERROR_OK == re->Parse(_T("Ref\\z\\b*=\\b*[\"]*{([a-zA-Z]+://[^\n\"]+}"), FALSE)) {
+ if (re && REPARSE_ERROR_OK == re->Parse(_T("Ref\\z\\b*=\\b*[\"]*{([a-zA-Z]+://[^\n\"]+}"), FALSE)) {
res.AddTail(re);
}
- } else if(ct == _T("audio/x-scpls")) {
+ } else if (ct == _T("audio/x-scpls")) {
// File1=...\n
re.Attach(DNew CAtlRegExp<>());
- if(re && REPARSE_ERROR_OK == re->Parse(_T("file\\z\\b*=\\b*[\"]*{[^\n\"]+}"), FALSE)) {
+ if (re && REPARSE_ERROR_OK == re->Parse(_T("file\\z\\b*=\\b*[\"]*{[^\n\"]+}"), FALSE)) {
res.AddTail(re);
}
- } else if(ct == _T("audio/x-mpegurl")) {
+ } else if (ct == _T("audio/x-mpegurl")) {
// #comment
// ...
re.Attach(DNew CAtlRegExp<>());
- if(re && REPARSE_ERROR_OK == re->Parse(_T("{[^#][^\n]+}"), FALSE)) {
+ if (re && REPARSE_ERROR_OK == re->Parse(_T("{[^#][^\n]+}"), FALSE)) {
res.AddTail(re);
}
- } else if(ct == _T("audio/x-pn-realaudio")) {
+ } else if (ct == _T("audio/x-pn-realaudio")) {
// rtsp://...
re.Attach(DNew CAtlRegExp<>());
- if(re && REPARSE_ERROR_OK == re->Parse(_T("{rtsp://[^\n]+}"), FALSE)) {
+ if (re && REPARSE_ERROR_OK == re->Parse(_T("{rtsp://[^\n]+}"), FALSE)) {
res.AddTail(re);
}
}
- if(!body.IsEmpty()) {
- if(fn.Find(_T("://")) >= 0) {
+ if (!body.IsEmpty()) {
+ if (fn.Find(_T("://")) >= 0) {
FindRedir(url, ct, body, *redir, res);
} else {
FindRedir(fn, ct, *redir, res);
@@ -2084,7 +2085,7 @@ bool CMPlayerCApp::IsVSFilterInstalled() {
bool result = false;
CRegKey key;
- if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("CLSID\\{083863F1-70DE-11d0-BD40-00A0C911CE86}\\Instance\\{9852A670-F845-491B-9BE6-EBD841B8A613}"), KEY_READ)) {
+ if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("CLSID\\{083863F1-70DE-11d0-BD40-00A0C911CE86}\\Instance\\{9852A670-F845-491B-9BE6-EBD841B8A613}"), KEY_READ)) {
result = true;
}
@@ -2095,7 +2096,7 @@ bool CMPlayerCApp::HasEVR() {
bool result = false;
CRegKey key;
- if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("CLSID\\{083863F1-70DE-11d0-BD40-00A0C911CE86}\\Instance\\{FA10746C-9B63-4B6C-BC49-FC300EA5F256}"), KEY_READ)) {
+ if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("CLSID\\{083863F1-70DE-11d0-BD40-00A0C911CE86}\\Instance\\{FA10746C-9B63-4B6C-BC49-FC300EA5F256}"), KEY_READ)) {
result = true;
}
|