mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-18 17:10:55 +02:00
Fix bug #883
This commit is contained in:
parent
c749ffc471
commit
cd11ddea43
1
src/AudacityApp.cpp
Normal file → Executable file
1
src/AudacityApp.cpp
Normal file → Executable file
@ -294,7 +294,6 @@ void QuitAudacity(bool bForce)
|
||||
gParentFrame->Destroy();
|
||||
gParentFrame = NULL;
|
||||
|
||||
CloseContrastDialog();
|
||||
#ifdef EXPERIMENTAL_SCOREALIGN
|
||||
CloseScoreAlignDialog();
|
||||
#endif
|
||||
|
@ -50,6 +50,7 @@ simplifies construction of menu items.
|
||||
#include <wx/utils.h>
|
||||
|
||||
#include "FreqWindow.h"
|
||||
#include "effects/Contrast.h"
|
||||
#include "TrackPanel.h"
|
||||
|
||||
#include "Project.h"
|
||||
@ -109,7 +110,6 @@ simplifies construction of menu items.
|
||||
#include "TimerRecordDialog.h"
|
||||
#include "SoundActivatedRecord.h"
|
||||
#include "LabelDialog.h"
|
||||
#include "effects/Contrast.h"
|
||||
|
||||
#include "FileDialog.h"
|
||||
#include "SplashDialog.h"
|
||||
@ -5136,7 +5136,34 @@ void AudacityProject::OnPlotSpectrum()
|
||||
|
||||
void AudacityProject::OnContrast()
|
||||
{
|
||||
InitContrastDialog(NULL);
|
||||
// All of this goes away when the Contrast Dialog is converted to a module
|
||||
if(!mContrastDialog)
|
||||
{
|
||||
wxPoint where;
|
||||
|
||||
where.x = 150;
|
||||
where.y = 150;
|
||||
|
||||
mContrastDialog = new ContrastDialog(this, -1, _("Contrast Analysis (WCAG 2 compliance)"), where);
|
||||
|
||||
mContrastDialog->bFGset = false;
|
||||
mContrastDialog->bBGset = false;
|
||||
}
|
||||
|
||||
// Zero dialog boxes. Do we need to do this here?
|
||||
if( !mContrastDialog->bFGset )
|
||||
{
|
||||
mContrastDialog->mForegroundStartT->SetValue(0.0);
|
||||
mContrastDialog->mForegroundEndT->SetValue(0.0);
|
||||
}
|
||||
if( !mContrastDialog->bBGset )
|
||||
{
|
||||
mContrastDialog->mBackgroundStartT->SetValue(0.0);
|
||||
mContrastDialog->mBackgroundEndT->SetValue(0.0);
|
||||
}
|
||||
|
||||
mContrastDialog->CentreOnParent();
|
||||
mContrastDialog->Show();
|
||||
}
|
||||
|
||||
|
||||
|
7
src/Project.cpp
Normal file → Executable file
7
src/Project.cpp
Normal file → Executable file
@ -93,6 +93,7 @@ scroll information. It also has some status flags.
|
||||
#include "Project.h"
|
||||
|
||||
#include "FreqWindow.h"
|
||||
#include "effects/contrast.h"
|
||||
#include "AutoRecovery.h"
|
||||
#include "AudacityApp.h"
|
||||
#include "AColor.h"
|
||||
@ -755,6 +756,7 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
|
||||
mMixerBoard(NULL),
|
||||
mMixerBoardFrame(NULL),
|
||||
mFreqWindow(NULL),
|
||||
mContrastDialog(NULL),
|
||||
mAliasMissingWarningDialog(NULL),
|
||||
mPlaybackMeter(NULL),
|
||||
mCaptureMeter(NULL),
|
||||
@ -2031,6 +2033,11 @@ void AudacityProject::OnCloseWindow(wxCloseEvent & event)
|
||||
mFreqWindow = NULL;
|
||||
}
|
||||
|
||||
if (mContrastDialog) {
|
||||
mContrastDialog->Destroy();
|
||||
mContrastDialog = NULL;
|
||||
}
|
||||
|
||||
// Check to see if we were playing or recording
|
||||
// audio, and if so, make sure Audio I/O is completely finished.
|
||||
// The main point of this is to properly push the state
|
||||
|
2
src/Project.h
Normal file → Executable file
2
src/Project.h
Normal file → Executable file
@ -62,6 +62,7 @@ class EffectPlugs;
|
||||
|
||||
class TrackPanel;
|
||||
class FreqWindow;
|
||||
class ContrastDialog;
|
||||
|
||||
// toolbar classes
|
||||
class ControlToolBar;
|
||||
@ -537,6 +538,7 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame,
|
||||
MixerBoardFrame* mMixerBoardFrame;
|
||||
|
||||
FreqWindow *mFreqWindow;
|
||||
ContrastDialog *mContrastDialog;
|
||||
|
||||
// dialog for missing alias warnings
|
||||
wxDialog *mAliasMissingWarningDialog;
|
||||
|
41
src/effects/Contrast.cpp
Normal file → Executable file
41
src/effects/Contrast.cpp
Normal file → Executable file
@ -53,47 +53,6 @@
|
||||
|
||||
#include "../PlatformCompatibility.h"
|
||||
|
||||
static ContrastDialog *gContrastDialog = NULL;
|
||||
|
||||
void InitContrastDialog(wxWindow * parent)
|
||||
{
|
||||
if(!gContrastDialog)
|
||||
{
|
||||
wxPoint where;
|
||||
|
||||
where.x = 150;
|
||||
where.y = 150;
|
||||
|
||||
gContrastDialog = new ContrastDialog(parent, -1, _("Contrast Analysis (WCAG 2 compliance)"), where);
|
||||
|
||||
gContrastDialog->bFGset = false;
|
||||
gContrastDialog->bBGset = false;
|
||||
}
|
||||
|
||||
// Zero dialog boxes. Do we need to do this here?
|
||||
if( !gContrastDialog->bFGset )
|
||||
{
|
||||
gContrastDialog->mForegroundStartT->SetValue(0.0);
|
||||
gContrastDialog->mForegroundEndT->SetValue(0.0);
|
||||
}
|
||||
if( !gContrastDialog->bBGset )
|
||||
{
|
||||
gContrastDialog->mBackgroundStartT->SetValue(0.0);
|
||||
gContrastDialog->mBackgroundEndT->SetValue(0.0);
|
||||
}
|
||||
|
||||
gContrastDialog->CentreOnParent();
|
||||
gContrastDialog->Show();
|
||||
}
|
||||
|
||||
void CloseContrastDialog()
|
||||
{
|
||||
if (gContrastDialog) {
|
||||
delete gContrastDialog;
|
||||
gContrastDialog = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
float ContrastDialog::GetDB()
|
||||
{
|
||||
// FIXME: what if more than one track?
|
||||
|
3
src/effects/Contrast.h
Normal file → Executable file
3
src/effects/Contrast.h
Normal file → Executable file
@ -20,9 +20,6 @@ class Envelope;
|
||||
class NumericTextCtrl;
|
||||
class WaveTrack;
|
||||
|
||||
void InitContrastDialog(wxWindow * parent);
|
||||
void CloseContrastDialog();
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// ContrastDialog
|
||||
//----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user