Stopped change of AR from re-displaying audio.

Originally committed to SVN as r1067.
This commit is contained in:
Rodrigo Braz Monteiro 2007-04-13 01:46:50 +00:00
parent c014c93c4c
commit 0ef48599e6
2 changed files with 15 additions and 16 deletions

View file

@ -691,22 +691,21 @@ void FrameMain::SetDisplayMode(int _showVid,int _showAudio) {
if (!IsShownOnScreen() && !firstRun) return; if (!IsShownOnScreen() && !firstRun) return;
firstRun = false; firstRun = false;
// Automatic
if (_showVid == -1) _showVid = (VideoContext::Get()->IsLoaded() && !detachedVideo) ? 1 : 0;
else if (_showVid == -2) _showVid = showVideo?1:0;
if (_showAudio == -1) _showAudio = audioBox->loaded ? 1 : 0;
else if (_showAudio == -2) _showAudio = showAudio?1:0;
// See if anything changed
if (_showVid == (showVideo?1:0) && _showAudio == (showAudio?1:0)) return;
showAudio = _showAudio == 1;
showVideo = _showVid == 1;
// Stop // Stop
Freeze(); Freeze();
VideoContext::Get()->Stop(); VideoContext::Get()->Stop();
// Automatic
if (_showVid == -1) _showVid = (VideoContext::Get()->IsLoaded() && !detachedVideo) ? 1 : 0;
if (_showAudio == -1) _showAudio = audioBox->loaded ? 1 : 0;
// See if anything changed
if (_showVid == (showVideo?1:0) && _showAudio == (showAudio?1:0)) {
Thaw();
return;
}
showAudio = _showAudio == 1;
showVideo = _showVid == 1;
// Set display // Set display
TopSizer->Show(videoBox,showVideo,true); TopSizer->Show(videoBox,showVideo,true);
ToolSizer->Show(audioBox,showAudio,true); ToolSizer->Show(audioBox,showAudio,true);

View file

@ -1155,7 +1155,7 @@ void FrameMain::OnReplace(wxCommandEvent &event) {
void FrameMain::OnSetARDefault (wxCommandEvent &event) { void FrameMain::OnSetARDefault (wxCommandEvent &event) {
VideoContext::Get()->Stop(); VideoContext::Get()->Stop();
VideoContext::Get()->SetAspectRatio(0); VideoContext::Get()->SetAspectRatio(0);
SetDisplayMode(-1,-1); SetDisplayMode(-1,-2);
} }
@ -1164,7 +1164,7 @@ void FrameMain::OnSetARDefault (wxCommandEvent &event) {
void FrameMain::OnSetARFull (wxCommandEvent &event) { void FrameMain::OnSetARFull (wxCommandEvent &event) {
VideoContext::Get()->Stop(); VideoContext::Get()->Stop();
VideoContext::Get()->SetAspectRatio(1); VideoContext::Get()->SetAspectRatio(1);
SetDisplayMode(-1,-1); SetDisplayMode(-1,-2);
} }
@ -1173,7 +1173,7 @@ void FrameMain::OnSetARFull (wxCommandEvent &event) {
void FrameMain::OnSetARWide (wxCommandEvent &event) { void FrameMain::OnSetARWide (wxCommandEvent &event) {
VideoContext::Get()->Stop(); VideoContext::Get()->Stop();
VideoContext::Get()->SetAspectRatio(2); VideoContext::Get()->SetAspectRatio(2);
SetDisplayMode(-1,-1); SetDisplayMode(-1,-2);
} }
@ -1182,7 +1182,7 @@ void FrameMain::OnSetARWide (wxCommandEvent &event) {
void FrameMain::OnSetAR235 (wxCommandEvent &event) { void FrameMain::OnSetAR235 (wxCommandEvent &event) {
VideoContext::Get()->Stop(); VideoContext::Get()->Stop();
VideoContext::Get()->SetAspectRatio(3); VideoContext::Get()->SetAspectRatio(3);
SetDisplayMode(-1,-1); SetDisplayMode(-1,-2);
} }