removed specialBgHandlingWidget, style sheet, some cleaning up

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@579 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Javier Serrano Polo
2007-11-10 21:11:32 +00:00
parent 4f057a7068
commit 87612a2d13
32 changed files with 189 additions and 449 deletions

View File

@@ -76,7 +76,6 @@ QPixmap * audioFileProcessor::s_artwork = NULL;
audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) :
instrument( _channel_track, &audiofileprocessor_plugin_descriptor ),
specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) ),
m_drawMethod( sampleBuffer::LINE_CONNECT )
{
connect( &m_sampleBuffer, SIGNAL( sampleUpdated() ), this,
@@ -96,8 +95,6 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) :
"project_open_down" ) );
m_openAudioFileButton->setInactiveGraphic( embed::getIconPixmap(
"project_open" ) );
m_openAudioFileButton->setBgGraphic( getBackground(
m_openAudioFileButton ) );
connect( m_openAudioFileButton, SIGNAL( clicked() ), this,
SLOT( openAudioFile() ) );
toolTip::add( m_openAudioFileButton, tr( "Open other sample" ) );
@@ -117,7 +114,6 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) :
"reverse_on" ) );
m_reverseButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
"reverse_off" ) );
m_reverseButton->setBgGraphic( getBackground( m_reverseButton ) );
connect( m_reverseButton, SIGNAL( toggled( bool ) ), this,
SLOT( reverseBtnToggled( bool ) ) );
toolTip::add( m_reverseButton, tr( "Reverse sample" ) );
@@ -133,7 +129,6 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) :
"loop_on" ) );
m_loopButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
"loop_off" ) );
m_loopButton->setBgGraphic( getBackground( m_loopButton ) );
toolTip::add( m_loopButton,
tr( "Loop sample at start- and end-point" ) );
m_loopButton->setWhatsThis(
@@ -191,7 +186,6 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) :
m_viewLinesPB = new pixmapButton( this, NULL, NULL );
m_viewLinesPB->move( 154, 158 );
m_viewLinesPB->setBgGraphic( getBackground( m_viewLinesPB ) );
if( m_drawMethod == sampleBuffer::LINE_CONNECT )
{
m_viewLinesPB->setChecked( TRUE );
@@ -206,7 +200,6 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) :
m_viewDotsPB = new pixmapButton( this, NULL, NULL );
m_viewDotsPB->move( 204, 158 );
m_viewDotsPB->setBgGraphic( getBackground( m_viewDotsPB ) );
if( m_drawMethod == sampleBuffer::DOTS )
{
m_viewDotsPB->setChecked( TRUE );

View File

@@ -31,7 +31,6 @@
#include "instrument.h"
#include "sample_buffer.h"
#include "spc_bg_hndl_widget.h"
class knob;
@@ -39,7 +38,7 @@ class pixmapButton;
class volumeKnob;
class audioFileProcessor : public instrument, public specialBgHandlingWidget
class audioFileProcessor : public instrument
{
Q_OBJECT
public:

View File

@@ -23,16 +23,8 @@
*/
#ifndef QT3
#include <QtGui/QLayout>
#else
#include <qlayout.h>
#endif
#include "bass_booster.h"
#include "knob.h"

View File

@@ -23,30 +23,26 @@
*/
#include <QtGui/QPainter>
#include <Qt/QtXml>
#include <QtGui/QDropEvent>
#include "bit_invader.h"
#include <QtXml/QDomElement>
#include <iostream>
#include <cstdlib>
#include <ctime>
#include "math.h"
using namespace std;
#include "bit_invader.h"
#include "base64.h"
#include "engine.h"
#include "graph.h"
#include "instrument_track.h"
#include "note_play_handle.h"
#include "templates.h"
#include "knob.h"
#include "pixmap_button.h"
#include "tooltip.h"
#include "song_editor.h"
#include "led_checkbox.h"
#include "note_play_handle.h"
#include "oscillator.h"
#include "sample_buffer.h"
#include "pixmap_button.h"
#include "song_editor.h"
#include "templates.h"
#include "tooltip.h"
#undef SINGLE_SOURCE_COMPILE
#include "embed.cpp"
@@ -72,7 +68,8 @@ plugin::descriptor bitinvader_plugin_descriptor =
QPixmap * bitInvader::s_artwork = NULL;
bSynth::bSynth(float* shape, int length, float _pitch, bool _interpolation, float factor, const sample_rate_t _sample_rate )
bSynth::bSynth( float * shape, int length, float _pitch, bool _interpolation,
float factor, const sample_rate_t _sample_rate )
{
interpolation = _interpolation;
@@ -155,8 +152,7 @@ sample_t bSynth::nextStringSample( void )
bitInvader::bitInvader( instrumentTrack * _channel_track ) :
instrument( _channel_track,
&bitinvader_plugin_descriptor ),
specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) )
&bitinvader_plugin_descriptor )
{
@@ -336,24 +332,25 @@ bitInvader::bitInvader( instrumentTrack * _channel_track ) :
void bitInvader::sinWaveClicked( void )
{
// generate a Sinus wave using static oscillator-method
for (int i=0; i < sample_length; i++)
{
sample_shape[i] = oscillator::sinSample( i/static_cast<float>(sample_length) );
}
for (int i=0; i < sample_length; i++)
{
sample_shape[i] = oscillator::sinSample( i / static_cast<float>(
sample_length ) );
}
sampleChanged();
}
void bitInvader::triangleWaveClicked( void )
{
// generate a Triangle wave using static oscillator-method
for (int i=0; i < sample_length; i++)
{
sample_shape[i] = oscillator::triangleSample( i/static_cast<float>(sample_length) );
}
sampleChanged();
for (int i=0; i < sample_length; i++)
{
sample_shape[i] = oscillator::triangleSample( i /
static_cast<float>( sample_length) );
}
sampleChanged();
}
@@ -361,35 +358,36 @@ void bitInvader::sawWaveClicked( void )
{
// generate a Saw wave using static oscillator-method
for (int i=0; i < sample_length; i++)
{
sample_shape[i] = oscillator::sawSample( i/static_cast<float>(sample_length) );
}
sampleChanged();
{
sample_shape[i] = oscillator::sawSample( i / static_cast<float>(
sample_length ) );
}
sampleChanged();
}
void bitInvader::sqrWaveClicked( void )
{
// generate a Sqr wave using static oscillator-method
for (int i=0; i < sample_length; i++)
{
sample_shape[i] = oscillator::squareSample( i/static_cast<float>(sample_length) );
}
sampleChanged();
{
sample_shape[i] = oscillator::squareSample( i /
static_cast<float>( sample_length ) );
}
sampleChanged();
}
void bitInvader::noiseWaveClicked( void )
{
// generate a Noise wave using static oscillator-method
for (int i=0; i < sample_length; i++)
{
sample_shape[i] = oscillator::noiseSample( i/static_cast<float>(sample_length) );
}
sampleChanged();
{
sample_shape[i] = oscillator::noiseSample( i /
static_cast<float>( sample_length ) );
}
sampleChanged();
}
void bitInvader::usrWaveClicked( void )
@@ -408,119 +406,19 @@ void bitInvader::usrWaveClicked( void )
buffer.setAudioFile( af );
// copy buffer data
sample_length = min( sample_length, static_cast<int>(buffer.frames()) );
sample_length = min( sample_length, static_cast<int>(
buffer.frames() ) );
for ( int i = 0; i < sample_length; i++ )
{
sample_shape[i] = (float)*buffer.data()[i];
}
}
sampleChanged();
}
/*
deprecated code
was replaced by static oscillator methods
void bitInvader::sinWaveClicked( void )
{
// generate sample data
for (int i=0; i < sample_length; i++)
{
// sin(x)
sample_shape[i] = sinf(i * 6.2831853 / sample_length);
}
sampleChanged();
}
void bitInvader::triangleWaveClicked( void )
{
int half_sample_length = sample_length / 2;
if ((sample_length % 2) == 0) {
for (int i=0; i < half_sample_length; i++)
{
// triangle
sample_shape[i] = (((float)i) / half_sample_length * 2) - 1;
}
for (int i=half_sample_length; i < sample_length; i++)
{
// triangle
sample_shape[i] = - (((float)(i-half_sample_length)) / half_sample_length * 2) + 1;
}
} else {
for (int i=0; i < half_sample_length; i++)
{
// triangle
sample_shape[i] = (((float)i) / half_sample_length * 2) - 1;
}
sample_shape[half_sample_length] = 1;
for (int i=half_sample_length+1; i < sample_length; i++)
{
// triangle
sample_shape[i] = - (((float)(i-half_sample_length)) / half_sample_length * 2) + 1;
}
}
sampleChanged();
}
void bitInvader::sawWaveClicked( void )
{
for (int i=0; i < sample_length; i++)
{
// saw
sample_shape[i] = (((float)i) / sample_length * 2) - 1;
}
sampleChanged();
}
void bitInvader::sqrWaveClicked( void )
{
int half_sample_length = sample_length / 2;
for (int i=0; i < half_sample_length; i++)
{
// triangle
sample_shape[i] = 1;
}
for (int i=half_sample_length; i < sample_length; i++)
{
// triangle
sample_shape[i] = -1;
}
sampleChanged();
}
void bitInvader::noiseWaveClicked( void)
{
srand(time(NULL));
for (int i=0; i < sample_length; i++)
{
sample_shape[i]= ((float)rand() / RAND_MAX * 2.0) - 1.0;
}
sampleChanged();
}
*/
bitInvader::~bitInvader()
{
@@ -769,3 +667,6 @@ plugin * lmms_plugin_main( void * _data )
}
#include "bit_invader.moc"

