Use a LanguageTag for closed caption tracks.
[dcpomatic.git] / src / wx / dcp_text_track_dialog.cc
index d48b3be2624d57b6036a8f8ea342f19708c13726..3e8750cd5bff82f405a19bf85ad0fcdca895e81b 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "dcp_text_track_dialog.h"
+#include "language_tag_widget.h"
 #include <boost/algorithm/string.hpp>
 
+
 using std::string;
 
+
 DCPTextTrackDialog::DCPTextTrackDialog (wxWindow* parent)
        : TableDialog (parent, _("DCP Text Track"), 2, 1, true)
 {
        add (_("Name"), true);
        add (_name = new wxTextCtrl (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(300, -1)));
        add (_("Language"), true);
-       add (_language = new wxTextCtrl (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(150, -1)));
+       _language = new LanguageTagWidget (this, wxT(""), dcp::LanguageTag("en-US"));
+       add (_language->sizer());
 
        layout ();
 }
 
+
 DCPTextTrack
 DCPTextTrackDialog::get () const
 {
-       return DCPTextTrack(wx_to_std(_name->GetValue()), wx_to_std(_language->GetValue()));
+       return DCPTextTrack(wx_to_std(_name->GetValue()), _language->get().to_string());
 }