Merge https://github.com/LMMS/lmms into stable-0.4
Conflicts: plugins/opl2/logo.png
6
.travis.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
language: cpp
|
||||
compiler: gcc
|
||||
before_install: sudo apt-get update
|
||||
install: (sudo apt-get install libqt4-dev libsndfile-dev fftw3-dev libvorbis-dev libogg-dev libasound2-dev libjack-dev libsdl-dev libsamplerate0-dev libstk0-dev libfluidsynth-dev portaudio19-dev) && (sudo apt-get install wine-dev libc6-dev-amd64 || true)
|
||||
before_script: mkdir build && cd build
|
||||
script: cmake .. && make -j8
|
||||
@@ -84,6 +84,8 @@ CHECK_INCLUDE_FILES(string.h LMMS_HAVE_STRING_H)
|
||||
CHECK_INCLUDE_FILES(process.h LMMS_HAVE_PROCESS_H)
|
||||
CHECK_INCLUDE_FILES(locale.h LMMS_HAVE_LOCALE_H)
|
||||
|
||||
LIST(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
# check for Qt4
|
||||
SET(QT_MIN_VERSION "4.3.0" COMPONENTS QtCore QtGui QtXml)
|
||||
FIND_PACKAGE(Qt4 REQUIRED)
|
||||
@@ -397,22 +399,25 @@ IF(LMMS_BUILD_WIN32)
|
||||
SET(EXTRA_LIBRARIES "-lwinmm")
|
||||
ENDIF()
|
||||
|
||||
ADD_DEFINITIONS(-D'LIB_DIR="${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/"' -D'PLUGIN_DIR="${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/lmms/"' ${PULSEAUDIO_DEFINITIONS} ${PORTAUDIO_DEFINITIONS})
|
||||
# Paths relative to lmms executable
|
||||
FILE(RELATIVE_PATH LIB_DIR_RELATIVE /${BIN_DIR} /${LIB_DIR})
|
||||
FILE(RELATIVE_PATH PLUGIN_DIR_RELATIVE /${BIN_DIR} /${PLUGIN_DIR})
|
||||
ADD_DEFINITIONS(-D'LIB_DIR="${LIB_DIR_RELATIVE}/"' -D'PLUGIN_DIR="${PLUGIN_DIR_RELATIVE}/"' ${PULSEAUDIO_DEFINITIONS} ${PORTAUDIO_DEFINITIONS})
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/include ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/include ${SDL_INCLUDE_DIR} ${PORTAUDIO_INCLUDE_DIR} ${PULSEAUDIO_INCLUDE_DIR} ${JACK_INCLUDE_DIRS} ${OGGVORBIS_INCLUDE_DIR} ${SAMPLERATE_INCLUDE_DIRS} ${SNDFILE_INCLUDE_DIRS})
|
||||
LINK_DIRECTORIES(${CMAKE_INSTALL_PREFIX}/lib ${ASOUND_LIBRARY_DIR} ${JACK_LIBRARY_DIRS} ${SAMPLERATE_LIBRARY_DIRS} ${SNDFILE_LIBRARY_DIRS})
|
||||
LINK_LIBRARIES(${CMAKE_THREAD_LIBS_INIT} ${QT_LIBRARIES} ${ASOUND_LIBRARY} ${SDL_LIBRARY} ${PORTAUDIO_LIBRARIES} ${PULSEAUDIO_LIBRARIES} ${JACK_LIBRARIES} ${OGGVORBIS_LIBRARIES} ${SAMPLERATE_LIBRARIES} ${SNDFILE_LIBRARIES} ${EXTRA_LIBRARIES})
|
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/lmms.1.gz COMMAND gzip -c ${CMAKE_SOURCE_DIR}/lmms.1 > ${CMAKE_BINARY_DIR}/lmms.1.gz DEPENDS ${CMAKE_SOURCE_DIR}/lmms.1 COMMENT "Generating lmms.1.gz")
|
||||
|
||||
ADD_EXECUTABLE(lmms ${lmms_SOURCES} ${lmms_INCLUDES} ${LIBSAMPLERATE_SOURCES} ${LMMS_ER_H} ${lmms_UI_out} lmmsconfig.h lmmsversion.h ${WINRC} ${CMAKE_BINARY_DIR}/lmms.1.gz)
|
||||
|
||||
TARGET_LINK_LIBRARIES(lmms ${CMAKE_THREAD_LIBS_INIT} ${QT_LIBRARIES} ${ASOUND_LIBRARY} ${SDL_LIBRARY} ${PORTAUDIO_LIBRARIES} ${PULSEAUDIO_LIBRARIES} ${JACK_LIBRARIES} ${OGGVORBIS_LIBRARIES} ${SAMPLERATE_LIBRARIES} ${SNDFILE_LIBRARIES} ${EXTRA_LIBRARIES})
|
||||
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
|
||||
SET_TARGET_PROPERTIES(lmms PROPERTIES LINK_FLAGS "${LINK_FLAGS} -mwindows")
|
||||
ADD_CUSTOM_COMMAND(TARGET lmms POST_BUILD COMMAND ${STRIP} ${CMAKE_BINARY_DIR}/lmms.exe)
|
||||
|
||||
INSTALL(TARGETS lmms RUNTIME DESTINATION .)
|
||||
INSTALL(TARGETS lmms RUNTIME DESTINATION ${BIN_DIR})
|
||||
INSTALL(FILES
|
||||
${MINGW_PREFIX}/bin/QtCore4.dll
|
||||
${MINGW_PREFIX}/bin/QtGui4.dll
|
||||
@@ -438,7 +443,7 @@ ELSE(LMMS_BUILD_WIN32)
|
||||
SET_TARGET_PROPERTIES(lmms PROPERTIES LINK_FLAGS "${LINK_FLAGS} -Wl,-E")
|
||||
ENDIF(NOT LMMS_BUILD_APPLE)
|
||||
|
||||
INSTALL(TARGETS lmms RUNTIME DESTINATION bin)
|
||||
INSTALL(TARGETS lmms RUNTIME DESTINATION ${BIN_DIR})
|
||||
INSTALL(FILES ${CMAKE_BINARY_DIR}/lmms.1.gz DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1/ PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
|
||||
|
||||
ENDIF(LMMS_BUILD_WIN32)
|
||||
@@ -505,7 +510,7 @@ ADD_CUSTOM_TARGET(dist
|
||||
COMMAND mkdir -p ${TMP}
|
||||
COMMAND cp AUTHORS build_mingw32 build_mingw64 CMakeLists.txt configure COPYING INSTALL lmms.1 lmms.rc.in lmms.spec.in lmmsconfig.h.in lmmsversion.h.in README TODO ${TMP}
|
||||
COMMAND cp -r buildtools cmake data include plugins src ${TMP}
|
||||
COMMAND rm -rf `find ${TMP} -type d -name ".svn"` `find ${TMP} -name cmake_install.cmake` `find ${TMP} -name Makefile` `find ${TMP} -type d -name CMakeFiles` ${TMP}/CMakeCache.txt
|
||||
COMMAND rm -rf `find ${TMP} -name cmake_install.cmake` `find ${TMP} -name Makefile` `find ${TMP} -type d -name CMakeFiles` ${TMP}/CMakeCache.txt
|
||||
COMMAND tar cjf lmms-${VERSION}.tar.bz2 ${TMP}
|
||||
COMMAND rm -rf ${TMP})
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ MACRO(BUILD_PLUGIN)
|
||||
CAR(PLUGIN_NAME ${PLUGIN_DEFAULT_ARGS})
|
||||
CDR(PLUGIN_SOURCES ${PLUGIN_DEFAULT_ARGS})
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src/gui ${CMAKE_INSTALL_PREFIX}/include)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src/gui)
|
||||
|
||||
ADD_DEFINITIONS(-DPLUGIN_NAME=${PLUGIN_NAME})
|
||||
|
||||
|
||||
@@ -44,10 +44,12 @@ ENDIF(CMAKE_INSTALL_LIBDIR)
|
||||
|
||||
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
SET(BIN_DIR .)
|
||||
SET(PLUGIN_DIR plugins)
|
||||
SET(DATA_DIR data)
|
||||
SET(LMMS_DATA_DIR data)
|
||||
ELSE(LMMS_BUILD_WIN32)
|
||||
SET(BIN_DIR bin)
|
||||
SET(PLUGIN_DIR ${LIB_DIR}/lmms)
|
||||
SET(DATA_DIR share)
|
||||
SET(LMMS_DATA_DIR ${DATA_DIR}/lmms)
|
||||
|
||||
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 457 B After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 449 B After Width: | Height: | Size: 780 B |
|
Before Width: | Height: | Size: 747 B After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 424 B After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 16 KiB |
BIN
data/themes/default/main_slider.png
Normal file
|
After Width: | Height: | Size: 670 B |
|
Before Width: | Height: | Size: 721 B After Width: | Height: | Size: 228 B |
|
Before Width: | Height: | Size: 736 B After Width: | Height: | Size: 337 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 610 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 692 B |
|
Before Width: | Height: | Size: 736 B After Width: | Height: | Size: 244 B |
@@ -13,6 +13,17 @@ AutomationEditor {
|
||||
}
|
||||
|
||||
|
||||
QLineEdit {
|
||||
border-radius: 4px;
|
||||
border: 2px inset rgba(91,101,113,128);
|
||||
background: #49515b;
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
QLineEdit:focus {
|
||||
border: 1px solid rgba(0,0,0, 128);
|
||||
}
|
||||
|
||||
|
||||
QToolTip {
|
||||
border-radius: 4px;
|
||||
@@ -91,11 +102,10 @@ trackOperationsWidget > QPushButton {
|
||||
max-width: 26px;
|
||||
min-height: 26px;
|
||||
min-width: 26px;
|
||||
background-color: #c9c9c9;
|
||||
border-radius: 2px;
|
||||
border: 1px solid rgba(0,0,0,64);
|
||||
background: none;
|
||||
border:none;
|
||||
}
|
||||
|
||||
/*
|
||||
trackOperationsWidget > QPushButton:hover {
|
||||
background: qlineargradient(spread:reflect, x1:0.5, y1:0.5, x2:0.5, y2:0, stop:0 rgba(224, 224, 224, 255), stop:1 rgba(201, 201, 201, 255));
|
||||
border: 1px solid rgba(0,0,0,255);
|
||||
@@ -113,23 +123,27 @@ trackOperationsWidget > QPushButton:flat {
|
||||
border-radius: 2px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
trackOperationsWidget#automationDisabled > QPushButton::menu-indicator {
|
||||
image: url(resources:track_op_menu_disabled.png);
|
||||
}
|
||||
|
||||
trackOperationsWidget#automationEnabled > QPushButton::menu-indicator {
|
||||
image: url(resources:track_op_menu.png);
|
||||
}
|
||||
*/
|
||||
|
||||
trackOperationsWidget > QPushButton::menu-indicator {
|
||||
subcontrol-origin: padding;
|
||||
subcontrol-position: center;
|
||||
image: url(resources:trackop.png);
|
||||
subcontrol-origin: padding;
|
||||
subcontrol-position: center;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
trackOperationsWidget > QPushButton::menu-indicator:pressed {
|
||||
position: relative;
|
||||
top: 1px;
|
||||
trackOperationsWidget > QPushButton::menu-indicator:hover {
|
||||
image: url(resources:trackop_h.png);
|
||||
}
|
||||
|
||||
|
||||
trackOperationsWidget > QPushButton::menu-indicator:pressed,
|
||||
trackOperationsWidget > QPushButton::menu-indicator:checked
|
||||
{
|
||||
image: url(resources:trackop_c.png);
|
||||
position: relative;
|
||||
top: 3px;
|
||||
}
|
||||
|
||||
trackWidget {
|
||||
@@ -141,6 +155,47 @@ nameLabel, effectLabel, sf2InstrumentView > QLabel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
automatableSlider::groove:vertical {
|
||||
background: rgba(0,0,0, 128);
|
||||
border: 1px inset rgba(100,100,100, 64);
|
||||
border-radius: 2px;
|
||||
width: 2px;
|
||||
margin: 2px 2px;
|
||||
}
|
||||
|
||||
automatableSlider::handle:vertical {
|
||||
background: none;
|
||||
border-image: url(resources:main_slider.png);
|
||||
width: 26px;
|
||||
height: 10px;
|
||||
border-radius: 2px;
|
||||
margin: -4px -12px -2px;
|
||||
}
|
||||
|
||||
|
||||
EffectSelectDialog QScrollArea {
|
||||
background: #5b6571;
|
||||
}
|
||||
|
||||
EffectControlDialog QGroupBox {
|
||||
background: #49515b;
|
||||
margin-top: 1ex;
|
||||
padding: 10px 2px 1px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid rgba(0,0,0, 64);
|
||||
}
|
||||
|
||||
EffectControlDialog QGroupBox::title {
|
||||
subcontrol-origin: margin;
|
||||
subcontrol-position: top left;
|
||||
background: #7b838d;
|
||||
color: white;
|
||||
border-radius: 2px;
|
||||
border: 1px solid rgba(0,0,0, 64);
|
||||
padding: 2px 1px;
|
||||
}
|
||||
|
||||
QWidget#mainToolbar {
|
||||
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #98a2a7, stop:1 #5b646f);
|
||||
}
|
||||
@@ -150,81 +205,78 @@ QToolBar {
|
||||
}
|
||||
|
||||
QToolButton, toolButton {
|
||||
padding: 2px 1px 1px 2px;
|
||||
padding: 1px 1px 1px 1px;
|
||||
border-radius: 2px;
|
||||
border: 1px solid rgba(0,0,0,64);
|
||||
background: qradialgradient(cx:0.3, cy:0.3, radius:0.8, fx:0.3, fy:0.3, stop:0 #c9c9c9, stop:0.5 #c0c0c0, stop:1 #747474 );
|
||||
border: 1px solid rgba(0,0,0,32);
|
||||
background: qradialgradient(cx:0.3, cy:0.3, radius:0.8, fx:0.3, fy:0.3, stop:0 #c9c9c9, stop:1 #969696 );
|
||||
font-size:10px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
QToolButton:hover, toolButton:hover {
|
||||
background: qradialgradient(cx:0.3, cy:0.3, radius:0.8, fx:0.3, fy:0.3, stop:0 #e0e0e0, stop:0.5 #c9c9c9, stop:1 #747474 );
|
||||
border: 1px solid rgba(0,0,0,255);
|
||||
background: qradialgradient(cx:0.3, cy:0.3, radius:0.8, fx:0.3, fy:0.3, stop:0 #e0e0e0, stop:0.5 #c9c9c9, stop:1 #969696 );
|
||||
border: 1px solid rgba(0,0,0,128);
|
||||
color: white;
|
||||
}
|
||||
|
||||
QToolButton:pressed, ToolButton:pressed {
|
||||
background: qradialgradient(cx:0.3, cy:0.3, radius:0.8, fx:0.3, fy:0.3, stop:0 #c9c9c9, stop:0.5 #c0c0c0, stop:1 #747474 );
|
||||
padding: 3px 1px 0px 2px;
|
||||
border: 1px solid rgba(0,0,0,255);
|
||||
QToolButton:pressed, toolButton:pressed {
|
||||
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #969696, stop:0.5 #c9c9c9, stop:1 #969696 );
|
||||
padding: 2px 1px 0px 1px;
|
||||
border: 1px solid rgba(0,0,0,128);
|
||||
color: white;
|
||||
}
|
||||
|
||||
QToolButton:checked, ToolButton:checked {
|
||||
QToolButton:checked, toolButton:checked {
|
||||
background: qradialgradient(cx:0.3, cy:0.3, radius:0.8, fx:0.3, fy:0.3, stop:0 #e0e0e0, stop:0.8 #c9c9c9, stop:1 #c0c0c0 );
|
||||
border-radius: 3px;
|
||||
padding: 3px 1px 0px 2px;
|
||||
padding: 2px 1px 0px 1px;
|
||||
border: 1px solid rgba(0,0,0,255);
|
||||
color: black;
|
||||
}
|
||||
|
||||
trackLabelButton {
|
||||
background-color: #5b6571;
|
||||
color: #c9c9c9;
|
||||
font-size: 10px;
|
||||
font-weight: normal;
|
||||
border-radius: 1px;
|
||||
border: 1px solid rgba(0,0,0,64);
|
||||
background-color: #5b6571;
|
||||
color: #c9c9c9;
|
||||
font-size: 10px;
|
||||
font-weight: normal;
|
||||
border-radius: 1px;
|
||||
border: none;
|
||||
padding: 2px 1px;
|
||||
}
|
||||
|
||||
trackLabelButton:hover {
|
||||
background-color: #7b838d;
|
||||
color: white;
|
||||
border: 1px solid black;
|
||||
background-color: qlineargradient(spread:reflect, x1:0, y1:0, x2:0, y2:0.5, stop:0 #5b6571, stop:0.75 #7b838d, stop:1 #7b838d );
|
||||
color: white;
|
||||
border: 1px solid rgba(0,0,0,64);
|
||||
padding: 1px 0px;
|
||||
}
|
||||
|
||||
trackLabelButton:pressed {
|
||||
background: qlineargradient(spread:reflect, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #49515b, stop:0.5 #5b6571, stop:1 #6b7581 );
|
||||
background: qlineargradient(spread:reflect, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #49515b, stop:0.3 #5b6571, stop:1 #6b7581 );
|
||||
color: white;
|
||||
border: 1px solid black;
|
||||
border: 1px solid rgba(0,0,0,64);
|
||||
padding: 2px 0px 0px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
trackLabelButton:checked {
|
||||
background: qlineargradient(spread:reflect, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #49515b, stop:0.5 #5b6571, stop:1 #6b7581 );
|
||||
color: #c9c9c9;
|
||||
border: 1px solid rgba(0,0,0,64);
|
||||
background: qlineargradient(spread:reflect, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #49515b, stop:0.3 #5b6571, stop:1 #6b7581 );
|
||||
color: white;
|
||||
border: 1px solid rgba(0,0,0,128);
|
||||
padding: 2px 0px 0px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
trackLabelButton:checked:hover {
|
||||
background-color: #7b838d;
|
||||
color: white;
|
||||
border: 1px solid black;
|
||||
font-weight: bold;
|
||||
background-color: qlineargradient(spread:reflect, x1:0, y1:0, x2:0, y2:0.5, stop:0 #5b6571, stop:0.75 #7b838d, stop:1 #7b838d );
|
||||
}
|
||||
|
||||
trackLabelButton:checked:pressed {
|
||||
background: qlineargradient(spread:reflect, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #49515b, stop:0.5 #5b6571, stop:1 #6b7581 );
|
||||
color: white;
|
||||
border: 1px solid black;
|
||||
font-weight: bold;
|
||||
background: qlineargradient(spread:reflect, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #49515b, stop:0.3 #5b6571, stop:1 #6b7581 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
SideBar {
|
||||
background: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop: 0 #98a2a7, stop: 1.0 #5b646f);
|
||||
}
|
||||
@@ -311,11 +363,11 @@ sf2InstrumentView knob {
|
||||
}
|
||||
|
||||
opl2instrumentView knob {
|
||||
color: rgb(128,128,128);
|
||||
qproperty-outerColor: rgb(255,255,255);
|
||||
qproperty-innerRadius: 2;
|
||||
qproperty-outerRadius: 9;
|
||||
qproperty-lineWidth: 2;
|
||||
color: rgb(128,128,128);
|
||||
qproperty-outerColor: rgb(255,255,255);
|
||||
qproperty-innerRadius: 2;
|
||||
qproperty-outerRadius: 9;
|
||||
qproperty-lineWidth: 2;
|
||||
}
|
||||
|
||||
/* palette information - each colour definition must be on a single line, and the line must begin with "palette:", with no leading whitespace
|
||||
@@ -329,7 +381,7 @@ palette:button {color: #c9c9c9}
|
||||
palette:shadow {color: #000000}
|
||||
palette:buttontext {color: #000000}
|
||||
palette:brighttext {color: #4afd85}
|
||||
palette:highlight {color: #303030}
|
||||
palette:highlight {color: #202020}
|
||||
palette:highlightedtext {color: #ffffff}
|
||||
|
||||
/* Notes:
|
||||
|
||||
BIN
data/themes/default/trackop.png
Normal file
|
After Width: | Height: | Size: 746 B |
BIN
data/themes/default/trackop_c.png
Normal file
|
After Width: | Height: | Size: 787 B |
BIN
data/themes/default/trackop_h.png
Normal file
|
After Width: | Height: | Size: 746 B |
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* AudioDevice.h - base-class for audio-devices, used by LMMS-mixer
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -130,11 +130,11 @@ protected:
|
||||
|
||||
// convert a given audio-buffer to a buffer in signed 16-bit samples
|
||||
// returns num of bytes in outbuf
|
||||
Uint32 convertToS16( const surroundSampleFrame * _ab,
|
||||
const fpp_t _frames,
|
||||
const float _master_gain,
|
||||
int_sample_t * _output_buffer,
|
||||
const bool _convert_endian = FALSE );
|
||||
int convertToS16( const surroundSampleFrame * _ab,
|
||||
const fpp_t _frames,
|
||||
const float _master_gain,
|
||||
int_sample_t * _output_buffer,
|
||||
const bool _convert_endian = false );
|
||||
|
||||
// clear given signed-int-16-buffer
|
||||
void clearS16Buffer( int_sample_t * _outbuf,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* AudioDummy.h - dummy audio-device
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -95,19 +95,14 @@ private:
|
||||
while( true )
|
||||
{
|
||||
timer.reset();
|
||||
const surroundSampleFrame * b =
|
||||
mixer()->nextBuffer();
|
||||
const surroundSampleFrame* b = mixer()->nextBuffer();
|
||||
if( !b )
|
||||
{
|
||||
break;
|
||||
}
|
||||
delete[] b;
|
||||
|
||||
const Sint32 microseconds = static_cast<Sint32>(
|
||||
mixer()->framesPerPeriod() *
|
||||
1000000.0f /
|
||||
mixer()->processingSampleRate() -
|
||||
timer.elapsed() );
|
||||
const int microseconds = static_cast<int>( mixer()->framesPerPeriod() * 1000000.0f / mixer()->processingSampleRate() - timer.elapsed() );
|
||||
if( microseconds > 0 )
|
||||
{
|
||||
usleep( microseconds );
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* AudioFileDevice.h - base-class for audio-device-classes which write
|
||||
* their output into a file
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
Sint32 writeData( const void * _data, Sint32 _len );
|
||||
int writeData( const void* data, int len );
|
||||
|
||||
inline bool useVBR() const
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* AudioFileOgg.h - Audio-device which encodes wave-stream and writes it
|
||||
* into an OGG-file. This is used for song-export.
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -75,7 +75,7 @@ private:
|
||||
|
||||
bool startEncoding();
|
||||
void finishEncoding();
|
||||
inline Sint32 writePage();
|
||||
inline int writePage();
|
||||
|
||||
|
||||
bool m_ok;
|
||||
@@ -86,7 +86,7 @@ private:
|
||||
bitrate_t m_minBitrate;
|
||||
bitrate_t m_maxBitrate;
|
||||
|
||||
Uint32 m_serialNo;
|
||||
uint32_t m_serialNo;
|
||||
|
||||
vorbis_comment * m_comments;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* AutomatableModel.h - declaration of class AutomatableModel
|
||||
*
|
||||
* Copyright (c) 2007-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2007-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -39,9 +39,9 @@
|
||||
return (type) modelname->value(); \
|
||||
} \
|
||||
public slots: \
|
||||
inline void setfunc( const type _val ) \
|
||||
inline void setfunc( const type val ) \
|
||||
{ \
|
||||
modelname->setValue( _val ); \
|
||||
modelname->setValue( val ); \
|
||||
}
|
||||
|
||||
#define mapPropertyFromModel(type,getfunc,setfunc,modelname) \
|
||||
@@ -51,9 +51,9 @@
|
||||
return (type) modelname.value(); \
|
||||
} \
|
||||
public slots: \
|
||||
inline void setfunc( const type _val ) \
|
||||
inline void setfunc( const type val ) \
|
||||
{ \
|
||||
modelname.setValue( (float) _val ); \
|
||||
modelname.setValue( (float) val ); \
|
||||
}
|
||||
|
||||
|
||||
@@ -74,60 +74,59 @@ public:
|
||||
Bool
|
||||
} ;
|
||||
|
||||
AutomatableModel( DataType _type,
|
||||
const float _val = 0,
|
||||
const float _min = 0,
|
||||
const float _max = 0,
|
||||
const float _step = 0,
|
||||
::Model * _parent = NULL,
|
||||
const QString & _display_name = QString(),
|
||||
bool _default_constructed = false );
|
||||
AutomatableModel( DataType type,
|
||||
const float val = 0,
|
||||
const float min = 0,
|
||||
const float max = 0,
|
||||
const float step = 0,
|
||||
Model* parent = NULL,
|
||||
const QString& display_name = QString(),
|
||||
bool default_constructed = false );
|
||||
|
||||
virtual ~AutomatableModel();
|
||||
|
||||
|
||||
static inline float copiedValue()
|
||||
static float copiedValue()
|
||||
{
|
||||
return __copiedValue;
|
||||
return s_copiedValue;
|
||||
}
|
||||
|
||||
bool isAutomated() const;
|
||||
|
||||
inline ControllerConnection * getControllerConnection() const
|
||||
inline ControllerConnection* controllerConnection() const
|
||||
{
|
||||
return m_controllerConnection;
|
||||
}
|
||||
|
||||
|
||||
void setControllerConnection( ControllerConnection * _c );
|
||||
void setControllerConnection( ControllerConnection* c );
|
||||
|
||||
|
||||
template<class T>
|
||||
static inline T castValue( const float _v )
|
||||
static inline T castValue( const float v )
|
||||
{
|
||||
return (T)( _v );
|
||||
return (T)( v );
|
||||
}
|
||||
|
||||
template<bool>
|
||||
static inline bool castValue( const float _v )
|
||||
static inline bool castValue( const float v )
|
||||
{
|
||||
return ( qRound( _v ) != 0 );
|
||||
return ( qRound( v ) != 0 );
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
inline T value( int _frameOffset = 0 ) const
|
||||
inline T value( int frameOffset = 0 ) const
|
||||
{
|
||||
if( unlikely( m_hasLinkedModels ||
|
||||
m_controllerConnection != NULL ) )
|
||||
if( unlikely( m_hasLinkedModels || m_controllerConnection != NULL ) )
|
||||
{
|
||||
return castValue<T>( controllerValue( _frameOffset ) );
|
||||
return castValue<T>( controllerValue( frameOffset ) );
|
||||
}
|
||||
|
||||
return castValue<T>( m_value );
|
||||
}
|
||||
|
||||
float controllerValue( int _frameOffset ) const;
|
||||
float controllerValue( int frameOffset ) const;
|
||||
|
||||
|
||||
template<class T>
|
||||
@@ -136,6 +135,11 @@ public:
|
||||
return castValue<T>( m_initValue );
|
||||
}
|
||||
|
||||
bool isAtInitValue() const
|
||||
{
|
||||
return m_value == m_initValue;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline T minValue() const
|
||||
{
|
||||
@@ -155,14 +159,14 @@ public:
|
||||
}
|
||||
|
||||
|
||||
void setInitValue( const float _value );
|
||||
void setInitValue( const float value );
|
||||
|
||||
void setAutomatedValue( const float _value );
|
||||
void setValue( const float _value );
|
||||
void setAutomatedValue( const float value );
|
||||
void setValue( const float value );
|
||||
|
||||
inline void incValue( int _steps )
|
||||
inline void incValue( int steps )
|
||||
{
|
||||
setValue( m_value + _steps * m_step );
|
||||
setValue( m_value + steps * m_step );
|
||||
}
|
||||
|
||||
inline float range() const
|
||||
@@ -170,24 +174,19 @@ public:
|
||||
return m_range;
|
||||
}
|
||||
|
||||
void setRange( const float _min, const float _max,
|
||||
const float _step = 1 );
|
||||
void setRange( const float min, const float max, const float step = 1 );
|
||||
|
||||
void setStep( const float _step );
|
||||
void setStep( const float step );
|
||||
|
||||
static void linkModels( AutomatableModel * _m1,
|
||||
AutomatableModel * _m2 );
|
||||
static void unlinkModels( AutomatableModel * _m1,
|
||||
AutomatableModel * _m2 );
|
||||
static void linkModels( AutomatableModel* m1, AutomatableModel* m2 );
|
||||
static void unlinkModels( AutomatableModel* m1, AutomatableModel* m2 );
|
||||
|
||||
void unlinkAllModels();
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this,
|
||||
const QString & _name = QString( "value" ) );
|
||||
virtual void saveSettings( QDomDocument& doc, QDomElement& element,
|
||||
const QString& name = QString( "value" ) );
|
||||
|
||||
virtual void loadSettings( const QDomElement & _this,
|
||||
const QString & _name = QString( "value" ) );
|
||||
virtual void loadSettings( const QDomElement& element, const QString& name = QString( "value" ) );
|
||||
|
||||
virtual QString nodeName() const
|
||||
{
|
||||
@@ -199,13 +198,13 @@ public:
|
||||
void addJournalEntryFromOldToCurVal();
|
||||
|
||||
|
||||
QString displayValue( const float _val ) const
|
||||
QString displayValue( const float val ) const
|
||||
{
|
||||
switch( m_dataType )
|
||||
{
|
||||
case Float: return QString::number( castValue<float>( _val ) );
|
||||
case Integer: return QString::number( castValue<int>( _val ) );
|
||||
case Bool: return QString::number( castValue<bool>( _val ) );
|
||||
case Float: return QString::number( castValue<float>( val ) );
|
||||
case Integer: return QString::number( castValue<int>( val ) );
|
||||
case Bool: return QString::number( castValue<bool>( val ) );
|
||||
}
|
||||
return "0";
|
||||
}
|
||||
@@ -224,15 +223,15 @@ public slots:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void redoStep( JournalEntry & _je );
|
||||
virtual void undoStep( JournalEntry & _je );
|
||||
virtual void redoStep( JournalEntry& je );
|
||||
virtual void undoStep( JournalEntry& je );
|
||||
|
||||
float fittedValue( float _value ) const;
|
||||
float fittedValue( float value ) const;
|
||||
|
||||
|
||||
private:
|
||||
void linkModel( AutomatableModel * _model );
|
||||
void unlinkModel( AutomatableModel * _model );
|
||||
void linkModel( AutomatableModel* model );
|
||||
void unlinkModel( AutomatableModel* model );
|
||||
|
||||
|
||||
DataType m_dataType;
|
||||
@@ -253,15 +252,15 @@ private:
|
||||
bool m_hasLinkedModels;
|
||||
|
||||
|
||||
ControllerConnection * m_controllerConnection;
|
||||
ControllerConnection* m_controllerConnection;
|
||||
|
||||
|
||||
static float __copiedValue;
|
||||
static float s_copiedValue;
|
||||
|
||||
|
||||
signals:
|
||||
void initValueChanged( float _val );
|
||||
void destroyed( jo_id_t _id );
|
||||
void initValueChanged( float val );
|
||||
void destroyed( jo_id_t id );
|
||||
|
||||
} ;
|
||||
|
||||
@@ -270,9 +269,9 @@ signals:
|
||||
|
||||
|
||||
#define defaultTypedMethods(type) \
|
||||
inline type value( int _frameOffset = 0 ) const \
|
||||
inline type value( int frameOffset = 0 ) const \
|
||||
{ \
|
||||
return AutomatableModel::value<type>( _frameOffset ); \
|
||||
return AutomatableModel::value<type>( frameOffset ); \
|
||||
} \
|
||||
\
|
||||
inline type initValue() const \
|
||||
@@ -296,12 +295,11 @@ signals:
|
||||
class FloatModel : public AutomatableModel
|
||||
{
|
||||
public:
|
||||
FloatModel( float _val = 0, float _min = 0, float _max = 0,
|
||||
float _step = 0, ::Model * _parent = NULL,
|
||||
const QString & _display_name = QString(),
|
||||
bool _default_constructed = false ) :
|
||||
AutomatableModel( Float, _val, _min, _max, _step,
|
||||
_parent, _display_name, _default_constructed )
|
||||
FloatModel( float val = 0, float min = 0, float max = 0, float step = 0,
|
||||
Model * parent = NULL,
|
||||
const QString& displayName = QString(),
|
||||
bool defaultConstructed = false ) :
|
||||
AutomatableModel( Float, val, min, max, step, parent, displayName, defaultConstructed )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -313,12 +311,11 @@ public:
|
||||
class IntModel : public AutomatableModel
|
||||
{
|
||||
public:
|
||||
IntModel( int _val = 0, int _min = 0, int _max = 0,
|
||||
::Model * _parent = NULL,
|
||||
const QString & _display_name = QString(),
|
||||
bool _default_constructed = false ) :
|
||||
AutomatableModel( Integer, _val, _min, _max, 1,
|
||||
_parent, _display_name, _default_constructed )
|
||||
IntModel( int val = 0, int min = 0, int max = 0,
|
||||
Model* parent = NULL,
|
||||
const QString& displayName = QString(),
|
||||
bool defaultConstructed = false ) :
|
||||
AutomatableModel( Integer, val, min, max, 1, parent, displayName, defaultConstructed )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -330,11 +327,11 @@ public:
|
||||
class BoolModel : public AutomatableModel
|
||||
{
|
||||
public:
|
||||
BoolModel( const bool _val = false, ::Model * _parent = NULL,
|
||||
const QString & _display_name = QString(),
|
||||
bool _default_constructed = false ) :
|
||||
AutomatableModel( Bool, _val, false, true, 1,
|
||||
_parent, _display_name, _default_constructed )
|
||||
BoolModel( const bool val = false,
|
||||
Model* parent = NULL,
|
||||
const QString& displayName = QString(),
|
||||
bool defaultConstructed = false ) :
|
||||
AutomatableModel( Bool, val, false, true, 1, parent, displayName, defaultConstructed )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -37,8 +37,7 @@ public:
|
||||
virtual ~AutomationTrack();
|
||||
|
||||
virtual bool play( const midiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 );
|
||||
|
||||
virtual QString nodeName() const
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@ private:
|
||||
QScrollArea * m_scrollArea;
|
||||
QPushButton * m_addButton;
|
||||
|
||||
Uint32 m_lastY;
|
||||
int m_lastY;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Effect.h - base class for effects
|
||||
*
|
||||
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -101,11 +101,8 @@ public:
|
||||
|
||||
inline f_cnt_t timeout() const
|
||||
{
|
||||
const float samples =
|
||||
engine::mixer()->processingSampleRate() *
|
||||
m_autoQuitModel.value() / 1000.0f;
|
||||
return 1 + ( static_cast<Uint32>( samples ) /
|
||||
engine::mixer()->framesPerPeriod() );
|
||||
const float samples = engine::mixer()->processingSampleRate() * m_autoQuitModel.value() / 1000.0f;
|
||||
return 1 + ( static_cast<int>( samples ) / engine::mixer()->framesPerPeriod() );
|
||||
}
|
||||
|
||||
inline float wetLevel() const
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* effect_rack_view.h - view for effectChain-model
|
||||
*
|
||||
* Copyright (c) 2006-2007 Danny McRae <khjklujn@netscape.net>
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -43,15 +43,15 @@ class EffectRackView : public QWidget, public ModelView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
EffectRackView( EffectChain * _model, QWidget * _parent = NULL );
|
||||
EffectRackView( EffectChain* model, QWidget* parent = NULL );
|
||||
virtual ~EffectRackView();
|
||||
|
||||
|
||||
public slots:
|
||||
void clearViews();
|
||||
void moveUp( EffectView * _view );
|
||||
void moveDown( EffectView * _view );
|
||||
void deletePlugin( EffectView * _view );
|
||||
void moveUp( EffectView* view );
|
||||
void moveDown( EffectView* view );
|
||||
void deletePlugin( EffectView* view );
|
||||
|
||||
|
||||
private slots:
|
||||
@@ -62,12 +62,12 @@ private slots:
|
||||
private:
|
||||
virtual void modelChanged();
|
||||
|
||||
inline EffectChain * fxChain()
|
||||
inline EffectChain* fxChain()
|
||||
{
|
||||
return castModel<EffectChain>();
|
||||
}
|
||||
|
||||
inline const EffectChain * fxChain() const
|
||||
inline const EffectChain* fxChain() const
|
||||
{
|
||||
return castModel<EffectChain>();
|
||||
}
|
||||
@@ -75,11 +75,10 @@ private:
|
||||
|
||||
QVector<EffectView *> m_effectViews;
|
||||
|
||||
QVBoxLayout * m_mainLayout;
|
||||
groupBox * m_effectsGroupBox;
|
||||
QScrollArea * m_scrollArea;
|
||||
groupBox* m_effectsGroupBox;
|
||||
QScrollArea* m_scrollArea;
|
||||
|
||||
Uint32 m_lastY;
|
||||
int m_lastY;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -49,10 +49,24 @@ public:
|
||||
|
||||
virtual float defaultValue() const = 0;
|
||||
|
||||
inline bool hasAutomation() const
|
||||
bool hasAutomation() const
|
||||
{
|
||||
return m_autoPattern != NULL &&
|
||||
m_autoPattern->getTimeMap().isEmpty() == false;
|
||||
if( m_autoPattern != NULL && m_autoPattern->getTimeMap().isEmpty() == false )
|
||||
{
|
||||
// prevent saving inline automation if there's just one value which equals value
|
||||
// of model which is going to be saved anyways
|
||||
if( isAtInitValue() &&
|
||||
m_autoPattern->getTimeMap().size() == 1 &&
|
||||
m_autoPattern->getTimeMap().keys().first() == 0 &&
|
||||
m_autoPattern->getTimeMap().values().first() == value() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
AutomationPattern * automationPattern()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* InstrumentFunctions.h - models for instrument-functions-tab
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
static const int MAX_CHORD_POLYPHONY = 10;
|
||||
|
||||
private:
|
||||
typedef Sint8 ChordSemiTones [MAX_CHORD_POLYPHONY];
|
||||
typedef int8_t ChordSemiTones [MAX_CHORD_POLYPHONY];
|
||||
|
||||
public:
|
||||
ChordCreator( Model * _parent );
|
||||
@@ -90,9 +90,9 @@ public:
|
||||
return size() == 0;
|
||||
}
|
||||
|
||||
bool hasSemiTone( Sint8 semi_tone ) const;
|
||||
bool hasSemiTone( int8_t semiTone ) const;
|
||||
|
||||
Sint8 last() const
|
||||
int8_t last() const
|
||||
{
|
||||
return m_semiTones[size() - 1];
|
||||
}
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
return m_name;
|
||||
}
|
||||
|
||||
Sint8 operator [] ( int n ) const
|
||||
int8_t operator [] ( int n ) const
|
||||
{
|
||||
return m_semiTones[n];
|
||||
}
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
#ifndef _INSTRUMENT_TRACK_H
|
||||
#define _INSTRUMENT_TRACK_H
|
||||
|
||||
#include <QtGui/QPushButton>
|
||||
|
||||
#include "AudioPort.h"
|
||||
#include "InstrumentFunctions.h"
|
||||
#include "InstrumentSoundShaping.h"
|
||||
@@ -120,8 +118,7 @@ public:
|
||||
|
||||
// play everything in given frame-range - creates note-play-handles
|
||||
virtual bool play( const midiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 );
|
||||
// create new view for me
|
||||
virtual trackView * createView( TrackContainerView* tcv );
|
||||
|
||||
@@ -188,6 +185,11 @@ public:
|
||||
return &m_panningModel;
|
||||
}
|
||||
|
||||
IntModel* pitchRangeModel()
|
||||
{
|
||||
return &m_pitchRangeModel;
|
||||
}
|
||||
|
||||
IntModel * effectChannelModel()
|
||||
{
|
||||
return &m_effectChannelModel;
|
||||
@@ -212,6 +214,7 @@ protected:
|
||||
protected slots:
|
||||
void updateBaseNote();
|
||||
void updatePitch();
|
||||
void updatePitchRange();
|
||||
|
||||
|
||||
private:
|
||||
@@ -229,6 +232,7 @@ private:
|
||||
FloatModel m_volumeModel;
|
||||
FloatModel m_panningModel;
|
||||
FloatModel m_pitchModel;
|
||||
IntModel m_pitchRangeModel;
|
||||
IntModel m_effectChannelModel;
|
||||
|
||||
|
||||
@@ -386,13 +390,12 @@ private:
|
||||
InstrumentTrackView * m_itv;
|
||||
|
||||
// widgets on the top of an instrument-track-window
|
||||
tabWidget * m_generalSettingsWidget;
|
||||
QLineEdit * m_nameLineEdit;
|
||||
knob * m_volumeKnob;
|
||||
knob * m_panningKnob;
|
||||
knob * m_pitchKnob;
|
||||
lcdSpinBox* m_pitchRangeSpinBox;
|
||||
lcdSpinBox * m_effectChannelNumber;
|
||||
QPushButton * m_saveSettingsBtn;
|
||||
|
||||
|
||||
// tab-widget with all children
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* LadspaBase.h - basic declarations concerning LADSPA
|
||||
*
|
||||
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -55,8 +55,8 @@ typedef struct PortDescription
|
||||
{
|
||||
QString name;
|
||||
ch_cnt_t proc;
|
||||
Uint16 port_id;
|
||||
Uint16 control_id;
|
||||
uint16_t port_id;
|
||||
uint16_t control_id;
|
||||
buffer_rate_t rate;
|
||||
buffer_data_t data_type;
|
||||
float scale;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* LadspaControl.h - model for controlling a LADSPA port
|
||||
*
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
@@ -72,8 +72,7 @@ public:
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent,
|
||||
const QString & _name );
|
||||
virtual void loadSettings( const QDomElement & _this,
|
||||
const QString & _name );
|
||||
virtual void loadSettings( const QDomElement & _this, const QString & _name );
|
||||
inline virtual QString nodeName() const
|
||||
{
|
||||
return "port";
|
||||
@@ -81,8 +80,8 @@ public:
|
||||
|
||||
|
||||
signals:
|
||||
void changed( Uint16 _port, LADSPA_Data _value );
|
||||
void linkChanged( Uint16 _port, bool _state );
|
||||
void changed( int _port, LADSPA_Data _value );
|
||||
void linkChanged( int _port, bool _state );
|
||||
|
||||
|
||||
protected slots:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* MidiAlsaRaw.h - midi-client for RawMIDI via ALSA
|
||||
* MidiAlsaRaw.h - MIDI client for RawMIDI via ALSA
|
||||
*
|
||||
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void sendByte( const Uint8 _c );
|
||||
virtual void sendByte( const unsigned char c );
|
||||
virtual void run();
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* MidiClient.h - base-class for MIDI clients like ALSA-sequencer-client
|
||||
*
|
||||
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -140,7 +140,7 @@ protected:
|
||||
|
||||
|
||||
|
||||
const Uint8 RAW_MIDI_PARSE_BUF_SIZE = 16;
|
||||
const int RAW_MIDI_PARSE_BUF_SIZE = 16;
|
||||
|
||||
|
||||
class MidiClientRaw : public MidiClient
|
||||
@@ -158,37 +158,35 @@ public:
|
||||
|
||||
protected:
|
||||
// generic raw-MIDI-parser which generates appropriate MIDI-events
|
||||
void parseData( const Uint8 _c );
|
||||
void parseData( const unsigned char c );
|
||||
|
||||
// to be implemented by actual client-implementation
|
||||
virtual void sendByte( const Uint8 _c ) = 0;
|
||||
virtual void sendByte( const unsigned char c ) = 0;
|
||||
|
||||
|
||||
private:
|
||||
// this does MIDI-event-process
|
||||
void processParsedEvent();
|
||||
virtual void processOutEvent( const midiEvent & _me,
|
||||
const midiTime & _time,
|
||||
const MidiPort * _port );
|
||||
virtual void processOutEvent( const midiEvent& event, const midiTime& time, const MidiPort* port );
|
||||
|
||||
// small helper function returning length of a certain event - this
|
||||
// is necessary for parsing raw-MIDI-data
|
||||
static Uint8 eventLength( const Uint8 _event );
|
||||
static int eventLength( const unsigned char event );
|
||||
|
||||
|
||||
// data being used for parsing
|
||||
struct midiParserData
|
||||
{
|
||||
Uint8 m_status; // identifies the type of event, that
|
||||
uint8_t m_status; // identifies the type of event, that
|
||||
// is currently received ('Noteon',
|
||||
// 'Pitch Bend' etc).
|
||||
Uint8 m_channel; // The channel of the event that is
|
||||
uint8_t m_channel; // The channel of the event that is
|
||||
// received (in case of a channel event)
|
||||
Uint32 m_bytes; // How many bytes have been read for
|
||||
uint32_t m_bytes; // How many bytes have been read for
|
||||
// the current event?
|
||||
Uint32 m_bytesTotal; // How many bytes does the current
|
||||
uint32_t m_bytesTotal; // How many bytes does the current
|
||||
// event type include?
|
||||
Uint32 m_buffer[RAW_MIDI_PARSE_BUF_SIZE];
|
||||
uint32_t m_buffer[RAW_MIDI_PARSE_BUF_SIZE];
|
||||
// buffer for incoming data
|
||||
midiEvent m_midiEvent; // midi-event
|
||||
} m_midiParseData;
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void sendByte( const Uint8 )
|
||||
virtual void sendByte( const unsigned char )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* MidiOss.h - OSS raw MIDI client
|
||||
*
|
||||
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void sendByte( const Uint8 _c );
|
||||
virtual void sendByte( const unsigned char c );
|
||||
virtual void run();
|
||||
|
||||
|
||||
|
||||
@@ -122,8 +122,7 @@ public:
|
||||
virtual ~SampleTrack();
|
||||
|
||||
virtual bool play( const midiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 );
|
||||
virtual trackView * createView( TrackContainerView* tcv );
|
||||
virtual trackContentObject * createTCO( const midiTime & _pos );
|
||||
|
||||
|
||||
@@ -56,6 +56,8 @@ public slots:
|
||||
void stop();
|
||||
void updatePosition();
|
||||
void addAutomationTrack();
|
||||
void addSteps();
|
||||
void removeSteps();
|
||||
|
||||
private:
|
||||
virtual void keyPressEvent( QKeyEvent * _ke );
|
||||
|
||||
@@ -109,10 +109,8 @@ public:
|
||||
bbTrack( TrackContainer* tc );
|
||||
virtual ~bbTrack();
|
||||
|
||||
virtual bool play( const midiTime & _start,
|
||||
const fpp_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
virtual bool play( const midiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 );
|
||||
virtual trackView * createView( TrackContainerView* tcv );
|
||||
virtual trackContentObject * createTCO( const midiTime & _pos );
|
||||
|
||||
|
||||
@@ -39,8 +39,7 @@ public:
|
||||
virtual ~bbTrackContainer();
|
||||
|
||||
virtual bool play( midiTime _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 );
|
||||
|
||||
virtual void updateAfterTrackAdd();
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* cpuload_widget.h - widget for displaying CPU-load (partly based on
|
||||
* Hydrogen's CPU-load-widget)
|
||||
*
|
||||
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -51,7 +51,7 @@ protected slots:
|
||||
|
||||
|
||||
private:
|
||||
Uint8 m_currentLoad;
|
||||
int m_currentLoad;
|
||||
|
||||
QPixmap m_temp;
|
||||
QPixmap m_background;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* endian_handling.h - handle endianess
|
||||
*
|
||||
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -22,7 +22,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ENDIAN_HANDLING_H
|
||||
#define _ENDIAN_HANDLING_H
|
||||
|
||||
@@ -37,18 +36,18 @@ inline bool isLittleEndian()
|
||||
}
|
||||
|
||||
|
||||
inline Sint16 swap16IfBE( Sint16 _i )
|
||||
inline int16_t swap16IfBE( int16_t i )
|
||||
{
|
||||
return( isLittleEndian() ? _i : ( ( _i & 0xFF ) << 8) | ( ( _i >> 8 ) & 0xFF ) );
|
||||
return( isLittleEndian() ? i : ( ( i & 0xFF ) << 8) | ( ( i >> 8 ) & 0xFF ) );
|
||||
}
|
||||
|
||||
|
||||
inline Sint32 swap32IfBE( Sint32 _i )
|
||||
inline int32_t swap32IfBE( int32_t i )
|
||||
{
|
||||
return( isLittleEndian() ? _i : ( ( _i & 0xff000000 ) >> 24 ) |
|
||||
( ( _i & 0x00ff0000 ) >> 8 ) |
|
||||
( ( _i & 0x0000ff00 ) << 8 ) |
|
||||
( ( _i & 0x000000ff ) << 24 ) );
|
||||
return( isLittleEndian() ? i : ( ( i & 0xff000000 ) >> 24 ) |
|
||||
( ( i & 0x00ff0000 ) >> 8 ) |
|
||||
( ( i & 0x0000ff00 ) << 8 ) |
|
||||
( ( i & 0x000000ff ) << 24 ) );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -73,10 +73,10 @@ enum ladspaPluginType
|
||||
typedef struct ladspaManagerStorage
|
||||
{
|
||||
LADSPA_Descriptor_Function descriptorFunction;
|
||||
Uint32 index;
|
||||
uint32_t index;
|
||||
ladspaPluginType type;
|
||||
Uint16 inputChannels;
|
||||
Uint16 outputChannels;
|
||||
uint16_t inputChannels;
|
||||
uint16_t outputChannels;
|
||||
} ladspaManagerDescription;
|
||||
|
||||
|
||||
@@ -123,20 +123,20 @@ public:
|
||||
|
||||
/* This indicates the number of ports (input AND output) present on
|
||||
the plugin. */
|
||||
Uint32 getPortCount( const ladspa_key_t & _plugin );
|
||||
uint32_t getPortCount( const ladspa_key_t & _plugin );
|
||||
|
||||
|
||||
/* Indicates that the port is an input. */
|
||||
bool isPortInput( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
bool isPortInput( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Indicates that the port is an output. */
|
||||
bool isPortOutput( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
bool isPortOutput( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Indicates that the port is an audio. */
|
||||
bool isPortAudio( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
bool isPortAudio( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Indicates that the port is an control. */
|
||||
bool isPortControl( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
bool isPortControl( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Indicates that any bounds specified should be interpreted as
|
||||
multiples of the sample rate. For instance, a frequency range from
|
||||
@@ -145,42 +145,42 @@ public:
|
||||
Hosts that support bounds at all must support this hint to retain
|
||||
meaning. */
|
||||
bool areHintsSampleRateDependent( const ladspa_key_t & _plugin,
|
||||
Uint32 _port );
|
||||
uint32_t _port );
|
||||
|
||||
/* Returns the lower boundary value for the given port. If
|
||||
no lower bound is provided by the plug-in, returns -999e-99. When
|
||||
areHintsSampleRateDependent() is also true then this value should be
|
||||
multiplied by the relevant sample rate. */
|
||||
float getLowerBound( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
float getLowerBound( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Returns the upper boundary value for the given port. If
|
||||
no upper bound is provided by the plug-in, returns -999e-99. When
|
||||
areHintsSampleRateDependent() is also true then this value should be
|
||||
multiplied by the relevant sample rate. */
|
||||
float getUpperBound( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
float getUpperBound( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Indicates whether the given port should be considered 0 or 1
|
||||
boolean switch. */
|
||||
bool isPortToggled( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
bool isPortToggled( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Retrieves any default setting hints offered by the plug-in for
|
||||
the given port. */
|
||||
float getDefaultSetting( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
float getDefaultSetting( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Indicates that it is likely that the user will find it more
|
||||
intuitive to view values using a logarithmic scale. This is
|
||||
particularly useful for frequencies and gains. */
|
||||
bool isLogarithmic( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
bool isLogarithmic( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Indicates that a user interface would probably wish to provide a
|
||||
stepped control taking only integer values. Any bounds set should be
|
||||
slightly wider than the actual integer range required to avoid floating
|
||||
point rounding errors. For instance, the integer set {0,1,2,3} might
|
||||
be described as [-0.1, 3.1]. */
|
||||
bool isInteger( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
bool isInteger( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Returns the name of the port. */
|
||||
QString getPortName( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
QString getPortName( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
|
||||
/* This may be used by the plugin developer to pass any custom
|
||||
@@ -206,7 +206,7 @@ public:
|
||||
|
||||
/* Returns a handle to an instantiation of the given plug-in. */
|
||||
LADSPA_Handle instantiate( const ladspa_key_t & _plugin,
|
||||
Uint32 _sample_rate );
|
||||
uint32_t _sample_rate );
|
||||
|
||||
/* This method calls a function pointer that connects a port on an
|
||||
instantiated plugin to a memory location at which a block of data
|
||||
@@ -227,7 +227,7 @@ public:
|
||||
run() or runAdding() is called. */
|
||||
bool connectPort( const ladspa_key_t & _plugin,
|
||||
LADSPA_Handle _instance,
|
||||
Uint32 _port,
|
||||
uint32_t _port,
|
||||
LADSPA_Data * _data_location );
|
||||
|
||||
/* This method calls a function pointer that initialises a plugin
|
||||
@@ -264,7 +264,7 @@ public:
|
||||
activate() has been called again. */
|
||||
bool run( const ladspa_key_t & _plugin,
|
||||
LADSPA_Handle _instance,
|
||||
Uint32 _sample_count );
|
||||
uint32_t _sample_count );
|
||||
|
||||
/* This method calls a function pointer that runs an instance of a
|
||||
plugin for a block. This has identical behaviour to run() except
|
||||
@@ -281,7 +281,7 @@ public:
|
||||
the function setRunAddingGain() must be provided also. */
|
||||
bool runAdding( const ladspa_key_t & _plugin,
|
||||
LADSPA_Handle _instance,
|
||||
Uint32 _sample_count );
|
||||
uint32_t _sample_count );
|
||||
|
||||
/* This method calls a function pointer that sets the output gain for
|
||||
use when runAdding() is called (see above). If this function is
|
||||
@@ -325,8 +325,8 @@ public:
|
||||
private:
|
||||
void addPlugins( LADSPA_Descriptor_Function _descriptor_func,
|
||||
const QString & _file );
|
||||
Uint16 getPluginInputs( const LADSPA_Descriptor * _descriptor );
|
||||
Uint16 getPluginOutputs( const LADSPA_Descriptor * _descriptor );
|
||||
uint16_t getPluginInputs( const LADSPA_Descriptor * _descriptor );
|
||||
uint16_t getPluginOutputs( const LADSPA_Descriptor * _descriptor );
|
||||
|
||||
typedef QMap<ladspa_key_t, ladspaManagerDescription *>
|
||||
ladspaManagerMapType;
|
||||
|
||||
@@ -46,6 +46,19 @@ public:
|
||||
update();
|
||||
}
|
||||
|
||||
/*! Sets an offset which is always added to value of model so we can
|
||||
display values in a user-friendly way if they internally start at 0 */
|
||||
void setDisplayOffset( int offset )
|
||||
{
|
||||
m_displayOffset = offset;
|
||||
}
|
||||
|
||||
/*! \brief Returns internal offset for displaying values */
|
||||
int displayOffset() const
|
||||
{
|
||||
return m_displayOffset;
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
virtual void update();
|
||||
@@ -60,6 +73,7 @@ protected:
|
||||
|
||||
private:
|
||||
QPoint m_origMousePos;
|
||||
int m_displayOffset;
|
||||
|
||||
|
||||
signals:
|
||||
|
||||
@@ -34,35 +34,26 @@
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
typedef unsigned char Uint8;
|
||||
typedef signed char Sint8;
|
||||
typedef unsigned short Uint16;
|
||||
typedef signed short Sint16;
|
||||
typedef unsigned int Uint32;
|
||||
typedef signed int Sint32;
|
||||
|
||||
|
||||
typedef Uint32 minute_t;
|
||||
typedef Sint8 second_t;
|
||||
typedef Sint32 tact_t;
|
||||
typedef Sint32 tick_t;
|
||||
typedef Uint8 volume_t;
|
||||
typedef Sint8 panning_t;
|
||||
typedef int32_t tact_t;
|
||||
typedef int32_t tick_t;
|
||||
typedef uint8_t volume_t;
|
||||
typedef int8_t panning_t;
|
||||
|
||||
|
||||
typedef float sample_t; // standard sample-type
|
||||
typedef Sint16 int_sample_t; // 16-bit-int-sample
|
||||
typedef int16_t int_sample_t; // 16-bit-int-sample
|
||||
|
||||
|
||||
typedef Uint32 sample_rate_t; // sample-rate
|
||||
typedef Sint16 fpp_t; // frames per period (0-16384)
|
||||
typedef Sint32 f_cnt_t; // standard frame-count
|
||||
typedef Uint8 ch_cnt_t; // channel-count (0-SURROUND_CHANNELS)
|
||||
typedef Uint16 bpm_t; // tempo (MIN_BPM to MAX_BPM)
|
||||
typedef Uint16 bitrate_t; // bitrate in kbps
|
||||
typedef Sint8 fx_ch_t; // FX-channel (0 to MAX_EFFECT_CHANNEL)
|
||||
typedef uint32_t sample_rate_t; // sample-rate
|
||||
typedef int16_t fpp_t; // frames per period (0-16384)
|
||||
typedef int32_t f_cnt_t; // standard frame-count
|
||||
typedef uint8_t ch_cnt_t; // channel-count (0-SURROUND_CHANNELS)
|
||||
typedef uint16_t bpm_t; // tempo (MIN_BPM to MAX_BPM)
|
||||
typedef uint16_t bitrate_t; // bitrate in kbps
|
||||
typedef uint16_t fx_ch_t; // FX-channel (0 to MAX_EFFECT_CHANNEL)
|
||||
|
||||
typedef Uint32 jo_id_t; // (unique) ID of a journalling object
|
||||
typedef uint32_t jo_id_t; // (unique) ID of a journalling object
|
||||
|
||||
// use for improved branch prediction
|
||||
#define likely(x) __builtin_expect((x),1)
|
||||
|
||||
@@ -124,9 +124,9 @@ const int MidiMinPanning = -128;
|
||||
struct midiEvent
|
||||
{
|
||||
midiEvent( MidiEventTypes _type = MidiActiveSensing,
|
||||
Sint8 _channel = 0,
|
||||
Sint16 _param1 = 0,
|
||||
Sint16 _param2 = 0,
|
||||
int8_t _channel = 0,
|
||||
int16_t _param1 = 0,
|
||||
int16_t _param2 = 0,
|
||||
const void * _sourcePort = NULL ) :
|
||||
m_type( _type ),
|
||||
m_metaEvent( MidiMetaInvalid ),
|
||||
@@ -172,12 +172,12 @@ struct midiEvent
|
||||
return m_channel;
|
||||
}
|
||||
|
||||
inline Sint16 key() const
|
||||
inline int16_t key() const
|
||||
{
|
||||
return m_data.m_param[0];
|
||||
}
|
||||
|
||||
inline Sint16 & key()
|
||||
inline int16_t & key()
|
||||
{
|
||||
return m_data.m_param[0];
|
||||
}
|
||||
@@ -192,17 +192,17 @@ struct midiEvent
|
||||
return m_data.m_param[1];
|
||||
}
|
||||
|
||||
inline Sint16 velocity() const
|
||||
inline int16_t velocity() const
|
||||
{
|
||||
return m_data.m_param[1];
|
||||
}
|
||||
|
||||
inline Sint16 & velocity()
|
||||
inline int16_t & velocity()
|
||||
{
|
||||
return m_data.m_param[1];
|
||||
}
|
||||
|
||||
inline Sint16 midiPanning() const
|
||||
inline int16_t midiPanning() const
|
||||
{
|
||||
return m_data.m_param[1];
|
||||
}
|
||||
@@ -237,12 +237,12 @@ struct midiEvent
|
||||
|
||||
MidiEventTypes m_type; // MIDI event type
|
||||
MidiMetaEvents m_metaEvent; // Meta event (mostly unused)
|
||||
Sint8 m_channel; // MIDI channel
|
||||
int8_t m_channel; // MIDI channel
|
||||
union
|
||||
{
|
||||
Sint16 m_param[2]; // first/second parameter (key/velocity)
|
||||
Uint8 m_bytes[4]; // raw bytes
|
||||
Sint32 m_sysExDataLen; // len of m_sysExData
|
||||
int16_t m_param[2]; // first/second parameter (key/velocity)
|
||||
uint8_t m_bytes[4]; // raw bytes
|
||||
int32_t m_sysExDataLen; // len of m_sysExData
|
||||
} m_data;
|
||||
|
||||
const char * m_sysExData;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* mmp.h - class for reading and writing multimedia-project-files
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2012-2013 Paul Giblock <p/at/pgiblock.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
@@ -104,10 +104,9 @@ private:
|
||||
} ;
|
||||
|
||||
|
||||
const Uint8 MMP_MAJOR_VERSION = 1;
|
||||
const Uint8 MMP_MINOR_VERSION = 0;
|
||||
const QString MMP_VERSION_STRING = QString::number( MMP_MAJOR_VERSION ) + "." +
|
||||
QString::number( MMP_MINOR_VERSION );
|
||||
const int MMP_MAJOR_VERSION = 1;
|
||||
const int MMP_MINOR_VERSION = 0;
|
||||
const QString MMP_VERSION_STRING = QString::number( MMP_MAJOR_VERSION ) + "." + QString::number( MMP_MINOR_VERSION );
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -233,7 +233,6 @@ private:
|
||||
|
||||
|
||||
private:
|
||||
DetuningHelper * m_detuning;
|
||||
float m_value;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -125,9 +125,6 @@ public:
|
||||
bool empty();
|
||||
|
||||
|
||||
void addSteps( int _n );
|
||||
void removeSteps( int _n );
|
||||
|
||||
virtual trackContentObjectView * createView( trackView * _tv );
|
||||
|
||||
|
||||
@@ -140,6 +137,8 @@ protected:
|
||||
|
||||
|
||||
protected slots:
|
||||
void addSteps();
|
||||
void removeSteps();
|
||||
void clear();
|
||||
void freeze();
|
||||
void unfreeze();
|
||||
@@ -164,6 +163,7 @@ private:
|
||||
|
||||
friend class patternView;
|
||||
friend class patternFreezeThread;
|
||||
friend class bbEditor;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -187,9 +187,6 @@ protected slots:
|
||||
void resetName();
|
||||
void changeName();
|
||||
|
||||
void addSteps( QAction * _item );
|
||||
void removeSteps( QAction * _item );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void constructContextMenu( QMenu * );
|
||||
|
||||
@@ -284,7 +284,7 @@ private:
|
||||
actions m_action;
|
||||
noteEditMode m_noteEditMode;
|
||||
|
||||
Uint32 m_selectStartTick;
|
||||
int m_selectStartTick;
|
||||
int m_selectedTick;
|
||||
int m_selectStartKey;
|
||||
int m_selectedKeys;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* track.h - declaration of classes concerning tracks -> necessary for all
|
||||
* track-like objects (beat/bassline, sample-track...)
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -64,8 +64,8 @@ const int TRACK_OP_WIDTH_COMPACT = 60;
|
||||
* Tracks can be resized by shift-dragging anywhere inside the track
|
||||
* display. This sets the minimum size in pixels for a track.
|
||||
*/
|
||||
const Uint16 MINIMAL_TRACK_HEIGHT = 8;
|
||||
const Uint16 DEFAULT_TRACK_HEIGHT = 32;
|
||||
const int MINIMAL_TRACK_HEIGHT = 8;
|
||||
const int DEFAULT_TRACK_HEIGHT = 32;
|
||||
|
||||
const int TCO_BORDER_WIDTH = 1;
|
||||
|
||||
@@ -74,6 +74,7 @@ class trackContentObject : public Model, public JournallingObject
|
||||
{
|
||||
Q_OBJECT
|
||||
mapPropertyFromModel(bool,isMuted,setMuted,m_mutedModel);
|
||||
mapPropertyFromModel(bool,isSolo,setSolo,m_soloModel);
|
||||
public:
|
||||
trackContentObject( track * _track );
|
||||
virtual ~trackContentObject();
|
||||
@@ -154,6 +155,7 @@ private:
|
||||
midiTime m_length;
|
||||
|
||||
BoolModel m_mutedModel;
|
||||
BoolModel m_soloModel;
|
||||
|
||||
|
||||
friend class trackContentObjectView;
|
||||
@@ -224,7 +226,7 @@ private:
|
||||
trackView * m_trackView;
|
||||
Actions m_action;
|
||||
bool m_autoResize;
|
||||
Sint16 m_initialMouseX;
|
||||
int m_initialMouseX;
|
||||
|
||||
textFloat * m_hint;
|
||||
|
||||
@@ -349,6 +351,7 @@ class EXPORT track : public Model, public JournallingObject
|
||||
{
|
||||
Q_OBJECT
|
||||
mapPropertyFromModel(bool,isMuted,setMuted,m_mutedModel);
|
||||
mapPropertyFromModel(bool,isSolo,setSolo,m_soloModel);
|
||||
public:
|
||||
typedef QVector<trackContentObject *> tcoVector;
|
||||
|
||||
@@ -380,8 +383,7 @@ public:
|
||||
}
|
||||
|
||||
virtual bool play( const midiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 ) = 0;
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 ) = 0;
|
||||
|
||||
|
||||
virtual trackView * createView( TrackContainerView * _view ) = 0;
|
||||
|
||||
@@ -186,21 +186,18 @@ void audioFileProcessor::loadFile( const QString & _file )
|
||||
|
||||
QString audioFileProcessor::nodeName( void ) const
|
||||
{
|
||||
return( audiofileprocessor_plugin_descriptor.name );
|
||||
return audiofileprocessor_plugin_descriptor.name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Uint32 audioFileProcessor::getBeatLen( notePlayHandle * _n ) const
|
||||
int audioFileProcessor::getBeatLen( notePlayHandle * _n ) const
|
||||
{
|
||||
const float freq_factor = BaseFreq / _n->frequency() *
|
||||
engine::mixer()->processingSampleRate() /
|
||||
engine::mixer()->baseSampleRate();
|
||||
engine::mixer()->processingSampleRate() / engine::mixer()->baseSampleRate();
|
||||
|
||||
return( static_cast<Uint32>( floorf( ( m_sampleBuffer.endFrame() -
|
||||
m_sampleBuffer.startFrame() ) *
|
||||
freq_factor ) ) );
|
||||
return static_cast<int>( floorf( ( m_sampleBuffer.endFrame() - m_sampleBuffer.startFrame() ) * freq_factor ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -208,7 +205,7 @@ Uint32 audioFileProcessor::getBeatLen( notePlayHandle * _n ) const
|
||||
|
||||
PluginView * audioFileProcessor::instantiateView( QWidget * _parent )
|
||||
{
|
||||
return( new AudioFileProcessorView( this, _parent ) );
|
||||
return new AudioFileProcessorView( this, _parent );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -56,11 +56,11 @@ public:
|
||||
|
||||
virtual QString nodeName() const;
|
||||
|
||||
virtual Uint32 getBeatLen( notePlayHandle * _n ) const;
|
||||
virtual int getBeatLen( notePlayHandle * _n ) const;
|
||||
|
||||
virtual f_cnt_t desiredReleaseFrames() const
|
||||
{
|
||||
return( 128 );
|
||||
return 128;
|
||||
}
|
||||
|
||||
virtual PluginView * instantiateView( QWidget * _parent );
|
||||
|
||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 12 KiB |
@@ -287,7 +287,7 @@ void bitInvader::playNote( notePlayHandle * _n,
|
||||
for( fpp_t frame = 0; frame < frames; ++frame )
|
||||
{
|
||||
const sample_t cur = ps->nextStringSample();
|
||||
for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
_working_buffer[frame][chnl] = cur;
|
||||
}
|
||||
|
||||
@@ -721,7 +721,7 @@ bool FlpImport::tryImport( TrackContainer* tc )
|
||||
// search for FLdt chunk
|
||||
while( 1 )
|
||||
{
|
||||
Sint32 id = readID();
|
||||
int32_t id = readID();
|
||||
const int len = read32LE();
|
||||
if( file().atEnd() )
|
||||
{
|
||||
@@ -769,7 +769,7 @@ bool FlpImport::tryImport( TrackContainer* tc )
|
||||
while( file().atEnd() == false )
|
||||
{
|
||||
FLP_Events ev = static_cast<FLP_Events>( readByte() );
|
||||
Uint32 data = readByte();
|
||||
uint32_t data = readByte();
|
||||
|
||||
if( ev >= FLP_Word && ev < FLP_Text )
|
||||
{
|
||||
@@ -786,7 +786,7 @@ bool FlpImport::tryImport( TrackContainer* tc )
|
||||
if( ev >= FLP_Text )
|
||||
{
|
||||
text_len = data & 0x7F;
|
||||
Uint8 shift = 0;
|
||||
uint8_t shift = 0;
|
||||
while( data & 0x80 )
|
||||
{
|
||||
data = readByte();
|
||||
@@ -1814,7 +1814,7 @@ void FlpImport::processPluginParams( FL_Channel * _ch )
|
||||
int ws = Oscillator::UserDefinedWave;
|
||||
for( int i = 0; i < 3; ++i )
|
||||
{
|
||||
const Sint32 * d = (const Sint32 *)
|
||||
const int32_t * d = (const int32_t *)
|
||||
( _ch->pluginSettings + i * 28 );
|
||||
QString is = QString::number( i );
|
||||
de.setAttribute( "vol" + is,
|
||||
|
||||
@@ -69,7 +69,7 @@ private:
|
||||
return( value );
|
||||
}
|
||||
|
||||
inline Sint32 read32LE()
|
||||
inline int32_t read32LE()
|
||||
{
|
||||
int value = readByte();
|
||||
value |= readByte() << 8;
|
||||
@@ -77,14 +77,14 @@ private:
|
||||
value |= readByte() << 24;
|
||||
return( value );
|
||||
}
|
||||
inline Sint32 read16LE()
|
||||
inline int32_t read16LE()
|
||||
{
|
||||
int value = readByte();
|
||||
value |= readByte() << 8;
|
||||
return( value );
|
||||
}
|
||||
|
||||
inline Sint32 readID()
|
||||
inline int32_t readID()
|
||||
{
|
||||
return( read32LE() );
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key )
|
||||
vlayout->setSpacing( 0 );
|
||||
vlayout->setMargin( 0 );
|
||||
|
||||
Uint16 pc = manager->getPortCount( _key );
|
||||
int pc = manager->getPortCount( _key );
|
||||
|
||||
QTableWidget * settings = new QTableWidget( pc, 7, this );
|
||||
|
||||
@@ -60,31 +60,23 @@ ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key )
|
||||
ports.append( tr( "SR Dependent" ) );
|
||||
settings->setHorizontalHeaderLabels( ports );
|
||||
|
||||
for( Uint16 row = 0; row < pc; row++ )
|
||||
for( int row = 0; row < pc; row++ )
|
||||
{
|
||||
for( Uint8 col = 0; col < 7; ++col )
|
||||
for( int col = 0; col < 7; ++col )
|
||||
{
|
||||
QTableWidgetItem * item = new QTableWidgetItem;
|
||||
item->setFlags( 0 );
|
||||
settings->setItem( row, col, item );
|
||||
}
|
||||
|
||||
Uint8 col = 0;
|
||||
settings->item( row, col++ )->setText( manager->getPortName(
|
||||
_key, row ) );
|
||||
int col = 0;
|
||||
settings->item( row, col++ )->setText( manager->getPortName( _key, row ) );
|
||||
|
||||
settings->item( row, col++ )->setText(
|
||||
manager->isPortAudio( _key, row ) ?
|
||||
tr( "Audio" ) : tr( "Control" ) );
|
||||
settings->item( row, col++ )->setText( manager->isPortAudio( _key, row ) ? tr( "Audio" ) : tr( "Control" ) );
|
||||
|
||||
settings->item( row, col++ )->setText(
|
||||
manager->isPortInput( _key, row ) ?
|
||||
tr( "Input" ) : tr( "Output" ) );
|
||||
settings->item( row, col++ )->setText( manager->isPortInput( _key, row ) ? tr( "Input" ) : tr( "Output" ) );
|
||||
|
||||
settings->item( row, col++ )->setText(
|
||||
manager->isPortToggled( _key, row ) ? tr( "Toggled" ) :
|
||||
manager->isInteger( _key, row ) ? tr( "Integer" ) :
|
||||
tr( "Float" ) );
|
||||
settings->item( row, col++ )->setText( manager->isPortToggled( _key, row ) ? tr( "Toggled" ) : manager->isInteger( _key, row ) ? tr( "Integer" ) : tr( "Float" ) );
|
||||
|
||||
float min = manager->getLowerBound( _key, row );
|
||||
float max = manager->getUpperBound( _key, row );
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* LadspaControls.cpp - model for LADSPA plugin controls
|
||||
*
|
||||
* Copyright (c) 2008-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -46,26 +46,20 @@ LadspaControls::LadspaControls( LadspaEffect * _eff ) :
|
||||
control_list_t p;
|
||||
|
||||
const bool linked_control = ( m_processors > 1 && proc == 0 );
|
||||
buffer_data_t last_port = NONE;
|
||||
|
||||
for( multi_proc_t::Iterator it = controls.begin();
|
||||
it != controls.end(); it++ )
|
||||
for( multi_proc_t::Iterator it = controls.begin(); it != controls.end(); it++ )
|
||||
{
|
||||
if( (*it)->proc == proc )
|
||||
{
|
||||
(*it)->control = new LadspaControl( this, *it,
|
||||
linked_control );
|
||||
|
||||
last_port = (*it)->data_type;
|
||||
|
||||
p.append( (*it)->control );
|
||||
|
||||
if( linked_control )
|
||||
{
|
||||
connect( (*it)->control,
|
||||
SIGNAL( linkChanged( Uint16, bool ) ),
|
||||
this,
|
||||
SLOT( linkPort( Uint16, bool ) ) );
|
||||
connect( (*it)->control, SIGNAL( linkChanged( int, bool ) ),
|
||||
this, SLOT( linkPort( int, bool ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -143,7 +137,7 @@ void LadspaControls::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
void LadspaControls::linkPort( Uint16 _port, bool _state )
|
||||
void LadspaControls::linkPort( int _port, bool _state )
|
||||
{
|
||||
LadspaControl * first = m_controls[0][_port];
|
||||
if( _state )
|
||||
@@ -170,18 +164,14 @@ void LadspaControls::updateLinkStatesFromGlobal()
|
||||
{
|
||||
if( m_stereoLinkModel.value() )
|
||||
{
|
||||
for( Uint16 port = 0;
|
||||
port < m_controlCount / m_processors;
|
||||
port++ )
|
||||
for( int port = 0; port < m_controlCount / m_processors; port++ )
|
||||
{
|
||||
m_controls[0][port]->setLink( true );
|
||||
}
|
||||
}
|
||||
else if( !m_noLink )
|
||||
{
|
||||
for( Uint16 port = 0;
|
||||
port < m_controlCount / m_processors;
|
||||
port++ )
|
||||
for( int port = 0; port < m_controlCount / m_processors; port++ )
|
||||
{
|
||||
m_controls[0][port]->setLink( false );
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* LadspaControls.h - model for LADSPA plugin controls
|
||||
*
|
||||
* Copyright (c) 2008-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
|
||||
protected slots:
|
||||
void updateLinkStatesFromGlobal();
|
||||
void linkPort( Uint16 _port, bool _state );
|
||||
void linkPort( int _port, bool _state );
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 113 KiB |
@@ -466,9 +466,8 @@ inline float GET_INC(float freq) {
|
||||
return freq/engine::mixer()->processingSampleRate(); // TODO: Use actual sampling rate.
|
||||
}
|
||||
|
||||
int lb302Synth::process(sampleFrame *outbuf, const Uint32 size)
|
||||
int lb302Synth::process(sampleFrame *outbuf, const int size)
|
||||
{
|
||||
unsigned int i;
|
||||
float w;
|
||||
float samp;
|
||||
|
||||
@@ -500,7 +499,7 @@ int lb302Synth::process(sampleFrame *outbuf, const Uint32 size)
|
||||
// TODO: NORMAL RELEASE
|
||||
// vca_mode = 1;
|
||||
|
||||
for(i=0;i<size;i++) {
|
||||
for(int i=0;i<size;i++) {
|
||||
|
||||
// update vcf
|
||||
if(vcf_envpos >= ENVINC) {
|
||||
@@ -804,34 +803,34 @@ lb302SynthView::lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
|
||||
m_vcfCutKnob = new knob( knobBright_26, this );
|
||||
m_vcfCutKnob->move( 75, 130 );
|
||||
m_vcfCutKnob->setHintText( tr( "Cutoff Freq:" ) + " ", "" );
|
||||
m_vcfCutKnob->setLabel( tr("CUT") );
|
||||
m_vcfCutKnob->setLabel( "" );
|
||||
|
||||
m_vcfResKnob = new knob( knobBright_26, this );
|
||||
m_vcfResKnob->move( 120, 130 );
|
||||
m_vcfResKnob->setHintText( tr( "Resonance:" ) + " ", "" );
|
||||
m_vcfResKnob->setLabel( tr("RES") );
|
||||
m_vcfResKnob->setLabel( "" );
|
||||
|
||||
m_vcfModKnob = new knob( knobBright_26, this );
|
||||
m_vcfModKnob->move( 165, 130 );
|
||||
m_vcfModKnob->setHintText( tr( "Env Mod:" ) + " ", "" );
|
||||
m_vcfModKnob->setLabel( tr("ENV MOD") );
|
||||
m_vcfModKnob->setLabel( "" );
|
||||
|
||||
m_vcfDecKnob = new knob( knobBright_26, this );
|
||||
m_vcfDecKnob->move( 210, 130 );
|
||||
m_vcfDecKnob->setHintText( tr( "Decay:" ) + " ", "" );
|
||||
m_vcfDecKnob->setLabel( tr("DEC") );
|
||||
m_vcfDecKnob->setLabel( "" );
|
||||
|
||||
m_slideToggle = new ledCheckBox( "Slide", this );
|
||||
m_slideToggle = new ledCheckBox( "", this );
|
||||
m_slideToggle->move( 10, 180 );
|
||||
|
||||
m_accentToggle = new ledCheckBox( "Accent", this );
|
||||
m_accentToggle = new ledCheckBox( "", this );
|
||||
m_accentToggle->move( 10, 200 );
|
||||
m_accentToggle->setDisabled(true);
|
||||
|
||||
m_deadToggle = new ledCheckBox( "Dead", this );
|
||||
m_deadToggle = new ledCheckBox( "", this );
|
||||
m_deadToggle->move( 10, 220 );
|
||||
|
||||
m_db24Toggle = new ledCheckBox( "24dB/oct", this );
|
||||
m_db24Toggle = new ledCheckBox( "", this );
|
||||
m_db24Toggle->setWhatsThis(
|
||||
tr( "303-es-que, 24dB/octave, 3 pole filter" ) );
|
||||
m_db24Toggle->move( 10, 150);
|
||||
@@ -840,12 +839,12 @@ lb302SynthView::lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
|
||||
m_slideDecKnob = new knob( knobBright_26, this );
|
||||
m_slideDecKnob->move( 210, 75 );
|
||||
m_slideDecKnob->setHintText( tr( "Slide Decay:" ) + " ", "" );
|
||||
m_slideDecKnob->setLabel( tr( "SLIDE"));
|
||||
m_slideDecKnob->setLabel( "");
|
||||
|
||||
m_distKnob = new knob( knobBright_26, this );
|
||||
m_distKnob->move( 210, 190 );
|
||||
m_distKnob->setHintText( tr( "DIST:" ) + " ", "" );
|
||||
m_distKnob->setLabel( tr( "DIST"));
|
||||
m_distKnob->setLabel( tr( ""));
|
||||
|
||||
|
||||
// Shapes
|
||||
|
||||
@@ -231,7 +231,7 @@ private:
|
||||
|
||||
void recalcFilter();
|
||||
|
||||
int process(sampleFrame *outbuf, const Uint32 size);
|
||||
int process(sampleFrame *outbuf, const int size);
|
||||
|
||||
friend class lb302SynthView;
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 112 KiB |
@@ -69,15 +69,15 @@ private:
|
||||
} while( --_bytes );
|
||||
return( value );
|
||||
}
|
||||
inline Sint32 read32LE( void )
|
||||
inline int read32LE()
|
||||
{
|
||||
int value = readByte();
|
||||
value |= readByte() << 8;
|
||||
value |= readByte() << 16;
|
||||
value |= readByte() << 24;
|
||||
return( value );
|
||||
return value;
|
||||
}
|
||||
inline int readVar( void )
|
||||
inline int readVar()
|
||||
{
|
||||
int c = readByte();
|
||||
int value = c & 0x7f;
|
||||
@@ -103,9 +103,9 @@ private:
|
||||
return( !file().atEnd() ? value : -1 );
|
||||
}
|
||||
|
||||
inline Sint32 readID( void )
|
||||
inline int readID()
|
||||
{
|
||||
return( read32LE() );
|
||||
return read32LE();
|
||||
}
|
||||
inline void skip( int _bytes )
|
||||
{
|
||||
|
||||
@@ -190,7 +190,7 @@ void organicInstrument::playNote( notePlayHandle * _n,
|
||||
Oscillator * oscs_l[m_numOscillators];
|
||||
Oscillator * oscs_r[m_numOscillators];
|
||||
|
||||
for( Sint8 i = m_numOscillators - 1; i >= 0; --i )
|
||||
for( int i = m_numOscillators - 1; i >= 0; --i )
|
||||
{
|
||||
|
||||
m_osc[i]->m_phaseOffsetLeft = rand()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* patman.cpp - a GUS-compatible patch instrument plugin
|
||||
*
|
||||
* Copyright (c) 2007-2008 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
|
||||
* Copyright (c) 2009-2013 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2009-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -564,7 +564,7 @@ void PatmanView::openFile( void )
|
||||
void PatmanView::updateFilename( void )
|
||||
{
|
||||
m_displayFilename = "";
|
||||
Uint16 idx = m_pi->m_patchFile.length();
|
||||
int idx = m_pi->m_patchFile.length();
|
||||
|
||||
QFontMetrics fm( pointSize<8>( font() ) );
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 30 KiB |
@@ -64,6 +64,7 @@ PeakControllerEffect::PeakControllerEffect(
|
||||
m_peakControls( this ),
|
||||
m_lastSample( 0 ),
|
||||
m_lastRMS( -1 ),
|
||||
m_lastRMSavail(false),
|
||||
m_autoController( NULL )
|
||||
{
|
||||
m_autoController = new PeakController( engine::getSong(), this );
|
||||
@@ -83,13 +84,19 @@ PeakControllerEffect::~PeakControllerEffect()
|
||||
}
|
||||
}
|
||||
|
||||
//! returns 1.0f if val > 0.0f, -1.0 else
|
||||
inline float my_sign(float val) { return -1.0f + 2.0f * (val > 0.0f); }
|
||||
|
||||
//! if val >= 0.0f, returns sqrtf(val), else: -sqrtf(-val)
|
||||
inline float sqrt_neg(float val) {
|
||||
return sqrtf(fabs(val)) * my_sign(val);
|
||||
}
|
||||
|
||||
bool PeakControllerEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
const fpp_t _frames )
|
||||
{
|
||||
PeakControllerEffectControls & c = m_peakControls;
|
||||
|
||||
|
||||
// This appears to be used for determining whether or not to continue processing
|
||||
// audio with this effect
|
||||
if( !isEnabled() || !isRunning() )
|
||||
@@ -101,7 +108,12 @@ bool PeakControllerEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
double sum = 0;
|
||||
for( int i = 0; i < _frames; ++i )
|
||||
{
|
||||
sum += _buf[i][0]*_buf[i][0] + _buf[i][1]*_buf[i][1];
|
||||
float sign_0 = (c.m_absModel.value())
|
||||
? 1.0f : my_sign(_buf[i][0]);
|
||||
float sign_1 = (c.m_absModel.value())
|
||||
? 1.0f : my_sign(_buf[i][1]);
|
||||
sum += _buf[i][0]*_buf[i][0]*sign_0
|
||||
+ _buf[i][1]*_buf[i][1]*sign_1;
|
||||
}
|
||||
|
||||
if( c.m_muteModel.value() )
|
||||
@@ -112,19 +124,22 @@ bool PeakControllerEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
}
|
||||
}
|
||||
|
||||
float curRMS = sqrtf( sum / _frames );
|
||||
float curRMS = sqrt_neg( sum / _frames );
|
||||
const float origRMS = curRMS;
|
||||
if( m_lastRMS < 0 )
|
||||
|
||||
if( !m_lastRMSavail )
|
||||
{
|
||||
m_lastRMSavail = true;
|
||||
m_lastRMS = curRMS;
|
||||
}
|
||||
const float v = ( curRMS >= m_lastRMS ) ?
|
||||
c.m_attackModel.value() :
|
||||
c.m_decayModel.value();
|
||||
const float a = sqrtf( sqrtf( v ) );
|
||||
const float a = sqrt_neg( sqrt_neg( v ) );
|
||||
curRMS = (1-a)*curRMS + a*m_lastRMS;
|
||||
|
||||
m_lastSample = c.m_baseModel.value() + c.m_amountModel.value()*curRMS;
|
||||
const float amount = c.m_amountModel.value() * c.m_amountMultModel.value();
|
||||
m_lastSample = c.m_baseModel.value() + amount*curRMS;
|
||||
m_lastRMS = curRMS;
|
||||
|
||||
// on greater buffer sizes our LP is updated less frequently, therfore
|
||||
@@ -138,6 +153,16 @@ bool PeakControllerEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
|
||||
//checkGate( out_sum / _frames );
|
||||
|
||||
// finally, mute the output if wanted
|
||||
// TODO: avoid clips?
|
||||
if( c.m_muteOutputModel.value() )
|
||||
{
|
||||
for( int i = 0; i < _frames; ++i )
|
||||
{
|
||||
_buf[i][0] = _buf[i][1] = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
return isRunning();
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ private:
|
||||
|
||||
float m_lastSample;
|
||||
float m_lastRMS;
|
||||
bool m_lastRMSavail;
|
||||
|
||||
Controller * m_autoController;
|
||||
|
||||
|
||||
@@ -44,13 +44,12 @@ PeakControllerEffectControlDialog::PeakControllerEffectControlDialog(
|
||||
pal.setBrush( backgroundRole(),
|
||||
PLUGIN_NAME::getIconPixmap( "artwork" ) );
|
||||
setPalette( pal );
|
||||
setFixedSize( 144, 110 );
|
||||
|
||||
QVBoxLayout * tl = new QVBoxLayout( this );
|
||||
tl->addSpacing( 25 );
|
||||
tl->setContentsMargins( 5, 30, 8, 8 );
|
||||
|
||||
QHBoxLayout * l = new QHBoxLayout;
|
||||
|
||||
l->setSpacing( 4 );
|
||||
m_baseKnob = new knob( knobBright_26, this );
|
||||
m_baseKnob->setLabel( tr( "BASE" ) );
|
||||
m_baseKnob->setModel( &_controls->m_baseModel );
|
||||
@@ -61,8 +60,13 @@ PeakControllerEffectControlDialog::PeakControllerEffectControlDialog(
|
||||
m_amountKnob->setModel( &_controls->m_amountModel );
|
||||
m_amountKnob->setHintText( tr( "Modulation amount:" ) + " ", "" );
|
||||
|
||||
m_amountMultKnob = new knob( knobBright_26, this );
|
||||
m_amountMultKnob->setLabel( tr( "MULT" ) );
|
||||
m_amountMultKnob->setModel( &_controls->m_amountMultModel );
|
||||
m_amountMultKnob->setHintText( tr( "Amount Multiplicator:" ) + " ", "" );
|
||||
|
||||
m_attackKnob = new knob( knobBright_26, this );
|
||||
m_attackKnob->setLabel( tr( "ATTACK" ) );
|
||||
m_attackKnob->setLabel( tr( "ATTCK" ) );
|
||||
m_attackKnob->setModel( &_controls->m_attackModel );
|
||||
m_attackKnob->setHintText( tr( "Attack:" ) + " ", "" );
|
||||
|
||||
@@ -73,15 +77,28 @@ PeakControllerEffectControlDialog::PeakControllerEffectControlDialog(
|
||||
|
||||
l->addWidget( m_baseKnob );
|
||||
l->addWidget( m_amountKnob );
|
||||
l->addWidget( m_amountMultKnob );
|
||||
l->addWidget( m_attackKnob );
|
||||
l->addWidget( m_decayKnob );
|
||||
l->addStretch(); // expand, so other widgets have minimum width
|
||||
tl->addLayout( l );
|
||||
|
||||
m_muteLed = new ledCheckBox( "Mute", this );
|
||||
QVBoxLayout * l2 = new QVBoxLayout; // = 2nd vbox
|
||||
|
||||
m_muteLed = new ledCheckBox( "Mute Effect", this );
|
||||
m_muteLed->setModel( &_controls->m_muteModel );
|
||||
|
||||
tl->addSpacing( 5 );
|
||||
tl->addWidget( m_muteLed );
|
||||
m_absLed = new ledCheckBox( "Abs Value", this );
|
||||
m_absLed->setModel( &_controls->m_absModel );
|
||||
|
||||
m_muteOutputLed = new ledCheckBox( "Mute Output", this );
|
||||
m_muteOutputLed->setModel( &_controls->m_muteOutputModel );
|
||||
|
||||
l2->addWidget( m_muteLed );
|
||||
l2->addWidget( m_absLed );
|
||||
l2->addWidget( m_muteOutputLed );
|
||||
l2->addStretch(); // expand, so other widgets have minimum height
|
||||
tl->addLayout( l2 );
|
||||
|
||||
setLayout( tl );
|
||||
}
|
||||
|
||||
@@ -50,6 +50,10 @@ protected:
|
||||
knob * m_decayKnob;
|
||||
ledCheckBox * m_muteLed;
|
||||
|
||||
ledCheckBox * m_absLed;
|
||||
knob * m_amountMultKnob;
|
||||
ledCheckBox * m_muteOutputLed;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,10 @@ PeakControllerEffectControls( PeakControllerEffect * _eff ) :
|
||||
m_amountModel( 1.0, -1.0, 1.0, 0.005, this, tr( "Modulation amount" ) ),
|
||||
m_attackModel( 0, 0, 0.999, 0.001, this, tr( "Attack" ) ),
|
||||
m_decayModel( 0, 0, 0.999, 0.001, this, tr( "Release" ) ),
|
||||
m_muteModel( false, this, tr( "Mute output" ) )
|
||||
m_muteModel( false, this, tr( "Mute output" ) ),
|
||||
m_absModel( true, this, tr("Abs Value") ),
|
||||
m_amountMultModel( 1.0, 0, 32, 0.2, this, tr("Amount Multiplicator") ),
|
||||
m_muteOutputModel( false, this, tr("Mute Output") )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -54,6 +57,10 @@ void PeakControllerEffectControls::loadSettings( const QDomElement & _this )
|
||||
m_attackModel.loadSettings( _this, "attack" );
|
||||
m_decayModel.loadSettings( _this, "decay" );
|
||||
|
||||
m_absModel.loadSettings( _this, "abs" );
|
||||
m_amountMultModel.loadSettings( _this, "amountmult" );
|
||||
m_muteOutputModel.loadSettings( _this, "muteout" );
|
||||
|
||||
int effectId = _this.attribute( "effectId" ).toInt();
|
||||
if( effectId > PeakController::s_lastEffectId )
|
||||
{
|
||||
@@ -82,6 +89,10 @@ void PeakControllerEffectControls::saveSettings( QDomDocument & _doc,
|
||||
|
||||
m_attackModel.saveSettings( _doc, _this, "attack" );
|
||||
m_decayModel.saveSettings( _doc, _this, "decay" );
|
||||
|
||||
m_absModel.saveSettings( _doc, _this, "abs" );
|
||||
m_amountMultModel.saveSettings( _doc, _this, "amountmult" );
|
||||
m_muteOutputModel.saveSettings( _doc, _this, "muteout" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -66,6 +66,9 @@ private:
|
||||
FloatModel m_attackModel;
|
||||
FloatModel m_decayModel;
|
||||
BoolModel m_muteModel;
|
||||
BoolModel m_absModel;
|
||||
FloatModel m_amountMultModel;
|
||||
BoolModel m_muteOutputModel;
|
||||
|
||||
friend class PeakControllerEffectControlDialog;
|
||||
friend class PeakControllerEffect;
|
||||
|
||||
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
@@ -232,7 +232,7 @@ void malletsInstrument::playNote( notePlayHandle * _n,
|
||||
m_stickModel.value(),
|
||||
m_vibratoFreqModel.value(),
|
||||
p,
|
||||
(Uint8) m_spreadModel.value(),
|
||||
(uint8_t) m_spreadModel.value(),
|
||||
engine::mixer()->processingSampleRate() );
|
||||
}
|
||||
else if( p == 9 )
|
||||
@@ -245,7 +245,7 @@ void malletsInstrument::playNote( notePlayHandle * _n,
|
||||
m_crossfadeModel.value(),
|
||||
m_lfoSpeedModel.value(),
|
||||
m_adsrModel.value(),
|
||||
(Uint8) m_spreadModel.value(),
|
||||
(uint8_t) m_spreadModel.value(),
|
||||
engine::mixer()->processingSampleRate() );
|
||||
}
|
||||
else
|
||||
@@ -258,7 +258,7 @@ void malletsInstrument::playNote( notePlayHandle * _n,
|
||||
p - 10,
|
||||
m_strikeModel.value() * 128.0,
|
||||
m_velocityModel.value(),
|
||||
(Uint8) m_spreadModel.value(),
|
||||
(uint8_t) m_spreadModel.value(),
|
||||
engine::mixer()->processingSampleRate() );
|
||||
}
|
||||
m.unlock();
|
||||
@@ -522,7 +522,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
|
||||
const StkFloat _control8,
|
||||
const StkFloat _control11,
|
||||
const int _control16,
|
||||
const Uint8 _delay,
|
||||
const uint8_t _delay,
|
||||
const sample_rate_t _sample_rate )
|
||||
{
|
||||
try
|
||||
@@ -551,7 +551,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
|
||||
m_delay = new StkFloat[256];
|
||||
m_delayRead = 0;
|
||||
m_delayWrite = _delay;
|
||||
for( Uint16 i = 0; i < 256; i++ )
|
||||
for( int i = 0; i < 256; i++ )
|
||||
{
|
||||
m_delay[i] = 0.0;
|
||||
}
|
||||
@@ -569,7 +569,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
|
||||
const StkFloat _control4,
|
||||
const StkFloat _control11,
|
||||
const StkFloat _control128,
|
||||
const Uint8 _delay,
|
||||
const uint8_t _delay,
|
||||
const sample_rate_t _sample_rate )
|
||||
{
|
||||
try
|
||||
@@ -596,7 +596,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
|
||||
m_delay = new StkFloat[256];
|
||||
m_delayRead = 0;
|
||||
m_delayWrite = _delay;
|
||||
for( Uint16 i = 0; i < 256; i++ )
|
||||
for( int i = 0; i < 256; i++ )
|
||||
{
|
||||
m_delay[i] = 0.0;
|
||||
}
|
||||
@@ -614,7 +614,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
|
||||
const int _control16,
|
||||
const StkFloat _control64,
|
||||
const StkFloat _control128,
|
||||
const Uint8 _delay,
|
||||
const uint8_t _delay,
|
||||
const sample_rate_t _sample_rate )
|
||||
{
|
||||
try
|
||||
@@ -643,7 +643,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
|
||||
m_delay = new StkFloat[256];
|
||||
m_delayRead = 0;
|
||||
m_delayWrite = _delay;
|
||||
for( Uint16 i = 0; i < 256; i++ )
|
||||
for( int i = 0; i < 256; i++ )
|
||||
{
|
||||
m_delay[i] = 0.0;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
const StkFloat _control8,
|
||||
const StkFloat _control11,
|
||||
const int _control16,
|
||||
const Uint8 _delay,
|
||||
const uint8_t _delay,
|
||||
const sample_rate_t _sample_rate );
|
||||
|
||||
// TubeBell
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
const StkFloat _control4,
|
||||
const StkFloat _control11,
|
||||
const StkFloat _control128,
|
||||
const Uint8 _delay,
|
||||
const uint8_t _delay,
|
||||
const sample_rate_t _sample_rate );
|
||||
|
||||
// BandedWG
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
const int _control16,
|
||||
const StkFloat _control64,
|
||||
const StkFloat _control128,
|
||||
const Uint8 _delay,
|
||||
const uint8_t _delay,
|
||||
const sample_rate_t _sample_rate );
|
||||
|
||||
inline ~malletsSynth()
|
||||
@@ -124,8 +124,8 @@ protected:
|
||||
Instrmnt * m_voice;
|
||||
|
||||
StkFloat * m_delay;
|
||||
Uint8 m_delayRead;
|
||||
Uint8 m_delayWrite;
|
||||
uint8_t m_delayRead;
|
||||
uint8_t m_delayWrite;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ void TripleOscillator::playNote( notePlayHandle * _n,
|
||||
Oscillator * oscs_l[NUM_OF_OSCILLATORS];
|
||||
Oscillator * oscs_r[NUM_OF_OSCILLATORS];
|
||||
|
||||
for( Sint8 i = NUM_OF_OSCILLATORS - 1; i >= 0; --i )
|
||||
for( int i = NUM_OF_OSCILLATORS - 1; i >= 0; --i )
|
||||
{
|
||||
|
||||
// the last oscs needs no sub-oscs...
|
||||
|
||||
@@ -6,7 +6,6 @@ LINK_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../vst_base)
|
||||
LINK_LIBRARIES(vstbase)
|
||||
|
||||
BUILD_PLUGIN(vestige vestige.cpp vestige.h MOCFILES vestige.h EMBEDDED_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.png)
|
||||
SET_TARGET_PROPERTIES(vestige PROPERTIES COMPILE_FLAGS "-D_FORTIFY_SOURCE=0")
|
||||
|
||||
ENDIF(LMMS_SUPPORT_VST)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* vestige.cpp - instrument-plugin for hosting VST-instruments
|
||||
*
|
||||
* Copyright (c) 2005-2013 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -135,8 +135,7 @@ void vestigeInstrument::loadSettings( const QDomElement & _this )
|
||||
knobFModel[i] = new FloatModel( 0.0f, 0.0f, 1.0f, 0.01f, this, QString::number(i) );
|
||||
knobFModel[i]->loadSettings( _this, paramStr );
|
||||
|
||||
if( !( knobFModel[ i ]->isAutomated() ||
|
||||
knobFModel[ i ]->getControllerConnection() ) )
|
||||
if( !( knobFModel[ i ]->isAutomated() || knobFModel[ i ]->controllerConnection() ) )
|
||||
{
|
||||
knobFModel[ i ]->setValue( ( s_dumpValues.at( 2 )).toFloat() );
|
||||
knobFModel[ i ]->setInitValue( ( s_dumpValues.at( 2 )).toFloat() );
|
||||
@@ -190,7 +189,7 @@ void vestigeInstrument::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
char paramStr[35];
|
||||
for( int i = 0; i < paramCount; i++ )
|
||||
{
|
||||
if (knobFModel[i]->isAutomated() || knobFModel[i]->getControllerConnection()) {
|
||||
if (knobFModel[i]->isAutomated() || knobFModel[i]->controllerConnection()) {
|
||||
sprintf( paramStr, "param%d", i);
|
||||
knobFModel[i]->saveSettings( _doc, _this, paramStr );
|
||||
}
|
||||
@@ -200,7 +199,7 @@ void vestigeInstrument::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
me.setAttribute( "value", knobFModel[i]->value() );
|
||||
_this.appendChild( me );
|
||||
|
||||
ControllerConnection * m_controllerConnection = knobFModel[i]->getControllerConnection();
|
||||
ControllerConnection * m_controllerConnection = knobFModel[i]->controllerConnection();
|
||||
if (m_controllerConnection) {
|
||||
QDomElement controller_element;
|
||||
QDomNode node = _this.namedItem( "connection" );
|
||||
@@ -1016,8 +1015,7 @@ void manageVestigeInstrumentView::syncPlugin( void )
|
||||
{
|
||||
// only not automated knobs are synced from VST
|
||||
// those auto-setted values are not jurnaled, tracked for undo / redo
|
||||
if( !( m_vi->knobFModel[ i ]->isAutomated() ||
|
||||
m_vi->knobFModel[ i ]->getControllerConnection() ) )
|
||||
if( !( m_vi->knobFModel[ i ]->isAutomated() || m_vi->knobFModel[ i ]->controllerConnection() ) )
|
||||
{
|
||||
sprintf( paramStr, "param%d", i );
|
||||
s_dumpValues = dump[ paramStr ].split( ":" );
|
||||
@@ -1038,8 +1036,7 @@ void manageVestigeInstrumentView::displayAutomatedOnly( void )
|
||||
for( int i = 0; i< m_vi->paramCount; i++ )
|
||||
{
|
||||
|
||||
if( !( m_vi->knobFModel[ i ]->isAutomated() ||
|
||||
m_vi->knobFModel[ i ]->getControllerConnection() ) )
|
||||
if( !( m_vi->knobFModel[ i ]->isAutomated() || m_vi->knobFModel[ i ]->controllerConnection() ) )
|
||||
{
|
||||
if( m_vi->vstKnobs[ i ]->isVisible() == true && isAuto )
|
||||
{
|
||||
|
||||
@@ -50,8 +50,8 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
|
||||
QPixmap _button7_off,
|
||||
QPixmap _button8_on,
|
||||
QPixmap _button8_off,
|
||||
Uint8 _default,
|
||||
Uint32 _x, Uint32 _y,
|
||||
int _default,
|
||||
int _x, int _y,
|
||||
QWidget * _parent ):
|
||||
QWidget( _parent ),
|
||||
IntModelView( new nineButtonSelectorModel(0, 8, _default, NULL,
|
||||
@@ -148,7 +148,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
|
||||
|
||||
nineButtonSelector::~ nineButtonSelector()
|
||||
{
|
||||
for( Uint8 i = 0; i < 9; i++ )
|
||||
for( int i = 0; i < 9; i++ )
|
||||
{
|
||||
delete m_buttons[i];
|
||||
}
|
||||
@@ -231,13 +231,13 @@ void nineButtonSelector::modelChanged()
|
||||
updateButton( model()->value() );
|
||||
}
|
||||
|
||||
void nineButtonSelector::setSelected( Uint8 _new_button )
|
||||
void nineButtonSelector::setSelected( int _new_button )
|
||||
{
|
||||
model()->setValue(_new_button);
|
||||
updateButton( _new_button );
|
||||
}
|
||||
|
||||
void nineButtonSelector::updateButton( Uint8 _new_button )
|
||||
void nineButtonSelector::updateButton( int _new_button )
|
||||
{
|
||||
m_lastBtn->setChecked( false );
|
||||
m_lastBtn->update();
|
||||
|
||||
@@ -51,17 +51,17 @@ public:
|
||||
QPixmap _button7_off,
|
||||
QPixmap _button8_on,
|
||||
QPixmap _button8_off,
|
||||
Uint8 _default,
|
||||
Uint32 _x, Uint32 _y,
|
||||
int _default,
|
||||
int _x, int _y,
|
||||
QWidget * _parent);
|
||||
virtual ~nineButtonSelector();
|
||||
|
||||
// inline Uint8 getSelected() {
|
||||
// inline int getSelected() {
|
||||
// return( castModel<nineButtonSelectorModel>()->value() );
|
||||
// };
|
||||
|
||||
protected:
|
||||
void setSelected( Uint8 _new_button );
|
||||
void setSelected( int _new_button );
|
||||
|
||||
public slots:
|
||||
void button0Clicked();
|
||||
@@ -77,11 +77,11 @@ public slots:
|
||||
void displayHelp();
|
||||
|
||||
signals:
|
||||
void nineButtonSelection( Uint8 );
|
||||
void nineButtonSelection( int );
|
||||
|
||||
private:
|
||||
virtual void modelChanged();
|
||||
void updateButton( Uint8 );
|
||||
void updateButton( int );
|
||||
|
||||
QList<pixmapButton *> m_buttons;
|
||||
pixmapButton * m_button;
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
|
||||
stringContainer::stringContainer(const float _pitch,
|
||||
const sample_rate_t _sample_rate,
|
||||
const Uint32 _buffer_length,
|
||||
const Uint8 _strings ) :
|
||||
const int _buffer_length,
|
||||
const int _strings ) :
|
||||
m_pitch( _pitch ),
|
||||
m_sampleRate( _sample_rate ),
|
||||
m_bufferLength( _buffer_length )
|
||||
{
|
||||
for( Uint8 i = 0; i < _strings; i++ )
|
||||
for( int i = 0; i < _strings; i++ )
|
||||
{
|
||||
m_exists.append( false );
|
||||
}
|
||||
@@ -42,16 +42,16 @@ stringContainer::stringContainer(const float _pitch,
|
||||
|
||||
|
||||
|
||||
void stringContainer::addString(Uint8 _harm,
|
||||
void stringContainer::addString(int _harm,
|
||||
const float _pick,
|
||||
const float _pickup,
|
||||
const float * _impulse,
|
||||
const float _randomize,
|
||||
const float _string_loss,
|
||||
const float _detune,
|
||||
const Uint8 _oversample,
|
||||
const int _oversample,
|
||||
const bool _state,
|
||||
const Uint8 _id )
|
||||
const int _id )
|
||||
{
|
||||
float harm;
|
||||
switch( _harm )
|
||||
|
||||
@@ -35,44 +35,44 @@ class stringContainer
|
||||
public:
|
||||
stringContainer(const float _pitch,
|
||||
const sample_rate_t _sample_rate,
|
||||
const Uint32 _buffer_length,
|
||||
const Uint8 _strings = 9 );
|
||||
const int _buffer_length,
|
||||
const int _strings = 9 );
|
||||
|
||||
void addString( Uint8 _harm,
|
||||
void addString( int _harm,
|
||||
const float _pick,
|
||||
const float _pickup,
|
||||
const float * _impluse,
|
||||
const float _randomize,
|
||||
const float _string_loss,
|
||||
const float _detune,
|
||||
const Uint8 _oversample,
|
||||
const int _oversample,
|
||||
const bool _state,
|
||||
const Uint8 _id );
|
||||
const int _id );
|
||||
|
||||
inline bool exists( Uint8 _id )
|
||||
bool exists( int _id ) const
|
||||
{
|
||||
return( m_exists[_id] );
|
||||
return m_exists[_id];
|
||||
}
|
||||
|
||||
inline ~stringContainer()
|
||||
~stringContainer()
|
||||
{
|
||||
Uint32 strings = m_strings.count();
|
||||
for( Uint32 i = 0; i < strings; i++ )
|
||||
int strings = m_strings.count();
|
||||
for( int i = 0; i < strings; i++ )
|
||||
{
|
||||
delete m_strings[i];
|
||||
}
|
||||
}
|
||||
|
||||
inline float getStringSample( Uint8 _string )
|
||||
float getStringSample( int _string )
|
||||
{
|
||||
return( m_strings[_string]->nextSample() );
|
||||
return m_strings[_string]->nextSample();
|
||||
}
|
||||
|
||||
private:
|
||||
QVector<vibratingString *> m_strings;
|
||||
const float m_pitch;
|
||||
const sample_rate_t m_sampleRate;
|
||||
const Uint32 m_bufferLength;
|
||||
const int m_bufferLength;
|
||||
QVector<bool> m_exists;
|
||||
} ;
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ vibed::vibed( InstrumentTrack * _instrumentTrack ) :
|
||||
nineButtonSelectorModel * harmonic;
|
||||
graphModel * graphTmp;
|
||||
|
||||
for( Uint8 harm = 0; harm < 9; harm++ )
|
||||
for( int harm = 0; harm < 9; harm++ )
|
||||
{
|
||||
knob = new FloatModel( DefaultVolume, MinVolume, MaxVolume,
|
||||
1.0f, this, tr( "String %1 volume" ).arg( harm+1 ) );
|
||||
@@ -142,7 +142,7 @@ void vibed::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
// Save plugin version
|
||||
_this.setAttribute( "version", "0.1" );
|
||||
|
||||
for( Uint8 i = 0; i < 9; i++ )
|
||||
for( int i = 0; i < 9; i++ )
|
||||
{
|
||||
name = "active" + QString::number( i );
|
||||
_this.setAttribute( name, QString::number(
|
||||
@@ -199,7 +199,7 @@ void vibed::loadSettings( const QDomElement & _this )
|
||||
|
||||
QString name;
|
||||
|
||||
for( Uint8 i = 0; i < 9; i++ )
|
||||
for( int i = 0; i < 9; i++ )
|
||||
{
|
||||
name = "active" + QString::number( i );
|
||||
m_powerButtons[i]->setValue( _this.attribute( name ).toInt() );
|
||||
@@ -280,7 +280,7 @@ void vibed::playNote( notePlayHandle * _n, sampleFrame * _working_buffer )
|
||||
engine::mixer()->processingSampleRate(),
|
||||
__sampleLength );
|
||||
|
||||
for( Uint8 i = 0; i < 9; ++i )
|
||||
for( int i = 0; i < 9; ++i )
|
||||
{
|
||||
if( m_powerButtons[i]->value() )
|
||||
{
|
||||
@@ -309,18 +309,14 @@ void vibed::playNote( notePlayHandle * _n, sampleFrame * _working_buffer )
|
||||
{
|
||||
_working_buffer[i][0] = 0.0f;
|
||||
_working_buffer[i][1] = 0.0f;
|
||||
Uint8 s = 0;
|
||||
for( Uint8 string = 0; string < 9; ++string )
|
||||
int s = 0;
|
||||
for( int string = 0; string < 9; ++string )
|
||||
{
|
||||
if( ps->exists( string ) )
|
||||
{
|
||||
// pan: 0 -> left, 1 -> right
|
||||
const float pan = (
|
||||
m_panKnobs[string]->value() + 1 ) /
|
||||
2.0f;
|
||||
const sample_t sample =
|
||||
ps->getStringSample( s ) *
|
||||
m_volumeKnobs[string]->value() / 100.0f;
|
||||
const float pan = ( m_panKnobs[string]->value() + 1 ) / 2.0f;
|
||||
const sample_t sample = ps->getStringSample( s ) * m_volumeKnobs[string]->value() / 100.0f;
|
||||
_working_buffer[i][0] += ( 1.0f - pan ) * sample;
|
||||
_working_buffer[i][1] += pan * sample;
|
||||
s++;
|
||||
@@ -547,8 +543,8 @@ vibedView::vibedView( Instrument * _instrument,
|
||||
"vibrating strings. The LED in the lower right corner of the "
|
||||
"waveform editor indicates whether the selected string is active." ) );
|
||||
|
||||
connect( m_stringSelector, SIGNAL( nineButtonSelection( Uint8 ) ),
|
||||
this, SLOT( showString( Uint8 ) ) );
|
||||
connect( m_stringSelector, SIGNAL( nineButtonSelection( int ) ),
|
||||
this, SLOT( showString( int ) ) );
|
||||
|
||||
showString( 0 );
|
||||
|
||||
@@ -668,7 +664,7 @@ void vibedView::modelChanged()
|
||||
|
||||
|
||||
|
||||
void vibedView::showString( Uint8 _string )
|
||||
void vibedView::showString( int _string )
|
||||
{
|
||||
vibed * v = castModel<vibed>();
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
virtual ~vibedView() {};
|
||||
|
||||
public slots:
|
||||
void showString( Uint8 _string );
|
||||
void showString( int _string );
|
||||
void contextMenuEvent( QContextMenuEvent * );
|
||||
void displayHelp();
|
||||
|
||||
|
||||
@@ -34,9 +34,9 @@ vibratingString::vibratingString( float _pitch,
|
||||
float _pick,
|
||||
float _pickup,
|
||||
float * _impulse,
|
||||
Uint32 _len,
|
||||
int _len,
|
||||
sample_rate_t _sample_rate,
|
||||
Uint8 _oversample,
|
||||
int _oversample,
|
||||
float _randomize,
|
||||
float _string_loss,
|
||||
float _detune,
|
||||
@@ -64,7 +64,7 @@ vibratingString::vibratingString( float _pitch,
|
||||
else
|
||||
{
|
||||
m_impulse = new float[_len];
|
||||
for( Uint32 i = 0; i < _len; i++ )
|
||||
for( int i = 0; i < _len; i++ )
|
||||
{
|
||||
m_impulse[i] = _impulse[i];
|
||||
}
|
||||
|
||||
@@ -37,9 +37,9 @@ public:
|
||||
float _pick,
|
||||
float _pickup,
|
||||
float * impluse,
|
||||
Uint32 _len,
|
||||
int _len,
|
||||
sample_rate_t _sample_rate,
|
||||
Uint8 _oversample,
|
||||
int _oversample,
|
||||
float _randomize,
|
||||
float _string_loss,
|
||||
float _detune,
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
{
|
||||
sample_t ym0;
|
||||
sample_t ypM;
|
||||
for( Uint8 i = 0; i < m_oversample; i++)
|
||||
for( int i = 0; i < m_oversample; i++)
|
||||
{
|
||||
// Output at pickup position
|
||||
m_outsamp[i] = fromBridgeAccess( m_fromBridge,
|
||||
@@ -94,7 +94,7 @@ private:
|
||||
delayLine * m_fromBridge;
|
||||
delayLine * m_toBridge;
|
||||
int m_pickupLoc;
|
||||
Uint8 m_oversample;
|
||||
int m_oversample;
|
||||
float m_randomize;
|
||||
float m_stringLoss;
|
||||
|
||||
|
||||
@@ -24,7 +24,14 @@ IF(LMMS_BUILD_LINUX AND NOT WANT_VST_NOWINE)
|
||||
|
||||
IF(LMMS_HOST_X86_64)
|
||||
SET(EXTRA_FLAGS -m32)
|
||||
|
||||
# workaround for broken wineg++ in WINE 1.4 (shipped e.g. with Ubuntu Precise)
|
||||
EXEC_PROGRAM( wineg++ ARGS "-v -m32 /dev/zero" OUTPUT_VARIABLE WINEBUILD_OUTPUT)
|
||||
if("${WINEBUILD_OUTPUT}" MATCHES ".*x86_64-linux-gnu/wine/libwinecrt0.a.*")
|
||||
SET(EXTRA_FLAGS ${EXTRA_FLAGS} -nodefaultlibs /usr/lib/i386-linux-gnu/wine/libwinecrt0.a -luser32 -lkernel32 -lgdi32)
|
||||
ENDIF()
|
||||
ENDIF(LMMS_HOST_X86_64)
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/RemoteVstPlugin.cpp
|
||||
COMMAND wineg++
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* RemoteVstPlugin.cpp - LMMS VST Support Layer (RemotePlugin client)
|
||||
*
|
||||
* Copyright (c) 2005-2012 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -297,7 +297,7 @@ private:
|
||||
|
||||
AEffect * m_plugin;
|
||||
HWND m_window;
|
||||
Sint32 m_windowID;
|
||||
intptr_t m_windowID;
|
||||
int m_windowWidth;
|
||||
int m_windowHeight;
|
||||
|
||||
@@ -689,7 +689,7 @@ void RemoteVstPlugin::initEditor()
|
||||
UpdateWindow( m_window );
|
||||
|
||||
#ifdef LMMS_BUILD_LINUX
|
||||
m_windowID = (Sint32) GetProp( m_window, "__wine_x11_whole_window" );
|
||||
m_windowID = (intptr_t) GetProp( m_window, "__wine_x11_whole_window" );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* VstPlugin.h - declaration of VstPlugin class
|
||||
*
|
||||
* Copyright (c) 2005-2012 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
return m_name;
|
||||
}
|
||||
|
||||
inline Sint32 version() const
|
||||
inline int version() const
|
||||
{
|
||||
return m_version;
|
||||
}
|
||||
@@ -137,7 +137,7 @@ private:
|
||||
bool m_badDllFormat;
|
||||
|
||||
QString m_name;
|
||||
Sint32 m_version;
|
||||
int m_version;
|
||||
QString m_vendorString;
|
||||
QString m_productString;
|
||||
QString m_currentProgramName;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* VstEffectControls.cpp - controls for VST effect plugins
|
||||
*
|
||||
* Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -88,7 +88,7 @@ void VstEffectControls::loadSettings( const QDomElement & _this )
|
||||
knobFModel[i]->loadSettings( _this, paramStr );
|
||||
|
||||
if( !( knobFModel[ i ]->isAutomated() ||
|
||||
knobFModel[ i ]->getControllerConnection() ) )
|
||||
knobFModel[ i ]->controllerConnection() ) )
|
||||
{
|
||||
knobFModel[ i ]->setValue( (s_dumpValues.at( 2 ) ).toFloat() );
|
||||
knobFModel[ i ]->setInitValue( (s_dumpValues.at( 2 ) ).toFloat() );
|
||||
@@ -133,7 +133,7 @@ void VstEffectControls::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
char paramStr[35];
|
||||
for( int i = 0; i < paramCount; i++ )
|
||||
{
|
||||
if (knobFModel[i]->isAutomated() || knobFModel[i]->getControllerConnection()) {
|
||||
if (knobFModel[i]->isAutomated() || knobFModel[i]->controllerConnection()) {
|
||||
sprintf( paramStr, "param%d", i);
|
||||
knobFModel[i]->saveSettings( _doc, _this, paramStr );
|
||||
}
|
||||
@@ -443,7 +443,7 @@ void manageVSTEffectView::syncPlugin( void )
|
||||
// only not automated knobs are synced from VST
|
||||
// those auto-setted values are not jurnaled, tracked for undo / redo
|
||||
if( !( m_vi2->knobFModel[ i ]->isAutomated() ||
|
||||
m_vi2->knobFModel[ i ]->getControllerConnection() ) )
|
||||
m_vi2->knobFModel[ i ]->controllerConnection() ) )
|
||||
{
|
||||
sprintf( paramStr, "param%d", i );
|
||||
s_dumpValues = dump[ paramStr ].split( ":" );
|
||||
@@ -464,7 +464,7 @@ void manageVSTEffectView::displayAutomatedOnly( void )
|
||||
{
|
||||
|
||||
if( !( m_vi2->knobFModel[ i ]->isAutomated() ||
|
||||
m_vi2->knobFModel[ i ]->getControllerConnection() ) )
|
||||
m_vi2->knobFModel[ i ]->controllerConnection() ) )
|
||||
{
|
||||
if( m_vi2->vstKnobs[ i ]->isVisible() == true && isAuto )
|
||||
{
|
||||
|
||||
@@ -108,7 +108,8 @@ ENDIF(LMMS_BUILD_WIN32)
|
||||
|
||||
# FLTK needs X
|
||||
IF(LMMS_BUILD_LINUX)
|
||||
FIND_PACKAGE(X11)
|
||||
FIND_PACKAGE(X11 REQUIRED)
|
||||
SET(FREETYPE_INCLUDE_DIRS foo) # fix broken FindFreetype.cmake in older versions of FreeType2
|
||||
FIND_PACKAGE(Freetype REQUIRED)
|
||||
TARGET_LINK_LIBRARIES(RemoteZynAddSubFx -ldl ${X11_LIBRARIES} ${X11_Xft_LIB} ${X11_Xinerama_LIB} ${FREETYPE_LIBRARY} -lfontconfig)
|
||||
ENDIF(LMMS_BUILD_LINUX)
|
||||
@@ -126,6 +127,10 @@ ELSEIF(LMMS_BUILD_WIN32)
|
||||
SET(FLTK_EXTRA_FLAGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/cmake/modules/Win32Toolchain.cmake")
|
||||
ENDIF(LMMS_BUILD_WIN64)
|
||||
|
||||
IF(NOT FREETYPE_INCLUDE_DIR_freetype2)
|
||||
SET(FREETYPE_INCLUDE_DIR_freetype2 ${FREETYPE_INCLUDE_DIR_ft2build}/freetype2)
|
||||
ENDIF()
|
||||
|
||||
ADD_CUSTOM_TARGET(libfltk COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/fltk && cd ${CMAKE_CURRENT_BINARY_DIR}/fltk && ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}/fltk ${FLTK_EXTRA_FLAGS} -DCMAKE_MODULE_PATH=${CMAKE_SOURCE_DIR}/cmake/modules/ -DFLTK_USE_SYSTEM_ZLIB:BOOL=ON -DFLTK_USE_SYSTEM_JPEG:BOOL=ON -DFLTK_USE_SYSTEM_PNG:BOOL=ON -DOPTION_BUILD_EXAMPLES:BOOL=OFF -DCMAKE_BUILD_TYPE=release -DFREETYPE_PATH="${FREETYPE_INCLUDE_DIR_freetype2}\;${FREETYPE_INCLUDE_DIR_ft2build}" && ${CMAKE_BUILD_TOOL})
|
||||
|
||||
ADD_DEPENDENCIES(RemoteZynAddSubFx libfltk)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* AutomatableModel.cpp - some implementations of AutomatableModel-class
|
||||
*
|
||||
* Copyright (c) 2008-2012 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -29,33 +29,28 @@
|
||||
#include "ControllerConnection.h"
|
||||
|
||||
|
||||
float AutomatableModel::__copiedValue = 0;
|
||||
float AutomatableModel::s_copiedValue = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
AutomatableModel::AutomatableModel( DataType _type,
|
||||
const float _val,
|
||||
const float _min,
|
||||
const float _max,
|
||||
const float _step,
|
||||
::Model * _parent,
|
||||
const QString & _display_name,
|
||||
bool _default_constructed ) :
|
||||
Model( _parent, _display_name, _default_constructed ),
|
||||
m_dataType( _type ),
|
||||
m_value( _val ),
|
||||
m_initValue( _val ),
|
||||
m_minValue( _min ),
|
||||
m_maxValue( _max ),
|
||||
m_step( _step ),
|
||||
m_range( _max - _min ),
|
||||
AutomatableModel::AutomatableModel( DataType type,
|
||||
const float val, const float min, const float max, const float step,
|
||||
Model* parent, const QString & displayName, bool defaultConstructed ) :
|
||||
Model( parent, displayName, defaultConstructed ),
|
||||
m_dataType( type ),
|
||||
m_value( val ),
|
||||
m_initValue( val ),
|
||||
m_minValue( min ),
|
||||
m_maxValue( max ),
|
||||
m_step( step ),
|
||||
m_range( max - min ),
|
||||
m_journalEntryReady( false ),
|
||||
m_setValueDepth( 0 ),
|
||||
m_hasLinkedModels( false ),
|
||||
m_controllerConnection( NULL )
|
||||
{
|
||||
setInitValue( _val );
|
||||
setInitValue( val );
|
||||
}
|
||||
|
||||
|
||||
@@ -88,55 +83,54 @@ bool AutomatableModel::isAutomated() const
|
||||
|
||||
|
||||
|
||||
void AutomatableModel::saveSettings( QDomDocument & _doc, QDomElement & _this,
|
||||
const QString & _name )
|
||||
void AutomatableModel::saveSettings( QDomDocument& doc, QDomElement& element, const QString& name )
|
||||
{
|
||||
if( isAutomated() )
|
||||
{
|
||||
QDomElement me = _doc.createElement( _name );
|
||||
QDomElement me = doc.createElement( name );
|
||||
me.setAttribute( "id", id() );
|
||||
me.setAttribute( "value", m_value );
|
||||
_this.appendChild( me );
|
||||
element.appendChild( me );
|
||||
}
|
||||
else
|
||||
{
|
||||
_this.setAttribute( _name, m_value );
|
||||
element.setAttribute( name, m_value );
|
||||
}
|
||||
|
||||
if( m_controllerConnection )
|
||||
{
|
||||
QDomElement controller_element;
|
||||
QDomNode node = _this.namedItem( "connection" );
|
||||
QDomElement controllerElement;
|
||||
QDomNode node = element.namedItem( "connection" );
|
||||
if( node.isElement() )
|
||||
{
|
||||
controller_element = node.toElement();
|
||||
controllerElement = node.toElement();
|
||||
}
|
||||
else
|
||||
{
|
||||
controller_element = _doc.createElement( "connection" );
|
||||
_this.appendChild( controller_element );
|
||||
controllerElement = doc.createElement( "connection" );
|
||||
element.appendChild( controllerElement );
|
||||
}
|
||||
QDomElement element = _doc.createElement( _name );
|
||||
m_controllerConnection->saveSettings( _doc, element );
|
||||
controller_element.appendChild( element );
|
||||
|
||||
QDomElement element = doc.createElement( name );
|
||||
m_controllerConnection->saveSettings( doc, element );
|
||||
|
||||
controllerElement.appendChild( element );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void AutomatableModel::loadSettings( const QDomElement & _this,
|
||||
const QString & _name )
|
||||
void AutomatableModel::loadSettings( const QDomElement& element, const QString& name )
|
||||
{
|
||||
// compat code
|
||||
QDomNode node = _this.namedItem( AutomationPattern::classNodeName() );
|
||||
QDomNode node = element.namedItem( AutomationPattern::classNodeName() );
|
||||
if( node.isElement() )
|
||||
{
|
||||
node = node.namedItem( _name );
|
||||
node = node.namedItem( name );
|
||||
if( node.isElement() )
|
||||
{
|
||||
AutomationPattern * p = AutomationPattern::
|
||||
globalAutomationPattern( this );
|
||||
AutomationPattern * p = AutomationPattern::globalAutomationPattern( this );
|
||||
p->loadSettings( node.toElement() );
|
||||
setValue( p->valueAt( 0 ) );
|
||||
// in older projects we sometimes have odd automations
|
||||
@@ -149,7 +143,7 @@ void AutomatableModel::loadSettings( const QDomElement & _this,
|
||||
}
|
||||
}
|
||||
|
||||
node = _this.namedItem( _name );
|
||||
node = element.namedItem( name );
|
||||
if( node.isElement() )
|
||||
{
|
||||
changeID( node.toElement().attribute( "id" ).toInt() );
|
||||
@@ -157,10 +151,10 @@ void AutomatableModel::loadSettings( const QDomElement & _this,
|
||||
return;
|
||||
}
|
||||
|
||||
node = _this.namedItem( "connection" );
|
||||
node = element.namedItem( "connection" );
|
||||
if( node.isElement() )
|
||||
{
|
||||
node = node.namedItem( _name );
|
||||
node = node.namedItem( name );
|
||||
if( node.isElement() )
|
||||
{
|
||||
setControllerConnection( new ControllerConnection( (Controller*)NULL ) );
|
||||
@@ -169,35 +163,37 @@ void AutomatableModel::loadSettings( const QDomElement & _this,
|
||||
}
|
||||
}
|
||||
|
||||
setInitValue( _this.attribute( _name ).toFloat() );
|
||||
if( element.hasAttribute( name ) )
|
||||
{
|
||||
setInitValue( element.attribute( name ).toFloat() );
|
||||
}
|
||||
else
|
||||
{
|
||||
reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void AutomatableModel::setValue( const float _value )
|
||||
void AutomatableModel::setValue( const float value )
|
||||
{
|
||||
++m_setValueDepth;
|
||||
const float old_val = m_value;
|
||||
|
||||
m_value = fittedValue( _value );
|
||||
m_value = fittedValue( value );
|
||||
if( old_val != m_value )
|
||||
{
|
||||
// add changes to history so user can undo it
|
||||
addJournalEntry( JournalEntry( 0, m_value - old_val ) );
|
||||
|
||||
// notify linked models
|
||||
for( AutoModelVector::Iterator it =
|
||||
m_linkedModels.begin();
|
||||
it != m_linkedModels.end(); ++it )
|
||||
for( AutoModelVector::Iterator it = m_linkedModels.begin(); it != m_linkedModels.end(); ++it )
|
||||
{
|
||||
if( (*it)->m_setValueDepth < 1 &&
|
||||
(*it)->fittedValue( _value ) !=
|
||||
(*it)->m_value )
|
||||
if( (*it)->m_setValueDepth < 1 && (*it)->fittedValue( value ) != (*it)->m_value )
|
||||
{
|
||||
bool journalling = (*it)->testAndSetJournalling(
|
||||
isJournalling() );
|
||||
(*it)->setValue( _value );
|
||||
bool journalling = (*it)->testAndSetJournalling( isJournalling() );
|
||||
(*it)->setValue( value );
|
||||
(*it)->setJournalling( journalling );
|
||||
}
|
||||
}
|
||||
@@ -213,13 +209,13 @@ void AutomatableModel::setValue( const float _value )
|
||||
|
||||
|
||||
|
||||
void AutomatableModel::setAutomatedValue( const float _value )
|
||||
void AutomatableModel::setAutomatedValue( const float value )
|
||||
{
|
||||
++m_setValueDepth;
|
||||
const float old_val = m_value;
|
||||
const float oldValue = m_value;
|
||||
|
||||
m_value = fittedValue( _value );
|
||||
if( old_val != m_value )
|
||||
m_value = fittedValue( value );
|
||||
if( oldValue != m_value )
|
||||
{
|
||||
// notify linked models
|
||||
for( AutoModelVector::Iterator it = m_linkedModels.begin();
|
||||
@@ -240,19 +236,20 @@ void AutomatableModel::setAutomatedValue( const float _value )
|
||||
|
||||
|
||||
|
||||
void AutomatableModel::setRange( const float _min, const float _max,
|
||||
const float _step )
|
||||
void AutomatableModel::setRange( const float min, const float max,
|
||||
const float step )
|
||||
{
|
||||
if( ( m_maxValue != _max ) || ( m_minValue != _min ) )
|
||||
if( ( m_maxValue != max ) || ( m_minValue != min ) )
|
||||
{
|
||||
m_minValue = _min;
|
||||
m_maxValue = _max;
|
||||
m_minValue = min;
|
||||
m_maxValue = max;
|
||||
if( m_minValue > m_maxValue )
|
||||
{
|
||||
qSwap<float>( m_minValue, m_maxValue );
|
||||
}
|
||||
m_range = m_maxValue - m_minValue;
|
||||
setStep( _step );
|
||||
|
||||
setStep( step );
|
||||
|
||||
// re-adjust value
|
||||
setInitValue( value<float>() );
|
||||
@@ -264,11 +261,11 @@ void AutomatableModel::setRange( const float _min, const float _max,
|
||||
|
||||
|
||||
|
||||
void AutomatableModel::setStep( const float _step )
|
||||
void AutomatableModel::setStep( const float step )
|
||||
{
|
||||
if( m_step != _step )
|
||||
if( m_step != step )
|
||||
{
|
||||
m_step = _step;
|
||||
m_step = step;
|
||||
emit propertiesChanged();
|
||||
}
|
||||
}
|
||||
@@ -276,63 +273,61 @@ void AutomatableModel::setStep( const float _step )
|
||||
|
||||
|
||||
|
||||
float AutomatableModel::fittedValue( float _value ) const
|
||||
float AutomatableModel::fittedValue( float value ) const
|
||||
{
|
||||
_value = tLimit<float>( _value, m_minValue, m_maxValue );
|
||||
value = tLimit<float>( value, m_minValue, m_maxValue );
|
||||
|
||||
if( m_step != 0 )
|
||||
{
|
||||
_value = roundf( _value / m_step ) * m_step;
|
||||
value = roundf( value / m_step ) * m_step;
|
||||
}
|
||||
else
|
||||
{
|
||||
_value = m_minValue;
|
||||
value = m_minValue;
|
||||
}
|
||||
|
||||
// correct rounding error at the border
|
||||
if( qAbs<float>( _value - m_maxValue ) <
|
||||
typeInfo<float>::minEps() * qAbs<float>( m_step ) )
|
||||
if( qAbs<float>( value - m_maxValue ) < typeInfo<float>::minEps() * qAbs<float>( m_step ) )
|
||||
{
|
||||
_value = m_maxValue;
|
||||
value = m_maxValue;
|
||||
}
|
||||
|
||||
// correct rounding error if value = 0
|
||||
if( qAbs<float>( _value ) < typeInfo<float>::minEps() *
|
||||
qAbs<float>( m_step ) )
|
||||
if( qAbs<float>( value ) < typeInfo<float>::minEps() * qAbs<float>( m_step ) )
|
||||
{
|
||||
_value = 0;
|
||||
value = 0;
|
||||
}
|
||||
|
||||
if( _value < m_minValue )
|
||||
if( value < m_minValue )
|
||||
{
|
||||
return m_minValue;
|
||||
}
|
||||
else if( _value > m_maxValue )
|
||||
else if( value > m_maxValue )
|
||||
{
|
||||
return m_maxValue;
|
||||
}
|
||||
|
||||
return _value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void AutomatableModel::redoStep( JournalEntry & _je )
|
||||
void AutomatableModel::redoStep( JournalEntry& je )
|
||||
{
|
||||
bool journalling = testAndSetJournalling( false );
|
||||
setValue( value<float>() + (float) _je.data().toDouble() );
|
||||
setValue( value<float>() + (float) je.data().toDouble() );
|
||||
setJournalling( journalling );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void AutomatableModel::undoStep( JournalEntry & _je )
|
||||
void AutomatableModel::undoStep( JournalEntry& je )
|
||||
{
|
||||
JournalEntry je( _je.actionID(), -_je.data().toDouble() );
|
||||
redoStep( je );
|
||||
JournalEntry inv( je.actionID(), -je.data().toDouble() );
|
||||
redoStep( inv );
|
||||
}
|
||||
|
||||
|
||||
@@ -355,8 +350,7 @@ void AutomatableModel::addJournalEntryFromOldToCurVal()
|
||||
restoreJournallingState();
|
||||
if( value<float>() != m_oldValue )
|
||||
{
|
||||
addJournalEntry( JournalEntry( 0, value<float>() -
|
||||
m_oldValue ) );
|
||||
addJournalEntry( JournalEntry( 0, value<float>() - m_oldValue ) );
|
||||
}
|
||||
m_journalEntryReady = false;
|
||||
}
|
||||
@@ -365,16 +359,16 @@ void AutomatableModel::addJournalEntryFromOldToCurVal()
|
||||
|
||||
|
||||
|
||||
void AutomatableModel::linkModel( AutomatableModel * _model )
|
||||
void AutomatableModel::linkModel( AutomatableModel* model )
|
||||
{
|
||||
if( !m_linkedModels.contains( _model ) )
|
||||
if( !m_linkedModels.contains( model ) )
|
||||
{
|
||||
m_linkedModels.push_back( _model );
|
||||
m_linkedModels.push_back( model );
|
||||
m_hasLinkedModels = true;
|
||||
if( !_model->m_hasLinkedModels )
|
||||
|
||||
if( !model->hasLinkedModels() )
|
||||
{
|
||||
QObject::connect( this, SIGNAL( dataChanged() ),
|
||||
_model, SIGNAL( dataChanged() ) );
|
||||
QObject::connect( this, SIGNAL( dataChanged() ), model, SIGNAL( dataChanged() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -382,10 +376,9 @@ void AutomatableModel::linkModel( AutomatableModel * _model )
|
||||
|
||||
|
||||
|
||||
void AutomatableModel::unlinkModel( AutomatableModel * _model )
|
||||
void AutomatableModel::unlinkModel( AutomatableModel* model )
|
||||
{
|
||||
AutoModelVector::Iterator it =
|
||||
qFind( m_linkedModels.begin(), m_linkedModels.end(), _model );
|
||||
AutoModelVector::Iterator it = qFind( m_linkedModels.begin(), m_linkedModels.end(), model );
|
||||
if( it != m_linkedModels.end() )
|
||||
{
|
||||
m_linkedModels.erase( it );
|
||||
@@ -398,21 +391,19 @@ void AutomatableModel::unlinkModel( AutomatableModel * _model )
|
||||
|
||||
|
||||
|
||||
void AutomatableModel::linkModels( AutomatableModel * _model1,
|
||||
AutomatableModel * _model2 )
|
||||
void AutomatableModel::linkModels( AutomatableModel* model1, AutomatableModel* model2 )
|
||||
{
|
||||
_model1->linkModel( _model2 );
|
||||
_model2->linkModel( _model1 );
|
||||
model1->linkModel( model2 );
|
||||
model2->linkModel( model1 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void AutomatableModel::unlinkModels( AutomatableModel * _model1,
|
||||
AutomatableModel * _model2 )
|
||||
void AutomatableModel::unlinkModels( AutomatableModel* model1, AutomatableModel* model2 )
|
||||
{
|
||||
_model1->unlinkModel( _model2 );
|
||||
_model2->unlinkModel( _model1 );
|
||||
model1->unlinkModel( model2 );
|
||||
model2->unlinkModel( model1 );
|
||||
}
|
||||
|
||||
|
||||
@@ -431,41 +422,37 @@ void AutomatableModel::unlinkAllModels()
|
||||
|
||||
|
||||
|
||||
void AutomatableModel::setControllerConnection( ControllerConnection * _c )
|
||||
void AutomatableModel::setControllerConnection( ControllerConnection* c )
|
||||
{
|
||||
m_controllerConnection = _c;
|
||||
if( _c )
|
||||
m_controllerConnection = c;
|
||||
if( c )
|
||||
{
|
||||
QObject::connect( m_controllerConnection,
|
||||
SIGNAL( valueChanged() ),
|
||||
this, SIGNAL( dataChanged() ) );
|
||||
QObject::connect( m_controllerConnection,
|
||||
SIGNAL( destroyed() ),
|
||||
this, SLOT( unlinkControllerConnection() ) );
|
||||
QObject::connect( m_controllerConnection, SIGNAL( valueChanged() ), this, SIGNAL( dataChanged() ) );
|
||||
QObject::connect( m_controllerConnection, SIGNAL( destroyed() ), this, SLOT( unlinkControllerConnection() ) );
|
||||
emit dataChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
float AutomatableModel::controllerValue( int _frameOffset ) const
|
||||
float AutomatableModel::controllerValue( int frameOffset ) const
|
||||
{
|
||||
if( m_controllerConnection )
|
||||
{
|
||||
const float v = m_minValue +
|
||||
( m_range * m_controllerConnection->currentValue(
|
||||
_frameOffset ) );
|
||||
const float v = minValue<float>() + ( range() * controllerConnection()->currentValue( frameOffset ) );
|
||||
if( typeInfo<float>::isEqual( m_step, 1 ) )
|
||||
{
|
||||
return qRound( v );
|
||||
}
|
||||
return v;
|
||||
}
|
||||
AutomatableModel * lm = m_linkedModels.first();
|
||||
if( lm->m_controllerConnection )
|
||||
|
||||
AutomatableModel* lm = m_linkedModels.first();
|
||||
if( lm->controllerConnection() )
|
||||
{
|
||||
return lm->controllerValue( _frameOffset );
|
||||
return lm->controllerValue( frameOffset );
|
||||
}
|
||||
|
||||
return lm->m_value;
|
||||
}
|
||||
|
||||
@@ -485,13 +472,13 @@ void AutomatableModel::unlinkControllerConnection()
|
||||
|
||||
|
||||
|
||||
void AutomatableModel::setInitValue( const float _value )
|
||||
void AutomatableModel::setInitValue( const float value )
|
||||
{
|
||||
m_initValue = fittedValue( _value );
|
||||
m_initValue = fittedValue( value );
|
||||
bool journalling = testAndSetJournalling( false );
|
||||
setValue( _value );
|
||||
setValue( value );
|
||||
setJournalling( journalling );
|
||||
emit initValueChanged( _value );
|
||||
emit initValueChanged( value );
|
||||
}
|
||||
|
||||
|
||||
@@ -507,7 +494,7 @@ void AutomatableModel::reset()
|
||||
|
||||
void AutomatableModel::copyValue()
|
||||
{
|
||||
__copiedValue = value<float>();
|
||||
s_copiedValue = value<float>();
|
||||
}
|
||||
|
||||
|
||||
@@ -515,7 +502,7 @@ void AutomatableModel::copyValue()
|
||||
|
||||
void AutomatableModel::pasteValue()
|
||||
{
|
||||
setValue( __copiedValue );
|
||||
setValue( copiedValue() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -102,10 +102,10 @@ void AutomationPattern::addObject( AutomatableModel * _obj, bool _search_dup )
|
||||
|
||||
if( addIt )
|
||||
{
|
||||
// been empty before?
|
||||
if( m_objects.isEmpty() && hasAutomation() == false )
|
||||
// been empty before and model's current value is not its init value?
|
||||
if( m_objects.isEmpty() && hasAutomation() == false && _obj->isAtInitValue() == false )
|
||||
{
|
||||
// then initialize default value
|
||||
// then initialize first value
|
||||
putValue( 0, _obj->value<float>(), false );
|
||||
}
|
||||
|
||||
@@ -449,31 +449,29 @@ trackContentObjectView * AutomationPattern::createView( trackView * _tv )
|
||||
|
||||
bool AutomationPattern::isAutomated( const AutomatableModel * _m )
|
||||
{
|
||||
TrackContainer::TrackList l = engine::getSong()->tracks() +
|
||||
engine::getBBTrackContainer()->tracks();
|
||||
TrackContainer::TrackList l;
|
||||
l += engine::getSong()->tracks();
|
||||
l += engine::getBBTrackContainer()->tracks();
|
||||
l += engine::getSong()->globalAutomationTrack();
|
||||
for( TrackContainer::TrackList::const_iterator it = l.begin();
|
||||
it != l.end(); ++it )
|
||||
|
||||
for( TrackContainer::TrackList::ConstIterator it = l.begin(); it != l.end(); ++it )
|
||||
{
|
||||
if( ( *it )->type() == track::AutomationTrack ||
|
||||
( *it )->type() == track::HiddenAutomationTrack )
|
||||
{
|
||||
const track::tcoVector & v = ( *it )->getTCOs();
|
||||
for( track::tcoVector::const_iterator j = v.begin();
|
||||
j != v.end(); ++j )
|
||||
for( track::tcoVector::ConstIterator j = v.begin(); j != v.end(); ++j )
|
||||
{
|
||||
const AutomationPattern * a =
|
||||
dynamic_cast<const AutomationPattern *>( *j );
|
||||
const AutomationPattern * a = dynamic_cast<const AutomationPattern *>( *j );
|
||||
if( a && a->hasAutomation() )
|
||||
{
|
||||
for( objectVector::const_iterator k = a->m_objects.begin();
|
||||
k != a->m_objects.end(); ++k )
|
||||
{
|
||||
if( *k == _m )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for( objectVector::const_iterator k = a->m_objects.begin(); k != a->m_objects.end(); ++k )
|
||||
{
|
||||
if( *k == _m )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||