diff --git a/ChangeLog b/ChangeLog index dd508e3ec..90e8d59cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,42 @@ +2005-09-29 Tobias Doerffel + + * src/widgets/tab_widget.cpp: + fixed bugs when adding widget with already existing index + + * Makefile.am: + * include/midi_out.h: + * include/plucked_string_synth.h: + * src/soundgenerators/midi_out.cpp: + * src/soundgenerators/plucked_string_synth.cpp: + classes midiOut and pluckedStringSynth do not have slots or signals, + so Q_OBJECT-macros were removed and MOC-code isn't compiled anymore + + * include/sgs: + * src/core/plugin_management.cpp: + removed because not needed anymore with new plugin-system + + * configure.in: + * Makefile.am: + * include/audio_file_processor.h: + * include/channel_track.h: + * include/midi_out.h: + * include/plucked_string_synth.h: + * include/sound_generator.h: + * include/triple_oscillator.h: + * src/core/browser.cpp: + * src/core/sound_generator.cpp: + * src/core/song_editor.cpp: + * src/midi/midi_file.cpp: + * src/soundgenerators/*: + * src/tracks/channel_track.cpp: + made all sound-generator-plugins shared libraries loaded at runtime, + which gives much more flexibility because you can load songs/presets + from people having other plugins just by adding according lib*.so file + to /usr/lib - no need to recompile! + + * inlude/empty_sg_plugin.h: + added empty sound-generator plugin + 2005-09-28 Tobias Doerffel * include/song_editor.h: diff --git a/Makefile.am b/Makefile.am index 3d85f4c3a..928c50e4c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -60,7 +60,6 @@ lmms_MOC = \ ./knob.moc \ ./lcd_spinbox.moc \ ./lmms_main_win.moc \ - ./midi_out.moc \ ./mixer.moc \ ./name_label.moc \ ./nstate_button.moc \ @@ -68,7 +67,6 @@ lmms_MOC = \ ./piano_roll.moc \ ./piano_widget.moc \ ./pixmap_button.moc \ - ./plucked_string_synth.moc \ ./project_notes.moc \ ./rename_dialog.moc \ ./sample_buffer.moc \ @@ -81,7 +79,7 @@ lmms_MOC = \ ./surround_area.moc \ ./tab_bar.moc \ ./tab_button.moc \ - ./tab_widget.moc \ + ./tab_widget.moc \ ./timeline.moc \ ./track_container.moc \ ./track.moc \ @@ -91,8 +89,6 @@ lmms_MOC = \ BUILT_SOURCES = $(lmms_MOC) -#lmms_TRANSLATIONS = $(wildcard $(srcdir)/locale/*.qm $(srcdir)/locale/*.ts) - lmms_EMBEDDED_RESOURCES = $(wildcard $(srcdir)/resources/*png AUTHORS COPYING) ./embedded_resources.h: $(lmms_EMBEDDED_RESOURCES) bin2res @@ -127,7 +123,6 @@ lmms_SOURCES = \ $(srcdir)/src/core/note_play_handle.cpp \ $(srcdir)/src/core/piano_roll.cpp \ $(srcdir)/src/core/piano_widget.cpp \ - $(srcdir)/src/core/plugin_management.cpp \ $(srcdir)/src/core/preset_preview_play_handle.cpp \ $(srcdir)/src/core/sample_play_handle.cpp \ $(srcdir)/src/core/setup_dialog.cpp \ @@ -148,10 +143,6 @@ lmms_SOURCES = \ $(srcdir)/src/midi/midi_file.cpp \ $(srcdir)/src/midi/midi_mapper.cpp \ $(srcdir)/src/midi/midi_oss.cpp \ - $(srcdir)/src/soundgenerators/audio_file_processor.cpp \ - $(srcdir)/src/soundgenerators/midi_out.cpp \ - $(srcdir)/src/soundgenerators/plucked_string_synth.cpp \ - $(srcdir)/src/soundgenerators/triple_oscillator.cpp \ $(srcdir)/src/tracks/bb_track.cpp \ $(srcdir)/src/tracks/channel_track.cpp \ $(srcdir)/src/tracks/pattern.cpp \ @@ -261,12 +252,11 @@ lmms_SOURCES = \ $(srcdir)/include/tooltip.h \ $(srcdir)/include/led_checkbox.h \ $(srcdir)/include/text_float.h \ - $(srcdir)/include/setup_dialog.h + $(srcdir)/include/setup_dialog.h \ + $(srcdir)/include/empty_sg_plugin.h -EXTRA_DIST = \ - $(lmms_EMBEDDED_RESOURCES) \ - $(srcdir)/include/sgs +EXTRA_DIST = $(lmms_EMBEDDED_RESOURCES) CLEANFILES = $(lmms_MOC) ./embedded_resources.h @@ -299,7 +289,17 @@ if HAVE_LIBSF LIB_SF_LDADD = -lsndfile endif -lmms_LDADD = $(QT_LDADD) $(LIB_SDL_LDADD) $(LIB_ASOUND_LDADD) $(LIB_JACK_LDADD) $(LIB_SDL_SOUND_LDADD) $(LIB_VORBIS_LDADD) $(LIB_SRC_LDADD) $(LIB_SF_LDADD) +lmms_LDADD = $(QT_LDADD) $(LIB_SDL_LDADD) $(LIB_ASOUND_LDADD) $(LIB_JACK_LDADD) $(LIB_SDL_SOUND_LDADD) $(LIB_VORBIS_LDADD) $(LIB_SRC_LDADD) $(LIB_SF_LDADD) -laudiofileprocessor -ldl +lmms_LDFLAGS = -rdynamic -rpath $(pkglibdir) SUBDIRS = artwork locale midi-maps presets projects samples + + +pkglib_LTLIBRARIES= libaudiofileprocessor.la libmidiout.la libpluckedstringsynth.la libtripleoscillator.la + + +libaudiofileprocessor_la_SOURCES = src/soundgenerators/audio_file_processor.cpp +libmidiout_la_SOURCES = src/soundgenerators/midi_out.cpp +libpluckedstringsynth_la_SOURCES = src/soundgenerators/plucked_string_synth.cpp +libtripleoscillator_la_SOURCES = src/soundgenerators/triple_oscillator.cpp diff --git a/TODO b/TODO index 2668e16a5..fb63aea6f 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,4 @@ +- proper dlclos()ing of sg-plugins - use own scrollview for capturing wheel-events - add note-len- and note-alignment-selectbox to piano-roll - only redraw region given by paint-event in pattern, bbTCO, sampleTCO etc. diff --git a/configure.in b/configure.in index eeb547895..1335f3b64 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.1.1-cvs20050928, tobydox@users.sourceforge.net) -AM_INIT_AUTOMAKE(lmms, 0.1.1-cvs20050928) +AC_INIT(lmms, 0.1.1-cvs20050929, tobydox@users.sourceforge.net) +AM_INIT_AUTOMAKE(lmms, 0.1.1-cvs20050929) AM_CONFIG_HEADER(config.h) @@ -11,6 +11,8 @@ AM_CONFIG_HEADER(config.h) AC_PROG_CXX AC_PROG_CC AC_PROG_LN_S +AC_PROG_GCC_TRADITIONAL +AC_PROG_LIBTOOL AC_PATH_XTRA @@ -20,7 +22,7 @@ gw_CHECK_QT # checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([fcntl.h memory.h string.h sys/ioctl.h unistd.h stdlib.h]) +AC_CHECK_HEADERS([fcntl.h memory.h string.h sys/ioctl.h unistd.h stdlib.h dlfcn.h]) # checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -33,7 +35,6 @@ AC_C_BIGENDIAN # checks for library functions. AC_FUNC_ALLOCA -AC_PROG_GCC_TRADITIONAL AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_TYPE_SIGNAL diff --git a/include/about_dialog.h b/include/about_dialog.h index 5a9051d07..f5c35ccd9 100644 --- a/include/about_dialog.h +++ b/include/about_dialog.h @@ -52,8 +52,8 @@ public: protected: - void keyPressEvent( QKeyEvent * _ke ); - void resizeEvent( QResizeEvent * _re ); + virtual void keyPressEvent( QKeyEvent * _ke ); + virtual void resizeEvent( QResizeEvent * _re ); private: diff --git a/include/oscillator.h b/include/oscillator.h index fa31918d4..03ff8879e 100644 --- a/include/oscillator.h +++ b/include/oscillator.h @@ -44,6 +44,8 @@ typedef void ( oscillator:: * oscFuncPtr ) ( sampleFrame * _ab, Uint32 _frames, Uint8 _chnl ); +const sampleFrame ZERO_FRAME = { 0.0f, 0.0f } ; + class oscillator { @@ -74,8 +76,16 @@ public: } inline void setUserWave( const sampleFrame * _data, Uint32 _frames ) { - m_userWaveData = _data; - m_userWaveFrames = _frames; + if( m_userWaveFrames > 0 ) + { + m_userWaveData = _data; + m_userWaveFrames = _frames; + } + else + { + m_userWaveData = &ZERO_FRAME; + m_userWaveFrames = 1; + } } inline void update( sampleFrame * _ab, Uint32 _frames, Uint8 _chnl ) { @@ -90,7 +100,7 @@ public: recalcOscCoeff( phase( v ) ); } - static oscillator * FASTCALL createNewOsc( waveShapes _wave_shape, + static oscillator * FASTCALL createOsc( waveShapes _wave_shape, modulationAlgos _modulation_algo, float _freq, Sint16 _phase_offset, float _volume_factor, oscillator * _m_subOsc = NULL ); @@ -102,6 +112,7 @@ public: // check whether v2 is in next period return( floorf( v2 ) > floorf( v1 ) ); } + static inline float phase( float _sample ) { #ifndef modff @@ -112,6 +123,7 @@ public: return( modff( _sample, &t ) ); //return( _sample - floorf( _sample ) ); } + // now follow the wave-shape-routines... static inline sampleType sinSample( float _sample ) { diff --git a/lmms.spec.in b/lmms.spec.in index 95b6d7164..36d5b1602 100644 --- a/lmms.spec.in +++ b/lmms.spec.in @@ -97,6 +97,7 @@ make DESTDIR=$RPM_BUILD_ROOT install %files %defattr(-,root,root) %{_bindir}/lmms +%{_libdir}/lmms/ %files data diff --git a/src/core/song_editor.cpp b/src/core/song_editor.cpp index ba8c21b14..abfd961db 100644 --- a/src/core/song_editor.cpp +++ b/src/core/song_editor.cpp @@ -26,6 +26,8 @@ #include #endif +#include + #include "qt3support.h" @@ -88,8 +90,6 @@ #include "debug.h" -#include "triple_oscillator.h" - extern QString file_to_load; extern QString file_to_render; @@ -1295,7 +1295,7 @@ void songEditor::addChannelTrack( void ) #ifdef LMMS_DEBUG assert( t != NULL ); #endif - t->loadPluginSettings( tripleOscillator::defaultSettings() ); + t->loadPlugin( "tripleoscillator" ); t->toggledChannelButton( TRUE ); t->show(); } @@ -1427,12 +1427,12 @@ void songEditor::createNewProject( void ) track * t; t = track::createTrack( track::CHANNEL_TRACK, this ); - dynamic_cast< channelTrack * >( t )->loadPluginSettings( - tripleOscillator::defaultSettings() ); + dynamic_cast< channelTrack * >( t )->loadPlugin( + "tripleoscillator" ); track::createTrack( track::SAMPLE_TRACK, this ); t = track::createTrack( track::CHANNEL_TRACK, bbEditor::inst() ); - dynamic_cast< channelTrack * >( t )->loadPluginSettings( - tripleOscillator::defaultSettings() ); + dynamic_cast< channelTrack * >( t )->loadPlugin( + "tripleoscillator" ); track::createTrack( track::BB_TRACK, this ); setBPM( DEFAULT_BPM ); diff --git a/src/lib/oscillator.cpp b/src/lib/oscillator.cpp index f39c2450c..ca6f0fe33 100644 --- a/src/lib/oscillator.cpp +++ b/src/lib/oscillator.cpp @@ -25,8 +25,6 @@ #include "oscillator.h" -const sampleFrame zero_frame = { 0.0f, 0.0f }; - oscillator::oscillator( modulationAlgos _modulation_algo, float _freq, Sint16 _phase_offset, float _volume_factor, @@ -35,7 +33,7 @@ oscillator::oscillator( modulationAlgos _modulation_algo, float _freq, m_volumeFactor(_volume_factor), m_phaseOffset(_phase_offset), m_subOsc(_sub_osc), - m_userWaveData( &zero_frame ), + m_userWaveData( &ZERO_FRAME ), m_userWaveFrames( 1 ) { @@ -189,7 +187,7 @@ generateOscillatorCodeFor( userWaveOsc, userWaveSample ); -oscillator * FASTCALL oscillator::createNewOsc( waveShapes _wave_shape, +oscillator * oscillator::createOsc( waveShapes _wave_shape, modulationAlgos _modulation_algo, float _freq, Sint16 _phase_offset, float _volume_factor, diff --git a/src/widgets/tab_widget.cpp b/src/widgets/tab_widget.cpp index de98aaded..d1f95f0c2 100644 --- a/src/widgets/tab_widget.cpp +++ b/src/widgets/tab_widget.cpp @@ -76,7 +76,7 @@ tabWidget::~tabWidget() void tabWidget::addTab( QWidget * _w, const QString & _name, int _idx ) { widgetDesc d = { _w, _name, fontMetrics().width( _name ) + 10 } ; - if( _idx < 0 || m_widgets.contains( _idx ) == TRUE ) + if( _idx < 0/* || m_widgets.contains( _idx ) == TRUE*/ ) { while( m_widgets.contains( ++_idx ) == TRUE ) { @@ -85,6 +85,7 @@ void tabWidget::addTab( QWidget * _w, const QString & _name, int _idx ) m_widgets[_idx] = d; _w->setFixedSize( width() - 4, height() - 14 ); _w->move( 2, 12 ); + _w->show(); if( m_widgets.contains( m_activeTab ) ) {