Skip to content

Commit

Permalink
Merge pull request #2 from LMMS/master
Browse files Browse the repository at this point in the history
Master
  • Loading branch information
LostRobotMusic authored Jan 3, 2019
2 parents 4252f75 + 5ebe0e0 commit a2b123e
Show file tree
Hide file tree
Showing 11 changed files with 175 additions and 340 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ build_script:
- cd build
- ps: $env:CMAKE_PLATFORM="$(if ($env:PLATFORM -eq 'x64') { 'x64' } else { '' })"
- ps: $env:QT_SUFFIX="$(if ($env:PLATFORM -eq 'x64') { '_64' } else { '' })"
- cmake -DUSE_COMPILE_CACHE=ON -DCACHE_TOOL=%APPVEYOR_BUILD_FOLDER%/clcache.4.1.0/clcache-4.1.0/clcache.exe -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=c:/Qt/5.9.5/msvc2015%QT_SUFFIX%;c:/tools/vcpkg/installed/%PLATFORM%-windows -DCMAKE_GENERATOR_PLATFORM="%CMAKE_PLATFORM%" ..
- cmake -DUSE_COMPILE_CACHE=ON -DCACHE_TOOL=%APPVEYOR_BUILD_FOLDER%/clcache.4.1.0/clcache-4.1.0/clcache.exe -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=c:/Qt/5.9/msvc2015%QT_SUFFIX%;c:/tools/vcpkg/installed/%PLATFORM%-windows -DCMAKE_GENERATOR_PLATFORM="%CMAKE_PLATFORM%" ..
- cmake --build . -- /maxcpucount:4
- cmake --build . --target tests
cache:
Expand Down
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ shared:
name: Initialize
command: |
mkdir -p /tmp/artifacts
# Workaround for failing submodule fetching
git config --global --unset url."ssh://[email protected]".insteadOf || true
# Commmon environment variables
common_environment: &common_environment
Expand All @@ -54,6 +56,9 @@ jobs:
../cmake/build_win32.sh
make lmms
make
- run:
name: Build tests
command: cd build && make tests
- *ccache_stats
- *save_cache
mingw64:
Expand All @@ -71,6 +76,9 @@ jobs:
mkdir build && cd build
../cmake/build_win64.sh
make
- run:
name: Build tests
command: cd build && make tests
- *ccache_stats
- *save_cache
linux.gcc:
Expand Down
4 changes: 1 addition & 3 deletions .travis/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ else
"$TRAVIS_BUILD_DIR/.travis/$TRAVIS_OS_NAME.$TARGET_OS.script.sh"

make -j4
make tests

if [[ $TARGET_OS != win* ]]; then

make tests
tests/tests

fi

# Package and upload non-tagged builds
Expand Down
2 changes: 1 addition & 1 deletion cmake/toolchains/common/Ubuntu-MinGW-W64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)

set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
SET(PKG_CONFIG_EXECUTABLE /usr/bin/${TOOLCHAIN_PREFIX}-pkg-config)
SET(ENV{PKG_CONFIG} /usr/bin/${TOOLCHAIN_PREFIX}-pkg-config)

IF(WIN64)
SET(TOOLCHAIN_PREFIX32 ${CMAKE_SYSTEM_PROCESSOR32}-w64-mingw32)
Expand Down
4 changes: 2 additions & 2 deletions cmake/toolchains/common/Ubuntu-MinGW-X-Trusty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ SET(CMAKE_RC_COMPILER ${MINGW_TOOL_PREFIX}windres)

# Mingw tools
SET(STRIP ${MINGW_TOOL_PREFIX}strip)
SET(PKG_CONFIG_EXECUTABLE ${MINGW_TOOL_PREFIX}pkg-config)
SET(ENV{PKG_CONFIG} ${MINGW_TOOL_PREFIX}pkg-config)

# For 32-bit vst support
IF(WIN64)
Expand All @@ -45,7 +45,7 @@ IF(NOT DEFINED ENV{MINGW_DEBUG_INFO})
MESSAGE("* CMAKE_C_COMPILER : ${CMAKE_C_COMPILER}")
MESSAGE("* CMAKE_CXX_COMPILER : ${CMAKE_CXX_COMPILER}")
MESSAGE("* CMAKE_RC_COMPILER : ${CMAKE_RC_COMPILER}")
MESSAGE("* PKG_CONFIG_EXECUTABLE : ${PKG_CONFIG_EXECUTABLE}")
MESSAGE("* ENV{PKG_CONFIG} : $ENV{PKG_CONFIG}")
MESSAGE("* MINGW_TOOL_PREFIX32 : ${MINGW_TOOL_PREFIX32}")
MESSAGE("* CMAKE_C_COMPILER32 : ${CMAKE_C_COMPILER32}")
MESSAGE("* CMAKE_CXX_COMPILER32 : ${CMAKE_CXX_COMPILER32}")
Expand Down
2 changes: 2 additions & 0 deletions include/AutomatableModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ public slots:


private:
static bool mustQuoteName(const QString &name);

