Set default directory to the waveform directory when opening an audio file for a user-defined waveform
This commit is contained in:
@@ -174,7 +174,8 @@ public:
|
||||
|
||||
QString openAudioFile() const;
|
||||
QString openAndSetAudioFile();
|
||||
|
||||
QString openAndSetWaveformFile();
|
||||
|
||||
QString & toBase64( QString & _dst ) const;
|
||||
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ OscillatorObject::~OscillatorObject()
|
||||
|
||||
void OscillatorObject::oscUserDefWaveDblClick()
|
||||
{
|
||||
QString af = m_sampleBuffer->openAndSetAudioFile();
|
||||
QString af = m_sampleBuffer->openAndSetWaveformFile();
|
||||
if( af != "" )
|
||||
{
|
||||
// TODO:
|
||||
|
||||
@@ -908,6 +908,23 @@ 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 );
|
||||
}
|
||||
|
||||
return fileName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#undef LMMS_HAVE_FLAC_STREAM_ENCODER_H /* not yet... */
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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++ )
|
||||
|
||||
Reference in New Issue
Block a user