From 9a88c7d32d9e42c07db17d8e33c4a509eb1390bd Mon Sep 17 00:00:00 2001 From: bruce Date: Tue, 11 Nov 2014 21:15:43 +0900 Subject: [PATCH] Test inter-instance communication via static variables. --- Source/hiopl.cpp | 5 +++++ Source/hiopl.h | 1 + 2 files changed, 6 insertions(+) diff --git a/Source/hiopl.cpp b/Source/hiopl.cpp index 3320faf..0509081 100644 --- a/Source/hiopl.cpp +++ b/Source/hiopl.cpp @@ -6,12 +6,17 @@ // A wrapper around the DOSBox and ZDoom OPL emulators. // 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; bool Hiopl::IsAnInstanceRecording() { return NULL != Hiopl::master; } +bool Hiopl::IsAnotherInstanceRecording() { + return this->IsAnInstanceRecording() && this != Hiopl::master; +} + Hiopl::Hiopl(int buflen, Emulator emulator) { InitCaptureVariables(); diff --git a/Source/hiopl.h b/Source/hiopl.h index 0cfbaf4..6fb844a 100644 --- a/Source/hiopl.h +++ b/Source/hiopl.h @@ -60,6 +60,7 @@ class Hiopl { void InitCaptureVariables(); bool IsAnInstanceRecording(); + bool IsAnotherInstanceRecording(); void StartCapture(const char* filepath); void StopCapture();