Simple cover sheet support (#1039).
[dcpomatic.git] / src / wx / wx_util.cc
index 40e72543a7e374495057f8872c792b68f1ed71e8..05f2db121ac69496ce828c828929820ad1db65d7 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 #include "file_picker_ctrl.h"
 #include "lib/config.h"
 #include "lib/util.h"
+#include <dcp/locale_convert.h>
 #include <wx/spinctrl.h>
 #include <boost/thread.hpp>
 
 using namespace std;
 using namespace boost;
+using dcp::locale_convert;
 
 /** Add a wxStaticText to a wxSizer, aligning it at vertical centre.
  *  @param s Sizer to add to.
@@ -357,3 +359,26 @@ time_to_timecode (DCPTime t, double fps)
        int const f = lrint (w * fps);
        return wxString::Format (wxT("%02d:%02d:%02d.%02d"), h, m, s, f);
 }
+
+void
+setup_audio_channels_choice (wxChoice* choice, int minimum)
+{
+       vector<pair<string, string> > items;
+       for (int i = minimum; i <= 16; i += 2) {
+               if (i == 2) {
+                       items.push_back (make_pair (wx_to_std (_("2 - stereo")), locale_convert<string> (i)));
+               } else if (i == 4) {
+                       items.push_back (make_pair (wx_to_std (_("4 - L/C/R/Lfe")), locale_convert<string> (i)));
+               } else if (i == 6) {
+                       items.push_back (make_pair (wx_to_std (_("6 - 5.1")), locale_convert<string> (i)));
+               } else if (i == 8) {
+                       items.push_back (make_pair (wx_to_std (_("8 - 5.1/HI/VI")), locale_convert<string> (i)));
+               } else if (i == 12) {
+                       items.push_back (make_pair (wx_to_std (_("12 - 7.1/HI/VI")), locale_convert<string> (i)));
+               } else {
+                       items.push_back (make_pair (locale_convert<string> (i), locale_convert<string> (i)));
+               }
+       }
+
+       checked_set (choice, items);
+}