AudioPanel::film_changed (Film::Property property)
{
switch (property) {
- case Film::CONTENT:
- setup_sensitivity ();
- break;
case Film::DCP_AUDIO_CHANNELS:
_mapping->set_channels (_editor->film()->dcp_audio_channels ());
break;
{
shared_ptr<AudioContent> ac = dynamic_pointer_cast<AudioContent> (c);
shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (c);
+
+ if (_audio_dialog && _editor->selected_audio_content()) {
+ _audio_dialog->set_content (_editor->selected_audio_content ());
+ }
if (property == AudioContentProperty::AUDIO_GAIN) {
checked_set (_gain, ac ? ac->audio_gain() : 0);
checked_set (_stream, lexical_cast<string> (fc->audio_stream()->id));
}
}
- setup_sensitivity ();
- } else if (property == FFmpegContentProperty::AUDIO_STREAM) {
- setup_sensitivity ();
}
}
_audio_dialog->set_content (ac);
}
-
-void
-AudioPanel::setup_sensitivity ()
-{
- _show->Enable (_editor->film ());
- _gain->Enable (_editor->generally_sensitive ());
- _gain_calculate_button->Enable (_editor->generally_sensitive ());
- _delay->Enable (_editor->generally_sensitive ());
-}
-
-void
-AudioPanel::content_selection_changed ()
-{
- if (_audio_dialog && _editor->selected_audio_content()) {
- _audio_dialog->set_content (_editor->selected_audio_content ());
- }
-}
-
void
AudioPanel::stream_changed (wxCommandEvent &)
{
void film_changed (Film::Property);
void film_content_changed (boost::shared_ptr<Content>, int);
- void content_selection_changed ();
-
- void setup_sensitivity ();
private:
void gain_changed (wxCommandEvent &);
_content_sizer->Add (_content_notebook, 1, wxEXPAND | wxTOP, 6);
_video_panel = new VideoPanel (this);
+ _panels.push_back (_video_panel);
_audio_panel = new AudioPanel (this);
+ _panels.push_back (_audio_panel);
_subtitle_panel = new SubtitlePanel (this);
+ _panels.push_back (_subtitle_panel);
_timing_panel = new TimingPanel (this);
+ _panels.push_back (_timing_panel);
}
+
/** Called when the name widget has been changed */
void
FilmEditor::name_changed (wxCommandEvent &)
stringstream s;
- _video_panel->film_changed (p);
- _audio_panel->film_changed (p);
- _subtitle_panel->film_changed (p);
- _timing_panel->film_changed (p);
+ for (list<FilmEditorPanel*>::iterator i = _panels.begin(); i != _panels.end(); ++i) {
+ (*i)->film_changed (p);
+ }
switch (p) {
case Film::NONE:
}
shared_ptr<Content> content = weak_content.lock ();
- if (content != selected_content ()) {
+ if (!content || content != selected_content ()) {
return;
}
-
- shared_ptr<VideoContent> video_content;
- shared_ptr<AudioContent> audio_content;
- shared_ptr<SubtitleContent> subtitle_content;
- shared_ptr<FFmpegContent> ffmpeg_content;
- if (content) {
- video_content = dynamic_pointer_cast<VideoContent> (content);
- audio_content = dynamic_pointer_cast<AudioContent> (content);
- subtitle_content = dynamic_pointer_cast<SubtitleContent> (content);
- ffmpeg_content = dynamic_pointer_cast<FFmpegContent> (content);
- }
-
- _video_panel->film_content_changed (content, property);
- _audio_panel->film_content_changed (content, property);
- _subtitle_panel->film_content_changed (content, property);
- _timing_panel->film_content_changed (content, property);
+
+ for (list<FilmEditorPanel*>::iterator i = _panels.begin(); i != _panels.end(); ++i) {
+ (*i)->film_content_changed (content, property);
+ }
if (property == FFmpegContentProperty::AUDIO_STREAM) {
setup_dcp_name ();
}
setup_dcp_name ();
- _video_panel->setup_scaling_description ();
}
/** Called when the container widget has been changed */
void
FilmEditor::set_film (shared_ptr<Film> f)
{
- set_things_sensitive (f != 0);
+ set_general_sensitivity (f != 0);
if (_film == f) {
return;
content_selection_changed (ev);
}
-/** Updates the sensitivity of lots of widgets to a given value.
- * @param s true to make sensitive, false to make insensitive.
- */
void
-FilmEditor::set_things_sensitive (bool s)
+FilmEditor::set_general_sensitivity (bool s)
{
_generally_sensitive = s;
-
+
+ /* Stuff in the Content / DCP tabs */
_name->Enable (s);
_use_dci_name->Enable (s);
_edit_dci_button->Enable (s);
_content->Enable (s);
+ _content_add->Enable (s);
+ _content_remove->Enable (s);
+ _content_timeline->Enable (s);
_dcp_content_type->Enable (s);
_dcp_frame_rate->Enable (s);
_dcp_audio_channels->Enable (s);
_j2k_bandwidth->Enable (s);
_container->Enable (s);
-
- _subtitle_panel->setup_control_sensitivity ();
- _audio_panel->setup_sensitivity ();
- setup_content_sensitivity ();
_best_dcp_frame_rate->Enable (s && _film && _film->best_dcp_video_frame_rate () != _film->dcp_video_frame_rate ());
+ _sequence_video->Enable (s);
+ _dcp_resolution->Enable (s);
+ _scaler->Enable (s);
+
+ /* Set the panels in the content notebook */
+ for (list<FilmEditorPanel*>::iterator i = _panels.begin(); i != _panels.end(); ++i) {
+ (*i)->Enable (s);
+ }
}
/** Called when the scaler widget has been changed */
void
FilmEditor::active_jobs_changed (bool a)
{
- set_things_sensitive (!a);
+ set_general_sensitivity (!a);
}
void
setup_content_sensitivity ();
shared_ptr<Content> s = selected_content ();
- _audio_panel->content_selection_changed ();
-
+ /* All other sensitivity in content panels should be triggered by
+ one of these.
+ */
film_content_changed (s, ContentProperty::START);
film_content_changed (s, ContentProperty::LENGTH);
film_content_changed (s, VideoContentProperty::VIDEO_CROP);
film_content_changed (s, SubtitleContentProperty::SUBTITLE_SCALE);
}
+/** Set up broad sensitivity based on the type of content that is selected */
void
FilmEditor::setup_content_sensitivity ()
{
void
FilmEditor::sequence_video_changed (wxCommandEvent &)
{
+ if (!_film) {
+ return;
+ }
+
_film->set_sequence_video (_sequence_video->GetValue ());
}
class TimelineDialog;
class Ratio;
class Timecode;
-class TimingPanel;
-class SubtitlePanel;
-class AudioPanel;
-class VideoPanel;
+class FilmEditorPanel;
/** @class FilmEditor
* @brief A wx widget to edit a film's metadata, and perform various functions.
boost::shared_ptr<AudioContent> selected_audio_content ();
boost::shared_ptr<SubtitleContent> selected_subtitle_content ();
- bool generally_sensitive () const {
- return _generally_sensitive;
- }
-
private:
void make_dcp_panel ();
void make_content_panel ();
void film_changed (Film::Property);
void film_content_changed (boost::weak_ptr<Content>, int);
- void set_things_sensitive (bool);
+ void set_general_sensitivity (bool);
void setup_dcp_name ();
void setup_content ();
void setup_container ();
void active_jobs_changed (bool);
- VideoPanel* _video_panel;
- AudioPanel* _audio_panel;
- SubtitlePanel* _subtitle_panel;
- TimingPanel* _timing_panel;
+ FilmEditorPanel* _video_panel;
+ FilmEditorPanel* _audio_panel;
+ FilmEditorPanel* _subtitle_panel;
+ FilmEditorPanel* _timing_panel;
+ std::list<FilmEditorPanel *> _panels;
wxNotebook* _main_notebook;
wxNotebook* _content_notebook;
virtual void film_changed (Film::Property) {}
virtual void film_content_changed (boost::shared_ptr<Content>, int) = 0;
- virtual void content_selection_changed () {}
protected:
FilmEditor* _editor;
{
switch (property) {
case Film::CONTENT:
- setup_control_sensitivity ();
+ setup_sensitivity ();
break;
case Film::WITH_SUBTITLES:
checked_set (_with_subtitles, _editor->film()->with_subtitles ());
- setup_control_sensitivity ();
+ setup_sensitivity ();
break;
default:
break;
_stream->SetSelection (wxNOT_FOUND);
}
}
- setup_control_sensitivity ();
+ setup_sensitivity ();
} else if (property == SubtitleContentProperty::SUBTITLE_OFFSET) {
checked_set (_offset, sc ? (sc->subtitle_offset() * 100) : 0);
} else if (property == SubtitleContentProperty::SUBTITLE_SCALE) {
}
void
-SubtitlePanel::setup_control_sensitivity ()
+SubtitlePanel::setup_sensitivity ()
{
bool h = false;
- if (_editor->generally_sensitive() && _editor->film()) {
- h = _editor->film()->has_subtitles ();
- }
-
- _with_subtitles->Enable (h);
-
bool j = false;
if (_editor->film()) {
+ h = _editor->film()->has_subtitles ();
j = _editor->film()->with_subtitles ();
}
+ _with_subtitles->Enable (h);
_offset->Enable (j);
_scale->Enable (j);
_stream->Enable (j);
void film_changed (Film::Property);
void film_content_changed (boost::shared_ptr<Content>, int);
- void setup_control_sensitivity ();
private:
void with_subtitles_toggled (wxCommandEvent &);
void offset_changed (wxCommandEvent &);
void scale_changed (wxCommandEvent &);
void stream_changed (wxCommandEvent &);
+
+ void setup_sensitivity ();
wxCheckBox* _with_subtitles;
wxSpinCtrl* _offset;
c->set_bottom_crop (_bottom_crop->GetValue ());
}
+void
+VideoPanel::film_changed (Film::Property property)
+{
+ switch (property) {
+ case Film::CONTAINER:
+ setup_scaling_description ();
+ break;
+ default:
+ break;
+ }
+}
+
void
VideoPanel::film_content_changed (shared_ptr<Content> c, int property)
{
*/
+#include "lib/film.h"
#include "film_editor_panel.h"
class wxChoice;
public:
VideoPanel (FilmEditor *);
+ void film_changed (Film::Property);
void film_content_changed (boost::shared_ptr<Content>, int);
- void setup_scaling_description ();
-
private:
void left_crop_changed (wxCommandEvent &);
void right_crop_changed (wxCommandEvent &);
void edit_filters_clicked (wxCommandEvent &);
void ratio_changed (wxCommandEvent &);
+ void setup_scaling_description ();
+
wxChoice* _ratio;
wxStaticText* _ratio_description;
wxStaticText* _scaling_description;