*/
-#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 <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(""));
_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;
}
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;
}
}
+