summaryrefslogtreecommitdiff
path: root/src/wx/export_subtitles_dialog.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2026-03-02 23:21:42 +0100
committerCarl Hetherington <cth@carlh.net>2026-03-02 23:21:42 +0100
commit5f589c6d951a5fc549dc652a7839c257d9bc6782 (patch)
tree5c19cc79c8c0c37f0c10e8ac240fbb2325d513ca /src/wx/export_subtitles_dialog.cc
parent8ed27c4278bc147b99602f59ede8639bbc8d00e6 (diff)
wip: srt export.3142-export-srt
Diffstat (limited to 'src/wx/export_subtitles_dialog.cc')
-rw-r--r--src/wx/export_subtitles_dialog.cc27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/wx/export_subtitles_dialog.cc b/src/wx/export_subtitles_dialog.cc
index 5ce97c93c..e08369b12 100644
--- a/src/wx/export_subtitles_dialog.cc
+++ b/src/wx/export_subtitles_dialog.cc
@@ -46,6 +46,7 @@ ExportSubtitlesDialog::ExportSubtitlesDialog(wxWindow* parent, int reels, bool i
_format = new Choice(this);
_format->add_entry(_("XML (Interop)"));
_format->add_entry(_("MXF (SMPTE)"));
+ _format->add_entry(_("SubRip (SRT)"));
_format->set(interop ? 0 : 1);
sizer->Add(_format, wxGBPosition(r, 1));
++r;
@@ -101,7 +102,17 @@ ExportSubtitlesDialog::format_changed()
void
ExportSubtitlesDialog::setup_wildcard()
{
- _file->set_wildcard(format() == SubtitleFormat::XML ? _("Subtitle files (.xml)|*.xml") : _("Subtitle files (.mxf)|*.mxf"));
+ switch (format()) {
+ case SubtitleFormat::XML:
+ _film->set_wildcard(_("Subtitle files (.xml)|*.xml"));
+ break;
+ case SubtitleFormat::MXF:
+ _film->set_wildcard(_("Subtitle files (.mxf)|*.mxf"));
+ break;
+ case SubtitleFormat::SRT:
+ _film->set_wildcard(_("Subtitle files (.srt)|*.srt"));
+ break;
+ }
}
@@ -113,6 +124,8 @@ ExportSubtitlesDialog::format() const
return SubtitleFormat::XML;
case 1:
return SubtitleFormat::MXF;
+ case 2:
+ return SubtitleFormat::SRT;
}
DCPOMATIC_ASSERT(false);
@@ -145,7 +158,17 @@ ExportSubtitlesDialog::path() const
if (_file->IsEnabled()) {
if (auto path = _file->path()) {
wxFileName fn(std_to_wx(path->string()));
- fn.SetExt(char_to_wx(format() == SubtitleFormat::XML ? "xml" : "mxf"));
+ switch (format()) {
+ case SubtitleFormat::XML:
+ fn.SetExt(char_to_wx("xml"));
+ break;
+ case SubtitleFormat::MXF:
+ fn.SetExt(char_to_wx("mxf"));
+ break;
+ case SubtitleFormat::SRT:
+ fn.SetExt(char_to_wx("srt"));
+ break;
+ }
return wx_to_std(fn.GetFullPath());
}
}