diff --git a/ChangeLog b/ChangeLog index 65c2ea68e..fa41b2dea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,32 @@ +2007-10-08 Tobias Doerffel + + merged some of Javiers recent changes to trunk: + + * configure.in: + * plugins/vst_base/lvsl_client.cpp: + * plugins/vst_base/lvsl_server.cpp: + * plugins/vst_base/Makefile.am: + * src/lib/journalling_object.cpp: + amd64 fixes + + * plugins/vestige/vestige.cpp: + fixed loading deadlock + + * plugins/vst_base/lvsl_server.c: + restricted shared memory permissions + + * plugins/vst_base/communication.h: + improved string communication + + * configure.in: + look for wine header in system folder too + + * plugins/singerbot/singerbot.cpp: + detected heap corruption + + * plugins/polyb302/polyb302.cpp: + applied relevant LB302 changes + 2007-09-25 Tobias Doerffel * include/mixer.h: diff --git a/Makefile.am b/Makefile.am index 37870547c..d43f98776 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,5 @@ AUTOMAKE_OPTIONS = foreign 1.4 +ACLOCAL_AMFLAGS = -I m4 dist-hook: rm -rf `find $(distdir) -name \*.moc` diff --git a/configure.in b/configure.in index 83f03522c..683563424 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.3.0, lmms-devel/at/lists/dot/sf/dot/net) -AM_INIT_AUTOMAKE(lmms, 0.3.0) +AC_INIT(lmms, 0.3.0-svn20071008, lmms-devel/at/lists/dot/sf/dot/net) +AM_INIT_AUTOMAKE(lmms, 0.3.0-svn20071008) AM_CONFIG_HEADER(config.h) @@ -218,7 +218,17 @@ if test "x$with_vst" = "xyes" ; then if test "$build_linux" = "true" ; then AC_CHECK_PROG(WINECXX, wineg++, /usr/bin/wineg++,,/usr/bin) - AC_CHECK_LIB([wine], [wine_init], true) + + if test "x`uname -m`" != "xx86_64" ; then + AC_CHECK_LIB([wine], [wine_init], true) + else + AMD64_BUILD=yes + OLDCFLAGS="$CFLAGS" + CFLAGS="-m32 $CFLAGS" + AC_CHECK_LIB([wine], [wine_init], true) + CFLAGS="$OLDCFLAGS" + fi + if test ! -z "$WINECXX" ; then AC_LANG_PUSH(C++) # CXXFLAGS="$CXXFLAGS -I${prefix}/include/wine/windows" @@ -226,6 +236,7 @@ if test "x$with_vst" = "xyes" ; then OLDCPPFLAGS="$CPPFLAGS" CXX="$WINECXX" CPPFLAGS="$CPPFLAGS -I${prefix}/include/wine/windows" + CPPFLAGS+=" -I/usr/include/wine/windows" AC_CHECK_HEADER(windows.h, HAVE_WINDOWS_H="true") CXX="$OLDCXX" CPPFLAGS="$OLDCPPFLAGS" @@ -237,6 +248,7 @@ if test "x$with_vst" = "xyes" ; then fi fi AM_CONDITIONAL(VST_SUPPORT, test ! -z "$WINECXX") +AM_CONDITIONAL(AMD64_BUILD, test "x$AMD64_BUILD" = "xyes") # check for LADSPA-SDK diff --git a/plugins/polyb302/polyb302.cpp b/plugins/polyb302/polyb302.cpp index 6c0cc0996..d8ae56d30 100644 --- a/plugins/polyb302/polyb302.cpp +++ b/plugins/polyb302/polyb302.cpp @@ -665,7 +665,8 @@ polyb302Synth::handleState::handleState( const polyb302Synth * _synth ) m_vcf_envpos = ENVINC; m_vco_detune = 0; - m_vca_mode = 2; + // Start VCA on an attack. + m_vca_mode = 0; m_vca_a = 0; //m_vca_attack = 1.0 - 0.94406088; m_vca_attack = 1.0 - 0.96406088; @@ -816,19 +817,6 @@ void polyb302Synth::handleState::process( sampleFrame * _outbuf, m_sample_cnt++; m_vcf_envpos++; - // 01/21/07 Changed to VCF -> VCA instead of VCA -> VCF -#ifdef LB_FILTERED - float samp = m_vcf->process( m_vco_k ) * 2.0 * m_vca_a; -#else - float samp = m_vco_k * m_vca_a; -#endif - - for( int c = 0; c < DEFAULT_CHANNELS; c++ ) - { - _outbuf[i][c] = samp; - } - - // update vco m_vco_c += m_vco_inc * _freq; if( m_vco_c > 0.5 ) @@ -902,19 +890,30 @@ void polyb302Synth::handleState::process( sampleFrame * _outbuf, break; } - // Make it louder. For the better? - //m_vco_k*=2.0; + // Write out samples. +#ifdef LB_FILTERED + float samp = m_vcf->process( m_vco_k ) * 2.0 * m_vca_a; +#else + float samp = m_vco_k * m_vca_a; +#endif + + for( int c = 0; c < DEFAULT_CHANNELS; c++ ) + { + _outbuf[i][c] = samp; + } + // Handle Envelope // TODO: Add decay once I figure out how to extend past the end // of a note. - if( m_sample_cnt >= 0.5 * engine::getMixer()->sampleRate() ) - { - m_vca_mode = 2; - } if( m_vca_mode == 0 ) { m_vca_a += ( m_vca_a0 - m_vca_a ) * m_vca_attack; + if( m_sample_cnt >= 0.5 + * engine::getMixer()->sampleRate() ) + { + m_vca_mode = 2; + } } else if( m_vca_mode == 1 ) { diff --git a/plugins/singerbot/singerbot.cpp b/plugins/singerbot/singerbot.cpp index d7a6fdf73..eb5817843 100644 --- a/plugins/singerbot/singerbot.cpp +++ b/plugins/singerbot/singerbot.cpp @@ -452,6 +452,7 @@ void singerBot::synThread::run( void ) void singerBot::synThread::text_to_wave( void ) { + //TODO: Heap corruption too -> move to separate process? char command[80]; sprintf( command, "(set! duffint_params '((start %f) (end %f)))", @@ -508,7 +509,7 @@ EST_Wave * singerBot::synThread::get_wave( const char * _name ) return( NULL ); } - EST_Relation *r = utterance( lutt )->relation( "Wave" ); + EST_Relation * r = utterance( lutt )->relation( "Wave" ); //TODO: This check is useless. The error is fatal. if ( !r || !r->head() ) diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 15eabdb85..d81e03578 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -456,7 +456,9 @@ void vestigeInstrument::openPlugin( void ) { return; } + engine::getMixer()->lock(); setParameter( "plugin", ofd.selectedFiles()[0] ); + engine::getMixer()->unlock(); } } diff --git a/plugins/vst_base/Makefile.am b/plugins/vst_base/Makefile.am index 2ab0f26ae..e662bdfd0 100644 --- a/plugins/vst_base/Makefile.am +++ b/plugins/vst_base/Makefile.am @@ -20,12 +20,19 @@ libvstbase_la_SOURCES = vst_base.cpp \ lvsl_client.cpp \ lvsl_client.h -CC = wineg++ pkglib_PROGRAMS = lvsl_server -lvsl_server_SOURCES = lvsl_server.c communication.h +lvsl_server_SOURCES = lvsl_server.cpp communication.h +lvsl_server_CPPFLAGS = $(AM_CPPFLAGS) -I${prefix}/include/wine/windows +lvsl_server_CPPFLAGS += -I/usr/include/wine/windows lvsl_server_LINK = wineg++ -mwindows -lpthread -o $(pkglib_PROGRAMS) nobase_pkglib_DATA = $(pkglib_PROGRAMS).exe.so +if AMD64_BUILD +lvsl_server_CXXFLAGS = -m32 $(AM_CXXFLAGS) +lvsl_server_LINK += -m32 -Wb,--as-cmd="as --32",--ld-cmd="ld -melf_i386" \ + -L/usr/lib32 +endif + CLEANFILES = $(MOC_FILES) $(nobase_pkglib_DATA) install-exec-hook: diff --git a/plugins/vst_base/communication.h b/plugins/vst_base/communication.h index bf7b7b1ef..35baf234a 100644 --- a/plugins/vst_base/communication.h +++ b/plugins/vst_base/communication.h @@ -2,7 +2,7 @@ * communication.h - header file defining stuff concerning communication between * LVSL-server and -client * - * Copyright (c) 2005-2006 Tobias Doerffel + * Copyright (c) 2005-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -61,8 +61,9 @@ inline void writeValue( const T & _i, int _fd = 1 ) static inline std::string readString( int _fd = 0 ) { Sint16 len = readValue( _fd ); - char * sc = new char[len]; + char * sc = new char[len + 1]; read( _fd, sc, len ); + sc[len] = '\0'; std::string s( sc ); delete[] sc; return( s ); @@ -73,7 +74,7 @@ static inline std::string readString( int _fd = 0 ) static inline void writeString( const char * _str, int _fd = 1 ) { - int len = strlen( _str ) + 1; + int len = strlen( _str ); writeValue( len, _fd ); write( _fd, _str, len ); } diff --git a/plugins/vst_base/lvsl_client.cpp b/plugins/vst_base/lvsl_client.cpp index 3954c944d..fbd3ae3d9 100644 --- a/plugins/vst_base/lvsl_client.cpp +++ b/plugins/vst_base/lvsl_client.cpp @@ -382,7 +382,12 @@ void remoteVSTPlugin::enqueueMidiEvent( const midiEvent & _event, { lock(); writeValueS( VST_ENQUEUE_MIDI_EVENT ); - writeValueS( _event ); + + writeValueS( _event.m_type ); + writeValueS( _event.m_channel ); + writeValueS( _event.m_data.m_param[0] ); + writeValueS( _event.m_data.m_param[1] ); + writeValueS( _frames_ahead ); unlock(); } @@ -578,7 +583,7 @@ Sint16 remoteVSTPlugin::processNextMessage( void ) case VST_SHM_KEY_AND_SIZE: { Uint16 shm_key = readValueS(); - size_t shm_size = readValueS(); + size_t shm_size = readValueS(); setShmKeyAndSize( shm_key, shm_size ); break; } diff --git a/plugins/vst_base/lvsl_server.c b/plugins/vst_base/lvsl_server.c index db9a7a91d..f8be5feeb 100644 --- a/plugins/vst_base/lvsl_server.c +++ b/plugins/vst_base/lvsl_server.c @@ -665,7 +665,7 @@ void VSTPlugin::resizeSharedMemory( void ) int shm_id; Uint16 shm_key = 0; while( ( shm_id = shmget( ++shm_key, s, IPC_CREAT | IPC_EXCL | - 0666 ) ) == -1 ) + 0600 ) ) == -1 ) { } @@ -688,7 +688,7 @@ void VSTPlugin::resizeSharedMemory( void ) writeValue( VST_SHM_KEY_AND_SIZE ); writeValue( shm_key ); - writeValue( s ); + writeValue( s ); } @@ -1206,7 +1206,14 @@ int main( void ) case VST_ENQUEUE_MIDI_EVENT: { - const midiEvent ev = readValue(); + midiEventTypes type = + readValue(); + Sint8 channel = readValue(); + Uint16 param1 = readValue(); + Uint16 param2 = readValue(); + const midiEvent ev = midiEvent( type, channel, + param1, param2 ); + const f_cnt_t fr_ahead = readValue(); plugin->enqueueMidiEvent( ev, fr_ahead ); break; diff --git a/src/lib/journalling_object.cpp b/src/lib/journalling_object.cpp index 3921728cc..83ab4e941 100644 --- a/src/lib/journalling_object.cpp +++ b/src/lib/journalling_object.cpp @@ -161,15 +161,16 @@ void journallingObject::saveJournal( QDomDocument & _doc, QDomElement journal_de = _doc.createElement( "journal" ); journal_de.setAttribute( "id", id() ); journal_de.setAttribute( "entries", m_journalEntries.size() ); - journal_de.setAttribute( "curentry", m_currentJournalEntry - - m_journalEntries.begin() ); + journal_de.setAttribute( "curentry", (int)( m_currentJournalEntry - + m_journalEntries.begin() ) ); journal_de.setAttribute( "metadata", TRUE ); for( journalEntryVector::const_iterator it = m_journalEntries.begin(); it != m_journalEntries.end(); ++it ) { QDomElement je_de = _doc.createElement( "entry" ); - je_de.setAttribute( "pos", it - m_journalEntries.begin() ); + je_de.setAttribute( "pos", (int)( it - + m_journalEntries.begin() ) ); je_de.setAttribute( "actionid", it->actionID() ); je_de.setAttribute( "data", base64::encode( it->data() ) ); journal_de.appendChild( je_de );