diff options
author | sansnom05 <sansnom05@users.sourceforge.net> | 2010-12-16 16:53:08 +0300 |
---|---|---|
committer | sansnom05 <sansnom05@users.sourceforge.net> | 2010-12-16 16:53:08 +0300 |
commit | f0d88a6ff96770b10031dcc59447cca2c7dbc91c (patch) | |
tree | e188e4e733fcf6fc9b00dc349618c19f4d47a7c9 /src/apps/mplayerc/PPageInternalFilters.cpp | |
parent | 5067b0b48d4d15b24669c8032b28e90e45202801 (diff) |
legacy branch: merge r2662-r2759
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/branches/legacy@2778 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/PPageInternalFilters.cpp')
-rw-r--r-- | src/apps/mplayerc/PPageInternalFilters.cpp | 176 |
1 files changed, 85 insertions, 91 deletions
diff --git a/src/apps/mplayerc/PPageInternalFilters.cpp b/src/apps/mplayerc/PPageInternalFilters.cpp index 291ac564e..08ef9b47c 100644 --- a/src/apps/mplayerc/PPageInternalFilters.cpp +++ b/src/apps/mplayerc/PPageInternalFilters.cpp @@ -40,160 +40,161 @@ static struct filter_t s_filters[] =
{
#if INTERNAL_SOURCEFILTER_AVI
- {_T("AVI"), 0, SRC_AVI, IDS_SRC_AVI, NULL},
+ {_T("AVI"), SOURCE_FILTER, SRC_AVI, IDS_SRC_AVI, NULL},
#endif
#if INTERNAL_SOURCEFILTER_CDDA
- {_T("CDDA (Audio CD)"), 0, SRC_CDDA, IDS_SRC_CDDA, NULL},
+ {_T("CDDA (Audio CD)"), SOURCE_FILTER, SRC_CDDA, IDS_SRC_CDDA, NULL},
#endif
#if INTERNAL_SOURCEFILTER_CDXA
- {_T("CDXA (VCD/SVCD/XCD)"), 0, SRC_CDXA, IDS_SRC_CDXA, NULL},
+ {_T("CDXA (VCD/SVCD/XCD)"), SOURCE_FILTER, SRC_CDXA, IDS_SRC_CDXA, NULL},
#endif
#if INTERNAL_SOURCEFILTER_DIRAC
- {_T("Dirac"), 0, SRC_DIRAC, IDS_SRC_DIRAC, NULL},
+ {_T("Dirac"), SOURCE_FILTER, SRC_DIRAC, IDS_SRC_DIRAC, NULL},
#endif
#if INTERNAL_SOURCEFILTER_DSM
- {_T("DirectShow Media"), 0, SRC_DSM, IDS_SRC_DSM, NULL},
+ {_T("DirectShow Media"), SOURCE_FILTER, SRC_DSM, IDS_SRC_DSM, NULL},
#endif
#if INTERNAL_SOURCEFILTER_DTSAC3
- {_T("DTS/AC3"), 0, SRC_DTSAC3, IDS_SRC_DTSAC3, NULL},
+ {_T("DTS/AC3"), SOURCE_FILTER, SRC_DTSAC3, IDS_SRC_DTSAC3, NULL},
#endif
#if INTERNAL_SOURCEFILTER_VTS
- {_T("DVD Video Title Set"), 0, SRC_VTS, IDS_SRC_VTS, NULL},
+ {_T("DVD Video Title Set"), SOURCE_FILTER, SRC_VTS, IDS_SRC_VTS, NULL},
#endif
#if INTERNAL_SOURCEFILTER_DVSOURCE
- {_T("DVD2AVI Project File"), 0, SRC_D2V, IDS_SRC_D2V, NULL},
+ {_T("DVD2AVI Project File"), SOURCE_FILTER, SRC_D2V, IDS_SRC_D2V, NULL},
#endif
#if INTERNAL_SOURCEFILTER_FLIC
- {_T("FLI/FLC"), 0, SRC_FLIC, IDS_SRC_FLIC, NULL},
+ {_T("FLI/FLC"), SOURCE_FILTER, SRC_FLIC, IDS_SRC_FLIC, NULL},
#endif
#if INTERNAL_SOURCEFILTER_FLAC
- {_T("Flac"), 0, SRC_FLAC, IDS_SRC_FLAC, NULL},
+ {_T("Flac"), SOURCE_FILTER, SRC_FLAC, IDS_SRC_FLAC, NULL},
#endif
#if INTERNAL_SOURCEFILTER_FLV
- {_T("FLV"), 0, SRC_FLV, IDS_SRC_FLV, NULL},
+ {_T("FLV"), SOURCE_FILTER, SRC_FLV, IDS_SRC_FLV, NULL},
#endif
#if INTERNAL_SOURCEFILTER_MATROSKA
- {_T("Matroska"), 0, SRC_MATROSKA, IDS_SRC_MATROSKA, NULL},
+ {_T("Matroska"), SOURCE_FILTER, SRC_MATROSKA, IDS_SRC_MATROSKA, NULL},
#endif
#if INTERNAL_SOURCEFILTER_MP4
- {_T("MP4/MOV"), 0, SRC_MP4, IDS_SRC_MP4, NULL},
+ {_T("MP4/MOV"), SOURCE_FILTER, SRC_MP4, IDS_SRC_MP4, NULL},
#endif
#if INTERNAL_SOURCEFILTER_MPEGAUDIO
- {_T("MPEG Audio"), 0, SRC_MPA, IDS_SRC_MPA, NULL},
+ {_T("MPEG Audio"), SOURCE_FILTER, SRC_MPA, IDS_SRC_MPA, NULL},
#endif
#if INTERNAL_SOURCEFILTER_MPEG
- {_T("MPEG PS/TS/PVA"), 0, SRC_MPEG, 0, NULL},
+ {_T("MPEG PS/TS/PVA"), SOURCE_FILTER, SRC_MPEG, 0, NULL},
#endif
#if INTERNAL_SOURCEFILTER_NUT
- {_T("Nut"), 0, SRC_NUT, IDS_SRC_NUT, NULL},
+ {_T("Nut"), SOURCE_FILTER, SRC_NUT, IDS_SRC_NUT, NULL},
#endif
#if INTERNAL_SOURCEFILTER_OGG
- {_T("Ogg"), 0, SRC_OGG, IDS_SRC_OGG, NULL},
+ {_T("Ogg"), SOURCE_FILTER, SRC_OGG, IDS_SRC_OGG, NULL},
#endif
#if INTERNAL_SOURCEFILTER_REALMEDIA
- {_T("RealMedia"), 0, SRC_REALMEDIA, IDS_SRC_REALMEDIA, NULL},
+ {_T("RealMedia"), SOURCE_FILTER, SRC_REALMEDIA, IDS_SRC_REALMEDIA, NULL},
#endif
#if INTERNAL_SOURCEFILTER_ROQ
- {_T("RoQ"), 0, SRC_ROQ, IDS_SRC_ROQ, NULL},
+ {_T("RoQ"), SOURCE_FILTER, SRC_ROQ, IDS_SRC_ROQ, NULL},
#endif
#if INTERNAL_SOURCEFILTER_SHOUTCAST
- {_T("SHOUTcast"), 0, SRC_SHOUTCAST, IDS_SRC_SHOUTCAST, NULL},
+ {_T("SHOUTcast"), SOURCE_FILTER, SRC_SHOUTCAST, IDS_SRC_SHOUTCAST, NULL},
#endif
+
#if INTERNAL_DECODER_AAC
- {_T("AAC"), 1, TRA_AAC, IDS_TRA_AAC, CreateInstance<CMpaDecFilter>},
+ {_T("AAC"), DECODER, TRA_AAC, IDS_TRA_AAC, CreateInstance<CMpaDecFilter>},
#endif
#if INTERNAL_DECODER_AC3
- {_T("AC3"), 1, TRA_AC3, IDS_TRA_AC3, CreateInstance<CMpaDecFilter>},
+ {_T("AC3"), DECODER, TRA_AC3, IDS_TRA_AC3, CreateInstance<CMpaDecFilter>},
#endif
#if INTERNAL_DECODER_DTS
- {_T("DTS"), 1, TRA_DTS, IDS_TRA_DTS, CreateInstance<CMpaDecFilter>},
- {_T("LPCM"), 1, TRA_LPCM, IDS_TRA_LPCM, CreateInstance<CMpaDecFilter>},
+ {_T("DTS"), DECODER, TRA_DTS, IDS_TRA_DTS, CreateInstance<CMpaDecFilter>},
+ {_T("LPCM"), DECODER, TRA_LPCM, IDS_TRA_LPCM, CreateInstance<CMpaDecFilter>},
#endif
#if INTERNAL_DECODER_MPEGAUDIO
- {_T("MPEG Audio"), 1, TRA_MPA, IDS_TRA_MPA, CreateInstance<CMpaDecFilter>},
+ {_T("MPEG Audio"), DECODER, TRA_MPA, IDS_TRA_MPA, CreateInstance<CMpaDecFilter>},
#endif
#if INTERNAL_DECODER_VORBIS
- {_T("Vorbis"), 1, TRA_VORBIS, 0, NULL /* TODO: CreateInstance<CMpaDecFilter>*/},
+ {_T("Vorbis"), DECODER, TRA_VORBIS, 0, NULL /* TODO: CreateInstance<CMpaDecFilter>*/},
#endif
#if INTERNAL_DECODER_FLAC
- {_T("FLAC"), 1, TRA_FLAC, 0, NULL /* TODO: CreateInstance<CMpaDecFilter>*/},
+ {_T("FLAC"), DECODER, TRA_FLAC, 0, NULL /* TODO: CreateInstance<CMpaDecFilter>*/},
#endif
#if INTERNAL_DECODER_NELLYMOSER
- {_T("Nellymoser"), 1, TRA_NELLY, 0, NULL /* TODO: CreateInstance<CMpaDecFilter>*/},
+ {_T("Nellymoser"), DECODER, TRA_NELLY, 0, NULL /* TODO: CreateInstance<CMpaDecFilter>*/},
#endif
#if INTERNAL_DECODER_AMR
- {_T("AMR"), 1, TRA_AMR, 0, NULL /* TODO: CreateInstance<CMpaDecFilter>*/},
+ {_T("AMR"), DECODER, TRA_AMR, 0, NULL /* TODO: CreateInstance<CMpaDecFilter>*/},
#endif
#if INTERNAL_DECODER_REALAUDIO
- {_T("RealAudio"), 1, TRA_RA, IDS_TRA_RA, NULL},
+ {_T("RealAudio"), DECODER, TRA_RA, IDS_TRA_RA, NULL},
#endif
#if INTERNAL_DECODER_PS2AUDIO
- {_T("PS2 Audio (PCM/ADPCM)"), 1, TRA_PS2AUD, IDS_TRA_PS2AUD, CreateInstance<CMpaDecFilter>},
+ {_T("PS2 Audio (PCM/ADPCM)"), DECODER, TRA_PS2AUD, IDS_TRA_PS2AUD, CreateInstance<CMpaDecFilter>},
#endif
#if INTERNAL_DECODER_PCM
- {_T("QT PCM"), 1, TRA_PCM, 0, NULL /* TODO: CreateInstance<CMpaDecFilter>*/},
+ {_T("QT PCM"), DECODER, TRA_PCM, 0, NULL /* TODO: CreateInstance<CMpaDecFilter>*/},
#endif
#if INTERNAL_DECODER_MPEG1
- {_T("MPEG-1 Video"), 1, TRA_MPEG1, IDS_TRA_MPEG1, CreateInstance<CMpeg2DecFilter>},
+ {_T("MPEG-1 Video"), DECODER, TRA_MPEG1, IDS_TRA_MPEG1, CreateInstance<CMpeg2DecFilter>},
#endif
#if INTERNAL_DECODER_MPEG2
- {_T("MPEG-2 Video"), 1, TRA_MPEG2, IDS_TRA_MPEG2, CreateInstance<CMpeg2DecFilter>},
+ {_T("MPEG-2 Video"), DECODER, TRA_MPEG2, IDS_TRA_MPEG2, CreateInstance<CMpeg2DecFilter>},
#endif
#if INTERNAL_DECODER_MPEG2_DXVA
- {_T("MPEG-2 Video (DXVA)"), 2, DXVA_MPEG2, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
+ {_T("MPEG-2 Video (DXVA)"), DXVA_DECODER, TRA_DXVA_MPEG2, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
#if INTERNAL_DECODER_DIRAC
- {_T("Dirac"), 1, TRA_DIRAC, IDS_TRA_DIRAC, NULL},
+ {_T("Dirac"), DECODER, TRA_DIRAC, IDS_TRA_DIRAC, NULL},
#endif
#if INTERNAL_DECODER_REALVIDEO
- {_T("RealVideo"), 1, TRA_RV, IDS_TRA_RV, NULL},
+ {_T("RealVideo"), DECODER, TRA_RV, IDS_TRA_RV, NULL},
#endif
#if INTERNAL_DECODER_H264_DXVA
- {_T("H264/AVC (DXVA)"), 2, DXVA_H264, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
+ {_T("H264/AVC (DXVA)"), DXVA_DECODER, TRA_DXVA_H264, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
#if INTERNAL_DECODER_H264
- {_T("H264/AVC (FFmpeg)"), 3, FFM_H264, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
+ {_T("H264/AVC (FFmpeg)"), FFMPEG_DECODER, FFM_H264, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
#if INTERNAL_DECODER_VC1_DXVA
- {_T("VC1 (DXVA)"), 2, DXVA_VC1, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
+ {_T("VC1 (DXVA)"), DXVA_DECODER, TRA_DXVA_VC1, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
#if INTERNAL_DECODER_VC1
- {_T("VC1 (FFmpeg)"), 3, FFM_VC1, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
+ {_T("VC1 (FFmpeg)"), FFMPEG_DECODER, FFM_VC1, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
#if INTERNAL_DECODER_XVID
- {_T("Xvid/MPEG-4"), 3, FFM_XVID, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
+ {_T("Xvid/MPEG-4"), FFMPEG_DECODER, FFM_XVID, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
#if INTERNAL_DECODER_DIVX
- {_T("DivX"), 3, FFM_DIVX, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
+ {_T("DivX"), FFMPEG_DECODER, FFM_DIVX, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
#if INTERNAL_DECODER_MSMPEG4
- {_T("MS MPEG-4"), 3, FFM_MSMPEG4, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
+ {_T("MS MPEG-4"), FFMPEG_DECODER, FFM_MSMPEG4, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
#if INTERNAL_DECODER_FLV
- {_T("FLV1/4"), 3, FFM_FLV4, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
+ {_T("FLV1/4"), FFMPEG_DECODER, FFM_FLV4, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
#if INTERNAL_DECODER_VP6
- {_T("VP5/6"), 3, FFM_VP62, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
+ {_T("VP5/6"), FFMPEG_DECODER, FFM_VP62, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
#if INTERNAL_DECODER_VP8
- {_T("VP8"), 3, FFM_VP8, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
+ {_T("VP8"), FFMPEG_DECODER, FFM_VP8, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
#if INTERNAL_DECODER_WMV
- {_T("WMV1/2/3"), 3, FFM_WMV, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
+ {_T("WMV1/2/3"), FFMPEG_DECODER, FFM_WMV, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
#if INTERNAL_DECODER_SVQ
- {_T("SVQ1/3"), 3, FFM_SVQ3, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
+ {_T("SVQ1/3"), FFMPEG_DECODER, FFM_SVQ3, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
#if INTERNAL_DECODER_H263
- {_T("H263"), 3, FFM_H263, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
+ {_T("H263"), FFMPEG_DECODER, FFM_H263, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
#if INTERNAL_DECODER_AMVV
- {_T("AMV video"), 3, FFM_AMVV, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
+ {_T("AMV video"), FFMPEG_DECODER, FFM_AMVV, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
#if INTERNAL_DECODER_THEORA
- {_T("Theora"), 3, FFM_THEORA, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
+ {_T("Theora"), FFMPEG_DECODER, FFM_THEORA, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
{NULL, 0, 0, 0, NULL}
};
@@ -414,35 +415,34 @@ BOOL CPPageInternalFilters::OnInitDialog() for(int i = 0; i < countof(s_filters)-1; i++)
{
CCheckListBox* l;
- UINT* pflags;
+ bool checked;
switch(s_filters[i].type)
{
- case 0: // source filter
+ case SOURCE_FILTER: // source filter
l = &m_listSrc;
- pflags = &s.SrcFilters;
+ checked = s.SrcFilters[s_filters[i].flag];
break;
- case 1: // decoder
+ case DECODER: // decoder
l = &m_listTra;
- pflags = &s.TraFilters;
+ checked = s.TraFilters[s_filters[i].flag];
break;
- case 2: // dxva decoder
+ case DXVA_DECODER: // dxva decoder
l = &m_listTra;
- pflags = &s.DXVAFilters;
+ checked = s.DXVAFilters[s_filters[i].flag];
break;
- case 3: // ffmpeg decoder
+ case FFMPEG_DECODER: // ffmpeg decoder
l = &m_listTra;
- pflags = &s.FFmpegFilters;
+ checked = s.FFmpegFilters[s_filters[i].flag];
break;
default:
l = NULL;
- pflags = NULL;
}
- if(l && pflags)
+ if (l)
{
int Index = l->AddString(s_filters[i].label);
- l->SetCheck(Index, !!(*pflags & s_filters[i].flag));
+ l->SetCheck(Index, checked);
l->SetItemDataPtr(Index, &s_filters[i]);
}
}
@@ -459,36 +459,30 @@ BOOL CPPageInternalFilters::OnApply() AppSettings& s = AfxGetAppSettings();
- s.SrcFilters = s.TraFilters = s.DXVAFilters = s.FFmpegFilters = 0;
-
- CList<filter_t*> fl;
- for(int i = 0; i < m_listSrc.GetCount(); i++)
- if(m_listSrc.GetCheck(i))
- fl.AddTail((filter_t*)m_listSrc.GetItemDataPtr(i));
- for(int i = 0; i < m_listTra.GetCount(); i++)
- if(m_listTra.GetCheck(i))
- fl.AddTail((filter_t*)m_listTra.GetItemDataPtr(i));
-
- POSITION pos = fl.GetHeadPosition();
- while(pos)
+ CPPageInternalFiltersListBox* list = &m_listSrc;
+ for (int l=0; l<2; l++)
{
- filter_t* f = fl.GetNext(pos);
-
- switch(f->type)
+ for(int i = 0; i < list->GetCount(); i++)
{
- case 0:
- s.SrcFilters |= f->flag;
- break;
- case 1:
- s.TraFilters |= f->flag;
- break;
- case 2:
- s.DXVAFilters |= f->flag;
- break;
- case 3:
- s.FFmpegFilters |= f->flag;
- break;
+ filter_t* f = (filter_t*) list->GetItemDataPtr(i);
+
+ switch(f->type)
+ {
+ case SOURCE_FILTER:
+ s.SrcFilters[f->flag] = list->GetCheck(i);
+ break;
+ case DECODER:
+ s.TraFilters[f->flag] = list->GetCheck(i);
+ break;
+ case DXVA_DECODER:
+ s.DXVAFilters[f->flag] = list->GetCheck(i);
+ break;
+ case FFMPEG_DECODER:
+ s.FFmpegFilters[f->flag] = list->GetCheck(i);
+ break;
+ }
}
+ list = &m_listTra;
}
return __super::OnApply();
|