diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/film_editor.cc | 6 | ||||
| -rw-r--r-- | src/wx/gain_calculator_dialog.cc | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index c8ef0f233..71c48bd79 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -648,6 +648,12 @@ FilmEditor::audio_gain_calculate_button_clicked (wxCommandEvent &) { GainCalculatorDialog* d = new GainCalculatorDialog (this); d->ShowModal (); + + if (d->wanted_fader() == 0 || d->actual_fader() == 0) { + d->Destroy (); + return; + } + _audio_gain->SetValue ( Config::instance()->sound_processor()->db_for_fader_change ( d->wanted_fader (), diff --git a/src/wx/gain_calculator_dialog.cc b/src/wx/gain_calculator_dialog.cc index fcd54d4cf..3f07faf06 100644 --- a/src/wx/gain_calculator_dialog.cc +++ b/src/wx/gain_calculator_dialog.cc @@ -52,11 +52,19 @@ GainCalculatorDialog::GainCalculatorDialog (wxWindow* parent) float GainCalculatorDialog::wanted_fader () const { + if (_wanted->GetValue().IsEmpty()) { + return 0; + } + return lexical_cast<float> (wx_to_std (_wanted->GetValue ())); } float GainCalculatorDialog::actual_fader () const { + if (_actual->GetValue().IsEmpty()) { + return 0; + } + return lexical_cast<float> (wx_to_std (_actual->GetValue ())); } |
