Rename Luppp to Loopp
parent
a748de09ed
commit
e592d5dea4
|
@ -2,7 +2,7 @@
|
||||||
planning/*
|
planning/*
|
||||||
|
|
||||||
src/*.o
|
src/*.o
|
||||||
luppp
|
loopp
|
||||||
|
|
||||||
*.zip
|
*.zip
|
||||||
*.orig
|
*.orig
|
||||||
|
@ -14,7 +14,7 @@ buildTest/*
|
||||||
/doc
|
/doc
|
||||||
/Makefile
|
/Makefile
|
||||||
/src/cmake_install.cmake
|
/src/cmake_install.cmake
|
||||||
/src/liblibluppp.a
|
/src/liblibloopp.a
|
||||||
/src/Makefile
|
/src/Makefile
|
||||||
CMakeFiles/*
|
CMakeFiles/*
|
||||||
src/CMakeFiles/*
|
src/CMakeFiles/*
|
||||||
|
|
|
@ -51,7 +51,7 @@ test:
|
||||||
- build-test
|
- build-test
|
||||||
script:
|
script:
|
||||||
- ninja -C buildDir test
|
- ninja -C buildDir test
|
||||||
- gcovr -b -e buildDir/luppp@exe/catch.hpp -e buildDir/luppp@exe/test_ <&1 | tee buildDir/coverage.txt
|
- gcovr -b -e buildDir/loopp@exe/catch.hpp -e buildDir/loopp@exe/test_ <&1 | tee buildDir/coverage.txt
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- buildDir/coverage.txt
|
- buildDir/coverage.txt
|
||||||
|
@ -74,4 +74,4 @@ package-AppImage:
|
||||||
untracked: false
|
untracked: false
|
||||||
expire_in: 30 days
|
expire_in: 30 days
|
||||||
paths:
|
paths:
|
||||||
- Luppp-*.AppImage*
|
- Loopp-*.AppImage*
|
||||||
|
|
|
@ -38,7 +38,7 @@ script:
|
||||||
- ./linuxdeployqt-continuous-x86_64.AppImage build/appdir/usr/share/applications/*.desktop -appimage
|
- ./linuxdeployqt-continuous-x86_64.AppImage build/appdir/usr/share/applications/*.desktop -appimage
|
||||||
after_success:
|
after_success:
|
||||||
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
|
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
|
||||||
- bash upload.sh Luppp*.AppImage*
|
- bash upload.sh Loopp*.AppImage*
|
||||||
branches:
|
branches:
|
||||||
except:
|
except:
|
||||||
#- Do not build tags that we create when we upload to GitHub Releases
|
#- Do not build tags that we create when we upload to GitHub Releases
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
## Features:
|
## Features:
|
||||||
|
|
||||||
* Print version number with `luppp --version`
|
* Print version number with `loopp --version`
|
||||||
|
|
||||||
## Improvements:
|
## Improvements:
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@
|
||||||
|
|
||||||
# 1.1: Saturday 24th December 2016
|
# 1.1: Saturday 24th December 2016
|
||||||
## Features:
|
## Features:
|
||||||
* Added saveDirectory option to set the save dir for Luppp sessions
|
* Added saveDirectory option to set the save dir for Loopp sessions
|
||||||
* Added possibility to enable metronom on startup and set volume
|
* Added possibility to enable metronom on startup and set volume
|
||||||
* Added possibility to save clips
|
* Added possibility to save clips
|
||||||
* Added per track outputs
|
* Added per track outputs
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
|
|
||||||
cmake_minimum_required (VERSION 2.6)
|
cmake_minimum_required (VERSION 2.6)
|
||||||
|
|
||||||
project (LUPPP)
|
project (LOOPP)
|
||||||
|
|
||||||
set(LUPPP_VERSION_MAJOR "1")
|
set(LOOPP_VERSION_MAJOR "1")
|
||||||
set(LUPPP_VERSION_MINOR "2")
|
set(LOOPP_VERSION_MINOR "2")
|
||||||
set(LUPPP_VERSION_PATCH "0")
|
set(LOOPP_VERSION_PATCH "0")
|
||||||
|
|
||||||
set(LUPPP_VERSION "${LUPPP_VERSION_MAJOR}.${LUPPP_VERSION_MINOR}.${LUPPP_VERSION_PATCH}")
|
set(LOOPP_VERSION "${LOOPP_VERSION_MAJOR}.${LOOPP_VERSION_MINOR}.${LOOPP_VERSION_PATCH}")
|
||||||
|
|
||||||
option(BUILD_TESTS "Build test version" OFF)
|
option(BUILD_TESTS "Build test version" OFF)
|
||||||
option(WITH_ASAN "Build address sanitized version" OFF)
|
option(WITH_ASAN "Build address sanitized version" OFF)
|
||||||
|
|
4
Doxyfile
4
Doxyfile
|
@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
|
||||||
# title of most generated pages and in a few other places.
|
# title of most generated pages and in a few other places.
|
||||||
# The default value is: My Project.
|
# The default value is: My Project.
|
||||||
|
|
||||||
PROJECT_NAME = "openAV - Luppp"
|
PROJECT_NAME = "openAV - Loopp"
|
||||||
|
|
||||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
|
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
|
||||||
# could be handy for archiving the generated documentation or if some version
|
# could be handy for archiving the generated documentation or if some version
|
||||||
|
@ -51,7 +51,7 @@ PROJECT_BRIEF =
|
||||||
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
|
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
|
||||||
# the logo to the output directory.
|
# the logo to the output directory.
|
||||||
|
|
||||||
PROJECT_LOGO = resources/icons/luppp.svg
|
PROJECT_LOGO = resources/icons/loopp.svg
|
||||||
|
|
||||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
|
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
|
||||||
# into which the generated documentation will be written. If a relative path is
|
# into which the generated documentation will be written. If a relative path is
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
Thanks for looking into packaging Luppp:
|
Thanks for looking into packaging Loopp:
|
||||||
OpenAV couldn't possibly package for every distro,
|
OpenAV couldn't possibly package for every distro,
|
||||||
your work is apprecatied!
|
your work is apprecatied!
|
||||||
|
|
||||||
|
@ -10,10 +10,10 @@ Notes for packaging:
|
||||||
|
|
||||||
=== Controllers directory
|
=== Controllers directory
|
||||||
Install controllers directory (and contents) to
|
Install controllers directory (and contents) to
|
||||||
/usr/share/luppp/controllers
|
/usr/share/loopp/controllers
|
||||||
|
|
||||||
Result: dir: /usr/share/luppp/controllers/
|
Result: dir: /usr/share/loopp/controllers/
|
||||||
files: /usr/share/luppp/controllers/<filename>.ctlr
|
files: /usr/share/loopp/controllers/<filename>.ctlr
|
||||||
|
|
||||||
|
|
||||||
=== Questions
|
=== Questions
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
./version.sh
|
./version.sh
|
||||||
git archive HEAD --prefix=luppp-beta/ --format=zip > lupppGit_`date +"%d-%m-%Y"`_`git log --pretty=format:"%h" | head -n1`.zip
|
git archive HEAD --prefix=loopp-beta/ --format=zip > looppGit_`date +"%d-%m-%Y"`_`git log --pretty=format:"%h" | head -n1`.zip
|
||||||
|
|
12
meson.build
12
meson.build
|
@ -1,4 +1,4 @@
|
||||||
project( 'openav_luppp', ['c','cpp'],
|
project( 'openav_loopp', ['c','cpp'],
|
||||||
default_options : [
|
default_options : [
|
||||||
'cpp_std=c++11',
|
'cpp_std=c++11',
|
||||||
])
|
])
|
||||||
|
@ -18,7 +18,7 @@ add_project_arguments('-Wno-sign-compare', language : 'cpp')
|
||||||
cc = meson.get_compiler('c')
|
cc = meson.get_compiler('c')
|
||||||
cpp = meson.get_compiler('cpp')
|
cpp = meson.get_compiler('cpp')
|
||||||
|
|
||||||
luppp_src = []
|
loopp_src = []
|
||||||
subdir('src')
|
subdir('src')
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ foreach dep : dep_names
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
# compile the main project
|
# compile the main project
|
||||||
exe = executable('luppp', luppp_src + [version_hxx],
|
exe = executable('loopp', loopp_src + [version_hxx],
|
||||||
install: true,
|
install: true,
|
||||||
dependencies: deps)
|
dependencies: deps)
|
||||||
|
|
||||||
|
@ -46,6 +46,6 @@ if get_option('unitTests')
|
||||||
test('Unit Tests', exe, args : ['-r junit', '-o junit.xml'])
|
test('Unit Tests', exe, args : ['-r junit', '-o junit.xml'])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
install_data('resources/metadata/luppp.desktop', install_dir: 'share/applications')
|
install_data('resources/metadata/loopp.desktop', install_dir: 'share/applications')
|
||||||
install_data('resources/metadata/luppp.appdata.xml', install_dir: 'share/appdata')
|
install_data('resources/metadata/loopp.appdata.xml', install_dir: 'share/appdata')
|
||||||
install_data('resources/icons/luppp.png', install_dir: 'share/pixmaps')
|
install_data('resources/icons/loopp.png', install_dir: 'share/pixmaps')
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
/* GIMP RGBA C-Source image dump (luppp.c) */
|
/* GIMP RGBA C-Source image dump (LOOPP.c) */
|
||||||
|
|
||||||
static const struct {
|
static const struct {
|
||||||
unsigned int width;
|
unsigned int width;
|
||||||
unsigned int height;
|
unsigned int height;
|
||||||
unsigned int bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */
|
unsigned int bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */
|
||||||
unsigned char pixel_data[130 * 36 * 4 + 1];
|
unsigned char pixel_data[130 * 36 * 4 + 1];
|
||||||
} lupppImg = {
|
} looppImg = {
|
||||||
130, 36, 4,
|
130, 36, 4,
|
||||||
"(((\377(((\377(((\377(((\377(((\377(((\377(((\377(((\377(((\377(((\377(("
|
"(((\377(((\377(((\377(((\377(((\377(((\377(((\377(((\377(((\377(((\377(("
|
||||||
"(\377(((\377(()\377(((\377)((\377)((\377(((\377(((\377(((\377(((\377(((\377"
|
"(\377(((\377(()\377(((\377)((\377)((\377(((\377(((\377(((\377(((\377(((\377"
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
|
@ -16,7 +16,7 @@
|
||||||
version="1.1"
|
version="1.1"
|
||||||
id="svg8"
|
id="svg8"
|
||||||
inkscape:version="0.92.1 r15371"
|
inkscape:version="0.92.1 r15371"
|
||||||
sodipodi:docname="luppp.svg">
|
sodipodi:docname="loopp.svg">
|
||||||
<defs
|
<defs
|
||||||
id="defs2">
|
id="defs2">
|
||||||
<linearGradient
|
<linearGradient
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
|
@ -1,18 +1,18 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<application>
|
<application>
|
||||||
<id type="desktop">luppp.desktop</id>
|
<id type="desktop">loopp.desktop</id>
|
||||||
<licence>CC0</licence>
|
<licence>CC0</licence>
|
||||||
<name>OpenAV Luppp</name>
|
<name>OpenAV Loopp</name>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Luppp is a music creation tool, intended for live use. It
|
Loopp is a music creation tool, intended for live use. It
|
||||||
focuses on real time processing and a fast intuitive
|
focuses on real time processing and a fast intuitive
|
||||||
workflow. It has been developed since December 2011, and many
|
workflow. It has been developed since December 2011, and many
|
||||||
iterations of development have been completed. Luppp
|
iterations of development have been completed. Loopp
|
||||||
uses jack for audio output.
|
uses jack for audio output.
|
||||||
</p>
|
</p>
|
||||||
<p xml:lang="fr">
|
<p xml:lang="fr">
|
||||||
Luppp est un outil de création musicale pensé pour une
|
Loopp est un outil de création musicale pensé pour une
|
||||||
utilisation live. Il se concentre sur l'utilisation en
|
utilisation live. Il se concentre sur l'utilisation en
|
||||||
temps-réel et une expérience utilisateur intuitive et
|
temps-réel et une expérience utilisateur intuitive et
|
||||||
rapide. Il est en développement depuis Décembre 2011, et
|
rapide. Il est en développement depuis Décembre 2011, et
|
||||||
|
@ -22,8 +22,8 @@
|
||||||
</description>
|
</description>
|
||||||
<screenshots>
|
<screenshots>
|
||||||
<!-- the width and height are optional, but suggested -->
|
<!-- the width and height are optional, but suggested -->
|
||||||
<screenshot type="default" width="1110" height="650">https://raw.github.com/harryhaaren/openAV-Luppp/master/resources/screenshots/1.0.png</screenshot>
|
<screenshot type="default" width="1110" height="650">https://raw.github.com/harryhaaren/openAV-Loopp/master/resources/screenshots/1.0.png</screenshot>
|
||||||
</screenshots>
|
</screenshots>
|
||||||
<url type="homepage">http://openavproductions.com/luppp</url>
|
<url type="homepage">http://openavproductions.com/loopp</url>
|
||||||
<updatecontact>zbyszek@in.waw.pl</updatecontact>
|
<updatecontact>zbyszek@in.waw.pl</updatecontact>
|
||||||
</application>
|
</application>
|
|
@ -1,13 +1,13 @@
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Name=Luppp
|
Name=Loopp
|
||||||
GenericName=Live performance mixing tool
|
GenericName=Live performance mixing tool
|
||||||
GenericName[fr]=Outil de mixage pour performance live
|
GenericName[fr]=Outil de mixage pour performance live
|
||||||
Comment=Create music by recording, playing, and mixing samples
|
Comment=Create music by recording, playing, and mixing samples
|
||||||
Comment[fr]=Créer de la musique en enregistrant, jouant, et mixant des échantillons
|
Comment[fr]=Créer de la musique en enregistrant, jouant, et mixant des échantillons
|
||||||
Type=Application
|
Type=Application
|
||||||
Categories=Audio;AudioVideo;
|
Categories=Audio;AudioVideo;
|
||||||
Exec=luppp
|
Exec=loopp
|
||||||
Terminal=false
|
Terminal=false
|
||||||
StartupNotify=true
|
StartupNotify=true
|
||||||
Icon=luppp
|
Icon=loopp
|
||||||
X-NSM-capable=true
|
X-NSM-capable=true
|
|
@ -68,29 +68,29 @@ endif()
|
||||||
FILE(GLOB sources *.cxx avtk/*.cxx cjson/*.c controller/*.cxx dsp/*.cxx observer/*.cxx state/*.cxx tests/*.cxx)
|
FILE(GLOB sources *.cxx avtk/*.cxx cjson/*.c controller/*.cxx dsp/*.cxx observer/*.cxx state/*.cxx tests/*.cxx)
|
||||||
|
|
||||||
# Compile binary
|
# Compile binary
|
||||||
add_executable (luppp version.hxx ${sources} )
|
add_executable (loopp version.hxx ${sources} )
|
||||||
|
|
||||||
# require a C++11 compiler
|
# require a C++11 compiler
|
||||||
set_target_properties(luppp PROPERTIES
|
set_target_properties(loopp PROPERTIES
|
||||||
CXX_STANDARD 11
|
CXX_STANDARD 11
|
||||||
CXX_STANDARD_REQUIRED YES
|
CXX_STANDARD_REQUIRED YES
|
||||||
CXX_EXTENSIONS NO
|
CXX_EXTENSIONS NO
|
||||||
)
|
)
|
||||||
|
|
||||||
# Linking
|
# Linking
|
||||||
target_link_libraries( luppp ${JACK_LIBRARIES} )
|
target_link_libraries( loopp ${JACK_LIBRARIES} )
|
||||||
target_link_libraries( luppp ${LIBLO_LIBRARIES} )
|
target_link_libraries( loopp ${LIBLO_LIBRARIES} )
|
||||||
target_link_libraries( luppp ${NTK_LIBRARIES} )
|
target_link_libraries( loopp ${NTK_LIBRARIES} )
|
||||||
target_link_libraries( luppp ${CAIRO_LIBRARIES} )
|
target_link_libraries( loopp ${CAIRO_LIBRARIES} )
|
||||||
target_link_libraries( luppp ${SNDFILE_LIBRARIES} )
|
target_link_libraries( loopp ${SNDFILE_LIBRARIES} )
|
||||||
target_link_libraries( luppp ${SAMPLERATE_LIBRARIES} )
|
target_link_libraries( loopp ${SAMPLERATE_LIBRARIES} )
|
||||||
target_link_libraries( luppp ${X11_LIBRARIES} )
|
target_link_libraries( loopp ${X11_LIBRARIES} )
|
||||||
|
|
||||||
# Check build type, linking with gcov for code analysis if needed
|
# Check build type, linking with gcov for code analysis if needed
|
||||||
IF(BUILD_TESTS)
|
IF(BUILD_TESTS)
|
||||||
target_link_libraries(luppp gcov)
|
target_link_libraries(loopp gcov)
|
||||||
ENDIF(BUILD_TESTS)
|
ENDIF(BUILD_TESTS)
|
||||||
|
|
||||||
# add the install targets
|
# add the install targets
|
||||||
install (TARGETS luppp DESTINATION bin)
|
install (TARGETS loopp DESTINATION bin)
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ long AudioBuffer::getAudioFrames()
|
||||||
long AudioBuffer::getSize()
|
long AudioBuffer::getSize()
|
||||||
{
|
{
|
||||||
if(bufferL.size() != bufferR.size()) {
|
if(bufferL.size() != bufferR.size()) {
|
||||||
LUPPP_WARN("left and right channels of audio buffer have different size: %i vs %i", bufferL.size(), bufferR.size() );
|
LOOPP_WARN("left and right channels of audio buffer have different size: %i vs %i", bufferL.size(), bufferR.size() );
|
||||||
}
|
}
|
||||||
return std::min(bufferL.size(), bufferR.size());
|
return std::min(bufferL.size(), bufferR.size());
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_AUDIOBUFFER_H
|
#ifndef LOOPP_AUDIOBUFFER_H
|
||||||
#define LUPPP_AUDIOBUFFER_H
|
#define LOOPP_AUDIOBUFFER_H
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_AUDIO_PROCESSOR_H
|
#ifndef LOOPP_AUDIO_PROCESSOR_H
|
||||||
#define LUPPP_AUDIO_PROCESSOR_H
|
#define LOOPP_AUDIO_PROCESSOR_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
@ -49,5 +49,5 @@ public:
|
||||||
virtual ~AudioProcessor() {};
|
virtual ~AudioProcessor() {};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_AUDIO_PROCESSOR_H
|
#endif // LOOPP_AUDIO_PROCESSOR_H
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
luppp_src += files( 'bindings.cxx', 'volume.cxx', 'clipselector.cxx')
|
loopp_src += files( 'bindings.cxx', 'volume.cxx', 'clipselector.cxx')
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_BUFFERS_H
|
#ifndef LOOPP_BUFFERS_H
|
||||||
#define LUPPP_BUFFERS_H
|
#define LOOPP_BUFFERS_H
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <jack/transport.h>
|
#include <jack/transport.h>
|
||||||
|
@ -151,5 +151,5 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_BUFFERS_H
|
#endif // LOOPP_BUFFERS_H
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
luppp_src += files('cJSON.c')
|
loopp_src += files('cJSON.c')
|
||||||
|
|
|
@ -16,12 +16,12 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_CONFIG_H
|
#ifndef LOOPP_CONFIG_H
|
||||||
#define LUPPP_CONFIG_H
|
#define LOOPP_CONFIG_H
|
||||||
|
|
||||||
|
|
||||||
/// PROGAM WIDE DEFINES
|
/// PROGAM WIDE DEFINES
|
||||||
#define NAME "Luppp"
|
#define NAME "Loopp"
|
||||||
|
|
||||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||||
|
|
||||||
|
@ -65,9 +65,9 @@
|
||||||
#define LOOPER_SAMPLES_BEFORE_REQUEST 44100
|
#define LOOPER_SAMPLES_BEFORE_REQUEST 44100
|
||||||
#define LOOPER_SAMPLES_UPDATE_SIZE 44100
|
#define LOOPER_SAMPLES_UPDATE_SIZE 44100
|
||||||
|
|
||||||
#define LUPPP_RETURN_OK 0
|
#define LOOPP_RETURN_OK 0
|
||||||
#define LUPPP_RETURN_WARNING 1
|
#define LOOPP_RETURN_WARNING 1
|
||||||
#define LUPPP_RETURN_ERROR 2
|
#define LOOPP_RETURN_ERROR 2
|
||||||
|
|
||||||
// Smoothing value
|
// Smoothing value
|
||||||
#define SMOOTHING_CONST 0.005
|
#define SMOOTHING_CONST 0.005
|
||||||
|
@ -76,5 +76,5 @@
|
||||||
#include "debug.hxx"
|
#include "debug.hxx"
|
||||||
|
|
||||||
|
|
||||||
#endif // LUPPP_CONFIG_H
|
#endif // LOOPP_CONFIG_H
|
||||||
|
|
||||||
|
|
|
@ -17,13 +17,13 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef LUPPP_BINDING_H
|
#ifndef LOOPP_BINDING_H
|
||||||
#define LUPPP_BINDING_H
|
#define LOOPP_BINDING_H
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
/// a LupppAction represents the Event type, as from Event.hxx
|
/// a LooppAction represents the Event type, as from Event.hxx
|
||||||
typedef int LupppAction;
|
typedef int LooppAction;
|
||||||
|
|
||||||
class Binding
|
class Binding
|
||||||
{
|
{
|
||||||
|
@ -41,7 +41,7 @@ public:
|
||||||
|
|
||||||
/// the action this binding relates to: this is an integer based on the
|
/// the action this binding relates to: this is an integer based on the
|
||||||
/// event.hxx enumeration of event types
|
/// event.hxx enumeration of event types
|
||||||
LupppAction action;
|
LooppAction action;
|
||||||
|
|
||||||
/// arguments to the event: track number, scene number etc
|
/// arguments to the event: track number, scene number etc
|
||||||
int active;
|
int active;
|
||||||
|
|
|
@ -17,15 +17,15 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef LUPPP_CONTROLLER_H
|
#ifndef LOOPP_CONTROLLER_H
|
||||||
#define LUPPP_CONTROLLER_H
|
#define LOOPP_CONTROLLER_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "../gridlogic.hxx"
|
#include "../gridlogic.hxx"
|
||||||
|
|
||||||
/** Controller
|
/** Controller
|
||||||
* This is the base class for any device that interacts with Luppp.
|
* This is the base class for any device that interacts with Loopp.
|
||||||
* Overriding the virtual functions allows the subclass to be notified about
|
* Overriding the virtual functions allows the subclass to be notified about
|
||||||
* that event type. To provide input, #include gridlogic.hxx and logic.hxx
|
* that event type. To provide input, #include gridlogic.hxx and logic.hxx
|
||||||
**/
|
**/
|
||||||
|
@ -100,5 +100,5 @@ private:
|
||||||
int ID;
|
int ID;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_CONTROLLER_H
|
#endif // LOOPP_CONTROLLER_H
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ GenericMIDI::GenericMIDI(int waste, std::string n) :
|
||||||
Controller(),
|
Controller(),
|
||||||
MidiIO()
|
MidiIO()
|
||||||
{
|
{
|
||||||
LUPPP_NOTE("Adding GenericMIDI %s", n.c_str() );
|
LOOPP_NOTE("Adding GenericMIDI %s", n.c_str() );
|
||||||
name = n;
|
name = n;
|
||||||
registerMidiPorts( name );
|
registerMidiPorts( name );
|
||||||
stat = CONTROLLER_OK;
|
stat = CONTROLLER_OK;
|
||||||
|
@ -49,7 +49,7 @@ GenericMIDI::GenericMIDI(int waste, std::string n) :
|
||||||
|
|
||||||
void GenericMIDI::setFootswitchToNextScene(int v)
|
void GenericMIDI::setFootswitchToNextScene(int v)
|
||||||
{
|
{
|
||||||
LUPPP_NOTE("Set Footswitch to %i", v );
|
LOOPP_NOTE("Set Footswitch to %i", v );
|
||||||
if ( v == 0 ) {
|
if ( v == 0 ) {
|
||||||
footswitchNextScene = false;
|
footswitchNextScene = false;
|
||||||
footswitchPrevScene = false;
|
footswitchPrevScene = false;
|
||||||
|
@ -77,12 +77,12 @@ GenericMIDI::GenericMIDI(std::string file) :
|
||||||
// load the JSON config file
|
// load the JSON config file
|
||||||
int result = loadController( file );
|
int result = loadController( file );
|
||||||
|
|
||||||
if ( result == LUPPP_RETURN_OK ) {
|
if ( result == LOOPP_RETURN_OK ) {
|
||||||
LUPPP_NOTE("GenericMIDI registering ports: %s", name.c_str() );
|
LOOPP_NOTE("GenericMIDI registering ports: %s", name.c_str() );
|
||||||
registerMidiPorts( name );
|
registerMidiPorts( name );
|
||||||
stat = CONTROLLER_OK;
|
stat = CONTROLLER_OK;
|
||||||
} else {
|
} else {
|
||||||
LUPPP_ERROR("Error in loading controller map!" );
|
LOOPP_ERROR("Error in loading controller map!" );
|
||||||
stat = CONTROLLER_ERROR;
|
stat = CONTROLLER_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ int GenericMIDI::registerComponents()
|
||||||
|
|
||||||
jack->registerMidiIO( m );
|
jack->registerMidiIO( m );
|
||||||
|
|
||||||
return LUPPP_RETURN_OK;
|
return LOOPP_RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GenericMIDI::getName()
|
std::string GenericMIDI::getName()
|
||||||
|
@ -212,7 +212,7 @@ void GenericMIDI::midi(unsigned char* midi)
|
||||||
|
|
||||||
// create new MIDI binding?
|
// create new MIDI binding?
|
||||||
if ( jack->bindingEventRecordEnable ) {
|
if ( jack->bindingEventRecordEnable ) {
|
||||||
//LUPPP_NOTE("making binding from: %i %i %f", status, data, value );
|
//LOOPP_NOTE("making binding from: %i %i %f", status, data, value );
|
||||||
setupBinding( jack->bindingEventType, status, data,
|
setupBinding( jack->bindingEventType, status, data,
|
||||||
jack->bindingTrack,
|
jack->bindingTrack,
|
||||||
jack->bindingScene,
|
jack->bindingScene,
|
||||||
|
@ -247,7 +247,7 @@ void GenericMIDI::midi(unsigned char* midi)
|
||||||
Binding* b = midiToAction.at(i);
|
Binding* b = midiToAction.at(i);
|
||||||
|
|
||||||
if ( b->status == status && b->data == data ) {
|
if ( b->status == status && b->data == data ) {
|
||||||
//LUPPP_NOTE("Executing action %s, send %i value %f, b->active %i", Event::getPrettyName(b->action), b->send, value, int(b->active) );
|
//LOOPP_NOTE("Executing action %s, send %i value %f, b->active %i", Event::getPrettyName(b->action), b->send, value, int(b->active) );
|
||||||
|
|
||||||
switch( b->action ) {
|
switch( b->action ) {
|
||||||
case Event::TRACK_VOLUME:
|
case Event::TRACK_VOLUME:
|
||||||
|
@ -308,11 +308,11 @@ void GenericMIDI::midi(unsigned char* midi)
|
||||||
jack->getLogic()->masterInputVol( value );
|
jack->getLogic()->masterInputVol( value );
|
||||||
break;
|
break;
|
||||||
case Event::MASTER_INPUT_TO:
|
case Event::MASTER_INPUT_TO:
|
||||||
//LUPPP_NOTE("GenMidi event INPUT_TO %i", b->send );
|
//LOOPP_NOTE("GenMidi event INPUT_TO %i", b->send );
|
||||||
jack->getLogic()->masterInputTo( b->send, value );
|
jack->getLogic()->masterInputTo( b->send, value );
|
||||||
break;
|
break;
|
||||||
case Event::MASTER_INPUT_TO_ACTIVE:
|
case Event::MASTER_INPUT_TO_ACTIVE:
|
||||||
//LUPPP_NOTE("GenMidi event INPUT_TO_ACTIVE %i", b->send );
|
//LOOPP_NOTE("GenMidi event INPUT_TO_ACTIVE %i", b->send );
|
||||||
jack->getLogic()->masterInputToActive( b->send, b->active );
|
jack->getLogic()->masterInputToActive( b->send, b->active );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ void GenericMIDI::setSceneState(int t, int scene, GridLogic::State s)
|
||||||
data[1] = b->data;
|
data[1] = b->data;
|
||||||
data[2] = it->second;
|
data[2] = it->second;
|
||||||
|
|
||||||
//LUPPP_NOTE("GenericMIDI::sceneState() writing event %i, %i, %i", data[0],data[1],data[2] );
|
//LOOPP_NOTE("GenericMIDI::sceneState() writing event %i, %i, %i", data[0],data[1],data[2] );
|
||||||
writeMidi( data );
|
writeMidi( data );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -396,7 +396,7 @@ void GenericMIDI::launchScene( int scene )
|
||||||
data[1] = b->data;
|
data[1] = b->data;
|
||||||
data[2] = (i == scene) * 127;
|
data[2] = (i == scene) * 127;
|
||||||
|
|
||||||
//LUPPP_NOTE("this = %i GenericMIDI::launchScene()", this );
|
//LOOPP_NOTE("this = %i GenericMIDI::launchScene()", this );
|
||||||
writeMidi( data );
|
writeMidi( data );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -409,7 +409,7 @@ int GenericMIDI::loadController( std::string file )
|
||||||
|
|
||||||
/// open and read whole file
|
/// open and read whole file
|
||||||
#ifdef DEBUG_CONTROLLER
|
#ifdef DEBUG_CONTROLLER
|
||||||
LUPPP_NOTE("%s%s","Loading controller : ", file.c_str() );
|
LOOPP_NOTE("%s%s","Loading controller : ", file.c_str() );
|
||||||
#endif
|
#endif
|
||||||
std::ifstream sampleFile( file.c_str(), std::ios_base::in|std::ios_base::ate);
|
std::ifstream sampleFile( file.c_str(), std::ios_base::in|std::ios_base::ate);
|
||||||
long file_length = sampleFile.tellg();
|
long file_length = sampleFile.tellg();
|
||||||
|
@ -427,37 +427,37 @@ int GenericMIDI::loadController( std::string file )
|
||||||
|
|
||||||
std::string line;
|
std::string line;
|
||||||
std::getline( ss, line );
|
std::getline( ss, line );
|
||||||
LUPPP_ERROR("%s %s","Error in JSON *before*: ", line.c_str() );
|
LOOPP_ERROR("%s %s","Error in JSON *before*: ", line.c_str() );
|
||||||
|
|
||||||
for(int i = 0; i < 5; i++) {
|
for(int i = 0; i < 5; i++) {
|
||||||
std::getline( ss, line );
|
std::getline( ss, line );
|
||||||
LUPPP_ERROR("%s %s","Error in JSON : ", line.c_str() );
|
LOOPP_ERROR("%s %s","Error in JSON : ", line.c_str() );
|
||||||
}
|
}
|
||||||
return LUPPP_RETURN_ERROR;
|
return LOOPP_RETURN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
cJSON* nameJson = cJSON_GetObjectItem( controllerJson, "name" );
|
cJSON* nameJson = cJSON_GetObjectItem( controllerJson, "name" );
|
||||||
if ( nameJson ) {
|
if ( nameJson ) {
|
||||||
name = nameJson->valuestring;
|
name = nameJson->valuestring;
|
||||||
LUPPP_NOTE("Device %s", name.c_str() );
|
LOOPP_NOTE("Device %s", name.c_str() );
|
||||||
} else {
|
} else {
|
||||||
LUPPP_NOTE("Has no name field");
|
LOOPP_NOTE("Has no name field");
|
||||||
}
|
}
|
||||||
|
|
||||||
cJSON* authorJson = cJSON_GetObjectItem( controllerJson, "author" );
|
cJSON* authorJson = cJSON_GetObjectItem( controllerJson, "author" );
|
||||||
if ( authorJson ) {
|
if ( authorJson ) {
|
||||||
author = authorJson->valuestring;
|
author = authorJson->valuestring;
|
||||||
LUPPP_NOTE("Author %s", author.c_str() );
|
LOOPP_NOTE("Author %s", author.c_str() );
|
||||||
} else {
|
} else {
|
||||||
LUPPP_NOTE("Has no author field");
|
LOOPP_NOTE("Has no author field");
|
||||||
}
|
}
|
||||||
|
|
||||||
cJSON* linkJson = cJSON_GetObjectItem( controllerJson, "link" );
|
cJSON* linkJson = cJSON_GetObjectItem( controllerJson, "link" );
|
||||||
if ( linkJson ) {
|
if ( linkJson ) {
|
||||||
email = linkJson->valuestring;
|
email = linkJson->valuestring;
|
||||||
LUPPP_NOTE("Link %s", email.c_str() );
|
LOOPP_NOTE("Link %s", email.c_str() );
|
||||||
} else {
|
} else {
|
||||||
LUPPP_NOTE("Has no link field");
|
LOOPP_NOTE("Has no link field");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -474,12 +474,12 @@ int GenericMIDI::loadController( std::string file )
|
||||||
nInputBindings++;
|
nInputBindings++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LUPPP_WARN("No input bindings array in .ctlr map." );
|
LOOPP_WARN("No input bindings array in .ctlr map." );
|
||||||
nInputBindings++; // hack to avoid 2 prints
|
nInputBindings++; // hack to avoid 2 prints
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( nInputBindings == 0 ) {
|
if ( nInputBindings == 0 ) {
|
||||||
LUPPP_NOTE("Zero input bindings present in .ctlr map.");
|
LOOPP_NOTE("Zero input bindings present in .ctlr map.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -494,35 +494,35 @@ int GenericMIDI::loadController( std::string file )
|
||||||
actionToMidi.push_back( tmp );
|
actionToMidi.push_back( tmp );
|
||||||
|
|
||||||
nOutputBindings++;
|
nOutputBindings++;
|
||||||
//LUPPP_NOTE("Binding from %s to %i %i", actionJ->valuestring, statusJson->valueint, dataJson->valueint );
|
//LOOPP_NOTE("Binding from %s to %i %i", actionJ->valuestring, statusJson->valueint, dataJson->valueint );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LUPPP_NOTE("No output bindings array in .ctlr map." );
|
LOOPP_NOTE("No output bindings array in .ctlr map." );
|
||||||
nOutputBindings++; // hack to avoid 2 prints
|
nOutputBindings++; // hack to avoid 2 prints
|
||||||
}
|
}
|
||||||
if ( nOutputBindings == 0 ) {
|
if ( nOutputBindings == 0 ) {
|
||||||
LUPPP_NOTE("Zero output bindings present in .ctlr map." );
|
LOOPP_NOTE("Zero output bindings present in .ctlr map." );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cJSON_Delete( controllerJson );
|
cJSON_Delete( controllerJson );
|
||||||
delete[] sampleString;
|
delete[] sampleString;
|
||||||
} else {
|
} else {
|
||||||
LUPPP_WARN("%s %s","No controller file found at ", file.c_str() );
|
LOOPP_WARN("%s %s","No controller file found at ", file.c_str() );
|
||||||
return LUPPP_RETURN_WARNING;
|
return LOOPP_RETURN_WARNING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LUPPP_NOTE("Controller loading complete." );
|
LOOPP_NOTE("Controller loading complete." );
|
||||||
|
|
||||||
return LUPPP_RETURN_OK;
|
return LOOPP_RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenericMIDI::removeBinding( int bindingID )
|
void GenericMIDI::removeBinding( int bindingID )
|
||||||
{
|
{
|
||||||
for(unsigned int i = 0; i < midiToAction.size(); i++) {
|
for(unsigned int i = 0; i < midiToAction.size(); i++) {
|
||||||
if ( midiToAction.at(i)->ID == bindingID ) {
|
if ( midiToAction.at(i)->ID == bindingID ) {
|
||||||
//LUPPP_NOTE("MIDI binding REMOVED with bindingID %i\n", bindingID );
|
//LOOPP_NOTE("MIDI binding REMOVED with bindingID %i\n", bindingID );
|
||||||
Binding* tmp = midiToAction.at(i);
|
Binding* tmp = midiToAction.at(i);
|
||||||
midiToAction.erase( midiToAction.begin()+i );
|
midiToAction.erase( midiToAction.begin()+i );
|
||||||
|
|
||||||
|
@ -534,9 +534,9 @@ void GenericMIDI::removeBinding( int bindingID )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenericMIDI::setupBinding( LupppAction eventType, int midiStatus, int midiData, int track, int scene, int send, int active )
|
void GenericMIDI::setupBinding( LooppAction eventType, int midiStatus, int midiData, int track, int scene, int send, int active )
|
||||||
{
|
{
|
||||||
LUPPP_NOTE("MIDI binding, track %d, send %d from eventType %d to %d, %d", track, send, eventType, midiStatus, midiData );
|
LOOPP_NOTE("MIDI binding, track %d, send %d from eventType %d to %d, %d", track, send, eventType, midiStatus, midiData );
|
||||||
|
|
||||||
// FIXME: NON-RT Have stack of Bindings() available, or push in GUI thread?
|
// FIXME: NON-RT Have stack of Bindings() available, or push in GUI thread?
|
||||||
Binding* tmp = new Binding();
|
Binding* tmp = new Binding();
|
||||||
|
@ -564,7 +564,7 @@ Binding* GenericMIDI::setupBinding( cJSON* binding )
|
||||||
|
|
||||||
cJSON* actionJson = cJSON_GetObjectItem( binding, "action" );
|
cJSON* actionJson = cJSON_GetObjectItem( binding, "action" );
|
||||||
if ( !actionJson ) {
|
if ( !actionJson ) {
|
||||||
LUPPP_WARN("Binding doesn't have action field: fix .ctlr file");
|
LOOPP_WARN("Binding doesn't have action field: fix .ctlr file");
|
||||||
delete tmp;
|
delete tmp;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -572,7 +572,7 @@ Binding* GenericMIDI::setupBinding( cJSON* binding )
|
||||||
cJSON* statusJson = cJSON_GetObjectItem( binding, "status" );
|
cJSON* statusJson = cJSON_GetObjectItem( binding, "status" );
|
||||||
cJSON* dataJson = cJSON_GetObjectItem( binding, "data" );
|
cJSON* dataJson = cJSON_GetObjectItem( binding, "data" );
|
||||||
if ( !statusJson || !dataJson ) {
|
if ( !statusJson || !dataJson ) {
|
||||||
LUPPP_WARN("Binding w Action:%s doesn't have status / data field: fix .ctlr file", actionJson->valuestring);
|
LOOPP_WARN("Binding w Action:%s doesn't have status / data field: fix .ctlr file", actionJson->valuestring);
|
||||||
delete tmp;
|
delete tmp;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -645,12 +645,12 @@ Binding* GenericMIDI::setupBinding( cJSON* binding )
|
||||||
tmp->action = Event::MASTER_VOL;
|
tmp->action = Event::MASTER_VOL;
|
||||||
} else if ( strcmp( actionJson->valuestring, "metronome:active" ) == 0 ) {
|
} else if ( strcmp( actionJson->valuestring, "metronome:active" ) == 0 ) {
|
||||||
tmp->action = Event::METRONOME_ACTIVE;
|
tmp->action = Event::METRONOME_ACTIVE;
|
||||||
LUPPP_NOTE("binding metro active event, tmp->active == %i", tmp->active );
|
LOOPP_NOTE("binding metro active event, tmp->active == %i", tmp->active );
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for valid event: otherwise pass
|
// check for valid event: otherwise pass
|
||||||
if ( tmp->action != Event::EVENT_NULL ) {
|
if ( tmp->action != Event::EVENT_NULL ) {
|
||||||
//LUPPP_NOTE("Binding from %i %i %s", statusJson->valueint, dataJson->valueint, actionJson->valuestring);
|
//LOOPP_NOTE("Binding from %i %i %s", statusJson->valueint, dataJson->valueint, actionJson->valuestring);
|
||||||
|
|
||||||
cJSON* track = cJSON_GetObjectItem( binding, "track" );
|
cJSON* track = cJSON_GetObjectItem( binding, "track" );
|
||||||
cJSON* scene = cJSON_GetObjectItem( binding, "scene" );
|
cJSON* scene = cJSON_GetObjectItem( binding, "scene" );
|
||||||
|
@ -665,7 +665,7 @@ Binding* GenericMIDI::setupBinding( cJSON* binding )
|
||||||
|
|
||||||
return tmp;
|
return tmp;
|
||||||
} else {
|
} else {
|
||||||
LUPPP_WARN("Binding action not recognized: %s", actionJson->valuestring );
|
LOOPP_WARN("Binding action not recognized: %s", actionJson->valuestring );
|
||||||
}
|
}
|
||||||
|
|
||||||
delete tmp;
|
delete tmp;
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef LUPPP_GENERIC_MIDI_H
|
#ifndef LOOPP_GENERIC_MIDI_H
|
||||||
#define LUPPP_GENERIC_MIDI_H
|
#define LOOPP_GENERIC_MIDI_H
|
||||||
|
|
||||||
#include "controller.hxx"
|
#include "controller.hxx"
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ public:
|
||||||
const std::vector<Binding*>& getMidiToAction();
|
const std::vector<Binding*>& getMidiToAction();
|
||||||
|
|
||||||
// for adding bindings from MIDI / GUI event pair
|
// for adding bindings from MIDI / GUI event pair
|
||||||
void setupBinding( LupppAction eventType, int midiStatus, int midiData, int track, int scene, int send, int active );
|
void setupBinding( LooppAction eventType, int midiStatus, int midiData, int track, int scene, int send, int active );
|
||||||
void removeBinding( int bindingID );
|
void removeBinding( int bindingID );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -117,5 +117,5 @@ private:
|
||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_GENERIC_MIDI_H
|
#endif // LOOPP_GENERIC_MIDI_H
|
||||||
|
|
||||||
|
|
|
@ -29,126 +29,126 @@
|
||||||
|
|
||||||
extern Jack* jack;
|
extern Jack* jack;
|
||||||
|
|
||||||
LupppGUI::LupppGUI() :
|
LooppGUI::LooppGUI() :
|
||||||
Controller()
|
Controller()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::masterInputVol(float f)
|
void LooppGUI::masterInputVol(float f)
|
||||||
{
|
{
|
||||||
EventMasterInputVol e( f );
|
EventMasterInputVol e( f );
|
||||||
writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::masterInputTo(int to,float f)
|
void LooppGUI::masterInputTo(int to,float f)
|
||||||
{
|
{
|
||||||
EventMasterInputTo e( (Event::INPUT_TO)to, f );
|
EventMasterInputTo e( (Event::INPUT_TO)to, f );
|
||||||
writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::masterInputToActive(int to,float f)
|
void LooppGUI::masterInputToActive(int to,float f)
|
||||||
{
|
{
|
||||||
EventMasterInputToActive e( (Event::INPUT_TO)to, f );
|
EventMasterInputToActive e( (Event::INPUT_TO)to, f );
|
||||||
writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::masterVolume(float f)
|
void LooppGUI::masterVolume(float f)
|
||||||
{
|
{
|
||||||
EventMasterVol e( f );
|
EventMasterVol e( f );
|
||||||
writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::masterReturnVolume(float f)
|
void LooppGUI::masterReturnVolume(float f)
|
||||||
{
|
{
|
||||||
printf(" return %f ", f );
|
printf(" return %f ", f );
|
||||||
EventMasterReturn e( RETURN_MAIN, f );
|
EventMasterReturn e( RETURN_MAIN, f );
|
||||||
writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::metronomeEnable(bool r)
|
void LooppGUI::metronomeEnable(bool r)
|
||||||
{
|
{
|
||||||
EventMetronomeActive e( r );
|
EventMetronomeActive e( r );
|
||||||
writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::recordArm(int t, bool r)
|
void LooppGUI::recordArm(int t, bool r)
|
||||||
{
|
{
|
||||||
EventTrackRecordArm e( t, r );
|
EventTrackRecordArm e( t, r );
|
||||||
writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::trackSend(int t, int send, float r)
|
void LooppGUI::trackSend(int t, int send, float r)
|
||||||
{
|
{
|
||||||
EventTrackSend e( t, static_cast<Event::SEND_TYPE>(send), r );
|
EventTrackSend e( t, static_cast<Event::SEND_TYPE>(send), r );
|
||||||
writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::specialScene(int t, int s)
|
void LooppGUI::specialScene(int t, int s)
|
||||||
{
|
{
|
||||||
EventGridSelectNewChosen e( t, s );
|
EventGridSelectNewChosen e( t, s );
|
||||||
writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::trackSendActive(int t, int send, bool a)
|
void LooppGUI::trackSendActive(int t, int send, bool a)
|
||||||
{
|
{
|
||||||
EventTrackSendActive e( t, static_cast<Event::SEND_TYPE>(send), a );
|
EventTrackSendActive e( t, static_cast<Event::SEND_TYPE>(send), a );
|
||||||
writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::trackJackSend(int t, float v)
|
void LooppGUI::trackJackSend(int t, float v)
|
||||||
{
|
{
|
||||||
EventTrackJackSend e(t,v);
|
EventTrackJackSend e(t,v);
|
||||||
writeToGuiRingbuffer(&e);
|
writeToGuiRingbuffer(&e);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::trackJackSendActivate(int t, bool a)
|
void LooppGUI::trackJackSendActivate(int t, bool a)
|
||||||
{
|
{
|
||||||
EventTrackJackSendActivate e(t,a);
|
EventTrackJackSendActivate e(t,a);
|
||||||
writeToGuiRingbuffer(&e);
|
writeToGuiRingbuffer(&e);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::setSceneState(int t, int clip, GridLogic::State s)
|
void LooppGUI::setSceneState(int t, int clip, GridLogic::State s)
|
||||||
{
|
{
|
||||||
EventGridState e( t, clip, s );
|
EventGridState e( t, clip, s );
|
||||||
writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::launchScene( int scene )
|
void LooppGUI::launchScene( int scene )
|
||||||
{
|
{
|
||||||
EventGridLaunchScene e( scene );
|
EventGridLaunchScene e( scene );
|
||||||
writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::mute(int t, bool b)
|
void LooppGUI::mute(int t, bool b)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::tapTempo( bool b )
|
void LooppGUI::tapTempo( bool b )
|
||||||
{
|
{
|
||||||
EventTimeTempoTap e(b);
|
EventTimeTempoTap e(b);
|
||||||
writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::bpm(float bpm)
|
void LooppGUI::bpm(float bpm)
|
||||||
{
|
{
|
||||||
EventTimeBPM e(bpm);
|
EventTimeBPM e(bpm);
|
||||||
writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::volume(int t, float f)
|
void LooppGUI::volume(int t, float f)
|
||||||
{
|
{
|
||||||
EventTrackVol e( t, f );
|
EventTrackVol e( t, f );
|
||||||
writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::pan(int t, float p)
|
void LooppGUI::pan(int t, float p)
|
||||||
{
|
{
|
||||||
EventTrackPan e( t, p );
|
EventTrackPan e( t, p );
|
||||||
writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
}
|
}
|
||||||
|
|
||||||
void LupppGUI::progress(int t, int s, float f)
|
void LooppGUI::progress(int t, int s, float f)
|
||||||
{
|
{
|
||||||
EventLooperProgress e( t, f );
|
EventLooperProgress e( t, f );
|
||||||
writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
|
|
|
@ -17,21 +17,21 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef LUPPP_CONTROLLER_GUI_H
|
#ifndef LOOPP_CONTROLLER_GUI_H
|
||||||
#define LUPPP_CONTROLLER_GUI_H
|
#define LOOPP_CONTROLLER_GUI_H
|
||||||
|
|
||||||
#include "controller.hxx"
|
#include "controller.hxx"
|
||||||
|
|
||||||
#include "../observer/midi.hxx"
|
#include "../observer/midi.hxx"
|
||||||
|
|
||||||
class LupppGUI : public Controller
|
class LooppGUI : public Controller
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LupppGUI();
|
LooppGUI();
|
||||||
|
|
||||||
std::string getName()
|
std::string getName()
|
||||||
{
|
{
|
||||||
return "Luppp GUI";
|
return "Loopp GUI";
|
||||||
}
|
}
|
||||||
|
|
||||||
void masterVolume(float f);
|
void masterVolume(float f);
|
||||||
|
@ -63,5 +63,5 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_CONTROLLER_GUI_H
|
#endif // LOOPP_CONTROLLER_GUI_H
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
luppp_src += files(
|
loopp_src += files(
|
||||||
'controller.cxx',
|
'controller.cxx',
|
||||||
'genericmidi.cxx',
|
'genericmidi.cxx',
|
||||||
'guicontroller.cxx',
|
'guicontroller.cxx',
|
||||||
|
|
|
@ -40,7 +40,7 @@ void NonSeq::launchScene( int scene )
|
||||||
data[1] = 20;
|
data[1] = 20;
|
||||||
data[2] = scene;
|
data[2] = scene;
|
||||||
|
|
||||||
//LUPPP_NOTE("NonSeq::launchScene() %i, %i, %i\n", data[0],data[1],data[2] );
|
//LOOPP_NOTE("NonSeq::launchScene() %i, %i, %i\n", data[0],data[1],data[2] );
|
||||||
writeMidi( data );
|
writeMidi( data );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,13 +58,13 @@ void NonSeq::setSceneState(int track, int scene, GridLogic::State s)
|
||||||
|
|
||||||
// check *actual* value of playing: *NOT* GridState::s, because it could be queued
|
// check *actual* value of playing: *NOT* GridState::s, because it could be queued
|
||||||
// for something else, but we want the *actual* here, not "queued". This is a unique
|
// for something else, but we want the *actual* here, not "queued". This is a unique
|
||||||
// use case because were trying to control non-seq as if it were part of Luppp.
|
// use case because were trying to control non-seq as if it were part of Loopp.
|
||||||
if( jack->getLooper( track )->getClip( scene )->playing() )
|
if( jack->getLooper( track )->getClip( scene )->playing() )
|
||||||
data[1] = 21;
|
data[1] = 21;
|
||||||
|
|
||||||
data[2] = track;
|
data[2] = track;
|
||||||
|
|
||||||
//LUPPP_NOTE("NonSeq::setSceneState() %i, %i, %i\n", data[0],data[1],data[2] );
|
//LOOPP_NOTE("NonSeq::setSceneState() %i, %i, %i\n", data[0],data[1],data[2] );
|
||||||
writeMidi( data );
|
writeMidi( data );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,5 +77,5 @@ int NonSeq::registerComponents()
|
||||||
|
|
||||||
jack->registerMidiIO( m );
|
jack->registerMidiIO( m );
|
||||||
|
|
||||||
return LUPPP_RETURN_OK;
|
return LOOPP_RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,14 +17,14 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef LUPPP_NON_SEQ_H
|
#ifndef LOOPP_NON_SEQ_H
|
||||||
#define LUPPP_NON_SEQ_H
|
#define LOOPP_NON_SEQ_H
|
||||||
|
|
||||||
#include "../observer/midi.hxx"
|
#include "../observer/midi.hxx"
|
||||||
#include "controller.hxx"
|
#include "controller.hxx"
|
||||||
|
|
||||||
/** NonSeq
|
/** NonSeq
|
||||||
* A class for integrating the NonSeq sequencer with Luppp, providing scene
|
* A class for integrating the NonSeq sequencer with Loopp, providing scene
|
||||||
* on / off MIDI events to NonSeq
|
* on / off MIDI events to NonSeq
|
||||||
**/
|
**/
|
||||||
class NonSeq : public Controller, public MidiIO
|
class NonSeq : public Controller, public MidiIO
|
||||||
|
@ -42,4 +42,4 @@ public:
|
||||||
void setSceneState(int track, int scene, GridLogic::State s);
|
void setSceneState(int track, int scene, GridLogic::State s);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_NON_SEQ_H
|
#endif // LOOPP_NON_SEQ_H
|
||||||
|
|
|
@ -29,11 +29,11 @@ ControllerUpdater::ControllerUpdater()
|
||||||
void ControllerUpdater::registerController( Controller* controller )
|
void ControllerUpdater::registerController( Controller* controller )
|
||||||
{
|
{
|
||||||
if (!controller) {
|
if (!controller) {
|
||||||
LUPPP_ERROR("Register Controller passed NULL controller!");
|
LOOPP_ERROR("Register Controller passed NULL controller!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//LUPPP_NOTE("Registering controller %s", controller->getName().c_str() );
|
//LOOPP_NOTE("Registering controller %s", controller->getName().c_str() );
|
||||||
|
|
||||||
// store the controller instance
|
// store the controller instance
|
||||||
c.push_back( controller );
|
c.push_back( controller );
|
||||||
|
@ -67,7 +67,7 @@ Controller* ControllerUpdater::getController(int id)
|
||||||
// search controllers for ID, if found return a pointer to it
|
// search controllers for ID, if found return a pointer to it
|
||||||
for( unsigned int i = 0; i < c.size(); i++) {
|
for( unsigned int i = 0; i < c.size(); i++) {
|
||||||
if ( c.at(i)->getID() == id ) {
|
if ( c.at(i)->getID() == id ) {
|
||||||
LUPPP_NOTE("getController target ID: %i, found ID: %i, returning %s", id, i, c.at(i)->getName().c_str() );
|
LOOPP_NOTE("getController target ID: %i, found ID: %i, returning %s", id, i, c.at(i)->getName().c_str() );
|
||||||
return c.at(i);
|
return c.at(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_CONTROLLER_UPDATER_H
|
#ifndef LOOPP_CONTROLLER_UPDATER_H
|
||||||
#define LUPPP_CONTROLLER_UPDATER_H
|
#define LOOPP_CONTROLLER_UPDATER_H
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -37,7 +37,7 @@ using namespace std;
|
||||||
* This class does no scheduling, it passes the events to the Controllers
|
* This class does no scheduling, it passes the events to the Controllers
|
||||||
* immidiatly.
|
* immidiatly.
|
||||||
*
|
*
|
||||||
* The Logic class is the opposite of this: it takes input and Luppp processes
|
* The Logic class is the opposite of this: it takes input and Loopp processes
|
||||||
* it, pushing the relevant updates in state through ControllerUpdater to each
|
* it, pushing the relevant updates in state through ControllerUpdater to each
|
||||||
* registered device.
|
* registered device.
|
||||||
**/
|
**/
|
||||||
|
@ -91,5 +91,5 @@ private:
|
||||||
std::vector<Controller*> c;
|
std::vector<Controller*> c;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_CONTROLLER_UPDATER_H
|
#endif // LOOPP_CONTROLLER_UPDATER_H
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
void luppp_debug( int warnLevel, const char* name, const char* file, const char* func, int line,
|
void loopp_debug( int warnLevel, const char* name, const char* file, const char* func, int line,
|
||||||
const char* format, ... )
|
const char* format, ... )
|
||||||
{
|
{
|
||||||
if ( warnLevel == DEBUG_LEVEL_ERROR ) {
|
if ( warnLevel == DEBUG_LEVEL_ERROR ) {
|
||||||
|
|
|
@ -16,16 +16,16 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_DEBUG_HXX
|
#ifndef LOOPP_DEBUG_HXX
|
||||||
#define LUPPP_DEBUG_HXX
|
#define LOOPP_DEBUG_HXX
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
/* Example usage
|
/* Example usage
|
||||||
LUPPP_NOTE( "%s", "MessageHere" );
|
LOOPP_NOTE( "%s", "MessageHere" );
|
||||||
LUPPP_WARN( "%s", "MessageHere" );
|
LOOPP_WARN( "%s", "MessageHere" );
|
||||||
LUPPP_KILL( "%s", "MessageHere" );
|
LOOPP_KILL( "%s", "MessageHere" );
|
||||||
*/
|
*/
|
||||||
|
|
||||||
enum DEBUG_LEVEL {
|
enum DEBUG_LEVEL {
|
||||||
|
@ -35,18 +35,18 @@ enum DEBUG_LEVEL {
|
||||||
DEBUG_LEVEL_TEST
|
DEBUG_LEVEL_TEST
|
||||||
};
|
};
|
||||||
|
|
||||||
void luppp_debug( int warnLevel, const char* name, const char* file, const char* func, int line,
|
void loopp_debug( int warnLevel, const char* name, const char* file, const char* func, int line,
|
||||||
const char* format = 0, ... );
|
const char* format = 0, ... );
|
||||||
|
|
||||||
|
|
||||||
#define LUPPP_DSP( format, args... ) luppp_debug( DEBUG_LEVEL_NOTE, " DSP ", "", "", 0, format, ## args )
|
#define LOOPP_DSP( format, args... ) loopp_debug( DEBUG_LEVEL_NOTE, " DSP ", "", "", 0, format, ## args )
|
||||||
|
|
||||||
#define LUPPP_NOTE( format, args... ) luppp_debug( DEBUG_LEVEL_NOTE, NAME, __FILE__, __FUNCTION__, __LINE__, format, ## args )
|
#define LOOPP_NOTE( format, args... ) loopp_debug( DEBUG_LEVEL_NOTE, NAME, __FILE__, __FUNCTION__, __LINE__, format, ## args )
|
||||||
#define LUPPP_WARN( format, args... ) luppp_debug( DEBUG_LEVEL_WARN, NAME, __FILE__, __FUNCTION__, __LINE__, format, ## args )
|
#define LOOPP_WARN( format, args... ) loopp_debug( DEBUG_LEVEL_WARN, NAME, __FILE__, __FUNCTION__, __LINE__, format, ## args )
|
||||||
#define LUPPP_ERROR( format, args... ) luppp_debug( DEBUG_LEVEL_ERROR, NAME, __FILE__, __FUNCTION__, __LINE__, format, ## args )
|
#define LOOPP_ERROR( format, args... ) loopp_debug( DEBUG_LEVEL_ERROR, NAME, __FILE__, __FUNCTION__, __LINE__, format, ## args )
|
||||||
|
|
||||||
// only gets printed if #definde BUILD_TESTS
|
// only gets printed if #definde BUILD_TESTS
|
||||||
#define LUPPP_PRINT_TEST( format, args... ) luppp_debug( DEBUG_LEVEL_DEBUG_ONLY, NAME, __FILE__, __FUNCTION__, __LINE__, format, ## args )
|
#define LOOPP_PRINT_TEST( format, args... ) loopp_debug( DEBUG_LEVEL_DEBUG_ONLY, NAME, __FILE__, __FUNCTION__, __LINE__, format, ## args )
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef LUPPP_DENORMALS_H
|
#ifndef LOOPP_DENORMALS_H
|
||||||
#define LUPPP_DENORMALS_H
|
#define LOOPP_DENORMALS_H
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
#include <pmmintrin.h>
|
#include <pmmintrin.h>
|
||||||
inline void AVOIDDENORMALS()
|
inline void AVOIDDENORMALS()
|
||||||
{
|
{
|
||||||
//LUPPP_NOTE("Denormals: FZ DAZ using SSE3");
|
//LOOPP_NOTE("Denormals: FZ DAZ using SSE3");
|
||||||
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
|
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
|
||||||
_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
|
_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ inline void AVOIDDENORMALS()
|
||||||
#include <xmmintrin.h>
|
#include <xmmintrin.h>
|
||||||
inline void AVOIDDENORMALS()
|
inline void AVOIDDENORMALS()
|
||||||
{
|
{
|
||||||
//LUPPP_NOTE("Denormals: FZ");
|
//LOOPP_NOTE("Denormals: FZ");
|
||||||
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
|
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
|
||||||
}
|
}
|
||||||
#endif //__SSE3__
|
#endif //__SSE3__
|
||||||
|
@ -45,9 +45,9 @@ inline void AVOIDDENORMALS()
|
||||||
#else
|
#else
|
||||||
inline void AVOIDDENORMALS()
|
inline void AVOIDDENORMALS()
|
||||||
{
|
{
|
||||||
LUPPP_NOTE( "Denormals: Warning! No protection" );
|
LOOPP_NOTE( "Denormals: Warning! No protection" );
|
||||||
}
|
}
|
||||||
#endif //__SSE__
|
#endif //__SSE__
|
||||||
|
|
||||||
#endif // LUPPP_DENORMALS_H
|
#endif // LOOPP_DENORMALS_H
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ DiskReader::DiskReader()
|
||||||
int DiskReader::loadPreferences()
|
int DiskReader::loadPreferences()
|
||||||
{
|
{
|
||||||
stringstream s;
|
stringstream s;
|
||||||
s << getenv("HOME") << "/.config/openAV/luppp/luppp.prfs";
|
s << getenv("HOME") << "/.config/openAV/loopp/loopp.prfs";
|
||||||
std::ifstream sampleFile( s.str().c_str(), std::ios_base::in|std::ios_base::ate);
|
std::ifstream sampleFile( s.str().c_str(), std::ios_base::in|std::ios_base::ate);
|
||||||
|
|
||||||
long file_length = sampleFile.tellg();
|
long file_length = sampleFile.tellg();
|
||||||
|
@ -64,8 +64,8 @@ int DiskReader::loadPreferences()
|
||||||
|
|
||||||
cJSON* preferencesJson = cJSON_Parse( sampleString );
|
cJSON* preferencesJson = cJSON_Parse( sampleString );
|
||||||
if (!preferencesJson) {
|
if (!preferencesJson) {
|
||||||
LUPPP_WARN("Preferences JSON not valid");
|
LOOPP_WARN("Preferences JSON not valid");
|
||||||
return LUPPP_RETURN_ERROR;
|
return LOOPP_RETURN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ int DiskReader::loadPreferences()
|
||||||
if ( resample ) {
|
if ( resample ) {
|
||||||
resampleQuality = resample->valueint;
|
resampleQuality = resample->valueint;
|
||||||
if ( resampleQuality == 0 ) {
|
if ( resampleQuality == 0 ) {
|
||||||
LUPPP_NOTE("Using Linear resampling, may reduce quality. Check .config/openAV/luppp/luppp.prfs");
|
LOOPP_NOTE("Using Linear resampling, may reduce quality. Check .config/openAV/loopp/loopp.prfs");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cJSON* ctlrs = cJSON_GetObjectItem( preferencesJson, "defaultControllers" );
|
cJSON* ctlrs = cJSON_GetObjectItem( preferencesJson, "defaultControllers" );
|
||||||
|
@ -83,14 +83,14 @@ int DiskReader::loadPreferences()
|
||||||
for(int i = 0; i < nCtlrs; i++ ) {
|
for(int i = 0; i < nCtlrs; i++ ) {
|
||||||
cJSON* ctlr = cJSON_GetArrayItem( ctlrs, i );
|
cJSON* ctlr = cJSON_GetArrayItem( ctlrs, i );
|
||||||
if( ctlr ) {
|
if( ctlr ) {
|
||||||
LUPPP_NOTE("Loading controller %s", ctlr->valuestring);
|
LOOPP_NOTE("Loading controller %s", ctlr->valuestring);
|
||||||
stringstream s;
|
stringstream s;
|
||||||
s << getenv("HOME") << "/.config/openAV/luppp/controllers/" << ctlr->valuestring;
|
s << getenv("HOME") << "/.config/openAV/loopp/controllers/" << ctlr->valuestring;
|
||||||
gui->addMidiControllerToSetup( s.str() );
|
gui->addMidiControllerToSetup( s.str() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LUPPP_NOTE("No default controllers active.");
|
LOOPP_NOTE("No default controllers active.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ int DiskReader::loadPreferences()
|
||||||
if(jackPerTrackOutput) {
|
if(jackPerTrackOutput) {
|
||||||
gui->enablePerTrackOutput=jackPerTrackOutput->valueint;
|
gui->enablePerTrackOutput=jackPerTrackOutput->valueint;
|
||||||
if(gui->enablePerTrackOutput)
|
if(gui->enablePerTrackOutput)
|
||||||
LUPPP_NOTE("Enabling per track output ports");
|
LOOPP_NOTE("Enabling per track output ports");
|
||||||
}
|
}
|
||||||
|
|
||||||
//Metronome on by default?
|
//Metronome on by default?
|
||||||
|
@ -131,15 +131,15 @@ int DiskReader::loadPreferences()
|
||||||
delete[] sampleString;
|
delete[] sampleString;
|
||||||
} else {
|
} else {
|
||||||
// empty file / file no exists:
|
// empty file / file no exists:
|
||||||
LUPPP_WARN("Preferences, file doesn't exist: ~/.config/openAV/luppp/luppp.prefs");
|
LOOPP_WARN("Preferences, file doesn't exist: ~/.config/openAV/loopp/loopp.prefs");
|
||||||
|
|
||||||
// so write default file
|
// so write default file
|
||||||
gui->getDiskWriter()->writeDefaultConfigToUserHome();
|
gui->getDiskWriter()->writeDefaultConfigToUserHome();
|
||||||
|
|
||||||
return LUPPP_RETURN_OK;
|
return LOOPP_RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
return LUPPP_RETURN_OK;
|
return LOOPP_RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DiskReader::showAudioEditor(AudioBuffer* ab)
|
int DiskReader::showAudioEditor(AudioBuffer* ab)
|
||||||
|
@ -152,11 +152,11 @@ int DiskReader::showAudioEditor(AudioBuffer* ab)
|
||||||
|
|
||||||
// handle "cancel" return
|
// handle "cancel" return
|
||||||
if ( ab->getBeats() == -1 ) {
|
if ( ab->getBeats() == -1 ) {
|
||||||
return LUPPP_RETURN_ERROR;
|
return LOOPP_RETURN_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return LUPPP_RETURN_OK;
|
return LOOPP_RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -170,11 +170,11 @@ int DiskReader::loadSample( int track, int scene, string path )
|
||||||
float frameBuf[ chnls ];
|
float frameBuf[ chnls ];
|
||||||
|
|
||||||
if ( infile.error() ) {
|
if ( infile.error() ) {
|
||||||
LUPPP_ERROR("File %s, Error %s", path.c_str(), infile.strError() );
|
LOOPP_ERROR("File %s, Error %s", path.c_str(), infile.strError() );
|
||||||
return LUPPP_RETURN_ERROR;
|
return LOOPP_RETURN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
LUPPP_NOTE("Loading file with %i chnls, frames %i, bufferL size %i bufferR size %i", infile.channels(), infile.frames(), bufL.size(), bufR.size() );
|
LOOPP_NOTE("Loading file with %i chnls, frames %i, bufferL size %i bufferR size %i", infile.channels(), infile.frames(), bufL.size(), bufR.size() );
|
||||||
|
|
||||||
// Read data
|
// Read data
|
||||||
for(int f=0; f<infile.frames(); f++) {
|
for(int f=0; f<infile.frames(); f++) {
|
||||||
|
@ -196,7 +196,7 @@ int DiskReader::loadSample( int track, int scene, string path )
|
||||||
|
|
||||||
/// resample?
|
/// resample?
|
||||||
if ( infile.samplerate() != gui->samplerate ) {
|
if ( infile.samplerate() != gui->samplerate ) {
|
||||||
LUPPP_NOTE("%s%i%s%i", "Resampling from ", infile.samplerate(), " to ", gui->samplerate);
|
LOOPP_NOTE("%s%i%s%i", "Resampling from ", infile.samplerate(), " to ", gui->samplerate);
|
||||||
|
|
||||||
float resampleRatio = float(gui->samplerate) / infile.samplerate();
|
float resampleRatio = float(gui->samplerate) / infile.samplerate();
|
||||||
std::vector<float> resampledL( infile.frames() / chnls * resampleRatio );
|
std::vector<float> resampledL( infile.frames() / chnls * resampleRatio );
|
||||||
|
@ -237,14 +237,14 @@ int DiskReader::loadSample( int track, int scene, string path )
|
||||||
// resample quality taken from config file,
|
// resample quality taken from config file,
|
||||||
int ret = src_simple ( &dataL, q, 1 );
|
int ret = src_simple ( &dataL, q, 1 );
|
||||||
if ( ret == 0 )
|
if ( ret == 0 )
|
||||||
LUPPP_NOTE("%s%i%s%i", "Resampling L finished, from ", dataL.input_frames_used, " to ", dataL.output_frames_gen );
|
LOOPP_NOTE("%s%i%s%i", "Resampling L finished, from ", dataL.input_frames_used, " to ", dataL.output_frames_gen );
|
||||||
else
|
else
|
||||||
LUPPP_ERROR("%s%i%s%i", "Resampling L finished, from ", dataL.input_frames_used, " to ", dataL.output_frames_gen );
|
LOOPP_ERROR("%s%i%s%i", "Resampling L finished, from ", dataL.input_frames_used, " to ", dataL.output_frames_gen );
|
||||||
ret = src_simple ( &dataR, q, 1 );
|
ret = src_simple ( &dataR, q, 1 );
|
||||||
if ( ret == 0 )
|
if ( ret == 0 )
|
||||||
LUPPP_NOTE("%s%i%s%i", "Resampling R finished, from ", dataR.input_frames_used, " to ", dataR.output_frames_gen );
|
LOOPP_NOTE("%s%i%s%i", "Resampling R finished, from ", dataR.input_frames_used, " to ", dataR.output_frames_gen );
|
||||||
else
|
else
|
||||||
LUPPP_ERROR("%s%i%s%i", "Resampling R finished, from ", dataR.input_frames_used, " to ", dataR.output_frames_gen );
|
LOOPP_ERROR("%s%i%s%i", "Resampling R finished, from ", dataR.input_frames_used, " to ", dataR.output_frames_gen );
|
||||||
|
|
||||||
/// exchange buffers, so buf contains the resampled audio
|
/// exchange buffers, so buf contains the resampled audio
|
||||||
bufL.swap( resampledL );
|
bufL.swap( resampledL );
|
||||||
|
@ -291,8 +291,8 @@ int DiskReader::loadSample( int track, int scene, string path )
|
||||||
|
|
||||||
cJSON* audioJson = cJSON_Parse( sampleString.data() );
|
cJSON* audioJson = cJSON_Parse( sampleString.data() );
|
||||||
if (!audioJson) {
|
if (!audioJson) {
|
||||||
LUPPP_ERROR("%s %s","Error in Sample JSON before: ", cJSON_GetErrorPtr() );
|
LOOPP_ERROR("%s %s","Error in Sample JSON before: ", cJSON_GetErrorPtr() );
|
||||||
return LUPPP_RETURN_ERROR;
|
return LOOPP_RETURN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
cJSON* sample = cJSON_GetObjectItem( audioJson, baseName.c_str() );
|
cJSON* sample = cJSON_GetObjectItem( audioJson, baseName.c_str() );
|
||||||
|
@ -312,10 +312,10 @@ int DiskReader::loadSample( int track, int scene, string path )
|
||||||
|
|
||||||
// if we don't find the beats from audio.cfg, show dialog
|
// if we don't find the beats from audio.cfg, show dialog
|
||||||
if ( loadableBuffer == false ) {
|
if ( loadableBuffer == false ) {
|
||||||
LUPPP_NOTE("Warning: audio.cfg has no entry for beats.");
|
LOOPP_NOTE("Warning: audio.cfg has no entry for beats.");
|
||||||
int ret = showAudioEditor( ab );
|
int ret = showAudioEditor( ab );
|
||||||
|
|
||||||
if ( ret == LUPPP_RETURN_OK ) {
|
if ( ret == LOOPP_RETURN_OK ) {
|
||||||
// flag that we can load this sample OK
|
// flag that we can load this sample OK
|
||||||
loadableBuffer = true;
|
loadableBuffer = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -327,10 +327,10 @@ int DiskReader::loadSample( int track, int scene, string path )
|
||||||
} else {
|
} else {
|
||||||
// this means there's no audio.cfg file found for the sample: show the user
|
// this means there's no audio.cfg file found for the sample: show the user
|
||||||
// the file, and ask what the intended beat number is, and load the AudioBuffer
|
// the file, and ask what the intended beat number is, and load the AudioBuffer
|
||||||
LUPPP_WARN("%s %s","Empty or no audio.cfg found at ",base.str().c_str() );
|
LOOPP_WARN("%s %s","Empty or no audio.cfg found at ",base.str().c_str() );
|
||||||
int error = showAudioEditor( ab );
|
int error = showAudioEditor( ab );
|
||||||
if ( error == LUPPP_RETURN_ERROR ) {
|
if ( error == LOOPP_RETURN_ERROR ) {
|
||||||
LUPPP_WARN("cancel clicked, deleting audiobuffer" );
|
LOOPP_WARN("cancel clicked, deleting audiobuffer" );
|
||||||
delete ab;
|
delete ab;
|
||||||
} else {
|
} else {
|
||||||
std::string name = path;
|
std::string name = path;
|
||||||
|
@ -338,7 +338,7 @@ int DiskReader::loadSample( int track, int scene, string path )
|
||||||
std::string sub = name.substr( i );
|
std::string sub = name.substr( i );
|
||||||
ab->setName( sub.c_str() );
|
ab->setName( sub.c_str() );
|
||||||
|
|
||||||
LUPPP_NOTE("AudioBuffer %s set %i beats", ab->getName().c_str(), ab->getBeats() );
|
LOOPP_NOTE("AudioBuffer %s set %i beats", ab->getName().c_str(), ab->getBeats() );
|
||||||
|
|
||||||
loadableBuffer = true;
|
loadableBuffer = true;
|
||||||
}
|
}
|
||||||
|
@ -358,11 +358,11 @@ int DiskReader::loadSample( int track, int scene, string path )
|
||||||
lastLoadedSamplePath = dirname( tmp );
|
lastLoadedSamplePath = dirname( tmp );
|
||||||
free(tmp);
|
free(tmp);
|
||||||
} else {
|
} else {
|
||||||
LUPPP_NOTE("AudioBuffer not loaded, missing beats info and dialog was Canceled" );
|
LOOPP_NOTE("AudioBuffer not loaded, missing beats info and dialog was Canceled" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return LUPPP_RETURN_OK;
|
return LOOPP_RETURN_OK;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -377,7 +377,7 @@ int DiskReader::readSession( std::string path )
|
||||||
sessionPath = path;
|
sessionPath = path;
|
||||||
|
|
||||||
stringstream s;
|
stringstream s;
|
||||||
s << path << "/session.luppp";
|
s << path << "/session.loopp";
|
||||||
|
|
||||||
stringstream samplePath;
|
stringstream samplePath;
|
||||||
samplePath << path << "/audio/audio.cfg";
|
samplePath << path << "/audio/audio.cfg";
|
||||||
|
@ -390,8 +390,8 @@ int DiskReader::readSession( std::string path )
|
||||||
long file_length = file.tellg();
|
long file_length = file.tellg();
|
||||||
if ( file_length < 0 ) {
|
if ( file_length < 0 ) {
|
||||||
// empty file / file no exists:
|
// empty file / file no exists:
|
||||||
LUPPP_ERROR("no session file exists!");
|
LOOPP_ERROR("no session file exists!");
|
||||||
return LUPPP_RETURN_ERROR;
|
return LOOPP_RETURN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
file.seekg(0, std::ios_base::beg);
|
file.seekg(0, std::ios_base::beg);
|
||||||
|
@ -402,8 +402,8 @@ int DiskReader::readSession( std::string path )
|
||||||
// create cJSON nodes from strings
|
// create cJSON nodes from strings
|
||||||
sessionJson = cJSON_Parse( sessionString );
|
sessionJson = cJSON_Parse( sessionString );
|
||||||
if (!sessionJson) {
|
if (!sessionJson) {
|
||||||
LUPPP_ERROR("%s %s", "Error in Session JSON before: ", cJSON_GetErrorPtr() );
|
LOOPP_ERROR("%s %s", "Error in Session JSON before: ", cJSON_GetErrorPtr() );
|
||||||
return LUPPP_RETURN_ERROR;
|
return LOOPP_RETURN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -417,7 +417,7 @@ int DiskReader::readSession( std::string path )
|
||||||
cJSON_Delete( sessionJson );
|
cJSON_Delete( sessionJson );
|
||||||
delete[] sessionString;
|
delete[] sessionString;
|
||||||
|
|
||||||
return LUPPP_RETURN_OK;
|
return LOOPP_RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DiskReader::readMaster()
|
int DiskReader::readMaster()
|
||||||
|
@ -428,7 +428,7 @@ int DiskReader::readMaster()
|
||||||
{
|
{
|
||||||
cJSON* bpm = cJSON_GetObjectItem( master, "bpm");
|
cJSON* bpm = cJSON_GetObjectItem( master, "bpm");
|
||||||
if ( bpm ) {
|
if ( bpm ) {
|
||||||
LUPPP_NOTE("%s %i","Session: BPM ",bpm->valueint);
|
LOOPP_NOTE("%s %i","Session: BPM ",bpm->valueint);
|
||||||
EventTimeBPM e( bpm->valuedouble );
|
EventTimeBPM e( bpm->valuedouble );
|
||||||
writeToDspRingbuffer( &e );
|
writeToDspRingbuffer( &e );
|
||||||
}
|
}
|
||||||
|
@ -537,11 +537,11 @@ int DiskReader::readMaster()
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
LUPPP_ERROR("%s", "Error getting master from JSON" );
|
LOOPP_ERROR("%s", "Error getting master from JSON" );
|
||||||
return LUPPP_RETURN_ERROR;
|
return LOOPP_RETURN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
return LUPPP_RETURN_OK;
|
return LOOPP_RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -559,7 +559,7 @@ int DiskReader::readScenes(int t, cJSON* track)
|
||||||
stringstream sampleFilePath;
|
stringstream sampleFilePath;
|
||||||
sampleFilePath << sessionPath << "/audio/" << clip->valuestring;
|
sampleFilePath << sessionPath << "/audio/" << clip->valuestring;
|
||||||
#ifdef DEBUG_STATE
|
#ifdef DEBUG_STATE
|
||||||
LUPPP_NOTE << "clip t " << t << " s " << s << " path " << sampleFilePath.str() << endl;
|
LOOPP_NOTE << "clip t " << t << " s " << s << " path " << sampleFilePath.str() << endl;
|
||||||
#endif
|
#endif
|
||||||
// load it, checking for sample.cfg, and using metadata if there
|
// load it, checking for sample.cfg, and using metadata if there
|
||||||
loadSample( t, s, sampleFilePath.str() );
|
loadSample( t, s, sampleFilePath.str() );
|
||||||
|
@ -572,7 +572,7 @@ int DiskReader::readScenes(int t, cJSON* track)
|
||||||
} // nClips loop
|
} // nClips loop
|
||||||
}
|
}
|
||||||
|
|
||||||
return LUPPP_RETURN_OK;
|
return LOOPP_RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DiskReader::readTracks()
|
int DiskReader::readTracks()
|
||||||
|
@ -584,7 +584,7 @@ int DiskReader::readTracks()
|
||||||
cJSON* track = cJSON_GetArrayItem( tracks, t );
|
cJSON* track = cJSON_GetArrayItem( tracks, t );
|
||||||
|
|
||||||
if( !track ) {
|
if( !track ) {
|
||||||
LUPPP_WARN("Track %i has no name track saved.", t);
|
LOOPP_WARN("Track %i has no name track saved.", t);
|
||||||
} else {
|
} else {
|
||||||
readScenes( t, track );
|
readScenes( t, track );
|
||||||
|
|
||||||
|
@ -592,7 +592,7 @@ int DiskReader::readTracks()
|
||||||
{
|
{
|
||||||
cJSON* name = cJSON_GetObjectItem( track, "name");
|
cJSON* name = cJSON_GetObjectItem( track, "name");
|
||||||
if( !name ) {
|
if( !name ) {
|
||||||
LUPPP_WARN("Track %i has no name data saved.", t);
|
LOOPP_WARN("Track %i has no name data saved.", t);
|
||||||
} else {
|
} else {
|
||||||
gui->getTrack(t)->bg.copy_label( name->valuestring );
|
gui->getTrack(t)->bg.copy_label( name->valuestring );
|
||||||
}
|
}
|
||||||
|
@ -601,7 +601,7 @@ int DiskReader::readTracks()
|
||||||
{
|
{
|
||||||
cJSON* fader = cJSON_GetObjectItem( track, "fader");
|
cJSON* fader = cJSON_GetObjectItem( track, "fader");
|
||||||
if( !fader ) {
|
if( !fader ) {
|
||||||
LUPPP_WARN("Track %i has no fader data saved.", t);
|
LOOPP_WARN("Track %i has no fader data saved.", t);
|
||||||
} else {
|
} else {
|
||||||
EventTrackVol e( t, fader->valuedouble );
|
EventTrackVol e( t, fader->valuedouble );
|
||||||
writeToDspRingbuffer( &e );
|
writeToDspRingbuffer( &e );
|
||||||
|
@ -611,11 +611,11 @@ int DiskReader::readTracks()
|
||||||
{
|
{
|
||||||
cJSON* pan = cJSON_GetObjectItem( track, "pan");
|
cJSON* pan = cJSON_GetObjectItem( track, "pan");
|
||||||
if( !pan ) {
|
if( !pan ) {
|
||||||
LUPPP_WARN("Track %i has no pan data saved.", t);
|
LOOPP_WARN("Track %i has no pan data saved.", t);
|
||||||
} else {
|
} else {
|
||||||
EventTrackPan e( t, (pan->valuedouble*2)-1.f );
|
EventTrackPan e( t, (pan->valuedouble*2)-1.f );
|
||||||
writeToDspRingbuffer( &e );
|
writeToDspRingbuffer( &e );
|
||||||
LUPPP_WARN("Track %i has pan %f", pan->valuedouble);
|
LOOPP_WARN("Track %i has pan %f", pan->valuedouble);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// sends
|
// sends
|
||||||
|
@ -627,7 +627,7 @@ int DiskReader::readTracks()
|
||||||
cJSON* keyActive = cJSON_GetObjectItem( track, "keyActive");
|
cJSON* keyActive = cJSON_GetObjectItem( track, "keyActive");
|
||||||
|
|
||||||
if( !send || !sendActive || !xside || !keyActive ) {
|
if( !send || !sendActive || !xside || !keyActive ) {
|
||||||
LUPPP_WARN("Track %i has no send data saved.", t);
|
LOOPP_WARN("Track %i has no send data saved.", t);
|
||||||
} else {
|
} else {
|
||||||
EventTrackSendActive e1( t, SEND_POSTFADER, sendActive->valueint );
|
EventTrackSendActive e1( t, SEND_POSTFADER, sendActive->valueint );
|
||||||
EventTrackSendActive e2( t, SEND_KEY, keyActive ->valueint );
|
EventTrackSendActive e2( t, SEND_KEY, keyActive ->valueint );
|
||||||
|
@ -655,8 +655,8 @@ int DiskReader::readTracks()
|
||||||
}// if track
|
}// if track
|
||||||
} // nTracks loop
|
} // nTracks loop
|
||||||
} else {
|
} else {
|
||||||
LUPPP_ERROR("%s", "Error getting clip" );
|
LOOPP_ERROR("%s", "Error getting clip" );
|
||||||
return LUPPP_RETURN_ERROR;
|
return LOOPP_RETURN_ERROR;
|
||||||
}
|
}
|
||||||
return LUPPP_RETURN_OK;
|
return LOOPP_RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_DISK_READER_H
|
#ifndef LOOPP_DISK_READER_H
|
||||||
#define LUPPP_DISK_READER_H
|
#define LOOPP_DISK_READER_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -26,11 +26,11 @@
|
||||||
class AudioBuffer;
|
class AudioBuffer;
|
||||||
|
|
||||||
/** DiskReader
|
/** DiskReader
|
||||||
* This class reads a previously saved session from disk, restoring Luppp's
|
* This class reads a previously saved session from disk, restoring Loopp's
|
||||||
* internal state to that of when the save took place.
|
* internal state to that of when the save took place.
|
||||||
*
|
*
|
||||||
* The directory <sessionDir> is the main point of loading. The user selects
|
* The directory <sessionDir> is the main point of loading. The user selects
|
||||||
* that directory to load the session from. <sessionDir>.luppp is the name of
|
* that directory to load the session from. <sessionDir>.loopp is the name of
|
||||||
* the session file: it contains all info about the session: Volumes, loaded
|
* the session file: it contains all info about the session: Volumes, loaded
|
||||||
* samples etc.
|
* samples etc.
|
||||||
*
|
*
|
||||||
|
@ -42,7 +42,7 @@ class DiskReader
|
||||||
public:
|
public:
|
||||||
DiskReader();
|
DiskReader();
|
||||||
|
|
||||||
/// loads default settings for Luppp: controller instances etc
|
/// loads default settings for Loopp: controller instances etc
|
||||||
int loadPreferences();
|
int loadPreferences();
|
||||||
|
|
||||||
/// loads a sample into a new AudioBuffer, returning the buffer
|
/// loads a sample into a new AudioBuffer, returning the buffer
|
||||||
|
@ -75,4 +75,4 @@ private:
|
||||||
std::string lastLoadedSamplePath;
|
std::string lastLoadedSamplePath;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_DISK_READER_H
|
#endif // LOOPP_DISK_READER_H
|
||||||
|
|
|
@ -55,38 +55,38 @@ DiskWriter::DiskWriter()
|
||||||
sessionName = "session";
|
sessionName = "session";
|
||||||
foldersCreated = false;
|
foldersCreated = false;
|
||||||
|
|
||||||
// create .config/openAV/luppp/ directory
|
// create .config/openAV/loopp/ directory
|
||||||
stringstream dotConfig;
|
stringstream dotConfig;
|
||||||
dotConfig << getenv("HOME") << "/.config/openAV/";
|
dotConfig << getenv("HOME") << "/.config/openAV/";
|
||||||
int dotConfigDir = mkdir( dotConfig.str().c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH );
|
int dotConfigDir = mkdir( dotConfig.str().c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH );
|
||||||
if ( errno == EEXIST ) {
|
if ( errno == EEXIST ) {
|
||||||
//LUPPP_NOTE("dotConfigDir exists");
|
//LOOPP_NOTE("dotConfigDir exists");
|
||||||
} else if ( dotConfigDir ) {
|
} else if ( dotConfigDir ) {
|
||||||
LUPPP_WARN("Error creating dotConfigDir: %s", strerror(errno));
|
LOOPP_WARN("Error creating dotConfigDir: %s", strerror(errno));
|
||||||
} else {
|
} else {
|
||||||
LUPPP_NOTE("Creating .config/openAV/ directory");
|
LOOPP_NOTE("Creating .config/openAV/ directory");
|
||||||
}
|
}
|
||||||
|
|
||||||
stringstream dotConfigLuppp;
|
stringstream dotConfigLoopp;
|
||||||
dotConfigLuppp << getenv("HOME") << "/.config/openAV/luppp";
|
dotConfigLoopp << getenv("HOME") << "/.config/openAV/loopp";
|
||||||
int dotConfigLupppDir = mkdir( dotConfigLuppp.str().c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH );
|
int dotConfigLooppDir = mkdir( dotConfigLoopp.str().c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH );
|
||||||
if ( errno == EEXIST ) {
|
if ( errno == EEXIST ) {
|
||||||
//LUPPP_NOTE("dotConfigLupppDir exists");
|
//LOOPP_NOTE("dotConfigLooppDir exists");
|
||||||
} else if ( dotConfigLupppDir ) {
|
} else if ( dotConfigLooppDir ) {
|
||||||
LUPPP_WARN("Error creating dotConfigLupppDir: %s", strerror(errno));
|
LOOPP_WARN("Error creating dotConfigLooppDir: %s", strerror(errno));
|
||||||
} else {
|
} else {
|
||||||
LUPPP_NOTE("Creating .config/openAV/luppp directory");
|
LOOPP_NOTE("Creating .config/openAV/loopp directory");
|
||||||
}
|
}
|
||||||
|
|
||||||
stringstream dotConfigCtlr;
|
stringstream dotConfigCtlr;
|
||||||
dotConfigCtlr << getenv("HOME") << "/.config/openAV/luppp/controllers/";
|
dotConfigCtlr << getenv("HOME") << "/.config/openAV/loopp/controllers/";
|
||||||
int dotConfigCtlrDir = mkdir( dotConfigCtlr.str().c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH );
|
int dotConfigCtlrDir = mkdir( dotConfigCtlr.str().c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH );
|
||||||
if ( errno == EEXIST ) {
|
if ( errno == EEXIST ) {
|
||||||
//LUPPP_NOTE("dotConfigCtlrDir exists");
|
//LOOPP_NOTE("dotConfigCtlrDir exists");
|
||||||
} else if ( dotConfigCtlrDir ) {
|
} else if ( dotConfigCtlrDir ) {
|
||||||
LUPPP_WARN("Error creating dotConfigCtlrDir: %s", strerror(errno));
|
LOOPP_WARN("Error creating dotConfigCtlrDir: %s", strerror(errno));
|
||||||
} else {
|
} else {
|
||||||
LUPPP_NOTE("Creating .config/openAV/luppp directory");
|
LOOPP_NOTE("Creating .config/openAV/loopp directory");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,39 +106,39 @@ void DiskWriter::initialize(std::string path, std::string name )
|
||||||
int projectDir = mkdir( path.c_str(),
|
int projectDir = mkdir( path.c_str(),
|
||||||
S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH );
|
S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH );
|
||||||
if ( errno == EEXIST ) {
|
if ( errno == EEXIST ) {
|
||||||
//LUPPP_NOTE("project dir %s exists, this is good", path.c_str());
|
//LOOPP_NOTE("project dir %s exists, this is good", path.c_str());
|
||||||
} else if ( projectDir ) {
|
} else if ( projectDir ) {
|
||||||
LUPPP_WARN("Error creating projectDir: %s", strerror(errno));
|
LOOPP_WARN("Error creating projectDir: %s", strerror(errno));
|
||||||
} else {
|
} else {
|
||||||
LUPPP_NOTE("Creating %s directory", path.c_str());
|
LOOPP_NOTE("Creating %s directory", path.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// write session.luppp JSON node to <path>/<sessionName>.luppp
|
// write session.loopp JSON node to <path>/<sessionName>.loopp
|
||||||
stringstream sessionDirStream;
|
stringstream sessionDirStream;
|
||||||
|
|
||||||
sessionDirStream << path;
|
sessionDirStream << path;
|
||||||
|
|
||||||
if ( !gui->getNsm() )
|
if ( !gui->getNsm() )
|
||||||
sessionDirStream << "/" << sessionName << ".luppp";
|
sessionDirStream << "/" << sessionName << ".loopp";
|
||||||
|
|
||||||
sessionDir = sessionDirStream.str();
|
sessionDir = sessionDirStream.str();
|
||||||
|
|
||||||
LUPPP_NOTE( "Creating session dir %s", sessionDir.c_str() );
|
LOOPP_NOTE( "Creating session dir %s", sessionDir.c_str() );
|
||||||
|
|
||||||
int sessionDirError = mkdir( sessionDir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH );
|
int sessionDirError = mkdir( sessionDir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH );
|
||||||
if ( sessionDirError ) {
|
if ( sessionDirError ) {
|
||||||
// handle by using different filename?
|
// handle by using different filename?
|
||||||
LUPPP_WARN("Error creating session directory. Does the path: %s exist?",path.c_str());
|
LOOPP_WARN("Error creating session directory. Does the path: %s exist?",path.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
stringstream audioDirStream;
|
stringstream audioDirStream;
|
||||||
audioDirStream << sessionDir << "/audio";
|
audioDirStream << sessionDir << "/audio";
|
||||||
audioDir = audioDirStream.str();
|
audioDir = audioDirStream.str();
|
||||||
LUPPP_NOTE("Creating audio dir %s", audioDir.c_str() );
|
LOOPP_NOTE("Creating audio dir %s", audioDir.c_str() );
|
||||||
|
|
||||||
int audioDirError = mkdir( audioDir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH );
|
int audioDirError = mkdir( audioDir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH );
|
||||||
if ( audioDirError ) {
|
if ( audioDirError ) {
|
||||||
LUPPP_WARN("Error creating sample directory");
|
LOOPP_WARN("Error creating sample directory");
|
||||||
}
|
}
|
||||||
|
|
||||||
foldersCreated = true;
|
foldersCreated = true;
|
||||||
|
@ -162,17 +162,17 @@ void DiskWriter::writeControllerInfo( CONTROLLER_INFO c, std::string s )
|
||||||
int DiskWriter::writeControllerFile( Controller* c )
|
int DiskWriter::writeControllerFile( Controller* c )
|
||||||
{
|
{
|
||||||
if ( c ) {
|
if ( c ) {
|
||||||
LUPPP_NOTE("DiskWriter Controller* id: %i", c->getID() );
|
LOOPP_NOTE("DiskWriter Controller* id: %i", c->getID() );
|
||||||
} else {
|
} else {
|
||||||
LUPPP_ERROR("DiskWriter Controller* passed NULL" );
|
LOOPP_ERROR("DiskWriter Controller* passed NULL" );
|
||||||
return LUPPP_RETURN_ERROR;
|
return LOOPP_RETURN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if controller of ID is actually a GenericMIDI controller
|
// check if controller of ID is actually a GenericMIDI controller
|
||||||
GenericMIDI* g = dynamic_cast<GenericMIDI*>( c );
|
GenericMIDI* g = dynamic_cast<GenericMIDI*>( c );
|
||||||
|
|
||||||
if ( g ) {
|
if ( g ) {
|
||||||
LUPPP_NOTE("Creating JSON for .ctlr file...");
|
LOOPP_NOTE("Creating JSON for .ctlr file...");
|
||||||
|
|
||||||
cJSON* controllerJson = cJSON_CreateObject();
|
cJSON* controllerJson = cJSON_CreateObject();
|
||||||
|
|
||||||
|
@ -212,35 +212,35 @@ int DiskWriter::writeControllerFile( Controller* c )
|
||||||
if ( b.at(i)->active!= -1 )
|
if ( b.at(i)->active!= -1 )
|
||||||
cJSON_AddNumberToObject( binding, "active", b.at(i)->active );
|
cJSON_AddNumberToObject( binding, "active", b.at(i)->active );
|
||||||
|
|
||||||
LUPPP_NOTE("Creating Binding: action %i == %s!", b.at(i)->action, actionName );
|
LOOPP_NOTE("Creating Binding: action %i == %s!", b.at(i)->action, actionName );
|
||||||
} else {
|
} else {
|
||||||
LUPPP_WARN("Binding action %i has no prettyName!", b.at(i)->action );
|
LOOPP_WARN("Binding action %i has no prettyName!", b.at(i)->action );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// write the sample JSON node to <samplePath>/sample.cfg
|
// write the sample JSON node to <samplePath>/sample.cfg
|
||||||
stringstream controllerCfgPath;
|
stringstream controllerCfgPath;
|
||||||
controllerCfgPath << getenv("HOME") << "/.config/openAV/luppp/controllers/" << g->getName() << ".ctlr";
|
controllerCfgPath << getenv("HOME") << "/.config/openAV/loopp/controllers/" << g->getName() << ".ctlr";
|
||||||
|
|
||||||
ifstream infile( controllerCfgPath.str().c_str() );
|
ifstream infile( controllerCfgPath.str().c_str() );
|
||||||
if ( infile.good() ) {
|
if ( infile.good() ) {
|
||||||
// file exists: ask user overwrite or rename?
|
// file exists: ask user overwrite or rename?
|
||||||
//LUPPP_WARN("Controller filename exists: prompting user to overwrite y/n?");
|
//LOOPP_WARN("Controller filename exists: prompting user to overwrite y/n?");
|
||||||
int action = fl_choice("Controller exists, action?", "Cancel", "Rename", "Overwrite");
|
int action = fl_choice("Controller exists, action?", "Cancel", "Rename", "Overwrite");
|
||||||
if ( action == 0 ) {
|
if ( action == 0 ) {
|
||||||
// return OK, as user has chosen to cancel writing the file
|
// return OK, as user has chosen to cancel writing the file
|
||||||
return LUPPP_RETURN_OK;
|
return LOOPP_RETURN_OK;
|
||||||
} else if ( action == 1 ) {
|
} else if ( action == 1 ) {
|
||||||
// rename here
|
// rename here
|
||||||
const char* name = fl_input("New name for .ctlr file:");
|
const char* name = fl_input("New name for .ctlr file:");
|
||||||
if ( name ) {
|
if ( name ) {
|
||||||
// clear the filename
|
// clear the filename
|
||||||
controllerCfgPath.str( "" );
|
controllerCfgPath.str( "" );
|
||||||
controllerCfgPath << getenv("HOME") << "/.config/openAV/luppp/controllers/" << name << ".ctlr";
|
controllerCfgPath << getenv("HOME") << "/.config/openAV/loopp/controllers/" << name << ".ctlr";
|
||||||
LUPPP_NOTE( "New .ctlr filename %s", controllerCfgPath.str().c_str() );
|
LOOPP_NOTE( "New .ctlr filename %s", controllerCfgPath.str().c_str() );
|
||||||
} else {
|
} else {
|
||||||
LUPPP_NOTE("No name entered for .ctlr file, canceling!");
|
LOOPP_NOTE("No name entered for .ctlr file, canceling!");
|
||||||
return LUPPP_RETURN_ERROR;
|
return LOOPP_RETURN_ERROR;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// just overwrite the file, no action
|
// just overwrite the file, no action
|
||||||
|
@ -249,18 +249,18 @@ int DiskWriter::writeControllerFile( Controller* c )
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LUPPP_NOTE("Writing %s.ctlr file to disk", g->getName().c_str() );
|
LOOPP_NOTE("Writing %s.ctlr file to disk", g->getName().c_str() );
|
||||||
|
|
||||||
ofstream controllerCfgFile;
|
ofstream controllerCfgFile;
|
||||||
controllerCfgFile.open ( controllerCfgPath.str().c_str() );
|
controllerCfgFile.open ( controllerCfgPath.str().c_str() );
|
||||||
controllerCfgFile << cJSON_Print( controllerJson );
|
controllerCfgFile << cJSON_Print( controllerJson );
|
||||||
controllerCfgFile.close();
|
controllerCfgFile.close();
|
||||||
} else {
|
} else {
|
||||||
LUPPP_WARN("Invalid Controller pointer: cannot write %s as is not a GenericMIDI controller!", c->getName().c_str() );
|
LOOPP_WARN("Invalid Controller pointer: cannot write %s as is not a GenericMIDI controller!", c->getName().c_str() );
|
||||||
return LUPPP_RETURN_ERROR;
|
return LOOPP_RETURN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
return LUPPP_RETURN_OK;
|
return LOOPP_RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DiskWriter::writeAudioBuffer(int track, int scene, AudioBuffer* ab,
|
int DiskWriter::writeAudioBuffer(int track, int scene, AudioBuffer* ab,
|
||||||
|
@ -291,8 +291,8 @@ int DiskWriter::writeAudioBuffer(int track, int scene, AudioBuffer* ab,
|
||||||
|
|
||||||
path << audioDir << "/" << filename.str();
|
path << audioDir << "/" << filename.str();
|
||||||
} else {
|
} else {
|
||||||
LUPPP_WARN("%s", "Session folders not created yet, while trying to write audioBuffers.");
|
LOOPP_WARN("%s", "Session folders not created yet, while trying to write audioBuffers.");
|
||||||
return LUPPP_RETURN_ERROR;
|
return LOOPP_RETURN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -308,10 +308,10 @@ int DiskWriter::writeAudioBuffer(int track, int scene, AudioBuffer* ab,
|
||||||
outfile.writef( frameBuf, 1);
|
outfile.writef( frameBuf, 1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LUPPP_WARN("%s","Sample has zero samples");
|
LOOPP_WARN("%s","Sample has zero samples");
|
||||||
}
|
}
|
||||||
|
|
||||||
return LUPPP_RETURN_OK;
|
return LOOPP_RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiskWriter::writeMaster()
|
void DiskWriter::writeMaster()
|
||||||
|
@ -350,8 +350,8 @@ void DiskWriter::writeMaster()
|
||||||
int DiskWriter::writeSession()
|
int DiskWriter::writeSession()
|
||||||
{
|
{
|
||||||
if ( !foldersCreated ) {
|
if ( !foldersCreated ) {
|
||||||
LUPPP_WARN("%s", "Session folders not created yet, while trying to write session.");
|
LOOPP_WARN("%s", "Session folders not created yet, while trying to write session.");
|
||||||
return LUPPP_RETURN_ERROR;
|
return LOOPP_RETURN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// add session metadata
|
// add session metadata
|
||||||
|
@ -416,11 +416,11 @@ int DiskWriter::writeSession()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
stringstream sessionLuppp;
|
stringstream sessionLoopp;
|
||||||
sessionLuppp << sessionDir << "/session.luppp";
|
sessionLoopp << sessionDir << "/session.loopp";
|
||||||
//c out << "Session dir: " << sessionDir.str() << "\n" << "Sample dir : " << audioDir.str() << endl;
|
//c out << "Session dir: " << sessionDir.str() << "\n" << "Sample dir : " << audioDir.str() << endl;
|
||||||
ofstream sessionFile;
|
ofstream sessionFile;
|
||||||
sessionFile.open ( sessionLuppp.str().c_str() );
|
sessionFile.open ( sessionLoopp.str().c_str() );
|
||||||
sessionFile << cJSON_Print( sessionJson );
|
sessionFile << cJSON_Print( sessionJson );
|
||||||
sessionFile.close();
|
sessionFile.close();
|
||||||
|
|
||||||
|
@ -445,21 +445,21 @@ int DiskWriter::writeSession()
|
||||||
audioJson = cJSON_CreateObject();
|
audioJson = cJSON_CreateObject();
|
||||||
|
|
||||||
|
|
||||||
return LUPPP_RETURN_OK;
|
return LOOPP_RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DiskWriter::writeDefaultConfigToUserHome()
|
void DiskWriter::writeDefaultConfigToUserHome()
|
||||||
{
|
{
|
||||||
LUPPP_NOTE("Writing default preferences file.");
|
LOOPP_NOTE("Writing default preferences file.");
|
||||||
|
|
||||||
cJSON* prfs = cJSON_CreateObject();
|
cJSON* prfs = cJSON_CreateObject();
|
||||||
|
|
||||||
// "__COMMENT__" : "users home + <whatever it says here>"
|
// "__COMMENT__" : "users home + <whatever it says here>"
|
||||||
// "saveDirectory" : "luppp"
|
// "saveDirectory" : "loopp"
|
||||||
cJSON_AddItemToObject ( prfs, "__COMMENT__",
|
cJSON_AddItemToObject ( prfs, "__COMMENT__",
|
||||||
cJSON_CreateString("users home + <whatever it says here>") );
|
cJSON_CreateString("users home + <whatever it says here>") );
|
||||||
cJSON_AddItemToObject ( prfs, "saveDirectory", cJSON_CreateString( "luppp" ));
|
cJSON_AddItemToObject ( prfs, "saveDirectory", cJSON_CreateString( "loopp" ));
|
||||||
|
|
||||||
|
|
||||||
// "__COMMENT__" : "0 = LINEAR, 1 = SINC_FASTEST, 2 = SINC_BEST",
|
// "__COMMENT__" : "0 = LINEAR, 1 = SINC_FASTEST, 2 = SINC_BEST",
|
||||||
|
@ -478,9 +478,9 @@ void DiskWriter::writeDefaultConfigToUserHome()
|
||||||
// cout << endl << cJSON_Print( prfs ) << endl << endl;
|
// cout << endl << cJSON_Print( prfs ) << endl << endl;
|
||||||
|
|
||||||
|
|
||||||
// write JSON to .config/openAV/luppp/luppp.prfs
|
// write JSON to .config/openAV/loopp/loopp.prfs
|
||||||
stringstream f;
|
stringstream f;
|
||||||
f << getenv("HOME") << "/.config/openAV/luppp/luppp.prfs";
|
f << getenv("HOME") << "/.config/openAV/loopp/loopp.prfs";
|
||||||
|
|
||||||
ofstream outFile;
|
ofstream outFile;
|
||||||
outFile.open ( f.str().c_str() );
|
outFile.open ( f.str().c_str() );
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_DISK_WRITER_H
|
#ifndef LOOPP_DISK_WRITER_H
|
||||||
#define LUPPP_DISK_WRITER_H
|
#define LOOPP_DISK_WRITER_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -48,7 +48,7 @@ public:
|
||||||
/** DiskWriter
|
/** DiskWriter
|
||||||
* This class writes soundfiles to disk, and keeps track of which filename was
|
* This class writes soundfiles to disk, and keeps track of which filename was
|
||||||
* in which track/scene combo in the grid. This metadata is then written to the
|
* in which track/scene combo in the grid. This metadata is then written to the
|
||||||
* <sessionName>.luppp file.
|
* <sessionName>.loopp file.
|
||||||
**/
|
**/
|
||||||
class DiskWriter
|
class DiskWriter
|
||||||
{
|
{
|
||||||
|
@ -100,4 +100,4 @@ private:
|
||||||
std::string controllerInfo[CONTROLLER_INFO_SIZE];
|
std::string controllerInfo[CONTROLLER_INFO_SIZE];
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_DISK_WRITER_H
|
#endif // LOOPP_DISK_WRITER_H
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
luppp_src += files('dsp_sidechain_gain.cxx')
|
loopp_src += files('dsp_sidechain_gain.cxx')
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_EVENT_H
|
#ifndef LOOPP_EVENT_H
|
||||||
#define LUPPP_EVENT_H
|
#define LOOPP_EVENT_H
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
@ -1264,5 +1264,5 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // LUPPP_EVENT_H
|
#endif // LOOPP_EVENT_H
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_EVENT_HANDLER_H
|
#ifndef LOOPP_EVENT_HANDLER_H
|
||||||
#define LUPPP_EVENT_HANDLER_H
|
#define LOOPP_EVENT_HANDLER_H
|
||||||
|
|
||||||
#include "event.hxx"
|
#include "event.hxx"
|
||||||
#include <jack/ringbuffer.h>
|
#include <jack/ringbuffer.h>
|
||||||
|
@ -36,5 +36,5 @@ extern void handleGuiEvents();
|
||||||
extern void writeToDspRingbuffer(EventBase* e);
|
extern void writeToDspRingbuffer(EventBase* e);
|
||||||
extern void writeToGuiRingbuffer(EventBase* e);
|
extern void writeToGuiRingbuffer(EventBase* e);
|
||||||
|
|
||||||
#endif // LUPPP_EVENT_HANDLER_H
|
#endif // LOOPP_EVENT_HANDLER_H
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_EVENT_HANDLER_DSP_H
|
#ifndef LOOPP_EVENT_HANDLER_DSP_H
|
||||||
#define LUPPP_EVENT_HANDLER_DSP_H
|
#define LOOPP_EVENT_HANDLER_DSP_H
|
||||||
|
|
||||||
|
|
||||||
// Library
|
// Library
|
||||||
|
@ -244,7 +244,7 @@ void handleDspEvents()
|
||||||
if ( availableRead >= sizeof(EventMetronomeVolume) ) {
|
if ( availableRead >= sizeof(EventMetronomeVolume) ) {
|
||||||
EventMetronomeVolume ev(false);
|
EventMetronomeVolume ev(false);
|
||||||
jack_ringbuffer_read( rbToDsp, (char*)&ev, sizeof(EventMetronomeVolume) );
|
jack_ringbuffer_read( rbToDsp, (char*)&ev, sizeof(EventMetronomeVolume) );
|
||||||
LUPPP_NOTE("EventDSP: MetroVol %f", ev.vol );
|
LOOPP_NOTE("EventDSP: MetroVol %f", ev.vol );
|
||||||
jack->getMetronome()->setVolume(ev.vol);
|
jack->getMetronome()->setVolume(ev.vol);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -398,7 +398,7 @@ void handleDspEvents()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ========= LUPPP INTERNAL =====
|
// ========= LOOPP INTERNAL =====
|
||||||
case Event::LOOPER_REQUEST_BUFFER: {
|
case Event::LOOPER_REQUEST_BUFFER: {
|
||||||
if ( availableRead >= sizeof(EventLooperClipRequestBuffer) ) {
|
if ( availableRead >= sizeof(EventLooperClipRequestBuffer) ) {
|
||||||
EventLooperClipRequestBuffer ev;
|
EventLooperClipRequestBuffer ev;
|
||||||
|
@ -506,5 +506,5 @@ void writeToDspRingbuffer(EventBase* e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // LUPPP_EVENT_HANDLER_DSP_H
|
#endif // LOOPP_EVENT_HANDLER_DSP_H
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_EVENT_HANDLER_DSP_H
|
#ifndef LOOPP_EVENT_HANDLER_DSP_H
|
||||||
#define LUPPP_EVENT_HANDLER_DSP_H
|
#define LOOPP_EVENT_HANDLER_DSP_H
|
||||||
|
|
||||||
|
|
||||||
// Library
|
// Library
|
||||||
|
@ -57,7 +57,7 @@ void handleGuiEvents()
|
||||||
if ( availableRead >= sizeof(EventQuit) ) {
|
if ( availableRead >= sizeof(EventQuit) ) {
|
||||||
EventQuit ev;
|
EventQuit ev;
|
||||||
jack_ringbuffer_read( rbToGui, (char*)&ev, sizeof(EventQuit) );
|
jack_ringbuffer_read( rbToGui, (char*)&ev, sizeof(EventQuit) );
|
||||||
LUPPP_NOTE("%s","GUI QUIT");
|
LOOPP_NOTE("%s","GUI QUIT");
|
||||||
gui->quit();
|
gui->quit();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -68,7 +68,7 @@ void handleGuiEvents()
|
||||||
EventSamplerate ev;
|
EventSamplerate ev;
|
||||||
jack_ringbuffer_read( rbToGui, (char*)&ev, sizeof(EventSamplerate) );
|
jack_ringbuffer_read( rbToGui, (char*)&ev, sizeof(EventSamplerate) );
|
||||||
gui->samplerate = ev.samplerate;
|
gui->samplerate = ev.samplerate;
|
||||||
//LUPPP_NOTE("Gui Samplerate: %i", gui->samplerate);
|
//LOOPP_NOTE("Gui Samplerate: %i", gui->samplerate);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ void handleGuiEvents()
|
||||||
if ( availableRead >= sizeof(EventGridSelectNewChosen) ) {
|
if ( availableRead >= sizeof(EventGridSelectNewChosen) ) {
|
||||||
EventGridSelectNewChosen ev;
|
EventGridSelectNewChosen ev;
|
||||||
jack_ringbuffer_read( rbToGui, (char*)&ev, sizeof(EventGridSelectNewChosen) );
|
jack_ringbuffer_read( rbToGui, (char*)&ev, sizeof(EventGridSelectNewChosen) );
|
||||||
//LUPPP_NOTE("New special, %i, %i", ev.track, ev.scene);
|
//LOOPP_NOTE("New special, %i, %i", ev.track, ev.scene);
|
||||||
for(int i = 0; i < NTRACKS; i++) {
|
for(int i = 0; i < NTRACKS; i++) {
|
||||||
gui->getTrack(i)->getClipSelector()->setSpecial( i == ev.track ? ev.scene : -1 );
|
gui->getTrack(i)->getClipSelector()->setSpecial( i == ev.track ? ev.scene : -1 );
|
||||||
}
|
}
|
||||||
|
@ -365,7 +365,7 @@ void handleGuiEvents()
|
||||||
EventGuiPrint ev;
|
EventGuiPrint ev;
|
||||||
jack_ringbuffer_read( rbToGui, (char*)&ev, sizeof(EventGuiPrint) );
|
jack_ringbuffer_read( rbToGui, (char*)&ev, sizeof(EventGuiPrint) );
|
||||||
//cout << "DSP: " << ev.getMessage() << endl;
|
//cout << "DSP: " << ev.getMessage() << endl;
|
||||||
LUPPP_DSP("%s", ev.getMessage() );
|
LOOPP_DSP("%s", ev.getMessage() );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -414,7 +414,7 @@ void handleGuiEvents()
|
||||||
AudioBuffer* ab = new AudioBuffer(ev.bufferSize);
|
AudioBuffer* ab = new AudioBuffer(ev.bufferSize);
|
||||||
|
|
||||||
if ( ab ) {
|
if ( ab ) {
|
||||||
//LUPPP_NOTE("Save buffer sent with t %i, s %i, ab* %i", ev.track, ev.scene, ab );
|
//LOOPP_NOTE("Save buffer sent with t %i, s %i, ab* %i", ev.track, ev.scene, ab );
|
||||||
EventRequestSaveBuffer returnEvent( ev.track, ev.scene, ab);
|
EventRequestSaveBuffer returnEvent( ev.track, ev.scene, ab);
|
||||||
writeToDspRingbuffer( &returnEvent );
|
writeToDspRingbuffer( &returnEvent );
|
||||||
} else {
|
} else {
|
||||||
|
@ -441,7 +441,7 @@ void handleGuiEvents()
|
||||||
if ( c )
|
if ( c )
|
||||||
c->setBindEnable( ev.enable );
|
c->setBindEnable( ev.enable );
|
||||||
else
|
else
|
||||||
LUPPP_WARN("ControllerUI %i doesn't exist in the UI", ev.controllerID );
|
LOOPP_WARN("ControllerUI %i doesn't exist in the UI", ev.controllerID );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -463,7 +463,7 @@ void handleGuiEvents()
|
||||||
if ( c )
|
if ( c )
|
||||||
c->addBinding( (Binding*)ev.binding );
|
c->addBinding( (Binding*)ev.binding );
|
||||||
else
|
else
|
||||||
LUPPP_WARN("ControllerUI %i doesn't exist in the UI", ev.controllerID );
|
LOOPP_WARN("ControllerUI %i doesn't exist in the UI", ev.controllerID );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -484,7 +484,7 @@ void handleGuiEvents()
|
||||||
jack_ringbuffer_read( rbToGui, (char*)&ev, sizeof(EventControllerInstance) );
|
jack_ringbuffer_read( rbToGui, (char*)&ev, sizeof(EventControllerInstance) );
|
||||||
// remove this controller from use:
|
// remove this controller from use:
|
||||||
Controller* c = (Controller*)ev.controller;
|
Controller* c = (Controller*)ev.controller;
|
||||||
LUPPP_NOTE("Deleting controller %s", c->getName().c_str() );
|
LOOPP_NOTE("Deleting controller %s", c->getName().c_str() );
|
||||||
// delete will call the destructor for the Controller: this should
|
// delete will call the destructor for the Controller: this should
|
||||||
// clean up ports etc, all from the GUI thread as appropriate
|
// clean up ports etc, all from the GUI thread as appropriate
|
||||||
delete c;
|
delete c;
|
||||||
|
@ -519,5 +519,5 @@ void writeToGuiRingbuffer(EventBase* e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // LUPPP_EVENT_HANDLER_DSP_H
|
#endif // LOOPP_EVENT_HANDLER_DSP_H
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ void AudioEditor::show( AudioBuffer* buf, bool modal )
|
||||||
ab = buf;
|
ab = buf;
|
||||||
|
|
||||||
if ( !ab ) {
|
if ( !ab ) {
|
||||||
LUPPP_WARN("called with ab == 0");
|
LOOPP_WARN("called with ab == 0");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef LUPPP_AUDIO_EDITOR_H
|
#ifndef LOOPP_AUDIO_EDITOR_H
|
||||||
#define LUPPP_AUDIO_EDITOR_H
|
#define LOOPP_AUDIO_EDITOR_H
|
||||||
|
|
||||||
#include <FL/Fl.H>
|
#include <FL/Fl.H>
|
||||||
#include <FL/Fl_Double_Window.H>
|
#include <FL/Fl_Double_Window.H>
|
||||||
|
@ -59,5 +59,5 @@ private:
|
||||||
AudioBuffer* ab;
|
AudioBuffer* ab;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_AUDIO_EDITOR_H
|
#endif // LOOPP_AUDIO_EDITOR_H
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ static void gmastertrack_tempoDial_callback(Fl_Widget *w, void *data)
|
||||||
Avtk::Dial* b = (Avtk::Dial*)w;
|
Avtk::Dial* b = (Avtk::Dial*)w;
|
||||||
float bpm = (b->value() * (float)(MAX_TEMPO - MIN_TEMPO) + MIN_TEMPO);
|
float bpm = (b->value() * (float)(MAX_TEMPO - MIN_TEMPO) + MIN_TEMPO);
|
||||||
if(std::fabs(bpm-round(bpm))) {
|
if(std::fabs(bpm-round(bpm))) {
|
||||||
LUPPP_WARN("%f",bpm);
|
LOOPP_WARN("%f",bpm);
|
||||||
}
|
}
|
||||||
EventTimeBPM e = EventTimeBPM( bpm );
|
EventTimeBPM e = EventTimeBPM( bpm );
|
||||||
writeToDspRingbuffer( &e );
|
writeToDspRingbuffer( &e );
|
||||||
|
@ -156,7 +156,7 @@ static void gmastertrack_button_callback(Fl_Widget *w, void *data)
|
||||||
} else
|
} else
|
||||||
v = 0.25;
|
v = 0.25;
|
||||||
|
|
||||||
LUPPP_NOTE("metro vol = %f", v );
|
LOOPP_NOTE("metro vol = %f", v );
|
||||||
|
|
||||||
EventMetronomeVolume e( v );
|
EventMetronomeVolume e( v );
|
||||||
writeToDspRingbuffer( &e );
|
writeToDspRingbuffer( &e );
|
||||||
|
@ -184,7 +184,7 @@ static void gmastertrack_button_callback(Fl_Widget *w, void *data)
|
||||||
writeToDspRingbuffer( &e );
|
writeToDspRingbuffer( &e );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LUPPP_WARN("Error: unknown command string");
|
LOOPP_WARN("Error: unknown command string");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,19 +333,19 @@ void GMasterTrack::setBpm( float b )
|
||||||
|
|
||||||
void GMasterTrack::setInputVol(float f)
|
void GMasterTrack::setInputVol(float f)
|
||||||
{
|
{
|
||||||
//LUPPP_NOTE(" gmtrck, inputVol %f", f );
|
//LOOPP_NOTE(" gmtrck, inputVol %f", f );
|
||||||
inputVolume.value( f );
|
inputVolume.value( f );
|
||||||
}
|
}
|
||||||
|
|
||||||
void GMasterTrack::setReturnVol(float f)
|
void GMasterTrack::setReturnVol(float f)
|
||||||
{
|
{
|
||||||
LUPPP_NOTE(" gmtrck, returnVol %f", f );
|
LOOPP_NOTE(" gmtrck, returnVol %f", f );
|
||||||
returnVol.value( f );
|
returnVol.value( f );
|
||||||
}
|
}
|
||||||
|
|
||||||
void GMasterTrack::setInputTo(int to, float f)
|
void GMasterTrack::setInputTo(int to, float f)
|
||||||
{
|
{
|
||||||
//LUPPP_NOTE(" gmtrck, inputTO %i, %f", to, f );
|
//LOOPP_NOTE(" gmtrck, inputTO %i, %f", to, f );
|
||||||
if ( to == Event::INPUT_TO_MIX )
|
if ( to == Event::INPUT_TO_MIX )
|
||||||
inputToMixVol.value( f );
|
inputToMixVol.value( f );
|
||||||
else if ( to == Event::INPUT_TO_SEND )
|
else if ( to == Event::INPUT_TO_SEND )
|
||||||
|
@ -356,7 +356,7 @@ void GMasterTrack::setInputTo(int to, float f)
|
||||||
|
|
||||||
void GMasterTrack::setInputToActive(int to, bool f)
|
void GMasterTrack::setInputToActive(int to, bool f)
|
||||||
{
|
{
|
||||||
//LUPPP_NOTE(" gmtrck, inputToActive %i, %i", to, int(f) );
|
//LOOPP_NOTE(" gmtrck, inputToActive %i, %i", to, int(f) );
|
||||||
|
|
||||||
if ( to == Event::INPUT_TO_MIX )
|
if ( to == Event::INPUT_TO_MIX )
|
||||||
inputToMix.value( f );
|
inputToMix.value( f );
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_G_MASTER_TRACK_H
|
#ifndef LOOPP_G_MASTER_TRACK_H
|
||||||
#define LUPPP_G_MASTER_TRACK_H
|
#define LOOPP_G_MASTER_TRACK_H
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -122,5 +122,5 @@ private:
|
||||||
static int privateID;
|
static int privateID;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_G_MASTER_TRACK_H
|
#endif // LOOPP_G_MASTER_TRACK_H
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ static void addControllerUiDsp(OptionsWindow* self, GenericMIDI* c)
|
||||||
// store the pointer to the options window: needed to make remove button work
|
// store the pointer to the options window: needed to make remove button work
|
||||||
self->controllers.back()->optionsWindow = self;
|
self->controllers.back()->optionsWindow = self;
|
||||||
|
|
||||||
LUPPP_NOTE("Added controller %s, ID %i", c->getName().c_str(), c->getID() );
|
LOOPP_NOTE("Added controller %s, ID %i", c->getName().c_str(), c->getID() );
|
||||||
|
|
||||||
// add widget before "add" button
|
// add widget before "add" button
|
||||||
self->tabs->insert( *self->controllers.back()->widget, self->addGroup );
|
self->tabs->insert( *self->controllers.back()->widget, self->addGroup );
|
||||||
|
@ -89,7 +89,7 @@ static void updateLinkCB(Fl_Widget* w, void* data)
|
||||||
static void writeBindEnable(Fl_Widget* w, void* data)
|
static void writeBindEnable(Fl_Widget* w, void* data)
|
||||||
{
|
{
|
||||||
OptionsWindow* o = (OptionsWindow*) data;
|
OptionsWindow* o = (OptionsWindow*) data;
|
||||||
//LUPPP_NOTE("MIDI bind mode");
|
//LOOPP_NOTE("MIDI bind mode");
|
||||||
|
|
||||||
Avtk::LightButton* l = (Avtk::LightButton*)w;
|
Avtk::LightButton* l = (Avtk::LightButton*)w;
|
||||||
l->value( !l->value() );
|
l->value( !l->value() );
|
||||||
|
@ -110,7 +110,7 @@ static void removeControllerCB(Fl_Widget* w, void* data)
|
||||||
|
|
||||||
// FIXME: confirm action here?
|
// FIXME: confirm action here?
|
||||||
|
|
||||||
//LUPPP_NOTE("Removing controllerID %i", self->controllerID );
|
//LOOPP_NOTE("Removing controllerID %i", self->controllerID );
|
||||||
EventControllerInstanceRemove e( self->controllerID );
|
EventControllerInstanceRemove e( self->controllerID );
|
||||||
writeToDspRingbuffer( &e );
|
writeToDspRingbuffer( &e );
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ static void removeControllerCB(Fl_Widget* w, void* data)
|
||||||
static void addNewController(Fl_Widget* w, void* ud)
|
static void addNewController(Fl_Widget* w, void* ud)
|
||||||
{
|
{
|
||||||
OptionsWindow* self = (OptionsWindow*)ud;
|
OptionsWindow* self = (OptionsWindow*)ud;
|
||||||
LUPPP_NOTE("%s","ADD Controller cb");
|
LOOPP_NOTE("%s","ADD Controller cb");
|
||||||
|
|
||||||
GenericMIDI* c = 0;
|
GenericMIDI* c = 0;
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ static void addNewController(Fl_Widget* w, void* ud)
|
||||||
if ( c->status() == Controller::CONTROLLER_OK ) {
|
if ( c->status() == Controller::CONTROLLER_OK ) {
|
||||||
addControllerUiDsp( self, c );
|
addControllerUiDsp( self, c );
|
||||||
} else {
|
} else {
|
||||||
LUPPP_ERROR("Controller initialization failed!");
|
LOOPP_ERROR("Controller initialization failed!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ static void selectLoadController(Fl_Widget* w, void* data)
|
||||||
fnfc.filter("Controllers\t*.ctlr");
|
fnfc.filter("Controllers\t*.ctlr");
|
||||||
|
|
||||||
stringstream s;
|
stringstream s;
|
||||||
s << getenv("HOME") << "/.config/openAV/luppp/controllers/";
|
s << getenv("HOME") << "/.config/openAV/loopp/controllers/";
|
||||||
fnfc.directory( s.str().c_str() ); // default directory to use
|
fnfc.directory( s.str().c_str() ); // default directory to use
|
||||||
// Show native chooser
|
// Show native chooser
|
||||||
switch ( fnfc.show() ) {
|
switch ( fnfc.show() ) {
|
||||||
|
@ -170,13 +170,13 @@ static void selectLoadController(Fl_Widget* w, void* data)
|
||||||
if ( strcmp( path.c_str(), "" ) == 0 )
|
if ( strcmp( path.c_str(), "" ) == 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//LUPPP_NOTE("%s","ADD Controller cb");
|
//LOOPP_NOTE("%s","ADD Controller cb");
|
||||||
GenericMIDI* c = new GenericMIDI( path );
|
GenericMIDI* c = new GenericMIDI( path );
|
||||||
|
|
||||||
if ( c->status() == Controller::CONTROLLER_OK ) {
|
if ( c->status() == Controller::CONTROLLER_OK ) {
|
||||||
addControllerUiDsp( self, c );
|
addControllerUiDsp( self, c );
|
||||||
} else {
|
} else {
|
||||||
LUPPP_ERROR("Controller initialization failed!");
|
LOOPP_ERROR("Controller initialization failed!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ static void writeControllerFile(Fl_Widget* w, void* data)
|
||||||
{
|
{
|
||||||
ControllerUI* c = (ControllerUI*)data;
|
ControllerUI* c = (ControllerUI*)data;
|
||||||
|
|
||||||
LUPPP_NOTE("Writing controller %li, %s ID %i .ctlr to disk", c, c->name.c_str(), c->controllerID );
|
LOOPP_NOTE("Writing controller %li, %s ID %i .ctlr to disk", c, c->name.c_str(), c->controllerID );
|
||||||
|
|
||||||
// Set the Controller details in diskWriter, so it write it pretty
|
// Set the Controller details in diskWriter, so it write it pretty
|
||||||
gui->getDiskWriter()->writeControllerInfo( CONTROLLER_NAME , c->name );
|
gui->getDiskWriter()->writeControllerInfo( CONTROLLER_NAME , c->name );
|
||||||
|
@ -205,7 +205,7 @@ static void deleteBindingFromController(Fl_Widget* w, void* ud)
|
||||||
s << w->label();
|
s << w->label();
|
||||||
int tmp;
|
int tmp;
|
||||||
s >> tmp;
|
s >> tmp;
|
||||||
LUPPP_NOTE("CtlrID %i: Deleting binding with ID %i", self->controllerID, tmp );
|
LOOPP_NOTE("CtlrID %i: Deleting binding with ID %i", self->controllerID, tmp );
|
||||||
|
|
||||||
EventControllerBindingRemove e( self->controllerID, tmp );
|
EventControllerBindingRemove e( self->controllerID, tmp );
|
||||||
writeToDspRingbuffer( &e );
|
writeToDspRingbuffer( &e );
|
||||||
|
@ -261,7 +261,7 @@ ControllerUI::ControllerUI(int x, int y, int w, int h, std::string n, int ID)
|
||||||
|
|
||||||
// save the controller ID this ControllerUI represents
|
// save the controller ID this ControllerUI represents
|
||||||
controllerID = ID;
|
controllerID = ID;
|
||||||
LUPPP_NOTE("Controller %li ID on create %i", this, controllerID );
|
LOOPP_NOTE("Controller %li ID on create %i", this, controllerID );
|
||||||
|
|
||||||
//ctlrButton->callback( selectLoadController );
|
//ctlrButton->callback( selectLoadController );
|
||||||
bindEnable->callback( writeBindEnable, this );
|
bindEnable->callback( writeBindEnable, this );
|
||||||
|
@ -309,12 +309,12 @@ void ControllerUI::addBinding( Binding* b )
|
||||||
const char* tmp = Event::getPrettyName( b->action );
|
const char* tmp = Event::getPrettyName( b->action );
|
||||||
if ( !tmp ) {
|
if ( !tmp ) {
|
||||||
#ifdef DEBUG_MIDI
|
#ifdef DEBUG_MIDI
|
||||||
LUPPP_NOTE("new binding, action string returned NULL, action number %i ", b->action );
|
LOOPP_NOTE("new binding, action string returned NULL, action number %i ", b->action );
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LUPPP_WARN("new binding, action: == EVENT_NULL" );
|
LOOPP_WARN("new binding, action: == EVENT_NULL" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -382,7 +382,7 @@ void ControllerUI::addBinding( Binding* b )
|
||||||
bindingsPack->redraw();
|
bindingsPack->redraw();
|
||||||
scroll->redraw();
|
scroll->redraw();
|
||||||
|
|
||||||
//LUPPP_NOTE("binding size %i %i", bindingsPack->w(), bindingsPack->h() );
|
//LOOPP_NOTE("binding size %i %i", bindingsPack->w(), bindingsPack->h() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ControllerUI::addBindings( GenericMIDI* c )
|
void ControllerUI::addBindings( GenericMIDI* c )
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_OPTIONS_H
|
#ifndef LOOPP_OPTIONS_H
|
||||||
#define LUPPP_OPTIONS_H
|
#define LOOPP_OPTIONS_H
|
||||||
|
|
||||||
#include "config.hxx"
|
#include "config.hxx"
|
||||||
|
|
||||||
|
@ -123,4 +123,4 @@ private:
|
||||||
Avtk::Button* loadButton;
|
Avtk::Button* loadButton;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_OPTIONS_H
|
#endif // LOOPP_OPTIONS_H
|
||||||
|
|
|
@ -203,7 +203,7 @@ void GridLogic::pressed( int track, int scene )
|
||||||
for(int i = 0; i < NSCENES; i++) {
|
for(int i = 0; i < NSCENES; i++) {
|
||||||
// exclude current scene
|
// exclude current scene
|
||||||
if ( i != scene ) {
|
if ( i != scene ) {
|
||||||
//LUPPP_NOTE("netralizing & qStop on scene %i due to press on %i", i, scene );
|
//LOOPP_NOTE("netralizing & qStop on scene %i due to press on %i", i, scene );
|
||||||
LooperClip* ilc = jack->getLooper( track )->getClip( i );
|
LooperClip* ilc = jack->getLooper( track )->getClip( i );
|
||||||
|
|
||||||
ilc->resetQueues();
|
ilc->resetQueues();
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_GRID_LOGIC_H
|
#ifndef LOOPP_GRID_LOGIC_H
|
||||||
#define LUPPP_GRID_LOGIC_H
|
#define LOOPP_GRID_LOGIC_H
|
||||||
|
|
||||||
#include "config.hxx"
|
#include "config.hxx"
|
||||||
#include "observer/time.hxx"
|
#include "observer/time.hxx"
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
class AudioBuffer;
|
class AudioBuffer;
|
||||||
|
|
||||||
/** GridLogic
|
/** GridLogic
|
||||||
* The logic code for the luppp tracks / grid resides here. This logic is
|
* The logic code for the loopp tracks / grid resides here. This logic is
|
||||||
* separtated from the Looper class so it can be repurposed by different
|
* separtated from the Looper class so it can be repurposed by different
|
||||||
* controllers and input devices. The UI and eg. APC / Launchpad all have a
|
* controllers and input devices. The UI and eg. APC / Launchpad all have a
|
||||||
* similar grid style interface: the logic is implemented here once.
|
* similar grid style interface: the logic is implemented here once.
|
||||||
|
@ -115,4 +115,4 @@ private:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // LUPPP_GRID_LOGIC_H
|
#endif // LOOPP_GRID_LOGIC_H
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_G_TRACK_H
|
#ifndef LOOPP_G_TRACK_H
|
||||||
#define LUPPP_G_TRACK_H
|
#define LOOPP_G_TRACK_H
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
@ -118,5 +118,5 @@ private:
|
||||||
static int privateID;
|
static int privateID;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_G_TRACK_H
|
#endif // LOOPP_G_TRACK_H
|
||||||
|
|
||||||
|
|
66
src/gui.cxx
66
src/gui.cxx
|
@ -47,9 +47,9 @@ extern Jack* jack;
|
||||||
#include <FL/Fl_Multiline_Output.H>
|
#include <FL/Fl_Multiline_Output.H>
|
||||||
|
|
||||||
// include the header.c file in the planning dir:
|
// include the header.c file in the planning dir:
|
||||||
// its the GIMP .c export of the LUPPP header image
|
// its the GIMP .c export of the LOOPP header image
|
||||||
#include "../planning/header.c"
|
#include "../planning/header.c"
|
||||||
#include "../planning/luppp.c"
|
#include "../planning/loopp.c"
|
||||||
#include "../planning/bg.c"
|
#include "../planning/bg.c"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
@ -60,7 +60,7 @@ extern int signalHanlderInt;
|
||||||
static void signalChecker(void*)
|
static void signalChecker(void*)
|
||||||
{
|
{
|
||||||
if ( signalHanlderInt ) {
|
if ( signalHanlderInt ) {
|
||||||
// Luppp recieved either a SIGTERM or SIGINT: quit gracefully
|
// Loopp recieved either a SIGTERM or SIGINT: quit gracefully
|
||||||
gui->quit();
|
gui->quit();
|
||||||
} else {
|
} else {
|
||||||
Fl::repeat_timeout( 0.1, (Fl_Timeout_Handler)&signalChecker, 0 );
|
Fl::repeat_timeout( 0.1, (Fl_Timeout_Handler)&signalChecker, 0 );
|
||||||
|
@ -91,7 +91,7 @@ static void gui_static_nsm_cb(void* inst)
|
||||||
|
|
||||||
void option_controller_cb(Fl_Widget*,void* data)
|
void option_controller_cb(Fl_Widget*,void* data)
|
||||||
{
|
{
|
||||||
LUPPP_NOTE("%s","Controller cb");
|
LOOPP_NOTE("%s","Controller cb");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gui_header_callback(Fl_Widget *w, void *data)
|
static void gui_header_callback(Fl_Widget *w, void *data)
|
||||||
|
@ -166,22 +166,22 @@ static void gui_header_callback(Fl_Widget *w, void *data)
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
LUPPP_NOTE( "Loading session from dir %s", tmp.c_str() );
|
LOOPP_NOTE( "Loading session from dir %s", tmp.c_str() );
|
||||||
|
|
||||||
// clear the current session: just do a state reset
|
// clear the current session: just do a state reset
|
||||||
EventStateReset e;
|
EventStateReset e;
|
||||||
writeToDspRingbuffer( &e );
|
writeToDspRingbuffer( &e );
|
||||||
|
|
||||||
int sess = gui->getDiskReader()->readSession( tmp );
|
int sess = gui->getDiskReader()->readSession( tmp );
|
||||||
if ( sess != LUPPP_RETURN_OK )
|
if ( sess != LOOPP_RETURN_OK )
|
||||||
LUPPP_ERROR( "Error loading session" );
|
LOOPP_ERROR( "Error loading session" );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else if ( strcmp(m->label(), "Save Session ") == 0 ) {
|
} else if ( strcmp(m->label(), "Save Session ") == 0 ) {
|
||||||
const char* name = fl_input( "Save session as", gui->getDiskWriter()->getLastSaveName().c_str() );
|
const char* name = fl_input( "Save session as", gui->getDiskWriter()->getLastSaveName().c_str() );
|
||||||
if ( name ) {
|
if ( name ) {
|
||||||
gui->getDiskWriter()->initialize( gui->getProjectsDir().c_str(), name );
|
gui->getDiskWriter()->initialize( gui->getProjectsDir().c_str(), name );
|
||||||
LUPPP_NOTE("%s %s","Saving session as ", name );
|
LOOPP_NOTE("%s %s","Saving session as ", name );
|
||||||
EventSessionSave e;
|
EventSessionSave e;
|
||||||
writeToDspRingbuffer( &e );
|
writeToDspRingbuffer( &e );
|
||||||
}
|
}
|
||||||
|
@ -223,26 +223,26 @@ void Gui::selectLoadController(Fl_Widget* w, void*)
|
||||||
if ( strcmp( path.c_str(), "" ) == 0 )
|
if ( strcmp( path.c_str(), "" ) == 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LUPPP_NOTE("%s","ADD Controller cb");
|
LOOPP_NOTE("%s","ADD Controller cb");
|
||||||
Controller* c = new GenericMIDI( path );
|
Controller* c = new GenericMIDI( path );
|
||||||
|
|
||||||
if ( c->status() == Controller::CONTROLLER_OK ) {
|
if ( c->status() == Controller::CONTROLLER_OK ) {
|
||||||
EventControllerInstance e(c);
|
EventControllerInstance e(c);
|
||||||
writeToDspRingbuffer( &e );
|
writeToDspRingbuffer( &e );
|
||||||
} else {
|
} else {
|
||||||
LUPPP_ERROR("Controller initialization failed!");
|
LOOPP_ERROR("Controller initialization failed!");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gui::setProjectsDir(string dir)
|
void Gui::setProjectsDir(string dir)
|
||||||
{
|
{
|
||||||
lupppProjectsDir=dir;
|
looppProjectsDir=dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
string Gui::getProjectsDir()
|
string Gui::getProjectsDir()
|
||||||
{
|
{
|
||||||
return lupppProjectsDir;
|
return looppProjectsDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gui::selectSaveSample( int track, int scene )
|
void Gui::selectSaveSample( int track, int scene )
|
||||||
|
@ -322,7 +322,7 @@ static int cb_nsm_open (const char *name,
|
||||||
char **out_msg,
|
char **out_msg,
|
||||||
void *userdata )
|
void *userdata )
|
||||||
{
|
{
|
||||||
LUPPP_NOTE("NSM: Open, displayname: %s", display_name );
|
LOOPP_NOTE("NSM: Open, displayname: %s", display_name );
|
||||||
|
|
||||||
Jack::setup( client_id );
|
Jack::setup( client_id );
|
||||||
|
|
||||||
|
@ -344,7 +344,7 @@ static int cb_nsm_open (const char *name,
|
||||||
|
|
||||||
static int cb_nsm_save ( char **out_msg, void *userdata )
|
static int cb_nsm_save ( char **out_msg, void *userdata )
|
||||||
{
|
{
|
||||||
LUPPP_NOTE("NSM: saving..." );
|
LOOPP_NOTE("NSM: saving..." );
|
||||||
|
|
||||||
// disk-writer already initialized to the right directory, so just write!
|
// disk-writer already initialized to the right directory, so just write!
|
||||||
EventSessionSave e;
|
EventSessionSave e;
|
||||||
|
@ -367,16 +367,16 @@ Gui::Gui(const char* argZero) :
|
||||||
// setup window icon before calling show()
|
// setup window icon before calling show()
|
||||||
fl_open_display();
|
fl_open_display();
|
||||||
Fl_Pixmap* pixmap = new Fl_Pixmap( icon_xpm );
|
Fl_Pixmap* pixmap = new Fl_Pixmap( icon_xpm );
|
||||||
Fl_Offscreen lupppIcon = XCreatePixmap(fl_display, RootWindow(fl_display, fl_screen),
|
Fl_Offscreen looppIcon = XCreatePixmap(fl_display, RootWindow(fl_display, fl_screen),
|
||||||
pixmap->w(), pixmap->h(), fl_visual->depth);
|
pixmap->w(), pixmap->h(), fl_visual->depth);
|
||||||
fl_gc = XCreateGC(fl_display, lupppIcon, 0, 0);
|
fl_gc = XCreateGC(fl_display, looppIcon, 0, 0);
|
||||||
fl_begin_offscreen(lupppIcon);
|
fl_begin_offscreen(looppIcon);
|
||||||
pixmap->draw(0,0);
|
pixmap->draw(0,0);
|
||||||
fl_end_offscreen();
|
fl_end_offscreen();
|
||||||
delete pixmap;
|
delete pixmap;
|
||||||
XFreeGC(fl_display, fl_gc);
|
XFreeGC(fl_display, fl_gc);
|
||||||
|
|
||||||
window.icon( (void*)lupppIcon );
|
window.icon( (void*)looppIcon );
|
||||||
|
|
||||||
// setup callback to signalChecker()
|
// setup callback to signalChecker()
|
||||||
Fl::add_timeout( 0.1, (Fl_Timeout_Handler)&signalChecker, 0 );
|
Fl::add_timeout( 0.1, (Fl_Timeout_Handler)&signalChecker, 0 );
|
||||||
|
@ -385,11 +385,11 @@ Gui::Gui(const char* argZero) :
|
||||||
Fl::add_handler( keyboardHandler );
|
Fl::add_handler( keyboardHandler );
|
||||||
|
|
||||||
//window.resize( false );
|
//window.resize( false );
|
||||||
window.xclass("luppp");
|
window.xclass("loopp");
|
||||||
window.iconlabel("luppp");
|
window.iconlabel("loopp");
|
||||||
|
|
||||||
window.color(FL_BLACK);
|
window.color(FL_BLACK);
|
||||||
window.label("Luppp");
|
window.label("Loopp");
|
||||||
window.callback( close_cb, 0 );
|
window.callback( close_cb, 0 );
|
||||||
window.size_range( 800, 450 );
|
window.size_range( 800, 450 );
|
||||||
|
|
||||||
|
@ -403,9 +403,9 @@ Gui::Gui(const char* argZero) :
|
||||||
Avtk::Image* bgImage = new Avtk::Image(0,0,1920,36,"bg");
|
Avtk::Image* bgImage = new Avtk::Image(0,0,1920,36,"bg");
|
||||||
bgImage->setPixbuf( bgImg.pixel_data, 4 );
|
bgImage->setPixbuf( bgImg.pixel_data, 4 );
|
||||||
|
|
||||||
Avtk::Image* lupppImage = new Avtk::Image(0,0,130,36,"luppp");
|
Avtk::Image* looppImage = new Avtk::Image(0,0,130,36,"loopp");
|
||||||
lupppImage->setPixbuf( lupppImg.pixel_data, 4 );
|
looppImage->setPixbuf( looppImg.pixel_data, 4 );
|
||||||
lupppImage->callback( gui_header_callback, this );
|
looppImage->callback( gui_header_callback, this );
|
||||||
|
|
||||||
Avtk::Image* headerImage = new Avtk::Image( window.w() - 270,0,270,36,"header");
|
Avtk::Image* headerImage = new Avtk::Image( window.w() - 270,0,270,36,"header");
|
||||||
headerImage->setPixbuf( header.pixel_data, 4 );
|
headerImage->setPixbuf( header.pixel_data, 4 );
|
||||||
|
@ -425,8 +425,8 @@ Gui::Gui(const char* argZero) :
|
||||||
}
|
}
|
||||||
headerImages->end();
|
headerImages->end();
|
||||||
|
|
||||||
// create a new "Group" with all Luppp GUI contents, for resizing
|
// create a new "Group" with all Loopp GUI contents, for resizing
|
||||||
lupppGroup = new Fl_Group( 0, 0, 1110, 700, "Luppp");
|
looppGroup = new Fl_Group( 0, 0, 1110, 700, "Loopp");
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (; i < NTRACKS; i++ ) {
|
for (; i < NTRACKS; i++ ) {
|
||||||
|
@ -436,9 +436,9 @@ Gui::Gui(const char* argZero) :
|
||||||
}
|
}
|
||||||
master = new GMasterTrack(8 + i * 118, 40, 150, 650, "Master");
|
master = new GMasterTrack(8 + i * 118, 40, 150, 650, "Master");
|
||||||
}
|
}
|
||||||
lupppGroup->end();
|
looppGroup->end();
|
||||||
|
|
||||||
window.resizable( lupppGroup );
|
window.resizable( looppGroup );
|
||||||
|
|
||||||
window.end();
|
window.end();
|
||||||
|
|
||||||
|
@ -454,10 +454,10 @@ Gui::Gui(const char* argZero) :
|
||||||
|
|
||||||
// read settings file using diskreader, and setup controllers etc
|
// read settings file using diskreader, and setup controllers etc
|
||||||
int prefs = diskReader->loadPreferences();
|
int prefs = diskReader->loadPreferences();
|
||||||
if ( prefs != LUPPP_RETURN_OK ) {
|
if ( prefs != LOOPP_RETURN_OK ) {
|
||||||
LUPPP_WARN("No preferences loaded, using defaults.");
|
LOOPP_WARN("No preferences loaded, using defaults.");
|
||||||
} else {
|
} else {
|
||||||
LUPPP_NOTE("Loaded preferences");
|
LOOPP_NOTE("Loaded preferences");
|
||||||
}
|
}
|
||||||
|
|
||||||
// NSM stuff
|
// NSM stuff
|
||||||
|
@ -470,8 +470,8 @@ Gui::Gui(const char* argZero) :
|
||||||
nsm_set_save_callback( nsm, cb_nsm_save, this );
|
nsm_set_save_callback( nsm, cb_nsm_save, this );
|
||||||
|
|
||||||
if ( nsm_init( nsm, nsm_url ) == 0 ) {
|
if ( nsm_init( nsm, nsm_url ) == 0 ) {
|
||||||
nsm_send_announce( nsm, "Luppp", "", argZero );
|
nsm_send_announce( nsm, "Loopp", "", argZero );
|
||||||
LUPPP_NOTE("Announcing to NSM");
|
LOOPP_NOTE("Announcing to NSM");
|
||||||
} else {
|
} else {
|
||||||
nsm_free( nsm );
|
nsm_free( nsm );
|
||||||
nsm = 0;
|
nsm = 0;
|
||||||
|
|
10
src/gui.hxx
10
src/gui.hxx
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_GUI
|
#ifndef LOOPP_GUI
|
||||||
#define LUPPP_GUI
|
#define LOOPP_GUI
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -125,11 +125,11 @@ private:
|
||||||
|
|
||||||
Fl_Double_Window window;
|
Fl_Double_Window window;
|
||||||
|
|
||||||
Fl_Group* lupppGroup;
|
Fl_Group* looppGroup;
|
||||||
|
|
||||||
OptionsWindow* optionWindow;
|
OptionsWindow* optionWindow;
|
||||||
|
|
||||||
std::string lupppProjectsDir;
|
std::string looppProjectsDir;
|
||||||
|
|
||||||
AudioEditor* audioEditor;
|
AudioEditor* audioEditor;
|
||||||
|
|
||||||
|
@ -150,4 +150,4 @@ private:
|
||||||
static int keyboardHandler(int event);
|
static int keyboardHandler(int event);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_GUI
|
#endif // LOOPP_GUI
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_G_UNIT_TRACK_H
|
#ifndef LOOPP_G_UNIT_TRACK_H
|
||||||
#define LUPPP_G_UNIT_TRACK_H
|
#define LOOPP_G_UNIT_TRACK_H
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
@ -68,5 +68,5 @@ private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_G_UNIT_TRACK_H
|
#endif // LOOPP_G_UNIT_TRACK_H
|
||||||
|
|
||||||
|
|
22
src/jack.cxx
22
src/jack.cxx
|
@ -59,7 +59,7 @@ void Jack::setup(std::string name)
|
||||||
jack->activate();
|
jack->activate();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
LUPPP_WARN("JACK instance already exists!");
|
LOOPP_WARN("JACK instance already exists!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ Jack::Jack( std::string name ) :
|
||||||
* The TrackOutput gets a pointer to the next AudioProcessor to call:
|
* The TrackOutput gets a pointer to the next AudioProcessor to call:
|
||||||
* This is either a JackSendReturn (providing send and return ports)
|
* This is either a JackSendReturn (providing send and return ports)
|
||||||
* or the track's Looper instance.
|
* or the track's Looper instance.
|
||||||
* This is an option in luppp.prfs
|
* This is an option in loopp.prfs
|
||||||
**/
|
**/
|
||||||
loopers.push_back( new Looper(track) );
|
loopers.push_back( new Looper(track) );
|
||||||
|
|
||||||
|
@ -285,14 +285,14 @@ Jack::Jack( std::string name ) :
|
||||||
if ( jack_set_process_callback( client,
|
if ( jack_set_process_callback( client,
|
||||||
static_process,
|
static_process,
|
||||||
static_cast<void*>(this)) ) {
|
static_cast<void*>(this)) ) {
|
||||||
LUPPP_ERROR("%s","Error setting process callback");
|
LOOPP_ERROR("%s","Error setting process callback");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( jack_set_timebase_callback(client,
|
if ( jack_set_timebase_callback(client,
|
||||||
0, //0, 0 == must be master, 1 == conditional
|
0, //0, 0 == must be master, 1 == conditional
|
||||||
(JackTimebaseCallback)static_timebase,
|
(JackTimebaseCallback)static_timebase,
|
||||||
static_cast<void*>(this)) ) {
|
static_cast<void*>(this)) ) {
|
||||||
LUPPP_ERROR("%s","Error setting timebase callback");
|
LOOPP_ERROR("%s","Error setting timebase callback");
|
||||||
}
|
}
|
||||||
|
|
||||||
//Controller* m = new AkaiAPC();
|
//Controller* m = new AkaiAPC();
|
||||||
|
@ -301,11 +301,11 @@ Jack::Jack( std::string name ) :
|
||||||
// Watch out for RT stuff, loading file, registering ports etc: before activate?!
|
// Watch out for RT stuff, loading file, registering ports etc: before activate?!
|
||||||
//Controller* m = new GenericMIDI("akai_apc.ctlr","apc");
|
//Controller* m = new GenericMIDI("akai_apc.ctlr","apc");
|
||||||
|
|
||||||
Controller* g = new LupppGUI();
|
Controller* g = new LooppGUI();
|
||||||
controllerUpdater->registerController( g );
|
controllerUpdater->registerController( g );
|
||||||
|
|
||||||
if ( !g ) {
|
if ( !g ) {
|
||||||
LUPPP_ERROR("%s","Error creating LupppGUI Controller instance");
|
LOOPP_ERROR("%s","Error creating LooppGUI Controller instance");
|
||||||
}
|
}
|
||||||
|
|
||||||
// call into the GUI, telling it to register default controllers
|
// call into the GUI, telling it to register default controllers
|
||||||
|
@ -358,7 +358,7 @@ void Jack::quit()
|
||||||
{
|
{
|
||||||
//jack_deactivate( client );
|
//jack_deactivate( client );
|
||||||
jack_client_close( client );
|
jack_client_close( client );
|
||||||
LUPPP_NOTE("%s","Quit JACK.");
|
LOOPP_NOTE("%s","Quit JACK.");
|
||||||
}
|
}
|
||||||
|
|
||||||
TrackOutput* Jack::getTrackOutput(int t)
|
TrackOutput* Jack::getTrackOutput(int t)
|
||||||
|
@ -404,7 +404,7 @@ Looper* Jack::getLooper(int t)
|
||||||
|
|
||||||
void Jack::registerMidiIO( MidiIO* mo )
|
void Jack::registerMidiIO( MidiIO* mo )
|
||||||
{
|
{
|
||||||
//LUPPP_NOTE("Jack::registerMidiIO()" );
|
//LOOPP_NOTE("Jack::registerMidiIO()" );
|
||||||
|
|
||||||
// CAREFUL : this could need to resize and cause malloc() in RT thread
|
// CAREFUL : this could need to resize and cause malloc() in RT thread
|
||||||
midiIO.push_back( mo );
|
midiIO.push_back( mo );
|
||||||
|
@ -412,7 +412,7 @@ void Jack::registerMidiIO( MidiIO* mo )
|
||||||
|
|
||||||
void Jack::unregisterMidiIO( MidiIO* mo )
|
void Jack::unregisterMidiIO( MidiIO* mo )
|
||||||
{
|
{
|
||||||
LUPPP_NOTE("Jack::unregisterMidiIO()");
|
LOOPP_NOTE("Jack::unregisterMidiIO()");
|
||||||
|
|
||||||
// unregister the observer
|
// unregister the observer
|
||||||
for(unsigned int i = 0; i < midiIO.size(); i++) {
|
for(unsigned int i = 0; i < midiIO.size(); i++) {
|
||||||
|
@ -519,7 +519,7 @@ int Jack::process (jack_nframes_t nframes)
|
||||||
void Jack::processFrames(int nframes)
|
void Jack::processFrames(int nframes)
|
||||||
{
|
{
|
||||||
if ( nframes < 0 ) {
|
if ( nframes < 0 ) {
|
||||||
LUPPP_WARN("Jack processFrames got nframes < 0");
|
LOOPP_WARN("Jack processFrames got nframes < 0");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -629,7 +629,7 @@ void Jack::processFrames(int nframes)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// move buffer pointers up nframes: allows processing of one "nframes" from
|
// move buffer pointers up nframes: allows processing of one "nframes" from
|
||||||
// JACK in multiple parts internally in Luppp: used for processing bar() / beat()
|
// JACK in multiple parts internally in Loopp: used for processing bar() / beat()
|
||||||
// if a full JACK nframes has been processed, this is extra work: its not that expensive
|
// if a full JACK nframes has been processed, this is extra work: its not that expensive
|
||||||
/// update buffers by nframes
|
/// update buffers by nframes
|
||||||
if(lastnframes+nframes<buffers.nframes) {
|
if(lastnframes+nframes<buffers.nframes) {
|
||||||
|
|
10
src/jack.hxx
10
src/jack.hxx
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_JACK_H
|
#ifndef LOOPP_JACK_H
|
||||||
#define LUPPP_JACK_H
|
#define LOOPP_JACK_H
|
||||||
|
|
||||||
// Library
|
// Library
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -61,13 +61,13 @@ public:
|
||||||
static void setup(std::string name);
|
static void setup(std::string name);
|
||||||
|
|
||||||
void activate();
|
void activate();
|
||||||
/// quits the JACK client, destroying ports etc. Call only on exit of Luppp.
|
/// quits the JACK client, destroying ports etc. Call only on exit of Loopp.
|
||||||
void quit();
|
void quit();
|
||||||
|
|
||||||
int getBuffersize();
|
int getBuffersize();
|
||||||
int getSamplerate();
|
int getSamplerate();
|
||||||
|
|
||||||
// Luppp process callback: bar() events can occur between these
|
// Loopp process callback: bar() events can occur between these
|
||||||
void processFrames(int nframes);
|
void processFrames(int nframes);
|
||||||
|
|
||||||
//Sets the first nframes of all the internal output buffers to zero. NO LIMIT CHECKS
|
//Sets the first nframes of all the internal output buffers to zero. NO LIMIT CHECKS
|
||||||
|
@ -251,5 +251,5 @@ private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_JACK_H
|
#endif // LOOPP_JACK_H
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ void Logic::trackVolume(int t, float v)
|
||||||
jack->getTrackOutput( t )->setMaster( v );
|
jack->getTrackOutput( t )->setMaster( v );
|
||||||
jack->getControllerUpdater()->volume( t, v );
|
jack->getControllerUpdater()->volume( t, v );
|
||||||
} else {
|
} else {
|
||||||
LUPPP_WARN("invalid track number %i: check controller map has \"track\" field.", t );
|
LOOPP_WARN("invalid track number %i: check controller map has \"track\" field.", t );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ void Logic::trackRecordArm(int t, bool v)
|
||||||
jack->getTrackOutput( t )->recordArm( v );
|
jack->getTrackOutput( t )->recordArm( v );
|
||||||
jack->getControllerUpdater()->recordArm( t, v );
|
jack->getControllerUpdater()->recordArm( t, v );
|
||||||
} else {
|
} else {
|
||||||
LUPPP_WARN("invalid track number %i: check controller map has \"track\" field.", t );
|
LOOPP_WARN("invalid track number %i: check controller map has \"track\" field.", t );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ void Logic::trackSendActive(int t, int s, bool v)
|
||||||
jack->getTrackOutput( t )->setSendActive( s, v );
|
jack->getTrackOutput( t )->setSendActive( s, v );
|
||||||
jack->getControllerUpdater()->setTrackSendActive( t, s, v );
|
jack->getControllerUpdater()->setTrackSendActive( t, s, v );
|
||||||
} else {
|
} else {
|
||||||
LUPPP_WARN("invalid track number %i: check controller map has \"track\" field.", t );
|
LOOPP_WARN("invalid track number %i: check controller map has \"track\" field.", t );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ void Logic::trackSend(int t, int send, float v)
|
||||||
jack->getTrackOutput( t )->setSend( send, v );
|
jack->getTrackOutput( t )->setSend( send, v );
|
||||||
jack->getControllerUpdater()->setTrackSend( t, send, v );
|
jack->getControllerUpdater()->setTrackSend( t, send, v );
|
||||||
} else {
|
} else {
|
||||||
LUPPP_WARN("invalid track number %i: check controller map has \"track\" field.", t );
|
LOOPP_WARN("invalid track number %i: check controller map has \"track\" field.", t );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ void Logic::trackJackSendActivate(int t, bool active)
|
||||||
jack->getJackSendReturn(t)->activate(active);
|
jack->getJackSendReturn(t)->activate(active);
|
||||||
jack->getControllerUpdater()->setTrackJackSendActive( t, active );
|
jack->getControllerUpdater()->setTrackJackSendActive( t, active );
|
||||||
} else {
|
} else {
|
||||||
LUPPP_WARN("invalid track number %i: check controller map has \"track\" field.", t );
|
LOOPP_WARN("invalid track number %i: check controller map has \"track\" field.", t );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ void Logic::trackJackSend(int t, float vol)
|
||||||
jack->getJackSendReturn(t)->sendVolume(vol);
|
jack->getJackSendReturn(t)->sendVolume(vol);
|
||||||
jack->getControllerUpdater()->setTrackJackSend( t, vol );
|
jack->getControllerUpdater()->setTrackJackSend( t, vol );
|
||||||
} else {
|
} else {
|
||||||
LUPPP_WARN("invalid track number %i: check controller map has \"track\" field.", t );
|
LOOPP_WARN("invalid track number %i: check controller map has \"track\" field.", t );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ void Logic::looperClipLenght(int t, int s, int l)
|
||||||
if ( t >= 0 && t < NTRACKS ) {
|
if ( t >= 0 && t < NTRACKS ) {
|
||||||
jack->getLooper( t )->getClip( s )->setBeats(l);
|
jack->getLooper( t )->getClip( s )->setBeats(l);
|
||||||
} else {
|
} else {
|
||||||
LUPPP_WARN("invalid track number %i: check controller map has \"track\" field.", t );
|
LOOPP_WARN("invalid track number %i: check controller map has \"track\" field.", t );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,15 +16,15 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_LOGIC_H
|
#ifndef LOOPP_LOGIC_H
|
||||||
#define LUPPP_LOGIC_H
|
#define LOOPP_LOGIC_H
|
||||||
|
|
||||||
#include "event.hxx"
|
#include "event.hxx"
|
||||||
|
|
||||||
/** Logic
|
/** Logic
|
||||||
* This class contains an interface exposing most functionality in Luppp. The
|
* This class contains an interface exposing most functionality in Loopp. The
|
||||||
* interface is used to have one central place from where each controller can
|
* interface is used to have one central place from where each controller can
|
||||||
* interact with Luppp using the same function calls.
|
* interact with Loopp using the same function calls.
|
||||||
*
|
*
|
||||||
* This class should be used for input from any device. The interface is
|
* This class should be used for input from any device. The interface is
|
||||||
* deliberatly specific with regards to scheduling events: controllers should
|
* deliberatly specific with regards to scheduling events: controllers should
|
||||||
|
@ -69,4 +69,4 @@ public:
|
||||||
void setClipLengthDown();
|
void setClipLengthDown();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_LOGIC_H
|
#endif // LOOPP_LOGIC_H
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_LOOPER_H
|
#ifndef LOOPP_LOOPER_H
|
||||||
#define LUPPP_LOOPER_H
|
#define LOOPP_LOOPER_H
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -88,4 +88,4 @@ private:
|
||||||
int uiUpdateCounter;
|
int uiUpdateCounter;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_LOOPER_H
|
#endif // LOOPP_LOOPER_H
|
||||||
|
|
|
@ -210,7 +210,7 @@ void LooperClip::record(int count, float* L, float* R)
|
||||||
EventGuiPrint e( buffer );
|
EventGuiPrint e( buffer );
|
||||||
writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
#ifdef BUILD_TESTS
|
#ifdef BUILD_TESTS
|
||||||
LUPPP_WARN("%s","buffer has no space");
|
LOOPP_WARN("%s","buffer has no space");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_LOOPER_CLIP_H
|
#ifndef LOOPP_LOOPER_CLIP_H
|
||||||
#define LUPPP_LOOPER_CLIP_H
|
#define LOOPP_LOOPER_CLIP_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "state/stately.hxx"
|
#include "state/stately.hxx"
|
||||||
|
@ -138,7 +138,7 @@ public:
|
||||||
private:
|
private:
|
||||||
int track, scene;
|
int track, scene;
|
||||||
|
|
||||||
/** Luppp needs more than the current state of the clip to accuratly handle
|
/** Loopp needs more than the current state of the clip to accuratly handle
|
||||||
* it. The current state of the grid is kept up-to-date by GridLogic
|
* it. The current state of the grid is kept up-to-date by GridLogic
|
||||||
* abstracting detail away, sending GridLogic::State to Controllers.
|
* abstracting detail away, sending GridLogic::State to Controllers.
|
||||||
**/
|
**/
|
||||||
|
@ -176,5 +176,5 @@ private:
|
||||||
void setStopped();
|
void setStopped();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_LOOPER_CLIP_H
|
#endif // LOOPP_LOOPER_CLIP_H
|
||||||
|
|
||||||
|
|
12
src/main.cxx
12
src/main.cxx
|
@ -52,8 +52,8 @@ static void gui_static_loadSession_cb(void* inst)
|
||||||
{
|
{
|
||||||
char* tmp = (char*) inst;
|
char* tmp = (char*) inst;
|
||||||
int sess = gui->getDiskReader()->readSession( tmp );
|
int sess = gui->getDiskReader()->readSession( tmp );
|
||||||
if ( sess != LUPPP_RETURN_OK )
|
if ( sess != LOOPP_RETURN_OK )
|
||||||
LUPPP_ERROR( "Error loading session" );
|
LOOPP_ERROR( "Error loading session" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LUPPP_NOTE("Git: %s", GIT_VERSION );
|
LOOPP_NOTE("Git: %s", GIT_VERSION );
|
||||||
|
|
||||||
// setup the environment
|
// setup the environment
|
||||||
AVOIDDENORMALS();
|
AVOIDDENORMALS();
|
||||||
|
@ -91,14 +91,14 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
|
|
||||||
#ifdef BUILD_TESTS
|
#ifdef BUILD_TESTS
|
||||||
LUPPP_NOTE("Built with BUILD_TESTS enabled");
|
LOOPP_NOTE("Built with BUILD_TESTS enabled");
|
||||||
if ( runTests ) {
|
if ( runTests ) {
|
||||||
// counts failures
|
// counts failures
|
||||||
int testResult = 0;
|
int testResult = 0;
|
||||||
|
|
||||||
// setup the testing Gui / JACK: Jack first, then GUI
|
// setup the testing Gui / JACK: Jack first, then GUI
|
||||||
gui = new Gui( argv[0] );
|
gui = new Gui( argv[0] );
|
||||||
Jack::setup("LupppTEST");
|
Jack::setup("LooppTEST");
|
||||||
|
|
||||||
// test offline functionality
|
// test offline functionality
|
||||||
testResult += gui->getDiskReader()->runTests();
|
testResult += gui->getDiskReader()->runTests();
|
||||||
|
@ -127,7 +127,7 @@ int main(int argc, char** argv)
|
||||||
// the NSM OSC Open message will trigger Jack initialization: necessary
|
// the NSM OSC Open message will trigger Jack initialization: necessary
|
||||||
// to use the right name to create the JACK client.
|
// to use the right name to create the JACK client.
|
||||||
} else {
|
} else {
|
||||||
Jack::setup("Luppp");
|
Jack::setup("Loopp");
|
||||||
jack->activate();
|
jack->activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ version_hxx = vcs_tag(
|
||||||
|
|
||||||
if not get_option('unitTests')
|
if not get_option('unitTests')
|
||||||
message('Create build config for publishing')
|
message('Create build config for publishing')
|
||||||
luppp_src = files(
|
loopp_src = files(
|
||||||
'audiobuffer.cxx',
|
'audiobuffer.cxx',
|
||||||
'controllerupdater.cxx',
|
'controllerupdater.cxx',
|
||||||
'debug.cxx',
|
'debug.cxx',
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_METRONOME_H
|
#ifndef LOOPP_METRONOME_H
|
||||||
#define LUPPP_METRONOME_H
|
#define LOOPP_METRONOME_H
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -56,4 +56,4 @@ private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_METRONOME_H
|
#endif // LOOPP_METRONOME_H
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
luppp_src += files('midi.cxx', 'time.cxx')
|
loopp_src += files('midi.cxx', 'time.cxx')
|
||||||
|
|
|
@ -29,14 +29,14 @@ MidiIO::MidiIO() :
|
||||||
jackInputPort(0),
|
jackInputPort(0),
|
||||||
jackOutputPort(0)
|
jackOutputPort(0)
|
||||||
{
|
{
|
||||||
//LUPPP_NOTE("MidiIO %i",this);
|
//LOOPP_NOTE("MidiIO %i",this);
|
||||||
}
|
}
|
||||||
|
|
||||||
MidiIO::~MidiIO()
|
MidiIO::~MidiIO()
|
||||||
{
|
{
|
||||||
jack->unregisterMidiIO( this );
|
jack->unregisterMidiIO( this );
|
||||||
|
|
||||||
//LUPPP_NOTE("~MidiIO unregistring ports");
|
//LOOPP_NOTE("~MidiIO unregistring ports");
|
||||||
jack_port_unregister( jack->getJackClientPointer(), jackInputPort );
|
jack_port_unregister( jack->getJackClientPointer(), jackInputPort );
|
||||||
jack_port_unregister( jack->getJackClientPointer(), jackOutputPort );
|
jack_port_unregister( jack->getJackClientPointer(), jackOutputPort );
|
||||||
}
|
}
|
||||||
|
@ -61,8 +61,8 @@ void MidiIO::writeMidi( unsigned char* data )
|
||||||
int MidiIO::registerMidiPorts(std::string name)
|
int MidiIO::registerMidiPorts(std::string name)
|
||||||
{
|
{
|
||||||
if( !jack ) {
|
if( !jack ) {
|
||||||
LUPPP_ERROR("Attempted register of controller, JACK not instantiated yet!");
|
LOOPP_ERROR("Attempted register of controller, JACK not instantiated yet!");
|
||||||
return LUPPP_RETURN_ERROR;
|
return LOOPP_RETURN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
jack_client_t* c = jack->getJackClientPointer();
|
jack_client_t* c = jack->getJackClientPointer();
|
||||||
|
@ -84,12 +84,12 @@ int MidiIO::registerMidiPorts(std::string name)
|
||||||
0 );
|
0 );
|
||||||
|
|
||||||
if ( jackInputPort && jackOutputPort ) {
|
if ( jackInputPort && jackOutputPort ) {
|
||||||
//LUPPP_NOTE("%i, %i", jackInputPort, jackOutputPort );
|
//LOOPP_NOTE("%i, %i", jackInputPort, jackOutputPort );
|
||||||
portsRegistered = true;
|
portsRegistered = true;
|
||||||
return LUPPP_RETURN_OK;
|
return LOOPP_RETURN_OK;
|
||||||
} else {
|
} else {
|
||||||
LUPPP_ERROR("Error registering JACK ports" );
|
LOOPP_ERROR("Error registering JACK ports" );
|
||||||
return LUPPP_RETURN_ERROR;
|
return LOOPP_RETURN_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_MIDI_IO_H
|
#ifndef LOOPP_MIDI_IO_H
|
||||||
#define LUPPP_MIDI_IO_H
|
#define LOOPP_MIDI_IO_H
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -60,4 +60,4 @@ private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_MIDI_IO_H
|
#endif // LOOPP_MIDI_IO_H
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_TIME_OBSERVER_H
|
#ifndef LOOPP_TIME_OBSERVER_H
|
||||||
#define LUPPP_TIME_OBSERVER_H
|
#define LOOPP_TIME_OBSERVER_H
|
||||||
|
|
||||||
#include "../config.hxx"
|
#include "../config.hxx"
|
||||||
|
|
||||||
|
@ -42,4 +42,4 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_TIME_OBSERVER_H
|
#endif // LOOPP_TIME_OBSERVER_H
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
luppp_src += files('state.cxx', 'stately.cxx')
|
loopp_src += files('state.cxx', 'stately.cxx')
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_STATE_H
|
#ifndef LOOPP_STATE_H
|
||||||
#define LUPPP_STATE_H
|
#define LOOPP_STATE_H
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
@ -49,4 +49,4 @@ private:
|
||||||
std::vector<Stately*> statelys;
|
std::vector<Stately*> statelys;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_STATE_H
|
#endif // LOOPP_STATE_H
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_STATELY_H
|
#ifndef LOOPP_STATELY_H
|
||||||
#define LUPPP_STATELY_H
|
#define LOOPP_STATELY_H
|
||||||
|
|
||||||
/** Stately
|
/** Stately
|
||||||
* This class is inherited from by all classes that have state.
|
* This class is inherited from by all classes that have state.
|
||||||
|
@ -59,5 +59,5 @@ private:
|
||||||
static void checkCompletedSave();
|
static void checkCompletedSave();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_STATELY_H
|
#endif // LOOPP_STATELY_H
|
||||||
|
|
||||||
|
|
|
@ -42,9 +42,9 @@ int DiskReader::runTests()
|
||||||
//AudioBuffer ab(440);
|
//AudioBuffer ab(440);
|
||||||
//gui->getDiskWriter()->initialize(path, session);
|
//gui->getDiskWriter()->initialize(path, session);
|
||||||
|
|
||||||
QUNIT_IS_TRUE( gui->getDiskReader()->loadSample( 0, 0,"/tmp/lupppTestMaterial/beat.wav" ) == LUPPP_RETURN_OK );
|
QUNIT_IS_TRUE( gui->getDiskReader()->loadSample( 0, 0,"/tmp/looppTestMaterial/beat.wav" ) == LOOPP_RETURN_OK );
|
||||||
|
|
||||||
QUNIT_IS_TRUE( gui->getDiskReader()->readSession("/tmp/lupppTestMaterial/lupppTest" ) == LUPPP_RETURN_OK );
|
QUNIT_IS_TRUE( gui->getDiskReader()->readSession("/tmp/looppTestMaterial/looppTest" ) == LOOPP_RETURN_OK );
|
||||||
|
|
||||||
return qunit.errors();
|
return qunit.errors();
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,8 +45,8 @@ int DiskWriter::runTests()
|
||||||
AudioBuffer ab(440);
|
AudioBuffer ab(440);
|
||||||
gui->getDiskWriter()->initialize(path, session);
|
gui->getDiskWriter()->initialize(path, session);
|
||||||
|
|
||||||
QUNIT_IS_TRUE( gui->getDiskWriter()->writeAudioBuffer(0, 0, &ab) == LUPPP_RETURN_OK );
|
QUNIT_IS_TRUE( gui->getDiskWriter()->writeAudioBuffer(0, 0, &ab) == LOOPP_RETURN_OK );
|
||||||
QUNIT_IS_TRUE( gui->getDiskWriter()->writeSession() == LUPPP_RETURN_OK );
|
QUNIT_IS_TRUE( gui->getDiskWriter()->writeSession() == LOOPP_RETURN_OK );
|
||||||
|
|
||||||
QUNIT_IS_TRUE( strcmp( gui->getDiskWriter()->getLastSavePath().c_str(), path.c_str() ) == 0 );
|
QUNIT_IS_TRUE( strcmp( gui->getDiskWriter()->getLastSavePath().c_str(), path.c_str() ) == 0 );
|
||||||
QUNIT_IS_TRUE( strcmp( gui->getDiskWriter()->getLastSaveName().c_str(), session.c_str() ) == 0 );
|
QUNIT_IS_TRUE( strcmp( gui->getDiskWriter()->getLastSaveName().c_str(), session.c_str() ) == 0 );
|
||||||
|
@ -63,21 +63,21 @@ int DiskWriter::runTests()
|
||||||
std::string link = "www.dummylink.com";
|
std::string link = "www.dummylink.com";
|
||||||
|
|
||||||
int d = gui->getDiskWriter()->writeControllerFile( dummy );
|
int d = gui->getDiskWriter()->writeControllerFile( dummy );
|
||||||
QUNIT_IS_TRUE( d == LUPPP_RETURN_OK );
|
QUNIT_IS_TRUE( d == LOOPP_RETURN_OK );
|
||||||
|
|
||||||
dummy->setupBinding( Event::TRACK_VOLUME, 176, 7, 0, 0, 0, 0 );
|
dummy->setupBinding( Event::TRACK_VOLUME, 176, 7, 0, 0, 0, 0 );
|
||||||
dummy->setupBinding( Event::GRID_LAUNCH_SCENE, 144, 60, 0, 2, 0, 0 );
|
dummy->setupBinding( Event::GRID_LAUNCH_SCENE, 144, 60, 0, 2, 0, 0 );
|
||||||
|
|
||||||
int d1 = gui->getDiskWriter()->writeControllerFile( dummy );
|
int d1 = gui->getDiskWriter()->writeControllerFile( dummy );
|
||||||
QUNIT_IS_TRUE( d1 == LUPPP_RETURN_OK );
|
QUNIT_IS_TRUE( d1 == LOOPP_RETURN_OK );
|
||||||
|
|
||||||
/// test dynamic cast, null, and invalid Controller* type
|
/// test dynamic cast, null, and invalid Controller* type
|
||||||
int r1 = gui->getDiskWriter()->writeControllerFile( 0 );
|
int r1 = gui->getDiskWriter()->writeControllerFile( 0 );
|
||||||
QUNIT_IS_TRUE( r1 == LUPPP_RETURN_ERROR );
|
QUNIT_IS_TRUE( r1 == LOOPP_RETURN_ERROR );
|
||||||
|
|
||||||
Controller* non = new NonSeq();
|
Controller* non = new NonSeq();
|
||||||
int r2 = gui->getDiskWriter()->writeControllerFile( non);
|
int r2 = gui->getDiskWriter()->writeControllerFile( non);
|
||||||
QUNIT_IS_TRUE( r2 == LUPPP_RETURN_ERROR );
|
QUNIT_IS_TRUE( r2 == LOOPP_RETURN_ERROR );
|
||||||
|
|
||||||
return qunit.errors();
|
return qunit.errors();
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ int GridLogic::runTests()
|
||||||
LooperClip* lc = jack->getLooper( t )->getClip( s );
|
LooperClip* lc = jack->getLooper( t )->getClip( s );
|
||||||
|
|
||||||
// "pretty" prints the state of the clip
|
// "pretty" prints the state of the clip
|
||||||
//LUPPP_NOTE("%s", GridLogic::StateString[ lc->getState() ] );
|
//LOOPP_NOTE("%s", GridLogic::StateString[ lc->getState() ] );
|
||||||
|
|
||||||
/// SCENE LAUNCH
|
/// SCENE LAUNCH
|
||||||
lc->init();
|
lc->init();
|
||||||
|
@ -49,28 +49,28 @@ int GridLogic::runTests()
|
||||||
int launchScene = s + 1;
|
int launchScene = s + 1;
|
||||||
lc->init();
|
lc->init();
|
||||||
lc->setState( true, false, false, true, false, false ); // loaded + qplay
|
lc->setState( true, false, false, true, false, false ); // loaded + qplay
|
||||||
LUPPP_NOTE("state before = %s", GridLogic::StateString[ lc->getState() ] );
|
LOOPP_NOTE("state before = %s", GridLogic::StateString[ lc->getState() ] );
|
||||||
jack->getGridLogic()->launchScene( launchScene ); // launch different clip
|
jack->getGridLogic()->launchScene( launchScene ); // launch different clip
|
||||||
|
|
||||||
QUNIT_IS_TRUE( jack->getGridLogic()->getLaunchedScene() == launchScene );
|
QUNIT_IS_TRUE( jack->getGridLogic()->getLaunchedScene() == launchScene );
|
||||||
LUPPP_NOTE("state after launch before bar = %s", GridLogic::StateString[ lc->getState() ] );
|
LOOPP_NOTE("state after launch before bar = %s", GridLogic::StateString[ lc->getState() ] );
|
||||||
QUNIT_IS_TRUE( lc->getState() == GridLogic::STATE_STOPPED );
|
QUNIT_IS_TRUE( lc->getState() == GridLogic::STATE_STOPPED );
|
||||||
|
|
||||||
jack->getGridLogic()->bar();
|
jack->getGridLogic()->bar();
|
||||||
|
|
||||||
LUPPP_NOTE("state after bar = %s", GridLogic::StateString[ lc->getState() ] );
|
LOOPP_NOTE("state after bar = %s", GridLogic::StateString[ lc->getState() ] );
|
||||||
QUNIT_IS_TRUE( lc->getState() == GridLogic::STATE_STOPPED );
|
QUNIT_IS_TRUE( lc->getState() == GridLogic::STATE_STOPPED );
|
||||||
|
|
||||||
/// s1 playing, then launch s2, s1
|
/// s1 playing, then launch s2, s1
|
||||||
lc->init();
|
lc->init();
|
||||||
lc->setState( true, true, false, false, false, false ); // playing
|
lc->setState( true, true, false, false, false, false ); // playing
|
||||||
//LUPPP_NOTE("state before = %s", GridLogic::StateString[ lc->getState() ] );
|
//LOOPP_NOTE("state before = %s", GridLogic::StateString[ lc->getState() ] );
|
||||||
jack->getGridLogic()->launchScene( launchScene ); // launch different clip
|
jack->getGridLogic()->launchScene( launchScene ); // launch different clip
|
||||||
QUNIT_IS_TRUE( jack->getGridLogic()->getLaunchedScene() == launchScene );
|
QUNIT_IS_TRUE( jack->getGridLogic()->getLaunchedScene() == launchScene );
|
||||||
//LUPPP_NOTE("state after before bar = %s", GridLogic::StateString[ lc->getState() ] );
|
//LOOPP_NOTE("state after before bar = %s", GridLogic::StateString[ lc->getState() ] );
|
||||||
QUNIT_IS_TRUE( lc->getState() == GridLogic::STATE_STOP_QUEUED );
|
QUNIT_IS_TRUE( lc->getState() == GridLogic::STATE_STOP_QUEUED );
|
||||||
jack->getGridLogic()->bar();
|
jack->getGridLogic()->bar();
|
||||||
//LUPPP_NOTE("state after bar = %s", GridLogic::StateString[ lc->getState() ] );
|
//LOOPP_NOTE("state after bar = %s", GridLogic::StateString[ lc->getState() ] );
|
||||||
QUNIT_IS_TRUE( lc->getState() == GridLogic::STATE_STOPPED );
|
QUNIT_IS_TRUE( lc->getState() == GridLogic::STATE_STOPPED );
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name" : "Akai APC 40",
|
"name" : "Akai APC 40",
|
||||||
"author" : "Harry van Haaren",
|
"author" : "Harry van Haaren",
|
||||||
"link" : "www.openavproductions.com/luppp#akaiapc40",
|
"link" : "www.openavproductions.com/loopp#akaiapc40",
|
||||||
|
|
||||||
"inputBindings" : [
|
"inputBindings" : [
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"session": "lupppTest",
|
"session": "looppTest",
|
||||||
"version_major": 1,
|
"version_major": 1,
|
||||||
"version_minor": 0,
|
"version_minor": 0,
|
||||||
"version_patch": 0,
|
"version_patch": 0,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
luppp_src += files(
|
loopp_src += files(
|
||||||
'diskreadertest.cxx',
|
'diskreadertest.cxx',
|
||||||
'diskwritertest.cxx',
|
'diskwritertest.cxx',
|
||||||
'goptionstest.cxx',
|
'goptionstest.cxx',
|
||||||
|
|
|
@ -73,7 +73,7 @@ void TimeManager::queueBpmChange(float bpm)
|
||||||
{
|
{
|
||||||
double frames = (double)samplerate * (double)60 / (double)bpm;
|
double frames = (double)samplerate * (double)60 / (double)bpm;
|
||||||
#ifdef DEBUG_TIME
|
#ifdef DEBUG_TIME
|
||||||
LUPPP_NOTE("%s %f","setBpm()",bpm);
|
LOOPP_NOTE("%s %f","setBpm()",bpm);
|
||||||
cout << "calculated: " << fixed << setprecision(20) << frames << "\n";
|
cout << "calculated: " << fixed << setprecision(20) << frames << "\n";
|
||||||
#endif
|
#endif
|
||||||
queueFpbChange( frames );
|
queueFpbChange( frames );
|
||||||
|
@ -125,7 +125,7 @@ void TimeManager::setFpb(double f)
|
||||||
|
|
||||||
void TimeManager::registerObserver(TimeObserver* o)
|
void TimeManager::registerObserver(TimeObserver* o)
|
||||||
{
|
{
|
||||||
//LUPPP_NOTE("%s","registerObserver()");
|
//LOOPP_NOTE("%s","registerObserver()");
|
||||||
observers.push_back(o);
|
observers.push_back(o);
|
||||||
o->setFpb( _fpb );
|
o->setFpb( _fpb );
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_TIME_H
|
#ifndef LOOPP_TIME_H
|
||||||
#define LUPPP_TIME_H
|
#define LOOPP_TIME_H
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
@ -93,4 +93,4 @@ private:
|
||||||
std::vector<TimeObserver*> observers;
|
std::vector<TimeObserver*> observers;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_TIME_H
|
#endif // LOOPP_TIME_H
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_TRACK_OUTPUT_H
|
#ifndef LOOPP_TRACK_OUTPUT_H
|
||||||
#define LUPPP_TRACK_OUTPUT_H
|
#define LOOPP_TRACK_OUTPUT_H
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -97,5 +97,5 @@ private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUPPP_TRACK_OUTPUT_H
|
#endif // LOOPP_TRACK_OUTPUT_H
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LUPPP_TRANSPORT_H
|
#ifndef LOOPP_TRANSPORT_H
|
||||||
#define LUPPP_TRANSPORT_H
|
#define LOOPP_TRANSPORT_H
|
||||||
|
|
||||||
enum TRANSPORT_STATE {
|
enum TRANSPORT_STATE {
|
||||||
TRANSPORT_STOPPED = 0,
|
TRANSPORT_STOPPED = 0,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
luppp_src = files(
|
loopp_src = files(
|
||||||
'test_audiobuffer.cxx',
|
'test_audiobuffer.cxx',
|
||||||
'test_entrypoint.cxx',
|
'test_entrypoint.cxx',
|
||||||
'test_debug.cxx',
|
'test_debug.cxx',
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
OUTPUT output;
|
OUTPUT output;
|
||||||
|
|
||||||
void
|
void
|
||||||
luppp_debug(int warnLevel, const char *name, const char *file, const char *func,
|
loopp_debug(int warnLevel, const char *name, const char *file, const char *func,
|
||||||
int line, const char *format, ...)
|
int line, const char *format, ...)
|
||||||
{
|
{
|
||||||
output.warnLevel = warnLevel;
|
output.warnLevel = warnLevel;
|
||||||
|
|
Loading…
Reference in New Issue