#include "audio_dialog.h"
#include "timeline_dialog.h"
#include "audio_mapping_view.h"
+#include "timing_panel.h"
using std::string;
using std::cout;
_sequence_video->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::sequence_video_changed), 0, this);
_audio_mapping->Changed.connect (boost::bind (&FilmEditor::audio_mapping_changed, this, _1));
- _start->Changed.connect (boost::bind (&FilmEditor::start_changed, this));
- _length->Changed.connect (boost::bind (&FilmEditor::length_changed, this));
}
void
_content_notebook->AddPage (_audio_panel, _("Audio"), false);
make_subtitle_panel ();
_content_notebook->AddPage (_subtitle_panel, _("Subtitles"), false);
- make_timing_panel ();
- _content_notebook->AddPage (_timing_panel, _("Timing"), false);
+ _timing_panel = new TimingPanel (this);
}
void
_subtitle_scale->SetValue (100);
}
-void
-FilmEditor::make_timing_panel ()
-{
- _timing_panel = new wxPanel (_content_notebook);
- wxBoxSizer* timing_sizer = new wxBoxSizer (wxVERTICAL);
- _timing_panel->SetSizer (timing_sizer);
- wxFlexGridSizer* grid = new wxFlexGridSizer (2, 4, 4);
- timing_sizer->Add (grid, 0, wxALL, 8);
-
- add_label_to_sizer (grid, _timing_panel, _("Start time"), true);
- _start = new Timecode (_timing_panel);
- grid->Add (_start);
- add_label_to_sizer (grid, _timing_panel, _("Length"), true);
- _length = new Timecode (_timing_panel);
- grid->Add (_length);
-}
-
-
/** Called when the left crop widget has been changed */
void
FilmEditor::left_crop_changed (wxCommandEvent &)
ffmpeg_content = dynamic_pointer_cast<FFmpegContent> (content);
}
+ _timing_panel->film_content_changed (content, property);
+
/* We can't use case {} here */
- if (property == ContentProperty::START) {
- if (content) {
- _start->set (content->start (), _film->dcp_video_frame_rate ());
- } else {
- _start->set (0, 24);
- }
- } else if (property == ContentProperty::LENGTH) {
- if (content) {
- _length->set (content->length (), _film->dcp_video_frame_rate ());
- } else {
- _length->set (0, 24);
- }
- } else if (property == VideoContentProperty::VIDEO_CROP) {
+ if (property == VideoContentProperty::VIDEO_CROP) {
checked_set (_left_crop, video_content ? video_content->crop().left : 0);
checked_set (_right_crop, video_content ? video_content->crop().right : 0);
checked_set (_top_crop, video_content ? video_content->crop().top : 0);
ac->set_audio_mapping (m);
}
-void
-FilmEditor::start_changed ()
-{
- shared_ptr<Content> c = selected_content ();
- if (!c) {
- return;
- }
-
- c->set_start (_start->get (_film->dcp_video_frame_rate ()));
-}
-
-void
-FilmEditor::length_changed ()
-{
- shared_ptr<Content> c = selected_content ();
- if (!c) {
- return;
- }
-
- shared_ptr<StillImageContent> ic = dynamic_pointer_cast<StillImageContent> (c);
- if (ic) {
- ic->set_video_length (_length->get(_film->dcp_video_frame_rate()) * ic->video_frame_rate() / TIME_HZ);
- }
-}
-
void
FilmEditor::set_selection (weak_ptr<Content> wc)
{
class AudioMappingView;
class Ratio;
class Timecode;
+class TimingPanel;
/** @class FilmEditor
* @brief A wx widget to edit a film's metadata, and perform various functions.
boost::signals2::signal<void (std::string)> FileChanged;
+ /* Stuff for panels */
+
+ wxNotebook* content_notebook () const {
+ return _content_notebook;
+ }
+
+ boost::shared_ptr<Film> film () const {
+ return _film;
+ }
+
+ boost::shared_ptr<Content> selected_content ();
+
private:
void make_dcp_panel ();
void make_content_panel ();
void make_video_panel ();
void make_audio_panel ();
void make_subtitle_panel ();
- void make_timing_panel ();
void connect_to_widgets ();
/* Handle changes to the view */
void setup_content_sensitivity ();
void active_jobs_changed (bool);
- boost::shared_ptr<Content> selected_content ();
boost::shared_ptr<VideoContent> selected_video_content ();
boost::shared_ptr<AudioContent> selected_audio_content ();
boost::shared_ptr<SubtitleContent> selected_subtitle_content ();
+ TimingPanel* _timing_panel;
+
wxNotebook* _main_notebook;
wxNotebook* _content_notebook;
wxPanel* _dcp_panel;
wxPanel* _video_panel;
wxPanel* _audio_panel;
wxPanel* _subtitle_panel;
- wxPanel* _timing_panel;
/** The film we are editing */
boost::shared_ptr<Film> _film;
wxStaticText* _audio_description;
wxChoice* _subtitle_stream;
AudioMappingView* _audio_mapping;
- Timecode* _start;
- Timecode* _length;
wxChoice* _dcp_resolution;
ContentMenu _menu;
--- /dev/null
+/*
+ Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net>
+
+ This program 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,
+ 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.
+
+*/
+
+#include "lib/content.h"
+#include "lib/still_image_content.h"
+#include "timing_panel.h"
+#include "wx_util.h"
+#include "timecode.h"
+#include "film_editor.h"
+
+using boost::shared_ptr;
+using boost::dynamic_pointer_cast;
+
+TimingPanel::TimingPanel (FilmEditor* e)
+ : FilmEditorPanel (e, _("Timing"))
+{
+ wxFlexGridSizer* grid = new wxFlexGridSizer (2, 4, 4);
+ _sizer->Add (grid, 0, wxALL, 8);
+
+ add_label_to_sizer (grid, this, _("Start time"), true);
+ _start = new Timecode (this);
+ grid->Add (_start);
+ add_label_to_sizer (grid, this, _("Length"), true);
+ _length = new Timecode (this);
+ grid->Add (_length);
+
+ _start->Changed.connect (boost::bind (&TimingPanel::start_changed, this));
+ _length->Changed.connect (boost::bind (&TimingPanel::length_changed, this));
+}
+
+void
+TimingPanel::film_content_changed (shared_ptr<Content> content, int property)
+{
+ if (property == ContentProperty::START) {
+ if (content) {
+ _start->set (content->start (), _editor->film()->dcp_video_frame_rate ());
+ } else {
+ _start->set (0, 24);
+ }
+ } else if (property == ContentProperty::LENGTH) {
+ if (content) {
+ _length->set (content->length (), _editor->film()->dcp_video_frame_rate ());
+ } else {
+ _length->set (0, 24);
+ }
+ }
+}
+
+void
+TimingPanel::start_changed ()
+{
+ shared_ptr<Content> c = _editor->selected_content ();
+ if (!c) {
+ return;
+ }
+
+ c->set_start (_start->get (_editor->film()->dcp_video_frame_rate ()));
+}
+
+void
+TimingPanel::length_changed ()
+{
+ shared_ptr<Content> c = _editor->selected_content ();
+ if (!c) {
+ return;
+ }
+
+ shared_ptr<StillImageContent> ic = dynamic_pointer_cast<StillImageContent> (c);
+ if (ic) {
+ ic->set_video_length (_length->get (_editor->film()->dcp_video_frame_rate()) * ic->video_frame_rate() / TIME_HZ);
+ }
+}
--- /dev/null
+/*
+ Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net>
+
+ This program 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,
+ 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.
+
+*/
+
+#include "film_editor_panel.h"
+
+class Timecode;
+
+class TimingPanel : public FilmEditorPanel
+{
+public:
+ TimingPanel (FilmEditor *);
+
+ void film_content_changed (boost::shared_ptr<Content>, int);
+
+private:
+ void start_changed ();
+ void length_changed ();
+
+ Timecode* _start;
+ Timecode* _length;
+};
dci_metadata_dialog.cc
dir_picker_ctrl.cc
film_editor.cc
+ film_editor_panel.cc
film_viewer.cc
filter_dialog.cc
filter_view.cc
timecode.cc
timeline.cc
timeline_dialog.cc
+ timing_panel.cc
wx_util.cc
wx_ui_signaller.cc
"""