: wxPanel (parent)
, _generally_sensitive (true)
, _audio_dialog (0)
+ , _timeline_dialog (0)
{
wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
_notebook = new wxNotebook (this, wxID_ANY);
_content->Connect (wxID_ANY, wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler (FilmEditor::content_activated), 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_edit->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_edit_clicked), 0, this);
+ _content_properties->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_properties_clicked), 0, this);
_content_earlier->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_earlier_clicked), 0, this);
_content_later->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_later_clicked), 0, this);
- _timeline_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::timeline_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);
b->Add (_content_add);
_content_remove = new wxButton (_content_panel, wxID_ANY, _("Remove"));
b->Add (_content_remove);
- _content_edit = new wxButton (_content_panel, wxID_ANY, _("Edit..."));
- b->Add (_content_edit);
+ _content_properties = new wxButton (_content_panel, wxID_ANY, _("Properties..."));
+ b->Add (_content_properties);
_content_earlier = new wxButton (_content_panel, wxID_ANY, _("Earlier"));
b->Add (_content_earlier);
_content_later = new wxButton (_content_panel, wxID_ANY, _("Later"));
b->Add (_content_later);
+ _content_timeline = new wxButton (_content_panel, wxID_ANY, _("Timeline..."));
+ b->Add (_content_timeline);
s->Add (b, 0, wxALL, 4);
add_label_to_sizer (h, _content_panel, _("times"));
_content_sizer->Add (h, 0, wxALL, 6);
- _playlist_description = new wxStaticText (_content_panel, wxID_ANY, wxT ("\n \n \n \n "));
- _content_sizer->Add (_playlist_description, 0.25, wxEXPAND | wxALL, 6);
- wxFont font = _playlist_description->GetFont();
- font.SetStyle(wxFONTSTYLE_ITALIC);
- font.SetPointSize(font.GetPointSize() - 1);
- _playlist_description->SetFont(font);
-
- _timeline_button = new wxButton (_content_panel, wxID_ANY, _("Timeline..."));
- _content_sizer->Add (_timeline_button, 0, wxALL, 6);
-
_loop_count->SetRange (2, 1024);
}
{
bool h = false;
if (_generally_sensitive && _film) {
- h = !_film->has_subtitles ();
+ h = _film->has_subtitles ();
}
_with_subtitles->Enable (h);
_content->SetItemState (0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
}
- setup_playlist_description ();
+ setup_content_information ();
}
void
ContentList c = _film->content ();
assert (ev.GetIndex() >= 0 && size_t (ev.GetIndex()) < c.size ());
- edit_content (c[ev.GetIndex()]);
+ content_properties (c[ev.GetIndex()]);
}
void
-FilmEditor::content_edit_clicked (wxCommandEvent &)
+FilmEditor::content_properties_clicked (wxCommandEvent &)
{
shared_ptr<Content> c = selected_content ();
if (!c) {
return;
}
- edit_content (c);
+ content_properties (c);
}
void
-FilmEditor::edit_content (shared_ptr<Content> c)
+FilmEditor::content_properties (shared_ptr<Content> c)
{
shared_ptr<ImageMagickContent> im = dynamic_pointer_cast<ImageMagickContent> (c);
if (im) {
shared_ptr<Content> selection = selected_content ();
- _content_edit->Enable (
+ _content_properties->Enable (
selection && _generally_sensitive &&
(dynamic_pointer_cast<ImageMagickContent> (selection) || dynamic_pointer_cast<FFmpegContent> (selection))
);
_content_remove->Enable (selection && _generally_sensitive);
_content_earlier->Enable (selection && _generally_sensitive);
_content_later->Enable (selection && _generally_sensitive);
+ _content_timeline->Enable (_generally_sensitive);
}
shared_ptr<Content>
}
void
-FilmEditor::setup_playlist_description ()
+FilmEditor::content_timeline_clicked (wxCommandEvent &)
{
- if (!_film) {
- _playlist_description->SetLabel (wxT (""));
- return;
+ if (_timeline_dialog) {
+ _timeline_dialog->Destroy ();
+ _timeline_dialog = 0;
}
-
- _playlist_description->SetLabel (std_to_wx (_film->playlist_description ()));
-}
-
-void
-FilmEditor::timeline_clicked (wxCommandEvent &)
-{
- TimelineDialog* d = new TimelineDialog (this, _film->playlist ());
- d->ShowModal ();
- d->Destroy ();
+
+ _timeline_dialog = new TimelineDialog (this, _film->playlist ());
+ _timeline_dialog->Show ();
}