projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More stack-allocated Dialog objects.
[dcpomatic.git]
/
src
/
wx
/
audio_panel.cc
diff --git
a/src/wx/audio_panel.cc
b/src/wx/audio_panel.cc
index f84c9d67f82b7902df5389eb8edc89e4f74c51be..9a90436696485f65a32aa32e4632ce0b099120ed 100644
(file)
--- a/
src/wx/audio_panel.cc
+++ b/
src/wx/audio_panel.cc
@@
-195,14
+195,6
@@
AudioPanel::add_to_grid ()
}
}
-AudioPanel::~AudioPanel ()
-{
- if (_audio_dialog) {
- _audio_dialog->Destroy ();
- _audio_dialog = nullptr;
- }
-}
-
void
AudioPanel::film_changed (Film::Property property)
{
void
AudioPanel::film_changed (Film::Property property)
{
@@
-312,18
+304,17
@@
AudioPanel::film_content_changed (int property)
void
AudioPanel::gain_calculate_button_clicked ()
{
void
AudioPanel::gain_calculate_button_clicked ()
{
-
auto d = new GainCalculatorDialog
(this);
- auto const r = d
->ShowModal
();
- auto c
= d->
db_change();
+
GainCalculatorDialog dialog
(this);
+ auto const r = d
ialog.ShowModal
();
+ auto c
hange = dialog.
db_change();
- if (r == wxID_CANCEL || !c) {
- d->Destroy ();
+ if (r == wxID_CANCEL || !change) {
return;
}
auto old_peak_dB = peak ();
auto old_value = _gain->wrapped()->GetValue();
return;
}
auto old_peak_dB = peak ();
auto old_value = _gain->wrapped()->GetValue();
- _gain->wrapped()->SetValue(old_value + *c);
+ _gain->wrapped()->SetValue(old_value + *c
hange
);
/* This appears to be necessary, as the change is not signalled,
I think.
/* This appears to be necessary, as the change is not signalled,
I think.
@@
-336,8
+327,6
@@
AudioPanel::gain_calculate_button_clicked ()
_gain->wrapped()->SetValue (old_value);
_gain->view_changed ();
}
_gain->wrapped()->SetValue (old_value);
_gain->view_changed ();
}
-
- d->Destroy ();
}
}
@@
-424,17
+413,14
@@
AudioPanel::setup_sensitivity ()
void
AudioPanel::show_clicked ()
{
void
AudioPanel::show_clicked ()
{
- if (_audio_dialog) {
- _audio_dialog->Destroy ();
- _audio_dialog = nullptr;
- }
+ _audio_dialog.reset();
auto ac = _parent->selected_audio ();
if (ac.size() != 1) {
return;
}
auto ac = _parent->selected_audio ();
if (ac.size() != 1) {
return;
}
- _audio_dialog
= new AudioDialog
(this, _parent->film(), _parent->film_viewer(), ac.front());
+ _audio_dialog
.reset
(this, _parent->film(), _parent->film_viewer(), ac.front());
_audio_dialog->Show ();
}
_audio_dialog->Show ();
}
@@
-533,10
+519,7
@@
void
AudioPanel::set_film (shared_ptr<Film>)
{
/* We are changing film, so destroy any audio dialog for the old one */
AudioPanel::set_film (shared_ptr<Film>)
{
/* We are changing film, so destroy any audio dialog for the old one */
- if (_audio_dialog) {
- _audio_dialog->Destroy ();
- _audio_dialog = nullptr;
- }
+ _audio_dialog.reset();
}
}