Use Qt's Resource System (2nd approach) (#1891)
* Remove bin2res, use Qt's resource system * Use QDir search paths and QImageReader in getIconPixmap * Don't include "embed.cpp" in plugins * getIconPixmap: Use QPixmapCache, use QPixmap::fromImageReader * Require CMake 2.8.9 * Fix ReverbSC embed usage
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9)
|
||||
|
||||
PROJECT(lmms)
|
||||
|
||||
@@ -456,17 +456,6 @@ FILE(REMOVE include/lmmsconfig.h)
|
||||
FILE(GLOB LMMS_INCLUDES "${CMAKE_SOURCE_DIR}/include/*.h")
|
||||
LIST(SORT LMMS_INCLUDES)
|
||||
|
||||
# embedded resources stuff
|
||||
IF(WIN32 OR WIN64)
|
||||
# compile buildtools native
|
||||
SET(BIN2RES_CPP "${CMAKE_SOURCE_DIR}/buildtools/bin2res.cpp")
|
||||
SET(BIN2RES "${CMAKE_BINARY_DIR}/bin2res")
|
||||
ADD_CUSTOM_TARGET(bin2res COMMAND g++ "\"${BIN2RES_CPP}\"" -o "\"${BIN2RES}\"" DEPENDS "${BIN2RES_CPP}")
|
||||
ELSE(WIN32 OR WIN64)
|
||||
ADD_EXECUTABLE(bin2res buildtools/bin2res.cpp)
|
||||
GET_TARGET_PROPERTY(BIN2RES bin2res LOCATION)
|
||||
ENDIF(WIN32 OR WIN64)
|
||||
|
||||
# we somehow have to make LMMS-binary depend on MOC-files
|
||||
ADD_FILE_DEPENDENCIES("${CMAKE_BINARY_DIR}/lmmsconfig.h")
|
||||
|
||||
|
||||
@@ -1,212 +0,0 @@
|
||||
/*
|
||||
* bin2res.cpp - generate embedded resources from binary data (based on qembed)
|
||||
*
|
||||
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
static void embedData( const char * _input, int _size, std::ostream & _output );
|
||||
static std::string convertFileNameToCIdentifier( const std::string & _s );
|
||||
|
||||
|
||||
struct embed
|
||||
{
|
||||
unsigned int size;
|
||||
std::string name;
|
||||
std::string cname;
|
||||
} ;
|
||||
|
||||
typedef std::vector<std::string> stringlist;
|
||||
|
||||
const int MAX_FILE_SIZE = 256*256*256; // = 16 MB
|
||||
|
||||
|
||||
int main( int argc, char * * argv )
|
||||
{
|
||||
if( argc < 2 )
|
||||
{
|
||||
std::cerr << "Usage:" << std::endl << "\t" << argv[0] <<
|
||||
" files" << std::endl;
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
std::cout << "// Generated by bin2res" << std::endl;
|
||||
|
||||
std::vector<embed *> embedded_data;
|
||||
|
||||
std::cout << "#ifndef _EMBEDDED_RESOURCES_H" << std::endl;
|
||||
std::cout << "#define _EMBEDDED_RESOURCES_H" << std::endl;
|
||||
|
||||
stringlist files;
|
||||
for( int i = 1; i < argc; ++i )
|
||||
{
|
||||
files.push_back( std::string( argv[i] ) );
|
||||
}
|
||||
for( stringlist::iterator it = files.begin(); it != files.end(); ++it )
|
||||
{
|
||||
std::ifstream f( it->c_str(), std::ios::binary );
|
||||
if( f.fail() )
|
||||
{
|
||||
std::cerr << "Cannot open file " << *it <<
|
||||
", ignoring it" << std::endl;
|
||||
continue;
|
||||
}
|
||||
f.seekg( 0, std::ios::end );
|
||||
int fsize = f.tellg();
|
||||
f.seekg( 0 );
|
||||
if( fsize == 0 || fsize > MAX_FILE_SIZE )
|
||||
{
|
||||
std::cerr << "File " << *it << " has zero size or is "
|
||||
"too large to be processed with bin2res." <<
|
||||
std::endl;
|
||||
}
|
||||
char * data = new char[fsize];
|
||||
f.read( data, fsize );
|
||||
embed * e = new embed;
|
||||
e->size = fsize;
|
||||
if( it->rfind( '/' ) != std::string::npos )
|
||||
{
|
||||
e->name = std::string( it->c_str() +
|
||||
it->rfind( '/' ) + 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
e->name = *it;
|
||||
}
|
||||
e->cname = convertFileNameToCIdentifier( e->name );
|
||||
embedded_data.push_back( e );
|
||||
std::string s;
|
||||
std::cout << "static const unsigned char " << e->cname <<
|
||||
"_data[] = {";
|
||||
embedData( data, fsize, std::cout );
|
||||
std::cout << std::endl << "};" << std::endl << std::endl;
|
||||
delete[] data;
|
||||
}
|
||||
|
||||
if( embedded_data.size() > 0 )
|
||||
{
|
||||
std::cout << "static const unsigned char dummy_data[] ="
|
||||
"{ 0x00 };" << std::endl << std::endl;
|
||||
embed * dummy = new embed;
|
||||
dummy->size = 1;
|
||||
dummy->name = "dummy";
|
||||
dummy->cname = convertFileNameToCIdentifier(
|
||||
std::string( "dummy" ) );
|
||||
embedded_data.push_back( dummy );
|
||||
|
||||
std::cout << "#include <string.h>" << std::endl << std::endl;
|
||||
std::cout << "#include \"embed.h\"" << std::endl << std::endl;
|
||||
std::cout << "static embed::descriptor embed_vec[] = {" << std::endl;
|
||||
/* << "{" << std::endl
|
||||
<< " int size;" << std::endl
|
||||
<< " const unsigned char * data;" <<
|
||||
std::endl
|
||||
<< " const char * name;" << std::endl
|
||||
<< "} embed_vec[] = {" << std::endl;*/
|
||||
while( embedded_data.size() > 0 )
|
||||
{
|
||||
embed * e = embedded_data[0];
|
||||
std::cout << " { " << e->size << ", " << e->cname <<
|
||||
"_data, " << "\"" << e->name <<
|
||||
"\" }," << std::endl;
|
||||
delete e;
|
||||
embedded_data.erase( embedded_data.begin() );
|
||||
}
|
||||
std::cout << " { 0, 0, 0 }" << std::endl << "};" << std::endl
|
||||
<< std::endl
|
||||
<< "static const embed::descriptor & "
|
||||
"findEmbeddedData( const char * _name )"
|
||||
<< std::endl << "{" << std::endl
|
||||
<< " for( int i = 0; embed_vec[i].data; "
|
||||
"i++ )" << std::endl
|
||||
<< " {" << std::endl
|
||||
<< " if( strcmp( embed_vec[i].name, "
|
||||
"_name ) == 0 )" << std::endl
|
||||
<< " {" << std::endl
|
||||
<< " return( "
|
||||
"embed_vec[i] );" << std::endl
|
||||
<< " }" << std::endl
|
||||
<< " }" << std::endl
|
||||
/* << " printf( \"warning: embedded resource "
|
||||
"%s not found!\\n\", _name );"
|
||||
<< std::endl*/
|
||||
<< " return( findEmbeddedData( "
|
||||
"\"dummy\" ) );" << std::endl
|
||||
<< "}" << std::endl << std::endl;
|
||||
}
|
||||
std::cout << "#endif" << std::endl;
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
std::string convertFileNameToCIdentifier( const std::string & _s )
|
||||
{
|
||||
std::string r = _s;
|
||||
int len = r.length();
|
||||
if ( len > 0 && !isalpha( (char)r[0] ) )
|
||||
{
|
||||
r[0] = '_';
|
||||
}
|
||||
for ( int i = 1; i < len; i++ )
|
||||
{
|
||||
if ( !isalnum( (char)r[i] ) )
|
||||
{
|
||||
r[i] = '_';
|
||||
}
|
||||
}
|
||||
return( r );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void embedData( const char * _input, int _nbytes, std::ostream & _output )
|
||||
{
|
||||
static const char hexdigits[] = "0123456789abcdef";
|
||||
std::string s;
|
||||
for( int i = 0; i < _nbytes; i++ )
|
||||
{
|
||||
if( ( i%14 ) == 0 )
|
||||
{
|
||||
s += "\n ";
|
||||
_output << s;
|
||||
s = "";
|
||||
}
|
||||
unsigned int v = _input[i];
|
||||
s += "0x";
|
||||
s += hexdigits[(v >> 4) & 15];
|
||||
s += hexdigits[v & 15];
|
||||
if( i < _nbytes-1 )
|
||||
{
|
||||
s += ',';
|
||||
}
|
||||
}
|
||||
if ( s.length() )
|
||||
{
|
||||
_output << s;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
# description: build LMMS-plugin
|
||||
# usage: BUILD_PLUGIN(<PLUGIN_NAME> <PLUGIN_SOURCES> MOCFILES <HEADERS_FOR_MOC> EMBEDDED_RESOURCES <LIST_OF_FILES_TO_EMBED> UICFILES <UI_FILES_TO_COMPILE> LINK <SHARED|MODULE>)
|
||||
|
||||
INCLUDE(GenQrc)
|
||||
|
||||
MACRO(BUILD_PLUGIN PLUGIN_NAME)
|
||||
CMAKE_PARSE_ARGUMENTS(PLUGIN "" "" "MOCFILES;EMBEDDED_RESOURCES;UICFILES;LINK" ${ARGN})
|
||||
SET(PLUGIN_SOURCES ${PLUGIN_UNPARSED_ARGUMENTS})
|
||||
@@ -25,11 +27,7 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
|
||||
ENDFOREACH()
|
||||
SET(PLUGIN_EMBEDDED_RESOURCES ${NEW_ARGS})
|
||||
|
||||
SET(ER_H ${CMAKE_CURRENT_BINARY_DIR}/embedded_resources.h)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${ER_H}
|
||||
COMMAND ${BIN2RES}
|
||||
ARGS ${PLUGIN_EMBEDDED_RESOURCES} > ${ER_H}
|
||||
DEPENDS bin2res)
|
||||
ADD_GEN_QRC(RCC_OUT "${PLUGIN_NAME}.qrc" PREFIX artwork/${PLUGIN_NAME} ${PLUGIN_EMBEDDED_RESOURCES})
|
||||
ENDIF(ER_LEN)
|
||||
|
||||
IF(QT5)
|
||||
@@ -41,7 +39,7 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
|
||||
ENDIF()
|
||||
|
||||
FOREACH(f ${PLUGIN_SOURCES})
|
||||
ADD_FILE_DEPENDENCIES(${f} ${ER_H} ${plugin_UIC_out})
|
||||
ADD_FILE_DEPENDENCIES(${f} ${RCC_OUT} ${plugin_UIC_out})
|
||||
ENDFOREACH(f)
|
||||
|
||||
IF(LMMS_BUILD_APPLE)
|
||||
@@ -58,11 +56,11 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
|
||||
ENDIF()
|
||||
|
||||
IF ("${PLUGIN_LINK}" STREQUAL "SHARED")
|
||||
ADD_LIBRARY(${PLUGIN_NAME} SHARED ${PLUGIN_SOURCES} ${plugin_MOC_out})
|
||||
ADD_LIBRARY(${PLUGIN_NAME} SHARED ${PLUGIN_SOURCES} ${plugin_MOC_out} ${RCC_OUT})
|
||||
ELSE ()
|
||||
ADD_LIBRARY(${PLUGIN_NAME} MODULE ${PLUGIN_SOURCES} ${plugin_MOC_out})
|
||||
ADD_LIBRARY(${PLUGIN_NAME} MODULE ${PLUGIN_SOURCES} ${plugin_MOC_out} ${RCC_OUT})
|
||||
ENDIF ()
|
||||
|
||||
|
||||
IF(QT5)
|
||||
TARGET_LINK_LIBRARIES(${PLUGIN_NAME} Qt5::Widgets Qt5::Xml)
|
||||
ENDIF()
|
||||
@@ -81,6 +79,6 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
|
||||
ADD_CUSTOM_COMMAND(TARGET ${PLUGIN_NAME} POST_BUILD COMMAND ${STRIP} $<TARGET_FILE:${PLUGIN_NAME}>)
|
||||
ENDIF(LMMS_BUILD_WIN32)
|
||||
|
||||
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${ER_H} ${plugin_MOC_out}")
|
||||
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${RCC_OUT} ${plugin_MOC_out}")
|
||||
ENDMACRO(BUILD_PLUGIN)
|
||||
|
||||
|
||||
57
cmake/modules/GenQrc.cmake
Normal file
57
cmake/modules/GenQrc.cmake
Normal file
@@ -0,0 +1,57 @@
|
||||
# GenQrc.cmake - Copyright (c) 2015 Lukas W <lukaswhl/at/gmail.com>
|
||||
|
||||
# Generates a simple qrc file containing the given resource files ${ARGN}:
|
||||
# GEN_QRC(resources.qrc artwork.png icon.png PREFIX /icons)
|
||||
# Files may also be added using a pattern with the GLOB keyword, e.g.:
|
||||
# GEN_QRC(resources.qrc GLOB *.png)
|
||||
FUNCTION(GEN_QRC OUT_FILE)
|
||||
CMAKE_PARSE_ARGUMENTS(RC "" "PREFIX;GLOB" "" ${ARGN})
|
||||
|
||||
IF(DEFINED RC_GLOB)
|
||||
FILE(GLOB GLOB_FILES ${RC_GLOB})
|
||||
ENDIF()
|
||||
|
||||
# Set the standard prefix to "/" if none is given
|
||||
IF(NOT DEFINED RC_PREFIX)
|
||||
SET(RC_PREFIX "/")
|
||||
ENDIF()
|
||||
|
||||
# We need to convert our list to a string in order to pass it to the script
|
||||
# on the command line.
|
||||
STRING(REPLACE ";" "\;" FILES "${RC_UNPARSED_ARGUMENTS};${GLOB_FILES}")
|
||||
|
||||
SET(GENQRC_SCRIPT "${CMAKE_SOURCE_DIR}/cmake/scripts/GenQrc.cmake")
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${OUT_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -D OUT_FILE=${OUT_FILE} -D RC_PREFIX=${RC_PREFIX} -D FILES:list=${FILES} -D DIR=${CMAKE_CURRENT_SOURCE_DIR} -P "${GENQRC_SCRIPT}"
|
||||
DEPENDS ${GENQRC_SCRIPT}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
VERBATIM
|
||||
)
|
||||
ENDFUNCTION()
|
||||
|
||||
# Generates a qrc file named ${QRC_OUT} from ${ARGN}, rccs it and returns Qt's
|
||||
# output file.
|
||||
# Must only be run once per CMakeLists.txt.
|
||||
# Usage example:
|
||||
# ADD_GEN_QRC(RCC_OUTPUT resources.qrc icon.png manual.pdf)
|
||||
# ADD_EXECUTABLE(myexe main.cpp ${RCC_OUTPUT})
|
||||
MACRO(ADD_GEN_QRC RCCOUT QRC_OUT)
|
||||
IF(NOT IS_ABSOLUTE ${QRC_OUT})
|
||||
SET(QRC_FILE "${CMAKE_CURRENT_BINARY_DIR}/${QRC_OUT}")
|
||||
ELSE()
|
||||
SET(QRC_FILE ${QRC_OUT})
|
||||
ENDIF()
|
||||
|
||||
GEN_QRC(${QRC_FILE} "${ARGN}")
|
||||
QT_ADD_RESOURCES(${RCCOUT} ${QRC_FILE})
|
||||
ENDMACRO()
|
||||
|
||||
|
||||
MACRO(QT_ADD_RESOURCES)
|
||||
IF(QT5)
|
||||
QT5_ADD_RESOURCES(${ARGN})
|
||||
ELSE()
|
||||
QT4_ADD_RESOURCES(${ARGN})
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
26
cmake/scripts/GenQrc.cmake
Normal file
26
cmake/scripts/GenQrc.cmake
Normal file
@@ -0,0 +1,26 @@
|
||||
# GenQrcScript.cmake - Copyright (c) 2015 Lukas W <lukaswhl/at/gmail.com>
|
||||
|
||||
INCLUDE(CMakeParseArguments)
|
||||
|
||||
FILE(REMOVE ${OUT_FILE})
|
||||
MACRO(OUT STRING)
|
||||
FILE(APPEND ${OUT_FILE} "${STRING}\n")
|
||||
ENDMACRO()
|
||||
|
||||
IF(NOT DEFINED RC_PREFIX)
|
||||
SET(RC_PREFIX "/")
|
||||
ENDIF()
|
||||
|
||||
# Write qrc file
|
||||
OUT("<RCC>")
|
||||
OUT(" <qresource prefix=\"${RC_PREFIX}\">")
|
||||
FOREACH(VAR ${FILES})
|
||||
GET_FILENAME_COMPONENT(FILENAME ${VAR} NAME)
|
||||
IF(IS_ABSOLUTE ${VAR})
|
||||
OUT(" <file alias=\"${FILENAME}\">${VAR}</file>")
|
||||
ELSE()
|
||||
OUT(" <file alias=\"${FILENAME}\">${DIR}/${VAR}</file>")
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
OUT(" </qresource>")
|
||||
OUT("</RCC>")
|
||||
@@ -35,15 +35,7 @@
|
||||
namespace embed
|
||||
{
|
||||
|
||||
struct descriptor
|
||||
{
|
||||
int size;
|
||||
const unsigned char * data;
|
||||
const char * name;
|
||||
} ;
|
||||
|
||||
|
||||
QPixmap EXPORT getIconPixmap( const char * _name, int _w = -1, int _h = -1 );
|
||||
QPixmap EXPORT getIconPixmap( const QString& _name, int _w = -1, int _h = -1 );
|
||||
QString EXPORT getText( const char * _name );
|
||||
|
||||
}
|
||||
@@ -53,7 +45,10 @@ QString EXPORT getText( const char * _name );
|
||||
namespace PLUGIN_NAME
|
||||
{
|
||||
|
||||
QPixmap getIconPixmap( const char * _name, int _w = -1, int _h = -1 );
|
||||
inline QPixmap getIconPixmap( const QString& _name, int _w = -1, int _h = -1 )
|
||||
{
|
||||
return embed::getIconPixmap(QString("%1/%2").arg(STRINGIFY(PLUGIN_NAME), _name), _w, _h);
|
||||
}
|
||||
//QString getText( const char * _name );
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "Amplifier.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
@@ -39,7 +39,7 @@ Plugin::Descriptor PLUGIN_EXPORT amplifier_plugin_descriptor =
|
||||
"Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
new PluginPixmapLoader("logo"),
|
||||
NULL,
|
||||
NULL
|
||||
} ;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(amplifier Amplifier.cpp AmplifierControls.cpp AmplifierControlDialog.cpp MOCFILES AmplifierControls.h AmplifierControlDialog.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(amplifier Amplifier.cpp AmplifierControls.cpp AmplifierControlDialog.cpp MOCFILES AmplifierControls.h AmplifierControlDialog.h EMBEDDED_RESOURCES artwork.png logo.png)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "BassBooster.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
@@ -38,7 +38,7 @@ Plugin::Descriptor PLUGIN_EXPORT bassbooster_plugin_descriptor =
|
||||
"Tobias Doerffel <tobydox/at/users.sf.net>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
new PluginPixmapLoader("logo"),
|
||||
NULL,
|
||||
NULL
|
||||
} ;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(bassbooster BassBooster.cpp BassBoosterControls.cpp BassBoosterControlDialog.cpp MOCFILES BassBoosterControls.h BassBoosterControlDialog.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(bassbooster BassBooster.cpp BassBoosterControls.cpp BassBoosterControlDialog.cpp MOCFILES BassBoosterControls.h BassBoosterControlDialog.h EMBEDDED_RESOURCES artwork.png logo.png)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
#include "Bitcrush.h"
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
const int OS_RATE = 5;
|
||||
const float OS_RATIO = 1.0f / OS_RATE;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(bitcrush Bitcrush.cpp BitcrushControls.cpp BitcrushControlDialog.cpp MOCFILES BitcrushControls.h BitcrushControlDialog.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(bitcrush Bitcrush.cpp BitcrushControls.cpp BitcrushControlDialog.cpp MOCFILES BitcrushControls.h BitcrushControlDialog.h EMBEDDED_RESOURCES artwork.png logo.png)
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(crossovereq CrossoverEQ.cpp CrossoverEQControls.cpp CrossoverEQControlDialog.cpp MOCFILES CrossoverEQControls.h CrossoverEQControlDialog.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(crossovereq CrossoverEQ.cpp CrossoverEQControls.cpp CrossoverEQControlDialog.cpp MOCFILES CrossoverEQControls.h CrossoverEQControlDialog.h EMBEDDED_RESOURCES artwork.png fader_bg.png fader_empty.png fader_knob2.png logo.png)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "CrossoverEQ.h"
|
||||
#include "lmms_math.h"
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(delay DelayEffect.cpp DelayControls.cpp DelayControlsDialog.cpp Lfo.cpp StereoDelay.cpp MOCFILES DelayControls.h DelayControlsDialog.h ../Eq/EqFader.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(delay DelayEffect.cpp DelayControls.cpp DelayControlsDialog.cpp Lfo.cpp StereoDelay.cpp MOCFILES DelayControls.h DelayControlsDialog.h ../Eq/EqFader.h EMBEDDED_RESOURCES artwork.png logo.png)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "DelayEffect.h"
|
||||
#include "Engine.h"
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
#include "interpolation.h"
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ Plugin::Descriptor PLUGIN_EXPORT delay_plugin_descriptor =
|
||||
"Dave French <contact/dot/dave/dot/french3/at/googlemail/dot/com>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
new PluginPixmapLoader("logo"),
|
||||
NULL,
|
||||
NULL
|
||||
} ;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(dualfilter DualFilter.cpp DualFilterControls.cpp DualFilterControlDialog.cpp MOCFILES DualFilterControls.h DualFilterControlDialog.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(dualfilter DualFilter.cpp DualFilterControls.cpp DualFilterControlDialog.cpp MOCFILES DualFilterControls.h DualFilterControlDialog.h EMBEDDED_RESOURCES artwork.png logo.png)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "DualFilter.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
#include "BasicFilters.h"
|
||||
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@ INCLUDE_DIRECTORIES(${FFTW3F_INCLUDE_DIRS})
|
||||
LINK_DIRECTORIES(${FFTW3F_LIBRARY_DIRS})
|
||||
LINK_LIBRARIES(${FFTW3F_LIBRARIES})
|
||||
BUILD_PLUGIN(eq EqEffect.cpp EqCurve.cpp EqCurve.h EqControls.cpp EqControlsDialog.cpp EqFilter.h EqParameterWidget.cpp EqFader.h EqSpectrumView.h EqSpectrumView.cpp
|
||||
MOCFILES EqControls.h EqControlsDialog.h EqCurve.h EqParameterWidget.h EqFader.h EqSpectrumView.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
MOCFILES EqControls.h EqControlsDialog.h EqCurve.h EqParameterWidget.h EqFader.h EqSpectrumView.h EMBEDDED_RESOURCES *.png)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "EqEffect.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "EqFader.h"
|
||||
#include "interpolation.h"
|
||||
@@ -42,7 +42,7 @@ Plugin::Descriptor PLUGIN_EXPORT eq_plugin_descriptor =
|
||||
"Dave French <contact/dot/dave/dot/french3/at/googlemail/dot/com>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
new PluginPixmapLoader("logo"),
|
||||
NULL,
|
||||
NULL
|
||||
} ;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(flanger FlangerEffect.cpp FlangerControls.cpp FlangerControlsDialog.cpp Noise.cpp QuadratureLfo.cpp MonoDelay.cpp MOCFILES FlangerControls.h FlangerControlsDialog.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(flanger FlangerEffect.cpp FlangerControls.cpp FlangerControlsDialog.cpp Noise.cpp QuadratureLfo.cpp MonoDelay.cpp MOCFILES FlangerControls.h FlangerControlsDialog.h EMBEDDED_RESOURCES artwork.png logo.png)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "FlangerEffect.h"
|
||||
#include "Engine.h"
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
@@ -37,7 +37,7 @@ Plugin::Descriptor PLUGIN_EXPORT flanger_plugin_descriptor =
|
||||
"Dave French <contact/dot/dave/dot/french3/at/googlemail/dot/com>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
new PluginPixmapLoader("logo"),
|
||||
NULL,
|
||||
NULL
|
||||
} ;
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#include "ToolTip.h"
|
||||
#include "LcdSpinBox.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
|
||||
@@ -3,7 +3,7 @@ INCLUDE(BuildPlugin)
|
||||
# Disable C++11
|
||||
REMOVE_DEFINITIONS(-std=c++0x)
|
||||
|
||||
BUILD_PLUGIN(ladspaeffect LadspaEffect.cpp LadspaControls.cpp LadspaControlDialog.cpp LadspaSubPluginFeatures.cpp LadspaEffect.h LadspaControls.h LadspaControlDialog.h LadspaSubPluginFeatures.h MOCFILES LadspaEffect.h LadspaControls.h LadspaControlDialog.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(ladspaeffect LadspaEffect.cpp LadspaControls.cpp LadspaControlDialog.cpp LadspaSubPluginFeatures.cpp LadspaEffect.h LadspaControls.h LadspaControlDialog.h LadspaSubPluginFeatures.h MOCFILES LadspaEffect.h LadspaControls.h LadspaControlDialog.h EMBEDDED_RESOURCES logo.png)
|
||||
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/ladspa")
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include "ValueBuffer.h"
|
||||
#include "Song.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
@@ -57,7 +57,7 @@ Plugin::Descriptor PLUGIN_EXPORT ladspaeffect_plugin_descriptor =
|
||||
"Danny McRae <khjklujn/at/users.sourceforge.net>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
new PluginPixmapLoader("logo"),
|
||||
NULL,
|
||||
new LadspaSubPluginFeatures( Plugin::Effect )
|
||||
} ;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(multitapecho MultitapEcho.cpp MultitapEchoControls.cpp MultitapEchoControlDialog.cpp MOCFILES MultitapEchoControls.h MultitapEchoControlDialog.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(multitapecho MultitapEcho.cpp MultitapEchoControls.cpp MultitapEchoControlDialog.cpp MOCFILES MultitapEchoControls.h MultitapEchoControlDialog.h EMBEDDED_RESOURCES artwork.png graph_bg.png logo.png)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
#include "MultitapEcho.h"
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
|
||||
@@ -20,5 +20,5 @@ BUILD_PLUGIN(
|
||||
base.h
|
||||
revsc.h
|
||||
dcblock.h
|
||||
EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png"
|
||||
EMBEDDED_RESOURCES artwork.png logo.png
|
||||
)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <math.h>
|
||||
#include "ReverbSC.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
#define DB2LIN(X) pow(10, X / 20.0f);
|
||||
|
||||
|
||||
@@ -2,4 +2,4 @@ INCLUDE(BuildPlugin)
|
||||
INCLUDE_DIRECTORIES(${FFTW3F_INCLUDE_DIRS})
|
||||
LINK_DIRECTORIES(${FFTW3F_LIBRARY_DIRS})
|
||||
LINK_LIBRARIES(${FFTW3F_LIBRARIES})
|
||||
BUILD_PLUGIN(spectrumanalyzer SpectrumAnalyzer.cpp SpectrumAnalyzerControls.cpp SpectrumAnalyzerControlDialog.cpp SpectrumAnalyzer.h SpectrumAnalyzerControls.h SpectrumAnalyzerControlDialog.h MOCFILES SpectrumAnalyzerControlDialog.h SpectrumAnalyzerControls.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(spectrumanalyzer SpectrumAnalyzer.cpp SpectrumAnalyzerControls.cpp SpectrumAnalyzerControlDialog.cpp SpectrumAnalyzer.h SpectrumAnalyzerControls.h SpectrumAnalyzerControlDialog.h MOCFILES SpectrumAnalyzerControlDialog.h SpectrumAnalyzerControls.h EMBEDDED_RESOURCES *.png)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "SpectrumAnalyzer.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
@@ -38,7 +38,7 @@ Plugin::Descriptor PLUGIN_EXPORT spectrumanalyzer_plugin_descriptor =
|
||||
"Tobias Doerffel <tobydox/at/users.sf.net>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
new PluginPixmapLoader(),
|
||||
NULL,
|
||||
NULL
|
||||
} ;
|
||||
|
||||
@@ -10,7 +10,7 @@ ELSE()
|
||||
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${PLUGIN_DIR}")
|
||||
ENDIF()
|
||||
|
||||
BUILD_PLUGIN(vsteffect VstEffect.cpp VstEffectControls.cpp VstEffectControlDialog.cpp VstSubPluginFeatures.cpp VstEffect.h VstEffectControls.h VstEffectControlDialog.h VstSubPluginFeatures.h MOCFILES VstEffectControlDialog.h VstEffectControls.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(vsteffect VstEffect.cpp VstEffectControls.cpp VstEffectControlDialog.cpp VstSubPluginFeatures.cpp VstEffect.h VstEffectControls.h VstEffectControlDialog.h VstSubPluginFeatures.h MOCFILES VstEffectControlDialog.h VstEffectControls.h EMBEDDED_RESOURCES logo.png)
|
||||
SET_TARGET_PROPERTIES(vsteffect PROPERTIES COMPILE_FLAGS "-Wno-attributes")
|
||||
TARGET_LINK_LIBRARIES(vsteffect -lvstbase)
|
||||
ADD_DEPENDENCIES(vsteffect vstbase)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "TextFloat.h"
|
||||
#include "VstSubPluginFeatures.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
@@ -44,7 +44,7 @@ Plugin::Descriptor PLUGIN_EXPORT vsteffect_plugin_descriptor =
|
||||
"Tobias Doerffel <tobydox/at/users.sf.net>",
|
||||
0x0200,
|
||||
Plugin::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
new PluginPixmapLoader("logo"),
|
||||
NULL,
|
||||
new VstSubPluginFeatures( Plugin::Effect )
|
||||
} ;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(audiofileprocessor audio_file_processor.cpp audio_file_processor.h MOCFILES audio_file_processor.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(audiofileprocessor audio_file_processor.cpp audio_file_processor.h MOCFILES audio_file_processor.h EMBEDDED_RESOURCES *.png)
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include "StringPairDrag.h"
|
||||
#include "DataFile.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include "Song.h"
|
||||
#include "interpolation.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ if(LMMS_HAVE_CARLA)
|
||||
INCLUDE_DIRECTORIES(${CARLA_INCLUDE_DIRS})
|
||||
LINK_DIRECTORIES(${CARLA_LIBRARY_DIRS})
|
||||
LINK_LIBRARIES(${CARLA_LIBRARIES})
|
||||
BUILD_PLUGIN(carlabase carla.cpp carla.h MOCFILES carla.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png" LINK SHARED)
|
||||
BUILD_PLUGIN(carlabase carla.cpp carla.h MOCFILES carla.h EMBEDDED_RESOURCES artwork-patchbay.png artwork-rack.png LINK SHARED)
|
||||
SET_TARGET_PROPERTIES(carlabase
|
||||
PROPERTIES SKIP_BUILD_RPATH TRUE
|
||||
BUILD_WITH_INSTALL_RPATH TRUE
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
// this doesn't seem to be defined anywhere
|
||||
static const double ticksPerBeat = 48.0;
|
||||
|
||||
@@ -5,5 +5,5 @@ if(LMMS_HAVE_CARLA)
|
||||
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/../carlabase"
|
||||
${CARLA_LIBRARY_DIRS})
|
||||
LINK_LIBRARIES(carlabase)
|
||||
BUILD_PLUGIN(carlapatchbay carlapatchbay.cpp EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(carlapatchbay carlapatchbay.cpp EMBEDDED_RESOURCES logo.png)
|
||||
endif(LMMS_HAVE_CARLA)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "carla.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
@@ -5,5 +5,5 @@ if(LMMS_HAVE_CARLA)
|
||||
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/../carlabase"
|
||||
${CARLA_LIBRARY_DIRS})
|
||||
LINK_LIBRARIES(carlabase)
|
||||
BUILD_PLUGIN(carlarack carlarack.cpp EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(carlarack carlarack.cpp EMBEDDED_RESOURCES logo.png)
|
||||
endif(LMMS_HAVE_CARLA)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "carla.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(dynamicsprocessor dynamics_processor.cpp dynamics_processor_controls.cpp dynamics_processor_control_dialog.cpp MOCFILES dynamics_processor_controls.h dynamics_processor_control_dialog.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(dynamicsprocessor dynamics_processor.cpp dynamics_processor_controls.cpp dynamics_processor_control_dialog.cpp MOCFILES dynamics_processor_controls.h dynamics_processor_control_dialog.h EMBEDDED_RESOURCES *.png)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "lmms_math.h"
|
||||
#include "interpolation.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
@@ -42,7 +42,7 @@ Plugin::Descriptor PLUGIN_EXPORT dynamicsprocessor_plugin_descriptor =
|
||||
"Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
new PluginPixmapLoader("logo"),
|
||||
NULL,
|
||||
NULL
|
||||
} ;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(kicker kicker.cpp kicker.h MOCFILES kicker.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(kicker kicker.cpp kicker.h MOCFILES kicker.h EMBEDDED_RESOURCES artwork.png logo.png)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "NotePlayHandle.h"
|
||||
#include "KickerOsc.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(ladspabrowser ladspa_browser.cpp ladspa_browser.h ladspa_description.cpp ladspa_description.h ladspa_port_dialog.cpp ladspa_port_dialog.h MOCFILES ladspa_browser.h ladspa_description.h ladspa_port_dialog.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(ladspabrowser ladspa_browser.cpp ladspa_browser.h ladspa_description.cpp ladspa_description.h ladspa_port_dialog.cpp ladspa_port_dialog.h MOCFILES ladspa_browser.h ladspa_description.h ladspa_port_dialog.h EMBEDDED_RESOURCES logo.png)
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "TabBar.h"
|
||||
#include "TabButton.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ Plugin::Descriptor PLUGIN_EXPORT ladspabrowser_plugin_descriptor =
|
||||
"Danny McRae <khjklujn/at/users.sourceforge.net>",
|
||||
0x0100,
|
||||
Plugin::Tool,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
new PluginPixmapLoader("logo"),
|
||||
NULL,
|
||||
NULL
|
||||
} ;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(lb302 lb302.cpp lb302.h MOCFILES lb302.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(lb302 lb302.cpp lb302.h MOCFILES lb302.h EMBEDDED_RESOURCES artwork.png logo.png)
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
#include "ToolTip.h"
|
||||
#include "BandLimitedWave.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
// Envelope Recalculation period
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(monstro Monstro.cpp Monstro.h MOCFILES Monstro.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(monstro Monstro.cpp Monstro.h MOCFILES Monstro.h EMBEDDED_RESOURCES *.png)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "lmms_math.h"
|
||||
#include "interpolation.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(nes Nes.cpp Nes.h MOCFILES Nes.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(nes Nes.cpp Nes.h MOCFILES Nes.h EMBEDDED_RESOURCES *.png)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "Mixer.h"
|
||||
#include "Oscillator.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include "opl.h"
|
||||
#include "temuopl.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
#include "math.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(organic organic.cpp organic.h MOCFILES organic.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(organic organic.cpp organic.h MOCFILES organic.h EMBEDDED_RESOURCES *.png)
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "templates.h"
|
||||
#include "ToolTip.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "Engine.h"
|
||||
#include "Graph.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(patman patman.cpp patman.h MOCFILES patman.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(patman patman.cpp patman.h MOCFILES patman.h EMBEDDED_RESOURCES *.png)
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <QPainter>
|
||||
#include <QDomElement>
|
||||
|
||||
#include "ConfigManager.h"
|
||||
#include "endian_handling.h"
|
||||
#include "Engine.h"
|
||||
#include "gui_templates.h"
|
||||
@@ -41,7 +42,7 @@
|
||||
#include "FileDialog.h"
|
||||
#include "ConfigManager.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(peakcontrollereffect peak_controller_effect.cpp peak_controller_effect_controls.cpp peak_controller_effect_control_dialog.cpp peak_controller_effect.h peak_controller_effect_controls.h peak_controller_effect_control_dialog.h MOCFILES peak_controller_effect_controls.h peak_controller_effect_control_dialog.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(peakcontrollereffect peak_controller_effect.cpp peak_controller_effect_controls.cpp peak_controller_effect_control_dialog.cpp peak_controller_effect.h peak_controller_effect_controls.h peak_controller_effect_control_dialog.h MOCFILES peak_controller_effect_controls.h peak_controller_effect_control_dialog.h EMBEDDED_RESOURCES artwork.png logo.png)
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "peak_controller_effect.h"
|
||||
#include "lmms_math.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
@@ -44,7 +44,7 @@ Plugin::Descriptor PLUGIN_EXPORT peakcontrollereffect_plugin_descriptor =
|
||||
"Paul Giblock <drfaygo/at/gmail.com>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
new PluginPixmapLoader("logo"),
|
||||
NULL,
|
||||
NULL
|
||||
} ;
|
||||
|
||||
@@ -3,6 +3,6 @@ if(LMMS_HAVE_FLUIDSYNTH)
|
||||
INCLUDE_DIRECTORIES(${FLUIDSYNTH_INCLUDE_DIRS} ${SAMPLERATE_INCLUDE_DIRS})
|
||||
LINK_DIRECTORIES(${FLUIDSYNTH_LIBRARY_DIRS} ${SAMPLERATE_LIBRARY_DIRS})
|
||||
LINK_LIBRARIES(${FLUIDSYNTH_LIBRARIES} ${SAMPLERATE_LIBRARIES})
|
||||
BUILD_PLUGIN(sf2player sf2_player.cpp sf2_player.h patches_dialog.cpp patches_dialog.h patches_dialog.ui MOCFILES sf2_player.h patches_dialog.h UICFILES patches_dialog.ui EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(sf2player sf2_player.cpp sf2_player.h patches_dialog.cpp patches_dialog.h patches_dialog.ui MOCFILES sf2_player.h patches_dialog.h UICFILES patches_dialog.ui EMBEDDED_RESOURCES *.png)
|
||||
endif(LMMS_HAVE_FLUIDSYNTH)
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "ConfigManager.h"
|
||||
#include "FileDialog.h"
|
||||
#include "sf2_player.h"
|
||||
#include "ConfigManager.h"
|
||||
#include "Engine.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "InstrumentPlayHandle.h"
|
||||
@@ -44,7 +45,7 @@
|
||||
#include "ToolTip.h"
|
||||
#include "LcdSpinBox.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(sfxr sfxr.cpp sfxr.h MOCFILES sfxr.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(sfxr sfxr.cpp sfxr.h MOCFILES sfxr.h EMBEDDED_RESOURCES *.png)
|
||||
|
||||
@@ -52,7 +52,7 @@ float frnd(float range)
|
||||
#include "MidiTime.h"
|
||||
#include "Mixer.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(sid sid_instrument.cpp sid_instrument.h envelope.h extfilt.h filter.h pot.h siddefs.h sid.h spline.h voice.h wave.h envelope.cc extfilt.cc filter.cc pot.cc sid.cc version.cc voice.cc wave6581_PS_.cc wave6581_PST.cc wave6581_P_T.cc wave6581__ST.cc wave8580_PS_.cc wave8580_PST.cc wave8580_P_T.cc wave8580__ST.cc wave.cc MOCFILES sid_instrument.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(sid sid_instrument.cpp sid_instrument.h envelope.h extfilt.h filter.h pot.h siddefs.h sid.h spline.h voice.h wave.h envelope.cc extfilt.cc filter.cc pot.cc sid.cc version.cc voice.cc wave6581_PS_.cc wave6581_PST.cc wave6581_P_T.cc wave6581__ST.cc wave8580_PS_.cc wave8580_PST.cc wave8580_P_T.cc wave8580__ST.cc wave.cc MOCFILES sid_instrument.h EMBEDDED_RESOURCES *.png)
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include "PixmapButton.h"
|
||||
#include "ToolTip.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
#define C64_PAL_CYCLES_PER_SEC 985248
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(stereoenhancer stereo_enhancer.cpp stereoenhancer_controls.cpp stereoenhancer_control_dialog.cpp stereo_enhancer.h stereoenhancer_controls.h stereoenhancer_control_dialog.h MOCFILES stereoenhancer_controls.h stereoenhancer_control_dialog.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(stereoenhancer stereo_enhancer.cpp stereoenhancer_controls.cpp stereoenhancer_control_dialog.cpp stereo_enhancer.h stereoenhancer_controls.h stereoenhancer_control_dialog.h MOCFILES stereoenhancer_controls.h stereoenhancer_control_dialog.h EMBEDDED_RESOURCES logo.png)
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "stereo_enhancer.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
@@ -40,7 +40,7 @@ Plugin::Descriptor PLUGIN_EXPORT stereoenhancer_plugin_descriptor =
|
||||
"Lou Herard <lherard/at/gmail.com>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
new PluginPixmapLoader("logo"),
|
||||
NULL,
|
||||
NULL
|
||||
} ;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(stereomatrix stereo_matrix.cpp stereomatrix_controls.cpp stereomatrix_control_dialog.cpp stereo_matrix.h stereomatrix_controls.h stereomatrix_control_dialog.h MOCFILES stereomatrix_controls.h stereomatrix_control_dialog.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(stereomatrix stereo_matrix.cpp stereomatrix_controls.cpp stereomatrix_control_dialog.cpp stereo_matrix.h stereomatrix_controls.h stereomatrix_control_dialog.h MOCFILES stereomatrix_controls.h stereomatrix_control_dialog.h EMBEDDED_RESOURCES artwork.png)
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "stereo_matrix.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
@@ -40,7 +40,7 @@ Plugin::Descriptor PLUGIN_EXPORT stereomatrix_plugin_descriptor =
|
||||
"Paul Giblock <drfaygo/at/gmail.com>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
new PluginPixmapLoader("logo"),
|
||||
NULL,
|
||||
NULL
|
||||
} ;
|
||||
|
||||
@@ -2,4 +2,4 @@ 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")
|
||||
BUILD_PLUGIN(malletsstk mallets.cpp mallets.h MOCFILES mallets.h EMBEDDED_RESOURCES artwork.png logo.png)
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "InstrumentTrack.h"
|
||||
#include "Mixer.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(tripleoscillator TripleOscillator.cpp TripleOscillator.h MOCFILES TripleOscillator.h EMBEDDED_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.png)
|
||||
BUILD_PLUGIN(tripleoscillator TripleOscillator.cpp TripleOscillator.h MOCFILES TripleOscillator.h EMBEDDED_RESOURCES *.png)
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include "SampleBuffer.h"
|
||||
#include "ToolTip.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <QMenu>
|
||||
#include <QDomElement>
|
||||
|
||||
#include "ConfigManager.h"
|
||||
#include "Engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "InstrumentPlayHandle.h"
|
||||
@@ -46,7 +47,7 @@
|
||||
#include "ToolTip.h"
|
||||
#include "FileDialog.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(vibedstrings vibed.cpp nine_button_selector.cpp string_container.cpp vibrating_string.cpp vibed.h nine_button_selector.h string_container.h vibrating_string.h MOCFILES vibed.h nine_button_selector.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(vibedstrings vibed.cpp nine_button_selector.cpp string_container.cpp vibrating_string.cpp vibed.h nine_button_selector.h string_container.h vibrating_string.h MOCFILES vibed.h nine_button_selector.h EMBEDDED_RESOURCES *.png)
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "volume.h"
|
||||
#include "Song.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
|
||||
@@ -2,4 +2,4 @@ INCLUDE(BuildPlugin)
|
||||
|
||||
LINK_DIRECTORIES(${SAMPLERATE_LIBRARY_DIRS})
|
||||
LINK_LIBRARIES(${SAMPLERATE_LIBRARIES})
|
||||
BUILD_PLUGIN(watsyn Watsyn.cpp Watsyn.h MOCFILES Watsyn.h EMBEDDED_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.png)
|
||||
BUILD_PLUGIN(watsyn Watsyn.cpp Watsyn.h MOCFILES Watsyn.h EMBEDDED_RESOURCES *.png)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "Mixer.h"
|
||||
#include "interpolation.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(waveshaper waveshaper.cpp waveshaper_controls.cpp waveshaper_control_dialog.cpp MOCFILES waveshaper_controls.h waveshaper_control_dialog.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(waveshaper waveshaper.cpp waveshaper_controls.cpp waveshaper_control_dialog.cpp MOCFILES waveshaper_controls.h waveshaper_control_dialog.h EMBEDDED_RESOURCES *.png)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "waveshaper.h"
|
||||
#include "lmms_math.h"
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
#include "interpolation.h"
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ Plugin::Descriptor PLUGIN_EXPORT waveshaper_plugin_descriptor =
|
||||
"Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
new PluginPixmapLoader("logo"),
|
||||
NULL,
|
||||
NULL
|
||||
} ;
|
||||
|
||||
@@ -146,7 +146,7 @@ IF(LMMS_BUILD_LINUX)
|
||||
ELSE()
|
||||
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${PLUGIN_DIR}")
|
||||
ENDIF()
|
||||
BUILD_PLUGIN(zynaddsubfx ZynAddSubFx.cpp ZynAddSubFx.h MOCFILES ZynAddSubFx.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BUILD_PLUGIN(zynaddsubfx ZynAddSubFx.cpp ZynAddSubFx.h MOCFILES ZynAddSubFx.h EMBEDDED_RESOURCES artwork.png logo.png)
|
||||
TARGET_LINK_LIBRARIES(zynaddsubfx -lZynAddSubFxCore)
|
||||
ADD_DEPENDENCIES(zynaddsubfx ZynAddSubFxCore)
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#include "Mixer.h"
|
||||
#include "ControllerConnection.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -41,12 +41,12 @@ IF(WIN32)
|
||||
DEPENDS "${CMAKE_BINARY_DIR}/lmms.rc")
|
||||
ENDIF()
|
||||
|
||||
SET(lmms_EMBEDDED_RESOURCES
|
||||
INCLUDE(GenQrc)
|
||||
ADD_GEN_QRC(LMMS_RCC_OUT lmms.qrc
|
||||
"${CMAKE_SOURCE_DIR}/doc/AUTHORS"
|
||||
"${CMAKE_SOURCE_DIR}/LICENSE.txt"
|
||||
"${CMAKE_SOURCE_DIR}/doc/CONTRIBUTORS")
|
||||
SET(LMMS_ER_H "${CMAKE_CURRENT_BINARY_DIR}/embedded_resources.h")
|
||||
ADD_CUSTOM_COMMAND(OUTPUT "${LMMS_ER_H}" COMMAND "${BIN2RES}" ARGS ${lmms_EMBEDDED_RESOURCES} > "\"${LMMS_ER_H}\"" DEPENDS bin2res)
|
||||
"${CMAKE_SOURCE_DIR}/doc/CONTRIBUTORS"
|
||||
)
|
||||
|
||||
# Paths relative to lmms executable
|
||||
FILE(RELATIVE_PATH LIB_DIR_RELATIVE "/${BIN_DIR}" "/${LIB_DIR}")
|
||||
@@ -89,28 +89,25 @@ IF(CMAKE_VERSION VERSION_GREATER "2.8.7")
|
||||
${LMMS_SRCS}
|
||||
${LMMS_INCLUDES}
|
||||
${LMMS_UI_OUT}
|
||||
${LMMS_ER_H}
|
||||
${LMMS_RCC_OUT}
|
||||
)
|
||||
ADD_EXECUTABLE(lmms
|
||||
core/main.cpp
|
||||
$<TARGET_OBJECTS:lmmsobjs>
|
||||
"${WINRC}"
|
||||
)
|
||||
|
||||
SET(iwyu include-what-you-use -Xiwyu --mapping_file=/usr/share/include-what-you-use/qt5_4.imp)
|
||||
#SET_PROPERTY(TARGET lmmsobjs PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${iwyu})
|
||||
ELSE()
|
||||
ADD_EXECUTABLE(lmms
|
||||
core/main.cpp
|
||||
${LMMS_SRCS}
|
||||
${LMMS_INCLUDES}
|
||||
${LMMS_UI_OUT}
|
||||
${LMMS_ER_H}
|
||||
${LMMS_RCC_OUT}
|
||||
"${WINRC}"
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${LMMS_ER_H} ${LMMS_UI_OUT} lmmsconfig.h lmms.1.gz")
|
||||
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${LMMS_RCC_OUT} ${LMMS_UI_OUT} lmmsconfig.h lmms.1.gz")
|
||||
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
SET(EXTRA_LIBRARIES "-lwinmm")
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "SongEditor.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDir>
|
||||
#include <QMessageBox>
|
||||
#include <QSplashScreen>
|
||||
|
||||
@@ -65,6 +66,10 @@ GuiApplication::GuiApplication()
|
||||
ConfigManager::inst()->createWorkingDir();
|
||||
}
|
||||
// Init style and palette
|
||||
QDir::addSearchPath("artwork", ConfigManager::inst()->artworkDir());
|
||||
QDir::addSearchPath("artwork", ConfigManager::inst()->defaultArtworkDir());
|
||||
QDir::addSearchPath("artwork", ":/artwork");
|
||||
|
||||
LmmsStyle* lmmsstyle = new LmmsStyle();
|
||||
QApplication::setStyle(lmmsstyle);
|
||||
|
||||
|
||||
@@ -22,92 +22,58 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QImage>
|
||||
#include <QHash>
|
||||
#include <QDebug>
|
||||
#include <QImageReader>
|
||||
#include <QPixmapCache>
|
||||
#include <QResource>
|
||||
#include "embed.h"
|
||||
|
||||
#ifndef PLUGIN_NAME
|
||||
namespace embed
|
||||
#else
|
||||
namespace PLUGIN_NAME
|
||||
#endif
|
||||
{
|
||||
|
||||
namespace
|
||||
|
||||
QPixmap getIconPixmap(const QString& pixmapName, int width, int height )
|
||||
{
|
||||
static QHash<QString, QPixmap> s_pixmapCache;
|
||||
}
|
||||
|
||||
#include "embedded_resources.h"
|
||||
|
||||
|
||||
QPixmap getIconPixmap( const char * pixmapName, int width, int height )
|
||||
{
|
||||
if( width == -1 || height == -1 )
|
||||
QString cacheName;
|
||||
if (width > 0 && height > 0)
|
||||
{
|
||||
// Return cached pixmap
|
||||
QPixmap cached = s_pixmapCache.value( pixmapName );
|
||||
if( !cached.isNull() )
|
||||
{
|
||||
return cached;
|
||||
}
|
||||
|
||||
// Or try to load it
|
||||
QList<QByteArray> formats = QImageReader::supportedImageFormats();
|
||||
QList<QString> candidates;
|
||||
QPixmap pixmap;
|
||||
QString name;
|
||||
int i;
|
||||
|
||||
for ( i = 0; i < formats.size() && pixmap.isNull(); ++i )
|
||||
{
|
||||
candidates << QString( pixmapName ) + "." + formats.at( i ).data();
|
||||
}
|
||||
|
||||
#ifdef PLUGIN_NAME
|
||||
for ( i = 0; i < candidates.size() && pixmap.isNull(); ++i ) {
|
||||
name = candidates.at( i );
|
||||
pixmap = QPixmap( "resources:plugins/" STRINGIFY( PLUGIN_NAME ) "_" + name );
|
||||
}
|
||||
#endif
|
||||
for ( i = 0; i < candidates.size() && pixmap.isNull(); ++i ) {
|
||||
name = candidates.at( i );
|
||||
pixmap = QPixmap( "resources:" + name );
|
||||
}
|
||||
|
||||
for ( i = 0; i < candidates.size() && pixmap.isNull(); ++i ) {
|
||||
name = candidates.at( i );
|
||||
const embed::descriptor & e =
|
||||
findEmbeddedData( name.toUtf8().constData() );
|
||||
// found?
|
||||
if( name == e.name )
|
||||
{
|
||||
pixmap.loadFromData( e.data, e.size );
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback
|
||||
if( pixmap.isNull() )
|
||||
{
|
||||
pixmap = QPixmap( 1, 1 );
|
||||
}
|
||||
// Save to cache and return
|
||||
s_pixmapCache.insert( pixmapName, pixmap );
|
||||
return pixmap;
|
||||
cacheName = QString("%1_%2_%3").arg(pixmapName, width, height);
|
||||
}
|
||||
else
|
||||
{
|
||||
cacheName = pixmapName;
|
||||
}
|
||||
|
||||
return getIconPixmap( pixmapName ).
|
||||
scaled( width, height, Qt::IgnoreAspectRatio,
|
||||
Qt::SmoothTransformation );
|
||||
// Return cached pixmap
|
||||
QPixmap pixmap;
|
||||
if( QPixmapCache::find(cacheName, &pixmap) )
|
||||
{
|
||||
return pixmap;
|
||||
}
|
||||
QImageReader reader(QString("artwork:%1").arg(pixmapName));
|
||||
|
||||
if (width > 0 && height > 0)
|
||||
{
|
||||
reader.setScaledSize(QSize(width, height));
|
||||
}
|
||||
|
||||
pixmap = QPixmap::fromImageReader(&reader);
|
||||
if (pixmap.isNull())
|
||||
{
|
||||
qWarning().nospace() << "Error loading icon pixmap " << pixmapName << ": " <<
|
||||
reader.errorString().toLocal8Bit().data();
|
||||
return QPixmap(1,1);
|
||||
}
|
||||
|
||||
// Save to cache and return
|
||||
QPixmapCache::insert(cacheName, pixmap);
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
|
||||
QString getText( const char * _name )
|
||||
QString getText( const char * name )
|
||||
{
|
||||
const embed::descriptor & e = findEmbeddedData( _name );
|
||||
return QString::fromUtf8( (const char *) e.data, e.size );
|
||||
return QString::fromUtf8( (const char*) QResource(QString(":/%1").arg(name)).data());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user