virtual void saveSettings( QDomDocument& doc, QDomElement& element )
{
saveSettings( doc, element, "value" );
Expand Down
3 changes: 2 additions & 1 deletion plugins/LadspaEffect/calf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ LIST(SORT SOURCES)
# Skip files matching pattern
SET(FILE_PATTERNS "ctl;gui;gtk;session;connector;jack;rdf;draw;fluid;preset;lv2;benchmark;win;plugin.cpp")
FOREACH(_item ${SOURCES})
GET_FILENAME_COMPONENT(m_basename ${_item} NAME)
FOREACH(_pattern ${FILE_PATTERNS})
IF(${_item} MATCHES ${_pattern})
IF(${m_basename} MATCHES ${_pattern})
LIST(REMOVE_ITEM SOURCES ${_item})
ENDIF()
ENDFOREACH()
Expand Down
9 changes: 6 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,15 @@ TARGET_INCLUDE_DIRECTORIES(lmms
PUBLIC ${CMAKE_CURRENT_BINARY_DIR}
)

# GENERATE_EXPORT_HEADER doesn't do this automatically for OBJECT libraries
# CMake doesn't define target_EXPORTS for OBJECT libraries.
# See the documentation of DEFINE_SYMBOL for details.
# Also add LMMS_STATIC_DEFINE for targets linking against it.
TARGET_COMPILE_DEFINITIONS(lmmsobjs
PRIVATE -Dlmmsobjs_EXPORTS
INTERFACE -DLMMS_STATIC_DEFINE
)
TARGET_COMPILE_DEFINITIONS(lmms
PRIVATE -Dlmmsobjs_EXPORTS
PRIVATE $<TARGET_PROPERTY:lmmsobjs,INTERFACE_COMPILE_DEFINITIONS>
)

# Set Visual Studio startup project to lmms
Expand Down Expand Up @@ -389,4 +392,4 @@ ELSE(NOT MSVC)
# "${VCPKG_ROOT}/bin/libsoundio.dll"
# DESTINATION .)
#ENDIF()
ENDIF(NOT MSVC)
ENDIF(NOT MSVC)
44 changes: 39 additions & 5 deletions src/core/AutomatableModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,23 @@ bool AutomatableModel::isAutomated() const
}



bool AutomatableModel::mustQuoteName(const QString& name)
{
QRegExp reg("^[A-Za-z0-9._-]+$");
return !reg.exactMatch(name);
}

void AutomatableModel::saveSettings( QDomDocument& doc, QDomElement& element, const QString& name )
{
bool mustQuote = mustQuoteName(name);

if( isAutomated() || m_scaleType != Linear )
{
// automation needs tuple of data (name, id, value)
// scale type also needs an extra value
// => it must be appended as a node

QRegExp reg("^[A-Za-z0-9._-]+$");
bool mustQuote = !reg.exactMatch(name);
QDomElement me = doc.createElement( mustQuote ? QString("automatablemodel") : name );
me.setAttribute( "id", ProjectJournal::idToSave( id() ) );
me.setAttribute( "value", m_value );
Expand All @@ -110,8 +117,18 @@ void AutomatableModel::saveSettings( QDomDocument& doc, QDomElement& element, co
}
else
{
// non automation, linear scale (default), can be saved as attribute
element.setAttribute( name, m_value );
if(mustQuote)
{
QDomElement me = doc.createElement( "automatablemodel" );
me.setAttribute( "nodename", name );
me.setAttribute( "value", m_value );
element.appendChild( me );
}
else
{
// non automation, linear scale (default), can be saved as attribute
element.setAttribute( name, m_value );
}
}

if( m_controllerConnection && m_controllerConnection->getController()->type()
Expand All @@ -131,7 +148,13 @@ void AutomatableModel::saveSettings( QDomDocument& doc, QDomElement& element, co
element.appendChild( controllerElement );
}

QDomElement element = doc.createElement( name );
bool mustQuote = mustQuoteName(name);
QString elementName = mustQuote ? "controllerconnection"
: name;

QDomElement element = doc.createElement( elementName );
if(mustQuote)
element.setAttribute( "nodename", name );
m_controllerConnection->saveSettings( doc, element );

controllerElement.appendChild( element );
Expand Down Expand Up @@ -170,6 +193,17 @@ void AutomatableModel::loadSettings( const QDomElement& element, const QString&
if( connectionNode.isElement() )
{
QDomNode thisConnection = connectionNode.toElement().namedItem( name );
if( !thisConnection.isElement() )
{
thisConnection = connectionNode.toElement().namedItem( "controllerconnection" );
QDomElement tcElement = thisConnection.toElement();
// sanity check
if( tcElement.isNull() || tcElement.attribute( "nodename" ) != name )
{
// no, that wasn't it, act as if we never found one
thisConnection.clear();
}
}
if( thisConnection.isElement() )
{
setControllerConnection( new ControllerConnection( (Controller*)NULL ) );
Expand Down
Loading

0 comments on commit a2b123e

Please sign in to comment.