From 1a2123f69d37be43da3b71f6763f5e5c60f53067 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sat, 26 Jul 2008 19:06:58 +0000 Subject: [PATCH] less header-dependencies and moved some type-definitions git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1373 0778d3d1-df1d-0410-868b-ea421aaaa00d --- CMakeLists.txt | 3 ++- ChangeLog | 2 +- cmake/modules/BuildPlugin.cmake | 1 + include/base64.h | 2 +- include/instrument_track.h | 6 +++--- include/lmms_math.h | 13 ++++++++++++- include/midi.h | 2 +- include/serializing_object.h | 12 ++++++------ plugins/flp_import/CMakeLists.txt | 2 +- plugins/stk/mallets/CMakeLists.txt | 1 + src/core/serializing_object.cpp | 14 ++++++++++++++ src/tracks/instrument_track.cpp | 6 +++--- 12 files changed, 46 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 009792c15..564c24b48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -304,7 +304,7 @@ ADD_FILE_DEPENDENCIES(lmmsconfig.h ${lmms_MOC_out}) ADD_CUSTOM_COMMAND(OUTPUT ${ER_H} COMMAND ${BIN2RES} ARGS ${lmms_EMBEDDED_RESOURCES} > ${ER_H} DEPENDS ${BIN2RES}) -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes -fno-exceptions ${CXXFLAGS}") IF(NOT WIN32) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") ENDIF(NOT WIN32) @@ -416,3 +416,4 @@ SET(CPACK_PACKAGE_EXECUTABLES "lmms" "LMMS binary") SET(CPACK_SOURCE_GENERATOR "TBZ2") SET(CPACK_SOURCE_PACKAGE_FILE_NAME "lmms-${VERSION}") INCLUDE(CPack) + diff --git a/ChangeLog b/ChangeLog index 7127b5380..51da08eef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2008-07-25 Tobias Doerffel +2008-07-26 Tobias Doerffel * plugins/organic/organic.cpp: * plugins/triple_oscillator/triple_oscillator.cpp: diff --git a/cmake/modules/BuildPlugin.cmake b/cmake/modules/BuildPlugin.cmake index 2ad3732a4..1c7ca9be8 100644 --- a/cmake/modules/BuildPlugin.cmake +++ b/cmake/modules/BuildPlugin.cmake @@ -72,6 +72,7 @@ MACRO(BUILD_PLUGIN) FOREACH(f ${PLUGIN_SOURCES}) ADD_FILE_DEPENDENCIES(${f} ${ER_H} ${plugin_MOC_out} ${plugin_UIC_out}) ENDFOREACH(f) +# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -i-static") IF(LMMS_BUILD_WIN32) LINK_DIRECTORIES(${CMAKE_BINARY_DIR}) LINK_LIBRARIES(-llmms ${QT_LIBRARIES}) diff --git a/include/base64.h b/include/base64.h index 8d02a2d0b..4f54701c8 100644 --- a/include/base64.h +++ b/include/base64.h @@ -51,6 +51,6 @@ namespace base64 QVariant decode( const QString & _b64, QVariant::Type _force_type = QVariant::Invalid ); -} ; +} #endif diff --git a/include/instrument_track.h b/include/instrument_track.h index 3922396b0..e9cf2bcac 100644 --- a/include/instrument_track.h +++ b/include/instrument_track.h @@ -180,9 +180,9 @@ private: QList m_processHandles; - floatModel m_volumeModel; - floatModel m_panningModel; - floatModel m_pitchModel; + intModel m_volumeModel; + intModel m_panningModel; + intModel m_pitchModel; intModel m_effectChannelModel; diff --git a/include/lmms_math.h b/include/lmms_math.h index cd9880abf..108a8d7eb 100644 --- a/include/lmms_math.h +++ b/include/lmms_math.h @@ -1,7 +1,7 @@ /* * lmms_math.h - defines math functions * - * Copyright (c) 2004-2006 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -27,7 +27,17 @@ #define _LMMS_MATH_H +#ifdef __INTEL_COMPILER +#include + +// Equivalent to _x - floorf( _x ) +static inline float fraction( const float _x ) +{ + return( _x - ( _x >= 0.0f ? floorf( _x ) : floorf( _x ) - 1 ) ); +} + +#else // Equivalent to _x - floorf( _x ) static inline float fraction( const float _x ) @@ -36,6 +46,7 @@ static inline float fraction( const float _x ) static_cast( _x ) - 1 ) ); } +#endif diff --git a/include/midi.h b/include/midi.h index 940243150..59e88a38f 100644 --- a/include/midi.h +++ b/include/midi.h @@ -58,7 +58,7 @@ enum MidiEventTypes MidiActiveSensing = 0xFE, MidiSystemReset = 0xFF, // meta event - for midi files only - MidiMetaEvent = 0xFF, + MidiMetaEvent = 0xFF } ; enum MidiMetaEvents diff --git a/include/serializing_object.h b/include/serializing_object.h index eaa28c9d1..da8cb4e28 100644 --- a/include/serializing_object.h +++ b/include/serializing_object.h @@ -62,13 +62,13 @@ public: protected: // to be implemented by sub-objects - virtual void saveSettings( QDomDocument & _doc, QDomElement & _this ) - { - } + virtual void saveSettings( QDomDocument & _doc, QDomElement & _this ); +// { +// } - virtual void loadSettings( const QDomElement & _this ) - { - } + virtual void loadSettings( const QDomElement & _this ); +// { +// } private: diff --git a/plugins/flp_import/CMakeLists.txt b/plugins/flp_import/CMakeLists.txt index 2dfeb3d19..9b13c0b4a 100644 --- a/plugins/flp_import/CMakeLists.txt +++ b/plugins/flp_import/CMakeLists.txt @@ -2,4 +2,4 @@ INCLUDE(BuildPlugin) INCLUDE_DIRECTORIES(unrtf) -BUILD_PLUGIN(flpimport flp_import.cpp flp_import.h MOCFILES EMBEDDED_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.png) +BUILD_PLUGIN(flpimport flp_import.cpp flp_import.h) diff --git a/plugins/stk/mallets/CMakeLists.txt b/plugins/stk/mallets/CMakeLists.txt index 63fcf8af6..d25973ddb 100644 --- a/plugins/stk/mallets/CMakeLists.txt +++ b/plugins/stk/mallets/CMakeLists.txt @@ -1,4 +1,5 @@ INCLUDE(BuildPlugin) INCLUDE_DIRECTORIES(${STK_INCLUDE_DIR}) LINK_LIBRARIES(${STK_LIBRARY}) +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions") BUILD_PLUGIN(malletsstk mallets.cpp mallets.h MOCFILES mallets.h EMBEDDED_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.png) diff --git a/src/core/serializing_object.cpp b/src/core/serializing_object.cpp index fa8e5bdb6..37754002a 100644 --- a/src/core/serializing_object.cpp +++ b/src/core/serializing_object.cpp @@ -76,3 +76,17 @@ void serializingObject::setHook( serializingObjectHook * _hook ) } + + +void serializingObject::saveSettings( QDomDocument & _doc, QDomElement & _this ) +{ +} + + + + +void serializingObject::loadSettings( const QDomElement & _this ) +{ +} + + diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index 26f31f4fd..0ef8cc3f3 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -101,11 +101,11 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) : this, this ), m_notes(), m_baseNoteModel( 0, 0, KeysPerOctave * NumOctaves - 1, this ), - m_volumeModel( DefaultVolume, MinVolume, MaxVolume, 1.0f, this, + m_volumeModel( DefaultVolume, MinVolume, MaxVolume, this, tr( "Volume" ) ), - m_panningModel( DefaultPanning, PanningLeft, PanningRight, 1.0f, + m_panningModel( DefaultPanning, PanningLeft, PanningRight, this, tr( "Panning" ) ), - m_pitchModel( 0, -100, 100, 1, this, tr( "Pitch" ) ), + m_pitchModel( 0, -100, 100, this, tr( "Pitch" ) ), m_effectChannelModel( 0, 0, NumFxChannels, this, tr( "FX channel" ) ), m_instrument( NULL ), m_soundShaping( this ),