├── docs └── img │ └── screenshot.png ├── CasterSoundboard ├── res │ └── img │ │ ├── Key.png │ │ ├── app.png │ │ ├── cog.png │ │ ├── cue.png │ │ ├── about.png │ │ ├── down.png │ │ ├── duck.png │ │ ├── loop.png │ │ ├── notes.png │ │ ├── open.png │ │ ├── pause.png │ │ ├── play.png │ │ ├── save.png │ │ ├── stop.png │ │ ├── newTab.png │ │ ├── no_loop.png │ │ ├── rename.png │ │ ├── save_as.png │ │ ├── stopAll.png │ │ ├── unduck.png │ │ ├── 33_percent.png │ │ ├── openMusic.png │ │ ├── colorPicker.png │ │ ├── open_sound_control.png │ │ ├── playState_paused.png │ │ ├── playState_playing.png │ │ └── playState_stopped.png ├── .gitignore ├── CasterPlayerState.h ├── res.qrc ├── CasterPlayerState.cpp ├── libs │ ├── osc │ │ ├── OscVersion.h │ │ ├── exceptions │ │ │ ├── UnknownTagException.h │ │ │ ├── GetMessageException.h │ │ │ ├── ReadMessageException.h │ │ │ ├── MalformedBundleException.h │ │ │ ├── GetBundleException.h │ │ │ ├── CharConversionException.h │ │ │ ├── LongConversionException.h │ │ │ ├── MidiConversionException.h │ │ │ ├── RgbaConversionException.h │ │ │ ├── BytesConversionException.h │ │ │ ├── FloatConversionException.h │ │ │ ├── OutOfBoundsReadException.h │ │ │ ├── DoubleConversionException.h │ │ │ ├── StringConversionException.h │ │ │ ├── SymbolConversionException.h │ │ │ ├── BooleanConversionException.h │ │ │ ├── IntegerConversionException.h │ │ │ ├── TimetagConversionException.h │ │ │ ├── MalformedArrayException.h │ │ │ └── OSC_ALL_EXCEPTIONS.h │ │ ├── reader │ │ │ ├── types │ │ │ │ ├── Symbol.h │ │ │ │ ├── OscArrayEnd.cpp │ │ │ │ ├── OscFalse.cpp │ │ │ │ ├── OscFalse.h │ │ │ │ ├── OscNil.cpp │ │ │ │ ├── OscArrayBegin.cpp │ │ │ │ ├── OscArrayEnd.h │ │ │ │ ├── OscTrue.cpp │ │ │ │ ├── OscNil.h │ │ │ │ ├── OscArrayBegin.h │ │ │ │ ├── OscTrue.h │ │ │ │ ├── OscChar.h │ │ │ │ ├── OscInfinitum.h │ │ │ │ ├── OscFloat.h │ │ │ │ ├── OscInteger.h │ │ │ │ ├── OscLong.h │ │ │ │ ├── OscDouble.h │ │ │ │ ├── OscMidi.h │ │ │ │ ├── OscBlob.h │ │ │ │ ├── OscChar.cpp │ │ │ │ ├── OscRGBA.h │ │ │ │ ├── OscString.h │ │ │ │ ├── OscSymbol.h │ │ │ │ ├── OscAddress.h │ │ │ │ ├── OscTags.h │ │ │ │ ├── OscTimetag.h │ │ │ │ ├── RGBA.h │ │ │ │ ├── Midi.h │ │ │ │ ├── OscInfinitum.cpp │ │ │ │ ├── OscFloat.cpp │ │ │ │ ├── OscInteger.cpp │ │ │ │ ├── OscLong.cpp │ │ │ │ ├── OscMidi.cpp │ │ │ │ ├── OscRGBA.cpp │ │ │ │ ├── OscDouble.cpp │ │ │ │ ├── OscValue.h │ │ │ │ ├── OscBlob.cpp │ │ │ │ ├── OscAddress.cpp │ │ │ │ ├── OscString.cpp │ │ │ │ ├── OscSymbol.cpp │ │ │ │ ├── OscTags.cpp │ │ │ │ └── OscTimeTag.cpp │ │ │ ├── OscContent.cpp │ │ │ ├── OscContent.h │ │ │ ├── OscMessage.h │ │ │ ├── OscBundle.h │ │ │ ├── OscReader.h │ │ │ ├── OscReader.cpp │ │ │ └── OscBundle.cpp │ │ ├── OscAPI.h │ │ ├── composer │ │ │ ├── OscContentComposer.h │ │ │ ├── OscContentComposer.cpp │ │ │ └── OscBundleComposer.h │ │ └── OscPatternMatching.h │ └── tools │ │ ├── ByteOrder.cpp │ │ ├── ByteOrder.h │ │ └── exceptions │ │ ├── BufferOverflowException.h │ │ ├── BufferUnderflowException.h │ │ ├── IllegalArgumentException.h │ │ └── IndexOutOfBoundsException.h ├── main.cpp ├── CasterCuePicker.h ├── CasterLabelColorPicker.h ├── CasterOSCServerConfigPicker.h ├── CSS.h └── CasterBoard.h ├── TouchOSC-Layouts ├── Test.touchosc └── SamngSung_Galaxy_Tab_4_10inch_covariant.touchosc ├── dist ├── linux │ ├── CasterSoundboard.png │ ├── CasterSoundboard.desktop │ └── CasterSoundboard.appdata.xml └── macos │ └── CasterSoundboard.icns ├── .gitignore ├── ISSUE_TEMPLATE.md ├── default.nix ├── .travis.yml ├── CONTRIBUTING.md ├── snap └── snapcraft.yaml └── README.md /docs/img/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/docs/img/screenshot.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/Key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/Key.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/app.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/cog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/cog.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/cue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/cue.png -------------------------------------------------------------------------------- /TouchOSC-Layouts/Test.touchosc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/TouchOSC-Layouts/Test.touchosc -------------------------------------------------------------------------------- /dist/linux/CasterSoundboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/dist/linux/CasterSoundboard.png -------------------------------------------------------------------------------- /dist/macos/CasterSoundboard.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/dist/macos/CasterSoundboard.icns -------------------------------------------------------------------------------- /CasterSoundboard/res/img/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/about.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/down.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/duck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/duck.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/loop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/loop.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/notes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/notes.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/open.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/pause.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/play.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/save.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/stop.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/newTab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/newTab.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/no_loop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/no_loop.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/rename.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/rename.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/save_as.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/save_as.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/stopAll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/stopAll.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/unduck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/unduck.png -------------------------------------------------------------------------------- /CasterSoundboard/.gitignore: -------------------------------------------------------------------------------- 1 | CasterSoundboard.pro.* 2 | .qmake.stash 3 | *.o 4 | CasterSoundboard 5 | *.app 6 | Makefile 7 | moc_* 8 | qrc_* 9 | -------------------------------------------------------------------------------- /CasterSoundboard/res/img/33_percent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/33_percent.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/openMusic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/openMusic.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/colorPicker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/colorPicker.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/open_sound_control.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/open_sound_control.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/playState_paused.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/playState_paused.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/playState_playing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/playState_playing.png -------------------------------------------------------------------------------- /CasterSoundboard/res/img/playState_stopped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/CasterSoundboard/res/img/playState_stopped.png -------------------------------------------------------------------------------- /TouchOSC-Layouts/SamngSung_Galaxy_Tab_4_10inch_covariant.touchosc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/CasterSoundboard/master/TouchOSC-Layouts/SamngSung_Galaxy_Tab_4_10inch_covariant.touchosc -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # vim stuff 2 | *.swp 3 | *.swo 4 | 5 | # OSX 6 | .DS_Store 7 | 8 | # Build directories 9 | build-CasterSoundboard-Desktop_Qt_5_8_0_GCC_64bit-Debug/ 10 | build-CasterSoundboard-Desktop_Qt_5_8_0_clang_64bit-Debug/ 11 | -------------------------------------------------------------------------------- /dist/linux/CasterSoundboard.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Type=Application 4 | Name=CasterSoundboard 5 | Comment=A soundboard for hot-keying and playing back sounds 6 | Icon=CasterSoundboard 7 | Exec=CasterSoundboard 8 | NoDisplay=false 9 | Categories=AudioVideo; 10 | StartupNotify=false 11 | Terminal=false 12 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | [⚠ Please read our [contributors](CONTRIBUTING.md) document before posting] 2 | 3 | #### Description of the Problem or Feature Request 4 | 5 | #### Basic system details 6 | 7 | CasterSoundboard version+commit: 8 | Operating system: 9 | Desktop environment: 10 | 11 | #### Steps to reproduce 12 | 13 | 1. 14 | 2. 15 | 3. 16 | 17 | #### Backtraces or error messages 18 | 19 | ``` 20 | [✍ Paste any error messages here between the ``` lines.] 21 | ``` 22 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | with import {}; 2 | 3 | stdenv.mkDerivation { 4 | name = "CasterSoundboard"; 5 | src = ./CasterSoundboard; 6 | nativeBuildInputs = [ qt5.qmakeHook qt5.makeQtWrapper ]; 7 | buildInputs = [ 8 | qt5.qtmultimedia 9 | gst_all_1.gst-plugins-base 10 | gst_all_1.gst-plugins-good 11 | gst_all_1.gst-plugins-bad 12 | gst_all_1.gst-plugins-ugly 13 | ]; 14 | enableParallelBuilding = true; 15 | postInstall = '' 16 | wrapQtProgram "$out/bin/$name" \ 17 | --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0" 18 | ''; 19 | } 20 | -------------------------------------------------------------------------------- /CasterSoundboard/CasterPlayerState.h: -------------------------------------------------------------------------------- 1 | #ifndef CASTERPLAYERSTATE_H 2 | #define CASTERPLAYERSTATE_H 3 | #include 4 | #include 5 | 6 | //forward declarations 7 | class QString; 8 | 9 | class CasterPlayerState 10 | { 11 | public: 12 | //Constructor 13 | CasterPlayerState(); 14 | 15 | // Properties 16 | QString *filePath; 17 | int volume; 18 | int startTime;// Milliseconds 19 | int stopTime;// Milliseconds 20 | bool loop; 21 | bool timeSet; 22 | int slider_H_Value; 23 | int slider_S_Value; 24 | int slider_L_Value; 25 | QString *PlayerBackgroundCSS; 26 | bool backgroundCSSChanged; 27 | }; 28 | 29 | //Operator Overloading 30 | QDataStream &operator<<(QDataStream &ds, const CasterPlayerState &cps); 31 | QDataStream &operator>>(QDataStream &ds, CasterPlayerState &cps); 32 | 33 | #endif // CASTERPLAYERSTATE_H 34 | -------------------------------------------------------------------------------- /dist/linux/CasterSoundboard.appdata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CasterSoundboard.desktop 5 | CC0-1.0 6 | LGPL-3.0 7 | CasterSoundboard 8 | A soundboard for hot-keying and playing back sounds 9 | 10 |

11 | A soundboard for hot-keying and playing back sounds. (For podcasting) 12 |

