Merge pull request #219 from diizy/stable-0.4

Sfxr logo, custom waveforms
This commit is contained in:
Tobias Doerffel
2014-02-01 03:42:06 -08:00
43 changed files with 31 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
INCLUDE(InstallHelpers)
INSTALL_DATA_SUBDIRS("samples" "*.wav;*.ogg;*.ds")
INSTALL_DATA_SUBDIRS("samples" "*.wav;*.ogg;*.ds;*.flac")

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -174,7 +174,8 @@ public:
QString openAudioFile() const;
QString openAndSetAudioFile();
QString openAndSetWaveformFile();
QString & toBase64( QString & _dst ) const;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 433 B

After

Width:  |  Height:  |  Size: 428 B

View File

@@ -42,11 +42,11 @@ enum SfxrWaves
};
const int WAVEFORM_BASE_X = 20;
const int WAVEFORM_BASE_Y = 14;
const int WAVEFORM_BASE_Y = 15;
const int WAVEFORM_BUTTON_WIDTH = 16;
const int GENERATOR_BASE_X = 110;
const int GENERATOR_BASE_Y = 24;
const int GENERATOR_BASE_Y = 25;
const int GENERATOR_BUTTON_WIDTH = 16;
const int RAND_BUTTON_X = 160;

View File

@@ -138,7 +138,7 @@ OscillatorObject::~OscillatorObject()
void OscillatorObject::oscUserDefWaveDblClick()
{
QString af = m_sampleBuffer->openAndSetAudioFile();
QString af = m_sampleBuffer->openAndSetWaveformFile();
if( af != "" )
{
// TODO:

View File

@@ -198,6 +198,7 @@ void LfoController::saveSettings( QDomDocument & _doc, QDomElement & _this )
m_phaseModel.saveSettings( _doc, _this, "phase" );
m_waveModel.saveSettings( _doc, _this, "wave" );
m_multiplierModel.saveSettings( _doc, _this, "multiplier" );
_this.setAttribute( "userwavefile" , m_userDefSampleBuffer->audioFile() );
}
@@ -212,6 +213,7 @@ void LfoController::loadSettings( const QDomElement & _this )
m_phaseModel.loadSettings( _this, "phase" );
m_waveModel.loadSettings( _this, "wave" );
m_multiplierModel.loadSettings( _this, "multiplier" );
m_userDefSampleBuffer->setAudioFile( _this.attribute("userwavefile" ) );
updateSampleFunction();
}

View File

@@ -908,6 +908,27 @@ QString SampleBuffer::openAndSetAudioFile()
}
QString SampleBuffer::openAndSetWaveformFile()
{
if( m_audioFile.isEmpty() )
{
m_audioFile = configManager::inst()->factorySamplesDir() + "waveforms/10saw.flac";
}
QString fileName = this->openAudioFile();
if(!fileName.isEmpty())
{
this->setAudioFile( fileName );
}
else
{
m_audioFile = "";
}
return fileName;
}
#undef LMMS_HAVE_FLAC_STREAM_ENCODER_H /* not yet... */

View File

@@ -252,7 +252,7 @@ void LfoControllerDialog::askUserDefWave()
{
SampleBuffer * sampleBuffer = dynamic_cast<LfoController*>(this->model())->
m_userDefSampleBuffer;
QString fileName = sampleBuffer->openAndSetAudioFile();
QString fileName = sampleBuffer->openAndSetWaveformFile();
if( fileName.isEmpty() == false )
{
// TODO:

View File

@@ -485,7 +485,7 @@ void graphModel::setWaveToNoise()
QString graphModel::setWaveToUser()
{
SampleBuffer * sampleBuffer = new SampleBuffer;
QString fileName = sampleBuffer->openAndSetAudioFile();
QString fileName = sampleBuffer->openAndSetWaveformFile();
if( fileName.isEmpty() == false )
{
for( int i = 0; i < length(); i++ )