/
Callbacks.cs
96 lines (85 loc) · 3.6 KB
/
Callbacks.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
using System.Windows;
using System.Runtime.InteropServices;
using BMDSwitcherAPI;
namespace AtemSharp
{
public delegate void SwitcherEventHandler();
class SwitcherCallback : IBMDSwitcherCallback
{
public event SwitcherEventHandler SwitcherDisconnected;
public void SwitcherMonitor()
{
}
void IBMDSwitcherCallback.Notify(_BMDSwitcherEventType eventType, _BMDSwitcherVideoMode coreVideoMode)
{
if (eventType == _BMDSwitcherEventType.bmdSwitcherEventTypeDisconnected)
{
if (SwitcherDisconnected != null)
SwitcherDisconnected();
}
}
}
class MixEffectBlockCallback : IBMDSwitcherMixEffectBlockCallback
{
public event SwitcherEventHandler ProgramInputChanged;
public event SwitcherEventHandler PreviewInputChanged;
public event SwitcherEventHandler TransitionFramesRemainingChanged;
public event SwitcherEventHandler TransitionPositionChanged;
public event SwitcherEventHandler InTransitionChanged;
void IBMDSwitcherMixEffectBlockCallback.PropertyChanged(_BMDSwitcherMixEffectBlockPropertyId propertyId)
{
switch (propertyId)
{
case _BMDSwitcherMixEffectBlockPropertyId.bmdSwitcherMixEffectBlockPropertyIdProgramInput:
if (ProgramInputChanged != null)
ProgramInputChanged();
break;
case _BMDSwitcherMixEffectBlockPropertyId.bmdSwitcherMixEffectBlockPropertyIdPreviewInput:
if (PreviewInputChanged != null)
PreviewInputChanged();
break;
case _BMDSwitcherMixEffectBlockPropertyId.bmdSwitcherMixEffectBlockPropertyIdTransitionFramesRemaining:
if (TransitionFramesRemainingChanged != null)
TransitionFramesRemainingChanged();
break;
case _BMDSwitcherMixEffectBlockPropertyId.bmdSwitcherMixEffectBlockPropertyIdTransitionPosition:
if (TransitionPositionChanged != null)
TransitionPositionChanged();
break;
case _BMDSwitcherMixEffectBlockPropertyId.bmdSwitcherMixEffectBlockPropertyIdInTransition:
if (InTransitionChanged != null)
InTransitionChanged();
break;
}
}
}
class InputCallback : IBMDSwitcherInputCallback
{
public event SwitcherEventHandler LongNameChanged;
private IBMDSwitcherInput bInput;
public IBMDSwitcherInput Input { get { return bInput; } }
public InputCallback(IBMDSwitcherInput input)
{
bInput = input;
}
void IBMDSwitcherInputCallback.Notify(_BMDSwitcherInputEventType eventType)
{
switch (eventType)
{
case _BMDSwitcherInputEventType.bmdSwitcherInputEventTypeLongNameChanged:
if (LongNameChanged != null)
LongNameChanged();
break;
}
}
// void IBMDSwitcherInputCallback.PropertyChanged(_BMDSwitcherInputPropertyId propertyId)
// {
// switch (propertyId)
// {
// case _BMDSwitcherInputPropertyId.bmdSwitcherInputPropertyIdLongName:
// if (LongNameChanged != null)
// LongNameChanged();
// break;
// }
}
}