View File

@@ -2,7 +2,7 @@
* bit_invader.h - declaration of class bitInvader and bSynth which
* are a wavetable synthesizer
*
* Copyright (c) 2006 Andreas Brandmaier <andy/at/brandmaier/dot/de>
* Copyright (c) 2006-2007 Andreas Brandmaier <andy/at/brandmaier/dot/de>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -29,28 +29,27 @@
#include "instrument.h"
#include "spc_bg_hndl_widget.h"
#include "graph.h"
#include "led_checkbox.h"
#include "oscillator.h"
#include "types.h"
class QPixmap;
class graph;
class knob;
class notePlayHandle;
class ledCheckBox;
class oscillator;
class pixmapButton;
class bSynth
{
public:
bSynth(float* sample, int length, float _pitch, bool _interpolation, float factor, const sample_rate_t _sample_rate);
bSynth( float * sample, int length, float _pitch, bool _interpolation,
float factor, const sample_rate_t _sample_rate );
virtual ~bSynth();
sample_t nextStringSample();
sample_t nextStringSample();
private:
int sample_index;
float sample_realindex;
int sample_length;
@@ -61,7 +60,7 @@ private:
} ;
class bitInvader : public instrument, public specialBgHandlingWidget
class bitInvader : public instrument
{
Q_OBJECT
public:
@@ -132,7 +131,6 @@ private:
} ;
#include "bit_invader.moc"
#endif

