From 87ee43a0790bba906c92439aba9ad852023e2847 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 19 Oct 2008 21:48:57 +0000 Subject: [PATCH] made STRINGIFY_PLUGIN_NAME from embed.h a generic macro STRINGIFY in lmms_basics.h git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1784 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 43 +++++++++++++++++++ include/embed.h | 8 +--- include/lmms_basics.h | 5 +++ include/plugin.h | 3 +- .../audio_file_processor.cpp | 2 +- plugins/bass_booster/bass_booster.cpp | 2 +- plugins/bit_invader/bit_invader.cpp | 2 +- plugins/flp_import/flp_import.cpp | 2 +- plugins/kicker/kicker.cpp | 2 +- plugins/ladspa_browser/ladspa_browser.cpp | 2 +- plugins/ladspa_effect/ladspa_effect.cpp | 2 +- plugins/lb302/lb302.cpp | 2 +- plugins/lb303/lb303.cpp | 2 +- plugins/midi_import/midi_import.cpp | 2 +- plugins/organic/organic.cpp | 2 +- plugins/papu/papu_instrument.cpp | 2 +- plugins/patman/patman.cpp | 2 +- .../peak_controller_effect.cpp | 2 +- plugins/sf2_player/sf2_player.cpp | 2 +- plugins/sid/sid_instrument.cpp | 2 +- .../spectrum_analyzer/spectrum_analyzer.cpp | 2 +- plugins/stereo_enhancer/stereo_enhancer.cpp | 2 +- plugins/stereo_matrix/stereo_matrix.cpp | 2 +- plugins/stk/mallets/mallets.cpp | 2 +- .../triple_oscillator/triple_oscillator.cpp | 2 +- plugins/vestige/vestige.cpp | 2 +- plugins/vibed/vibed.cpp | 2 +- plugins/vst_base/vst_base.cpp | 2 +- plugins/vst_effect/vst_effect.cpp | 2 +- src/gui/embed.cpp | 2 +- 30 files changed, 77 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2ae1447f1..c525af279 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,48 @@ 2008-10-19 Tobias Doerffel + * plugins/sid/sid_instrument.cpp: + * plugins/ladspa_effect/ladspa_effect.cpp: + * plugins/patman/patman.cpp: + * plugins/lb302/lb302.cpp: + * plugins/organic/organic.cpp: + * plugins/lb303/lb303.cpp: + * plugins/stereo_matrix/stereo_matrix.cpp: + * plugins/bass_booster/bass_booster.cpp: + * plugins/bit_invader/bit_invader.cpp: + * plugins/vst_effect/vst_effect.cpp: + * plugins/vibed/vibed.cpp: + * plugins/triple_oscillator/triple_oscillator.cpp: + * plugins/peak_controller_effect/peak_controller_effect.cpp: + * plugins/audio_file_processor/audio_file_processor.cpp: + * plugins/stk/mallets/mallets.cpp: + * plugins/stereo_enhancer/stereo_enhancer.cpp: + * plugins/papu/papu_instrument.cpp: + * plugins/sf2_player/sf2_player.cpp: + * plugins/vestige/vestige.cpp: + * plugins/vst_base/vst_base.cpp: + * plugins/ladspa_browser/ladspa_browser.cpp: + * plugins/spectrum_analyzer/spectrum_analyzer.cpp: + * plugins/kicker/kicker.cpp: + * plugins/flp_import/flp_import.cpp: + * plugins/midi_import/midi_import.cpp: + * include/embed.h: + * include/lmms_basics.h: + * include/plugin.h: + * src/gui/embed.cpp: + made STRINGIFY_PLUGIN_NAME from embed.h a generic macro STRINGIFY in + lmms_basics.h + + * include/about_dialog.h: + * src/gui/about_dialog.cpp: + * src/gui/dialogs/about_dialog.ui: + designed-based about dialog + + * src/gui/widgets/rename_dialog.cpp: + initially select whole string so it can be overwritten easily + + * AUTHORS: + moved an item to lmms-extras/AUTHORS + * plugins/vst_base/vst_plugin.h: * plugins/vst_base/vst_plugin.cpp: * plugins/vst_effect/vst_effect_control_dialog.cpp: diff --git a/include/embed.h b/include/embed.h index 2dad5ce4c..0f91ae3bc 100644 --- a/include/embed.h +++ b/include/embed.h @@ -31,10 +31,7 @@ #include "export.h" - - -#define STRINGIFY_PLUGIN_NAME(s) STR(s) -#define STR(PN) #PN +#include "lmms_basics.h" namespace embed @@ -124,8 +121,7 @@ public: virtual QString pixmapName( void ) const { - return QString( STRINGIFY_PLUGIN_NAME(PLUGIN_NAME) ) + - "::" + m_name; + return QString( STRINGIFY(PLUGIN_NAME) ) + "::" + m_name; } } ; diff --git a/include/lmms_basics.h b/include/lmms_basics.h index e9f352c84..0deefee66 100644 --- a/include/lmms_basics.h +++ b/include/lmms_basics.h @@ -136,4 +136,9 @@ typedef sample_t surroundSampleFrame[SURROUND_CHANNELS]; typedef sample_t sampleFrameA[DEFAULT_CHANNELS] __attribute__((__aligned__(ALIGN_SIZE))); #endif + +#define STRINGIFY(s) STR(s) +#define STR(PN) #PN + + #endif diff --git a/include/plugin.h b/include/plugin.h index d7f847ff7..8c29636cd 100644 --- a/include/plugin.h +++ b/include/plugin.h @@ -152,8 +152,7 @@ public: // returns display-name out of descriptor virtual QString displayName( void ) const { - return model::displayName().isNull() ? - m_descriptor->displayName : + return m_descriptor ? m_descriptor->displayName : model::displayName(); } diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index 8df817333..1e787979a 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -51,7 +51,7 @@ extern "C" plugin::descriptor PLUGIN_EXPORT audiofileprocessor_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "AudioFileProcessor", QT_TRANSLATE_NOOP( "pluginBrowser", "simple sampler with various settings for " diff --git a/plugins/bass_booster/bass_booster.cpp b/plugins/bass_booster/bass_booster.cpp index b52e4a49d..1d9600618 100644 --- a/plugins/bass_booster/bass_booster.cpp +++ b/plugins/bass_booster/bass_booster.cpp @@ -35,7 +35,7 @@ extern "C" plugin::descriptor PLUGIN_EXPORT bassbooster_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "BassBooster Effect", QT_TRANSLATE_NOOP( "pluginBrowser", "plugin for boosting bass" ), diff --git a/plugins/bit_invader/bit_invader.cpp b/plugins/bit_invader/bit_invader.cpp index c85544a9b..126f8b3bf 100644 --- a/plugins/bit_invader/bit_invader.cpp +++ b/plugins/bit_invader/bit_invader.cpp @@ -47,7 +47,7 @@ extern "C" plugin::descriptor PLUGIN_EXPORT bitinvader_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "BitInvader", QT_TRANSLATE_NOOP( "pluginBrowser", "Customizable wavetable synthesizer" ), diff --git a/plugins/flp_import/flp_import.cpp b/plugins/flp_import/flp_import.cpp index e8e54b9dd..10b3e15d2 100644 --- a/plugins/flp_import/flp_import.cpp +++ b/plugins/flp_import/flp_import.cpp @@ -67,7 +67,7 @@ extern "C" plugin::descriptor PLUGIN_EXPORT flpimport_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "FLP Import", QT_TRANSLATE_NOOP( "pluginBrowser", "Filter for importing FL Studio projects into LMMS" ), diff --git a/plugins/kicker/kicker.cpp b/plugins/kicker/kicker.cpp index b86da5c3d..76426b4c8 100644 --- a/plugins/kicker/kicker.cpp +++ b/plugins/kicker/kicker.cpp @@ -42,7 +42,7 @@ extern "C" plugin::descriptor PLUGIN_EXPORT kicker_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "Kicker", QT_TRANSLATE_NOOP( "pluginBrowser", "versatile kick- & bassdrum-synthesizer" ), diff --git a/plugins/ladspa_browser/ladspa_browser.cpp b/plugins/ladspa_browser/ladspa_browser.cpp index 00b5c803b..0ba6993eb 100644 --- a/plugins/ladspa_browser/ladspa_browser.cpp +++ b/plugins/ladspa_browser/ladspa_browser.cpp @@ -49,7 +49,7 @@ extern "C" plugin::descriptor PLUGIN_EXPORT ladspabrowser_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "LADSPA Plugin Browser", QT_TRANSLATE_NOOP( "pluginBrowser", "List installed LADSPA plugins" ), diff --git a/plugins/ladspa_effect/ladspa_effect.cpp b/plugins/ladspa_effect/ladspa_effect.cpp index 453471c98..e1c0d4459 100644 --- a/plugins/ladspa_effect/ladspa_effect.cpp +++ b/plugins/ladspa_effect/ladspa_effect.cpp @@ -46,7 +46,7 @@ extern "C" plugin::descriptor PLUGIN_EXPORT ladspaeffect_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "LADSPA Effect", QT_TRANSLATE_NOOP( "pluginBrowser", "plugin for using arbitrary LADSPA-effects " diff --git a/plugins/lb302/lb302.cpp b/plugins/lb302/lb302.cpp index d47621d26..91959a55e 100644 --- a/plugins/lb302/lb302.cpp +++ b/plugins/lb302/lb302.cpp @@ -83,7 +83,7 @@ extern "C" plugin::descriptor PLUGIN_EXPORT lb302_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "LB302", QT_TRANSLATE_NOOP( "pluginBrowser", "Incomplete monophonic immitation tb303" ), diff --git a/plugins/lb303/lb303.cpp b/plugins/lb303/lb303.cpp index df24dd742..9323773a0 100644 --- a/plugins/lb303/lb303.cpp +++ b/plugins/lb303/lb303.cpp @@ -79,7 +79,7 @@ extern "C" plugin::descriptor PLUGIN_EXPORT lb303_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "LB303", QT_TRANSLATE_NOOP( "pluginBrowser", "Incomplete monophonic immitation tb303" ), diff --git a/plugins/midi_import/midi_import.cpp b/plugins/midi_import/midi_import.cpp index c175ef4f3..36db12ae9 100644 --- a/plugins/midi_import/midi_import.cpp +++ b/plugins/midi_import/midi_import.cpp @@ -54,7 +54,7 @@ extern "C" plugin::descriptor PLUGIN_EXPORT midiimport_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "MIDI Import", QT_TRANSLATE_NOOP( "pluginBrowser", "Filter for importing MIDI-files into LMMS" ), diff --git a/plugins/organic/organic.cpp b/plugins/organic/organic.cpp index b287b98bf..bfc96832e 100644 --- a/plugins/organic/organic.cpp +++ b/plugins/organic/organic.cpp @@ -48,7 +48,7 @@ extern "C" plugin::descriptor PLUGIN_EXPORT organic_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "Organic", QT_TRANSLATE_NOOP( "pluginBrowser", "Additive Synthesizer for organ-like sounds" ), diff --git a/plugins/papu/papu_instrument.cpp b/plugins/papu/papu_instrument.cpp index 3100ff542..888772a1c 100644 --- a/plugins/papu/papu_instrument.cpp +++ b/plugins/papu/papu_instrument.cpp @@ -43,7 +43,7 @@ extern "C" { plugin::descriptor PLUGIN_EXPORT papu_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "FreeBoy", QT_TRANSLATE_NOOP( "pluginBrowser", "Emulation of GameBoy (TM) APU" ), diff --git a/plugins/patman/patman.cpp b/plugins/patman/patman.cpp index b44ff12f5..c8b8c6b38 100644 --- a/plugins/patman/patman.cpp +++ b/plugins/patman/patman.cpp @@ -50,7 +50,7 @@ extern "C" plugin::descriptor PLUGIN_EXPORT patman_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "PatMan", QT_TRANSLATE_NOOP( "pluginBrowser", "GUS-compatible patch instrument" ), diff --git a/plugins/peak_controller_effect/peak_controller_effect.cpp b/plugins/peak_controller_effect/peak_controller_effect.cpp index 64a32a9dc..e8d9f8eeb 100644 --- a/plugins/peak_controller_effect/peak_controller_effect.cpp +++ b/plugins/peak_controller_effect/peak_controller_effect.cpp @@ -38,7 +38,7 @@ extern "C" plugin::descriptor PLUGIN_EXPORT peakcontrollereffect_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "Peak Controller", QT_TRANSLATE_NOOP( "pluginBrowser", "Plugin for controlling knobs with sound peaks" ), diff --git a/plugins/sf2_player/sf2_player.cpp b/plugins/sf2_player/sf2_player.cpp index cf5bcb4e8..894deb0aa 100644 --- a/plugins/sf2_player/sf2_player.cpp +++ b/plugins/sf2_player/sf2_player.cpp @@ -51,7 +51,7 @@ extern "C" plugin::descriptor sf2player_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "Sf2 Player", QT_TRANSLATE_NOOP( "pluginBrowser", "Player for SoundFont files" ), diff --git a/plugins/sid/sid_instrument.cpp b/plugins/sid/sid_instrument.cpp index 39764dc7d..60f067da3 100644 --- a/plugins/sid/sid_instrument.cpp +++ b/plugins/sid/sid_instrument.cpp @@ -69,7 +69,7 @@ extern "C" { plugin::descriptor PLUGIN_EXPORT sid_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "SID", QT_TRANSLATE_NOOP( "pluginBrowser", "Emulation of the MOS6581 and MOS8580 " "SID.\nThis chip was used in the Commodore 64 computer." ), diff --git a/plugins/spectrum_analyzer/spectrum_analyzer.cpp b/plugins/spectrum_analyzer/spectrum_analyzer.cpp index 8542e9780..110e10805 100644 --- a/plugins/spectrum_analyzer/spectrum_analyzer.cpp +++ b/plugins/spectrum_analyzer/spectrum_analyzer.cpp @@ -35,7 +35,7 @@ extern "C" plugin::descriptor PLUGIN_EXPORT spectrumanalyzer_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "Spectrum Analyzer", QT_TRANSLATE_NOOP( "pluginBrowser", "plugin for using arbitrary VST-effects " diff --git a/plugins/stereo_enhancer/stereo_enhancer.cpp b/plugins/stereo_enhancer/stereo_enhancer.cpp index e120c5825..5827394bf 100644 --- a/plugins/stereo_enhancer/stereo_enhancer.cpp +++ b/plugins/stereo_enhancer/stereo_enhancer.cpp @@ -35,7 +35,7 @@ extern "C" plugin::descriptor PLUGIN_EXPORT stereoenhancer_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "StereoEnhancer Effect", QT_TRANSLATE_NOOP( "pluginBrowser", "Plugin for enhancing stereo separation of a stereo input file" ), diff --git a/plugins/stereo_matrix/stereo_matrix.cpp b/plugins/stereo_matrix/stereo_matrix.cpp index f1f5a012c..950b57b5b 100644 --- a/plugins/stereo_matrix/stereo_matrix.cpp +++ b/plugins/stereo_matrix/stereo_matrix.cpp @@ -35,7 +35,7 @@ extern "C" plugin::descriptor PLUGIN_EXPORT stereomatrix_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "Stereophonic Matrix", QT_TRANSLATE_NOOP( "pluginBrowser", "Plugin for freely manipulating stereo output" ), diff --git a/plugins/stk/mallets/mallets.cpp b/plugins/stk/mallets/mallets.cpp index 71bf6132c..256710012 100644 --- a/plugins/stk/mallets/mallets.cpp +++ b/plugins/stk/mallets/mallets.cpp @@ -44,7 +44,7 @@ extern "C" plugin::descriptor malletsstk_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "Mallets", QT_TRANSLATE_NOOP( "pluginBrowser", "Tuneful things to bang on" ), diff --git a/plugins/triple_oscillator/triple_oscillator.cpp b/plugins/triple_oscillator/triple_oscillator.cpp index 4ccbaf9f0..aa610a9a5 100644 --- a/plugins/triple_oscillator/triple_oscillator.cpp +++ b/plugins/triple_oscillator/triple_oscillator.cpp @@ -49,7 +49,7 @@ extern "C" plugin::descriptor PLUGIN_EXPORT tripleoscillator_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "TripleOscillator", QT_TRANSLATE_NOOP( "pluginBrowser", "three powerful oscillators you can modulate " diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 7f47935cc..ebeaef2c4 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -50,7 +50,7 @@ extern "C" plugin::descriptor vestige_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "VeSTige", QT_TRANSLATE_NOOP( "pluginBrowser", "VST-host for using VST(i)-plugins within LMMS" ), diff --git a/plugins/vibed/vibed.cpp b/plugins/vibed/vibed.cpp index 827fa4b63..793f8befa 100644 --- a/plugins/vibed/vibed.cpp +++ b/plugins/vibed/vibed.cpp @@ -49,7 +49,7 @@ extern "C" plugin::descriptor PLUGIN_EXPORT vibedstrings_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "Vibed", QT_TRANSLATE_NOOP( "pluginBrowser", "Vibrating string modeler" ), diff --git a/plugins/vst_base/vst_base.cpp b/plugins/vst_base/vst_base.cpp index 9c3c34e87..86e6a3065 100644 --- a/plugins/vst_base/vst_base.cpp +++ b/plugins/vst_base/vst_base.cpp @@ -33,7 +33,7 @@ extern "C" plugin::descriptor vstbase_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "VST Base", "library for all LMMS-plugins dealing with VST-plugins", "Tobias Doerffel ", diff --git a/plugins/vst_effect/vst_effect.cpp b/plugins/vst_effect/vst_effect.cpp index 90b1a8904..efe5e7c31 100644 --- a/plugins/vst_effect/vst_effect.cpp +++ b/plugins/vst_effect/vst_effect.cpp @@ -41,7 +41,7 @@ extern "C" plugin::descriptor vsteffect_plugin_descriptor = { - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + STRINGIFY( PLUGIN_NAME ), "VST Effect", QT_TRANSLATE_NOOP( "pluginBrowser", "plugin for using arbitrary VST-effects " diff --git a/src/gui/embed.cpp b/src/gui/embed.cpp index ab294f063..c28dbdeab 100644 --- a/src/gui/embed.cpp +++ b/src/gui/embed.cpp @@ -51,7 +51,7 @@ QPixmap getIconPixmap( const char * _name, int _w, int _h ) #ifdef PLUGIN_NAME QPixmap p( configManager::inst()->artworkDir() + "plugins/" + - STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ) + "_" + name ); + STRINGIFY( PLUGIN_NAME ) + "_" + name ); if( p.isNull() ) { p = QPixmap( configManager::inst()->artworkDir() +