Skip to content

Commit

Permalink
Adding transition rate for additional transition types, and DSK rate (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffeyDev committed Jun 7, 2020
1 parent 4af4747 commit 75b6757
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 7 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AtemOSC v3.1.4
# AtemOSC v3.1.5

## Features
This is a macOS application, providing an interface to control an ATEM video switcher via OSC.
Expand Down Expand Up @@ -76,7 +76,6 @@ 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 @@ -87,6 +86,14 @@ To set the transition type of the Auto transition:
- **DVE** `/atem/transition/type dve`
- Also supports sending the type in the address instead of as a string value (e.g. `/atem/transition/type/dve`)

To set rate for Auto transition:

- **Currently selected type** `/atem/transition/rate <float>`
- **Mix** `/atem/transition/mix/rate <float>`
- **Dip** `/atem/transition/dip/rate <float>`
- **Wipe** `/atem/transition/wipe/rate <float>`
- **DVE** `/atem/transition/dve/rate <float>`

Feedback: None

### Auxiliary Source Selection
Expand Down
61 changes: 58 additions & 3 deletions atemOSC/OSCReceiver.mm
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,59 @@ - (instancetype) initWithDelegate:(AppDelegate *) delegate
mTransitionParameters->SetNextTransitionStyle(bmdSwitcherTransitionStyleDVE);
}];

