This commit is contained in:
Raine M. Ekman
2014-01-25 16:05:45 +02:00
69 changed files with 973 additions and 475 deletions

View File

@@ -243,7 +243,7 @@ void bitInvader::normalize()
const float f = fabsf( samples[i] );
if (f > max) { max = f; }
}
normalizeFactor = 1.0 / max;
m_normalizeFactor = 1.0 / max;
}
@@ -270,7 +270,7 @@ void bitInvader::playNote( notePlayHandle * _n,
}
else
{
factor = normalizeFactor;
factor = m_normalizeFactor;
}
_n->m_pluginData = new bSynth(
@@ -350,69 +350,69 @@ bitInvaderView::bitInvaderView( Instrument * _instrument,
m_graph->setPalette( pal );
sinWaveBtn = new pixmapButton( this, tr( "Sine wave" ) );
sinWaveBtn->move( 188, 120 );
sinWaveBtn->setActiveGraphic( embed::getIconPixmap(
m_sinWaveBtn = new pixmapButton( this, tr( "Sine wave" ) );
m_sinWaveBtn->move( 188, 120 );
m_sinWaveBtn->setActiveGraphic( embed::getIconPixmap(
"sin_wave_active" ) );
sinWaveBtn->setInactiveGraphic( embed::getIconPixmap(
m_sinWaveBtn->setInactiveGraphic( embed::getIconPixmap(
"sin_wave_inactive" ) );
toolTip::add( sinWaveBtn,
toolTip::add( m_sinWaveBtn,
tr( "Click for a sine-wave." ) );
triangleWaveBtn = new pixmapButton( this, tr( "Triangle wave" ) );
triangleWaveBtn->move( 188, 136 );
triangleWaveBtn->setActiveGraphic(
m_triangleWaveBtn = new pixmapButton( this, tr( "Triangle wave" ) );
m_triangleWaveBtn->move( 188, 136 );
m_triangleWaveBtn->setActiveGraphic(
embed::getIconPixmap( "triangle_wave_active" ) );
triangleWaveBtn->setInactiveGraphic(
m_triangleWaveBtn->setInactiveGraphic(
embed::getIconPixmap( "triangle_wave_inactive" ) );
toolTip::add( triangleWaveBtn,
toolTip::add( m_triangleWaveBtn,
tr( "Click here for a triangle-wave." ) );
sawWaveBtn = new pixmapButton( this, tr( "Saw wave" ) );
sawWaveBtn->move( 188, 152 );
sawWaveBtn->setActiveGraphic( embed::getIconPixmap(
m_sawWaveBtn = new pixmapButton( this, tr( "Saw wave" ) );
m_sawWaveBtn->move( 188, 152 );
m_sawWaveBtn->setActiveGraphic( embed::getIconPixmap(
"saw_wave_active" ) );
sawWaveBtn->setInactiveGraphic( embed::getIconPixmap(
m_sawWaveBtn->setInactiveGraphic( embed::getIconPixmap(
"saw_wave_inactive" ) );
toolTip::add( sawWaveBtn,
toolTip::add( m_sawWaveBtn,
tr( "Click here for a saw-wave." ) );
sqrWaveBtn = new pixmapButton( this, tr( "Square wave" ) );
sqrWaveBtn->move( 188, 168 );
sqrWaveBtn->setActiveGraphic( embed::getIconPixmap(
m_sqrWaveBtn = new pixmapButton( this, tr( "Square wave" ) );
m_sqrWaveBtn->move( 188, 168 );
m_sqrWaveBtn->setActiveGraphic( embed::getIconPixmap(
"square_wave_active" ) );
sqrWaveBtn->setInactiveGraphic( embed::getIconPixmap(
m_sqrWaveBtn->setInactiveGraphic( embed::getIconPixmap(
"square_wave_inactive" ) );
toolTip::add( sqrWaveBtn,
toolTip::add( m_sqrWaveBtn,
tr( "Click here for a square-wave." ) );
whiteNoiseWaveBtn = new pixmapButton( this,
m_whiteNoiseWaveBtn = new pixmapButton( this,
tr( "White noise wave" ) );
whiteNoiseWaveBtn->move( 188, 184 );
whiteNoiseWaveBtn->setActiveGraphic(
m_whiteNoiseWaveBtn->move( 188, 184 );
m_whiteNoiseWaveBtn->setActiveGraphic(
embed::getIconPixmap( "white_noise_wave_active" ) );
whiteNoiseWaveBtn->setInactiveGraphic(
m_whiteNoiseWaveBtn->setInactiveGraphic(
embed::getIconPixmap( "white_noise_wave_inactive" ) );
toolTip::add( whiteNoiseWaveBtn,
toolTip::add( m_whiteNoiseWaveBtn,
tr( "Click here for white-noise." ) );
usrWaveBtn = new pixmapButton( this, tr( "User defined wave" ) );
usrWaveBtn->move( 188, 200 );
usrWaveBtn->setActiveGraphic( embed::getIconPixmap(
m_usrWaveBtn = new pixmapButton( this, tr( "User defined wave" ) );
m_usrWaveBtn->move( 188, 200 );
m_usrWaveBtn->setActiveGraphic( embed::getIconPixmap(
"usr_wave_active" ) );
usrWaveBtn->setInactiveGraphic( embed::getIconPixmap(
m_usrWaveBtn->setInactiveGraphic( embed::getIconPixmap(
"usr_wave_inactive" ) );
toolTip::add( usrWaveBtn,
toolTip::add( m_usrWaveBtn,
tr( "Click here for a user-defined shape." ) );
smoothBtn = new pixmapButton( this, tr( "Smooth" ) );
smoothBtn->move( 35, 200 );
smoothBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
m_smoothBtn = new pixmapButton( this, tr( "Smooth" ) );
m_smoothBtn->move( 35, 200 );
m_smoothBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"smooth" ) );
smoothBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
m_smoothBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
"smooth" ) );
smoothBtn->setChecked( true );
toolTip::add( smoothBtn,
m_smoothBtn->setChecked( true );
toolTip::add( m_smoothBtn,
tr( "Click here to smooth waveform." ) );
@@ -426,20 +426,20 @@ bitInvaderView::bitInvaderView( Instrument * _instrument,
m_normalizeToggle->move( 55, 100 );
connect( sinWaveBtn, SIGNAL (clicked () ),
connect( m_sinWaveBtn, SIGNAL (clicked () ),
this, SLOT ( sinWaveClicked() ) );
connect( triangleWaveBtn, SIGNAL ( clicked () ),
connect( m_triangleWaveBtn, SIGNAL ( clicked () ),
this, SLOT ( triangleWaveClicked() ) );
connect( sawWaveBtn, SIGNAL (clicked () ),
connect( m_sawWaveBtn, SIGNAL (clicked () ),
this, SLOT ( sawWaveClicked() ) );
connect( sqrWaveBtn, SIGNAL ( clicked () ),
connect( m_sqrWaveBtn, SIGNAL ( clicked () ),
this, SLOT ( sqrWaveClicked() ) );
connect( whiteNoiseWaveBtn, SIGNAL ( clicked () ),
connect( m_whiteNoiseWaveBtn, SIGNAL ( clicked () ),
this, SLOT ( noiseWaveClicked() ) );
connect( usrWaveBtn, SIGNAL ( clicked () ),
connect( m_usrWaveBtn, SIGNAL ( clicked () ),
this, SLOT ( usrWaveClicked() ) );
connect( smoothBtn, SIGNAL ( clicked () ),
connect( m_smoothBtn, SIGNAL ( clicked () ),
this, SLOT ( smoothClicked() ) );
connect( m_interpolationToggle, SIGNAL( toggled( bool ) ),
@@ -514,6 +514,9 @@ void bitInvaderView::noiseWaveClicked()
void bitInvaderView::usrWaveClicked()
{
QString fileName = m_graph->model()->setWaveToUser();
toolTip::add( m_usrWaveBtn, fileName );
engine::getSong()->setModified();
/*
m_graph->model()->setWaveToNoise();
engine::getSong()->setModified();

View File

@@ -99,7 +99,7 @@ private:
BoolModel m_interpolation;
BoolModel m_normalize;
float normalizeFactor;
float m_normalizeFactor;
oscillator * m_osc;
@@ -136,13 +136,13 @@ private:
virtual void modelChanged();
knob * m_sampleLengthKnob;
pixmapButton * sinWaveBtn;
pixmapButton * triangleWaveBtn;
pixmapButton * sqrWaveBtn;
pixmapButton * sawWaveBtn;
pixmapButton * whiteNoiseWaveBtn;
pixmapButton * smoothBtn;
pixmapButton * usrWaveBtn;
pixmapButton * m_sinWaveBtn;
pixmapButton * m_triangleWaveBtn;
pixmapButton * m_sqrWaveBtn;
pixmapButton * m_sawWaveBtn;
pixmapButton * m_whiteNoiseWaveBtn;
pixmapButton * m_smoothBtn;
pixmapButton * m_usrWaveBtn;
static QPixmap * s_artwork;

View File

@@ -1,5 +1,5 @@
/*
* flp_import.cpp - support for importing FLP-files
* FlpImport.cpp - support for importing FLP-files
*
* Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
@@ -464,7 +464,7 @@ struct FL_Channel : public FL_Plugin
filterCut( 10000 ),
filterRes( 0.1 ),
filterEnabled( false ),
arpDir( Arpeggiator::ArpDirUp ),
arpDir( InstrumentFunctionArpeggio::ArpDirUp ),
arpRange( 0 ),
selectedArp( 0 ),
arpTime( 100 ),
@@ -603,14 +603,14 @@ bool FlpImport::tryImport( TrackContainer* tc )
basicFilters<>::NumFilters+basicFilters<>::LowPass
} ;
const Arpeggiator::ArpDirections mappedArpDir[] =
const InstrumentFunctionArpeggio::ArpDirections mappedArpDir[] =
{
Arpeggiator::ArpDirUp,
Arpeggiator::ArpDirUp,
Arpeggiator::ArpDirDown,
Arpeggiator::ArpDirUpAndDown,
Arpeggiator::ArpDirUpAndDown,
Arpeggiator::ArpDirRandom
InstrumentFunctionArpeggio::ArpDirUp,
InstrumentFunctionArpeggio::ArpDirUp,
InstrumentFunctionArpeggio::ArpDirDown,
InstrumentFunctionArpeggio::ArpDirUpAndDown,
InstrumentFunctionArpeggio::ArpDirUpAndDown,
InstrumentFunctionArpeggio::ArpDirRandom
} ;
QMap<QString, int> mappedPluginTypes;
@@ -1519,7 +1519,7 @@ else
}
}
Arpeggiator * arp = &t->m_arpeggiator;
InstrumentFunctionArpeggio * arp = &t->m_arpeggio;
arp->m_arpDirectionModel.setValue( it->arpDir );
arp->m_arpRangeModel.setValue( it->arpRange );
arp->m_arpModel.setValue( it->selectedArp );

View File

@@ -9,7 +9,7 @@
04 apr 03 -- fixed bug in add_track that caused infinite loop
*/
#include "assert.h"
#include "debug.h"
#include "stdlib.h"
#include "stdio.h"
#include "string.h"
@@ -727,8 +727,8 @@ void Alg_event_list::set_start_time(Alg_event *event, double t)
// For Alg_track, change the time and move the event to the right place
// For Alg_seq, find the track and do the update there
long index, i;
Alg_track_ptr track_ptr;
long index = 0, i;
Alg_track_ptr track_ptr = Alg_track_ptr();
if (type == 'e') { // this is an Alg_event_list
// make sure the owner has not changed its event set
assert(events_owner &&
@@ -2283,6 +2283,7 @@ Alg_track_ptr Alg_seq::track(int i)
}
#pragma GCC diagnostic ignored "-Wreturn-type" // ok not to return a value here
Alg_event_ptr &Alg_seq::operator[](int i)
{
int ntracks = track_list.length();
@@ -2296,7 +2297,7 @@ Alg_event_ptr &Alg_seq::operator[](int i)
}
tr++;
}
assert(false); // out of bounds
assert(false); // out of bounds
}

View File

@@ -48,7 +48,7 @@
#ifndef __ALLEGRO__
#define __ALLEGRO__
#include <assert.h>
#include "debug.h"
#include "lmmsconfig.h"

View File

@@ -1,4 +1,4 @@
#include "assert.h"
#include "debug.h"
#include "stdlib.h"
#include "string.h"
#include "ctype.h"

View File

@@ -3,7 +3,7 @@
#include "stdlib.h"
#include "stdio.h"
#include "string.h"
#include "assert.h"
#include "debug.h"
#include <string>
#include <fstream>
#include "allegro.h"

View File

@@ -1,6 +1,6 @@
// allegrowr.cpp -- write sequence to an Allegro file (text)
#include "assert.h"
#include "debug.h"
#include "stdlib.h"
#include <iostream>
#include <fstream>

View File

@@ -25,7 +25,6 @@
#include "patman.h"
#include <QtGui/QFileDialog>
#include <QtGui/QDragEnterEvent>
#include <QtGui/QPainter>
#include <QtXml/QDomElement>
@@ -39,6 +38,7 @@
#include "song.h"
#include "string_pair_drag.h"
#include "tooltip.h"
#include "FileDialog.h"
#include "embed.cpp"
@@ -508,11 +508,8 @@ PatmanView::~PatmanView()
void PatmanView::openFile( void )
{
QFileDialog ofd( NULL, tr( "Open patch file" ) );
#if QT_VERSION >= 0x040806
ofd.setOption( QFileDialog::DontUseCustomDirectoryIcons );
#endif
ofd.setFileMode( QFileDialog::ExistingFiles );
FileDialog ofd( NULL, tr( "Open patch file" ) );
ofd.setFileMode( FileDialog::ExistingFiles );
QStringList types;
types << tr( "Patch-Files (*.pat)" );

View File

@@ -27,9 +27,9 @@
#include <QtCore/QTextStream>
#include <QtGui/QLayout>
#include <QtGui/QLabel>
#include <QtGui/QFileDialog>
#include <QtXml/QDomDocument>
#include "FileDialog.h"
#include "sf2_player.h"
#include "engine.h"
#include "InstrumentTrack.h"
@@ -1044,11 +1044,8 @@ void sf2InstrumentView::showFileDialog()
{
sf2Instrument * k = castModel<sf2Instrument>();
QFileDialog ofd( NULL, tr( "Open SoundFont file" ) );
#if QT_VERSION >= 0x040806
ofd.setOption( QFileDialog::DontUseCustomDirectoryIcons );
#endif
ofd.setFileMode( QFileDialog::ExistingFiles );
FileDialog ofd( NULL, tr( "Open SoundFont file" ) );
ofd.setFileMode( FileDialog::ExistingFiles );
QStringList types;
types << tr( "SoundFont2 Files (*.sf2)" );

View File

@@ -138,10 +138,9 @@ OscillatorObject::~OscillatorObject()
void OscillatorObject::oscUserDefWaveDblClick()
{
QString af = m_sampleBuffer->openAudioFile();
QString af = m_sampleBuffer->openAndSetAudioFile();
if( af != "" )
{
m_sampleBuffer->setAudioFile( af );
// TODO:
//toolTip::add( m_usrWaveBtn, m_sampleBuffer->audioFile() );
}

View File

@@ -25,7 +25,6 @@
#include "vestige.h"
#include <QtGui/QDropEvent>
#include <QtGui/QFileDialog>
#include <QtGui/QMessageBox>
#include <QtGui/QPainter>
#include <QtGui/QPushButton>
@@ -43,6 +42,7 @@
#include "string_pair_drag.h"
#include "text_float.h"
#include "tooltip.h"
#include "FileDialog.h"
#include "embed.cpp"
@@ -613,10 +613,7 @@ void VestigeInstrumentView::modelChanged()
void VestigeInstrumentView::openPlugin()
{
QFileDialog ofd( NULL, tr( "Open VST-plugin" ) );
#if QT_VERSION >= 0x040806
ofd.setOption( QFileDialog::DontUseCustomDirectoryIcons );
#endif
FileDialog ofd( NULL, tr( "Open VST-plugin" ) );
QString dir;
if( m_vi->m_pluginDLL != "" )
@@ -629,7 +626,7 @@ void VestigeInstrumentView::openPlugin()
}
// change dir to position of previously opened file
ofd.setDirectory( dir );
ofd.setFileMode( QFileDialog::ExistingFiles );
ofd.setFileMode( FileDialog::ExistingFiles );
// set filters
QStringList types;

View File

@@ -728,9 +728,9 @@ void vibedView::noiseWaveClicked()
void vibedView::usrWaveClicked()
{
// TODO: load file
//m_graph->model()->setWaveToUser();
//engine::getSongEditor()->setModified();
QString fileName = m_graph->model()->setWaveToUser();
toolTip::add( m_usrWaveBtn, fileName );
engine::getSong()->setModified();
}

View File

@@ -24,7 +24,6 @@
#include "VstPlugin.h"
#include <QtGui/QFileDialog>
#include <QtCore/QDir>
#include <QtCore/QFileInfo>
#include <QtCore/QLocale>
@@ -49,6 +48,7 @@
#include "MainWindow.h"
#include "song.h"
#include "templates.h"
#include "FileDialog.h"
#include <QtGui/QLayout>
@@ -510,12 +510,9 @@ bool VstPlugin::processMessage( const message & _m )
void VstPlugin::openPreset( )
{
QFileDialog ofd( NULL, tr( "Open Preset" ), "",
FileDialog ofd( NULL, tr( "Open Preset" ), "",
tr( "Vst Plugin Preset (*.fxp *.fxb)" ) );
#if QT_VERSION >= 0x040806
ofd.setOption( QFileDialog::DontUseCustomDirectoryIcons );
#endif
ofd.setFileMode( QFileDialog::ExistingFiles );
ofd.setFileMode( FileDialog::ExistingFiles );
if( ofd.exec () == QDialog::Accepted &&
!ofd.selectedFiles().isEmpty() )
{
@@ -571,19 +568,16 @@ void VstPlugin::savePreset( )
QString presName = currentProgramName().isEmpty() ? tr(": default") : currentProgramName();
presName.replace(tr("\""), tr("'")); // QFileDialog unable to handle double quotes properly
QFileDialog sfd( NULL, tr( "Save Preset" ), presName.section(": ", 1, 1) + tr(".fxp"),
FileDialog sfd( NULL, tr( "Save Preset" ), presName.section(": ", 1, 1) + tr(".fxp"),
tr( "Vst Plugin Preset (*.fxp *.fxb)" ) );
#if QT_VERSION >= 0x040806
sfd.setOption( QFileDialog::DontUseCustomDirectoryIcons );
#endif
if( p_name != "" ) // remember last directory
{
sfd.setDirectory( QFileInfo( p_name ).absolutePath() );
}
sfd.setAcceptMode( QFileDialog::AcceptSave );
sfd.setFileMode( QFileDialog::AnyFile );
sfd.setAcceptMode( FileDialog::AcceptSave );
sfd.setFileMode( FileDialog::AnyFile );
if( sfd.exec () == QDialog::Accepted &&
!sfd.selectedFiles().isEmpty() && sfd.selectedFiles()[0] != "" )
{