├── .gitignore ├── .gitmodules ├── .travis.yml ├── README.md ├── app ├── QOSC │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── QOSC.pri │ ├── README.md │ ├── examples │ │ ├── .gitignore │ │ ├── example-receive │ │ │ ├── example-receive.pro │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ └── mainwindow.h │ │ └── example-send │ │ │ ├── example-send.pro │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ └── mainwindow.h │ ├── libs │ │ └── oscpack │ │ │ ├── .gitignore │ │ │ ├── CHANGES │ │ │ ├── CMakeLists.txt │ │ │ ├── LICENSE │ │ │ ├── README │ │ │ ├── README.md │ │ │ ├── TODO │ │ │ ├── appveyor.yml │ │ │ ├── biicode.conf │ │ │ ├── examples │ │ │ ├── OscDump.cpp │ │ │ ├── SimpleReceive.cpp │ │ │ └── SimpleSend.cpp │ │ │ ├── ip │ │ │ ├── IpEndpointName.cpp │ │ │ ├── IpEndpointName.h │ │ │ ├── NetworkingUtils.h │ │ │ ├── PacketListener.h │ │ │ ├── TimerListener.h │ │ │ ├── UdpSocket.h │ │ │ ├── posix │ │ │ │ ├── NetworkingUtils.cpp │ │ │ │ └── UdpSocket.cpp │ │ │ └── win32 │ │ │ │ ├── NetworkingUtils.cpp │ │ │ │ └── UdpSocket.cpp │ │ │ ├── make.MinGW32.bat │ │ │ ├── osc │ │ │ ├── MessageMappingOscPacketListener.h │ │ │ ├── OscException.h │ │ │ ├── OscHostEndianness.h │ │ │ ├── OscOutboundPacketStream.cpp │ │ │ ├── OscOutboundPacketStream.h │ │ │ ├── OscPacketListener.h │ │ │ ├── OscPrintReceivedElements.cpp │ │ │ ├── OscPrintReceivedElements.h │ │ │ ├── OscReceivedElements.cpp │ │ │ ├── OscReceivedElements.h │ │ │ ├── OscTypes.cpp │ │ │ └── OscTypes.h │ │ │ └── tests │ │ │ ├── OscReceiveTest.cpp │ │ │ ├── OscReceiveTest.h │ │ │ ├── OscSendTests.cpp │ │ │ ├── OscSendTests.h │ │ │ ├── OscUnitTests.cpp │ │ │ └── OscUnitTests.h │ ├── scripts │ │ └── ci │ │ │ ├── common │ │ │ └── script.sh │ │ │ ├── linux │ │ │ └── install.sh │ │ │ └── osx │ │ │ └── install.sh │ └── src │ │ ├── qoscargument.h │ │ ├── qoscbundle.cpp │ │ ├── qoscbundle.h │ │ ├── qoscmessage.cpp │ │ ├── qoscmessage.h │ │ ├── qoscreceiver.cpp │ │ ├── qoscreceiver.h │ │ ├── qoscsender.cpp │ │ └── qoscsender.h ├── app.pro ├── fileio.cpp ├── fileio.h ├── icons │ ├── 128x128 │ │ └── cool-retro-term.png │ ├── 256x256 │ │ └── cool-retro-term.png │ ├── 32x32 │ │ └── cool-retro-term.png │ ├── 64x64 │ │ └── cool-retro-term.png │ └── crt.icns ├── main.cpp ├── monospacefontmanager.cpp ├── monospacefontmanager.h ├── qml │ ├── AboutDialog.qml │ ├── ApplicationSettings.qml │ ├── BurnInEffect.qml │ ├── CRTMainMenuBar.qml │ ├── CheckableSlider.qml │ ├── ColorButton.qml │ ├── Components │ │ └── SizedLabel.qml │ ├── Effects │ │ ├── CircleEQ.qml │ │ ├── Plasma.qml │ │ ├── Tiles.qml │ │ └── Tunnel.qml │ ├── FontPixels.qml │ ├── FontScanlines.qml │ ├── Fonts.qml │ ├── Glossy.qml │ ├── InsertNameDialog.qml │ ├── PreprocessedTerminal.qml │ ├── SettingsAdvancedTab.qml │ ├── SettingsEffectsTab.qml │ ├── SettingsGeneralTab.qml │ ├── SettingsTerminalTab.qml │ ├── SettingsWindow.qml │ ├── ShaderTerminal.qml │ ├── SimpleSlider.qml │ ├── SizeOverlay.qml │ ├── SlowBurnIn.qml │ ├── Storage.qml │ ├── TerminalContainer.qml │ ├── TimeManager.qml │ ├── fonts │ │ ├── 1971-ibm-3278 │ │ │ ├── 3270Medium.ttf │ │ │ ├── LICENSE.txt │ │ │ └── README.md │ │ ├── 1977-apple2 │ │ │ ├── FreeLicense.txt │ │ │ ├── PRNumber3.ttf │ │ │ └── PrintChar21.ttf │ │ ├── 1977-commodore-pet │ │ │ ├── FreeLicense.txt │ │ │ └── PetMe.ttf │ │ ├── 1979-atari-400-800 │ │ │ ├── AtariClassic-Regular.ttf │ │ │ └── Read Me.pdf │ │ ├── 1981-ibm-pc │ │ │ ├── LICENSE.TXT │ │ │ └── PxPlus_IBM_BIOS.ttf │ │ ├── 1982-commodore64 │ │ │ ├── C64_Pro_Mono-STYLE.ttf │ │ │ └── license.txt │ │ ├── 1985-ibm-pc-vga │ │ │ ├── LICENSE.TXT │ │ │ └── PxPlus_IBM_VGA8.ttf │ │ ├── modern-fixedsys-excelsior │ │ │ └── FSEX301-L2.ttf │ │ ├── modern-hermit │ │ │ ├── Hermit-bold.otf │ │ │ ├── Hermit-light.otf │ │ │ ├── Hermit-medium.otf │ │ │ └── LICENSE │ │ ├── modern-inconsolata │ │ │ └── Inconsolata.otf │ │ ├── modern-pro-font-win-tweaked │ │ │ ├── ._LICENSE │ │ │ ├── ._readme.txt │ │ │ ├── Comments for ProFontWindows │ │ │ ├── LICENSE │ │ │ ├── ProFontWindows.ttf │ │ │ └── readme.txt │ │ ├── modern-proggy-tiny │ │ │ ├── Licence.txt │ │ │ └── ProggyTiny.ttf │ │ └── modern-terminus │ │ │ ├── COPYING │ │ │ └── TerminusTTF-4.46.0.ttf │ ├── images │ │ ├── allNoise512.png │ │ └── crt256.png │ ├── main.qml │ ├── resources.qrc │ └── utils.js ├── scoscdataprovider.cpp └── scoscdataprovider.h ├── cool-retro-term.desktop ├── crt-live-coding.pro ├── foxdot-server.py ├── gpl-2.0.txt ├── gpl-3.0.txt ├── packaging ├── appdata │ └── cool-retro-term.appdata.xml ├── debian │ ├── .gitignore │ ├── changelog │ ├── compat │ ├── control │ ├── cool-retro-term.1 │ ├── copyright │ ├── rules │ ├── source │ │ └── format │ └── watch └── rpm │ └── cool-retro-term.spec ├── sc-foxdot-visual.scd ├── snap └── snapcraft.yaml └── vimrc /.gitignore: -------------------------------------------------------------------------------- 1 | # C++ objects and libs 2 | 3 | *.slo 4 | *.lo 5 | *.o 6 | *.a 7 | *.la 8 | *.lai 9 | *.so 10 | *.dll 11 | *.dylib 12 | 13 | # Qt-es 14 | 15 | /.qmake.cache 16 | /.qmake.stash 17 | *.pro.user 18 | *.pro.user.* 19 | *.moc 20 | moc_*.cpp 21 | qrc_*.cpp 22 | ui_*.h 23 | Makefile* 24 | *-build-* 25 | 26 | # QtCreator 27 | 28 | *.autosave 29 | 30 | # QtCtreator Qml 31 | *.qmlproject.user 32 | *.qmlproject.user.* 33 | 34 | # Others 35 | 36 | *.xcf 37 | 38 | # Ubuntu SDk 39 | *.excludes 40 | *.json 41 | 42 | # Excludes compiled files 43 | imports 44 | cool-retro-term 45 | 46 | # Mac OSX 47 | 48 | .DS_Store 49 | *.app 50 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "qmltermwidget"] 2 | path = qmltermwidget 3 | url = https://github.com/Swordfish90/qmltermwidget 4 | branch = unstable 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | dist: trusty 3 | language: c++ 4 | 5 | install: 6 | - sudo add-apt-repository -y ppa:beineri/opt-qt58-trusty 7 | - sudo apt-get update -qq 8 | - sudo apt-get -y install build-essential qt58declarative qt58graphicaleffects qt58quickcontrols libgl1-mesa-dev 9 | - source /opt/qt*/bin/qt*-env.sh 10 | 11 | script: 12 | - qmake CONFIG+=release PREFIX=/usr 13 | - make -j$(nproc) 14 | - mkdir -p appdir/usr/share/metainfo appdir/usr/bin 15 | - cp packaging/appdata/cool-retro-term.appdata.xml appdir/usr/share/metainfo/ 16 | - cp cool-retro-term appdir/usr/bin/ 17 | - cp ./cool-retro-term.desktop appdir/ 18 | - cp ./app/icons/128x128/cool-retro-term.png appdir/ 19 | - cp -r ./app/qml appdir/usr/ 20 | - cp -r ./qmltermwidget/QMLTermWidget appdir/usr/qml/ # Workaround for https://github.com/probonopd/linuxdeployqt/issues/78 21 | - wget -c https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage 22 | - chmod a+x linuxdeployqt-*.AppImage 23 | - unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH 24 | - export VERSION=$(git rev-parse --short HEAD) # linuxdeployqt uses this for naming the file 25 | - ./linuxdeployqt-*.AppImage appdir/usr/bin/cool-retro-term -qmldir=./app/qml/ -qmldir=./qmltermwidget/ # -verbose=3 2>&1 | grep "path:" -C 3 26 | - ./linuxdeployqt-*.AppImage appdir/usr/bin/cool-retro-term -qmldir=./app/qml/ -qmldir=./qmltermwidget/ -verbose=2 -appimage 27 | 28 | after_success: 29 | - find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq 30 | - # curl --upload-file Cool*.AppImage https://transfer.sh/Cool_Retro_Term-git.$(git rev-parse --short HEAD)-x86_64.AppImage 31 | - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh 32 | - bash upload.sh Cool*.AppImage* 33 | 34 | branches: 35 | except: 36 | - # Do not build tags that we create when we upload to GitHub Releases 37 | - /^(?i:continuous)/ 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # crt-live-coding 2 | 3 | [![In action](https://img.youtube.com/vi/_8ITuKIi_Is/maxresdefault.jpg)](https://www.youtube.com/watch?v=_8ITuKIi_Is) 4 | 5 | ## Description 6 | 7 | This project is an attempt to a nice looking music live coding environment based on a cool-retro-term fork. 8 | It currently makes use of FoxDot, supercollider and vim, but any cli application with a supercollider backend is theoretically supported. 9 | 10 | Beware, you are dealing with a *very early* release so don't expect a plug and play experience! 11 | 12 | ## Build instructions (Linux) 13 | 14 | Make sure FoxDot and supercollider (with sc3 plugins) are property installed: https://github.com/Qirky/FoxDot. 15 | 16 | Install qt5 and the related dependencies: https://github.com/Swordfish90/cool-retro-term. 17 | 18 | ```bash 19 | # Get it from GitHub 20 | git clone --recursive https://github.com/Swordfish90/crt-live-coding.git 21 | 22 | cd crt-live-coding 23 | 24 | qmake && make 25 | ``` 26 | 27 | ## Run instructions 28 | 29 | Open a terminal into the project root and type: 30 | 31 | ```bash 32 | 33 | # Launch supercollider and the FoxDot server 34 | sclang sc-foxdot-visual.scd & python3 foxdot-server.py 35 | 36 | # This will launch crt-live-coding running vim with a custom vimrc file 37 | ./crt-live-coding -e vim -u vimrc 38 | 39 | # Press enter (in normal mode) to play that line of foxdot code! 40 | ``` 41 | 42 | ## How does it work? 43 | 44 | There are a few pieces here working together. 45 | 46 | sc-foxdot-visual.scd launches FoxDot.start and analyzes the audio stream, extracting features needed for graphical effects. These are sent to crt-live-coding via OSC commands on port 7089. 47 | 48 | foxdot-server.py runs a FoxDot server in the background and listens on port 7088 for FoxDot instructions. 49 | 50 | crt-live-coding is running vim with a custom vimrc file. Every time you press enter (in normal mode) vim will send the current line to port 7088. 51 | 52 | ## Donations 53 | I made this project in my spare time because I love what I'm doing. If you are enjoying it and you want to buy me a beer click [here](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=flscogna%40gmail%2ecom&lc=IT&item_name=Filippo%20Scognamiglio¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted). 54 | -------------------------------------------------------------------------------- /app/QOSC/.gitignore: -------------------------------------------------------------------------------- 1 | #libs/* 2 | examples/build-* 3 | 4 | *.DS_Store 5 | -------------------------------------------------------------------------------- /app/QOSC/.travis.yml: -------------------------------------------------------------------------------- 1 | os: 2 | - linux 3 | - osx 4 | 5 | language: cpp 6 | sudo: required 7 | 8 | install: . scripts/ci/$TRAVIS_OS_NAME/install.sh 9 | script: . scripts/ci/common/script.sh 10 | -------------------------------------------------------------------------------- /app/QOSC/QOSC.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $$PWD/libs/oscpack 2 | INCLUDEPATH += $$PWD/src 3 | 4 | HEADERS += \ 5 | $$PWD/src/qoscsender.h \ 6 | $$PWD/src/qoscreceiver.h \ 7 | $$PWD/src/qoscargument.h \ 8 | $$PWD/src/qoscbundle.h \ 9 | $$PWD/src/qoscmessage.h 10 | HEADERS += 11 | HEADERS += 12 | HEADERS += 13 | 14 | SOURCES += \ 15 | $$PWD/src/qoscbundle.cpp \ 16 | $$PWD/src/qoscsender.cpp \ 17 | $$PWD/src/qoscmessage.cpp \ 18 | $$PWD/src/qoscreceiver.cpp 19 | SOURCES += 20 | SOURCES += 21 | SOURCES += 22 | 23 | HEADERS += $$PWD/libs/oscpack/ip/IpEndpointName.h 24 | HEADERS += $$PWD/libs/oscpack/ip/NetworkingUtils.h 25 | HEADERS += $$PWD/libs/oscpack/ip/PacketListener.h 26 | HEADERS += $$PWD/libs/oscpack/ip/TimerListener.h 27 | HEADERS += $$PWD/libs/oscpack/ip/UdpSocket.h 28 | HEADERS += $$PWD/libs/oscpack/osc/MessageMappingOscPacketListener.h 29 | HEADERS += $$PWD/libs/oscpack/osc/OscException.h 30 | HEADERS += $$PWD/libs/oscpack/osc/OscHostEndianness.h 31 | HEADERS += $$PWD/libs/oscpack/osc/OscOutboundPacketStream.h 32 | HEADERS += $$PWD/libs/oscpack/osc/OscPacketListener.h 33 | HEADERS += $$PWD/libs/oscpack/osc/OscPrintReceivedElements.h 34 | HEADERS += $$PWD/libs/oscpack/osc/OscReceivedElements.h 35 | HEADERS += $$PWD/libs/oscpack/osc/OscTypes.h 36 | 37 | unix { 38 | SOURCES += $$PWD/libs/oscpack/ip/posix/NetworkingUtils.cpp 39 | SOURCES += $$PWD/libs/oscpack/ip/posix/UdpSocket.cpp 40 | } else { 41 | SOURCES += $$PWD/libs/oscpack/ip/win32/NetworkingUtils.cpp 42 | SOURCES += $$PWD/libs/oscpack/ip/win32/UdpSocket.cpp 43 | } 44 | 45 | SOURCES += $$PWD/libs/oscpack/ip/IpEndpointName.cpp 46 | SOURCES += $$PWD/libs/oscpack/osc/OscOutboundPacketStream.cpp 47 | SOURCES += $$PWD/libs/oscpack/osc/OscPrintReceivedElements.cpp 48 | SOURCES += $$PWD/libs/oscpack/osc/OscReceivedElements.cpp 49 | SOURCES += $$PWD/libs/oscpack/osc/OscTypes.cpp 50 | 51 | DISTFILES += $$PWD/README.md \ 52 | $$PWD/.travis.yml 53 | -------------------------------------------------------------------------------- /app/QOSC/README.md: -------------------------------------------------------------------------------- 1 | QOSC 2 | === 3 | Description 4 | --- 5 | QOSC is a wrapper of oscpack, it allows to send and receive osc data within Qt. 6 | This is a work in progress and definitely needs some time and care. 7 | 8 | Build status 9 | --- 10 | [![Build Status](https://travis-ci.org/thomasgeissl/QOSC.svg?branch=master)](https://travis-ci.org/thomasgeissl/QOSC) 11 | 12 | 13 | Dependencies 14 | --- 15 | * https://github.com/MariadeAnton/oscpack/ (already included) 16 | 17 | License 18 | --- 19 | This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 20 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 21 | You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. 22 | 23 | Changelog 24 | --- 25 | -------------------------------------------------------------------------------- /app/QOSC/examples/.gitignore: -------------------------------------------------------------------------------- 1 | */*.pro.user* 2 | */build* 3 | -------------------------------------------------------------------------------- /app/QOSC/examples/example-receive/example-receive.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2016-01-18T15:13:11 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = example-receive 12 | TEMPLATE = app 13 | 14 | 15 | SOURCES += main.cpp\ 16 | mainwindow.cpp 17 | 18 | HEADERS += mainwindow.h 19 | 20 | include(../../QOSC.pri) 21 | -------------------------------------------------------------------------------- /app/QOSC/examples/example-receive/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | MainWindow w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /app/QOSC/examples/example-receive/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | #include 4 | 5 | MainWindow::MainWindow(QWidget *parent) 6 | : QMainWindow(parent), 7 | _oscReceiver(new QOSCReceiver(8000, this)), 8 | _slider(new QSlider(this)), 9 | _toggle(new QPushButton(this)), 10 | _lineEdit(new QLineEdit(this)), 11 | _spinBox(new QDoubleSpinBox) 12 | { 13 | connect(_oscReceiver, SIGNAL(messageReceived(QOSCMessage*)), this, SLOT(onMessageReceived(QOSCMessage*))); 14 | _oscReceiver->start(); 15 | 16 | 17 | setWindowTitle("QOSCReceiveExample"); 18 | QWidget *mainWidget = new QWidget(this); 19 | QVBoxLayout *mainLayout = new QVBoxLayout(mainWidget); 20 | mainLayout->addWidget(_slider); 21 | mainLayout->addWidget(_lineEdit); 22 | mainLayout->addWidget(_toggle); 23 | mainLayout->addWidget(_spinBox); 24 | setCentralWidget(mainWidget); 25 | 26 | mainWidget->setEnabled(false); 27 | _toggle->setCheckable(true); 28 | 29 | } 30 | 31 | MainWindow::~MainWindow() 32 | { 33 | 34 | } 35 | 36 | void MainWindow::onMessageReceived(QOSCMessage *msg) 37 | { 38 | qDebug()<<"new message"<getAddress(); 39 | // foreach(QOSCArgument *arg, msg->getArguments()) 40 | // { 41 | // arg->_type 42 | 43 | // } 44 | // for(int i = 0; i < msg->getSize(); i++) 45 | // { 46 | // if(msg->isIntArgument(i)) 47 | // { 48 | // qDebug()<<"arg"<getArgumentAsInt(i); 49 | // } 50 | // else if(msg->isStringArgument(i)) 51 | // { 52 | // qDebug()<<"arg"<getArgumentAsString(i); 53 | // } 54 | // else if(msg->isBoolArgument(i)) 55 | // { 56 | // qDebug()<<"arg"<getArgumentAsBool(i); 57 | // } 58 | // else if(msg->isFloatArgument(i)) 59 | // { 60 | // qDebug()<<"arg"<getArgumentAsFloat(i); 61 | // } 62 | // } 63 | if(msg->getAddress() == "/slider" && msg->isIntArgument(0)) 64 | { 65 | _slider->setValue(msg->getArgumentAsInt(0)); 66 | } 67 | else if(msg->getAddress() == "/lineEdit" && msg->isStringArgument(0)) 68 | { 69 | _lineEdit->setText(msg->getArgumentAsString(0)); 70 | } 71 | else if(msg->getAddress() == "/toggle" && msg->isBoolArgument(0)) 72 | { 73 | _toggle->setChecked(msg->getArgumentAsBool(0)); 74 | } 75 | else if(msg->getAddress() == "/spinBox" && msg->isFloatArgument(0)) 76 | { 77 | _spinBox->setValue(msg->getArgumentAsFloat(0)); 78 | } 79 | else if(msg->getAddress() == "/values" && 80 | msg->isIntArgument(0) && 81 | msg->isStringArgument(1) && 82 | msg->isBoolArgument(2) && 83 | msg->isFloatArgument(3)) 84 | { 85 | _slider->setValue(msg->getArgumentAsInt(0)); 86 | _lineEdit->setText(msg->getArgumentAsString(1)); 87 | _toggle->setChecked(msg->getArgumentAsBool(2)); 88 | _spinBox->setValue(msg->getArgumentAsFloat(3)); 89 | } 90 | } 91 | 92 | 93 | -------------------------------------------------------------------------------- /app/QOSC/examples/example-receive/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include "qoscreceiver.h" 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | class MainWindow : public QMainWindow 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | MainWindow(QWidget *parent = 0); 18 | ~MainWindow(); 19 | QOSCReceiver *_oscReceiver; 20 | public slots: 21 | void onMessageReceived(QOSCMessage *msg); 22 | 23 | private: 24 | QSlider *_slider; 25 | QPushButton *_toggle; 26 | QLineEdit *_lineEdit; 27 | QDoubleSpinBox *_spinBox; 28 | }; 29 | 30 | #endif // MAINWINDOW_H 31 | -------------------------------------------------------------------------------- /app/QOSC/examples/example-send/example-send.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2015-04-02T15:53:12 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = example-send 12 | TEMPLATE = app 13 | 14 | 15 | SOURCES += main.cpp\ 16 | mainwindow.cpp 17 | 18 | HEADERS += mainwindow.h 19 | include(../../QOSC.pri) 20 | 21 | -------------------------------------------------------------------------------- /app/QOSC/examples/example-send/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | int main(int argc, char *argv[]) 4 | { 5 | QApplication a(argc, argv); 6 | MainWindow w; 7 | w.show(); 8 | 9 | return a.exec(); 10 | } 11 | -------------------------------------------------------------------------------- /app/QOSC/examples/example-send/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | #include 4 | 5 | MainWindow::MainWindow(QWidget *parent) 6 | : QMainWindow(parent), 7 | _oscSender(new QOSCSender("127.0.0.1", 8000, this)), 8 | _slider(new QSlider(this)), 9 | _lineEdit(new QLineEdit(this)), 10 | _toggle(new QPushButton(this)), 11 | _spinBox(new QDoubleSpinBox), 12 | _sendAllButton(new QPushButton("send all", this)) 13 | { 14 | _toggle->setCheckable(true); 15 | 16 | connect(_slider, SIGNAL(valueChanged(int)), this, SLOT(onSliderChange(int))); 17 | connect(_lineEdit, SIGNAL(textChanged(QString)), this, SLOT(onLineEditChange(QString))); 18 | connect(_toggle, SIGNAL(clicked(bool)), this, SLOT(onToggleChange(bool))); 19 | connect(_spinBox, SIGNAL(valueChanged(double)), SLOT(onSpinBoxChange(double))); 20 | connect(_sendAllButton, SIGNAL(clicked(bool)), SLOT(onSendAllButtonClick(bool))); 21 | 22 | setWindowTitle("QOSCSendExample"); 23 | QWidget *mainWidget = new QWidget(this); 24 | QVBoxLayout *mainLayout = new QVBoxLayout(mainWidget); 25 | mainLayout->addWidget(_slider); 26 | mainLayout->addWidget(_lineEdit); 27 | mainLayout->addWidget(_toggle); 28 | mainLayout->addWidget(_spinBox); 29 | mainLayout->addWidget(_sendAllButton); 30 | setCentralWidget(mainWidget); 31 | } 32 | 33 | MainWindow::~MainWindow() 34 | { 35 | 36 | } 37 | 38 | void MainWindow::onSliderChange(int value) 39 | { 40 | 41 | QOSCMessage *message = new QOSCMessage("/slider"); 42 | message->addInt(value); 43 | _oscSender->send(message); 44 | } 45 | 46 | void MainWindow::onToggleChange(bool value) 47 | { 48 | QOSCMessage *message = new QOSCMessage("/toggle"); 49 | message->addBool(value); 50 | _oscSender->send(message); 51 | } 52 | 53 | void MainWindow::onLineEditChange(QString value) 54 | { 55 | QOSCMessage *message = new QOSCMessage("/lineEdit"); 56 | message->addString(value); 57 | _oscSender->send(message); 58 | } 59 | 60 | void MainWindow::onSpinBoxChange(double value) 61 | { 62 | QOSCMessage *message = new QOSCMessage("/spinBox"); 63 | message->addFloat(value); 64 | _oscSender->send(message); 65 | } 66 | 67 | void MainWindow::onSendAllButtonClick(bool value) 68 | { 69 | Q_UNUSED(value); 70 | QOSCMessage *message = new QOSCMessage("/values"); 71 | message->addInt(_slider->value()); 72 | message->addString(_lineEdit->text()); 73 | message->addBool(_toggle->isChecked()); 74 | message->addFloat(_spinBox->value()); 75 | _oscSender->send(message); 76 | } 77 | -------------------------------------------------------------------------------- /app/QOSC/examples/example-send/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include "qoscsender.h" 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | class MainWindow : public QMainWindow 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | MainWindow(QWidget *parent = 0); 18 | ~MainWindow(); 19 | private slots: 20 | void onSliderChange(int value); 21 | void onToggleChange(bool value); 22 | void onLineEditChange(QString value); 23 | void onSpinBoxChange(double value); 24 | void onSendAllButtonClick(bool value); 25 | private: 26 | QOSCSender *_oscSender; 27 | QSlider *_slider; 28 | QPushButton *_toggle; 29 | QLineEdit *_lineEdit; 30 | QDoubleSpinBox *_spinBox; 31 | 32 | QPushButton *_sendAllButton; 33 | }; 34 | 35 | #endif // MAINWINDOW_H 36 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/.gitignore: -------------------------------------------------------------------------------- 1 | bii/ 2 | bin/ -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/CHANGES: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/QOSC/libs/oscpack/CHANGES -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | IF(BIICODE) 2 | include(${CMAKE_HOME_DIRECTORY}/biicode.cmake) 3 | 4 | IF(WIN32) 5 | list(REMOVE_ITEM BII_LIB_SRC ip/posix/NetworkingUtils.cpp ip/posix/UdpSocket.cpp) 6 | 7 | ELSE() 8 | list(REMOVE_ITEM BII_LIB_SRC ip/win32/NetworkingUtils.cpp ip/win32/UdpSocket.cpp) 9 | 10 | ENDIF() 11 | 12 | # Include base block dirU 13 | ADD_BIICODE_TARGETS() 14 | 15 | IF(WIN32) 16 | TARGET_LINK_LIBRARIES(${BII_LIB_TARGET} PUBLIC winmm) 17 | 18 | ENDIF() 19 | TARGET_INCLUDE_DIRECTORIES(${BII_LIB_TARGET} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 20 | 21 | 22 | ELSE() 23 | cmake_minimum_required(VERSION 2.6) 24 | PROJECT(TestOscpack) 25 | 26 | INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}) 27 | 28 | # separate versions of NetworkingUtils.cpp and UdpSocket.cpp are provided for Win32 and POSIX 29 | # the IpSystemTypePath selects the correct ones based on the current platform 30 | 31 | IF(WIN32) 32 | set(IpSystemTypePath ip/win32) 33 | set(LIBS ${LIBS} Ws2_32 winmm) 34 | ELSE(WIN32) 35 | set(IpSystemTypePath ip/posix) 36 | ENDIF(WIN32) 37 | 38 | ADD_LIBRARY(oscpack 39 | 40 | ip/IpEndpointName.h 41 | ip/IpEndpointName.cpp 42 | 43 | ip/NetworkingUtils.h 44 | ${IpSystemTypePath}/NetworkingUtils.cpp 45 | 46 | ip/UdpSocket.h 47 | ${IpSystemTypePath}/UdpSocket.cpp 48 | 49 | ip/PacketListener.h 50 | ip/TimerListener.h 51 | 52 | osc/OscTypes.h 53 | osc/OscTypes.cpp 54 | osc/OscHostEndianness.h 55 | osc/OscException.h 56 | osc/OscPacketListener.h 57 | osc/MessageMappingOscPacketListener.h 58 | osc/OscReceivedElements.h 59 | osc/OscReceivedElements.cpp 60 | osc/OscPrintReceivedElements.h 61 | osc/OscPrintReceivedElements.cpp 62 | osc/OscOutboundPacketStream.h 63 | osc/OscOutboundPacketStream.cpp 64 | 65 | ) 66 | 67 | 68 | ADD_EXECUTABLE(OscUnitTests tests/OscUnitTests.cpp) 69 | TARGET_LINK_LIBRARIES(OscUnitTests oscpack ${LIBS}) 70 | 71 | ADD_EXECUTABLE(OscSendTests tests/OscSendTests.cpp) 72 | TARGET_LINK_LIBRARIES(OscSendTests oscpack ${LIBS}) 73 | 74 | ADD_EXECUTABLE(OscReceiveTest tests/OscReceiveTest.cpp) 75 | TARGET_LINK_LIBRARIES(OscReceiveTest oscpack ${LIBS}) 76 | 77 | 78 | ADD_EXECUTABLE(OscDump examples/OscDump.cpp) 79 | TARGET_LINK_LIBRARIES(OscDump oscpack ${LIBS}) 80 | 81 | ADD_EXECUTABLE(SimpleReceive examples/SimpleReceive.cpp) 82 | TARGET_LINK_LIBRARIES(SimpleReceive oscpack ${LIBS}) 83 | 84 | ADD_EXECUTABLE(SimpleSend examples/SimpleSend.cpp) 85 | TARGET_LINK_LIBRARIES(SimpleSend oscpack ${LIBS}) 86 | 87 | 88 | if(MSVC) 89 | # Force to always compile with W4 90 | if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") 91 | string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") 92 | else() 93 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") 94 | endif() 95 | elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) 96 | # Update if necessary 97 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-long-long -pedantic") 98 | endif() 99 | ENDIF() 100 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/LICENSE: -------------------------------------------------------------------------------- 1 | oscpack -- Open Sound Control (OSC) packet manipulation library 2 | http://www.rossbencina.com/code/oscpack 3 | 4 | Copyright (c) 2004-2013 Ross Bencina 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files 8 | (the "Software"), to deal in the Software without restriction, 9 | including without limitation the rights to use, copy, modify, merge, 10 | publish, distribute, sublicense, and/or sell copies of the Software, 11 | and to permit persons to whom the Software is furnished to do so, 12 | subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 21 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 22 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | 25 | ### 26 | 27 | The text above constitutes the entire oscpack license; however, 28 | the oscpack developer(s) also make the following non-binding requests: 29 | 30 | Any person wishing to distribute modifications to the Software is 31 | requested to send the modifications to the original developer so that 32 | they can be incorporated into the canonical version. It is also 33 | requested that these non-binding requests be included whenever the 34 | above license is reproduced. -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/TODO: -------------------------------------------------------------------------------- 1 | TODO: 2 | 3 | - consider adding the local endpoint name to PacketListener::PacketReceived() params 4 | 5 | - consider adding ListenerThread class to support old seperate thread listener functionality, something like: 6 | 7 | class UdpSocketListenerThread{ 8 | public: 9 | UdpSocketListenerThread( UdpSocket& socket, Listener *listener ); 10 | UdpSocketListenerThread( UdpSocketReceiveMultiplexer *mux ); 11 | ~UdpSocketListenerThread(); 12 | 13 | void Run(); 14 | void Stop(); 15 | }; 16 | 17 | - work out a way to make the parsing classes totally safe. at a minimum this 18 | means adding functions to test for invalid float/doublevalues, 19 | making sure the iterators never pass the end of the message, ... 20 | (passing end of message can happen if: 21 | - too many args in type tags 22 | a. typetags overflow message size 23 | b. args fulfilling typetags overflow message size 24 | - strings too long or not terminated correctly 25 | - blobs too long or not terminated correctly 26 | 27 | if the message was fully checked during construction, the end() iterator 28 | could be moved back until only arguments which fit withing size() may 29 | be interated (this could be none). A flag could be set to indicate that 30 | something was wrong. 31 | 32 | - other packet badness could include: 33 | - time tags too far into the future (the scheduler should deal with 34 | that i guess). 35 | - message address patterns which aren't correctly terminated 36 | 37 | - improve the ability to parse messages without tags (SC uses methods which 38 | get the data and advance the iterator in one step.) 39 | - Check* could be modified to do this - ie if typetags are not present 40 | it could check that reading the field won't escape the message size 41 | and return the data, or return false if some consistency 42 | constraint is violated. 43 | (or alternately drop support for messages without type tags) 44 | 45 | 46 | - add a method to discard an inprogress message if it gets half 47 | constructed and the buffer is full in OutboundPacket 48 | 49 | - write a stress testing app which can send garbage packets to try to flush out other bugs in the parsing code. 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | 3 | install: 4 | - ps: wget https://s3.amazonaws.com/biibinaries/thirdparty/cmake-3.0.2-win32-x86.zip -OutFile cmake.zip 5 | - cmd: echo "Unzipping cmake..." 6 | - cmd: 7z x cmake.zip -o"C:\Program Files (x86)\" -y > nul 7 | - cmd: set PATH=%PATH:CMake 2.8\bin=%;C:\Program Files (x86)\cmake-3.0.2-win32-x86\bin 8 | - cmd: cmake --version 9 | - cmd: echo "Downloading biicode..." 10 | - ps: wget http://www.biicode.com/downloads/latest/win -OutFile bii-win.exe 11 | - cmd: bii-win.exe /VERYSILENT 12 | - cmd: set PATH=%PATH%;C:\Program Files (x86)\BiiCode\bii 13 | - cmd: bii -v 14 | - cmd: del bii-win.exe 15 | - cmd: del cmake.zip 16 | 17 | before_build: 18 | - cmd: bii init -L 19 | - cmd: bii configure -G "Visual Studio 12" 20 | 21 | build_script: 22 | - cmd: bii build 23 | test_script: 24 | - cmd: cd bin 25 | - cmd: dir 26 | 27 | deploy_script: 28 | - cmd: bii user %block_user% -p %secured_passwd% 29 | - if defined APPVEYOR_REPO_TAG_NAME set VERSION=%APPVEYOR_REPO_TAG_NAME% 30 | - if defined APPVEYOR_REPO_TAG_NAME bii publish -r --tag=STABLE --versiontag=%VERSION% 31 | - if not defined APPVEYOR_REPO_TAG_NAME bii publish -r 32 | 33 | on_success: 34 | - ps: | 35 | git checkout "$env:APPVEYOR_REPO_BRANCH" 36 | git config --global core.autocrlf true 37 | git config --global credential.helper store 38 | Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:access_token):x-oauth-basic@github.com`n" 39 | git remote add neworigin "$env:github_repo" 40 | git config --global user.email "$env:github_email" 41 | git config --global user.name "$env:github_user" 42 | git add biicode.conf 43 | git commit -m "Updated biicode parents [skip ci]" 44 | git push neworigin "$env:APPVEYOR_REPO_BRANCH" 45 | 46 | environment: 47 | block_user: 48 | "Maria" 49 | block_name: 50 | "oscpack" 51 | secured_passwd: 52 | secure: ZMvgETfLAUo7kISnvrinBA== 53 | access_token: 54 | secure: GdIDIRkmsM9blqS143lQErkxguMYgJBs74GzWw+lgzjvl/NoLs4ErcOZ2JBAEmkr 55 | github_user: 56 | "MariadeAnton" 57 | github_email: 58 | "maria.deanton@biicode.com" 59 | github_repo: 60 | "git@github.com:MariadeAnton/oscpack-biicode.git" -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/biicode.conf: -------------------------------------------------------------------------------- 1 | # Biicode configuration file 2 | 3 | [requirements] 4 | 5 | [parent] 6 | # This file contains your block ancestors versions 7 | * Maria/oscpack: 0 8 | 9 | [paths] 10 | / 11 | 12 | [dependencies] 13 | ip/UdpSocket.h + ip/win32/UdpSocket.cpp 14 | 15 | [mains] 16 | 17 | [hooks] 18 | 19 | [includes] 20 | 21 | [data] -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/examples/OscDump.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | oscpack -- Open Sound Control (OSC) packet manipulation library 3 | http://www.rossbencina.com/code/oscpack 4 | 5 | Copyright (c) 2004-2013 Ross Bencina 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 22 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 23 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | The text above constitutes the entire oscpack license; however, 29 | the oscpack developer(s) also make the following non-binding requests: 30 | 31 | Any person wishing to distribute modifications to the Software is 32 | requested to send the modifications to the original developer so that 33 | they can be incorporated into the canonical version. It is also 34 | requested that these non-binding requests be included whenever the 35 | above license is reproduced. 36 | */ 37 | 38 | /* 39 | OscDump prints incoming OSC packets. Unlike the Berkeley dumposc program 40 | OscDump uses a different printing format which indicates the type of each 41 | message argument. 42 | */ 43 | 44 | 45 | #include 46 | #include 47 | #include 48 | 49 | #if defined(__BORLANDC__) // workaround for BCB4 release build intrinsics bug 50 | namespace std { 51 | using ::__strcmp__; // avoid error: E2316 '__strcmp__' is not a member of 'std'. 52 | } 53 | #endif 54 | 55 | #include "osc/OscReceivedElements.h" 56 | #include "osc/OscPrintReceivedElements.h" 57 | 58 | #include "ip/UdpSocket.h" 59 | #include "ip/PacketListener.h" 60 | 61 | 62 | class OscDumpPacketListener : public PacketListener{ 63 | public: 64 | virtual void ProcessPacket( const char *data, int size, 65 | const IpEndpointName& remoteEndpoint ) 66 | { 67 | (void) remoteEndpoint; // suppress unused parameter warning 68 | 69 | std::cout << osc::ReceivedPacket( data, size ); 70 | } 71 | }; 72 | 73 | int main(int argc, char* argv[]) 74 | { 75 | if( argc >= 2 && std::strcmp( argv[1], "-h" ) == 0 ){ 76 | std::cout << "usage: OscDump [port]\n"; 77 | return 0; 78 | } 79 | 80 | int port = 7000; 81 | 82 | if( argc >= 2 ) 83 | port = std::atoi( argv[1] ); 84 | 85 | OscDumpPacketListener listener; 86 | UdpListeningReceiveSocket s( 87 | IpEndpointName( IpEndpointName::ANY_ADDRESS, port ), 88 | &listener ); 89 | 90 | std::cout << "listening for input on port " << port << "...\n"; 91 | std::cout << "press ctrl-c to end\n"; 92 | 93 | s.RunUntilSigInt(); 94 | 95 | std::cout << "finishing.\n"; 96 | 97 | return 0; 98 | } 99 | 100 | 101 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/examples/SimpleReceive.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Example of two different ways to process received OSC messages using oscpack. 3 | Receives the messages from the SimpleSend.cpp example. 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | #if defined(__BORLANDC__) // workaround for BCB4 release build intrinsics bug 10 | namespace std { 11 | using ::__strcmp__; // avoid error: E2316 '__strcmp__' is not a member of 'std'. 12 | } 13 | #endif 14 | 15 | #include "osc/OscReceivedElements.h" 16 | #include "osc/OscPacketListener.h" 17 | #include "ip/UdpSocket.h" 18 | 19 | 20 | #define PORT 7000 21 | 22 | class ExamplePacketListener : public osc::OscPacketListener { 23 | protected: 24 | 25 | virtual void ProcessMessage( const osc::ReceivedMessage& m, 26 | const IpEndpointName& remoteEndpoint ) 27 | { 28 | (void) remoteEndpoint; // suppress unused parameter warning 29 | 30 | try{ 31 | // example of parsing single messages. osc::OsckPacketListener 32 | // handles the bundle traversal. 33 | 34 | if( std::strcmp( m.AddressPattern(), "/test1" ) == 0 ){ 35 | // example #1 -- argument stream interface 36 | osc::ReceivedMessageArgumentStream args = m.ArgumentStream(); 37 | bool a1; 38 | osc::int32 a2; 39 | float a3; 40 | const char *a4; 41 | args >> a1 >> a2 >> a3 >> a4 >> osc::EndMessage; 42 | 43 | std::cout << "received '/test1' message with arguments: " 44 | << a1 << " " << a2 << " " << a3 << " " << a4 << "\n"; 45 | 46 | }else if( std::strcmp( m.AddressPattern(), "/test2" ) == 0 ){ 47 | // example #2 -- argument iterator interface, supports 48 | // reflection for overloaded messages (eg you can call 49 | // (*arg)->IsBool() to check if a bool was passed etc). 50 | osc::ReceivedMessage::const_iterator arg = m.ArgumentsBegin(); 51 | bool a1 = (arg++)->AsBool(); 52 | int a2 = (arg++)->AsInt32(); 53 | float a3 = (arg++)->AsFloat(); 54 | const char *a4 = (arg++)->AsString(); 55 | if( arg != m.ArgumentsEnd() ) 56 | throw osc::ExcessArgumentException(); 57 | 58 | std::cout << "received '/test2' message with arguments: " 59 | << a1 << " " << a2 << " " << a3 << " " << a4 << "\n"; 60 | } 61 | }catch( osc::Exception& e ){ 62 | // any parsing errors such as unexpected argument types, or 63 | // missing arguments get thrown as exceptions. 64 | std::cout << "error while parsing message: " 65 | << m.AddressPattern() << ": " << e.what() << "\n"; 66 | } 67 | } 68 | }; 69 | 70 | int main(int argc, char* argv[]) 71 | { 72 | (void) argc; // suppress unused parameter warnings 73 | (void) argv; // suppress unused parameter warnings 74 | 75 | ExamplePacketListener listener; 76 | UdpListeningReceiveSocket s( 77 | IpEndpointName( IpEndpointName::ANY_ADDRESS, PORT ), 78 | &listener ); 79 | 80 | std::cout << "press ctrl-c to end\n"; 81 | 82 | s.RunUntilSigInt(); 83 | 84 | return 0; 85 | } 86 | 87 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/examples/SimpleSend.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Simple example of sending an OSC message using oscpack. 3 | */ 4 | 5 | #include "osc/OscOutboundPacketStream.h" 6 | #include "ip/UdpSocket.h" 7 | 8 | 9 | #define ADDRESS "127.0.0.1" 10 | #define PORT 7000 11 | 12 | #define OUTPUT_BUFFER_SIZE 1024 13 | 14 | int main(int argc, char* argv[]) 15 | { 16 | (void) argc; // suppress unused parameter warnings 17 | (void) argv; // suppress unused parameter warnings 18 | 19 | UdpTransmitSocket transmitSocket( IpEndpointName( ADDRESS, PORT ) ); 20 | 21 | char buffer[OUTPUT_BUFFER_SIZE]; 22 | osc::OutboundPacketStream p( buffer, OUTPUT_BUFFER_SIZE ); 23 | 24 | p << osc::BeginBundleImmediate 25 | << osc::BeginMessage( "/test1" ) 26 | << true << 23 << (float)3.1415 << "hello" << osc::EndMessage 27 | << osc::BeginMessage( "/test2" ) 28 | << true << 24 << (float)10.8 << "world" << osc::EndMessage 29 | << osc::EndBundle; 30 | 31 | transmitSocket.Send( p.Data(), p.Size() ); 32 | } 33 | 34 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/ip/IpEndpointName.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | oscpack -- Open Sound Control (OSC) packet manipulation library 3 | http://www.rossbencina.com/code/oscpack 4 | 5 | Copyright (c) 2004-2013 Ross Bencina 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 22 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 23 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | The text above constitutes the entire oscpack license; however, 29 | the oscpack developer(s) also make the following non-binding requests: 30 | 31 | Any person wishing to distribute modifications to the Software is 32 | requested to send the modifications to the original developer so that 33 | they can be incorporated into the canonical version. It is also 34 | requested that these non-binding requests be included whenever the 35 | above license is reproduced. 36 | */ 37 | #include "IpEndpointName.h" 38 | 39 | #include 40 | 41 | #include "NetworkingUtils.h" 42 | 43 | 44 | unsigned long IpEndpointName::GetHostByName( const char *s ) 45 | { 46 | return ::GetHostByName(s); 47 | } 48 | 49 | 50 | void IpEndpointName::AddressAsString( char *s ) const 51 | { 52 | if( address == ANY_ADDRESS ){ 53 | std::sprintf( s, "" ); 54 | }else{ 55 | std::sprintf( s, "%d.%d.%d.%d", 56 | (int)((address >> 24) & 0xFF), 57 | (int)((address >> 16) & 0xFF), 58 | (int)((address >> 8) & 0xFF), 59 | (int)(address & 0xFF) ); 60 | } 61 | } 62 | 63 | 64 | void IpEndpointName::AddressAndPortAsString( char *s ) const 65 | { 66 | if( port == ANY_PORT ){ 67 | if( address == ANY_ADDRESS ){ 68 | std::sprintf( s, ":" ); 69 | }else{ 70 | std::sprintf( s, "%d.%d.%d.%d:", 71 | (int)((address >> 24) & 0xFF), 72 | (int)((address >> 16) & 0xFF), 73 | (int)((address >> 8) & 0xFF), 74 | (int)(address & 0xFF) ); 75 | } 76 | }else{ 77 | if( address == ANY_ADDRESS ){ 78 | std::sprintf( s, ":%d", port ); 79 | }else{ 80 | std::sprintf( s, "%d.%d.%d.%d:%d", 81 | (int)((address >> 24) & 0xFF), 82 | (int)((address >> 16) & 0xFF), 83 | (int)((address >> 8) & 0xFF), 84 | (int)(address & 0xFF), 85 | (int)port ); 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/ip/IpEndpointName.h: -------------------------------------------------------------------------------- 1 | /* 2 | oscpack -- Open Sound Control (OSC) packet manipulation library 3 | http://www.rossbencina.com/code/oscpack 4 | 5 | Copyright (c) 2004-2013 Ross Bencina 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 22 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 23 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | The text above constitutes the entire oscpack license; however, 29 | the oscpack developer(s) also make the following non-binding requests: 30 | 31 | Any person wishing to distribute modifications to the Software is 32 | requested to send the modifications to the original developer so that 33 | they can be incorporated into the canonical version. It is also 34 | requested that these non-binding requests be included whenever the 35 | above license is reproduced. 36 | */ 37 | #ifndef INCLUDED_OSCPACK_IPENDPOINTNAME_H 38 | #define INCLUDED_OSCPACK_IPENDPOINTNAME_H 39 | 40 | 41 | class IpEndpointName{ 42 | static unsigned long GetHostByName( const char *s ); 43 | public: 44 | static const unsigned long ANY_ADDRESS = 0xFFFFFFFF; 45 | static const int ANY_PORT = -1; 46 | 47 | IpEndpointName() 48 | : address( ANY_ADDRESS ), port( ANY_PORT ) {} 49 | IpEndpointName( int port_ ) 50 | : address( ANY_ADDRESS ), port( port_ ) {} 51 | IpEndpointName( unsigned long ipAddress_, int port_ ) 52 | : address( ipAddress_ ), port( port_ ) {} 53 | IpEndpointName( const char *addressName, int port_=ANY_PORT ) 54 | : address( GetHostByName( addressName ) ) 55 | , port( port_ ) {} 56 | IpEndpointName( int addressA, int addressB, int addressC, int addressD, int port_=ANY_PORT ) 57 | : address( ( (addressA << 24) | (addressB << 16) | (addressC << 8) | addressD ) ) 58 | , port( port_ ) {} 59 | 60 | // address and port are maintained in host byte order here 61 | unsigned long address; 62 | int port; 63 | 64 | bool IsMulticastAddress() const { return ((address >> 24) & 0xFF) >= 224 && ((address >> 24) & 0xFF) <= 239; } 65 | 66 | enum { ADDRESS_STRING_LENGTH=17 }; 67 | void AddressAsString( char *s ) const; 68 | 69 | enum { ADDRESS_AND_PORT_STRING_LENGTH=23}; 70 | void AddressAndPortAsString( char *s ) const; 71 | }; 72 | 73 | inline bool operator==( const IpEndpointName& lhs, const IpEndpointName& rhs ) 74 | { 75 | return (lhs.address == rhs.address && lhs.port == rhs.port ); 76 | } 77 | 78 | inline bool operator!=( const IpEndpointName& lhs, const IpEndpointName& rhs ) 79 | { 80 | return !(lhs == rhs); 81 | } 82 | 83 | #endif /* INCLUDED_OSCPACK_IPENDPOINTNAME_H */ 84 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/ip/NetworkingUtils.h: -------------------------------------------------------------------------------- 1 | /* 2 | oscpack -- Open Sound Control (OSC) packet manipulation library 3 | http://www.rossbencina.com/code/oscpack 4 | 5 | Copyright (c) 2004-2013 Ross Bencina 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 22 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 23 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | The text above constitutes the entire oscpack license; however, 29 | the oscpack developer(s) also make the following non-binding requests: 30 | 31 | Any person wishing to distribute modifications to the Software is 32 | requested to send the modifications to the original developer so that 33 | they can be incorporated into the canonical version. It is also 34 | requested that these non-binding requests be included whenever the 35 | above license is reproduced. 36 | */ 37 | #ifndef INCLUDED_OSCPACK_NETWORKINGUTILS_H 38 | #define INCLUDED_OSCPACK_NETWORKINGUTILS_H 39 | 40 | 41 | // in general NetworkInitializer is only used internally, but if you're 42 | // application creates multiple sockets from different threads at runtime you 43 | // should instantiate one of these in main just to make sure the networking 44 | // layer is initialized. 45 | class NetworkInitializer{ 46 | public: 47 | NetworkInitializer(); 48 | ~NetworkInitializer(); 49 | }; 50 | 51 | 52 | // return ip address of host name in host byte order 53 | unsigned long GetHostByName( const char *name ); 54 | 55 | 56 | #endif /* INCLUDED_OSCPACK_NETWORKINGUTILS_H */ 57 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/ip/PacketListener.h: -------------------------------------------------------------------------------- 1 | /* 2 | oscpack -- Open Sound Control (OSC) packet manipulation library 3 | http://www.rossbencina.com/code/oscpack 4 | 5 | Copyright (c) 2004-2013 Ross Bencina 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 22 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 23 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | The text above constitutes the entire oscpack license; however, 29 | the oscpack developer(s) also make the following non-binding requests: 30 | 31 | Any person wishing to distribute modifications to the Software is 32 | requested to send the modifications to the original developer so that 33 | they can be incorporated into the canonical version. It is also 34 | requested that these non-binding requests be included whenever the 35 | above license is reproduced. 36 | */ 37 | #ifndef INCLUDED_OSCPACK_PACKETLISTENER_H 38 | #define INCLUDED_OSCPACK_PACKETLISTENER_H 39 | 40 | 41 | class IpEndpointName; 42 | 43 | class PacketListener{ 44 | public: 45 | virtual ~PacketListener() {} 46 | virtual void ProcessPacket( const char *data, int size, 47 | const IpEndpointName& remoteEndpoint ) = 0; 48 | }; 49 | 50 | #endif /* INCLUDED_OSCPACK_PACKETLISTENER_H */ 51 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/ip/TimerListener.h: -------------------------------------------------------------------------------- 1 | /* 2 | oscpack -- Open Sound Control (OSC) packet manipulation library 3 | http://www.rossbencina.com/code/oscpack 4 | 5 | Copyright (c) 2004-2013 Ross Bencina 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 22 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 23 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | The text above constitutes the entire oscpack license; however, 29 | the oscpack developer(s) also make the following non-binding requests: 30 | 31 | Any person wishing to distribute modifications to the Software is 32 | requested to send the modifications to the original developer so that 33 | they can be incorporated into the canonical version. It is also 34 | requested that these non-binding requests be included whenever the 35 | above license is reproduced. 36 | */ 37 | #ifndef INCLUDED_OSCPACK_TIMERLISTENER_H 38 | #define INCLUDED_OSCPACK_TIMERLISTENER_H 39 | 40 | 41 | class TimerListener{ 42 | public: 43 | virtual ~TimerListener() {} 44 | virtual void TimerExpired() = 0; 45 | }; 46 | 47 | #endif /* INCLUDED_OSCPACK_TIMERLISTENER_H */ 48 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/ip/posix/NetworkingUtils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | oscpack -- Open Sound Control (OSC) packet manipulation library 3 | http://www.rossbencina.com/code/oscpack 4 | 5 | Copyright (c) 2004-2013 Ross Bencina 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 22 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 23 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | The text above constitutes the entire oscpack license; however, 29 | the oscpack developer(s) also make the following non-binding requests: 30 | 31 | Any person wishing to distribute modifications to the Software is 32 | requested to send the modifications to the original developer so that 33 | they can be incorporated into the canonical version. It is also 34 | requested that these non-binding requests be included whenever the 35 | above license is reproduced. 36 | */ 37 | #include "ip/NetworkingUtils.h" 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | 46 | 47 | NetworkInitializer::NetworkInitializer() {} 48 | 49 | NetworkInitializer::~NetworkInitializer() {} 50 | 51 | 52 | unsigned long GetHostByName( const char *name ) 53 | { 54 | unsigned long result = 0; 55 | 56 | struct hostent *h = gethostbyname( name ); 57 | if( h ){ 58 | struct in_addr a; 59 | std::memcpy( &a, h->h_addr_list[0], h->h_length ); 60 | result = ntohl(a.s_addr); 61 | } 62 | 63 | return result; 64 | } 65 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/ip/win32/NetworkingUtils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | oscpack -- Open Sound Control (OSC) packet manipulation library 3 | http://www.rossbencina.com/code/oscpack 4 | 5 | Copyright (c) 2004-2013 Ross Bencina 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 22 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 23 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | The text above constitutes the entire oscpack license; however, 29 | the oscpack developer(s) also make the following non-binding requests: 30 | 31 | Any person wishing to distribute modifications to the Software is 32 | requested to send the modifications to the original developer so that 33 | they can be incorporated into the canonical version. It is also 34 | requested that these non-binding requests be included whenever the 35 | above license is reproduced. 36 | */ 37 | #include "ip/NetworkingUtils.h" 38 | 39 | #include // this must come first to prevent errors with MSVC7 40 | #include 41 | 42 | #include 43 | 44 | 45 | static LONG initCount_ = 0; 46 | static bool winsockInitialized_ = false; 47 | 48 | NetworkInitializer::NetworkInitializer() 49 | { 50 | if( InterlockedIncrement( &initCount_ ) == 1 ){ 51 | // there is a race condition here if one thread tries to access 52 | // the library while another is still initializing it. 53 | // i can't think of an easy way to fix it so i'm telling you here 54 | // incase you need to init the library from two threads at once. 55 | // this is why the header file advises to instantiate one of these 56 | // in main() so that the initialization happens globally 57 | 58 | // initialize winsock 59 | WSAData wsaData; 60 | int nCode = WSAStartup(MAKEWORD(1, 1), &wsaData); 61 | if( nCode != 0 ){ 62 | //std::cout << "WSAStartup() failed with error code " << nCode << "\n"; 63 | }else{ 64 | winsockInitialized_ = true; 65 | } 66 | } 67 | } 68 | 69 | 70 | NetworkInitializer::~NetworkInitializer() 71 | { 72 | if( InterlockedDecrement( &initCount_ ) == 0 ){ 73 | if( winsockInitialized_ ){ 74 | WSACleanup(); 75 | winsockInitialized_ = false; 76 | } 77 | } 78 | } 79 | 80 | 81 | unsigned long GetHostByName( const char *name ) 82 | { 83 | NetworkInitializer networkInitializer; 84 | 85 | unsigned long result = 0; 86 | 87 | struct hostent *h = gethostbyname( name ); 88 | if( h ){ 89 | struct in_addr a; 90 | std::memcpy( &a, h->h_addr_list[0], h->h_length ); 91 | result = ntohl(a.s_addr); 92 | } 93 | 94 | return result; 95 | } 96 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/make.MinGW32.bat: -------------------------------------------------------------------------------- 1 | del bin\OscUnitTests.exe 2 | del bin\OscDump.exe 3 | del bin\OscSendTests.exe 4 | del bin\OscReceiveTest.exe 5 | mkdir bin 6 | 7 | g++ tests\OscUnitTests.cpp osc\OscTypes.cpp osc\OscReceivedElements.cpp osc\OscPrintReceivedElements.cpp osc\OscOutboundPacketStream.cpp -Wall -Wextra -I. -lws2_32 -o bin\OscUnitTests.exe 8 | 9 | g++ examples\OscDump.cpp osc\OscTypes.cpp osc\OscReceivedElements.cpp osc\OscPrintReceivedElements.cpp ip\win32\NetworkingUtils.cpp ip\win32\UdpSocket.cpp -Wall -Wextra -I. -lws2_32 -lwinmm -o bin\OscDump.exe 10 | 11 | g++ examples\SimpleSend.cpp osc\OscTypes.cpp osc\OscOutboundPacketStream.cpp ip\win32\NetworkingUtils.cpp ip\win32\UdpSocket.cpp ip\IpEndpointName.cpp -Wall -Wextra -I. -lws2_32 -lwinmm -o bin\SimpleSend.exe 12 | 13 | g++ examples\SimpleReceive.cpp osc\OscTypes.cpp osc\OscReceivedElements.cpp ip\win32\NetworkingUtils.cpp ip\win32\UdpSocket.cpp -Wall -Wextra -I. -lws2_32 -lwinmm -o bin\SimpleReceive.exe 14 | 15 | g++ tests\OscSendTests.cpp osc\OscTypes.cpp osc\OscOutboundPacketStream.cpp ip\win32\NetworkingUtils.cpp ip\win32\UdpSocket.cpp ip\IpEndpointName.cpp -Wall -Wextra -I. -lws2_32 -lwinmm -o bin\OscSendTests.exe 16 | 17 | g++ tests\OscReceiveTest.cpp osc\OscTypes.cpp osc\OscReceivedElements.cpp ip\win32\NetworkingUtils.cpp ip\win32\UdpSocket.cpp -Wall -Wextra -I. -lws2_32 -lwinmm -o bin\OscReceiveTest.exe 18 | 19 | .\bin\OscUnitTests.exe -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/osc/MessageMappingOscPacketListener.h: -------------------------------------------------------------------------------- 1 | /* 2 | oscpack -- Open Sound Control (OSC) packet manipulation library 3 | http://www.rossbencina.com/code/oscpack 4 | 5 | Copyright (c) 2004-2013 Ross Bencina 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 22 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 23 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | The text above constitutes the entire oscpack license; however, 29 | the oscpack developer(s) also make the following non-binding requests: 30 | 31 | Any person wishing to distribute modifications to the Software is 32 | requested to send the modifications to the original developer so that 33 | they can be incorporated into the canonical version. It is also 34 | requested that these non-binding requests be included whenever the 35 | above license is reproduced. 36 | */ 37 | #ifndef INCLUDED_OSCPACK_MESSAGEMAPPINGOSCPACKETLISTENER_H 38 | #define INCLUDED_OSCPACK_MESSAGEMAPPINGOSCPACKETLISTENER_H 39 | 40 | #include 41 | #include 42 | 43 | #include "OscPacketListener.h" 44 | 45 | 46 | 47 | namespace osc{ 48 | 49 | template< class T > 50 | class MessageMappingOscPacketListener : public OscPacketListener{ 51 | public: 52 | typedef void (T::*function_type)(const osc::ReceivedMessage&, const IpEndpointName&); 53 | 54 | protected: 55 | void RegisterMessageFunction( const char *addressPattern, function_type f ) 56 | { 57 | functions_.insert( std::make_pair( addressPattern, f ) ); 58 | } 59 | 60 | virtual void ProcessMessage( const osc::ReceivedMessage& m, 61 | const IpEndpointName& remoteEndpoint ) 62 | { 63 | typename function_map_type::iterator i = functions_.find( m.AddressPattern() ); 64 | if( i != functions_.end() ) 65 | (dynamic_cast(this)->*(i->second))( m, remoteEndpoint ); 66 | } 67 | 68 | private: 69 | struct cstr_compare{ 70 | bool operator()( const char *lhs, const char *rhs ) const 71 | { return std::strcmp( lhs, rhs ) < 0; } 72 | }; 73 | 74 | typedef std::map function_map_type; 75 | function_map_type functions_; 76 | }; 77 | 78 | } // namespace osc 79 | 80 | #endif /* INCLUDED_OSCPACK_MESSAGEMAPPINGOSCPACKETLISTENER_H */ -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/osc/OscException.h: -------------------------------------------------------------------------------- 1 | /* 2 | oscpack -- Open Sound Control (OSC) packet manipulation library 3 | http://www.rossbencina.com/code/oscpack 4 | 5 | Copyright (c) 2004-2013 Ross Bencina 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 22 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 23 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | The text above constitutes the entire oscpack license; however, 29 | the oscpack developer(s) also make the following non-binding requests: 30 | 31 | Any person wishing to distribute modifications to the Software is 32 | requested to send the modifications to the original developer so that 33 | they can be incorporated into the canonical version. It is also 34 | requested that these non-binding requests be included whenever the 35 | above license is reproduced. 36 | */ 37 | #ifndef INCLUDED_OSCPACK_OSCEXCEPTION_H 38 | #define INCLUDED_OSCPACK_OSCEXCEPTION_H 39 | 40 | #include 41 | 42 | namespace osc{ 43 | 44 | class Exception : public std::exception { 45 | const char *what_; 46 | 47 | public: 48 | Exception() throw() {} 49 | Exception( const Exception& src ) throw() 50 | : std::exception( src ) 51 | , what_( src.what_ ) {} 52 | Exception( const char *w ) throw() 53 | : what_( w ) {} 54 | Exception& operator=( const Exception& src ) throw() 55 | { what_ = src.what_; return *this; } 56 | virtual ~Exception() throw() {} 57 | virtual const char* what() const throw() { return what_; } 58 | }; 59 | 60 | } // namespace osc 61 | 62 | #endif /* INCLUDED_OSCPACK_OSCEXCEPTION_H */ 63 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/osc/OscHostEndianness.h: -------------------------------------------------------------------------------- 1 | /* 2 | oscpack -- Open Sound Control (OSC) packet manipulation library 3 | http://www.rossbencina.com/code/oscpack 4 | 5 | Copyright (c) 2004-2013 Ross Bencina 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 22 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 23 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | The text above constitutes the entire oscpack license; however, 29 | the oscpack developer(s) also make the following non-binding requests: 30 | 31 | Any person wishing to distribute modifications to the Software is 32 | requested to send the modifications to the original developer so that 33 | they can be incorporated into the canonical version. It is also 34 | requested that these non-binding requests be included whenever the 35 | above license is reproduced. 36 | */ 37 | #ifndef INCLUDED_OSCPACK_OSCHOSTENDIANNESS_H 38 | #define INCLUDED_OSCPACK_OSCHOSTENDIANNESS_H 39 | 40 | /* 41 | Make sure either OSC_HOST_LITTLE_ENDIAN or OSC_HOST_BIG_ENDIAN is defined 42 | 43 | We try to use preprocessor symbols to deduce the host endianness. 44 | 45 | Alternatively you can define one of the above symbols from the command line. 46 | Usually you do this with the -D flag to the compiler. e.g.: 47 | 48 | $ g++ -DOSC_HOST_LITTLE_ENDIAN ... 49 | */ 50 | 51 | #if defined(OSC_HOST_LITTLE_ENDIAN) || defined(OSC_HOST_BIG_ENDIAN) 52 | 53 | // endianness defined on the command line. nothing to do here. 54 | 55 | #elif defined(__WIN32__) || defined(WIN32) || defined(WINCE) 56 | 57 | // assume that __WIN32__ is only defined on little endian systems 58 | 59 | #define OSC_HOST_LITTLE_ENDIAN 1 60 | #undef OSC_HOST_BIG_ENDIAN 61 | 62 | #elif defined(__APPLE__) 63 | 64 | #if defined(__LITTLE_ENDIAN__) 65 | 66 | #define OSC_HOST_LITTLE_ENDIAN 1 67 | #undef OSC_HOST_BIG_ENDIAN 68 | 69 | #elif defined(__BIG_ENDIAN__) 70 | 71 | #define OSC_HOST_BIG_ENDIAN 1 72 | #undef OSC_HOST_LITTLE_ENDIAN 73 | 74 | #endif 75 | 76 | #elif defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) 77 | 78 | // should cover gcc and clang 79 | 80 | #if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) 81 | 82 | #define OSC_HOST_LITTLE_ENDIAN 1 83 | #undef OSC_HOST_BIG_ENDIAN 84 | 85 | #elif (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) 86 | 87 | #define OSC_HOST_BIG_ENDIAN 1 88 | #undef OSC_HOST_LITTLE_ENDIAN 89 | 90 | #endif 91 | 92 | #else 93 | 94 | // gcc defines __LITTLE_ENDIAN__ and __BIG_ENDIAN__ 95 | // for others used here see http://sourceforge.net/p/predef/wiki/Endianness/ 96 | #if (defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) \ 97 | || (defined(__ARMEL__) && !defined(__ARMEB__)) \ 98 | || (defined(__AARCH64EL__) && !defined(__AARCH64EB__)) \ 99 | || (defined(_MIPSEL) && !defined(_MIPSEB)) \ 100 | || (defined(__MIPSEL) && !defined(__MIPSEB)) \ 101 | || (defined(__MIPSEL__) && !defined(__MIPSEB__)) 102 | 103 | #define OSC_HOST_LITTLE_ENDIAN 1 104 | #undef OSC_HOST_BIG_ENDIAN 105 | 106 | #elif (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)) \ 107 | || (defined(__ARMEB__) && !defined(__ARMEL__)) \ 108 | || (defined(__AARCH64EB__) && !defined(__AARCH64EL__)) \ 109 | || (defined(_MIPSEB) && !defined(_MIPSEL)) \ 110 | || (defined(__MIPSEB) && !defined(__MIPSEL)) \ 111 | || (defined(__MIPSEB__) && !defined(__MIPSEL__)) 112 | 113 | #define OSC_HOST_BIG_ENDIAN 1 114 | #undef OSC_HOST_LITTLE_ENDIAN 115 | 116 | #endif 117 | 118 | #endif 119 | 120 | #if !defined(OSC_HOST_LITTLE_ENDIAN) && !defined(OSC_HOST_BIG_ENDIAN) 121 | 122 | #error please edit OSCHostEndianness.h or define one of {OSC_HOST_LITTLE_ENDIAN, OSC_HOST_BIG_ENDIAN} to configure endianness 123 | 124 | #endif 125 | 126 | #endif /* INCLUDED_OSCPACK_OSCHOSTENDIANNESS_H */ 127 | 128 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/osc/OscPacketListener.h: -------------------------------------------------------------------------------- 1 | /* 2 | oscpack -- Open Sound Control (OSC) packet manipulation library 3 | http://www.rossbencina.com/code/oscpack 4 | 5 | Copyright (c) 2004-2013 Ross Bencina 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 22 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 23 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | The text above constitutes the entire oscpack license; however, 29 | the oscpack developer(s) also make the following non-binding requests: 30 | 31 | Any person wishing to distribute modifications to the Software is 32 | requested to send the modifications to the original developer so that 33 | they can be incorporated into the canonical version. It is also 34 | requested that these non-binding requests be included whenever the 35 | above license is reproduced. 36 | */ 37 | #ifndef INCLUDED_OSCPACK_OSCPACKETLISTENER_H 38 | #define INCLUDED_OSCPACK_OSCPACKETLISTENER_H 39 | 40 | #include "OscReceivedElements.h" 41 | #include "../ip/PacketListener.h" 42 | 43 | 44 | namespace osc{ 45 | 46 | class OscPacketListener : public PacketListener{ 47 | protected: 48 | virtual void ProcessBundle( const osc::ReceivedBundle& b, 49 | const IpEndpointName& remoteEndpoint ) 50 | { 51 | // ignore bundle time tag for now 52 | 53 | for( ReceivedBundle::const_iterator i = b.ElementsBegin(); 54 | i != b.ElementsEnd(); ++i ){ 55 | if( i->IsBundle() ) 56 | ProcessBundle( ReceivedBundle(*i), remoteEndpoint ); 57 | else 58 | ProcessMessage( ReceivedMessage(*i), remoteEndpoint ); 59 | } 60 | } 61 | 62 | virtual void ProcessMessage( const osc::ReceivedMessage& m, 63 | const IpEndpointName& remoteEndpoint ) = 0; 64 | 65 | public: 66 | virtual void ProcessPacket( const char *data, int size, 67 | const IpEndpointName& remoteEndpoint ) 68 | { 69 | osc::ReceivedPacket p( data, size ); 70 | if( p.IsBundle() ) 71 | ProcessBundle( ReceivedBundle(p), remoteEndpoint ); 72 | else 73 | ProcessMessage( ReceivedMessage(p), remoteEndpoint ); 74 | } 75 | }; 76 | 77 | } // namespace osc 78 | 79 | #endif /* INCLUDED_OSCPACK_OSCPACKETLISTENER_H */ 80 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/osc/OscPrintReceivedElements.h: -------------------------------------------------------------------------------- 1 | /* 2 | oscpack -- Open Sound Control (OSC) packet manipulation library 3 | http://www.rossbencina.com/code/oscpack 4 | 5 | Copyright (c) 2004-2013 Ross Bencina 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 22 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 23 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | The text above constitutes the entire oscpack license; however, 29 | the oscpack developer(s) also make the following non-binding requests: 30 | 31 | Any person wishing to distribute modifications to the Software is 32 | requested to send the modifications to the original developer so that 33 | they can be incorporated into the canonical version. It is also 34 | requested that these non-binding requests be included whenever the 35 | above license is reproduced. 36 | */ 37 | #ifndef INCLUDED_OSCPACK_OSCPRINTRECEIVEDELEMENTS_H 38 | #define INCLUDED_OSCPACK_OSCPRINTRECEIVEDELEMENTS_H 39 | 40 | #include 41 | 42 | #include "OscReceivedElements.h" 43 | 44 | 45 | namespace osc{ 46 | 47 | std::ostream& operator<<( std::ostream & os, const ReceivedPacket& p ); 48 | std::ostream& operator<<( std::ostream & os, const ReceivedMessageArgument& arg ); 49 | std::ostream& operator<<( std::ostream & os, const ReceivedMessage& m ); 50 | std::ostream& operator<<( std::ostream & os, const ReceivedBundle& b ); 51 | 52 | } // namespace osc 53 | 54 | #endif /* INCLUDED_OSCPACK_OSCPRINTRECEIVEDELEMENTS_H */ 55 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/osc/OscTypes.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | oscpack -- Open Sound Control (OSC) packet manipulation library 3 | http://www.rossbencina.com/code/oscpack 4 | 5 | Copyright (c) 2004-2013 Ross Bencina 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 22 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 23 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | The text above constitutes the entire oscpack license; however, 29 | the oscpack developer(s) also make the following non-binding requests: 30 | 31 | Any person wishing to distribute modifications to the Software is 32 | requested to send the modifications to the original developer so that 33 | they can be incorporated into the canonical version. It is also 34 | requested that these non-binding requests be included whenever the 35 | above license is reproduced. 36 | */ 37 | #include "OscTypes.h" 38 | 39 | namespace osc{ 40 | 41 | BundleInitiator BeginBundleImmediate(1); 42 | BundleTerminator EndBundle; 43 | MessageTerminator EndMessage; 44 | NilType OscNil; 45 | #ifndef _OBJC_OBJC_H_ 46 | NilType Nil; // Objective-C defines Nil. so our Nil is deprecated. use OscNil instead 47 | #endif 48 | InfinitumType Infinitum; 49 | ArrayInitiator BeginArray; 50 | ArrayTerminator EndArray; 51 | 52 | } // namespace osc 53 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/tests/OscReceiveTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | oscpack -- Open Sound Control packet manipulation library 3 | http://www.audiomulch.com/~rossb/oscpack 4 | 5 | Copyright (c) 2004-2005 Ross Bencina 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | Any person wishing to distribute modifications to the Software is 19 | requested to send the modifications to the original developer so that 20 | they can be incorporated into the canonical version. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 23 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 24 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 25 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 26 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 27 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 28 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 29 | */ 30 | 31 | #ifndef INCLUDED_OSCRECEIVETEST_H 32 | #define INCLUDED_OSCRECEIVETEST_H 33 | 34 | namespace osc{ 35 | 36 | void RunReceiveTest( int port ); 37 | 38 | } // namespace osc 39 | 40 | #endif /* INCLUDED_OSCSENDTESTS_H */ 41 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/tests/OscSendTests.h: -------------------------------------------------------------------------------- 1 | /* 2 | oscpack -- Open Sound Control packet manipulation library 3 | http://www.audiomulch.com/~rossb/oscpack 4 | 5 | Copyright (c) 2004-2005 Ross Bencina 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | Any person wishing to distribute modifications to the Software is 19 | requested to send the modifications to the original developer so that 20 | they can be incorporated into the canonical version. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 23 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 24 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 25 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 26 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 27 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 28 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 29 | */ 30 | #ifndef INCLUDED_OSCSENDTESTS_H 31 | #define INCLUDED_OSCSENDTESTS_H 32 | 33 | namespace osc{ 34 | 35 | void RunSendTests( unsigned long address, int port ); 36 | 37 | } // namespace osc 38 | 39 | #endif /* INCLUDED_OSCSENDTESTS_H */ 40 | -------------------------------------------------------------------------------- /app/QOSC/libs/oscpack/tests/OscUnitTests.h: -------------------------------------------------------------------------------- 1 | /* 2 | oscpack -- Open Sound Control packet manipulation library 3 | http://www.audiomulch.com/~rossb/oscpack 4 | 5 | Copyright (c) 2004-2005 Ross Bencina 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | Any person wishing to distribute modifications to the Software is 19 | requested to send the modifications to the original developer so that 20 | they can be incorporated into the canonical version. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 23 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 24 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 25 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 26 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 27 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 28 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 29 | */ 30 | #ifndef INCLUDED_OSCUNITTESTS_H 31 | #define INCLUDED_OSCUNITTESTS_H 32 | 33 | namespace osc{ 34 | 35 | void RunUnitTests(); 36 | 37 | } // namespace osc 38 | 39 | #endif /* INCLUDED_OSCUNITTESTS_H */ 40 | -------------------------------------------------------------------------------- /app/QOSC/scripts/ci/common/script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | 4 | for dir in examples/example*/ 5 | do 6 | ( 7 | dir=${dir%*/} && 8 | cd examples/${dir##*/} && 9 | mkdir -p build && 10 | cd build && 11 | qmake ../*.pro && 12 | make 13 | 14 | ) 15 | done 16 | -------------------------------------------------------------------------------- /app/QOSC/scripts/ci/linux/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | 4 | sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa 5 | sudo apt-get update -qq 6 | 7 | sudo apt-get install qt5-default 8 | sudo apt-get install qt5-qmake 9 | sudo apt-get install qtbase5-dev-tools 10 | -------------------------------------------------------------------------------- /app/QOSC/scripts/ci/osx/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | 4 | brew install qt5 5 | brew link --force qt5 6 | -------------------------------------------------------------------------------- /app/QOSC/src/qoscargument.h: -------------------------------------------------------------------------------- 1 | #ifndef QOSCARGUMENT_H 2 | #define QOSCARGUMENT_H 3 | #include 4 | typedef enum 5 | { 6 | QOSCARGUMENT_INT, 7 | QOSCARGUMENT_FLOAT, 8 | QOSCARGUMENT_STRING, 9 | QOSCARGUMENT_BLOB, 10 | QOSCARGUMENT_BOOL, 11 | QOSCARGUMENT_NULL, 12 | QOSCARGUMENT_IMPULSE, 13 | QOSCARGUMENT_TIME 14 | } QOSCArgumentType; 15 | 16 | class QOSCArgument 17 | { 18 | public: 19 | QOSCArgument(QOSCArgumentType type = QOSCARGUMENT_NULL): 20 | _type(type) 21 | { 22 | } 23 | QOSCArgumentType getType() 24 | { 25 | return _type; 26 | } 27 | 28 | //protected: 29 | QOSCArgumentType _type; 30 | }; 31 | 32 | class QOSCArgument_int : public QOSCArgument 33 | { 34 | public: 35 | QOSCArgument_int(int value = 0) : 36 | QOSCArgument(QOSCARGUMENT_INT), 37 | _value(value) 38 | { 39 | } 40 | //private: 41 | int _value; 42 | }; 43 | class QOSCArgument_float : public QOSCArgument 44 | { 45 | public: 46 | QOSCArgument_float(float value = 0) : 47 | QOSCArgument(QOSCARGUMENT_FLOAT), 48 | _value(value) 49 | { 50 | } 51 | //private: 52 | float _value; 53 | }; 54 | class QOSCArgument_string : public QOSCArgument 55 | { 56 | public: 57 | QOSCArgument_string(QString value = "") : 58 | QOSCArgument(QOSCARGUMENT_STRING), 59 | _value(value) 60 | { 61 | } 62 | //private: 63 | QString _value; 64 | }; 65 | class QOSCArgument_blob : public QOSCArgument 66 | { 67 | public: 68 | QOSCArgument_blob(QByteArray value) : 69 | QOSCArgument(QOSCARGUMENT_BLOB), 70 | _value(value) 71 | { 72 | } 73 | //private: 74 | QByteArray _value; 75 | }; 76 | class QOSCArgument_bool : public QOSCArgument 77 | { 78 | public: 79 | QOSCArgument_bool(bool value = false) : 80 | QOSCArgument(QOSCARGUMENT_BOOL), 81 | _value(value) 82 | { 83 | } 84 | //private: 85 | bool _value; 86 | }; 87 | class QOSCArgument_impulse : public QOSCArgument 88 | { 89 | public: 90 | QOSCArgument_impulse() : 91 | QOSCArgument(QOSCARGUMENT_IMPULSE) 92 | { 93 | } 94 | }; 95 | class QOSCArgument_null : public QOSCArgument 96 | { 97 | public: 98 | QOSCArgument_null() : 99 | QOSCArgument(QOSCARGUMENT_NULL) 100 | { 101 | } 102 | }; 103 | class QOSCArgument_time : public QOSCArgument 104 | { 105 | public: 106 | QOSCArgument_time(int value) : 107 | QOSCArgument(QOSCARGUMENT_TIME), 108 | _value(value) 109 | { 110 | } 111 | //private: 112 | int _value; 113 | }; 114 | 115 | 116 | #endif // QOSCARGUMENT_H 117 | -------------------------------------------------------------------------------- /app/QOSC/src/qoscbundle.cpp: -------------------------------------------------------------------------------- 1 | #include "qoscbundle.h" 2 | 3 | QOSCBundle::QOSCBundle() 4 | { 5 | } 6 | void QOSCBundle::addMessage(QOSCMessage *message) 7 | { 8 | _messages << message; 9 | } 10 | 11 | QVector QOSCBundle::getMessages() 12 | { 13 | return _messages; 14 | } 15 | -------------------------------------------------------------------------------- /app/QOSC/src/qoscbundle.h: -------------------------------------------------------------------------------- 1 | #ifndef QOSCBUNDLE_H 2 | #define QOSCBUNDLE_H 3 | #include 4 | #include "qoscmessage.h" 5 | 6 | class QOSCBundle 7 | { 8 | public: 9 | QOSCBundle(); 10 | void addMessage(QOSCMessage *message); 11 | QVector getMessages(); 12 | private: 13 | QVector _messages; 14 | }; 15 | 16 | #endif // QOSCBUNDLE_H 17 | -------------------------------------------------------------------------------- /app/QOSC/src/qoscmessage.h: -------------------------------------------------------------------------------- 1 | #ifndef QOSCMESSAGE_H 2 | #define QOSCMESSAGE_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "osc/OscOutboundPacketStream.h" 9 | #include "qoscargument.h" 10 | 11 | class QOSCMessage : public QObject 12 | { 13 | Q_OBJECT 14 | public: 15 | explicit QOSCMessage(QString address, QObject *parent = nullptr); 16 | virtual ~QOSCMessage(); 17 | 18 | QOSCMessage* add(int value); 19 | QOSCMessage* addInt(int value); 20 | QOSCMessage* add(QString value); 21 | QOSCMessage* addString(QString value); 22 | QOSCMessage* add(bool value); 23 | QOSCMessage* addBool(bool value); 24 | QOSCMessage* addT(); 25 | QOSCMessage* addF(); 26 | QOSCMessage* add(float value); 27 | QOSCMessage* addFloat(float value); 28 | QOSCMessage* add(QByteArray value); 29 | QOSCMessage* addBlob(QByteArray value); 30 | QOSCMessage* addImpulse(); 31 | QOSCMessage* addNull(); 32 | QOSCMessage* addTime(int value); 33 | 34 | osc::OutboundPacketStream* getPacket(); 35 | QVector getArguments(); 36 | int getSize(); 37 | QString getAddress(); 38 | 39 | bool isIntArgument(int index); 40 | bool isStringArgument(int index); 41 | bool isBoolArgument(int index); 42 | bool isFloatArgument(int index); 43 | bool isBlobArgument(int index); 44 | bool isImpulseArgument(int index); 45 | bool isNullArgument(int index); 46 | bool isTimeArgument(int index); 47 | 48 | int getArgumentAsInt(int index); 49 | QString getArgumentAsString(int index); 50 | bool getArgumentAsBool(int index); 51 | float getArgumentAsFloat(int index); 52 | QByteArray getArgumentAsBlob(int index); 53 | int getArgumentAsTime(int index); 54 | 55 | 56 | private: 57 | QString _address; 58 | QVector _arguments; 59 | 60 | char _buffer[1024]; 61 | osc::OutboundPacketStream _packet;//(_buffer, 1024); 62 | }; 63 | #endif // QOSCMESSAGE_H 64 | -------------------------------------------------------------------------------- /app/QOSC/src/qoscreceiver.cpp: -------------------------------------------------------------------------------- 1 | #include "qoscreceiver.h" 2 | #include 3 | 4 | QOSCReceiver::QOSCReceiver(unsigned int localPortUI, QObject *parent): 5 | QThread(parent), 6 | _localPortUI(localPortUI), 7 | _socket( new UdpListeningReceiveSocket(IpEndpointName( IpEndpointName::ANY_ADDRESS, localPortUI ), this)) 8 | { 9 | } 10 | void QOSCReceiver::stop() 11 | { 12 | // _socket->AsynchronousBreak(); 13 | } 14 | 15 | void QOSCReceiver::run() 16 | { 17 | qDebug()<<"started thread"; 18 | _socket->Run(); 19 | qDebug()<<"ended thread"; 20 | 21 | } 22 | 23 | void QOSCReceiver::ProcessMessage(const ReceivedMessage &m, const IpEndpointName &remoteEndpoint) 24 | { 25 | //qDebug()<<"new oscmessage"; 26 | QOSCMessage *msg = new QOSCMessage(QString::fromStdString(m.AddressPattern())); 27 | for(osc::ReceivedMessage::const_iterator arg = m.ArgumentsBegin(); arg != m.ArgumentsEnd(); ++arg) 28 | { 29 | if(arg->IsInt32()){ 30 | msg->addInt(arg->AsInt32()); 31 | } 32 | else if(arg->IsString()) 33 | { 34 | msg->addString(arg->AsString()); 35 | } 36 | else if(arg->IsBool()) 37 | { 38 | msg->addBool(arg->AsBool()); 39 | } 40 | else if(arg->IsFloat()) 41 | { 42 | msg->addFloat(arg->AsFloat()); 43 | } 44 | else if(arg->IsBlob()) 45 | { 46 | //TODO: 47 | } 48 | 49 | } 50 | emit messageReceived(msg); 51 | } 52 | -------------------------------------------------------------------------------- /app/QOSC/src/qoscreceiver.h: -------------------------------------------------------------------------------- 1 | #ifndef QOSCRECEIVERER_H 2 | #define QOSCRECEIVERER_H 3 | #include "osc/OscOutboundPacketStream.h" 4 | #include "osc/OscPacketListener.h" 5 | #include "ip/UdpSocket.h" 6 | 7 | #include 8 | #include 9 | #include 10 | #include "qoscmessage.h" 11 | #include "qoscbundle.h" 12 | 13 | using namespace osc; 14 | class QOSCReceiver : 15 | public QThread, 16 | public osc::OscPacketListener 17 | { 18 | Q_OBJECT 19 | public: 20 | explicit QOSCReceiver(unsigned int localPortUI, QObject *parent = nullptr); 21 | void stop(); 22 | 23 | protected: 24 | void run(); 25 | private: 26 | virtual void ProcessMessage( const osc::ReceivedMessage &m, const IpEndpointName& remoteEndpoint ); 27 | 28 | private: 29 | UdpListeningReceiveSocket *_socket; 30 | unsigned int _localPortUI; 31 | signals: 32 | void messageReceived(QOSCMessage *msg); 33 | }; 34 | 35 | #endif // QOSCRECEIVER_H 36 | -------------------------------------------------------------------------------- /app/QOSC/src/qoscsender.cpp: -------------------------------------------------------------------------------- 1 | #include "qoscsender.h" 2 | 3 | #include 4 | QOSCSender::QOSCSender(QObject *parent) : QObject(parent){ 5 | 6 | } 7 | QOSCSender::QOSCSender(QString remoteHost, int remotePort, QObject *parent) : 8 | QObject(parent), 9 | _remoteHost(remoteHost), 10 | _remotePort(remotePort) 11 | { 12 | setup(); 13 | } 14 | void QOSCSender::setup(QString remoteHost, int remotePort) 15 | { 16 | _remoteHost = remoteHost; 17 | _remotePort = remotePort; 18 | setup(); 19 | } 20 | void QOSCSender::setup() 21 | { 22 | _socket = new UdpTransmitSocket(IpEndpointName(_remoteHost.toStdString().c_str(), _remotePort)); 23 | } 24 | 25 | void QOSCSender::send(QOSCMessage *message, bool bundled) 26 | { 27 | char buffer[1024]; 28 | osc::OutboundPacketStream packet(buffer, 1024); 29 | if(bundled){ 30 | packet << osc::BeginBundleImmediate << osc::BeginMessage(message->getAddress().toStdString().c_str()); 31 | }else{ 32 | packet << osc::BeginMessage(message->getAddress().toStdString().c_str()); 33 | } 34 | foreach(QOSCArgument *argument, message->getArguments()) 35 | { 36 | 37 | if(argument->_type == QOSCARGUMENT_INT) 38 | { 39 | packet << static_cast(argument)->_value; 40 | } 41 | else if(argument->_type == QOSCARGUMENT_FLOAT) 42 | { 43 | packet << (float) static_cast(argument)->_value; 44 | } 45 | else if(argument->_type == QOSCARGUMENT_STRING) 46 | { 47 | packet << static_cast(argument)->_value.toStdString().c_str(); 48 | } 49 | else if(argument->_type == QOSCARGUMENT_BLOB) 50 | { 51 | osc::Blob b(static_cast(argument)->_value, (unsigned long) static_cast(argument)->_value.size()); 52 | packet << b; 53 | } 54 | else if(argument->_type == QOSCARGUMENT_BOOL) 55 | { 56 | packet << static_cast(argument)->_value; 57 | } 58 | else if(argument->_type == QOSCARGUMENT_IMPULSE) 59 | { 60 | osc::InfinitumType value; 61 | packet << value; 62 | } 63 | else if(argument->_type == QOSCARGUMENT_NULL) 64 | { 65 | osc::NilType value; 66 | packet << value; 67 | } 68 | else if(argument->_type == QOSCARGUMENT_TIME) 69 | { 70 | qDebug()<<"TODO"<<"oscSender type time"; 71 | } 72 | } 73 | 74 | if(bundled){ 75 | packet << osc::EndMessage 76 | << osc::EndBundle; 77 | }else{ 78 | packet << osc::EndMessage; 79 | } 80 | _socket->Send(packet.Data(), packet.Size()); 81 | 82 | /* 83 | _socket->Send(message.getPacket()->Data(), message.getPacket()->Size()); 84 | 85 | 86 | _packet.Clear(); 87 | _packet << osc::BeginBundleImmediate << osc::BeginMessage(_address.toStdString().c_str()); 88 | foreach(qTGOscArgument* argument, _arguments) 89 | { 90 | 91 | if(argument->_type == QTGOSCARGUMENT_INT) 92 | { 93 | _packet << static_cast(argument)->_value; 94 | } 95 | else if(argument->_type == QTGOSCARGUMENT_FLOAT) 96 | { 97 | _packet << (float) static_cast(argument)->_value; 98 | } 99 | else if(argument->_type == QTGOSCARGUMENT_BOOL) 100 | 101 | { 102 | _packet << static_cast(argument)->_value; 103 | } 104 | else if(argument->_type == QTGOSCARGUMENT_STRING) 105 | { 106 | _packet << static_cast(argument)->_value.toStdString().c_str(); 107 | } 108 | } 109 | */ 110 | } 111 | void QOSCSender::send(QOSCBundle bundle) 112 | { 113 | // _socket->Send(message.getPacket()->Data(), message.getPacket()->Size()); 114 | } 115 | 116 | void QOSCSender::setRemoteHost(QString remoteHost) 117 | { 118 | _remoteHost = remoteHost; 119 | } 120 | void QOSCSender::setRemotePort(int remotePort) 121 | { 122 | _remotePort = remotePort; 123 | } 124 | -------------------------------------------------------------------------------- /app/QOSC/src/qoscsender.h: -------------------------------------------------------------------------------- 1 | #ifndef QOSCSENDER_H 2 | #define QOSCSENDER_H 3 | 4 | #include "osc/OscOutboundPacketStream.h" 5 | #include "osc/OscTypes.h" 6 | #include "ip/UdpSocket.h" 7 | #include 8 | #include 9 | #include "qoscmessage.h" 10 | #include "qoscbundle.h" 11 | 12 | class QOSCSender : public QObject 13 | { 14 | Q_OBJECT 15 | public: 16 | explicit QOSCSender(QObject *parent = nullptr); 17 | explicit QOSCSender(QString remoteHost, int remotePort, QObject *parent = nullptr); 18 | void send(QOSCMessage *message, bool bundled = true); 19 | void send(QOSCBundle bundle); 20 | protected: 21 | private: 22 | UdpTransmitSocket *_socket; 23 | QString _remoteHost; 24 | int _remotePort; 25 | public slots: 26 | void setRemoteHost(QString remoteHost); 27 | void setRemotePort(int remotePort); 28 | void setup(QString remoteHost, int remotePort); 29 | void setup(); 30 | }; 31 | 32 | #endif // QOSCSENDER_H 33 | -------------------------------------------------------------------------------- /app/app.pro: -------------------------------------------------------------------------------- 1 | QT += qml quick widgets sql 2 | TARGET = crt-live-coding 3 | CONFIG += c++11 4 | 5 | include(QOSC/QOSC.pri) 6 | 7 | # The following define makes your compiler emit warnings if you use 8 | # any Qt feature that has been marked deprecated (the exact warnings 9 | # depend on your compiler). Refer to the documentation for the 10 | # deprecated API to know how to port your code away from it. 11 | DEFINES += QT_DEPRECATED_WARNINGS 12 | 13 | DESTDIR = $$OUT_PWD/../ 14 | 15 | HEADERS += \ 16 | fileio.h \ 17 | scoscdataprovider.h \ 18 | monospacefontmanager.h 19 | 20 | SOURCES += main.cpp \ 21 | fileio.cpp \ 22 | scoscdataprovider.cpp \ 23 | monospacefontmanager.cpp 24 | 25 | macx:ICON = icons/crt.icns 26 | 27 | RESOURCES += qml/resources.qrc 28 | 29 | ######################################### 30 | ## INTALLS 31 | ######################################### 32 | 33 | target.path += /usr/bin/ 34 | 35 | INSTALLS += target 36 | 37 | # Install icons 38 | unix { 39 | icon32.files = icons/32x32/cool-retro-term.png 40 | icon32.path = /usr/share/icons/hicolor/32x32/apps 41 | icon64.files = icons/64x64/cool-retro-term.png 42 | icon64.path = /usr/share/icons/hicolor/64x64/apps 43 | icon128.files = icons/128x128/cool-retro-term.png 44 | icon128.path = /usr/share/icons/hicolor/128x128/apps 45 | icon256.files = icons/256x256/cool-retro-term.png 46 | icon256.path = /usr/share/icons/hicolor/256x256/apps 47 | 48 | INSTALLS += icon32 icon64 icon128 icon256 49 | } 50 | -------------------------------------------------------------------------------- /app/fileio.cpp: -------------------------------------------------------------------------------- 1 | #include "fileio.h" 2 | 3 | FileIO::FileIO() 4 | { 5 | } 6 | 7 | bool FileIO::write(const QString& sourceUrl, const QString& data) { 8 | if (sourceUrl.isEmpty()) 9 | return false; 10 | 11 | QUrl url(sourceUrl); 12 | QFile file(url.toLocalFile()); 13 | if (!file.open(QFile::WriteOnly | QFile::Truncate)) 14 | return false; 15 | 16 | QTextStream out(&file); 17 | out << data; 18 | file.close(); 19 | return true; 20 | } 21 | 22 | QString FileIO::read(const QString& sourceUrl) { 23 | if (sourceUrl.isEmpty()) 24 | return ""; 25 | 26 | QUrl url(sourceUrl); 27 | QFile file(url.toLocalFile()); 28 | if (!file.open(QFile::ReadOnly)) 29 | return ""; 30 | 31 | QTextStream in(&file); 32 | QString result = in.readAll(); 33 | 34 | file.close(); 35 | 36 | return result; 37 | } 38 | -------------------------------------------------------------------------------- /app/fileio.h: -------------------------------------------------------------------------------- 1 | #ifndef FILEIO_H 2 | #define FILEIO_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class FileIO : public QObject 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | FileIO(); 15 | 16 | public slots: 17 | bool write(const QString& sourceUrl, const QString& data); 18 | QString read(const QString& sourceUrl); 19 | }; 20 | 21 | #endif // FILEIO_H 22 | -------------------------------------------------------------------------------- /app/icons/128x128/cool-retro-term.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/icons/128x128/cool-retro-term.png -------------------------------------------------------------------------------- /app/icons/256x256/cool-retro-term.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/icons/256x256/cool-retro-term.png -------------------------------------------------------------------------------- /app/icons/32x32/cool-retro-term.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/icons/32x32/cool-retro-term.png -------------------------------------------------------------------------------- /app/icons/64x64/cool-retro-term.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/icons/64x64/cool-retro-term.png -------------------------------------------------------------------------------- /app/icons/crt.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/icons/crt.icns -------------------------------------------------------------------------------- /app/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | #include 16 | #include 17 | 18 | #include "scoscdataprovider.h" 19 | 20 | QString getNamedArgument(QStringList args, QString name, QString defaultName) 21 | { 22 | int index = args.indexOf(name); 23 | return (index != -1) ? args[index + 1] : QString(defaultName); 24 | } 25 | 26 | QString getNamedArgument(QStringList args, QString name) 27 | { 28 | return getNamedArgument(args, name, ""); 29 | } 30 | 31 | int main(int argc, char *argv[]) 32 | { 33 | // Some environmental variable are necessary on certain platforms. 34 | 35 | // This disables QT appmenu under Ubuntu, which is not working with QML apps. 36 | setenv("QT_QPA_PLATFORMTHEME", "", 1); 37 | 38 | #if defined (Q_OS_LINUX) 39 | setenv("QSG_RENDER_LOOP", "threaded", 0); 40 | #endif 41 | 42 | #if defined(Q_OS_MAC) 43 | // This allows UTF-8 characters usage in OSX. 44 | setenv("LC_CTYPE", "UTF-8", 1); 45 | #endif 46 | 47 | QApplication app(argc, argv); 48 | // set application attributes 49 | // Has no effects, see https://bugreports.qt.io/browse/QTBUG-51293 50 | // app.setAttribute(Qt::AA_MacDontSwapCtrlAndMeta, true); 51 | 52 | QQmlApplicationEngine engine; 53 | FileIO fileIO; 54 | MonospaceFontManager monospaceFontManager; 55 | SCOSCDataProvider oscData; 56 | 57 | #if !defined(Q_OS_MAC) 58 | app.setWindowIcon(QIcon::fromTheme("cool-retro-term", QIcon(":../icons/32x32/cool-retro-term.png"))); 59 | #else 60 | app.setWindowIcon(QIcon(":../icons/32x32/cool-retro-term.png")); 61 | #endif 62 | 63 | // Manage command line arguments from the cpp side 64 | QStringList args = app.arguments(); 65 | if (args.contains("-h") || args.contains("--help")) { 66 | // BUG: This usage help text goes to stderr, should go to stdout. 67 | // BUG: First line of output is surrounded by double quotes. 68 | qDebug() << "Usage: " + args.at(0) + " [--default-settings] [--workdir ] [--program ] [-p|--profile ] [--fullscreen] [-h|--help]"; 69 | qDebug() << " --default-settings Run crt-live-coding with the default settings"; 70 | qDebug() << " --workdir Change working directory to 'dir'"; 71 | qDebug() << " -e Command to execute. This option will catch all following arguments, so use it as the last option."; 72 | qDebug() << " -T Set window title to 'title'."; 73 | qDebug() << " --fullscreen Run crt-live-coding in fullscreen."; 74 | qDebug() << " -p|--profile <prof> Run crt-live-coding with the given profile."; 75 | qDebug() << " -h|--help Print this help."; 76 | qDebug() << " --verbose Print additional information such as profiles and settings."; 77 | return 0; 78 | } 79 | 80 | QString appVersion("0.0.1-alpha"); 81 | 82 | if (args.contains("-v") || args.contains("--version")) { 83 | qDebug() << ("crt-live-coding " + appVersion).toStdString().c_str(); 84 | return 0; 85 | } 86 | 87 | // Manage default command 88 | QStringList cmdList; 89 | if (args.contains("-e")) { 90 | cmdList << args.mid(args.indexOf("-e") + 1); 91 | } 92 | QVariant command(cmdList.empty() ? QVariant() : cmdList[0]); 93 | QVariant commandArgs(cmdList.size() <= 1 ? QVariant() : QVariant(cmdList.mid(1))); 94 | engine.rootContext()->setContextProperty("appVersion", appVersion); 95 | engine.rootContext()->setContextProperty("defaultCmd", command); 96 | engine.rootContext()->setContextProperty("defaultCmdArgs", commandArgs); 97 | 98 | engine.rootContext()->setContextProperty("workdir", getNamedArgument(args, "--workdir", "$HOME")); 99 | engine.rootContext()->setContextProperty("fileIO", &fileIO); 100 | engine.rootContext()->setContextProperty("monospaceSystemFonts", monospaceFontManager.retrieveMonospaceFonts()); 101 | 102 | engine.rootContext()->setContextProperty("devicePixelRatio", app.devicePixelRatio()); 103 | engine.rootContext()->setContextProperty("oscData", &oscData); 104 | 105 | // Manage import paths for Linux and OSX. 106 | QStringList importPathList = engine.importPathList(); 107 | importPathList.prepend(QCoreApplication::applicationDirPath() + "/qmltermwidget"); 108 | importPathList.prepend(QCoreApplication::applicationDirPath() + "/../PlugIns"); 109 | importPathList.prepend(QCoreApplication::applicationDirPath() + "/../../../qmltermwidget"); 110 | engine.setImportPathList(importPathList); 111 | 112 | engine.load(QUrl(QStringLiteral ("qrc:/main.qml"))); 113 | 114 | if (engine.rootObjects().isEmpty()) { 115 | qDebug() << "Cannot load QML interface"; 116 | return EXIT_FAILURE; 117 | } 118 | 119 | // Quit the application when the engine closes. 120 | QObject::connect((QObject*) &engine, SIGNAL(quit()), (QObject*) &app, SLOT(quit())); 121 | 122 | return app.exec(); 123 | } 124 | -------------------------------------------------------------------------------- /app/monospacefontmanager.cpp: -------------------------------------------------------------------------------- 1 | #include "monospacefontmanager.h" 2 | 3 | #include <QDebug> 4 | 5 | MonospaceFontManager::MonospaceFontManager(QObject *parent) : QObject(parent) 6 | { 7 | 8 | } 9 | 10 | QStringList MonospaceFontManager::retrieveMonospaceFonts() { 11 | QStringList result; 12 | 13 | QFontDatabase fontDatabase; 14 | QStringList fontFamilies = fontDatabase.families(); 15 | 16 | for (int i = 0; i < fontFamilies.size(); i++) { 17 | QString fontFamily = fontFamilies[i]; 18 | QFont font(fontFamily); 19 | if (fontDatabase.isFixedPitch(font.family())) { 20 | result.append(fontFamily); 21 | } 22 | } 23 | 24 | return result; 25 | } 26 | -------------------------------------------------------------------------------- /app/monospacefontmanager.h: -------------------------------------------------------------------------------- 1 | #ifndef MONOSPACEFONTMANAGER_H 2 | #define MONOSPACEFONTMANAGER_H 3 | 4 | #include <QObject> 5 | #include <QFontDatabase> 6 | 7 | class MonospaceFontManager : public QObject 8 | { 9 | Q_OBJECT 10 | public: 11 | explicit MonospaceFontManager(QObject *parent = nullptr); 12 | Q_INVOKABLE QStringList retrieveMonospaceFonts(); 13 | }; 14 | 15 | #endif // MONOSPACEFONTMANAGER_H 16 | -------------------------------------------------------------------------------- /app/qml/AboutDialog.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.2 2 | import QtQuick.Controls 1.1 3 | import QtQuick.Layouts 1.1 4 | import QtQuick.Window 2.0 5 | 6 | Window{ 7 | id: dialogwindow 8 | title: qsTr("About") 9 | width: 600 10 | height: 400 11 | 12 | modality: Qt.ApplicationModal 13 | 14 | ColumnLayout{ 15 | anchors.fill: parent 16 | anchors.margins: 15 17 | spacing: 15 18 | Text { 19 | Layout.alignment: Qt.AlignHCenter 20 | text: "crt-live-coding" 21 | font {bold: true; pointSize: 18} 22 | } 23 | Loader{ 24 | id: mainContent 25 | Layout.fillHeight: true 26 | Layout.fillWidth: true 27 | 28 | states: [ 29 | State { 30 | name: "Default" 31 | PropertyChanges { 32 | target: mainContent 33 | sourceComponent: defaultComponent 34 | } 35 | }, 36 | State { 37 | name: "License" 38 | PropertyChanges { 39 | target: mainContent 40 | sourceComponent: licenseComponent 41 | } 42 | } 43 | ] 44 | Component.onCompleted: mainContent.state = "Default"; 45 | } 46 | Item{ 47 | Layout.fillWidth: true 48 | height: childrenRect.height 49 | Button{ 50 | anchors.left: parent.left 51 | text: qsTr("License") 52 | onClicked: { 53 | mainContent.state == "Default" ? mainContent.state = "License" : mainContent.state = "Default" 54 | } 55 | } 56 | Button{ 57 | anchors.right: parent.right 58 | text: qsTr("Close") 59 | onClicked: dialogwindow.close(); 60 | } 61 | } 62 | } 63 | // MAIN COMPONENTS //////////////////////////////////////////////////////// 64 | Component{ 65 | id: defaultComponent 66 | ColumnLayout{ 67 | anchors.fill: parent 68 | spacing: 10 69 | Image{ 70 | Layout.fillWidth: true 71 | Layout.fillHeight: true 72 | Layout.alignment: Qt.AlignHCenter 73 | fillMode: Image.PreserveAspectFit 74 | source: "images/crt256.png" 75 | smooth: true 76 | } 77 | Text{ 78 | Layout.alignment: Qt.AlignCenter 79 | horizontalAlignment: Text.AlignHCenter 80 | text: appSettings.version + "\n" + 81 | qsTr("Author: ") + "Filippo Scognamiglio\n" + 82 | qsTr("Email: ") + "flscogna@gmail.com\n" + 83 | qsTr("Source: ") + "https://github.com/Swordfish90/crt-live-coding\n" 84 | } 85 | } 86 | } 87 | Component{ 88 | id: licenseComponent 89 | TextArea{ 90 | anchors.fill: parent 91 | readOnly: true 92 | text: "Copyright (c) 2013 Filippo Scognamiglio <flscogna@gmail.com>\n\n" + 93 | "https://github.com/Swordfish90/crt-live-coding\n\n" + 94 | 95 | "crt-live-coding is free software: you can redistribute it and/or modify " + 96 | "it under the terms of the GNU General Public License as published by " + 97 | "the Free Software Foundation, either version 3 of the License, or " + 98 | "(at your option) any later version.\n\n" + 99 | 100 | "This program is distributed in the hope that it will be useful, " + 101 | "but WITHOUT ANY WARRANTY; without even the implied warranty of " + 102 | "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the " + 103 | "GNU General Public License for more details.\n\n" + 104 | 105 | "You should have received a copy of the GNU General Public License " + 106 | "along with this program. If not, see <http://www.gnu.org/licenses/>." 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /app/qml/BurnInEffect.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | import "utils.js" as Utils 4 | 5 | Loader { 6 | id: burnInEffect 7 | 8 | property ShaderEffectSource source: item ? item.source : null 9 | 10 | property real lastUpdate: 0 11 | property real prevLastUpdate: 0 12 | 13 | property real burnIn: appSettings.burnIn 14 | property real burnInFadeTime: 1 / Utils.lint(_minBurnInFadeTime, _maxBurnInFadeTime, burnIn) 15 | property real _minBurnInFadeTime: appSettings.minBurnInFadeTime 16 | property real _maxBurnInFadeTime: appSettings.maxBurnInFadeTime 17 | 18 | active: appSettings.useFastBurnIn && appSettings.burnIn !== 0 19 | 20 | anchors.fill: parent 21 | 22 | function completelyUpdate() { 23 | prevLastUpdate = lastUpdate; 24 | lastUpdate = timeManager.time; 25 | item.source.scheduleUpdate(); 26 | } 27 | 28 | function restartBlurSource(){ 29 | prevLastUpdate = timeManager.time; 30 | lastUpdate = prevLastUpdate; 31 | completelyUpdate(); 32 | } 33 | 34 | sourceComponent: Item { 35 | property alias source: burnInEffectSource 36 | 37 | ShaderEffectSource { 38 | id: burnInEffectSource 39 | 40 | anchors.fill: parent 41 | 42 | sourceItem: burnInShaderEffect 43 | live: false 44 | recursive: true 45 | hideSource: true 46 | wrapMode: ShaderEffectSource.ClampToEdge 47 | 48 | format: ShaderEffectSource.RGBA 49 | smooth: true 50 | 51 | visible: false 52 | 53 | Connections { 54 | target: kterminal 55 | onImagePainted: completelyUpdate() 56 | } 57 | // Restart blurred source settings change. 58 | Connections{ 59 | target: appSettings 60 | onBurnInChanged: burnInEffect.restartBlurSource(); 61 | onTerminalFontChanged: burnInEffect.restartBlurSource(); 62 | onRasterizationChanged: burnInEffect.restartBlurSource(); 63 | onBurnInQualityChanged: burnInEffect.restartBlurSource(); 64 | } 65 | 66 | Connections { 67 | target: kterminalScrollbar 68 | onOpacityChanged: completelyUpdate() 69 | } 70 | } 71 | 72 | ShaderEffect { 73 | id: burnInShaderEffect 74 | 75 | property variant txt_source: kterminalSource 76 | property variant burnInSource: burnInEffectSource 77 | property real burnInTime: burnInFadeTime 78 | property real lastUpdate: burnInEffect.lastUpdate 79 | property real prevLastUpdate: burnInEffect.prevLastUpdate 80 | 81 | anchors.fill: parent 82 | blending: false 83 | 84 | fragmentShader: 85 | "#ifdef GL_ES 86 | precision mediump float; 87 | #endif\n" + 88 | 89 | "uniform lowp float qt_Opacity;" + 90 | "uniform lowp sampler2D txt_source;" + 91 | 92 | "varying highp vec2 qt_TexCoord0; 93 | 94 | uniform lowp sampler2D burnInSource; 95 | uniform highp float burnInTime; 96 | 97 | uniform highp float lastUpdate; 98 | 99 | uniform highp float prevLastUpdate;" + 100 | 101 | "float rgb2grey(vec3 v){ 102 | return dot(v, vec3(0.21, 0.72, 0.04)); 103 | }" + 104 | 105 | "void main() { 106 | vec2 coords = qt_TexCoord0; 107 | 108 | vec3 txtColor = texture2D(txt_source, coords).rgb; 109 | vec4 accColor = texture2D(burnInSource, coords); 110 | 111 | float prevMask = accColor.a; 112 | float currMask = rgb2grey(txtColor); 113 | 114 | highp float blurDecay = clamp((lastUpdate - prevLastUpdate) * burnInTime, 0.0, 1.0); 115 | blurDecay = max(0.0, blurDecay - prevMask); 116 | vec3 blurColor = accColor.rgb - vec3(blurDecay); 117 | vec3 color = max(blurColor, txtColor); 118 | 119 | gl_FragColor = vec4(color, currMask); 120 | } 121 | " 122 | 123 | onStatusChanged: if (log) console.log(log) //Print warning messages 124 | } 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /app/qml/CRTMainMenuBar.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.2 2 | import QtQuick.Controls 1.1 3 | 4 | MenuBar { 5 | id: defaultMenuBar 6 | property bool visible: true 7 | Menu { 8 | title: qsTr("File") 9 | visible: defaultMenuBar.visible 10 | MenuItem {action: quitAction} 11 | } 12 | Menu { 13 | title: qsTr("Edit") 14 | visible: defaultMenuBar.visible && appSettings.showMenubar 15 | MenuItem {action: copyAction} 16 | MenuItem {action: pasteAction} 17 | MenuSeparator{visible: Qt.platform.os !== "osx"} 18 | MenuItem {action: showsettingsAction} 19 | } 20 | Menu{ 21 | title: qsTr("View") 22 | visible: defaultMenuBar.visible 23 | MenuItem {action: fullscreenAction; visible: fullscreenAction.enabled} 24 | MenuItem {action: showMenubarAction; visible: showMenubarAction.enabled} 25 | MenuSeparator{visible: showMenubarAction.enabled} 26 | MenuItem {action: zoomIn} 27 | MenuItem {action: zoomOut} 28 | } 29 | Menu{ 30 | id: profilesMenu 31 | title: qsTr("Profiles") 32 | visible: defaultMenuBar.visible 33 | Instantiator{ 34 | model: appSettings.profilesList 35 | delegate: MenuItem { 36 | text: model.text 37 | onTriggered: { 38 | appSettings.loadProfileString(obj_string); 39 | appSettings.handleFontChanged(); 40 | } 41 | } 42 | onObjectAdded: profilesMenu.insertItem(index, object) 43 | onObjectRemoved: profilesMenu.removeItem(object) 44 | } 45 | } 46 | Menu{ 47 | title: qsTr("Help") 48 | visible: defaultMenuBar.visible 49 | MenuItem {action: showAboutAction} 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/qml/CheckableSlider.qml: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2013 "Filippo Scognamiglio" 3 | * https://github.com/Swordfish90/cool-retro-term 4 | * 5 | * This file is part of cool-retro-term. 6 | * 7 | * cool-retro-term is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 | *******************************************************************************/ 20 | 21 | import QtQuick 2.2 22 | import QtQuick.Controls 1.1 23 | import QtQuick.Layouts 1.1 24 | 25 | import "Components" 26 | 27 | RowLayout { 28 | property alias name: check.text 29 | 30 | property double value 31 | property alias min_value: slider.minimumValue 32 | property alias max_value: slider.maximumValue 33 | property alias stepSize: slider.stepSize 34 | 35 | signal newValue(real newValue); 36 | 37 | id: setting_component 38 | Layout.fillWidth: true 39 | 40 | onValueChanged: { 41 | check.checked = !(value == 0); 42 | if(check.checked) 43 | slider.value = value; 44 | } 45 | 46 | CheckBox{ 47 | id: check 48 | implicitWidth: 160 49 | onClicked: { 50 | if(!checked){ 51 | checked = false; 52 | slider.enabled = false; 53 | newValue(0); 54 | } else { 55 | checked = true; 56 | newValue(slider.value); 57 | slider.enabled = true; 58 | } 59 | } 60 | } 61 | Slider{ 62 | id: slider 63 | stepSize: parent.stepSize 64 | Layout.fillWidth: true 65 | onValueChanged: { 66 | newValue(value); 67 | } 68 | } 69 | SizedLabel { 70 | Layout.fillHeight: true 71 | text: Math.round(((value - min_value) / (max_value - min_value)) * 100) + "%" 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/qml/ColorButton.qml: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2013 "Filippo Scognamiglio" 3 | * https://github.com/Swordfish90/cool-retro-term 4 | * 5 | * This file is part of cool-retro-term. 6 | * 7 | * cool-retro-term is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 | *******************************************************************************/ 20 | 21 | import QtQuick 2.2 22 | import QtQuick.Dialogs 1.1 23 | 24 | Item { 25 | id: rootItem 26 | 27 | signal colorSelected (color color) 28 | property color color 29 | property string name 30 | 31 | ColorDialog { 32 | id: colorDialog 33 | title: qsTr("Choose a color") 34 | modality: Qt.ApplicationModal 35 | visible: false 36 | 37 | //This is a workaround to a Qt 5.2 bug. 38 | onColorChanged: if (Qt.platform.os !== "osx") colorSelected(color) 39 | onAccepted: if (Qt.platform.os === "osx") colorSelected(color) 40 | } 41 | Rectangle{ 42 | anchors.fill: parent 43 | radius: 10 44 | color: rootItem.color 45 | border.color: "black" 46 | Glossy {} 47 | Rectangle { 48 | anchors.fill: parent 49 | anchors.margins: parent.height * 0.25 50 | radius: parent.radius 51 | color: "white" 52 | opacity: 0.5 53 | } 54 | Text{ 55 | anchors.centerIn: parent 56 | z: parent.z + 1 57 | text: name + ": " + rootItem.color 58 | } 59 | } 60 | MouseArea{ 61 | anchors.fill: parent 62 | onClicked: colorDialog.visible = true; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /app/qml/Components/SizedLabel.qml: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2013 "Filippo Scognamiglio" 3 | * https://github.com/Swordfish90/cool-retro-term 4 | * 5 | * This file is part of cool-retro-term. 6 | * 7 | * cool-retro-term is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 | *******************************************************************************/ 20 | 21 | 22 | import QtQuick 2.0 23 | import QtQuick.Controls 1.0 24 | 25 | // This component is simply a label with a predefined size. 26 | // Used to improve alignment. 27 | 28 | Item { 29 | property alias text: textfield.text 30 | width: appSettings.labelWidth 31 | Label{ 32 | id: textfield 33 | anchors { right: parent.right; verticalCenter: parent.verticalCenter } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/qml/Effects/Plasma.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | ShaderEffect { 4 | id: effect 5 | 6 | property color fontColor: appSettings.fontColor 7 | 8 | Connections { 9 | target: oscData 10 | onNewData: { 11 | effect.loud = loud / 100 12 | 13 | effect.eq0 = eqm[0] * 0.2 + effect.eq0 * 0.8 14 | effect.eq1 = eqm[1] * 0.2 + effect.eq1 * 0.8 15 | effect.eq2 = eqm[2] * 0.2 + effect.eq2 * 0.8 16 | effect.eq3 = eqm[3] * 0.2 + effect.eq3 * 0.8 17 | effect.eq4 = eqm[4] * 0.2 + effect.eq4 * 0.8 18 | effect.eq5 = eqm[5] * 0.2 + effect.eq5 * 0.8 19 | effect.eq6 = eqm[6] * 0.2 + effect.eq6 * 0.8 20 | effect.eq7 = eqm[7] * 0.2 + effect.eq7 * 0.8 21 | } 22 | } 23 | 24 | // Music parameters 25 | property real eq0: 0 26 | property real eq1: 0 27 | property real eq2: 0 28 | property real eq3: 0 29 | property real eq4: 0 30 | property real eq5: 0 31 | property real eq6: 0 32 | property real eq7: 0 33 | 34 | property real loud: 0 35 | property real flat: 0 36 | property real centroid: 0 37 | 38 | property real time: timeManager.time 39 | 40 | anchors.fill: parent 41 | blending: false 42 | 43 | //Print the number with a reasonable precision for the shader. 44 | function str(num){ 45 | return num.toFixed(8); 46 | } 47 | 48 | fragmentShader: " 49 | #ifdef GL_ES 50 | precision mediump float; 51 | #endif 52 | 53 | uniform highp float qt_Opacity; 54 | uniform highp float time; 55 | varying highp vec2 qt_TexCoord0; 56 | 57 | uniform highp vec4 fontColor; 58 | 59 | uniform mediump float loud; 60 | uniform mediump float flat; 61 | uniform mediump float centroid; 62 | 63 | uniform lowp float eq0; 64 | uniform lowp float eq1; 65 | uniform lowp float eq2; 66 | uniform lowp float eq3; 67 | uniform lowp float eq4; 68 | uniform lowp float eq5; 69 | uniform lowp float eq6; 70 | uniform lowp float eq7;" + 71 | 72 | "void main() { 73 | vec3 txt_color = vec3(0.0); 74 | 75 | vec2 uv = qt_TexCoord0; 76 | vec2 p = (uv * 2.0 - 1.0) * 15.0; 77 | vec2 sfunc = vec2(p.x, p.y); 78 | float baseFreq = 4.0; 79 | float baseAmp = 1.5 * loud; 80 | float speed = 10.0; 81 | 82 | sfunc.y += baseAmp * eq0 * sin(uv.x * baseFreq + speed * time); 83 | sfunc.y += baseAmp * eq1 * sin(uv.x * 2.0 * baseFreq + (speed + 0.1) * time); 84 | sfunc.y += baseAmp * eq2 * sin(uv.x * 4.0 * baseFreq + (speed + 0.2) * time); 85 | sfunc.y += baseAmp * eq3 * sin(uv.x * 8.0 * baseFreq + (speed + 0.3) * time); 86 | sfunc.y += baseAmp * eq4 * sin(uv.x * 16.0 * baseFreq + (speed + 0.4) * time); 87 | sfunc.y += baseAmp * eq5 * sin(uv.x * 32.0 * baseFreq + (speed + 0.5) * time); 88 | 89 | sfunc.y *= uv.x * 2.0 + 0.05; 90 | sfunc.y *= 2.0 - uv.x * 2.0 + 0.05; 91 | sfunc.y /= 0.1; 92 | 93 | vec3 c = vec3(abs(sfunc.y)); 94 | c = pow(c, vec3(-0.5)); 95 | c *= fontColor.rgb; 96 | txt_color = clamp(vec3(0.0), vec3(0.5), c); 97 | 98 | gl_FragColor = vec4(txt_color, qt_Opacity);" + 99 | "}" 100 | 101 | onStatusChanged: { 102 | // Print warning messages 103 | if (log) 104 | console.log(log); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /app/qml/Effects/Tiles.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | ShaderEffect { 4 | id: effect 5 | 6 | property color fontColor: appSettings.fontColor 7 | 8 | Connections { 9 | target: oscData 10 | onNewData: { 11 | effect.loudIntegral += (loud / 100) 12 | effect.loud = loud / 100 13 | } 14 | } 15 | 16 | property real loud: 0 17 | property real loudIntegral: 0 18 | 19 | property size resolution: Qt.size(width, height) 20 | 21 | property real time: timeManager.time 22 | 23 | anchors.fill: parent 24 | blending: false 25 | 26 | 27 | fragmentShader: " 28 | #ifdef GL_ES 29 | precision mediump float; 30 | #endif 31 | 32 | #define pi 3.14159265 33 | 34 | uniform highp float qt_Opacity; 35 | uniform highp float time; 36 | varying highp vec2 qt_TexCoord0; 37 | 38 | uniform highp vec4 fontColor; 39 | uniform mediump vec2 resolution; 40 | 41 | uniform lowp float loud; 42 | uniform highp float loudIntegral; 43 | 44 | vec3 hsv2rgb(in vec3 hsv) { 45 | hsv.yz = clamp (hsv.yz, 0.0, 1.0); 46 | return hsv.z * (1.0 + 0.5 * hsv.y * (cos (2.0 * pi * (hsv.x + vec3 (0.0, 2.0 / 3.0, 1.0 / 3.0))) - 1.0)); 47 | } 48 | 49 | float rand(in vec2 seed) { 50 | return fract(sin(dot(seed, vec2 (12.9898, 78.233))) * 137.5453); 51 | } 52 | " + 53 | 54 | "void main() { 55 | vec2 frag = (2.0 * qt_TexCoord0 * resolution - resolution) / resolution.y; 56 | frag *= 5.0; 57 | float random = rand(floor(frag)); 58 | vec2 black = smoothstep(1.0, 0.8, cos(frag * pi * 2.0)); 59 | vec3 color = hsv2rgb(vec3(random + loudIntegral * 0.01, 1.0, 1.0)); 60 | color *= black.x * black.y * smoothstep(1.0, 0.0, length(fract(frag) - 0.5)); 61 | color *= 0.5 + loud * cos(random + random * time + 0.125 * pi * loudIntegral); 62 | color *= 0.5; 63 | 64 | gl_FragColor = vec4(color * fontColor.rgb, qt_Opacity);" + 65 | "}" 66 | 67 | onStatusChanged: { 68 | // Print warning messages 69 | if (log) 70 | console.log(log); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/qml/Effects/Tunnel.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | import "../utils.js" as Utils 4 | 5 | ShaderEffect { 6 | id: effect 7 | 8 | property color fontColor: appSettings.fontColor 9 | 10 | Connections { 11 | target: oscData 12 | onNewData: { 13 | effect.loud = loud / 100 14 | effect.speed = Utils.lint(0.01, 0.20, effect.loud * effect.loud) 15 | } 16 | } 17 | 18 | property real loud: 0 19 | 20 | property size resolution: Qt.size(width, height) 21 | 22 | property real time: 0 23 | 24 | property real speed: 0 25 | 26 | Connections { 27 | target: timeManager 28 | onTimeChanged: time += effect.speed 29 | } 30 | 31 | anchors.fill: parent 32 | blending: false 33 | 34 | 35 | fragmentShader: " 36 | #define CIRCLES 8.0 37 | #ifdef GL_ES 38 | precision mediump float; 39 | #endif 40 | 41 | uniform highp float qt_Opacity; 42 | uniform highp float time; 43 | varying highp vec2 qt_TexCoord0; 44 | 45 | uniform highp vec4 fontColor; 46 | uniform mediump vec2 resolution; 47 | 48 | uniform mediump float loud; 49 | 50 | vec2 position(float z) { 51 | float temp1 = cos(z * 0.031) * 4.0; 52 | float temp2 = sin(z * 0.0091) * 3.0; 53 | return vec2( 54 | sin(z * 0.1) + sin(temp1) + sin(temp2) * 3.0, 55 | cos(z * 0.1) + cos(temp1) + cos(temp2) * 3.0 56 | ); 57 | }" + 58 | 59 | "void main() { 60 | vec2 p = (qt_TexCoord0 * resolution * 2.0 - resolution) / min(resolution.x, resolution.y); 61 | float speed = 1.0; 62 | float camZ = speed * time; 63 | vec2 cam = position(camZ); 64 | 65 | float dt = 0.5; 66 | float camZ2 = speed * (time + dt); 67 | vec2 cam2 = position(camZ2); 68 | vec2 dcamdt = (cam2 - cam) / dt; 69 | 70 | vec3 f = vec3(0.0); 71 | for(float i = 1.0; i < CIRCLES; i += 1.0) { 72 | float realZ = floor(camZ) + i; 73 | float screenZ = realZ - camZ; 74 | float r = 0.5 / screenZ; 75 | vec2 c = (position(realZ) - cam) * 4.0 / screenZ - dcamdt * 0.4; 76 | vec3 color = (vec3(sin(realZ * 0.07), sin(realZ * 0.1), sin(realZ * 0.08)) * 0.25 + vec3(1.00)) / 2.0; 77 | f += color * 0.06 / screenZ / (abs(length(p - c) - r) + 0.01) * smoothstep(1.0, 0.0, screenZ / CIRCLES); 78 | } 79 | 80 | f = f * fontColor.rgb * loud; 81 | f = clamp(vec3(0.0), vec3(0.5), f); 82 | 83 | gl_FragColor = vec4(f, qt_Opacity);" + 84 | "}" 85 | 86 | onStatusChanged: { 87 | // Print warning messages 88 | if (log) 89 | console.log(log); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /app/qml/FontPixels.qml: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2013 "Filippo Scognamiglio" 3 | * https://github.com/Swordfish90/cool-retro-term 4 | * 5 | * This file is part of cool-retro-term. 6 | * 7 | * cool-retro-term is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 | *******************************************************************************/ 20 | 21 | import QtQuick 2.2 22 | 23 | QtObject{ 24 | property int selectedFontIndex 25 | property real scaling 26 | property var _font: fontlist.get(selectedFontIndex) 27 | property var source: _font.source 28 | property int pixelSize: _font.pixelSize 29 | property int lineSpacing: _font.lineSpacing 30 | property real screenScaling: scaling * _font.baseScaling 31 | property real defaultFontWidth: fontlist.get(selectedFontIndex).fontWidth 32 | property bool lowResolutionFont: true 33 | 34 | property ListModel fontlist: ListModel{ 35 | ListElement{ 36 | name: "COMMODORE_PET" 37 | text: "Commodore PET (1977)" 38 | source: "fonts/1977-commodore-pet/PetMe.ttf" 39 | lineSpacing: 3 40 | pixelSize: 8 41 | baseScaling: 3.5 42 | fontWidth: 0.8 43 | } 44 | ListElement{ 45 | name: "IBM_PC" 46 | text: "IBM PC (1981)" 47 | source: "fonts/1981-ibm-pc/PxPlus_IBM_BIOS.ttf" 48 | lineSpacing: 3 49 | pixelSize: 8 50 | baseScaling: 3.5 51 | fontWidth: 0.8 52 | } 53 | ListElement{ 54 | name: "PROGGY_TINY" 55 | text: "Proggy Tiny (Modern)" 56 | source: "fonts/modern-proggy-tiny/ProggyTiny.ttf" 57 | lineSpacing: 1 58 | pixelSize: 16 59 | baseScaling: 3.3 60 | fontWidth: 0.9 61 | } 62 | ListElement{ 63 | name: "TERMINUS_SCALED" 64 | text: "Terminus (Modern)" 65 | source: "fonts/modern-terminus/TerminusTTF-4.46.0.ttf" 66 | lineSpacing: 1 67 | pixelSize: 12 68 | baseScaling: 3.0 69 | fontWidth: 1.0 70 | } 71 | ListElement{ 72 | name: "PRO_FONT_SCALED" 73 | text: "Pro Font (Modern)" 74 | source: "fonts/modern-pro-font-win-tweaked/ProFontWindows.ttf" 75 | lineSpacing: 1 76 | pixelSize: 12 77 | baseScaling: 3.0 78 | fontWidth: 1.0 79 | } 80 | ListElement{ 81 | name: "APPLE_II" 82 | text: "Apple ][ (1977)" 83 | source: "fonts/1977-apple2/PrintChar21.ttf" 84 | lineSpacing: 2 85 | pixelSize: 8 86 | baseScaling: 3.5 87 | fontWidth: 0.9 88 | } 89 | ListElement{ 90 | name: "ATARI_400" 91 | text: "Atari 400-800 (1979)" 92 | source: "fonts/1979-atari-400-800/AtariClassic-Regular.ttf" 93 | lineSpacing: 3 94 | pixelSize: 8 95 | baseScaling: 3.5 96 | fontWidth: 0.8 97 | } 98 | ListElement{ 99 | name: "COMMODORE_64" 100 | text: "Commodore 64 (1982)" 101 | source: "fonts/1982-commodore64/C64_Pro_Mono-STYLE.ttf" 102 | lineSpacing: 3 103 | pixelSize: 8 104 | baseScaling: 3.5 105 | fontWidth: 0.8 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /app/qml/FontScanlines.qml: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2013 "Filippo Scognamiglio" 3 | * https://github.com/Swordfish90/cool-retro-term 4 | * 5 | * This file is part of cool-retro-term. 6 | * 7 | * cool-retro-term is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 | *******************************************************************************/ 20 | 21 | import QtQuick 2.2 22 | 23 | QtObject{ 24 | property int selectedFontIndex 25 | property real scaling 26 | property var _font: fontlist.get(selectedFontIndex) 27 | property var source: _font.source 28 | property int pixelSize: _font.pixelSize 29 | property int lineSpacing: _font.lineSpacing 30 | property real screenScaling: scaling * _font.baseScaling 31 | property real defaultFontWidth: fontlist.get(selectedFontIndex).fontWidth 32 | property bool lowResolutionFont: true 33 | 34 | property ListModel fontlist: ListModel{ 35 | ListElement{ 36 | name: "COMMODORE_PET" 37 | text: "Commodore PET (1977)" 38 | source: "fonts/1977-commodore-pet/PetMe.ttf" 39 | lineSpacing: 3 40 | pixelSize: 8 41 | baseScaling: 3.5 42 | fontWidth: 0.7 43 | } 44 | ListElement{ 45 | name: "IBM_PC" 46 | text: "IBM PC (1981)" 47 | source: "fonts/1981-ibm-pc/PxPlus_IBM_BIOS.ttf" 48 | lineSpacing: 3 49 | pixelSize: 8 50 | baseScaling: 3.5 51 | fontWidth: 0.8 52 | } 53 | ListElement{ 54 | name: "PROGGY_TINY" 55 | text: "Proggy Tiny (Modern)" 56 | source: "fonts/modern-proggy-tiny/ProggyTiny.ttf" 57 | lineSpacing: 1 58 | pixelSize: 16 59 | baseScaling: 3.3 60 | fontWidth: 0.9 61 | } 62 | ListElement{ 63 | name: "TERMINUS_SCALED" 64 | text: "Terminus (Modern)" 65 | source: "fonts/modern-terminus/TerminusTTF-4.46.0.ttf" 66 | lineSpacing: 1 67 | pixelSize: 12 68 | baseScaling: 3.0 69 | fontWidth: 1.0 70 | } 71 | ListElement{ 72 | name: "PRO_FONT_SCALED" 73 | text: "Pro Font (Modern)" 74 | source: "fonts/modern-pro-font-win-tweaked/ProFontWindows.ttf" 75 | lineSpacing: 1 76 | pixelSize: 12 77 | baseScaling: 3.0 78 | fontWidth: 1.0 79 | } 80 | ListElement{ 81 | name: "APPLE_II" 82 | text: "Apple ][ (1977)" 83 | source: "fonts/1977-apple2/PrintChar21.ttf" 84 | lineSpacing: 3 85 | pixelSize: 8 86 | baseScaling: 3.5 87 | fontWidth: 0.8 88 | } 89 | ListElement{ 90 | name: "ATARI_400" 91 | text: "Atari 400-800 (1979)" 92 | source: "fonts/1979-atari-400-800/AtariClassic-Regular.ttf" 93 | lineSpacing: 3 94 | pixelSize: 8 95 | baseScaling: 3.5 96 | fontWidth: 0.7 97 | } 98 | ListElement{ 99 | name: "COMMODORE_64" 100 | text: "Commodore 64 (1982)" 101 | source: "fonts/1982-commodore64/C64_Pro_Mono-STYLE.ttf" 102 | lineSpacing: 3 103 | pixelSize: 8 104 | baseScaling: 3.5 105 | fontWidth: 0.7 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /app/qml/Glossy.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.2 2 | 3 | Rectangle { 4 | anchors.centerIn: parent 5 | width: parent.width - parent.border.width 6 | height: parent.height - parent.border.width 7 | radius:parent.radius - parent.border.width/2 8 | smooth: true 9 | 10 | border.width: parent.border.width/2 11 | border.color: "#22FFFFFF" 12 | 13 | gradient: Gradient { 14 | GradientStop { position: 0; color: "#88FFFFFF" } 15 | GradientStop { position: .1; color: "#55FFFFFF" } 16 | GradientStop { position: .5; color: "#33FFFFFF" } 17 | GradientStop { position: .501; color: "#11000000" } 18 | GradientStop { position: .8; color: "#11FFFFFF" } 19 | GradientStop { position: 1; color: "#55FFFFFF" } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/qml/InsertNameDialog.qml: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2013 "Filippo Scognamiglio" 3 | * https://github.com/Swordfish90/cool-retro-term 4 | * 5 | * This file is part of cool-retro-term. 6 | * 7 | * cool-retro-term is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 | *******************************************************************************/ 20 | 21 | import QtQuick 2.2 22 | import QtQuick.Window 2.0 23 | import QtQuick.Controls 1.1 24 | import QtQuick.Layouts 1.1 25 | import QtQuick.Dialogs 1.1 26 | 27 | Window{ 28 | id: insertnamedialog 29 | width: 400 30 | height: 100 31 | modality: Qt.ApplicationModal 32 | title: qsTr("Save new profile") 33 | 34 | property alias profileName: namefield.text 35 | signal nameSelected(string name) 36 | 37 | MessageDialog { 38 | id: errorDialog 39 | title: qsTr("Error") 40 | visible: false 41 | 42 | function showError(message){ 43 | text = message; 44 | open(); 45 | } 46 | } 47 | 48 | function validateName(name){ 49 | var profile_list = appSettings.profilesList; 50 | if (name === "") 51 | return 1; 52 | return 0; 53 | } 54 | 55 | ColumnLayout{ 56 | anchors.margins: 10 57 | anchors.fill: parent 58 | RowLayout{ 59 | Label{text: qsTr("Name")} 60 | TextField{ 61 | id: namefield 62 | Layout.fillWidth: true 63 | Component.onCompleted: forceActiveFocus() 64 | onAccepted: okbutton.clickAction() 65 | } 66 | } 67 | RowLayout{ 68 | Layout.alignment: Qt.AlignBottom | Qt.AlignRight 69 | Button{ 70 | id: okbutton 71 | text: qsTr("OK") 72 | onClicked: clickAction() 73 | function clickAction(){ 74 | var name = namefield.text; 75 | switch(validateName(name)){ 76 | case 1: 77 | errorDialog.showError(qsTr("The name you inserted is empty. Please choose a different one.")); 78 | break; 79 | default: 80 | nameSelected(name); 81 | close(); 82 | } 83 | } 84 | } 85 | Button{ 86 | text: qsTr("Cancel") 87 | onClicked: close() 88 | } 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /app/qml/SettingsEffectsTab.qml: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2013 "Filippo Scognamiglio" 3 | * https://github.com/Swordfish90/cool-retro-term 4 | * 5 | * This file is part of cool-retro-term. 6 | * 7 | * cool-retro-term is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 | *******************************************************************************/ 20 | 21 | import QtQuick 2.2 22 | import QtQuick.Controls 1.1 23 | import QtQuick.Layouts 1.1 24 | 25 | Tab{ 26 | ColumnLayout{ 27 | anchors.fill: parent 28 | spacing: 2 29 | 30 | GroupBox { 31 | title: qsTr("Background Shader") 32 | Layout.fillWidth: true 33 | 34 | ComboBox { 35 | id: backgroundShaderCombobox 36 | 37 | anchors.fill: parent 38 | model: appSettings.backgrounds 39 | textRole: "name" 40 | 41 | onCurrentIndexChanged: appSettings.selectedBackground = appSettings.backgrounds.get(currentIndex).bgId 42 | 43 | function updateIndex() { 44 | for (var i = 0; i < appSettings.backgrounds.count; i++) { 45 | if (appSettings.selectedBackground === appSettings.backgrounds.get(i).bgId) { 46 | currentIndex = i 47 | } 48 | } 49 | } 50 | } 51 | } 52 | 53 | GroupBox{ 54 | title: qsTr("Effects") 55 | Layout.fillWidth: true 56 | 57 | ColumnLayout { 58 | anchors.fill: parent 59 | 60 | CheckableSlider{ 61 | name: qsTr("Music Sensitivity") 62 | onNewValue: appSettings.musicSensitivity = newValue 63 | value: appSettings.musicSensitivity 64 | } 65 | CheckableSlider{ 66 | name: qsTr("Bloom") 67 | onNewValue: appSettings.bloom = newValue 68 | value: appSettings.bloom 69 | } 70 | CheckableSlider{ 71 | name: qsTr("BurnIn") 72 | onNewValue: appSettings.burnIn = newValue 73 | value: appSettings.burnIn 74 | } 75 | CheckableSlider{ 76 | name: qsTr("Static Noise") 77 | onNewValue: appSettings.staticNoise = newValue 78 | value: appSettings.staticNoise 79 | } 80 | CheckableSlider{ 81 | name: qsTr("Jitter") 82 | onNewValue: appSettings.jitter = newValue 83 | value: appSettings.jitter 84 | } 85 | CheckableSlider{ 86 | name: qsTr("Glow Line") 87 | onNewValue: appSettings.glowingLine = newValue; 88 | value: appSettings.glowingLine 89 | } 90 | CheckableSlider{ 91 | name: qsTr("Flickering") 92 | onNewValue: appSettings.flickering = newValue; 93 | value: appSettings.flickering; 94 | } 95 | CheckableSlider{ 96 | name: qsTr("Horizontal Sync") 97 | onNewValue: appSettings.horizontalSync = newValue; 98 | value: appSettings.horizontalSync; 99 | } 100 | CheckableSlider{ 101 | name: qsTr("RGB Shift") 102 | onNewValue: appSettings.rbgShift = newValue; 103 | value: appSettings.rbgShift; 104 | } 105 | } 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /app/qml/SettingsWindow.qml: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2013 "Filippo Scognamiglio" 3 | * https://github.com/Swordfish90/cool-retro-term 4 | * 5 | * This file is part of cool-retro-term. 6 | * 7 | * cool-retro-term is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 | *******************************************************************************/ 20 | 21 | import QtQuick 2.2 22 | import QtQuick.Controls 1.1 23 | import QtQuick.Window 2.1 24 | import QtQuick.Layouts 1.1 25 | import QtQuick.Dialogs 1.1 26 | 27 | Window { 28 | id: settings_window 29 | title: qsTr("Settings") 30 | width: 580 31 | height: 400 32 | 33 | property int tabmargins: 15 34 | 35 | TabView{ 36 | id: tabView 37 | anchors.fill: parent 38 | anchors.margins: 10 39 | SettingsGeneralTab { 40 | id: generalTab 41 | title: qsTr("General") 42 | anchors.fill: parent 43 | anchors.margins: tabmargins 44 | } 45 | SettingsTerminalTab { 46 | id: terminalTab 47 | title: qsTr("Terminal") 48 | anchors.fill: parent 49 | anchors.margins: tabmargins 50 | } 51 | SettingsEffectsTab { 52 | id: effectsTab 53 | title: qsTr("Effects") 54 | anchors.fill: parent 55 | anchors.margins: tabmargins 56 | } 57 | SettingsAdvancedTab { 58 | id: performanceTab 59 | title: qsTr("Advanced") 60 | anchors.fill: parent 61 | anchors.margins: tabmargins 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /app/qml/SimpleSlider.qml: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2013 "Filippo Scognamiglio" 3 | * https://github.com/Swordfish90/cool-retro-term 4 | * 5 | * This file is part of cool-retro-term. 6 | * 7 | * cool-retro-term is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 | *******************************************************************************/ 20 | 21 | import QtQuick 2.2 22 | import QtQuick.Controls 1.1 23 | import QtQuick.Layouts 1.1 24 | 25 | import "Components" 26 | 27 | RowLayout { 28 | property alias value: slider.value 29 | property alias stepSize: slider.stepSize 30 | property alias minimumValue: slider.minimumValue 31 | property alias maximumValue: slider.maximumValue 32 | property real maxMultiplier: 100 33 | 34 | id: setting_component 35 | spacing: 10 36 | Slider{ 37 | id: slider 38 | stepSize: parent.stepSize 39 | Layout.fillWidth: true 40 | } 41 | SizedLabel{ 42 | text: Math.round(value * maxMultiplier) + "%" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/qml/SizeOverlay.qml: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2013 "Filippo Scognamiglio" 3 | * https://github.com/Swordfish90/cool-retro-term 4 | * 5 | * This file is part of cool-retro-term. 6 | * 7 | * cool-retro-term is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 | *******************************************************************************/ 20 | 21 | import QtQuick 2.2 22 | 23 | Rectangle{ 24 | property size terminalSize 25 | property real topOpacity: 0.6 26 | width: textSize.width * 2 27 | height: textSize.height * 2 28 | radius: 5 29 | border.width: 2 30 | border.color: "white" 31 | color: "black" 32 | opacity: sizetimer.running ? 0.6 : 0.0 33 | 34 | Behavior on opacity{NumberAnimation{duration: 200}} 35 | 36 | onTerminalSizeChanged: sizetimer.restart() 37 | 38 | Text{ 39 | id: textSize 40 | anchors.centerIn: parent 41 | color: "white" 42 | text: terminalSize.width + "x" + terminalSize.height 43 | } 44 | Timer{ 45 | id: sizetimer 46 | interval: 1000 47 | running: false 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/qml/SlowBurnIn.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | import "utils.js" as Utils 4 | 5 | Loader { 6 | property ShaderEffectSource source: item ? item.source : null 7 | 8 | active: !appSettings.useFastBurnIn && appSettings.burnIn !== 0 9 | 10 | anchors.fill: parent 11 | 12 | sourceComponent: Item { 13 | property alias source: burnInSourceEffect 14 | 15 | property int burnInScaling: scaleTexture * appSettings.burnInQuality 16 | 17 | ShaderEffectSource { 18 | property bool updateBurnIn: false 19 | property real burnIn: appSettings.burnIn 20 | property real fps: appSettings.fps !== 0 ? appSettings.fps : 60 21 | property real burnInFadeTime: Utils.lint(minBurnInFadeTime, maxBurnInFadeTime, burnIn) 22 | property real burnInCoefficient: 1000 / (fps * burnInFadeTime) 23 | property real minBurnInFadeTime: appSettings.minBurnInFadeTime 24 | property real maxBurnInFadeTime: appSettings.maxBurnInFadeTime 25 | 26 | id: burnInSourceEffect 27 | 28 | anchors.fill: parent 29 | 30 | sourceItem: burnInEffect 31 | recursive: true 32 | live: false 33 | hideSource: true 34 | wrapMode: kterminalSource.wrapMode 35 | 36 | visible: false 37 | 38 | function restartBlurSource(){ 39 | livetimer.restart(); 40 | } 41 | 42 | // This updates the burnin synched with the timer. 43 | Connections { 44 | target: burnInSourceEffect.updateBurnIn ? timeManager : null 45 | ignoreUnknownSignals: false 46 | onTimeChanged: { 47 | burnInSourceEffect.scheduleUpdate(); 48 | } 49 | } 50 | 51 | Timer{ 52 | id: livetimer 53 | 54 | // The interval assumes 60 fps. This is the time needed burnout a white pixel. 55 | // We multiply 1.1 to have a little bit of margin over the theoretical value. 56 | // This solution is not extremely clean, but it's probably the best to avoid measuring fps. 57 | 58 | interval: burnInSourceEffect.burnInFadeTime * 1.1 59 | running: true 60 | onTriggered: burnInSourceEffect.updateBurnIn = false; 61 | } 62 | Connections{ 63 | target: kterminal 64 | onImagePainted:{ 65 | burnInSourceEffect.scheduleUpdate(); 66 | burnInSourceEffect.updateBurnIn = true; 67 | livetimer.restart(); 68 | } 69 | } 70 | // Restart blurred source settings change. 71 | Connections{ 72 | target: appSettings 73 | onBurnInChanged: burnInSourceEffect.restartBlurSource(); 74 | onTerminalFontChanged: burnInSourceEffect.restartBlurSource(); 75 | onRasterizationChanged: burnInSourceEffect.restartBlurSource(); 76 | onBurnInQualityChanged: burnInSourceEffect.restartBlurSource(); 77 | } 78 | Connections { 79 | target: kterminalScrollbar 80 | onOpacityChanged: burnInSourceEffect.restartBlurSource(); 81 | } 82 | 83 | ShaderEffect { 84 | id: burnInEffect 85 | 86 | property variant txt_source: kterminalSource 87 | property variant blurredSource: burnInSourceEffect 88 | property real burnInCoefficient: burnInSourceEffect.burnInCoefficient 89 | 90 | anchors.fill: parent 91 | blending: false 92 | 93 | fragmentShader: 94 | "#ifdef GL_ES 95 | precision mediump float; 96 | #endif\n" + 97 | 98 | "uniform lowp float qt_Opacity;" + 99 | "uniform lowp sampler2D txt_source;" + 100 | 101 | "varying highp vec2 qt_TexCoord0; 102 | uniform lowp sampler2D blurredSource; 103 | uniform highp float burnInCoefficient;" + 104 | 105 | "float max3(vec3 v) { 106 | return max (max (v.x, v.y), v.z); 107 | }" + 108 | 109 | "void main() {" + 110 | "vec2 coords = qt_TexCoord0;" + 111 | "vec3 origColor = texture2D(txt_source, coords).rgb;" + 112 | "vec3 blur_color = texture2D(blurredSource, coords).rgb - vec3(burnInCoefficient);" + 113 | "vec3 color = min(origColor + blur_color, max(origColor, blur_color));" + 114 | 115 | "gl_FragColor = vec4(color, max3(color - origColor));" + 116 | "}" 117 | 118 | onStatusChanged: if (log) console.log(log) //Print warning messages 119 | } 120 | } 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /app/qml/Storage.qml: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2013 "Filippo Scognamiglio" 3 | * https://github.com/Swordfish90/cool-retro-term 4 | * 5 | * This file is part of cool-retro-term. 6 | * 7 | * cool-retro-term is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 | *******************************************************************************/ 20 | 21 | import QtQuick 2.2 22 | import QtQuick.LocalStorage 2.0 23 | 24 | QtObject { 25 | readonly property string dbMajorVersion: "1" 26 | readonly property string dbMinorVersion: "1.0" 27 | property bool initialized: false 28 | 29 | function getDatabase() { 30 | return LocalStorage.openDatabaseSync("crtlivemusic" + dbMajorVersion, dbMinorVersion, "StorageDatabase", 100000); 31 | } 32 | 33 | function initialize() { 34 | var db = getDatabase(); 35 | db.transaction( 36 | function(tx) { 37 | tx.executeSql('CREATE TABLE IF NOT EXISTS settings(setting TEXT UNIQUE, value TEXT)'); 38 | }); 39 | 40 | initialized = true; 41 | } 42 | 43 | function setSetting(setting, value) { 44 | if(!initialized) initialize(); 45 | 46 | var db = getDatabase(); 47 | var res = ""; 48 | db.transaction(function(tx) { 49 | var rs = tx.executeSql('INSERT OR REPLACE INTO settings VALUES (?,?);', [setting,value]); 50 | //console.log(rs.rowsAffected) 51 | if (rs.rowsAffected > 0) { 52 | res = "OK"; 53 | } else { 54 | res = "Error"; 55 | } 56 | } 57 | ); 58 | // The function returns “OK” if it was successful, or “Error” if it wasn't 59 | return res; 60 | } 61 | 62 | function getSetting(setting) { 63 | if(!initialized) initialize(); 64 | var db = getDatabase(); 65 | var res=""; 66 | db.transaction(function(tx) { 67 | var rs = tx.executeSql('SELECT value FROM settings WHERE setting=?;', [setting]); 68 | if (rs.rows.length > 0) { 69 | res = rs.rows.item(0).value; 70 | } else { 71 | res = undefined; 72 | } 73 | }) 74 | return res 75 | } 76 | 77 | function dropSettings(){ 78 | var db = getDatabase(); 79 | db.transaction( 80 | function(tx) { 81 | tx.executeSql('DROP TABLE settings'); 82 | }); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /app/qml/TerminalContainer.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.2 2 | import QtGraphicalEffects 1.0 3 | 4 | import "utils.js" as Utils 5 | 6 | ShaderTerminal { 7 | property alias title: terminal.title 8 | property alias terminalSize: terminal.terminalSize 9 | 10 | id: mainShader 11 | opacity: appSettings.windowOpacity * 0.3 + 0.7 12 | 13 | source: terminal.mainSource 14 | burnInEffect: terminal.burnInEffect 15 | slowBurnInEffect: terminal.slowBurnInEffect 16 | virtual_resolution: terminal.virtualResolution 17 | 18 | TimeManager{ 19 | id: timeManager 20 | enableTimer: terminalWindow.visible 21 | } 22 | 23 | PreprocessedTerminal{ 24 | id: terminal 25 | anchors.fill: parent 26 | } 27 | 28 | // EFFECTS //////////////////////////////////////////////////////////////// 29 | 30 | Loader{ 31 | id: bloomEffectLoader 32 | active: appSettings.bloom 33 | asynchronous: true 34 | width: parent.width * appSettings.bloomQuality 35 | height: parent.height * appSettings.bloomQuality 36 | 37 | sourceComponent: FastBlur{ 38 | radius: Utils.lint(16, 64, appSettings.bloomQuality); 39 | source: terminal.mainSource 40 | transparentBorder: true 41 | } 42 | } 43 | Loader{ 44 | id: bloomSourceLoader 45 | active: appSettings.bloom !== 0 46 | asynchronous: true 47 | sourceComponent: ShaderEffectSource{ 48 | id: _bloomEffectSource 49 | sourceItem: bloomEffectLoader.item 50 | hideSource: true 51 | smooth: true 52 | visible: false 53 | } 54 | } 55 | 56 | bloomSource: bloomSourceLoader.item 57 | 58 | // NewTerminalFrame { 59 | // id: terminalFrame 60 | // anchors.fill: parent 61 | // blending: true 62 | // } 63 | 64 | // This shader might be useful in the future. Since we used it only for a couple 65 | // of calculations is probably best to move those in the main shader. If in the future 66 | // we need to store another fullScreen channel this might be handy. 67 | 68 | // ShaderEffect { 69 | // id: rasterizationEffect 70 | // width: parent.width 71 | // height: parent.height 72 | // property real outColor: 0.0 73 | // property real dispX: (5 / width) * appSettings.windowScaling 74 | // property real dispY: (5 / height) * appSettings.windowScaling 75 | // property size virtual_resolution: terminal.virtualResolution 76 | 77 | // blending: false 78 | 79 | // fragmentShader: 80 | // "uniform lowp float qt_Opacity;" + 81 | 82 | // "varying highp vec2 qt_TexCoord0; 83 | // uniform highp vec2 virtual_resolution; 84 | // uniform highp float dispX; 85 | // uniform highp float dispY; 86 | // uniform mediump float outColor; 87 | 88 | // highp float getScanlineIntensity(vec2 coords) { 89 | // highp float result = 1.0;" + 90 | 91 | // (appSettings.rasterization != appSettings.no_rasterization ? 92 | // "result *= abs(sin(coords.y * virtual_resolution.y * "+Math.PI+"));" : "") + 93 | // (appSettings.rasterization == appSettings.pixel_rasterization ? 94 | // "result *= abs(sin(coords.x * virtual_resolution.x * "+Math.PI+"));" : "") + " 95 | 96 | // return result; 97 | // }" + 98 | 99 | // "void main() {" + 100 | // "highp float color = getScanlineIntensity(qt_TexCoord0);" + 101 | 102 | // "float distance = length(vec2(0.5) - qt_TexCoord0);" + 103 | // "color = mix(color, 0.0, 1.2 * distance * distance);" + 104 | 105 | // "color *= outColor + smoothstep(0.00, dispX, qt_TexCoord0.x) * (1.0 - outColor);" + 106 | // "color *= outColor + smoothstep(0.00, dispY, qt_TexCoord0.y) * (1.0 - outColor);" + 107 | // "color *= outColor + (1.0 - smoothstep(1.00 - dispX, 1.00, qt_TexCoord0.x)) * (1.0 - outColor);" + 108 | // "color *= outColor + (1.0 - smoothstep(1.00 - dispY, 1.00, qt_TexCoord0.y)) * (1.0 - outColor);" + 109 | 110 | // "gl_FragColor.a = color;" + 111 | // "}" 112 | 113 | // onStatusChanged: if (log) console.log(log) //Print warning messages 114 | // } 115 | 116 | // rasterizationSource: ShaderEffectSource{ 117 | // id: rasterizationEffectSource 118 | // sourceItem: rasterizationEffect 119 | // hideSource: true 120 | // smooth: true 121 | // wrapMode: ShaderEffectSource.ClampToEdge 122 | // visible: false 123 | // } 124 | } 125 | -------------------------------------------------------------------------------- /app/qml/TimeManager.qml: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2013 "Filippo Scognamiglio" 3 | * https://github.com/Swordfish90/cool-retro-term 4 | * 5 | * This file is part of cool-retro-term. 6 | * 7 | * cool-retro-term is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 | *******************************************************************************/ 20 | 21 | import QtQuick 2.2 22 | 23 | Timer{ 24 | default property bool enableTimer: false 25 | property real step: interval / 1000 26 | property real time 27 | 28 | NumberAnimation on time { 29 | from: 0 30 | to: 100000 31 | running: appSettings.fps === 0 && enableTimer 32 | duration: 100000 33 | loops: Animation.Infinite 34 | } 35 | 36 | onTriggered: time += step 37 | running: appSettings.fps !== 0 && enableTimer 38 | interval: Math.round(1000 / appSettings.fps) 39 | repeat: true 40 | } 41 | -------------------------------------------------------------------------------- /app/qml/fonts/1971-ibm-3278/3270Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/qml/fonts/1971-ibm-3278/3270Medium.ttf -------------------------------------------------------------------------------- /app/qml/fonts/1971-ibm-3278/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2017, Ricardo Banffy. 2 | Copyright (c) 1993-2011, Paul Mattes. 3 | Copyright (c) 2004-2005, Don Russell. 4 | Copyright (c) 2004, Dick Altenbern. 5 | Copyright (c) 1990, Jeff Sparkes. 6 | Copyright (c) 1989, Georgia Tech Research Corporation (GTRC), Atlanta, GA 30332. 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions are 11 | met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, 14 | this list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | * Neither the name of Ricardo Banffy, Paul Mattes, Don Russell, 21 | Dick Altenbern, Jeff Sparkes, GTRC nor the names of their contributors 22 | may be used to endorse or promote products derived from this software 23 | without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 26 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 27 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 28 | IN NO EVENT SHALL RICARDO BANFFY, PAUL MATTES, DON RUSSELL, DICK ALTENBERN, JEFF 29 | SPARKES OR GTRC BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 30 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 31 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 33 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | 36 | The Debian Logo glyph is based on the Debian Open Use Logo and is 37 | Copyright (c) 1999 Software in the Public Interest, Inc., and it is 38 | incorporated here under the terms of the Creative Commons 39 | Attribution-ShareAlike 3.0 Unported License. The logo is released 40 | under the terms of the GNU Lesser General Public License, version 3 or 41 | any later version, or, at your option, of the Creative Commons 42 | Attribution-ShareAlike 3.0 Unported License. 43 | 44 | Ubuntu, the Ubuntu logo and the Circle of Friends symbol are 45 | registered trademarks of Canonical Ltd. 46 | 47 | The Fontforge SFD font description file is optionally licensed under 48 | the SIL Open Font License v1.1 with no Reserved Font Name. This 49 | license is available with a FAQ at http://scripts.sil.org/OFL. 50 | -------------------------------------------------------------------------------- /app/qml/fonts/1977-apple2/FreeLicense.txt: -------------------------------------------------------------------------------- 1 | KREATIVE SOFTWARE RELAY FONTS FREE USE LICENSE 2 | version 1.2f 3 | 4 | Permission is hereby granted, free of charge, to any person or entity (the "User") obtaining a copy of the included font files (the "Software") produced by Kreative Software, to utilize, display, embed, or redistribute the Software, subject to the following conditions: 5 | 6 | 1. The User may not sell copies of the Software for a fee. 7 | 8 | 1a. The User may give away copies of the Software free of charge provided this license and any documentation is included verbatim and credit is given to Kreative Korporation or Kreative Software. 9 | 10 | 2. The User may not modify, reverse-engineer, or create any derivative works of the Software. 11 | 12 | 3. Any Software carrying the following font names or variations thereof is not covered by this license and may not be used under the terms of this license: Jewel Hill, Miss Diode n Friends, This is Beckie's font! 13 | 14 | 3a. Any Software carrying a font name ending with the string "Pro CE" is not covered by this license and may not be used under the terms of this license. 15 | 16 | 4. This license becomes null and void if any of the above conditions are not met. 17 | 18 | 5. Kreative Software reserves the right to change this license at any time without notice. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE SOFTWARE OR FROM OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /app/qml/fonts/1977-apple2/PRNumber3.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/qml/fonts/1977-apple2/PRNumber3.ttf -------------------------------------------------------------------------------- /app/qml/fonts/1977-apple2/PrintChar21.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/qml/fonts/1977-apple2/PrintChar21.ttf -------------------------------------------------------------------------------- /app/qml/fonts/1977-commodore-pet/FreeLicense.txt: -------------------------------------------------------------------------------- 1 | KREATIVE SOFTWARE RELAY FONTS FREE USE LICENSE 2 | version 1.2f 3 | 4 | Permission is hereby granted, free of charge, to any person or entity (the "User") obtaining a copy of the included font files (the "Software") produced by Kreative Software, to utilize, display, embed, or redistribute the Software, subject to the following conditions: 5 | 6 | 1. The User may not sell copies of the Software for a fee. 7 | 8 | 1a. The User may give away copies of the Software free of charge provided this license and any documentation is included verbatim and credit is given to Kreative Korporation or Kreative Software. 9 | 10 | 2. The User may not modify, reverse-engineer, or create any derivative works of the Software. 11 | 12 | 3. Any Software carrying the following font names or variations thereof is not covered by this license and may not be used under the terms of this license: Jewel Hill, Miss Diode n Friends, This is Beckie's font! 13 | 14 | 3a. Any Software carrying a font name ending with the string "Pro CE" is not covered by this license and may not be used under the terms of this license. 15 | 16 | 4. This license becomes null and void if any of the above conditions are not met. 17 | 18 | 5. Kreative Software reserves the right to change this license at any time without notice. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE SOFTWARE OR FROM OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /app/qml/fonts/1977-commodore-pet/PetMe.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/qml/fonts/1977-commodore-pet/PetMe.ttf -------------------------------------------------------------------------------- /app/qml/fonts/1979-atari-400-800/AtariClassic-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/qml/fonts/1979-atari-400-800/AtariClassic-Regular.ttf -------------------------------------------------------------------------------- /app/qml/fonts/1979-atari-400-800/Read Me.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/qml/fonts/1979-atari-400-800/Read Me.pdf -------------------------------------------------------------------------------- /app/qml/fonts/1981-ibm-pc/PxPlus_IBM_BIOS.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/qml/fonts/1981-ibm-pc/PxPlus_IBM_BIOS.ttf -------------------------------------------------------------------------------- /app/qml/fonts/1982-commodore64/C64_Pro_Mono-STYLE.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/qml/fonts/1982-commodore64/C64_Pro_Mono-STYLE.ttf -------------------------------------------------------------------------------- /app/qml/fonts/1982-commodore64/license.txt: -------------------------------------------------------------------------------- 1 | 2 | Fonts in this package are (c) 2010-2014 Style. 3 | 4 | This license is applicable to each font file included in this package in all their variants (ttf, eot, woff, woff2, svg). 5 | 6 | You MAY NOT: sell this font; include/redistribute the font in any font collection regardless of pricing; provide the font for direct download from any web site, modify or rename the font. You MAY: link to "http://style64.org/c64-truetype" in order for others to download and install the font; embed the font (without any modification or file renaming) for display on any web site using @font-face rules; use this font in static images and vector art; include this font (without any modification or file renaming) as part of a software package but ONLY if said software package is freely provided to end users. You may also contact us to negotiate a (possibly commercial) license for your use outside of these guidelines at "http://style64.org/contact-style". 7 | 8 | At all times the most recent version of this license can be found at "http://style64.org/c64-truetype/license". 9 | -------------------------------------------------------------------------------- /app/qml/fonts/1985-ibm-pc-vga/PxPlus_IBM_VGA8.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/qml/fonts/1985-ibm-pc-vga/PxPlus_IBM_VGA8.ttf -------------------------------------------------------------------------------- /app/qml/fonts/modern-fixedsys-excelsior/FSEX301-L2.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/qml/fonts/modern-fixedsys-excelsior/FSEX301-L2.ttf -------------------------------------------------------------------------------- /app/qml/fonts/modern-hermit/Hermit-bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/qml/fonts/modern-hermit/Hermit-bold.otf -------------------------------------------------------------------------------- /app/qml/fonts/modern-hermit/Hermit-light.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/qml/fonts/modern-hermit/Hermit-light.otf -------------------------------------------------------------------------------- /app/qml/fonts/modern-hermit/Hermit-medium.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/qml/fonts/modern-hermit/Hermit-medium.otf -------------------------------------------------------------------------------- /app/qml/fonts/modern-hermit/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Pablo Caro <me AT pcaro DOT es> - http://pcaro.es/ 2 | with Reserved Font Name Hermit. 3 | 4 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 5 | This license is copied below, and is also available with a FAQ at: 6 | http://scripts.sil.org/OFL 7 | 8 | 9 | ----------------------------------------------------------- 10 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 11 | ----------------------------------------------------------- 12 | 13 | PREAMBLE 14 | The goals of the Open Font License (OFL) are to stimulate worldwide 15 | development of collaborative font projects, to support the font creation 16 | efforts of academic and linguistic communities, and to provide a free and 17 | open framework in which fonts may be shared and improved in partnership 18 | with others. 19 | 20 | The OFL allows the licensed fonts to be used, studied, modified and 21 | redistributed freely as long as they are not sold by themselves. The 22 | fonts, including any derivative works, can be bundled, embedded, 23 | redistributed and/or sold with any software provided that any reserved 24 | names are not used by derivative works. The fonts and derivatives, 25 | however, cannot be released under any other type of license. The 26 | requirement for fonts to remain under this license does not apply 27 | to any document created using the fonts or their derivatives. 28 | 29 | DEFINITIONS 30 | "Font Software" refers to the set of files released by the Copyright 31 | Holder(s) under this license and clearly marked as such. This may 32 | include source files, build scripts and documentation. 33 | 34 | "Reserved Font Name" refers to any names specified as such after the 35 | copyright statement(s). 36 | 37 | "Original Version" refers to the collection of Font Software components as 38 | distributed by the Copyright Holder(s). 39 | 40 | "Modified Version" refers to any derivative made by adding to, deleting, 41 | or substituting -- in part or in whole -- any of the components of the 42 | Original Version, by changing formats or by porting the Font Software to a 43 | new environment. 44 | 45 | "Author" refers to any designer, engineer, programmer, technical 46 | writer or other person who contributed to the Font Software. 47 | 48 | PERMISSION & CONDITIONS 49 | Permission is hereby granted, free of charge, to any person obtaining 50 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 51 | redistribute, and sell modified and unmodified copies of the Font 52 | Software, subject to the following conditions: 53 | 54 | 1) Neither the Font Software nor any of its individual components, 55 | in Original or Modified Versions, may be sold by itself. 56 | 57 | 2) Original or Modified Versions of the Font Software may be bundled, 58 | redistributed and/or sold with any software, provided that each copy 59 | contains the above copyright notice and this license. These can be 60 | included either as stand-alone text files, human-readable headers or 61 | in the appropriate machine-readable metadata fields within text or 62 | binary files as long as those fields can be easily viewed by the user. 63 | 64 | 3) No Modified Version of the Font Software may use the Reserved Font 65 | Name(s) unless explicit written permission is granted by the corresponding 66 | Copyright Holder. This restriction only applies to the primary font name as 67 | presented to the users. 68 | 69 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 70 | Software shall not be used to promote, endorse or advertise any 71 | Modified Version, except to acknowledge the contribution(s) of the 72 | Copyright Holder(s) and the Author(s) or with their explicit written 73 | permission. 74 | 75 | 5) The Font Software, modified or unmodified, in part or in whole, 76 | must be distributed entirely under this license, and must not be 77 | distributed under any other license. The requirement for fonts to 78 | remain under this license does not apply to any document created 79 | using the Font Software. 80 | 81 | TERMINATION 82 | This license becomes null and void if any of the above conditions are 83 | not met. 84 | 85 | DISCLAIMER 86 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 87 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 88 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 89 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 90 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 91 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 92 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 93 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 94 | OTHER DEALINGS IN THE FONT SOFTWARE. 95 | -------------------------------------------------------------------------------- /app/qml/fonts/modern-inconsolata/Inconsolata.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/qml/fonts/modern-inconsolata/Inconsolata.otf -------------------------------------------------------------------------------- /app/qml/fonts/modern-pro-font-win-tweaked/._LICENSE: -------------------------------------------------------------------------------- 1 | ������������������������ ���&��� ����TxMt������������������������ -------------------------------------------------------------------------------- /app/qml/fonts/modern-pro-font-win-tweaked/._readme.txt: -------------------------------------------------------------------------------- 1 | ������������������������ ���&��� ����TxMt������������������������ -------------------------------------------------------------------------------- /app/qml/fonts/modern-pro-font-win-tweaked/Comments for ProFontWindows: -------------------------------------------------------------------------------- 1 | dopustz:-480 -------------------------------------------------------------------------------- /app/qml/fonts/modern-pro-font-win-tweaked/LICENSE: -------------------------------------------------------------------------------- 1 | ProFont 2 | MIT License 3 | 4 | Copyright (c) 2014 Carl Osterwald, Stephen C. Gilardi, Andrew Welch 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. -------------------------------------------------------------------------------- /app/qml/fonts/modern-pro-font-win-tweaked/ProFontWindows.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/qml/fonts/modern-pro-font-win-tweaked/ProFontWindows.ttf -------------------------------------------------------------------------------- /app/qml/fonts/modern-pro-font-win-tweaked/readme.txt: -------------------------------------------------------------------------------- 1 | WHAT IS THIS? 2 | 3 | This is ProFont TrueType, converted to Windows TrueType format 4 | by Mike Smith, with some tweaks added by "ardu". 5 | 6 | Modifications include: 7 | - A Euro character 8 | - Missing characters from the Latin 1 code page 9 | - Full support for CodePage 850. These are mostly the famous 10 | block/box characters you know from DOS. Very useful if you use 11 | Mightnight Commander through PuTTY. 12 | - Fixed metrics so that point size of 9 works correctly. Until now 13 | you had to select 7 to obtain the native point size of 9. 14 | - Added some quick&dirty hinting for point size of 9. Most characters 15 | now match closely the look of the bitmap version. 16 | Don't expect it to look good on anything else than Windows... 17 | 18 | 19 | 20 | To get the full original Distribution, other ProFont builds 21 | and more information 22 | go to <http://tobiasjung.name/profont/> 23 | 24 | 25 | DISCLAIMER 26 | See LICENSE file 27 | 28 | 29 | Tobias Jung 30 | January 2014 31 | profont@tobiasjung.name 32 | -------------------------------------------------------------------------------- /app/qml/fonts/modern-proggy-tiny/Licence.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004, 2005 Tristan Grimmer 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /app/qml/fonts/modern-proggy-tiny/ProggyTiny.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/qml/fonts/modern-proggy-tiny/ProggyTiny.ttf -------------------------------------------------------------------------------- /app/qml/fonts/modern-terminus/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Dimitar Toshkov Zhekov, 2 | with Reserved Font Name "Terminus Font". 3 | 4 | Copyright (c) 2011 Tilman Blumenbach, 5 | with Reserved Font Name "Terminus (TTF)". 6 | 7 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 8 | This license is copied below, and is also available with a FAQ at: 9 | http://scripts.sil.org/OFL 10 | 11 | 12 | ----------------------------------------------------------- 13 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 14 | ----------------------------------------------------------- 15 | 16 | PREAMBLE 17 | The goals of the Open Font License (OFL) are to stimulate worldwide 18 | development of collaborative font projects, to support the font creation 19 | efforts of academic and linguistic communities, and to provide a free and 20 | open framework in which fonts may be shared and improved in partnership 21 | with others. 22 | 23 | The OFL allows the licensed fonts to be used, studied, modified and 24 | redistributed freely as long as they are not sold by themselves. The 25 | fonts, including any derivative works, can be bundled, embedded, 26 | redistributed and/or sold with any software provided that any reserved 27 | names are not used by derivative works. The fonts and derivatives, 28 | however, cannot be released under any other type of license. The 29 | requirement for fonts to remain under this license does not apply 30 | to any document created using the fonts or their derivatives. 31 | 32 | DEFINITIONS 33 | "Font Software" refers to the set of files released by the Copyright 34 | Holder(s) under this license and clearly marked as such. This may 35 | include source files, build scripts and documentation. 36 | 37 | "Reserved Font Name" refers to any names specified as such after the 38 | copyright statement(s). 39 | 40 | "Original Version" refers to the collection of Font Software components as 41 | distributed by the Copyright Holder(s). 42 | 43 | "Modified Version" refers to any derivative made by adding to, deleting, 44 | or substituting -- in part or in whole -- any of the components of the 45 | Original Version, by changing formats or by porting the Font Software to a 46 | new environment. 47 | 48 | "Author" refers to any designer, engineer, programmer, technical 49 | writer or other person who contributed to the Font Software. 50 | 51 | PERMISSION & CONDITIONS 52 | Permission is hereby granted, free of charge, to any person obtaining 53 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 54 | redistribute, and sell modified and unmodified copies of the Font 55 | Software, subject to the following conditions: 56 | 57 | 1) Neither the Font Software nor any of its individual components, 58 | in Original or Modified Versions, may be sold by itself. 59 | 60 | 2) Original or Modified Versions of the Font Software may be bundled, 61 | redistributed and/or sold with any software, provided that each copy 62 | contains the above copyright notice and this license. These can be 63 | included either as stand-alone text files, human-readable headers or 64 | in the appropriate machine-readable metadata fields within text or 65 | binary files as long as those fields can be easily viewed by the user. 66 | 67 | 3) No Modified Version of the Font Software may use the Reserved Font 68 | Name(s) unless explicit written permission is granted by the corresponding 69 | Copyright Holder. This restriction only applies to the primary font name as 70 | presented to the users. 71 | 72 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 73 | Software shall not be used to promote, endorse or advertise any 74 | Modified Version, except to acknowledge the contribution(s) of the 75 | Copyright Holder(s) and the Author(s) or with their explicit written 76 | permission. 77 | 78 | 5) The Font Software, modified or unmodified, in part or in whole, 79 | must be distributed entirely under this license, and must not be 80 | distributed under any other license. The requirement for fonts to 81 | remain under this license does not apply to any document created 82 | using the Font Software. 83 | 84 | TERMINATION 85 | This license becomes null and void if any of the above conditions are 86 | not met. 87 | 88 | DISCLAIMER 89 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 90 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 91 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 92 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 93 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 94 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 95 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 96 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 97 | OTHER DEALINGS IN THE FONT SOFTWARE. 98 | -------------------------------------------------------------------------------- /app/qml/fonts/modern-terminus/TerminusTTF-4.46.0.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/qml/fonts/modern-terminus/TerminusTTF-4.46.0.ttf -------------------------------------------------------------------------------- /app/qml/images/allNoise512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/qml/images/allNoise512.png -------------------------------------------------------------------------------- /app/qml/images/crt256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swordfish90/crt-live-coding/8054ea9f1905d705911bf9ea1d358b3252cbe449/app/qml/images/crt256.png -------------------------------------------------------------------------------- /app/qml/resources.qrc: -------------------------------------------------------------------------------- 1 | <RCC> 2 | <qresource prefix="/"> 3 | <file>SizeOverlay.qml</file> 4 | <file>ShaderTerminal.qml</file> 5 | <file>CheckableSlider.qml</file> 6 | <file>ApplicationSettings.qml</file> 7 | <file>SettingsWindow.qml</file> 8 | <file>Fonts.qml</file> 9 | <file>FontPixels.qml</file> 10 | <file>SettingsGeneralTab.qml</file> 11 | <file>PreprocessedTerminal.qml</file> 12 | <file>TimeManager.qml</file> 13 | <file>SimpleSlider.qml</file> 14 | <file>ColorButton.qml</file> 15 | <file>Glossy.qml</file> 16 | <file>AboutDialog.qml</file> 17 | <file>InsertNameDialog.qml</file> 18 | <file>SettingsEffectsTab.qml</file> 19 | <file>main.qml</file> 20 | <file>SettingsTerminalTab.qml</file> 21 | <file>FontScanlines.qml</file> 22 | <file>fonts/1977-apple2/PrintChar21.ttf</file> 23 | <file>fonts/1971-ibm-3278/3270Medium.ttf</file> 24 | <file>Storage.qml</file> 25 | <file>CRTMainMenuBar.qml</file> 26 | <file>SettingsAdvancedTab.qml</file> 27 | <file>TerminalContainer.qml</file> 28 | <file>images/crt256.png</file> 29 | <file>utils.js</file> 30 | <file>images/allNoise512.png</file> 31 | <file>fonts/modern-proggy-tiny/ProggyTiny.ttf</file> 32 | <file>fonts/modern-pro-font-win-tweaked/ProFontWindows.ttf</file> 33 | <file>fonts/modern-hermit/Hermit-medium.otf</file> 34 | <file>fonts/modern-inconsolata/Inconsolata.otf</file> 35 | <file>fonts/modern-fixedsys-excelsior/FSEX301-L2.ttf</file> 36 | <file>../icons/32x32/cool-retro-term.png</file> 37 | <file>Components/SizedLabel.qml</file> 38 | <file>fonts/1979-atari-400-800/AtariClassic-Regular.ttf</file> 39 | <file>fonts/1982-commodore64/C64_Pro_Mono-STYLE.ttf</file> 40 | <file>fonts/1981-ibm-pc/PxPlus_IBM_BIOS.ttf</file> 41 | <file>fonts/1985-ibm-pc-vga/PxPlus_IBM_VGA8.ttf</file> 42 | <file>fonts/1977-commodore-pet/PetMe.ttf</file> 43 | <file>BurnInEffect.qml</file> 44 | <file>fonts/modern-terminus/TerminusTTF-4.46.0.ttf</file> 45 | <file>SlowBurnIn.qml</file> 46 | <file>Effects/Plasma.qml</file> 47 | <file>Effects/Tunnel.qml</file> 48 | <file>Effects/CircleEQ.qml</file> 49 | <file>Effects/Tiles.qml</file> 50 | </qresource> 51 | </RCC> 52 | -------------------------------------------------------------------------------- /app/qml/utils.js: -------------------------------------------------------------------------------- 1 | .pragma library 2 | function clamp(x, min, max) { 3 | if (x <= min) 4 | return min; 5 | if (x >= max) 6 | return max; 7 | return x; 8 | } 9 | function lint(a, b, t) { 10 | return (1 - t) * a + (t) * b; 11 | } 12 | function mix(c1, c2, alpha){ 13 | return Qt.rgba(c1.r * alpha + c2.r * (1-alpha), 14 | c1.g * alpha + c2.g * (1-alpha), 15 | c1.b * alpha + c2.b * (1-alpha), 16 | c1.a * alpha + c2.a * (1-alpha)) 17 | } 18 | function strToColor(s){ 19 | var r = parseInt(s.substring(1,3), 16) / 256; 20 | var g = parseInt(s.substring(3,5), 16) / 256; 21 | var b = parseInt(s.substring(5,7), 16) / 256; 22 | return Qt.rgba(r, g, b, 1.0); 23 | } 24 | 25 | /* Tokenizes a command into program and arguments, taking into account quoted 26 | * strings and backslashes. 27 | * Based on GLib's tokenizer, used by Gnome Terminal 28 | */ 29 | function tokenizeCommandLine(s){ 30 | var args = []; 31 | var currentToken = ""; 32 | var quoteChar = ""; 33 | var escaped = false; 34 | var nextToken = function() { 35 | args.push(currentToken); 36 | currentToken = ""; 37 | } 38 | var appendToCurrentToken = function(c) { 39 | currentToken += c; 40 | } 41 | 42 | for (var i = 0; i < s.length; i++) { 43 | 44 | // char followed by backslash, append literally 45 | if (escaped) { 46 | escaped = false; 47 | appendToCurrentToken(s[i]); 48 | 49 | // char inside quotes, either close or append 50 | } else if (quoteChar) { 51 | escaped = s[i] === '\\'; 52 | if (quoteChar === s[i]) { 53 | quoteChar = ""; 54 | nextToken(); 55 | } else if (!escaped) { 56 | appendToCurrentToken(s[i]); 57 | } 58 | 59 | // regular char 60 | } else { 61 | escaped = s[i] === '\\'; 62 | switch (s[i]) { 63 | case '\\': 64 | // begin escape 65 | break; 66 | case '\n': 67 | // newlines always delimits 68 | nextToken(); 69 | break; 70 | case ' ': 71 | case '\t': 72 | // delimit on new whitespace 73 | if (currentToken) { 74 | nextToken(); 75 | } 76 | break; 77 | case '\'': 78 | case '"': 79 | // begin quoted section 80 | quoteChar = s[i]; 81 | break; 82 | default: 83 | appendToCurrentToken(s[i]); 84 | } 85 | } 86 | } 87 | 88 | // ignore last token if broken quotes/backslash 89 | if (currentToken && !escaped && !quoteChar) { 90 | nextToken(); 91 | } 92 | 93 | return args; 94 | } 95 | -------------------------------------------------------------------------------- /app/scoscdataprovider.cpp: -------------------------------------------------------------------------------- 1 | #include "scoscdataprovider.h" 2 | #include <QDebug> 3 | 4 | SCOSCDataProvider::SCOSCDataProvider(QObject *parent) : QObject(parent), 5 | oscReceiver(new QOSCReceiver(7089, this)) 6 | { 7 | connect(oscReceiver, SIGNAL(messageReceived(QOSCMessage*)), this, SLOT(onMessageReceived(QOSCMessage*))); 8 | oscReceiver->start(); 9 | } 10 | 11 | void SCOSCDataProvider::onMessageReceived(QOSCMessage* message) 12 | { 13 | // qDebug() << "Message received!"; 14 | //qDebug() << message->getAddress(); 15 | 16 | if (message->getAddress() == "/scdata") { 17 | float loud = message->getArgumentAsFloat(1); 18 | float flat = message->getArgumentAsFloat(3); 19 | float centroid = message->getArgumentAsFloat(5); 20 | 21 | float pw0 = message->getArgumentAsFloat(7); 22 | float pw1 = message->getArgumentAsFloat(8); 23 | float pw2 = message->getArgumentAsFloat(9); 24 | float pw3 = message->getArgumentAsFloat(10); 25 | float pw4 = message->getArgumentAsFloat(11); 26 | float pw5 = message->getArgumentAsFloat(12); 27 | float pw6 = message->getArgumentAsFloat(13); 28 | float pw7 = message->getArgumentAsFloat(14); 29 | 30 | QVector<qreal> pwdata {pw0, pw1, pw2, pw3, pw4, pw5, pw6, pw7}; 31 | 32 | emit newData(loud, flat, centroid, pwdata); 33 | } 34 | 35 | // if (message->getAddress() == "/debug/loud") { 36 | // float loudness = message->getArgumentAsFloat(0); 37 | // emit newLoudness(loudness); 38 | // } 39 | 40 | // if (message->getAddress() == "/s_new") { 41 | // if (message->isStringArgument(0)) { 42 | // if (message->getArgumentAsString(0) == "makeSound" || message->getArgumentAsString(0) == "startSound") 43 | // return; 44 | 45 | // if (message->getArgumentAsString(0).startsWith("play") && message->isFloatArgument(11)) { 46 | // emit newSampleSound(message->getArgumentAsFloat(11), extractAmplitudeFromMessage(message)); 47 | // } else { 48 | // emit newSynthSound(message->getArgumentAsString(0), extractAmplitudeFromMessage(message)); 49 | // } 50 | // } 51 | // } 52 | 53 | //// Print every argument 54 | // for (int i = 0; i < message->getSize(); i++){ 55 | // if(message->isIntArgument(i)) 56 | // { 57 | // qDebug()<<"arg int"<<i<<message->getArgumentAsInt(i); 58 | // } 59 | // else if(message->isStringArgument(i)) 60 | // { 61 | // qDebug()<<"arg str"<<i<<message->getArgumentAsString(i); 62 | // } 63 | // else if(message->isBoolArgument(i)) 64 | // { 65 | // qDebug()<<"arg bool"<<i<<message->getArgumentAsBool(i); 66 | // } 67 | // else if(message->isFloatArgument(i)) 68 | // { 69 | // qDebug()<<"arg float"<<i<<message->getArgumentAsFloat(i); 70 | // } 71 | // } 72 | } 73 | -------------------------------------------------------------------------------- /app/scoscdataprovider.h: -------------------------------------------------------------------------------- 1 | #ifndef SCOSCDATAPROVIDER_H 2 | #define SCOSCDATAPROVIDER_H 3 | 4 | #include <QObject> 5 | #include "QOSC/src/qoscreceiver.h" 6 | #include "QOSC/src/qoscmessage.h" 7 | 8 | class SCOSCDataProvider : public QObject 9 | { 10 | Q_OBJECT 11 | public: 12 | explicit SCOSCDataProvider(QObject *parent = nullptr); 13 | 14 | signals: 15 | void newData(float loud, float flat, float centroid, QVector<qreal> eqm); 16 | 17 | public slots: 18 | void onMessageReceived(QOSCMessage* message); 19 | 20 | private: 21 | QOSCReceiver* oscReceiver; 22 | }; 23 | 24 | #endif // SCOSCDATAPROVIDER_H 25 | -------------------------------------------------------------------------------- /cool-retro-term.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Comment=Use the command line the old way 3 | Exec=cool-retro-term 4 | GenericName=Terminal emulator 5 | Icon=cool-retro-term 6 | Name=Cool Retro Term 7 | Categories=System;TerminalEmulator; 8 | StartupNotify=true 9 | Terminal=false 10 | Type=Application 11 | Keywords=shell;prompt;command;commandline; 12 | -------------------------------------------------------------------------------- /crt-live-coding.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | CONFIG += ordered 4 | 5 | SUBDIRS += qmltermwidget 6 | SUBDIRS += app 7 | 8 | desktop.files += cool-retro-term.desktop 9 | desktop.path += /usr/share/applications 10 | 11 | INSTALLS += desktop 12 | -------------------------------------------------------------------------------- /foxdot-server.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | import argparse 4 | import socket 5 | from contextlib import closing 6 | from threading import Thread, Lock 7 | 8 | from FoxDot import * 9 | 10 | DEFAULT_PORT = 7088 11 | 12 | _env = None 13 | lock = Lock() 14 | 15 | def main(): 16 | """ Run a FoxDot process and listen for input on a socket """ 17 | global _env 18 | parser = argparse.ArgumentParser(description=main.__doc__) 19 | parser.add_argument('-l', action='append', nargs='*', 20 | help="library to load") 21 | parser.add_argument('-p', type=int, default=DEFAULT_PORT, 22 | help="port (default %(default)s)") 23 | args = parser.parse_args() 24 | 25 | serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 26 | serversocket.bind(('localhost', args.p)) 27 | serversocket.listen(0) 28 | 29 | # This should be enabled to see foxdot messages and use those for visualization 30 | # my_client = OSCClient() 31 | # my_client.connect( ("localhost", DEFAULT_VISUALIZATION_PORT) ) 32 | # Server.forward = my_client 33 | 34 | _env = FoxDotCode() 35 | if args.l: 36 | for arg in args.l: 37 | for fname in arg: 38 | with open(fname, 'r') as ifile: 39 | execute(ifile.read(), verbose=False) 40 | print("Listening on port %d" % args.p) 41 | 42 | while True: 43 | connection, address = serversocket.accept() 44 | handler = Thread(target=handle_connection, args=(connection,)) 45 | handler.start() 46 | 47 | def execute(code, verbose=True): 48 | with lock: 49 | return _env(code, verbose=verbose) 50 | 51 | 52 | def handle_connection(connection): 53 | with closing(connection): 54 | chunks = [] 55 | while True: 56 | buf = connection.recv(4096) 57 | if not buf: 58 | break 59 | chunks.append(buf) 60 | if chunks: 61 | merged = str(b''.join(chunks), "utf-8") 62 | ret = execute(merged) 63 | # connection.send(ret.encode()) 64 | 65 | if __name__ == '__main__': 66 | main() 67 | -------------------------------------------------------------------------------- /packaging/appdata/cool-retro-term.appdata.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <!-- Copyright 2014 Markus S. <kamikazow@web.de> --> 3 | <component type="desktop"> 4 | <id>cool-retro-term.desktop</id> 5 | <metadata_license>MIT</metadata_license> 6 | <project_license>GPL-3.0+</project_license> 7 | <name>Cool Retro Term</name> 8 | <summary>Terminal emulator with an old school look and feel</summary> 9 | 10 | <description> 11 | <p> 12 | cool-retro-term is a terminal emulator which tries to mimic the look and feel of the old cathode tube screens. It has been designed to be eye-candy, customizable, and reasonably lightweight. 13 | </p> 14 | </description> 15 | 16 | <screenshots> 17 | <screenshot type="default"> 18 | <caption>Default amber look</caption> 19 | <image width="1022" height="791">https://camo.githubusercontent.com/2443e662e95733ba6ae331f391f6ec036d1ee7fd/687474703a2f2f692e696d6775722e636f6d2f4e5566766e6c752e706e67</image> 20 | </screenshot> 21 | <screenshot> 22 | <caption>Apple II look</caption> 23 | <image width="1024" height="796">https://camo.githubusercontent.com/44a19842d532555c7b02bf6b4b4684add9edf18c/687474703a2f2f692e696d6775722e636f6d2f4d4d6d4d3648742e706e67</image> 24 | </screenshot> 25 | </screenshots> 26 | 27 | <url type="homepage">https://github.com/Swordfish90/cool-retro-term</url> 28 | 29 | <provides> 30 | <binary>cool-retro-term</binary> 31 | </provides> 32 | 33 | <releases> 34 | <release version="0.9" timestamp="1410447866"> 35 | <description> 36 | <p>First release</p> 37 | </description> 38 | </release> 39 | </releases> 40 | </component> 41 | -------------------------------------------------------------------------------- /packaging/debian/.gitignore: -------------------------------------------------------------------------------- 1 | /*.debhelper.log 2 | /*.substvars 3 | /cool-retro-term/ 4 | /files 5 | -------------------------------------------------------------------------------- /packaging/debian/changelog: -------------------------------------------------------------------------------- 1 | cool-retro-term (0.9-1) UNRELEASED; urgency=medium 2 | 3 | * Initial release. (Closes: #758238) 4 | 5 | -- Jeka Der <jekader@gmail.com> Fri, 10 Oct 2014 19:58:29 +0200 6 | -------------------------------------------------------------------------------- /packaging/debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /packaging/debian/control: -------------------------------------------------------------------------------- 1 | Source: cool-retro-term 2 | Maintainer: Jeka Der <jekader@gmail.com> 3 | Section: x11 4 | Priority: optional 5 | Standards-Version: 3.9.6 6 | Homepage: https://github.com/Swordfish90/cool-retro-term 7 | Vcs-Git: git://github.com/barak/cool-retro-term.git 8 | Vcs-Browser: https://github.com/barak/cool-retro-term 9 | Build-Depends: debhelper (>= 9), qmlscene, 10 | qt5-qmake, qtdeclarative5-dev, qml-module-qtquick-controls, 11 | qml-module-qtgraphicaleffects, qml-module-qtquick-dialogs, 12 | qml-module-qtquick-localstorage, qml-module-qtquick-window2 13 | 14 | Package: cool-retro-term 15 | Architecture: any 16 | Replaces: cool-old-term 17 | Provides: x-terminal-emulator 18 | Depends: qml-module-qtquick-controls, qml-module-qtgraphicaleffects, 19 | qml-module-qtquick-dialogs, qml-module-qtquick-localstorage, 20 | qml-module-qtquick-window2, ${shlibs:Depends}, ${misc:Depends} 21 | Description: terminal emulator which mimics old screens 22 | cool-retro-term is a terminal emulator which mimics the look and feel 23 | of the old cathode tube screens. It has been designed to be eye-candy, 24 | customizable, and reasonably lightweight. 25 | -------------------------------------------------------------------------------- /packaging/debian/cool-retro-term.1: -------------------------------------------------------------------------------- 1 | .TH "COOL-RETRO-TERM" 1 "2017-11-06" 2 | .SH NAME 3 | cool\-retro\-term \- terminal emulator mimicking an old cathode display 4 | .SH SYNOPSIS 5 | \fBcool\-retro\-term\fR [\fIOPTIONS\fR] 6 | .br 7 | \fBcool\-retro\-term\fR [\fIOPTIONS\fR] -e \fICOMMAND\fR [\fIARGUMENT\fR...] 8 | .SH DESCRIPTION 9 | This manual page documents briefly the \fBcool\-retro\-term\fR command. 10 | .PP 11 | \fBcool\-retro\-term\fR is a terminal emulator which mimics the 12 | look and feel of the old cathode tube screens. 13 | It has been designed to be eye-candy, 14 | customizable, and reasonably lightweight. 15 | .SH OPTIONS 16 | .TP 17 | \fB\-\-default\-settings\fR 18 | Run with the default settings. 19 | .TP 20 | \fB\-e\fR \fICOMMAND\fR 21 | Command to execute. This should be used as the last option. 22 | All the arguments following \fICOMMAND\fR will be passed to said command. 23 | .TP 24 | \fB\-\-fullscreen\fR 25 | Run in fullscreen mode. 26 | .TP 27 | \fB\-h\fR, \fB\-\-help\fR 28 | Print a help screen and exit. 29 | .TP 30 | \fB\-p\fR \fIPROFILE\fR, \fB\-\-profile\fR \fIPROFILE\fR 31 | Run with the given profile. 32 | .TP 33 | \fB\-T\fR \fITITLE\fR 34 | Use \fITITLE\fR as the window title. 35 | .TP 36 | \fB\-\-verbose\fR 37 | Print additional information such as profiles and settings. 38 | .TP 39 | \fB\-v\fR, \fB\-\-version\fR 40 | Print the version number and exit. 41 | .TP 42 | \fB\-\-workdir\fR \fIDIR\fR 43 | Start with \fIDIR\fR as the working directory. 44 | .SH LICENCE 45 | This program is available under the terms of the GNU General Public License, 46 | version 3 or any later version, as published by the Free Software Foundation. 47 | -------------------------------------------------------------------------------- /packaging/debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: cool-retro-term 3 | Upstream-Contact: Filippo Scognamiglio <flscogna@gmail.com> 4 | Source: https://github.com/Swordfish90/cool-retro-term 5 | 6 | Files: * 7 | Copyright: 2013-2017 Filippo Scognamiglio 8 | License: GPL-3 9 | On Debian systems, the full text of the GNU General Public 10 | License version 3 can be found in the file 11 | `/usr/share/common-licenses/GPL-3'. 12 | -------------------------------------------------------------------------------- /packaging/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | %: 3 | dh $@ 4 | 5 | -------------------------------------------------------------------------------- /packaging/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /packaging/debian/watch: -------------------------------------------------------------------------------- 1 | version=4 2 | opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%<project>-$1.tar.gz%" \ 3 | https://github.com/Swordfish90/cool-retro-term/tags \ 4 | (?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate 5 | -------------------------------------------------------------------------------- /packaging/rpm/cool-retro-term.spec: -------------------------------------------------------------------------------- 1 | # 2 | # spec file for package cool-retro-term 3 | # 4 | # Copyright © 2014 Markus S. <kamikazow@web.de> 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. 18 | 19 | Name: cool-retro-term 20 | Summary: Cool Retro Terminal 21 | Version: 1.0 22 | Release: 0%{?dist} 23 | Group: System/X11/Terminals 24 | License: GPL-3.0+ 25 | URL: https://github.com/Swordfish90/cool-retro-term 26 | 27 | # For this spec file to work, the cool-retro-term sources must be located 28 | # in a directory named cool-retro-term-0.9 (with "0.9" being the version 29 | # number defined above). 30 | # If the sources are compressed in another format than .tar.xz, change the 31 | # file extension accordingly. 32 | Source0: %{name}-%{version}.tar.xz 33 | 34 | BuildRequires: pkgconfig(Qt5Core) 35 | BuildRequires: pkgconfig(Qt5Declarative) 36 | BuildRequires: pkgconfig(Qt5Gui) 37 | BuildRequires: pkgconfig(Qt5Quick) 38 | BuildRequires: desktop-file-utils 39 | 40 | # Package names only verified with Fedora and openSUSE. 41 | # Should the packages in your distro be named dirrerently, 42 | # see http://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto 43 | %if 0%{?fedora} 44 | Requires: qt5-qtbase 45 | Requires: qt5-qtbase-gui 46 | Requires: qt5-qtdeclarative 47 | Requires: qt5-qtgraphicaleffects 48 | Requires: qt5-qtquickcontrols 49 | %endif 50 | 51 | %if 0%{?suse_version} 52 | Requires: libqt5-qtquickcontrols 53 | Requires: libqt5-qtbase 54 | Requires: libQt5Gui5 55 | Requires: libqt5-qtdeclarative 56 | Requires: libqt5-qtgraphicaleffects 57 | %endif 58 | 59 | %description 60 | cool-retro-term is a terminal emulator which tries to mimic the look and feel 61 | of the old cathode tube screens. It has been designed to be eye-candy, 62 | customizable, and reasonably lightweight. 63 | 64 | %prep 65 | %setup -q 66 | 67 | %build 68 | qmake-qt5 69 | make %{?_smp_mflags} 70 | 71 | %install 72 | # Work around weird qmake behaviour: http://davmac.wordpress.com/2007/02/21/qts-qmake/ 73 | make INSTALL_ROOT=%{buildroot} install 74 | 75 | desktop-file-install \ 76 | --dir=${RPM_BUILD_ROOT}%{_datadir}/applications \ 77 | %{name}.desktop 78 | 79 | %files 80 | %defattr(-,root,root,-) 81 | %doc gpl-2.0.txt gpl-3.0.txt README.md 82 | %{_bindir}/%{name} 83 | %{_libdir}/qt5/qml/ 84 | %{_datadir}/applications/%{name}.desktop 85 | %{_datadir}/icons/hicolor/*/*/* 86 | 87 | %clean 88 | rm -rf %{buildroot} 89 | 90 | %changelog 91 | * Sun Sep 7 14:03:35 UTC 2014 - kamikazow@web.de 92 | - cool-old-term has been renamed to cool-retro-term 93 | - Ported the spec file to CRT's new, way nicer build system <https://github.com/Swordfish90/cool-retro-term/pull/105> 94 | 95 | * Fri Aug 29 20:56:20 UTC 2014 - kamikazow@web.de 96 | - Fixed: QtDeclarative-devel is required for "qmlscene" binary 97 | 98 | * Fri Aug 1 14:09:35 UTC 2014 - kamikazow@web.de 99 | - First build 100 | - cool-old-term 0.9 101 | -------------------------------------------------------------------------------- /sc-foxdot-visual.scd: -------------------------------------------------------------------------------- 1 | ( 2 | FoxDot.start; 3 | 4 | s.boot; 5 | 6 | // define the OSC function inside the main enviroment 7 | ~oscFunc = OSCFunc({ 8 | |msg, time, addr, recvPort| 9 | var data_analyzer = NetAddr("localhost", 7089); 10 | var data; 11 | 12 | data = msg[3..14]; 13 | data_analyzer.sendMsg("/scdata", 14 | "/loud", data[0], 15 | "/flat",data[1], 16 | "/centroid", data[2], 17 | "/eqm", data[3], data[4], data[5], data[6], data[7], data[8], data[9], data[10]) 18 | },'/tr'); 19 | 20 | Task ({ 21 | SynthDef(\audioAnalyzer, { 22 | | in=0, rate1=1, rate2=1 | 23 | var sig, fft;//, amplitude; 24 | var loud, powers, flat, centroid; 25 | var freq, hasFreq; 26 | var ph, onset; 27 | 28 | // we must use a mono source 29 | sig = Mix.ar(In.ar(in, 2)); 30 | 31 | //amplitude = Amplitude.kr(sig); 32 | fft = FFT(LocalBuf(2048), sig); 33 | loud = Loudness.kr(fft); 34 | powers = FFTSubbandPower.kr(fft, [100, 200, 400, 800, 1600, 3200, 6400], 1, 2); 35 | powers = (powers.log10 * 0.25).max(0.0); 36 | 37 | flat = SpecFlatness.kr(fft); 38 | centroid = SpecCentroid.kr(fft); 39 | 40 | SendReply.kr(Impulse.kr(rate1),'/tr', [loud, flat, centroid] ++ powers, replyID: 1); 41 | }).add; 42 | 43 | 3.wait; 44 | 45 | // and instantiate it just after the default server group 46 | ~listenSynth = Synth(\audioAnalyzer, [\in, 0,\rate1, 10, \rate2, 10],target:Server.default.defaultGroup, addAction:\addAfter); 47 | }).start; 48 | 49 | 50 | //start proxyspace 51 | p = ProxySpace.push(s); 52 | //start tempo clock 53 | p.makeTempoClock; 54 | //give proxyspace a tempo 55 | p.clock.tempo = 2; 56 | ) 57 | -------------------------------------------------------------------------------- /snap/snapcraft.yaml: -------------------------------------------------------------------------------- 1 | name: cool-retro-term # check to see if it's available 2 | version: '1.1.1' # this is freakin' awesome 3 | summary: cool-retro-term is a cool and retro terminal emulator. # 79 char long summary 4 | description: | 5 | cool-retro-term is a terminal emulator which mimics the look and feel of the old cathode tube screens. It has been designed to be eye-candy, customizable, and reasonably lightweight. 6 | grade: stable # must be 'stable' to release into candidate/stable channels 7 | confinement: classic # use 'strict' once you have the right plugs 8 | 9 | base: core18 10 | 11 | apps: 12 | cool-retro-term: 13 | command: bin/desktop-launch $SNAP/usr/bin/cool-retro-term 14 | desktop: usr/share/applications/cool-retro-term.desktop 15 | environment: 16 | QML2_IMPORT_PATH: $SNAP/usr/lib/x86_64-linux-gnu/qt5/qml 17 | 18 | parts: 19 | desktop-qt5: 20 | source: https://github.com/ubuntu/snapcraft-desktop-helpers.git 21 | source-subdir: qt 22 | plugin: make 23 | make-parameters: ["FLAVOR=qt5"] 24 | build-packages: 25 | - build-essential 26 | - qtbase5-dev 27 | - dpkg-dev 28 | stage-packages: 29 | - libxkbcommon0 30 | - ttf-ubuntu-font-family 31 | - dmz-cursor-theme 32 | - light-themes 33 | - adwaita-icon-theme 34 | - gnome-themes-standard 35 | - shared-mime-info 36 | - libqt5gui5 37 | - libgdk-pixbuf2.0-0 38 | - libqt5svg5 # for loading icon themes which are svg 39 | - try: [appmenu-qt5] # not available on core18 40 | - locales-all 41 | - xdg-user-dirs 42 | - fcitx-frontend-qt5 43 | 44 | my-part: 45 | source: https://github.com/Swordfish90/cool-retro-term 46 | source-type: git 47 | plugin: qmake # See 'snapcraft plugins' 48 | qt-version: qt5 49 | after: [desktop-qt5] 50 | 51 | build-packages: 52 | - build-essential 53 | - qmlscene 54 | - qt5-qmake 55 | - qt5-default 56 | - qtdeclarative5-dev 57 | 58 | stage-packages: 59 | - qmlscene 60 | - qml-module-qtquick-controls 61 | - qml-module-qtquick2 62 | - qml-module-qtgraphicaleffects 63 | - qml-module-qtquick-dialogs 64 | - qml-module-qtquick-localstorage 65 | - qml-module-qtquick-window2 66 | - libgl1-mesa-dev 67 | - qtdeclarative5-dev-tools 68 | - qml-module-qtquick-extras 69 | - qml-module-qt-labs-settings 70 | - qml-module-qt-labs-folderlistmodel 71 | 72 | -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | vnoremap <silent> <CR> y:call system('nc localhost 7088 -w 0', @")<CR> 2 | nnoremap <silent> <CR> :call system('nc localhost 7088 -w 0', getline('.'))<CR> 3 | :set filetype=python 4 | syntax on 5 | highlight EndOfBuffer ctermfg=black ctermbg=black 6 | set shortmess=at 7 | --------------------------------------------------------------------------------