[self addEndpoint:@"/atem/transition/rate" valueType:OSCValFloat handler:^void(NSDictionary *d, OSCValue *v) {
[self addEndpoint:@"/atem/transition/rate" label:@"Set rate for selected transition type (mix, dip, wipe, or DVE)" valueType:OSCValFloat handler:^void(NSDictionary *d, OSCValue *v) {
IBMDSwitcherTransitionParameters* mTransitionParameters=NULL;
[appDel mMixEffectBlock]->QueryInterface(IID_IBMDSwitcherTransitionParameters, (void**)&mTransitionParameters);
BMDSwitcherTransitionStyle style=NULL;
mTransitionParameters->GetNextTransitionStyle(&style);

IBMDSwitcherTransitionMixParameters* mTransitionMixParameters=NULL;
IBMDSwitcherTransitionDipParameters* mTransitionDipParameters=NULL;
IBMDSwitcherTransitionWipeParameters* mTransitionWipeParameters=NULL;
IBMDSwitcherTransitionDVEParameters* mTransitionDVEParameters=NULL;

switch (style) {
case bmdSwitcherTransitionStyleMix:
if (SUCCEEDED([appDel mMixEffectBlock]->QueryInterface(IID_IBMDSwitcherTransitionMixParameters, (void**)&mTransitionMixParameters)))
mTransitionMixParameters->SetRate([v floatValue]);
break;
case bmdSwitcherTransitionStyleDip:
if (SUCCEEDED([appDel mMixEffectBlock]->QueryInterface(IID_IBMDSwitcherTransitionDipParameters, (void**)&mTransitionDipParameters)))
mTransitionDipParameters->SetRate([v floatValue]);
break;
case bmdSwitcherTransitionStyleWipe:
if (SUCCEEDED([appDel mMixEffectBlock]->QueryInterface(IID_IBMDSwitcherTransitionDipParameters, (void**)&mTransitionWipeParameters)))
mTransitionWipeParameters->SetRate([v floatValue]);
break;
case bmdSwitcherTransitionStyleDVE:
if (SUCCEEDED([appDel mMixEffectBlock]->QueryInterface(IID_IBMDSwitcherTransitionDVEParameters, (void**)&mTransitionDVEParameters)))
mTransitionDVEParameters->SetRate([v floatValue]);
break;
}
}];

[self addEndpoint:@"/atem/transition/mix/rate" valueType:OSCValFloat handler:^void(NSDictionary *d, OSCValue *v) {
IBMDSwitcherTransitionMixParameters* mTransitionMixParameters=NULL;
[appDel mMixEffectBlock]->QueryInterface(IID_IBMDSwitcherTransitionMixParameters, (void**)&mTransitionMixParameters);
mTransitionMixParameters->SetRate([v floatValue]);
if (SUCCEEDED([appDel mMixEffectBlock]->QueryInterface(IID_IBMDSwitcherTransitionMixParameters, (void**)&mTransitionMixParameters)))
mTransitionMixParameters->SetRate([v floatValue]);
}];

[self addEndpoint:@"/atem/transition/dip/rate" valueType:OSCValFloat handler:^void(NSDictionary *d, OSCValue *v) {
IBMDSwitcherTransitionDipParameters* mTransitionDipParameters=NULL;
if (SUCCEEDED([appDel mMixEffectBlock]->QueryInterface(IID_IBMDSwitcherTransitionDipParameters, (void**)&mTransitionDipParameters)))
mTransitionDipParameters->SetRate([v floatValue]);
}];

[self addEndpoint:@"/atem/transition/wipe/rate" valueType:OSCValFloat handler:^void(NSDictionary *d, OSCValue *v) {
IBMDSwitcherTransitionWipeParameters* mTransitionWipeParameters=NULL;
if (SUCCEEDED([appDel mMixEffectBlock]->QueryInterface(IID_IBMDSwitcherTransitionDipParameters, (void**)&mTransitionWipeParameters)))
mTransitionWipeParameters->SetRate([v floatValue]);
}];

[self addEndpoint:@"/atem/transition/dve/rate" valueType:OSCValFloat handler:^void(NSDictionary *d, OSCValue *v) {
IBMDSwitcherTransitionDVEParameters* mTransitionDVEParameters=NULL;
if (SUCCEEDED([appDel mMixEffectBlock]->QueryInterface(IID_IBMDSwitcherTransitionDVEParameters, (void**)&mTransitionDVEParameters)))
mTransitionDVEParameters->SetRate([v floatValue]);
}];

[self addEndpoint:@"/atem/usk/<key>/tie" label:@"Set USK<key> Tie" valueType:OSCValBool handler:^void(NSDictionary *d, OSCValue *v) {
Expand Down Expand Up @@ -361,6 +410,7 @@ - (instancetype) initWithDelegate:(AppDelegate *) delegate
dveParams->SetBorderLuma([v floatValue]);
}];


[self addEndpoint:@"/atem/dsk/<key>/tie" label:@"Set DSK<key> Tie" valueType:OSCValBool handler:^void(NSDictionary *d, OSCValue *v) {
int key = [[d objectForKey:@"<key>"] intValue];
bool isTransitioning;
Expand Down Expand Up @@ -406,6 +456,11 @@ - (instancetype) initWithDelegate:(AppDelegate *) delegate
if (!isTransitioning) [appDel dsk][key-1]->PerformAutoTransition();
}];

[self addEndpoint:@"/atem/dsk/<key>/rate" label:@"Set Rate for DSK<key>" valueType:OSCValFloat handler:^void(NSDictionary *d, OSCValue *v) {
int key = [[d objectForKey:@"<key>"] intValue];
[appDel dsk][key-1]->SetRate([v intValue]);
}];

[self addEndpoint:@"/atem/dsk/<key>/source/fill" label:@"Set Fill Source for DSK<key>" valueType:OSCValInt handler:^void(NSDictionary *d, OSCValue *v) {
int key = [[d objectForKey:@"<key>"] intValue];
[appDel dsk][key-1]->SetInputFill([v intValue]);
Expand Down
4 changes: 2 additions & 2 deletions atemOSC/atemOSC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks";
MACH_O_TYPE = mh_execute;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 3.1.4;
MARKETING_VERSION = 3.1.5;
PRODUCT_BUNDLE_IDENTIFIER = "cc.buechele.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = atemOSC;
SDKROOT = macosx;
Expand All @@ -339,7 +339,7 @@
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks";
MACH_O_TYPE = mh_execute;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 3.1.4;
MARKETING_VERSION = 3.1.5;
PRODUCT_BUNDLE_IDENTIFIER = "cc.buechele.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = atemOSC;
SDKROOT = macosx;
Expand Down

0 comments on commit 75b6757

Please sign in to comment.