implement studio transition

This commit is contained in:
2023-10-20 11:18:06 -04:00
parent 6b0f5b99f9
commit d5d52ad2bd
2 changed files with 9 additions and 7 deletions

View File

@@ -7,8 +7,7 @@ class ObsCommunity: Obs, AutoCloseable {
// TODO: make a single controller, and read ops from a queue.
override fun close() {
}
override fun close() {}
override val handler: Handler = Handler { op ->
var controller:OBSRemoteController? = null
@@ -17,12 +16,16 @@ class ObsCommunity: Obs, AutoCloseable {
controller?.let { controller ->
log.info("ready to send ${op}")
when(op) {
Op.STUDIO_TRANSITION -> {
controller.triggerStudioModeTransition { response ->
log.info("Response successful: ${response.isSuccessful}")
controller.disconnect()
}
}
}
}
}
controller = OBSRemoteController.builder()
.host("localhost")

View File

@@ -1,7 +1,6 @@
package net.eksb.obsdc
enum class Op {
A,
B,
STUDIO_TRANSITION,
;
}