View File

@@ -156,11 +156,7 @@ static int my_getchar (QBuffer* f)
error_handler("Cannot allocate read buffer");
}
}
#ifndef QT3
read_buf_end = f->read(read_buf, buffer_size);
#else
read_buf_end = f->readBlock(read_buf, buffer_size);
#endif
read_buf_index = 0;
if (!read_buf_end)
return EOF;

View File

@@ -23,19 +23,12 @@
*/
#include <QtGui/QPainter>
#include <Qt/QtXml>
#include <QtGui/QDropEvent>
#include <iostream>
#include <cstdlib>
#include <ctime>
#include "math.h"
using namespace std;
#include "organic.h"
#include <QtXml/QDomElement>
#include "engine.h"
#include "instrument_track.h"
#include "knob.h"
@@ -83,7 +76,6 @@ QPixmap * organicInstrument::s_artwork = NULL;
organicInstrument::organicInstrument( instrumentTrack * _channel_track ) :
instrument( _channel_track,
&organic_plugin_descriptor ),
specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) ),
m_modulationAlgo( oscillator::MIX )
{
m_num_oscillators = 8;
@@ -525,3 +517,7 @@ plugin * lmms_plugin_main( void * _data )
* - randomize preset
*/
#include "organic.moc"

View File

@@ -28,8 +28,6 @@
#include "instrument.h"
#include "spc_bg_hndl_widget.h"
#include "led_checkbox.h"
#include "oscillator.h"
class QPixmap;
@@ -77,7 +75,7 @@ private slots:
class organicInstrument : public instrument, public specialBgHandlingWidget
class organicInstrument : public instrument
{
Q_OBJECT
public:
@@ -137,7 +135,6 @@ private slots:
} ;
#include "organic.moc"
#endif

View File

@@ -23,11 +23,12 @@
*/
#include "patman.h"
#include <QtGui/QFileDialog>
#include <QtGui/QDragEnterEvent>
#include <QtXml/QDomElement>
#include "patman.h"
#include "endian_handling.h"
#include "engine.h"
#include "gui_templates.h"
@@ -72,8 +73,7 @@ plugin * lmms_plugin_main( void * _data )
patmanSynth::patmanSynth( instrumentTrack * _track ) :
instrument( _track, &patman_plugin_descriptor ),
specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) )
instrument( _track, &patman_plugin_descriptor )
{
setAutoFillBackground( TRUE );
QPalette pal;
@@ -88,8 +88,6 @@ patmanSynth::patmanSynth( instrumentTrack * _track ) :
"project_open_down" ) );
m_openFileButton->setInactiveGraphic( embed::getIconPixmap(
"project_open" ) );
m_openFileButton->setBgGraphic( getBackground(
m_openFileButton ) );
connect( m_openFileButton, SIGNAL( clicked() ), this,
SLOT( openFile() ) );
toolTip::add( m_openFileButton, tr( "Open other patch" ) );
@@ -105,7 +103,6 @@ patmanSynth::patmanSynth( instrumentTrack * _track ) :
"loop_on" ) );
m_loopButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
"loop_off" ) );
m_loopButton->setBgGraphic( getBackground( m_loopButton ) );
toolTip::add( m_loopButton, tr( "Loop mode" ) );
m_loopButton->setWhatsThis(
tr( "Here you can toggle the Loop mode. If enabled, PatMan "
@@ -120,7 +117,6 @@ patmanSynth::patmanSynth( instrumentTrack * _track ) :
"tune_on" ) );
m_tuneButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
"tune_off" ) );
m_tuneButton->setBgGraphic( getBackground( m_tuneButton ) );
toolTip::add( m_tuneButton, tr( "Tune mode" ) );
m_tuneButton->setWhatsThis(
tr( "Here you can toggle the Tune mode. If enabled, PatMan "

View File

@@ -29,7 +29,6 @@
#include "instrument.h"
#include "sample_buffer.h"
#include "spc_bg_hndl_widget.h"
class pixmapButton;
@@ -45,7 +44,7 @@ class pixmapButton;
#define MODES_CLAMPED ( 1 << 7 )
class patmanSynth : public instrument, public specialBgHandlingWidget
class patmanSynth : public instrument
{
Q_OBJECT
public:

View File

@@ -23,25 +23,21 @@
*/
#include <Qt/QtXml>
#include <QtGui/QMessageBox>
#include "vestige.h"
#include <QtGui/QFileDialog>
#include <QtCore/QFileInfo>
#include <QtCore/QDir>
#include <QtGui/QMessageBox>
#include <QtGui/QPushButton>
#include <QtGui/QCursor>
#include <QtXml/QDomElement>
#include "engine.h"
#include "vestige.h"
#include "gui_templates.h"
#include "instrument_play_handle.h"
#include "instrument_track.h"
#include "lvsl_client.h"
#include "mixer.h"
#include "note_play_handle.h"
#include "pixmap_button.h"
#include "song_editor.h"
#include "spc_bg_hndl_widget.h"
#include "text_float.h"
#include "tooltip.h"
@@ -73,7 +69,6 @@ QPixmap * vestigeInstrument::s_artwork = NULL;
vestigeInstrument::vestigeInstrument( instrumentTrack * _instrument_track ) :
instrument( _instrument_track, &vestige_plugin_descriptor ),
specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) ),
m_plugin( NULL ),
m_pluginMutex()
{
@@ -91,8 +86,6 @@ vestigeInstrument::vestigeInstrument( instrumentTrack * _instrument_track ) :
"project_open_down" ) );
m_openPluginButton->setInactiveGraphic( embed::getIconPixmap(
"project_open" ) );
m_openPluginButton->setBgGraphic( getBackground(
m_openPluginButton ) );
connect( m_openPluginButton, SIGNAL( clicked() ), this,
SLOT( openPlugin() ) );
toolTip::add( m_openPluginButton, tr( "Open other VST-plugin" ) );

