Add exit command to stress tester.
authorCarl Hetherington <cth@carlh.net>
Wed, 29 Apr 2020 20:45:54 +0000 (22:45 +0200)
committerCarl Hetherington <cth@carlh.net>
Wed, 29 Apr 2020 20:45:54 +0000 (22:45 +0200)
DEVELOP.md
src/wx/player_stress_tester.cc
src/wx/player_stress_tester.h

index 4d2b0fca8b420c5e79c7d041124a1ec3fc0453fc..dc66a3bfd87dff628b6ee883b6541fd0eb724bf1 100644 (file)
@@ -36,10 +36,14 @@ Stop any current playback.
 
 Seek to some point in the current DCP, where 0 is the start and 4095 is the end; for example
 
-```S 2048```
+```K 2048```
 
 seeks half-way through the DCP.
 
+* `E`
+
+Stops playback and closes the player.
+
 The script can be run using something like
 
 ```dcpomatic2_player -s stress```
index c0e6e8443f2c5640876e613a17250b7ce2931005..726db2a70b9144578ed6c1acee37e6ba5049c4c1 100644 (file)
@@ -67,6 +67,8 @@ Command::Command (string line)
                }
                type = SEEK;
                int_param = raw_convert<int>(bits[1]);
+       } else if (bits[0] == "E") {
+               type = EXIT;
        }
 }
 
@@ -156,6 +158,9 @@ PlayerStressTester::check_commands ()
                        _controls->seek (_current_command->int_param);
                        ++_current_command;
                        break;
+               case Command::EXIT:
+                       wxTheApp->GetTopWindow()->Destroy();
+                       break;
        }
 }
 
index 40686bc2476b3e0f951590ddb409369a30cd292d..9da73762f38d44860efedb7ac0780805090e5366 100644 (file)
@@ -35,6 +35,7 @@ public:
                WAIT,
                STOP,
                SEEK,
+               EXIT
        };
 
        Command(std::string line);