├── example ├── qatemswitcher │ ├── main.cpp │ ├── qatemswitcher.pro │ ├── mainwindow.h │ ├── mainwindow.cpp │ └── mainwindow.ui └── qatemuploader │ ├── qatemuploader.pro │ ├── qatemuploader.h │ ├── main.cpp │ └── qatemuploader.cpp ├── .gitignore ├── README.md ├── libqatemcontrol.pro ├── libqatemcontrol_global.h ├── qatemcameracontrol.h ├── qupstreamkeysettings.h ├── qatemdownstreamkey.h ├── qatemtypes.h ├── qatemdownstreamkey.cpp ├── qatemcameracontrol.cpp ├── qatemconnection.h ├── COPYING └── qatemmixeffect.h /example/qatemswitcher/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | MainWindow w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | *.so.* 9 | *.dylib 10 | 11 | # Compiled Static libraries 12 | *.lai 13 | *.la 14 | *.a 15 | 16 | *.pro.user* 17 | Makefile 18 | moc_* 19 | 20 | build 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | libqatemcontrol 2 | =============== 3 | 4 | libqatemcontrol implements the protocol used to connect to BlackMagic ATEM switches. 5 | 6 | The protocol has been documented here: 7 | http://skaarhoj.com/fileadmin/BMDPROTOCOL.html 8 | 9 | Packet documentation: 10 | http://atemuser.com/forums/atem-vision-mixers/developers/controlling-atem#comment-251 11 | 12 | ## To build the library 13 | ``` 14 | qmake 15 | make 16 | ``` 17 | 18 | ## To install 19 | ``` 20 | make install 21 | ``` 22 | -------------------------------------------------------------------------------- /example/qatemuploader/qatemuploader.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2014-04-12T08:09:29 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core network 8 | 9 | TARGET = qatemuploader 10 | CONFIG += console 11 | CONFIG -= app_bundle 12 | 13 | TEMPLATE = app 14 | 15 | macx { 16 | INCLUDEPATH += /usr/local/include 17 | DEPENDPATH += /usr/local/include 18 | LIBS += -L/usr/local/lib 19 | } 20 | 21 | LIBS += -lqatemcontrol 22 | 23 | SOURCES += main.cpp \ 24 | qatemuploader.cpp 25 | 26 | HEADERS += \ 27 | qatemuploader.h 28 | -------------------------------------------------------------------------------- /example/qatemswitcher/qatemswitcher.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2013-10-06T09:35:23 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui network 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = qatemswitcher 12 | TEMPLATE = app 13 | 14 | macx { 15 | INCLUDEPATH += /usr/local/include 16 | DEPENDPATH += /usr/local/include 17 | LIBS += -L/usr/local/lib 18 | } 19 | 20 | LIBS += -lqatemcontrol 21 | 22 | 23 | SOURCES += main.cpp\ 24 | mainwindow.cpp 25 | 26 | HEADERS += mainwindow.h 27 | 28 | FORMS += mainwindow.ui 29 | -------------------------------------------------------------------------------- /libqatemcontrol.pro: -------------------------------------------------------------------------------- 1 | QT += network 2 | 3 | TARGET = qatemcontrol 4 | TEMPLATE = lib 5 | 6 | DEFINES += LIBQATEMCONTROL_LIBRARY 7 | 8 | SOURCES += qatemconnection.cpp \ 9 | qatemmixeffect.cpp \ 10 | qatemcameracontrol.cpp \ 11 | qatemdownstreamkey.cpp 12 | 13 | HEADERS += qatemconnection.h \ 14 | libqatemcontrol_global.h \ 15 | qupstreamkeysettings.h \ 16 | qatemmixeffect.h \ 17 | qatemtypes.h \ 18 | qatemcameracontrol.h \ 19 | qatemdownstreamkey.h 20 | 21 | macx { 22 | target.path = /usr/local/lib 23 | header_files.path = /usr/local/include 24 | } 25 | unix:!macx { 26 | target.path = /usr/lib 27 | header_files.path = /usr/include 28 | } 29 | unix { 30 | INSTALLS += target 31 | 32 | header_files.files = $$HEADERS 33 | INSTALLS += header_files 34 | } 35 | -------------------------------------------------------------------------------- /example/qatemuploader/qatemuploader.h: -------------------------------------------------------------------------------- 1 | #ifndef QATEMUPLOADER_H 2 | #define QATEMUPLOADER_H 3 | 4 | #include 5 | 6 | class QAtemConnection; 7 | 8 | class QAtemUploader : public QObject 9 | { 10 | Q_OBJECT 11 | public: 12 | enum State { 13 | NotConnected, 14 | AquiringLock, 15 | Inprogress, 16 | Done 17 | }; 18 | 19 | explicit QAtemUploader(QObject *parent = 0); 20 | 21 | void setMediaPlayer(qint8 id) { m_mediaplayer = id; } 22 | void upload(const QString &filename, const QString &address, quint8 position); 23 | 24 | protected slots: 25 | void handleError(const QString &errorString); 26 | 27 | void requestLock(); 28 | void handleMediaLockState(quint8 id, bool locked); 29 | 30 | void handleDataTransferFinished(quint16 transferId); 31 | 32 | private: 33 | QAtemConnection *m_connection; 34 | 35 | QString m_filename; 36 | quint8 m_position; 37 | State m_state; 38 | qint8 m_mediaplayer; 39 | }; 40 | 41 | #endif // QATEMUPLOADER_H 42 | -------------------------------------------------------------------------------- /libqatemcontrol_global.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 Peter Simonsson 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library. If not, see . 16 | */ 17 | 18 | #ifndef LIBQATEMCONTROL_GLOBAL_H 19 | #define LIBQATEMCONTROL_GLOBAL_H 20 | 21 | #include 22 | 23 | #if defined(LIBQATEMCONTROL_LIBRARY) 24 | # define LIBQATEMCONTROLSHARED_EXPORT Q_DECL_EXPORT 25 | #else 26 | # define LIBQATEMCONTROLSHARED_EXPORT Q_DECL_IMPORT 27 | #endif 28 | 29 | #endif // LIBQATEMCONTROL_GLOBAL_H 30 | -------------------------------------------------------------------------------- /example/qatemuploader/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "qatemuploader.h" 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | QCoreApplication a(argc, argv); 9 | QCoreApplication::setApplicationName("qatemuploader"); 10 | QCoreApplication::setApplicationVersion("0.1"); 11 | 12 | QCommandLineParser parser; 13 | parser.setApplicationDescription("Uploads image files to a Blackmagic ATEM switcher."); 14 | parser.addHelpOption(); 15 | parser.addVersionOption(); 16 | parser.addPositionalArgument("address", QCoreApplication::translate("main", "Address of the Blackmagic ATEM switcher")); 17 | parser.addPositionalArgument("position", QCoreApplication::translate("main", "Position in the still store")); 18 | parser.addPositionalArgument("source", QCoreApplication::translate("main", "Image file to upload")); 19 | 20 | QCommandLineOption copyToMediaPlayer (QStringList() << "mp" << "mediaplayer", QCoreApplication::translate("main", "Copy to media player when done"), "id"); 21 | parser.addOption(copyToMediaPlayer); 22 | 23 | parser.process(a); 24 | 25 | QStringList arguments = parser.positionalArguments(); 26 | 27 | if (arguments.count() != 3) 28 | { 29 | parser.showHelp(-1); 30 | } 31 | 32 | qint8 mediaplayer = static_cast(parser.value(copyToMediaPlayer).toInt() - 1); 33 | 34 | QAtemUploader uploader; 35 | uploader.setMediaPlayer(mediaplayer); 36 | uploader.upload(arguments[2], arguments[0], static_cast (arguments[1].toUInt() - 1)); 37 | 38 | return a.exec(); 39 | } 40 | -------------------------------------------------------------------------------- /example/qatemswitcher/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class MainWindow; 8 | } 9 | 10 | class QAtemConnection; 11 | class QButtonGroup; 12 | 13 | class MainWindow : public QMainWindow 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit MainWindow(QWidget *parent = nullptr); 19 | ~MainWindow(); 20 | 21 | protected slots: 22 | void connectToAtem(); 23 | 24 | void onAtemConnected(); 25 | 26 | void changeProgramInput(int input); 27 | void changePreviewInput(int input); 28 | void updateProgramInput(quint8 me, quint16 oldInput, quint16 newInput); 29 | void updatePreviewInput(quint8 me, quint16 oldInput, quint16 newInput); 30 | 31 | void toggleDsk1Tie(); 32 | void toggleDsk1OnAir(); 33 | void doDsk1Auto(); 34 | void toggleDsk2Tie(); 35 | void toggleDsk2OnAir(); 36 | void doDsk2Auto(); 37 | void updateDskTie(quint8 key, bool tie); 38 | void updateDskOn(quint8 key, bool on); 39 | 40 | void setTransitionRate(quint8 me, quint8 rate); 41 | void setTransitionStyle(quint8 me, quint8 style); 42 | void changeTransitionStyle(int style); 43 | void updateKeysOnNextTransition(quint8 me, quint8 keyers); 44 | void changeKeysTransition(int btn, bool state); 45 | void setTransitionPosition(quint8 me, quint16 pos); 46 | void changeTransitionPosition(int pos); 47 | 48 | void setFadeToBlackRate(quint8 me, quint8 rate); 49 | void setFadeToBlack(quint8 me, bool fading, bool state); 50 | 51 | void setUpstreamKeyOnAir(quint8 me, quint8 key, bool state); 52 | void changeKeyOnAir(int index, bool state); 53 | 54 | void updateTransitionPreview(quint8 me, bool state); 55 | 56 | private: 57 | Ui::MainWindow *m_ui; 58 | QAtemConnection *m_atemConnection; 59 | 60 | QButtonGroup *m_programGroup; 61 | QButtonGroup *m_previewGroup; 62 | QButtonGroup *m_transitionStyleGroup; 63 | QButtonGroup *m_keysTransitionGroup; 64 | QButtonGroup *m_keyOnAirGroup; 65 | }; 66 | 67 | #endif // MAINWINDOW_H 68 | -------------------------------------------------------------------------------- /qatemcameracontrol.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Peter Simonsson 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library. If not, see . 16 | */ 17 | 18 | #ifndef QATEMCAMERACONTROL_H 19 | #define QATEMCAMERACONTROL_H 20 | 21 | #include "qatemtypes.h" 22 | #include "libqatemcontrol_global.h" 23 | 24 | #include 25 | 26 | class QAtemConnection; 27 | 28 | class LIBQATEMCONTROLSHARED_EXPORT QAtemCameraControl : public QObject 29 | { 30 | Q_OBJECT 31 | public: 32 | explicit QAtemCameraControl(QAtemConnection *parent = nullptr); 33 | ~QAtemCameraControl(); 34 | 35 | QAtem::Camera *camera(quint8 input) const { return m_cameras[input - 1]; } 36 | 37 | public slots: 38 | void setFocus(quint8 input, quint16 focus); 39 | void activeAutoFocus(quint8 input); 40 | void setIris(quint8 input, quint16 iris); 41 | void setZoomSpeed(quint8 input, qint16 zoom); 42 | 43 | void setGain(quint8 input, quint16 gain); 44 | void setWhiteBalance(quint8 input, quint16 wb); 45 | void setShutter(quint8 input, quint16 shutter); 46 | 47 | void setLift(quint8 input, float r, float g, float b, float y); 48 | void setGamma(quint8 input, float r, float g, float b, float y); 49 | void setGain(quint8 input, float r, float g, float b, float y); 50 | void setContrast(quint8 input, quint8 contrast); 51 | void setLumMix(quint8 input, quint8 mix); 52 | void setHueSaturation(quint8 input, quint16 hue, quint8 saturation); 53 | 54 | protected slots: 55 | void onCCdP(const QByteArray& payload); 56 | 57 | private: 58 | void sendCCmd(quint8 input, quint8 hardware, quint8 command, bool append, quint8 valueType, QList values); 59 | 60 | QAtemConnection *m_atemConnection; 61 | 62 | QList m_cameras; 63 | 64 | signals: 65 | void cameraChanged(quint8 input); 66 | }; 67 | 68 | #endif // QATEMCAMERACONTROL_H 69 | -------------------------------------------------------------------------------- /example/qatemuploader/qatemuploader.cpp: -------------------------------------------------------------------------------- 1 | #include "qatemuploader.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | QAtemUploader::QAtemUploader(QObject *parent) : 12 | QObject(parent), m_state(NotConnected), m_mediaplayer (-1) 13 | { 14 | m_connection = new QAtemConnection(this); 15 | connect(m_connection, SIGNAL(socketError(QString)), 16 | this, SLOT(handleError(QString))); 17 | connect(m_connection, SIGNAL(connected()), 18 | this, SLOT(requestLock())); 19 | connect(m_connection, SIGNAL(mediaLockStateChanged(quint8,bool)), 20 | this, SLOT(handleMediaLockState(quint8,bool))); 21 | connect(m_connection, SIGNAL(dataTransferFinished(quint16)), 22 | this, SLOT(handleDataTransferFinished(quint16))); 23 | } 24 | 25 | void QAtemUploader::upload(const QString &filename, const QString &address, quint8 position) 26 | { 27 | QHostAddress host(address); 28 | 29 | if(host.isNull()) 30 | { 31 | handleError(tr("Invalid switcher address")); 32 | return; 33 | } 34 | 35 | m_connection->connectToSwitcher(host); 36 | 37 | m_filename = filename; 38 | m_position = position; 39 | } 40 | 41 | void QAtemUploader::handleError(const QString &errorString) 42 | { 43 | QTextStream out(stderr); 44 | out << errorString << endl << endl; 45 | QCoreApplication::exit(-1); 46 | } 47 | 48 | void QAtemUploader::requestLock() 49 | { 50 | m_state = AquiringLock; 51 | 52 | if(!m_connection->mediaLockState(0)) 53 | { 54 | m_connection->aquireMediaLock(0, m_position); 55 | } 56 | else 57 | { 58 | QTextStream out(stdout); 59 | out << tr("Waiting for lock to be released... "); 60 | } 61 | } 62 | 63 | void QAtemUploader::handleMediaLockState(quint8 id, bool locked) 64 | { 65 | QTextStream out(stdout); 66 | 67 | if (id == 0 && locked && m_state == AquiringLock) 68 | { 69 | QImage image(m_filename); 70 | 71 | if(image.isNull()) 72 | { 73 | handleError(tr ("Failed to load image")); 74 | return; 75 | } 76 | 77 | QSize size = m_connection->availableVideoModes().value(m_connection->videoFormat()).size; 78 | 79 | QFileInfo info(m_filename); 80 | 81 | out << tr ("Uploading... "); 82 | m_connection->sendDataToSwitcher(0, m_position, info.baseName().toUtf8(), QAtemConnection::prepImageForSwitcher(image, size.width(), size.height())); 83 | m_state = Inprogress; 84 | } 85 | else if(id == 0 && !locked) 86 | { 87 | if(m_state == AquiringLock) 88 | { 89 | out << tr ("Trying") << endl; 90 | requestLock(); 91 | } 92 | else if (m_state == Inprogress) 93 | { 94 | out << tr ("Done.") << endl << endl; 95 | m_state = Done; 96 | QCoreApplication::exit(); 97 | } 98 | } 99 | } 100 | 101 | void QAtemUploader::handleDataTransferFinished(quint16 transferId) 102 | { 103 | if(transferId == 1) 104 | { 105 | m_connection->unlockMediaLock(0); 106 | 107 | if(m_mediaplayer == 0 || m_mediaplayer == 1) 108 | { 109 | m_connection->setMediaPlayerSource(static_cast(m_mediaplayer), false, m_position); 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /qupstreamkeysettings.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 Peter Simonsson 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library. If not, see . 16 | */ 17 | 18 | #ifndef QUPSTREAMKEYSETTINGS_H 19 | #define QUPSTREAMKEYSETTINGS_H 20 | 21 | #include "qatemtypes.h" 22 | #include "libqatemcontrol_global.h" 23 | 24 | #include 25 | 26 | struct LIBQATEMCONTROLSHARED_EXPORT QUpstreamKeySettings 27 | { 28 | QUpstreamKeySettings(quint8 id) : m_id (id) 29 | { 30 | m_onAir = false; 31 | m_type = 0; 32 | m_fillSource = 0; 33 | m_keySource = 0; 34 | m_enableMask = false; 35 | m_topMask = 0; 36 | m_bottomMask = 0; 37 | m_leftMask = 0; 38 | m_rightMask = 0; 39 | m_lumaPreMultipliedKey = false; 40 | m_lumaInvertKey = false; 41 | m_lumaClip = 0; 42 | m_lumaGain = 0; 43 | m_chromaHue = 0; 44 | m_chromaGain = 0; 45 | m_chromaYSuppress = 0; 46 | m_chromaLift = 0; 47 | m_chromaNarrowRange = false; 48 | m_patternPattern = 0; 49 | m_patternInvertPattern = false; 50 | m_patternSize = 0; 51 | m_patternSymmetry = 0; 52 | m_patternSoftness = 0; 53 | m_patternXPosition = 0; 54 | m_patternYPosition = 0; 55 | m_dveXPosition = 0; 56 | m_dveYPosition = 0; 57 | m_dveXSize = 0; 58 | m_dveYSize = 0; 59 | m_dveRotation = 0; 60 | m_dveEnableDropShadow = false; 61 | m_dveLightSourceDirection = 0; 62 | m_dveLightSourceAltitude = 0; 63 | m_dveEnableBorder = false; 64 | m_dveBorderStyle = 0; 65 | m_dveBorderOutsideWidth = 0; 66 | m_dveBorderInsideWidth = 0; 67 | m_dveBorderOutsideSoften = 0; 68 | m_dveBorderInsideSoften = 0; 69 | m_dveBorderOpacity = 0; 70 | m_dveBorderBevelPosition = 0; 71 | m_dveBorderBevelSoften = 0; 72 | m_dveRate = 0; 73 | m_dveKeyFrameASet = 0; 74 | m_dveKeyFrameBSet = 0; 75 | m_dveMaskEnabled = false; 76 | m_dveMaskTop = 0; 77 | m_dveMaskBottom = 0; 78 | m_dveMaskLeft = 0; 79 | m_dveMaskRight = 0; 80 | m_enableFly = false; 81 | } 82 | 83 | quint8 m_id; 84 | bool m_onAir; 85 | quint8 m_type; 86 | quint16 m_fillSource; 87 | quint16 m_keySource; 88 | bool m_enableMask; 89 | float m_topMask; 90 | float m_bottomMask; 91 | float m_leftMask; 92 | float m_rightMask; 93 | bool m_lumaPreMultipliedKey; 94 | bool m_lumaInvertKey; 95 | float m_lumaClip; 96 | float m_lumaGain; 97 | float m_chromaHue; 98 | float m_chromaGain; 99 | float m_chromaYSuppress; 100 | float m_chromaLift; 101 | bool m_chromaNarrowRange; 102 | quint8 m_patternPattern; 103 | bool m_patternInvertPattern; 104 | float m_patternSize; 105 | float m_patternSymmetry; 106 | float m_patternSoftness; 107 | float m_patternXPosition; 108 | float m_patternYPosition; 109 | float m_dveXPosition; 110 | float m_dveYPosition; 111 | float m_dveXSize; 112 | float m_dveYSize; 113 | float m_dveRotation; 114 | bool m_dveEnableDropShadow; 115 | float m_dveLightSourceDirection; 116 | quint8 m_dveLightSourceAltitude; 117 | bool m_dveEnableBorder; 118 | quint8 m_dveBorderStyle; 119 | QColor m_dveBorderColor; 120 | float m_dveBorderOutsideWidth; 121 | float m_dveBorderInsideWidth; 122 | quint8 m_dveBorderOutsideSoften; 123 | quint8 m_dveBorderInsideSoften; 124 | quint8 m_dveBorderOpacity; 125 | float m_dveBorderBevelPosition; 126 | float m_dveBorderBevelSoften; 127 | quint8 m_dveRate; 128 | bool m_dveKeyFrameASet; 129 | bool m_dveKeyFrameBSet; 130 | bool m_dveMaskEnabled; 131 | float m_dveMaskTop; 132 | float m_dveMaskBottom; 133 | float m_dveMaskLeft; 134 | float m_dveMaskRight; 135 | bool m_enableFly; 136 | 137 | QAtem::DveKeyFrame m_keyFrames[2]; 138 | }; 139 | 140 | #endif // QUPSTREAMKEYSETTINGS_H 141 | -------------------------------------------------------------------------------- /qatemdownstreamkey.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Peter Simonsson 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library. If not, see . 16 | */ 17 | 18 | #ifndef DOWNSTREAMKEY_H 19 | #define DOWNSTREAMKEY_H 20 | 21 | #include 22 | #include "libqatemcontrol_global.h" 23 | 24 | class QAtemConnection; 25 | 26 | class LIBQATEMCONTROLSHARED_EXPORT QAtemDownstreamKey : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | Q_PROPERTY(bool onAir READ onAir WRITE setOnAir NOTIFY onAirChanged) 31 | Q_PROPERTY(bool tie READ tie WRITE setTie NOTIFY tieChanged) 32 | Q_PROPERTY(quint8 frameRate READ frameRate WRITE setFrameRate NOTIFY frameRateChanged) 33 | Q_PROPERTY(quint8 frameCount READ frameCount NOTIFY frameCountChanged) 34 | Q_PROPERTY(quint16 fillSource READ fillSource WRITE setFillSource NOTIFY sourcesChanged) 35 | Q_PROPERTY(quint16 keySource READ keySource WRITE setKeySource NOTIFY sourcesChanged) 36 | Q_PROPERTY(bool invertKey READ invertKey WRITE setInvertKey NOTIFY invertKeyChanged) 37 | Q_PROPERTY(bool preMultiplied READ preMultiplied WRITE setPreMultiplied NOTIFY preMultipliedChanged) 38 | Q_PROPERTY(float clip READ clip WRITE setClip NOTIFY clipChanged) 39 | Q_PROPERTY(float gain READ gain WRITE setGain NOTIFY gainChanged) 40 | Q_PROPERTY(bool enableMask READ enableMask WRITE setEnableMask NOTIFY enableMaskChanged) 41 | 42 | public: 43 | explicit QAtemDownstreamKey(quint8 id, QAtemConnection *parent); 44 | ~QAtemDownstreamKey(); 45 | 46 | bool onAir() const { return m_onAir; } 47 | bool inTransition() const { return m_inTransition; } 48 | bool inAutoTransition() const { return m_inAutoTransition; } 49 | bool tie() const { return m_tie; } 50 | quint8 frameRate() const { return m_frameRate; } 51 | quint8 frameCount() const { return m_frameCount; } 52 | quint16 fillSource() const { return m_fillSource; } 53 | quint16 keySource() const { return m_keySource; } 54 | bool invertKey() const { return m_invertKey; } 55 | bool preMultiplied() const { return m_preMultiplied; } 56 | float clip() const { return m_clip; } 57 | float gain() const { return m_gain; } 58 | bool enableMask() const { return m_enableMask; } 59 | float topMask() const { return m_topMask; } 60 | float bottomMask() const { return m_bottomMask; } 61 | float leftMask() const { return m_leftMask; } 62 | float rightMask() const { return m_rightMask; } 63 | 64 | public slots: 65 | void setOnAir(bool state); 66 | void setTie(bool state); 67 | void setFrameRate(quint8 frames); 68 | void setFillSource(quint16 source); 69 | void setKeySource(quint16 source); 70 | void setInvertKey(bool invert); 71 | void setPreMultiplied(bool preMultiplied); 72 | void setClip(float clip); 73 | void setGain(float gain); 74 | void setEnableMask(bool enabled); 75 | void setMask(float top, float bottom, float left, float right); 76 | 77 | void doAuto(); 78 | 79 | protected slots: 80 | void onDskS(const QByteArray &payload); 81 | void onDskP(const QByteArray &payload); 82 | void onDskB(const QByteArray &payload); 83 | 84 | private: 85 | quint8 m_id; 86 | 87 | bool m_onAir; 88 | bool m_inTransition; 89 | bool m_inAutoTransition; 90 | bool m_tie; 91 | quint8 m_frameRate; 92 | quint8 m_frameCount; 93 | quint16 m_fillSource; 94 | quint16 m_keySource; 95 | bool m_invertKey; 96 | bool m_preMultiplied; 97 | float m_clip; 98 | float m_gain; 99 | bool m_enableMask; 100 | float m_topMask; 101 | float m_bottomMask; 102 | float m_leftMask; 103 | float m_rightMask; 104 | 105 | QAtemConnection *m_atemConnection; 106 | 107 | signals: 108 | void onAirChanged(quint8 keyer, bool state); 109 | void inTransitionChanged(quint8 keyer, bool state); 110 | void inAutoTransitionChanged(quint8 keyer, bool state); 111 | void tieChanged(quint8 keyer, bool state); 112 | void frameCountChanged(quint8 keyer, quint8 count); 113 | void frameRateChanged(quint8 keyer, quint8 frames); 114 | void sourcesChanged(quint8 keyer, quint16 fill, quint16 key); 115 | void invertKeyChanged(quint8 keyer, bool invert); 116 | void preMultipliedChanged(quint8 keyer, bool preMultiplied); 117 | void clipChanged(quint8 keyer, float clip); 118 | void gainChanged(quint8 keyer, float gain); 119 | void enableMaskChanged(quint8 keyer, bool enable); 120 | void maskChanged(quint8 keyer, float top, float bottom, float left, float right); 121 | }; 122 | 123 | #endif // DOWNSTREAMKEY_H 124 | -------------------------------------------------------------------------------- /qatemtypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2014 Peter Simonsson 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library. If not, see . 16 | */ 17 | 18 | #ifndef QATEM_TOPOLOGY_H 19 | #define QATEM_TOPOLOGY_H 20 | 21 | #include "libqatemcontrol_global.h" 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace QAtem 30 | { 31 | typedef union 32 | { 33 | quint16 u16; 34 | quint8 u8[2]; 35 | } U16_U8; 36 | 37 | typedef union 38 | { 39 | quint32 u32; 40 | quint8 u8[4]; 41 | } U32_U8; 42 | 43 | struct LIBQATEMCONTROLSHARED_EXPORT Topology 44 | { 45 | quint8 MEs; 46 | quint8 sources; 47 | quint8 colorGenerators; 48 | quint8 auxBusses; 49 | quint8 downstreamKeyers; 50 | quint8 upstreamKeyers; 51 | quint8 stingers; 52 | quint8 DVEs; 53 | quint8 supersources; 54 | bool hasSD; 55 | }; 56 | 57 | struct LIBQATEMCONTROLSHARED_EXPORT VideoMode 58 | { 59 | VideoMode() : index(0), framesPerSecond(0.0) {} 60 | VideoMode(quint8 i, const QString &n, const QSize &s, float f) : 61 | index(i), name(n), size(s), framesPerSecond(f) {} 62 | 63 | quint8 index; 64 | QString name; 65 | QSize size; 66 | float framesPerSecond; 67 | }; 68 | 69 | struct LIBQATEMCONTROLSHARED_EXPORT MultiView 70 | { 71 | MultiView(quint8 i) : index(i) {} 72 | 73 | quint8 index; 74 | /// Multi view layout, 0 = prg/prv on top, 1 = prg/prv on bottom, 2 = prg/prv on left, 3 = prg/prv on right 75 | quint8 layout; 76 | quint16 sources[10]; 77 | }; 78 | 79 | struct LIBQATEMCONTROLSHARED_EXPORT InputInfo 80 | { 81 | InputInfo() 82 | { 83 | index = 0; 84 | tally = 0; 85 | externalType = 0; 86 | internalType = 0; 87 | availableExternalTypes = 0; 88 | availability = 0; 89 | meAvailability = 0; 90 | } 91 | 92 | quint16 index; 93 | quint8 tally; 94 | quint8 externalType; // 0 = Internal, 1 = SDI, 2 = HDMI, 3 = Composite, 4 = Component, 5 = SVideo 95 | quint8 internalType; // 0 = External, 1 = Black, 2 = Color Bars, 3 = Color Generator, 4 = Media Player Fill, 5 = Media Player Key, 6 = SuperSource, 128 = ME Output, 129 = Auxiliary, 130 = Mask 96 | quint8 availableExternalTypes; // Bit 0: SDI, 1: HDMI, 2: Component, 3: Composite, 4: SVideo 97 | quint8 availability; // Bit 0: Auxiliary, 1: Multiviewer, 2: SuperSource Art, 3: SuperSource Box, 4: Key Sources 98 | quint8 meAvailability; // Bit 0: ME1 + Fill Sources, 1: ME2 + Fill Sources 99 | QString longText; 100 | QString shortText; 101 | }; 102 | 103 | enum MediaType 104 | { 105 | StillMedia = 1, 106 | ClipMedia = 2, 107 | SoundMedia = 3 108 | }; 109 | 110 | struct LIBQATEMCONTROLSHARED_EXPORT MediaInfo 111 | { 112 | quint8 index; 113 | bool used; 114 | quint16 frameCount; 115 | QString name; 116 | MediaType type; 117 | QByteArray hash; 118 | }; 119 | 120 | struct LIBQATEMCONTROLSHARED_EXPORT MediaPlayerState 121 | { 122 | quint8 index; 123 | bool loop; 124 | bool playing; 125 | bool atBegining; 126 | quint8 currentFrame; 127 | }; 128 | 129 | struct LIBQATEMCONTROLSHARED_EXPORT AudioInput 130 | { 131 | quint16 index; 132 | quint8 type; // 0 = Video input, 1 = Media player, 2 = External 133 | quint8 plugType; // 0 = Internal, 1 = SDI, 2 = HDMI, 3 = Component, 4 = Composite, 5 = SVideo, 32 = XLR, 64 = AES/EBU, 128 = RCA 134 | quint8 state; // 0 = Off, 1 = On, 2 = AFV 135 | float balance; 136 | float gain; // dB 137 | }; 138 | 139 | struct LIBQATEMCONTROLSHARED_EXPORT AudioLevel 140 | { 141 | quint16 index; 142 | float left; 143 | float right; 144 | float peakLeft; 145 | float peakRight; 146 | }; 147 | 148 | struct LIBQATEMCONTROLSHARED_EXPORT DveKeyFrame 149 | { 150 | QPointF position; 151 | QSizeF size; 152 | float rotation; 153 | float lightSourceDirection; 154 | quint8 lightSourceAltitude; 155 | QColor borderColor; 156 | float borderOutsideWidth; 157 | float borderInsideWidth; 158 | quint8 borderOutsideSoften; 159 | quint8 borderInsideSoften; 160 | quint8 borderOpacity; 161 | float borderBevelPosition; 162 | quint8 borderBevelSoften; 163 | float maskTop; 164 | float maskBottom; 165 | float maskLeft; 166 | float maskRight; 167 | }; 168 | 169 | struct LIBQATEMCONTROLSHARED_EXPORT Camera 170 | { 171 | Camera(quint8 i) : 172 | input(i), focus(0), autoFocused(false), iris(0), zoomSpeed(0), 173 | gain(0), whiteBalance(0), shutter(0), 174 | liftR(0), liftG(0), liftB(0), liftY(0), 175 | gammaR(0), gammaG(0), gammaB(0), gammaY(0), 176 | gainR(0), gainG(0), gainB(0), gainY(0), 177 | contrast(0), lumMix(0), hue(0), saturation(0) 178 | { 179 | } 180 | 181 | quint8 input; 182 | quint16 focus; 183 | bool autoFocused; 184 | quint16 iris; 185 | qint16 zoomSpeed; 186 | quint16 gain; 187 | quint16 whiteBalance; 188 | quint16 shutter; 189 | float liftR; 190 | float liftG; 191 | float liftB; 192 | float liftY; 193 | float gammaR; 194 | float gammaG; 195 | float gammaB; 196 | float gammaY; 197 | float gainR; 198 | float gainG; 199 | float gainB; 200 | float gainY; 201 | quint8 contrast; 202 | quint8 lumMix; 203 | quint16 hue; 204 | quint8 saturation; 205 | }; 206 | 207 | struct LIBQATEMCONTROLSHARED_EXPORT MacroInfo 208 | { 209 | quint8 index; 210 | bool used; 211 | QString name; 212 | QString description; 213 | }; 214 | 215 | enum MacroRunningState 216 | { 217 | MacroStoped, 218 | MacroRunning, 219 | MacroWaiting 220 | }; 221 | } 222 | 223 | #endif //QATEM_TOPOLOGY_H 224 | -------------------------------------------------------------------------------- /qatemdownstreamkey.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Peter Simonsson 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library. If not, see . 16 | */ 17 | 18 | #include "qatemdownstreamkey.h" 19 | #include "qatemconnection.h" 20 | 21 | QAtemDownstreamKey::QAtemDownstreamKey(quint8 id, QAtemConnection *parent) : 22 | QObject(parent), m_id (id), m_atemConnection(parent) 23 | { 24 | m_onAir = false; 25 | m_tie = false; 26 | m_frameRate = 0; 27 | m_frameCount = 0; 28 | m_fillSource = 0; 29 | m_keySource = 0; 30 | m_invertKey = false; 31 | m_preMultiplied = false; 32 | m_clip = 0; 33 | m_gain = 0; 34 | m_enableMask = false; 35 | m_topMask = 0; 36 | m_bottomMask = 0; 37 | m_leftMask = 0; 38 | m_rightMask = 0; 39 | 40 | m_atemConnection->registerCommand("DskS", this, "onDskS"); 41 | m_atemConnection->registerCommand("DskP", this, "onDskP"); 42 | m_atemConnection->registerCommand("DskB", this, "onDskB"); 43 | } 44 | 45 | QAtemDownstreamKey::~QAtemDownstreamKey() 46 | { 47 | m_atemConnection->unregisterCommand("DskS", this); 48 | m_atemConnection->unregisterCommand("DskP", this); 49 | m_atemConnection->unregisterCommand("DskB", this); 50 | } 51 | 52 | void QAtemDownstreamKey::setOnAir(bool state) 53 | { 54 | if(state == m_onAir) 55 | { 56 | return; 57 | } 58 | 59 | QByteArray cmd("CDsL"); 60 | QByteArray payload(4, 0x0); 61 | 62 | payload[0] = static_cast(m_id); 63 | payload[1] = static_cast(state); 64 | 65 | m_atemConnection->sendCommand(cmd, payload); 66 | } 67 | 68 | void QAtemDownstreamKey::setTie(bool state) 69 | { 70 | if(state == m_tie) 71 | { 72 | return; 73 | } 74 | 75 | QByteArray cmd("CDsT"); 76 | QByteArray payload(4, 0x0); 77 | 78 | payload[0] = static_cast(m_id); 79 | payload[1] = static_cast(state); 80 | 81 | m_atemConnection->sendCommand(cmd, payload); 82 | } 83 | 84 | void QAtemDownstreamKey::doAuto() 85 | { 86 | QByteArray cmd("DDsA"); 87 | QByteArray payload(4, 0x0); 88 | 89 | payload[0] = static_cast(m_id); 90 | 91 | m_atemConnection->sendCommand(cmd, payload); 92 | } 93 | 94 | void QAtemDownstreamKey::setFillSource(quint16 source) 95 | { 96 | if(source == m_fillSource) 97 | { 98 | return; 99 | } 100 | 101 | QByteArray cmd("CDsF"); 102 | QByteArray payload(4, 0x0); 103 | QAtem::U16_U8 val; 104 | 105 | payload[0] = static_cast(m_id); 106 | val.u16 = source; 107 | payload[2] = static_cast(val.u8[1]); 108 | payload[3] = static_cast(val.u8[0]); 109 | 110 | m_atemConnection->sendCommand(cmd, payload); 111 | } 112 | 113 | void QAtemDownstreamKey::setKeySource(quint16 source) 114 | { 115 | if(source == m_keySource) 116 | { 117 | return; 118 | } 119 | 120 | QByteArray cmd("CDsC"); 121 | QByteArray payload(4, 0x0); 122 | QAtem::U16_U8 val; 123 | 124 | payload[0] = static_cast(m_id); 125 | val.u16 = source; 126 | payload[2] = static_cast(val.u8[1]); 127 | payload[3] = static_cast(val.u8[0]); 128 | 129 | m_atemConnection->sendCommand(cmd, payload); 130 | } 131 | 132 | void QAtemDownstreamKey::setFrameRate(quint8 frames) 133 | { 134 | if(frames == m_frameRate) 135 | { 136 | return; 137 | } 138 | 139 | QByteArray cmd("CDsR"); 140 | QByteArray payload(4, 0x0); 141 | 142 | payload[0] = static_cast(m_id); 143 | payload[1] = static_cast(frames); 144 | 145 | m_atemConnection->sendCommand(cmd, payload); 146 | } 147 | 148 | void QAtemDownstreamKey::setInvertKey(bool invert) 149 | { 150 | if(invert == m_invertKey) 151 | { 152 | return; 153 | } 154 | 155 | QByteArray cmd("CDsG"); 156 | QByteArray payload(12, 0x0); 157 | 158 | payload[0] = 0x08; 159 | payload[1] = static_cast(m_id); 160 | payload[8] = static_cast(invert); 161 | 162 | m_atemConnection->sendCommand(cmd, payload); 163 | } 164 | 165 | void QAtemDownstreamKey::setPreMultiplied(bool preMultiplied) 166 | { 167 | if(preMultiplied == m_preMultiplied) 168 | { 169 | return; 170 | } 171 | 172 | QByteArray cmd("CDsG"); 173 | QByteArray payload(12, 0x0); 174 | 175 | payload[0] = 0x01; 176 | payload[1] = static_cast(m_id); 177 | payload[2] = preMultiplied; 178 | 179 | m_atemConnection->sendCommand(cmd, payload); 180 | } 181 | 182 | void QAtemDownstreamKey::setClip(float clip) 183 | { 184 | if(qFuzzyCompare(clip, m_clip)) 185 | { 186 | return; 187 | } 188 | 189 | QByteArray cmd("CDsG"); 190 | QByteArray payload(12, 0x0); 191 | QAtem::U16_U8 val; 192 | val.u16 = static_cast(clip * 10); 193 | 194 | payload[0] = 0x02; 195 | payload[1] = static_cast(m_id); 196 | payload[4] = static_cast(val.u8[1]); 197 | payload[5] = static_cast(val.u8[0]); 198 | 199 | m_atemConnection->sendCommand(cmd, payload); 200 | } 201 | 202 | void QAtemDownstreamKey::setGain(float gain) 203 | { 204 | if(qFuzzyCompare(gain, m_gain)) 205 | { 206 | return; 207 | } 208 | 209 | QByteArray cmd("CDsG"); 210 | QByteArray payload(12, 0x0); 211 | QAtem::U16_U8 val; 212 | val.u16 = static_cast(gain * 10); 213 | 214 | payload[0] = 0x04; 215 | payload[1] = static_cast(m_id); 216 | payload[6] = static_cast(val.u8[1]); 217 | payload[7] = static_cast(val.u8[0]); 218 | 219 | m_atemConnection->sendCommand(cmd, payload); 220 | } 221 | 222 | void QAtemDownstreamKey::setEnableMask(bool enable) 223 | { 224 | if(enable == m_enableMask) 225 | { 226 | return; 227 | } 228 | 229 | QByteArray cmd("CDsM"); 230 | QByteArray payload(12, 0x0); 231 | 232 | payload[0] = 0x01; 233 | payload[1] = static_cast(m_id); 234 | payload[2] = enable; 235 | 236 | m_atemConnection->sendCommand(cmd, payload); 237 | } 238 | 239 | void QAtemDownstreamKey::setMask(float top, float bottom, float left, float right) 240 | { 241 | QByteArray cmd("CDsM"); 242 | QByteArray payload(12, 0x0); 243 | 244 | payload[0] = static_cast(0x1e); 245 | payload[1] = static_cast(m_id); 246 | QAtem::U16_U8 val; 247 | val.u16 = static_cast(top * 1000); 248 | payload[4] = static_cast(val.u8[1]); 249 | payload[5] = static_cast(val.u8[0]); 250 | val.u16 = static_cast(bottom * 1000); 251 | payload[6] = static_cast(val.u8[1]); 252 | payload[7] = static_cast(val.u8[0]); 253 | val.u16 = static_cast(left * 1000); 254 | payload[8] = static_cast(val.u8[1]); 255 | payload[9] = static_cast(val.u8[0]); 256 | val.u16 = static_cast(right * 1000); 257 | payload[10] = static_cast(val.u8[1]); 258 | payload[11] = static_cast(val.u8[0]); 259 | 260 | m_atemConnection->sendCommand(cmd, payload); 261 | } 262 | 263 | void QAtemDownstreamKey::onDskS(const QByteArray& payload) 264 | { 265 | quint8 index = static_cast(payload.at(6)); 266 | 267 | if(index == m_id) 268 | { 269 | bool temp_onAir = m_onAir; 270 | bool temp_inTransition = m_inTransition; 271 | bool temp_inAutoTransition = m_inAutoTransition; 272 | quint8 temp_frameCount = m_frameCount; 273 | 274 | m_onAir = payload.at(7); 275 | m_inTransition = payload.at(8); 276 | m_inAutoTransition = payload.at(9); 277 | m_frameCount = static_cast(payload.at(10)); 278 | 279 | if (m_onAir != temp_onAir) 280 | { 281 | emit onAirChanged(m_id, m_onAir); 282 | } 283 | if (m_inTransition != temp_inTransition) 284 | { 285 | emit inTransitionChanged(m_id, m_inTransition); 286 | } 287 | if (m_inAutoTransition != temp_inAutoTransition) 288 | { 289 | emit inAutoTransitionChanged(m_id, m_inAutoTransition); 290 | } 291 | if (m_frameCount != temp_frameCount) 292 | { 293 | emit frameCountChanged(m_id, m_frameCount); 294 | } 295 | } 296 | } 297 | 298 | void QAtemDownstreamKey::onDskP(const QByteArray& payload) 299 | { 300 | quint8 index = static_cast(payload.at(6)); 301 | 302 | if(index == m_id) 303 | { 304 | m_tie = payload.at(7); 305 | m_frameRate = static_cast(payload.at(8)); 306 | m_preMultiplied = payload.at(9); 307 | QAtem::U16_U8 val; 308 | val.u8[1] = static_cast(payload.at(10)); 309 | val.u8[0] = static_cast(payload.at(11)); 310 | m_clip = val.u16 / 10.0f; 311 | val.u8[1] = static_cast(payload.at(12)); 312 | val.u8[0] = static_cast(payload.at(13)); 313 | m_gain = val.u16 / 10.0f; 314 | m_invertKey = payload.at(14); 315 | m_enableMask = payload.at(15); 316 | val.u8[1] = static_cast(payload.at(16)); 317 | val.u8[0] = static_cast(payload.at(17)); 318 | m_topMask = static_cast(val.u16) / 1000.0f; 319 | val.u8[1] = static_cast(payload.at(18)); 320 | val.u8[0] = static_cast(payload.at(19)); 321 | m_bottomMask = static_cast(val.u16) / 1000.0f; 322 | val.u8[1] = static_cast(payload.at(20)); 323 | val.u8[0] = static_cast(payload.at(21)); 324 | m_leftMask = static_cast(val.u16) / 1000.0f; 325 | val.u8[1] = static_cast(payload.at(22)); 326 | val.u8[0] = static_cast(payload.at(23)); 327 | m_rightMask = static_cast(val.u16) / 1000.0f; 328 | 329 | emit tieChanged(m_id, m_tie); 330 | emit frameRateChanged(m_id, m_frameRate); 331 | emit invertKeyChanged(m_id, m_invertKey); 332 | emit preMultipliedChanged(m_id, m_preMultiplied); 333 | emit clipChanged(m_id, m_clip); 334 | emit gainChanged(m_id, m_gain); 335 | emit enableMaskChanged(m_id, m_enableMask); 336 | emit maskChanged(m_id, m_topMask, m_bottomMask, m_leftMask, m_rightMask); 337 | } 338 | } 339 | 340 | void QAtemDownstreamKey::onDskB(const QByteArray& payload) 341 | { 342 | QAtem::U16_U8 val; 343 | quint8 index = static_cast(payload.at(6)); 344 | 345 | if(index == m_id) 346 | { 347 | val.u8[1] = static_cast(payload.at(8)); 348 | val.u8[0] = static_cast(payload.at(9)); 349 | m_fillSource = val.u16; 350 | val.u8[1] = static_cast(payload.at(10)); 351 | val.u8[0] = static_cast(payload.at(11)); 352 | m_keySource = val.u16; 353 | 354 | emit sourcesChanged(m_id, m_fillSource, m_keySource); 355 | } 356 | } 357 | -------------------------------------------------------------------------------- /qatemcameracontrol.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Peter Simonsson 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library. If not, see . 16 | */ 17 | 18 | #include "qatemcameracontrol.h" 19 | #include "qatemconnection.h" 20 | 21 | #define QATEM_LENS 0x00 22 | #define QATEM_CAMERA 0x01 23 | #define QATEM_CHIP 0x08 24 | 25 | #define QATEM_LENS_FOCUS 0x00 26 | #define QATEM_LENS_AUTOFOCUS 0x01 27 | #define QATEM_LENS_IRIS 0x03 28 | #define QATEM_LENS_ZOOM 0x09 29 | 30 | #define QATEM_CAMERA_GAIN 0x01 31 | #define QATEM_CAMERA_WHITE_BALANCE 0x02 32 | #define QATEM_CAMERA_SHUTTER 0x05 33 | 34 | #define QATEM_CHIP_LIFT 0x00 35 | #define QATEM_CHIP_GAMMA 0x01 36 | #define QATEM_CHIP_GAIN 0x02 37 | #define QATEM_CHIP_CONTRAST 0x04 38 | #define QATEM_CHIP_LUM_MIX 0x05 39 | #define QATEM_HUE_SATURATION 0x06 40 | 41 | QAtemCameraControl::QAtemCameraControl(QAtemConnection *parent) : 42 | QObject(parent), m_atemConnection(parent) 43 | { 44 | m_atemConnection->registerCommand("CCdP", this, "onCCdP"); 45 | } 46 | 47 | QAtemCameraControl::~QAtemCameraControl() 48 | { 49 | m_atemConnection->unregisterCommand("CCdP", this); 50 | 51 | qDeleteAll(m_cameras); 52 | } 53 | 54 | void QAtemCameraControl::onCCdP(const QByteArray& payload) 55 | { 56 | quint8 input = static_cast(payload.at(6)); 57 | quint8 adjustmentDomain = static_cast(payload.at(7)); 58 | quint8 feature = static_cast(payload.at(8)); 59 | 60 | if(input == 0) 61 | { 62 | qDebug() << "[onCCdP] Unhandled input:" << input; 63 | return; 64 | } 65 | 66 | if(input >= m_cameras.count()) 67 | { 68 | for(quint8 index = static_cast(m_cameras.count()); index < input; index++) 69 | { 70 | m_cameras.append(new QAtem::Camera(index)); 71 | } 72 | } 73 | 74 | QAtem::Camera *camera = m_cameras[input - 1]; 75 | QAtem::U16_U8 val; 76 | 77 | switch(adjustmentDomain) 78 | { 79 | case 0: //Lens 80 | switch(feature) 81 | { 82 | case 0: //Focus 83 | val.u8[1] = static_cast(payload.at(22)); 84 | val.u8[0] = static_cast(payload.at(23)); 85 | camera->focus = val.u16; 86 | camera->autoFocused = false; 87 | break; 88 | case 1: //Auto focused 89 | camera->autoFocused = true; 90 | break; 91 | case 3: //Iris 92 | val.u8[1] = static_cast(payload.at(22)); 93 | val.u8[0] = static_cast(payload.at(23)); 94 | camera->iris = val.u16; 95 | break; 96 | case 9: //Zoom 97 | val.u8[1] = static_cast(payload.at(22)); 98 | val.u8[0] = static_cast(payload.at(23)); 99 | camera->zoomSpeed = static_cast(val.u16); 100 | break; 101 | default: 102 | qDebug() << "[doCCdP] Unknown lens feature:" << feature; 103 | break; 104 | } 105 | 106 | break; 107 | case 1: //Camera 108 | switch(feature) 109 | { 110 | case 1: //Gain 111 | val.u8[1] = static_cast(payload.at(22)); 112 | val.u8[0] = static_cast(payload.at(23)); 113 | camera->gain = val.u16; 114 | break; 115 | case 2: //White balance 116 | val.u8[1] = static_cast(payload.at(22)); 117 | val.u8[0] = static_cast(payload.at(23)); 118 | camera->whiteBalance = val.u16; 119 | break; 120 | case 5: //Shutter 121 | val.u8[1] = static_cast(payload.at(24)); 122 | val.u8[0] = static_cast(payload.at(25)); 123 | camera->shutter = val.u16; 124 | break; 125 | default: 126 | qDebug() << "[doCCdP] Unknown camera feature:" << feature; 127 | break; 128 | } 129 | 130 | break; 131 | case 8: //Chip 132 | switch(feature) 133 | { 134 | case 0: //Lift 135 | val.u8[1] = static_cast(payload.at(22)); 136 | val.u8[0] = static_cast(payload.at(23)); 137 | camera->liftR = static_cast(val.u16) / 4096.0f; 138 | val.u8[1] = static_cast(payload.at(24)); 139 | val.u8[0] = static_cast(payload.at(25)); 140 | camera->liftB = static_cast(val.u16) / 4096.0f; 141 | val.u8[1] = static_cast(payload.at(26)); 142 | val.u8[0] = static_cast(payload.at(27)); 143 | camera->liftG = static_cast(val.u16) / 4096.0f; 144 | val.u8[1] = static_cast(payload.at(28)); 145 | val.u8[0] = static_cast(payload.at(29)); 146 | camera->liftY = static_cast(val.u16) / 4096.0f; 147 | break; 148 | case 1: //Gamma 149 | val.u8[1] = static_cast(payload.at(22)); 150 | val.u8[0] = static_cast(payload.at(23)); 151 | camera->gammaR = static_cast(val.u16) / 8192.0f; 152 | val.u8[1] = static_cast(payload.at(24)); 153 | val.u8[0] = static_cast(payload.at(25)); 154 | camera->gammaB = static_cast(val.u16) / 8192.0f; 155 | val.u8[1] = static_cast(payload.at(26)); 156 | val.u8[0] = static_cast(payload.at(27)); 157 | camera->gammaG = static_cast(val.u16) / 8192.0f; 158 | val.u8[1] = static_cast(payload.at(28)); 159 | val.u8[0] = static_cast(payload.at(29)); 160 | camera->gammaY = static_cast(val.u16) / 8192.0f; 161 | break; 162 | case 2: //Gain 163 | val.u8[1] = static_cast(payload.at(22)); 164 | val.u8[0] = static_cast(payload.at(23)); 165 | camera->gainR = static_cast(val.u16) / 2048.0f; 166 | val.u8[1] = static_cast(payload.at(24)); 167 | val.u8[0] = static_cast(payload.at(25)); 168 | camera->gainB = static_cast(val.u16) / 2048.0f; 169 | val.u8[1] = static_cast(payload.at(26)); 170 | val.u8[0] = static_cast(payload.at(27)); 171 | camera->gainG = static_cast(val.u16) / 2048.0f; 172 | val.u8[1] = static_cast(payload.at(28)); 173 | val.u8[0] = static_cast(payload.at(29)); 174 | camera->gainY = static_cast(val.u16) / 2048.0f; 175 | break; 176 | case 3: //Aperture 177 | // qDebug() << payload.mid(6).toHex(); 178 | break; 179 | case 4: //Contrast 180 | val.u8[1] = static_cast(payload.at(24)); 181 | val.u8[0] = static_cast(payload.at(25)); 182 | camera->contrast = static_cast(qRound((static_cast(val.u16) / 4096.0) * 100)); 183 | break; 184 | case 5: //Lum 185 | val.u8[1] = static_cast(payload.at(22)); 186 | val.u8[0] = static_cast(payload.at(23)); 187 | camera->lumMix = static_cast(qRound((static_cast(val.u16) / 2048.0) * 100)); 188 | break; 189 | case 6: //Hue & Saturation 190 | val.u8[1] = static_cast(payload.at(22)); 191 | val.u8[0] = static_cast(payload.at(23)); 192 | camera->hue = static_cast(180 + qRound((static_cast(val.u16) / 2048.0) * 180)); 193 | val.u8[1] = static_cast(payload.at(24)); 194 | val.u8[0] = static_cast(payload.at(25)); 195 | camera->saturation = static_cast(qRound((static_cast(val.u16) / 4096.0) * 100)); 196 | break; 197 | default: 198 | qDebug() << "[doCCdP] Unknown chip feature:" << feature; 199 | break; 200 | } 201 | 202 | break; 203 | default: 204 | qDebug() << "[onCCdP] Unknown adjustment domain:" << adjustmentDomain; 205 | } 206 | 207 | emit cameraChanged(input); 208 | } 209 | 210 | void QAtemCameraControl::sendCCmd(quint8 input, quint8 hardware, quint8 command, bool append, quint8 valueType, QList values) 211 | { 212 | if(input < 1) 213 | { 214 | return; 215 | } 216 | 217 | QByteArray cmd("CCmd"); 218 | QByteArray payload(24, 0x0); 219 | 220 | payload[0] = static_cast(input); 221 | payload[1] = static_cast(hardware); 222 | payload[2] = static_cast(command); 223 | payload[3] = append; 224 | payload[4] = static_cast(valueType); 225 | 226 | 227 | int index = 0; 228 | 229 | switch (valueType) 230 | { 231 | case 0x01: 232 | payload[7] = static_cast(values.count()); 233 | foreach(const QAtem::U16_U8 &val, values) 234 | { 235 | payload[16 + 2 * index] = static_cast(val.u8[1]); 236 | payload[17 + 2 * index] = static_cast(val.u8[0]); 237 | index++; 238 | } 239 | break; 240 | case 0x03: 241 | payload[11] = static_cast(values.count()); 242 | foreach(const QAtem::U16_U8 &val, values) 243 | { 244 | payload[18 + 2 * index] = static_cast(val.u8[1]); 245 | payload[19 + 2 * index] = static_cast(val.u8[0]); 246 | index++; 247 | } 248 | break; 249 | case 0x02: 250 | /* fallthrough */ 251 | case 0x80: 252 | payload[9] = static_cast(values.count()); 253 | foreach(const QAtem::U16_U8 &val, values) 254 | { 255 | payload[16 + 2 * index] = static_cast(val.u8[1]); 256 | payload[17 + 2 * index] = static_cast(val.u8[0]); 257 | index++; 258 | } 259 | break; 260 | } 261 | 262 | m_atemConnection->sendCommand(cmd, payload); 263 | } 264 | 265 | void QAtemCameraControl::setFocus(quint8 input, quint16 focus) 266 | { 267 | QAtem::U16_U8 val; 268 | val.u16 = focus; 269 | 270 | sendCCmd(input, QATEM_LENS, QATEM_LENS_FOCUS, false, 0x80, QList() << val); 271 | } 272 | 273 | void QAtemCameraControl::activeAutoFocus(quint8 input) 274 | { 275 | sendCCmd(input, QATEM_LENS, QATEM_LENS_AUTOFOCUS, false, 0x0, QList()); 276 | } 277 | 278 | void QAtemCameraControl::setIris(quint8 input, quint16 iris) 279 | { 280 | QAtem::U16_U8 val; 281 | val.u16 = iris; 282 | 283 | sendCCmd(input, QATEM_LENS, QATEM_LENS_IRIS, false, 0x80, QList() << val); 284 | } 285 | 286 | void QAtemCameraControl::setZoomSpeed(quint8 input, qint16 zoom) 287 | { 288 | QAtem::U16_U8 val; 289 | val.u16 = static_cast(zoom); 290 | 291 | sendCCmd(input, QATEM_LENS, QATEM_LENS_ZOOM, false, 0x80, QList() << val); 292 | } 293 | 294 | void QAtemCameraControl::setGain(quint8 input, quint16 gain) 295 | { 296 | QAtem::U16_U8 val; 297 | val.u16 = gain; 298 | 299 | sendCCmd(input, QATEM_CAMERA, QATEM_CAMERA_GAIN, false, 0x01, QList() << val); 300 | } 301 | 302 | void QAtemCameraControl::setWhiteBalance(quint8 input, quint16 wb) 303 | { 304 | QAtem::U16_U8 val; 305 | val.u16 = wb; 306 | 307 | sendCCmd(input, QATEM_CAMERA, QATEM_CAMERA_WHITE_BALANCE, false, 0x02, QList() << val); 308 | } 309 | 310 | void QAtemCameraControl::setShutter(quint8 input, quint16 shutter) 311 | { 312 | QAtem::U16_U8 val; 313 | val.u16 = shutter; 314 | 315 | sendCCmd(input, QATEM_CAMERA, QATEM_CAMERA_SHUTTER, false, 0x03, QList() << val); 316 | } 317 | 318 | void QAtemCameraControl::setLift(quint8 input, float r, float g, float b, float y) 319 | { 320 | QList values; 321 | QAtem::U16_U8 val; 322 | val.u16 = static_cast(qRound(r * 4096)); 323 | values << val; 324 | val.u16 = static_cast(qRound(g * 4096)); 325 | values << val; 326 | val.u16 = static_cast(qRound(b * 4096)); 327 | values << val; 328 | val.u16 = static_cast(qRound(y * 4096)); 329 | values << val; 330 | 331 | sendCCmd(input, QATEM_CHIP, QATEM_CHIP_LIFT, false, 0x80, values); 332 | } 333 | 334 | void QAtemCameraControl::setGamma(quint8 input, float r, float g, float b, float y) 335 | { 336 | QList values; 337 | QAtem::U16_U8 val; 338 | val.u16 = static_cast(qRound(r * 8192)); 339 | values << val; 340 | val.u16 = static_cast(qRound(g * 8192)); 341 | values << val; 342 | val.u16 = static_cast(qRound(b * 8192)); 343 | values << val; 344 | val.u16 = static_cast(qRound(y * 8192)); 345 | values << val; 346 | 347 | sendCCmd(input, QATEM_CHIP, QATEM_CHIP_GAMMA, false, 0x80, values); 348 | } 349 | 350 | void QAtemCameraControl::setGain(quint8 input, float r, float g, float b, float y) 351 | { 352 | QList values; 353 | QAtem::U16_U8 val; 354 | val.u16 = static_cast(qRound(r * 2048)); 355 | values << val; 356 | val.u16 = static_cast(qRound(g * 2048)); 357 | values << val; 358 | val.u16 = static_cast(qRound(b * 2048)); 359 | values << val; 360 | val.u16 = static_cast(qRound(y * 2048)); 361 | values << val; 362 | 363 | sendCCmd(input, QATEM_CHIP, QATEM_CHIP_GAIN, false, 0x80, values); 364 | } 365 | 366 | void QAtemCameraControl::setContrast(quint8 input, quint8 contrast) 367 | { 368 | QList values; 369 | QAtem::U16_U8 val; 370 | val.u16 = 0x00; 371 | values << val; 372 | val.u16 = static_cast(qRound((contrast / 100.0) * 4096.0)); 373 | values << val; 374 | 375 | sendCCmd(input, QATEM_CHIP, QATEM_CHIP_CONTRAST, false, 0x80, values); 376 | } 377 | 378 | void QAtemCameraControl::setLumMix(quint8 input, quint8 mix) 379 | { 380 | QAtem::U16_U8 val; 381 | val.u16 = static_cast(qRound((mix / 100.0) * 2048.0)); 382 | 383 | sendCCmd(input, QATEM_CHIP, QATEM_CHIP_LUM_MIX, false, 0x80, QList() << val); 384 | } 385 | 386 | void QAtemCameraControl::setHueSaturation(quint8 input, quint16 hue, quint8 saturation) 387 | { 388 | QList values; 389 | QAtem::U16_U8 val; 390 | val.u16 = static_cast(qRound(((hue - 180) / 180.0) * 2048.0)); 391 | values << val; 392 | val.u16 = static_cast(qRound((saturation / 100.0) * 4096.0)); 393 | values << val; 394 | 395 | sendCCmd(input, QATEM_CHIP, QATEM_HUE_SATURATION, false, 0x80, values); 396 | } 397 | -------------------------------------------------------------------------------- /example/qatemswitcher/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | 4 | #include "qatemconnection.h" 5 | #include "qatemmixeffect.h" 6 | #include "qatemdownstreamkey.h" 7 | 8 | #include 9 | #include 10 | 11 | MainWindow::MainWindow(QWidget *parent) : 12 | QMainWindow(parent), 13 | m_ui(new Ui::MainWindow) 14 | { 15 | m_ui->setupUi(this); 16 | 17 | connect(m_ui->action_Quit, SIGNAL(triggered()), 18 | qApp, SLOT(quit())); 19 | 20 | m_atemConnection = new QAtemConnection(this); 21 | 22 | connect(m_atemConnection, &QAtemConnection::connected, 23 | this, &MainWindow::onAtemConnected); 24 | 25 | m_programGroup = new QButtonGroup (this); 26 | m_programGroup->setExclusive(true); 27 | m_programGroup->addButton(m_ui->program1Button, 1); 28 | m_programGroup->addButton(m_ui->program2Button, 2); 29 | m_programGroup->addButton(m_ui->program3Button, 3); 30 | m_programGroup->addButton(m_ui->program4Button, 4); 31 | m_programGroup->addButton(m_ui->program5Button, 5); 32 | m_programGroup->addButton(m_ui->program6Button, 6); 33 | m_programGroup->addButton(m_ui->program7Button, 7); 34 | m_programGroup->addButton(m_ui->program8Button, 8); 35 | 36 | connect(m_programGroup, QOverload::of(&QButtonGroup::buttonClicked), 37 | this, &MainWindow::changeProgramInput); 38 | 39 | m_previewGroup = new QButtonGroup (this); 40 | m_previewGroup->setExclusive(true); 41 | m_previewGroup->addButton(m_ui->preview1Button, 1); 42 | m_previewGroup->addButton(m_ui->preview2Button, 2); 43 | m_previewGroup->addButton(m_ui->preview3Button, 3); 44 | m_previewGroup->addButton(m_ui->preview4Button, 4); 45 | m_previewGroup->addButton(m_ui->preview5Button, 5); 46 | m_previewGroup->addButton(m_ui->preview6Button, 6); 47 | m_previewGroup->addButton(m_ui->preview7Button, 7); 48 | m_previewGroup->addButton(m_ui->preview8Button, 8); 49 | 50 | connect(m_previewGroup, QOverload::of(&QButtonGroup::buttonClicked), 51 | this, &MainWindow::changePreviewInput); 52 | 53 | m_transitionStyleGroup = new QButtonGroup (this); 54 | m_transitionStyleGroup->setExclusive(true); 55 | m_transitionStyleGroup->addButton(m_ui->mixBtn, 0); 56 | m_transitionStyleGroup->addButton(m_ui->dipBtn, 1); 57 | m_transitionStyleGroup->addButton(m_ui->wipeBtn, 2); 58 | m_transitionStyleGroup->addButton(m_ui->dveBtn, 3); 59 | m_transitionStyleGroup->addButton(m_ui->stingBtn, 4); 60 | 61 | connect(m_transitionStyleGroup, QOverload::of(&QButtonGroup::buttonClicked), 62 | this, &MainWindow::changeTransitionStyle); 63 | 64 | m_keysTransitionGroup = new QButtonGroup (this); 65 | m_keysTransitionGroup->setExclusive(false); 66 | m_keysTransitionGroup->addButton(m_ui->bkgdBtn, 0); 67 | m_keysTransitionGroup->addButton(m_ui->key1Btn, 1); 68 | m_keysTransitionGroup->addButton(m_ui->key2Btn, 2); 69 | m_keysTransitionGroup->addButton(m_ui->key3Btn, 3); 70 | m_keysTransitionGroup->addButton(m_ui->key4Btn, 4); 71 | 72 | connect(m_keysTransitionGroup, QOverload::of(&QButtonGroup::buttonToggled), 73 | this, &MainWindow::changeKeysTransition); 74 | 75 | m_keyOnAirGroup = new QButtonGroup(this); 76 | m_keyOnAirGroup->setExclusive(false); 77 | m_keyOnAirGroup->addButton(m_ui->key1OnAirBtn, 0); 78 | m_keyOnAirGroup->addButton(m_ui->key2OnAirBtn, 1); 79 | m_keyOnAirGroup->addButton(m_ui->key3OnAirBtn, 2); 80 | m_keyOnAirGroup->addButton(m_ui->key4OnAirBtn, 3); 81 | 82 | connect(m_keyOnAirGroup, QOverload::of(&QButtonGroup::buttonToggled), 83 | this, &MainWindow::changeKeyOnAir); 84 | 85 | connect(m_ui->dsk1TieButton, &QPushButton::clicked, 86 | this, &MainWindow::toggleDsk1Tie); 87 | connect(m_ui->dsk1OnAirButton, &QPushButton::clicked, 88 | this, &MainWindow::toggleDsk1OnAir); 89 | connect(m_ui->dsk1AutoButton, SIGNAL(clicked()), 90 | this, SLOT(doDsk1Auto())); 91 | connect(m_ui->dsk1AutoButton, &QPushButton::clicked, 92 | this, &MainWindow::doDsk1Auto); 93 | 94 | connect(m_ui->dsk2TieButton, &QPushButton::clicked, 95 | this, &MainWindow::toggleDsk2Tie); 96 | connect(m_ui->dsk2OnAirButton, &QPushButton::clicked, 97 | this, &MainWindow::toggleDsk2OnAir); 98 | connect(m_ui->dsk2AutoButton, &QPushButton::clicked, 99 | this, &MainWindow::doDsk2Auto); 100 | 101 | foreach(QAtemDownstreamKey *dsk, m_atemConnection->downstreamKeys()) 102 | { 103 | connect(dsk, &QAtemDownstreamKey::tieChanged, 104 | this, &MainWindow::updateDskTie); 105 | connect(dsk, &QAtemDownstreamKey::onAirChanged, 106 | this, &MainWindow::updateDskOn); 107 | } 108 | 109 | connectToAtem(); 110 | } 111 | 112 | MainWindow::~MainWindow() 113 | { 114 | delete m_ui; 115 | } 116 | 117 | void MainWindow::connectToAtem() 118 | { 119 | QString address = QInputDialog::getText(this, tr("Connect To ATEM"), tr("Address:")); 120 | 121 | if(!address.isEmpty()) 122 | { 123 | m_atemConnection->connectToSwitcher(QHostAddress(address)); 124 | } 125 | } 126 | 127 | void MainWindow::onAtemConnected() 128 | { 129 | quint8 count = 0; 130 | 131 | foreach(const QAtem::InputInfo &info, m_atemConnection->inputInfos()) 132 | { 133 | if(info.externalType != 0 /*Internal source*/) 134 | { 135 | ++count; 136 | } 137 | } 138 | 139 | m_ui->program7Button->setEnabled(count >= 7); 140 | m_ui->program8Button->setEnabled(count >= 8); 141 | m_ui->preview7Button->setEnabled(count >= 7); 142 | m_ui->preview8Button->setEnabled(count >= 8); 143 | 144 | QAtemMixEffect *me = m_atemConnection->mixEffect(0); 145 | 146 | if(me) 147 | { 148 | m_ui->key2Btn->setEnabled(me->upstreamKeyCount() >= 2); 149 | m_ui->key2OnAirBtn->setEnabled(me->upstreamKeyCount() >= 2); 150 | m_ui->key3Btn->setEnabled(me->upstreamKeyCount() >= 3); 151 | m_ui->key3OnAirBtn->setEnabled(me->upstreamKeyCount() >= 3); 152 | m_ui->key4Btn->setEnabled(me->upstreamKeyCount() >= 4); 153 | m_ui->key4OnAirBtn->setEnabled(me->upstreamKeyCount() >= 4); 154 | m_ui->stingBtn->setEnabled(m_atemConnection->topology().DVEs != 0); 155 | m_ui->dveBtn->setEnabled(m_atemConnection->topology().DVEs != 0); 156 | 157 | connect(m_ui->autoButton, &QPushButton::clicked, 158 | me, &QAtemMixEffect::autoTransition); 159 | connect(m_ui->cutButton, &QPushButton::clicked, 160 | me, &QAtemMixEffect::cut); 161 | 162 | connect(me, &QAtemMixEffect::programInputChanged, 163 | this, &MainWindow::updateProgramInput); 164 | connect(me, &QAtemMixEffect::previewInputChanged, 165 | this, &MainWindow::updatePreviewInput); 166 | 167 | connect(me, &QAtemMixEffect::transitionFrameCountChanged, 168 | this, &MainWindow::setTransitionRate); 169 | connect(me, &QAtemMixEffect::nextTransitionStyleChanged, 170 | this, &MainWindow::setTransitionStyle); 171 | connect(me, &QAtemMixEffect::keyersOnNextTransitionChanged, 172 | this, &MainWindow::updateKeysOnNextTransition); 173 | connect(me, &QAtemMixEffect::transitionPreviewChanged, 174 | this, &MainWindow::updateTransitionPreview); 175 | connect(m_ui->prevTransBtn, &QPushButton::toggled, 176 | me, &QAtemMixEffect::setTransitionPreview); 177 | connect(me, &QAtemMixEffect::transitionPositionChanged, 178 | this, &MainWindow::setTransitionPosition); 179 | connect(m_ui->tBar, &QSlider::valueChanged, 180 | this, &MainWindow::changeTransitionPosition); 181 | 182 | connect(me, &QAtemMixEffect::fadeToBlackFrameCountChanged, 183 | this, &MainWindow::setFadeToBlackRate); 184 | connect(me, &QAtemMixEffect::fadeToBlackChanged, 185 | this, &MainWindow::setFadeToBlack); 186 | connect(m_ui->ftbBtn, &QPushButton::clicked, 187 | me, &QAtemMixEffect::toggleFadeToBlack); 188 | 189 | connect(me, &QAtemMixEffect::upstreamKeyOnAirChanged, 190 | this, &MainWindow::setUpstreamKeyOnAir); 191 | 192 | if(me->programInput() > 0 && me->programInput() <= 8) 193 | { 194 | m_programGroup->button(me->programInput())->setChecked(true); 195 | } 196 | if(me->previewInput() > 0 && me->previewInput() <= 8) 197 | { 198 | m_previewGroup->button(me->previewInput())->setChecked(true); 199 | } 200 | 201 | setTransitionRate(0, me->transitionFrameCount()); 202 | setTransitionStyle(0, me->nextTransitionStyle()); 203 | updateKeysOnNextTransition(0, me->keyersOnNextTransition()); 204 | m_ui->prevTransBtn->setChecked(me->transitionPreviewEnabled()); 205 | 206 | setFadeToBlackRate(0, me->fadeToBlackFrameCount()); 207 | setFadeToBlack(0, me->fadeToBlackFading(), me->fadeToBlackEnabled()); 208 | 209 | for(quint8 i = 0; i < me->upstreamKeyCount(); ++i) 210 | { 211 | setUpstreamKeyOnAir(0, i, me->upstreamKeyOnAir(i)); 212 | } 213 | } 214 | else 215 | { 216 | qCritical() << "No M/E found!"; 217 | } 218 | } 219 | 220 | void MainWindow::changeProgramInput(int input) 221 | { 222 | QAtemMixEffect *me = m_atemConnection->mixEffect(0); 223 | 224 | if(me) 225 | { 226 | me->changeProgramInput(static_cast(input)); 227 | } 228 | else 229 | { 230 | qCritical() << "No M/E found!"; 231 | } 232 | } 233 | 234 | void MainWindow::changePreviewInput(int input) 235 | { 236 | QAtemMixEffect *me = m_atemConnection->mixEffect(0); 237 | 238 | if(me) 239 | { 240 | me->changePreviewInput(static_cast(input)); 241 | } 242 | else 243 | { 244 | qCritical() << "No M/E found!"; 245 | } 246 | } 247 | 248 | void MainWindow::updateProgramInput(quint8 me, quint16 oldInput, quint16 newInput) 249 | { 250 | if(me == 0) 251 | { 252 | if(newInput > 0 && newInput <= 8) 253 | { 254 | m_programGroup->button(newInput)->setChecked(true); 255 | } 256 | else if(oldInput > 0 && oldInput <= 8) 257 | { 258 | m_programGroup->button(oldInput)->setChecked(false); 259 | } 260 | } 261 | } 262 | 263 | void MainWindow::updatePreviewInput(quint8 me, quint16 oldInput, quint16 newInput) 264 | { 265 | if(me == 0) 266 | { 267 | if(newInput > 0 && newInput <= 8) 268 | { 269 | m_previewGroup->button(newInput)->setChecked(true); 270 | } 271 | else if(oldInput > 0 && oldInput <= 8) 272 | { 273 | m_previewGroup->button(oldInput)->setChecked(false); 274 | } 275 | } 276 | } 277 | 278 | void MainWindow::toggleDsk1Tie() 279 | { 280 | m_atemConnection->downstreamKey(0)->setTie(!m_atemConnection->downstreamKey(0)->tie()); 281 | } 282 | 283 | void MainWindow::toggleDsk1OnAir() 284 | { 285 | m_atemConnection->downstreamKey(0)->setOnAir(!m_atemConnection->downstreamKey(0)->onAir()); 286 | } 287 | 288 | void MainWindow::doDsk1Auto() 289 | { 290 | m_atemConnection->downstreamKey(0)->doAuto(); 291 | } 292 | 293 | void MainWindow::toggleDsk2Tie() 294 | { 295 | m_atemConnection->downstreamKey(1)->setTie(!m_atemConnection->downstreamKey(1)->tie()); 296 | } 297 | 298 | void MainWindow::toggleDsk2OnAir() 299 | { 300 | m_atemConnection->downstreamKey(1)->setOnAir(!m_atemConnection->downstreamKey(1)->onAir()); 301 | } 302 | 303 | void MainWindow::doDsk2Auto() 304 | { 305 | m_atemConnection->downstreamKey(1)->doAuto(); 306 | } 307 | 308 | void MainWindow::updateDskTie(quint8 key, bool tie) 309 | { 310 | if (key == 0) 311 | { 312 | m_ui->dsk1TieButton->setChecked(tie); 313 | } 314 | else if (key == 1) 315 | { 316 | m_ui->dsk2TieButton->setChecked(tie); 317 | } 318 | } 319 | 320 | void MainWindow::updateDskOn(quint8 key, bool on) 321 | { 322 | if (key == 0) 323 | { 324 | m_ui->dsk1OnAirButton->setChecked(on); 325 | } 326 | else if (key == 1) 327 | { 328 | m_ui->dsk2OnAirButton->setChecked(on); 329 | } 330 | } 331 | 332 | void MainWindow::setTransitionRate(quint8 me, quint8 rate) 333 | { 334 | Q_UNUSED(me) 335 | 336 | m_ui->transitionRate->display(rate); 337 | } 338 | 339 | void MainWindow::setTransitionStyle(quint8 me, quint8 style) 340 | { 341 | Q_UNUSED(me) 342 | 343 | m_transitionStyleGroup->button(style)->setChecked(true); 344 | } 345 | 346 | void MainWindow::changeTransitionStyle(int style) 347 | { 348 | if (style != m_atemConnection->mixEffect(0)->nextTransitionStyle()) 349 | m_atemConnection->mixEffect(0)->setTransitionType(static_cast(style)); 350 | } 351 | 352 | void MainWindow::updateKeysOnNextTransition(quint8 me, quint8 keyers) 353 | { 354 | Q_UNUSED(me) 355 | 356 | bool state = m_keysTransitionGroup->blockSignals(true); 357 | m_ui->bkgdBtn->setChecked(keyers & 1); 358 | m_ui->key1Btn->setChecked(keyers & (1 << 1)); 359 | m_ui->key2Btn->setChecked(keyers & (1 << 2)); 360 | m_ui->key3Btn->setChecked(keyers & (1 << 3)); 361 | m_ui->key4Btn->setChecked(keyers & (1 << 4)); 362 | m_keysTransitionGroup->blockSignals(state); 363 | } 364 | 365 | void MainWindow::changeKeysTransition(int btn, bool state) 366 | { 367 | if(btn == 0) 368 | { 369 | m_atemConnection->mixEffect(0)->setBackgroundOnNextTransition(state); 370 | } 371 | else 372 | { 373 | m_atemConnection->mixEffect(0)->setUpstreamKeyOnNextTransition(static_cast(btn - 1), state); 374 | } 375 | } 376 | 377 | void MainWindow::setTransitionPosition(quint8 me, quint16 pos) 378 | { 379 | Q_UNUSED(me) 380 | 381 | bool state = m_ui->tBar->blockSignals(true); 382 | 383 | if(m_ui->tBar->value() > 9000 && pos == 0) 384 | { 385 | m_ui->tBar->setInvertedAppearance(!m_ui->tBar->invertedAppearance()); 386 | } 387 | 388 | m_ui->tBar->setValue(pos); 389 | m_ui->tBar->blockSignals(state); 390 | } 391 | 392 | void MainWindow::changeTransitionPosition(int pos) 393 | { 394 | m_atemConnection->mixEffect(0)->setTransitionPosition(pos); 395 | } 396 | 397 | void MainWindow::setFadeToBlackRate(quint8 me, quint8 rate) 398 | { 399 | Q_UNUSED(me) 400 | 401 | m_ui->ftbRate->display(rate); 402 | } 403 | 404 | void MainWindow::setFadeToBlack(quint8 me, bool fading, bool state) 405 | { 406 | Q_UNUSED(me) 407 | 408 | m_ui->ftbBtn->setChecked(fading || state); 409 | } 410 | 411 | void MainWindow::setUpstreamKeyOnAir(quint8 me, quint8 key, bool state) 412 | { 413 | Q_UNUSED(me) 414 | 415 | bool block = m_keyOnAirGroup->blockSignals(true); 416 | m_keyOnAirGroup->button(key)->setChecked(state); 417 | m_keyOnAirGroup->blockSignals(block); 418 | } 419 | 420 | void MainWindow::changeKeyOnAir(int index, bool state) 421 | { 422 | m_atemConnection->mixEffect(0)->setUpstreamKeyOnAir(index, state); 423 | } 424 | 425 | void MainWindow::updateTransitionPreview(quint8 me, bool state) 426 | { 427 | Q_UNUSED(me) 428 | 429 | m_ui->prevTransBtn->setChecked(state); 430 | } 431 | -------------------------------------------------------------------------------- /example/qatemswitcher/mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 1420 10 | 251 11 | 12 | 13 | 14 | QAtemSwitcher 15 | 16 | 17 | 18 | 19 | 20 | 21 | Auto 22 | 23 | 24 | 25 | 26 | 27 | 28 | DSK 1 29 | 30 | 31 | 32 | 33 | 34 | Tie 35 | 36 | 37 | true 38 | 39 | 40 | 41 | 42 | 43 | 44 | On Air 45 | 46 | 47 | true 48 | 49 | 50 | 51 | 52 | 53 | 54 | Auto 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | DSK 2 65 | 66 | 67 | 68 | 69 | 70 | Tie 71 | 72 | 73 | true 74 | 75 | 76 | 77 | 78 | 79 | 80 | On Air 81 | 82 | 83 | true 84 | 85 | 86 | 87 | 88 | 89 | 90 | Auto 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | Next Transition 101 | 102 | 103 | 104 | 105 | 106 | Key 4 107 | 108 | 109 | true 110 | 111 | 112 | 113 | 114 | 115 | 116 | Bkgd 117 | 118 | 119 | true 120 | 121 | 122 | 123 | 124 | 125 | 126 | Key 3 127 | 128 | 129 | true 130 | 131 | 132 | 133 | 134 | 135 | 136 | On Air 137 | 138 | 139 | true 140 | 141 | 142 | 143 | 144 | 145 | 146 | Key 2 147 | 148 | 149 | true 150 | 151 | 152 | 153 | 154 | 155 | 156 | Key 1 157 | 158 | 159 | true 160 | 161 | 162 | 163 | 164 | 165 | 166 | On Air 167 | 168 | 169 | true 170 | 171 | 172 | 173 | 174 | 175 | 176 | On Air 177 | 178 | 179 | true 180 | 181 | 182 | 183 | 184 | 185 | 186 | On Air 187 | 188 | 189 | true 190 | 191 | 192 | 193 | 194 | 195 | 196 | Mix 197 | 198 | 199 | true 200 | 201 | 202 | 203 | 204 | 205 | 206 | Dip 207 | 208 | 209 | true 210 | 211 | 212 | 213 | 214 | 215 | 216 | Wipe 217 | 218 | 219 | true 220 | 221 | 222 | 223 | 224 | 225 | 226 | Sting 227 | 228 | 229 | true 230 | 231 | 232 | 233 | 234 | 235 | 236 | DVE 237 | 238 | 239 | true 240 | 241 | 242 | 243 | 244 | 245 | 246 | Qt::Horizontal 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 10000 257 | 258 | 259 | Qt::Vertical 260 | 261 | 262 | 263 | 264 | 265 | 266 | Preview 267 | 268 | 269 | 270 | 271 | 272 | 1 273 | 274 | 275 | true 276 | 277 | 278 | 279 | 280 | 281 | 282 | 2 283 | 284 | 285 | true 286 | 287 | 288 | 289 | 290 | 291 | 292 | 3 293 | 294 | 295 | true 296 | 297 | 298 | 299 | 300 | 301 | 302 | 4 303 | 304 | 305 | true 306 | 307 | 308 | 309 | 310 | 311 | 312 | 5 313 | 314 | 315 | true 316 | 317 | 318 | 319 | 320 | 321 | 322 | 6 323 | 324 | 325 | true 326 | 327 | 328 | 329 | 330 | 331 | 332 | 7 333 | 334 | 335 | true 336 | 337 | 338 | 339 | 340 | 341 | 342 | 8 343 | 344 | 345 | true 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | Program 356 | 357 | 358 | 359 | 360 | 361 | 1 362 | 363 | 364 | true 365 | 366 | 367 | 368 | 369 | 370 | 371 | 2 372 | 373 | 374 | true 375 | 376 | 377 | 378 | 379 | 380 | 381 | 3 382 | 383 | 384 | true 385 | 386 | 387 | 388 | 389 | 390 | 391 | 4 392 | 393 | 394 | true 395 | 396 | 397 | 398 | 399 | 400 | 401 | 5 402 | 403 | 404 | true 405 | 406 | 407 | 408 | 409 | 410 | 411 | 6 412 | 413 | 414 | true 415 | 416 | 417 | 418 | 419 | 420 | 421 | 7 422 | 423 | 424 | true 425 | 426 | 427 | 428 | 429 | 430 | 431 | 8 432 | 433 | 434 | true 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | Qt::Vertical 445 | 446 | 447 | 448 | 20 449 | 0 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | Prev Trans 458 | 459 | 460 | true 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | Cut 471 | 472 | 473 | 474 | 475 | 476 | 477 | FTB 478 | 479 | 480 | true 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 0 493 | 0 494 | 1420 495 | 33 496 | 497 | 498 | 499 | 500 | &File 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | &Quit 509 | 510 | 511 | Ctrl+Q 512 | 513 | 514 | 515 | 516 | 517 | program1Button 518 | program2Button 519 | program3Button 520 | program4Button 521 | program5Button 522 | program6Button 523 | program7Button 524 | program8Button 525 | preview1Button 526 | preview2Button 527 | preview3Button 528 | preview4Button 529 | preview5Button 530 | preview6Button 531 | preview7Button 532 | preview8Button 533 | 534 | 535 | 536 | 537 | -------------------------------------------------------------------------------- /qatemconnection.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 Peter Simonsson 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library. If not, see . 16 | */ 17 | 18 | #ifndef QATEMCONNECTION_H 19 | #define QATEMCONNECTION_H 20 | 21 | #include "qatemtypes.h" 22 | #include "libqatemcontrol_global.h" 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | class QTimer; 29 | class QHostAddress; 30 | class QAtemMixEffect; 31 | class QAtemCameraControl; 32 | class QAtemDownstreamKey; 33 | 34 | class LIBQATEMCONTROLSHARED_EXPORT QAtemConnection : public QObject 35 | { 36 | Q_OBJECT 37 | friend class QAtemMixEffect; 38 | friend class QAtemCameraControl; 39 | friend class QAtemDownstreamKey; 40 | public: 41 | enum Command 42 | { 43 | Cmd_NoCommand = 0x0, 44 | Cmd_AckRequest = 0x1, 45 | Cmd_HelloPacket = 0x2, 46 | Cmd_Resend = 0x4, 47 | Cmd_Undefined = 0x8, 48 | Cmd_Ack = 0x10 49 | }; 50 | 51 | Q_DECLARE_FLAGS(Commands, Command) 52 | 53 | struct CommandHeader 54 | { 55 | quint8 bitmask; 56 | quint16 size; 57 | quint16 uid; 58 | quint16 ackId; 59 | quint16 packetId; 60 | 61 | CommandHeader() 62 | { 63 | bitmask = size = uid = ackId = packetId = 0; 64 | } 65 | }; 66 | 67 | explicit QAtemConnection(QObject* parent = nullptr); 68 | virtual ~QAtemConnection(); 69 | 70 | QHostAddress address() const { return m_address; } 71 | 72 | bool isConnected() const; 73 | 74 | /// Connect to ATEM switcher at @p address 75 | void connectToSwitcher(const QHostAddress& address, int connectionTimeout = 1000); 76 | void disconnectFromSwitcher(); 77 | 78 | void setDebugEnabled(bool enabled) { m_debugEnabled = enabled; } 79 | bool debugEnabled() const { return m_debugEnabled; } 80 | 81 | /// @returns the tally state of the input @p index. 1 = program, 2 = preview and 3 = both 82 | quint8 tallyByIndex(quint8 index) const; 83 | /// @returns number of tally indexes available 84 | int tallyIndexCount() const { return m_tallyByIndex.count(); } 85 | 86 | /// @returns number of tally channels available 87 | quint16 tallyChannelCount() const { return m_tallyChannelCount; } 88 | 89 | QColor colorGeneratorColor(quint8 generator) const; 90 | 91 | QAtemDownstreamKey *downstreamKey(quint8 id) const; 92 | QVector downstreamKeys() const { return m_downstreamKeys; } 93 | 94 | quint8 mediaPlayerType(quint8 player) const; 95 | quint8 mediaPlayerSelectedStill(quint8 player) const; 96 | quint8 mediaPlayerSelectedClip(quint8 player) const; 97 | /// @returns the current state of the media player @p player 98 | QAtem::MediaPlayerState mediaPlayerState(quint8 player) const { return m_mediaPlayerStates.value(player); } 99 | 100 | quint16 auxSource(quint8 aux) const; 101 | 102 | QString productInformation() const { return m_productInformation; } 103 | quint16 majorVersion() const { return m_majorversion; } 104 | quint16 minorVersion() const { return m_minorversion; } 105 | 106 | /// @returns Info about the input @p index 107 | QAtem::InputInfo inputInfo(quint16 index) const { return m_inputInfos.value(index); } 108 | QMap inputInfos () const { return m_inputInfos; } 109 | 110 | QAtem::MediaInfo stillMediaInfo(quint8 index) const { return m_stillMediaInfos.value(index); } 111 | QAtem::MediaInfo clipMediaInfo(quint8 index) const { return m_clipMediaInfos.value(index); } 112 | QAtem::MediaInfo soundMediaInfo(quint8 index) const { return m_soundMediaInfos.value(index); } 113 | 114 | quint8 multiViewCount() const { return static_cast(m_multiViews.count()); } 115 | QAtem::MultiView *multiView(quint8 index) const; 116 | 117 | QMap availableVideoModes() const { return m_availableVideoModes; } 118 | /// @returns index of the video format in use. 0 = 525i5994, 1 = 625i50, 2 = 525i5994 16:9, 3 = 625i50 16:9, 4 = 720p50, 5 = 720p5994, 6 = 1080i50, 7 = 1080i5994 119 | quint8 videoFormat() const { return m_videoFormat; } 120 | /// @returns type of video down coversion, 0 = Center cut, 1 = Letterbox, 2 = Anamorphic 121 | quint8 videoDownConvertType() const { return m_videoDownConvertType; } 122 | 123 | /// @returns size of clip 1 in the media pool 124 | quint16 mediaPoolClip1Size() const { return m_mediaPoolClip1Size; } 125 | /// @returns size of clip 2 in the media pool 126 | quint16 mediaPoolClip2Size() const { return m_mediaPoolClip2Size; } 127 | 128 | /// @returns number of still banks in the media pool 129 | quint8 mediaPoolStillBankCount() const { return m_mediaPoolStillBankCount; } 130 | /// @returns total number of clip banks in the media pool 131 | quint8 mediaPoolClipBankCount() const { return m_mediaPoolClipBankCount; } 132 | 133 | /// @returns audio input info for input @p index 134 | QAtem::AudioInput audioInput(quint16 index) { return m_audioInputs.value(index); } 135 | QHash audioInputs() { return m_audioInputs; } 136 | /// @return audio tally state for audio input @p index 137 | bool audioTallyState(quint16 index) { return m_audioTally.value(index); } 138 | 139 | /// @returns true if the monitor function is enabled on the audio breakout cable. 140 | bool audioMonitorEnabled() const { return m_audioMonitorEnabled; } 141 | float audioMonitorGain() const { return m_audioMonitorGain; } 142 | bool audioMonitorMuted() const { return m_audioMonitorMuted; } 143 | bool audioMonitorDimmed() const { return m_audioMonitorDimmed; } 144 | /// @returns the audio channel that is solo on monitor out. -1 = None. 145 | qint8 audioMonitorSolo() const { return m_audioMonitorSolo; } 146 | float audioMonitorLevel() const { return m_audioMonitorLevel; } 147 | float audioMasterOutputGain() const { return m_audioMasterOutputGain; } 148 | 149 | QAtem::AudioLevel audioLevel(quint16 index) const { return m_audioLevels.value(index); } 150 | float audioMasterOutputLevelLeft() const { return m_audioMasterOutputLevelLeft;} 151 | float audioMasterOutputLevelRight() const { return m_audioMasterOutputLevelRight;} 152 | float audioMasterOutputPeakLeft() const { return m_audioMasterOutputPeakLeft; } 153 | float audioMasterOutputPeakRight() const { return m_audioMasterOutputPeakRight; } 154 | 155 | quint8 audioChannelCount() const { return m_audioChannelCount; } 156 | bool hasAudioMonitor() const { return m_hasAudioMonitor; } 157 | 158 | /// Aquire the media pool lock with ID @p id. @returns false if the lock is already locked. 159 | bool aquireMediaLock(quint8 id, quint8 index); 160 | /// Unlock the media pool lock with ID @p id. 161 | void unlockMediaLock(quint8 id); 162 | /// @returns the state of the media pool lock with ID @p id. 163 | bool mediaLockState(quint8 id) const { return m_mediaLocks.value(id); } 164 | 165 | void aquireLock(quint8 storeId); 166 | 167 | /** 168 | * @brief Send data to a store in the switcher. 169 | * @param storeId 0 = Still store, 1 = Clip store, 2 = Sound store, 3 = Multiview labels, 255 = Macros 170 | * @param index Index in the store 171 | * @param name Name shown to the user 172 | * @param data Actual pixel or sound data 173 | * @return Returns the ID of the data transfer if success else 0 174 | */ 175 | quint16 sendDataToSwitcher(quint8 storeId, quint8 index, const QByteArray &name, const QByteArray &data); 176 | bool transferActive() const { return m_transferActive; } 177 | quint16 transferId () const { return m_transferId; } 178 | int remainingTransferDataSize() const { return m_transferData.size(); } 179 | quint16 getDataFromSwitcher(quint8 storeId, quint8 index); 180 | QByteArray transferData() const { return m_transferData; } 181 | 182 | /** 183 | * Convert @p image to a QByteArray suitable for sending to the switcher. 184 | * @param image The image to convert 185 | * @param width Width of the frame the image will be converted to 186 | * @param height Height of the frame the image will be converted to 187 | */ 188 | static QByteArray prepImageForSwitcher(QImage &image, const int width, const int height); 189 | 190 | QAtem::Topology topology() const { return m_topology; } 191 | 192 | QAtemMixEffect *mixEffect(quint8 me) const; 193 | 194 | void registerCommand(const QByteArray &command, QObject *object, const QByteArray &slot); 195 | void unregisterCommand(const QByteArray &command, QObject *object); 196 | 197 | /// @returns the power status as a bitmask. Bit 0: Main power on/off, 1: Backup power on/off 198 | quint8 powerStatus() const { return m_powerStatus; } 199 | 200 | QAtemCameraControl *cameraControl() const { return m_cameraControl; } 201 | 202 | QAtem::MacroInfo macroInfo(quint8 index) const { return m_macroInfos.at(index); } 203 | QVector macroInfos () const { return m_macroInfos; } 204 | 205 | QAtem::MacroRunningState macroRunningState() const { return m_macroRunningState; } 206 | bool macroRepeating() const { return m_macroRepeating; } 207 | quint8 runningMacro() const { return m_runningMacro; } 208 | bool macroRecording() const { return m_macroRecording; } 209 | quint8 recordingMacro() const { return m_recordingMacro; } 210 | 211 | public slots: 212 | void saveSettings(); 213 | void clearSettings(); 214 | 215 | void setColorGeneratorColor(quint8 generator, const QColor& color); 216 | 217 | void setMediaPlayerSource(quint8 player, bool clip, quint8 source); 218 | void setMediaPlayerLoop(quint8 player, bool loop); 219 | void setMediaPlayerPlay(quint8 player, bool play); 220 | void mediaPlayerGoToBeginning(quint8 player); 221 | void mediaPlayerGoFrameBackward(quint8 player); 222 | void mediaPlayerGoFrameForward(quint8 player); 223 | 224 | void setAuxSource(quint8 aux, quint16 source); 225 | 226 | /** 227 | * Set the type of input to use. 1 = SDI, 2 = HMDI, 4 = Component. 228 | * On TVS input 3 and 4 are selectable between HDMI and SDI. 229 | * On 1 M/E input 1 is selectable between HDMI and component. 230 | */ 231 | void setInputType(quint16 input, quint8 type); 232 | void setInputLongName(quint16 input, const QString& name); 233 | void setInputShortName(quint16 input, const QString& name); 234 | 235 | void setVideoFormat(quint8 format); 236 | /// Set type of video down conversion to @p type. 0 = Center cut, 1 = Letterbox, 2 = Anamorphic 237 | void setVideoDownConvertType(quint8 type); 238 | 239 | /// Sets the size of media pool clip 1 to @p size, max is mediaPoolClipBankCount(). Clip 2 size will be mediaPoolClipBankCount() - @p size. 240 | void setMediaPoolClipSplit(quint16 size); 241 | 242 | /// Sets the layout of multi viewer @p multiView to @p layout. 243 | void setMultiViewLayout(quint8 multiView, quint8 layout); 244 | void setMultiViewInput(quint8 multiView, quint8 windowIndex, quint16 source); 245 | 246 | /// Set to true if you want audio data from the mixer 247 | void setAudioLevelsEnabled(bool enabled); 248 | /// Set the state of the audio input. 0 = Off, 1 = On, 2 = AFV 249 | void setAudioInputState(quint16 index, quint8 state); 250 | /// Set the balance of the audio input. @p balance is a value between -1.0 and +1.0. 251 | void setAudioInputBalance(quint16 index, float balance); 252 | /// Set the gain of the audio input @p index. @p left and @p right is between +6dB and -60dB (-infdB) 253 | void setAudioInputGain(quint16 index, float gain); 254 | /// Set the gain of the audio master output. @p left and @p right is between +6dB and -60dB (-infdB) 255 | void setAudioMasterOutputGain(float gain); 256 | /// Enables audio monitoring using the breakout cable. 257 | void setAudioMonitorEnabled(bool enabled); 258 | /// Set the gain of the audio monitor output. @p gain is between +6dB and -60dB (-infdB) 259 | void setAudioMonitorGain(float gain); 260 | void setAudioMonitorMuted(bool muted); 261 | void setAudioMonitorDimmed(bool dimmed); 262 | void setAudioMonitorSolo(qint8 solo); 263 | void resetAudioMasterOutputPeaks(); 264 | void resetAudioInputPeaks(quint16 input); 265 | 266 | void runMacro(quint8 macroIndex); 267 | void setMacroRepeating(bool state); 268 | void startRecordingMacro(quint8 macroIndex, const QByteArray &name, const QByteArray &description); 269 | void stopRecordingMacro(); 270 | void addMacroUserWait(); 271 | void addMacroPause(quint32 frames); 272 | void setMacroName(quint8 macroIndex, const QByteArray &name); 273 | void setMacroDescription(quint8 macroIndex, const QByteArray &description); 274 | void removeMacro(quint8 macroIndex); 275 | void continueMacro(); 276 | void stopMacro(); 277 | 278 | protected slots: 279 | void handleSocketData(); 280 | 281 | void handleError(QAbstractSocket::SocketError); 282 | void handleConnectionTimeout(); 283 | void emitConnectedSignal(); 284 | 285 | void onTlIn(const QByteArray& payload); 286 | void onColV(const QByteArray& payload); 287 | void onMPCE(const QByteArray& payload); 288 | void onAuxS(const QByteArray& payload); 289 | void on_pin(const QByteArray& payload); 290 | void on_ver(const QByteArray& payload); 291 | void onInPr(const QByteArray& payload); 292 | void onMPSE(const QByteArray& payload); 293 | void onMPfe(const QByteArray& payload); 294 | void onMPCS(const QByteArray& payload); 295 | void onMvIn(const QByteArray& payload); 296 | void onMvPr(const QByteArray& payload); 297 | void onVidM(const QByteArray& payload); 298 | void onTime(const QByteArray& payload); 299 | void onDcOt(const QByteArray& payload); 300 | void onAMmO(const QByteArray& payload); 301 | void onMPSp(const QByteArray& payload); 302 | void onRCPS(const QByteArray& payload); 303 | void onAMLv(const QByteArray& payload); 304 | void onAMTl(const QByteArray& payload); 305 | void onAMIP(const QByteArray& payload); 306 | void onAMMO(const QByteArray& payload); 307 | void onLKST(const QByteArray& payload); 308 | void onFTCD(const QByteArray& payload); 309 | void onFTDC(const QByteArray& payload); 310 | void on_top(const QByteArray& payload); 311 | void onPowr(const QByteArray& payload); 312 | void onVMC(const QByteArray& payload); 313 | void onWarn(const QByteArray& payload); 314 | void on_mpl(const QByteArray& payload); 315 | void on_TlC(const QByteArray& payload); 316 | void onTlSr(const QByteArray& payload); 317 | void on_AMC(const QByteArray& payload); 318 | void onMPAS(const QByteArray& payload); 319 | void onMPfM(const QByteArray& payload); 320 | void onAuxP(const QByteArray& payload); 321 | void onMPrp(const QByteArray& payload); 322 | void onMRPr(const QByteArray& payload); 323 | void onMRcS(const QByteArray& payload); 324 | void on_MAC(const QByteArray& payload); 325 | void onFTDa(const QByteArray& payload); 326 | void onFTDE(const QByteArray& payload); 327 | void onLKOB(const QByteArray& payload); 328 | 329 | void initDownloadToSwitcher(); 330 | void flushTransferBuffer(quint8 count); 331 | void acceptData(); 332 | 333 | protected: 334 | QByteArray createCommandHeader(Commands bitmask, quint16 payloadSize, quint16 uid, quint16 ackId); 335 | 336 | QAtemConnection::CommandHeader parseCommandHeader(const QByteArray& datagram) const; 337 | void parsePayLoad(const QByteArray& datagram); 338 | 339 | bool sendDatagram(const QByteArray& datagram); 340 | bool sendCommand(const QByteArray& cmd, const QByteArray &payload); 341 | 342 | void initCommandSlotHash(); 343 | 344 | void sendData(quint16 id, const QByteArray &data); 345 | void sendFileDescription(); 346 | void requestData(); 347 | 348 | static float convertToDecibel(quint16 level); 349 | static quint16 convertFromDecibel(float level); 350 | 351 | void setInitialized(bool state); 352 | 353 | private: 354 | struct ObjectSlot 355 | { 356 | ObjectSlot(QObject *o, const QByteArray &s) : object(o), slot(s) {} 357 | 358 | inline bool operator ==(const ObjectSlot &b) const 359 | { 360 | return (b.object == object && b.slot == slot); 361 | } 362 | 363 | QObject *object; 364 | QByteArray slot; 365 | }; 366 | 367 | QUdpSocket* m_socket; 368 | QTimer* m_connectionTimer; 369 | 370 | QHostAddress m_address; 371 | quint16 m_port; 372 | 373 | quint16 m_packetCounter; 374 | bool m_isInitialized; 375 | quint16 m_currentUid; 376 | 377 | QMultiHash m_commandSlotHash; 378 | 379 | bool m_debugEnabled; 380 | 381 | QVector m_mixEffects; 382 | 383 | QVector m_tallyByIndex; 384 | 385 | quint16 m_tallyChannelCount; 386 | 387 | QVector m_downstreamKeys; 388 | 389 | QHash m_colorGeneratorColors; 390 | 391 | QHash m_mediaPlayerType; 392 | QHash m_mediaPlayerSelectedStill; 393 | QHash m_mediaPlayerSelectedClip; 394 | QHash m_mediaPlayerStates; 395 | 396 | QHash m_auxSource; 397 | 398 | QString m_productInformation; 399 | quint16 m_majorversion; 400 | quint16 m_minorversion; 401 | 402 | QMap m_inputInfos; 403 | 404 | QHash m_stillMediaInfos; 405 | QHash m_clipMediaInfos; 406 | QHash m_soundMediaInfos; 407 | 408 | QVector m_multiViews; 409 | 410 | quint8 m_videoFormat; 411 | quint8 m_videoDownConvertType; 412 | 413 | quint16 m_mediaPoolClip1Size; 414 | quint16 m_mediaPoolClip2Size; 415 | quint8 m_mediaPoolStillBankCount; 416 | quint8 m_mediaPoolClipBankCount; 417 | 418 | QHash m_audioInputs; 419 | QHash m_audioTally; 420 | QHash m_audioLevels; 421 | 422 | bool m_audioMonitorEnabled; 423 | float m_audioMonitorGain; 424 | bool m_audioMonitorDimmed; 425 | bool m_audioMonitorMuted; 426 | qint8 m_audioMonitorSolo; 427 | float m_audioMonitorLevel; 428 | 429 | float m_audioMasterOutputLevelLeft; 430 | float m_audioMasterOutputLevelRight; 431 | float m_audioMasterOutputPeakLeft; 432 | float m_audioMasterOutputPeakRight; 433 | float m_audioMasterOutputGain; 434 | 435 | quint8 m_audioChannelCount; 436 | bool m_hasAudioMonitor; 437 | 438 | QHash m_mediaLocks; 439 | 440 | bool m_transferActive; 441 | QByteArray m_transferData; 442 | quint8 m_transferStoreId; 443 | quint8 m_transferIndex; 444 | QByteArray m_transferName; 445 | quint16 m_transferId; 446 | quint16 m_lastTransferId; 447 | QByteArray m_transferHash; 448 | 449 | QAtem::Topology m_topology; 450 | 451 | quint8 m_powerStatus; 452 | 453 | QMap m_availableVideoModes; 454 | 455 | QAtemCameraControl *m_cameraControl; 456 | 457 | QVector m_macroInfos; 458 | QAtem::MacroRunningState m_macroRunningState; 459 | bool m_macroRepeating; 460 | quint8 m_runningMacro; 461 | bool m_macroRecording; 462 | quint8 m_recordingMacro; 463 | 464 | signals: 465 | void connected(); 466 | void disconnected(); 467 | void socketError(const QString& errorString); 468 | 469 | void switcherWarning(const QString &warningString); 470 | 471 | void tallyStatesChanged(); 472 | 473 | void colorGeneratorColorChanged(quint8 generator, const QColor& color); 474 | 475 | void mediaPlayerChanged(quint8 player, quint8 type, quint8 still, quint8 clip); 476 | void mediaPlayerStateChanged(quint8 player, const QAtem::MediaPlayerState& state); 477 | 478 | void auxSourceChanged(quint8 aux, quint16 source); 479 | 480 | void inputInfoChanged(const QAtem::InputInfo& info); 481 | 482 | void mediaInfoChanged(const QAtem::MediaInfo& info); 483 | 484 | void productInformationChanged(const QString& info); 485 | void versionChanged(quint16 major, quint16 minor); 486 | 487 | void timeChanged(quint32 time); 488 | 489 | void videoFormatChanged(quint8 format); 490 | void videoDownConvertTypeChanged(quint8 type); 491 | 492 | void mediaPoolClip1SizeChanged(quint16 size); 493 | void mediaPoolClip2SizeChanged(quint16 size); 494 | 495 | void audioInputChanged(quint8 index, const QAtem::AudioInput& input); 496 | void audioMonitorEnabledChanged(bool enabled); 497 | void audioMonitorGainChanged(float gain); 498 | void audioMonitorMutedChanged(bool muted); 499 | void audioMonitorDimmedChanged(bool dimmed); 500 | void audioMonitorSoloChanged(qint8 solo); 501 | void audioMasterOutputGainChanged(float gain); 502 | void audioLevelsChanged(); 503 | 504 | void mediaLockStateChanged(quint8 id, bool state); 505 | void getLockStateChanged(quint8 storeId, bool state); 506 | 507 | void dataTransferFinished(quint16 transferId); 508 | 509 | void topologyChanged(const QAtem::Topology &topology); 510 | 511 | void powerStatusChanged(quint8 status); 512 | 513 | void multiViewLayoutChanged(quint8 multiView, quint8 layout); 514 | void multiViewInputsChanged(quint8 multiView); 515 | 516 | void macroInfoChanged(quint8 index, const QAtem::MacroInfo &info); 517 | void macroRunningStateChanged(QAtem::MacroRunningState running, bool repeating, quint8 macroIndex); 518 | void macroRecordingStateChanged(bool recording, quint8 macroIndex); 519 | }; 520 | 521 | Q_DECLARE_OPERATORS_FOR_FLAGS(QAtemConnection::Commands) 522 | 523 | #endif //QATEMCONNECTION_H 524 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 2.1, February 1999 3 | 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | [This is the first released version of the Lesser GPL. It also counts 10 | as the successor of the GNU Library Public License, version 2, hence 11 | the version number 2.1.] 12 | 13 | Preamble 14 | 15 | The licenses for most software are designed to take away your 16 | freedom to share and change it. By contrast, the GNU General Public 17 | Licenses are intended to guarantee your freedom to share and change 18 | free software--to make sure the software is free for all its users. 19 | 20 | This license, the Lesser General Public License, applies to some 21 | specially designated software packages--typically libraries--of the 22 | Free Software Foundation and other authors who decide to use it. You 23 | can use it too, but we suggest you first think carefully about whether 24 | this license or the ordinary General Public License is the better 25 | strategy to use in any particular case, based on the explanations below. 26 | 27 | When we speak of free software, we are referring to freedom of use, 28 | not price. Our General Public Licenses are designed to make sure that 29 | you have the freedom to distribute copies of free software (and charge 30 | for this service if you wish); that you receive source code or can get 31 | it if you want it; that you can change the software and use pieces of 32 | it in new free programs; and that you are informed that you can do 33 | these things. 34 | 35 | To protect your rights, we need to make restrictions that forbid 36 | distributors to deny you these rights or to ask you to surrender these 37 | rights. These restrictions translate to certain responsibilities for 38 | you if you distribute copies of the library or if you modify it. 39 | 40 | For example, if you distribute copies of the library, whether gratis 41 | or for a fee, you must give the recipients all the rights that we gave 42 | you. You must make sure that they, too, receive or can get the source 43 | code. If you link other code with the library, you must provide 44 | complete object files to the recipients, so that they can relink them 45 | with the library after making changes to the library and recompiling 46 | it. And you must show them these terms so they know their rights. 47 | 48 | We protect your rights with a two-step method: (1) we copyright the 49 | library, and (2) we offer you this license, which gives you legal 50 | permission to copy, distribute and/or modify the library. 51 | 52 | To protect each distributor, we want to make it very clear that 53 | there is no warranty for the free library. Also, if the library is 54 | modified by someone else and passed on, the recipients should know 55 | that what they have is not the original version, so that the original 56 | author's reputation will not be affected by problems that might be 57 | introduced by others. 58 | 59 | Finally, software patents pose a constant threat to the existence of 60 | any free program. We wish to make sure that a company cannot 61 | effectively restrict the users of a free program by obtaining a 62 | restrictive license from a patent holder. Therefore, we insist that 63 | any patent license obtained for a version of the library must be 64 | consistent with the full freedom of use specified in this license. 65 | 66 | Most GNU software, including some libraries, is covered by the 67 | ordinary GNU General Public License. This license, the GNU Lesser 68 | General Public License, applies to certain designated libraries, and 69 | is quite different from the ordinary General Public License. We use 70 | this license for certain libraries in order to permit linking those 71 | libraries into non-free programs. 72 | 73 | When a program is linked with a library, whether statically or using 74 | a shared library, the combination of the two is legally speaking a 75 | combined work, a derivative of the original library. The ordinary 76 | General Public License therefore permits such linking only if the 77 | entire combination fits its criteria of freedom. The Lesser General 78 | Public License permits more lax criteria for linking other code with 79 | the library. 80 | 81 | We call this license the "Lesser" General Public License because it 82 | does Less to protect the user's freedom than the ordinary General 83 | Public License. It also provides other free software developers Less 84 | of an advantage over competing non-free programs. These disadvantages 85 | are the reason we use the ordinary General Public License for many 86 | libraries. However, the Lesser license provides advantages in certain 87 | special circumstances. 88 | 89 | For example, on rare occasions, there may be a special need to 90 | encourage the widest possible use of a certain library, so that it becomes 91 | a de-facto standard. To achieve this, non-free programs must be 92 | allowed to use the library. A more frequent case is that a free 93 | library does the same job as widely used non-free libraries. In this 94 | case, there is little to gain by limiting the free library to free 95 | software only, so we use the Lesser General Public License. 96 | 97 | In other cases, permission to use a particular library in non-free 98 | programs enables a greater number of people to use a large body of 99 | free software. For example, permission to use the GNU C Library in 100 | non-free programs enables many more people to use the whole GNU 101 | operating system, as well as its variant, the GNU/Linux operating 102 | system. 103 | 104 | Although the Lesser General Public License is Less protective of the 105 | users' freedom, it does ensure that the user of a program that is 106 | linked with the Library has the freedom and the wherewithal to run 107 | that program using a modified version of the Library. 108 | 109 | The precise terms and conditions for copying, distribution and 110 | modification follow. Pay close attention to the difference between a 111 | "work based on the library" and a "work that uses the library". The 112 | former contains code derived from the library, whereas the latter must 113 | be combined with the library in order to run. 114 | 115 | GNU LESSER GENERAL PUBLIC LICENSE 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 117 | 118 | 0. This License Agreement applies to any software library or other 119 | program which contains a notice placed by the copyright holder or 120 | other authorized party saying it may be distributed under the terms of 121 | this Lesser General Public License (also called "this License"). 122 | Each licensee is addressed as "you". 123 | 124 | A "library" means a collection of software functions and/or data 125 | prepared so as to be conveniently linked with application programs 126 | (which use some of those functions and data) to form executables. 127 | 128 | The "Library", below, refers to any such software library or work 129 | which has been distributed under these terms. A "work based on the 130 | Library" means either the Library or any derivative work under 131 | copyright law: that is to say, a work containing the Library or a 132 | portion of it, either verbatim or with modifications and/or translated 133 | straightforwardly into another language. (Hereinafter, translation is 134 | included without limitation in the term "modification".) 135 | 136 | "Source code" for a work means the preferred form of the work for 137 | making modifications to it. For a library, complete source code means 138 | all the source code for all modules it contains, plus any associated 139 | interface definition files, plus the scripts used to control compilation 140 | and installation of the library. 141 | 142 | Activities other than copying, distribution and modification are not 143 | covered by this License; they are outside its scope. The act of 144 | running a program using the Library is not restricted, and output from 145 | such a program is covered only if its contents constitute a work based 146 | on the Library (independent of the use of the Library in a tool for 147 | writing it). Whether that is true depends on what the Library does 148 | and what the program that uses the Library does. 149 | 150 | 1. You may copy and distribute verbatim copies of the Library's 151 | complete source code as you receive it, in any medium, provided that 152 | you conspicuously and appropriately publish on each copy an 153 | appropriate copyright notice and disclaimer of warranty; keep intact 154 | all the notices that refer to this License and to the absence of any 155 | warranty; and distribute a copy of this License along with the 156 | Library. 157 | 158 | You may charge a fee for the physical act of transferring a copy, 159 | and you may at your option offer warranty protection in exchange for a 160 | fee. 161 | 162 | 2. You may modify your copy or copies of the Library or any portion 163 | of it, thus forming a work based on the Library, and copy and 164 | distribute such modifications or work under the terms of Section 1 165 | above, provided that you also meet all of these conditions: 166 | 167 | a) The modified work must itself be a software library. 168 | 169 | b) You must cause the files modified to carry prominent notices 170 | stating that you changed the files and the date of any change. 171 | 172 | c) You must cause the whole of the work to be licensed at no 173 | charge to all third parties under the terms of this License. 174 | 175 | d) If a facility in the modified Library refers to a function or a 176 | table of data to be supplied by an application program that uses 177 | the facility, other than as an argument passed when the facility 178 | is invoked, then you must make a good faith effort to ensure that, 179 | in the event an application does not supply such function or 180 | table, the facility still operates, and performs whatever part of 181 | its purpose remains meaningful. 182 | 183 | (For example, a function in a library to compute square roots has 184 | a purpose that is entirely well-defined independent of the 185 | application. Therefore, Subsection 2d requires that any 186 | application-supplied function or table used by this function must 187 | be optional: if the application does not supply it, the square 188 | root function must still compute square roots.) 189 | 190 | These requirements apply to the modified work as a whole. If 191 | identifiable sections of that work are not derived from the Library, 192 | and can be reasonably considered independent and separate works in 193 | themselves, then this License, and its terms, do not apply to those 194 | sections when you distribute them as separate works. But when you 195 | distribute the same sections as part of a whole which is a work based 196 | on the Library, the distribution of the whole must be on the terms of 197 | this License, whose permissions for other licensees extend to the 198 | entire whole, and thus to each and every part regardless of who wrote 199 | it. 200 | 201 | Thus, it is not the intent of this section to claim rights or contest 202 | your rights to work written entirely by you; rather, the intent is to 203 | exercise the right to control the distribution of derivative or 204 | collective works based on the Library. 205 | 206 | In addition, mere aggregation of another work not based on the Library 207 | with the Library (or with a work based on the Library) on a volume of 208 | a storage or distribution medium does not bring the other work under 209 | the scope of this License. 210 | 211 | 3. You may opt to apply the terms of the ordinary GNU General Public 212 | License instead of this License to a given copy of the Library. To do 213 | this, you must alter all the notices that refer to this License, so 214 | that they refer to the ordinary GNU General Public License, version 2, 215 | instead of to this License. (If a newer version than version 2 of the 216 | ordinary GNU General Public License has appeared, then you can specify 217 | that version instead if you wish.) Do not make any other change in 218 | these notices. 219 | 220 | Once this change is made in a given copy, it is irreversible for 221 | that copy, so the ordinary GNU General Public License applies to all 222 | subsequent copies and derivative works made from that copy. 223 | 224 | This option is useful when you wish to copy part of the code of 225 | the Library into a program that is not a library. 226 | 227 | 4. You may copy and distribute the Library (or a portion or 228 | derivative of it, under Section 2) in object code or executable form 229 | under the terms of Sections 1 and 2 above provided that you accompany 230 | it with the complete corresponding machine-readable source code, which 231 | must be distributed under the terms of Sections 1 and 2 above on a 232 | medium customarily used for software interchange. 233 | 234 | If distribution of object code is made by offering access to copy 235 | from a designated place, then offering equivalent access to copy the 236 | source code from the same place satisfies the requirement to 237 | distribute the source code, even though third parties are not 238 | compelled to copy the source along with the object code. 239 | 240 | 5. A program that contains no derivative of any portion of the 241 | Library, but is designed to work with the Library by being compiled or 242 | linked with it, is called a "work that uses the Library". Such a 243 | work, in isolation, is not a derivative work of the Library, and 244 | therefore falls outside the scope of this License. 245 | 246 | However, linking a "work that uses the Library" with the Library 247 | creates an executable that is a derivative of the Library (because it 248 | contains portions of the Library), rather than a "work that uses the 249 | library". The executable is therefore covered by this License. 250 | Section 6 states terms for distribution of such executables. 251 | 252 | When a "work that uses the Library" uses material from a header file 253 | that is part of the Library, the object code for the work may be a 254 | derivative work of the Library even though the source code is not. 255 | Whether this is true is especially significant if the work can be 256 | linked without the Library, or if the work is itself a library. The 257 | threshold for this to be true is not precisely defined by law. 258 | 259 | If such an object file uses only numerical parameters, data 260 | structure layouts and accessors, and small macros and small inline 261 | functions (ten lines or less in length), then the use of the object 262 | file is unrestricted, regardless of whether it is legally a derivative 263 | work. (Executables containing this object code plus portions of the 264 | Library will still fall under Section 6.) 265 | 266 | Otherwise, if the work is a derivative of the Library, you may 267 | distribute the object code for the work under the terms of Section 6. 268 | Any executables containing that work also fall under Section 6, 269 | whether or not they are linked directly with the Library itself. 270 | 271 | 6. As an exception to the Sections above, you may also combine or 272 | link a "work that uses the Library" with the Library to produce a 273 | work containing portions of the Library, and distribute that work 274 | under terms of your choice, provided that the terms permit 275 | modification of the work for the customer's own use and reverse 276 | engineering for debugging such modifications. 277 | 278 | You must give prominent notice with each copy of the work that the 279 | Library is used in it and that the Library and its use are covered by 280 | this License. You must supply a copy of this License. If the work 281 | during execution displays copyright notices, you must include the 282 | copyright notice for the Library among them, as well as a reference 283 | directing the user to the copy of this License. Also, you must do one 284 | of these things: 285 | 286 | a) Accompany the work with the complete corresponding 287 | machine-readable source code for the Library including whatever 288 | changes were used in the work (which must be distributed under 289 | Sections 1 and 2 above); and, if the work is an executable linked 290 | with the Library, with the complete machine-readable "work that 291 | uses the Library", as object code and/or source code, so that the 292 | user can modify the Library and then relink to produce a modified 293 | executable containing the modified Library. (It is understood 294 | that the user who changes the contents of definitions files in the 295 | Library will not necessarily be able to recompile the application 296 | to use the modified definitions.) 297 | 298 | b) Use a suitable shared library mechanism for linking with the 299 | Library. A suitable mechanism is one that (1) uses at run time a 300 | copy of the library already present on the user's computer system, 301 | rather than copying library functions into the executable, and (2) 302 | will operate properly with a modified version of the library, if 303 | the user installs one, as long as the modified version is 304 | interface-compatible with the version that the work was made with. 305 | 306 | c) Accompany the work with a written offer, valid for at 307 | least three years, to give the same user the materials 308 | specified in Subsection 6a, above, for a charge no more 309 | than the cost of performing this distribution. 310 | 311 | d) If distribution of the work is made by offering access to copy 312 | from a designated place, offer equivalent access to copy the above 313 | specified materials from the same place. 314 | 315 | e) Verify that the user has already received a copy of these 316 | materials or that you have already sent this user a copy. 317 | 318 | For an executable, the required form of the "work that uses the 319 | Library" must include any data and utility programs needed for 320 | reproducing the executable from it. However, as a special exception, 321 | the materials to be distributed need not include anything that is 322 | normally distributed (in either source or binary form) with the major 323 | components (compiler, kernel, and so on) of the operating system on 324 | which the executable runs, unless that component itself accompanies 325 | the executable. 326 | 327 | It may happen that this requirement contradicts the license 328 | restrictions of other proprietary libraries that do not normally 329 | accompany the operating system. Such a contradiction means you cannot 330 | use both them and the Library together in an executable that you 331 | distribute. 332 | 333 | 7. You may place library facilities that are a work based on the 334 | Library side-by-side in a single library together with other library 335 | facilities not covered by this License, and distribute such a combined 336 | library, provided that the separate distribution of the work based on 337 | the Library and of the other library facilities is otherwise 338 | permitted, and provided that you do these two things: 339 | 340 | a) Accompany the combined library with a copy of the same work 341 | based on the Library, uncombined with any other library 342 | facilities. This must be distributed under the terms of the 343 | Sections above. 344 | 345 | b) Give prominent notice with the combined library of the fact 346 | that part of it is a work based on the Library, and explaining 347 | where to find the accompanying uncombined form of the same work. 348 | 349 | 8. You may not copy, modify, sublicense, link with, or distribute 350 | the Library except as expressly provided under this License. Any 351 | attempt otherwise to copy, modify, sublicense, link with, or 352 | distribute the Library is void, and will automatically terminate your 353 | rights under this License. However, parties who have received copies, 354 | or rights, from you under this License will not have their licenses 355 | terminated so long as such parties remain in full compliance. 356 | 357 | 9. You are not required to accept this License, since you have not 358 | signed it. However, nothing else grants you permission to modify or 359 | distribute the Library or its derivative works. These actions are 360 | prohibited by law if you do not accept this License. Therefore, by 361 | modifying or distributing the Library (or any work based on the 362 | Library), you indicate your acceptance of this License to do so, and 363 | all its terms and conditions for copying, distributing or modifying 364 | the Library or works based on it. 365 | 366 | 10. Each time you redistribute the Library (or any work based on the 367 | Library), the recipient automatically receives a license from the 368 | original licensor to copy, distribute, link with or modify the Library 369 | subject to these terms and conditions. You may not impose any further 370 | restrictions on the recipients' exercise of the rights granted herein. 371 | You are not responsible for enforcing compliance by third parties with 372 | this License. 373 | 374 | 11. If, as a consequence of a court judgment or allegation of patent 375 | infringement or for any other reason (not limited to patent issues), 376 | conditions are imposed on you (whether by court order, agreement or 377 | otherwise) that contradict the conditions of this License, they do not 378 | excuse you from the conditions of this License. If you cannot 379 | distribute so as to satisfy simultaneously your obligations under this 380 | License and any other pertinent obligations, then as a consequence you 381 | may not distribute the Library at all. For example, if a patent 382 | license would not permit royalty-free redistribution of the Library by 383 | all those who receive copies directly or indirectly through you, then 384 | the only way you could satisfy both it and this License would be to 385 | refrain entirely from distribution of the Library. 386 | 387 | If any portion of this section is held invalid or unenforceable under any 388 | particular circumstance, the balance of the section is intended to apply, 389 | and the section as a whole is intended to apply in other circumstances. 390 | 391 | It is not the purpose of this section to induce you to infringe any 392 | patents or other property right claims or to contest validity of any 393 | such claims; this section has the sole purpose of protecting the 394 | integrity of the free software distribution system which is 395 | implemented by public license practices. Many people have made 396 | generous contributions to the wide range of software distributed 397 | through that system in reliance on consistent application of that 398 | system; it is up to the author/donor to decide if he or she is willing 399 | to distribute software through any other system and a licensee cannot 400 | impose that choice. 401 | 402 | This section is intended to make thoroughly clear what is believed to 403 | be a consequence of the rest of this License. 404 | 405 | 12. If the distribution and/or use of the Library is restricted in 406 | certain countries either by patents or by copyrighted interfaces, the 407 | original copyright holder who places the Library under this License may add 408 | an explicit geographical distribution limitation excluding those countries, 409 | so that distribution is permitted only in or among countries not thus 410 | excluded. In such case, this License incorporates the limitation as if 411 | written in the body of this License. 412 | 413 | 13. The Free Software Foundation may publish revised and/or new 414 | versions of the Lesser General Public License from time to time. 415 | Such new versions will be similar in spirit to the present version, 416 | but may differ in detail to address new problems or concerns. 417 | 418 | Each version is given a distinguishing version number. If the Library 419 | specifies a version number of this License which applies to it and 420 | "any later version", you have the option of following the terms and 421 | conditions either of that version or of any later version published by 422 | the Free Software Foundation. If the Library does not specify a 423 | license version number, you may choose any version ever published by 424 | the Free Software Foundation. 425 | 426 | 14. If you wish to incorporate parts of the Library into other free 427 | programs whose distribution conditions are incompatible with these, 428 | write to the author to ask for permission. For software which is 429 | copyrighted by the Free Software Foundation, write to the Free 430 | Software Foundation; we sometimes make exceptions for this. Our 431 | decision will be guided by the two goals of preserving the free status 432 | of all derivatives of our free software and of promoting the sharing 433 | and reuse of software generally. 434 | 435 | NO WARRANTY 436 | 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 446 | 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 456 | DAMAGES. 457 | 458 | END OF TERMS AND CONDITIONS 459 | 460 | How to Apply These Terms to Your New Libraries 461 | 462 | If you develop a new library, and you want it to be of the greatest 463 | possible use to the public, we recommend making it free software that 464 | everyone can redistribute and change. You can do so by permitting 465 | redistribution under these terms (or, alternatively, under the terms of the 466 | ordinary General Public License). 467 | 468 | To apply these terms, attach the following notices to the library. It is 469 | safest to attach them to the start of each source file to most effectively 470 | convey the exclusion of warranty; and each file should have at least the 471 | "copyright" line and a pointer to where the full notice is found. 472 | 473 | 474 | Copyright (C) 475 | 476 | This library is free software; you can redistribute it and/or 477 | modify it under the terms of the GNU Lesser General Public 478 | License as published by the Free Software Foundation; either 479 | version 2.1 of the License, or (at your option) any later version. 480 | 481 | This library is distributed in the hope that it will be useful, 482 | but WITHOUT ANY WARRANTY; without even the implied warranty of 483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 484 | Lesser General Public License for more details. 485 | 486 | You should have received a copy of the GNU Lesser General Public 487 | License along with this library; if not, write to the Free Software 488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 489 | 490 | Also add information on how to contact you by electronic and paper mail. 491 | 492 | You should also get your employer (if you work as a programmer) or your 493 | school, if any, to sign a "copyright disclaimer" for the library, if 494 | necessary. Here is a sample; alter the names: 495 | 496 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 497 | library `Frob' (a library for tweaking knobs) written by James Random Hacker. 498 | 499 | , 1 April 1990 500 | Ty Coon, President of Vice 501 | 502 | That's all there is to it! 503 | -------------------------------------------------------------------------------- /qatemmixeffect.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2014 Peter Simonsson 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library. If not, see . 16 | */ 17 | 18 | #ifndef QATEMMIXEFFECT_H 19 | #define QATEMMIXEFFECT_H 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | class QColor; 27 | 28 | class LIBQATEMCONTROLSHARED_EXPORT QAtemMixEffect : public QObject 29 | { 30 | Q_OBJECT 31 | public: 32 | explicit QAtemMixEffect(quint8 id, QAtemConnection *parent = nullptr); 33 | ~QAtemMixEffect(); 34 | 35 | void createUpstreamKeyers(quint8 count); 36 | 37 | /// @returns the index of the input that is on program 38 | quint16 programInput() const { return m_programInput; } 39 | /// @returns the index of the input that is on preview 40 | quint16 previewInput() const { return m_previewInput; } 41 | 42 | /// @returns true if transition preview is enabled 43 | bool transitionPreviewEnabled() const { return m_transitionPreviewEnabled; } 44 | /// @returns number of frames left of transition 45 | quint8 transitionFrameCount() const { return m_transitionFrameCount; } 46 | /// @returns percent left of transition 47 | quint16 transitionPosition() const { return m_transitionPosition; } 48 | /// @returns keyers used on next transition. Bit 0 = Background, 1-4 = keys, only bit 0 and 1 available on TVS 49 | quint8 keyersOnNextTransition() const { return m_keyersOnNextTransition; } 50 | /// @returns index of selected transition style for next transition. Bit 0 = Mix, 1 = Dip, 2 = Wipe, 3 = DVE and 4 = Stinger, only bit 0-2 available on TVS 51 | quint8 nextTransitionStyle() const { return m_nextTransitionStyle; } 52 | /// @returns keyers used on current transition. Bit 0 = Background, 1-4 = keys, only bit 0 and 1 available on TVS 53 | quint8 keyersOnCurrentTransition() const { return m_keyersOnCurrentTransition; } 54 | /// @returns index of selected transition style for current transition. Bit 0 = Mix, 1 = Dip, 2 = Wipe, 3 = DVE and 4 = Stinger, only bit 0-2 available on TVS 55 | quint8 currentTransitionStyle() const { return m_currentTransitionStyle; } 56 | 57 | /// @returns true if fade to black is on. 58 | bool fadeToBlackEnabled() const { return m_fadeToBlackEnabled; } 59 | /// @returns true if fade to black is fading to/from black 60 | bool fadeToBlackFading() const { return m_fadeToBlackFading; } 61 | /// @returns number of frames left of fade to black transition. 62 | quint8 fadeToBlackFrameCount() const { return m_fadeToBlackFrameCount; } 63 | /// @returns duration in number of frames for the fade to black transition. 64 | quint8 fadeToBlackFrames() const { return m_fadeToBlackFrames; } 65 | 66 | /// @returns duration in number of frames for mix transition 67 | quint8 mixFrames() const { return m_mixFrames; } 68 | 69 | /// @returns duration in number of frames for dip transition 70 | quint8 dipFrames() const { return m_dipFrames; } 71 | /// @returns the source used for a dip transition 72 | quint16 dipSource() const { return m_dipSource; } 73 | 74 | /// @returns duration in number of frames for wipe transition 75 | quint8 wipeFrames() const { return m_wipeFrames; } 76 | /// @returns the border source index, used for wipe transition 77 | quint16 wipeBorderSource() const { return m_wipeBorderSource; } 78 | /// @returns border width for wipe transition 79 | quint16 wipeBorderWidth() const { return m_wipeBorderWidth; } 80 | /// @returns border softness for wipe transition 81 | quint16 wipeBorderSoftness() const { return m_wipeBorderSoftness; } 82 | /// @returns type of wipe transition 83 | quint8 wipeType() const { return m_wipeType; } 84 | /// @returns symmetry of wipe transition 85 | quint16 wipeSymmetry() const { return m_wipeSymmetry; } 86 | /// @returns x position of wipe transition 87 | quint16 wipeXPosition() const { return m_wipeXPosition; } 88 | /// @returns y position of wipe transition 89 | quint16 wipeYPosition() const { return m_wipeYPosition; } 90 | /// @returns true if wipe transition direction should be reversed 91 | bool wipeReverseDirection() const { return m_wipeReverseDirection; } 92 | /// @returns true if wipe transition direction should flip flop 93 | bool wipeFlipFlop() const { return m_wipeFlipFlop; } 94 | 95 | /// @returns duration in number of frames for DVE transition 96 | quint8 dveRate() const { return m_dveRate; } 97 | /** 98 | * @returns the selected effect for DVE transition 99 | * 100 | * Swosh: 101 | * 0 = Top left 102 | * 1 = Up 103 | * 2 = Top right 104 | * 3 = Left 105 | * 4 = Right 106 | * 5 = Bottom left 107 | * 6 = Down 108 | * 7 = Bottom right 109 | * 110 | * Spin: 111 | * 8 = Down left, clockwise 112 | * 9 = Up left, clockwise 113 | * 10 = Down right, clockwise 114 | * 11 = Up right, clockwise 115 | * 12 = Up right, anti clockwise 116 | * 13 = Down right, anti clockwise 117 | * 14 = Up left, anti clockwise 118 | * 15 = Down left, anti clockwise 119 | * 120 | * Squeeze: 121 | * 16 = Top left 122 | * 17 = Up 123 | * 18 = Top right 124 | * 19 = Left 125 | * 20 = Right 126 | * 21 = Bottom left 127 | * 22 = Down 128 | * 23 = Bottom right 129 | * 130 | * Push: 131 | * 24 = Top left 132 | * 25 = Up 133 | * 26 = Top right 134 | * 27 = Left 135 | * 28 = Right 136 | * 29 = Bottom left 137 | * 30 = Down 138 | * 31 = Bottom right 139 | * 140 | * Graphic: 141 | * 32 = Spin clockwise 142 | * 33 = Spin anti clockwise 143 | * 34 = Logo wipe 144 | */ 145 | quint8 dveEffect() const { return m_dveEffect; } 146 | quint16 dveFillSource() const { return m_dveFillSource; } 147 | quint16 dveKeySource() const { return m_dveKeySource; } 148 | bool dveKeyEnabled() const { return m_dveKeyEnabled; } 149 | bool dvePreMultipliedKeyEnabled() const { return m_dvePreMultipliedKeyEnabled; } 150 | /// @returns the clip of the key in per cent for the DVE transition 151 | float dveKeyClip() const { return m_dveKeyClip; } 152 | /// @returns the gain of the key in per cent for the DVE transition 153 | float dveKeyGain() const { return m_dveKeyGain; } 154 | bool dveInvertKeyEnabled() const { return m_dveEnableInvertKey; } 155 | bool dveReverseDirection() const { return m_dveReverseDirection; } 156 | bool dveFlipFlopDirection() const { return m_dveFlipFlopDirection; } 157 | 158 | /// @returns source used for the Stinger transition. 1 = Media player 1, 2 = Media player 2 159 | quint8 stingerSource() const { return m_stingerSource; } 160 | /// @returns true if the Stinger transition has a pre multiplied key 161 | bool stingerPreMultipliedKeyEnabled() const { return m_stingerPreMultipliedKeyEnabled; } 162 | float stingerClip() const { return m_stingerClip; } 163 | float stingerGain() const { return m_stingerGain; } 164 | bool stingerInvertKeyEnabled() const { return m_stingerInvertKeyEnabled; } 165 | quint16 stingerPreRoll() const { return m_stingerPreRoll; } 166 | quint16 stingerClipDuration() const { return m_stingerClipDuration; } 167 | quint16 stingerTriggerPoint() const { return m_stingerTriggerPoint; } 168 | quint16 stingerMixRate() const { return m_stingerMixRate; } 169 | 170 | /// @returns number of upstream keys available on this M/E 171 | quint8 upstreamKeyCount() const { return static_cast(m_upstreamKeys.count()); } 172 | /// @returns true if upstream key @p keyer is on air 173 | bool upstreamKeyOnAir(quint8 keyer) const; 174 | /// @returns the key type for upstream key @p keyer, 0 = luma, 1 = chroma, 2 = pattern, 3 = DVE 175 | quint8 upstreamKeyType(quint8 keyer) const { return m_upstreamKeys[keyer]->m_type; } 176 | /// @returns the source used as fill for upstream key @p keyer 177 | quint16 upstreamKeyFillSource(quint8 keyer) const { return m_upstreamKeys[keyer]->m_fillSource; } 178 | /// @returns the source used as key for upstream key @p keyer 179 | quint16 upstreamKeyKeySource(quint8 keyer) const { return m_upstreamKeys[keyer]->m_keySource; } 180 | /// @returns true if the mask is enabled for upstream key @p keyer 181 | bool upstreamKeyEnableMask(quint8 keyer) const { return m_upstreamKeys[keyer]->m_enableMask; } 182 | /// @returns top mask for upstream key @p keyer 183 | float upstreamKeyTopMask(quint8 keyer) const { return m_upstreamKeys[keyer]->m_topMask; } 184 | /// @returns bottom mask for upstream key @p keyer 185 | float upstreamKeyBottomMask(quint8 keyer) const { return m_upstreamKeys[keyer]->m_bottomMask; } 186 | /// @returns left mask for upstream key @p keyer 187 | float upstreamKeyLeftMask(quint8 keyer) const { return m_upstreamKeys[keyer]->m_leftMask; } 188 | /// @returns right mask for upstream key @p keyer 189 | float upstreamKeyRightMask(quint8 keyer) const { return m_upstreamKeys[keyer]->m_rightMask; } 190 | /// @returns true if the key is pre multiplied for luma upstream key @p keyer 191 | bool upstreamKeyLumaPreMultipliedKey(quint8 keyer) const { return m_upstreamKeys[keyer]->m_lumaPreMultipliedKey; } 192 | /// @returns true if the key source should be inverted for luma upstream key @p keyer 193 | bool upstreamKeyLumaInvertKey(quint8 keyer) const { return m_upstreamKeys[keyer]->m_lumaInvertKey; } 194 | /// @returns clip for luma upstream key @p keyer 195 | float upstreamKeyLumaClip(quint8 keyer) const { return m_upstreamKeys[keyer]->m_lumaClip; } 196 | /// @returns gain for luma upstream key @p keyer 197 | float upstreamKeyLumaGain(quint8 keyer) const { return m_upstreamKeys[keyer]->m_lumaGain; } 198 | /// @returns hue for chroma upstream key @p keyer 199 | float upstreamKeyChromaHue(quint8 keyer) const { return m_upstreamKeys[keyer]->m_chromaHue; } 200 | /// @returns gain for chroma upstream key @p keyer 201 | float upstreamKeyChromaGain(quint8 keyer) const { return m_upstreamKeys[keyer]->m_chromaGain; } 202 | /// @returns y suppress for chroma upstream key @p keyer 203 | float upstreamKeyChromaYSuppress(quint8 keyer) const { return m_upstreamKeys[keyer]->m_chromaYSuppress; } 204 | /// @returns lift for chroma upstream key @p keyer 205 | float upstreamKeyChromaLift(quint8 keyer) const { return m_upstreamKeys[keyer]->m_chromaLift; } 206 | /// @returns true if chroma upstream key @p keyer should have narrow chroma key range 207 | bool upstreamKeyChromaNarrowRange(quint8 keyer) const { return m_upstreamKeys[keyer]->m_chromaNarrowRange; } 208 | /// @returns pattern of pattern upstream key @p keyer 209 | quint8 upstreamKeyPatternPattern(quint8 keyer) const { return m_upstreamKeys[keyer]->m_patternPattern; } 210 | /// @returns true if pattern upstream key @p keyer should invert the pattern 211 | bool upstreamKeyPatternInvertPattern(quint8 keyer) const { return m_upstreamKeys[keyer]->m_patternInvertPattern; } 212 | /// @returns size for pattern upstream key @p keyer 213 | float upstreamKeyPatternSize(quint8 keyer) const { return m_upstreamKeys[keyer]->m_patternSize; } 214 | /// @returns symmetry for pattern upstream key @p keyer 215 | float upstreamKeyPatternSymmetry(quint8 keyer) const { return m_upstreamKeys[keyer]->m_patternSymmetry; } 216 | /// @returns softness for pattern upstream key @p keyer 217 | float upstreamKeyPatternSoftness(quint8 keyer) const { return m_upstreamKeys[keyer]->m_patternSoftness; } 218 | /// @returns x position for pattern upstream key @p keyer 219 | float upstreamKeyPatternXPosition(quint8 keyer) const { return m_upstreamKeys[keyer]->m_patternXPosition; } 220 | /// @returns y position for pattern upstream key @p keyer 221 | float upstreamKeyPatternYPosition(quint8 keyer) const { return m_upstreamKeys[keyer]->m_patternYPosition; } 222 | /// @returns x position of DVE for upstream key @p keyer 223 | float upstreamKeyDVEXPosition(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveXPosition; } 224 | /// @returns y position of DVE for upstream key @p keyer 225 | float upstreamKeyDVEYPosition(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveYPosition; } 226 | /// @returns x size of DVE for upstream key @p keyer 227 | float upstreamKeyDVEXSize(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveXSize; } 228 | /// @returns y size of DVE for upstream key @p keyer 229 | float upstreamKeyDVEYSize(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveYSize; } 230 | /// @returns rotation of DVE for upstream key @p keyer 231 | float upstreamKeyDVERotation(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveRotation; } 232 | /// @returns true if the drop shadow is enabled on the DVE for upstream key @p keyer 233 | bool upstreamKeyDVEDropShadowEnabled(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveEnableDropShadow; } 234 | /// @returns direction of the light source for the drop shadow on the DVE for upstream key @p keyer 235 | float upstreamKeyDVELightSourceDirection(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveLightSourceDirection; } 236 | /// @returns altitude of the light source for the drop shadow on the DVE for upstream keu @p keyer 237 | quint8 upstreamKeyDVELightSourceAltitude(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveLightSourceAltitude; } 238 | /// @returns true if the border is enabled on the DVE for upstream key @p keyer 239 | bool upstreamKeyDVEBorderEnabled(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveEnableBorder; } 240 | /// @returns the border style of the DVE for upstream key @p keyer. 0 = No Bevel, 1 = Bevel In Out, 2 = Bevel In, 3 = Bevel Out 241 | quint8 upstreamKeyDVEBorderStyle(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveBorderStyle; } 242 | /// @returns the border color of the DVE for upstream key @p keyer 243 | QColor upstreamKeyDVEBorderColor(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveBorderColor; } 244 | /// @returns the outside width of the border of the DVE for upstream key @p keyer 245 | float upstreamKeyDVEBorderOutsideWidth(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveBorderOutsideWidth; } 246 | /// @returns the inside width of the border of the DVE for upstream key @p keyer 247 | float upstreamKeyDVEBorderInsideWidth(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveBorderInsideWidth; } 248 | /// @returns the outside soften (%) of the border of the DVE for upstream key @p keyer 249 | quint8 upstreamKeyDVEBorderOutsideSoften(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveBorderOutsideSoften; } 250 | /// @returns the inside soften (%) of the border of the DVE for upstream key @p keyer 251 | quint8 upstreamKeyDVEBorderInsideSoften(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveBorderInsideSoften; } 252 | /// @returns the opacity of the border of the DVE for upstream key @p keyer 253 | quint8 upstreamKeyDVEBorderOpacity(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveBorderOpacity; } 254 | /// @returns the bevel position of the border of the DVE for upstream key @p keyer 255 | float upstreamKeyDVEBorderBevelPosition(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveBorderBevelPosition; } 256 | /// @returns the bevel soften (%) of the border of the DVE for upstream key @p keyer 257 | float upstreamKeyDVEBorderBevelSoften(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveBorderBevelSoften; } 258 | /// @returns the rate in frames the DVE for upstream key @p keyer runs at 259 | quint8 upstreamKeyDVERate(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveRate; } 260 | /// @returns true if key frame A has been set for the DVE for upstream key @p keyer 261 | bool upstreamKeyDVEKeyFrameASet(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveKeyFrameASet; } 262 | /// @returns true if key frame B has been set for the DVE for upstream key @p keyer 263 | bool upstreamKeyDVEKeyFrameBSet(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveKeyFrameBSet; } 264 | bool upstreamKeyDVEMaskEnabled(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveMaskEnabled; } 265 | float upstreamKeyDVEMaskTop(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveMaskTop; } 266 | float upstreamKeyDVEMaskBottom(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveMaskBottom; } 267 | float upstreamKeyDVEMaskLeft(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveMaskLeft; } 268 | float upstreamKeyDVEMaskRight(quint8 keyer) const { return m_upstreamKeys[keyer]->m_dveMaskRight; } 269 | /// @returns true if fly is enabled for non DVE type of the upstream key @p keyer 270 | bool upstreamKeyEnableFly(quint8 keyer) const { return m_upstreamKeys[keyer]->m_enableFly; } 271 | /// @returns the current key frame settings for keyer @p keyer and key frame @frame. 1 = KeyFrame A, 2 = KeyFrame B 272 | QAtem::DveKeyFrame upstreamKeyKeyFrame(quint8 keyer, quint8 frame) const { return m_upstreamKeys[keyer]->m_keyFrames[frame - 1]; } 273 | 274 | public slots: 275 | void cut(); 276 | void autoTransition(); 277 | 278 | void changeProgramInput(quint16 index); 279 | void changePreviewInput(quint16 index); 280 | 281 | /// Set the current position of the transition to @p position. Set @p position to 0 to signal transition done. 282 | void setTransitionPosition(quint16 position); 283 | void setTransitionPreview(bool state); 284 | void setTransitionType(quint8 type); 285 | void setUpstreamKeyOnNextTransition(quint8 keyer, bool state); 286 | void setBackgroundOnNextTransition(bool state); 287 | 288 | void toggleFadeToBlack(); 289 | void setFadeToBlackFrameRate(quint8 frames); 290 | 291 | void setMixFrames(quint8 frames); 292 | 293 | void setDipFrames(quint8 frames); 294 | void setDipSource(quint16 source); 295 | 296 | void setWipeBorderSource(quint16 source); 297 | void setWipeFrames(quint8 frames); 298 | void setWipeBorderWidth(quint16 width); 299 | void setWipeBorderSoftness(quint16 softness); 300 | void setWipeType(quint8 type); 301 | void setWipeSymmetry(quint16 value); 302 | void setWipeXPosition(quint16 value); 303 | void setWipeYPosition(quint16 value); 304 | void setWipeReverseDirection(bool reverse); 305 | void setWipeFlipFlop(bool flipFlop); 306 | 307 | void setDVERate(quint8 frames); 308 | /** 309 | * Set the effect used for the DVE transition to @p effect 310 | * 311 | * Swosh: 312 | * 0 = Top left 313 | * 1 = Up 314 | * 2 = Top right 315 | * 3 = Left 316 | * 4 = Right 317 | * 5 = Bottom left 318 | * 6 = Down 319 | * 7 = Bottom right 320 | * 321 | * Spin: 322 | * 8 = Down left, clockwise 323 | * 9 = Up left, clockwise 324 | * 10 = Down right, clockwise 325 | * 11 = Up right, clockwise 326 | * 12 = Up right, anti clockwise 327 | * 13 = Down right, anti clockwise 328 | * 14 = Up left, anti clockwise 329 | * 15 = Down left, anti clockwise 330 | * 331 | * Squeeze: 332 | * 16 = Top left 333 | * 17 = Up 334 | * 18 = Top right 335 | * 19 = Left 336 | * 20 = Right 337 | * 21 = Bottom left 338 | * 22 = Down 339 | * 23 = Bottom right 340 | * 341 | * Push: 342 | * 24 = Top left 343 | * 25 = Up 344 | * 26 = Top right 345 | * 27 = Left 346 | * 28 = Right 347 | * 29 = Bottom left 348 | * 30 = Down 349 | * 31 = Bottom right 350 | * 351 | * Graphic: 352 | * 32 = Spin clockwise 353 | * 33 = Spin anti clockwise 354 | * 34 = Logo wipe 355 | */ 356 | void setDVEEffect(quint8 effect); 357 | void setDVEFillSource(quint16 source); 358 | void setDVEKeySource(quint16 source); 359 | void setDVEKeyEnabled(bool enabled); 360 | void setDVEPreMultipliedKeyEnabled(bool enabled); 361 | /// Set clip of key for DVE transition to @p percent 362 | void setDVEKeyClip(float percent); 363 | /// Set gain of key for DVE transition to @p percent 364 | void setDVEKeyGain(float percent); 365 | void setDVEInvertKeyEnabled(bool enabled); 366 | /// Set to true to do the DVE transition in the reverse direction 367 | void setDVEReverseDirection(bool reverse); 368 | /// Set to true to flip flop the direction of the DVE transition between uses 369 | void setDVEFlipFlopDirection(bool flipFlop); 370 | 371 | /// Set the source used for Stinger transition to @p source. 1 = Media player 1, 2 = Media player 2 372 | void setStingerSource(quint8 source); 373 | /// Enable if the key is pre multiplied in the source for the Stinger transition 374 | void setStingerPreMultipliedKeyEnabled(bool enabled); 375 | void setStingerClip(float percent); 376 | void setStingerGain(float percent); 377 | void setStingerInvertKeyEnabled(bool enabled); 378 | void setStingerPreRoll(quint16 frames); 379 | void setStingerClipDuration(quint16 frames); 380 | void setStingerTriggerPoint(quint16 frames); 381 | void setStingerMixRate(quint16 frames); 382 | 383 | void setUpstreamKeyOnAir(quint8 keyer, bool state); 384 | void setUpstreamKeyType(quint8 keyer, quint8 type); 385 | void setUpstreamKeyFillSource(quint8 keyer, quint16 source); 386 | void setUpstreamKeyKeySource(quint8 keyer, quint16 source); 387 | void setUpstreamKeyEnableMask(quint8 keyer, bool enable); 388 | void setUpstreamKeyMask(quint8 keyer, float top, float bottom, float left, float right); 389 | void setUpstreamKeyLumaPreMultipliedKey(quint8 keyer, bool preMultiplied); 390 | void setUpstreamKeyLumaInvertKey(quint8 keyer, bool invert); 391 | void setUpstreamKeyLumaClip(quint8 keyer, float clip); 392 | void setUpstreamKeyLumaGain(quint8 keyer, float gain); 393 | void setUpstreamKeyChromaHue(quint8 keyer, float hue); 394 | void setUpstreamKeyChromaGain(quint8 keyer, float gain); 395 | void setUpstreamKeyChromaYSuppress(quint8 keyer, float ySuppress); 396 | void setUpstreamKeyChromaLift(quint8 keyer, float lift); 397 | void setUpstreamKeyChromaNarrowRange(quint8 keyer, bool narrowRange); 398 | void setUpstreamKeyPatternPattern(quint8 keyer, quint8 pattern); 399 | void setUpstreamKeyPatternInvertPattern(quint8 keyer, bool invert); 400 | void setUpstreamKeyPatternSize(quint8 keyer, float size); 401 | void setUpstreamKeyPatternSymmetry(quint8 keyer, float symmetry); 402 | void setUpstreamKeyPatternSoftness(quint8 keyer, float softness); 403 | void setUpstreamKeyPatternXPosition(quint8 keyer, float xPosition); 404 | void setUpstreamKeyPatternYPosition(quint8 keyer, float yPosition); 405 | void setUpstreamKeyDVEPosition(quint8 keyer, float xPosition, float yPosition); 406 | void setUpstreamKeyDVESize(quint8 keyer, float xSize, float ySize); 407 | void setUpstreamKeyDVERotation(quint8 keyer, float rotation); 408 | void setUpstreamKeyDVELightSource(quint8 keyer, float direction, quint8 altitude); 409 | void setUpstreamKeyDVEDropShadowEnabled(quint8 keyer, bool enabled); 410 | void setUpstreamKeyDVEBorderEnabled(quint8 keyer, bool enabled); 411 | /// Set the border style of the upstream key DVE. 0 = No Bevel, 1 = Bevel In Out, 2 = Bevel In, 3 = Bevel Out 412 | void setUpstreamKeyDVEBorderStyle(quint8 keyer, quint8 style); 413 | void setUpstreamKeyDVEBorderColorH(quint8 keyer, float h); 414 | void setUpstreamKeyDVEBorderColorS(quint8 keyer, float s); 415 | void setUpstreamKeyDVEBorderColorL(quint8 keyer, float l); 416 | void setUpstreamKeyDVEBorderColor(quint8 keyer, const QColor& color); 417 | void setUpstreamKeyDVEBorderWidth(quint8 keyer, float outside, float inside); 418 | void setUpstreamKeyDVEBorderSoften(quint8 keyer, quint8 outside, quint8 inside); 419 | void setUpstreamKeyDVEBorderOpacity(quint8 keyer, quint8 opacity); 420 | void setUpstreamKeyDVEBorderBevelPosition(quint8 keyer, float position); 421 | void setUpstreamKeyDVEBorderBevelSoften(quint8 keyer, float soften); 422 | void setUpstreamKeyDVERate(quint8 keyer, quint8 rate); 423 | /// Set the @p keyFrame of the DVE for upstream keyer @p keyer. 1 = Keyframe A, 2 = Keyframe B 424 | void setUpstreamKeyDVEKeyFrame(quint8 keyer, quint8 keyFrame); 425 | /** 426 | * Make the upstream key @p keyer run to @p position. 1 = Keyframe A, 2 = Keyframe B, 3 = Fullscreen, 4 = Infinite 427 | * If the @p position = infinite there is also a @p direction. 428 | * Available directions: 429 | * 0 = Center 430 | * 1 = Top left 431 | * 2 = Up 432 | * 3 = Top right 433 | * 4 = Left 434 | * 5 = Center 435 | * 6 = Right 436 | * 7 = Bottom left 437 | * 8 = Down 438 | * 9 = Bottom right 439 | */ 440 | void runUpstreamKeyTo(quint8 keyer, quint8 position, quint8 direction); 441 | /// Enable fly on the non DVE key types of the upstream key @p keyer 442 | void setUpstreamKeyFlyEnabled(quint8 keyer, bool enable); 443 | void setUpstreamKeyDVEMaskEnabled(quint8 keyer, bool enable); 444 | void setUpstreamKeyDVEMask(quint8 keyer, float top, float bottom, float left, float right); 445 | 446 | protected slots: 447 | void onPrgI(const QByteArray& payload); 448 | void onPrvI(const QByteArray& payload); 449 | 450 | void onTrPr(const QByteArray& payload); 451 | void onTrPs(const QByteArray& payload); 452 | void onTrSS(const QByteArray& payload); 453 | 454 | void onFtbS(const QByteArray& payload); 455 | void onFtbP(const QByteArray& payload); 456 | 457 | void onTMxP(const QByteArray& payload); 458 | 459 | void onTDpP(const QByteArray& payload); 460 | 461 | void onTWpP(const QByteArray& payload); 462 | 463 | void onTDvP(const QByteArray& payload); 464 | 465 | void onTStP(const QByteArray& payload); 466 | 467 | void onKeOn(const QByteArray& payload); 468 | void onKeBP(const QByteArray& payload); 469 | void onKeLm(const QByteArray& payload); 470 | void onKeCk(const QByteArray& payload); 471 | void onKePt(const QByteArray& payload); 472 | void onKeDV(const QByteArray& payload); 473 | void onKeFS(const QByteArray& payload); 474 | void onKKFP(const QByteArray& payload); 475 | 476 | protected: 477 | void setKeyOnNextTransition (int index, bool state); 478 | 479 | private: 480 | quint8 m_id; 481 | QAtemConnection *m_atemConnection; 482 | 483 | quint16 m_programInput; 484 | quint16 m_previewInput; 485 | 486 | bool m_transitionPreviewEnabled; 487 | quint8 m_transitionFrameCount; 488 | quint16 m_transitionPosition; 489 | quint8 m_keyersOnCurrentTransition; 490 | quint8 m_currentTransitionStyle; 491 | quint8 m_keyersOnNextTransition; 492 | quint8 m_nextTransitionStyle; 493 | 494 | bool m_fadeToBlackEnabled; 495 | bool m_fadeToBlackFading; 496 | quint8 m_fadeToBlackFrameCount; 497 | quint8 m_fadeToBlackFrames; 498 | 499 | quint8 m_mixFrames; 500 | 501 | quint8 m_dipFrames; 502 | quint16 m_dipSource; 503 | 504 | quint8 m_wipeFrames; 505 | quint16 m_wipeBorderSource; 506 | quint16 m_wipeBorderWidth; 507 | quint16 m_wipeBorderSoftness; 508 | quint8 m_wipeType; 509 | quint16 m_wipeSymmetry; 510 | quint16 m_wipeXPosition; 511 | quint16 m_wipeYPosition; 512 | bool m_wipeReverseDirection; 513 | bool m_wipeFlipFlop; 514 | 515 | quint8 m_dveRate; 516 | quint8 m_dveEffect; 517 | quint16 m_dveFillSource; 518 | quint16 m_dveKeySource; 519 | bool m_dveKeyEnabled; 520 | bool m_dvePreMultipliedKeyEnabled; 521 | float m_dveKeyClip; 522 | float m_dveKeyGain; 523 | bool m_dveEnableInvertKey; 524 | bool m_dveReverseDirection; 525 | bool m_dveFlipFlopDirection; 526 | 527 | quint8 m_stingerSource; 528 | bool m_stingerPreMultipliedKeyEnabled; 529 | float m_stingerClip; 530 | float m_stingerGain; 531 | bool m_stingerInvertKeyEnabled; 532 | quint16 m_stingerPreRoll; 533 | quint16 m_stingerClipDuration; 534 | quint16 m_stingerTriggerPoint; 535 | quint16 m_stingerMixRate; 536 | 537 | QVector m_upstreamKeys; 538 | 539 | signals: 540 | void programInputChanged(quint8 me, quint16 oldIndex, quint16 newIndex); 541 | void previewInputChanged(quint8 me, quint16 oldIndex, quint16 newIndex); 542 | 543 | void transitionPreviewChanged(quint8 me, bool state); 544 | void transitionFrameCountChanged(quint8 me, quint8 count); 545 | void transitionPositionChanged(quint8 me, quint16 count); 546 | void nextTransitionStyleChanged(quint8 me, quint8 style); 547 | void keyersOnNextTransitionChanged(quint8 me, quint8 keyers); 548 | void currentTransitionStyleChanged(quint8 me, quint8 style); 549 | void keyersOnCurrentTransitionChanged(quint8 me, quint8 keyers); 550 | 551 | ///@p fading is true while fading to/from black, @p enabled is true when program is faded to black 552 | void fadeToBlackChanged(quint8 me, bool fading, bool enabled); 553 | void fadeToBlackFrameCountChanged(quint8 me, quint8 count); 554 | void fadeToBlackFramesChanged(quint8 me, quint8 frames); 555 | 556 | void mixFramesChanged(quint8 me, quint8 frames); 557 | 558 | void dipFramesChanged(quint8 me, quint8 frames); 559 | void dipSourceChanged(quint8 me, quint16 source); 560 | 561 | void wipeFramesChanged(quint8 me, quint8 frames); 562 | void wipeBorderWidthChanged(quint8 me, quint16 width); 563 | void wipeBorderSoftnessChanged(quint8 me, quint16 softness); 564 | void wipeTypeChanged(quint8 me, quint8 type); 565 | void wipeSymmetryChanged(quint8 me, quint16 value); 566 | void wipeXPositionChanged(quint8 me, quint16 value); 567 | void wipeYPositionChanged(quint8 me, quint16 value); 568 | void wipeReverseDirectionChanged(quint8 me, bool reverse); 569 | void wipeFlipFlopChanged(quint8 me, bool flipFlop); 570 | void wipeBorderSourceChanged(quint8 me, quint16 index); 571 | 572 | void dveRateChanged(quint8 me, quint16 frames); 573 | void dveEffectChanged(quint8 me, quint8 effect); 574 | void dveFillSourceChanged(quint8 me, quint16 source); 575 | void dveKeySourceChanged(quint8 me, quint16 source); 576 | void dveEnableKeyChanged(quint8 me, bool enabled); 577 | void dveEnablePreMultipliedKeyChanged(quint8 me, bool enabled); 578 | void dveKeyClipChanged(quint8 me, float clip); 579 | void dveKeyGainChanged(quint8 me, float gain); 580 | void dveEnableInvertKeyChanged(quint8 me, bool enabled); 581 | void dveReverseDirectionChanged(quint8 me, bool reverse); 582 | void dveFlipFlopDirectionChanged(quint8 me, bool flipFlop); 583 | 584 | void stingerSourceChanged(quint8 me, quint8 source); 585 | void stingerEnablePreMultipliedKeyChanged(quint8 me, bool enabled); 586 | void stingerClipChanged(quint8 me, float percent); 587 | void stingerGainChanged(quint8 me, float percent); 588 | void stingerEnableInvertKeyChanged(quint8 me, bool enabled); 589 | void stingerPreRollChanged(quint8 me, quint16 frames); 590 | void stingerClipDurationChanged(quint8 me, quint16 frames); 591 | void stingerTriggerPointChanged(quint8 me, quint16 frames); 592 | void stingerMixRateChanged(quint8 me, quint16 frames); 593 | 594 | void upstreamKeyOnAirChanged(quint8 me, quint8 keyer, bool state); 595 | void upstreamKeyTypeChanged(quint8 me, quint8 keyer, quint8 type); 596 | void upstreamKeyFillSourceChanged(quint8 me, quint8 keyer, quint16 source); 597 | void upstreamKeyKeySourceChanged(quint8 me, quint8 keyer, quint16 source); 598 | void upstreamKeyEnableMaskChanged(quint8 me, quint8 keyer, bool enable); 599 | void upstreamKeyTopMaskChanged(quint8 me, quint8 keyer, float value); 600 | void upstreamKeyBottomMaskChanged(quint8 me, quint8 keyer, float value); 601 | void upstreamKeyLeftMaskChanged(quint8 me, quint8 keyer, float value); 602 | void upstreamKeyRightMaskChanged(quint8 me, quint8 keyer, float value); 603 | void upstreamKeyLumaPreMultipliedKeyChanged(quint8 me, quint8 keyer, bool preMultiplied); 604 | void upstreamKeyLumaInvertKeyChanged(quint8 me, quint8 keyer, bool invert); 605 | void upstreamKeyLumaClipChanged(quint8 me, quint8 keyer, float clip); 606 | void upstreamKeyLumaGainChanged(quint8 me, quint8 keyer, float gain); 607 | void upstreamKeyChromaHueChanged(quint8 me, quint8 keyer, float hue); 608 | void upstreamKeyChromaGainChanged(quint8 me, quint8 keyer, float gain); 609 | void upstreamKeyChromaYSuppressChanged(quint8 me, quint8 keyer, float ySuppress); 610 | void upstreamKeyChromaLiftChanged(quint8 me, quint8 keyer, float lift); 611 | void upstreamKeyChromaNarrowRangeChanged(quint8 me, quint8 keyer, bool narrowRange); 612 | void upstreamKeyPatternPatternChanged(quint8 me, quint8 keyer, quint8 pattern); 613 | void upstreamKeyPatternInvertPatternChanged(quint8 me, quint8 keyer, bool invert); 614 | void upstreamKeyPatternSizeChanged(quint8 me, quint8 keyer, float size); 615 | void upstreamKeyPatternSymmetryChanged(quint8 me, quint8 keyer, float symmetry); 616 | void upstreamKeyPatternSoftnessChanged(quint8 me, quint8 keyer, float softness); 617 | void upstreamKeyPatternXPositionChanged(quint8 me, quint8 keyer, float xPosition); 618 | void upstreamKeyPatternYPositionChanged(quint8 me, quint8 keyer, float yPosition); 619 | void upstreamKeyDVEXPositionChanged(quint8 me, quint8 keyer, float xPosition); 620 | void upstreamKeyDVEYPositionChanged(quint8 me, quint8 keyer, float yPosition); 621 | void upstreamKeyDVEXSizeChanged(quint8 me, quint8 keyer, float xSize); 622 | void upstreamKeyDVEYSizeChanged(quint8 me, quint8 keyer, float ySize); 623 | void upstreamKeyDVERotationChanged(quint8 me, quint8 keyer, float rotation); 624 | void upstreamKeyDVEEnableDropShadowChanged(quint8 me, quint8 keyer, bool enable); 625 | void upstreamKeyDVELighSourceDirectionChanged(quint8 me, quint8 keyer, float direction); 626 | void upstreamKeyDVELightSourceAltitudeChanged(quint8 me, quint8 keyer, quint8 altitude); 627 | void upstreamKeyDVEEnableBorderChanged(quint8 me, quint8 keyer, bool enable); 628 | void upstreamKeyDVEBorderStyleChanged(quint8 me, quint8 keyer, quint8 style); 629 | void upstreamKeyDVEBorderColorChanged(quint8 me, quint8 keyer, QColor color); 630 | void upstreamKeyDVEBorderOutsideWidthChanged(quint8 me, quint8 keyer, float width); 631 | void upstreamKeyDVEBorderInsideWidthChanged(quint8 me, quint8 keyer, float width); 632 | void upstreamKeyDVEBorderOutsideSoftenChanged(quint8 me, quint8 keyer, quint8 soften); 633 | void upstreamKeyDVEBorderInsideSoftenChanged(quint8 me, quint8 keyer, quint8 soften); 634 | void upstreamKeyDVEBorderOpacityChanged(quint8 me, quint8 keyer, quint8 opacity); 635 | void upstreamKeyDVEBorderBevelPositionChanged(quint8 me, quint8 keyer, float position); 636 | void upstreamKeyDVEBorderBevelSoftenChanged(quint8 me, quint8 keyer, float soften); 637 | void upstreamKeyDVERateChanged(quint8 me, quint8 keyer, quint8 rate); 638 | void upstreamKeyDVEKeyFrameASetChanged(quint8 me, quint8 keyer, bool set); 639 | void upstreamKeyDVEKeyFrameBSetChanged(quint8 me, quint8 keyer, bool set); 640 | void upstreamKeyEnableFlyChanged(quint8 me, quint8 keyer, bool enabled); 641 | void upstreamKeyDVEKeyFrameChanged(quint8 me, quint8 keyer, quint8 frame); 642 | void upstreamKeyDVEMaskEnabledChanged(quint8 me, quint8 keyer, bool enabled); 643 | void upstreamKeyDVEMaskTopChanged(quint8 me, quint8 keyer, float top); 644 | void upstreamKeyDVEMaskBottomChanged(quint8 me, quint8 keyer, float bottom); 645 | void upstreamKeyDVEMaskLeftChanged(quint8 me, quint8 keyer, float left); 646 | void upstreamKeyDVEMaskRightChanged(quint8 me, quint8 keyer, float right); 647 | }; 648 | 649 | #endif // QATEMMIXEFFECT_H 650 | --------------------------------------------------------------------------------