A few things missed when setting sensitivity.
[dcpomatic.git] / src / wx / film_editor.cc
index b90731cf3464393cad2920177f3300d92d018bcc..5ff3b3302561ecdae5b96cd26e4e43ce1da5b8ac 100644 (file)
 #include "dci_name_dialog.h"
 #include "scaler.h"
 
-using namespace std;
-using namespace boost;
+using std::string;
+using std::stringstream;
+using std::pair;
+using std::fixed;
+using std::setprecision;
+using std::list;
+using std::vector;
+using boost::shared_ptr;
 
 /** @param f Film to edit */
-FilmEditor::FilmEditor (Film* f, wxWindow* parent)
+FilmEditor::FilmEditor (shared_ptr<Film> f, wxWindow* parent)
        : wxPanel (parent)
        , _ignore_changes (Film::NONE)
        , _film (f)
@@ -231,6 +237,10 @@ FilmEditor::FilmEditor (Film* f, wxWindow* parent)
                _scaler->Append (std_to_wx ((*i)->name()));
        }
 
+       JobManager::instance()->ActiveJobsChanged.connect (
+               bind (&FilmEditor::active_jobs_changed, this, _1)
+               );
+
        /* And set their values from the Film */
        set_film (f);
        
@@ -587,7 +597,7 @@ FilmEditor::dcp_content_type_changed (wxCommandEvent &)
 
 /** Sets the Film that we are editing */
 void
-FilmEditor::set_film (Film* f)
+FilmEditor::set_film (shared_ptr<Film> f)
 {
        _film = f;
 
@@ -636,7 +646,6 @@ FilmEditor::set_things_sensitive (bool s)
        _name->Enable (s);
        _use_dci_name->Enable (s);
        _edit_dci_button->Enable (s);
-       _frames_per_second->Enable (s);
        _format->Enable (s);
        _content->Enable (s);
        _left_crop->Enable (s);
@@ -645,6 +654,7 @@ FilmEditor::set_things_sensitive (bool s)
        _bottom_crop->Enable (s);
        _filters_button->Enable (s);
        _scaler->Enable (s);
+       _audio_stream->Enable (s);
        _dcp_content_type->Enable (s);
        _dcp_range->Enable (s);
        _change_dcp_range_button->Enable (s);
@@ -652,10 +662,13 @@ FilmEditor::set_things_sensitive (bool s)
        _audio_gain->Enable (s);
        _audio_gain_calculate_button->Enable (s);
        _audio_delay->Enable (s);
+       _subtitle_stream->Enable (s);
        _still_duration->Enable (s);
        _with_subtitles->Enable (s);
        _subtitle_offset->Enable (s);
        _subtitle_scale->Enable (s);
+       _frames_per_second->Enable (s);
+       _original_size->Enable (s);
 }
 
 /** Called when the `Edit filters' button has been clicked */
@@ -930,3 +943,9 @@ FilmEditor::setup_audio_details ()
                _audio->SetLabel (std_to_wx (s.str ()));
        }
 }
+
+void
+FilmEditor::active_jobs_changed (bool a)
+{
+       set_things_sensitive (!a);
+}