13 |
14 | 15 | 16 | https://raw.githubusercontent.com/JupiterBroadcasting/CasterSoundboard/master/docs/img/screenshot.png 17 | 18 | 19 | https://github.com/JupiterBroadcasting/CasterSoundboard 20 | https://github.com/JupiterBroadcasting/CasterSoundboard/issues 21 | fszymanski@fedoraproject.org 22 |
23 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | compiler: gcc 3 | sudo: require 4 | dist: trusty 5 | 6 | before_install: 7 | - sudo add-apt-repository ppa:beineri/opt-qt593-trusty -y 8 | - sudo apt-get update -qq 9 | 10 | install: 11 | - sudo apt-get -y install qt59base qt59declarative qt59multimedia libgl1-mesa-dev 12 | - source /opt/qt*/bin/qt*-env.sh 13 | 14 | script: 15 | - cd ./CasterSoundboard/ 16 | - qmake CONFIG+=release PREFIX=/usr 17 | - make -j$(nproc) 18 | - make INSTALL_ROOT=appdir -j$(nproc) install ; find appdir/ 19 | - wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" 20 | - chmod a+x linuxdeployqt-continuous-x86_64.AppImage 21 | - ./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/share/applications/*.desktop -appimage 22 | 23 | after_success: 24 | - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh 25 | - bash upload.sh Caster*.AppImage* 26 | 27 | branches: 28 | except: 29 | - # Do not build tags that we create when we upload to GitHub Releases 30 | - /^(?i:continuous)/ 31 | -------------------------------------------------------------------------------- /CasterSoundboard/res.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | res/img/Key.png 4 | res/img/down.png 5 | res/img/app.png 6 | res/img/pause.png 7 | res/img/play.png 8 | res/img/stop.png 9 | res/img/newTab.png 10 | res/img/about.png 11 | res/img/cog.png 12 | res/img/save.png 13 | res/img/save_as.png 14 | res/img/open.png 15 | res/img/notes.png 16 | res/img/cue.png 17 | res/img/colorPicker.png 18 | res/img/openMusic.png 19 | res/img/playState_playing.png 20 | res/img/playState_paused.png 21 | res/img/playState_stopped.png 22 | res/img/loop.png 23 | res/img/no_loop.png 24 | res/img/stopAll.png 25 | res/img/rename.png 26 | res/img/open_sound_control.png 27 | res/img/duck.png 28 | res/img/unduck.png 29 | res/img/33_percent.png 30 | 31 | 32 | -------------------------------------------------------------------------------- /CasterSoundboard/CasterPlayerState.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "CasterPlayerState.h" 3 | #include 4 | 5 | //Constructor 6 | CasterPlayerState::CasterPlayerState() 7 | { 8 | //Set Default Property Values 9 | filePath = new QString(""); 10 | volume = 100; 11 | startTime = 0; 12 | stopTime = 0; 13 | loop = false; 14 | timeSet = false; 15 | // Set Slider Defaults 16 | slider_H_Value = 0; 17 | slider_S_Value = 0; 18 | slider_L_Value = 0; 19 | PlayerBackgroundCSS = new QString(""); 20 | backgroundCSSChanged = false; 21 | } 22 | 23 | //Operator Overloading 24 | QDataStream &operator<<(QDataStream &ds, const CasterPlayerState &cps) 25 | { 26 | return ds << *cps.filePath << cps.volume 27 | << cps.startTime << cps.stopTime 28 | << cps.loop << cps.timeSet 29 | << cps.slider_H_Value << cps.slider_S_Value 30 | << cps.slider_L_Value << *cps.PlayerBackgroundCSS 31 | << cps.backgroundCSSChanged; 32 | } 33 | 34 | QDataStream &operator>>(QDataStream &ds, CasterPlayerState &cps) 35 | { 36 | return ds >> *cps.filePath >> cps.volume 37 | >> cps.startTime >> cps.stopTime 38 | >> cps.loop >> cps.timeSet 39 | >> cps.slider_H_Value >> cps.slider_S_Value 40 | >> cps.slider_L_Value >> *cps.PlayerBackgroundCSS 41 | >> cps.backgroundCSSChanged; 42 | } 43 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/OscVersion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_VERSION_H_ 24 | #define OSC_VERSION_H_ 25 | 26 | #include 27 | 28 | class OscVersion 29 | { 30 | public: 31 | enum Version 32 | { 33 | OSC_10, OSC_11 34 | }; 35 | }; 36 | 37 | #endif // OSC_VERSION_H_ 38 | -------------------------------------------------------------------------------- /CasterSoundboard/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * Copyright 2013 Oscar Cerna 5 | * 6 | * This file is part of CasterSoundboard. An application for playing hot-keyed sounds. 7 | * For more information, please visit http://sourceforge.net/projects/castersb. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU LESSER GENERAL PUBLIC LICENSE for more details. 18 | * 19 | * You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | #include "MainWindow.h" 24 | #include 25 | 26 | 27 | int main(int argc, char *argv[]) 28 | { 29 | //START APPLICATION 30 | QApplication a(argc, argv); 31 | //CREATE MAIN WINDOW 32 | MainWindow *w = new MainWindow; 33 | //SET MAIN WINDOW SIZE 34 | w->resize(1000, 500); 35 | //SHOW MAIN WINDOW 36 | w->show(); 37 | //END APPLICATION 38 | return a.exec(); 39 | } 40 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/tools/ByteOrder.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | 26 | ByteOrder::Endianness ByteOrder::endianness() 27 | { 28 | union 29 | { 30 | qint32 i; 31 | char b[sizeof(qint32)]; 32 | } u; 33 | u.i = 0x01020304; 34 | return (u.b[0] == 0x01) ? BIG_ENDIAN_DATA : LITTLE_ENDIAN_DATA; 35 | } 36 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/UnknownTagException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef UNKNOWN_TAG_EXCEPTION_H_ 24 | #define UNKNOWN_TAG_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | class UnknownTagException : public QException 29 | { 30 | public: 31 | 32 | virtual const char* what() const throw () 33 | { 34 | return "unknown type tag"; 35 | } 36 | }; 37 | 38 | #endif // UNKNOWN_TAG_EXCEPTION_H_ 39 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/GetMessageException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_MESSAGE_EXCEPTION_H_ 24 | #define OSC_MESSAGE_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | class GetMessageException : public QException 29 | { 30 | public: 31 | 32 | virtual const char* what() const throw () 33 | { 34 | return "Content does not match Message structure."; 35 | } 36 | }; 37 | 38 | #endif // OSC_MESSAGE_EXCEPTION_H_ 39 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/ReadMessageException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef READ_MESSAGE_EXCEPTION_H_ 24 | #define READ_MESSAGE_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | class ReadMessageException : public QException 29 | { 30 | public: 31 | 32 | virtual const char* what() const throw () 33 | { 34 | return "Unable to read message because of error."; 35 | } 36 | }; 37 | 38 | #endif // READ_MESSAGE_EXCEPTION_H_ 39 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/MalformedBundleException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_MALFORMED_BUNDLE_EXCEPTION_H_ 24 | #define OSC_MALFORMED_BUNDLE_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | class OscMalformedBundleException : public QException 29 | { 30 | public: 31 | 32 | virtual const char* what() const throw () 33 | { 34 | return "Malformed bunble header"; 35 | } 36 | }; 37 | 38 | #endif // OSC_MALFORMED_BUNDLE_EXCEPTION_H_ 39 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/GetBundleException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_BUNDLE_EXCEPTION_H_ 24 | #define OSC_BUNDLE_EXCEPTION_H_ 25 | 26 | #include 27 | #include 28 | 29 | class GetBundleException : public QException 30 | { 31 | public: 32 | 33 | virtual const char* what() const throw () 34 | { 35 | return "Content does not match Bundle structure."; 36 | } 37 | }; 38 | 39 | #endif // OSC_BUNDLE_EXCEPTION_H_ 40 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/Symbol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef SYMBOL_H_ 24 | #define SYMBOL_H_ 25 | 26 | #include 27 | #include 28 | 29 | class OSC_API Symbol 30 | { 31 | public: 32 | Symbol(const QString& aString) : 33 | mString(aString) 34 | { 35 | } 36 | 37 | QString getSymbol() const 38 | { 39 | return mString; 40 | } 41 | 42 | private: 43 | QString mString; 44 | }; 45 | 46 | #endif /* SYMBOL_H_ */ 47 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/CharConversionException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_CHAR_CONVERSION_EXCEPTION_H_ 24 | #define OSC_CHAR_CONVERSION_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | class CharConversionException : public QException 29 | { 30 | public: 31 | 32 | virtual const char* what() const throw () 33 | { 34 | return "Content does not match Bundle structure."; 35 | } 36 | }; 37 | 38 | #endif // OSC_CHAR_CONVERSION_EXCEPTION_H_ 39 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/LongConversionException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_LONG_CONVERSION_EXCEPTION_H_ 24 | #define OSC_LONG_CONVERSION_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | class LongConversionException : public QException 29 | { 30 | public: 31 | 32 | virtual const char* what() const throw () 33 | { 34 | return "Content does not match Bundle structure."; 35 | } 36 | }; 37 | 38 | #endif // OSC_LONG_CONVERSION_EXCEPTION_H_ 39 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/MidiConversionException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_MIDI_CONVERTION_EXCEPTION_H_ 24 | #define OSC_MIDI_CONVERTION_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | class MidiConversionException : public QException 29 | { 30 | public: 31 | 32 | virtual const char* what() const throw () 33 | { 34 | return "Content does not match Bundle structure."; 35 | } 36 | }; 37 | 38 | #endif // OSC_MIDI_CONVERTION_EXCEPTION_H_ 39 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/RgbaConversionException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_RGBA_CONVERSION_EXCEPTION_H_ 24 | #define OSC_RGBA_CONVERSION_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | class RgbaConversionException : public QException 29 | { 30 | public: 31 | 32 | virtual const char* what() const throw () 33 | { 34 | return "Content does not match Bundle structure."; 35 | } 36 | }; 37 | 38 | #endif // OSC_RGBA_CONVERSION_EXCEPTION_H_ 39 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/BytesConversionException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_BYTES_CONVERSION_EXCEPTION_H_ 24 | #define OSC_BYTES_CONVERSION_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | class BytesConversionException : public QException 29 | { 30 | public: 31 | 32 | virtual const char* what() const throw () 33 | { 34 | return "Content does not match Bundle structure."; 35 | } 36 | }; 37 | 38 | #endif // OSC_BYTES_CONVERSION_EXCEPTION_H_ 39 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/FloatConversionException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_FLOAT_CONVERSION_EXCEPTION_H_ 24 | #define OSC_FLOAT_CONVERSION_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | class FloatConversionException : public QException 29 | { 30 | public: 31 | 32 | virtual const char* what() const throw () 33 | { 34 | return "Content does not match Bundle structure."; 35 | } 36 | }; 37 | 38 | #endif // OSC_FLOAT_CONVERSION_EXCEPTION_H_ 39 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/OutOfBoundsReadException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OUT_OF_BOUNDS_READ_EXCEPTION_H_ 24 | #define OUT_OF_BOUNDS_READ_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | class OutOfBoundsReadException : public QException 29 | { 30 | public: 31 | 32 | virtual const char* what() const throw () 33 | { 34 | return "trying to read data beyond packet size limit"; 35 | } 36 | }; 37 | 38 | #endif // OUT_OF_BOUNDS_READ_EXCEPTION_H_ 39 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/OscContent.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | 26 | /** Build the current OscContent object. */ 27 | OscContent::OscContent(ByteBuffer* packet) 28 | : mPacket(packet) 29 | { 30 | mStartIdx = mPacket->getPosition(); 31 | mDataIdx = 0; 32 | } 33 | 34 | OscContent::~OscContent() { 35 | } 36 | 37 | ByteBuffer* 38 | OscContent::getPacket() 39 | { 40 | return mPacket; 41 | } 42 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/DoubleConversionException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_DOUBLE_CONVERTION_EXCEPTION_H_ 24 | #define OSC_DOUBLE_CONVERTION_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | class DoubleConversionException : public QException 29 | { 30 | public: 31 | 32 | virtual const char* what() const throw () 33 | { 34 | return "Content does not match Bundle structure."; 35 | } 36 | }; 37 | 38 | #endif // OSC_DOUBLE_CONVERTION_EXCEPTION_H_ 39 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/StringConversionException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_STRING_CONVERSION_EXCEPTION_H_ 24 | #define OSC_STRING_CONVERSION_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | class StringConversionException : public QException 29 | { 30 | public: 31 | 32 | virtual const char* what() const throw () 33 | { 34 | return "Content does not match Bundle structure."; 35 | } 36 | }; 37 | 38 | #endif // OSC_STRING_CONVERSION_EXCEPTION_H_ 39 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/SymbolConversionException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_SYMBOL_CONVERSION_EXCEPTION_H_ 24 | #define OSC_SYMBOL_CONVERSION_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | class SymbolConversionException : public QException 29 | { 30 | public: 31 | 32 | virtual const char* what() const throw () 33 | { 34 | return "Content does not match Bundle structure."; 35 | } 36 | }; 37 | 38 | #endif // OSC_SYMBOL_CONVERSION_EXCEPTION_H_ 39 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/BooleanConversionException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_BOOLEAN_CONVERSION_EXCEPTION_H_ 24 | #define OSC_BOOLEAN_CONVERSION_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | class BooleanConversionException : public QException 29 | { 30 | public: 31 | 32 | virtual const char* what() const throw () 33 | { 34 | return "Content does not match Bundle structure."; 35 | } 36 | }; 37 | 38 | #endif // OSC_BOOLEAN_CONVERSION_EXCEPTION_H_ 39 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/IntegerConversionException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_INTEGER_CONVERSION_EXCEPTION_H_ 24 | #define OSC_INTEGER_CONVERSION_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | class IntegerConversionException : public QException 29 | { 30 | public: 31 | 32 | virtual const char* what() const throw () 33 | { 34 | return "Content does not match Bundle structure."; 35 | } 36 | }; 37 | 38 | #endif // OSC_INTEGER_CONVERSION_EXCEPTION_H_ 39 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/TimetagConversionException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_TIMETAG_CONVERSION_EXCEPTION_H_ 24 | #define OSC_TIMETAG_CONVERSION_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | class TimetagConversionException : public QException 29 | { 30 | public: 31 | 32 | virtual const char* what() const throw () 33 | { 34 | return "Content does not match Bundle structure."; 35 | } 36 | }; 37 | 38 | #endif // OSC_TIMETAG_CONVERSION_EXCEPTION_H_ 39 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/MalformedArrayException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef MALFORMED_ARRAY_EXCEPTION_H_ 24 | #define MALFORMED_ARRAY_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | class MalformedArrayException : public QException 29 | { 30 | public: 31 | 32 | virtual const char* what() const throw () 33 | { 34 | return "array was not terminated before end of message (expected ']' end of array tag)"; 35 | } 36 | }; 37 | 38 | #endif // MALFORMED_ARRAY_EXCEPTION_H_ 39 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscArrayEnd.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | 25 | OscArrayEnd::OscArrayEnd(ByteBuffer* packet, qint32 pos) 26 | : OscValue(']', packet, pos) 27 | { 28 | 29 | } 30 | 31 | bool OscArrayEnd::isArrayEnd() 32 | { 33 | return true; 34 | } 35 | 36 | QByteArray OscArrayEnd::toBytes() 37 | { 38 | return QByteArray(1, 0); 39 | } 40 | 41 | double OscArrayEnd::toDouble() 42 | { 43 | return 0; 44 | } 45 | 46 | qint64 OscArrayEnd::toLong() 47 | { 48 | return 0; 49 | } 50 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute to CasterSoundboard 2 | 3 | CasterSoundboard is a volunteer-run project, built and maintained by many contributors. We welcome new team members, and value feedback from users using CastrerSoundboard. 4 | 5 | The following is a set of guidelines for contributing to CasterSoundboard, which are hosted in the Jupiter Broadcasting Organization on GitHub. These are just guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. 6 | 7 | ### Reporting a Bug Report or Requesting a Feature 8 | We utilize a template to keep our issue tracker organized. Please fill it out and remove areas that are not related to your Bug Report or Feature Request. Also keep these guidelines in mind as well: 9 | 10 | * Search before posing to avoid duplicates 11 | * Please keep the topic of the issue or feature request to **ONE** problem or request. 12 | * This will help our contributors keep the issues tracker organized. 13 | * Please fill out the areas of the template you are using. Delete the parts you are not using. 14 | * Make sure title is short but useful. It should echo the description. 15 | * `Add a "New Data not saved" confirmation` is a good example of a title. 16 | * Tell us how to reproduce the bug in clear, numbered steps. 17 | * If we can't reproduce your bug, we will have to ask more questions. Please answer promptly, otherwise your Bug Report may stall. 18 | * For Feature Requests, Ask yourself these questions before you post: 19 | * What are the advantages to having this Feature? 20 | * How will it benefit CasterSoundboard's work flow? 21 | * What will be the challenges to adding this feature? 22 | * Do you have any mockups or examples from other programs which implement this? 23 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscFalse.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | 25 | OscFalse::OscFalse(ByteBuffer* packet, qint32 pos) 26 | : OscValue('F', packet, pos) 27 | { 28 | } 29 | 30 | bool OscFalse::isFalse() 31 | { 32 | return true; 33 | } 34 | 35 | QByteArray OscFalse::toBytes() 36 | { 37 | return QByteArray(1, 0); 38 | } 39 | 40 | double OscFalse::toDouble() 41 | { 42 | return 0.0; 43 | } 44 | 45 | 46 | qint64 OscFalse::toLong() 47 | { 48 | return 0; 49 | } 50 | 51 | 52 | QString OscFalse::toString() 53 | { 54 | return "FALSE"; 55 | } 56 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/tools/ByteOrder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef BYTE_ORDER_H_ 24 | #define BYTE_ORDER_H_ 25 | 26 | #include 27 | 28 | class OSC_API ByteOrder 29 | { 30 | public: 31 | /** 32 | * \enum Endianness 33 | * \brief specifies the endianness 34 | */ 35 | enum Endianness 36 | { 37 | BIG_ENDIAN_DATA, /**< Big endian */ 38 | LITTLE_ENDIAN_DATA /**< Little endian */ 39 | }; 40 | 41 | /** 42 | * Returns the current endianness of the system 43 | * 44 | * \return the current endianness 45 | */ 46 | static Endianness endianness(); 47 | }; 48 | 49 | #endif // BYTE_ORDER_H_ 50 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscFalse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_FALSE_H_ 24 | #define OSC_FALSE_H_ 25 | 26 | #include 27 | 28 | /** Class representing an OSC-FALSE tag. */ 29 | class OSC_API OscFalse : public OscValue 30 | { 31 | public: 32 | virtual bool isFalse(); 33 | virtual QByteArray toBytes(); 34 | virtual double toDouble(); 35 | virtual qint64 toLong(); 36 | virtual QString toString(); 37 | 38 | #ifndef BUILD_UNITTESTS 39 | private: 40 | #endif 41 | OscFalse(ByteBuffer* packet, qint32 pos); 42 | 43 | friend class OscMessage; 44 | }; 45 | 46 | #endif // OSC_FALSE_H_ 47 | -------------------------------------------------------------------------------- /snap/snapcraft.yaml: -------------------------------------------------------------------------------- 1 | name: castersoundboard 2 | version: git 3 | summary: A soundboard for hot-keying and playing back sounds. (For podcasting) 4 | description: | 5 | A soundboard for hot-keying and playing back sounds. (For podcasting) 6 | 7 | grade: stable 8 | confinement: strict 9 | 10 | parts: 11 | desktop-icon: 12 | source: . 13 | plugin: nil 14 | prepare: | 15 | mkdir -p $SNAPCRAFT_PART_INSTALL/usr/share/applications 16 | mkdir -p $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps 17 | cp -v dist/linux/CasterSoundboard.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications/ 18 | cp -v dist/linux/CasterSoundboard.png $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps/ 19 | sed -i 's|Icon=CasterSoundboard|Icon=/usr/share/pixmaps/CasterSoundboard\.png|' $SNAPCRAFT_PART_INSTALL/usr/share/applications/CasterSoundboard.desktop 20 | 21 | castersoundboard: 22 | source: ./CasterSoundboard 23 | plugin: qmake 24 | qt-version: qt5 25 | after: 26 | - desktop-icon 27 | - desktop-qt5 28 | build-packages: 29 | - g++ 30 | - qt5-default 31 | - qtdeclarative5-dev 32 | - qtmultimedia5-dev 33 | stage-packages: 34 | - gstreamer1.0-plugins-bad 35 | - gstreamer1.0-plugins-base 36 | - gstreamer1.0-plugins-good 37 | - gstreamer1.0-plugins-ugly 38 | - libqt5declarative5 39 | - libqt5multimedia5 40 | - libqt5multimedia5-plugins 41 | - libqt5network5 42 | prime: 43 | - -usr/share/doc 44 | 45 | apps: 46 | castersoundboard: 47 | command: bin/desktop-launch $SNAP/usr/local/bin/CasterSoundboard 48 | desktop: usr/share/applications/CasterSoundboard.desktop 49 | plugs: 50 | - home 51 | - mount-observe 52 | - network 53 | - network-bind 54 | - opengl 55 | - pulseaudio 56 | - x11 57 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/OscContent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_CONTENT_H_ 24 | #define OSC_CONTENT_H_ 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | class OscBundle; 31 | class OscMessage; 32 | class ByteBuffer; 33 | 34 | /** 35 | * Abstract class to manage packet embedded content as objects. 36 | */ 37 | class OSC_API OscContent 38 | { 39 | 40 | public: 41 | virtual ~OscContent(); 42 | 43 | ByteBuffer* getPacket(); 44 | 45 | protected: 46 | qint32 mDataIdx; 47 | qint32 mStartIdx; 48 | ByteBuffer* mPacket; 49 | 50 | /** Build the current OscContent object. */ 51 | OscContent(ByteBuffer* packet); 52 | }; 53 | 54 | #endif // OSC_CONTENT_H_ 55 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscNil.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | 25 | /** 26 | * Build a new OscNil from the given location in packet. 27 | * 28 | * @param pos 29 | * the Nil tag position. 30 | */ 31 | OscNil::OscNil(ByteBuffer* packet, qint32 pos) 32 | : OscValue('N', packet, pos) 33 | { 34 | } 35 | 36 | bool OscNil::isNil() 37 | { 38 | return true; 39 | } 40 | 41 | char OscNil::toChar() 42 | { 43 | return 0; 44 | } 45 | 46 | QByteArray OscNil::toBytes() 47 | { 48 | return QByteArray(1, 0); 49 | } 50 | 51 | double OscNil::toDouble() 52 | { 53 | return 0; 54 | } 55 | 56 | qint64 OscNil::toLong() 57 | { 58 | return 0; 59 | } 60 | 61 | QString OscNil::toString() 62 | { 63 | return "NIL"; 64 | } 65 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscArrayBegin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | 25 | /** 26 | * Build a new OscArrayBegin from the given location in packet. 27 | * 28 | * @param pos 29 | * an ArrayBegin tag position. 30 | */ 31 | OscArrayBegin::OscArrayBegin(ByteBuffer* packet, qint32 pos) 32 | : OscValue('[', packet, pos) 33 | { 34 | } 35 | 36 | bool OscArrayBegin::isArrayBegin() 37 | { 38 | return true; 39 | } 40 | 41 | bool OscArrayBegin::toBoolean() 42 | { 43 | return true; 44 | } 45 | 46 | QByteArray OscArrayBegin::toBytes() 47 | { 48 | return QByteArray(1, 1); 49 | } 50 | 51 | double OscArrayBegin::toDouble() 52 | { 53 | return 1; 54 | } 55 | 56 | qint64 OscArrayBegin::toLong() 57 | { 58 | return 1; 59 | } 60 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscArrayEnd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_ARRAY_END_H_ 24 | #define OSC_ARRAY_END_H_ 25 | 26 | #include 27 | 28 | /** Class representing an OSC-Array-End. */ 29 | class OSC_API OscArrayEnd : public OscValue 30 | { 31 | public: 32 | virtual bool isArrayEnd(); 33 | virtual QByteArray toBytes(); 34 | virtual double toDouble(); 35 | virtual qint64 toLong(); 36 | 37 | #ifndef BUILD_UNITTESTS 38 | private: 39 | #endif 40 | /** 41 | * Build a new OscArrayEnd from the given location in packet. 42 | * 43 | * @param pos 44 | * an ArrayEnd tag position. 45 | */ 46 | OscArrayEnd(ByteBuffer* packet, qint32 pos); 47 | 48 | friend class OscMessage; 49 | 50 | }; 51 | #endif // OSC_ARRAY_END_H_ 52 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscTrue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | 25 | /** 26 | * Build a new OscTrue from the given location in packet. 27 | * 28 | * @param pos 29 | * the TRUE tag position. 30 | */ 31 | OscTrue::OscTrue(ByteBuffer* packet, qint32 pos) 32 | : OscValue('T', packet, pos) 33 | { 34 | } 35 | 36 | bool OscTrue::isTrue() 37 | { 38 | return true; 39 | } 40 | 41 | bool OscTrue::toBoolean() 42 | { 43 | return true; 44 | } 45 | 46 | QByteArray OscTrue::toBytes() 47 | { 48 | return QByteArray(1, 1); 49 | } 50 | 51 | double OscTrue::toDouble() 52 | { 53 | return 1.0; 54 | } 55 | 56 | qint64 OscTrue::toLong() 57 | { 58 | return 1; 59 | } 60 | 61 | QString OscTrue::toString() 62 | { 63 | return "TRUE"; 64 | } 65 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscNil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_NIL_H_ 24 | #define OSC_NIL_H_ 25 | 26 | #include 27 | 28 | /** Class representing an OSC-Nil tag. */ 29 | class OSC_API OscNil : public OscValue 30 | { 31 | public: 32 | virtual bool isNil(); 33 | virtual char toChar(); 34 | virtual QByteArray toBytes(); 35 | virtual double toDouble(); 36 | virtual qint64 toLong(); 37 | virtual QString toString(); 38 | 39 | #ifndef BUILD_UNITTESTS 40 | private: 41 | #endif 42 | /** 43 | * Build a new OscNil from the given location in packet. 44 | * 45 | * @param pos 46 | * the Nil tag position. 47 | */ 48 | OscNil(ByteBuffer* packet, qint32 pos); 49 | 50 | friend class OscMessage; 51 | 52 | }; 53 | 54 | #endif // OSC_NIL_H_ 55 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/tools/exceptions/BufferOverflowException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef BUFFER_OVERFLOW_EXCEPTION_H_ 24 | #define BUFFER_OVERFLOW_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | /*! \class BufferOverflowException 29 | * \brief Class which defines buffer overflow exceptions 30 | * 31 | * This class defines the buffer overflow exceptions in COCON 32 | */ 33 | class BufferOverflowException : public QException 34 | { 35 | public: 36 | /** 37 | * \brief Returns this exception message 38 | * 39 | * Returns the message emitted by this exception 40 | * 41 | * \return this exception message 42 | */ 43 | virtual const char* what() const throw () 44 | { 45 | return "Buffer Overflow Exception"; 46 | } 47 | }; 48 | 49 | #endif // BUFFER_OVERFLOW_EXCEPTION_H_ 50 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/tools/exceptions/BufferUnderflowException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef BUFFER_UNDERFLOW_EXCEPTION_H_ 24 | #define BUFFER_UNDERFLOW_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | /*! \class BufferUnderflowException 29 | * \brief Class which defines buffer underflow exceptions 30 | * 31 | * This class defines the buffer underflow exceptions in COCON 32 | */ 33 | class BufferUnderflowException : public QException 34 | { 35 | public: 36 | /** 37 | * \brief Returns this exception message 38 | * 39 | * Returns the message emitted by this exception 40 | * 41 | * \return this exception message 42 | */ 43 | virtual const char* what() const throw () 44 | { 45 | return "Buffer Underflow Exception"; 46 | } 47 | }; 48 | 49 | #endif // BUFFER_UNDERFLOW_EXCEPTION_H_ 50 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/tools/exceptions/IllegalArgumentException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef ILLEGAL_ARGUMENT_EXCEPTION_H_ 24 | #define ILLEGAL_ARGUMENT_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | /*! \class IllegalArgumentException 29 | * \brief Class which defines illegal arguments exceptions 30 | * 31 | * This class defines the illegal arguments exceptions in COCON 32 | */ 33 | class IllegalArgumentException : public QException 34 | { 35 | public: 36 | /** 37 | * \brief Returns this exception message 38 | * 39 | * Returns the message emitted by this exception 40 | * 41 | * \return this exception message 42 | */ 43 | virtual const char* what() const throw () 44 | { 45 | return "Illegal Argument Exception"; 46 | } 47 | }; 48 | 49 | #endif // ILLEGAL_ARGUMENT_EXCEPTION_H_ 50 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/tools/exceptions/IndexOutOfBoundsException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef INDEX_OUT_OF_BOUNDS_EXCEPTION_H_ 24 | #define INDEX_OUT_OF_BOUNDS_EXCEPTION_H_ 25 | 26 | #include 27 | 28 | /*! \class IndexOutOfBoundsException 29 | * \brief Class which defines index out of bounds exceptions 30 | * 31 | * This class defines the index out of bounds exceptions in COCON 32 | */ 33 | class IndexOutOfBoundsException : public QException 34 | { 35 | public: 36 | /** 37 | * \brief Returns this exception message 38 | * 39 | * Returns the message emitted by this exception 40 | * 41 | * \return this exception message 42 | */ 43 | virtual const char* what() const throw () 44 | { 45 | return "Index Out Of Bounds Exception"; 46 | } 47 | }; 48 | 49 | #endif // INDEX_OUT_OF_BOUNDS_EXCEPTION_H_ 50 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscArrayBegin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_ARRAY_BEGIN_H_ 24 | #define OSC_ARRAY_BEGIN_H_ 25 | 26 | #include 27 | 28 | /** Class representing an OSC-Array-Begin. */ 29 | class OSC_API OscArrayBegin : public OscValue 30 | { 31 | public: 32 | virtual bool isArrayBegin(); 33 | virtual bool toBoolean(); 34 | virtual QByteArray toBytes(); 35 | virtual double toDouble(); 36 | virtual qint64 toLong(); 37 | 38 | #ifndef BUILD_UNITTESTS 39 | private: 40 | #endif 41 | /** 42 | * Build a new OscArrayBegin from the given location in packet. 43 | * 44 | * @param pos 45 | * an ArrayBegin tag position. 46 | */ 47 | OscArrayBegin(ByteBuffer* packet, qint32 pos); 48 | 49 | friend class OscMessage; 50 | 51 | }; 52 | 53 | #endif // OSC_ARRAY_BEGIN_H_ 54 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscTrue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_TRUE_H_ 24 | #define OSC_TRUE_H_ 25 | 26 | #include 27 | 28 | /** Class representing an OSC-TRUE tag. */ 29 | class OSC_API OscTrue : public OscValue 30 | { 31 | public: 32 | virtual bool isTrue(); 33 | virtual bool toBoolean(); 34 | virtual QByteArray toBytes(); 35 | virtual double toDouble(); 36 | virtual qint64 toLong(); 37 | virtual QString toString(); 38 | 39 | #ifndef BUILD_UNITTESTS 40 | private: 41 | #endif 42 | /** 43 | * Build a new OscTrue from the given location in packet. 44 | * 45 | * @param pos 46 | * the TRUE tag position. 47 | */ 48 | OscTrue(ByteBuffer* packet, qint32 pos); 49 | 50 | /** */ 51 | 52 | 53 | friend class OscMessage; 54 | 55 | }; 56 | 57 | #endif // OSC_TRUE_H_ 58 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscChar.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_CHAR_H_ 24 | #define OSC_CHAR_H_ 25 | 26 | #include 27 | 28 | /** Class representing an OSC-char. */ 29 | class OSC_API OscChar : public OscValue 30 | { 31 | public: 32 | virtual bool toBoolean(); 33 | virtual QByteArray toBytes(); 34 | virtual char toChar(); 35 | virtual double toDouble(); 36 | virtual qint64 toLong(); 37 | virtual QString toString(); 38 | 39 | #ifndef BUILD_UNITTESTS 40 | private: 41 | #endif 42 | /** 43 | * Returns the char value. 44 | * 45 | * @return a char value. 46 | */ 47 | qint32 get(); 48 | 49 | /** 50 | * Build a new OscChar from the given location in packet. 51 | * 52 | * @param pos 53 | * the char value position. 54 | */ 55 | OscChar(ByteBuffer* packet, qint32 pos); 56 | 57 | friend class OscMessage; 58 | }; 59 | 60 | #endif // OSC_CHAR_H_ 61 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscInfinitum.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_INFINITUM_H_ 24 | #define OSC_INFINITUM_H_ 25 | 26 | #include 27 | 28 | /** Class representing an OSC-Infinitum tag. */ 29 | class OSC_API OscInfinitum : public OscValue 30 | { 31 | public: 32 | virtual bool isInfinitum(); 33 | virtual bool toBoolean(); 34 | virtual QByteArray toBytes(); 35 | virtual char toChar(); 36 | virtual double toDouble(); 37 | virtual float toFloat(); 38 | virtual qint32 toInteger(); 39 | virtual qint64 toLong(); 40 | virtual QString toString(); 41 | 42 | #ifndef BUILD_UNITTESTS 43 | private: 44 | #endif 45 | /** 46 | * Build a new OscInfinitum from the given location in packet. 47 | * 48 | * @param pos 49 | * the Infinitum tag position. 50 | */ 51 | OscInfinitum(ByteBuffer* packet, qint32 pos); 52 | 53 | friend class OscMessage; 54 | }; 55 | 56 | #endif // OSC_INFINITUM_H_ 57 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/OscAPI.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef _OSC_API_H_ 24 | #define _OSC_API_H_ 25 | 26 | #include 27 | 28 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) 29 | #ifdef Q_OS_WIN 30 | // Define to export or import depending if we are building or using the library. 31 | // OSC_EXPORT should only be defined when building. 32 | #if defined(OSC_EXPORT) 33 | #define OSC_API __declspec(dllexport) 34 | #else 35 | #define OSC_API __declspec(dllimport) 36 | #endif 37 | #else 38 | // Define empty for other platforms 39 | #define OSC_API 40 | #endif 41 | #else 42 | #ifdef Q_WS_WIN 43 | // Define to export or import depending if we are building or using the library. 44 | // OSC_EXPORT should only be defined when building. 45 | #if defined(OSC_EXPORT) 46 | #define OSC_API __declspec(dllexport) 47 | #else 48 | #define OSC_API __declspec(dllimport) 49 | #endif 50 | #else 51 | // Define empty for other platforms 52 | #define OSC_API 53 | #endif 54 | #endif 55 | 56 | #endif // _OSC_API_H_ 57 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscFloat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_FLOAT_H_ 24 | #define OSC_FLOAT_H_ 25 | 26 | #include 27 | 28 | /** Class representing an OSC-Float value. */ 29 | class OSC_API OscFloat : public OscValue 30 | { 31 | public: 32 | virtual bool toBoolean(); 33 | virtual QByteArray toBytes(); 34 | virtual char toChar(); 35 | virtual double toDouble(); 36 | virtual qint64 toLong(); 37 | virtual Midi toMIDI(); 38 | virtual RGBA toRGBA(); 39 | virtual QString toString(); 40 | 41 | #ifndef BUILD_UNITTESTS 42 | private: 43 | #endif 44 | /** 45 | * Build a new OscFloat from the given location in packet. 46 | * 47 | * @param pos 48 | * the float value position. 49 | */ 50 | OscFloat(ByteBuffer* packet, qint32 pos); 51 | 52 | /** 53 | * Returns the float value. 54 | * 55 | * @return a float value. 56 | */ 57 | float get(); 58 | 59 | friend class OscMessage; 60 | }; 61 | 62 | #endif // OSC_FLOAT_H_ 63 | -------------------------------------------------------------------------------- /CasterSoundboard/CasterCuePicker.h: -------------------------------------------------------------------------------- 1 | #ifndef CASTERCUEPICKER_H 2 | #define CASTERCUEPICKER_H 3 | #include 4 | 5 | //forward declarations 6 | class QMediaPlayer; 7 | class QWidget; 8 | class QSlider; 9 | class QLineEdit; 10 | class QPushButton; 11 | class QLabel; 12 | class QString; 13 | class QVBoxLayout; 14 | class QHBoxLayout; 15 | 16 | 17 | 18 | class CasterCuePicker : public QDialog 19 | { 20 | Q_OBJECT 21 | public: 22 | //Constructor 23 | CasterCuePicker(int _startTime, int _stopTime); //don't forget to pass the parent 24 | 25 | //PROPERTIES 26 | bool ok;//DiagResult 27 | int duration; 28 | int startTime;// Milliseconds 29 | int stopTime;// Milliseconds 30 | bool loop; 31 | QMediaPlayer *player;//Media Player 32 | 33 | //METHODS 34 | void setVolume(int _volume); 35 | void setFilePath(QString *_filePath, int _duration, bool _loop); 36 | void setStartTime(int _startTime); 37 | void setStopTime(int _stopTime); 38 | 39 | //WIDGETS 40 | 41 | 42 | protected: 43 | //PROPERTIES 44 | 45 | //METHODS 46 | void closeEvent(QCloseEvent *event); 47 | 48 | //WIDGETS 49 | 50 | private: 51 | //PROPERTIES 52 | 53 | //METHODS 54 | QString getTimeString(int timeInMilliseconds); 55 | 56 | //WIDGETS 57 | QLabel *label_StartTimeText; 58 | QLabel *label_StopTimeText; 59 | QLabel *label_StartTime; 60 | QLabel *label_StopTime; 61 | QSlider *slider_StartTime; 62 | QSlider *slider_StopTime; 63 | QPushButton *button_Preview; 64 | QPushButton *button_Cancel; 65 | QPushButton *button_Accept; 66 | 67 | QVBoxLayout *layout_main; 68 | QHBoxLayout *layout_startTimeWidgets; 69 | QHBoxLayout *layout_stopTimeWidgets; 70 | QHBoxLayout *layout_buttons; 71 | 72 | signals: 73 | //SIGNALS 74 | 75 | public slots: 76 | //SLOTS 77 | void slider_StartTime_valueChanged(int value); 78 | void slider_StopTime_valueChanged(int value); 79 | void button_Preview_Clicked(); 80 | void button_Accept_Clicked(); 81 | void button_Cancel_Clicked(); 82 | void playerPositionChanged(qint64 position); 83 | 84 | }; 85 | 86 | #endif // CASTERCUEPICKER_H 87 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscInteger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_INTEGER_H_ 24 | #define OSC_INTEGER_H_ 25 | 26 | #include 27 | 28 | /** 29 | * Class representing an OSC-int32. 30 | */ 31 | class OSC_API OscInteger : public OscValue 32 | { 33 | public: 34 | virtual bool toBoolean(); 35 | virtual QByteArray toBytes(); 36 | virtual char toChar(); 37 | virtual double toDouble(); 38 | virtual qint64 toLong(); 39 | virtual Midi toMIDI(); 40 | virtual RGBA toRGBA(); 41 | virtual QString toString(); 42 | 43 | #ifndef BUILD_UNITTESTS 44 | private: 45 | #endif 46 | /** 47 | * Build a new OscInteger from the given location in packet. 48 | * 49 | * @param pos 50 | * the int32 value position. 51 | */ 52 | OscInteger(ByteBuffer* packet, qint32 pos); 53 | 54 | /** 55 | * Returns the int32 value. 56 | * 57 | * @return an qint32 value. 58 | */ 59 | qint32 get(); 60 | 61 | friend class OscMessage; 62 | }; 63 | 64 | #endif // OSC_INTEGER_H_ 65 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscLong.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_LONG_H_ 24 | #define OSC_LONG_H_ 25 | 26 | #include 27 | 28 | /** Class representing an OSC-int64 value. */ 29 | class OSC_API OscLong : public OscValue 30 | { 31 | public: 32 | virtual bool toBoolean(); 33 | virtual QByteArray toBytes(); 34 | virtual char toChar(); 35 | virtual double toDouble(); 36 | virtual qint64 toLong(); 37 | virtual Midi toMIDI(); 38 | virtual RGBA toRGBA(); 39 | virtual QString toString(); 40 | virtual QDateTime toTimetag(); 41 | 42 | #ifndef BUILD_UNITTESTS 43 | private: 44 | #endif 45 | /** 46 | * Build a new OscInt64 from the given location in packet. 47 | * 48 | * @param pos 49 | * the int64 value position. 50 | */ 51 | OscLong(ByteBuffer* packet, qint32 pos); 52 | 53 | /** 54 | * Returns the long value. 55 | * 56 | * @return a long value. 57 | */ 58 | qint64 get(); 59 | 60 | friend class OscMessage; 61 | }; 62 | 63 | #endif // OSC_LONG_H_ 64 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscDouble.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_DOUBLE_H_ 24 | #define OSC_DOUBLE_H_ 25 | 26 | #include 27 | 28 | /** Class representing an OSC-double. */ 29 | class OSC_API OscDouble : public OscValue 30 | { 31 | public: 32 | virtual bool toBoolean(); 33 | virtual QByteArray toBytes(); 34 | virtual char toChar(); 35 | virtual double toDouble(); 36 | virtual qint64 toLong(); 37 | virtual Midi toMIDI(); 38 | virtual RGBA toRGBA(); 39 | virtual QString toString(); 40 | virtual QDateTime toTimetag(); 41 | 42 | #ifndef BUILD_UNITTESTS 43 | private: 44 | #endif 45 | /** 46 | * Build a new OscDouble from the given location in packet. 47 | * 48 | * @param pos 49 | * the double value position. 50 | */ 51 | OscDouble(ByteBuffer* packet, qint32 pos); 52 | 53 | /** 54 | * Returns the double value. 55 | * 56 | * @return a double value. 57 | */ 58 | double get(); 59 | 60 | friend class OscMessage; 61 | }; 62 | 63 | #endif // OSC_DOUBLE_H_ 64 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscMidi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_MIDI_H_ 24 | #define OSC_MIDI_H_ 25 | 26 | #include 27 | 28 | /** Class representing an OSC-Midi message. */ 29 | class OSC_API OscMidi : public OscValue 30 | { 31 | public: 32 | virtual bool toBoolean(); 33 | virtual QByteArray toBytes(); 34 | virtual char toChar(); 35 | virtual float toFloat(); 36 | virtual double toDouble(); 37 | virtual qint64 toLong(); 38 | virtual Midi toMIDI(); 39 | virtual RGBA toRGBA(); 40 | virtual QString toString(); 41 | 42 | #ifndef BUILD_UNITTESTS 43 | private: 44 | #endif 45 | /** 46 | * Build a new OscMidi from the given location in packet. 47 | * 48 | * @param pos 49 | * the MIDI message position. 50 | */ 51 | OscMidi(ByteBuffer* packet, qint32 pos); 52 | 53 | /** 54 | * Returns the MIDI message value. 55 | * 56 | * @return an qint32 value. 57 | */ 58 | QByteArray get(); 59 | 60 | friend class OscMessage; 61 | 62 | }; 63 | 64 | #endif // OSC_MIDI_H_ 65 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscBlob.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_BLOB_H_ 24 | #define OSC_BLOB_H_ 25 | 26 | #include 27 | 28 | /** Class representing an OSC-Blob. */ 29 | class OSC_API OscBlob : public OscValue 30 | { 31 | public: 32 | virtual bool toBoolean(); 33 | virtual QByteArray toBytes(); 34 | virtual char toChar(); 35 | virtual double toDouble(); 36 | virtual float toFloat(); 37 | virtual qint32 toInteger(); 38 | virtual qint64 toLong(); 39 | virtual QString toString(); 40 | 41 | #ifndef BUILD_UNITTESTS 42 | private: 43 | #endif 44 | /** 45 | * Build a new OscBlob from the given location in packet. 46 | * 47 | * @param pos 48 | * the Blob byte array position. 49 | */ 50 | OscBlob(ByteBuffer* packet, qint32 pos); 51 | 52 | /** 53 | * Returns the blob data. 54 | * 55 | * @return a blob data. 56 | */ 57 | QByteArray& get(); 58 | 59 | QByteArray mData; 60 | qint32 mBlobSize; 61 | 62 | friend class OscMessage; 63 | 64 | }; 65 | 66 | #endif // OSC_BLOB_H_ 67 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscChar.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | 26 | /** 27 | * Build a new OscChar from the given location in packet. 28 | * 29 | * @param pos 30 | * the char value position. 31 | */ 32 | OscChar::OscChar(ByteBuffer* packet, qint32 pos) 33 | : OscValue('c', packet, pos) 34 | { 35 | mPacket->getInt(); 36 | } 37 | 38 | /** 39 | * Returns the char value. 40 | * 41 | * @return a char value. 42 | */ 43 | qint32 OscChar::get() 44 | { 45 | return mPacket->getInt(mPos); 46 | } 47 | 48 | bool OscChar::toBoolean() 49 | { 50 | return (get() != 0); 51 | } 52 | 53 | QByteArray OscChar::toBytes() 54 | { 55 | return QByteArray(1, (char)get()); 56 | } 57 | 58 | char OscChar::toChar() 59 | { 60 | return get(); 61 | } 62 | 63 | double OscChar::toDouble() 64 | { 65 | return get(); 66 | } 67 | 68 | qint64 OscChar::toLong() 69 | { 70 | return get(); 71 | } 72 | 73 | QString OscChar::toString() 74 | { 75 | return QChar(get()); 76 | } 77 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscRGBA.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_RGBA_H_ 24 | #define OSC_RGBA_H_ 25 | 26 | #include 27 | 28 | /** Class representing an OSC-RGBA-color value. */ 29 | class OSC_API OscRGBA : public OscValue 30 | { 31 | public: 32 | virtual bool toBoolean(); 33 | virtual QByteArray toBytes(); 34 | virtual char toChar(); 35 | virtual float toFloat(); 36 | virtual double toDouble(); 37 | virtual qint64 toLong(); 38 | virtual Midi toMIDI(); 39 | virtual RGBA toRGBA(); 40 | virtual QString toString(); 41 | 42 | #ifndef BUILD_UNITTESTS 43 | private: 44 | #endif 45 | /** 46 | * Build a new OscRGBA from the given location in packet. 47 | * 48 | * @param pos 49 | * the RGBA color value position. 50 | */ 51 | 52 | OscRGBA(ByteBuffer* packet, qint32 pos); 53 | 54 | /** 55 | * Returns the RGBA color value. 56 | * 57 | * @return an qint32 value. 58 | */ 59 | QByteArray get(); 60 | 61 | friend class OscMessage; 62 | 63 | }; 64 | 65 | #endif // OSC_RGBA_H_ 66 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscString.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_STRING_H_ 24 | #define OSC_STRING_H_ 25 | 26 | #include 27 | 28 | /** Class representing an OSC-string value. */ 29 | class OSC_API OscString : public OscValue 30 | { 31 | public: 32 | virtual bool toBoolean(); 33 | virtual QByteArray toBytes(); 34 | virtual char toChar(); 35 | virtual float toFloat(); 36 | virtual double toDouble(); 37 | virtual qint32 toInteger(); 38 | virtual qint64 toLong(); 39 | virtual QString toString(); 40 | virtual QString toSymbol(); 41 | 42 | #ifndef BUILD_UNITTESTS 43 | private: 44 | #endif 45 | /** 46 | * Build a new OscString from the given location in packet. 47 | * 48 | * @param pos 49 | * the string position. 50 | */ 51 | OscString(ByteBuffer* packet, qint32 pos); 52 | 53 | /** 54 | * Returns the string value. 55 | * 56 | * @return a string value. 57 | */ 58 | QByteArray get(); 59 | 60 | friend class OscMessage; 61 | 62 | }; 63 | 64 | #endif // OSC_STRING_H_ 65 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscSymbol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_SYMBOL_H_ 24 | #define OSC_SYMBOL_H_ 25 | 26 | #include 27 | 28 | /** Class representing an OSC-symbol value. */ 29 | class OSC_API OscSymbol : public OscValue 30 | { 31 | public: 32 | virtual bool toBoolean(); 33 | virtual QByteArray toBytes(); 34 | virtual char toChar(); 35 | virtual float toFloat(); 36 | virtual double toDouble(); 37 | virtual qint32 toInteger(); 38 | virtual qint64 toLong(); 39 | virtual QString toString(); 40 | virtual QString toSymbol(); 41 | 42 | #ifndef BUILD_UNITTESTS 43 | private: 44 | #endif 45 | /** 46 | * Build a new OscSymbol from the given location in packet. 47 | * 48 | * @param pos 49 | * the Symbol string value position. 50 | */ 51 | OscSymbol(ByteBuffer* packet, qint32 pos); 52 | 53 | /** 54 | * Returns the Symbol value. 55 | * 56 | * @return a string value. 57 | */ 58 | QByteArray get(); 59 | 60 | friend class OscMessage; 61 | 62 | }; 63 | 64 | #endif // OSC_SYMBOL_H_ 65 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscAddress.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_ADDRESS_H_ 24 | #define OSC_ADDRESS_H_ 25 | 26 | #include 27 | 28 | /** Class representing an OSC-Address-Pattern. */ 29 | class OSC_API OscAddress : public OscValue 30 | { 31 | 32 | public: 33 | virtual bool toBoolean(); 34 | virtual QByteArray toBytes(); 35 | virtual char toChar(); 36 | virtual double toDouble(); 37 | virtual float toFloat(); 38 | virtual qint32 toInteger(); 39 | virtual qint64 toLong(); 40 | virtual QString toString(); 41 | 42 | virtual ~OscAddress() {}; 43 | 44 | #ifndef BUILD_UNITTESTS 45 | private: 46 | #endif 47 | /** 48 | * Build a new OscAddress from the given location in packet. 49 | * 50 | * @param pos 51 | * an address pattern string position. 52 | */ 53 | OscAddress(ByteBuffer* packet, qint32 pos); 54 | 55 | /** 56 | * Returns the address pattern string. 57 | * 58 | * @return a string 59 | */ 60 | QString get(); 61 | 62 | friend class OscMessage; 63 | }; 64 | 65 | #endif // OSC_ADDRESS_H_ 66 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscTags.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_TAGS_H_ 24 | #define OSC_TAGS_H_ 25 | 26 | #include 27 | 28 | /** Class representing the type tags string of this message. */ 29 | class OSC_API OscTags: public OscValue 30 | { 31 | public: 32 | virtual bool toBoolean(); 33 | virtual QByteArray toBytes(); 34 | virtual char toChar(); 35 | virtual double toDouble(); 36 | virtual float toFloat(); 37 | virtual qint32 toInteger(); 38 | virtual qint64 toLong(); 39 | virtual Midi toMIDI(); 40 | virtual RGBA toRGBA(); 41 | virtual QString toString(); 42 | virtual QString toSymbol(); 43 | virtual QDateTime toTimetag(); 44 | 45 | private: 46 | /** 47 | * Build a new OscTags from the given location in packet. 48 | * 49 | * @param pos 50 | * the message type tags string position. 51 | */ 52 | OscTags(ByteBuffer* packet, qint32 pos); 53 | 54 | /** 55 | * Returns the OSC type tags associated to this message. 56 | * 57 | * @return a string value. 58 | */ 59 | QString get(); 60 | 61 | friend class OscMessage; 62 | 63 | }; 64 | 65 | #endif // OSC_TAGS_H_ 66 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscTimetag.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_Timetag_H_ 24 | #define OSC_Timetag_H_ 25 | 26 | #include 27 | #include 28 | 29 | /** Class representing an OSC-Timetag value. */ 30 | class OSC_API OscTimetag : public OscValue 31 | { 32 | public: 33 | virtual bool toBoolean(); 34 | virtual QByteArray toBytes(); 35 | virtual char toChar(); 36 | virtual double toDouble(); 37 | virtual float toFloat(); 38 | virtual qint32 toInteger(); 39 | virtual qint64 toLong(); 40 | virtual Midi toMIDI(); 41 | virtual RGBA toRGBA(); 42 | virtual QString toString(); 43 | virtual QDateTime toTimetag(); 44 | 45 | #ifndef BUILD_UNITTESTS 46 | private: 47 | #endif 48 | /** 49 | * Build a new OscTimetag from the given location in packet. 50 | * 51 | * @param pos 52 | * the time tag value position. 53 | */ 54 | OscTimetag(ByteBuffer* packet, qint32 pos); 55 | 56 | /** 57 | * Returns the OSC Timetag value. 58 | * 59 | * @return a long value. 60 | */ 61 | NtpTimestamp get(); 62 | 63 | friend class OscMessage; 64 | }; 65 | 66 | #endif // OSC_Timetag_H_ 67 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/RGBA.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef RGBA_H_ 24 | #define RGBA_H_ 25 | 26 | #include 27 | 28 | class OSC_API RGBA 29 | { 30 | private: 31 | qint32 mPacked; 32 | public: 33 | RGBA() 34 | { 35 | mPacked = 0; 36 | } 37 | 38 | RGBA(const QByteArray& bytes) 39 | { 40 | mPacked = *(int*)bytes.constData(); 41 | } 42 | 43 | RGBA(qint32 aPackedRGBA) 44 | { 45 | mPacked = aPackedRGBA; 46 | } 47 | 48 | RGBA(char r, char g, char b, char a) 49 | { 50 | mPacked = 0; 51 | mPacked &= r; 52 | mPacked <<= 8; 53 | mPacked &= g; 54 | mPacked <<= 8; 55 | mPacked &= b; 56 | mPacked <<= 8; 57 | mPacked &= a; 58 | } 59 | 60 | qint32 getPackedRGBA() 61 | { 62 | return mPacked; 63 | } 64 | 65 | void getUnpackedRGBA(qint32 &r, qint32 &g, qint32 &b, qint32 &a) 66 | { 67 | a = mPacked & 0xFF; 68 | mPacked >>= 8; 69 | b = mPacked & 0xFF; 70 | mPacked >>= 8; 71 | g = mPacked & 0xFF; 72 | mPacked >>= 8; 73 | r = mPacked & 0xFF; 74 | } 75 | 76 | bool operator== (const RGBA& rgba) const 77 | { 78 | return mPacked == rgba.mPacked; 79 | } 80 | }; 81 | 82 | #endif // RGBA_H_ 83 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/Midi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef MIDI_H_ 24 | #define MIDI_H_ 25 | 26 | #include 27 | 28 | class OSC_API Midi 29 | { 30 | private: 31 | char mPort; 32 | char mStatus; 33 | char mData1; 34 | char mData2; 35 | public: 36 | Midi() 37 | { 38 | mPort = 'm'; 39 | mStatus = 'i'; 40 | mData1 = 'd'; 41 | mData2 = 'i'; 42 | } 43 | 44 | Midi(const QByteArray& aByteArray) 45 | { 46 | mPort = aByteArray[0]; 47 | mStatus = aByteArray[1]; 48 | mData1 = aByteArray[2]; 49 | mData2 = aByteArray[3]; 50 | } 51 | 52 | Midi(char aPort, char aStatus, char aData1, char aData2) 53 | { 54 | mPort = aPort; 55 | mStatus = aStatus; 56 | mData1 = aData1; 57 | mData2 = aData2; 58 | } 59 | 60 | char getPort() const 61 | { 62 | return mPort; 63 | } 64 | 65 | char getStatus() const 66 | { 67 | return mStatus; 68 | } 69 | 70 | char getData1() const 71 | { 72 | return mData1; 73 | } 74 | 75 | char getData2() const 76 | { 77 | return mData2; 78 | } 79 | 80 | bool operator== (const Midi& m) const 81 | { 82 | return mData1 == m.mData1 83 | && mData2 == m.mData2 84 | && mPort == m.mPort 85 | && mStatus == m.mStatus; 86 | } 87 | }; 88 | 89 | 90 | #endif // MIDI_H_ 91 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscInfinitum.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | 26 | /** 27 | * Build a new OscInfinitum from the given location in packet. 28 | * 29 | * @param pos 30 | * the Infinitum tag position. 31 | */ 32 | OscInfinitum::OscInfinitum(ByteBuffer* packet, qint32 pos) 33 | : OscValue('I', packet, pos) 34 | { 35 | } 36 | 37 | bool OscInfinitum::isInfinitum() 38 | { 39 | return true; 40 | } 41 | 42 | bool OscInfinitum::toBoolean() 43 | { 44 | return true; 45 | } 46 | 47 | QByteArray OscInfinitum::toBytes() 48 | { 49 | return QByteArray(1, std::numeric_limits::infinity()); 50 | } 51 | 52 | char OscInfinitum::toChar() 53 | { 54 | return std::numeric_limits::infinity(); 55 | } 56 | 57 | double OscInfinitum::toDouble() 58 | { 59 | return std::numeric_limits::infinity(); 60 | } 61 | 62 | float OscInfinitum::toFloat() 63 | { 64 | return std::numeric_limits::infinity(); 65 | } 66 | 67 | qint32 OscInfinitum::toInteger() 68 | { 69 | return std::numeric_limits::infinity(); 70 | } 71 | 72 | qint64 OscInfinitum::toLong() 73 | { 74 | return std::numeric_limits::infinity(); 75 | } 76 | 77 | QString OscInfinitum::toString() 78 | { 79 | return "INF"; 80 | } 81 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscFloat.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | OscFloat::OscFloat(ByteBuffer* packet, qint32 pos) 29 | : OscValue('f', packet, pos) 30 | { 31 | mPacket->getFloat(); 32 | } 33 | 34 | float OscFloat::get() 35 | { 36 | return mPacket->getFloat(mPos); 37 | } 38 | 39 | bool OscFloat::toBoolean() 40 | { 41 | return (get() != 0); 42 | } 43 | 44 | QByteArray OscFloat::toBytes() 45 | { 46 | float f = get(); 47 | QByteArray bytes(4, 0); 48 | bytes.insert(0, (char*)&f, 4); 49 | return bytes; 50 | } 51 | 52 | char OscFloat::toChar() 53 | { 54 | float f = get(); 55 | if (f > std::numeric_limits::min() && f < std::numeric_limits::max()) 56 | return (char)get(); 57 | else 58 | throw CharConversionException(); 59 | } 60 | 61 | double OscFloat::toDouble() 62 | { 63 | return get(); 64 | } 65 | 66 | qint64 OscFloat::toLong() 67 | { 68 | return (qint64)get(); 69 | } 70 | 71 | Midi OscFloat::toMIDI() 72 | { 73 | return Midi(toBytes()); 74 | } 75 | 76 | RGBA OscFloat::toRGBA() 77 | { 78 | return RGBA(toBytes()); 79 | } 80 | 81 | QString OscFloat::toString() 82 | { 83 | return QString::number(get()); 84 | } 85 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscInteger.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | OscInteger::OscInteger(ByteBuffer* packet, qint32 pos) 29 | : OscValue('i', packet, pos) 30 | { 31 | mPacket->getInt(); 32 | } 33 | 34 | qint32 OscInteger::get() 35 | { 36 | return mPacket->getInt(mPos); 37 | } 38 | 39 | bool OscInteger::toBoolean() 40 | { 41 | return (get() != 0); 42 | } 43 | 44 | QByteArray OscInteger::toBytes() 45 | { 46 | qint32 i = get(); 47 | QByteArray bytes(4, 0); 48 | bytes.insert(0, (char*)&i, 4); 49 | return bytes; 50 | } 51 | 52 | char OscInteger::toChar() 53 | { 54 | qint32 i = get(); 55 | if (i > std::numeric_limits::min() && i < std::numeric_limits::max()) 56 | return (char)get(); 57 | else 58 | throw CharConversionException(); 59 | } 60 | 61 | double OscInteger::toDouble() 62 | { 63 | return get(); 64 | } 65 | 66 | qint64 OscInteger::toLong() 67 | { 68 | return get(); 69 | } 70 | 71 | Midi OscInteger::toMIDI() 72 | { 73 | return Midi(toBytes()); 74 | } 75 | 76 | RGBA OscInteger::toRGBA() 77 | { 78 | return RGBA(toBytes()); 79 | } 80 | 81 | QString OscInteger::toString() 82 | { 83 | return QString::number(get()); 84 | } 85 | 86 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/exceptions/OSC_ALL_EXCEPTIONS.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_ALL_EXCEPTIONS_H_ 24 | #define OSC_ALL_EXCEPTIONS_H_ 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | #endif // OSC_ALL_EXCEPTIONS_H_ 47 | -------------------------------------------------------------------------------- /CasterSoundboard/CasterLabelColorPicker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * Copyright 2013 Oscar Cerna 5 | * 6 | * This file is part of CasterSoundboard. An application for playing hot-keyed sounds. 7 | * For more information, please visit http://sourceforge.net/projects/castersb. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU LESSER GENERAL PUBLIC LICENSE for more details. 18 | * 19 | * You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | #ifndef CASTERLABELCOLORPICKER_H 24 | #define CASTERLABELCOLORPICKER_H 25 | #include 26 | 27 | //forward declarations 28 | class QWidget; 29 | class QSlider; 30 | class QLineEdit; 31 | class QPushButton; 32 | class QLabel; 33 | class QString; 34 | 35 | class CasterLabelColorPicker : public QDialog //inherit from QWidget 36 | { 37 | Q_OBJECT 38 | public: 39 | //Constructor 40 | CasterLabelColorPicker(); 41 | 42 | //PROPERTIES 43 | bool ok; 44 | QString currentCSS; 45 | int slider_H_Value; 46 | int slider_S_Value; 47 | int slider_L_Value; 48 | 49 | //METHODS 50 | void set_slider_H_Value(int H_Value); 51 | void set_slider_S_Value(int S_Value); 52 | void set_slider_L_Value(int L_Value); 53 | 54 | //WIDGETS 55 | 56 | 57 | protected: 58 | //PROPERTIES 59 | 60 | //METHODS 61 | 62 | //WIDGETS 63 | 64 | private: 65 | //PROPERTIES 66 | 67 | //METHODS 68 | 69 | //WIDGETS 70 | QLabel *label_H; 71 | QLabel *label_S; 72 | QLabel *label_L; 73 | QLabel *label_H_Value; 74 | QLabel *label_S_Value; 75 | QLabel *label_L_Value; 76 | QSlider *slider_H; 77 | QSlider *slider_S; 78 | QSlider *slider_L; 79 | QWidget *widget_Color_Label; 80 | QPushButton *button_Cancel; 81 | QPushButton *button_Accept; 82 | 83 | 84 | signals: 85 | //SIGNALS 86 | 87 | public slots: 88 | //SLOTS 89 | void slider_HSL_valueChanged(int value); 90 | void button_Accept_Clicked(); 91 | void button_Cancel_Clicked(); 92 | 93 | }; 94 | #endif // CASTERLABELCOLORPICKER_H 95 | -------------------------------------------------------------------------------- /CasterSoundboard/CasterOSCServerConfigPicker.h: -------------------------------------------------------------------------------- 1 | #ifndef CASTEROSCSERVERCONFIGPICKER_H 2 | #define CASTEROSCSERVERCONFIGPICKER_H 3 | #include 4 | 5 | //forward declarations 6 | class QWidget; 7 | class QSlider; 8 | class QLineEdit; 9 | class QPushButton; 10 | class QLabel; 11 | class QString; 12 | class QVBoxLayout; 13 | class QHBoxLayout; 14 | class QHostAddress; 15 | 16 | 17 | 18 | class CasterOSCServerConfigPicker : public QDialog 19 | { 20 | Q_OBJECT 21 | public: 22 | // Static 23 | static const int Action_Neutral = 0; 24 | static const int Action_Start_Server = 1; 25 | static const int Action_Kill_Server = 2; 26 | 27 | //Constructor 28 | CasterOSCServerConfigPicker(QString _inbound_ipv4, int _inbound_port, QString _outbound_ipv4, int _outbound_port); 29 | 30 | 31 | //PROPERTIES 32 | bool ok;//DiagResult 33 | int Result = 0; 34 | 35 | //METHODS 36 | //Inbound 37 | void setInBoundIPv4(QString *ip); 38 | void setInBoundPort(int port); 39 | int getInboundPort(); 40 | 41 | //Outbound 42 | void setOutBoundIPv4(QString *ip); 43 | QString getOutboundIPv4(); 44 | void setOutBoundPort(int port); 45 | int getOutboundPort(); 46 | 47 | //MISC 48 | void setIsServerRunning(bool isRunning); 49 | bool getIsServerRunning(); 50 | 51 | //WIDGETS 52 | 53 | 54 | protected: 55 | //PROPERTIES 56 | 57 | //METHODS 58 | void closeEvent(QCloseEvent *event); 59 | 60 | //WIDGETS 61 | 62 | private: 63 | //PROPERTIES 64 | bool server_is_running = false; 65 | QString *inbound_ipv4; 66 | int inbound_port = 8000; 67 | QString *outbound_ipv4; 68 | int outbound_port = 9000; 69 | 70 | //METHODS 71 | 72 | //WIDGETS 73 | QLabel *label_General; 74 | QLabel *label_Inbound; 75 | QLabel *label_Outbound; 76 | QLineEdit *textBox_Inbound_IPv4; 77 | QLineEdit *textBox_Inbound_Port; 78 | QLineEdit *textBox_Outbound_IPv4; 79 | QLineEdit *textBox_Outbound_Port; 80 | QPushButton *button_Cancel; 81 | QPushButton *button_ToggleServer; 82 | 83 | QVBoxLayout *layout_main; 84 | QHBoxLayout *layout_general_info; 85 | QHBoxLayout *layout_inbound_info; 86 | QHBoxLayout *layout_inbound_controls; 87 | QHBoxLayout *layout_outbound_info; 88 | QHBoxLayout *layout_outbound_controls; 89 | QHBoxLayout *layout_buttons; 90 | 91 | signals: 92 | //SIGNALS 93 | 94 | public slots: 95 | //SLOTS 96 | void button_ToggleServer_Clicked(); 97 | void button_Cancel_Clicked(); 98 | 99 | }; 100 | 101 | #endif // CASTEROSCSERVERCONFIGPICKER_H 102 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/composer/OscContentComposer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_COMPOSER_H_ 24 | #define OSC_COMPOSER_H_ 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | class ByteBuffer; 31 | 32 | class OSC_API OscContentComposer 33 | { 34 | protected: 35 | virtual ~OscContentComposer(); 36 | 37 | /** 38 | * Returns the size of the current OscContentComposer. 39 | * 40 | * @return the current message size 41 | */ 42 | virtual qint32 computeSize(); 43 | 44 | /** 45 | * Copy current message buffers to passed ByteBuffer 46 | * 47 | * @param dst 48 | * The ByteBuffer where to copy current data. 49 | */ 50 | virtual void fillByteBuffer(ByteBuffer* dst); 51 | 52 | /** 53 | * Complete passed ByteBuffer to the next 4-bytes alignment. 54 | * 55 | * @param dst 56 | * The ByteBuffer to complete 57 | */ 58 | static void fillAlignment(ByteBuffer*& dst); 59 | 60 | ByteBuffer* mHeaderByteBuffer; 61 | 62 | virtual QByteArray* getBytes(/*OscVersion::Version aVersion */) = 0; 63 | 64 | /** 65 | * Build a new Composer. By default, bytes are written in BIG_ENDIAN style. 66 | */ 67 | OscContentComposer(); 68 | 69 | /** 70 | * 71 | */ 72 | static ByteBuffer* checkBufferSize(ByteBuffer* aBuffer, size_t aSize); 73 | 74 | private: 75 | QByteArray* mHeaderBuffer; 76 | static qint32 mHeaderBufferSize; 77 | static QByteArray mBlank; 78 | 79 | friend class OscBundleComposer; 80 | }; 81 | 82 | #endif // OSC_COMPOSER_H_ 83 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscLong.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | OscLong::OscLong(ByteBuffer* packet, qint32 pos) 30 | : OscValue('h', packet, pos) 31 | { 32 | mPacket->getLong(); 33 | } 34 | 35 | /** 36 | * Returns the int64 value. 37 | * 38 | * @return a long value. 39 | */ 40 | qint64 OscLong::get() 41 | { 42 | return mPacket->getLong(mPos); 43 | } 44 | 45 | bool OscLong::toBoolean() 46 | { 47 | return (get() != 0); 48 | } 49 | 50 | QByteArray OscLong::toBytes() 51 | { 52 | qint64 l = get(); 53 | QByteArray bytes(8, 0); 54 | bytes.insert(0, (char*)&l, 8); 55 | return bytes; 56 | } 57 | 58 | char OscLong::toChar() 59 | { 60 | qint64 l = get(); 61 | if (l > std::numeric_limits::min() && l < std::numeric_limits::max()) 62 | return (char)get(); 63 | else 64 | throw CharConversionException(); 65 | } 66 | 67 | double OscLong::toDouble() 68 | { 69 | return get(); 70 | } 71 | 72 | qint64 OscLong::toLong() 73 | { 74 | return get(); 75 | } 76 | 77 | Midi OscLong::toMIDI() 78 | { 79 | return Midi(toBytes()); 80 | } 81 | 82 | RGBA OscLong::toRGBA() 83 | { 84 | return RGBA(toBytes()); 85 | } 86 | 87 | QString OscLong::toString() 88 | { 89 | return QString::number(get()); 90 | } 91 | 92 | QDateTime OscLong::toTimetag() 93 | { 94 | NtpTimestamp ntp( *(qint32*)(toBytes().constData()), *(qint32*)(toBytes().constData() + 4)); 95 | return NtpTimestamp::toDateTime(ntp); 96 | } 97 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscMidi.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | /** 30 | * Build a new OscMidi from the given location in packet. 31 | * 32 | * @param pos 33 | * the MIDI message position. 34 | */ 35 | OscMidi::OscMidi(ByteBuffer* packet, qint32 pos) 36 | : OscValue('m', packet, pos) 37 | { 38 | mPacket->getInt(); 39 | } 40 | 41 | /** 42 | * Returns the MIDI message value. 43 | * 44 | * @return an qint32 value. 45 | */ 46 | QByteArray OscMidi::get() 47 | { 48 | QByteArray bytes(4, 0); 49 | mPacket->setPosition(mPos); 50 | mPacket->get(&bytes); 51 | return bytes; 52 | } 53 | 54 | bool OscMidi::toBoolean() 55 | { 56 | return (mPacket->getInt(mPos) != 0); 57 | } 58 | 59 | QByteArray OscMidi::toBytes() 60 | { 61 | return get(); 62 | } 63 | 64 | char OscMidi::toChar() 65 | { 66 | throw CharConversionException(); 67 | } 68 | 69 | float OscMidi::toFloat() 70 | { 71 | throw FloatConversionException(); 72 | } 73 | 74 | double OscMidi::toDouble() 75 | { 76 | throw DoubleConversionException(); 77 | } 78 | 79 | qint64 OscMidi::toLong() 80 | { 81 | return mPacket->getInt(mPos); 82 | } 83 | 84 | Midi OscMidi::toMIDI() 85 | { 86 | return Midi(get()); 87 | } 88 | 89 | RGBA OscMidi::toRGBA() 90 | { 91 | return RGBA(get()); 92 | } 93 | 94 | QString OscMidi::toString() 95 | { 96 | return QString::number(mPacket->getInt(mPos),16); 97 | } 98 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscRGBA.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | /** 30 | * Build a new OscRGBA from the given location in packet. 31 | * 32 | * @param pos 33 | * the RGBA color value position. 34 | */ 35 | OscRGBA::OscRGBA(ByteBuffer* packet, qint32 pos) 36 | : OscValue('r', packet, pos) 37 | { 38 | mPacket->getInt(); 39 | } 40 | 41 | /** 42 | * Returns the RGBA color value. 43 | * 44 | * @return an qint32 value. 45 | */ 46 | QByteArray OscRGBA::get() 47 | { 48 | qint32 i = mPacket->getInt(mPos); 49 | QByteArray bytes(4, 0); 50 | bytes.insert(0, (char*)&i, 4); 51 | return bytes; 52 | } 53 | 54 | bool OscRGBA::toBoolean() 55 | { 56 | return (mPacket->getInt(mPos) != 0); 57 | } 58 | 59 | QByteArray OscRGBA::toBytes() 60 | { 61 | return get(); 62 | } 63 | 64 | char OscRGBA::toChar() 65 | { 66 | throw CharConversionException(); 67 | } 68 | 69 | float OscRGBA::toFloat() 70 | { 71 | throw FloatConversionException(); 72 | } 73 | 74 | double OscRGBA::toDouble() 75 | { 76 | throw DoubleConversionException(); 77 | } 78 | 79 | qint64 OscRGBA::toLong() 80 | { 81 | return mPacket->getInt(mPos); 82 | } 83 | 84 | Midi OscRGBA::toMIDI() 85 | { 86 | return Midi(get()); 87 | } 88 | 89 | RGBA OscRGBA::toRGBA() 90 | { 91 | return RGBA(get()); 92 | } 93 | 94 | QString OscRGBA::toString() 95 | { 96 | return QString::number(mPacket->getInt(mPos),16); 97 | } 98 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscDouble.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | OscDouble::OscDouble(ByteBuffer* packet, qint32 pos) 30 | : OscValue('d', packet, pos) 31 | { 32 | mPacket->getDouble(); 33 | } 34 | 35 | /** 36 | * Returns the double value. 37 | * 38 | * @return a double value. 39 | */ 40 | double OscDouble::get() 41 | { 42 | return mPacket->getDouble(mPos); 43 | } 44 | 45 | bool OscDouble::toBoolean() 46 | { 47 | return (get() != 0); 48 | } 49 | 50 | QByteArray OscDouble::toBytes() 51 | { 52 | double d = get(); 53 | QByteArray bytes(8, 0); 54 | bytes.insert(0, (char*)&d, 8); 55 | return bytes; 56 | } 57 | 58 | char OscDouble::toChar() 59 | { 60 | double d = get(); 61 | if (d > std::numeric_limits::min() && d < std::numeric_limits::max()) 62 | return (char)get(); 63 | else 64 | throw CharConversionException(); 65 | } 66 | 67 | double OscDouble::toDouble() 68 | { 69 | return get(); 70 | } 71 | 72 | qint64 OscDouble::toLong() 73 | { 74 | return (qint64)get(); 75 | } 76 | 77 | Midi OscDouble::toMIDI() 78 | { 79 | return Midi(toBytes()); 80 | } 81 | 82 | RGBA OscDouble::toRGBA() 83 | { 84 | return RGBA(toBytes()); 85 | } 86 | 87 | QString OscDouble::toString() 88 | { 89 | return QString::number(get()); 90 | } 91 | 92 | QDateTime OscDouble::toTimetag() 93 | { 94 | NtpTimestamp ntp( *(qint32*)(toBytes().constData()), *(qint32*)(toBytes().constData() + 4)); 95 | return NtpTimestamp::toDateTime(ntp); 96 | } 97 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/OscPatternMatching.h: -------------------------------------------------------------------------------- 1 | /* 2 | Written by John MacCallum, The Center for New Music and Audio Technologies, 3 | University of California, Berkeley. Copyright (c) 2009, The Regents of 4 | the University of California (Regents). 5 | Permission to use, copy, modify, distribute, and distribute modified versions 6 | of this software and its documentation without fee and without a signed 7 | licensing agreement, is hereby granted, provided that the above copyright 8 | notice, this paragraph and the following two paragraphs appear in all copies, 9 | modifications, and distributions. 10 | 11 | IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, 12 | SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING 13 | OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS 14 | BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | 16 | REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED 19 | HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE 20 | MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 21 | */ 22 | 23 | #ifndef OSC_PATTERN_MATCHING_H_ 24 | #define OSC_PATTERN_MATCHING_H_ 25 | 26 | #include 27 | 28 | /*! \class OSCPatternMatching 29 | * \brief Class which provides OSC messages pattern matching 30 | * 31 | * This class provides a static method for OSC messages pattern matching 32 | */ 33 | class OSC_API OSCPatternMatching 34 | { 35 | public: 36 | 37 | enum Type { 38 | /** 39 | * Return code for osc_match() that indicates that the entire address was successfully matched 40 | */ 41 | OSC_MATCH_ADDRESS_COMPLETE = 1, 42 | /** 43 | * Return code for osc_match() that indicates that the entire pattern was successfully matched 44 | */ 45 | OSC_MATCH_PATTERN_COMPLETE = 2 46 | }; 47 | 48 | /** 49 | * Match a pattern against an address. In the case of a partial match, pattern_offset 50 | * and address_offset will contain the number of bytes into their respective strings 51 | * where the match failed. 52 | * 53 | * @param pattern The pattern to match 54 | * @param address The address to match 55 | * @param pattern_offset The number of bytes into the pattern that were matched successfully 56 | * @param address_offset The number of bytes into the address that were matched successfully 57 | * @return 0 if the match failed altogether, or an or'd combination of OSC_MATCH_ADDRESS_COMPLETE and 58 | * OSC_MATCH_PATTERN_COMPLETE. 59 | */ 60 | static int osc_match(const char *pattern, const char *address, int *pattern_offset, int *address_offset); 61 | }; 62 | 63 | #endif // OSC_PATTERN_MATCHING_H_ 64 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/OscMessage.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_MESSAGE_H_ 24 | #define OSC_MESSAGE_H_ 25 | 26 | #include 27 | #include 28 | 29 | class ByteArray; 30 | class OscValue; 31 | 32 | /** 33 | * Class managing packet data as an OSC message object. 34 | *

