summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/audio_panel.cc23
-rw-r--r--src/wx/audio_panel.h2
2 files changed, 25 insertions, 0 deletions
diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc
index 15b18828d..fed1e9c6a 100644
--- a/src/wx/audio_panel.cc
+++ b/src/wx/audio_panel.cc
@@ -109,6 +109,8 @@ AudioPanel::create ()
_fade_out_label = create_label (this, _("Fade out"), true);
_fade_out = new Timecode<ContentTime> (this);
+ _use_same_fades_as_video = new wxCheckBox (this, wxID_ANY, _("Use same fades as video"));
+
_mapping = new AudioMappingView (this, _("Content"), _("content"), _("DCP"), _("DCP"));
_sizer->Add (_mapping, 1, wxEXPAND | wxALL, 6);
@@ -132,6 +134,7 @@ AudioPanel::create ()
_fade_in->Changed.connect (boost::bind(&AudioPanel::fade_in_changed, this));
_fade_out->Changed.connect (boost::bind(&AudioPanel::fade_out_changed, this));
+ _use_same_fades_as_video->Bind (wxEVT_CHECKBOX, boost::bind(&AudioPanel::use_same_fades_as_video_changed, this));
_mapping_connection = _mapping->Changed.connect (boost::bind (&AudioPanel::mapping_changed, this, _1));
_active_jobs_connection = JobManager::instance()->ActiveJobsChanged.connect (boost::bind (&AudioPanel::active_jobs_changed, this, _1, _2));
@@ -182,6 +185,9 @@ AudioPanel::add_to_grid ()
add_label_to_sizer (_grid, _fade_out_label, true, wxGBPosition(r, 0));
_grid->Add (_fade_out, wxGBPosition(r, 1), wxGBSpan(1, 3));
++r;
+
+ _grid->Add (_use_same_fades_as_video, wxGBPosition(r, 0), wxGBSpan(1, 4));
+ ++r;
}
@@ -291,6 +297,8 @@ AudioPanel::film_content_changed (int property)
} else {
_fade_out->clear ();
}
+ } else if (property == AudioContentProperty::USE_SAME_FADES_AS_VIDEO) {
+ setup_sensitivity ();
}
}
@@ -362,6 +370,7 @@ AudioPanel::content_selection_changed ()
film_content_changed (AudioContentProperty::GAIN);
film_content_changed (AudioContentProperty::FADE_IN);
film_content_changed (AudioContentProperty::FADE_OUT);
+ film_content_changed (AudioContentProperty::USE_SAME_FADES_AS_VIDEO);
film_content_changed (DCPContentProperty::REFERENCE_AUDIO);
setup_sensitivity ();
@@ -391,6 +400,8 @@ AudioPanel::setup_sensitivity ()
auto const ref = _reference->GetValue();
auto const single = sel.size() == 1;
+ auto const all_have_video = std::all_of(sel.begin(), sel.end(), [](shared_ptr<const Content> c) { return static_cast<bool>(c->video); });
+
_gain->wrapped()->Enable (!ref);
_gain_calculate_button->Enable (!ref && single);
_show->Enable (single);
@@ -398,6 +409,9 @@ AudioPanel::setup_sensitivity ()
_delay->wrapped()->Enable (!ref);
_mapping->Enable (!ref && single);
_description->Enable (!ref && single);
+ _fade_in->Enable (!_use_same_fades_as_video->GetValue());
+ _fade_out->Enable (!_use_same_fades_as_video->GetValue());
+ _use_same_fades_as_video->Enable (!ref && all_have_video);
}
@@ -531,3 +545,12 @@ AudioPanel::fade_out_changed ()
}
}
+
+void
+AudioPanel::use_same_fades_as_video_changed ()
+{
+ for (auto content: _parent->selected_audio()) {
+ content->audio->set_use_same_fades_as_video(_use_same_fades_as_video->GetValue());
+ }
+}
+
diff --git a/src/wx/audio_panel.h b/src/wx/audio_panel.h
index 2faec25df..213ad4cb7 100644
--- a/src/wx/audio_panel.h
+++ b/src/wx/audio_panel.h
@@ -59,6 +59,7 @@ private:
boost::optional<float> peak () const;
void fade_in_changed ();
void fade_out_changed ();
+ void use_same_fades_as_video_changed ();
wxCheckBox* _reference;
wxStaticText* _reference_note;
@@ -75,6 +76,7 @@ private:
Timecode<dcpomatic::ContentTime>* _fade_in;
wxStaticText* _fade_out_label;
Timecode<dcpomatic::ContentTime>* _fade_out;
+ wxCheckBox* _use_same_fades_as_video;
AudioMappingView* _mapping;
wxStaticText* _description;
AudioDialog* _audio_dialog = nullptr;