diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml new file mode 100644 index 0000000..ce55f6b --- /dev/null +++ b/.github/workflows/build-linux.yml @@ -0,0 +1,69 @@ +# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage. +# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml +name: Build on Linux + +on: + push: + branches: [ "devel", "master" ] + pull_request: + branches: [ "devel", "master" ] + workflow_dispatch: + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: RelWithDebInfo + DRUMSTICKNAME: DrumstickV2 + SONIVOXNAME: SonivoxV3 + DRUMSTICK_LOCATION: ${{github.workspace}}/DrumstickV2 + SONIVOX_LOCATION: ${{github.workspace}}/SonivoxV3 + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - uses: dawidd6/action-download-artifact@v3 + with: + name: ${{env.SONIVOXNAME}}-linux + github_token: ${{secrets.GH_PAT}} + repo: pedrolcl/sonivox + workflow: cmake-linux.yml + + - name: Extract downloaded files + run: tar xvf ${{env.SONIVOXNAME}}.tar + + - uses: dawidd6/action-download-artifact@v3 + with: + name: ${{env.DRUMSTICKNAME}} + github_token: ${{secrets.GH_PAT}} + repo: pedrolcl/drumstick + workflow: cmake.yml + + - name: Extract downloaded files + run: tar xvf ${{env.DRUMSTICKNAME}}.tar + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + version: '6.5.*' + + - name: Dependencies + run: sudo apt-get update && sudo apt-get install -yq pkg-config libasound2-dev libpulse-dev + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + -DCMAKE_PREFIX_PATH="${{env.DRUMSTICK_LOCATION}};${{env.SONIVOX_LOCATION}}" + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} diff --git a/.gitmodules b/.gitmodules index 003f61a..77d771e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "sonivox"] path = sonivox url = git@github.com:pedrolcl/sonivox.git + branch = devel diff --git a/CMakeLists.txt b/CMakeLists.txt index 810c26e..d8d2d60 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,38 +1,32 @@ cmake_minimum_required(VERSION 3.9) project( EASSynth - VERSION 1.5.0 + VERSION 1.5.1 DESCRIPTION "Sonivox EAS for Linux and Qt" ) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) -option(USE_QT "Choose which Qt major version (5 or 6) to prefer. By default uses whatever is found") +option(USE_QT5 "Choose Qt5 instead of Qt6. By default uses Qt6") include(GNUInstallDirs) -if (USE_QT) - if (NOT (USE_QT EQUAL 5 OR USE_QT EQUAL 6)) - message(FATAL_ERROR "Wrong Qt major version. Only 5 and 6 are valid options") - endif() -endif() - -if (USE_QT EQUAL 5) +if (USE_QT5) find_package(QT NAMES Qt5) -elseif (USE_QT EQUAL 6) - find_package(QT NAMES Qt6) else() - find_package(QT NAMES Qt5 Qt6) + find_package(QT NAMES Qt6) endif() find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets REQUIRED) -find_package(Drumstick 2.7 COMPONENTS ALSA REQUIRED) +find_package(Drumstick 2.9 COMPONENTS ALSA REQUIRED) message(STATUS "Using Drumstick version: ${Drumstick_VERSION}") find_package(PkgConfig REQUIRED) pkg_check_modules(PULSE REQUIRED IMPORTED_TARGET libpulse-simple) -find_package(sonivox 3.6.12 CONFIG) +find_package(sonivox 3.6.13 CONFIG) if (NOT sonivox_FOUND) - add_subdirectory(sonivox) + message(FATAL_ERROR "Sonivox library not found") + #alternative: use sonivox as a git submodule: + #add_subdirectory(sonivox) endif() message(STATUS "Using Sonivox version: ${sonivox_VERSION}") add_subdirectory(libsvoxeas) diff --git a/README.md b/README.md index 5b6b343..58cc6a0 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ To build, test and debug you may also find QtCreator interesting. You may also u Licenses -------- -Copyright (C) 2016-2023 Pedro López-Cabanillas. +Copyright (C) 2016-2024 Pedro López-Cabanillas. 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 diff --git a/cmdlnsynth/main.cpp b/cmdlnsynth/main.cpp index 7a9eb84..5ec77e2 100644 --- a/cmdlnsynth/main.cpp +++ b/cmdlnsynth/main.cpp @@ -1,6 +1,6 @@ /* Sonivox EAS Synthesizer for Qt applications - Copyright (C) 2016-2023, Pedro Lopez-Cabanillas + Copyright (C) 2016-2024, Pedro Lopez-Cabanillas This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/guisynth/main.cpp b/guisynth/main.cpp index 976e308..7344421 100644 --- a/guisynth/main.cpp +++ b/guisynth/main.cpp @@ -1,6 +1,6 @@ /* Sonivox EAS Synthesizer for Qt applications - Copyright (C) 2016-2023, Pedro Lopez-Cabanillas + Copyright (C) 2016-2024, Pedro Lopez-Cabanillas This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/guisynth/mainwindow.cpp b/guisynth/mainwindow.cpp index 9669c91..bd0edc9 100644 --- a/guisynth/mainwindow.cpp +++ b/guisynth/mainwindow.cpp @@ -1,6 +1,6 @@ /* Sonivox EAS Synthesizer for Qt applications - Copyright (C) 2016-2023, Pedro Lopez-Cabanillas + Copyright (C) 2016-2024, Pedro Lopez-Cabanillas This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,6 +44,9 @@ MainWindow::MainWindow(QWidget *parent) : ui->combo_Chorus->addItem(QStringLiteral("None"), -1); ui->combo_Chorus->setCurrentIndex(4); + ui->libSonivoxVersion->setText(m_synth->renderer()->libVersion()); + setWindowTitle(windowTitle() + " v" + qApp->applicationVersion()); + connect(ui->combo_Reverb, SIGNAL(currentIndexChanged(int)), SLOT(reverbTypeChanged(int))); connect(ui->combo_Chorus, SIGNAL(currentIndexChanged(int)), SLOT(chorusTypeChanged(int))); connect(ui->dial_Reverb, &QDial::valueChanged, this, &MainWindow::reverbChanged); diff --git a/guisynth/mainwindow.h b/guisynth/mainwindow.h index aaee9af..f9b8934 100644 --- a/guisynth/mainwindow.h +++ b/guisynth/mainwindow.h @@ -1,6 +1,6 @@ /* Sonivox EAS Synthesizer for Qt applications - Copyright (C) 2016-2023, Pedro Lopez-Cabanillas + Copyright (C) 2016-2024, Pedro Lopez-Cabanillas This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/guisynth/mainwindow.ui b/guisynth/mainwindow.ui index 1293113..4c77f44 100644 --- a/guisynth/mainwindow.ui +++ b/guisynth/mainwindow.ui @@ -6,14 +6,14 @@ 0 0 - 273 - 265 + 280 + 290 - 273 - 265 + 280 + 290 @@ -25,7 +25,37 @@ - + + + + + + + 0 + 0 + + + + Sonivox Version: + + + + + + + + 0 + 0 + + + + + + + + + + Reverb @@ -35,7 +65,7 @@ - + Qt::Vertical @@ -48,7 +78,7 @@ - + Chorus @@ -58,24 +88,24 @@ - + 32765 - + 32765 - + - + diff --git a/libsvoxeas/filewrapper.cpp b/libsvoxeas/filewrapper.cpp index 008ca33..bbf8018 100644 --- a/libsvoxeas/filewrapper.cpp +++ b/libsvoxeas/filewrapper.cpp @@ -1,6 +1,6 @@ /* Sonivox EAS Synthesizer for Qt applications - Copyright (C) 2016-2023, Pedro Lopez-Cabanillas + Copyright (C) 2016-2024, Pedro Lopez-Cabanillas This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libsvoxeas/filewrapper.h b/libsvoxeas/filewrapper.h index 8948623..639abf8 100644 --- a/libsvoxeas/filewrapper.h +++ b/libsvoxeas/filewrapper.h @@ -1,6 +1,6 @@ /* Sonivox EAS Synthesizer for Qt applications - Copyright (C) 2016-2023, Pedro Lopez-Cabanillas + Copyright (C) 2016-2024, Pedro Lopez-Cabanillas This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libsvoxeas/programsettings.cpp b/libsvoxeas/programsettings.cpp index 1b50452..99085d3 100644 --- a/libsvoxeas/programsettings.cpp +++ b/libsvoxeas/programsettings.cpp @@ -1,6 +1,6 @@ /* Sonivox EAS Synthesizer for Qt applications - Copyright (C) 2016-2023, Pedro Lopez-Cabanillas + Copyright (C) 2016-2024, Pedro Lopez-Cabanillas This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libsvoxeas/programsettings.h b/libsvoxeas/programsettings.h index 41a208c..065c8ad 100644 --- a/libsvoxeas/programsettings.h +++ b/libsvoxeas/programsettings.h @@ -1,6 +1,6 @@ /* Sonivox EAS Synthesizer for Qt applications - Copyright (C) 2016-2023, Pedro Lopez-Cabanillas + Copyright (C) 2016-2024, Pedro Lopez-Cabanillas This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libsvoxeas/synthcontroller.cpp b/libsvoxeas/synthcontroller.cpp index 0a06ad9..d4d0f2c 100644 --- a/libsvoxeas/synthcontroller.cpp +++ b/libsvoxeas/synthcontroller.cpp @@ -1,6 +1,6 @@ /* Sonivox EAS Synthesizer for Qt applications - Copyright (C) 2016-2023, Pedro Lopez-Cabanillas + Copyright (C) 2016-2024, Pedro Lopez-Cabanillas This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libsvoxeas/synthcontroller.h b/libsvoxeas/synthcontroller.h index 933c206..fa73077 100644 --- a/libsvoxeas/synthcontroller.h +++ b/libsvoxeas/synthcontroller.h @@ -1,6 +1,6 @@ /* Sonivox EAS Synthesizer for Qt applications - Copyright (C) 2016-2023, Pedro Lopez-Cabanillas + Copyright (C) 2016-2024, Pedro Lopez-Cabanillas This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libsvoxeas/synthrenderer.cpp b/libsvoxeas/synthrenderer.cpp index 7a08970..c25cd34 100644 --- a/libsvoxeas/synthrenderer.cpp +++ b/libsvoxeas/synthrenderer.cpp @@ -1,6 +1,6 @@ /* Sonivox EAS Synthesizer for Qt applications - Copyright (C) 2016-2023, Pedro Lopez-Cabanillas + Copyright (C) 2016-2024, Pedro Lopez-Cabanillas This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,20 +16,23 @@ along with this program. If not, see . */ +#include #include +#include #include -#include #include -#include -#include +#include #include -#include "eas_reverb.h" -#include "eas_chorus.h" -#include -#include +#include + #include -#include "synthrenderer.h" +#include +#include + +#include "eas_chorus.h" +#include "eas_reverb.h" #include "filewrapper.h" +#include "synthrenderer.h" using namespace drumstick::ALSA; @@ -122,7 +125,9 @@ SynthRenderer::initEAS() m_sampleRate = easConfig->sampleRate; m_bufferSize = easConfig->mixBufferSize; m_channels = easConfig->numChannels; - qDebug() << Q_FUNC_INFO << "EAS bufferSize=" << m_bufferSize << " sampleRate=" << m_sampleRate << " channels=" << m_channels; + m_libVersion = easConfig->libVersion; + qDebug() << Q_FUNC_INFO << "Sonivox library:" << libVersion() << "bufferSize:" << m_bufferSize + << "sampleRate:" << m_sampleRate << "channels:" << m_channels; } void @@ -197,6 +202,17 @@ void SynthRenderer::uninitPulse() pa_simple_free(m_pulseHandle); } +QString SynthRenderer::libVersion() const +{ + quint8 v1, v2, v3, v4; + v1 = (m_libVersion >> 24) & 0xff; + v2 = (m_libVersion >> 16) & 0xff; + v3 = (m_libVersion >> 8) & 0xff; + v4 = m_libVersion & 0xff; + QVersionNumber vn{v1, v2, v3, v4}; + return vn.toString(); +} + SynthRenderer::~SynthRenderer() { uninitALSA(); diff --git a/libsvoxeas/synthrenderer.h b/libsvoxeas/synthrenderer.h index 3366a6c..432183d 100644 --- a/libsvoxeas/synthrenderer.h +++ b/libsvoxeas/synthrenderer.h @@ -1,6 +1,6 @@ /* Sonivox EAS Synthesizer for Qt applications - Copyright (C) 2016-2023, Pedro Lopez-Cabanillas + Copyright (C) 2016-2024, Pedro Lopez-Cabanillas This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -51,9 +51,10 @@ class SynthRenderer : public QObject void stopPlayback(); void uninitALSA(); - void uninitPulse(); + QString libVersion() const; + private: void initALSA(); void initEAS(); @@ -90,6 +91,7 @@ public slots: /* SONiVOX EAS */ int m_sampleRate, m_bufferSize, m_channels; + uint m_libVersion; EAS_DATA_HANDLE m_easData; EAS_HANDLE m_streamHandle; EAS_HANDLE m_midiFileHandle; diff --git a/screenshot.png b/screenshot.png index b389617..d4d7405 100644 Binary files a/screenshot.png and b/screenshot.png differ