Fix Bitinvader waveform cutoff behavior

This commit is contained in:
Douglas
2019-02-13 11:46:47 -07:00
committed by Hyunjin Song
parent fcacf44375
commit 8d707df171
3 changed files with 19 additions and 28 deletions

View File

@@ -472,6 +472,7 @@ void bitInvaderView::modelChanged()
void bitInvaderView::sinWaveClicked()
{
m_graph->model()->clearInvisible();
m_graph->model()->setWaveToSine();
Engine::getSong()->setModified();
}
@@ -481,6 +482,7 @@ void bitInvaderView::sinWaveClicked()
void bitInvaderView::triangleWaveClicked()
{
m_graph->model()->clearInvisible();
m_graph->model()->setWaveToTriangle();
Engine::getSong()->setModified();
}
@@ -490,6 +492,7 @@ void bitInvaderView::triangleWaveClicked()
void bitInvaderView::sawWaveClicked()
{
m_graph->model()->clearInvisible();
m_graph->model()->setWaveToSaw();
Engine::getSong()->setModified();
}
@@ -499,6 +502,7 @@ void bitInvaderView::sawWaveClicked()
void bitInvaderView::sqrWaveClicked()
{
m_graph->model()->clearInvisible();
m_graph->model()->setWaveToSquare();
Engine::getSong()->setModified();
}
@@ -508,6 +512,7 @@ void bitInvaderView::sqrWaveClicked()
void bitInvaderView::noiseWaveClicked()
{
m_graph->model()->clearInvisible();
m_graph->model()->setWaveToNoise();
Engine::getSong()->setModified();
}
@@ -518,35 +523,12 @@ 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();
// zero sample_shape
for (int i = 0; i < sample_length; i++)
if (!fileName.isEmpty())
{
sample_shape[i] = 0;
ToolTip::add(m_usrWaveBtn, fileName);
m_graph->model()->clearInvisible();
Engine::getSong()->setModified();
}
// load user shape
sampleBuffer buffer;
QString af = buffer.openAudioFile();
if ( af != "" )
{
buffer.setAudioFile( af );
// copy buffer data
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();
*/
}