diff --git a/ATEM_tally_light/ATEM_tally_light.cpp b/ATEM_tally_light/ATEM_tally_light.cpp index 40e9d7f..d01f174 100644 --- a/ATEM_tally_light/ATEM_tally_light.cpp +++ b/ATEM_tally_light/ATEM_tally_light.cpp @@ -358,7 +358,7 @@ void loop() { // Initialize a connection to the switcher: if (firstRun) { atemSwitcher.begin(settings.switcherIP); - //atemSwitcher.serialOutput(0xff); //Makes Atem library print debug info + //atemSwitcher.serialOutput(0x80); //Makes Atem library print debug info Serial.println("------------------------"); Serial.println("Connecting to switcher..."); Serial.println((String)"Switcher IP: " + settings.switcherIP[0] + "." + settings.switcherIP[1] + "." + settings.switcherIP[2] + "." + settings.switcherIP[3]); diff --git a/libraries/ATEMmin/ATEMmin.cpp b/libraries/ATEMmin/ATEMmin.cpp index 246fb89..d8bb955 100644 --- a/libraries/ATEMmin/ATEMmin.cpp +++ b/libraries/ATEMmin/ATEMmin.cpp @@ -345,7 +345,7 @@ ATEMmin::ATEMmin(){} * Added by Aron N. Het Lam * Functionality to parse and retrieve streaming status. */ - else + else if(!strcmp_P(cmdStr, PSTR("StRS"))) { #if ATEM_debug temp = streamingStatusFlags; @@ -357,6 +357,18 @@ ATEMmin::ATEMmin(){} Serial.println(streamingStatusFlags); } #endif + } else + if(!strcmp_P(cmdStr, PSTR("RTMS"))) { + #if ATEM_debug + temp = recordingStatusFlags; + #endif + recordingStatusFlags = word(_packetBuffer[0], _packetBuffer[1]); + #if ATEM_debug + if ((_serialOutput==0x80 && recordingStatusFlags!=temp) || (_serialOutput==0x81 && !hasInitialized())) { + Serial.print(F("recordingStatusFlags = ")); + Serial.println(recordingStatusFlags); + } + #endif } } @@ -697,3 +709,58 @@ ATEMmin::ATEMmin(){} bool ATEMmin::getStreamUnknownError() { return streamingStatusFlags & 1 << 15; } + + /** + * Get raw recording status flags + */ + uint16_t ATEMmin::getRecordingStatusFlags() { return recordingStatusFlags; } + + /** + * Get recording status idle flag + */ + bool ATEMmin::getRecordingIdle() { return recordingStatusFlags == 0; } + + /** + * Get recording status is recording flag + */ + bool ATEMmin::getRecordingRecording() { return recordingStatusFlags & 1 << 0; } + + /** + * Get recording status is stopping flag + */ + bool ATEMmin::getRecordingStopping() { return recordingStatusFlags & 1 << 7; } + + /** + * Get recording status error none flag + */ + bool ATEMmin::getRecordingErrorNone() { return recordingStatusFlags & 1 << 1; } + + /** + * Get recording status error no media flag + */ + bool ATEMmin::getRecordingNoMedial() { return recordingStatusFlags == 0; } + + /** + * Get recording status error media full flag + */ + bool ATEMmin::getRecordingMediaFull() { return recordingStatusFlags & 1 << 2; } + + /** + * Get recording status media error flag + */ + bool ATEMmin::getRecordingMediaError() { return recordingStatusFlags & 1 << 3; } + + /** + * Get recording status media unformatted flag + */ + bool ATEMmin::getRecordingMediaUnformatted() { return recordingStatusFlags & 1 << 4; } + + /** + * Get recording status error dropping frames flag + */ + bool ATEMmin::getRecordingDroppingFrames() { return recordingStatusFlags & 1 << 5; } + + /** + * Get recording status unknown error flag + */ + bool ATEMmin::getRecordingUnknownError() { return recordingStatusFlags & 1 << 15; } diff --git a/libraries/ATEMmin/ATEMmin.h b/libraries/ATEMmin/ATEMmin.h index b27db15..62b0983 100644 --- a/libraries/ATEMmin/ATEMmin.h +++ b/libraries/ATEMmin/ATEMmin.h @@ -85,6 +85,7 @@ class ATEMmin : public ATEMbase uint16_t atemTallyByIndexSources; uint8_t atemTallyByIndexTallyFlags[41]; uint16_t streamingStatusFlags; //Added by Aron N. Het Lam + uint16_t recordingStatusFlags; //Added by Aron N. Het Lam public: // Public Methods in ATEM.h: @@ -123,6 +124,17 @@ class ATEMmin : public ATEMbase bool getStreamInvalidState(); bool getStreamStopping(); bool getStreamUnknownError(); + uint16_t getRecordingStatusFlags(); + bool getRecordingIdle(); + bool getRecordingRecording(); + bool getRecordingStopping(); + bool getRecordingErrorNone(); + bool getRecordingNoMedial(); + bool getRecordingMediaFull(); + bool getRecordingMediaError(); + bool getRecordingMediaUnformatted(); + bool getRecordingDroppingFrames(); + bool getRecordingUnknownError(); }; #endif