Emit no audio from DCPs if none is mapped
[dcpomatic.git] / src / wx / video_panel.cc
index a9ef6e02dea1d36f051d774d94ae988dac86f966..e065f9bb4b8ef548a3389b3bddce6611a73a0540 100644 (file)
@@ -108,7 +108,11 @@ VideoPanel::create ()
        int const link_height = 32;
 #elif defined(DCPOMATIC_OSX)
        int const crop_width = 56;
+#if wxCHECK_VERSION(3, 2, 0)
+       int const link_width = 8 + 15 / dpi_scale_factor(this);
+#else
        int const link_width = 23;
+#endif
        int const link_height = 28;
 #else
        int const crop_width = 56;
@@ -127,8 +131,10 @@ VideoPanel::create ()
                boost::bind (&VideoPanel::left_crop_changed, this)
                );
 
+       auto const link_path = bitmap_path(gui_is_dark() ? "link_white.png" : "link_black.png");
+
        _left_right_link = new wxToggleButton (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(link_width, link_height));
-       _left_right_link->SetBitmap (wxBitmap(bitmap_path("link.png"), wxBITMAP_TYPE_PNG));
+       _left_right_link->SetBitmap(wxBitmap(link_path, wxBITMAP_TYPE_PNG));
 
        _right_crop_label = create_label (this, _("Right"), true);
        _right_crop = new ContentSpinCtrl<VideoContent> (
@@ -153,7 +159,7 @@ VideoPanel::create ()
                );
 
        _top_bottom_link = new wxToggleButton (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(link_width, link_height));
-       _top_bottom_link->SetBitmap (wxBitmap(bitmap_path("link.png"), wxBITMAP_TYPE_PNG));
+       _top_bottom_link->SetBitmap(wxBitmap(link_path, wxBITMAP_TYPE_PNG));
 
        _bottom_crop_label = create_label (this, _("Bottom"), true);
        _bottom_crop = new ContentSpinCtrl<VideoContent> (
@@ -725,7 +731,10 @@ bool
 VideoPanel::scale_custom_edit_clicked ()
 {
        auto vc = _parent->selected_video().front()->video;
-       CustomScaleDialog dialog(this, vc->size(), _parent->film()->frame_size(), vc->custom_ratio(), vc->custom_size());
+       auto size = vc->size();
+       DCPOMATIC_ASSERT(size);
+
+       CustomScaleDialog dialog(this, *size, _parent->film()->frame_size(), vc->custom_ratio(), vc->custom_size());
        if (dialog.ShowModal() != wxID_OK) {
                return false;
        }
@@ -766,7 +775,7 @@ VideoPanel::left_crop_changed ()
 {
        _left_changed_last = true;
        if (_left_right_link->GetValue()) {
-               for (auto i: _parent->selected_video()) {
+               for (auto const& i: _parent->selected_video()) {
                        i->video->set_right_crop (i->video->requested_left_crop());
                }
        }
@@ -778,7 +787,7 @@ VideoPanel::right_crop_changed ()
 {
        _left_changed_last = false;
        if (_left_right_link->GetValue()) {
-               for (auto i: _parent->selected_video()) {
+               for (auto const& i: _parent->selected_video()) {
                        i->video->set_left_crop (i->video->requested_right_crop());
                }
        }