View File

@@ -27,30 +27,22 @@
#define _VESTIGE_H
#ifndef QT3
#include <QtCore/QMutex>
#else
#include <qmutex.h>
#endif
#include "instrument.h"
#include "midi.h"
#include "note.h"
#include "spc_bg_hndl_widget.h"
class QPixmap;
class QPushButton;
class pixmapButton;
class QPushButton;
class remoteVSTPlugin;
class QPixmap;
class vestigeInstrument : public instrument, public specialBgHandlingWidget
class vestigeInstrument : public instrument
{
Q_OBJECT
public:

View File

@@ -23,16 +23,10 @@
*/
#ifndef QT3
#include "vst_control_dialog.h"
#include <QtGui/QLayout>
#else
#include <qlayout.h>
#endif
#include "vst_effect.h"
@@ -45,11 +39,7 @@ vstControlDialog::vstControlDialog( QWidget * _parent,
QWidget * pw = m_effect->m_plugin->pluginWidget();
if( pw )
{
#ifndef QT3
pw->setParent( this );
#else
pw->reparent( this, QPoint( 0, 0 ) );
#endif
pw->show();
l->addWidget( pw );
}

View File

@@ -23,21 +23,13 @@
*/
#ifndef QT3
#include "vst_effect.h"
#include <QtGui/QMessageBox>
#else
#include <qmessagebox.h>
#endif
#include "vst_effect.h"
#include "vst_subplugin_features.h"
#include "song_editor.h"
#include "text_float.h"
#include "vst_subplugin_features.h"
#undef SINGLE_SOURCE_COMPILE

View File

@@ -25,20 +25,11 @@
*/
#ifndef QT3
#include "vst_subplugin_features.h"
#include <QtCore/QDir>
#include <QtGui/QLabel>
#else
#include <qdir.h>
#include <qlabel.h>
#endif
#include "vst_subplugin_features.h"
#include "config_mgr.h"
@@ -64,12 +55,8 @@ void vstSubPluginFeatures::listSubPluginKeys( plugin::descriptor * _desc,
keyList & _kl )
{
QStringList dlls = QDir( configManager::inst()->vstDir() ).
#ifndef QT3
entryList( QStringList() << "*.dll",
QDir::Files, QDir::Name );
#else
entryList( "*.dll", QDir::Files, QDir::Name );
#endif
// TODO: eval m_type
for( QStringList::const_iterator it = dlls.begin();
it != dlls.end(); ++it )