small fixes and other stuff

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@132 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2006-04-20 10:32:33 +00:00
parent 703adaf6a3
commit 6ab8ee6edb
9 changed files with 97 additions and 40 deletions

View File

@@ -1,3 +1,24 @@
2006-04-18 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* 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 <tobydox/at/users/dot/sourceforge/dot/net>
* plugins/vibed/vibed.cpp:
some small optimizations in vibed::playNote( ... )
2006-04-16 Danny McRae <khjklujn/at/users/dot/sourceforge/dot/net>
* Makefile.am:
* src/lmms_single_source.cpp:

View File

@@ -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)

View File

@@ -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<pattern *>(
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 );

View File

@@ -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;
}
/*========================================================================

View File

@@ -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);

View File

@@ -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);

View File

@@ -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<stringContainer *>(
_n->m_pluginData );
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( 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();

View File

@@ -25,6 +25,8 @@
*/
#include <math.h>
#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] ) >

View File

@@ -28,6 +28,23 @@
#include <math.h>
#include "volume_knob.h"
#include "main_window.h"
#include "config_mgr.h"
#include "text_float.h"
#include "string_pair_drag.h"
#ifndef QT3
#include <QtGui/QApplication>
#include <QtGui/QInputDialog>
#else
#include <qapplication.h>
#include <qinputdialog.h>
#endif
volumeKnob::volumeKnob( int _knob_num, QWidget * _parent, const QString & _name,