#include "lib/filter.h"
#include "lib/ratio.h"
#include "lib/config.h"
-#include "lib/imagemagick_content.h"
+#include "lib/still_image_content.h"
#include "lib/sndfile_content.h"
#include "lib/dcp_content_type.h"
#include "lib/sound_processor.h"
#include "gain_calculator_dialog.h"
#include "dci_metadata_dialog.h"
#include "audio_dialog.h"
-#include "imagemagick_content_dialog.h"
+#include "still_image_content_dialog.h"
#include "timeline_dialog.h"
#include "audio_mapping_view.h"
/** @param f Film to edit */
FilmEditor::FilmEditor (shared_ptr<Film> f, wxWindow* parent)
: wxPanel (parent)
+ , _menu (f, this)
, _generally_sensitive (true)
, _audio_dialog (0)
, _timeline_dialog (0)
_ratio->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::ratio_changed), 0, this);
_content->Connect (wxID_ANY, wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler (FilmEditor::content_selection_changed), 0, this);
_content->Connect (wxID_ANY, wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler (FilmEditor::content_selection_changed), 0, this);
+ _content->Connect (wxID_ANY, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK,wxListEventHandler (FilmEditor::content_right_click), 0, this);
_content_add->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_add_clicked), 0, this);
_content_remove->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_remove_clicked), 0, this);
_content_timeline->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_timeline_clicked), 0, this);
- _loop_content->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::loop_content_toggled), 0, this);
- _loop_count->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::loop_count_changed), 0, this);
_left_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::left_crop_changed), 0, this);
_right_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::right_crop_changed), 0, this);
_top_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::top_crop_changed), 0, this);
_audio_stream->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::audio_stream_changed), 0, this);
_subtitle_stream->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::subtitle_stream_changed), 0, this);
_dcp_resolution->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::dcp_resolution_changed), 0, this);
+ _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));
_content_sizer->Add (s, 0.75, wxEXPAND | wxALL, 6);
}
- wxBoxSizer* h = new wxBoxSizer (wxHORIZONTAL);
- _loop_content = new wxCheckBox (_content_panel, wxID_ANY, _("Loop everything"));
- h->Add (_loop_content, 0, wxALL, 6);
- _loop_count = new wxSpinCtrl (_content_panel, wxID_ANY);
- h->Add (_loop_count, 0, wxALL, 6);
- add_label_to_sizer (h, _content_panel, _("times"), false);
- _content_sizer->Add (h, 0, wxALL, 6);
+ _sequence_video = new wxCheckBox (_content_panel, wxID_ANY, _("Keep video in sequence"));
+ _content_sizer->Add (_sequence_video);
_content_notebook = new wxNotebook (_content_panel, wxID_ANY);
_content_sizer->Add (_content_notebook, 1, wxEXPAND | wxTOP, 6);
_content_notebook->AddPage (_subtitle_panel, _("Subtitles"), false);
make_timing_panel ();
_content_notebook->AddPage (_timing_panel, _("Timing"), false);
-
- _loop_count->SetRange (2, 1024);
}
void
setup_subtitle_control_sensitivity ();
setup_show_audio_sensitivity ();
break;
- case Film::LOOP:
- checked_set (_loop_content, _film->loop() > 1);
- checked_set (_loop_count, _film->loop());
- setup_loop_sensitivity ();
- break;
case Film::CONTAINER:
setup_container ();
break;
_audio_mapping->set_channels (_film->dcp_audio_channels ());
setup_dcp_name ();
break;
+ case Film::SEQUENCE_VIDEO:
+ checked_set (_sequence_video, _film->sequence_video ());
+ break;
}
}
void
FilmEditor::film_content_changed (weak_ptr<Content> weak_content, int property)
{
+ ensure_ui_thread ();
+
if (!_film) {
/* We call this method ourselves (as well as using it as a signal handler)
so _film can be 0.
}
shared_ptr<Content> content = weak_content.lock ();
+ if (content != selected_content ()) {
+ return;
+ }
+
shared_ptr<VideoContent> video_content;
shared_ptr<AudioContent> audio_content;
shared_ptr<SubtitleContent> subtitle_content;
film_changed (Film::NAME);
film_changed (Film::USE_DCI_NAME);
film_changed (Film::CONTENT);
- film_changed (Film::LOOP);
film_changed (Film::DCP_CONTENT_TYPE);
film_changed (Film::CONTAINER);
film_changed (Film::RESOLUTION);
film_changed (Film::DCI_METADATA);
film_changed (Film::DCP_VIDEO_FRAME_RATE);
film_changed (Film::DCP_AUDIO_CHANNELS);
+ film_changed (Film::SEQUENCE_VIDEO);
- if (!_film->content_without_loop().empty ()) {
- set_selection (_film->content_without_loop().front ());
+ if (!_film->content().empty ()) {
+ set_selection (_film->content().front ());
}
wxListEvent ev;
_show_audio->Enable (s);
_audio_delay->Enable (s);
_container->Enable (s);
- _loop_content->Enable (s);
- _loop_count->Enable (s);
setup_subtitle_control_sensitivity ();
setup_show_audio_sensitivity ();
_content->DeleteAllItems ();
- Playlist::ContentList content = _film->content_without_loop ();
- for (Playlist::ContentList::iterator i = content.begin(); i != content.end(); ++i) {
+ ContentList content = _film->content ();
+ for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
int const t = _content->GetItemCount ();
_content->InsertItem (t, std_to_wx ((*i)->summary ()));
if ((*i)->summary() == selected_summary) {
shared_ptr<Content> c;
- if (ImageMagickContent::valid_file (p)) {
- c.reset (new ImageMagickContent (_film, p));
+ if (StillImageContent::valid_file (p)) {
+ c.reset (new StillImageContent (_film, p));
} else if (SndfileContent::valid_file (p)) {
c.reset (new SndfileContent (_film, p));
} else {
return shared_ptr<Content> ();
}
- Playlist::ContentList c = _film->content_without_loop ();
+ ContentList c = _film->content ();
if (s < 0 || size_t (s) >= c.size ()) {
return shared_ptr<Content> ();
}
_scaling_description->SetLabel (d);
}
-void
-FilmEditor::loop_content_toggled (wxCommandEvent &)
-{
- if (_loop_content->GetValue ()) {
- _film->set_loop (_loop_count->GetValue ());
- } else {
- _film->set_loop (1);
- }
-
- setup_loop_sensitivity ();
-}
-
-void
-FilmEditor::loop_count_changed (wxCommandEvent &)
-{
- _film->set_loop (_loop_count->GetValue ());
-}
-
-void
-FilmEditor::setup_loop_sensitivity ()
-{
- _loop_count->Enable (_loop_content->GetValue ());
-}
-
void
FilmEditor::content_timeline_clicked (wxCommandEvent &)
{
return;
}
- shared_ptr<ImageMagickContent> ic = dynamic_pointer_cast<ImageMagickContent> (c);
+ 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)
{
- Playlist::ContentList content = _film->content_without_loop ();
+ ContentList content = _film->content ();
for (size_t i = 0; i < content.size(); ++i) {
if (content[i] == wc.lock ()) {
_content->SetItemState (i, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
vc->set_ratio (ratios[n]);
}
}
+
+void
+FilmEditor::sequence_video_changed (wxCommandEvent &)
+{
+ _film->set_sequence_video (_sequence_video->GetValue ());
+}
+
+void
+FilmEditor::content_right_click (wxListEvent& ev)
+{
+ ContentList cl;
+ cl.push_back (selected_content ());
+ _menu.popup (cl, ev.GetPoint ());
+}