Merge branch 'master' into feature/recording-stage-one

This commit is contained in:
Hyunjin Song
2022-10-30 12:04:26 +09:00
273 changed files with 3011 additions and 3112 deletions

View File

@@ -1,31 +0,0 @@
clone_depth: 1
version: "{build}"
image: Visual Studio 2017
platform:
- x86
- x64
environment:
matrix:
- compiler: msvc
install:
- cd C:\Tools\vcpkg
- git pull --quiet
- .\bootstrap-vcpkg.bat
- cd %APPVEYOR_BUILD_FOLDER%
- vcpkg install --triplet %PLATFORM%-windows --recurse fftw3 libsamplerate libsndfile lilv lv2 sdl2
- nuget install clcache -Version 4.1.0
build_script:
- cd %APPVEYOR_BUILD_FOLDER%
- mkdir build
- cd build
- ps: $env:CMAKE_PLATFORM="$(if ($env:PLATFORM -eq 'x64') { 'x64' } else { '' })"
- ps: $env:QT_SUFFIX="$(if ($env:PLATFORM -eq 'x64') { '_64' } else { '' })"
- cmake -DUSE_COMPILE_CACHE=ON -DCACHE_TOOL=%APPVEYOR_BUILD_FOLDER%/clcache.4.1.0/clcache-4.1.0/clcache.exe -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=c:/Qt/5.12/msvc2017%QT_SUFFIX% -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_GENERATOR_PLATFORM="%CMAKE_PLATFORM%" ..
- cmake --build . -- /maxcpucount:4
- cmake --build . --target tests
- cmake --build . --target package
artifacts:
- path: 'build\lmms-*.exe'
name: Installer
cache:
- c:/tools/vcpkg/installed

View File

@@ -1,225 +0,0 @@
version: 2
shared:
restore_cache: &restore_cache
restore_cache:
keys:
- ccache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}
- ccache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
- ccache-{{ arch }}
save_cache: &save_cache
save_cache:
key: ccache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .BuildNum }}
paths:
- ~/.ccache
restore_homebrew_cache: &restore_homebrew_cache
restore_cache:
keys:
- homebrew-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}
- homebrew-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
- homebrew-{{ arch }}
save_homebrew_cache: &save_homebrew_cache
save_cache:
key: homebrew-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .BuildNum }}
paths:
- ~/Library/Caches/Homebrew
- /usr/local/Homebrew
ccache_stats: &ccache_stats
run:
name: Print ccache statistics
command: |
echo "[ccache config]"
ccache -p
echo "[ccache stats]"
ccache -s
# Commmon initializing commands
init: &init
run:
name: Initialize
command: |
mkdir -p /tmp/artifacts
# Workaround for failing submodule fetching
git config --global --unset url."ssh://git@github.com".insteadOf || true
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
then
echo "Fetching out merged pull request"
git fetch -u origin refs/pull/${CIRCLE_PR_NUMBER}/merge:pr/merge
git checkout pr/merge
else
echo "Not a pull request"
fi
# Commmon environment variables
common_environment: &common_environment
QT5: True
CMAKE_OPTS: -DUSE_WERROR=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_CCACHE=ON
CCACHE_MAXSIZE: 500M
CCACHE_LOGFILE: /tmp/artifacts/ccache.log
MAKEFLAGS: -j6
jobs:
mingw32:
environment:
<<: *common_environment
docker:
- image: lmmsci/linux.mingw32:18.04
steps:
- checkout
- *init
- *restore_cache
- run:
name: Building
command: |
mkdir build && cd build
../cmake/build_win32.sh
make lmms
make
- run:
name: Build tests
command: cd build && make tests
- run:
name: Build installer
command: |
cd build
make package
cp ./lmms-*.exe /tmp/artifacts/
- store_artifacts:
path: /tmp/artifacts/
destination: /
- *ccache_stats
- *save_cache
mingw64:
environment:
<<: *common_environment
docker:
- image: lmmsci/linux.mingw64:18.04
steps:
- checkout
- *init
- *restore_cache
- run:
name: Building
command: |
mkdir build && cd build
../cmake/build_win64.sh
make
- run:
name: Build tests
command: cd build && make tests
- run:
name: Build installer
command: |
cd build
make package
cp ./lmms-*.exe /tmp/artifacts/
- store_artifacts:
path: /tmp/artifacts/
destination: /
- *ccache_stats
- *save_cache
linux.gcc:
docker:
- image: lmmsci/linux.gcc:18.04
environment:
<<: *common_environment
steps:
- checkout
- *init
- *restore_cache
- run:
name: Configure
command: |
source /opt/qt5*/bin/qt5*-env.sh || true
mkdir build && cd build
cmake .. $CMAKE_OPTS -DCMAKE_INSTALL_PREFIX=./install
- run:
name: Build
command: cd build && make
- run:
name: Build tests
command: cd build && make tests
- run:
name: Run tests
command: build/tests/tests
- *ccache_stats
- run:
name: Build AppImage
command: |
cd build
make install
make appimage || (cat appimage.log && false)
cp ./lmms-*.AppImage /tmp/artifacts/
- store_artifacts:
path: /tmp/artifacts/
destination: /
- store_artifacts:
path: build/appimage.log
destination: /
- *save_cache
shellcheck:
docker:
- image: koalaman/shellcheck-alpine:v0.4.6
steps:
- checkout
- run:
name: Shellcheck
command: shellcheck $(find "./cmake/" -type f -name '*.sh' -o -name "*.sh.in")
macos:
environment:
<<: *common_environment
macos:
xcode: "10.3.0"
steps:
- checkout
- *init
- *restore_homebrew_cache
- *restore_cache
- run:
name: Install Homebrew dependencies
command: |
# uninstall Homebrew's python 2 to prevent errors on brew install
brew uninstall python@2 || true
# Working around for https://github.com/Homebrew/brew/pull/9383
(git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch && git merge FETCH_HEAD --ff-only) || true
(git -C "/usr/local/Homebrew" fetch && git merge FETCH_HEAD --ff-only) || true
brew install ccache fftw cmake pkg-config libogg libvorbis lame libsndfile libsamplerate jack sdl libgig libsoundio lilv lv2 stk fluid-synth portaudio fltk qt5 carla
- run:
name: Install nodejs dependencies
command: npm install -g appdmg
- run:
name: Building
command: |
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX="../target" -DCMAKE_PREFIX_PATH="$(brew --prefix qt5)" $CMAKE_OPTS -DUSE_WERROR=OFF
make
- run:
name: Build tests
command: cd build && make tests
- run:
name: Run tests
command: build/tests/tests
- run:
name: Build DMG
command: |
cd build
make install
make dmg
cp ./lmms-*.dmg /tmp/artifacts/
- store_artifacts:
path: /tmp/artifacts/
destination: /
- *save_cache
- *save_homebrew_cache
workflows:
version: 2
build-and-test:
jobs:
- macos
- mingw32
- mingw64
- linux.gcc
- shellcheck

