zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit fd3ce48f49591d05f3870f192c300f42fe33522c
parent 1b0b06bbb29c365c0306f235c3507b889d977aad
Author: fundamental <[email protected]>
Date:   Sun, 30 May 2010 16:45:03 -0400

LASH: made optional in cmake

Diffstat:
Msrc/CMakeLists.txt | 12+++++++-----
Msrc/Misc/CMakeLists.txt | 2+-
Msrc/Misc/LASHClient.h | 4+---
Msrc/main.cpp | 41+++++++++++++++++++++--------------------
4 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt @@ -15,6 +15,9 @@ find_package(PortAudio) set(FLTK_SKIP_OPENGL true) find_package(FLTK) find_package(OpenGL) #for FLTK +# lash +pkg_search_module(LASH lash-1.0) +mark_as_advanced(LASH_LIBRARIES) ######### Settings ########### # NOTE: These cache variables should normally not be changed in this @@ -33,6 +36,8 @@ SET (OssEnable ${ALSA_FOUND} CACHE BOOL #TODO perhaps check for /dev/dsp "Enable support for Open Sound System") SET (PaEnable ${PORTAUDIO_FOUND} CACHE BOOL "Enable support for Port Audio System") +SET (LashEnable ${LASH_FOUND} CACHE BOOL + "Enable LASH Audio Session Handler") # Now, handle the incoming settings and set define flags/variables based @@ -54,9 +59,6 @@ if(NOT PKG_CONFIG_FOUND) message(FATAL_ERROR "pkg-config not found") endif(NOT PKG_CONFIG_FOUND) -# lash -pkg_search_module(LASH lash-1.0) -mark_as_advanced(LASH_LIBRARIES) ########### Settings dependant code ########### # From here on, the setting variables have been prepared so concentrate @@ -88,9 +90,9 @@ if (CompileTests) ENABLE_TESTING() endif() -if(LASH_FOUND) +if(LashEnable) include_directories(${LASH_INCLUDE_DIRS}) - add_definitions(-DUSE_LASH) + add_definitions(-DLASH=1) set(AUDIO_LIBRARIES ${AUDIO_LIBRARIES} ${LASH_LIBRARIES}) message(STATUS "Compiling with lash") endif() diff --git a/src/Misc/CMakeLists.txt b/src/Misc/CMakeLists.txt @@ -13,7 +13,7 @@ set(zynaddsubfx_misc_SRCS WavFile.cpp ) -if (LASH_FOUND) +if(LashEnabled) set(zynaddsubfx_misc_SRCS ${zynaddsubfx_misc_SRCS} LASHClient.cpp) endif() diff --git a/src/Misc/LASHClient.h b/src/Misc/LASHClient.h @@ -28,9 +28,7 @@ /** This class wraps up some functions for initialising and polling - * the LASH daemon. - * \todo fix indentation nonconformism - * \todo see why there is no destructor*/ + * the LASH daemon.*/ class LASHClient { public: diff --git a/src/main.cpp b/src/main.cpp @@ -66,9 +66,9 @@ pthread_t thr3, thr4; Master *master; int swaplr = 0; //1 for left-right swapping -#ifdef USE_LASH +#if LASH #include "Misc/LASHClient.h" -LASHClient *lash; +LASHClient *lash = NULL; #endif int Pexitprogram = 0; //if the UI set this to 1, the program will exit @@ -86,23 +86,23 @@ void *thread3(void *) ui->showUI(); while(Pexitprogram == 0) { -#ifdef USE_LASH +#if LASH string filename; switch(lash->checkevents(filename)) { - case LASHClient::Save: - ui->do_save_master(filename.c_str()); - lash->confirmevent(LASHClient::Save); - break; - case LASHClient::Restore: - ui->do_load_master(filename.c_str()); - lash->confirmevent(LASHClient::Restore); - break; - case LASHClient::Quit: - Pexitprogram = 1; - default: - break; + case LASHClient::Save: + ui->do_save_master(filename.c_str()); + lash->confirmevent(LASHClient::Save); + break; + case LASHClient::Restore: + ui->do_load_master(filename.c_str()); + lash->confirmevent(LASHClient::Restore); + break; + case LASHClient::Quit: + Pexitprogram = 1; + default: + break; } -#endif //USE_LASH +#endif //LASH Fl::wait(); } @@ -181,6 +181,10 @@ void sigterm_exit(int sig) */ void initprogram() { +#if LASH + lash = new LASHClient(&argc, &argv); +#endif + cerr.precision(1); cerr << std::fixed; cerr << "\nSample Rate = \t\t" << SAMPLE_RATE << endl; @@ -212,7 +216,7 @@ void exitprogram() delete ui; #endif -#ifdef USE_LASH +#if LASH delete lash; #endif @@ -247,9 +251,6 @@ int opterr = 0; #ifndef VSTAUDIOOUT int main(int argc, char *argv[]) { -#ifdef USE_LASH - lash = new LASHClient(&argc, &argv); -#endif config.init(); dump.startnow();