summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-09-06 23:34:48 +0100
committerCarl Hetherington <cth@carlh.net>2018-09-06 23:34:48 +0100
commit401af8742fe5b2bb3ec117acdc4b0b36bc8f5047 (patch)
tree903a138f847c19c9bfa7dca675abdc9b5ff11231 /src/wx
parent2857a60daf47286979a813ebefd892757de4f113 (diff)
Interface levels in audio tab.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/audio_panel.cc66
-rw-r--r--src/wx/audio_panel.h5
-rw-r--r--src/wx/content_sub_panel.cc17
-rw-r--r--src/wx/content_sub_panel.h7
-rw-r--r--src/wx/text_panel.cc6
-rw-r--r--src/wx/text_panel.h1
-rw-r--r--src/wx/timing_panel.cc6
-rw-r--r--src/wx/timing_panel.h1
-rw-r--r--src/wx/video_panel.cc16
-rw-r--r--src/wx/video_panel.h3
10 files changed, 83 insertions, 45 deletions
diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc
index 7d3ea3264..c250e9914 100644
--- a/src/wx/audio_panel.cc
+++ b/src/wx/audio_panel.cc
@@ -48,33 +48,18 @@ AudioPanel::AudioPanel (ContentPanel* p)
: ContentSubPanel (p, _("Audio"))
, _audio_dialog (0)
{
- wxBoxSizer* reference_sizer = new wxBoxSizer (wxVERTICAL);
-
_reference = new wxCheckBox (this, wxID_ANY, _("Use this DCP's audio as OV and make VF"));
- reference_sizer->Add (_reference, 0, wxLEFT | wxRIGHT | wxTOP, DCPOMATIC_SIZER_GAP);
-
_reference_note = new wxStaticText (this, wxID_ANY, _(""));
_reference_note->Wrap (200);
- reference_sizer->Add (_reference_note, 0, wxLEFT | wxRIGHT, DCPOMATIC_SIZER_GAP);
wxFont font = _reference_note->GetFont();
font.SetStyle(wxFONTSTYLE_ITALIC);
font.SetPointSize(font.GetPointSize() - 1);
_reference_note->SetFont(font);
- _sizer->Add (reference_sizer);
-
- wxGridBagSizer* grid = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
- _sizer->Add (grid, 0, wxALL, 8);
-
- int r = 0;
-
_show = new wxButton (this, wxID_ANY, _("Show graph of audio levels..."));
- grid->Add (_show, wxGBPosition (r, 0), wxGBSpan (1, 2));
_peak = new wxStaticText (this, wxID_ANY, wxT (""));
- grid->Add (_peak, wxGBPosition (r, 2), wxGBSpan (1, 2), wxALIGN_CENTER_VERTICAL);
- ++r;
- add_label_to_sizer (grid, this, _("Gain"), true, wxGBPosition (r, 0));
+ _gain_label = create_label (this, _("Gain"), true);
_gain = new ContentSpinCtrlDouble<AudioContent> (
this,
new wxSpinCtrlDouble (this),
@@ -84,13 +69,10 @@ AudioPanel::AudioPanel (ContentPanel* p)
boost::mem_fn (&AudioContent::set_gain)
);
- _gain->add (grid, wxGBPosition (r, 1));
- add_label_to_sizer (grid, this, _("dB"), false, wxGBPosition (r, 2));
+ _gain_db_label = create_label (this, _("dB"), false);
_gain_calculate_button = new wxButton (this, wxID_ANY, _("Calculate..."));
- grid->Add (_gain_calculate_button, wxGBPosition (r, 3));
- ++r;
- add_label_to_sizer (grid, this, _("Delay"), true, wxGBPosition (r, 0));
+ _delay_label = create_label (this, _("Delay"), true);
_delay = new ContentSpinCtrl<AudioContent> (
this,
new wxSpinCtrl (this),
@@ -100,19 +82,15 @@ AudioPanel::AudioPanel (ContentPanel* p)
boost::mem_fn (&AudioContent::set_delay)
);
- _delay->add (grid, wxGBPosition (r, 1));
/// TRANSLATORS: this is an abbreviation for milliseconds, the unit of time
- add_label_to_sizer (grid, this, _("ms"), false, wxGBPosition (r, 2));
- ++r;
+ _delay_ms_label = create_label (this, _("ms"), false);
_mapping = new AudioMappingView (this);
_sizer->Add (_mapping, 1, wxEXPAND | wxALL, 6);
- ++r;
_description = new wxStaticText (this, wxID_ANY, wxT (" \n"), wxDefaultPosition, wxDefaultSize);
_sizer->Add (_description, 0, wxALL, 12);
_description->SetFont (font);
- ++r;
_gain->wrapped()->SetRange (-60, 60);
_gain->wrapped()->SetDigits (1);
@@ -131,6 +109,42 @@ AudioPanel::AudioPanel (ContentPanel* p)
_mapping_connection = _mapping->Changed.connect (boost::bind (&AudioPanel::mapping_changed, this, _1));
JobManager::instance()->ActiveJobsChanged.connect (boost::bind (&AudioPanel::active_jobs_changed, this, _1, _2));
+
+ add_to_grid ();
+}
+
+void
+AudioPanel::add_to_grid ()
+{
+ Config::Interface const interface = Config::instance()->interface_complexity();
+
+ int r = 0;
+
+ _reference->Show (interface == Config::INTERFACE_FULL);
+ _reference_note->Show (interface == Config::INTERFACE_FULL);
+
+ if (interface == Config::INTERFACE_FULL) {
+ wxBoxSizer* reference_sizer = new wxBoxSizer (wxVERTICAL);
+ reference_sizer->Add (_reference, 0, wxLEFT | wxRIGHT | wxTOP, DCPOMATIC_SIZER_GAP);
+ reference_sizer->Add (_reference_note, 0, wxLEFT | wxRIGHT, DCPOMATIC_SIZER_GAP);
+ _grid->Add (reference_sizer, wxGBPosition(r, 0), wxGBSpan(1, 4));
+ ++r;
+ }
+
+ _grid->Add (_show, wxGBPosition (r, 0), wxGBSpan (1, 2));
+ _grid->Add (_peak, wxGBPosition (r, 2), wxGBSpan (1, 2), wxALIGN_CENTER_VERTICAL);
+ ++r;
+
+ add_label_to_sizer (_grid, _gain_label, true, wxGBPosition(r, 0));
+ _gain->add (_grid, wxGBPosition(r, 1));
+ add_label_to_sizer (_grid, _gain_db_label, false, wxGBPosition(r, 2));
+ _grid->Add (_gain_calculate_button, wxGBPosition(r, 3));
+ ++r;
+
+ add_label_to_sizer (_grid, _delay_label, true, wxGBPosition(r, 0));
+ _delay->add (_grid, wxGBPosition (r, 1));
+ add_label_to_sizer (_grid, _delay_ms_label, false, wxGBPosition(r, 2));
+ ++r;
}
AudioPanel::~AudioPanel ()
diff --git a/src/wx/audio_panel.h b/src/wx/audio_panel.h
index 66667e1ad..56b6fbe84 100644
--- a/src/wx/audio_panel.h
+++ b/src/wx/audio_panel.h
@@ -49,13 +49,18 @@ private:
void active_jobs_changed (boost::optional<std::string>, boost::optional<std::string>);
void setup_sensitivity ();
void reference_clicked ();
+ void add_to_grid ();
wxCheckBox* _reference;
wxStaticText* _reference_note;
wxButton* _show;
+ wxStaticText* _gain_label;
+ wxStaticText* _gain_db_label;
ContentSpinCtrlDouble<AudioContent>* _gain;
wxButton* _gain_calculate_button;
wxStaticText* _peak;
+ wxStaticText* _delay_label;
+ wxStaticText* _delay_ms_label;
ContentSpinCtrl<AudioContent>* _delay;
AudioMappingView* _mapping;
wxStaticText* _description;
diff --git a/src/wx/content_sub_panel.cc b/src/wx/content_sub_panel.cc
index aab404b74..0bd79805b 100644
--- a/src/wx/content_sub_panel.cc
+++ b/src/wx/content_sub_panel.cc
@@ -39,6 +39,23 @@ ContentSubPanel::ContentSubPanel (ContentPanel* p, wxString name)
{
SetScrollRate (8, 8);
SetSizer (_sizer);
+
+ _grid = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
+ _sizer->Add (_grid, 0, wxALL, 8);
+
+ Config::instance()->Changed.connect (boost::bind (&ContentSubPanel::config_changed, this, _1));
+}
+
+
+void
+ContentSubPanel::config_changed (Config::Property p)
+{
+ if (p == Config::INTERFACE_COMPLEXITY) {
+ _grid->Clear ();
+ add_to_grid ();
+ _sizer->Layout ();
+ _grid->Layout ();
+ }
}
void
diff --git a/src/wx/content_sub_panel.h b/src/wx/content_sub_panel.h
index 8c7854af2..bb0e937a1 100644
--- a/src/wx/content_sub_panel.h
+++ b/src/wx/content_sub_panel.h
@@ -24,10 +24,12 @@
#include <boost/shared_ptr.hpp>
#include <wx/wx.h>
#include "lib/film.h"
+#include "lib/config.h"
class ContentPanel;
class Content;
class DCPContent;
+class wxGridBagSizer;
class ContentSubPanel : public wxScrolledWindow
{
@@ -47,10 +49,15 @@ public:
protected:
void setup_refer_button (wxCheckBox* button, wxStaticText* note, boost::shared_ptr<DCPContent> dcp, bool can_reference, std::string why_not) const;
+ virtual void add_to_grid () = 0;
ContentPanel* _parent;
wxSizer* _sizer;
+ wxGridBagSizer* _grid;
wxString _name;
+
+private:
+ void config_changed (Config::Property);
};
#endif
diff --git a/src/wx/text_panel.cc b/src/wx/text_panel.cc
index 164b9dd7d..169732b66 100644
--- a/src/wx/text_panel.cc
+++ b/src/wx/text_panel.cc
@@ -186,6 +186,12 @@ TextPanel::TextPanel (ContentPanel* p, TextType t)
}
void
+TextPanel::add_to_grid ()
+{
+
+}
+
+void
TextPanel::update_dcp_track_selection ()
{
optional<DCPTextTrack> selected;
diff --git a/src/wx/text_panel.h b/src/wx/text_panel.h
index 349960f8e..3c0dc2365 100644
--- a/src/wx/text_panel.h
+++ b/src/wx/text_panel.h
@@ -53,6 +53,7 @@ private:
TextType current_type () const;
void update_dcp_tracks ();
void update_dcp_track_selection ();
+ void add_to_grid ();
void setup_sensitivity ();
diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc
index e9fc51f58..5a69fa686 100644
--- a/src/wx/timing_panel.cc
+++ b/src/wx/timing_panel.cc
@@ -171,6 +171,12 @@ TimingPanel::TimingPanel (ContentPanel* p, FilmViewer* viewer)
}
void
+TimingPanel::add_to_grid ()
+{
+
+}
+
+void
TimingPanel::update_full_length ()
{
set<DCPTime> check;
diff --git a/src/wx/timing_panel.h b/src/wx/timing_panel.h
index 0767daa09..400305c1a 100644
--- a/src/wx/timing_panel.h
+++ b/src/wx/timing_panel.h
@@ -46,6 +46,7 @@ private:
void update_full_length ();
void update_play_length ();
void setup_sensitivity ();
+ void add_to_grid ();
FilmViewer* _viewer;
diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc
index 029e410a6..dbba9e3b0 100644
--- a/src/wx/video_panel.cc
+++ b/src/wx/video_panel.cc
@@ -82,9 +82,6 @@ VideoPanel::VideoPanel (ContentPanel* p)
font.SetPointSize(font.GetPointSize() - 1);
_reference_note->SetFont(font);
- _grid = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
- _sizer->Add (_grid, 0, wxALL, 8);
-
_type_label = create_label (this, _("Type"), true);
_frame_type = new ContentChoice<VideoContent, VideoFrameType> (
this,
@@ -205,23 +202,10 @@ VideoPanel::VideoPanel (ContentPanel* p)
_colour_conversion->Bind (wxEVT_CHOICE, boost::bind (&VideoPanel::colour_conversion_changed, this));
_edit_colour_conversion_button->Bind (wxEVT_BUTTON, boost::bind (&VideoPanel::edit_colour_conversion_clicked, this));
- Config::instance()->Changed.connect (boost::bind (&VideoPanel::config_changed, this, _1));
-
add_to_grid ();
}
void
-VideoPanel::config_changed (Config::Property p)
-{
- if (p == Config::INTERFACE_COMPLEXITY) {
- _grid->Clear ();
- add_to_grid ();
- _sizer->Layout ();
- _grid->Layout ();
- }
-}
-
-void
VideoPanel::add_to_grid ()
{
Config::Interface const interface = Config::instance()->interface_complexity();
diff --git a/src/wx/video_panel.h b/src/wx/video_panel.h
index a244d08b3..795a52a78 100644
--- a/src/wx/video_panel.h
+++ b/src/wx/video_panel.h
@@ -27,7 +27,6 @@
#include "timecode.h"
#include "lib/video_content_scale.h"
#include "lib/film.h"
-#include "lib/config.h"
class wxChoice;
class wxStaticText;
@@ -54,12 +53,10 @@ private:
void fade_in_changed ();
void fade_out_changed ();
void add_to_grid ();
- void config_changed (Config::Property p);
void setup_description ();
void setup_sensitivity ();
- wxGridBagSizer* _grid;
wxCheckBox* _reference;
wxStaticText* _reference_note;
wxStaticText* _type_label;