From bc2b42452d8a4038003751100bcc11134aac93cc Mon Sep 17 00:00:00 2001 From: SteffeyDev Date: Sun, 7 Jun 2020 10:48:57 -0400 Subject: [PATCH] Adding transition rate (#164) --- .gitignore | 5 ++++- README.md | 3 ++- atemOSC/OSCReceiver.mm | 21 +++++++++++++-------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 828aed1..9104dac 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,7 @@ profile *.moved-aside DerivedData .idea/ -*.hmap \ No newline at end of file +*.hmap + +# Vim +*.swp diff --git a/README.md b/README.md index df216ea..f15c0ef 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ Note: You can fetch the names of each input by sending the `/atem/send-status` c - **Auto** `/atem/transition/auto` - **Fade to Black Toggle** `/atem/transition/ftb` - **Preview Transition** `/atem/transition/preview ` + - **Change Rate** `/atem/transition/rate ` To set the transition type of the Auto transition: @@ -94,7 +95,7 @@ To set the transition type of the Auto transition: - Where `$x` is an integer value that is a valid program source, and can be 1-6 depending on the capability of your ATEM switcher. Check the Help Menu for the correct values. - e.g. `/atem/aux/1 1` to set Aux 1 output to source 1 (Camera 1) -Feedback: None +Feedback: Enabled for `/atem/transition/bar` ### Upstream Keyers diff --git a/atemOSC/OSCReceiver.mm b/atemOSC/OSCReceiver.mm index 5c1798c..fb7a533 100644 --- a/atemOSC/OSCReceiver.mm +++ b/atemOSC/OSCReceiver.mm @@ -175,20 +175,25 @@ - (instancetype) initWithDelegate:(AppDelegate *) delegate }]; [self addEndpoint:@"/atem/transition/type" valueType:OSCValString handler:^void(NSDictionary *d, OSCValue *v) { - REFIID transitionStyleID = IID_IBMDSwitcherTransitionParameters; - IBMDSwitcherTransitionParameters* mTransitionStyleParameters=NULL; - [appDel mMixEffectBlock]->QueryInterface(transitionStyleID, (void**)&mTransitionStyleParameters); + IBMDSwitcherTransitionParameters* mTransitionParameters=NULL; + [appDel mMixEffectBlock]->QueryInterface(IID_IBMDSwitcherTransitionParameters, (void**)&mTransitionParameters); if ([[v stringValue] isEqualToString:@"mix"]) - mTransitionStyleParameters->SetNextTransitionStyle(bmdSwitcherTransitionStyleMix); + mTransitionParameters->SetNextTransitionStyle(bmdSwitcherTransitionStyleMix); else if ([[v stringValue] isEqualToString:@"dip"]) - mTransitionStyleParameters->SetNextTransitionStyle(bmdSwitcherTransitionStyleDip); + mTransitionParameters->SetNextTransitionStyle(bmdSwitcherTransitionStyleDip); else if ([[v stringValue] isEqualToString:@"wipe"]) - mTransitionStyleParameters->SetNextTransitionStyle(bmdSwitcherTransitionStyleWipe); + mTransitionParameters->SetNextTransitionStyle(bmdSwitcherTransitionStyleWipe); else if ([[v stringValue] isEqualToString:@"sting"]) - mTransitionStyleParameters->SetNextTransitionStyle(bmdSwitcherTransitionStyleStinger); + mTransitionParameters->SetNextTransitionStyle(bmdSwitcherTransitionStyleStinger); else if ([[v stringValue] isEqualToString:@"dve"]) - mTransitionStyleParameters->SetNextTransitionStyle(bmdSwitcherTransitionStyleDVE); + mTransitionParameters->SetNextTransitionStyle(bmdSwitcherTransitionStyleDVE); + }]; + + [self addEndpoint:@"/atem/transition/rate" valueType:OSCValFloat handler:^void(NSDictionary *d, OSCValue *v) { + IBMDSwitcherTransitionMixParameters* mTransitionMixParameters=NULL; + [appDel mMixEffectBlock]->QueryInterface(IID_IBMDSwitcherTransitionMixParameters, (void**)&mTransitionMixParameters); + mTransitionMixParameters->SetRate([v floatValue]); }]; [self addEndpoint:@"/atem/usk//tie" label:@"Set USK Tie" valueType:OSCValBool handler:^void(NSDictionary *d, OSCValue *v) {