#include "content_panel.h"
#include "fonts_dialog.h"
#include "text_subtitle_appearance_dialog.h"
+#include "image_subtitle_colour_dialog.h"
#include "lib/ffmpeg_content.h"
#include "lib/text_subtitle_content.h"
#include "lib/ffmpeg_subtitle_stream.h"
#include "lib/dcp_subtitle_decoder.h"
#include "lib/dcp_content.h"
#include <wx/spinctrl.h>
-#include <boost/lexical_cast.hpp>
#include <boost/foreach.hpp>
using std::vector;
using std::string;
using std::list;
using boost::shared_ptr;
-using boost::lexical_cast;
using boost::dynamic_pointer_cast;
SubtitlePanel::SubtitlePanel (ContentPanel* p)
_stream->Enable (!reference && ffmpeg_subs == 1);
_subtitle_view_button->Enable (!reference && (text_subs == 1 || dcp_subs == 1));
_fonts_dialog_button->Enable (!reference && (text_subs == 1 || dcp_subs == 1));
- _appearance_dialog_button->Enable (!reference && text_subs == 1);
+ _appearance_dialog_button->Enable (!reference && (ffmpeg_subs == 1 || text_subs == 1));
}
void
DCPOMATIC_ASSERT (c.size() == 1);
shared_ptr<TextSubtitleContent> sr = dynamic_pointer_cast<TextSubtitleContent> (c.front ());
- DCPOMATIC_ASSERT (sr);
-
- TextSubtitleAppearanceDialog* d = new TextSubtitleAppearanceDialog (this, sr);
- if (d->ShowModal () == wxID_OK) {
- d->apply ();
+ if (sr) {
+ TextSubtitleAppearanceDialog* d = new TextSubtitleAppearanceDialog (this, sr);
+ if (d->ShowModal () == wxID_OK) {
+ d->apply ();
+ }
+ d->Destroy ();
+ } else {
+ shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (c.front ());
+ DCPOMATIC_ASSERT (fc);
+ ImageSubtitleColourDialog* d = new ImageSubtitleColourDialog (this, fc, fc->subtitle_stream ());
+ if (d->ShowModal() == wxID_OK) {
+ d->apply ();
+ }
+ d->Destroy ();
}
- d->Destroy ();
}