diff --git a/ChangeLog b/ChangeLog index 5f3a153ef..486de7229 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,39 @@ +2006-12-19 Javier Serrano Polo + + * include/tool.h: + * src/core/tool.cpp: + initial release, base class for all tool plugins + + * include/plugin.h: + * plugins/ladspa_effect/ladspa_subplugin_features.cpp: + renamed AnalysisTools to Tool + + * include/main_window.h: + * src/core/main_window.cpp: + added tools menu + + * Makefile.am: + * src/lmms_single_source.cpp: + added tool plugins + + * configure.in: + * plugins/live_tool/artwork.png: + * plugins/live_tool/live_tool.cpp: + * plugins/live_tool/live_tool.h: + * plugins/live_tool/logo.png: + * plugins/live_tool/Makefile.am: + added live tool, an example tool plugin + + * plugins/Makefile.am: + - added live tool + - eased SVN merging + + * data/*/Makefile.am: + * data/*/*/Makefile.am: + * plugins/vst_base/Makefile.am: + - removed wildcard extension for POSIX compliance + - fixed additional automake 1.10 issues + 2006-12-18 Tobias Doerffel * plugins/bass_booster/bassboster_control_dialog.h: diff --git a/Makefile.am b/Makefile.am index 69df2fd36..8a3494938 100644 --- a/Makefile.am +++ b/Makefile.am @@ -166,6 +166,7 @@ lmms_SOURCES = \ $(srcdir)/src/core/sample_play_handle.cpp \ $(srcdir)/src/core/setup_dialog.cpp \ $(srcdir)/src/core/song_editor.cpp \ + $(srcdir)/src/core/tool.cpp \ $(srcdir)/src/core/track.cpp \ $(srcdir)/src/core/track_container.cpp \ $(srcdir)/src/core/surround_area.cpp \ @@ -324,6 +325,7 @@ lmms_SOURCES = \ $(srcdir)/include/string_pair_drag.h \ $(srcdir)/include/midi_tab_widget.h \ $(srcdir)/include/audio_port.h \ + $(srcdir)/include/tool.h \ $(srcdir)/include/tool_button.h \ $(srcdir)/include/cpuload_widget.h \ $(srcdir)/include/midi_alsa_seq.h \ diff --git a/configure.in b/configure.in index 87e51ee08..a37f87b66 100644 --- a/configure.in +++ b/configure.in @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) -AC_INIT(lmms, 0.2.1-svn20061217, lmms-devel/at/lists/dot/sf/dot/net) -AM_INIT_AUTOMAKE(lmms, 0.2.1-svn20061217) +AC_INIT(lmms, 0.2.1-svn20061219, lmms-devel/at/lists/dot/sf/dot/net) +AM_INIT_AUTOMAKE(lmms, 0.2.1-svn20061219) AM_CONFIG_HEADER(config.h) @@ -560,6 +560,7 @@ AC_CONFIG_FILES([Makefile plugins/ladspa_base/Makefile plugins/ladspa_effect/Makefile plugins/ladspa_effect/caps/Makefile + plugins/live_tool/Makefile plugins/midi_import/Makefile plugins/organic/Makefile plugins/plucked_string_synth/Makefile diff --git a/data/locale/Makefile.am b/data/locale/Makefile.am index 59d66b88e..a58117760 100755 --- a/data/locale/Makefile.am +++ b/data/locale/Makefile.am @@ -1,7 +1,7 @@ localedir = $(lmmsdatadir)/locale -locale_DATA = $(wildcard *.qm) -locale_SOURCES = $(wildcard *.ts) +locale_DATA = *.qm +locale_TSOURCES = *.ts -EXTRA_DIST = $(locale_DATA) $(locale_SOURCES) +EXTRA_DIST = $(locale_DATA) $(locale_TSOURCES) diff --git a/data/presets/AudioFileProcessor/Makefile.am b/data/presets/AudioFileProcessor/Makefile.am index b42ac19ee..634c12d70 100755 --- a/data/presets/AudioFileProcessor/Makefile.am +++ b/data/presets/AudioFileProcessor/Makefile.am @@ -1,6 +1,6 @@ afppresetsdir = $(lmmsdatadir)/presets/AudioFileProcessor -afppresets_DATA = $(wildcard *.cs.xml) +afppresets_DATA = *.cs.xml EXTRA_DIST = $(afppresets_DATA) diff --git a/data/presets/BitInvader/Makefile.am b/data/presets/BitInvader/Makefile.am index 9bfcb7f2d..7094a3c73 100755 --- a/data/presets/BitInvader/Makefile.am +++ b/data/presets/BitInvader/Makefile.am @@ -1,5 +1,5 @@ bipresetsdir = $(lmmsdatadir)/presets/BitInvader -bipresets_DATA = $(wildcard *.cs.xml) +bipresets_DATA = *.cs.xml EXTRA_DIST = $(bipresets_DATA) diff --git a/data/presets/Organic/Makefile.am b/data/presets/Organic/Makefile.am index 67c524f32..7ba3b5637 100644 --- a/data/presets/Organic/Makefile.am +++ b/data/presets/Organic/Makefile.am @@ -1,6 +1,6 @@ psspresetsdir = $(lmmsdatadir)/presets/Organic -psspresets_DATA = $(wildcard *.cs.xml) +psspresets_DATA = *.cs.xml EXTRA_DIST = $(psspresets_DATA) diff --git a/data/presets/PluckedStringSynth/Makefile.am b/data/presets/PluckedStringSynth/Makefile.am index 0d3e709db..fd0181261 100755 --- a/data/presets/PluckedStringSynth/Makefile.am +++ b/data/presets/PluckedStringSynth/Makefile.am @@ -1,6 +1,6 @@ psspresetsdir = $(lmmsdatadir)/presets/PluckedStringSynth -psspresets_DATA = $(wildcard *.cs.xml) +psspresets_DATA = *.cs.xml EXTRA_DIST = $(psspresets_DATA) diff --git a/data/presets/TripleOscillator/Makefile.am b/data/presets/TripleOscillator/Makefile.am index 5a711c0cf..ec7f96fb5 100755 --- a/data/presets/TripleOscillator/Makefile.am +++ b/data/presets/TripleOscillator/Makefile.am @@ -1,6 +1,6 @@ topresetsdir = $(lmmsdatadir)/presets/TripleOscillator -topresets_DATA = $(wildcard *.cs.xml) +topresets_DATA = *.cs.xml EXTRA_DIST = $(topresets_DATA) diff --git a/data/presets/VeSTige/Makefile.am b/data/presets/VeSTige/Makefile.am index 527e96ed7..7dc119bfa 100755 --- a/data/presets/VeSTige/Makefile.am +++ b/data/presets/VeSTige/Makefile.am @@ -1,6 +1,6 @@ vstpresetsdir = $(lmmsdatadir)/presets/VeSTige -vstpresets_DATA = $(wildcard *.cs.xml) +vstpresets_DATA = *.cs.xml EXTRA_DIST = $(vstpresets_DATA) diff --git a/data/projects/cool_songs/Makefile.am b/data/projects/cool_songs/Makefile.am index 2dab751a2..7ecd52d76 100755 --- a/data/projects/cool_songs/Makefile.am +++ b/data/projects/cool_songs/Makefile.am @@ -1,6 +1,6 @@ coolsongsdir = $(lmmsdatadir)/projects/cool_songs -coolsongs_DATA = $(wildcard *.mmp) +coolsongs_DATA = *.mmp EXTRA_DIST = $(coolsongs_DATA) diff --git a/data/projects/covers/Makefile.am b/data/projects/covers/Makefile.am index a2bd40fdd..a2ca5f340 100755 --- a/data/projects/covers/Makefile.am +++ b/data/projects/covers/Makefile.am @@ -1,6 +1,6 @@ coversdir = $(lmmsdatadir)/projects/covers -covers_DATA = $(wildcard *.mmp) +covers_DATA = *.mmp EXTRA_DIST = $(covers_DATA) diff --git a/data/projects/demos/Makefile.am b/data/projects/demos/Makefile.am index cec23c10c..878ff233d 100755 --- a/data/projects/demos/Makefile.am +++ b/data/projects/demos/Makefile.am @@ -1,6 +1,6 @@ demosdir = $(lmmsdatadir)/projects/demos -demos_DATA = $(wildcard *.mmp) +demos_DATA = *.mmp EXTRA_DIST = $(demos_DATA) diff --git a/data/projects/misc/Makefile.am b/data/projects/misc/Makefile.am index e8aa117f1..1bf335f0b 100755 --- a/data/projects/misc/Makefile.am +++ b/data/projects/misc/Makefile.am @@ -1,6 +1,6 @@ miscdir = $(lmmsdatadir)/projects/misc -misc_DATA = $(wildcard *.mmp) +misc_DATA = *.mmp EXTRA_DIST = $(misc_DATA) diff --git a/data/projects/recorded_loops/Makefile.am b/data/projects/recorded_loops/Makefile.am index bd0b05761..054b7543e 100755 --- a/data/projects/recorded_loops/Makefile.am +++ b/data/projects/recorded_loops/Makefile.am @@ -1,6 +1,6 @@ recordedloopsdir = $(lmmsdatadir)/projects/recorded_loops -recordedloops_DATA = $(wildcard *.mmp) +#recordedloops_DATA = *.mmp -EXTRA_DIST = $(recordedloops_DATA) +#EXTRA_DIST = $(recordedloops_DATA) diff --git a/data/projects/templates/Makefile.am b/data/projects/templates/Makefile.am index 25ad77fc5..d9c684e99 100755 --- a/data/projects/templates/Makefile.am +++ b/data/projects/templates/Makefile.am @@ -1,6 +1,6 @@ templatesdir = $(lmmsdatadir)/projects/templates -templates_DATA = $(wildcard *.mpt) +templates_DATA = *.mpt EXTRA_DIST = $(templates_DATA) diff --git a/data/projects/tutorials/Makefile.am b/data/projects/tutorials/Makefile.am index 4c0e3243e..05613824b 100755 --- a/data/projects/tutorials/Makefile.am +++ b/data/projects/tutorials/Makefile.am @@ -1,6 +1,6 @@ tutorialsdir = $(lmmsdatadir)/projects/tutorials -tutorials_DATA = $(wildcard *.mmp) +tutorials_DATA = *.mmp EXTRA_DIST = $(tutorials_DATA) diff --git a/data/samples/basses/Makefile.am b/data/samples/basses/Makefile.am index fcdef3bf7..843acefbc 100755 --- a/data/samples/basses/Makefile.am +++ b/data/samples/basses/Makefile.am @@ -1,6 +1,6 @@ bassessamplesdir = $(lmmsdatadir)/samples/basses -bassessamples_DATA = $(wildcard *.wav *.ogg) +bassessamples_DATA = *.ogg EXTRA_DIST = $(bassessamples_DATA) diff --git a/data/samples/bassloopes/Makefile.am b/data/samples/bassloopes/Makefile.am index 4e4acc45f..fb1b486b0 100755 --- a/data/samples/bassloopes/Makefile.am +++ b/data/samples/bassloopes/Makefile.am @@ -1,6 +1,6 @@ bassloopessamplesdir = $(lmmsdatadir)/samples/bassloopes -bassloopessamples_DATA = $(wildcard *.wav *.ogg) +bassloopessamples_DATA = *.ogg EXTRA_DIST = $(bassloopessamples_DATA) diff --git a/data/samples/beats/Makefile.am b/data/samples/beats/Makefile.am index 41551478d..6de81ff14 100755 --- a/data/samples/beats/Makefile.am +++ b/data/samples/beats/Makefile.am @@ -1,6 +1,6 @@ beatssamplesdir = $(lmmsdatadir)/samples/beats -beatssamples_DATA = $(wildcard *.wav *.ogg) +beatssamples_DATA = *.ogg EXTRA_DIST = $(beatssamples_DATA) diff --git a/data/samples/drums/Makefile.am b/data/samples/drums/Makefile.am index cfee3a0bc..eac8db9c6 100755 --- a/data/samples/drums/Makefile.am +++ b/data/samples/drums/Makefile.am @@ -1,6 +1,6 @@ drumssamplesdir = $(lmmsdatadir)/samples/drums -drumssamples_DATA = $(wildcard *.wav *.ogg) +drumssamples_DATA = *.ogg EXTRA_DIST = $(drumssamples_DATA) diff --git a/data/samples/effects/Makefile.am b/data/samples/effects/Makefile.am index 5783f61e5..a1b79c790 100755 --- a/data/samples/effects/Makefile.am +++ b/data/samples/effects/Makefile.am @@ -1,6 +1,6 @@ effectssamplesdir = $(lmmsdatadir)/samples/effects -effectssamples_DATA = $(wildcard *.wav *.ogg) +effectssamples_DATA = *.ogg EXTRA_DIST = $(effectssamples_DATA) diff --git a/data/samples/instruments/Makefile.am b/data/samples/instruments/Makefile.am index f86b104bc..ba6788b54 100755 --- a/data/samples/instruments/Makefile.am +++ b/data/samples/instruments/Makefile.am @@ -1,6 +1,6 @@ instrumentssamplesdir = $(lmmsdatadir)/samples/instruments -instrumentssamples_DATA = $(wildcard *.wav *.ogg) +instrumentssamples_DATA = *.ogg EXTRA_DIST = $(instrumentssamples_DATA) diff --git a/data/samples/latin/Makefile.am b/data/samples/latin/Makefile.am index cc7e7a599..c1ca07265 100755 --- a/data/samples/latin/Makefile.am +++ b/data/samples/latin/Makefile.am @@ -1,6 +1,6 @@ latinsamplesdir = $(lmmsdatadir)/samples/latin -latinsamples_DATA = $(wildcard *.wav *.ogg) +latinsamples_DATA = *.ogg EXTRA_DIST = $(latinsamples_DATA) diff --git a/data/samples/misc/Makefile.am b/data/samples/misc/Makefile.am index ec3eb1977..db3b44803 100755 --- a/data/samples/misc/Makefile.am +++ b/data/samples/misc/Makefile.am @@ -1,6 +1,6 @@ miscsamplesdir = $(lmmsdatadir)/samples/misc -miscsamples_DATA = $(wildcard *.wav *.ogg) +miscsamples_DATA = *.ogg EXTRA_DIST = $(miscsamples_DATA) diff --git a/data/samples/shapes/Makefile.am b/data/samples/shapes/Makefile.am index 1ad1bcca2..f7e7a5973 100755 --- a/data/samples/shapes/Makefile.am +++ b/data/samples/shapes/Makefile.am @@ -1,6 +1,6 @@ shapessamplesdir = $(lmmsdatadir)/samples/shapes -shapessamples_DATA = $(wildcard *.wav *.ogg) +shapessamples_DATA = *.wav *.ogg EXTRA_DIST = $(shapessamples_DATA) diff --git a/data/samples/stringsnpads/Makefile.am b/data/samples/stringsnpads/Makefile.am index 69fb02a9c..18a179ddf 100755 --- a/data/samples/stringsnpads/Makefile.am +++ b/data/samples/stringsnpads/Makefile.am @@ -1,6 +1,6 @@ stringsnpadssamplesdir = $(lmmsdatadir)/samples/stringsnpads -stringsnpadssamples_DATA = $(wildcard *.wav *.ogg) +stringsnpadssamples_DATA = *.ogg EXTRA_DIST = $(stringsnpadssamples_DATA) diff --git a/data/themes/Makefile.am b/data/themes/Makefile.am index ccae107b4..273661acf 100755 --- a/data/themes/Makefile.am +++ b/data/themes/Makefile.am @@ -1,11 +1,11 @@ theme_defaultdir = $(lmmsdatadir)/themes/default -theme_default_DATA = $(wildcard default/*.png) +theme_default_DATA = default/*.png theme_blue_scenedir = $(lmmsdatadir)/themes/blue_scene -theme_blue_scene_DATA = $(wildcard blue_scene/*.png) +theme_blue_scene_DATA = blue_scene/*.png plugin_theme_blue_scenedir = $(lmmsdatadir)/themes/blue_scene/plugins -plugin_theme_blue_scene_DATA = $(wildcard blue_scene/plugins/*.png) +plugin_theme_blue_scene_DATA = blue_scene/plugins/*.png EXTRA_DIST = $(theme_default_DATA) $(theme_blue_scene_DATA) $(plugin_theme_blue_scene_DATA) diff --git a/data/track_icons/Makefile.am b/data/track_icons/Makefile.am index 7f57748ec..abaee96a9 100755 --- a/data/track_icons/Makefile.am +++ b/data/track_icons/Makefile.am @@ -1,6 +1,6 @@ trackiconsdir = $(lmmsdatadir)/track_icons -trackicons_DATA = $(wildcard *.png) +trackicons_DATA = *.png EXTRA_DIST = $(trackicons_DATA) diff --git a/include/main_window.h b/include/main_window.h index 864d8bf61..e6f78359f 100644 --- a/include/main_window.h +++ b/include/main_window.h @@ -57,6 +57,7 @@ class QGridLayout; class QSplashScreen; class configManager; +class tool; class toolButton; @@ -165,12 +166,16 @@ private: bool m_alt; } m_keyMods; + QMenu * m_tools_menu; + vlist m_tools; + friend class engine; private slots: void fillTemplatesMenu( void ); + void showTool( int _idx ); } ; diff --git a/include/plugin.h b/include/plugin.h index de0542b1b..51e294f87 100644 --- a/include/plugin.h +++ b/include/plugin.h @@ -69,7 +69,7 @@ public: Effect, // effect-plugin for effect-board ImportFilter, // filter for importing a file ExportFilter, // filter for exporting a file - AnalysisTools, // analysis-tools (level-meter etc) + Tool, // additional tool (level-meter etc) Library, // simple library holding a code-base for // several other plugins (e.g. LADSPA-support) Other, diff --git a/include/tool.h b/include/tool.h new file mode 100644 index 000000000..5c87625a2 --- /dev/null +++ b/include/tool.h @@ -0,0 +1,63 @@ +/* + * tool.h - declaration of class tool, standard interface for all tool plugins + * + * Copyright (c) 2006 Javier Serrano Polo + * + * This file is part of Linux MultiMedia Studio - http://lmms.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. + * + */ + + +#ifndef _TOOL_H +#define _TOOL_H + + +#ifdef QT4 + +#include + +#else + +#include + +#endif + + +#include "plugin.h" + + +class mainWindow; + + +class tool : public QWidget, public plugin +{ +public: + tool( mainWindow * _window, const descriptor * _descriptor ); + virtual ~tool(); + + // instantiate tool-plugin with given name or return NULL + // on failure + static tool * FASTCALL instantiate( const QString & _plugin_name, + mainWindow * _window ); + +} ; + + + + +#endif diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 53efb1f88..e6a050dc9 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -10,5 +10,17 @@ if STK_SUPPORT STK_DIR=stk endif -SUBDIRS = audio_file_processor bass_booster bit_invader flp_import $(LADSPA_DIRS) midi_import organic plucked_string_synth $(STK_DIR) triple_oscillator $(VST_DIRS) vibed - +SUBDIRS = \ + audio_file_processor \ + bass_booster \ + bit_invader \ + flp_import \ + $(LADSPA_DIRS) \ + live_tool \ + midi_import \ + organic \ + plucked_string_synth \ + $(STK_DIR) \ + triple_oscillator \ + $(VST_DIRS) \ + vibed diff --git a/plugins/ladspa_effect/ladspa_subplugin_features.cpp b/plugins/ladspa_effect/ladspa_subplugin_features.cpp index 9ec148736..fa181ab80 100644 --- a/plugins/ladspa_effect/ladspa_subplugin_features.cpp +++ b/plugins/ladspa_effect/ladspa_subplugin_features.cpp @@ -153,7 +153,7 @@ void ladspaSubPluginFeatures::listSubPluginKeys( engine * _eng, plugins = lm->getValidEffects(); //plugins += lm->getInvalidEffects(); break; - case plugin::AnalysisTools: + case plugin::Tool: plugins = lm->getAnalysisTools(); break; case plugin::Other: diff --git a/plugins/live_tool/Makefile.am b/plugins/live_tool/Makefile.am new file mode 100644 index 000000000..ecd8527a5 --- /dev/null +++ b/plugins/live_tool/Makefile.am @@ -0,0 +1,33 @@ +AUTOMAKE_OPTIONS = foreign 1.4 + + +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src/lib -I. + + +AM_CXXFLAGS := $(AM_CXXFLAGS) $(QT_CXXFLAGS) -DPLUGIN_NAME="live_tool" + + +%.moc: ./%.h + $(MOC) -o $@ $< + + +MOC_FILES = ./live_tool.moc + +BUILT_SOURCES = $(MOC_FILES) ./embedded_resources.h +EMBEDDED_RESOURCES = $(wildcard *png) + +./embedded_resources.h: $(EMBEDDED_RESOURCES) + $(BIN2RES) $(EMBEDDED_RESOURCES) > $@ + +EXTRA_DIST = $(EMBEDDED_RESOURCES) + + +CLEANFILES = $(MOC_FILES) ./embedded_resources.h + + + +pkglib_LTLIBRARIES = liblive_tool.la + +liblive_tool_la_SOURCES = live_tool.cpp live_tool.h + +$(liblive_tool_la_SOURCES): ./embedded_resources.h diff --git a/plugins/live_tool/artwork.png b/plugins/live_tool/artwork.png new file mode 100644 index 000000000..05ff319b7 Binary files /dev/null and b/plugins/live_tool/artwork.png differ diff --git a/plugins/live_tool/live_tool.cpp b/plugins/live_tool/live_tool.cpp new file mode 100644 index 000000000..da0e64f34 --- /dev/null +++ b/plugins/live_tool/live_tool.cpp @@ -0,0 +1,163 @@ +/* + * live_tool.cpp - tool for live performance + * + * Copyright (c) 2006 Javier Serrano Polo + * + * This file is part of Linux MultiMedia Studio - http://lmms.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 "live_tool.h" +#include "bb_editor.h" +#include "song_editor.h" + +#ifdef Q_WS_X11 + +#include + +#endif + +#undef SINGLE_SOURCE_COMPILE +#include "embed.cpp" + + + + +extern "C" +{ + +plugin::descriptor live_tool_plugin_descriptor = +{ + STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + "LiveTool", + QT_TRANSLATE_NOOP( "pluginBrowser", + "tool for live performance" ), + "Javier Serrano Polo ", + 0x0100, + plugin::Tool, + new QPixmap( PLUGIN_NAME::getIconPixmap( "logo" ) ), + NULL +} ; + +} + + + + +liveTool::liveTool( mainWindow * _window ) : + tool( _window, &live_tool_plugin_descriptor ) +{ + QPixmap background = PLUGIN_NAME::getIconPixmap( "artwork" ); + setPaletteBackgroundPixmap( background ); + setFixedSize( background.size() ); + + hide(); +} + + + + +liveTool::~liveTool() +{ +} + + + + +QString liveTool::nodeName( void ) const +{ + return( live_tool_plugin_descriptor.name ); +} + + + + +void liveTool::keyPressEvent( QKeyEvent * _ke ) +{ + switch( _ke->key() ) + { + case Qt::Key_Space: + if( eng()->getSongEditor()->playing() ) + { + eng()->getSongEditor()->pause(); + } + else if( eng()->getSongEditor()->paused() && + eng()->getSongEditor()->playMode() == + songEditor::PLAY_SONG ) + { + eng()->getSongEditor()->resumeFromPause(); + } + else + { + eng()->getSongEditor()->play(); + } + break; + + default: + _ke->ignore(); + break; + } +} + + + + +#ifdef Q_WS_X11 +bool liveTool::x11Event( XEvent * _xe ) +{ + if( _xe->type == KeyPress ) + { + unsigned keycode = _xe->xkey.keycode; + // F1 to F10 + if( 67 <= keycode && keycode <= 76 ) + { + toggleInstrument( keycode - 67 ); + return( TRUE ); + } + } + return( FALSE ); +} +#endif + + + + +void liveTool::toggleInstrument( int _n ) +{ + bool track_exists; + track * t = eng()->getBBEditor()->tracks().at( _n, &track_exists ); + if( track_exists ) + { + t->setMuted( !t->muted() ); + } +} + + + + +extern "C" +{ + +// neccessary for getting instance out of shared lib +plugin * lmms_plugin_main( void * _data ) +{ + return( new liveTool( static_cast( _data ) ) ); +} + +} diff --git a/plugins/live_tool/live_tool.h b/plugins/live_tool/live_tool.h new file mode 100644 index 000000000..39eacceaa --- /dev/null +++ b/plugins/live_tool/live_tool.h @@ -0,0 +1,59 @@ +/* + * live_tool.h - declaration of class liveTool, for live performance + * + * Copyright (c) 2006 Javier Serrano Polo + * + * This file is part of Linux MultiMedia Studio - http://lmms.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. + * + */ + + +#ifndef _LIVE_TOOL_H +#define _LIVE_TOOL_H + + +#include "tool.h" + + + + +class liveTool : public tool +{ +public: + liveTool( mainWindow * _window ); + virtual ~liveTool(); + + virtual QString nodeName( void ) const; + + +protected: + virtual void keyPressEvent( QKeyEvent * _ke ); +#ifdef Q_WS_X11 + virtual bool x11Event( XEvent * _xe ); +#endif + + +private: + void toggleInstrument( int _n ); + +} ; + + + + +#endif diff --git a/plugins/live_tool/logo.png b/plugins/live_tool/logo.png new file mode 100644 index 000000000..13fc305cb Binary files /dev/null and b/plugins/live_tool/logo.png differ diff --git a/plugins/vst_base/Makefile.am b/plugins/vst_base/Makefile.am index df22da7c3..2ab0f26ae 100644 --- a/plugins/vst_base/Makefile.am +++ b/plugins/vst_base/Makefile.am @@ -23,8 +23,7 @@ libvstbase_la_SOURCES = vst_base.cpp \ CC = wineg++ pkglib_PROGRAMS = lvsl_server lvsl_server_SOURCES = lvsl_server.c communication.h -lvsl_server_LDFLAGS = -mwindows -lpthread -o $(pkglib_PROGRAMS) -lvsl_server_LINK = wineg++ +lvsl_server_LINK = wineg++ -mwindows -lpthread -o $(pkglib_PROGRAMS) nobase_pkglib_DATA = $(pkglib_PROGRAMS).exe.so CLEANFILES = $(MOC_FILES) $(nobase_pkglib_DATA) diff --git a/src/core/main_window.cpp b/src/core/main_window.cpp index 029d9e190..66771c3ab 100644 --- a/src/core/main_window.cpp +++ b/src/core/main_window.cpp @@ -77,6 +77,7 @@ #include "buffer_allocator.h" #include "setup_dialog.h" #include "audio_dummy.h" +#include "tool.h" #include "tool_button.h" #include "project_journal.h" #include "automation_editor.h" @@ -97,7 +98,8 @@ mainWindow::mainWindow( engine * _engine ) : ), engineObject( _engine ), m_workspace( NULL ), - m_templatesMenu( NULL ) + m_templatesMenu( NULL ), + m_tools_menu( NULL ) { #ifdef QT4 setAttribute( Qt::WA_DeleteOnClose ); @@ -500,7 +502,7 @@ void mainWindow::finalize( void ) this, SLOT( redo() ), Qt::CTRL + Qt::Key_R ); - + QMenu * settings_menu = new QMenu( this ); #ifdef QT4 menuBar()->addMenu( settings_menu )->setText( tr( "&Settings" ) ); @@ -514,7 +516,33 @@ void mainWindow::finalize( void ) tr( "Show setup wizard" ), configManager::inst(), SLOT( exec() ) ); - + + m_tools_menu = new QMenu( this ); + vvector pluginDescriptors; + plugin::getDescriptorsOfAvailPlugins( pluginDescriptors ); + for( vvector::iterator it = + pluginDescriptors.begin(); + it != pluginDescriptors.end(); ++it ) + { + if( it->type == plugin::Tool ) + { + m_tools_menu->addAction( *it->logo, it->public_name ); + m_tools.push_back( tool::instantiate( it->name, + this ) ); + } + } + if( m_tools_menu->count() ) + { +#ifdef QT4 + menuBar()->addMenu( m_tools_menu )->setText( tr( "&Tools" ) ); +#else + menuBar()->insertItem( tr( "&Tools" ), m_tools_menu ); +#endif + connect( m_tools_menu, SIGNAL( activated( int ) ), + this, SLOT( showTool( int ) ) ); + } + + // help-popup-menu QMenu * help_menu = new QMenu( this ); #ifdef QT4 @@ -1051,6 +1079,16 @@ void mainWindow::fillTemplatesMenu( void ) +void mainWindow::showTool( int _idx ) +{ + tool * t = m_tools[m_tools_menu->indexOf( _idx )]; + t->show(); + t->setFocus(); +} + + + + #ifndef QT4 #undef addSeparator #endif diff --git a/src/core/tool.cpp b/src/core/tool.cpp new file mode 100644 index 000000000..2eb8c8ba0 --- /dev/null +++ b/src/core/tool.cpp @@ -0,0 +1,70 @@ +#ifndef SINGLE_SOURCE_COMPILE + +/* + * tool.cpp - base class for all tool plugins (graphs, extensions, etc) + * + * Copyright (c) 2006 Javier Serrano Polo + * + * This file is part of Linux MultiMedia Studio - http://lmms.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 "tool.h" +#include "main_window.h" + + + + +tool::tool( mainWindow * _window, const descriptor * _descriptor ) : + QWidget( _window->workspace() ), + plugin( _descriptor, _window->eng() ) +{ + setWindowTitle( _descriptor->public_name ); + setWindowIcon( *_descriptor->logo ); +} + + + + +tool::~tool() +{ +} + + + + +tool * tool::instantiate( const QString & _plugin_name, mainWindow * _window ) +{ + plugin * p = plugin::instantiate( _plugin_name, _window ); + // check whether instantiated plugin is an instrument + if( dynamic_cast( p ) != NULL ) + { + // everything ok, so return pointer + return( dynamic_cast( p ) ); + } + + // not quite... so delete plugin + delete p; + return( NULL ); +} + + + + +#endif diff --git a/src/lmms_single_source.cpp b/src/lmms_single_source.cpp index 7019da3e5..7bb6e1390 100644 --- a/src/lmms_single_source.cpp +++ b/src/lmms_single_source.cpp @@ -44,6 +44,7 @@ #include "src/core/piano_widget.cpp" #include "src/core/name_label.cpp" #include "src/core/preset_preview_play_handle.cpp" +#include "src/core/tool.cpp" #include "src/core/track_container.cpp" #include "src/core/track.cpp" #include "src/core/file_browser.cpp"