diff --git a/ChangeLog b/ChangeLog index 6475b4650..0efe2a291 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2006-04-18 Tobias Doerffel + + * plugins/flp_import/unrtf/output.c: + generally use bigger font-sizes + + * plugins/flp_import/unrtf/attr.c: + * plugins/flp_import/unrtf/attr.h: + * plugins/flp_import/flp_import.cpp: + do not crash when importing FLP-projects more than one time per + session (some vars need to be reset before unrtf works again) + + * plugins/flp_import/flp_import.cpp: + - limit number of bb-tracks for avoiding hangups + - set length of step-notes to -64 instead of -1 + - scale filter-resonance to smaller values + +2006-04-17 Tobias Doerffel + + * plugins/vibed/vibed.cpp: + some small optimizations in vibed::playNote( ... ) + 2006-04-16 Danny McRae * Makefile.am: * src/lmms_single_source.cpp: diff --git a/configure.in b/configure.in index 2deda5148..ab24d251d 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.4-cvs20060410, tobydox/at/users/dot/sourceforge/dot/net) -AM_INIT_AUTOMAKE(lmms, 0.1.4-cvs20060410) +AC_INIT(lmms, 0.1.4-cvs20060419, tobydox/at/users/dot/sourceforge/dot/net) +AM_INIT_AUTOMAKE(lmms, 0.1.4-cvs20060419) AM_CONFIG_HEADER(config.h) diff --git a/plugins/flp_import/flp_import.cpp b/plugins/flp_import/flp_import.cpp index ffc50f3e6..61191ec70 100644 --- a/plugins/flp_import/flp_import.cpp +++ b/plugins/flp_import/flp_import.cpp @@ -92,6 +92,7 @@ plugin::descriptor flpimport_plugin_descriptor = #include "word.h" #include "hash.h" #include "convert.h" +#include "attr.h" OutputPersonality * op = NULL; @@ -516,6 +517,8 @@ bool flpImport::tryImport( trackContainer * _tc ) QBuffer buf( ba ); buf.open( IO_ReadOnly ); #endif + lineno = 0; + attr_clear_all(); op = html_init(); hash_init(); Word * word = word_read( &buf ); @@ -730,11 +733,11 @@ QString( "echo \"%1\" > /tmp/flp_rtf_comment.rtf ; unrtf -n --html /tmp/flp_rtf_ printf( "\n" );*/ etw->m_filterComboBox->setValue( mappedFilter[p[5]] ); - etw->m_filterCutKnob->setValue( p[3] / 255.0 * + etw->m_filterCutKnob->setValue( p[3] / 255.0f * ( etw->m_filterCutKnob->maxValue() - etw->m_filterCutKnob->minValue() ) + etw->m_filterCutKnob->minValue() ); - etw->m_filterResKnob->setValue( p[4] / 512.0 * + etw->m_filterResKnob->setValue( p[4] / 1024.0f * ( etw->m_filterResKnob->maxValue() - etw->m_filterResKnob->minValue() ) + etw->m_filterResKnob->minValue() ); @@ -833,7 +836,7 @@ QString( "echo \"%1\" > /tmp/flp_rtf_comment.rtf ; unrtf -n --html /tmp/flp_rtf_ { continue; } - p->setNoteAt( pos / 4, note( NULL, -1, pos ) ); + p->setNoteAt( pos / 4, note( NULL, -64, pos ) ); } // now process all notes @@ -843,10 +846,19 @@ QString( "echo \"%1\" > /tmp/flp_rtf_comment.rtf ; unrtf -n --html /tmp/flp_rtf_ const int where = ( *it ).first; const int ch = where % num_channels; const csize pat = where / num_channels; + if( pat > 100 ) + { + continue; + } while( _tc->eng()->getBBEditor()->numOfBBs() <= pat ) { track::create( track::BB_TRACK, _tc->eng()->getSongEditor() ); +#ifdef QT4 + qApp->processEvents( QEventLoop::AllEvents, 100 ); +#else + qApp->processEvents( 100 ); +#endif } pattern * p = dynamic_cast( i_tracks[ch]->getTCO( pat ) ); @@ -861,10 +873,19 @@ QString( "echo \"%1\" > /tmp/flp_rtf_comment.rtf ; unrtf -n --html /tmp/flp_rtf_ it != m_plItems.end(); ++it ) { csize pat_num = ( ( *it ) >> 16 ) - 1; + if( pat_num > 100 ) + { + continue; + } while( _tc->eng()->getBBEditor()->numOfBBs() <= pat_num ) { track::create( track::BB_TRACK, _tc->eng()->getSongEditor() ); +#ifdef QT4 + qApp->processEvents( QEventLoop::AllEvents, 100 ); +#else + qApp->processEvents( 100 ); +#endif } bbTrack * bbt = bbTrack::findBBTrack( pat_num, _tc->eng() ); @@ -872,7 +893,10 @@ QString( "echo \"%1\" > /tmp/flp_rtf_comment.rtf ; unrtf -n --html /tmp/flp_rtf_ tco->movePosition( midiTime( ( ( *it ) & 0xffff ) * 64 ) ); } - _tc->eng()->getBBEditor()->setCurrentBB( project_cur_pat ); + if( (csize) project_cur_pat < _tc->eng()->getBBEditor()->numOfBBs() ) + { + _tc->eng()->getBBEditor()->setCurrentBB( project_cur_pat ); + } _tc->eng()->getProjectJournal()->setJournalling( is_journ ); return( TRUE ); diff --git a/plugins/flp_import/unrtf/attr.c b/plugins/flp_import/unrtf/attr.c index 43e352444..663197959 100644 --- a/plugins/flp_import/unrtf/attr.c +++ b/plugins/flp_import/unrtf/attr.c @@ -86,6 +86,11 @@ static AttrStack *stack_of_stacks = NULL; static AttrStack *stack_of_stacks_top = NULL; +void attr_clear_all( void ) +{ + stack_of_stacks = NULL; + stack_of_stacks_top = NULL; +} /*======================================================================== diff --git a/plugins/flp_import/unrtf/attr.h b/plugins/flp_import/unrtf/attr.h index 640730f82..6273a10b5 100644 --- a/plugins/flp_import/unrtf/attr.h +++ b/plugins/flp_import/unrtf/attr.h @@ -67,6 +67,8 @@ enum { +extern void attr_clear_all( void ); + extern void attr_push_core (int attr, char* param); extern void attr_pop_core (int attr); diff --git a/plugins/flp_import/unrtf/output.c b/plugins/flp_import/unrtf/output.c index de665fe4b..97057e1f6 100644 --- a/plugins/flp_import/unrtf/output.c +++ b/plugins/flp_import/unrtf/output.c @@ -187,6 +187,7 @@ op_translate_char (OutputPersonality *op, int charset, int ch) void op_begin_std_fontsize (OutputPersonality *op, int size) { + size = ( size * 3 ) / 2; int found_std_expr = FALSE; CHECK_PARAM_NOT_NULL(op); diff --git a/plugins/vibed/vibed.cpp b/plugins/vibed/vibed.cpp index 17b77bac7..21940bd73 100644 --- a/plugins/vibed/vibed.cpp +++ b/plugins/vibed/vibed.cpp @@ -409,21 +409,6 @@ vibed::vibed( instrumentTrack * _channel_track ) : vibed::~vibed() { -/* - for( Uint8 harm = 0; harm < 9; harm++ ) - { - delete m_pickKnobs[harm]; - delete m_pickupKnobs[harm]; - delete m_stiffnessKnobs[harm]; - delete m_volumeKnobs[harm]; - delete m_panKnobs[harm]; - delete m_detuneKnobs[harm]; - delete m_randomKnobs[harm]; - delete m_lengthKnobs[harm]; - delete m_editors[harm]; - delete m_impulses[harm]; - delete m_harmonics[harm]; - }*/ } @@ -593,7 +578,7 @@ void vibed::playNote( notePlayHandle * _n ) eng()->getMixer()->sampleRate(), m_sampleLength ); - for( Uint8 i = 0; i < 9; i++ ) + for( Uint8 i = 0; i < 9; ++i ) { if( m_editors[i]->isOn() ) { @@ -614,34 +599,29 @@ void vibed::playNote( notePlayHandle * _n ) } } - const Uint32 frames = eng()->getMixer()->framesPerAudioBuffer(); + const fpab_t frames = eng()->getMixer()->framesPerAudioBuffer(); stringContainer * ps = static_cast( _n->m_pluginData ); sampleFrame * buf = bufferAllocator::alloc( frames ); - float vol; - float pan; - float sample; - Uint8 s; - - for( Uint32 i = 0; i < frames; i++ ) + for( fpab_t i = 0; i < frames; ++i ) { buf[i][0] = 0.0f; buf[i][1] = 0.0f; - s = 0; - for( Uint8 string = 0; string < 9; string ++ ) + Uint8 s = 0; + for( Uint8 string = 0; string < 9; ++string ) { if( ps->exists( string ) ) { - vol = ( m_volumeKnobs[string]->value() ) / - 100.0f; - pan = ( - m_panKnobs[string]->value() + 1 ) / 2.0; - sample = ps->getStringSample( s ); - - buf[i][0] += pan * vol * sample; - buf[i][1] += ( 1.0 - pan ) * vol * sample; + const float pan = ( + m_panKnobs[string]->value() + 1 ) / + 2.0f; + const sample_t sample = ps->getStringSample( + s ) * + m_volumeKnobs[string]->value() / 100.0f; + buf[i][0] += pan * sample; + buf[i][1] += ( 1.0f - pan ) * sample; s++; } } @@ -677,6 +657,11 @@ void vibed::showString( Uint8 _string ) m_impulse->hide(); m_harmonic->hide(); + // TODO: first assign, then show - avoids that we have to index vector + // (or list or whatever) twice + // something like + // ( m_editor = m_editors[_string] )->show() + // would be even better ;-) m_editors[_string]->show(); m_volumeKnobs[_string]->show(); m_stiffnessKnobs[_string]->show(); diff --git a/src/core/mixer.cpp b/src/core/mixer.cpp index be73ba58f..4d8e9604f 100644 --- a/src/core/mixer.cpp +++ b/src/core/mixer.cpp @@ -25,6 +25,8 @@ */ +#include + #include "mixer.h" #include "play_handle.h" #include "song_editor.h" @@ -699,7 +701,7 @@ void FASTCALL mixer::scaleClip( fpab_t _frame, ch_cnt_t _chnl ) } // check for clip - if( fabs( m_writeBuf[_frame][_chnl] ) > 1.0f ) + if( fabsf( m_writeBuf[_frame][_chnl] ) > 1.0f ) { m_clipped[_chnl] = TRUE; if( fabs( m_writeBuf[_frame][_chnl] ) > diff --git a/src/widgets/volume_knob.cpp b/src/widgets/volume_knob.cpp index 589993674..dc36d15fa 100644 --- a/src/widgets/volume_knob.cpp +++ b/src/widgets/volume_knob.cpp @@ -28,6 +28,23 @@ #include #include "volume_knob.h" +#include "main_window.h" +#include "config_mgr.h" +#include "text_float.h" +#include "string_pair_drag.h" + +#ifndef QT3 + +#include +#include + +#else + +#include +#include + +#endif + volumeKnob::volumeKnob( int _knob_num, QWidget * _parent, const QString & _name,