35 | * An OSC message object is composed of: 36 | *

    37 | *
  • An address pattern string (aka OscAddress) 38 | *
  • A type tags string (aka OscTags) 39 | *
  • A list of values (aka OscValue) 40 | *
  • ... 41 | *
42 | *

43 | */ 44 | class OSC_API OscMessage : public OscContent 45 | { 46 | public: 47 | 48 | /** */ 49 | size_t getNumValues() const; 50 | 51 | /** */ 52 | OscValue* getValue(size_t index) const; 53 | 54 | /** */ 55 | QString getAddress() const; 56 | 57 | /** */ 58 | QString getTags() const; 59 | 60 | /** */ 61 | virtual QDateTime getTimeTag() const; 62 | 63 | /** Destructor */ 64 | virtual ~OscMessage(); 65 | 66 | private: 67 | /** 68 | * Build a new OscMessage object. While building the message structure, 69 | * the packet buffer is parsed, and new OscValue objects are created and 70 | * registered in a list, in order to be accessible later. 71 | * 72 | * @param messageSize 73 | * The size of the buffer containing the bundle to load. 74 | * @throws OscMalformedMessageException 75 | * A contained message cannot be read properly. 76 | */ 77 | OscMessage(ByteBuffer* packet, qint32 messageSize); 78 | 79 | /** List of values embedded in the current OscMessage. */ 80 | QVector mValues; 81 | 82 | /** Required for access to constructor. */ 83 | friend class OscBundle; 84 | friend class OscReader; 85 | }; 86 | 87 | #endif // OSC_MESSAGE_H_ 88 | -------------------------------------------------------------------------------- /CasterSoundboard/CSS.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * Copyright 2013 Oscar Cerna 5 | * 6 | * This file is part of CasterSoundboard. An application for playing hot-keyed sounds. 7 | * For more information, please visit http://sourceforge.net/projects/castersb. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU LESSER GENERAL PUBLIC LICENSE for more details. 18 | * 19 | * You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | #ifndef CSS_H 24 | #define CSS_H 25 | 26 | #define CSS_GRAIENT_GREY "CasterPlayerWidget{background:qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,stop:0.0 rgba(218,218,218, 255),stop:0.1 rgba(206,206,206, 255),stop:0.25 rgba(186,186,186, 255),stop:0.37 rgba(189,189,189, 255),stop:0.5 rgba(192,192,192, 255),stop:0.51 rgba(168,168,168, 255),stop:0.83 rgba(204,204,204, 255),stop:1.0 rgba(221,221,221, 255));}" 27 | #define CSS_GRAIENT_GREY_W "QWidget{background:qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,stop:0.0 rgba(218,218,218, 255),stop:0.1 rgba(206,206,206, 255),stop:0.25 rgba(186,186,186, 255),stop:0.37 rgba(189,189,189, 255),stop:0.5 rgba(192,192,192, 255),stop:0.51 rgba(168,168,168, 255),stop:0.83 rgba(204,204,204, 255),stop:1.0 rgba(221,221,221, 255));}" 28 | 29 | //Foward Declarations 30 | class QString; 31 | struct RGB_C; 32 | struct HSL_C; 33 | 34 | struct RGB_C { 35 | float R; 36 | float G; 37 | float B; 38 | RGB_C(float red, float green, float blue) : R(red), G(green), B(blue) {} 39 | RGB_C(HSL_C hsl_color); 40 | RGB_C operator+(RGB_C &color); 41 | RGB_C addHSL(HSL_C &color); 42 | QString toStr(); 43 | } ; 44 | 45 | struct HSL_C { 46 | float H; 47 | float S; 48 | float L; 49 | HSL_C(float hue, float sat, float light ) : H(hue), S(sat), L(light) {} 50 | HSL_C(RGB_C rgb_color); 51 | HSL_C operator+(HSL_C &color); 52 | HSL_C addRGB(RGB_C &color); 53 | QString toStr(); 54 | }; 55 | 56 | QString Generate_CSS(HSL_C hsl_color); 57 | QString Generate_CSS_W(HSL_C hsl_color); 58 | QString Generate_CSS_Gradient_Stop(float stop); 59 | 60 | float Clamp(float value, float lower, float upper); 61 | float Max(float a, float b); 62 | float Max(float a, float b, float c); 63 | float Min(float a, float b); 64 | float Min(float a, float b, float c); 65 | namespace CSS { 66 | float abs(float a); 67 | } 68 | int fSwitch(float value, float a, float b, float c); 69 | 70 | #endif // CSS_H 71 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/OscBundle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_BUNDLE_H_ 24 | #define OSC_BUNDLE_H_ 25 | 26 | #include 27 | #include 28 | 29 | class OSC_API OscBundle : public OscContent { 30 | public: 31 | 32 | /** TODO */ 33 | size_t getNumEntries(); 34 | 35 | /** 36 | * Conversion type for current OscContent object as an OscBundle object. 37 | * 38 | * @return this as an OscBundle object. If this cannot be convert to an 39 | * OscBundle object, returns null. 40 | */ 41 | OscBundle* getBundle(qint32 index); 42 | 43 | /** 44 | * Conversion type for current OscContent object as an OscMessage 45 | * object. 46 | * 47 | * @return this as an OscMessage object. If this cannot be convert to an 48 | * OscMessage object, returns null. 49 | */ 50 | OscMessage* getMessage(qint32 index); 51 | 52 | /** 53 | * Returns the current bundle time tag as a 64-bit integer value 54 | * 55 | * @return the time tag as a long value. 56 | */ 57 | QDateTime getTimeTag(); 58 | 59 | private: 60 | /** 61 | * Build a new OscBundle object. 62 | * 63 | * @param bufferSize 64 | * The size of the buffer containing the bundle to load. 65 | * @throws OscMalformedBundleException 66 | * The bundle cannot be read properly. 67 | * @throws OscMalformedMessageException 68 | * A contained message cannot be read properly. 69 | */ 70 | OscBundle(ByteBuffer* packet, qint32 bufferSize); 71 | 72 | /** Destructor */ 73 | virtual ~OscBundle(); 74 | 75 | /** 76 | * List of all messages or bundles directly accessible from this bundle. 77 | */ 78 | QVector mContentList; 79 | 80 | /** Required for access to constructor. */ 81 | friend class OscReader; 82 | }; 83 | 84 | #endif // OSC_BUNDLE_H_ 85 | -------------------------------------------------------------------------------- /CasterSoundboard/CasterBoard.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * Copyright 2013 Oscar Cerna 5 | * 6 | * This file is part of CasterSoundboard. An application for playing hot-keyed sounds. 7 | * For more information, please visit http://sourceforge.net/projects/castersb. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU LESSER GENERAL PUBLIC LICENSE for more details. 18 | * 19 | * You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | #ifndef CASTERBOARD_H 24 | #define CASTERBOARD_H 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include "libs/osc/composer/OscMessageComposer.h" 30 | 31 | //forward declarations 32 | class CasterPlayerWidget; 33 | class QString; 34 | class CasterBoardState; 35 | 36 | class CasterBoard : public QWidget //inherit from QWidget 37 | { 38 | Q_OBJECT 39 | public: 40 | //Constructor 41 | CasterBoard(QWidget* parent = 0); //don't forget to pass the parent 42 | 43 | //Properties 44 | bool isCurrentBoard = false; 45 | QString *soundBoardName; 46 | QString *profileFilePath; 47 | QMap *int_to_player_key; 48 | QMap *keyboard_key_to_player_key; 49 | QMap *players; 50 | 51 | //Methods 52 | void stopAllSounds(); 53 | void reloadBoardFromPlayerStates(); 54 | void setAllAudioDuckingStates(int state); 55 | void syncWithOSCClient();//Refeshes UI on OSC Client 56 | 57 | 58 | protected: 59 | //======== 60 | void keyReleaseEvent(QKeyEvent *event);//Capture Hot Keys 61 | 62 | private: 63 | //Private Methods 64 | //OSC Composer Methods 65 | OscMessageComposer* writeOSCMessage(QString address, int value); 66 | OscMessageComposer* writeOSCMessage(QString address, float value); 67 | OscMessageComposer* writeOSCMessage(QString address, QString value); 68 | 69 | signals: 70 | //SIGNALS 71 | void globalHotKeyReleasedEvent(QKeyEvent *event);//Use by mainwindow to perform actions on all sound boads. Needed because of how focus works in qt. 72 | void _updateOSCClient(OscMessageComposer* message); 73 | 74 | public slots: 75 | //SLOTS 76 | void notifyApplicationAboutOSCMessage(OscMessageComposer* message); 77 | 78 | }; 79 | 80 | //Operator Overloading 81 | QDataStream &operator<<(QDataStream &ds, const CasterBoard &cb); 82 | QDataStream &operator>>(QDataStream &ds, CasterBoard &cb); 83 | 84 | #endif // CASTERBOARD_H 85 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscValue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_VALUE_H_ 24 | #define OSC_VALUE_H_ 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | class ByteBuffer; 34 | 35 | /** 36 | * Abstract class representing an OSC value. This class is derivated to 37 | * manage all OSC common types. 38 | */ 39 | class OSC_API OscValue 40 | { 41 | public: 42 | 43 | virtual char getTag(); 44 | virtual bool isArrayBegin(); 45 | virtual bool isArrayEnd(); 46 | virtual bool isFalse(); 47 | virtual bool isTrue(); 48 | virtual bool isNil(); 49 | virtual bool isInfinitum(); 50 | virtual bool toBoolean(); 51 | virtual QByteArray toBytes() = 0; 52 | virtual char toChar(); 53 | virtual float toFloat(); 54 | virtual double toDouble() = 0; 55 | virtual qint32 toInteger(); 56 | virtual qint64 toLong() = 0; 57 | virtual QString toString(); 58 | virtual QString toSymbol(); 59 | virtual Midi toMIDI(); 60 | virtual RGBA toRGBA(); 61 | virtual QDateTime toTimetag(); 62 | 63 | virtual ~OscValue() {}; 64 | 65 | protected: 66 | 67 | OscValue(char typeTag, ByteBuffer* packet, qint32 pos); 68 | 69 | 70 | /** 71 | * Returns the position of the next non-null character in the packet. 72 | * 73 | * @return the position. 74 | */ 75 | static qint32 getLastStringIdx(ByteBuffer* packet); 76 | 77 | /** 78 | * Returns the string located at the passed position in the packet buffer. 79 | * 80 | * @param pos 81 | * The position were the string starts 82 | * @return The read string. 83 | */ 84 | static QByteArray getString(ByteBuffer* packet, qint32 pos); 85 | 86 | /** The buffer to read to. */ 87 | ByteBuffer* mPacket; 88 | 89 | /** The Osc value type tag. */ 90 | char mTag; 91 | 92 | qint32 mPos; 93 | }; 94 | 95 | #endif // OSC_VALUE_H_ 96 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/OscReader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_READER_H_ 24 | #define OSC_READER_H_ 25 | 26 | #include 27 | #include 28 | 29 | class ByteBuffer; 30 | class OscBundle; 31 | class OscMessage; 32 | class OscContent; 33 | 34 | class OSC_API OscReader 35 | { 36 | public: 37 | /** 38 | * @brief Conversion type for current OscContent object as an OscBundle object. 39 | * 40 | * @return this as an OscBundle object. If this cannot be convert to an 41 | * OscBundle object, returns null. 42 | */ 43 | OscBundle* getBundle(); 44 | 45 | /** 46 | * @brief Conversion type for current OscContent object as an OscMessage 47 | * object. 48 | * 49 | * @return this as an OscMessage object. If this cannot be convert to an 50 | * OscMessage object, returns null. 51 | */ 52 | OscMessage* getMessage(); 53 | 54 | /** 55 | * @brief Build a new OscContent object based on the passed byte buffer. 56 | * 57 | * @param src 58 | * the byte buffer to parse containing OSC messages 59 | * @throws ReadMessageException 60 | * The contained message cannot be read properly. 61 | */ 62 | OscReader(QByteArray* src); 63 | 64 | /** 65 | * @brief Build a new OscContent object based on the passed byte buffer. 66 | * 67 | * @param src 68 | * the byte buffer to parse containing OSC messages 69 | * @param offset 70 | * the position where to start reading the byte buffer 71 | * @param size 72 | * the size of the byte buffer 73 | * @throws ReadMessageException 74 | * The contained message cannot be read properly. 75 | */ 76 | OscReader(QByteArray* src, qint32 offset, qint32 size); 77 | 78 | /** 79 | * @brief Destructor. 80 | */ 81 | ~OscReader(); 82 | 83 | private: 84 | 85 | OscContent* mContent; 86 | ByteBuffer* mPacket; 87 | qint32 mPacketSize; 88 | 89 | void init(QByteArray* src, qint32 offset, qint32 size); 90 | 91 | friend class OscMessage; 92 | }; 93 | 94 | #endif // OSC_READER_H_ 95 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscBlob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | OscBlob::OscBlob(ByteBuffer* packet, qint32 pos) 33 | : OscValue('b', packet, pos) 34 | { 35 | try 36 | { 37 | get(); 38 | } 39 | catch (const QException& e) 40 | { 41 | throw e; 42 | } 43 | } 44 | 45 | /** 46 | * Returns the blob data. 47 | * 48 | * @return a blob data. 49 | */ 50 | QByteArray& OscBlob::get() 51 | { 52 | try 53 | { 54 | mBlobSize = mPacket->getInt(mPos); 55 | 56 | if (mBlobSize != 0) 57 | { 58 | mData = QByteArray(mBlobSize, 0); 59 | mPacket->setPosition(mPos + 4); 60 | mPacket->get(&mData, 0, mBlobSize); 61 | 62 | qint32 rem = 4 - (mBlobSize % 4); 63 | if (rem == 4) 64 | rem = 0; 65 | 66 | mPacket->setPosition(mPos + 4 + mBlobSize + rem); 67 | } 68 | 69 | return mData; 70 | } 71 | catch (const QException& e) 72 | { 73 | throw e; 74 | } 75 | } 76 | 77 | bool OscBlob::toBoolean() 78 | { 79 | return (get().length() != 0); 80 | } 81 | 82 | QByteArray OscBlob::toBytes() 83 | { 84 | return get(); 85 | } 86 | 87 | char OscBlob::toChar() 88 | { 89 | throw CharConversionException(); 90 | } 91 | 92 | double OscBlob::toDouble() 93 | { 94 | throw DoubleConversionException(); 95 | } 96 | 97 | float OscBlob::toFloat() 98 | { 99 | throw FloatConversionException(); 100 | } 101 | 102 | qint32 OscBlob::toInteger() 103 | { 104 | throw IntegerConversionException(); 105 | } 106 | 107 | qint64 OscBlob::toLong() 108 | { 109 | throw LongConversionException(); 110 | } 111 | 112 | QString OscBlob::toString() 113 | { 114 | throw StringConversionException(); 115 | } 116 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscAddress.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | /** 37 | * Build a new OscAddress from the given location in packet. 38 | * 39 | * @param pos 40 | * an address pattern string position. 41 | */ 42 | OscAddress::OscAddress(ByteBuffer* packet, qint32 pos) 43 | : OscValue('\0', packet, pos) 44 | { 45 | try 46 | { 47 | get(); 48 | } 49 | catch (const QException& e) 50 | { 51 | throw e; 52 | } 53 | } 54 | 55 | /** 56 | * Returns the address pattern string. 57 | * 58 | * @return a string 59 | */ 60 | QString OscAddress::get() 61 | { 62 | try 63 | { 64 | return OscValue::getString(mPacket, mPos); 65 | } 66 | catch (const QException& e) 67 | { 68 | throw e; 69 | } 70 | } 71 | 72 | bool OscAddress::toBoolean() 73 | { 74 | throw BooleanConversionException(); 75 | } 76 | 77 | QByteArray OscAddress::toBytes() 78 | { 79 | throw BytesConversionException(); 80 | } 81 | 82 | char OscAddress::toChar() 83 | { 84 | throw CharConversionException(); 85 | } 86 | 87 | double OscAddress::toDouble() 88 | { 89 | throw DoubleConversionException(); 90 | } 91 | 92 | float OscAddress::toFloat() 93 | { 94 | throw FloatConversionException(); 95 | } 96 | 97 | qint32 OscAddress::toInteger() 98 | { 99 | throw IntegerConversionException(); 100 | } 101 | 102 | qint64 OscAddress::toLong() 103 | { 104 | throw LongConversionException(); 105 | } 106 | 107 | 108 | QString OscAddress::toString() 109 | { 110 | return get(); 111 | } 112 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/composer/OscContentComposer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | qint32 OscContentComposer::mHeaderBufferSize = 128; 28 | QByteArray OscContentComposer::mBlank(4, 0); 29 | 30 | OscContentComposer::OscContentComposer() 31 | { 32 | mHeaderBuffer = new QByteArray(mHeaderBufferSize, 0); 33 | mHeaderByteBuffer = ByteBuffer::wrap(mHeaderBuffer, true); 34 | } 35 | 36 | OscContentComposer::~OscContentComposer() 37 | { 38 | // No Need to delete since buffer is owned by ByteBuffer 39 | // delete mHeaderBuffer; 40 | 41 | delete mHeaderByteBuffer; 42 | } 43 | 44 | qint32 OscContentComposer::computeSize() 45 | { 46 | // Be sure to align type tags ending 47 | if (mHeaderByteBuffer->get(mHeaderByteBuffer->getPosition() - 1) != 0) 48 | { 49 | mHeaderByteBuffer = checkBufferSize(mHeaderByteBuffer, 1); 50 | mHeaderByteBuffer->put((char)0); 51 | } 52 | fillAlignment(mHeaderByteBuffer); 53 | return mHeaderByteBuffer->getPosition(); 54 | } 55 | 56 | ByteBuffer* OscContentComposer::checkBufferSize(ByteBuffer* aBuffer, size_t aSize) 57 | { 58 | if (aBuffer->getPosition() + (qint32)aSize > aBuffer->getCapacity()) 59 | { 60 | qint32 newDataBufferSize = aBuffer->getCapacity() + (qint32)pow(2, ceil(log((aSize)) / log(2))); 61 | ByteBuffer* newDataByteBuffer = ByteBuffer::allocate(newDataBufferSize); 62 | if (aBuffer->getPosition() > 0) 63 | newDataByteBuffer->put(aBuffer->getByteArray(), 0, aBuffer->getPosition()); 64 | delete aBuffer; 65 | 66 | return newDataByteBuffer; 67 | } 68 | else 69 | return aBuffer; 70 | } 71 | 72 | void OscContentComposer::fillByteBuffer(ByteBuffer* dst) 73 | { 74 | try 75 | { 76 | dst->put(mHeaderByteBuffer->getByteArray(), 0, mHeaderByteBuffer->getPosition()); 77 | } 78 | catch (const QException& e) 79 | { 80 | throw e; 81 | } 82 | } 83 | 84 | void OscContentComposer::fillAlignment(ByteBuffer*& dst) 85 | { 86 | qint32 size = 4 - (dst->getPosition() & 0x3); 87 | if (size != 4) 88 | { 89 | try 90 | { 91 | dst = checkBufferSize(dst, size); 92 | dst->put(&mBlank, 0, size); 93 | } 94 | catch (const QException& e) 95 | { 96 | throw e; 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/composer/OscBundleComposer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef OSC_BUNDLE_COMPOSER_H_ 24 | #define OSC_BUNDLE_COMPOSER_H_ 25 | 26 | #include 27 | #include 28 | 29 | class OSC_API OscBundleComposer : public OscContentComposer 30 | { 31 | private: 32 | QByteArray* mData; 33 | public: 34 | /** 35 | * Build a new OSC Bundle. 36 | * 37 | * @param timetag 38 | * The long value that applies as a time tag to this bundle. 39 | */ 40 | OscBundleComposer(QDateTime timetag); 41 | 42 | /** Destructor. */ 43 | virtual ~OscBundleComposer(); 44 | 45 | /** 46 | * Appends a new message to the current bundle. 47 | * 48 | * @param address 49 | * @return the new message to compose. 50 | */ 51 | OscMessageComposer* pushMessage(QString& address); 52 | 53 | /** 54 | * Appends a previously built message to the current bundle being composed. 55 | * 56 | * @param message 57 | * The message to add to this bundle. 58 | */ 59 | void pushMessage(OscMessageComposer* message); 60 | 61 | /** 62 | * Appends a new message to the current bundle. 63 | * 64 | * @param timeTag 65 | * The time tag to apply to the new bundle. 66 | * @return the new bundle to compose. 67 | */ 68 | OscBundleComposer* pushBundle(QDateTime timeTag = NtpTimestamp::IMMEDIATE); 69 | 70 | /** 71 | * Appends a previously built bundle to the current bundle being composed. 72 | * 73 | * @param bundle 74 | * The bundle to add to this bundle. 75 | */ 76 | void pushBundle(OscBundleComposer* bundle); 77 | 78 | /** 79 | * Gets the complete OSC bundle for the current bundle being composed. 80 | * 81 | * @return the current OscMessage data. 82 | */ 83 | virtual QByteArray* getBytes(/*OscVersion::Version aVersion*/); 84 | 85 | protected: 86 | /* 87 | * @see com.cocon.osc.OscComposer#computeSize() 88 | */ 89 | virtual qint32 computeSize(); 90 | 91 | /* 92 | * @see com.cocon.osc.OscComposer#fillByteBuffer() 93 | */ 94 | virtual void fillByteBuffer(ByteBuffer* byteBuffer); 95 | 96 | protected: 97 | /** List of all messages or bundles to compose to build the whole Bundle. */ 98 | QVector mContentList; 99 | }; 100 | 101 | #endif // OSC_BUNDLE_COMPOSER_H_ 102 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscString.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | /** 32 | * Build a new OscString from the given location in packet. 33 | * 34 | * @param pos 35 | * the string position. 36 | */ 37 | OscString::OscString(ByteBuffer* packet, qint32 pos) 38 | : OscValue('s', packet, pos) 39 | { 40 | try 41 | { 42 | get(); 43 | } 44 | catch (const QException& e) 45 | { 46 | throw e; 47 | } 48 | } 49 | 50 | /** 51 | * Returns the string value. 52 | * 53 | * @return a string value. 54 | */ 55 | QByteArray OscString::get() 56 | { 57 | try 58 | { 59 | return OscValue::getString(mPacket, mPos); 60 | } 61 | catch (const QException& e) 62 | { 63 | throw e; 64 | } 65 | } 66 | 67 | bool OscString::toBoolean() 68 | { 69 | return (get().length() != 0); 70 | } 71 | 72 | QByteArray OscString::toBytes() 73 | { 74 | return get(); 75 | } 76 | 77 | char OscString::toChar() 78 | { 79 | const QByteArray& value = get(); 80 | if (value.length() > 1) 81 | throw CharConversionException(); 82 | else 83 | return value.at(0); 84 | } 85 | 86 | float OscString::toFloat() 87 | { 88 | bool ok; 89 | float f = get().toFloat(&ok); 90 | if (ok) 91 | return f; 92 | else 93 | throw FloatConversionException(); 94 | } 95 | 96 | double OscString::toDouble() 97 | { 98 | bool ok; 99 | double d = get().toDouble(&ok); 100 | if (ok) 101 | return d; 102 | else 103 | throw DoubleConversionException(); 104 | } 105 | 106 | qint32 OscString::toInteger() 107 | { 108 | bool ok; 109 | qint32 i = get().toInt(&ok); 110 | if (ok) 111 | return i; 112 | else 113 | throw IntegerConversionException(); 114 | } 115 | 116 | qint64 OscString::toLong() 117 | { 118 | bool ok; 119 | qint64 h = get().toLongLong(&ok); 120 | if (ok) 121 | return h; 122 | else 123 | throw LongConversionException(); 124 | } 125 | 126 | QString OscString::toString() 127 | { 128 | return get(); 129 | } 130 | 131 | QString OscString::toSymbol() 132 | { 133 | return toString(); 134 | } 135 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscSymbol.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | /** 32 | * Build a new OscSymbol from the given location in packet. 33 | * 34 | * @param pos 35 | * the Symbol string value position. 36 | */ 37 | OscSymbol::OscSymbol(ByteBuffer* packet, qint32 pos) 38 | : OscValue('S', packet, pos) 39 | { 40 | try 41 | { 42 | get(); 43 | } 44 | catch (const QException& e) 45 | { 46 | throw e; 47 | } 48 | } 49 | 50 | /** 51 | * Returns the Symbol value. 52 | * 53 | * @return a string value. 54 | */ 55 | QByteArray OscSymbol::get() 56 | { 57 | try 58 | { 59 | return OscValue::getString(mPacket, mPos); 60 | } 61 | catch (const QException& e) 62 | { 63 | throw e; 64 | } 65 | } 66 | 67 | bool OscSymbol::toBoolean() 68 | { 69 | return (get().length() != 0); 70 | } 71 | 72 | QByteArray OscSymbol::toBytes() 73 | { 74 | return get(); 75 | } 76 | 77 | char OscSymbol::toChar() 78 | { 79 | const QByteArray& value = get(); 80 | if (value.length() > 1) 81 | throw CharConversionException(); 82 | else 83 | return value.at(0); 84 | } 85 | 86 | float OscSymbol::toFloat() 87 | { 88 | bool ok; 89 | float f = get().toFloat(&ok); 90 | if (ok) 91 | return f; 92 | else 93 | throw FloatConversionException(); 94 | } 95 | 96 | double OscSymbol::toDouble() 97 | { 98 | bool ok; 99 | double d = get().toDouble(&ok); 100 | if (ok) 101 | return d; 102 | else 103 | throw DoubleConversionException(); 104 | } 105 | 106 | qint32 OscSymbol::toInteger() 107 | { 108 | bool ok; 109 | qint32 i = get().toInt(&ok); 110 | if (ok) 111 | return i; 112 | else 113 | throw IntegerConversionException(); 114 | } 115 | 116 | qint64 OscSymbol::toLong() 117 | { 118 | bool ok; 119 | qint64 h = get().toLongLong(&ok); 120 | if (ok) 121 | return h; 122 | else 123 | throw LongConversionException(); 124 | } 125 | 126 | QString OscSymbol::toString() 127 | { 128 | return toSymbol(); 129 | } 130 | 131 | QString OscSymbol::toSymbol() 132 | { 133 | return get(); 134 | } 135 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/OscReader.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | /** */ 33 | OscBundle* OscReader::getBundle() 34 | { 35 | OscBundle* bundle = dynamic_cast(mContent); 36 | if (bundle) 37 | return bundle; 38 | return 0;//NULL 39 | } 40 | 41 | /** 42 | * Conversion type for current OscContent object as an OscMessage 43 | * object. 44 | * 45 | * @return this as an OscMessage object. If this cannot be convert to an 46 | * OscMessage object, returns null. 47 | */ 48 | OscMessage* OscReader::getMessage() 49 | { 50 | OscMessage* message = dynamic_cast(mContent); 51 | if (message) 52 | return message; 53 | return 0;//NULL 54 | } 55 | 56 | /** 57 | * Build a new OscContent object based on the passed byte buffer. 58 | * 59 | * @param src 60 | * the byte buffer to parse containing OSC messages 61 | * @param length 62 | * the length of the message buffer 63 | * @throws OscMalformedBundleException 64 | * The bundle cannot be read properly. 65 | * @throws OscMalformedMessageException 66 | * A contained message cannot be read properly. 67 | */ 68 | OscReader::OscReader(QByteArray* src) 69 | { 70 | init(src, 0, src->size()); 71 | } 72 | 73 | OscReader::OscReader(QByteArray* src, qint32 offset, qint32 size) 74 | { 75 | init(src, offset, size); 76 | } 77 | 78 | OscReader::~OscReader() 79 | { 80 | // DO NOT DESTROY OSCMESSAGE OR OSCBUNDLE 81 | // delete mContent 82 | // delete mPacket; 83 | } 84 | 85 | void 86 | OscReader::init(QByteArray* src, qint32 offset, qint32 size) 87 | { 88 | mContent = NULL; 89 | mPacketSize = size; 90 | mPacket = ByteBuffer::wrap(src); 91 | try 92 | { 93 | if (mPacket->get(mPacket->getPosition()) == '#') 94 | mContent = new OscBundle(mPacket, mPacketSize); 95 | else 96 | { 97 | mPacket->setPosition(offset); 98 | mContent = new OscMessage(mPacket, mPacketSize); 99 | } 100 | } 101 | catch (...) 102 | { 103 | throw ReadMessageException(); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | CasterSoundboard 4 | ================ 5 | [![Snap Status](https://build.snapcraft.io/badge/JupiterBroadcasting/CasterSoundboard.svg)](https://build.snapcraft.io/user/JupiterBroadcasting/CasterSoundboard) 6 | [![License](https://img.shields.io/github/license/JupiterBroadcasting/CasterSoundboard.svg)](https://github.com/JupiterBroadcasting/CasterSoundboard/blob/master/LICENSE) 7 | 8 | A soundboard for hot-keying and playing back sounds. (For podcasting) 9 | 10 | CasterSoundboard is written in C++ Qt5. 11 | --- 12 | 13 | ## Guides 14 | + [Control CasterSoundboard with your phone or tablet via a network](https://github.com/JupiterBroadcasting/CasterSoundboard/wiki/Guide:-How-to-Control-CasterSoundboard-Using-Your-Phone-or-Tablet "CasterSoundboard's Wiki") 15 | --- 16 | 17 | ## Libraries Used 18 | + [osc-cpp-qt](https://github.com/MugenSAS/osc-cpp-qt) 19 | --- 20 | 21 | ## How to Install 22 | 23 | ### Snap 24 | 25 | Install CasterSoundboard in seconds on [Ubuntu and other snap supported Linux 26 | distributions](https://snapcraft.io/docs/core/install) with: 27 | 28 | snap install castersoundboard 29 | 30 | Installing a snap is very quick. Snaps are secure. They are isolated with all 31 | of their dependencies. Snaps also auto update when a new version is released. 32 | 33 | ### Arch AUR 34 | Thanks to [@j605](https://github.com/j605 "Jagannathan Tiruvallur Eachambadi") for creating a `PKGBUILD` for people on Arch who want to try this software: 35 | + [CasterSoundboard-git](https://aur.archlinux.org/packages/castersoundboard-git) 36 | 37 | ### Fedora 25 and newer 38 | RPM package can be found in the [Copr](https://copr.fedorainfracloud.org/coprs/fszymanski/castersoundboard/) repository: 39 | ``` 40 | # dnf copr enable fszymanski/castersoundboard 41 | # dnf install castersoundboard 42 | ``` 43 | 44 | ### Building From Source 45 | 46 | First clone the repository using `git`, if you don't have `git` installed 47 | you can find installation instructions [here](https://git-scm.com) 48 | 49 | ``` 50 | $ git clone https://github.com/JupiterBroadcasting/CasterSoundboard 51 | ``` 52 | 53 | Now we need to install the qt5 development libraries and tools, the 54 | commands for various platforms are listed below: 55 | 56 | *Fedora* 57 | ``` 58 | # dnf install qt5-devel make gcc gcc-c++ 59 | ``` 60 | 61 | *Debian and Ubuntu* 62 | ``` 63 | # apt install qtdeclarative5-dev qt5-default qtmultimedia5-dev build-essential 64 | ``` 65 | 66 | *Mac OSX* 67 | ``` 68 | # brew install qt 69 | ``` 70 | 71 | You should then have access to `qmake`, `make`, and the qt5 development 72 | libraries. Next `cd` into the project folder inside the repo: 73 | 74 | ``` 75 | $ cd CasterSoundboard/CasterSoundboard 76 | ``` 77 | 78 | You can specify the target directory using the `PREFIX` `qmake` variable (default: `/usr/local`). 79 | Now run `qmake`, this will auto generate a makefile: 80 | 81 | ``` 82 | $ qmake PREFIX=/usr 83 | ``` 84 | 85 | or on Fedora: 86 | 87 | ``` 88 | $ qmake-qt5 PREFIX=/usr 89 | ``` 90 | 91 | Then run `make` to build the project: 92 | 93 | ``` 94 | $ make 95 | ``` 96 | 97 | And finally run `make install` to install the app: 98 | 99 | ``` 100 | # make install 101 | ``` 102 | 103 | Now you're good to go! 104 | 105 | ### Troubleshooting ### 106 | Problem: On Ubuntu you get error: 107 | ``` 108 | defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer" 109 | ``` 110 | Solution: Install missing qt5 multimedia plugins 111 | ``` 112 | sudo apt-get install libqt5multimedia5-plugins 113 | ``` 114 | ### Screenshot ### 115 | ![Alt text](/docs/img/screenshot.png?raw=true "Running on Ubuntu") 116 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscTags.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | /** 37 | * Build a new OscTags from the given location in packet. 38 | * 39 | * @param pos 40 | * the message type tags string position. 41 | */ 42 | OscTags::OscTags(ByteBuffer* packet, qint32 pos) 43 | : OscValue('\0', packet, pos) 44 | { 45 | try 46 | { 47 | get(); 48 | } 49 | catch (const QException& e) 50 | { 51 | throw e; 52 | } 53 | } 54 | 55 | /** 56 | * Returns the OSC type tags associated to this message. 57 | * 58 | * @return a string value. 59 | */ 60 | QString OscTags::get() 61 | { 62 | try 63 | { 64 | return OscValue::getString(mPacket, mPos); 65 | } 66 | catch (const QException& e) 67 | { 68 | throw e; 69 | } 70 | } 71 | 72 | bool OscTags::toBoolean() 73 | { 74 | throw BooleanConversionException(); 75 | } 76 | 77 | QByteArray OscTags::toBytes() 78 | { 79 | throw BytesConversionException(); 80 | } 81 | 82 | char OscTags::toChar() 83 | { 84 | throw CharConversionException(); 85 | } 86 | 87 | double OscTags::toDouble() 88 | { 89 | throw DoubleConversionException(); 90 | } 91 | 92 | float OscTags::toFloat() 93 | { 94 | throw FloatConversionException(); 95 | } 96 | 97 | qint32 OscTags::toInteger() 98 | { 99 | throw IntegerConversionException(); 100 | } 101 | 102 | qint64 OscTags::toLong() 103 | { 104 | throw LongConversionException(); 105 | } 106 | 107 | Midi OscTags::toMIDI() 108 | { 109 | throw MidiConversionException(); 110 | } 111 | 112 | RGBA OscTags::toRGBA() 113 | { 114 | throw RgbaConversionException(); 115 | } 116 | 117 | QString OscTags::toString() 118 | { 119 | return get(); 120 | } 121 | 122 | QString OscTags::toSymbol() 123 | { 124 | throw SymbolConversionException(); 125 | } 126 | 127 | QDateTime OscTags::toTimetag() 128 | { 129 | throw TimetagConversionException(); 130 | } 131 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/types/OscTimeTag.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | /** 36 | * Build a new OscTimetag from the given location in packet. 37 | * 38 | * @param pos 39 | * the time tag value position. 40 | */ 41 | OscTimetag::OscTimetag(ByteBuffer* packet, qint32 pos) 42 | : OscValue('t', packet, pos) 43 | { 44 | mPacket->getLong(); 45 | } 46 | 47 | /** 48 | * Returns the OSC Timetag value. 49 | * 50 | * @return a long value. 51 | */ 52 | NtpTimestamp OscTimetag::get() 53 | { 54 | NtpTimestamp ntp( mPacket->getInt(mPos), mPacket->getInt(mPos + 4) ); 55 | return ntp; 56 | } 57 | 58 | bool OscTimetag::toBoolean() 59 | { 60 | NtpTimestamp ntp( qToBigEndian(0), qToBigEndian(1) ); 61 | return (get() != ntp); 62 | } 63 | 64 | QByteArray OscTimetag::toBytes() 65 | { 66 | NtpTimestamp ntp = get(); 67 | QByteArray bytes(8, 0); 68 | quint32 secs = ntp.rawSeconds(); 69 | quint32 fracs = ntp.rawFraction(); 70 | bytes.insert(0, (char*)&secs, 4); 71 | bytes.insert(4, (char*)&fracs, 4); 72 | return bytes; 73 | } 74 | 75 | char OscTimetag::toChar() 76 | { 77 | throw CharConversionException(); 78 | } 79 | 80 | double OscTimetag::toDouble() 81 | { 82 | throw DoubleConversionException(); 83 | } 84 | 85 | float OscTimetag::toFloat() 86 | { 87 | throw FloatConversionException(); 88 | } 89 | 90 | qint32 OscTimetag::toInteger() 91 | { 92 | throw IntegerConversionException(); 93 | } 94 | 95 | qint64 OscTimetag::toLong() 96 | { 97 | throw LongConversionException(); 98 | } 99 | 100 | Midi OscTimetag::toMIDI() 101 | { 102 | NtpTimestamp ntp = get(); 103 | QByteArray bytes(4, 0); 104 | quint32 secs = ntp.seconds(); 105 | bytes.insert(0, (char*)&secs, 4); 106 | return Midi(bytes); 107 | } 108 | 109 | RGBA OscTimetag::toRGBA() 110 | { 111 | NtpTimestamp ntp = get(); 112 | QByteArray bytes(4, 0); 113 | quint32 secs = ntp.seconds(); 114 | bytes.insert(0, (char*)&secs, 4); 115 | return RGBA(bytes); 116 | } 117 | 118 | QString OscTimetag::toString() 119 | { 120 | throw StringConversionException(); 121 | } 122 | 123 | QDateTime OscTimetag::toTimetag() 124 | { 125 | return NtpTimestamp::toDateTime(get()); 126 | } 127 | -------------------------------------------------------------------------------- /CasterSoundboard/libs/osc/reader/OscBundle.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 MUGEN SAS 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | /** 32 | * Build a new OscBundle object. 33 | * 34 | * @param bufferSize 35 | * The size of the buffer containing the bundle to load. 36 | * @throws OscMalformedBundleException 37 | * The bundle cannot be read properly. 38 | * @throws OscMalformedMessageException 39 | * A contained message cannot be read properly. 40 | */ 41 | OscBundle::OscBundle(ByteBuffer* packet, qint32 bufferSize) 42 | : OscContent(packet) 43 | { 44 | if (mPacket->get() != '#' || mPacket->get() != 'b' || mPacket->get() != 'u' || mPacket->get() != 'n' 45 | || mPacket->get() != 'd' || mPacket->get() != 'l' || mPacket->get() != 'e' || mPacket->get() != '\0') 46 | throw OscMalformedBundleException(); 47 | 48 | // Move Packet cursor after timeTag 49 | mPacket->getLong(); 50 | 51 | while (mPacket->getPosition() < mStartIdx + bufferSize) 52 | { 53 | qint32 contentSize = mPacket->getInt(); 54 | if (mPacket->get(mPacket->getPosition()) == '#') 55 | mContentList.push_back(new OscBundle(packet, contentSize)); 56 | else 57 | mContentList.push_back(new OscMessage(packet, contentSize)); 58 | } 59 | } 60 | 61 | OscBundle::~OscBundle() 62 | { 63 | delete mPacket; 64 | 65 | for (qint32 i = 0; i < mContentList.size(); i++) 66 | { 67 | delete (mContentList[i]); 68 | } 69 | mContentList.clear(); 70 | } 71 | 72 | /** 73 | * Returns the current bundle time tag as a 64-bit integer value 74 | * 75 | * @return the time tag as a long value. 76 | */ 77 | QDateTime OscBundle::getTimeTag() 78 | { 79 | NtpTimestamp ntp(mPacket->getInt(mStartIdx + 8), mPacket->getInt(mStartIdx + 12)); 80 | return NtpTimestamp::toDateTime(ntp); 81 | } 82 | 83 | /** */ 84 | size_t OscBundle::getNumEntries() 85 | { 86 | return mContentList.size(); 87 | } 88 | 89 | /** */ 90 | OscBundle* OscBundle::getBundle(qint32 index) 91 | { 92 | if (dynamic_cast(mContentList[index]) != 0) 93 | return dynamic_cast(mContentList[index]); 94 | throw GetBundleException(); 95 | } 96 | 97 | /** 98 | * Conversion type for current OscContent object as an OscMessage 99 | * object. 100 | * 101 | * @return this as an OscMessage object. If this cannot be convert to an 102 | * OscMessage object, returns null. 103 | */ 104 | OscMessage* OscBundle::getMessage(qint32 index) 105 | { 106 | if (dynamic_cast(mContentList[index]) != 0) 107 | return dynamic_cast(mContentList[index]); 108 | throw GetMessageException(); 109 | } 110 | --------------------------------------------------------------------------------