2
0
Fork 0

Test inter-instance communication via static variables.

This commit is contained in:
bruce 2014-11-11 21:15:43 +09:00
parent 76206997f8
commit 9a88c7d32d
2 changed files with 6 additions and 0 deletions

View file

@ -6,12 +6,17 @@
// A wrapper around the DOSBox and ZDoom OPL emulators. // A wrapper around the DOSBox and ZDoom OPL emulators.
// Used by the first recording instance to claim master status // Used by the first recording instance to claim master status
// TODO: develop the logic for recording data from other (non-master) plugins
Hiopl* Hiopl::master = NULL; Hiopl* Hiopl::master = NULL;
bool Hiopl::IsAnInstanceRecording() { bool Hiopl::IsAnInstanceRecording() {
return NULL != Hiopl::master; return NULL != Hiopl::master;
} }
bool Hiopl::IsAnotherInstanceRecording() {
return this->IsAnInstanceRecording() && this != Hiopl::master;
}
Hiopl::Hiopl(int buflen, Emulator emulator) { Hiopl::Hiopl(int buflen, Emulator emulator) {
InitCaptureVariables(); InitCaptureVariables();

View file

@ -60,6 +60,7 @@ class Hiopl {
void InitCaptureVariables(); void InitCaptureVariables();
bool IsAnInstanceRecording(); bool IsAnInstanceRecording();
bool IsAnotherInstanceRecording();
void StartCapture(const char* filepath); void StartCapture(const char* filepath);
void StopCapture(); void StopCapture();