Skip to content

Commit

Permalink
Adding transition rate (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffeyDev committed Jun 7, 2020
1 parent c6282c8 commit bc2b424
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ profile
*.moved-aside
DerivedData
.idea/
*.hmap
*.hmap

# Vim
*.swp
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <true|false>`
- **Change Rate** `/atem/transition/rate <float>`

To set the transition type of the Auto transition:

Expand All @@ -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

Expand Down
21 changes: 13 additions & 8 deletions atemOSC/OSCReceiver.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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/<key>/tie" label:@"Set USK<key> Tie" valueType:OSCValBool handler:^void(NSDictionary *d, OSCValue *v) {
Expand Down

0 comments on commit bc2b424

Please sign in to comment.