*/
-#include "audio_panel.h"
-#include "audio_mapping_view.h"
-#include "wx_util.h"
-#include "gain_calculator_dialog.h"
-#include "content_panel.h"
+
#include "audio_dialog.h"
-#include "static_text.h"
+#include "audio_mapping_view.h"
+#include "audio_panel.h"
#include "check_box.h"
+#include "content_panel.h"
#include "dcpomatic_button.h"
+#include "gain_calculator_dialog.h"
+#include "static_text.h"
+#include "wx_util.h"
#include "lib/config.h"
#include "lib/ffmpeg_audio_stream.h"
#include "lib/ffmpeg_content.h"
#include "lib/job_manager.h"
#include "lib/dcp_content.h"
#include "lib/audio_content.h"
+#include "lib/maths_util.h"
#include <wx/spinctrl.h>
#include <iostream>
+
using std::vector;
using std::cout;
using std::string;
using namespace boost::placeholders;
#endif
+
AudioPanel::AudioPanel (ContentPanel* p)
: ContentSubPanel (p, _("Audio"))
, _audio_dialog (0)
+{
+
+}
+
+
+void
+AudioPanel::create ()
{
_reference = new CheckBox (this, _("Use this DCP's audio as OV and make VF"));
_reference_note = new StaticText (this, wxT(""));
_delay->wrapped()->SetRange (-1000, 1000);
content_selection_changed ();
- film_changed (Film::AUDIO_CHANNELS);
- film_changed (Film::VIDEO_FRAME_RATE);
- film_changed (Film::REEL_TYPE);
+ film_changed (Film::Property::AUDIO_CHANNELS);
+ film_changed (Film::Property::VIDEO_FRAME_RATE);
+ film_changed (Film::Property::REEL_TYPE);
_reference->Bind (wxEVT_CHECKBOX, boost::bind (&AudioPanel::reference_clicked, this));
_show->Bind (wxEVT_BUTTON, boost::bind (&AudioPanel::show_clicked, this));
_active_jobs_connection = JobManager::instance()->ActiveJobsChanged.connect (boost::bind (&AudioPanel::active_jobs_changed, this, _1, _2));
add_to_grid ();
+
+ _sizer->Layout ();
}
void
add_label_to_sizer (_grid, _gain_label, true, wxGBPosition(r, 0));
{
auto s = new wxBoxSizer (wxHORIZONTAL);
- s->Add (_gain->wrapped(), 1, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM | wxRIGHT, 6);
+ s->Add (_gain->wrapped(), 1, wxALIGN_CENTER_VERTICAL | wxRIGHT, DCPOMATIC_SIZER_GAP);
s->Add (_gain_db_label, 0, wxALIGN_CENTER_VERTICAL);
_grid->Add (s, wxGBPosition(r, 1));
}
add_label_to_sizer (_grid, _delay_label, true, wxGBPosition(r, 0));
auto s = new wxBoxSizer (wxHORIZONTAL);
- s->Add (_delay->wrapped(), 1, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM | wxRIGHT, 6);
+ s->Add (_delay->wrapped(), 1, wxALIGN_CENTER_VERTICAL | wxRIGHT, DCPOMATIC_SIZER_GAP);
s->Add (_delay_ms_label, 0, wxALIGN_CENTER_VERTICAL);
_grid->Add (s, wxGBPosition(r, 1));
++r;
}
switch (property) {
- case Film::AUDIO_CHANNELS:
- case Film::AUDIO_PROCESSOR:
+ case Film::Property::AUDIO_CHANNELS:
+ case Film::Property::AUDIO_PROCESSOR:
_mapping->set_output_channels (_parent->film()->audio_output_names ());
setup_peak ();
break;
- case Film::VIDEO_FRAME_RATE:
+ case Film::Property::VIDEO_FRAME_RATE:
setup_description ();
break;
- case Film::REEL_TYPE:
- case Film::INTEROP:
+ case Film::Property::REEL_TYPE:
+ case Film::Property::INTEROP:
setup_sensitivity ();
break;
default:
}
setup_description ();
setup_peak ();
- _sizer->Layout ();
+ layout ();
} else if (property == AudioContentProperty::GAIN) {
setup_peak ();
} else if (property == DCPContentProperty::REFERENCE_AUDIO) {
}
setup_refer_button (_reference, _reference_note, dcp, can_reference, cannot);
- if (_reference->GetValue ()) {
- _gain->wrapped()->Enable (false);
- _gain_calculate_button->Enable (false);
- _show->Enable (true);
- _peak->Enable (false);
- _delay->wrapped()->Enable (false);
- _mapping->Enable (false);
- _description->Enable (false);
- } else {
- _gain->wrapped()->Enable (sel.size() == 1);
- _gain_calculate_button->Enable (sel.size() == 1);
- _show->Enable (sel.size() == 1);
- _peak->Enable (sel.size() == 1);
- _delay->wrapped()->Enable (sel.size() == 1);
- _mapping->Enable (sel.size() == 1);
- _description->Enable (sel.size() == 1);
- }
+ auto const ref = _reference->GetValue();
+ auto const single = sel.size() == 1;
+
+ _gain->wrapped()->Enable (!ref);
+ _gain_calculate_button->Enable (!ref && single);
+ _show->Enable (single);
+ _peak->Enable (!ref && single);
+ _delay->wrapped()->Enable (!ref);
+ _mapping->Enable (!ref && single);
+ _description->Enable (!ref && single);
}
void
_audio_dialog = nullptr;
}
}
+