_panels.push_back (_video_panel);
_audio_panel = new AudioPanel (this);
_panels.push_back (_audio_panel);
- for (int i = 0; i < CAPTION_COUNT; ++i) {
- _caption_panel[i] = new TextPanel (this, static_cast<TextType>(i));
- _panels.push_back (_caption_panel[i]);
+ for (int i = 0; i < TEXT_COUNT; ++i) {
+ _text_panel[i] = new TextPanel (this, static_cast<TextType>(i));
+ _panels.push_back (_text_panel[i]);
}
_timing_panel = new TimingPanel (this, _film_viewer);
_panels.push_back (_timing_panel);
+ _notebook->AddPage (_timing_panel, _("Timing"), false);
_content->Bind (wxEVT_LIST_ITEM_SELECTED, boost::bind (&ContentPanel::selection_changed, this));
_content->Bind (wxEVT_LIST_ITEM_DESELECTED, boost::bind (&ContentPanel::selection_changed, this));
}
ContentList
-ContentPanel::selected_caption ()
+ContentPanel::selected_text ()
{
ContentList sc;
BOOST_FOREACH (shared_ptr<Content> i, selected ()) {
- if (!i->caption.empty()) {
+ if (!i->text.empty()) {
sc.push_back (i);
}
}
}
}
- if (go_to && Config::instance()->jump_to_selected ()) {
- _film_viewer->set_position (go_to.get().ceil(_film->video_frame_rate()));
+ if (go_to && Config::instance()->jump_to_selected() && signal_manager) {
+ signal_manager->when_idle(boost::bind(&FilmViewer::set_position, _film_viewer, go_to.get().ceil(_film->video_frame_rate())));
}
if (_timeline_dialog) {
bool have_video = false;
bool have_audio = false;
- bool have_caption[CAPTION_COUNT] = { false, false };
+ bool have_text[TEXT_COUNT] = { false, false };
BOOST_FOREACH (shared_ptr<Content> i, selected()) {
if (i->video) {
have_video = true;
if (i->audio) {
have_audio = true;
}
- BOOST_FOREACH (shared_ptr<TextContent> j, i->caption) {
- have_caption[j->original_type()] = true;
+ BOOST_FOREACH (shared_ptr<TextContent> j, i->text) {
+ have_text[j->original_type()] = true;
}
}
bool video_panel = false;
bool audio_panel = false;
- bool caption_panel[CAPTION_COUNT] = { false, false };
+ bool text_panel[TEXT_COUNT] = { false, false };
for (size_t i = 0; i < _notebook->GetPageCount(); ++i) {
if (_notebook->GetPage(i) == _video_panel) {
video_panel = true;
} else if (_notebook->GetPage(i) == _audio_panel) {
audio_panel = true;
}
- for (int j = 0; j < CAPTION_COUNT; ++j) {
- if (_notebook->GetPage(i) == _caption_panel[j]) {
- caption_panel[j] = true;
+ for (int j = 0; j < TEXT_COUNT; ++j) {
+ if (_notebook->GetPage(i) == _text_panel[j]) {
+ text_panel[j] = true;
}
}
}
++off;
}
- for (int i = 0; i < CAPTION_COUNT; ++i) {
- if (have_caption[i] != caption_panel[i]) {
- if (caption_panel[i]) {
+ for (int i = 0; i < TEXT_COUNT; ++i) {
+ if (have_text[i] != text_panel[i]) {
+ if (text_panel[i]) {
_notebook->RemovePage (off);
}
- if (have_caption[i]) {
- _notebook->InsertPage (off, _caption_panel[i], _caption_panel[i]->name());
+ if (have_text[i]) {
+ _notebook->InsertPage (off, _text_panel[i], _text_panel[i]->name());
}
}
- if (have_caption[i]) {
+ if (have_text[i]) {
++off;
}
}
}
}
- if (!done) {
+ if (!done && _notebook->GetPageCount() > 0) {
_notebook->SetSelection (0);
}
_video_panel->Enable (_generally_sensitive && video_selection.size() > 0);
_audio_panel->Enable (_generally_sensitive && audio_selection.size() > 0);
- for (int i = 0; i < CAPTION_COUNT; ++i) {
- _caption_panel[i]->Enable (_generally_sensitive && selection.size() == 1 && !selection.front()->caption.empty());
+ for (int i = 0; i < TEXT_COUNT; ++i) {
+ _text_panel[i]->Enable (_generally_sensitive && selection.size() == 1 && !selection.front()->text.empty());
}
_timing_panel->Enable (_generally_sensitive);
}