252
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,252 @@
---
name: build
'on': [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
linux:
name: linux
runs-on: ubuntu-latest
container: lmmsci/linux.gcc:18.04
env:
CMAKE_OPTS: >-
-DUSE_WERROR=ON
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DUSE_COMPILE_CACHE=ON
CCACHE_MAXSIZE: 500M
MAKEFLAGS: -j2
steps:
- name: Update and configure Git
run: |
add-apt-repository ppa:git-core/ppa
apt-get update
apt-get --yes install git
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Cache ccache data
uses: actions/cache@v3
with:
key: ccache-${{ github.job }}-${{ github.ref }}-${{ github.run_id }}
restore-keys: |
ccache-${{ github.job }}-${{ github.ref }}-
ccache-${{ github.job }}-
path: ~/.ccache
- name: Configure
run: |
source /opt/qt5*/bin/qt5*-env.sh || true
mkdir build && cd build
cmake .. $CMAKE_OPTS -DCMAKE_INSTALL_PREFIX=./install
- name: Build
run: cmake --build build
- name: Build tests
run: cmake --build build --target tests
- name: Run tests
run: build/tests/tests
- name: Package
run: |
cmake --build build --target install
cmake --build build --target appimage
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: linux
path: build/lmms-*.AppImage
- name: Print ccache statistics
run: |
echo "[ccache config]"
ccache -p
echo "[ccache stats]"
ccache -s
macos:
name: macos
runs-on: macos-11
env:
CMAKE_OPTS: >-
-DUSE_WERROR=ON
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DUSE_COMPILE_CACHE=ON
CCACHE_MAXSIZE: 500M
MAKEFLAGS: -j3
DEVELOPER_DIR: /Applications/Xcode_11.7.app/Contents/Developer
steps:
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Cache ccache data
uses: actions/cache@v3
with:
key: ccache-${{ github.job }}-${{ github.ref }}-${{ github.run_id }}
restore-keys: |
ccache-${{ github.job }}-${{ github.ref }}-
ccache-${{ github.job }}-
path: ~/Library/Caches/ccache
- name: Install dependencies
run: |
brew install ccache fftw pkg-config libogg libvorbis lame libsndfile \
libsamplerate jack sdl libgig libsoundio lilv lv2 stk \
fluid-synth portaudio fltk qt@5 carla
npm install --location=global appdmg
- name: Configure
run: |
mkdir build
cmake -S . \
-B build \
-DCMAKE_INSTALL_PREFIX="../target" \
-DCMAKE_PREFIX_PATH="$(brew --prefix qt5)" \
$CMAKE_OPTS \
-DUSE_WERROR=OFF
- name: Build
run: cmake --build build
- name: Build tests
run: cmake --build build --target tests
- name: Run tests
run: build/tests/tests
- name: Package
run: |
cmake --build build --target install
cmake --build build --target dmg
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: macos
path: build/lmms-*.dmg
- name: Print ccache statistics
run: |
echo "[ccache config]"
ccache -p
echo "[ccache stats]"
ccache -s
mingw:
strategy:
fail-fast: false
matrix:
arch: ['32', '64']
name: mingw${{ matrix.arch }}
runs-on: ubuntu-latest
container: lmmsci/linux.mingw${{ matrix.arch }}:18.04
env:
CMAKE_OPTS: >-
-DUSE_WERROR=ON
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DUSE_COMPILE_CACHE=ON
CCACHE_MAXSIZE: 500M
MAKEFLAGS: -j2
steps:
- name: Update and configure Git
run: |
add-apt-repository ppa:git-core/ppa
apt-get update
apt-get --yes install git
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Cache ccache data
uses: actions/cache@v3
with:
key: "ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}\
-${{ github.run_id }}"
restore-keys: |
ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}-
ccache-${{ github.job }}-${{ matrix.arch }}-
path: ~/.ccache
- name: Configure
run: |
mkdir build && cd build
../cmake/build_win${{ matrix.arch }}.sh
- name: Build
run: cmake --build build
- name: Build tests
run: cmake --build build --target tests
- name: Package
run: cmake --build build --target package
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: mingw${{ matrix.arch }}
path: build/lmms-*.exe
- name: Print ccache statistics
run: |
echo "[ccache config]"
ccache -p
echo "[ccache stats]"
ccache -s
msvc:
strategy:
fail-fast: false
matrix:
arch: ['x86', 'x64']
name: msvc-${{ matrix.arch }}
runs-on: windows-2019
env:
qt-version: '5.15.2'
steps:
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Cache vcpkg dependencies
uses: actions/cache@v3
with:
key: vcpkg-${{ matrix.arch }}-${{ github.ref }}-${{ github.run_id }}
restore-keys: |
vcpkg-${{ matrix.arch }}-${{ github.ref }}-
vcpkg-${{ matrix.arch }}-
path: C:\vcpkg\installed
- name: Install 64-bit Qt
if: matrix.arch == 'x64'
uses: jurplel/install-qt-action@64bdb64f2c14311d23733a8463e5fcbc65e8775e
with:
version: ${{ env.qt-version }}
arch: win64_msvc2019_64
archives: qtbase qtsvg qttools
cache: true
- name: Install 32-bit Qt
uses: jurplel/install-qt-action@64bdb64f2c14311d23733a8463e5fcbc65e8775e
with:
version: ${{ env.qt-version }}
arch: win32_msvc2019
archives: qtbase qtsvg qttools
cache: true
set-env: ${{ matrix.arch == 'x86' }}
- name: Install dependencies
run: |
vcpkg install `
--triplet=${{ matrix.arch }}-windows `
--host-triplet=${{ matrix.arch }}-windows `
--recurse `
fftw3 fluidsynth[sndfile] libsamplerate libsndfile libstk lilv lv2 `
portaudio sdl2
- name: Set up build environment
uses: ilammy/msvc-dev-cmd@d8610e2b41c6d0f0c3b4c46dad8df0fd826c68e1
with:
arch: ${{ matrix.arch }}
- name: Configure
run: |
mkdir build
cmake -S . `
-B build `
-G Ninja `
--toolchain C:/vcpkg/scripts/buildsystems/vcpkg.cmake `
-DCMAKE_BUILD_TYPE=RelWithDebInfo
- name: Build
run: cmake --build build
- name: Build tests
run: cmake --build build --target tests
- name: Package
run: cmake --build build --target package
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: msvc-${{ matrix.arch }}
path: build\lmms-*.exe

View File

@@ -1,19 +0,0 @@
name: check-strings
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install python-tinycss2
run: sudo apt-get install -y python3-tinycss2
- name: Update submodules
run: git submodule update --init --recursive
- name: Verify check-strings script
run: tests/check-strings/verify
- name: Run check-strings
run: tests/check-strings/check-strings

33
.github/workflows/checks.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
---
name: checks
'on': [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
scripted-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install python-tinycss2
run: sudo apt-get install -y python3-tinycss2
- name: Update submodules
run: git submodule update --init --recursive
- name: Verify scripted tests
run: tests/scripted/verify
- name: Run check-strings
run: tests/scripted/check-strings
- name: Run check-namespace
run: tests/scripted/check-namespace
shellcheck:
runs-on: ubuntu-latest
container: koalaman/shellcheck-alpine:v0.4.6
steps:
- name: Check out
uses: actions/checkout@v3
- name: Run shellcheck
run: |
shellcheck \
$(find "./cmake/" -type f -name '*.sh' -o -name "*.sh.in") \
doc/bash-completion/lmms \
buildtools/update_locales

View File

@@ -1,33 +0,0 @@
language: cpp
compiler: gcc
dist: xenial
sudo: required
cache:
directories:
- $HOME/apt_mingw_cache
- $HOME/.ccache
- $HOME/pbuilder-bases
matrix:
include:
- env: TYPE=style
- os: linux
- env: TARGET_OS=debian-sid TARGET_DEPLOY=True
git:
depth: false
- env: TARGET_OS=debian-sid TARGET_ARCH=i386
git:
depth: false
- compiler: clang
env: TARGET_OS=debian-sid
git:
depth: false
- os: osx
osx_image: xcode10.3
before_install:
# appdmg doesn't work with old Node.js
- if [ "$TRAVIS_OS_NAME" = osx ]; then nvm install 10; fi
install: ${TRAVIS_BUILD_DIR}/.travis/install.sh
script: ${TRAVIS_BUILD_DIR}/.travis/script.sh
after_script: ${TRAVIS_BUILD_DIR}/.travis/after_script.sh
before_deploy:
- if [ "$TARGET_OS" != debian-sid ]; then make package; fi

View File

@@ -1,7 +0,0 @@
#!/usr/bin/env bash
set -e
if [ "$TYPE" != 'style' ]; then
ccache -s
fi

View File

@@ -1 +0,0 @@
0de866bc0ee26de392e037104b174474989a830e2249280a136144baa44557aa ccache_3.2.4-1_amd64.deb

View File

@@ -1,3 +0,0 @@
314ef4af137903dfb13e8c3ef1e6ea56cfdb23808d52ec4f5f50e288c73610c5 pbuilder_0.229.1_all.deb
fa82aa8ed3055c6f6330104deedf080b26778295e589426d4c4dd0f2c2a5defa debootstrap_1.0.95_all.deb
2ef4c09f7841b72f93412803ddd142f72658536dbfabe00e449eb548f432f3f8 debian-archive-keyring_2017.7ubuntu1_all.deb

View File

@@ -1,11 +0,0 @@
#!/usr/bin/env bash
set -e
if [ "$TYPE" = 'style' ]; then
sudo apt-get -yqq update
sudo apt-get install shellcheck
else
"$TRAVIS_BUILD_DIR/.travis/$TRAVIS_OS_NAME.$TARGET_OS.before_install.sh"
"$TRAVIS_BUILD_DIR/.travis/$TRAVIS_OS_NAME.$TARGET_OS.install.sh"
fi

View File

@@ -1,8 +0,0 @@
#!/usr/bin/env bash
set -e
sudo add-apt-repository ppa:beineri/opt-qt592-xenial -y
sudo dpkg --add-architecture i386
sudo apt-get update -qq || true

View File

@@ -1,23 +0,0 @@
#!/usr/bin/env bash
set -e
PACKAGES="cmake libsndfile-dev fftw3-dev libvorbis-dev libogg-dev libmp3lame-dev
libasound2-dev libjack-jackd2-dev libsdl-dev libsamplerate0-dev libstk0-dev stk
libfluidsynth-dev portaudio19-dev g++-multilib libfltk1.3-dev fluid
libgig-dev libsoundio-dev qt59base qt59translations qt59tools"
# swh build dependencies
SWH_PACKAGES="perl libxml2-utils libxml-perl liblist-moreutils-perl"
# VST dependencies
VST_PACKAGES="wine-dev qt59x11extras qtbase5-private-dev libxcb-util0-dev libxcb-keysyms1-dev"
# LV2 dependencies; libsuil-dev is not required
LV2_PACKAGES="lv2-dev liblilv-dev"
# Help with unmet dependencies
PACKAGES="$PACKAGES $SWH_PACKAGES $VST_PACKAGES $LV2_PACKAGES libjack-jackd2-0"
# shellcheck disable=SC2086
sudo apt-get install -y $PACKAGES

View File

@@ -1,15 +0,0 @@
#!/usr/bin/env bash
unset QTDIR QT_PLUGIN_PATH LD_LIBRARY_PATH
# shellcheck disable=SC1091
source /opt/qt59/bin/qt59-env.sh
set -e
mkdir build
cd build
# shellcheck disable=SC2086
cmake -DUSE_WERROR=ON -DCMAKE_INSTALL_PREFIX=../target $CMAKE_FLAGS ..
make -j4
make tests
./tests/tests

View File

@@ -1,2 +0,0 @@
#!/bin/sh
sudo apt-get update -qq

View File

@@ -1,17 +0,0 @@
#!/bin/sh
set -e
sudo apt-get install -y \
dpkg \
pbuilder
# work around a pbuilder bug which breaks ccache
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=666525
# and also missing signing keys in Trusty's debian-archive-keyring
cd /tmp
wget http://archive.ubuntu.com/ubuntu/pool/main/p/pbuilder/pbuilder_0.229.1_all.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/debootstrap_1.0.95_all.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/d/debian-archive-keyring/debian-archive-keyring_2017.7ubuntu1_all.deb
sha256sum -c "$TRAVIS_BUILD_DIR/.travis/debian_pkgs.sha256"
sudo dpkg -i pbuilder_0.229.1_all.deb debootstrap_1.0.95_all.deb debian-archive-keyring_2017.7ubuntu1_all.deb
cd "$OLDPWD"

View File

@@ -1,72 +0,0 @@
#!/bin/bash
set -e
: "${TARGET_ARCH:=amd64}"
BASETGZ="$HOME/pbuilder-bases/debian-sid-$TARGET_ARCH.tgz"
MIRROR=http://cdn-fastly.deb.debian.org/debian
KEYRING=/usr/share/keyrings/debian-archive-keyring.gpg
if [ -z "$TRAVIS_TAG" ]
then
sudo \
sh -c "echo CCACHEDIR=$HOME/.ccache >> /etc/pbuilderrc"
fi
if [ "$CC" = clang ]
then
sudo sh -c "echo EXTRAPACKAGES=clang >> /etc/pbuilderrc"
fi
if [ ! -e "$BASETGZ.stamp" ]
then
mkdir -p "$HOME/pbuilder-bases"
sudo pbuilder --create --basetgz "$BASETGZ" --mirror $MIRROR \
--distribution sid --architecture $TARGET_ARCH \
--debootstrapopts --variant=buildd \
--debootstrapopts --keyring=$KEYRING \
--debootstrapopts --include=perl
touch "$BASETGZ.stamp"
else
sudo pbuilder --update --basetgz "$BASETGZ"
fi
sync_version() {
local VERSION
local MMR
local STAGE
local EXTRA
VERSION=$(git describe --tags --match v[0-9].[0-9].[0-9]*)
VERSION=${VERSION#v}
MMR=${VERSION%%-*}
case $VERSION in
*-*-*-*)
VERSION=${VERSION%-*}
STAGE=${VERSION#*-}
STAGE=${STAGE%-*}
EXTRA=${VERSION##*-}
VERSION=$MMR~$STAGE.$EXTRA
;;
*-*-*)
VERSION=${VERSION%-*}
EXTRA=${VERSION##*-}
VERSION=$MMR.$EXTRA
;;
*-*)
STAGE=${VERSION#*-}
VERSION=$MMR~$STAGE
;;
esac
sed "1 s/@VERSION@/$VERSION/" -i debian/changelog
echo "Set Debian version to $VERSION"
}
sync_version
DIR="$PWD"
cd ..
dpkg-source -b "$DIR"
env -i CC="$CC" CXX="$CXX" sudo pbuilder --build --debbuildopts "--jobs=auto" \
--basetgz "$BASETGZ" ./*.dsc

View File

@@ -1,16 +0,0 @@
#!/usr/bin/env bash
set -e
CACHE_DIR=$HOME/apt_mingw_cache/$1
mkdir -p "$CACHE_DIR"
pushd "$CACHE_DIR"
# shellcheck disable=SC2086
apt-get --print-uris --yes install $MINGW_PACKAGES | grep ^\' | cut -d\' -f2 > downloads.list
wget -N --input-file downloads.list
sudo cp ./*.deb /var/cache/apt/archives/
popd

View File

@@ -1,6 +0,0 @@
#!/usr/bin/env bash
set -e
sudo add-apt-repository ppa:tobydox/mingw-x-trusty -y
sudo apt-get update -qq

View File

@@ -1,29 +0,0 @@
#!/usr/bin/env bash
set -e
MINGW_PACKAGES="mingw32-x-sdl mingw32-x-libvorbis mingw32-x-fluidsynth mingw32-x-stk
mingw32-x-glib2 mingw32-x-portaudio mingw32-x-libsndfile mingw32-x-fftw
mingw32-x-flac mingw32-x-fltk mingw32-x-libsamplerate
mingw32-x-pkgconfig mingw32-x-binutils mingw32-x-gcc mingw32-x-runtime
mingw32-x-libgig mingw32-x-libsoundio mingw32-x-lame mingw32-x-qt5base"
# swh build dependencies
SWH_PACKAGES="perl libxml2-utils libxml-perl liblist-moreutils-perl"
export MINGW_PACKAGES
"$TRAVIS_BUILD_DIR/.travis/linux.win.download.sh" win32
PACKAGES="nsis cloog-isl libmpc3 qt4-linguist-tools mingw32 $MINGW_PACKAGES $SWH_PACKAGES"
# shellcheck disable=SC2086
sudo apt-get install -y $PACKAGES
# ccache 3.2 is needed because mingw32-x-gcc is version 4.9, which causes cmake
# to use @file command line passing, which in turn ccache 3.1.9 doesn't support
pushd /tmp
wget http://archive.ubuntu.com/ubuntu/pool/main/c/ccache/ccache_3.2.4-1_amd64.deb
sha256sum -c "$TRAVIS_BUILD_DIR/.travis/ccache.sha256"
sudo dpkg -i ccache_3.2.4-1_amd64.deb
popd

View File

@@ -1,11 +0,0 @@
#!/usr/bin/env bash
set -e
mkdir build
cd build
export CMAKE_OPTS="$CMAKE_FLAGS -DUSE_WERROR=ON"
../cmake/build_win32.sh
make -j4
make tests

View File

@@ -1,5 +0,0 @@
#!/usr/bin/env bash
set -e
"$TRAVIS_BUILD_DIR/.travis/linux.win32.before_install.sh"

View File

@@ -1,19 +0,0 @@
#!/usr/bin/env bash
set -e
# First, install 32-bit deps
"$TRAVIS_BUILD_DIR/.travis/linux.win32.install.sh"
MINGW_PACKAGES="mingw64-x-sdl mingw64-x-libvorbis mingw64-x-fluidsynth mingw64-x-stk
mingw64-x-glib2 mingw64-x-portaudio mingw64-x-libsndfile
mingw64-x-fftw mingw64-x-flac mingw64-x-fltk mingw64-x-libsamplerate
mingw64-x-pkgconfig mingw64-x-binutils mingw64-x-gcc mingw64-x-runtime
mingw64-x-libgig mingw64-x-libsoundio mingw64-x-lame mingw64-x-qt5base"
export MINGW_PACKAGES
"$TRAVIS_BUILD_DIR/.travis/linux.win.download.sh" win64
# shellcheck disable=SC2086
sudo apt-get install -y $MINGW_PACKAGES

View File

@@ -1,11 +0,0 @@
#!/usr/bin/env bash
set -e
mkdir build
cd build
export CMAKE_OPTS="$CMAKE_FLAGS -DUSE_WERROR=ON"
../cmake/build_win64.sh
make -j4
make tests

View File

@@ -1,7 +0,0 @@
#!/usr/bin/env bash
set -e
brew update
# Python 2 may cause conflicts on dependency installation
brew unlink python@2 || true

View File

@@ -1,22 +0,0 @@
#!/usr/bin/env bash
set -e
PACKAGES="cmake pkg-config libogg libvorbis lame libsndfile libsamplerate lilv lv2 jack sdl libgig libsoundio stk fluid-synth portaudio node fltk qt carla"
if "${TRAVIS}"; then
PACKAGES="$PACKAGES ccache"
fi
# removing already installed packages from the list
for p in $(brew list); do
PACKAGES=${PACKAGES//$p/}
done;
# shellcheck disable=SC2086
brew install $PACKAGES
# fftw tries to install gcc which conflicts with travis
brew install fftw --ignore-dependencies
npm install -g appdmg

View File

@@ -1,16 +0,0 @@
#!/usr/bin/env bash
set -e
mkdir build
cd build
# Workaround; No FindQt5.cmake module exists
CMAKE_PREFIX_PATH="$(brew --prefix qt5)"
export CMAKE_PREFIX_PATH
# shellcheck disable=SC2086
cmake -DUSE_WERROR=OFF -DCMAKE_INSTALL_PREFIX=../target $CMAKE_FLAGS ..
make -j4
make tests
./tests/tests

View File

@@ -1,48 +0,0 @@
#!/usr/bin/env bash
set -e
if [ "$TYPE" = 'style' ]; then
# SC2185 is disabled because of: https://github.com/koalaman/shellcheck/issues/942
# once it's fixed, it should be enabled again
# shellcheck disable=SC2185
# shellcheck disable=SC2046
shellcheck $(find -O3 . -maxdepth 3 -type f -name '*.sh' -o -name "*.sh.in")
shellcheck doc/bash-completion/lmms
else
export CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUNDLE_QT_TRANSLATIONS=ON"
if [ -z "$TRAVIS_TAG" ]; then
export CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_CCACHE=ON"
fi
"$TRAVIS_BUILD_DIR/.travis/$TRAVIS_OS_NAME.$TARGET_OS.script.sh"
# Package and upload non-tagged builds
if [ -n "$TRAVIS_TAG" ]; then
# Skip, handled by travis deploy instead
exit 0
elif [[ $TARGET_OS == win* ]]; then
cd build
make -j4 package
PACKAGE="$(ls lmms-*win*.exe)"
elif [[ $TRAVIS_OS_NAME == osx ]]; then
cd build
make -j4 install > /dev/null
make dmg
PACKAGE="$(ls lmms-*.dmg)"
elif [[ $TARGET_OS != debian-sid ]]; then
cd build
make -j4 install > /dev/null
make appimage
PACKAGE="$(ls lmms-*.AppImage)"
fi
echo "Uploading $PACKAGE to transfer.sh..."
# Limit the connection time to 3 minutes and total upload time to 5 minutes
# Otherwise the build may hang
curl --connect-timeout 180 --max-time 300 --upload-file "$PACKAGE" "https://transfer.sh/$PACKAGE" || true
fi

View File

@@ -22,6 +22,14 @@ ENDIF(COMMAND CMAKE_POLICY)
# Import of windows.h breaks min()/max()
ADD_DEFINITIONS(-DNOMINMAX)
# CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES is not set correctly for MinGW until
# CMake 3.14.1, so avoid specifying system include directories on affected
# versions. Normal include directories are safe, since GCC ignores them if they
# are already in the built-in search path.
if(MINGW AND CMAKE_VERSION VERSION_LESS "3.14.1")
set(CMAKE_NO_SYSTEM_FROM_IMPORTED TRUE)
endif()
INCLUDE(PluginList)
INCLUDE(CheckSubmodules)
INCLUDE(AddFileDependencies)
@@ -110,6 +118,7 @@ IF(LMMS_BUILD_WIN32)
SET(STATUS_ALSA "<not supported on this platform>")
SET(STATUS_PULSEAUDIO "<not supported on this platform>")
SET(STATUS_SOUNDIO "<disabled in this release>")
SET(STATUS_SNDIO "<not supported on this platform>")
SET(STATUS_WINMM "OK")
SET(STATUS_APPLEMIDI "<not supported on this platform>")
ELSE(LMMS_BUILD_WIN32)
@@ -208,6 +217,8 @@ IF(WANT_LV2)
PKG_CHECK_MODULES(LILV lilv-0)
ENDIF()
IF(NOT LV2_FOUND AND NOT LILV_FOUND)
UNSET(LV2_FOUND CACHE)
UNSET(LILV_FOUND CACHE)
FIND_PACKAGE(LV2 CONFIG)
FIND_PACKAGE(LILV CONFIG)
IF(LILV_FOUND)
@@ -295,17 +306,7 @@ ENDIF(WANT_CARLA)
# check for SDL2
IF(WANT_SDL)
# Don't look for SDL2main
SET(SDL2_BUILDING_LIBRARY TRUE)
# Search for SDL2 using config mode first, then fall back to module mode.
# This allows us to use SDL2's own CMake configuration files if available.
FIND_PACKAGE(SDL2 CONFIG QUIET)
IF(NOT TARGET SDL2::SDL2)
UNSET(SDL2_FOUND)
FIND_PACKAGE(SDL2 MODULE)
ENDIF()
FIND_PACKAGE(SDL2)
IF(SDL2_FOUND)
SET(LMMS_HAVE_SDL TRUE)
SET(LMMS_HAVE_SDL2 TRUE)
@@ -356,13 +357,13 @@ ENDIF(WANT_STK)
# check for PortAudio
IF(WANT_PORTAUDIO)
FIND_PACKAGE(Portaudio)
IF(PORTAUDIO_FOUND)
IF(Portaudio_FOUND)
SET(LMMS_HAVE_PORTAUDIO TRUE)
SET(STATUS_PORTAUDIO "OK")
ELSE(PORTAUDIO_FOUND)
ELSE()
SET(STATUS_PORTAUDIO "not found, please install portaudio19-dev (or similar, version >= 1.9) "
"if you require PortAudio support")
ENDIF(PORTAUDIO_FOUND)
ENDIF()
ENDIF(WANT_PORTAUDIO)
# check for libsoundio
@@ -494,14 +495,14 @@ ENDIF()
# check for Fluidsynth
IF(WANT_SF2)
PKG_CHECK_MODULES(FLUIDSYNTH fluidsynth>=1.0.7)
IF(FLUIDSYNTH_FOUND)
find_package(FluidSynth 1.0.7)
if(FluidSynth_FOUND)
SET(LMMS_HAVE_FLUIDSYNTH TRUE)
SET(STATUS_FLUIDSYNTH "OK")
ELSE(FLUIDSYNTH_FOUND)
else()
SET(STATUS_FLUIDSYNTH "not found, libfluidsynth-dev (or similar)"
"is highly recommended")
ENDIF(FLUIDSYNTH_FOUND)
endif()
ENDIF(WANT_SF2)
# check for libgig
@@ -602,6 +603,16 @@ SET(CMAKE_CXX_FLAGS "${WERROR_FLAGS} ${CMAKE_CXX_FLAGS}")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DLMMS_DEBUG")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLMMS_DEBUG")
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.16")
set(NOOP_COMMAND "${CMAKE_COMMAND}" "-E" "true")
else()
set(NOOP_COMMAND "${CMAKE_COMMAND}" "-E" "echo")
endif()
if(STRIP)
set(STRIP_COMMAND "$<IF:$<TARGET:Debug,RelWithDebInfo>,${NOOP_COMMAND},${STRIP}>")
else()
set(STRIP_COMMAND "${NOOP_COMMAND}")
endif()
# people simply updating git will still have this and mess up build with it
FILE(REMOVE include/lmmsconfig.h)

View File

@@ -6,9 +6,6 @@
# Notes: Will attempt to fetch linuxdeployqt automatically (x86_64 only)
# See Also: https://github.com/probonopd/linuxdeployqt/blob/master/BUILDING.md
set -e
LINUXDEPLOYQT="@CMAKE_BINARY_DIR@/linuxdeployqt"
VERBOSITY=2 # 3=debug
LOGFILE="@CMAKE_BINARY_DIR@/appimage.log"
APPDIR="@CMAKE_BINARY_DIR@/@PROJECT_NAME_UCASE@.AppDir/"
@@ -40,8 +37,21 @@ function skipped {
echo -e " ${PLAIN}[${YELLOW}skipped${PLAIN}] ${1}"
}
# Exit with error message if any command fails
trap "error 'Failed to generate AppImage'; exit 1" ERR
# Run a command silently, but print output if it fails
function run_and_log {
echo -e "\n\n>>>>> $1" >> "$LOGFILE"
output="$("$@" 2>&1)"
status=$?
echo "$output" >> "$LOGFILE"
[[ $status != 0 ]] && echo "$output"
return $status
}
# Blindly assume system arch is appimage arch
ARCH=$(arch)
ARCH=$(uname -m)
export ARCH
# Check for problematic install locations
@@ -50,35 +60,39 @@ if [ "$INSTALL" == "/usr/local" ] || [ "$INSTALL" == "/usr" ] ; then
error "Incompatible CMAKE_INSTALL_PREFIX for creating AppImage: @CMAKE_INSTALL_PREFIX@"
fi
echo -e "\nWriting verbose output to \"${LOGFILE}\""
# Ensure linuxdeployqt uses the same qmake version as cmake
PATH="$(pwd -P)/squashfs-root/usr/bin:$(dirname "@QT_QMAKE_EXECUTABLE@")":$PATH
PATH="$(dirname "@QT_QMAKE_EXECUTABLE@"):$PATH"
export PATH
# Use linuxdeployqt from env or in PATH
[[ $LINUXDEPLOYQT ]] || LINUXDEPLOYQT="$(which linuxdeployqt 2>/dev/null)" || true
[[ $APPIMAGETOOL ]] || APPIMAGETOOL="$(which appimagetool 2>/dev/null)" || true
# Fetch portable linuxdeployqt if not in PATH
APPIMAGETOOL="squashfs-root/usr/bin/appimagetool"
echo -e "\nDownloading linuxdeployqt to ${LINUXDEPLOYQT}..."
if env -i which linuxdeployqt > /dev/null 2>&1; then
skipped "System already provides this utility"
else
filename="linuxdeployqt-continuous-$(uname -p).AppImage"
if [[ -z $LINUXDEPLOYQT || -z $APPIMAGETOOL ]]; then
filename="linuxdeployqt-continuous-$ARCH.AppImage"
url="https://github.com/probonopd/linuxdeployqt/releases/download/continuous/$filename"
down_file="$(pwd)/$filename"
if [ ! -f "$LINUXDEPLOYQT" ]; then
ln -s "$down_file" "$LINUXDEPLOYQT"
fi
echo " [.......] Downloading ($(uname -p)): ${url}"
wget -N -q "$url" || (rm "$filename" && false)
chmod +x "$LINUXDEPLOYQT"
success "Downloaded $LINUXDEPLOYQT"
echo " [.......] Downloading: ${url}"
wget -N -q "$url" && err=0 || err=$?
case "$err" in
0) success "Downloaded $PWD/$filename" ;;
# 8 == server issued 4xx error
8) error "Download failed (perhaps no package available for $ARCH)" ;;
*) error "Download failed" ;;
esac
# Extract AppImage and replace LINUXDEPLOYQT variable with extracted binary
# to support systems without fuse
# Also, we need to set LD_LIBRARY_PATH, but linuxdepoyqt's AppRun unsets it
# See https://github.com/probonopd/linuxdeployqt/pull/370/
"$LINUXDEPLOYQT" --appimage-extract > /dev/null 2>&1
LINUXDEPLOYQT="squashfs-root/usr/bin/linuxdeployqt"
success "Extracted $APPIMAGETOOL"
chmod +x "$filename"
./"$filename" --appimage-extract >/dev/null
success "Extracted $filename"
# Use the extracted linuxdeployqt and appimagetool
PATH="$(pwd -P)/squashfs-root/usr/bin:$PATH"
[[ $LINUXDEPLOYQT ]] || LINUXDEPLOYQT="$(which linuxdeployqt)"
[[ $APPIMAGETOOL ]] || APPIMAGETOOL="$(which appimagetool)"
fi
# Make skeleton AppDir
@@ -149,12 +163,14 @@ executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/imbeq_1197.
executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/pitch_scale_1193.so"
executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/pitch_scale_1194.so"
echo -e "\nWriting verbose output to \"${LOGFILE}\""
echo -n > "$LOGFILE"
# Bundle both qt and non-qt dependencies into appimage format
echo -e "\nBundling and relinking system dependencies..."
echo -e ">>>>> linuxdeployqt" > "$LOGFILE"
# shellcheck disable=SC2086
"$LINUXDEPLOYQT" "$DESKTOPFILE" $executables -bundle-non-qt-libs -verbose=$VERBOSITY $STRIP >> "$LOGFILE" 2>&1
run_and_log "$LINUXDEPLOYQT" "$DESKTOPFILE" $executables -bundle-non-qt-libs -verbose=$VERBOSITY $STRIP
success "Bundled and relinked dependencies"
# Link to original location so lmms can find them
@@ -187,8 +203,7 @@ ln -sr "${APPDIR}/usr/bin/lmms" "${APPDIR}/AppRun"
# Create AppImage
echo -e "\nFinishing the AppImage..."
echo -e "\n\n>>>>> appimagetool" >> "$LOGFILE"
"$APPIMAGETOOL" "${APPDIR}" "@APPIMAGE_FILE@" >> "$LOGFILE" 2>&1
run_and_log "$APPIMAGETOOL" "${APPDIR}" "@APPIMAGE_FILE@"
success "Created @APPIMAGE_FILE@"
echo -e "\nFinished"

View File

@@ -76,9 +76,13 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
ADD_DEPENDENCIES(${PLUGIN_NAME} lmms)
ENDIF(LMMS_BUILD_APPLE)
IF(LMMS_BUILD_WIN32)
IF(STRIP)
ADD_CUSTOM_COMMAND(TARGET ${PLUGIN_NAME} POST_BUILD COMMAND ${STRIP} "$<TARGET_FILE:${PLUGIN_NAME}>")
ENDIF()
add_custom_command(
TARGET "${PLUGIN_NAME}"
POST_BUILD
COMMAND "${STRIP_COMMAND}" "$<TARGET_FILE:${PLUGIN_NAME}>"
VERBATIM
COMMAND_EXPAND_LISTS
)
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES PREFIX "")
ENDIF()

View File

@@ -63,7 +63,10 @@ IF(WIN32)
MESSAGE(WARNING "Unknown target architecture: ${MSVC_TARGET_PLATFORM}")
ENDIF()
IF(MSVC_VER VERSION_GREATER 19.20 OR MSVC_VER VERSION_EQUAL 19.20)
IF(MSVC_VER VERSION_GREATER 19.30 OR MSVC_VER VERSION_EQUAL 19.30)
SET(LMMS_MSVC_GENERATOR "Visual Studio 17 2022")
SET(LMMS_MSVC_YEAR 2022)
ELSEIF(MSVC_VER VERSION_GREATER 19.20 OR MSVC_VER VERSION_EQUAL 19.20)
SET(LMMS_MSVC_GENERATOR "Visual Studio 16 2019")
SET(LMMS_MSVC_YEAR 2019) # Qt only provides binaries for MSVC 2017, but 2019 is binary compatible
ELSEIF(MSVC_VER VERSION_GREATER 19.10 OR MSVC_VER VERSION_EQUAL 19.10)

View File

@@ -0,0 +1,73 @@
# Copyright (c) 2022 Dominic Clark
#
# Redistribution and use is allowed according to the terms of the New BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# Return if we already have FluidSynth
if(TARGET fluidsynth)
set(FluidSynth_FOUND 1)
return()
endif()
# Attempt to find FluidSynth using PkgConfig
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(FLUIDSYNTH_PKG fluidsynth)
endif()
# Find the library and headers using the results from PkgConfig as a guide
find_path(FluidSynth_INCLUDE_DIR
NAMES "fluidsynth.h"
HINTS ${FLUIDSYNTH_PKG_INCLUDE_DIRS}
)
find_library(FluidSynth_LIBRARY
NAMES "fluidsynth"
HINTS ${FLUIDSYNTH_PKG_LIBRARY_DIRS}
)
if(FluidSynth_INCLUDE_DIR AND FluidSynth_LIBRARY)
add_library(fluidsynth UNKNOWN IMPORTED)
set_target_properties(fluidsynth PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${FluidSynth_INCLUDE_DIR}"
)
if(VCPKG_INSTALLED_DIR)
include(ImportedTargetHelpers)
_get_vcpkg_library_configs(FluidSynth_IMPLIB_RELEASE FluidSynth_IMPLIB_DEBUG "${FluidSynth_LIBRARY}")
else()
set(FluidSynth_IMPLIB_RELEASE "${FluidSynth_LIBRARY}")
endif()
if(FluidSynth_IMPLIB_DEBUG)
set_target_properties(fluidsynth PROPERTIES
IMPORTED_LOCATION_RELEASE "${FluidSynth_IMPLIB_RELEASE}"
IMPORTED_LOCATION_DEBUG "${FluidSynth_IMPLIB_DEBUG}"
)
else()
set_target_properties(fluidsynth PROPERTIES
IMPORTED_LOCATION "${FluidSynth_IMPLIB_RELEASE}"
)
endif()
if(EXISTS "${FluidSynth_INCLUDE_DIR}/fluidsynth/version.h")
file(STRINGS
"${FluidSynth_INCLUDE_DIR}/fluidsynth/version.h"
_version_string
REGEX "^#[\t ]*define[\t ]+FLUIDSYNTH_VERSION[\t ]+\".*\""
)
string(REGEX REPLACE
"^.*FLUIDSYNTH_VERSION[\t ]+\"([^\"]*)\".*$"
"\\1"
FluidSynth_VERSION_STRING
"${_version_string}"
)
unset(_version_string)
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FluidSynth
REQUIRED_VARS FluidSynth_LIBRARY FluidSynth_INCLUDE_DIR
VERSION_VAR FluidSynth_VERSION_STRING
)

View File

@@ -1,16 +1,37 @@
# - Try to find LAME
# Once done this will define
#
# LAME_FOUND - system has liblame
# LAME_INCLUDE_DIRS - the liblame include directory
# LAME_LIBRARIES - The liblame libraries
# Lame_FOUND - system has liblame
# Lame_INCLUDE_DIRS - the liblame include directory
# Lame_LIBRARIES - The liblame libraries
# mp3lame::mp3lame - an imported target providing lame
find_path(LAME_INCLUDE_DIRS lame/lame.h)
find_library(LAME_LIBRARIES mp3lame)
find_package(mp3lame CONFIG QUIET)
if(TARGET mp3lame::mp3lame)
# Extract details for find_package_handle_standard_args
get_target_property(Lame_LIBRARIES mp3lame::mp3lame LOCATION)
get_target_property(Lame_INCLUDE_DIRS mp3lame::mp3lame INTERFACE_INCLUDE_DIRECTORIES)
else()
find_path(Lame_INCLUDE_DIRS lame/lame.h)
find_library(Lame_LIBRARIES mp3lame)
list(APPEND Lame_DEFINITIONS HAVE_LIBMP3LAME=1)
mark_as_advanced(Lame_INCLUDE_DIRS Lame_LIBRARIES Lame_DEFINITIONS)
if(Lame_LIBRARIES AND Lame_INCLUDE_DIRS)
add_library(mp3lame::mp3lame UNKNOWN IMPORTED)
set_target_properties(mp3lame::mp3lame PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Lame_INCLUDE_DIRS}"
INTERFACE_COMPILE_DEFINITIONS "${Lame_DEFINITIONS}"
IMPORTED_LOCATION "${Lame_LIBRARIES}"
)
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Lame DEFAULT_MSG LAME_INCLUDE_DIRS LAME_LIBRARIES)
list(APPEND LAME_DEFINITIONS -DHAVE_LIBMP3LAME=1)
mark_as_advanced(LAME_INCLUDE_DIRS LAME_LIBRARIES LAME_DEFINITIONS)
find_package_handle_standard_args(Lame
REQUIRED_VARS Lame_LIBRARIES Lame_INCLUDE_DIRS
)

View File

@@ -1,36 +1,44 @@
# - Try to find Portaudio
# Once done this will define
#
# PORTAUDIO_FOUND - system has Portaudio
# PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory
# PORTAUDIO_LIBRARIES - Link these to use Portaudio
# PORTAUDIO_DEFINITIONS - Compiler switches required for using Portaudio
#
# Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
# Copyright (c) 2022 Dominic Clark
#
# Redistribution and use is allowed according to the terms of the New BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
# Try config mode if possible
find_package(portaudio CONFIG QUIET)
if (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
# in cache already
set(PORTAUDIO_FOUND TRUE)
else (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
include(FindPkgConfig)
pkg_check_modules(PORTAUDIO portaudio-2.0)
if (PORTAUDIO_FOUND)
if (NOT Portaudio_FIND_QUIETLY)
message(STATUS "Found Portaudio: ${PORTAUDIO_LIBRARIES}")
endif (NOT Portaudio_FIND_QUIETLY)
else (PORTAUDIO_FOUND)
if (Portaudio_FIND_REQUIRED)
message(FATAL_ERROR "Could not find Portaudio")
endif (Portaudio_FIND_REQUIRED)
endif (PORTAUDIO_FOUND)
if(TARGET portaudio)
# Extract details for find_package_handle_standard_args
get_target_property(Portaudio_LIBRARY portaudio LOCATION)
get_target_property(Portaudio_INCLUDE_DIR portaudio INTERFACE_INCLUDE_DIRECTORIES)
else()
# Attempt to find PortAudio using PkgConfig, if we have it
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PORTAUDIO_PKG portaudio-2.0)
endif()
# show the PORTAUDIO_INCLUDE_DIRS and PORTAUDIO_LIBRARIES variables only in the advanced view
mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
# Find the library and headers using the results from PkgConfig as a guide
find_library(Portaudio_LIBRARY
NAMES "portaudio"
HINTS ${PORTAUDIO_PKG_LIBRARY_DIRS}
)
endif (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
find_path(Portaudio_INCLUDE_DIR
NAMES "portaudio.h"
HINTS ${PORTAUDIO_PKG_INCLUDE_DIRS}
)
# Create an imported target for PortAudio if we succeeded in finding it.
if(Portaudio_LIBRARY AND Portaudio_INCLUDE_DIR)
add_library(portaudio UNKNOWN IMPORTED)
set_target_properties(portaudio PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Portaudio_INCLUDE_DIR}"
IMPORTED_LOCATION "${Portaudio_LIBRARY}"
)
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Portaudio
REQUIRED_VARS Portaudio_LIBRARY Portaudio_INCLUDE_DIR
)

View File

@@ -1,60 +1,20 @@
# This module defines
# SDL2::SDL2, a target providing SDL2 itself
# SDL2::SDL2main, a target providing an entry point for applications
# SDL2_LIBRARY, the name of the library to link against
# SDL2_FOUND, if false, do not try to link to SDL2
# SDL2_INCLUDE_DIR, where to find SDL.h
#
# This module responds to the the flag:
# SDL2_BUILDING_LIBRARY
# If this is defined, then no SDL2::SDL2main target will be created because
# only applications need main().
# Otherwise, it is assumed you are building an application and this
# module will attempt to locate and set the the proper link flags
# as part of the SDL2::SDL2main target.
#
# Don't forget to include SDLmain.h and SDLmain.m your project for the
# OS X framework based version. (Other versions link to -lSDL2main which
# this module will try to find on your behalf.) Also for OS X, this
# module will automatically add the -framework Cocoa on your behalf.
#
#
# Additional Note: If you see an empty SDL2_LIBRARY in your configuration, it
# means CMake did not find your SDL2 library (SDL2.dll, libsdl2.so,
# SDL2.framework, etc).
# Set SDL2_LIBRARY to point to your SDL2 library, and configure again.
# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value
# as appropriate.
#
#
# Modified by Dominic Clark.
# Added modern CMake targets to match those SDL2 itself uses.
#
# $SDL2DIR is an environment variable that would
# correspond to the ./configure --prefix=$SDL2DIR
# used in building SDL2.
# l.e.galup 9-20-02
#
# Modified by Eric Wing.
# Added code to assist with automated building by using environmental variables
# and providing a more controlled/consistent search behavior.
# Added new modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
# Also corrected the header search path to follow "proper" SDL guidelines.
# Added a search for SDL2main which is needed by some platforms.
# Added a search for threads which is needed by some platforms.
# Added needed compile switches for MinGW.
#
# On OSX, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# SDL2_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
#
# Note that the header path has changed from SDL2/SDL.h to just SDL.h
# This needed to change because "proper" SDL convention
# is #include "SDL.h", not <SDL2/SDL.h>. This is done for portability
# reasons because not all systems place things in SDL2/ (see FreeBSD).
# $SDL2DIR is an environment variable that would
# correspond to the ./configure --prefix=$SDL2DIR
# used in building SDL2.
#
# Modified by Eric Wing, l.e.galup, and Dominic Clark
#
#=============================================================================
# Copyright 2003-2009 Kitware, Inc.
#
@@ -68,110 +28,91 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# message("<FindSDL2.cmake>")
# Try config mode first - anything SDL2 itself provides is likely to be more
# reliable than our guesses.
find_package(SDL2 CONFIG QUIET)
SET(SDL2_SEARCH_PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
${SDL2_PATH}
)
FIND_PATH(SDL2_INCLUDE_DIR SDL.h
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES SDL2 include/SDL2 include
PATHS ${SDL2_SEARCH_PATHS}
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(PATH_SUFFIXES lib64 lib/x64 lib)
else()
set(PATH_SUFFIXES lib/x86 lib)
endif()
FIND_LIBRARY(SDL2_LIBRARY
NAMES SDL2
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES ${PATH_SUFFIXES}
PATHS ${SDL2_SEARCH_PATHS}
)
IF(NOT SDL2_BUILDING_LIBRARY)
IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
# Non-OS X framework versions expect you to also dynamically link to
# SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
# seem to provide SDL2main for compatibility even though they don't
# necessarily need it.
FIND_LIBRARY(SDL2MAIN_LIBRARY
NAMES SDL2main
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES ${PATH_SUFFIXES}
PATHS ${SDL2_SEARCH_PATHS}
)
ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
ENDIF(NOT SDL2_BUILDING_LIBRARY)
# SDL2 may require threads on your system.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# But for non-OSX systems, I will use the CMake Threads package.
IF(NOT APPLE)
FIND_PACKAGE(Threads)
ENDIF(NOT APPLE)
# MinGW needs an additional link flag, -mwindows
# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -mwindows
IF(MINGW)
SET(MINGW32_LIBRARY mingw32 "-mwindows" CACHE STRING "mwindows for MinGW")
ENDIF(MINGW)
IF(SDL2_LIBRARY)
ADD_LIBRARY(SDL2::SDL2 UNKNOWN IMPORTED)
SET_TARGET_PROPERTIES(SDL2::SDL2 PROPERTIES
IMPORTED_LOCATION "${SDL2_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}"
if(TARGET SDL2::SDL2)
# Extract details for find_package_handle_standard_args
get_target_property(SDL2_LIBRARY SDL2::SDL2 LOCATION)
get_target_property(SDL2_INCLUDE_DIR SDL2::SDL2 INTERFACE_INCLUDE_DIRECTORIES)
else()
set(SDL2_SEARCH_PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
${SDL2_PATH}
)
# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
IF(APPLE)
SET_PROPERTY(TARGET SDL2::SDL2 APPEND PROPERTY
INTERFACE_LINK_OPTIONS "-framework Cocoa"
)
ENDIF(APPLE)
# For threads, as mentioned Apple doesn't need this.
# In fact, there seems to be a problem if I used the Threads package
# and try using this line, so I'm just skipping it entirely for OS X.
IF(NOT APPLE AND Threads_FOUND)
SET_PROPERTY(TARGET SDL2::SDL2 APPEND PROPERTY
INTERFACE_LINK_LIBRARIES "Threads::Threads"
)
ENDIF(NOT APPLE AND Threads_FOUND)
ENDIF(SDL2_LIBRARY)
IF(NOT SDL2_BUILDING_LIBRARY AND SDL2MAIN_LIBRARY)
ADD_LIBRARY(SDL2::SDL2main STATIC IMPORTED)
SET_TARGET_PROPERTIES(SDL2::SDL2main PROPERTIES
IMPORTED_LOCATION "${SDL2MAIN_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}"
find_path(SDL2_INCLUDE_DIR
NAMES SDL.h
HINTS $ENV{SDL2DIR} ${SDL2_INCLUDE_DIRS}
PATH_SUFFIXES SDL2 include/SDL2 include
PATHS ${SDL2_SEARCH_PATHS}
)
IF(MINGW)
SET_PROPERTY(TARGET SDL2::SDL2main APPEND PROPERTY
INTERFACE_LINK_OPTIONS "${MINGW32_LIBRARY}"
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(PATH_SUFFIXES lib64 lib/x64 lib)
else()
set(PATH_SUFFIXES lib/x86 lib)
endif()
find_library(SDL2_LIBRARY
NAMES SDL2
HINTS $ENV{SDL2DIR} ${SDL2_LIBDIR}
PATH_SUFFIXES ${PATH_SUFFIXES}
PATHS ${SDL2_SEARCH_PATHS}
)
# SDL2 may require threads on your system.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# But for non-OSX systems, I will use the CMake Threads package.
if(NOT APPLE)
find_package(Threads)
endif()
if(SDL2_LIBRARY AND SDL2_INCLUDE_DIR)
add_library(SDL2::SDL2 UNKNOWN IMPORTED)
set_target_properties(SDL2::SDL2 PROPERTIES
IMPORTED_LOCATION "${SDL2_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}"
)
ENDIF(MINGW)
ENDIF(NOT SDL2_BUILDING_LIBRARY AND SDL2MAIN_LIBRARY)
# message("</FindSDL2.cmake>")
# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
if(APPLE)
set_property(TARGET SDL2::SDL2 APPEND PROPERTY
INTERFACE_LINK_OPTIONS "-framework Cocoa"
)
endif()
INCLUDE(FindPackageHandleStandardArgs)
# For threads, as mentioned Apple doesn't need this.
# In fact, there seems to be a problem if I used the Threads package
# and try using this line, so I'm just skipping it entirely for OS X.
if(NOT APPLE AND Threads_FOUND)
set_property(TARGET SDL2::SDL2 APPEND PROPERTY
INTERFACE_LINK_LIBRARIES "Threads::Threads"
)
endif()
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)
if(EXISTS "${SDL2_INCLUDE_DIR}/SDL_version.h")
file(READ "${SDL2_INCLUDE_DIR}/SDL_version.h" _sdl_version_h)
string(REGEX REPLACE ".*#[\t ]*define[\t ]+SDL_MAJOR_VERSION[\t ]+([0-9]+).*" "\\1" SDL2_VERSION_MAJOR "${_sdl_version_h}")
string(REGEX REPLACE ".*#[\t ]*define[\t ]+SDL_MINOR_VERSION[\t ]+([0-9]+).*" "\\1" SDL2_VERSION_MINOR "${_sdl_version_h}")
string(REGEX REPLACE ".*#[\t ]*define[\t ]+SDL_PATCHLEVEL[\t ]+([0-9]+).*" "\\1" SDL2_VERSION_PATCH "${_sdl_version_h}")
set(SDL2_VERSION "${SDL2_VERSION_MAJOR}.${SDL2_VERSION_MINOR}.${SDL2_VERSION_PATCH}")
unset(_sdl_version_h)
endif()
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SDL2
REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR
VERSION_VAR SDL2_VERSION
)

View File

@@ -1,20 +1,32 @@
FIND_PATH(STK_INCLUDE_DIR Stk.h /usr/include/stk /usr/local/include/stk ${CMAKE_INSTALL_PREFIX}/include/stk ${CMAKE_FIND_ROOT_PATH}/include/stk)
# Try config mode first
find_package(unofficial-libstk CONFIG QUIET)
FIND_LIBRARY(STK_LIBRARY NAMES stk PATH /usr/lib /usr/local/lib ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_FIND_ROOT_PATH}/lib)
if(TARGET unofficial::libstk::libstk)
# Extract details for find_package_handle_standard_args
get_target_property(STK_LIBRARY unofficial::libstk::libstk LOCATION)
get_target_property(STK_INCLUDE_DIR unofficial::libstk::libstk INTERFACE_INCLUDE_DIRECTORIES)
else()
find_path(STK_INCLUDE_DIR
NAMES stk/Stk.h
PATH /usr/include /usr/local/include "${CMAKE_INSTALL_PREFIX}/include" "${CMAKE_FIND_ROOT_PATH}/include"
)
IF (STK_INCLUDE_DIR AND STK_LIBRARY)
SET(STK_FOUND TRUE)
ENDIF (STK_INCLUDE_DIR AND STK_LIBRARY)
find_library(STK_LIBRARY
NAMES stk
PATH /usr/lib /usr/local/lib "${CMAKE_INSTALL_PREFIX}/lib" "${CMAKE_FIND_ROOT_PATH}/lib"
)
if(STK_INCLUDE_DIR AND STK_LIBRARY)
# Yes, this target name is hideous, but it matches that provided by vcpkg
add_library(unofficial::libstk::libstk UNKNOWN IMPORTED)
set_target_properties(unofficial::libstk::libstk PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${STK_INCLUDE_DIR}"
IMPORTED_LOCATION "${STK_LIBRARY}"
)
endif()
endif()
IF (STK_FOUND)
IF (NOT STK_FIND_QUIETLY)
MESSAGE(STATUS "Found STK: ${STK_LIBRARY}")
SET(HAVE_STK TRUE)
ENDIF (NOT STK_FIND_QUIETLY)
ELSE (STK_FOUND)
IF (STK_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find STK")
ENDIF (STK_FIND_REQUIRED)
ENDIF (STK_FOUND)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(STK
REQUIRED_VARS STK_LIBRARY STK_INCLUDE_DIR
)

View File

@@ -0,0 +1,57 @@
# Given a library in vcpkg, find appropriate debug and release versions. If only
# one version exists, it is used as the release version, and the debug version
# is not set.
function(_get_vcpkg_library_configs _release_out _debug_out _library)
# We want to do all operations within the vcpkg directory
file(RELATIVE_PATH _lib_relative "${VCPKG_INSTALLED_DIR}" "${_library}")
# Return early if we're not using vcpkg
if(IS_ABSOLUTE _lib_relative OR _lib_relative MATCHES "^\\.\\./")
set("${_release_out}" "${_library}" PARENT_SCOPE)
return()
endif()
string(REPLACE "/" ";" _path_bits "${_lib_relative}")
# Determine whether we were given the debug or release version
list(FIND _path_bits "debug" _debug_index)
if(_debug_index EQUAL -1)
# We have the release version, so use it
set(_release_lib "${_library}")
# Try to find a debug version too
list(FIND _path_bits "lib" _lib_index)
if(_lib_index GREATER_EQUAL 0)
list(INSERT _path_bits "${_lib_index}" "debug")
list(INSERT _path_bits 0 "${VCPKG_INSTALLED_DIR}")
string(REPLACE ";" "/" _debug_lib "${_path_bits}")
if(NOT EXISTS "${_debug_lib}")
# Debug version does not exist - only use given version
unset(_debug_lib)
endif()
endif()
else()
# We have the debug version, so try to find a release version too
list(REMOVE_AT _path_bits "${_debug_index}")
list(INSERT _path_bits 0 "${VCPKG_INSTALLED_DIR}")
string(REPLACE ";" "/" _release_lib "${_path_bits}")
if(NOT EXISTS "${_release_lib}")
# Release version does not exist - only use given version
set(_release_lib "${_library}")
else()
# Release version exists, so use given version as debug
set(_debug_lib "${_library}")
endif()
endif()
# Set output variables appropriately
if(_debug_lib)
set("${_release_out}" "${_release_lib}" PARENT_SCOPE)
set("${_debug_out}" "${_debug_lib}" PARENT_SCOPE)
else()
set("${_release_out}" "${_release_lib}" PARENT_SCOPE)
unset("${_debug_out}" PARENT_SCOPE)
endif()
endfunction()

View File

@@ -1,6 +1,5 @@
#!/usr/bin/env bash
# lmms(1) completion -*- shell-script -*-
# use shellcheck: "shellcheck -e bash <filename>"
_lmms_array_contains ()
{

View File

@@ -143,7 +143,7 @@ private:
void *hostApiSpecificStreamInfo;
} PaStreamParameters;
#endif
#endif // PORTAUDIO_V19
PaStream * m_paStream;
PaStreamParameters m_outputParameters;

View File

@@ -102,6 +102,6 @@ private:
} // namespace lmms
#endif
#endif // LMMS_HAVE_PULSEAUDIO
#endif

View File

@@ -87,6 +87,6 @@ private:
} // namespace lmms
#endif /* LMMS_HAVE_SNDIO */
#endif // LMMS_HAVE_SNDIO
#endif /* _AUDIO_SNDIO_H */
#endif // _AUDIO_SNDIO_H

View File

@@ -93,6 +93,12 @@ public:
return m_length;
}
/*! \brief Specify whether or not a TCO automatically resizes.
*
* If a TCO does automatically resize, it cannot be manually
* resized by clicking and dragging its edge.
*
*/
inline void setAutoResize( const bool r )
{
m_autoResize = r;

View File

@@ -50,7 +50,7 @@ public:
} ;
}
} // namespace gui
class DummyEffectControls : public EffectControls
{

View File

@@ -66,6 +66,6 @@ protected:
} ;
} // namesplace lmms
} // namespace lmms
#endif

View File

@@ -22,6 +22,8 @@
*
*/
#ifndef IO_HELPER_H
#define IO_HELPER_H
#include "lmmsconfig.h"
@@ -37,7 +39,7 @@
#ifdef LMMS_HAVE_UNISTD_H
#include <unistd.h>
#endif
#endif
#endif // LMMS_BUILD_WIN32
namespace lmms
{
@@ -87,4 +89,6 @@ int fileToDescriptor(FILE* f, bool closeFile = true)
}
} // namespace lmms
} // namespace lmms
#endif

View File

@@ -23,12 +23,12 @@
*
*/
#include <QWidget>
#include "lmms_export.h"
#ifndef LMMSPALETTE_H
#define LMMSPALETTE_H
#include <QWidget>
#include "lmms_export.h"
namespace lmms::gui
{

View File

@@ -73,6 +73,6 @@ private:
} // namespace lmms
#endif /* LMMS_HAVE_SNDIO */
#endif // LMMS_HAVE_SNDIO
#endif /* _MIDI_SNDIO_H */
#endif // _MIDI_SNDIO_H

View File

@@ -82,7 +82,7 @@ private:
InstrumentTrack* m_instrumentTrack;
MidiEventProcessor* m_midiEvProc;
bool m_pressedKeys[NumKeys];
std::array<bool, NumKeys> m_pressedKeys = {};
} ;

View File

@@ -341,7 +341,7 @@ private:
std::atomic_int m_lockDepth;
} ;
#endif
#endif // SYNC_WITH_SHM_FIFO
@@ -530,7 +530,7 @@ public:
writeInt( len );
write( _s.c_str(), len );
}
#endif
#endif // SYNC_WITH_SHM_FIFO
#ifndef BUILD_REMOTE_PLUGIN_CLIENT
inline bool messagesLeft()
@@ -562,7 +562,7 @@ public:
{
return waitDepthCounter() > 0;
}
#endif
#endif // BUILD_REMOTE_PLUGIN_CLIENT
virtual bool processMessage( const message & _m ) = 0;
@@ -667,7 +667,7 @@ private:
pthread_mutex_t m_receiveMutex;
pthread_mutex_t m_sendMutex;
#endif
#endif // SYNC_WITH_SHM_FIFO
} ;

View File

@@ -173,7 +173,7 @@ private:
std::condition_variable m_cv;
std::thread m_thread;
};
#endif
#endif // LMMS_BUILD_WIN32
#ifdef SYNC_WITH_SHM_FIFO
RemotePluginClient::RemotePluginClient( const std::string& _shm_in, const std::string& _shm_out ) :

View File

@@ -148,6 +148,7 @@ public:
return "trackcontainerview";
}
unsigned int totalHeightOfTracks() const;
RubberBand *rubberBand() const;
@@ -206,10 +207,9 @@ private:
RubberBand * m_rubberBand;
signals:
void positionChanged( const lmms::TimePos & _pos );
void tracksRealigned();
} ;

View File

@@ -33,7 +33,7 @@
#ifndef NDEBUG
#define NDEBUG
#endif
#endif
#endif // LMMS_DEBUG
#include <cassert>
#include <cstdio>

View File

@@ -65,7 +65,7 @@ inline QPixmap getIconPixmap( const QString& _name,
}
//QString getText( const char * _name );
}
} // namespace PLUGIN_NAME
#endif // PLUGIN_NAME

View File

@@ -118,7 +118,7 @@ static inline float absFraction( float _x )
}
#endif
#endif
#endif // __INTEL_COMPILER
@@ -153,7 +153,7 @@ static inline long double fastFmal( long double a, long double b, long double c
#endif
#else
return a * b + c;
#endif
#endif // FP_FAST_FMAL
}
//! @brief Takes advantage of fmaf() function if present in hardware
@@ -167,7 +167,7 @@ static inline float fastFmaf( float a, float b, float c )
#endif
#else
return a * b + c;
#endif
#endif // FP_FAST_FMAF
}
//! @brief Takes advantage of fma() function if present in hardware

View File

@@ -1,3 +1,6 @@
#ifndef VERSION_INFO_H
#define VERSION_INFO_H
#include "lmms_basics.h"
#ifdef __GNUC__
@@ -47,3 +50,5 @@ constexpr const char* LMMS_BUILDCONF_PLATFORM = "win32";
#ifdef LMMS_BUILD_HAIKU
constexpr const char* LMMS_BUILDCONF_PLATFORM = "Haiku";
#endif
#endif

View File

@@ -43,27 +43,27 @@ AmplifierControlDialog::AmplifierControlDialog( AmplifierControls* controls ) :
setPalette( pal );
setFixedSize( 100, 110 );
Knob * volumeKnob = new Knob( knobBright_26, this);
auto volumeKnob = new Knob(knobBright_26, this);
volumeKnob -> move( 16, 10 );
volumeKnob -> setVolumeKnob( true );
volumeKnob->setModel( &controls->m_volumeModel );
volumeKnob->setLabel( tr( "VOL" ) );
volumeKnob->setHintText( tr( "Volume:" ) , "%" );
Knob * panKnob = new Knob( knobBright_26, this);
auto panKnob = new Knob(knobBright_26, this);
panKnob -> move( 57, 10 );
panKnob->setModel( &controls->m_panModel );
panKnob->setLabel( tr( "PAN" ) );
panKnob->setHintText( tr( "Panning:" ) , "" );
Knob * leftKnob = new Knob( knobBright_26, this);
auto leftKnob = new Knob(knobBright_26, this);
leftKnob -> move( 16, 65 );
leftKnob -> setVolumeKnob( true );
leftKnob->setModel( &controls->m_leftModel );
leftKnob->setLabel( tr( "LEFT" ) );
leftKnob->setHintText( tr( "Left gain:" ) , "%" );
Knob * rightKnob = new Knob( knobBright_26, this);
auto rightKnob = new Knob(knobBright_26, this);
rightKnob -> move( 57, 65 );
rightKnob -> setVolumeKnob( true );
rightKnob->setModel( &controls->m_rightModel );

View File

@@ -426,9 +426,9 @@ void AudioFileProcessor::loopPointChanged()
void AudioFileProcessor::pointChanged()
{
const f_cnt_t f_start = static_cast<f_cnt_t>( m_startPointModel.value() * m_sampleBuffer.frames() );
const f_cnt_t f_end = static_cast<f_cnt_t>( m_endPointModel.value() * m_sampleBuffer.frames() );
const f_cnt_t f_loop = static_cast<f_cnt_t>( m_loopPointModel.value() * m_sampleBuffer.frames() );
const auto f_start = static_cast<f_cnt_t>(m_startPointModel.value() * m_sampleBuffer.frames());
const auto f_end = static_cast<f_cnt_t>(m_endPointModel.value() * m_sampleBuffer.frames());
const auto f_loop = static_cast<f_cnt_t>(m_loopPointModel.value() * m_sampleBuffer.frames());
m_nextPlayStartPoint = f_start;
m_nextPlayBackwards = false;
@@ -479,7 +479,7 @@ AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument,
// loop button group
PixmapButton * m_loopOffButton = new PixmapButton( this );
auto m_loopOffButton = new PixmapButton(this);
m_loopOffButton->setCheckable( true );
m_loopOffButton->move( 190, 105 );
m_loopOffButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
@@ -488,8 +488,7 @@ AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument,
"loop_off_off" ) );
m_loopOffButton->setToolTip(tr("Disable loop"));
PixmapButton * m_loopOnButton = new PixmapButton( this );
auto m_loopOnButton = new PixmapButton(this);
m_loopOnButton->setCheckable( true );
m_loopOnButton->move( 190, 124 );
m_loopOnButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
@@ -498,7 +497,7 @@ AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument,
"loop_on_off" ) );
m_loopOnButton->setToolTip(tr("Enable loop"));
PixmapButton * m_loopPingPongButton = new PixmapButton( this );
auto m_loopPingPongButton = new PixmapButton(this);
m_loopPingPongButton->setCheckable( true );
m_loopPingPongButton->move( 216, 124 );
m_loopPingPongButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
@@ -645,9 +644,9 @@ void AudioFileProcessorView::paintEvent( QPaintEvent * )
p.drawPixmap( 0, 0, *s_artwork );
AudioFileProcessor * a = castModel<AudioFileProcessor>();
auto a = castModel<AudioFileProcessor>();
QString file_name = "";
QString file_name = "";
int idx = a->m_sampleBuffer.audioFile().length();
p.setFont( pointSize<8>( font() ) );
@@ -702,7 +701,7 @@ void AudioFileProcessorView::openAudioFile()
void AudioFileProcessorView::modelChanged()
{
AudioFileProcessor * a = castModel<AudioFileProcessor>();
auto a = castModel<AudioFileProcessor>();
connect( &a->m_sampleBuffer, SIGNAL( sampleUpdated() ),
this, SLOT( sampleUpdated() ) );
m_ampKnob->setModel( &a->m_ampModel );

View File

@@ -45,22 +45,22 @@ BassBoosterControlDialog::BassBoosterControlDialog( BassBoosterControls* control
setPalette( pal );
setFixedSize( 120, 60 );
QVBoxLayout * tl = new QVBoxLayout( this );
auto tl = new QVBoxLayout(this);
tl->addSpacing( 4 );
QHBoxLayout * l = new QHBoxLayout;
auto l = new QHBoxLayout;
Knob * freqKnob = new Knob( knobBright_26, this);
auto freqKnob = new Knob(knobBright_26, this);
freqKnob->setModel( &controls->m_freqModel );
freqKnob->setLabel( tr( "FREQ" ) );
freqKnob->setHintText( tr( "Frequency:" ) , "Hz" );
Knob * gainKnob = new Knob( knobBright_26, this );
auto gainKnob = new Knob(knobBright_26, this);
gainKnob->setModel( &controls->m_gainModel );
gainKnob->setLabel( tr( "GAIN" ) );
gainKnob->setHintText( tr( "Gain:" ) , "" );
Knob * ratioKnob = new Knob( knobBright_26, this );
auto ratioKnob = new Knob(knobBright_26, this);
ratioKnob->setModel( &controls->m_ratioModel );
ratioKnob->setLabel( tr( "RATIO" ) );
ratioKnob->setHintText( tr( "Ratio:" ) , "" );

View File

@@ -103,10 +103,8 @@ BSynth::~BSynth()
sample_t BSynth::nextStringSample( float sample_length )
{
float sample_step =
static_cast<float>( sample_length / ( sample_rate / nph->frequency() ) );
auto sample_step = static_cast<float>(sample_length / (sample_rate / nph->frequency()));
// check overflow
while (sample_realindex >= sample_length) {
sample_realindex -= sample_length;
@@ -299,7 +297,7 @@ void BitInvader::playNote( NotePlayHandle * _n,
const fpp_t frames = _n->framesLeftForCurrentPeriod();
const f_cnt_t offset = _n->noteOffset();
BSynth * ps = static_cast<BSynth *>( _n->m_pluginData );
auto ps = static_cast<BSynth*>(_n->m_pluginData);
for( fpp_t frame = offset; frame < frames + offset; ++frame )
{
const sample_t cur = ps->nextStringSample( m_graph.length() );
@@ -472,7 +470,7 @@ BitInvaderView::BitInvaderView( Instrument * _instrument,
void BitInvaderView::modelChanged()
{
BitInvader * b = castModel<BitInvader>();
auto b = castModel<BitInvader>();
m_graph->setModel( &b->m_graph );
m_sampleLengthKnob->setModel( &b->m_sampleLength );

32
plugins/Bitcrush/BitcrushControlDialog.cpp Executable file → Normal file
View File

@@ -46,20 +46,20 @@ BitcrushControlDialog::BitcrushControlDialog( BitcrushControls * controls ) :
setFixedSize( 181, 128 );
// labels
QLabel * inLabel = new QLabel( tr( "IN" ), this );
auto inLabel = new QLabel(tr("IN"), this);
inLabel->move( 24, 15 );
QLabel * outLabel = new QLabel( tr( "OUT" ), this );
auto outLabel = new QLabel(tr("OUT"), this);
outLabel->move( 139, 15 );
// input knobs
Knob * inGain = new Knob( knobBright_26, this );
auto inGain = new Knob(knobBright_26, this);
inGain->move( 16, 32 );
inGain->setModel( & controls->m_inGain );
inGain->setLabel( tr( "GAIN" ) );
inGain->setHintText( tr( "Input gain:" ) , " dBFS" );
Knob * inNoise = new Knob( knobBright_26, this );
auto inNoise = new Knob(knobBright_26, this);
inNoise->move( 14, 76 );
inNoise->setModel( & controls->m_inNoise );
inNoise->setLabel( tr( "NOISE" ) );
@@ -67,13 +67,13 @@ BitcrushControlDialog::BitcrushControlDialog( BitcrushControls * controls ) :
// output knobs
Knob * outGain = new Knob( knobBright_26, this );
auto outGain = new Knob(knobBright_26, this);
outGain->move( 138, 32 );
outGain->setModel( & controls->m_outGain );
outGain->setLabel( tr( "GAIN" ) );
outGain->setHintText( tr( "Output gain:" ) , " dBFS" );
Knob * outClip = new Knob( knobBright_26, this );
auto outClip = new Knob(knobBright_26, this);
outClip->move( 138, 76 );
outClip->setModel( & controls->m_outClip );
outClip->setLabel( tr( "CLIP" ) );
@@ -82,25 +82,25 @@ BitcrushControlDialog::BitcrushControlDialog( BitcrushControls * controls ) :
// leds
LedCheckBox * rateEnabled = new LedCheckBox( "", this, tr( "Rate enabled" ), LedCheckBox::Green );
auto rateEnabled = new LedCheckBox("", this, tr("Rate enabled"), LedCheckBox::Green);
rateEnabled->move( 64, 14 );
rateEnabled->setModel( & controls->m_rateEnabled );
rateEnabled->setToolTip(tr("Enable sample-rate crushing"));
LedCheckBox * depthEnabled = new LedCheckBox( "", this, tr( "Depth enabled" ), LedCheckBox::Green );
auto depthEnabled = new LedCheckBox("", this, tr("Depth enabled"), LedCheckBox::Green);
depthEnabled->move( 101, 14 );
depthEnabled->setModel( & controls->m_depthEnabled );
depthEnabled->setToolTip(tr("Enable bit-depth crushing"));
// rate crushing knobs
Knob * rate = new Knob( knobBright_26, this );
auto rate = new Knob(knobBright_26, this);
rate->move( 59, 32 );
rate->setModel( & controls->m_rate );
rate->setLabel( tr( "FREQ" ) );
rate->setHintText( tr( "Sample rate:" ) , " Hz" );
Knob * stereoDiff = new Knob( knobBright_26, this );
auto stereoDiff = new Knob(knobBright_26, this);
stereoDiff->move( 72, 76 );
stereoDiff->setModel( & controls->m_stereoDiff );
stereoDiff->setLabel( tr( "STEREO" ) );
@@ -108,7 +108,7 @@ BitcrushControlDialog::BitcrushControlDialog( BitcrushControls * controls ) :
// depth crushing knob
Knob * levels = new Knob( knobBright_26, this );
auto levels = new Knob(knobBright_26, this);
levels->move( 92, 32 );
levels->setModel( & controls->m_levels );
levels->setLabel( tr( "QUANT" ) );

View File

@@ -42,7 +42,7 @@ BitcrushControls::BitcrushControls( BitcrushEffect * eff ) :
m_outGain( 0.0f, -20.0f, 20.0f, 0.1f, this, tr( "Output gain" ) ),
m_outClip( 0.0f, -20.0f, 20.0f, 0.1f, this, tr( "Output clip" ) ),
m_rate( 44100.f, 20.f, 44100.f, 1.0f, this, tr( "Sample rate" ) ),
m_stereoDiff( 0.f, 0.f, 50.f, 0.1f, this, tr( "Stereo difference" ) ),
m_stereoDiff( 0.f, -50.f, 50.f, 0.1f, this, tr( "Stereo difference" ) ),
m_levels( 256.f, 1.f, 256.f, 0.01f, this, tr( "Levels" ) ),
m_rateEnabled( true, this, tr( "Rate enabled" ) ),
m_depthEnabled( true, this, tr( "Depth enabled" ) )

View File

@@ -194,8 +194,8 @@ CarlaInstrument::CarlaInstrument(InstrumentTrack* const instrumentTrack, const D
fDescriptor->activate(fHandle);
// we need a play-handle which cares for calling play()
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, instrumentTrack );
Engine::audioEngine()->addPlayHandle( iph );
auto iph = new InstrumentPlayHandle(this, instrumentTrack);
Engine::audioEngine()->addPlayHandle( iph );
#if CARLA_VERSION_HEX >= CARLA_MIN_PARAM_VERSION
// text filter completion
@@ -625,8 +625,8 @@ CarlaInstrumentView::CarlaInstrumentView(CarlaInstrument* const instrument, QWid
pal.setBrush(backgroundRole(), instrument->kIsPatchbay ? PLUGIN_NAME::getIconPixmap("artwork-patchbay") : PLUGIN_NAME::getIconPixmap("artwork-rack"));
setPalette(pal);
QHBoxLayout* l = new QHBoxLayout(this);
l->setContentsMargins( 20, 180, 10, 10 );
auto l = new QHBoxLayout(this);
l->setContentsMargins( 20, 180, 10, 10 );
l->setSpacing(3);
l->setAlignment(Qt::AlignTop);
@@ -750,8 +750,8 @@ CarlaParamsView::CarlaParamsView(CarlaInstrumentView* const instrumentView, QWid
m_curOutColumn(0),
m_curOutRow(0)
{
QWidget* centralWidget = new QWidget(this);
QVBoxLayout* verticalLayout = new QVBoxLayout(centralWidget);
auto centralWidget = new QWidget(this);
auto verticalLayout = new QVBoxLayout(centralWidget);
// -- Toolbar
m_toolBarLayout = new QHBoxLayout();
@@ -794,9 +794,9 @@ CarlaParamsView::CarlaParamsView(CarlaInstrumentView* const instrumentView, QWid
m_toolBarLayout->addWidget(m_groupFilterCombo);
// -- Input params
QFrame* inputFrame = new QFrame(this);
QVBoxLayout* inputLayout = new QVBoxLayout(inputFrame);
QLabel* inputLabel = new QLabel("Input parameters", inputFrame);
auto inputFrame = new QFrame(this);
auto inputLayout = new QVBoxLayout(inputFrame);
auto inputLabel = new QLabel("Input parameters", inputFrame);
m_inputScrollArea = new QScrollArea(inputFrame);
m_inputScrollAreaWidgetContent = new QWidget();
@@ -820,9 +820,9 @@ CarlaParamsView::CarlaParamsView(CarlaInstrumentView* const instrumentView, QWid
inputLayout->addWidget(m_inputScrollArea);
// -- Output params
QFrame* outputFrame = new QFrame(this);
QVBoxLayout* outputLayout = new QVBoxLayout(outputFrame);
QLabel* outputLabel = new QLabel("Output parameters", outputFrame);
auto outputFrame = new QFrame(this);
auto outputLayout = new QVBoxLayout(outputFrame);
auto outputLabel = new QLabel("Output parameters", outputFrame);
m_outputScrollArea = new QScrollArea(outputFrame);
m_outputScrollAreaWidgetContent = new QWidget();
@@ -846,7 +846,7 @@ CarlaParamsView::CarlaParamsView(CarlaInstrumentView* const instrumentView, QWid
outputLayout->addWidget(m_outputScrollArea);
// -- QSplitter
QSplitter* splitter = new QSplitter(Qt::Vertical, this);
auto splitter = new QSplitter(Qt::Vertical, this);
// -- Add layout and widgets.
verticalLayout->addLayout(m_toolBarLayout);
@@ -866,8 +866,8 @@ CarlaParamsView::CarlaParamsView(CarlaInstrumentView* const instrumentView, QWid
#endif
// -- Sub window
CarlaParamsSubWindow* win = new CarlaParamsSubWindow(getGUI()->mainWindow()->workspace()->viewport(), Qt::SubWindow |
Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint);
auto win = new CarlaParamsSubWindow(getGUI()->mainWindow()->workspace()->viewport(),
Qt::SubWindow | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint);
m_carlaInstrumentView->m_paramsSubWindow = getGUI()->mainWindow()->workspace()->addSubWindow(win);
m_carlaInstrumentView->m_paramsSubWindow->setSizePolicy(
QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
@@ -976,7 +976,7 @@ void CarlaParamsView::filterKnobs()
}
// Add spacer so all knobs go to top
QSpacerItem* verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
auto verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
m_inputScrollAreaLayout->addItem(verticalSpacer, m_curRow+1, 0, 1, 1);
}

View File

@@ -46,19 +46,19 @@ CrossoverEQControlDialog::CrossoverEQControlDialog( CrossoverEQControls * contro
setFixedSize( 167, 178 );
// knobs
Knob * xover12 = new Knob( knobBright_26, this );
auto xover12 = new Knob(knobBright_26, this);
xover12->move( 29, 11 );
xover12->setModel( & controls->m_xover12 );
xover12->setLabel( "1/2" );
xover12->setHintText( tr( "Band 1/2 crossover:" ), " Hz" );
Knob * xover23 = new Knob( knobBright_26, this );
auto xover23 = new Knob(knobBright_26, this);
xover23->move( 69, 11 );
xover23->setModel( & controls->m_xover23 );
xover23->setLabel( "2/3" );
xover23->setHintText( tr( "Band 2/3 crossover:" ), " Hz" );
Knob * xover34 = new Knob( knobBright_26, this );
auto xover34 = new Knob(knobBright_26, this);
xover34->move( 109, 11 );
xover34->setModel( & controls->m_xover34 );
xover34->setLabel( "3/4" );
@@ -69,47 +69,43 @@ CrossoverEQControlDialog::CrossoverEQControlDialog( CrossoverEQControls * contro
m_fader_knob = QPixmap( PLUGIN_NAME::getIconPixmap( "fader_knob2" ) );
// faders
Fader * gain1 = new Fader( &controls->m_gain1, tr( "Band 1 gain" ), this,
&m_fader_bg, &m_fader_empty, &m_fader_knob );
auto gain1 = new Fader(&controls->m_gain1, tr("Band 1 gain"), this, &m_fader_bg, &m_fader_empty, &m_fader_knob);
gain1->move( 7, 56 );
gain1->setDisplayConversion( false );
gain1->setHintText( tr( "Band 1 gain:" ), " dBFS" );
Fader * gain2 = new Fader( &controls->m_gain2, tr( "Band 2 gain" ), this,
&m_fader_bg, &m_fader_empty, &m_fader_knob );
auto gain2 = new Fader(&controls->m_gain2, tr("Band 2 gain"), this, &m_fader_bg, &m_fader_empty, &m_fader_knob);
gain2->move( 47, 56 );
gain2->setDisplayConversion( false );
gain2->setHintText( tr( "Band 2 gain:" ), " dBFS" );
Fader * gain3 = new Fader( &controls->m_gain3, tr( "Band 3 gain" ), this,
&m_fader_bg, &m_fader_empty, &m_fader_knob );
auto gain3 = new Fader(&controls->m_gain3, tr("Band 3 gain"), this, &m_fader_bg, &m_fader_empty, &m_fader_knob);
gain3->move( 87, 56 );
gain3->setDisplayConversion( false );
gain3->setHintText( tr( "Band 3 gain:" ), " dBFS" );
Fader * gain4 = new Fader( &controls->m_gain4, tr( "Band 4 gain" ), this,
&m_fader_bg, &m_fader_empty, &m_fader_knob );
auto gain4 = new Fader(&controls->m_gain4, tr("Band 4 gain"), this, &m_fader_bg, &m_fader_empty, &m_fader_knob);
gain4->move( 127, 56 );
gain4->setDisplayConversion( false );
gain4->setHintText( tr( "Band 4 gain:" ), " dBFS" );
// leds
LedCheckBox * mute1 = new LedCheckBox( "", this, tr( "Band 1 mute" ), LedCheckBox::Green );
auto mute1 = new LedCheckBox("", this, tr("Band 1 mute"), LedCheckBox::Green);
mute1->move( 15, 154 );
mute1->setModel( & controls->m_mute1 );
mute1->setToolTip(tr("Mute band 1"));
LedCheckBox * mute2 = new LedCheckBox( "", this, tr( "Band 2 mute" ), LedCheckBox::Green );
auto mute2 = new LedCheckBox("", this, tr("Band 2 mute"), LedCheckBox::Green);
mute2->move( 55, 154 );
mute2->setModel( & controls->m_mute2 );
mute2->setToolTip(tr("Mute band 2"));
LedCheckBox * mute3 = new LedCheckBox( "", this, tr( "Band 3 mute" ), LedCheckBox::Green );
auto mute3 = new LedCheckBox("", this, tr("Band 3 mute"), LedCheckBox::Green);
mute3->move( 95, 154 );
mute3->setModel( & controls->m_mute3 );
mute3->setToolTip(tr("Mute band 3"));
LedCheckBox * mute4 = new LedCheckBox( "", this, tr( "Band 4 mute" ), LedCheckBox::Green );
auto mute4 = new LedCheckBox("", this, tr("Band 4 mute"), LedCheckBox::Green);
mute4->move( 135, 154 );
mute4->setModel( & controls->m_mute4 );
mute4->setToolTip(tr("Mute band 4"));

14
plugins/Delay/DelayControlsDialog.cpp Executable file → Normal file
View File

@@ -44,42 +44,42 @@ DelayControlsDialog::DelayControlsDialog( DelayControls *controls ) :
setPalette( pal );
setFixedSize( 300, 208 );
TempoSyncKnob* sampleDelayKnob = new TempoSyncKnob( knobBright_26, this );
auto sampleDelayKnob = new TempoSyncKnob(knobBright_26, this);
sampleDelayKnob->move( 10,14 );
sampleDelayKnob->setVolumeKnob( false );
sampleDelayKnob->setModel( &controls->m_delayTimeModel );
sampleDelayKnob->setLabel( tr( "DELAY" ) );
sampleDelayKnob->setHintText( tr( "Delay time" ) + " ", " s" );
Knob * feedbackKnob = new Knob( knobBright_26, this );
auto feedbackKnob = new Knob(knobBright_26, this);
feedbackKnob->move( 11, 58 );
feedbackKnob->setVolumeKnob( true) ;
feedbackKnob->setModel( &controls->m_feedbackModel);
feedbackKnob->setLabel( tr( "FDBK" ) );
feedbackKnob->setHintText( tr ( "Feedback amount" ) + " " , "" );
TempoSyncKnob * lfoFreqKnob = new TempoSyncKnob( knobBright_26, this );
auto lfoFreqKnob = new TempoSyncKnob(knobBright_26, this);
lfoFreqKnob->move( 11, 119 );
lfoFreqKnob->setVolumeKnob( false );
lfoFreqKnob->setModel( &controls->m_lfoTimeModel );
lfoFreqKnob->setLabel( tr( "RATE" ) );
lfoFreqKnob->setHintText( tr ( "LFO frequency") + " ", " s" );
TempoSyncKnob * lfoAmtKnob = new TempoSyncKnob( knobBright_26, this );
auto lfoAmtKnob = new TempoSyncKnob(knobBright_26, this);
lfoAmtKnob->move( 11, 159 );
lfoAmtKnob->setVolumeKnob( false );
lfoAmtKnob->setModel( &controls->m_lfoAmountModel );
lfoAmtKnob->setLabel( tr( "AMNT" ) );
lfoAmtKnob->setHintText( tr ( "LFO amount" ) + " " , " s" );
EqFader * outFader = new EqFader( &controls->m_outGainModel,tr( "Out gain" ),
this, &controls->m_outPeakL, &controls->m_outPeakR );
auto outFader
= new EqFader(&controls->m_outGainModel, tr("Out gain"), this, &controls->m_outPeakL, &controls->m_outPeakR);
outFader->setMaximumHeight( 196 );
outFader->move( 263, 45 );
outFader->setDisplayConversion( false );
outFader->setHintText( tr( "Gain" ), "dBFS" );
XyPad * pad = new XyPad( this, &controls->m_feedbackModel, &controls->m_delayTimeModel );
auto pad = new XyPad(this, &controls->m_feedbackModel, &controls->m_delayTimeModel);
pad->resize( 200, 200 );
pad->move( 50, 5 );
}

10
plugins/DualFilter/DualFilterControlDialog.cpp Executable file → Normal file
View File

@@ -64,10 +64,8 @@ DualFilterControlDialog::DualFilterControlDialog( DualFilterControls* controls )
gain1Knob-> setVolumeKnob( true );
gain2Knob-> setVolumeKnob( true );
LedCheckBox * enabled1Toggle = new LedCheckBox( "", this,
tr( "Filter 1 enabled" ), LedCheckBox::Green );
LedCheckBox * enabled2Toggle = new LedCheckBox( "", this,
tr( "Filter 2 enabled" ), LedCheckBox::Green );
auto enabled1Toggle = new LedCheckBox("", this, tr("Filter 1 enabled"), LedCheckBox::Green);
auto enabled2Toggle = new LedCheckBox("", this, tr("Filter 2 enabled"), LedCheckBox::Green);
enabled1Toggle -> move( 12, 11 );
enabled1Toggle -> setModel( &controls -> m_enabled1Model );
@@ -76,12 +74,12 @@ DualFilterControlDialog::DualFilterControlDialog( DualFilterControls* controls )
enabled2Toggle -> setModel( &controls -> m_enabled2Model );
enabled2Toggle->setToolTip(tr("Enable/disable filter 2"));
ComboBox * m_filter1ComboBox = new ComboBox( this );
auto m_filter1ComboBox = new ComboBox(this);
m_filter1ComboBox->setGeometry( 19, 70, 137, ComboBox::DEFAULT_HEIGHT );
m_filter1ComboBox->setFont( pointSize<8>( m_filter1ComboBox->font() ) );
m_filter1ComboBox->setModel( &controls->m_filter1Model );
ComboBox * m_filter2ComboBox = new ComboBox( this );
auto m_filter2ComboBox = new ComboBox(this);
m_filter2ComboBox->setGeometry( 217, 70, 137, ComboBox::DEFAULT_HEIGHT );
m_filter2ComboBox->setFont( pointSize<8>( m_filter2ComboBox->font() ) );
m_filter2ComboBox->setModel( &controls->m_filter2Model );

View File

@@ -47,7 +47,7 @@ DynProcControlDialog::DynProcControlDialog(
setPalette( pal );
setFixedSize( 224, 319 );
Graph * waveGraph = new Graph( this, Graph::LinearNonCyclicStyle, 204, 205 );
auto waveGraph = new Graph(this, Graph::LinearNonCyclicStyle, 204, 205);
waveGraph -> move( 10, 6 );
waveGraph -> setModel( &_controls -> m_wavegraphModel );
waveGraph -> setAutoFillBackground( true );
@@ -58,7 +58,7 @@ DynProcControlDialog::DynProcControlDialog(
waveGraph->setGraphColor( QColor( 85, 204, 145 ) );
waveGraph -> setMaximumSize( 204, 205 );
Knob * inputKnob = new Knob( knobBright_26, this);
auto inputKnob = new Knob(knobBright_26, this);
inputKnob -> setVolumeKnob( true );
inputKnob -> setVolumeRatio( 1.0 );
inputKnob -> move( 26, 223 );
@@ -66,21 +66,21 @@ DynProcControlDialog::DynProcControlDialog(
inputKnob->setLabel( tr( "INPUT" ) );
inputKnob->setHintText( tr( "Input gain:" ) , "" );
Knob * outputKnob = new Knob( knobBright_26, this );
auto outputKnob = new Knob(knobBright_26, this);
outputKnob -> setVolumeKnob( true );
outputKnob -> setVolumeRatio( 1.0 );
outputKnob -> move( 76, 223 );
outputKnob->setModel( &_controls->m_outputModel );
outputKnob->setLabel( tr( "OUTPUT" ) );
outputKnob->setHintText( tr( "Output gain:" ) , "" );
Knob * attackKnob = new Knob( knobBright_26, this);
auto attackKnob = new Knob(knobBright_26, this);
attackKnob -> move( 24, 268 );
attackKnob->setModel( &_controls->m_attackModel );
attackKnob->setLabel( tr( "ATTACK" ) );
attackKnob->setHintText( tr( "Peak attack time:" ) , "ms" );
Knob * releaseKnob = new Knob( knobBright_26, this );
auto releaseKnob = new Knob(knobBright_26, this);
releaseKnob -> move( 74, 268 );
releaseKnob->setModel( &_controls->m_releaseModel );
releaseKnob->setLabel( tr( "RELEASE" ) );
@@ -88,28 +88,28 @@ DynProcControlDialog::DynProcControlDialog(
//wavegraph control buttons
PixmapButton * resetButton = new PixmapButton( this, tr("Reset wavegraph") );
auto resetButton = new PixmapButton(this, tr("Reset wavegraph"));
resetButton -> move( 162, 223 );
resetButton -> resize( 13, 48 );
resetButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "reset_active" ) );
resetButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "reset_inactive" ) );
resetButton->setToolTip(tr("Reset wavegraph"));
PixmapButton * smoothButton = new PixmapButton( this, tr("Smooth wavegraph") );
auto smoothButton = new PixmapButton(this, tr("Smooth wavegraph"));
smoothButton -> move( 162, 239 );
smoothButton -> resize( 13, 48 );
smoothButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "smooth_active" ) );
smoothButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "smooth_inactive" ) );
smoothButton->setToolTip(tr("Smooth wavegraph"));
PixmapButton * addOneButton = new PixmapButton( this, tr("Increase wavegraph amplitude by 1 dB") );
auto addOneButton = new PixmapButton(this, tr("Increase wavegraph amplitude by 1 dB"));
addOneButton -> move( 131, 223 );
addOneButton -> resize( 13, 29 );
addOneButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "add1_active" ) );
addOneButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "add1_inactive" ) );
addOneButton->setToolTip(tr("Increase wavegraph amplitude by 1 dB"));
PixmapButton * subOneButton = new PixmapButton( this, tr("Decrease wavegraph amplitude by 1 dB") );
auto subOneButton = new PixmapButton(this, tr("Decrease wavegraph amplitude by 1 dB"));
subOneButton -> move( 131, 239 );
subOneButton -> resize( 13, 29 );
subOneButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "sub1_active" ) );
@@ -117,28 +117,28 @@ DynProcControlDialog::DynProcControlDialog(
subOneButton->setToolTip(tr("Decrease wavegraph amplitude by 1 dB"));
//stereomode switches
PixmapButton * smMaxButton = new PixmapButton( this, tr( "Stereo mode: maximum" ) );
auto smMaxButton = new PixmapButton(this, tr("Stereo mode: maximum"));
smMaxButton -> move( 131, 257 );
smMaxButton -> resize( 78, 17 );
smMaxButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "max_active" ) );
smMaxButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "max_inactive" ) );
smMaxButton->setToolTip(tr("Process based on the maximum of both stereo channels"));
PixmapButton * smAvgButton = new PixmapButton( this, tr( "Stereo mode: average" ) );
auto smAvgButton = new PixmapButton(this, tr("Stereo mode: average"));
smAvgButton -> move( 131, 274 );
smAvgButton -> resize( 78, 16 );
smAvgButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "avg_active" ) );
smAvgButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "avg_inactive" ) );
smAvgButton->setToolTip(tr("Process based on the average of both stereo channels"));
PixmapButton * smUnlButton = new PixmapButton( this, tr( "Stereo mode: unlinked" ) );
auto smUnlButton = new PixmapButton(this, tr("Stereo mode: unlinked"));
smUnlButton -> move( 131, 290 );
smUnlButton -> resize( 78, 17 );
smUnlButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "unl_active" ) );
smUnlButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "unl_inactive" ) );
smUnlButton->setToolTip(tr("Process each stereo channel independently"));
automatableButtonGroup * smGroup = new automatableButtonGroup( this );
auto smGroup = new automatableButtonGroup(this);
smGroup -> addButton( smMaxButton );
smGroup -> addButton( smAvgButton );
smGroup -> addButton( smUnlButton );

View File

@@ -52,11 +52,11 @@ EqControlsDialog::EqControlsDialog( EqControls *controls ) :
setPalette( pal );
setFixedSize( 500, 500 );
EqSpectrumView * inSpec = new EqSpectrumView( &controls->m_inFftBands, this );
auto inSpec = new EqSpectrumView(&controls->m_inFftBands, this);
inSpec->move( 26, 17 );
inSpec->setColor( QColor( 77, 101, 242, 150 ) );
EqSpectrumView * outSpec = new EqSpectrumView( &controls->m_outFftBands, this );
auto outSpec = new EqSpectrumView(&controls->m_outFftBands, this);
outSpec->setColor( QColor( 0, 255, 239, 150 ) );
outSpec->move( 26, 17 );
@@ -72,16 +72,18 @@ EqControlsDialog::EqControlsDialog( EqControls *controls ) :
setBand( 6, &controls->m_highShelfActiveModel, &controls->m_highShelfFreqModel, &controls->m_highShelfResModel, &controls->m_highShelfGainModel, QColor(255 ,255, 255), tr( "High-shelf" ), &controls->m_highShelfPeakL, &controls->m_highShelfPeakR,0,0,0,0,0,0 );
setBand( 7, &controls->m_lpActiveModel, &controls->m_lpFreqModel, &controls->m_lpResModel, 0, QColor(255 ,255, 255), tr( "LP" ) ,0,0,0,0,0, &controls->m_lp12Model, &controls->m_lp24Model, &controls->m_lp48Model);
QPixmap * faderBg = new QPixmap( PLUGIN_NAME::getIconPixmap( "faderback" ) );
QPixmap * faderLeds = new QPixmap( PLUGIN_NAME::getIconPixmap( "faderleds" ) );
QPixmap * faderKnob = new QPixmap( PLUGIN_NAME::getIconPixmap( "faderknob" ) );
auto faderBg = new QPixmap(PLUGIN_NAME::getIconPixmap("faderback"));
auto faderLeds = new QPixmap(PLUGIN_NAME::getIconPixmap("faderleds"));
auto faderKnob = new QPixmap(PLUGIN_NAME::getIconPixmap("faderknob"));
EqFader * GainFaderIn = new EqFader( &controls->m_inGainModel, tr( "Input gain" ), this, faderBg, faderLeds, faderKnob, &controls->m_inPeakL, &controls->m_inPeakR );
auto GainFaderIn = new EqFader(&controls->m_inGainModel, tr("Input gain"), this, faderBg, faderLeds, faderKnob,
&controls->m_inPeakL, &controls->m_inPeakR);
GainFaderIn->move( 23, 295 );
GainFaderIn->setDisplayConversion( false );
GainFaderIn->setHintText( tr( "Gain" ), "dBv");
EqFader * GainFaderOut = new EqFader( &controls->m_outGainModel, tr( "Output gain" ), this, faderBg, faderLeds, faderKnob, &controls->m_outPeakL, &controls->m_outPeakR );
auto GainFaderOut = new EqFader(&controls->m_outGainModel, tr("Output gain"), this, faderBg, faderLeds, faderKnob,
&controls->m_outPeakL, &controls->m_outPeakR);
GainFaderOut->move( 453, 295);
GainFaderOut->setDisplayConversion( false );
GainFaderOut->setHintText( tr( "Gain" ), "dBv" );
@@ -90,7 +92,8 @@ EqControlsDialog::EqControlsDialog( EqControls *controls ) :
int distance = 126;
for( int i = 1; i < m_parameterWidget->bandCount() - 1; i++ )
{
EqFader * gainFader = new EqFader( m_parameterWidget->getBandModels( i )->gain, tr( "" ), this, faderBg, faderLeds, faderKnob, m_parameterWidget->getBandModels( i )->peakL, m_parameterWidget->getBandModels( i )->peakR );
auto gainFader = new EqFader(m_parameterWidget->getBandModels(i)->gain, tr(""), this, faderBg, faderLeds,
faderKnob, m_parameterWidget->getBandModels(i)->peakL, m_parameterWidget->getBandModels(i)->peakR);
gainFader->move( distance, 295 );
distance += 44;
gainFader->setMinimumHeight(80);
@@ -103,21 +106,21 @@ EqControlsDialog::EqControlsDialog( EqControls *controls ) :
distance = 81;
for( int i = 0; i < m_parameterWidget->bandCount() ; i++ )
{
Knob * resKnob = new Knob( knobBright_26, this );
auto resKnob = new Knob(knobBright_26, this);
resKnob->move( distance, 440 );
resKnob->setVolumeKnob(false);
resKnob->setModel( m_parameterWidget->getBandModels( i )->res );
if(i > 1 && i < 6) { resKnob->setHintText( tr( "Bandwidth: " ) , tr( " Octave" ) ); }
else { resKnob->setHintText( tr( "Resonance : " ) , "" ); }
Knob * freqKnob = new Knob( knobBright_26, this );
auto freqKnob = new Knob(knobBright_26, this);
freqKnob->move( distance, 396 );
freqKnob->setVolumeKnob( false );
freqKnob->setModel( m_parameterWidget->getBandModels( i )->freq );
freqKnob->setHintText( tr( "Frequency:" ), "Hz" );
// adds the Number Active buttons
PixmapButton * activeButton = new PixmapButton( this, nullptr );
auto activeButton = new PixmapButton(this, nullptr);
activeButton->setCheckable(true);
activeButton->setModel( m_parameterWidget->getBandModels( i )->active );
@@ -140,48 +143,48 @@ EqControlsDialog::EqControlsDialog( EqControls *controls ) :
// adds the buttons for Spectrum analyser on/off
LedCheckBox * inSpecButton = new LedCheckBox( this );
auto inSpecButton = new LedCheckBox(this);
inSpecButton->setCheckable(true);
inSpecButton->setModel( &controls->m_analyseInModel );
inSpecButton->move( 172, 240 );
LedCheckBox * outSpecButton = new LedCheckBox( this );
auto outSpecButton = new LedCheckBox(this);
outSpecButton->setCheckable(true);
outSpecButton->setModel( &controls->m_analyseOutModel );
outSpecButton->move( 302, 240 );
//hp filter type
PixmapButton * hp12Button = new PixmapButton( this , nullptr );
auto hp12Button = new PixmapButton(this, nullptr);
hp12Button->setModel( m_parameterWidget->getBandModels( 0 )->hp12 );
hp12Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "12dB" ) );
hp12Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "12dBoff" ) );
hp12Button->move( 79, 298 );
PixmapButton * hp24Button = new PixmapButton( this , nullptr );
auto hp24Button = new PixmapButton(this, nullptr);
hp24Button->setModel(m_parameterWidget->getBandModels( 0 )->hp24 );
hp24Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "24dB" ) );
hp24Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "24dBoff" ) );
hp24Button->move( 79 , 328 );
PixmapButton * hp48Button = new PixmapButton( this , nullptr );
auto hp48Button = new PixmapButton(this, nullptr);
hp48Button->setModel( m_parameterWidget->getBandModels(0)->hp48 );
hp48Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "48dB" ) );
hp48Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "48dBoff" ) );
hp48Button->move( 79, 358 );
//LP filter type
PixmapButton * lp12Button = new PixmapButton( this , nullptr );
auto lp12Button = new PixmapButton(this, nullptr);
lp12Button->setModel( m_parameterWidget->getBandModels( 7 )->lp12 );
lp12Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "12dB" ) );
lp12Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "12dBoff" ) );
lp12Button->move( 387, 298 );
PixmapButton * lp24Button = new PixmapButton( this , nullptr );
auto lp24Button = new PixmapButton(this, nullptr);
lp24Button->setModel( m_parameterWidget->getBandModels( 7 )->lp24 );
lp24Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "24dB" ) );
lp24Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "24dBoff" ) );
lp24Button->move( 387, 328 );
PixmapButton * lp48Button = new PixmapButton( this , nullptr );
auto lp48Button = new PixmapButton(this, nullptr);
lp48Button->setModel( m_parameterWidget->getBandModels( 7 )->lp48 );
lp48Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "48dB" ) );
lp48Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "48dBoff" ) );
@@ -196,13 +199,13 @@ EqControlsDialog::EqControlsDialog( EqControls *controls ) :
QObject::connect( m_parameterWidget->getBandModels( 7 )->lp24 , SIGNAL ( dataChanged() ), m_parameterWidget, SLOT( updateHandle()));
QObject::connect( m_parameterWidget->getBandModels( 7 )->lp48 , SIGNAL ( dataChanged() ), m_parameterWidget, SLOT( updateHandle()));
automatableButtonGroup *lpBtnGrp = new automatableButtonGroup( this, tr( "LP group" ) );
auto lpBtnGrp = new automatableButtonGroup(this, tr("LP group"));
lpBtnGrp->addButton( lp12Button );
lpBtnGrp->addButton( lp24Button );
lpBtnGrp->addButton( lp48Button );
lpBtnGrp->setModel(&m_controls->m_lpTypeModel);
automatableButtonGroup *hpBtnGrp = new automatableButtonGroup( this, tr( "HP group" ) );
auto hpBtnGrp = new automatableButtonGroup(this, tr("HP group"));
hpBtnGrp->addButton( hp12Button );
hpBtnGrp->addButton( hp24Button );
hpBtnGrp->addButton( hp48Button );

View File

@@ -56,9 +56,9 @@ EqParameterWidget::EqParameterWidget( QWidget *parent, EqControls * controls ) :
m_pixelsPerOctave = EqHandle::freqToXPixel( 10000, m_displayWidth ) - EqHandle::freqToXPixel( 5000, m_displayWidth );
//GraphicsScene and GraphicsView stuff
QGraphicsScene *scene = new QGraphicsScene();
auto scene = new QGraphicsScene();
scene->setSceneRect( 0, 0, m_displayWidth, m_displayHeigth );
QGraphicsView *view = new QGraphicsView( this );
auto view = new QGraphicsView(this);
view->setStyleSheet( "border-style: none; background: transparent;" );
view->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
view->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );

View File

@@ -42,49 +42,49 @@ FlangerControlsDialog::FlangerControlsDialog( FlangerControls *controls ) :
setPalette( pal );
setFixedSize( 233, 75 );
Knob* delayKnob = new Knob( knobBright_26, this );
auto delayKnob = new Knob(knobBright_26, this);
delayKnob->move( 10,10 );
delayKnob->setVolumeKnob( false );
delayKnob->setModel( &controls->m_delayTimeModel );
delayKnob->setLabel( tr( "DELAY" ) );
delayKnob->setHintText( tr( "Delay time:" ) + " ", "s" );
TempoSyncKnob * lfoFreqKnob = new TempoSyncKnob( knobBright_26, this );
auto lfoFreqKnob = new TempoSyncKnob(knobBright_26, this);
lfoFreqKnob->move( 48,10 );
lfoFreqKnob->setVolumeKnob( false );
lfoFreqKnob->setModel( &controls->m_lfoFrequencyModel );
lfoFreqKnob->setLabel( tr( "RATE" ) );
lfoFreqKnob->setHintText( tr( "Period:" ) , " Sec" );
Knob * lfoAmtKnob = new Knob( knobBright_26, this );
auto lfoAmtKnob = new Knob(knobBright_26, this);
lfoAmtKnob->move( 85,10 );
lfoAmtKnob->setVolumeKnob( false );
lfoAmtKnob->setModel( &controls->m_lfoAmountModel );
lfoAmtKnob->setLabel( tr( "AMNT" ) );
lfoAmtKnob->setHintText( tr( "Amount:" ) , "" );
Knob * lfoPhaseKnob = new Knob( knobBright_26, this );
auto lfoPhaseKnob = new Knob(knobBright_26, this);
lfoPhaseKnob->move( 123,10 );
lfoPhaseKnob->setVolumeKnob( false );
lfoPhaseKnob->setModel( &controls->m_lfoPhaseModel );
lfoPhaseKnob->setLabel( tr( "PHASE" ) );
lfoPhaseKnob->setHintText( tr( "Phase:" ) , " degrees" );
Knob * feedbackKnob = new Knob( knobBright_26, this );
auto feedbackKnob = new Knob(knobBright_26, this);
feedbackKnob->move( 160,10 );
feedbackKnob->setVolumeKnob( true) ;
feedbackKnob->setModel( &controls->m_feedbackModel );
feedbackKnob->setLabel( tr( "FDBK" ) );
feedbackKnob->setHintText( tr( "Feedback amount:" ) , "" );
Knob * whiteNoiseKnob = new Knob( knobBright_26, this );
auto whiteNoiseKnob = new Knob(knobBright_26, this);
whiteNoiseKnob->move( 196,10 );
whiteNoiseKnob->setVolumeKnob( true) ;
whiteNoiseKnob->setModel( &controls->m_whiteNoiseAmountModel );
whiteNoiseKnob->setLabel( tr( "NOISE" ) );
whiteNoiseKnob->setHintText( tr( "White noise amount:" ) , "" );
LedCheckBox * invertCb = new LedCheckBox( tr( "Invert" ), this );
auto invertCb = new LedCheckBox(tr("Invert"), this);
invertCb->move( 10,53 );

View File

@@ -251,7 +251,7 @@ void FreeBoyInstrument::playNote( NotePlayHandle * _n,
if ( tfp == 0 )
{
Gb_Apu_Buffer *papu = new Gb_Apu_Buffer();
auto papu = new Gb_Apu_Buffer();
papu->set_sample_rate( samplerate, CLOCK_RATE );
// Master sound circuitry power control
@@ -282,7 +282,7 @@ void FreeBoyInstrument::playNote( NotePlayHandle * _n,
_n->m_pluginData = papu;
}
Gb_Apu_Buffer *papu = static_cast<Gb_Apu_Buffer *>( _n->m_pluginData );
auto papu = static_cast<Gb_Apu_Buffer*>(_n->m_pluginData);
papu->treble_eq( m_trebleModel.value() );
papu->bass_freq( m_bassModel.value() );
@@ -681,7 +681,7 @@ FreeBoyInstrumentView::FreeBoyInstrumentView( Instrument * _instrument,
void FreeBoyInstrumentView::modelChanged()
{
FreeBoyInstrument * p = castModel<FreeBoyInstrument>();
auto p = castModel<FreeBoyInstrument>();
m_ch1SweepTimeKnob->setModel( &p->m_ch1SweepTimeModel );
m_ch1SweepDirButton->setModel( &p->m_ch1SweepDirModel );

View File

@@ -92,7 +92,7 @@ GigInstrument::GigInstrument( InstrumentTrack * _instrument_track ) :
m_RandomSeed( 0 ),
m_currentKeyDimension( 0 )
{
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrument_track );
auto iph = new InstrumentPlayHandle(this, _instrument_track);
Engine::audioEngine()->addPlayHandle( iph );
updateSampleRate();
@@ -305,7 +305,7 @@ void GigInstrument::playNote( NotePlayHandle * _n, sampleFrame * )
if( tfp == 0 )
{
GIGPluginData * pluginData = new GIGPluginData;
auto pluginData = new GIGPluginData;
pluginData->midiNote = midiNote;
_n->m_pluginData = pluginData;
@@ -355,10 +355,9 @@ void GigInstrument::play( sampleFrame * _working_buffer )
it->state = PlayingKeyUp;
// Notify each sample that the key has been released
for( QList<GigSample>::iterator sample = it->samples.begin();
sample != it->samples.end(); ++sample )
for (auto& sample : it->samples)
{
sample->adsr.keyup();
sample.adsr.keyup();
}
// Add release samples if available
@@ -408,22 +407,17 @@ void GigInstrument::play( sampleFrame * _working_buffer )
}
// Fill buffer with portions of the note samples
for( QList<GigNote>::iterator it = m_notes.begin(); it != m_notes.end(); ++it )
for (auto& note : m_notes)
{
// Only process the notes if we're in a playing state
if( !( it->state == PlayingKeyDown ||
it->state == PlayingKeyUp ) )
if (!(note.state == PlayingKeyDown || note.state == PlayingKeyUp ))
{
continue;
}
for( QList<GigSample>::iterator sample = it->samples.begin();
sample != it->samples.end(); ++sample )
for (auto& sample : note.samples)
{
if( sample->sample == nullptr || sample->region == nullptr )
{
continue;
}
if (sample.sample == nullptr || sample.region == nullptr) { continue; }
// Will change if resampling
bool resample = false;
@@ -434,18 +428,15 @@ void GigInstrument::play( sampleFrame * _working_buffer )
// Resample to be the correct pitch when the sample provided isn't
// solely for this one note (e.g. one or two samples per octave) or
// we are processing at a different sample rate
if( sample->region->PitchTrack == true || rate != sample->sample->SamplesPerSecond )
if (sample.region->PitchTrack == true || rate != sample.sample->SamplesPerSecond)
{
resample = true;
// Factor just for resampling
freq_factor = 1.0 * rate / sample->sample->SamplesPerSecond;
freq_factor = 1.0 * rate / sample.sample->SamplesPerSecond;
// Factor for pitch shifting as well as resampling
if( sample->region->PitchTrack == true )
{
freq_factor *= sample->freqFactor;
}
if (sample.region->PitchTrack == true) { freq_factor *= sample.freqFactor; }
// We need a bit of margin so we don't get glitching
samples = frames / freq_factor + MARGIN[m_interpolation];
@@ -453,11 +444,11 @@ void GigInstrument::play( sampleFrame * _working_buffer )
// Load this note's data
sampleFrame sampleData[samples];
loadSample( *sample, sampleData, samples );
loadSample(sample, sampleData, samples);
// Apply ADSR using a copy so if we don't use these samples when
// resampling, the ADSR doesn't get messed up
ADSR copy = sample->adsr;
ADSR copy = sample.adsr;
for( f_cnt_t i = 0; i < samples; ++i )
{
@@ -472,8 +463,7 @@ void GigInstrument::play( sampleFrame * _working_buffer )
sampleFrame convertBuf[frames];
// Only output if resampling is successful (note that "used" is output)
if( sample->convertSampleRate( *sampleData, *convertBuf, samples, frames,
freq_factor, used ) )
if (sample.convertSampleRate(*sampleData, *convertBuf, samples, frames, freq_factor, used))
{
for( f_cnt_t i = 0; i < frames; ++i )
{
@@ -492,8 +482,8 @@ void GigInstrument::play( sampleFrame * _working_buffer )
}
// Update note position with how many samples we actually used
sample->pos += used;
sample->adsr.inc( used );
sample.pos += used;
sample.adsr.inc(used);
}
}
@@ -593,7 +583,7 @@ void GigInstrument::loadSample( GigSample& sample, sampleFrame* sampleData, f_cn
// Convert from 16 or 24 bit into 32-bit float
if( sample.sample->BitDepth == 24 ) // 24 bit
{
uint8_t * pInt = reinterpret_cast<uint8_t*>( &buffer );
auto pInt = reinterpret_cast<uint8_t*>(&buffer);
for( f_cnt_t i = 0; i < samples; ++i )
{
@@ -625,7 +615,7 @@ void GigInstrument::loadSample( GigSample& sample, sampleFrame* sampleData, f_cn
}
else // 16 bit
{
int16_t * pInt = reinterpret_cast<int16_t*>( &buffer );
auto pInt = reinterpret_cast<int16_t*>(&buffer);
for( f_cnt_t i = 0; i < samples; ++i )
{
@@ -684,18 +674,17 @@ f_cnt_t GigInstrument::getPingPongIndex( f_cnt_t index, f_cnt_t startf, f_cnt_t
// A key has been released
void GigInstrument::deleteNotePluginData( NotePlayHandle * _n )
{
GIGPluginData * pluginData = static_cast<GIGPluginData *>( _n->m_pluginData );
auto pluginData = static_cast<GIGPluginData*>(_n->m_pluginData);
QMutexLocker locker( &m_notesMutex );
// Mark the note as being released, but only if it was playing or was just
// pressed (i.e., not if the key was already released)
for( QList<GigNote>::iterator i = m_notes.begin(); i != m_notes.end(); ++i )
for (auto& note : m_notes)
{
// Find the note by matching pointers to the plugin data
if( i->handle == pluginData &&
( i->state == KeyDown || i->state == PlayingKeyDown ) )
if (note.handle == pluginData && (note.state == KeyDown || note.state == PlayingKeyDown))
{
i->state = KeyUp;
note.state = KeyUp;
}
}
@@ -931,7 +920,7 @@ public:
GigInstrumentView::GigInstrumentView( Instrument * _instrument, QWidget * _parent ) :
InstrumentViewFixedSize( _instrument, _parent )
{
GigInstrument * k = castModel<GigInstrument>();
auto k = castModel<GigInstrument>();
connect( &k->m_bankNum, SIGNAL( dataChanged() ), this, SLOT( updatePatchName() ) );
connect( &k->m_patchNum, SIGNAL( dataChanged() ), this, SLOT( updatePatchName() ) );
@@ -990,7 +979,7 @@ GigInstrumentView::GigInstrumentView( Instrument * _instrument, QWidget * _paren
void GigInstrumentView::modelChanged()
{
GigInstrument * k = castModel<GigInstrument>();
auto k = castModel<GigInstrument>();
m_bankNumLcd->setModel( &k->m_bankNum );
m_patchNumLcd->setModel( &k->m_patchNum );
@@ -1007,7 +996,7 @@ void GigInstrumentView::modelChanged()
void GigInstrumentView::updateFilename()
{
GigInstrument * i = castModel<GigInstrument>();
auto i = castModel<GigInstrument>();
QFontMetrics fm( m_filenameLabel->font() );
QString file = i->m_filename.endsWith( ".gig", Qt::CaseInsensitive ) ?
i->m_filename.left( i->m_filename.length() - 4 ) :
@@ -1025,7 +1014,7 @@ void GigInstrumentView::updateFilename()
void GigInstrumentView::updatePatchName()
{
GigInstrument * i = castModel<GigInstrument>();
auto i = castModel<GigInstrument>();
QFontMetrics fm( font() );
QString patch = i->getCurrentPatchName();
m_patchLabel->setText( fm.elidedText( patch, Qt::ElideLeft, m_patchLabel->width() ) );
@@ -1046,7 +1035,7 @@ void GigInstrumentView::invalidateFile()
void GigInstrumentView::showFileDialog()
{
GigInstrument * k = castModel<GigInstrument>();
auto k = castModel<GigInstrument>();
FileDialog ofd( nullptr, tr( "Open GIG file" ) );
ofd.setFileMode( FileDialog::ExistingFiles );
@@ -1087,7 +1076,7 @@ void GigInstrumentView::showFileDialog()
void GigInstrumentView::showPatchDialog()
{
GigInstrument * k = castModel<GigInstrument>();
auto k = castModel<GigInstrument>();
PatchesDialog pd( this );
pd.setup( k->m_instance, 1, k->instrumentTrack()->name(), &k->m_bankNum, &k->m_patchNum, m_patchLabel );
pd.exec();

View File

@@ -276,7 +276,7 @@ bool HydrogenImport::readSong()
QString instrId = LocalFileMng::readXmlString( noteNode, "instrument", 0,false, false );
int i = pattern_count - 1 + existing_patterns;
pattern_id[sName] = pattern_count - 1;
MidiClip*p = dynamic_cast<MidiClip*>( drum_track[instrId]->getClip( i ) );
auto p = dynamic_cast<MidiClip*>(drum_track[instrId]->getClip(i));
Note n;
n.setPos( nPosition );
if ( (nPosition + 48) <= nSize )

View File

@@ -185,7 +185,7 @@ void KickerInstrument::playNote( NotePlayHandle * _n,
_n->noteOff();
}
SweepOsc * so = static_cast<SweepOsc *>( _n->m_pluginData );
auto so = static_cast<SweepOsc*>(_n->m_pluginData);
so->update( _working_buffer + offset, frames, Engine::audioEngine()->processingSampleRate() );
if( _n->isReleased() )
@@ -334,7 +334,7 @@ KickerInstrumentView::KickerInstrumentView( Instrument * _instrument,
void KickerInstrumentView::modelChanged()
{
KickerInstrument * k = castModel<KickerInstrument>();
auto k = castModel<KickerInstrument>();
m_startFreqKnob->setModel( &k->m_startFreqModel );
m_endFreqKnob->setModel( &k->m_endFreqModel );
m_decayKnob->setModel( &k->m_decayModel );

View File

@@ -96,7 +96,7 @@ namespace gui
LadspaBrowserView::LadspaBrowserView( ToolPlugin * _tool ) :
ToolPluginView( _tool )
{
QHBoxLayout * hlayout = new QHBoxLayout( this );
auto hlayout = new QHBoxLayout(this);
hlayout->setSpacing( 0 );
hlayout->setMargin( 0 );
@@ -104,7 +104,7 @@ LadspaBrowserView::LadspaBrowserView( ToolPlugin * _tool ) :
m_tabBar->setExclusive( true );
m_tabBar->setFixedWidth( 72 );
QWidget * ws = new QWidget( this );
auto ws = new QWidget(this);
ws->setFixedSize( 500, 480 );
QWidget * available = createTab( ws, tr( "Available Effects" ), VALID );
@@ -162,14 +162,14 @@ LadspaBrowserView::LadspaBrowserView( ToolPlugin * _tool ) :
QWidget * LadspaBrowserView::createTab( QWidget * _parent, const QString & _txt,
LadspaPluginType _type )
{
QWidget * tab = new QWidget( _parent );
auto tab = new QWidget(_parent);
tab->setFixedSize( 500, 400 );
QVBoxLayout * layout = new QVBoxLayout( tab );
auto layout = new QVBoxLayout(tab);
layout->setSpacing( 0 );
layout->setMargin( 0 );
const QString type = "<b>" + tr( "Type:" ) + "</b> ";
QLabel * title = new QLabel( type + _txt, tab );
auto title = new QLabel(type + _txt, tab);
QFont f = title->font();
f.setBold( true );
title->setFont( pointSize<12>( f ) );
@@ -178,7 +178,7 @@ QWidget * LadspaBrowserView::createTab( QWidget * _parent, const QString & _txt,
layout->addWidget( title );
layout->addSpacing( 10 );
LadspaDescription * description = new LadspaDescription( tab, _type );
auto description = new LadspaDescription(tab, _type);
connect( description, SIGNAL( doubleClicked( const ::lmms::ladspa_key_t & ) ),
SLOT( showPorts( const ::lmms::ladspa_key_t & ) ) );
layout->addWidget( description, 1 );

View File

@@ -72,20 +72,18 @@ LadspaDescription::LadspaDescription( QWidget * _parent,
}
QList<QString> pluginNames;
for( l_sortable_plugin_t::iterator it = plugins.begin();
it != plugins.end(); ++it )
for (const auto& plugin : plugins)
{
if( _type != VALID ||
manager->getDescription( ( *it ).second )->inputChannels
<= Engine::audioEngine()->audioDev()->channels() )
{
pluginNames.push_back( ( *it ).first );
m_pluginKeys.push_back( ( *it ).second );
ch_cnt_t audioDeviceChannels = Engine::audioEngine()->audioDev()->channels();
if (_type != VALID || manager->getDescription(plugin.second)->inputChannels <= audioDeviceChannels)
{
pluginNames.push_back(plugin.first);
m_pluginKeys.push_back(plugin.second);
}
}
QGroupBox * pluginsBox = new QGroupBox( tr( "Plugins" ), this );
QListWidget * pluginList = new QListWidget( pluginsBox );
auto pluginsBox = new QGroupBox(tr("Plugins"), this);
auto pluginList = new QListWidget(pluginsBox);
pluginList->addItems( pluginNames );
connect( pluginList, SIGNAL( currentRowChanged( int ) ),
SLOT( rowChanged( int ) ) );
@@ -93,15 +91,15 @@ LadspaDescription::LadspaDescription( QWidget * _parent,
SLOT( onDoubleClicked( QListWidgetItem * ) ) );
( new QVBoxLayout( pluginsBox ) )->addWidget( pluginList );
QGroupBox * descriptionBox = new QGroupBox( tr( "Description" ), this );
QVBoxLayout * descriptionLayout = new QVBoxLayout( descriptionBox );
auto descriptionBox = new QGroupBox(tr("Description"), this);
auto descriptionLayout = new QVBoxLayout(descriptionBox);
descriptionLayout->setSpacing( 0 );
descriptionLayout->setMargin( 0 );
m_scrollArea = new QScrollArea( descriptionBox );
descriptionLayout->addWidget( m_scrollArea );
QVBoxLayout * layout = new QVBoxLayout( this );
auto layout = new QVBoxLayout(this);
layout->addWidget( pluginsBox );
layout->addWidget( descriptionBox );
@@ -118,76 +116,76 @@ LadspaDescription::LadspaDescription( QWidget * _parent,
void LadspaDescription::update( const ladspa_key_t & _key )
{
QWidget * description = new QWidget;
auto description = new QWidget;
m_scrollArea->setWidget( description );
QVBoxLayout * layout = new QVBoxLayout( description );
auto layout = new QVBoxLayout(description);
layout->setSizeConstraint( QLayout::SetFixedSize );
Ladspa2LMMS * manager = Engine::getLADSPAManager();
QLabel * name = new QLabel( description );
auto name = new QLabel(description);
name->setText( QWidget::tr( "Name: " ) + manager->getName( _key ) );
layout->addWidget( name );
QWidget * maker = new QWidget( description );
QHBoxLayout * makerLayout = new QHBoxLayout( maker );
auto maker = new QWidget(description);
auto makerLayout = new QHBoxLayout(maker);
makerLayout->setMargin( 0 );
makerLayout->setSpacing( 0 );
layout->addWidget( maker );
QLabel * maker_label = new QLabel( maker );
auto maker_label = new QLabel(maker);
maker_label->setText( QWidget::tr( "Maker: " ) );
maker_label->setAlignment( Qt::AlignTop );
QLabel * maker_content = new QLabel( maker );
auto maker_content = new QLabel(maker);
maker_content->setText( manager->getMaker( _key ) );
maker_content->setWordWrap( true );
makerLayout->addWidget( maker_label );
makerLayout->addWidget( maker_content, 1 );
QWidget * copyright = new QWidget( description );
QHBoxLayout * copyrightLayout = new QHBoxLayout( copyright );
auto copyright = new QWidget(description);
auto copyrightLayout = new QHBoxLayout(copyright);
copyrightLayout->setMargin( 0 );
copyrightLayout->setSpacing( 0 );
layout->addWidget( copyright );
QLabel * copyright_label = new QLabel( copyright );
auto copyright_label = new QLabel(copyright);
copyright_label->setText( QWidget::tr( "Copyright: " ) );
copyright_label->setAlignment( Qt::AlignTop );
QLabel * copyright_content = new QLabel( copyright );
auto copyright_content = new QLabel(copyright);
copyright_content->setText( manager->getCopyright( _key ) );
copyright_content->setWordWrap( true );
copyrightLayout->addWidget( copyright_label );
copyrightLayout->addWidget( copyright_content, 1 );
QLabel * requiresRealTime = new QLabel( description );
auto requiresRealTime = new QLabel(description);
requiresRealTime->setText( QWidget::tr( "Requires Real Time: " ) +
( manager->hasRealTimeDependency( _key ) ?
QWidget::tr( "Yes" ) :
QWidget::tr( "No" ) ) );
layout->addWidget( requiresRealTime );
QLabel * realTimeCapable = new QLabel( description );
auto realTimeCapable = new QLabel(description);
realTimeCapable->setText( QWidget::tr( "Real Time Capable: " ) +
( manager->isRealTimeCapable( _key ) ?
QWidget::tr( "Yes" ) :
QWidget::tr( "No" ) ) );
layout->addWidget( realTimeCapable );
QLabel * inplaceBroken = new QLabel( description );
auto inplaceBroken = new QLabel(description);
inplaceBroken->setText( QWidget::tr( "In Place Broken: " ) +
( manager->isInplaceBroken( _key ) ?
QWidget::tr( "Yes" ) :
QWidget::tr( "No" ) ) );
layout->addWidget( inplaceBroken );
QLabel * channelsIn = new QLabel( description );
auto channelsIn = new QLabel(description);
channelsIn->setText( QWidget::tr( "Channels In: " ) + QString::number(
manager->getDescription( _key )->inputChannels ) );
layout->addWidget( channelsIn );
QLabel * channelsOut = new QLabel( description );
auto channelsOut = new QLabel(description);
channelsOut->setText( QWidget::tr( "Channels Out: " ) + QString::number(
manager->getDescription( _key )->outputChannels ) );
layout->addWidget( channelsOut );

View File

@@ -45,13 +45,13 @@ LadspaPortDialog::LadspaPortDialog( const ladspa_key_t & _key )
setWindowTitle( tr( "Ports" ) );
setModal( true );
QVBoxLayout * vlayout = new QVBoxLayout( this );
auto vlayout = new QVBoxLayout(this);
vlayout->setSpacing( 0 );
vlayout->setMargin( 0 );
int pc = manager->getPortCount( _key );
QTableWidget * settings = new QTableWidget( pc, 7, this );
auto settings = new QTableWidget(pc, 7, this);
QStringList ports;
ports.append( tr( "Name" ) );
@@ -67,7 +67,7 @@ LadspaPortDialog::LadspaPortDialog( const ladspa_key_t & _key )
{
for( int col = 0; col < 7; ++col )
{
QTableWidgetItem * item = new QTableWidgetItem;
auto item = new QTableWidgetItem;
item->setFlags(QFlag(0));
settings->setItem( row, col, item );
}

View File

@@ -46,7 +46,7 @@ LadspaControlDialog::LadspaControlDialog( LadspaControls * _ctl ) :
m_effectLayout( nullptr ),
m_stereoLink( nullptr )
{
QVBoxLayout * mainLay = new QVBoxLayout( this );
auto mainLay = new QVBoxLayout(this);
m_effectLayout = new QHBoxLayout();
mainLay->addLayout( m_effectLayout );
@@ -56,7 +56,7 @@ LadspaControlDialog::LadspaControlDialog( LadspaControls * _ctl ) :
if( _ctl->m_processors > 1 )
{
mainLay->addSpacing( 3 );
QHBoxLayout * center = new QHBoxLayout();
auto center = new QHBoxLayout();
mainLay->addLayout( center );
m_stereoLink = new LedCheckBox( tr( "Link Channels" ), this );
m_stereoLink->setModel( &_ctl->m_stereoLinkModel );
@@ -69,11 +69,10 @@ LadspaControlDialog::LadspaControlDialog( LadspaControls * _ctl ) :
void LadspaControlDialog::updateEffectView( LadspaControls * _ctl )
{
QList<QGroupBox *> list = findChildren<QGroupBox *>();
for( QList<QGroupBox *>::iterator it = list.begin(); it != list.end();
++it )
QList<QGroupBox *> groupBoxes = findChildren<QGroupBox *>();
for (const auto& groupBox : groupBoxes)
{
delete *it;
delete groupBox;
}
m_effectControls = _ctl;
@@ -101,16 +100,15 @@ void LadspaControlDialog::updateEffectView( LadspaControls * _ctl )
grouper = new QGroupBox( this );
}
QGridLayout * gl = new QGridLayout( grouper );
auto gl = new QGridLayout(grouper);
grouper->setLayout( gl );
grouper->setAlignment( Qt::Vertical );
for( control_list_t::iterator it = controls.begin();
it != controls.end(); ++it )
for (const auto& control : controls)
{
if( (*it)->port()->proc == proc )
if (control->port()->proc == proc)
{
buffer_data_t this_port = (*it)->port()->data_type;
buffer_data_t this_port = control->port()->data_type;
if( last_port != NONE &&
( this_port == TOGGLED || this_port == ENUM ) &&
( last_port != TOGGLED && last_port != ENUM ) )
@@ -118,13 +116,13 @@ void LadspaControlDialog::updateEffectView( LadspaControls * _ctl )
++row;
col = 0;
}
gl->addWidget( new LadspaControlView( grouper, *it ), row, col );
gl->addWidget(new LadspaControlView(grouper, control), row, col);
if( ++col == cols )
{
++row;
col = 0;
}
last_port = (*it)->port()->data_type;
last_port = control->port()->data_type;
}
}

View File

@@ -53,20 +53,19 @@ LadspaControls::LadspaControls( LadspaEffect * _eff ) :
const bool linked_control = ( m_processors > 1 && proc == 0 );
for( multi_proc_t::Iterator it = controls.begin(); it != controls.end(); it++ )
for (const auto& control : controls)
{
if( (*it)->proc == proc )
if (control->proc == proc)
{
(*it)->control = new LadspaControl( this, *it,
linked_control );
control->control = new LadspaControl(this, control, linked_control);
p.append( (*it)->control );
p.append(control->control);
if( linked_control )
if (linked_control)
{
connect( (*it)->control, SIGNAL( linkChanged( int, bool ) ),
this, SLOT( linkPort( int, bool ) ),
Qt::DirectConnection );
connect(control->control, SIGNAL(linkChanged(int, bool)),
this, SLOT(linkPort(int, bool)),
Qt::DirectConnection);
}
}
}
@@ -77,12 +76,11 @@ LadspaControls::LadspaControls( LadspaEffect * _eff ) :
// now link all controls
if( m_processors > 1 )
{
for( multi_proc_t::Iterator it = controls.begin();
it != controls.end(); it++ )
for (const auto& control : controls)
{
if( (*it)->proc == 0 )
if (control->proc == 0)
{
linkPort( ( *it )->control_id, true );
linkPort(control->control_id, true);
}
}
}
@@ -112,12 +110,10 @@ void LadspaControls::saveSettings( QDomDocument & _doc, QDomElement & _this )
multi_proc_t controls = m_effect->getPortControls();
_this.setAttribute( "ports", controls.count() );
for( multi_proc_t::Iterator it = controls.begin();
it != controls.end(); it++ )
for (const auto& control : controls)
{
QString n = "port" + QString::number( (*it)->proc ) +
QString::number( (*it)->port_id );
(*it)->control->saveSettings( _doc, _this, n );
QString n = "port" + QString::number(control->proc) + QString::number(control->port_id);
control->control->saveSettings(_doc, _this, n);
}
}
@@ -132,12 +128,10 @@ void LadspaControls::loadSettings( const QDomElement & _this )
}
multi_proc_t controls = m_effect->getPortControls();
for( multi_proc_t::Iterator it = controls.begin();
it != controls.end(); it++ )
for (const auto& control : controls)
{
QString n = "port" + QString::number( (*it)->proc ) +
QString::number( (*it)->port_id );
(*it)->control->loadSettings( _this, n );
QString n = "port" + QString::number(control->proc) + QString::number(control->port_id);
control->control->loadSettings(_this, n);
}
}

View File

@@ -311,7 +311,7 @@ void LadspaEffect::pluginInstantiation()
multi_proc_t ports;
for( int port = 0; port < m_portCount; port++ )
{
port_desc_t * p = new port_desc_t;
auto p = new port_desc_t;
p->name = manager->getPortName( m_key, port );
p->proc = proc;

View File

@@ -63,65 +63,65 @@ void LadspaSubPluginFeatures::fillDescriptionWidget( QWidget * _parent,
const ladspa_key_t & lkey = subPluginKeyToLadspaKey( _key );
Ladspa2LMMS * lm = Engine::getLADSPAManager();
QLabel * label = new QLabel( _parent );
auto label = new QLabel(_parent);
label->setText( QWidget::tr( "Name: " ) + lm->getName( lkey ) );
QLabel* fileInfo = new QLabel( _parent );
auto fileInfo = new QLabel(_parent);
fileInfo->setText( QWidget::tr( "File: %1" ).arg( lkey.first ) );
QWidget * maker = new QWidget( _parent );
QHBoxLayout * l = new QHBoxLayout( maker );
auto maker = new QWidget(_parent);
auto l = new QHBoxLayout(maker);
l->setMargin( 0 );
l->setSpacing( 0 );
QLabel * maker_label = new QLabel( maker );
auto maker_label = new QLabel(maker);
maker_label->setText( QWidget::tr( "Maker: " ) );
maker_label->setAlignment( Qt::AlignTop );
QLabel * maker_content = new QLabel( maker );
auto maker_content = new QLabel(maker);
maker_content->setText( lm->getMaker( lkey ) );
maker_content->setWordWrap( true );
l->addWidget( maker_label );
l->addWidget( maker_content, 1 );
QWidget * copyright = new QWidget( _parent );
auto copyright = new QWidget(_parent);
l = new QHBoxLayout( copyright );
l->setMargin( 0 );
l->setSpacing( 0 );
copyright->setMinimumWidth( _parent->minimumWidth() );
QLabel * copyright_label = new QLabel( copyright );
auto copyright_label = new QLabel(copyright);
copyright_label->setText( QWidget::tr( "Copyright: " ) );
copyright_label->setAlignment( Qt::AlignTop );
QLabel * copyright_content = new QLabel( copyright );
auto copyright_content = new QLabel(copyright);
copyright_content->setText( lm->getCopyright( lkey ) );
copyright_content->setWordWrap( true );
l->addWidget( copyright_label );
l->addWidget( copyright_content, 1 );
QLabel * requiresRealTime = new QLabel( _parent );
auto requiresRealTime = new QLabel(_parent);
requiresRealTime->setText( QWidget::tr( "Requires Real Time: " ) +
( lm->hasRealTimeDependency( lkey ) ?
QWidget::tr( "Yes" ) :
QWidget::tr( "No" ) ) );
QLabel * realTimeCapable = new QLabel( _parent );
auto realTimeCapable = new QLabel(_parent);
realTimeCapable->setText( QWidget::tr( "Real Time Capable: " ) +
( lm->isRealTimeCapable( lkey ) ?
QWidget::tr( "Yes" ) :
QWidget::tr( "No" ) ) );
QLabel * inplaceBroken = new QLabel( _parent );
auto inplaceBroken = new QLabel(_parent);
inplaceBroken->setText( QWidget::tr( "In Place Broken: " ) +
( lm->isInplaceBroken( lkey ) ?
QWidget::tr( "Yes" ) :
QWidget::tr( "No" ) ) );
QLabel * channelsIn = new QLabel( _parent );
auto channelsIn = new QLabel(_parent);
channelsIn->setText( QWidget::tr( "Channels In: " ) +
QString::number( lm->getDescription( lkey )->inputChannels ) );
QLabel * channelsOut = new QLabel( _parent );
auto channelsOut = new QLabel(_parent);
channelsOut->setText( QWidget::tr( "Channels Out: " ) +
QString::number( lm->getDescription( lkey )->outputChannels ) );
}

View File

@@ -40,10 +40,15 @@ IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
ENDIF()
SET_TARGET_PROPERTIES(veal PROPERTIES COMPILE_FLAGS "-fexceptions -O2 -finline-functions ${INLINE_FLAGS}")
# Don't strip if "Debug" or "RelWithDebInfo"
IF(LMMS_BUILD_WIN32 AND NOT CMAKE_BUILD_TYPE MATCHES "Deb")
ADD_CUSTOM_COMMAND(TARGET veal POST_BUILD COMMAND "${STRIP}" "$<TARGET_FILE:veal>")
ENDIF()
if(LMMS_BUILD_WIN32)
add_custom_command(
TARGET veal
POST_BUILD
COMMAND "${STRIP_COMMAND}" "$<TARGET_FILE:veal>"
VERBATIM
COMMAND_EXPAND_LISTS
)
endif()
IF(NOT LMMS_BUILD_APPLE AND NOT LMMS_BUILD_OPENBSD)
SET_TARGET_PROPERTIES(veal PROPERTIES LINK_FLAGS "${LINK_FLAGS} -shared -Wl,-no-undefined")
ENDIF()

View File

@@ -10,7 +10,13 @@ SET_TARGET_PROPERTIES(caps PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(caps PROPERTIES COMPILE_FLAGS "-O2 -funroll-loops -Wno-write-strings")
IF(LMMS_BUILD_WIN32)
ADD_CUSTOM_COMMAND(TARGET caps POST_BUILD COMMAND "${STRIP}" \"$<TARGET_FILE:caps>\")
add_custom_command(
TARGET caps
POST_BUILD
COMMAND "${STRIP_COMMAND}" "$<TARGET_FILE:caps>"
VERBATIM
COMMAND_EXPAND_LISTS
)
ENDIF(LMMS_BUILD_WIN32)
IF(NOT LMMS_BUILD_APPLE AND NOT LMMS_BUILD_OPENBSD)
SET_TARGET_PROPERTIES(caps PROPERTIES LINK_FLAGS "${LINK_FLAGS} -shared -Wl,-no-undefined")

View File

@@ -7,11 +7,19 @@ INSTALL(TARGETS cmt LIBRARY DESTINATION "${PLUGIN_DIR}/ladspa")
SET_TARGET_PROPERTIES(cmt PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(cmt PROPERTIES COMPILE_FLAGS "-Wall -O3 -fno-strict-aliasing")
IF(LMMS_BUILD_WIN32 AND NOT CMAKE_BUILD_TYPE MATCHES "Deb")
ADD_CUSTOM_COMMAND(TARGET cmt POST_BUILD COMMAND "${STRIP}" "$<TARGET_FILE:cmt>")
ELSE()
SET_TARGET_PROPERTIES(cmt PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -fPIC")
ENDIF()
if(LMMS_BUILD_WIN32)
add_custom_command(
TARGET cmt
POST_BUILD
COMMAND "${STRIP_COMMAND}" "$<TARGET_FILE:cmt>"
VERBATIM
COMMAND_EXPAND_LISTS
)
endif()
if(NOT LMMS_BUILD_WIN32)
set_target_properties(cmt PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -fPIC")
endif()
IF(NOT LMMS_BUILD_APPLE AND NOT LMMS_BUILD_OPENBSD)
SET_TARGET_PROPERTIES(cmt PROPERTIES LINK_FLAGS "${LINK_FLAGS} -shared -Wl,-no-undefined")

View File

@@ -41,6 +41,16 @@ FOREACH(_item ${XML_SOURCES})
TARGET_LINK_LIBRARIES("${_plugin}" m)
ENDIF()
if(LMMS_BUILD_WIN32)
add_custom_command(
TARGET "${_plugin}"
POST_BUILD
COMMAND "${STRIP_COMMAND}" "$<TARGET_FILE:${_plugin}>"
VERBATIM
COMMAND_EXPAND_LISTS
)
endif(LMMS_BUILD_WIN32)
SET_TARGET_PROPERTIES("${_plugin}" PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES("${_plugin}" PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}")
SET_TARGET_PROPERTIES("${_plugin}" PROPERTIES LINK_FLAGS "${LINK_FLAGS}")

View File

@@ -11,10 +11,15 @@ FOREACH(_item ${PLUGIN_SOURCES})
ENDIF()
INSTALL(TARGETS "${_plugin}" LIBRARY DESTINATION "${PLUGIN_DIR}/ladspa")
SET_TARGET_PROPERTIES("${_plugin}" PROPERTIES PREFIX "")
# Don't strip if "Debug" or "RelWithDebInfo"
IF(LMMS_BUILD_WIN32 AND NOT CMAKE_BUILD_TYPE MATCHES "Deb")
ADD_CUSTOM_COMMAND(TARGET "${_plugin}" POST_BUILD COMMAND "${STRIP}" \"$<TARGET_FILE:${_plugin}>\")
ENDIF()
if(LMMS_BUILD_WIN32)
add_custom_command(
TARGET "${_plugin}"
POST_BUILD
COMMAND "${STRIP_COMMAND}" "$<TARGET_FILE:${_plugin}>"
VERBATIM
COMMAND_EXPAND_LISTS
)
endif()
IF(NOT MSVC)
TARGET_LINK_LIBRARIES("${_plugin}" m)
ENDIF()

View File

@@ -349,15 +349,16 @@ Lb302Synth::Lb302Synth( InstrumentTrack * _instrumentTrack ) :
filterChanged();
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrumentTrack );
auto iph = new InstrumentPlayHandle(this, _instrumentTrack);
Engine::audioEngine()->addPlayHandle( iph );
}
Lb302Synth::~Lb302Synth()
{
for (int i=0; i<NUM_FILTERS; ++i) {
delete vcfs[i];
for (const auto& vcf : vcfs)
{
delete vcf;
}
}
@@ -869,7 +870,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
// move to 120,75
const int waveBtnX = 10;
const int waveBtnY = 96;
PixmapButton * sawWaveBtn = new PixmapButton( this, tr( "Saw wave" ) );
auto sawWaveBtn = new PixmapButton(this, tr("Saw wave"));
sawWaveBtn->move( waveBtnX, waveBtnY );
sawWaveBtn->setActiveGraphic( embed::getIconPixmap(
"saw_wave_active" ) );
@@ -878,8 +879,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
sawWaveBtn->setToolTip(
tr( "Click here for a saw-wave." ) );
PixmapButton * triangleWaveBtn =
new PixmapButton( this, tr( "Triangle wave" ) );
auto triangleWaveBtn = new PixmapButton(this, tr("Triangle wave"));
triangleWaveBtn->move( waveBtnX+(16*1), waveBtnY );
triangleWaveBtn->setActiveGraphic(
embed::getIconPixmap( "triangle_wave_active" ) );
@@ -888,7 +888,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
triangleWaveBtn->setToolTip(
tr( "Click here for a triangle-wave." ) );
PixmapButton * sqrWaveBtn = new PixmapButton( this, tr( "Square wave" ) );
auto sqrWaveBtn = new PixmapButton(this, tr("Square wave"));
sqrWaveBtn->move( waveBtnX+(16*2), waveBtnY );
sqrWaveBtn->setActiveGraphic( embed::getIconPixmap(
"square_wave_active" ) );
@@ -897,8 +897,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
sqrWaveBtn->setToolTip(
tr( "Click here for a square-wave." ) );
PixmapButton * roundSqrWaveBtn =
new PixmapButton( this, tr( "Rounded square wave" ) );
auto roundSqrWaveBtn = new PixmapButton(this, tr("Rounded square wave"));
roundSqrWaveBtn->move( waveBtnX+(16*3), waveBtnY );
roundSqrWaveBtn->setActiveGraphic( embed::getIconPixmap(
"round_square_wave_active" ) );
@@ -907,8 +906,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
roundSqrWaveBtn->setToolTip(
tr( "Click here for a square-wave with a rounded end." ) );
PixmapButton * moogWaveBtn =
new PixmapButton( this, tr( "Moog wave" ) );
auto moogWaveBtn = new PixmapButton(this, tr("Moog wave"));
moogWaveBtn->move( waveBtnX+(16*4), waveBtnY );
moogWaveBtn->setActiveGraphic(
embed::getIconPixmap( "moog_saw_wave_active" ) );
@@ -917,7 +915,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
moogWaveBtn->setToolTip(
tr( "Click here for a moog-like wave." ) );
PixmapButton * sinWaveBtn = new PixmapButton( this, tr( "Sine wave" ) );
auto sinWaveBtn = new PixmapButton(this, tr("Sine wave"));
sinWaveBtn->move( waveBtnX+(16*5), waveBtnY );
sinWaveBtn->setActiveGraphic( embed::getIconPixmap(
"sin_wave_active" ) );
@@ -926,8 +924,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
sinWaveBtn->setToolTip(
tr( "Click for a sine-wave." ) );
PixmapButton * exponentialWaveBtn =
new PixmapButton( this, tr( "White noise wave" ) );
auto exponentialWaveBtn = new PixmapButton(this, tr("White noise wave"));
exponentialWaveBtn->move( waveBtnX+(16*6), waveBtnY );
exponentialWaveBtn->setActiveGraphic(
embed::getIconPixmap( "exp_wave_active" ) );
@@ -936,9 +933,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
exponentialWaveBtn->setToolTip(
tr( "Click here for an exponential wave." ) );
PixmapButton * whiteNoiseWaveBtn =
new PixmapButton( this, tr( "White noise wave" ) );
auto whiteNoiseWaveBtn = new PixmapButton(this, tr("White noise wave"));
whiteNoiseWaveBtn->move( waveBtnX+(16*7), waveBtnY );
whiteNoiseWaveBtn->setActiveGraphic(
embed::getIconPixmap( "white_noise_wave_active" ) );
@@ -947,8 +942,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
whiteNoiseWaveBtn->setToolTip(
tr( "Click here for white-noise." ) );
PixmapButton * blSawWaveBtn =
new PixmapButton( this, tr( "Bandlimited saw wave" ) );
auto blSawWaveBtn = new PixmapButton(this, tr("Bandlimited saw wave"));
blSawWaveBtn->move( waveBtnX+(16*9)-8, waveBtnY );
blSawWaveBtn->setActiveGraphic(
embed::getIconPixmap( "saw_wave_active" ) );
@@ -957,8 +951,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
blSawWaveBtn->setToolTip(
tr( "Click here for bandlimited saw wave." ) );
PixmapButton * blSquareWaveBtn =
new PixmapButton( this, tr( "Bandlimited square wave" ) );
auto blSquareWaveBtn = new PixmapButton(this, tr("Bandlimited square wave"));
blSquareWaveBtn->move( waveBtnX+(16*10)-8, waveBtnY );
blSquareWaveBtn->setActiveGraphic(
embed::getIconPixmap( "square_wave_active" ) );
@@ -967,8 +960,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
blSquareWaveBtn->setToolTip(
tr( "Click here for bandlimited square wave." ) );
PixmapButton * blTriangleWaveBtn =
new PixmapButton( this, tr( "Bandlimited triangle wave" ) );
auto blTriangleWaveBtn = new PixmapButton(this, tr("Bandlimited triangle wave"));
blTriangleWaveBtn->move( waveBtnX+(16*11)-8, waveBtnY );
blTriangleWaveBtn->setActiveGraphic(
embed::getIconPixmap( "triangle_wave_active" ) );
@@ -977,8 +969,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
blTriangleWaveBtn->setToolTip(
tr( "Click here for bandlimited triangle wave." ) );
PixmapButton * blMoogWaveBtn =
new PixmapButton( this, tr( "Bandlimited moog saw wave" ) );
auto blMoogWaveBtn = new PixmapButton(this, tr("Bandlimited moog saw wave"));
blMoogWaveBtn->move( waveBtnX+(16*12)-8, waveBtnY );
blMoogWaveBtn->setActiveGraphic(
embed::getIconPixmap( "moog_saw_wave_active" ) );
@@ -1012,7 +1003,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
void Lb302SynthView::modelChanged()
{
Lb302Synth * syn = castModel<Lb302Synth>();
auto syn = castModel<Lb302Synth>();
m_vcfCutKnob->setModel( &syn->vcf_cut_knob );
m_vcfResKnob->setModel( &syn->vcf_res_knob );

View File

@@ -90,8 +90,8 @@ bool Lv2Effect::processAudioBuffer(sampleFrame *buf, const fpp_t frames)
{
buf[f][0] = d * buf[f][0] + w * m_tmpOutputSmps[f][0];
buf[f][1] = d * buf[f][1] + w * m_tmpOutputSmps[f][1];
double l = static_cast<double>(buf[f][0]);
double r = static_cast<double>(buf[f][1]);
auto l = static_cast<double>(buf[f][0]);
auto r = static_cast<double>(buf[f][1]);
outSum += l*l + r*r;
}
checkGate(outSum / frames);
@@ -109,7 +109,7 @@ extern "C"
PLUGIN_EXPORT Plugin *lmms_plugin_main(Model *_parent, void *_data)
{
using KeyType = Plugin::Descriptor::SubPluginFeatures::Key;
Lv2Effect* eff = new Lv2Effect(_parent, static_cast<const KeyType*>(_data));
auto eff = new Lv2Effect(_parent, static_cast<const KeyType*>(_data));
if (!eff->isValid()) { delete eff; eff = nullptr; }
return eff;
}

View File

@@ -58,4 +58,4 @@ private:
} // namespace lmms
#endif // LMMS_HAVE_LV2
#endif

View File

@@ -78,17 +78,13 @@ Lv2Instrument::Lv2Instrument(InstrumentTrack *instrumentTrackArg,
{
if (Lv2ControlBase::isValid())
{
#ifdef LV2_INSTRUMENT_USE_MIDI
for (int i = 0; i < NumKeys; ++i) { m_runningNotes[i] = 0; }
#endif
connect(instrumentTrack()->pitchRangeModel(), SIGNAL(dataChanged()),
this, SLOT(updatePitchRange()), Qt::DirectConnection);
connect(Engine::audioEngine(), &AudioEngine::sampleRateChanged,
this, [this](){Lv2ControlBase::reloadPlugin();});
// now we need a play-handle which cares for calling play()
InstrumentPlayHandle *iph =
new InstrumentPlayHandle(this, instrumentTrackArg);
auto iph = new InstrumentPlayHandle(this, instrumentTrackArg);
Engine::audioEngine()->addPlayHandle(iph);
}
}
@@ -299,9 +295,7 @@ extern "C"
PLUGIN_EXPORT Plugin *lmms_plugin_main(Model *_parent, void *_data)
{
using KeyType = Plugin::Descriptor::SubPluginFeatures::Key;
Lv2Instrument* ins = new Lv2Instrument(
static_cast<InstrumentTrack*>(_parent),
static_cast<KeyType*>(_data ));
auto ins = new Lv2Instrument(static_cast<InstrumentTrack*>(_parent), static_cast<KeyType*>(_data));
if (!ins->isValid()) { delete ins; ins = nullptr; }
return ins;
}

View File

@@ -101,7 +101,7 @@ private:
void setNameFromFile(const QString &name) override;
#ifdef LV2_INSTRUMENT_USE_MIDI
int m_runningNotes[NumKeys];
std::array<int, NumKeys> m_runningNotes = {};
#endif
friend class gui::Lv2InsView;

View File

@@ -216,27 +216,28 @@ bool MidiExport::tryExport(const TrackContainer::TrackList &tracks,
int len = n.toElement().attribute("steps", "1").toInt() * 12;
// for each pattern clip of the current pattern track (in song editor)
for (auto it = plist.begin(); it != plist.end(); ++it)
for (const auto& position : plist)
{
while (!st.empty() && st.back().second <= it->first)
const auto& [start, end] = position;
while (!st.empty() && st.back().second <= start)
{
writePatternClip(midiClip, nv, len, st.back().first, pos, st.back().second);
pos = st.back().second;
st.pop_back();
}
if (!st.empty() && st.back().second <= it->second)
if (!st.empty() && st.back().second <= end)
{
writePatternClip(midiClip, nv, len, st.back().first, pos, it->first);
pos = it->first;
while (!st.empty() && st.back().second <= it->second)
writePatternClip(midiClip, nv, len, st.back().first, pos, start);
pos = start;
while (!st.empty() && st.back().second <= end)
{
st.pop_back();
}
}
st.push_back(*it);
pos = it->first;
st.push_back(position);
pos = start;
}
while (!st.empty())
@@ -286,9 +287,9 @@ void MidiExport::writeMidiClip(MidiNoteVector &midiClip, const QDomNode& n,
void MidiExport::writeMidiClipToTrack(MTrack &mtrack, MidiNoteVector &nv)
{
for (auto it = nv.begin(); it != nv.end(); ++it)
for (const auto& note : nv)
{
mtrack.addNote(it->pitch, it->volume, it->time / 48.0, it->duration / 48.0);
mtrack.addNote(note.pitch, note.volume, note.time / 48.0, note.duration / 48.0);
}
}
@@ -301,16 +302,15 @@ void MidiExport::writePatternClip(MidiNoteVector& src, MidiNoteVector& dst,
start -= base;
end -= base;
std::sort(src.begin(), src.end());
for (auto it = src.begin(); it != src.end(); ++it)
for (const auto& srcNote : src)
{
for (int time = it->time + ceil((start - it->time) / len)
* len; time < end; time += len)
for (int time = srcNote.time + ceil((start - srcNote.time) / len) * len; time < end; time += len)
{
MidiNote note;
note.duration = it->duration;
note.pitch = it->pitch;
note.duration = srcNote.duration;
note.pitch = srcNote.pitch;
note.time = base + time;
note.volume = it->volume;
note.volume = srcNote.volume;
dst.push_back(note);
}
}

View File

@@ -310,7 +310,7 @@ bool MidiImport::readSMF( TrackContainer* tc )
pd.setValue( 0 );
std::istringstream stream(readAllData().toStdString());
Alg_seq_ptr seq = new Alg_seq(stream, true);
auto seq = new Alg_seq(stream, true);
seq->convert_to_beats();
pd.setMaximum( seq->tracks() + preTrackSteps );
@@ -328,18 +328,14 @@ bool MidiImport::readSMF( TrackContainer* tc )
// NOTE: unordered_map::operator[] creates a new element if none exists
MeterModel & timeSigMM = Engine::getSong()->getTimeSigModel();
AutomationTrack * nt = dynamic_cast<AutomationTrack*>(
Track::create(Track::AutomationTrack, Engine::getSong()));
auto nt = dynamic_cast<AutomationTrack*>(Track::create(Track::AutomationTrack, Engine::getSong()));
nt->setName(tr("MIDI Time Signature Numerator"));
AutomationTrack * dt = dynamic_cast<AutomationTrack*>(
Track::create(Track::AutomationTrack, Engine::getSong()));
auto dt = dynamic_cast<AutomationTrack*>(Track::create(Track::AutomationTrack, Engine::getSong()));
dt->setName(tr("MIDI Time Signature Denominator"));
AutomationClip * timeSigNumeratorPat =
new AutomationClip(nt);
auto timeSigNumeratorPat = new AutomationClip(nt);
timeSigNumeratorPat->setDisplayName(tr("Numerator"));
timeSigNumeratorPat->addObject(&timeSigMM.numeratorModel());
AutomationClip * timeSigDenominatorPat =
new AutomationClip(dt);
auto timeSigDenominatorPat = new AutomationClip(dt);
timeSigDenominatorPat->setDisplayName(tr("Denominator"));
timeSigDenominatorPat->addObject(&timeSigMM.denominatorModel());
@@ -405,9 +401,9 @@ bool MidiImport::readSMF( TrackContainer* tc )
Alg_track_ptr trk = seq->track( t );
pd.setValue( t + preTrackSteps );
for( int c = 0; c < MIDI_CC_COUNT; c++ )
for (auto& cc : ccs)
{
ccs[c].clear();
cc.clear();
}
// Now look at events
@@ -448,7 +444,7 @@ bool MidiImport::readSMF( TrackContainer* tc )
else if (evt->is_note())
{
smfMidiChannel * ch = chs[evt->chan].create( tc, trackName );
Alg_note_ptr noteEvt = dynamic_cast<Alg_note_ptr>( evt );
auto noteEvt = dynamic_cast<Alg_note_ptr>(evt);
int ticks = noteEvt->get_duration() * ticksPerBeat;
Note n( (ticks < 1 ? 1 : ticks ),
noteEvt->get_start_time() * ticksPerBeat,

View File

@@ -87,7 +87,7 @@ MonstroSynth::MonstroSynth( MonstroInstrument * _i, NotePlayHandle * _nph ) :
m_lfo_next[0] = Oscillator::noiseSample( 0.0f );
m_lfo_next[1] = Oscillator::noiseSample( 0.0f );
m_osc1l_last = 0.0f;
m_osc1r_last = 0.0f;
@@ -652,14 +652,14 @@ inline void MonstroSynth::updateModulators( float * env1, float * env2, float *
{
// frames played before
const f_cnt_t tfp = m_nph->totalFramesPlayed();
float * lfo [2];
float * env [2];
lfo[0] = lfo1;
lfo[1] = lfo2;
env[0] = env1;
env[1] = env2;
for( int i = 0; i < 2; ++i )
{
switch( m_lfovalue[i] )
@@ -740,7 +740,7 @@ inline void MonstroSynth::updateModulators( float * env1, float * env2, float *
{
const f_cnt_t tm = ( tfp + f ) % static_cast<int>( m_lfo_rate[i] );
if( tm == 0 )
{
{
m_lfo_last[i] = m_lfo_next[i];
m_lfo_next[i] = Oscillator::noiseSample( 0.0f );
}
@@ -755,9 +755,9 @@ inline void MonstroSynth::updateModulators( float * env1, float * env2, float *
{
if( tfp + f < m_lfoatt[i] ) lfo[i][f] *= ( static_cast<sample_t>( tfp ) / m_lfoatt[i] );
}
/////////////////////////////////////////////
// //
// //
@@ -765,7 +765,7 @@ inline void MonstroSynth::updateModulators( float * env1, float * env2, float *
// //
// //
/////////////////////////////////////////////
for( f_cnt_t f = 0; f < frames; ++f )
{
if( m_env_phase[i] < 4.0f && m_nph->isReleased() && f >= m_nph->framesBeforeRelease() )
@@ -1035,7 +1035,7 @@ void MonstroInstrument::playNote( NotePlayHandle * _n,
_n->m_pluginData = new MonstroSynth( this, _n );
}
MonstroSynth * ms = static_cast<MonstroSynth *>( _n->m_pluginData );
auto ms = static_cast<MonstroSynth*>(_n->m_pluginData);
ms->renderOutput( frames, _working_buffer + offset );
@@ -1414,7 +1414,7 @@ void MonstroInstrument::updateLFOAtts()
void MonstroInstrument::updateSamplerate()
{
m_samplerate = Engine::audioEngine()->processingSampleRate();
m_integrator = 0.5f - ( 0.5f - INTEGRATOR ) * 44100.0f / m_samplerate;
m_fmCorrection = 44100.f / m_samplerate * FM_AMOUNT;
m_counterMax = ( m_samplerate * 5 ) / 44100;
@@ -1459,13 +1459,13 @@ MonstroView::MonstroView( Instrument * _instrument,
// "tab buttons"
PixmapButton * m_opViewButton = new PixmapButton( this, nullptr );
auto m_opViewButton = new PixmapButton(this, nullptr);
m_opViewButton -> move( 0,0 );
m_opViewButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "opview_active" ) );
m_opViewButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "opview_inactive" ) );
m_opViewButton->setToolTip(tr("Operators view"));
PixmapButton * m_matViewButton = new PixmapButton( this, nullptr );
auto m_matViewButton = new PixmapButton(this, nullptr);
m_matViewButton -> move( 125,0 );
m_matViewButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "matview_active" ) );
m_matViewButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "matview_inactive" ) );
@@ -1498,7 +1498,7 @@ void MonstroView::updateLayout()
void MonstroView::modelChanged()
{
MonstroInstrument * m = castModel<MonstroInstrument>();
auto m = castModel<MonstroInstrument>();
m_osc1VolKnob-> setModel( &m-> m_osc1Vol );
m_osc1PanKnob-> setModel( &m-> m_osc1Pan );
@@ -1631,7 +1631,7 @@ QWidget * MonstroView::setupOperatorsView( QWidget * _parent )
{
// operators view
QWidget * view = new QWidget( _parent );
auto view = new QWidget(_parent);
view-> setFixedSize( 250, 250 );
makeknob( m_osc1VolKnob, KNOBCOL1, O1ROW, tr( "Volume" ), "%", "osc1Knob" )
@@ -1694,46 +1694,47 @@ QWidget * MonstroView::setupOperatorsView( QWidget * _parent )
m_lfo2WaveBox -> setGeometry( 127, LFOROW + 7, 42, ComboBox::DEFAULT_HEIGHT );
m_lfo2WaveBox->setFont( pointSize<8>( m_lfo2WaveBox->font() ) );
maketsknob( m_lfo2AttKnob, LFOCOL4, LFOROW, tr( "Attack" ), " ms", "lfoKnob" )
maketsknob( m_lfo2RateKnob, LFOCOL5, LFOROW, tr( "Rate" ), " ms", "lfoKnob" )
makeknob( m_lfo2PhsKnob, LFOCOL6, LFOROW, tr( "Phase" ), tr( " deg" ), "lfoKnob" )
maketsknob(m_lfo2AttKnob, LFOCOL4, LFOROW, tr("Attack"), " ms", "lfoKnob")
maketsknob(m_lfo2RateKnob, LFOCOL5, LFOROW, tr("Rate"), " ms", "lfoKnob")
makeknob(m_lfo2PhsKnob, LFOCOL6, LFOROW, tr("Phase"), tr(" deg"), "lfoKnob")
maketsknob( m_env1PreKnob, KNOBCOL1, E1ROW, tr( "Pre-delay" ), " ms", "envKnob" )
maketsknob( m_env1AttKnob, KNOBCOL2, E1ROW, tr( "Attack" ), " ms", "envKnob" )
maketsknob( m_env1HoldKnob, KNOBCOL3, E1ROW, tr( "Hold" ), " ms", "envKnob" )
maketsknob( m_env1DecKnob, KNOBCOL4, E1ROW, tr( "Decay" ), " ms", "envKnob" )
makeknob( m_env1SusKnob, KNOBCOL5, E1ROW, tr( "Sustain" ), "", "envKnob" )
maketsknob( m_env1RelKnob, KNOBCOL6, E1ROW, tr( "Release" ), " ms", "envKnob" )
makeknob( m_env1SlopeKnob, KNOBCOL7, E1ROW, tr( "Slope" ), "", "envKnob" )
maketsknob(m_env1PreKnob, KNOBCOL1, E1ROW, tr("Pre-delay"), " ms", "envKnob")
maketsknob(m_env1AttKnob, KNOBCOL2, E1ROW, tr("Attack"), " ms", "envKnob")
maketsknob(m_env1HoldKnob, KNOBCOL3, E1ROW, tr("Hold"), " ms", "envKnob")
maketsknob(m_env1DecKnob, KNOBCOL4, E1ROW, tr("Decay"), " ms", "envKnob")
maketsknob( m_env2PreKnob, KNOBCOL1, E2ROW, tr( "Pre-delay" ), " ms", "envKnob" )
maketsknob( m_env2AttKnob, KNOBCOL2, E2ROW, tr( "Attack" ), " ms", "envKnob" )
maketsknob( m_env2HoldKnob, KNOBCOL3, E2ROW, tr( "Hold" ), " ms", "envKnob" )
maketsknob( m_env2DecKnob, KNOBCOL4, E2ROW, tr( "Decay" ), " ms", "envKnob" )
makeknob( m_env2SusKnob, KNOBCOL5, E2ROW, tr( "Sustain" ), "", "envKnob" )
maketsknob( m_env2RelKnob, KNOBCOL6, E2ROW, tr( "Release" ), " ms", "envKnob" )
makeknob( m_env2SlopeKnob, KNOBCOL7, E2ROW, tr( "Slope" ), "", "envKnob" )
makeknob(m_env1SusKnob, KNOBCOL5, E1ROW, tr("Sustain"), "", "envKnob")
maketsknob(m_env1RelKnob, KNOBCOL6, E1ROW, tr("Release"), " ms", "envKnob")
makeknob(m_env1SlopeKnob, KNOBCOL7, E1ROW, tr("Slope"), "", "envKnob")
maketsknob(m_env2PreKnob, KNOBCOL1, E2ROW, tr("Pre-delay"), " ms", "envKnob")
maketsknob(m_env2AttKnob, KNOBCOL2, E2ROW, tr("Attack"), " ms", "envKnob")
maketsknob(m_env2HoldKnob, KNOBCOL3, E2ROW, tr("Hold"), " ms", "envKnob")
maketsknob(m_env2DecKnob, KNOBCOL4, E2ROW, tr("Decay"), " ms", "envKnob")
makeknob(m_env2SusKnob, KNOBCOL5, E2ROW, tr("Sustain"), "", "envKnob")
maketsknob(m_env2RelKnob, KNOBCOL6, E2ROW, tr("Release"), " ms", "envKnob")
makeknob(m_env2SlopeKnob, KNOBCOL7, E2ROW, tr("Slope"), "", "envKnob")
// mod selector
PixmapButton * m_mixButton = new PixmapButton( view, nullptr );
auto m_mixButton = new PixmapButton(view, nullptr);
m_mixButton -> move( 225, 185 );
m_mixButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "mix_active" ) );
m_mixButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "mix_inactive" ) );
m_mixButton->setToolTip(tr("Mix osc 2 with osc 3"));
PixmapButton * m_amButton = new PixmapButton( view, nullptr );
auto m_amButton = new PixmapButton(view, nullptr);
m_amButton -> move( 225, 185 + 15 );
m_amButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "am_active" ) );
m_amButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "am_inactive" ) );
m_amButton->setToolTip(tr("Modulate amplitude of osc 3 by osc 2"));
PixmapButton * m_fmButton = new PixmapButton( view, nullptr );
auto m_fmButton = new PixmapButton(view, nullptr);
m_fmButton -> move( 225, 185 + 15*2 );
m_fmButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "fm_active" ) );
m_fmButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "fm_inactive" ) );
m_fmButton->setToolTip(tr("Modulate frequency of osc 3 by osc 2"));
PixmapButton * m_pmButton = new PixmapButton( view, nullptr );
auto m_pmButton = new PixmapButton(view, nullptr);
m_pmButton -> move( 225, 185 + 15*3 );
m_pmButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "pm_active" ) );
m_pmButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "pm_inactive" ) );
@@ -1755,7 +1756,7 @@ QWidget * MonstroView::setupMatrixView( QWidget * _parent )
{
// matrix view
QWidget * view = new QWidget( _parent );
auto view = new QWidget(_parent);
view-> setFixedSize( 250, 250 );
makeknob( m_vol1env1Knob, MATCOL1, MATROW1, tr( "Modulation amount" ), "", "matrixKnob" )

View File

@@ -47,10 +47,10 @@ MultitapEchoControlDialog::MultitapEchoControlDialog( MultitapEchoControls * con
setFixedSize( 245, 300 );
// graph widgets
Graph * ampGraph = new Graph( this, Graph::BarStyle, 204, 105 );
Graph * lpGraph = new Graph( this, Graph::BarStyle, 204, 105 );
auto ampGraph = new Graph(this, Graph::BarStyle, 204, 105);
auto lpGraph = new Graph(this, Graph::BarStyle, 204, 105);
ampGraph->move( 30, 10 );
lpGraph->move( 30, 125 );
@@ -71,33 +71,33 @@ MultitapEchoControlDialog::MultitapEchoControlDialog( MultitapEchoControls * con
lpGraph -> setMaximumSize( 204, 105 );
// steps spinbox
LcdSpinBox * steps = new LcdSpinBox( 2, this, "Steps" );
auto steps = new LcdSpinBox(2, this, "Steps");
steps->move( 20, 245 );
steps->setModel( & controls->m_steps );
// knobs
TempoSyncKnob * stepLength = new TempoSyncKnob( knobBright_26, this );
auto stepLength = new TempoSyncKnob(knobBright_26, this);
stepLength->move( 100, 245 );
stepLength->setModel( & controls->m_stepLength );
stepLength->setLabel( tr( "Length" ) );
stepLength->setHintText( tr( "Step length:" ) , " ms" );
Knob * dryGain = new Knob( knobBright_26, this );
auto dryGain = new Knob(knobBright_26, this);
dryGain->move( 150, 245 );
dryGain->setModel( & controls->m_dryGain );
dryGain->setLabel( tr( "Dry" ) );
dryGain->setHintText( tr( "Dry gain:" ) , " dBFS" );
Knob * stages = new Knob( knobBright_26, this );
auto stages = new Knob(knobBright_26, this);
stages->move( 200, 245 );
stages->setModel( & controls->m_stages );
stages->setLabel( tr( "Stages" ) );
stages->setHintText( tr( "Low-pass stages:" ) , "x" );
// switch led
LedCheckBox * swapInputs = new LedCheckBox( "Swap inputs", this, tr( "Swap inputs" ), LedCheckBox::Green );
auto swapInputs = new LedCheckBox("Swap inputs", this, tr("Swap inputs"), LedCheckBox::Green);
swapInputs->move( 20, 275 );
swapInputs->setModel( & controls->m_swapInputs );
swapInputs->setToolTip(tr("Swap left and right input channels for reflections"));

View File

@@ -385,9 +385,9 @@ void NesObject::renderOutput( sampleFrame * buf, fpp_t frames )
// //
// final stage - mixing //
// //
////////////////////////////////
float pin1 = static_cast<float>( ch1 + ch2 );
////////////////////////////////
auto pin1 = static_cast<float>(ch1 + ch2);
// add dithering noise
pin1 *= 1.0 + ( Oscillator::noiseSample( 0.0f ) * DITHER_AMP );
pin1 = pin1 / 30.0f;
@@ -405,8 +405,7 @@ void NesObject::renderOutput( sampleFrame * buf, fpp_t frames )
pin1 *= NES_MIXING_12;
float pin2 = static_cast<float>( ch3 + ch4 );
auto pin2 = static_cast<float>(ch3 + ch4);
// add dithering noise
pin2 *= 1.0 + ( Oscillator::noiseSample( 0.0f ) * DITHER_AMP );
pin2 = pin2 / 30.0f;
@@ -552,13 +551,13 @@ void NesInstrument::playNote( NotePlayHandle * n, sampleFrame * workingBuffer )
const f_cnt_t offset = n->noteOffset();
if ( n->totalFramesPlayed() == 0 || n->m_pluginData == nullptr )
{
NesObject * nes = new NesObject( this, Engine::audioEngine()->processingSampleRate(), n );
{
auto nes = new NesObject(this, Engine::audioEngine()->processingSampleRate(), n);
n->m_pluginData = nes;
}
NesObject * nes = static_cast<NesObject *>( n->m_pluginData );
auto nes = static_cast<NesObject*>(n->m_pluginData);
nes->renderOutput( workingBuffer + offset, frames );
applyRelease( workingBuffer, n );
@@ -846,7 +845,7 @@ NesInstrumentView::NesInstrumentView( Instrument * instrument, QWidget * parent
void NesInstrumentView::modelChanged()
{
NesInstrument * nes = castModel<NesInstrument>();
auto nes = castModel<NesInstrument>();
m_ch1EnabledBtn->setModel( &nes->m_ch1Enabled );
m_ch1CrsKnob->setModel( &nes->m_ch1Crs );

View File

@@ -215,7 +215,7 @@ OpulenzInstrument::OpulenzInstrument( InstrumentTrack * _instrument_track ) :
MOD_CON( trem_depth_mdl );
// Connect the plugin to the audio engine...
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrument_track );
auto iph = new InstrumentPlayHandle(this, _instrument_track);
Engine::audioEngine()->addPlayHandle( iph );
}
@@ -798,8 +798,7 @@ void OpulenzInstrumentView::updateKnobHints()
-12, 0, 12, 19, 24, 28, 31, 34, 36, 38, 40, 40, 43, 43, 47, 47
};
OpulenzInstrument * m = castModel<OpulenzInstrument>();
auto m = castModel<OpulenzInstrument>();
op1_a_kn->setHintText( tr( "Attack" ),
" (" + knobHintHelper(attack_times[(int)m->op1_a_mdl.value()]) + ")");
@@ -821,7 +820,7 @@ void OpulenzInstrumentView::updateKnobHints()
void OpulenzInstrumentView::modelChanged()
{
OpulenzInstrument * m = castModel<OpulenzInstrument>();
auto m = castModel<OpulenzInstrument>();
// m_patch->setModel( &m->m_patchModel );
op1_a_kn->setModel( &m->op1_a_mdl );

View File

@@ -422,7 +422,7 @@ OrganicInstrumentView::OrganicInstrumentView( Instrument * _instrument,
InstrumentViewFixedSize( _instrument, _parent ),
m_oscKnobs( nullptr )
{
OrganicInstrument * oi = castModel<OrganicInstrument>();
auto oi = castModel<OrganicInstrument>();
setAutoFillBackground( true );
QPalette pal;
@@ -474,8 +474,8 @@ OrganicInstrumentView::~OrganicInstrumentView()
void OrganicInstrumentView::modelChanged()
{
OrganicInstrument * oi = castModel<OrganicInstrument>();
auto oi = castModel<OrganicInstrument>();
const float y=91.0f;
const float rowHeight = 26.0f;
const float x=53.0f;
@@ -512,7 +512,7 @@ void OrganicInstrumentView::modelChanged()
oscKnob->setHintText( tr( "Osc %1 waveform:" ).arg( i + 1 ), QString() );
// setup volume-knob
Knob * volKnob = new Knob( knobStyled, this );
auto volKnob = new Knob(knobStyled, this);
volKnob->setVolumeKnob( true );
volKnob->move( x + i * colWidth, y + rowHeight*1 );
volKnob->setFixedSize( 21, 21 );
@@ -547,7 +547,7 @@ void OrganicInstrumentView::modelChanged()
void OrganicInstrumentView::updateKnobHint()
{
OrganicInstrument * oi = castModel<OrganicInstrument>();
auto oi = castModel<OrganicInstrument>();
for( int i = 0; i < m_numOscillators; ++i )
{
const float harm = oi->m_osc[i]->m_harmModel.value();

View File

@@ -148,7 +148,7 @@ void PatmanInstrument::playNote( NotePlayHandle * _n,
{
selectSample( _n );
}
handle_data * hdata = (handle_data *)_n->m_pluginData;
auto hdata = (handle_data*)_n->m_pluginData;
float play_freq = hdata->tuned ? _n->frequency() :
hdata->sample->frequency();
@@ -171,7 +171,7 @@ void PatmanInstrument::playNote( NotePlayHandle * _n,
void PatmanInstrument::deleteNotePluginData( NotePlayHandle * _n )
{
handle_data * hdata = (handle_data *)_n->m_pluginData;
auto hdata = (handle_data*)_n->m_pluginData;
sharedObject::unref( hdata->sample );
delete hdata->state;
delete hdata;
@@ -347,7 +347,7 @@ PatmanInstrument::LoadErrors PatmanInstrument::loadPatch(
}
}
sampleFrame * data = new sampleFrame[frames];
auto data = new sampleFrame[frames];
for( f_cnt_t frame = 0; frame < frames; ++frame )
{
@@ -358,7 +358,7 @@ PatmanInstrument::LoadErrors PatmanInstrument::loadPatch(
}
}
SampleBuffer* psample = new SampleBuffer( data, frames );
auto psample = new SampleBuffer(data, frames);
psample->setFrequency( root_freq / 1000.0f );
psample->setSampleRate( sample_rate );
@@ -399,20 +399,20 @@ void PatmanInstrument::selectSample( NotePlayHandle * _n )
float min_dist = HUGE_VALF;
SampleBuffer* sample = nullptr;
for( QVector<SampleBuffer *>::iterator it = m_patchSamples.begin(); it != m_patchSamples.end(); ++it )
for (const auto& patchSample : m_patchSamples)
{
float patch_freq = ( *it )->frequency();
float patch_freq = patchSample->frequency();
float dist = freq >= patch_freq ? freq / patch_freq :
patch_freq / freq;
if( dist < min_dist )
{
min_dist = dist;
sample = *it;
sample = patchSample;
}
}
handle_data * hdata = new handle_data;
auto hdata = new handle_data;
hdata->tuned = m_tunedModel.value();
if( sample )
{

View File

@@ -85,9 +85,9 @@ PeakControllerEffectControlDialog::PeakControllerEffectControlDialog(
m_absLed = new LedCheckBox( tr( "Absolute value" ), this );
m_absLed->setModel( &_controls->m_absModel );
QVBoxLayout * mainLayout = new QVBoxLayout();
QHBoxLayout * knobLayout = new QHBoxLayout();
QHBoxLayout * ledLayout = new QHBoxLayout();
auto mainLayout = new QVBoxLayout();
auto knobLayout = new QHBoxLayout();
auto ledLayout = new QHBoxLayout();
knobLayout->addWidget( m_baseKnob );
knobLayout->addWidget( m_amountKnob );

View File

@@ -98,12 +98,10 @@ bool ReverbSCEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames )
{
sample_t s[2] = { buf[f][0], buf[f][1] };
const SPFLOAT inGain = (SPFLOAT)DB2LIN((inGainBuf ?
inGainBuf->values()[f]
: m_reverbSCControls.m_inputGainModel.value()));
const SPFLOAT outGain = (SPFLOAT)DB2LIN((outGainBuf ?
outGainBuf->values()[f]
: m_reverbSCControls.m_outputGainModel.value()));
const auto inGain
= (SPFLOAT)DB2LIN((inGainBuf ? inGainBuf->values()[f] : m_reverbSCControls.m_inputGainModel.value()));
const auto outGain
= (SPFLOAT)DB2LIN((outGainBuf ? outGainBuf->values()[f] : m_reverbSCControls.m_outputGainModel.value()));
s[0] *= inGain;
s[1] *= inGain;

Some files were not shown because too many files have changed in this diff Show More