Add swaroop variant and use it to remove the screen options from the View menu.
authorCarl Hetherington <cth@carlh.net>
Fri, 21 Sep 2018 00:18:11 +0000 (01:18 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 21 Sep 2018 00:18:11 +0000 (01:18 +0100)
cscript
src/tools/dcpomatic_player.cc
wscript

diff --git a/cscript b/cscript
index c13061be1218bef6765cbb167b2966ce617d3216..a42c950334374dc89355e74addaa73dd17aa7d1c 100644 (file)
--- a/cscript
+++ b/cscript
@@ -338,7 +338,7 @@ def dependencies(target):
     return deps
 
 def option_defaults():
-    return { "player-only": "False", "gui": True }
+    return { "player-only": "False", "gui": True, "variant": None }
 
 def configure_options(target, options):
     opt = ''
@@ -366,6 +366,9 @@ def configure_options(target, options):
     if options['player-only']:
         opt += ' --player-only'
 
+    if options['variant'] is not None:
+        opt += ' --variant=%s' % options['variant']
+
     # Build Windows debug versions with static linking as I think gdb works better then
     if target.debug and target.platform == 'windows':
         opt += ' --static-dcpomatic'
index 1196567269ef3dea36aca19b829a3077524f9580..0f0d84df2f1f785748ce011740aa097046b0f516 100644 (file)
@@ -115,6 +115,8 @@ public:
                , _history_items (0)
                , _history_position (0)
                , _history_separator (0)
+               , _view_full_screen (0)
+               , _view_dual_screen (0)
        {
 
 #if defined(DCPOMATIC_WINDOWS)
@@ -355,8 +357,10 @@ private:
                optional<int> c = Config::instance()->decode_reduction();
                _view_cpl = view->Append(ID_view_cpl, _("CPL"), _cpl_menu);
                view->AppendSeparator();
+#ifndef DCPOMATIC_VARIANT_SWAROOP
                _view_full_screen = view->AppendCheckItem(ID_view_full_screen, _("Full screen\tF11"));
                _view_dual_screen = view->AppendCheckItem(ID_view_dual_screen, _("Dual screen\tShift+F11"));
+#endif
                setup_menu ();
                view->AppendSeparator();
                view->Append(ID_view_closed_captions, _("Closed captions..."));
@@ -547,8 +551,12 @@ private:
 
        void setup_menu ()
        {
-               _view_full_screen->Check (_mode == Config::PLAYER_MODE_FULL);
-               _view_dual_screen->Check (_mode == Config::PLAYER_MODE_DUAL);
+               if (_view_full_screen) {
+                       _view_full_screen->Check (_mode == Config::PLAYER_MODE_FULL);
+               }
+               if (_view_dual_screen) {
+                       _view_dual_screen->Check (_mode == Config::PLAYER_MODE_DUAL);
+               }
        }
 
        void setup_screen ()
diff --git a/wscript b/wscript
index c4102733687ef0dd3250d970b63b2489fc8cc97f..501bd4fb983df6544a71db6e4c1eb2817a5b119b 100644 (file)
--- a/wscript
+++ b/wscript
@@ -65,6 +65,7 @@ def options(opt):
     opt.add_option('--static-curl',       action='store_true', default=False, help='link statically to libcurl')
     opt.add_option('--workaround-gssapi', action='store_true', default=False, help='link to gssapi_krb5')
     opt.add_option('--force-cpp11',       action='store_true', default=False, help='force use of C++11')
+    opt.add_option('--variant',           help='build variant', choices=['swaroop'])
 
 def configure(conf):
     conf.load('compiler_cxx')
@@ -115,6 +116,9 @@ def configure(conf):
     else:
         conf.env.append_value('CXXFLAGS', '-O2')
 
+    if conf.options.variant is not None:
+        conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_VARIANT_%s' % conf.options.variant.upper())
+
     #
     # Windows/Linux/OS X specific
     #