No-op; rename a whole load of wx constants to their shorter equivalents.
[dcpomatic.git] / src / wx / video_panel.cc
index 28a26ce087612ab95db476cf11e52e4f3e25c067..462f2bdae3925ceb69aae168a1a8afba0f92937e 100644 (file)
@@ -1,19 +1,20 @@
 /*
     Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
 
-    This program is free software; you can redistribute it and/or modify
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.
 
-    This program is distributed in the hope that it will be useful,
+    DCP-o-matic is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
 
 */
 
@@ -231,6 +232,7 @@ VideoPanel::VideoPanel (ContentPanel* p)
        }
 
        _frame_type->wrapped()->Append (_("2D"));
+       _frame_type->wrapped()->Append (_("3D"));
        _frame_type->wrapped()->Append (_("3D left/right"));
        _frame_type->wrapped()->Append (_("3D top/bottom"));
        _frame_type->wrapped()->Append (_("3D alternate"));
@@ -240,23 +242,28 @@ VideoPanel::VideoPanel (ContentPanel* p)
        _fade_in->Changed.connect (boost::bind (&VideoPanel::fade_in_changed, this));
        _fade_out->Changed.connect (boost::bind (&VideoPanel::fade_out_changed, this));
 
-       _reference->Bind                     (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&VideoPanel::reference_clicked, this));
-       _filters_button->Bind                (wxEVT_COMMAND_BUTTON_CLICKED,   boost::bind (&VideoPanel::edit_filters_clicked, this));
-       _colour_conversion->Bind             (wxEVT_COMMAND_CHOICE_SELECTED,  boost::bind (&VideoPanel::colour_conversion_changed, this));
-       _edit_colour_conversion_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED,   boost::bind (&VideoPanel::edit_colour_conversion_clicked, this));
+       _reference->Bind                     (wxEVT_CHECKBOX, boost::bind (&VideoPanel::reference_clicked, this));
+       _filters_button->Bind                (wxEVT_BUTTON,   boost::bind (&VideoPanel::edit_filters_clicked, this));
+       _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));
 }
 
 void
 VideoPanel::film_changed (Film::Property property)
 {
        switch (property) {
-       case Film::CONTAINER:
        case Film::VIDEO_FRAME_RATE:
+       case Film::CONTAINER:
+               setup_description ();
+               setup_sensitivity ();
+               break;
        case Film::RESOLUTION:
                setup_description ();
                break;
        case Film::REEL_TYPE:
+       case Film::INTEROP:
                setup_sensitivity ();
+               break;
        default:
                break;
        }
@@ -273,13 +280,10 @@ VideoPanel::film_content_changed (int property)
                fcs = dynamic_pointer_cast<FFmpegContent> (vcs);
        }
 
-       if (property == VideoContentProperty::FRAME_TYPE) {
-               setup_description ();
-       } else if (property == VideoContentProperty::CROP) {
-               setup_description ();
-       } else if (property == VideoContentProperty::SCALE) {
-               setup_description ();
-       } else if (property == VideoContentProperty::FRAME_RATE) {
+       if (property == ContentProperty::VIDEO_FRAME_RATE ||
+           property == VideoContentProperty::FRAME_TYPE ||
+           property == VideoContentProperty::CROP ||
+           property == VideoContentProperty::SCALE) {
                setup_description ();
        } else if (property == VideoContentProperty::COLOUR_CONVERSION) {
                if (vcs && vcs->video->colour_conversion ()) {
@@ -316,8 +320,8 @@ VideoPanel::film_content_changed (int property)
 
                if (check.size() == 1) {
                        _fade_in->set (
-                               ContentTime::from_frames (vc.front()->video->fade_in (), vc.front()->video->frame_rate ()),
-                               vc.front()->video->frame_rate ()
+                               ContentTime::from_frames (vc.front()->video->fade_in (), vc.front()->active_video_frame_rate ()),
+                               vc.front()->active_video_frame_rate ()
                                );
                } else {
                        _fade_in->clear ();
@@ -330,8 +334,8 @@ VideoPanel::film_content_changed (int property)
 
                if (check.size() == 1) {
                        _fade_out->set (
-                               ContentTime::from_frames (vc.front()->video->fade_out (), vc.front()->video->frame_rate ()),
-                               vc.front()->video->frame_rate ()
+                               ContentTime::from_frames (vc.front()->video->fade_out (), vc.front()->active_video_frame_rate ()),
+                               vc.front()->active_video_frame_rate ()
                                );
                } else {
                        _fade_out->clear ();
@@ -415,9 +419,13 @@ VideoPanel::edit_colour_conversion_clicked ()
        }
 
        ContentColourConversionDialog* d = new ContentColourConversionDialog (this, vc.front()->video->yuv ());
-       d->set (vc.front()->video->colour_conversion().get_value_or (PresetColourConversion::all().front ().conversion));
-       d->ShowModal ();
-       vc.front()->video->set_colour_conversion (d->get ());
+       d->set (vc.front()->video->colour_conversion().get_value_or (PresetColourConversion::all().front().conversion));
+       if (d->ShowModal() == wxID_OK) {
+               vc.front()->video->set_colour_conversion (d->get ());
+       } else {
+               /* Reset the colour conversion choice */
+               film_content_changed (VideoContentProperty::COLOUR_CONVERSION);
+       }
        d->Destroy ();
 }
 
@@ -433,8 +441,8 @@ VideoPanel::content_selection_changed ()
        _bottom_crop->set_content (video_sel);
        _scale->set_content (video_sel);
 
+       film_content_changed (ContentProperty::VIDEO_FRAME_RATE);
        film_content_changed (VideoContentProperty::CROP);
-       film_content_changed (VideoContentProperty::FRAME_RATE);
        film_content_changed (VideoContentProperty::COLOUR_CONVERSION);
        film_content_changed (VideoContentProperty::FADE_IN);
        film_content_changed (VideoContentProperty::FADE_OUT);