Merge remote-tracking branch 'upstream/master' into dynamic-effect-dialog-merge_upstream_20230907
Conflicts: include/LedCheckBox.h src/gui/widgets/LedCheckBox.cpp Adjusted some enums in LadspaMatrixControlDialog.cpp and LadspaWidgetFactory.cpp. Note: The following commits made changes to `Knob.cpp` and might need to be integrated into `FloatModelEditorBase` which was created by extracting methods and implementations from `Knob`: *f10277715f: Seems to have only changed enum definitions *7000afb2ea: Modifier keys for mouse wheel events *fcdf4c0568: Show knob value on mouse over
This commit is contained in:
@@ -41,7 +41,7 @@ Plugin::Descriptor PLUGIN_EXPORT amplifier_plugin_descriptor =
|
||||
QT_TRANSLATE_NOOP( "PluginBrowser", "A native amplifier plugin" ),
|
||||
"Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader("logo"),
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
||||
@@ -43,27 +43,27 @@ AmplifierControlDialog::AmplifierControlDialog( AmplifierControls* controls ) :
|
||||
setPalette( pal );
|
||||
setFixedSize( 100, 110 );
|
||||
|
||||
auto volumeKnob = new Knob(knobBright_26, this);
|
||||
auto volumeKnob = new Knob(KnobType::Bright26, this);
|
||||
volumeKnob -> move( 16, 10 );
|
||||
volumeKnob -> setVolumeKnob( true );
|
||||
volumeKnob->setModel( &controls->m_volumeModel );
|
||||
volumeKnob->setLabel( tr( "VOL" ) );
|
||||
volumeKnob->setHintText( tr( "Volume:" ) , "%" );
|
||||
|
||||
auto panKnob = new Knob(knobBright_26, this);
|
||||
auto panKnob = new Knob(KnobType::Bright26, this);
|
||||
panKnob -> move( 57, 10 );
|
||||
panKnob->setModel( &controls->m_panModel );
|
||||
panKnob->setLabel( tr( "PAN" ) );
|
||||
panKnob->setHintText( tr( "Panning:" ) , "" );
|
||||
|
||||
auto leftKnob = new Knob(knobBright_26, this);
|
||||
auto leftKnob = new Knob(KnobType::Bright26, this);
|
||||
leftKnob -> move( 16, 65 );
|
||||
leftKnob -> setVolumeKnob( true );
|
||||
leftKnob->setModel( &controls->m_leftModel );
|
||||
leftKnob->setLabel( tr( "LEFT" ) );
|
||||
leftKnob->setHintText( tr( "Left gain:" ) , "%" );
|
||||
|
||||
auto rightKnob = new Knob(knobBright_26, this);
|
||||
auto rightKnob = new Knob(KnobType::Bright26, this);
|
||||
rightKnob -> move( 57, 65 );
|
||||
rightKnob -> setVolumeKnob( true );
|
||||
rightKnob->setModel( &controls->m_rightModel );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* AudioFileProcessor.cpp - instrument for using audio-files
|
||||
* AudioFileProcessor.cpp - instrument for using audio files
|
||||
*
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
@@ -47,7 +47,6 @@
|
||||
#include "embed.h"
|
||||
#include "plugin_export.h"
|
||||
|
||||
|
||||
namespace lmms
|
||||
{
|
||||
|
||||
@@ -65,7 +64,7 @@ Plugin::Descriptor PLUGIN_EXPORT audiofileprocessor_plugin_descriptor =
|
||||
"instrument-track" ),
|
||||
"Tobias Doerffel <tobydox/at/users.sf.net>",
|
||||
0x0100,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
"wav,ogg,ds,spx,au,voc,aif,aiff,flac,raw",
|
||||
nullptr,
|
||||
@@ -205,74 +204,70 @@ void AudioFileProcessor::deleteNotePluginData( NotePlayHandle * _n )
|
||||
|
||||
|
||||
|
||||
void AudioFileProcessor::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this )
|
||||
void AudioFileProcessor::saveSettings(QDomDocument& doc, QDomElement& elem)
|
||||
{
|
||||
_this.setAttribute( "src", m_sampleBuffer.audioFile() );
|
||||
if( m_sampleBuffer.audioFile() == "" )
|
||||
elem.setAttribute("src", m_sampleBuffer.audioFile());
|
||||
if (m_sampleBuffer.audioFile().isEmpty())
|
||||
{
|
||||
QString s;
|
||||
_this.setAttribute( "sampledata",
|
||||
m_sampleBuffer.toBase64( s ) );
|
||||
elem.setAttribute("sampledata", m_sampleBuffer.toBase64(s));
|
||||
}
|
||||
m_reverseModel.saveSettings( _doc, _this, "reversed" );
|
||||
m_loopModel.saveSettings( _doc, _this, "looped" );
|
||||
m_ampModel.saveSettings( _doc, _this, "amp" );
|
||||
m_startPointModel.saveSettings( _doc, _this, "sframe" );
|
||||
m_endPointModel.saveSettings( _doc, _this, "eframe" );
|
||||
m_loopPointModel.saveSettings( _doc, _this, "lframe" );
|
||||
m_stutterModel.saveSettings( _doc, _this, "stutter" );
|
||||
m_interpolationModel.saveSettings( _doc, _this, "interp" );
|
||||
|
||||
m_reverseModel.saveSettings(doc, elem, "reversed");
|
||||
m_loopModel.saveSettings(doc, elem, "looped");
|
||||
m_ampModel.saveSettings(doc, elem, "amp");
|
||||
m_startPointModel.saveSettings(doc, elem, "sframe");
|
||||
m_endPointModel.saveSettings(doc, elem, "eframe");
|
||||
m_loopPointModel.saveSettings(doc, elem, "lframe");
|
||||
m_stutterModel.saveSettings(doc, elem, "stutter");
|
||||
m_interpolationModel.saveSettings(doc, elem, "interp");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void AudioFileProcessor::loadSettings( const QDomElement & _this )
|
||||
void AudioFileProcessor::loadSettings(const QDomElement& elem)
|
||||
{
|
||||
if( _this.attribute( "src" ) != "" )
|
||||
if (!elem.attribute("src").isEmpty())
|
||||
{
|
||||
setAudioFile( _this.attribute( "src" ), false );
|
||||
setAudioFile(elem.attribute("src"), false);
|
||||
|
||||
QString absolutePath = PathUtil::toAbsolute( m_sampleBuffer.audioFile() );
|
||||
if ( !QFileInfo( absolutePath ).exists() )
|
||||
QString absolutePath = PathUtil::toAbsolute(m_sampleBuffer.audioFile());
|
||||
if (!QFileInfo(absolutePath).exists())
|
||||
{
|
||||
QString message = tr( "Sample not found: %1" ).arg( m_sampleBuffer.audioFile() );
|
||||
|
||||
Engine::getSong()->collectError( message );
|
||||
QString message = tr("Sample not found: %1").arg(m_sampleBuffer.audioFile());
|
||||
Engine::getSong()->collectError(message);
|
||||
}
|
||||
}
|
||||
else if( _this.attribute( "sampledata" ) != "" )
|
||||
else if (!elem.attribute("sampledata").isEmpty())
|
||||
{
|
||||
m_sampleBuffer.loadFromBase64( _this.attribute( "srcdata" ) );
|
||||
m_sampleBuffer.loadFromBase64(elem.attribute("srcdata"));
|
||||
}
|
||||
|
||||
m_loopModel.loadSettings( _this, "looped" );
|
||||
m_ampModel.loadSettings( _this, "amp" );
|
||||
m_endPointModel.loadSettings( _this, "eframe" );
|
||||
m_startPointModel.loadSettings( _this, "sframe" );
|
||||
m_loopModel.loadSettings(elem, "looped");
|
||||
m_ampModel.loadSettings(elem, "amp");
|
||||
m_endPointModel.loadSettings(elem, "eframe");
|
||||
m_startPointModel.loadSettings(elem, "sframe");
|
||||
|
||||
// compat code for not having a separate loopback point
|
||||
if (_this.hasAttribute("lframe") || !(_this.firstChildElement("lframe").isNull()))
|
||||
if (elem.hasAttribute("lframe") || !elem.firstChildElement("lframe").isNull())
|
||||
{
|
||||
m_loopPointModel.loadSettings( _this, "lframe" );
|
||||
m_loopPointModel.loadSettings(elem, "lframe");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_loopPointModel.loadSettings( _this, "sframe" );
|
||||
m_loopPointModel.loadSettings(elem, "sframe");
|
||||
}
|
||||
|
||||
m_reverseModel.loadSettings( _this, "reversed" );
|
||||
m_reverseModel.loadSettings(elem, "reversed");
|
||||
|
||||
m_stutterModel.loadSettings( _this, "stutter" );
|
||||
if( _this.hasAttribute( "interp" ) )
|
||||
m_stutterModel.loadSettings(elem, "stutter");
|
||||
if (elem.hasAttribute("interp") || !elem.firstChildElement("interp").isNull())
|
||||
{
|
||||
m_interpolationModel.loadSettings( _this, "interp" );
|
||||
m_interpolationModel.loadSettings(elem, "interp");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_interpolationModel.setValue( 1 ); //linear by default
|
||||
m_interpolationModel.setValue(1.0f); // linear by default
|
||||
}
|
||||
|
||||
pointChanged();
|
||||
@@ -521,7 +516,7 @@ AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument,
|
||||
m_stutterButton->setToolTip(
|
||||
tr( "Continue sample playback across notes" ) );
|
||||
|
||||
m_ampKnob = new Knob( knobBright_26, this );
|
||||
m_ampKnob = new Knob( KnobType::Bright26, this );
|
||||
m_ampKnob->setVolumeKnob( true );
|
||||
m_ampKnob->move( 5, 108 );
|
||||
m_ampKnob->setHintText( tr( "Amplify:" ), "%" );
|
||||
@@ -572,7 +567,7 @@ void AudioFileProcessorView::dragEnterEvent( QDragEnterEvent * _dee )
|
||||
QString txt = _dee->mimeData()->data(
|
||||
mimeType( MimeType::StringPair ) );
|
||||
if( txt.section( ':', 0, 0 ) == QString( "clip_%1" ).arg(
|
||||
Track::SampleTrack ) )
|
||||
static_cast<int>(Track::Type::Sample) ) )
|
||||
{
|
||||
_dee->acceptProposedAction();
|
||||
}
|
||||
@@ -624,7 +619,7 @@ void AudioFileProcessorView::dropEvent( QDropEvent * _de )
|
||||
newWaveView();
|
||||
return;
|
||||
}
|
||||
else if( type == QString( "clip_%1" ).arg( Track::SampleTrack ) )
|
||||
else if( type == QString( "clip_%1" ).arg( static_cast<int>(Track::Type::Sample) ) )
|
||||
{
|
||||
DataFile dataFile( value.toUtf8() );
|
||||
castModel<AudioFileProcessor>()->setAudioFile( dataFile.content().firstChild().toElement().attribute( "src" ) );
|
||||
@@ -686,14 +681,12 @@ void AudioFileProcessorView::sampleUpdated()
|
||||
|
||||
void AudioFileProcessorView::openAudioFile()
|
||||
{
|
||||
QString af = castModel<AudioFileProcessor>()->m_sampleBuffer.
|
||||
openAudioFile();
|
||||
if( af != "" )
|
||||
{
|
||||
castModel<AudioFileProcessor>()->setAudioFile( af );
|
||||
Engine::getSong()->setModified();
|
||||
m_waveView->updateSampleRange();
|
||||
}
|
||||
QString af = castModel<AudioFileProcessor>()->m_sampleBuffer.openAudioFile();
|
||||
if (af.isEmpty()) { return; }
|
||||
|
||||
castModel<AudioFileProcessor>()->setAudioFile(af);
|
||||
Engine::getSong()->setModified();
|
||||
m_waveView->updateSampleRange();
|
||||
}
|
||||
|
||||
|
||||
@@ -794,9 +787,9 @@ void AudioFileProcessorWaveView::mousePressEvent( QMouseEvent * _me )
|
||||
const int end_dist = qAbs( m_endFrameX - x );
|
||||
const int loop_dist = qAbs( m_loopFrameX - x );
|
||||
|
||||
draggingType dt = sample_loop; int md = loop_dist;
|
||||
if( start_dist < loop_dist ) { dt = sample_start; md = start_dist; }
|
||||
else if( end_dist < loop_dist ) { dt = sample_end; md = end_dist; }
|
||||
DraggingType dt = DraggingType::SampleLoop; int md = loop_dist;
|
||||
if( start_dist < loop_dist ) { dt = DraggingType::SampleStart; md = start_dist; }
|
||||
else if( end_dist < loop_dist ) { dt = DraggingType::SampleEnd; md = end_dist; }
|
||||
|
||||
if( md < 4 )
|
||||
{
|
||||
@@ -804,7 +797,7 @@ void AudioFileProcessorWaveView::mousePressEvent( QMouseEvent * _me )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_draggingType = wave;
|
||||
m_draggingType = DraggingType::Wave;
|
||||
updateCursor(_me);
|
||||
}
|
||||
}
|
||||
@@ -815,7 +808,7 @@ void AudioFileProcessorWaveView::mousePressEvent( QMouseEvent * _me )
|
||||
void AudioFileProcessorWaveView::mouseReleaseEvent( QMouseEvent * _me )
|
||||
{
|
||||
m_isDragging = false;
|
||||
if( m_draggingType == wave )
|
||||
if( m_draggingType == DraggingType::Wave )
|
||||
{
|
||||
updateCursor(_me);
|
||||
}
|
||||
@@ -835,16 +828,16 @@ void AudioFileProcessorWaveView::mouseMoveEvent( QMouseEvent * _me )
|
||||
const int step = _me->x() - m_draggingLastPoint.x();
|
||||
switch( m_draggingType )
|
||||
{
|
||||
case sample_start:
|
||||
slideSamplePointByPx( start, step );
|
||||
case DraggingType::SampleStart:
|
||||
slideSamplePointByPx( Point::Start, step );
|
||||
break;
|
||||
case sample_end:
|
||||
slideSamplePointByPx( end, step );
|
||||
case DraggingType::SampleEnd:
|
||||
slideSamplePointByPx( Point::End, step );
|
||||
break;
|
||||
case sample_loop:
|
||||
slideSamplePointByPx( loop, step );
|
||||
case DraggingType::SampleLoop:
|
||||
slideSamplePointByPx( Point::Loop, step );
|
||||
break;
|
||||
case wave:
|
||||
case DraggingType::Wave:
|
||||
default:
|
||||
if( qAbs( _me->y() - m_draggingLastPoint.y() )
|
||||
< 2 * qAbs( _me->x() - m_draggingLastPoint.x() ) )
|
||||
@@ -990,7 +983,7 @@ void AudioFileProcessorWaveView::updateGraph()
|
||||
if( m_to == 1 )
|
||||
{
|
||||
m_to = m_sampleBuffer.frames() * 0.7;
|
||||
slideSamplePointToFrames( end, m_to * 0.7 );
|
||||
slideSamplePointToFrames( Point::End, m_to * 0.7 );
|
||||
}
|
||||
|
||||
if( m_from > m_sampleBuffer.startFrame() )
|
||||
@@ -1117,7 +1110,7 @@ void AudioFileProcessorWaveView::setKnobs( knob * _start, knob * _end, knob * _l
|
||||
|
||||
|
||||
|
||||
void AudioFileProcessorWaveView::slideSamplePointByPx( knobType _point, int _px )
|
||||
void AudioFileProcessorWaveView::slideSamplePointByPx( Point _point, int _px )
|
||||
{
|
||||
slideSamplePointByFrames(
|
||||
_point,
|
||||
@@ -1128,18 +1121,18 @@ void AudioFileProcessorWaveView::slideSamplePointByPx( knobType _point, int _px
|
||||
|
||||
|
||||
|
||||
void AudioFileProcessorWaveView::slideSamplePointByFrames( knobType _point, f_cnt_t _frames, bool _slide_to )
|
||||
void AudioFileProcessorWaveView::slideSamplePointByFrames( Point _point, f_cnt_t _frames, bool _slide_to )
|
||||
{
|
||||
knob * a_knob = m_startKnob;
|
||||
switch( _point )
|
||||
{
|
||||
case end:
|
||||
case Point::End:
|
||||
a_knob = m_endKnob;
|
||||
break;
|
||||
case loop:
|
||||
case Point::Loop:
|
||||
a_knob = m_loopKnob;
|
||||
break;
|
||||
case start:
|
||||
case Point::Start:
|
||||
break;
|
||||
}
|
||||
if( a_knob == nullptr )
|
||||
@@ -1203,7 +1196,7 @@ void AudioFileProcessorWaveView::reverse()
|
||||
|
||||
void AudioFileProcessorWaveView::updateCursor( QMouseEvent * _me )
|
||||
{
|
||||
bool const waveIsDragged = m_isDragging && (m_draggingType == wave);
|
||||
bool const waveIsDragged = m_isDragging && (m_draggingType == DraggingType::Wave);
|
||||
bool const pointerCloseToStartEndOrLoop = (_me != nullptr ) &&
|
||||
( isCloseTo( _me->x(), m_startFrameX ) ||
|
||||
isCloseTo( _me->x(), m_endFrameX ) ||
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef AUDIO_FILE_PROCESSOR_H
|
||||
#define AUDIO_FILE_PROCESSOR_H
|
||||
#ifndef LMMS_AUDIO_FILE_PROCESSOR_H
|
||||
#define LMMS_AUDIO_FILE_PROCESSOR_H
|
||||
|
||||
#include <QPixmap>
|
||||
|
||||
@@ -61,9 +60,8 @@ public:
|
||||
sampleFrame * _working_buffer ) override;
|
||||
void deleteNotePluginData( NotePlayHandle * _n ) override;
|
||||
|
||||
void saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
void saveSettings(QDomDocument& doc, QDomElement& elem) override;
|
||||
void loadSettings(const QDomElement& elem) override;
|
||||
|
||||
void loadFile( const QString & _file ) override;
|
||||
|
||||
@@ -179,11 +177,11 @@ protected:
|
||||
|
||||
|
||||
public:
|
||||
enum knobType
|
||||
enum class Point
|
||||
{
|
||||
start,
|
||||
end,
|
||||
loop
|
||||
Start,
|
||||
End,
|
||||
Loop
|
||||
} ;
|
||||
|
||||
class knob : public Knob
|
||||
@@ -194,7 +192,7 @@ public:
|
||||
|
||||
public:
|
||||
knob( QWidget * _parent ) :
|
||||
Knob( knobBright_26, _parent ),
|
||||
Knob( KnobType::Bright26, _parent ),
|
||||
m_waveView( 0 ),
|
||||
m_relatedKnob( 0 )
|
||||
{
|
||||
@@ -241,12 +239,12 @@ public slots:
|
||||
private:
|
||||
static const int s_padding = 2;
|
||||
|
||||
enum draggingType
|
||||
enum class DraggingType
|
||||
{
|
||||
wave,
|
||||
sample_start,
|
||||
sample_end,
|
||||
sample_loop
|
||||
Wave,
|
||||
SampleStart,
|
||||
SampleEnd,
|
||||
SampleLoop
|
||||
} ;
|
||||
|
||||
SampleBuffer& m_sampleBuffer;
|
||||
@@ -264,7 +262,7 @@ private:
|
||||
f_cnt_t m_loopFrameX;
|
||||
bool m_isDragging;
|
||||
QPoint m_draggingLastPoint;
|
||||
draggingType m_draggingType;
|
||||
DraggingType m_draggingType;
|
||||
bool m_reversed;
|
||||
f_cnt_t m_framesPlayed;
|
||||
bool m_animation;
|
||||
@@ -278,11 +276,11 @@ public:
|
||||
private:
|
||||
void zoom( const bool _out = false );
|
||||
void slide( int _px );
|
||||
void slideSamplePointByPx( knobType _point, int _px );
|
||||
void slideSamplePointByFrames( knobType _point, f_cnt_t _frames, bool _slide_to = false );
|
||||
void slideSamplePointByPx( Point _point, int _px );
|
||||
void slideSamplePointByFrames( Point _point, f_cnt_t _frames, bool _slide_to = false );
|
||||
void slideSampleByFrames( f_cnt_t _frames );
|
||||
|
||||
void slideSamplePointToFrames( knobType _point, f_cnt_t _frames )
|
||||
void slideSamplePointToFrames( Point _point, f_cnt_t _frames )
|
||||
{
|
||||
slideSamplePointByFrames( _point, _frames, true );
|
||||
}
|
||||
@@ -303,4 +301,4 @@ private:
|
||||
|
||||
} // namespace lmms
|
||||
|
||||
#endif
|
||||
#endif // LMMS_AUDIO_FILE_PROCESSOR_H
|
||||
|
||||
@@ -41,7 +41,7 @@ Plugin::Descriptor PLUGIN_EXPORT bassbooster_plugin_descriptor =
|
||||
QT_TRANSLATE_NOOP( "PluginBrowser", "Boost your bass the fast and simple way" ),
|
||||
"Tobias Doerffel <tobydox/at/users.sf.net>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader("logo"),
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
||||
@@ -50,17 +50,17 @@ BassBoosterControlDialog::BassBoosterControlDialog( BassBoosterControls* control
|
||||
|
||||
auto l = new QHBoxLayout;
|
||||
|
||||
auto freqKnob = new Knob(knobBright_26, this);
|
||||
auto freqKnob = new Knob(KnobType::Bright26, this);
|
||||
freqKnob->setModel( &controls->m_freqModel );
|
||||
freqKnob->setLabel( tr( "FREQ" ) );
|
||||
freqKnob->setHintText( tr( "Frequency:" ) , "Hz" );
|
||||
|
||||
auto gainKnob = new Knob(knobBright_26, this);
|
||||
auto gainKnob = new Knob(KnobType::Bright26, this);
|
||||
gainKnob->setModel( &controls->m_gainModel );
|
||||
gainKnob->setLabel( tr( "GAIN" ) );
|
||||
gainKnob->setHintText( tr( "Gain:" ) , "" );
|
||||
|
||||
auto ratioKnob = new Knob(knobBright_26, this);
|
||||
auto ratioKnob = new Knob(KnobType::Bright26, this);
|
||||
ratioKnob->setModel( &controls->m_ratioModel );
|
||||
ratioKnob->setLabel( tr( "RATIO" ) );
|
||||
ratioKnob->setHintText( tr( "Ratio:" ) , "" );
|
||||
|
||||
@@ -60,7 +60,7 @@ Plugin::Descriptor PLUGIN_EXPORT bitinvader_plugin_descriptor =
|
||||
"Customizable wavetable synthesizer" ),
|
||||
"Andreas Brandmaier <andreas/at/brandmaier/dot/de>",
|
||||
0x0100,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -274,9 +274,8 @@ QString BitInvader::nodeName() const
|
||||
void BitInvader::playNote( NotePlayHandle * _n,
|
||||
sampleFrame * _working_buffer )
|
||||
{
|
||||
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == nullptr )
|
||||
if (!_n->m_pluginData)
|
||||
{
|
||||
|
||||
float factor;
|
||||
if( !m_normalize.value() )
|
||||
{
|
||||
@@ -346,11 +345,11 @@ BitInvaderView::BitInvaderView( Instrument * _instrument,
|
||||
"artwork" ) );
|
||||
setPalette( pal );
|
||||
|
||||
m_sampleLengthKnob = new Knob( knobDark_28, this );
|
||||
m_sampleLengthKnob = new Knob( KnobType::Dark28, this );
|
||||
m_sampleLengthKnob->move( 6, 201 );
|
||||
m_sampleLengthKnob->setHintText( tr( "Sample length" ), "" );
|
||||
|
||||
m_graph = new Graph( this, Graph::NearestStyle, 204, 134 );
|
||||
m_graph = new Graph( this, Graph::Style::Nearest, 204, 134 );
|
||||
m_graph->move(23,59); // 55,120 - 2px border
|
||||
m_graph->setAutoFillBackground( true );
|
||||
m_graph->setGraphColor( QColor( 255, 255, 255 ) );
|
||||
@@ -432,12 +431,12 @@ BitInvaderView::BitInvaderView( Instrument * _instrument,
|
||||
|
||||
|
||||
m_interpolationToggle = new LedCheckBox( "Interpolation", this,
|
||||
tr( "Interpolation" ), LedCheckBox::Yellow );
|
||||
tr( "Interpolation" ), LedCheckBox::LedColor::Yellow );
|
||||
m_interpolationToggle->move( 131, 221 );
|
||||
|
||||
|
||||
m_normalizeToggle = new LedCheckBox( "Normalize", this,
|
||||
tr( "Normalize" ), LedCheckBox::Green );
|
||||
tr( "Normalize" ), LedCheckBox::LedColor::Green );
|
||||
m_normalizeToggle->move( 131, 236 );
|
||||
|
||||
|
||||
@@ -557,7 +556,7 @@ void BitInvaderView::smoothClicked()
|
||||
|
||||
void BitInvaderView::interpolationToggled( bool value )
|
||||
{
|
||||
m_graph->setGraphStyle( value ? Graph::LinearStyle : Graph::NearestStyle);
|
||||
m_graph->setGraphStyle( value ? Graph::Style::Linear : Graph::Style::Nearest);
|
||||
Engine::getSong()->setModified();
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ Plugin::Descriptor PLUGIN_EXPORT bitcrush_plugin_descriptor =
|
||||
QT_TRANSLATE_NOOP( "PluginBrowser", "An oversampling bitcrusher" ),
|
||||
"Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
||||
@@ -53,13 +53,13 @@ BitcrushControlDialog::BitcrushControlDialog( BitcrushControls * controls ) :
|
||||
outLabel->move( 139, 15 );
|
||||
|
||||
// input knobs
|
||||
auto inGain = new Knob(knobBright_26, this);
|
||||
auto inGain = new Knob(KnobType::Bright26, this);
|
||||
inGain->move( 16, 32 );
|
||||
inGain->setModel( & controls->m_inGain );
|
||||
inGain->setLabel( tr( "GAIN" ) );
|
||||
inGain->setHintText( tr( "Input gain:" ) , " dBFS" );
|
||||
|
||||
auto inNoise = new Knob(knobBright_26, this);
|
||||
auto inNoise = new Knob(KnobType::Bright26, this);
|
||||
inNoise->move( 14, 76 );
|
||||
inNoise->setModel( & controls->m_inNoise );
|
||||
inNoise->setLabel( tr( "NOISE" ) );
|
||||
@@ -67,13 +67,13 @@ BitcrushControlDialog::BitcrushControlDialog( BitcrushControls * controls ) :
|
||||
|
||||
|
||||
// output knobs
|
||||
auto outGain = new Knob(knobBright_26, this);
|
||||
auto outGain = new Knob(KnobType::Bright26, this);
|
||||
outGain->move( 138, 32 );
|
||||
outGain->setModel( & controls->m_outGain );
|
||||
outGain->setLabel( tr( "GAIN" ) );
|
||||
outGain->setHintText( tr( "Output gain:" ) , " dBFS" );
|
||||
|
||||
auto outClip = new Knob(knobBright_26, this);
|
||||
auto outClip = new Knob(KnobType::Bright26, this);
|
||||
outClip->move( 138, 76 );
|
||||
outClip->setModel( & controls->m_outClip );
|
||||
outClip->setLabel( tr( "CLIP" ) );
|
||||
@@ -82,25 +82,25 @@ BitcrushControlDialog::BitcrushControlDialog( BitcrushControls * controls ) :
|
||||
|
||||
|
||||
// leds
|
||||
auto rateEnabled = new LedCheckBox("", this, tr("Rate enabled"), LedCheckBox::Green);
|
||||
auto rateEnabled = new LedCheckBox("", this, tr("Rate enabled"), LedCheckBox::LedColor::Green);
|
||||
rateEnabled->move( 64, 14 );
|
||||
rateEnabled->setModel( & controls->m_rateEnabled );
|
||||
rateEnabled->setToolTip(tr("Enable sample-rate crushing"));
|
||||
|
||||
auto depthEnabled = new LedCheckBox("", this, tr("Depth enabled"), LedCheckBox::Green);
|
||||
auto depthEnabled = new LedCheckBox("", this, tr("Depth enabled"), LedCheckBox::LedColor::Green);
|
||||
depthEnabled->move( 101, 14 );
|
||||
depthEnabled->setModel( & controls->m_depthEnabled );
|
||||
depthEnabled->setToolTip(tr("Enable bit-depth crushing"));
|
||||
|
||||
|
||||
// rate crushing knobs
|
||||
auto rate = new Knob(knobBright_26, this);
|
||||
auto rate = new Knob(KnobType::Bright26, this);
|
||||
rate->move( 59, 32 );
|
||||
rate->setModel( & controls->m_rate );
|
||||
rate->setLabel( tr( "FREQ" ) );
|
||||
rate->setHintText( tr( "Sample rate:" ) , " Hz" );
|
||||
|
||||
auto stereoDiff = new Knob(knobBright_26, this);
|
||||
auto stereoDiff = new Knob(KnobType::Bright26, this);
|
||||
stereoDiff->move( 72, 76 );
|
||||
stereoDiff->setModel( & controls->m_stereoDiff );
|
||||
stereoDiff->setLabel( tr( "STEREO" ) );
|
||||
@@ -108,7 +108,7 @@ BitcrushControlDialog::BitcrushControlDialog( BitcrushControls * controls ) :
|
||||
|
||||
|
||||
// depth crushing knob
|
||||
auto levels = new Knob(knobBright_26, this);
|
||||
auto levels = new Knob(KnobType::Bright26, this);
|
||||
levels->move( 92, 32 );
|
||||
levels->setModel( & controls->m_levels );
|
||||
levels->setLabel( tr( "QUANT" ) );
|
||||
|
||||
@@ -5,7 +5,7 @@ SET(CMAKE_DEBUG_POSTFIX "")
|
||||
# Enable C++17
|
||||
SET(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
IF(LMMS_BUILD_APPLE)
|
||||
IF(LMMS_BUILD_APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||
ENDIF()
|
||||
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
# For MacOS, use "OLD" RPATH install_name behavior
|
||||
# This can be changed to "NEW" safely if install_apple.sh.in
|
||||
# is updated to relink libcarlabase.dylib. MacOS 10.8 uses
|
||||
# cmake 3.9.6, so this can be done at any time.
|
||||
IF(NOT CMAKE_VERSION VERSION_LESS 3.9)
|
||||
CMAKE_POLICY(SET CMP0068 OLD)
|
||||
ENDIF()
|
||||
|
||||
# If Carla was not provided by the system, make a dummy library instead
|
||||
if(LMMS_HAVE_WEAKCARLA)
|
||||
SET(CARLA_INCLUDE_DIRS
|
||||
|
||||
@@ -220,7 +220,7 @@ CarlaInstrument::CarlaInstrument(InstrumentTrack* const instrumentTrack, const D
|
||||
|
||||
CarlaInstrument::~CarlaInstrument()
|
||||
{
|
||||
Engine::audioEngine()->removePlayHandlesOfTypes(instrumentTrack(), PlayHandle::TypeNotePlayHandle | PlayHandle::TypeInstrumentPlayHandle);
|
||||
Engine::audioEngine()->removePlayHandlesOfTypes(instrumentTrack(), PlayHandle::Type::NotePlayHandle | PlayHandle::Type::InstrumentPlayHandle);
|
||||
|
||||
if (fHost.resourceDir != nullptr)
|
||||
{
|
||||
@@ -345,7 +345,7 @@ intptr_t CarlaInstrument::handleDispatcher(const NativeHostDispatcherOpcode opco
|
||||
|
||||
Instrument::Flags CarlaInstrument::flags() const
|
||||
{
|
||||
return IsSingleStreamed|IsMidiBased|IsNotBendable;
|
||||
return Flag::IsSingleStreamed | Flag::IsMidiBased | Flag::IsNotBendable;
|
||||
}
|
||||
|
||||
QString CarlaInstrument::nodeName() const
|
||||
@@ -1015,7 +1015,7 @@ void CarlaParamsView::refreshKnobs()
|
||||
for (uint32_t i=0; i < m_carlaInstrument->m_paramModels.count(); ++i)
|
||||
{
|
||||
bool enabled = m_carlaInstrument->m_paramModels[i]->enabled();
|
||||
m_knobs.push_back(new Knob(knobDark_28, m_inputScrollAreaWidgetContent));
|
||||
m_knobs.push_back(new Knob(KnobType::Dark28, m_inputScrollAreaWidgetContent));
|
||||
QString name = (*m_carlaInstrument->m_paramModels[i]).displayName();
|
||||
m_knobs[i]->setHintText(name, "");
|
||||
m_knobs[i]->setLabel(name);
|
||||
|
||||
@@ -2,12 +2,16 @@
|
||||
#define BUILDING_CARLA
|
||||
#include "CarlaNativePlugin.h"
|
||||
|
||||
CARLA_EXPORT const char* carla_get_library_filename() { return nullptr; }
|
||||
CARLA_EXPORT const char* carla_get_library_folder() { return nullptr; }
|
||||
CARLA_EXPORT const NativePluginDescriptor* carla_get_native_rack_plugin() { return nullptr; }
|
||||
CARLA_EXPORT const NativePluginDescriptor* carla_get_native_patchbay_plugin() { return nullptr; }
|
||||
CARLA_EXPORT const NativePluginDescriptor* carla_get_native_patchbay16_plugin() { return nullptr; }
|
||||
CARLA_EXPORT const NativePluginDescriptor* carla_get_native_patchbay32_plugin() { return nullptr; }
|
||||
CARLA_EXPORT const NativePluginDescriptor* carla_get_native_patchbay64_plugin() { return nullptr; }
|
||||
CARLA_EXPORT const NativePluginDescriptor* carla_get_native_patchbay_cv_plugin() { return nullptr; }
|
||||
CARLA_EXPORT CarlaBackend::CarlaEngine* carla_get_native_plugin_engine(const NativePluginDescriptor* desc, NativePluginHandle handle) { return nullptr; }
|
||||
#ifndef CARLA_PLUGIN_EXPORT
|
||||
#define CARLA_PLUGIN_EXPORT CARLA_EXPORT
|
||||
#endif
|
||||
|
||||
CARLA_PLUGIN_EXPORT const char* carla_get_library_filename() { return nullptr; }
|
||||
CARLA_PLUGIN_EXPORT const char* carla_get_library_folder() { return nullptr; }
|
||||
CARLA_PLUGIN_EXPORT const NativePluginDescriptor* carla_get_native_rack_plugin() { return nullptr; }
|
||||
CARLA_PLUGIN_EXPORT const NativePluginDescriptor* carla_get_native_patchbay_plugin() { return nullptr; }
|
||||
CARLA_PLUGIN_EXPORT const NativePluginDescriptor* carla_get_native_patchbay16_plugin() { return nullptr; }
|
||||
CARLA_PLUGIN_EXPORT const NativePluginDescriptor* carla_get_native_patchbay32_plugin() { return nullptr; }
|
||||
CARLA_PLUGIN_EXPORT const NativePluginDescriptor* carla_get_native_patchbay64_plugin() { return nullptr; }
|
||||
CARLA_PLUGIN_EXPORT const NativePluginDescriptor* carla_get_native_patchbay_cv_plugin() { return nullptr; }
|
||||
CARLA_PLUGIN_EXPORT CarlaBackend::CarlaEngine* carla_get_native_plugin_engine(const NativePluginDescriptor* desc, NativePluginHandle handle) { return nullptr; }
|
||||
|
||||
@@ -43,7 +43,7 @@ Plugin::Descriptor PLUGIN_EXPORT carlapatchbay_plugin_descriptor =
|
||||
"Carla Patchbay Instrument" ),
|
||||
"falkTX <falktx/at/falktx.com>",
|
||||
CARLA_VERSION_HEX,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
||||
@@ -43,7 +43,7 @@ Plugin::Descriptor PLUGIN_EXPORT carlarack_plugin_descriptor =
|
||||
"Carla Rack Instrument" ),
|
||||
"falkTX <falktx/at/falktx.com>",
|
||||
CARLA_VERSION_HEX,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
||||
@@ -43,7 +43,7 @@ Plugin::Descriptor PLUGIN_EXPORT compressor_plugin_descriptor =
|
||||
QT_TRANSLATE_NOOP("PluginBrowser", "A dynamic range compressor."),
|
||||
"Lost Robot <r94231@gmail.com>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader("logo"),
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -442,28 +442,28 @@ bool CompressorEffect::processAudioBuffer(sampleFrame* buf, const fpp_t frames)
|
||||
m_gainResult[i] = qMax(m_rangeVal, m_gainResult[i]);
|
||||
}
|
||||
|
||||
switch (stereoLink)
|
||||
switch (static_cast<StereoLinkMode>(stereoLink))
|
||||
{
|
||||
case Unlinked:
|
||||
case StereoLinkMode::Unlinked:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case Maximum:
|
||||
case StereoLinkMode::Maximum:
|
||||
{
|
||||
m_gainResult[0] = m_gainResult[1] = qMin(m_gainResult[0], m_gainResult[1]);
|
||||
break;
|
||||
}
|
||||
case Average:
|
||||
case StereoLinkMode::Average:
|
||||
{
|
||||
m_gainResult[0] = m_gainResult[1] = (m_gainResult[0] + m_gainResult[1]) * 0.5f;
|
||||
break;
|
||||
}
|
||||
case Minimum:
|
||||
case StereoLinkMode::Minimum:
|
||||
{
|
||||
m_gainResult[0] = m_gainResult[1] = qMax(m_gainResult[0], m_gainResult[1]);
|
||||
break;
|
||||
}
|
||||
case Blend:
|
||||
case StereoLinkMode::Blend:
|
||||
{
|
||||
if (blend > 0)// 0 is unlinked
|
||||
{
|
||||
|
||||
@@ -79,7 +79,7 @@ private:
|
||||
inline int realmod(int k, int n);
|
||||
inline float realfmod(float k, float n);
|
||||
|
||||
enum StereoLinkModes { Unlinked, Maximum, Average, Minimum, Blend };
|
||||
enum class StereoLinkMode { Unlinked, Maximum, Average, Minimum, Blend };
|
||||
|
||||
std::vector<float> m_preLookaheadBuf[2];
|
||||
int m_preLookaheadBufLoc[2] = {0};
|
||||
|
||||
@@ -95,92 +95,92 @@ CompressorControlDialog::CompressorControlDialog(CompressorControls* controls) :
|
||||
m_ratioEnabledLabel->setPixmap(PLUGIN_NAME::getIconPixmap("knob_enabled_large"));
|
||||
m_ratioEnabledLabel->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||
|
||||
m_thresholdKnob = new Knob(knobStyled, this);
|
||||
m_thresholdKnob = new Knob(KnobType::Styled, this);
|
||||
makeLargeKnob(m_thresholdKnob, tr("Threshold:") , " dBFS");
|
||||
m_thresholdKnob->setModel(&controls->m_thresholdModel);
|
||||
m_thresholdKnob->setToolTip(tr("Volume at which the compression begins to take place"));
|
||||
|
||||
m_ratioKnob = new Knob(knobStyled, this);
|
||||
m_ratioKnob = new Knob(KnobType::Styled, this);
|
||||
makeLargeKnob(m_ratioKnob, tr("Ratio:") , ":1");
|
||||
m_ratioKnob->setModel(&controls->m_ratioModel);
|
||||
m_ratioKnob->setToolTip(tr("How far the compressor must turn the volume down after crossing the threshold"));
|
||||
|
||||
m_attackKnob = new Knob(knobStyled, this);
|
||||
m_attackKnob = new Knob(KnobType::Styled, this);
|
||||
makeLargeKnob(m_attackKnob, tr("Attack:") , " ms");
|
||||
m_attackKnob->setModel(&controls->m_attackModel);
|
||||
m_attackKnob->setToolTip(tr("Speed at which the compressor starts to compress the audio"));
|
||||
|
||||
m_releaseKnob = new Knob(knobStyled, this);
|
||||
m_releaseKnob = new Knob(KnobType::Styled, this);
|
||||
makeLargeKnob(m_releaseKnob, tr("Release:") , " ms");
|
||||
m_releaseKnob->setModel(&controls->m_releaseModel);
|
||||
m_releaseKnob->setToolTip(tr("Speed at which the compressor ceases to compress the audio"));
|
||||
|
||||
m_kneeKnob = new Knob(knobStyled, this);
|
||||
m_kneeKnob = new Knob(KnobType::Styled, this);
|
||||
makeSmallKnob(m_kneeKnob, tr("Knee:") , " dB");
|
||||
m_kneeKnob->setModel(&controls->m_kneeModel);
|
||||
m_kneeKnob->setToolTip(tr("Smooth out the gain reduction curve around the threshold"));
|
||||
|
||||
m_rangeKnob = new Knob(knobStyled, this);
|
||||
m_rangeKnob = new Knob(KnobType::Styled, this);
|
||||
makeSmallKnob(m_rangeKnob, tr("Range:") , " dBFS");
|
||||
m_rangeKnob->setModel(&controls->m_rangeModel);
|
||||
m_rangeKnob->setToolTip(tr("Maximum gain reduction"));
|
||||
|
||||
m_lookaheadLengthKnob = new Knob(knobStyled, this);
|
||||
m_lookaheadLengthKnob = new Knob(KnobType::Styled, this);
|
||||
makeSmallKnob(m_lookaheadLengthKnob, tr("Lookahead Length:") , " ms");
|
||||
m_lookaheadLengthKnob->setModel(&controls->m_lookaheadLengthModel);
|
||||
m_lookaheadLengthKnob->setToolTip(tr("How long the compressor has to react to the sidechain signal ahead of time"));
|
||||
|
||||
m_holdKnob = new Knob(knobStyled, this);
|
||||
m_holdKnob = new Knob(KnobType::Styled, this);
|
||||
makeSmallKnob(m_holdKnob, tr("Hold:") , " ms");
|
||||
m_holdKnob->setModel(&controls->m_holdModel);
|
||||
m_holdKnob->setToolTip(tr("Delay between attack and release stages"));
|
||||
|
||||
m_rmsKnob = new Knob(knobStyled, this);
|
||||
m_rmsKnob = new Knob(KnobType::Styled, this);
|
||||
makeSmallKnob(m_rmsKnob, tr("RMS Size:") , "");
|
||||
m_rmsKnob->setModel(&controls->m_rmsModel);
|
||||
m_rmsKnob->setToolTip(tr("Size of the RMS buffer"));
|
||||
|
||||
m_inBalanceKnob = new Knob(knobStyled, this);
|
||||
m_inBalanceKnob = new Knob(KnobType::Styled, this);
|
||||
makeSmallKnob(m_inBalanceKnob, tr("Input Balance:") , "");
|
||||
m_inBalanceKnob->setModel(&controls->m_inBalanceModel);
|
||||
m_inBalanceKnob->setToolTip(tr("Bias the input audio to the left/right or mid/side"));
|
||||
|
||||
m_outBalanceKnob = new Knob(knobStyled, this);
|
||||
m_outBalanceKnob = new Knob(KnobType::Styled, this);
|
||||
makeSmallKnob(m_outBalanceKnob, tr("Output Balance:") , "");
|
||||
m_outBalanceKnob->setModel(&controls->m_outBalanceModel);
|
||||
m_outBalanceKnob->setToolTip(tr("Bias the output audio to the left/right or mid/side"));
|
||||
|
||||
m_stereoBalanceKnob = new Knob(knobStyled, this);
|
||||
m_stereoBalanceKnob = new Knob(KnobType::Styled, this);
|
||||
makeSmallKnob(m_stereoBalanceKnob, tr("Stereo Balance:") , "");
|
||||
m_stereoBalanceKnob->setModel(&controls->m_stereoBalanceModel);
|
||||
m_stereoBalanceKnob->setToolTip(tr("Bias the sidechain signal to the left/right or mid/side"));
|
||||
|
||||
m_blendKnob = new Knob(knobStyled, this);
|
||||
m_blendKnob = new Knob(KnobType::Styled, this);
|
||||
makeSmallKnob(m_blendKnob, tr("Stereo Link Blend:") , "");
|
||||
m_blendKnob->setModel(&controls->m_blendModel);
|
||||
m_blendKnob->setToolTip(tr("Blend between unlinked/maximum/average/minimum stereo linking modes"));
|
||||
|
||||
m_tiltKnob = new Knob(knobStyled, this);
|
||||
m_tiltKnob = new Knob(KnobType::Styled, this);
|
||||
makeSmallKnob(m_tiltKnob, tr("Tilt Gain:") , " dB");
|
||||
m_tiltKnob->setModel(&controls->m_tiltModel);
|
||||
m_tiltKnob->setToolTip(tr("Bias the sidechain signal to the low or high frequencies. -6 db is lowpass, 6 db is highpass."));
|
||||
|
||||
m_tiltFreqKnob = new Knob(knobStyled, this);
|
||||
m_tiltFreqKnob = new Knob(KnobType::Styled, this);
|
||||
makeSmallKnob(m_tiltFreqKnob, tr("Tilt Frequency:") , " Hz");
|
||||
m_tiltFreqKnob->setModel(&controls->m_tiltFreqModel);
|
||||
m_tiltFreqKnob->setToolTip(tr("Center frequency of sidechain tilt filter"));
|
||||
|
||||
m_mixKnob = new Knob(knobStyled, this);
|
||||
m_mixKnob = new Knob(KnobType::Styled, this);
|
||||
makeSmallKnob(m_mixKnob, tr("Mix:") , "%");
|
||||
m_mixKnob->setModel(&controls->m_mixModel);
|
||||
m_mixKnob->setToolTip(tr("Balance between wet and dry signals"));
|
||||
|
||||
m_autoAttackKnob = new Knob(knobStyled, this);
|
||||
m_autoAttackKnob = new Knob(KnobType::Styled, this);
|
||||
makeSmallKnob(m_autoAttackKnob, tr("Auto Attack:") , "%");
|
||||
m_autoAttackKnob->setModel(&controls->m_autoAttackModel);
|
||||
m_autoAttackKnob->setToolTip(tr("Automatically control attack value depending on crest factor"));
|
||||
|
||||
m_autoReleaseKnob = new Knob(knobStyled, this);
|
||||
m_autoReleaseKnob = new Knob(KnobType::Styled, this);
|
||||
makeSmallKnob(m_autoReleaseKnob, tr("Auto Release:") , "%");
|
||||
m_autoReleaseKnob->setModel(&controls->m_autoReleaseModel);
|
||||
m_autoReleaseKnob->setToolTip(tr("Automatically control release value depending on crest factor"));
|
||||
|
||||
@@ -43,7 +43,7 @@ Plugin::Descriptor PLUGIN_EXPORT crossovereq_plugin_descriptor =
|
||||
QT_TRANSLATE_NOOP( "PluginBrowser", "A 4-band Crossover Equalizer" ),
|
||||
"Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
||||
@@ -46,19 +46,19 @@ CrossoverEQControlDialog::CrossoverEQControlDialog( CrossoverEQControls * contro
|
||||
setFixedSize( 167, 178 );
|
||||
|
||||
// knobs
|
||||
auto xover12 = new Knob(knobBright_26, this);
|
||||
auto xover12 = new Knob(KnobType::Bright26, this);
|
||||
xover12->move( 29, 11 );
|
||||
xover12->setModel( & controls->m_xover12 );
|
||||
xover12->setLabel( "1/2" );
|
||||
xover12->setHintText( tr( "Band 1/2 crossover:" ), " Hz" );
|
||||
|
||||
auto xover23 = new Knob(knobBright_26, this);
|
||||
auto xover23 = new Knob(KnobType::Bright26, this);
|
||||
xover23->move( 69, 11 );
|
||||
xover23->setModel( & controls->m_xover23 );
|
||||
xover23->setLabel( "2/3" );
|
||||
xover23->setHintText( tr( "Band 2/3 crossover:" ), " Hz" );
|
||||
|
||||
auto xover34 = new Knob(knobBright_26, this);
|
||||
auto xover34 = new Knob(KnobType::Bright26, this);
|
||||
xover34->move( 109, 11 );
|
||||
xover34->setModel( & controls->m_xover34 );
|
||||
xover34->setLabel( "3/4" );
|
||||
@@ -90,22 +90,22 @@ CrossoverEQControlDialog::CrossoverEQControlDialog( CrossoverEQControls * contro
|
||||
gain4->setHintText( tr( "Band 4 gain:" ), " dBFS" );
|
||||
|
||||
// leds
|
||||
auto mute1 = new LedCheckBox("", this, tr("Band 1 mute"), LedCheckBox::Green);
|
||||
auto mute1 = new LedCheckBox("", this, tr("Band 1 mute"), LedCheckBox::LedColor::Green);
|
||||
mute1->move( 15, 154 );
|
||||
mute1->setModel( & controls->m_mute1 );
|
||||
mute1->setToolTip(tr("Mute band 1"));
|
||||
|
||||
auto mute2 = new LedCheckBox("", this, tr("Band 2 mute"), LedCheckBox::Green);
|
||||
auto mute2 = new LedCheckBox("", this, tr("Band 2 mute"), LedCheckBox::LedColor::Green);
|
||||
mute2->move( 55, 154 );
|
||||
mute2->setModel( & controls->m_mute2 );
|
||||
mute2->setToolTip(tr("Mute band 2"));
|
||||
|
||||
auto mute3 = new LedCheckBox("", this, tr("Band 3 mute"), LedCheckBox::Green);
|
||||
auto mute3 = new LedCheckBox("", this, tr("Band 3 mute"), LedCheckBox::LedColor::Green);
|
||||
mute3->move( 95, 154 );
|
||||
mute3->setModel( & controls->m_mute3 );
|
||||
mute3->setToolTip(tr("Mute band 3"));
|
||||
|
||||
auto mute4 = new LedCheckBox("", this, tr("Band 4 mute"), LedCheckBox::Green);
|
||||
auto mute4 = new LedCheckBox("", this, tr("Band 4 mute"), LedCheckBox::LedColor::Green);
|
||||
mute4->move( 135, 154 );
|
||||
mute4->setModel( & controls->m_mute4 );
|
||||
mute4->setToolTip(tr("Mute band 4"));
|
||||
|
||||
@@ -44,28 +44,28 @@ DelayControlsDialog::DelayControlsDialog( DelayControls *controls ) :
|
||||
setPalette( pal );
|
||||
setFixedSize( 300, 208 );
|
||||
|
||||
auto sampleDelayKnob = new TempoSyncKnob(knobBright_26, this);
|
||||
auto sampleDelayKnob = new TempoSyncKnob(KnobType::Bright26, this);
|
||||
sampleDelayKnob->move( 10,14 );
|
||||
sampleDelayKnob->setVolumeKnob( false );
|
||||
sampleDelayKnob->setModel( &controls->m_delayTimeModel );
|
||||
sampleDelayKnob->setLabel( tr( "DELAY" ) );
|
||||
sampleDelayKnob->setHintText( tr( "Delay time" ) + " ", " s" );
|
||||
|
||||
auto feedbackKnob = new Knob(knobBright_26, this);
|
||||
auto feedbackKnob = new Knob(KnobType::Bright26, this);
|
||||
feedbackKnob->move( 11, 58 );
|
||||
feedbackKnob->setVolumeKnob( true) ;
|
||||
feedbackKnob->setModel( &controls->m_feedbackModel);
|
||||
feedbackKnob->setLabel( tr( "FDBK" ) );
|
||||
feedbackKnob->setHintText( tr ( "Feedback amount" ) + " " , "" );
|
||||
|
||||
auto lfoFreqKnob = new TempoSyncKnob(knobBright_26, this);
|
||||
auto lfoFreqKnob = new TempoSyncKnob(KnobType::Bright26, this);
|
||||
lfoFreqKnob->move( 11, 119 );
|
||||
lfoFreqKnob->setVolumeKnob( false );
|
||||
lfoFreqKnob->setModel( &controls->m_lfoTimeModel );
|
||||
lfoFreqKnob->setLabel( tr( "RATE" ) );
|
||||
lfoFreqKnob->setHintText( tr ( "LFO frequency") + " ", " s" );
|
||||
|
||||
auto lfoAmtKnob = new TempoSyncKnob(knobBright_26, this);
|
||||
auto lfoAmtKnob = new TempoSyncKnob(KnobType::Bright26, this);
|
||||
lfoAmtKnob->move( 11, 159 );
|
||||
lfoAmtKnob->setVolumeKnob( false );
|
||||
lfoAmtKnob->setModel( &controls->m_lfoAmountModel );
|
||||
|
||||
@@ -44,7 +44,7 @@ Plugin::Descriptor PLUGIN_EXPORT delay_plugin_descriptor =
|
||||
QT_TRANSLATE_NOOP( "PluginBrowser", "A native delay plugin" ),
|
||||
"Dave French <contact/dot/dave/dot/french3/at/googlemail/dot/com>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader("logo"),
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
||||
@@ -40,7 +40,7 @@ Plugin::Descriptor PLUGIN_EXPORT dispersion_plugin_descriptor =
|
||||
QT_TRANSLATE_NOOP("PluginBrowser", "An all-pass filter allowing for extremely high orders."),
|
||||
"Lost Robot <r94231/at/gmail/dot/com>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader("logo"),
|
||||
nullptr,
|
||||
nullptr
|
||||
|
||||
@@ -51,19 +51,19 @@ DispersionControlDialog::DispersionControlDialog(DispersionControls* controls) :
|
||||
m_amountBox->setLabel(tr("AMOUNT"));
|
||||
m_amountBox->setToolTip(tr("Number of all-pass filters"));
|
||||
|
||||
Knob * freqKnob = new Knob(knobBright_26, this);
|
||||
Knob * freqKnob = new Knob(KnobType::Bright26, this);
|
||||
freqKnob->move(59, 8);
|
||||
freqKnob->setModel(&controls->m_freqModel);
|
||||
freqKnob->setLabel(tr("FREQ"));
|
||||
freqKnob->setHintText(tr("Frequency:") , " Hz");
|
||||
|
||||
Knob * resoKnob = new Knob(knobBright_26, this);
|
||||
Knob * resoKnob = new Knob(KnobType::Bright26, this);
|
||||
resoKnob->move(99, 8);
|
||||
resoKnob->setModel(&controls->m_resoModel);
|
||||
resoKnob->setLabel(tr("RESO"));
|
||||
resoKnob->setHintText(tr("Resonance:") , " octaves");
|
||||
|
||||
Knob * feedbackKnob = new Knob(knobBright_26, this);
|
||||
Knob * feedbackKnob = new Knob(KnobType::Bright26, this);
|
||||
feedbackKnob->move(139, 8);
|
||||
feedbackKnob->setModel(&controls->m_feedbackModel);
|
||||
feedbackKnob->setLabel(tr("FEED"));
|
||||
|
||||
@@ -43,7 +43,7 @@ Plugin::Descriptor PLUGIN_EXPORT dualfilter_plugin_descriptor =
|
||||
QT_TRANSLATE_NOOP( "PluginBrowser", "A Dual filter plugin" ),
|
||||
"Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -90,12 +90,12 @@ bool DualFilterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames
|
||||
|
||||
if( m_dfControls.m_filter1Model.isValueChanged() || m_filter1changed )
|
||||
{
|
||||
m_filter1->setFilterType( m_dfControls.m_filter1Model.value() );
|
||||
m_filter1->setFilterType( static_cast<BasicFilters<2>::FilterType>(m_dfControls.m_filter1Model.value()) );
|
||||
m_filter1changed = true;
|
||||
}
|
||||
if( m_dfControls.m_filter2Model.isValueChanged() || m_filter2changed )
|
||||
{
|
||||
m_filter2->setFilterType( m_dfControls.m_filter2Model.value() );
|
||||
m_filter2->setFilterType( static_cast<BasicFilters<2>::FilterType>(m_dfControls.m_filter2Model.value()) );
|
||||
m_filter2changed = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace lmms::gui
|
||||
|
||||
|
||||
#define makeknob( name, x, y, model, label, hint, unit ) \
|
||||
Knob * name = new Knob( knobBright_26, this); \
|
||||
Knob * name = new Knob( KnobType::Bright26, this); \
|
||||
(name) -> move( x, y ); \
|
||||
(name) ->setModel( &controls-> model ); \
|
||||
(name) ->setLabel( label ); \
|
||||
@@ -64,8 +64,8 @@ DualFilterControlDialog::DualFilterControlDialog( DualFilterControls* controls )
|
||||
gain1Knob-> setVolumeKnob( true );
|
||||
gain2Knob-> setVolumeKnob( true );
|
||||
|
||||
auto enabled1Toggle = new LedCheckBox("", this, tr("Filter 1 enabled"), LedCheckBox::Green);
|
||||
auto enabled2Toggle = new LedCheckBox("", this, tr("Filter 2 enabled"), LedCheckBox::Green);
|
||||
auto enabled1Toggle = new LedCheckBox("", this, tr("Filter 1 enabled"), LedCheckBox::LedColor::Green);
|
||||
auto enabled2Toggle = new LedCheckBox("", this, tr("Filter 2 enabled"), LedCheckBox::LedColor::Green);
|
||||
|
||||
enabled1Toggle -> move( 12, 11 );
|
||||
enabled1Toggle -> setModel( &controls -> m_enabled1Model );
|
||||
|
||||
@@ -47,7 +47,7 @@ Plugin::Descriptor PLUGIN_EXPORT dynamicsprocessor_plugin_descriptor =
|
||||
"plugin for processing dynamics in a flexible way" ),
|
||||
"Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader("logo"),
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -167,19 +167,19 @@ bool DynProcEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
}
|
||||
|
||||
// account for stereo mode
|
||||
switch( stereoMode )
|
||||
switch( static_cast<DynProcControls::StereoMode>(stereoMode) )
|
||||
{
|
||||
case DynProcControls::SM_Maximum:
|
||||
case DynProcControls::StereoMode::Maximum:
|
||||
{
|
||||
sm_peak[0] = sm_peak[1] = qMax( m_currentPeak[0], m_currentPeak[1] );
|
||||
break;
|
||||
}
|
||||
case DynProcControls::SM_Average:
|
||||
case DynProcControls::StereoMode::Average:
|
||||
{
|
||||
sm_peak[0] = sm_peak[1] = ( m_currentPeak[0] + m_currentPeak[1] ) * 0.5;
|
||||
break;
|
||||
}
|
||||
case DynProcControls::SM_Unlinked:
|
||||
case DynProcControls::StereoMode::Unlinked:
|
||||
{
|
||||
sm_peak[0] = m_currentPeak[0];
|
||||
sm_peak[1] = m_currentPeak[1];
|
||||
|
||||
@@ -47,7 +47,7 @@ DynProcControlDialog::DynProcControlDialog(
|
||||
setPalette( pal );
|
||||
setFixedSize( 224, 319 );
|
||||
|
||||
auto waveGraph = new Graph(this, Graph::LinearNonCyclicStyle, 204, 205);
|
||||
auto waveGraph = new Graph(this, Graph::Style::LinearNonCyclic, 204, 205);
|
||||
waveGraph -> move( 10, 6 );
|
||||
waveGraph -> setModel( &_controls -> m_wavegraphModel );
|
||||
waveGraph -> setAutoFillBackground( true );
|
||||
@@ -58,7 +58,7 @@ DynProcControlDialog::DynProcControlDialog(
|
||||
waveGraph->setGraphColor( QColor( 85, 204, 145 ) );
|
||||
waveGraph -> setMaximumSize( 204, 205 );
|
||||
|
||||
auto inputKnob = new Knob(knobBright_26, this);
|
||||
auto inputKnob = new Knob(KnobType::Bright26, this);
|
||||
inputKnob -> setVolumeKnob( true );
|
||||
inputKnob -> setVolumeRatio( 1.0 );
|
||||
inputKnob -> move( 26, 223 );
|
||||
@@ -66,7 +66,7 @@ DynProcControlDialog::DynProcControlDialog(
|
||||
inputKnob->setLabel( tr( "INPUT" ) );
|
||||
inputKnob->setHintText( tr( "Input gain:" ) , "" );
|
||||
|
||||
auto outputKnob = new Knob(knobBright_26, this);
|
||||
auto outputKnob = new Knob(KnobType::Bright26, this);
|
||||
outputKnob -> setVolumeKnob( true );
|
||||
outputKnob -> setVolumeRatio( 1.0 );
|
||||
outputKnob -> move( 76, 223 );
|
||||
@@ -74,13 +74,13 @@ DynProcControlDialog::DynProcControlDialog(
|
||||
outputKnob->setLabel( tr( "OUTPUT" ) );
|
||||
outputKnob->setHintText( tr( "Output gain:" ) , "" );
|
||||
|
||||
auto attackKnob = new Knob(knobBright_26, this);
|
||||
auto attackKnob = new Knob(KnobType::Bright26, this);
|
||||
attackKnob -> move( 24, 268 );
|
||||
attackKnob->setModel( &_controls->m_attackModel );
|
||||
attackKnob->setLabel( tr( "ATTACK" ) );
|
||||
attackKnob->setHintText( tr( "Peak attack time:" ) , "ms" );
|
||||
|
||||
auto releaseKnob = new Knob(knobBright_26, this);
|
||||
auto releaseKnob = new Knob(KnobType::Bright26, this);
|
||||
releaseKnob -> move( 74, 268 );
|
||||
releaseKnob->setModel( &_controls->m_releaseModel );
|
||||
releaseKnob->setLabel( tr( "RELEASE" ) );
|
||||
|
||||
@@ -41,12 +41,11 @@ class DynProcControls : public EffectControls
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum StereoModes
|
||||
enum class StereoMode
|
||||
{
|
||||
SM_Maximum,
|
||||
SM_Average,
|
||||
SM_Unlinked,
|
||||
NumStereoModes
|
||||
Maximum,
|
||||
Average,
|
||||
Unlinked
|
||||
};
|
||||
DynProcControls( DynProcEffect * _eff );
|
||||
~DynProcControls() override = default;
|
||||
|
||||
@@ -106,14 +106,14 @@ EqControlsDialog::EqControlsDialog( EqControls *controls ) :
|
||||
distance = 81;
|
||||
for( int i = 0; i < m_parameterWidget->bandCount() ; i++ )
|
||||
{
|
||||
auto resKnob = new Knob(knobBright_26, this);
|
||||
auto resKnob = new Knob(KnobType::Bright26, this);
|
||||
resKnob->move( distance, 440 );
|
||||
resKnob->setVolumeKnob(false);
|
||||
resKnob->setModel( m_parameterWidget->getBandModels( i )->res );
|
||||
if(i > 1 && i < 6) { resKnob->setHintText( tr( "Bandwidth: " ) , tr( " Octave" ) ); }
|
||||
else { resKnob->setHintText( tr( "Resonance : " ) , "" ); }
|
||||
|
||||
auto freqKnob = new Knob(knobBright_26, this);
|
||||
auto freqKnob = new Knob(KnobType::Bright26, this);
|
||||
freqKnob->move( distance, 396 );
|
||||
freqKnob->setVolumeKnob( false );
|
||||
freqKnob->setModel( m_parameterWidget->getBandModels( i )->freq );
|
||||
|
||||
@@ -137,7 +137,7 @@ void EqHandle::paint( QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||
QRectF textRect2 = QRectF ( rectX+1, rectY+1, 80, 30 );
|
||||
QString freq = QString::number( xPixelToFreq( EqHandle::x(), m_width ) );
|
||||
QString res;
|
||||
if ( getType() != para )
|
||||
if ( getType() != EqHandleType::Para )
|
||||
{
|
||||
res = tr( "Reso: ") + QString::number( getResonance() );
|
||||
}
|
||||
@@ -171,11 +171,11 @@ QPainterPath EqHandle::getCurvePath()
|
||||
float y = m_heigth * 0.5;
|
||||
for ( float x = 0 ; x < m_width; x++ )
|
||||
{
|
||||
if ( m_type == highpass ) y = getLowCutCurve( x );
|
||||
if ( m_type == lowshelf ) y = getLowShelfCurve( x );
|
||||
if ( m_type == para ) y = getPeakCurve( x );
|
||||
if ( m_type == highshelf ) y = getHighShelfCurve( x );
|
||||
if ( m_type == lowpass ) y = getHighCutCurve( x );
|
||||
if ( m_type == EqHandleType::HighPass ) y = getLowCutCurve( x );
|
||||
if ( m_type == EqHandleType::LowShelf ) y = getLowShelfCurve( x );
|
||||
if ( m_type == EqHandleType::Para ) y = getPeakCurve( x );
|
||||
if ( m_type == EqHandleType::HighShelf ) y = getHighShelfCurve( x );
|
||||
if ( m_type == EqHandleType::LowPass ) y = getHighCutCurve( x );
|
||||
if ( x == 0 ) path.moveTo( x, y ); // sets the begin of Path
|
||||
path.lineTo( x, y );
|
||||
}
|
||||
@@ -410,7 +410,7 @@ int EqHandle::getNum()
|
||||
|
||||
|
||||
|
||||
void EqHandle::setType( int t )
|
||||
void EqHandle::setType( EqHandleType t )
|
||||
{
|
||||
EqHandle::m_type = t;
|
||||
}
|
||||
@@ -442,7 +442,7 @@ void EqHandle::setMouseHover( bool d )
|
||||
|
||||
|
||||
|
||||
int EqHandle::getType()
|
||||
EqHandleType EqHandle::getType()
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
@@ -569,7 +569,7 @@ void EqHandle::mouseReleaseEvent( QGraphicsSceneMouseEvent *event )
|
||||
void EqHandle::wheelEvent( QGraphicsSceneWheelEvent *wevent )
|
||||
{
|
||||
float highestBandwich;
|
||||
if( m_type != para )
|
||||
if( m_type != EqHandleType::Para )
|
||||
{
|
||||
highestBandwich = 10;
|
||||
}
|
||||
@@ -631,7 +631,7 @@ QVariant EqHandle::itemChange( QGraphicsItem::GraphicsItemChange change, const Q
|
||||
if( change == ItemPositionChange )
|
||||
{
|
||||
// pass filter don't move in y direction
|
||||
if ( m_type == highpass || m_type == lowpass )
|
||||
if ( m_type == EqHandleType::HighPass || m_type == EqHandleType::LowPass )
|
||||
{
|
||||
float newX = value.toPointF().x();
|
||||
if( newX < 0 )
|
||||
@@ -714,23 +714,23 @@ void EqCurve::paint( QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||
{
|
||||
for ( int x = 0; x < m_width ; x=x+1 )
|
||||
{
|
||||
if ( m_handle->at( thatHandle )->getType() == highpass )
|
||||
if ( m_handle->at( thatHandle )->getType() == EqHandleType::HighPass )
|
||||
{
|
||||
mainCurve[x]= ( mainCurve[x] + ( m_handle->at( thatHandle )->getLowCutCurve( x ) * ( activeHandles ) ) - ( ( activeHandles * ( m_heigth/2 ) ) - m_heigth ) );
|
||||
}
|
||||
if ( m_handle->at(thatHandle)->getType() == lowshelf )
|
||||
if ( m_handle->at(thatHandle)->getType() == EqHandleType::LowShelf )
|
||||
{
|
||||
mainCurve[x]= ( mainCurve[x] + ( m_handle->at( thatHandle )->getLowShelfCurve( x ) * ( activeHandles ) ) - ( ( activeHandles * ( m_heigth/2 ) ) - m_heigth ) );
|
||||
}
|
||||
if ( m_handle->at( thatHandle )->getType() == para )
|
||||
if ( m_handle->at( thatHandle )->getType() == EqHandleType::Para )
|
||||
{
|
||||
mainCurve[x]= ( mainCurve[x] + ( m_handle->at( thatHandle )->getPeakCurve( x ) * ( activeHandles ) ) - ( ( activeHandles * ( m_heigth/2 ) ) - m_heigth ) );
|
||||
}
|
||||
if ( m_handle->at( thatHandle )->getType() == highshelf )
|
||||
if ( m_handle->at( thatHandle )->getType() == EqHandleType::HighShelf )
|
||||
{
|
||||
mainCurve[x]= ( mainCurve[x] + ( m_handle->at( thatHandle )->getHighShelfCurve( x ) * ( activeHandles ) ) - ( ( activeHandles * ( m_heigth/2 ) ) - m_heigth ) );
|
||||
}
|
||||
if ( m_handle->at(thatHandle)->getType() == lowpass )
|
||||
if ( m_handle->at(thatHandle)->getType() == EqHandleType::LowPass )
|
||||
{
|
||||
mainCurve[x]= ( mainCurve[x] + ( m_handle->at( thatHandle )->getHighCutCurve( x ) * ( activeHandles ) ) - ( ( activeHandles * ( m_heigth/2 ) ) - m_heigth ) );
|
||||
}
|
||||
|
||||
@@ -32,12 +32,12 @@ namespace lmms::gui
|
||||
{
|
||||
|
||||
|
||||
enum{
|
||||
highpass=1,
|
||||
lowshelf,
|
||||
para,
|
||||
highshelf,
|
||||
lowpass
|
||||
enum class EqHandleType {
|
||||
HighPass=1,
|
||||
LowShelf,
|
||||
Para,
|
||||
HighShelf,
|
||||
LowPass
|
||||
};
|
||||
|
||||
|
||||
@@ -64,8 +64,8 @@ public:
|
||||
float getHighCutCurve( float x );
|
||||
float getResonance();
|
||||
int getNum();
|
||||
int getType();
|
||||
void setType( int t );
|
||||
EqHandleType getType();
|
||||
void setType( EqHandleType t );
|
||||
void setResonance( float r );
|
||||
bool isMouseHover();
|
||||
void setMouseHover( bool d );
|
||||
@@ -104,7 +104,8 @@ private:
|
||||
bool m_lp24;
|
||||
bool m_lp48;
|
||||
bool m_mouseHover;
|
||||
int m_type, m_numb;
|
||||
EqHandleType m_type;
|
||||
int m_numb;
|
||||
float m_width, m_heigth;
|
||||
float m_resonance;
|
||||
bool m_mousePressed;
|
||||
|
||||
@@ -44,7 +44,7 @@ Plugin::Descriptor PLUGIN_EXPORT eq_plugin_descriptor =
|
||||
QT_TRANSLATE_NOOP( "PluginBrowser", "A native eq plugin" ),
|
||||
"Dave French <contact/dot/dave/dot/french3/at/googlemail/dot/com>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader("logo"),
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
||||
@@ -164,35 +164,35 @@ void EqParameterWidget::changeHandle( int i )
|
||||
switch ( i )
|
||||
{
|
||||
case 0 :
|
||||
m_handleList->at( i )->setType( highpass );
|
||||
m_handleList->at( i )->setType( EqHandleType::HighPass );
|
||||
m_handleList->at( i )->setPos( x, m_displayHeigth / 2 );
|
||||
break;
|
||||
case 1:
|
||||
m_handleList->at( i )->setType( lowshelf );
|
||||
m_handleList->at( i )->setType( EqHandleType::LowShelf );
|
||||
m_handleList->at( i )->setPos( x, y );
|
||||
break;
|
||||
case 2:
|
||||
m_handleList->at( i )->setType( para );
|
||||
m_handleList->at( i )->setType( EqHandleType::Para );
|
||||
m_handleList->at( i )->setPos( x, y );
|
||||
break;
|
||||
case 3:
|
||||
m_handleList->at( i )->setType( para );
|
||||
m_handleList->at( i )->setType( EqHandleType::Para );
|
||||
m_handleList->at( i )->setPos( x, y );
|
||||
break;
|
||||
case 4:
|
||||
m_handleList->at( i )->setType( para );
|
||||
m_handleList->at( i )->setType( EqHandleType::Para );
|
||||
m_handleList->at( i )->setPos( x, y );
|
||||
break;
|
||||
case 5:
|
||||
m_handleList->at( i )->setType( para );
|
||||
m_handleList->at( i )->setType( EqHandleType::Para );
|
||||
m_handleList->at( i )->setPos( x, y );
|
||||
break;
|
||||
case 6:
|
||||
m_handleList->at( i )->setType( highshelf );
|
||||
m_handleList->at( i )->setType( EqHandleType::HighShelf );
|
||||
m_handleList->at( i )->setPos( x, y );
|
||||
break;
|
||||
case 7:
|
||||
m_handleList->at( i )->setType( lowpass );
|
||||
m_handleList->at( i )->setType( EqHandleType::LowPass );
|
||||
m_handleList->at( i )->setPos( QPointF( x, m_displayHeigth / 2 ) );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -42,42 +42,42 @@ FlangerControlsDialog::FlangerControlsDialog( FlangerControls *controls ) :
|
||||
setPalette( pal );
|
||||
setFixedSize( 233, 75 );
|
||||
|
||||
auto delayKnob = new Knob(knobBright_26, this);
|
||||
auto delayKnob = new Knob(KnobType::Bright26, this);
|
||||
delayKnob->move( 10,10 );
|
||||
delayKnob->setVolumeKnob( false );
|
||||
delayKnob->setModel( &controls->m_delayTimeModel );
|
||||
delayKnob->setLabel( tr( "DELAY" ) );
|
||||
delayKnob->setHintText( tr( "Delay time:" ) + " ", "s" );
|
||||
|
||||
auto lfoFreqKnob = new TempoSyncKnob(knobBright_26, this);
|
||||
auto lfoFreqKnob = new TempoSyncKnob(KnobType::Bright26, this);
|
||||
lfoFreqKnob->move( 48,10 );
|
||||
lfoFreqKnob->setVolumeKnob( false );
|
||||
lfoFreqKnob->setModel( &controls->m_lfoFrequencyModel );
|
||||
lfoFreqKnob->setLabel( tr( "RATE" ) );
|
||||
lfoFreqKnob->setHintText( tr( "Period:" ) , " Sec" );
|
||||
|
||||
auto lfoAmtKnob = new Knob(knobBright_26, this);
|
||||
auto lfoAmtKnob = new Knob(KnobType::Bright26, this);
|
||||
lfoAmtKnob->move( 85,10 );
|
||||
lfoAmtKnob->setVolumeKnob( false );
|
||||
lfoAmtKnob->setModel( &controls->m_lfoAmountModel );
|
||||
lfoAmtKnob->setLabel( tr( "AMNT" ) );
|
||||
lfoAmtKnob->setHintText( tr( "Amount:" ) , "" );
|
||||
|
||||
auto lfoPhaseKnob = new Knob(knobBright_26, this);
|
||||
auto lfoPhaseKnob = new Knob(KnobType::Bright26, this);
|
||||
lfoPhaseKnob->move( 123,10 );
|
||||
lfoPhaseKnob->setVolumeKnob( false );
|
||||
lfoPhaseKnob->setModel( &controls->m_lfoPhaseModel );
|
||||
lfoPhaseKnob->setLabel( tr( "PHASE" ) );
|
||||
lfoPhaseKnob->setHintText( tr( "Phase:" ) , " degrees" );
|
||||
|
||||
auto feedbackKnob = new Knob(knobBright_26, this);
|
||||
auto feedbackKnob = new Knob(KnobType::Bright26, this);
|
||||
feedbackKnob->move( 160,10 );
|
||||
feedbackKnob->setVolumeKnob( true) ;
|
||||
feedbackKnob->setModel( &controls->m_feedbackModel );
|
||||
feedbackKnob->setLabel( tr( "FDBK" ) );
|
||||
feedbackKnob->setHintText( tr( "Feedback amount:" ) , "" );
|
||||
|
||||
auto whiteNoiseKnob = new Knob(knobBright_26, this);
|
||||
auto whiteNoiseKnob = new Knob(KnobType::Bright26, this);
|
||||
whiteNoiseKnob->move( 196,10 );
|
||||
whiteNoiseKnob->setVolumeKnob( true) ;
|
||||
whiteNoiseKnob->setModel( &controls->m_whiteNoiseAmountModel );
|
||||
|
||||
@@ -45,7 +45,7 @@ Plugin::Descriptor PLUGIN_EXPORT flanger_plugin_descriptor =
|
||||
QT_TRANSLATE_NOOP( "PluginBrowser", "A native flanger plugin" ),
|
||||
"Dave French <contact/dot/dave/dot/french3/at/googlemail/dot/com>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader("logo"),
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
||||
@@ -63,7 +63,7 @@ Plugin::Descriptor PLUGIN_EXPORT freeboy_plugin_descriptor =
|
||||
"Attila Herman <attila589/at/gmail.com>"
|
||||
"Csaba Hruska <csaba.hruska/at/gmail.com>",
|
||||
0x0100,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
nullptr,
|
||||
} ;
|
||||
@@ -250,7 +250,7 @@ void FreeBoyInstrument::playNote(NotePlayHandle* nph, sampleFrame* workingBuffer
|
||||
int data = 0;
|
||||
int freq = nph->frequency();
|
||||
|
||||
if ( tfp == 0 )
|
||||
if (!nph->m_pluginData)
|
||||
{
|
||||
auto papu = new GbApuWrapper{};
|
||||
papu->setSampleRate(samplerate, CLOCK_RATE);
|
||||
@@ -446,7 +446,7 @@ class FreeBoyKnob : public Knob
|
||||
{
|
||||
public:
|
||||
FreeBoyKnob( QWidget * _parent ) :
|
||||
Knob( knobStyled, _parent )
|
||||
Knob( KnobType::Styled, _parent )
|
||||
{
|
||||
setFixedSize( 30, 30 );
|
||||
setCenterPointX( 15.0 );
|
||||
@@ -677,7 +677,7 @@ FreeBoyInstrumentView::FreeBoyInstrumentView( Instrument * _instrument,
|
||||
|
||||
|
||||
m_graph = new Graph( this );
|
||||
m_graph->setGraphStyle( Graph::NearestStyle );
|
||||
m_graph->setGraphStyle( Graph::Style::Nearest );
|
||||
m_graph->setGraphColor( QColor(0x4E, 0x83, 0x2B) );
|
||||
m_graph->move( 37, 199 );
|
||||
m_graph->resize(208, 47);
|
||||
|
||||
@@ -69,7 +69,7 @@ Plugin::Descriptor PLUGIN_EXPORT gigplayer_plugin_descriptor =
|
||||
QT_TRANSLATE_NOOP( "PluginBrowser", "Player for GIG files" ),
|
||||
"Garrett Wilson <g/at/floft/dot/net>",
|
||||
0x0100,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
"gig",
|
||||
nullptr,
|
||||
@@ -108,8 +108,8 @@ GigInstrument::GigInstrument( InstrumentTrack * _instrument_track ) :
|
||||
GigInstrument::~GigInstrument()
|
||||
{
|
||||
Engine::audioEngine()->removePlayHandlesOfTypes( instrumentTrack(),
|
||||
PlayHandle::TypeNotePlayHandle
|
||||
| PlayHandle::TypeInstrumentPlayHandle );
|
||||
PlayHandle::Type::NotePlayHandle
|
||||
| PlayHandle::Type::InstrumentPlayHandle );
|
||||
freeInstance();
|
||||
}
|
||||
|
||||
@@ -293,8 +293,6 @@ void GigInstrument::playNote( NotePlayHandle * _n, sampleFrame * )
|
||||
{
|
||||
const float LOG440 = 2.643452676f;
|
||||
|
||||
const f_cnt_t tfp = _n->totalFramesPlayed();
|
||||
|
||||
int midiNote = (int) floor( 12.0 * ( log2( _n->unpitchedFrequency() ) - LOG440 ) - 4.0 );
|
||||
|
||||
// out of range?
|
||||
@@ -303,7 +301,7 @@ void GigInstrument::playNote( NotePlayHandle * _n, sampleFrame * )
|
||||
return;
|
||||
}
|
||||
|
||||
if( tfp == 0 )
|
||||
if (!_n->m_pluginData)
|
||||
{
|
||||
auto pluginData = new GIGPluginData;
|
||||
pluginData->midiNote = midiNote;
|
||||
@@ -343,16 +341,16 @@ void GigInstrument::play( sampleFrame * _working_buffer )
|
||||
for( QList<GigNote>::iterator it = m_notes.begin(); it != m_notes.end(); ++it )
|
||||
{
|
||||
// Process notes in the KeyUp state, adding release samples if desired
|
||||
if( it->state == KeyUp )
|
||||
if( it->state == GigState::KeyUp )
|
||||
{
|
||||
// If there are no samples, we're done
|
||||
if( it->samples.empty() )
|
||||
{
|
||||
it->state = Completed;
|
||||
it->state = GigState::Completed;
|
||||
}
|
||||
else
|
||||
{
|
||||
it->state = PlayingKeyUp;
|
||||
it->state = GigState::PlayingKeyUp;
|
||||
|
||||
// Notify each sample that the key has been released
|
||||
for (auto& sample : it->samples)
|
||||
@@ -368,9 +366,9 @@ void GigInstrument::play( sampleFrame * _working_buffer )
|
||||
}
|
||||
}
|
||||
// Process notes in the KeyDown state, adding samples for the notes
|
||||
else if( it->state == KeyDown )
|
||||
else if( it->state == GigState::KeyDown )
|
||||
{
|
||||
it->state = PlayingKeyDown;
|
||||
it->state = GigState::PlayingKeyDown;
|
||||
addSamples( *it, false );
|
||||
}
|
||||
|
||||
@@ -395,7 +393,7 @@ void GigInstrument::play( sampleFrame * _working_buffer )
|
||||
}
|
||||
|
||||
// Delete ended notes (either in the completed state or all the samples ended)
|
||||
if( it->state == Completed || it->samples.empty() )
|
||||
if( it->state == GigState::Completed || it->samples.empty() )
|
||||
{
|
||||
it = m_notes.erase( it );
|
||||
|
||||
@@ -410,7 +408,7 @@ void GigInstrument::play( sampleFrame * _working_buffer )
|
||||
for (auto& note : m_notes)
|
||||
{
|
||||
// Only process the notes if we're in a playing state
|
||||
if (!(note.state == PlayingKeyDown || note.state == PlayingKeyUp ))
|
||||
if (!(note.state == GigState::PlayingKeyDown || note.state == GigState::PlayingKeyUp ))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -682,9 +680,9 @@ void GigInstrument::deleteNotePluginData( NotePlayHandle * _n )
|
||||
for (auto& note : m_notes)
|
||||
{
|
||||
// Find the note by matching pointers to the plugin data
|
||||
if (note.handle == pluginData && (note.state == KeyDown || note.state == PlayingKeyDown))
|
||||
if (note.handle == pluginData && (note.state == GigState::KeyDown || note.state == GigState::PlayingKeyDown))
|
||||
{
|
||||
note.state = KeyUp;
|
||||
note.state = GigState::KeyUp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -908,7 +906,7 @@ class gigKnob : public Knob
|
||||
{
|
||||
public:
|
||||
gigKnob( QWidget * _parent ) :
|
||||
Knob( knobBright_26, _parent )
|
||||
Knob( KnobType::Bright26, _parent )
|
||||
{
|
||||
setFixedSize( 31, 38 );
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ public:
|
||||
|
||||
|
||||
// What portion of a note are we in?
|
||||
enum GigState
|
||||
enum class GigState
|
||||
{
|
||||
// We just pressed the key
|
||||
KeyDown,
|
||||
@@ -224,7 +224,7 @@ public:
|
||||
|
||||
GigNote( int midiNote, int velocity, float frequency, GIGPluginData * handle )
|
||||
: midiNote( midiNote ), velocity( velocity ),
|
||||
release( false ), isRelease( false ), state( KeyDown ),
|
||||
release( false ), isRelease( false ), state( GigState::KeyDown ),
|
||||
frequency( frequency ), handle( handle )
|
||||
{
|
||||
}
|
||||
@@ -268,7 +268,7 @@ public:
|
||||
|
||||
Flags flags() const override
|
||||
{
|
||||
return IsSingleStreamed|IsNotBendable;
|
||||
return Flag::IsSingleStreamed | Flag::IsNotBendable;
|
||||
}
|
||||
|
||||
gui::PluginView* instantiateView( QWidget * _parent ) override;
|
||||
|
||||
@@ -30,7 +30,7 @@ Plugin::Descriptor PLUGIN_EXPORT hydrogenimport_plugin_descriptor =
|
||||
"Filter for importing Hydrogen files into LMMS" ),
|
||||
"frank mather",
|
||||
0x0100,
|
||||
Plugin::ImportFilter,
|
||||
Plugin::Type::ImportFilter,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -42,7 +42,7 @@ QString filename;
|
||||
class NoteKey
|
||||
{
|
||||
public:
|
||||
enum Key {
|
||||
enum class Key {
|
||||
C = 0,
|
||||
Cs,
|
||||
D,
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
|
||||
static int stringToNoteKey( const QString& str )
|
||||
{
|
||||
int m_key = NoteKey::C;
|
||||
auto m_key = Key::C;
|
||||
|
||||
|
||||
QString sKey = str.left( str.length() - 1 );
|
||||
@@ -74,54 +74,54 @@ public:
|
||||
|
||||
if ( sKey == "C" )
|
||||
{
|
||||
m_key = NoteKey::C;
|
||||
m_key = Key::C;
|
||||
}
|
||||
else if ( sKey == "Cs" )
|
||||
{
|
||||
m_key = NoteKey::Cs;
|
||||
m_key = Key::Cs;
|
||||
}
|
||||
else if ( sKey == "D" )
|
||||
{
|
||||
m_key = NoteKey::D;
|
||||
m_key = Key::D;
|
||||
}
|
||||
else if ( sKey == "Ef" )
|
||||
{
|
||||
m_key = NoteKey::Ef;
|
||||
m_key = Key::Ef;
|
||||
}
|
||||
else if ( sKey == "E" )
|
||||
{
|
||||
m_key = NoteKey::E;
|
||||
m_key = Key::E;
|
||||
}
|
||||
else if ( sKey == "F" )
|
||||
{
|
||||
m_key = NoteKey::F;
|
||||
m_key = Key::F;
|
||||
}
|
||||
else if ( sKey == "Fs" )
|
||||
{
|
||||
m_key = NoteKey::Fs;
|
||||
m_key = Key::Fs;
|
||||
}
|
||||
else if ( sKey == "G" )
|
||||
{
|
||||
m_key = NoteKey::G;
|
||||
m_key = Key::G;
|
||||
}
|
||||
else if ( sKey == "Af" )
|
||||
{
|
||||
m_key = NoteKey::Af;
|
||||
m_key = Key::Af;
|
||||
}
|
||||
else if ( sKey == "A" )
|
||||
{
|
||||
m_key = NoteKey::A;
|
||||
m_key = Key::A;
|
||||
}
|
||||
else if ( sKey == "Bf" )
|
||||
{
|
||||
m_key = NoteKey::Bf;
|
||||
m_key = Key::Bf;
|
||||
}
|
||||
else if ( sKey == "B" ) {
|
||||
m_key = NoteKey::B;
|
||||
m_key = Key::B;
|
||||
}
|
||||
|
||||
// Hydrogen records MIDI notes from C-1 to B5, and exports them as a number ranging from -3 to 3
|
||||
return m_key + ((nOctave + 3) * 12);
|
||||
return static_cast<int>(m_key) + ((nOctave + 3) * 12);
|
||||
}
|
||||
|
||||
};
|
||||
@@ -218,7 +218,7 @@ bool HydrogenImport::readSong()
|
||||
if ( nLayer == 0 )
|
||||
{
|
||||
drum_track[sId] = static_cast<InstrumentTrack*>(
|
||||
Track::create(Track::InstrumentTrack, Engine::patternStore())
|
||||
Track::create(Track::Type::Instrument, Engine::patternStore())
|
||||
);
|
||||
drum_track[sId]->volumeModel()->setValue( fVolume * 100 );
|
||||
drum_track[sId]->panningModel()->setValue( ( fPan_R - fPan_L ) * 100 );
|
||||
|
||||
@@ -23,11 +23,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "Kicker.h"
|
||||
|
||||
#include <QDomElement>
|
||||
|
||||
#include "Kicker.h"
|
||||
#include "AudioEngine.h"
|
||||
#include "Engine.h"
|
||||
#include "InstrumentTrack.h"
|
||||
@@ -55,7 +54,7 @@ Plugin::Descriptor PLUGIN_EXPORT kicker_plugin_descriptor =
|
||||
"Versatile drum synthesizer" ),
|
||||
"Tobias Doerffel <tobydox/at/users.sf.net>",
|
||||
0x0100,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -85,65 +84,64 @@ KickerInstrument::KickerInstrument( InstrumentTrack * _instrument_track ) :
|
||||
|
||||
|
||||
|
||||
void KickerInstrument::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this )
|
||||
void KickerInstrument::saveSettings(QDomDocument& doc, QDomElement& elem)
|
||||
{
|
||||
m_startFreqModel.saveSettings( _doc, _this, "startfreq" );
|
||||
m_endFreqModel.saveSettings( _doc, _this, "endfreq" );
|
||||
m_decayModel.saveSettings( _doc, _this, "decay" );
|
||||
m_distModel.saveSettings( _doc, _this, "dist" );
|
||||
m_distEndModel.saveSettings( _doc, _this, "distend" );
|
||||
m_gainModel.saveSettings( _doc, _this, "gain" );
|
||||
m_envModel.saveSettings( _doc, _this, "env" );
|
||||
m_noiseModel.saveSettings( _doc, _this, "noise" );
|
||||
m_clickModel.saveSettings( _doc, _this, "click" );
|
||||
m_slopeModel.saveSettings( _doc, _this, "slope" );
|
||||
m_startNoteModel.saveSettings( _doc, _this, "startnote" );
|
||||
m_endNoteModel.saveSettings( _doc, _this, "endnote" );
|
||||
m_versionModel.saveSettings( _doc, _this, "version" );
|
||||
m_startFreqModel.saveSettings(doc, elem, "startfreq");
|
||||
m_endFreqModel.saveSettings(doc, elem, "endfreq");
|
||||
m_decayModel.saveSettings(doc, elem, "decay");
|
||||
m_distModel.saveSettings(doc, elem, "dist");
|
||||
m_distEndModel.saveSettings(doc, elem, "distend");
|
||||
m_gainModel.saveSettings(doc, elem, "gain");
|
||||
m_envModel.saveSettings(doc, elem, "env");
|
||||
m_noiseModel.saveSettings(doc, elem, "noise");
|
||||
m_clickModel.saveSettings(doc, elem, "click");
|
||||
m_slopeModel.saveSettings(doc, elem, "slope");
|
||||
m_startNoteModel.saveSettings(doc, elem, "startnote");
|
||||
m_endNoteModel.saveSettings(doc, elem, "endnote");
|
||||
m_versionModel.saveSettings(doc, elem, "version");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void KickerInstrument::loadSettings( const QDomElement & _this )
|
||||
void KickerInstrument::loadSettings(const QDomElement& elem)
|
||||
{
|
||||
m_versionModel.loadSettings( _this, "version" );
|
||||
m_versionModel.loadSettings(elem, "version");
|
||||
|
||||
m_startFreqModel.loadSettings( _this, "startfreq" );
|
||||
m_endFreqModel.loadSettings( _this, "endfreq" );
|
||||
m_decayModel.loadSettings( _this, "decay" );
|
||||
m_distModel.loadSettings( _this, "dist" );
|
||||
if( _this.hasAttribute( "distend" ) )
|
||||
m_startFreqModel.loadSettings(elem, "startfreq");
|
||||
m_endFreqModel.loadSettings(elem, "endfreq");
|
||||
m_decayModel.loadSettings(elem, "decay");
|
||||
m_distModel.loadSettings(elem, "dist");
|
||||
if (elem.hasAttribute("distend") || !elem.firstChildElement("distend").isNull())
|
||||
{
|
||||
m_distEndModel.loadSettings( _this, "distend" );
|
||||
m_distEndModel.loadSettings(elem, "distend");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_distEndModel.setValue( m_distModel.value() );
|
||||
m_distEndModel.setValue(m_distModel.value());
|
||||
}
|
||||
m_gainModel.loadSettings( _this, "gain" );
|
||||
m_envModel.loadSettings( _this, "env" );
|
||||
m_noiseModel.loadSettings( _this, "noise" );
|
||||
m_clickModel.loadSettings( _this, "click" );
|
||||
m_slopeModel.loadSettings( _this, "slope" );
|
||||
m_startNoteModel.loadSettings( _this, "startnote" );
|
||||
if( m_versionModel.value() < 1 )
|
||||
m_gainModel.loadSettings(elem, "gain");
|
||||
m_envModel.loadSettings(elem, "env");
|
||||
m_noiseModel.loadSettings(elem, "noise");
|
||||
m_clickModel.loadSettings(elem, "click");
|
||||
m_slopeModel.loadSettings(elem, "slope");
|
||||
m_startNoteModel.loadSettings(elem, "startnote");
|
||||
if (m_versionModel.value() < 1)
|
||||
{
|
||||
m_startNoteModel.setValue( false );
|
||||
m_startNoteModel.setValue(false);
|
||||
}
|
||||
m_endNoteModel.loadSettings( _this, "endnote" );
|
||||
m_endNoteModel.loadSettings(elem, "endnote");
|
||||
|
||||
// Try to maintain backwards compatibility
|
||||
if( !_this.hasAttribute( "version" ) )
|
||||
if (!elem.hasAttribute("version"))
|
||||
{
|
||||
m_startNoteModel.setValue( false );
|
||||
m_decayModel.setValue( m_decayModel.value() * 1.33f );
|
||||
m_envModel.setValue( 1.0f );
|
||||
m_slopeModel.setValue( 1.0f );
|
||||
m_clickModel.setValue( 0.0f );
|
||||
m_startNoteModel.setValue(false);
|
||||
m_decayModel.setValue(m_decayModel.value() * 1.33f);
|
||||
m_envModel.setValue(1.0f);
|
||||
m_slopeModel.setValue(1.0f);
|
||||
m_clickModel.setValue(0.0f);
|
||||
}
|
||||
m_versionModel.setValue( KICKER_PRESET_VERSION );
|
||||
m_versionModel.setValue(KICKER_PRESET_VERSION);
|
||||
}
|
||||
|
||||
|
||||
@@ -165,7 +163,7 @@ void KickerInstrument::playNote( NotePlayHandle * _n,
|
||||
const float decfr = m_decayModel.value() * Engine::audioEngine()->processingSampleRate() / 1000.0f;
|
||||
const f_cnt_t tfp = _n->totalFramesPlayed();
|
||||
|
||||
if ( tfp == 0 )
|
||||
if (!_n->m_pluginData)
|
||||
{
|
||||
_n->m_pluginData = new SweepOsc(
|
||||
DistFX( m_distModel.value(),
|
||||
@@ -228,7 +226,7 @@ class KickerKnob : public Knob
|
||||
{
|
||||
public:
|
||||
KickerKnob( QWidget * _parent ) :
|
||||
Knob( knobStyled, _parent )
|
||||
Knob( KnobType::Styled, _parent )
|
||||
{
|
||||
setFixedSize( 29, 29 );
|
||||
setObjectName( "smallKnob" );
|
||||
@@ -240,7 +238,7 @@ class KickerEnvKnob : public TempoSyncKnob
|
||||
{
|
||||
public:
|
||||
KickerEnvKnob( QWidget * _parent ) :
|
||||
TempoSyncKnob( knobStyled, _parent )
|
||||
TempoSyncKnob( KnobType::Styled, _parent )
|
||||
{
|
||||
setFixedSize( 29, 29 );
|
||||
setObjectName( "smallKnob" );
|
||||
@@ -252,7 +250,7 @@ class KickerLargeKnob : public Knob
|
||||
{
|
||||
public:
|
||||
KickerLargeKnob( QWidget * _parent ) :
|
||||
Knob( knobStyled, _parent )
|
||||
Knob( KnobType::Styled, _parent )
|
||||
{
|
||||
setFixedSize( 34, 34 );
|
||||
setObjectName( "largeKnob" );
|
||||
@@ -317,10 +315,10 @@ KickerInstrumentView::KickerInstrumentView( Instrument * _instrument,
|
||||
m_distEndKnob->setHintText( tr( "End distortion:" ), "" );
|
||||
m_distEndKnob->move( COL5, ROW2 );
|
||||
|
||||
m_startNoteToggle = new LedCheckBox( "", this, "", LedCheckBox::Green );
|
||||
m_startNoteToggle = new LedCheckBox( "", this, "", LedCheckBox::LedColor::Green );
|
||||
m_startNoteToggle->move( COL1 + 8, LED_ROW );
|
||||
|
||||
m_endNoteToggle = new LedCheckBox( "", this, "", LedCheckBox::Green );
|
||||
m_endNoteToggle = new LedCheckBox( "", this, "", LedCheckBox::LedColor::Green );
|
||||
m_endNoteToggle->move( END_COL + 8, LED_ROW );
|
||||
|
||||
setAutoFillBackground( true );
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef KICKER_H
|
||||
#define KICKER_H
|
||||
#ifndef LMMS_KICKER_H
|
||||
#define LMMS_KICKER_H
|
||||
|
||||
#include "AutomatableModel.h"
|
||||
#include "Instrument.h"
|
||||
@@ -60,14 +59,14 @@ public:
|
||||
sampleFrame * _working_buffer ) override;
|
||||
void deleteNotePluginData( NotePlayHandle * _n ) override;
|
||||
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
void saveSettings(QDomDocument& doc, QDomElement& elem) override;
|
||||
void loadSettings(const QDomElement& elem) override;
|
||||
|
||||
QString nodeName() const override;
|
||||
|
||||
Flags flags() const override
|
||||
{
|
||||
return IsNotBendable;
|
||||
return Flag::IsNotBendable;
|
||||
}
|
||||
|
||||
f_cnt_t desiredReleaseFrames() const override
|
||||
@@ -135,4 +134,4 @@ private:
|
||||
|
||||
} // namespace lmms
|
||||
|
||||
#endif
|
||||
#endif // LMMS_KICKER_H
|
||||
|
||||
@@ -56,7 +56,7 @@ Plugin::Descriptor PLUGIN_EXPORT ladspabrowser_plugin_descriptor =
|
||||
"List installed LADSPA plugins" ),
|
||||
"Danny McRae <khjklujn/at/users.sourceforge.net>",
|
||||
0x0100,
|
||||
Plugin::Tool,
|
||||
Plugin::Type::Tool,
|
||||
new PluginPixmapLoader("logo"),
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -107,12 +107,12 @@ LadspaBrowserView::LadspaBrowserView( ToolPlugin * _tool ) :
|
||||
auto ws = new QWidget(this);
|
||||
ws->setFixedSize( 500, 480 );
|
||||
|
||||
QWidget * available = createTab( ws, tr( "Available Effects" ), VALID );
|
||||
QWidget * available = createTab( ws, tr( "Available Effects" ), LadspaPluginType::Valid );
|
||||
QWidget * unavailable = createTab( ws, tr( "Unavailable Effects" ),
|
||||
INVALID );
|
||||
QWidget * instruments = createTab( ws, tr( "Instruments" ), SOURCE );
|
||||
QWidget * analysis = createTab( ws, tr( "Analysis Tools" ), SINK );
|
||||
QWidget * other = createTab( ws, tr( "Don't know" ), OTHER );
|
||||
LadspaPluginType::Invalid );
|
||||
QWidget * instruments = createTab( ws, tr( "Instruments" ), LadspaPluginType::Source );
|
||||
QWidget * analysis = createTab( ws, tr( "Analysis Tools" ), LadspaPluginType::Sink );
|
||||
QWidget * other = createTab( ws, tr( "Don't know" ), LadspaPluginType::Other );
|
||||
|
||||
|
||||
m_tabBar->addTab( available, tr( "Available Effects" ),
|
||||
|
||||
@@ -49,22 +49,22 @@ LadspaDescription::LadspaDescription( QWidget * _parent,
|
||||
l_sortable_plugin_t plugins;
|
||||
switch( _type )
|
||||
{
|
||||
case SOURCE:
|
||||
case LadspaPluginType::Source:
|
||||
plugins = manager->getInstruments();
|
||||
break;
|
||||
case TRANSFER:
|
||||
case LadspaPluginType::Transfer:
|
||||
plugins = manager->getValidEffects();
|
||||
break;
|
||||
case VALID:
|
||||
case LadspaPluginType::Valid:
|
||||
plugins = manager->getValidEffects();
|
||||
break;
|
||||
case INVALID:
|
||||
case LadspaPluginType::Invalid:
|
||||
plugins = manager->getInvalidEffects();
|
||||
break;
|
||||
case SINK:
|
||||
case LadspaPluginType::Sink:
|
||||
plugins = manager->getAnalysisTools();
|
||||
break;
|
||||
case OTHER:
|
||||
case LadspaPluginType::Other:
|
||||
plugins = manager->getOthers();
|
||||
break;
|
||||
default:
|
||||
@@ -75,7 +75,7 @@ LadspaDescription::LadspaDescription( QWidget * _parent,
|
||||
for (const auto& plugin : plugins)
|
||||
{
|
||||
ch_cnt_t audioDeviceChannels = Engine::audioEngine()->audioDev()->channels();
|
||||
if (_type != VALID || manager->getDescription(plugin.second)->inputChannels <= audioDeviceChannels)
|
||||
if (_type != LadspaPluginType::Valid || manager->getDescription(plugin.second)->inputChannels <= audioDeviceChannels)
|
||||
{
|
||||
pluginNames.push_back(plugin.first);
|
||||
m_pluginKeys.push_back(plugin.second);
|
||||
|
||||
@@ -86,7 +86,7 @@ void LadspaControlDialog::updateEffectView( LadspaControls * _ctl )
|
||||
control_list_t & controls = _ctl->m_controls[proc];
|
||||
int row = 0;
|
||||
int col = 0;
|
||||
buffer_data_t last_port = NONE;
|
||||
BufferDataType last_port = BufferDataType::None;
|
||||
|
||||
QGroupBox * grouper;
|
||||
if( _ctl->m_processors > 1 )
|
||||
@@ -108,10 +108,10 @@ void LadspaControlDialog::updateEffectView( LadspaControls * _ctl )
|
||||
{
|
||||
if (control->port()->proc == proc)
|
||||
{
|
||||
buffer_data_t this_port = control->port()->data_type;
|
||||
if( last_port != NONE &&
|
||||
( this_port == TOGGLED || this_port == ENUM ) &&
|
||||
( last_port != TOGGLED && last_port != ENUM ) )
|
||||
BufferDataType this_port = control->port()->data_type;
|
||||
if( last_port != BufferDataType::None &&
|
||||
( this_port == BufferDataType::Toggled || this_port == BufferDataType::Enum ) &&
|
||||
( last_port != BufferDataType::Toggled && last_port != BufferDataType::Enum ) )
|
||||
{
|
||||
++row;
|
||||
col = 0;
|
||||
|
||||
@@ -60,10 +60,10 @@ Plugin::Descriptor PLUGIN_EXPORT ladspaeffect_plugin_descriptor =
|
||||
"inside LMMS." ),
|
||||
"Danny McRae <khjklujn/at/users.sourceforge.net>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader("logo"),
|
||||
nullptr,
|
||||
new LadspaSubPluginFeatures( Plugin::Effect )
|
||||
new LadspaSubPluginFeatures( Plugin::Type::Effect )
|
||||
} ;
|
||||
|
||||
}
|
||||
@@ -106,7 +106,7 @@ LadspaEffect::~LadspaEffect()
|
||||
|
||||
void LadspaEffect::changeSampleRate()
|
||||
{
|
||||
DataFile dataFile( DataFile::EffectSettings );
|
||||
DataFile dataFile( DataFile::Type::EffectSettings );
|
||||
m_controls->saveState( dataFile, dataFile.content() );
|
||||
|
||||
LadspaControls * controls = m_controls;
|
||||
@@ -163,7 +163,7 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
port_desc_t * pp = m_ports.at( proc ).at( port );
|
||||
switch( pp->rate )
|
||||
{
|
||||
case CHANNEL_IN:
|
||||
case BufferRate::ChannelIn:
|
||||
for( fpp_t frame = 0;
|
||||
frame < frames; ++frame )
|
||||
{
|
||||
@@ -172,7 +172,7 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
}
|
||||
++channel;
|
||||
break;
|
||||
case AUDIO_RATE_INPUT:
|
||||
case BufferRate::AudioRateInput:
|
||||
{
|
||||
ValueBuffer * vb = pp->control->valueBuffer();
|
||||
if( vb )
|
||||
@@ -195,7 +195,7 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONTROL_RATE_INPUT:
|
||||
case BufferRate::ControlRateInput:
|
||||
if( pp->control == nullptr )
|
||||
{
|
||||
break;
|
||||
@@ -205,9 +205,9 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
pp->buffer[0] =
|
||||
pp->value;
|
||||
break;
|
||||
case CHANNEL_OUT:
|
||||
case AUDIO_RATE_OUTPUT:
|
||||
case CONTROL_RATE_OUTPUT:
|
||||
case BufferRate::ChannelOut:
|
||||
case BufferRate::AudioRateOutput:
|
||||
case BufferRate::ControlRateOutput:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -234,11 +234,11 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
port_desc_t * pp = m_ports.at( proc ).at( port );
|
||||
switch( pp->rate )
|
||||
{
|
||||
case CHANNEL_IN:
|
||||
case AUDIO_RATE_INPUT:
|
||||
case CONTROL_RATE_INPUT:
|
||||
case BufferRate::ChannelIn:
|
||||
case BufferRate::AudioRateInput:
|
||||
case BufferRate::ControlRateInput:
|
||||
break;
|
||||
case CHANNEL_OUT:
|
||||
case BufferRate::ChannelOut:
|
||||
for( fpp_t frame = 0;
|
||||
frame < frames; ++frame )
|
||||
{
|
||||
@@ -247,8 +247,8 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
}
|
||||
++channel;
|
||||
break;
|
||||
case AUDIO_RATE_OUTPUT:
|
||||
case CONTROL_RATE_OUTPUT:
|
||||
case BufferRate::AudioRateOutput:
|
||||
case BufferRate::ControlRateOutput:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -325,7 +325,7 @@ void LadspaEffect::pluginInstantiation()
|
||||
if( p->name.toUpper().contains( "IN" ) &&
|
||||
manager->isPortInput( m_key, port ) )
|
||||
{
|
||||
p->rate = CHANNEL_IN;
|
||||
p->rate = BufferRate::ChannelIn;
|
||||
p->buffer = MM_ALLOC<LADSPA_Data>( Engine::audioEngine()->framesPerPeriod() );
|
||||
inbuf[ inputch ] = p->buffer;
|
||||
inputch++;
|
||||
@@ -333,7 +333,7 @@ void LadspaEffect::pluginInstantiation()
|
||||
else if( p->name.toUpper().contains( "OUT" ) &&
|
||||
manager->isPortOutput( m_key, port ) )
|
||||
{
|
||||
p->rate = CHANNEL_OUT;
|
||||
p->rate = BufferRate::ChannelOut;
|
||||
if( ! m_inPlaceBroken && inbuf[ outputch ] )
|
||||
{
|
||||
p->buffer = inbuf[ outputch ];
|
||||
@@ -347,12 +347,12 @@ void LadspaEffect::pluginInstantiation()
|
||||
}
|
||||
else if( manager->isPortInput( m_key, port ) )
|
||||
{
|
||||
p->rate = AUDIO_RATE_INPUT;
|
||||
p->rate = BufferRate::AudioRateInput;
|
||||
p->buffer = MM_ALLOC<LADSPA_Data>( Engine::audioEngine()->framesPerPeriod() );
|
||||
}
|
||||
else
|
||||
{
|
||||
p->rate = AUDIO_RATE_OUTPUT;
|
||||
p->rate = BufferRate::AudioRateOutput;
|
||||
p->buffer = MM_ALLOC<LADSPA_Data>( Engine::audioEngine()->framesPerPeriod() );
|
||||
}
|
||||
}
|
||||
@@ -362,30 +362,30 @@ void LadspaEffect::pluginInstantiation()
|
||||
|
||||
if( manager->isPortInput( m_key, port ) )
|
||||
{
|
||||
p->rate = CONTROL_RATE_INPUT;
|
||||
p->rate = BufferRate::ControlRateInput;
|
||||
}
|
||||
else
|
||||
{
|
||||
p->rate = CONTROL_RATE_OUTPUT;
|
||||
p->rate = BufferRate::ControlRateOutput;
|
||||
}
|
||||
}
|
||||
|
||||
p->scale = 1.0f;
|
||||
if( manager->isEnum( m_key, port ) )
|
||||
{
|
||||
p->data_type = ENUM;
|
||||
p->data_type = BufferDataType::Enum;
|
||||
}
|
||||
else if( manager->isPortToggled( m_key, port ) )
|
||||
{
|
||||
p->data_type = TOGGLED;
|
||||
p->data_type = BufferDataType::Toggled;
|
||||
}
|
||||
else if( manager->isInteger( m_key, port ) )
|
||||
{
|
||||
p->data_type = INTEGER;
|
||||
p->data_type = BufferDataType::Integer;
|
||||
}
|
||||
else if( p->name.toUpper().contains( "(SECONDS)" ) )
|
||||
{
|
||||
p->data_type = TIME;
|
||||
p->data_type = BufferDataType::Time;
|
||||
p->scale = 1000.0f;
|
||||
int loc = p->name.toUpper().indexOf(
|
||||
"(SECONDS)" );
|
||||
@@ -393,20 +393,20 @@ void LadspaEffect::pluginInstantiation()
|
||||
}
|
||||
else if( p->name.toUpper().contains( "(S)" ) )
|
||||
{
|
||||
p->data_type = TIME;
|
||||
p->data_type = BufferDataType::Time;
|
||||
p->scale = 1000.0f;
|
||||
int loc = p->name.toUpper().indexOf( "(S)" );
|
||||
p->name.replace( loc, 3, "(ms)" );
|
||||
}
|
||||
else if( p->name.toUpper().contains( "(MS)" ) )
|
||||
{
|
||||
p->data_type = TIME;
|
||||
p->data_type = BufferDataType::Time;
|
||||
int loc = p->name.toUpper().indexOf( "(MS)" );
|
||||
p->name.replace( loc, 4, "(ms)" );
|
||||
}
|
||||
else
|
||||
{
|
||||
p->data_type = FLOATING;
|
||||
p->data_type = BufferDataType::Floating;
|
||||
}
|
||||
|
||||
// Get the range and default values.
|
||||
@@ -438,7 +438,7 @@ void LadspaEffect::pluginInstantiation()
|
||||
p->def = manager->getDefaultSetting( m_key, port );
|
||||
if( p->def == NOHINT )
|
||||
{
|
||||
if( p->data_type != TOGGLED )
|
||||
if( p->data_type != BufferDataType::Toggled )
|
||||
{
|
||||
p->def = ( p->min + p->max ) / 2.0f;
|
||||
}
|
||||
@@ -465,8 +465,8 @@ void LadspaEffect::pluginInstantiation()
|
||||
|
||||
// For convenience, keep a separate list of the ports that are used
|
||||
// to control the processors.
|
||||
if( p->rate == AUDIO_RATE_INPUT ||
|
||||
p->rate == CONTROL_RATE_INPUT )
|
||||
if( p->rate == BufferRate::AudioRateInput ||
|
||||
p->rate == BufferRate::ControlRateInput )
|
||||
{
|
||||
p->control_id = m_portControls.count();
|
||||
m_portControls.append( p );
|
||||
@@ -555,7 +555,7 @@ void LadspaEffect::pluginDestruction()
|
||||
for( int port = 0; port < m_portCount; port++ )
|
||||
{
|
||||
port_desc_t * pp = m_ports.at( proc ).at( port );
|
||||
if( m_inPlaceBroken || pp->rate != CHANNEL_OUT )
|
||||
if( m_inPlaceBroken || pp->rate != BufferRate::ChannelOut )
|
||||
{
|
||||
if( pp->buffer) MM_FREE( pp->buffer );
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace lmms
|
||||
{
|
||||
|
||||
|
||||
LadspaSubPluginFeatures::LadspaSubPluginFeatures( Plugin::PluginTypes _type ) :
|
||||
LadspaSubPluginFeatures::LadspaSubPluginFeatures( Plugin::Type _type ) :
|
||||
SubPluginFeatures( _type )
|
||||
{
|
||||
}
|
||||
@@ -137,17 +137,17 @@ void LadspaSubPluginFeatures::listSubPluginKeys(
|
||||
l_sortable_plugin_t plugins;
|
||||
switch( m_type )
|
||||
{
|
||||
case Plugin::Instrument:
|
||||
case Plugin::Type::Instrument:
|
||||
plugins = lm->getInstruments();
|
||||
break;
|
||||
case Plugin::Effect:
|
||||
case Plugin::Type::Effect:
|
||||
plugins = lm->getValidEffects();
|
||||
//plugins += lm->getInvalidEffects();
|
||||
break;
|
||||
case Plugin::Tool:
|
||||
case Plugin::Type::Tool:
|
||||
plugins = lm->getAnalysisTools();
|
||||
break;
|
||||
case Plugin::Other:
|
||||
case Plugin::Type::Other:
|
||||
plugins = lm->getOthers();
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace lmms
|
||||
class LadspaSubPluginFeatures : public Plugin::Descriptor::SubPluginFeatures
|
||||
{
|
||||
public:
|
||||
LadspaSubPluginFeatures( Plugin::PluginTypes _type );
|
||||
LadspaSubPluginFeatures( Plugin::Type _type );
|
||||
|
||||
QString displayName(const Key& k) const override;
|
||||
void fillDescriptionWidget( QWidget * _parent,
|
||||
|
||||
@@ -53,7 +53,7 @@ class DescriptorStub
|
||||
PortCount = 0;
|
||||
}
|
||||
|
||||
~DescriptorStub()
|
||||
virtual ~DescriptorStub()
|
||||
{
|
||||
if (PortCount)
|
||||
{
|
||||
@@ -87,6 +87,7 @@ class Descriptor
|
||||
|
||||
public:
|
||||
Descriptor() { setup(); }
|
||||
~Descriptor() override = default;
|
||||
void setup();
|
||||
|
||||
void autogen()
|
||||
|
||||
Submodule plugins/LadspaEffect/cmt/cmt updated: f7c25ed4ef...6e6e291fba
@@ -86,7 +86,7 @@ Plugin::Descriptor PLUGIN_EXPORT lb302_plugin_descriptor =
|
||||
"Incomplete monophonic imitation TB-303" ),
|
||||
"Paul Giblock <pgib/at/users.sf.net>",
|
||||
0x0100,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -290,7 +290,7 @@ Lb302Synth::Lb302Synth( InstrumentTrack * _instrumentTrack ) :
|
||||
vca_decay(0.99897516),
|
||||
vca_a0(0.5),
|
||||
vca_a(0.),
|
||||
vca_mode(never_played)
|
||||
vca_mode(VcaMode::NeverPlayed)
|
||||
{
|
||||
|
||||
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ),
|
||||
@@ -332,7 +332,7 @@ Lb302Synth::Lb302Synth( InstrumentTrack * _instrumentTrack ) :
|
||||
|
||||
vcf_envpos = ENVINC;
|
||||
|
||||
vco_shape = BL_SAWTOOTH;
|
||||
vco_shape = VcoShape::BLSawtooth;
|
||||
|
||||
vcfs[0] = new Lb302FilterIIR2(&fs);
|
||||
vcfs[1] = new Lb302Filter3Pole(&fs);
|
||||
@@ -469,7 +469,7 @@ int Lb302Synth::process(sampleFrame *outbuf, const int size)
|
||||
|
||||
if( release_frame == 0 || ! m_playingNote )
|
||||
{
|
||||
vca_mode = decay;
|
||||
vca_mode = VcaMode::Decay;
|
||||
}
|
||||
|
||||
if( new_freq )
|
||||
@@ -493,7 +493,7 @@ int Lb302Synth::process(sampleFrame *outbuf, const int size)
|
||||
// start decay if we're past release
|
||||
if( i >= release_frame )
|
||||
{
|
||||
vca_mode = decay;
|
||||
vca_mode = VcaMode::Decay;
|
||||
}
|
||||
|
||||
// update vcf
|
||||
@@ -523,43 +523,43 @@ int Lb302Synth::process(sampleFrame *outbuf, const int size)
|
||||
vco_c -= 1.0;
|
||||
|
||||
switch(int(rint(wave_shape.value()))) {
|
||||
case 0: vco_shape = SAWTOOTH; break;
|
||||
case 1: vco_shape = TRIANGLE; break;
|
||||
case 2: vco_shape = SQUARE; break;
|
||||
case 3: vco_shape = ROUND_SQUARE; break;
|
||||
case 4: vco_shape = MOOG; break;
|
||||
case 5: vco_shape = SINE; break;
|
||||
case 6: vco_shape = EXPONENTIAL; break;
|
||||
case 7: vco_shape = WHITE_NOISE; break;
|
||||
case 8: vco_shape = BL_SAWTOOTH; break;
|
||||
case 9: vco_shape = BL_SQUARE; break;
|
||||
case 10: vco_shape = BL_TRIANGLE; break;
|
||||
case 11: vco_shape = BL_MOOG; break;
|
||||
default: vco_shape = SAWTOOTH; break;
|
||||
case 0: vco_shape = VcoShape::Sawtooth; break;
|
||||
case 1: vco_shape = VcoShape::Triangle; break;
|
||||
case 2: vco_shape = VcoShape::Square; break;
|
||||
case 3: vco_shape = VcoShape::RoundSquare; break;
|
||||
case 4: vco_shape = VcoShape::Moog; break;
|
||||
case 5: vco_shape = VcoShape::Sine; break;
|
||||
case 6: vco_shape = VcoShape::Exponential; break;
|
||||
case 7: vco_shape = VcoShape::WhiteNoise; break;
|
||||
case 8: vco_shape = VcoShape::BLSawtooth; break;
|
||||
case 9: vco_shape = VcoShape::BLSquare; break;
|
||||
case 10: vco_shape = VcoShape::BLTriangle; break;
|
||||
case 11: vco_shape = VcoShape::BLMoog; break;
|
||||
default: vco_shape = VcoShape::Sawtooth; break;
|
||||
}
|
||||
|
||||
// add vco_shape_param the changes the shape of each curve.
|
||||
// merge sawtooths with triangle and square with round square?
|
||||
switch (vco_shape) {
|
||||
case SAWTOOTH: // p0: curviness of line
|
||||
case VcoShape::Sawtooth: // p0: curviness of line
|
||||
vco_k = vco_c; // Is this sawtooth backwards?
|
||||
break;
|
||||
|
||||
case TRIANGLE: // p0: duty rev.saw<->triangle<->saw p1: curviness
|
||||
case VcoShape::Triangle: // p0: duty rev.saw<->triangle<->saw p1: curviness
|
||||
vco_k = (vco_c*2.0)+0.5;
|
||||
if (vco_k>0.5)
|
||||
vco_k = 1.0- vco_k;
|
||||
break;
|
||||
|
||||
case SQUARE: // p0: slope of top
|
||||
case VcoShape::Square: // p0: slope of top
|
||||
vco_k = (vco_c<0)?0.5:-0.5;
|
||||
break;
|
||||
|
||||
case ROUND_SQUARE: // p0: width of round
|
||||
case VcoShape::RoundSquare: // p0: width of round
|
||||
vco_k = (vco_c<0)?(sqrtf(1-(vco_c*vco_c*4))-0.5):-0.5;
|
||||
break;
|
||||
|
||||
case MOOG: // Maybe the fall should be exponential/sinsoidal instead of quadric.
|
||||
case VcoShape::Moog: // Maybe the fall should be exponential/sinsoidal instead of quadric.
|
||||
// [-0.5, 0]: Rise, [0,0.25]: Slope down, [0.25,0.5]: Low
|
||||
vco_k = (vco_c*2.0)+0.5;
|
||||
if (vco_k>1.0) {
|
||||
@@ -572,33 +572,33 @@ int Lb302Synth::process(sampleFrame *outbuf, const int size)
|
||||
vco_k *= 2.0; // MOOG wave gets filtered away
|
||||
break;
|
||||
|
||||
case SINE:
|
||||
case VcoShape::Sine:
|
||||
// [-0.5, 0.5] : [-pi, pi]
|
||||
vco_k = 0.5f * Oscillator::sinSample( vco_c );
|
||||
break;
|
||||
|
||||
case EXPONENTIAL:
|
||||
case VcoShape::Exponential:
|
||||
vco_k = 0.5 * Oscillator::expSample( vco_c );
|
||||
break;
|
||||
|
||||
case WHITE_NOISE:
|
||||
case VcoShape::WhiteNoise:
|
||||
vco_k = 0.5 * Oscillator::noiseSample( vco_c );
|
||||
break;
|
||||
|
||||
case BL_SAWTOOTH:
|
||||
vco_k = BandLimitedWave::oscillate( vco_c + 0.5f, BandLimitedWave::pdToLen( vco_inc ), BandLimitedWave::BLSaw ) * 0.5f;
|
||||
case VcoShape::BLSawtooth:
|
||||
vco_k = BandLimitedWave::oscillate( vco_c + 0.5f, BandLimitedWave::pdToLen( vco_inc ), BandLimitedWave::Waveform::BLSaw ) * 0.5f;
|
||||
break;
|
||||
|
||||
case BL_SQUARE:
|
||||
vco_k = BandLimitedWave::oscillate( vco_c + 0.5f, BandLimitedWave::pdToLen( vco_inc ), BandLimitedWave::BLSquare ) * 0.5f;
|
||||
case VcoShape::BLSquare:
|
||||
vco_k = BandLimitedWave::oscillate( vco_c + 0.5f, BandLimitedWave::pdToLen( vco_inc ), BandLimitedWave::Waveform::BLSquare ) * 0.5f;
|
||||
break;
|
||||
|
||||
case BL_TRIANGLE:
|
||||
vco_k = BandLimitedWave::oscillate( vco_c + 0.5f, BandLimitedWave::pdToLen( vco_inc ), BandLimitedWave::BLTriangle ) * 0.5f;
|
||||
case VcoShape::BLTriangle:
|
||||
vco_k = BandLimitedWave::oscillate( vco_c + 0.5f, BandLimitedWave::pdToLen( vco_inc ), BandLimitedWave::Waveform::BLTriangle ) * 0.5f;
|
||||
break;
|
||||
|
||||
case BL_MOOG:
|
||||
vco_k = BandLimitedWave::oscillate( vco_c + 0.5f, BandLimitedWave::pdToLen( vco_inc ), BandLimitedWave::BLMoog );
|
||||
case VcoShape::BLMoog:
|
||||
vco_k = BandLimitedWave::oscillate( vco_c + 0.5f, BandLimitedWave::pdToLen( vco_inc ), BandLimitedWave::Waveform::BLMoog );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -633,18 +633,18 @@ int Lb302Synth::process(sampleFrame *outbuf, const int size)
|
||||
}
|
||||
|
||||
// Handle Envelope
|
||||
if(vca_mode==attack) {
|
||||
if(vca_mode==VcaMode::Attack) {
|
||||
vca_a+=(vca_a0-vca_a)*vca_attack;
|
||||
if(sample_cnt>=0.5*Engine::audioEngine()->processingSampleRate())
|
||||
vca_mode = idle;
|
||||
vca_mode = VcaMode::Idle;
|
||||
}
|
||||
else if(vca_mode == decay) {
|
||||
else if(vca_mode == VcaMode::Decay) {
|
||||
vca_a *= vca_decay;
|
||||
|
||||
// the following line actually speeds up processing
|
||||
if(vca_a < (1/65536.0)) {
|
||||
vca_a = 0;
|
||||
vca_mode = never_played;
|
||||
vca_mode = VcaMode::NeverPlayed;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -666,15 +666,15 @@ void Lb302Synth::initNote( Lb302Note *n)
|
||||
|
||||
// Always reset vca on non-dead notes, and
|
||||
// Only reset vca on decaying(decayed) and never-played
|
||||
if(n->dead == 0 || (vca_mode == decay || vca_mode == never_played)) {
|
||||
if(n->dead == 0 || (vca_mode == VcaMode::Decay || vca_mode == VcaMode::NeverPlayed)) {
|
||||
//printf(" good\n");
|
||||
sample_cnt = 0;
|
||||
vca_mode = attack;
|
||||
vca_mode = VcaMode::Attack;
|
||||
// LB303:
|
||||
//vca_a = 0;
|
||||
}
|
||||
else {
|
||||
vca_mode = idle;
|
||||
vca_mode = VcaMode::Idle;
|
||||
}
|
||||
|
||||
initSlide();
|
||||
@@ -746,7 +746,7 @@ void Lb302Synth::playNote( NotePlayHandle * _n, sampleFrame * _working_buffer )
|
||||
void Lb302Synth::processNote( NotePlayHandle * _n )
|
||||
{
|
||||
/// Start a new note.
|
||||
if( _n->m_pluginData != this )
|
||||
if (_n->m_pluginData != this)
|
||||
{
|
||||
m_playingNote = _n;
|
||||
new_freq = true;
|
||||
@@ -819,22 +819,22 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
|
||||
InstrumentViewFixedSize( _instrument, _parent )
|
||||
{
|
||||
// GUI
|
||||
m_vcfCutKnob = new Knob( knobBright_26, this );
|
||||
m_vcfCutKnob = new Knob( KnobType::Bright26, this );
|
||||
m_vcfCutKnob->move( 75, 130 );
|
||||
m_vcfCutKnob->setHintText( tr( "Cutoff Freq:" ), "" );
|
||||
m_vcfCutKnob->setLabel( "" );
|
||||
|
||||
m_vcfResKnob = new Knob( knobBright_26, this );
|
||||
m_vcfResKnob = new Knob( KnobType::Bright26, this );
|
||||
m_vcfResKnob->move( 120, 130 );
|
||||
m_vcfResKnob->setHintText( tr( "Resonance:" ), "" );
|
||||
m_vcfResKnob->setLabel( "" );
|
||||
|
||||
m_vcfModKnob = new Knob( knobBright_26, this );
|
||||
m_vcfModKnob = new Knob( KnobType::Bright26, this );
|
||||
m_vcfModKnob->move( 165, 130 );
|
||||
m_vcfModKnob->setHintText( tr( "Env Mod:" ), "" );
|
||||
m_vcfModKnob->setLabel( "" );
|
||||
|
||||
m_vcfDecKnob = new Knob( knobBright_26, this );
|
||||
m_vcfDecKnob = new Knob( KnobType::Bright26, this );
|
||||
m_vcfDecKnob->move( 210, 130 );
|
||||
m_vcfDecKnob->setHintText( tr( "Decay:" ), "" );
|
||||
m_vcfDecKnob->setLabel( "" );
|
||||
@@ -855,12 +855,12 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
|
||||
tr( "303-es-que, 24dB/octave, 3 pole filter" ) );
|
||||
|
||||
|
||||
m_slideDecKnob = new Knob( knobBright_26, this );
|
||||
m_slideDecKnob = new Knob( KnobType::Bright26, this );
|
||||
m_slideDecKnob->move( 210, 75 );
|
||||
m_slideDecKnob->setHintText( tr( "Slide Decay:" ), "" );
|
||||
m_slideDecKnob->setLabel( "");
|
||||
|
||||
m_distKnob = new Knob( knobBright_26, this );
|
||||
m_distKnob = new Knob( KnobType::Bright26, this );
|
||||
m_distKnob->move( 210, 190 );
|
||||
m_distKnob->setHintText( tr( "DIST:" ), "" );
|
||||
m_distKnob->setLabel( tr( ""));
|
||||
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
|
||||
Flags flags() const override
|
||||
{
|
||||
return IsSingleStreamed;
|
||||
return Flag::IsSingleStreamed;
|
||||
}
|
||||
|
||||
f_cnt_t desiredReleaseFrames() const override
|
||||
@@ -213,9 +213,9 @@ private:
|
||||
vco_slideinc, //* Slide base to use in next node. Nonzero=slide next note
|
||||
vco_slidebase; //* The base vco_inc while sliding.
|
||||
|
||||
enum vco_shape_t { SAWTOOTH, SQUARE, TRIANGLE, MOOG, ROUND_SQUARE, SINE, EXPONENTIAL, WHITE_NOISE,
|
||||
BL_SAWTOOTH, BL_SQUARE, BL_TRIANGLE, BL_MOOG };
|
||||
vco_shape_t vco_shape;
|
||||
enum class VcoShape { Sawtooth, Square, Triangle, Moog, RoundSquare, Sine, Exponential, WhiteNoise,
|
||||
BLSawtooth, BLSquare, BLTriangle, BLMoog };
|
||||
VcoShape vco_shape;
|
||||
|
||||
// Filters (just keep both loaded and switch)
|
||||
Lb302Filter* vcfs[NUM_FILTERS];
|
||||
@@ -235,14 +235,14 @@ private:
|
||||
vca_a; // Amplifier coefficient.
|
||||
|
||||
// Envelope State
|
||||
enum VCA_Mode
|
||||
enum class VcaMode
|
||||
{
|
||||
attack = 0,
|
||||
decay = 1,
|
||||
idle = 2,
|
||||
never_played = 3
|
||||
Attack = 0,
|
||||
Decay = 1,
|
||||
Idle = 2,
|
||||
NeverPlayed = 3
|
||||
};
|
||||
VCA_Mode vca_mode;
|
||||
VcaMode vca_mode;
|
||||
|
||||
// My hacks
|
||||
int sample_cnt;
|
||||
|
||||
@@ -46,10 +46,10 @@ Plugin::Descriptor PLUGIN_EXPORT lv2effect_plugin_descriptor =
|
||||
"plugin for using arbitrary LV2-effects inside LMMS."),
|
||||
"Johannes Lorenz <jlsf2013$$$users.sourceforge.net, $$$=@>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader("logo"),
|
||||
nullptr,
|
||||
new Lv2SubPluginFeatures(Plugin::Effect)
|
||||
new Lv2SubPluginFeatures(Plugin::Type::Effect)
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -55,10 +55,10 @@ Plugin::Descriptor PLUGIN_EXPORT lv2instrument_plugin_descriptor =
|
||||
"plugin for using arbitrary LV2 instruments inside LMMS."),
|
||||
"Johannes Lorenz <jlsf2013$$$users.sourceforge.net, $$$=@>",
|
||||
0x0100,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader("logo"),
|
||||
nullptr,
|
||||
new Lv2SubPluginFeatures(Plugin::Instrument)
|
||||
new Lv2SubPluginFeatures(Plugin::Type::Instrument)
|
||||
};
|
||||
|
||||
}
|
||||
@@ -97,7 +97,7 @@ Lv2Instrument::Lv2Instrument(InstrumentTrack *instrumentTrackArg,
|
||||
Lv2Instrument::~Lv2Instrument()
|
||||
{
|
||||
Engine::audioEngine()->removePlayHandlesOfTypes(instrumentTrack(),
|
||||
PlayHandle::TypeNotePlayHandle | PlayHandle::TypeInstrumentPlayHandle);
|
||||
PlayHandle::Type::NotePlayHandle | PlayHandle::Type::InstrumentPlayHandle);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -89,9 +89,9 @@ public:
|
||||
Flags flags() const override
|
||||
{
|
||||
#ifdef LV2_INSTRUMENT_USE_MIDI
|
||||
return IsSingleStreamed | IsMidiBased;
|
||||
return Flag::IsSingleStreamed | Flag::IsMidiBased;
|
||||
#else
|
||||
return IsSingleStreamed;
|
||||
return Flag::IsSingleStreamed;
|
||||
#endif
|
||||
}
|
||||
gui::PluginView* instantiateView(QWidget *parent) override;
|
||||
|
||||
@@ -51,7 +51,7 @@ Plugin::Descriptor PLUGIN_EXPORT midiexport_plugin_descriptor =
|
||||
"Mohamed Abdel Maksoud <mohamed at amaksoud.com> and "
|
||||
"Hyunjin Song <tteu.ingog/at/gmail.com>",
|
||||
0x0100,
|
||||
Plugin::ExportFilter,
|
||||
Plugin::Type::ExportFilter,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -84,8 +84,8 @@ bool MidiExport::tryExport(const TrackContainer::TrackList &tracks,
|
||||
auto buffer = std::array<uint8_t, BUFFER_SIZE>{};
|
||||
uint32_t size;
|
||||
|
||||
for (const Track* track : tracks) if (track->type() == Track::InstrumentTrack) nTracks++;
|
||||
for (const Track* track : patternStoreTracks) if (track->type() == Track::InstrumentTrack) nTracks++;
|
||||
for (const Track* track : tracks) if (track->type() == Track::Type::Instrument) nTracks++;
|
||||
for (const Track* track : patternStoreTracks) if (track->type() == Track::Type::Instrument) nTracks++;
|
||||
|
||||
// midi header
|
||||
MidiFile::MIDIHeader header(nTracks);
|
||||
@@ -97,10 +97,10 @@ bool MidiExport::tryExport(const TrackContainer::TrackList &tracks,
|
||||
// midi tracks
|
||||
for (Track* track : tracks)
|
||||
{
|
||||
DataFile dataFile(DataFile::SongProject);
|
||||
DataFile dataFile(DataFile::Type::SongProject);
|
||||
MTrack mtrack;
|
||||
|
||||
if (track->type() == Track::InstrumentTrack)
|
||||
if (track->type() == Track::Type::Instrument)
|
||||
{
|
||||
|
||||
mtrack.addName(track->name().toStdString(), 0);
|
||||
@@ -143,7 +143,7 @@ bool MidiExport::tryExport(const TrackContainer::TrackList &tracks,
|
||||
midiout.writeRawData((char *)buffer.data(), size);
|
||||
}
|
||||
|
||||
if (track->type() == Track::PatternTrack)
|
||||
if (track->type() == Track::Type::Pattern)
|
||||
{
|
||||
patternTrack = dynamic_cast<PatternTrack*>(track);
|
||||
element = patternTrack->saveState(dataFile, dataFile.content());
|
||||
@@ -169,7 +169,7 @@ bool MidiExport::tryExport(const TrackContainer::TrackList &tracks,
|
||||
// for each instrument in the pattern editor
|
||||
for (Track* track : patternStoreTracks)
|
||||
{
|
||||
DataFile dataFile(DataFile::SongProject);
|
||||
DataFile dataFile(DataFile::Type::SongProject);
|
||||
MTrack mtrack;
|
||||
|
||||
// begin at the first pattern track (first pattern)
|
||||
@@ -177,7 +177,7 @@ bool MidiExport::tryExport(const TrackContainer::TrackList &tracks,
|
||||
|
||||
std::vector<std::pair<int,int>> st;
|
||||
|
||||
if (track->type() != Track::InstrumentTrack) continue;
|
||||
if (track->type() != Track::Type::Instrument) continue;
|
||||
|
||||
mtrack.addName(track->name().toStdString(), 0);
|
||||
//mtrack.addProgramChange(0, 0);
|
||||
|
||||
@@ -71,7 +71,7 @@ Plugin::Descriptor PLUGIN_EXPORT midiimport_plugin_descriptor =
|
||||
"Filter for importing MIDI-files into LMMS" ),
|
||||
"Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>",
|
||||
0x0100,
|
||||
Plugin::ImportFilter,
|
||||
Plugin::Type::ImportFilter,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
// in the main thread. This should probably be
|
||||
// removed if that ever changes.
|
||||
qApp->processEvents();
|
||||
at = dynamic_cast<AutomationTrack *>( Track::create( Track::AutomationTrack, tc ) );
|
||||
at = dynamic_cast<AutomationTrack *>( Track::create( Track::Type::Automation, tc ) );
|
||||
}
|
||||
if( tn != "") {
|
||||
at->setName( tn );
|
||||
@@ -227,7 +227,7 @@ public:
|
||||
if( !it ) {
|
||||
// Keep LMMS responsive
|
||||
qApp->processEvents();
|
||||
it = dynamic_cast<InstrumentTrack *>( Track::create( Track::InstrumentTrack, tc ) );
|
||||
it = dynamic_cast<InstrumentTrack *>( Track::create( Track::Type::Instrument, tc ) );
|
||||
|
||||
#ifdef LMMS_HAVE_FLUIDSYNTH
|
||||
it_inst = it->loadInstrument( "sf2player" );
|
||||
@@ -328,9 +328,9 @@ bool MidiImport::readSMF( TrackContainer* tc )
|
||||
// NOTE: unordered_map::operator[] creates a new element if none exists
|
||||
|
||||
MeterModel & timeSigMM = Engine::getSong()->getTimeSigModel();
|
||||
auto nt = dynamic_cast<AutomationTrack*>(Track::create(Track::AutomationTrack, Engine::getSong()));
|
||||
auto nt = dynamic_cast<AutomationTrack*>(Track::create(Track::Type::Automation, Engine::getSong()));
|
||||
nt->setName(tr("MIDI Time Signature Numerator"));
|
||||
auto dt = dynamic_cast<AutomationTrack*>(Track::create(Track::AutomationTrack, Engine::getSong()));
|
||||
auto dt = dynamic_cast<AutomationTrack*>(Track::create(Track::Type::Automation, Engine::getSong()));
|
||||
dt->setName(tr("MIDI Time Signature Denominator"));
|
||||
auto timeSigNumeratorPat = new AutomationClip(nt);
|
||||
timeSigNumeratorPat->setDisplayName(tr("Numerator"));
|
||||
@@ -358,7 +358,7 @@ bool MidiImport::readSMF( TrackContainer* tc )
|
||||
pd.setValue( 2 );
|
||||
|
||||
// Tempo stuff
|
||||
auto tt = dynamic_cast<AutomationTrack*>(Track::create(Track::AutomationTrack, Engine::getSong()));
|
||||
auto tt = dynamic_cast<AutomationTrack*>(Track::create(Track::Type::Automation, Engine::getSong()));
|
||||
tt->setName(tr("Tempo"));
|
||||
auto tap = new AutomationClip(tt);
|
||||
tap->setDisplayName(tr("Tempo"));
|
||||
|
||||
@@ -53,7 +53,7 @@ Plugin::Descriptor PLUGIN_EXPORT monstro_plugin_descriptor =
|
||||
"Monstrous 3-oscillator synth with modulation matrix" ),
|
||||
"Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>",
|
||||
0x0100,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -1030,7 +1030,7 @@ void MonstroInstrument::playNote( NotePlayHandle * _n,
|
||||
const fpp_t frames = _n->framesLeftForCurrentPeriod();
|
||||
const f_cnt_t offset = _n->noteOffset();
|
||||
|
||||
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == nullptr )
|
||||
if (!_n->m_pluginData)
|
||||
{
|
||||
_n->m_pluginData = new MonstroSynth( this, _n );
|
||||
}
|
||||
|
||||
@@ -43,14 +43,14 @@
|
||||
//
|
||||
|
||||
#define makeknob( name, x, y, hint, unit, oname ) \
|
||||
name = new Knob( knobStyled, view ); \
|
||||
name = new Knob( KnobType::Styled, view ); \
|
||||
name ->move( x, y ); \
|
||||
name ->setHintText( hint, unit ); \
|
||||
name ->setObjectName( oname ); \
|
||||
name ->setFixedSize( 20, 20 );
|
||||
|
||||
#define maketsknob( name, x, y, hint, unit, oname ) \
|
||||
name = new TempoSyncKnob( knobStyled, view ); \
|
||||
name = new TempoSyncKnob( KnobType::Styled, view ); \
|
||||
name ->move( x, y ); \
|
||||
name ->setHintText( hint, unit ); \
|
||||
name ->setObjectName( oname ); \
|
||||
@@ -211,19 +211,19 @@ private:
|
||||
break;
|
||||
case WAVE_TRI:
|
||||
//return Oscillator::triangleSample( _ph );
|
||||
return BandLimitedWave::oscillate( _ph, _wavelen, BandLimitedWave::BLTriangle );
|
||||
return BandLimitedWave::oscillate( _ph, _wavelen, BandLimitedWave::Waveform::BLTriangle );
|
||||
break;
|
||||
case WAVE_SAW:
|
||||
//return Oscillator::sawSample( _ph );
|
||||
return BandLimitedWave::oscillate( _ph, _wavelen, BandLimitedWave::BLSaw );
|
||||
return BandLimitedWave::oscillate( _ph, _wavelen, BandLimitedWave::Waveform::BLSaw );
|
||||
break;
|
||||
case WAVE_RAMP:
|
||||
//return Oscillator::sawSample( _ph ) * -1.0;
|
||||
return BandLimitedWave::oscillate( _ph, _wavelen, BandLimitedWave::BLSaw ) * -1.0;
|
||||
return BandLimitedWave::oscillate( _ph, _wavelen, BandLimitedWave::Waveform::BLSaw ) * -1.0;
|
||||
break;
|
||||
case WAVE_SQR:
|
||||
//return Oscillator::squareSample( _ph );
|
||||
return BandLimitedWave::oscillate( _ph, _wavelen, BandLimitedWave::BLSquare );
|
||||
return BandLimitedWave::oscillate( _ph, _wavelen, BandLimitedWave::Waveform::BLSquare );
|
||||
break;
|
||||
case WAVE_SQRSOFT:
|
||||
{
|
||||
@@ -236,7 +236,7 @@ private:
|
||||
}
|
||||
case WAVE_MOOG:
|
||||
//return Oscillator::moogSawSample( _ph );
|
||||
return BandLimitedWave::oscillate( _ph, _wavelen, BandLimitedWave::BLMoog );
|
||||
return BandLimitedWave::oscillate( _ph, _wavelen, BandLimitedWave::Waveform::BLMoog );
|
||||
break;
|
||||
case WAVE_SINABS:
|
||||
return qAbs( Oscillator::sinSample( _ph ) );
|
||||
|
||||
@@ -41,7 +41,7 @@ Plugin::Descriptor PLUGIN_EXPORT multitapecho_plugin_descriptor =
|
||||
QT_TRANSLATE_NOOP( "PluginBrowser", "A multitap echo delay plugin" ),
|
||||
"Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
||||
@@ -48,8 +48,8 @@ MultitapEchoControlDialog::MultitapEchoControlDialog( MultitapEchoControls * con
|
||||
|
||||
// graph widgets
|
||||
|
||||
auto ampGraph = new Graph(this, Graph::BarStyle, 204, 105);
|
||||
auto lpGraph = new Graph(this, Graph::BarStyle, 204, 105);
|
||||
auto ampGraph = new Graph(this, Graph::Style::Bar, 204, 105);
|
||||
auto lpGraph = new Graph(this, Graph::Style::Bar, 204, 105);
|
||||
|
||||
ampGraph->move( 30, 10 );
|
||||
lpGraph->move( 30, 125 );
|
||||
@@ -78,26 +78,26 @@ MultitapEchoControlDialog::MultitapEchoControlDialog( MultitapEchoControls * con
|
||||
|
||||
// knobs
|
||||
|
||||
auto stepLength = new TempoSyncKnob(knobBright_26, this);
|
||||
auto stepLength = new TempoSyncKnob(KnobType::Bright26, this);
|
||||
stepLength->move( 100, 245 );
|
||||
stepLength->setModel( & controls->m_stepLength );
|
||||
stepLength->setLabel( tr( "Length" ) );
|
||||
stepLength->setHintText( tr( "Step length:" ) , " ms" );
|
||||
|
||||
auto dryGain = new Knob(knobBright_26, this);
|
||||
auto dryGain = new Knob(KnobType::Bright26, this);
|
||||
dryGain->move( 150, 245 );
|
||||
dryGain->setModel( & controls->m_dryGain );
|
||||
dryGain->setLabel( tr( "Dry" ) );
|
||||
dryGain->setHintText( tr( "Dry gain:" ) , " dBFS" );
|
||||
|
||||
auto stages = new Knob(knobBright_26, this);
|
||||
auto stages = new Knob(KnobType::Bright26, this);
|
||||
stages->move( 200, 245 );
|
||||
stages->setModel( & controls->m_stages );
|
||||
stages->setLabel( tr( "Stages" ) );
|
||||
stages->setHintText( tr( "Low-pass stages:" ) , "x" );
|
||||
// switch led
|
||||
|
||||
auto swapInputs = new LedCheckBox("Swap inputs", this, tr("Swap inputs"), LedCheckBox::Green);
|
||||
auto swapInputs = new LedCheckBox("Swap inputs", this, tr("Swap inputs"), LedCheckBox::LedColor::Green);
|
||||
swapInputs->move( 20, 275 );
|
||||
swapInputs->setModel( & controls->m_swapInputs );
|
||||
swapInputs->setToolTip(tr("Swap left and right input channels for reflections"));
|
||||
|
||||
@@ -51,7 +51,7 @@ Plugin::Descriptor PLUGIN_EXPORT nes_plugin_descriptor =
|
||||
"A NES-like synthesizer" ),
|
||||
"Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>",
|
||||
0x0100,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -550,7 +550,7 @@ void NesInstrument::playNote( NotePlayHandle * n, sampleFrame * workingBuffer )
|
||||
const fpp_t frames = n->framesLeftForCurrentPeriod();
|
||||
const f_cnt_t offset = n->noteOffset();
|
||||
|
||||
if ( n->totalFramesPlayed() == 0 || n->m_pluginData == nullptr )
|
||||
if (!n->m_pluginData)
|
||||
{
|
||||
auto nes = new NesObject(this, Engine::audioEngine()->processingSampleRate(), n);
|
||||
n->m_pluginData = nes;
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
|
||||
#define makeknob( name, x, y, hint, unit, oname ) \
|
||||
name = new Knob( knobStyled, this ); \
|
||||
name = new Knob( KnobType::Styled, this ); \
|
||||
name ->move( x, y ); \
|
||||
name ->setHintText( hint, unit ); \
|
||||
name ->setObjectName( oname ); \
|
||||
|
||||
@@ -73,7 +73,7 @@ Plugin::Descriptor PLUGIN_EXPORT opulenz_plugin_descriptor =
|
||||
"2-operator FM Synth" ),
|
||||
"Raine M. Ekman <raine/at/iki/fi>",
|
||||
0x0100,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
"sbi",
|
||||
nullptr,
|
||||
@@ -222,8 +222,8 @@ OpulenzInstrument::OpulenzInstrument( InstrumentTrack * _instrument_track ) :
|
||||
OpulenzInstrument::~OpulenzInstrument() {
|
||||
delete theEmulator;
|
||||
Engine::audioEngine()->removePlayHandlesOfTypes( instrumentTrack(),
|
||||
PlayHandle::TypeNotePlayHandle
|
||||
| PlayHandle::TypeInstrumentPlayHandle );
|
||||
PlayHandle::Type::NotePlayHandle
|
||||
| PlayHandle::Type::InstrumentPlayHandle );
|
||||
delete [] renderbuffer;
|
||||
}
|
||||
|
||||
@@ -686,7 +686,7 @@ OpulenzInstrumentView::OpulenzInstrumentView( Instrument * _instrument,
|
||||
{
|
||||
|
||||
#define KNOB_GEN(knobname, hinttext, hintunit,xpos,ypos) \
|
||||
knobname = new Knob( knobStyled, this );\
|
||||
knobname = new Knob( KnobType::Styled, this );\
|
||||
knobname->setHintText( tr(hinttext), hintunit );\
|
||||
knobname->setFixedSize(22,22);\
|
||||
knobname->setCenterPointX(11.0);\
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
|
||||
Flags flags() const override
|
||||
{
|
||||
return IsSingleStreamed | IsMidiBased;
|
||||
return Flag::IsSingleStreamed | Flag::IsMidiBased;
|
||||
}
|
||||
|
||||
bool handleMidiEvent( const MidiEvent& event, const TimePos& time, f_cnt_t offset = 0 ) override;
|
||||
|
||||
@@ -22,13 +22,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "Organic.h"
|
||||
|
||||
|
||||
#include <QDomElement>
|
||||
|
||||
|
||||
#include "Engine.h"
|
||||
#include "AudioEngine.h"
|
||||
#include "InstrumentTrack.h"
|
||||
@@ -38,7 +35,6 @@
|
||||
#include "PixmapButton.h"
|
||||
|
||||
#include "embed.h"
|
||||
|
||||
#include "plugin_export.h"
|
||||
|
||||
namespace lmms
|
||||
@@ -56,7 +52,7 @@ Plugin::Descriptor PLUGIN_EXPORT organic_plugin_descriptor =
|
||||
"Additive Synthesizer for organ-like sounds" ),
|
||||
"Andreas Brandmaier <andreas/at/brandmaier.de>",
|
||||
0x0100,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -78,7 +74,9 @@ float * OrganicInstrument::s_harmonics = nullptr;
|
||||
|
||||
OrganicInstrument::OrganicInstrument( InstrumentTrack * _instrument_track ) :
|
||||
Instrument( _instrument_track, &organic_plugin_descriptor ),
|
||||
m_modulationAlgo( Oscillator::SignalMix, Oscillator::SignalMix, Oscillator::SignalMix),
|
||||
m_modulationAlgo(static_cast<int>(Oscillator::ModulationAlgo::SignalMix),
|
||||
static_cast<int>(Oscillator::ModulationAlgo::SignalMix),
|
||||
static_cast<int>(Oscillator::ModulationAlgo::SignalMix)),
|
||||
m_fx1Model( 0.0f, 0.0f, 0.99f, 0.01f , this, tr( "Distortion" ) ),
|
||||
m_volModel( 100.0f, 0.0f, 200.0f, 1.0f, this, tr( "Volume" ) )
|
||||
{
|
||||
@@ -159,61 +157,59 @@ OrganicInstrument::~OrganicInstrument()
|
||||
|
||||
|
||||
|
||||
void OrganicInstrument::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
void OrganicInstrument::saveSettings(QDomDocument& doc, QDomElement& elem)
|
||||
{
|
||||
_this.setAttribute( "num_osc", QString::number( m_numOscillators ) );
|
||||
m_fx1Model.saveSettings( _doc, _this, "foldback" );
|
||||
m_volModel.saveSettings( _doc, _this, "vol" );
|
||||
elem.setAttribute("num_osc", QString::number(m_numOscillators));
|
||||
m_fx1Model.saveSettings(doc, elem, "foldback");
|
||||
m_volModel.saveSettings(doc, elem, "vol");
|
||||
|
||||
for( int i = 0; i < m_numOscillators; ++i )
|
||||
for (int i = 0; i < m_numOscillators; ++i)
|
||||
{
|
||||
QString is = QString::number( i );
|
||||
m_osc[i]->m_volModel.saveSettings( _doc, _this, "vol" + is );
|
||||
m_osc[i]->m_panModel.saveSettings( _doc, _this, "pan" + is );
|
||||
m_osc[i]->m_harmModel.saveSettings( _doc, _this, "newharmonic" + is );
|
||||
|
||||
m_osc[i]->m_detuneModel.saveSettings( _doc, _this, "newdetune"
|
||||
+ is );
|
||||
m_osc[i]->m_oscModel.saveSettings( _doc, _this, "wavetype"
|
||||
+ is );
|
||||
const auto is = QString::number(i);
|
||||
m_osc[i]->m_volModel.saveSettings(doc, elem, "vol" + is);
|
||||
m_osc[i]->m_panModel.saveSettings(doc, elem, "pan" + is);
|
||||
m_osc[i]->m_harmModel.saveSettings(doc, elem, "newharmonic" + is);
|
||||
m_osc[i]->m_detuneModel.saveSettings(doc, elem, "newdetune" + is);
|
||||
m_osc[i]->m_oscModel.saveSettings(doc, elem, "wavetype" + is);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void OrganicInstrument::loadSettings( const QDomElement & _this )
|
||||
void OrganicInstrument::loadSettings(const QDomElement& elem)
|
||||
{
|
||||
// m_numOscillators = _this.attribute( "num_osc" ).
|
||||
// toInt();
|
||||
|
||||
for( int i = 0; i < m_numOscillators; ++i )
|
||||
for (int i = 0; i < m_numOscillators; ++i)
|
||||
{
|
||||
QString is = QString::number( i );
|
||||
m_osc[i]->m_volModel.loadSettings( _this, "vol" + is );
|
||||
if( _this.hasAttribute( "detune" + is ) )
|
||||
{
|
||||
m_osc[i]->m_detuneModel.setValue( _this.attribute( "detune" ).toInt() * 12 );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_osc[i]->m_detuneModel.loadSettings( _this, "newdetune" + is );
|
||||
}
|
||||
m_osc[i]->m_panModel.loadSettings( _this, "pan" + is );
|
||||
m_osc[i]->m_oscModel.loadSettings( _this, "wavetype" + is );
|
||||
const auto is = QString::number(i);
|
||||
|
||||
if( _this.hasAttribute( "newharmonic" + is ) )
|
||||
m_osc[i]->m_volModel.loadSettings(elem, "vol" + is);
|
||||
|
||||
if (elem.hasAttribute("detune" + is) || !elem.firstChildElement("detune" + is).isNull())
|
||||
{
|
||||
m_osc[i]->m_harmModel.loadSettings( _this, "newharmonic" + is );
|
||||
m_osc[i]->m_detuneModel.loadSettings(elem, "detune" + is);
|
||||
m_osc[i]->m_detuneModel.setValue(m_osc[i]->m_detuneModel.value() * 12); // compat
|
||||
}
|
||||
else
|
||||
{
|
||||
m_osc[i]->m_harmModel.setValue( static_cast<float>( i ) );
|
||||
m_osc[i]->m_detuneModel.loadSettings(elem, "newdetune" + is);
|
||||
}
|
||||
|
||||
m_osc[i]->m_panModel.loadSettings(elem, "pan" + is);
|
||||
m_osc[i]->m_oscModel.loadSettings(elem, "wavetype" + is);
|
||||
|
||||
if (elem.hasAttribute("newharmonic" + is) || !elem.firstChildElement("newharmonic" + is).isNull())
|
||||
{
|
||||
m_osc[i]->m_harmModel.loadSettings(elem, "newharmonic" + is);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_osc[i]->m_harmModel.setValue(static_cast<float>(i));
|
||||
}
|
||||
}
|
||||
|
||||
m_volModel.loadSettings( _this, "vol" );
|
||||
m_fx1Model.loadSettings( _this, "foldback" );
|
||||
m_volModel.loadSettings(elem, "vol");
|
||||
m_fx1Model.loadSettings(elem, "foldback");
|
||||
}
|
||||
|
||||
|
||||
@@ -231,7 +227,7 @@ void OrganicInstrument::playNote( NotePlayHandle * _n,
|
||||
const fpp_t frames = _n->framesLeftForCurrentPeriod();
|
||||
const f_cnt_t offset = _n->noteOffset();
|
||||
|
||||
if( _n->totalFramesPlayed() == 0 || _n->m_pluginData == nullptr )
|
||||
if (!_n->m_pluginData)
|
||||
{
|
||||
auto oscs_l = std::array<Oscillator*, NUM_OSCILLATORS>{};
|
||||
auto oscs_r = std::array<Oscillator*, NUM_OSCILLATORS>{};
|
||||
@@ -409,7 +405,7 @@ class OrganicKnob : public Knob
|
||||
{
|
||||
public:
|
||||
OrganicKnob( QWidget * _parent ) :
|
||||
Knob( knobStyled, _parent )
|
||||
Knob( KnobType::Styled, _parent )
|
||||
{
|
||||
setFixedSize( 21, 21 );
|
||||
}
|
||||
@@ -512,7 +508,7 @@ void OrganicInstrumentView::modelChanged()
|
||||
oscKnob->setHintText( tr( "Osc %1 waveform:" ).arg( i + 1 ), QString() );
|
||||
|
||||
// setup volume-knob
|
||||
auto volKnob = new Knob(knobStyled, this);
|
||||
auto volKnob = new Knob(KnobType::Styled, this);
|
||||
volKnob->setVolumeKnob( true );
|
||||
volKnob->move( x + i * colWidth, y + rowHeight*1 );
|
||||
volKnob->setFixedSize( 21, 21 );
|
||||
@@ -566,7 +562,7 @@ void OrganicInstrumentView::updateKnobHint()
|
||||
|
||||
OscillatorObject::OscillatorObject( Model * _parent, int _index ) :
|
||||
Model( _parent ),
|
||||
m_waveShape( Oscillator::SineWave, 0, Oscillator::NumWaveShapes-1, this ),
|
||||
m_waveShape( static_cast<int>(Oscillator::WaveShape::Sine), 0, Oscillator::NumWaveShapes-1, this ),
|
||||
m_oscModel( 0.0f, 0.0f, 5.0f, 1.0f,
|
||||
this, tr( "Osc %1 waveform" ).arg( _index + 1 ) ),
|
||||
m_harmModel( static_cast<float>( _index ), 0.0f, 17.0f, 1.0f,
|
||||
@@ -588,15 +584,15 @@ void OscillatorObject::oscButtonChanged()
|
||||
|
||||
static auto shapes = std::array
|
||||
{
|
||||
Oscillator::SineWave,
|
||||
Oscillator::SawWave,
|
||||
Oscillator::SquareWave,
|
||||
Oscillator::TriangleWave,
|
||||
Oscillator::MoogSawWave,
|
||||
Oscillator::ExponentialWave
|
||||
Oscillator::WaveShape::Sine,
|
||||
Oscillator::WaveShape::Saw,
|
||||
Oscillator::WaveShape::Square,
|
||||
Oscillator::WaveShape::Triangle,
|
||||
Oscillator::WaveShape::MoogSaw,
|
||||
Oscillator::WaveShape::Exponential
|
||||
} ;
|
||||
|
||||
m_waveShape.setValue( shapes[(int)roundf( m_oscModel.value() )] );
|
||||
m_waveShape.setValue( static_cast<float>(shapes[(int)roundf( m_oscModel.value() )]) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -22,9 +22,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ORGANIC_H
|
||||
#define ORGANIC_H
|
||||
#ifndef LMMS_ORGANIC_H
|
||||
#define LMMS_ORGANIC_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
@@ -131,8 +130,8 @@ public:
|
||||
void deleteNotePluginData( NotePlayHandle * _n ) override;
|
||||
|
||||
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
void saveSettings(QDomDocument& doc, QDomElement& elem) override;
|
||||
void loadSettings(const QDomElement& elem) override;
|
||||
|
||||
QString nodeName() const override;
|
||||
|
||||
@@ -239,4 +238,4 @@ protected slots:
|
||||
|
||||
} // namespace lmms
|
||||
|
||||
#endif
|
||||
#endif // LMMS_ORGANIC_H
|
||||
|
||||
@@ -61,7 +61,7 @@ Plugin::Descriptor PLUGIN_EXPORT patman_plugin_descriptor =
|
||||
"GUS-compatible patch instrument" ),
|
||||
"Javier Serrano Polo <jasp00/at/users.sourceforge.net>",
|
||||
0x0100,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
"pat",
|
||||
nullptr,
|
||||
@@ -144,7 +144,7 @@ void PatmanInstrument::playNote( NotePlayHandle * _n,
|
||||
const fpp_t frames = _n->framesLeftForCurrentPeriod();
|
||||
const f_cnt_t offset = _n->noteOffset();
|
||||
|
||||
if( !_n->m_pluginData )
|
||||
if (!_n->m_pluginData)
|
||||
{
|
||||
selectSample( _n );
|
||||
}
|
||||
@@ -154,7 +154,7 @@ void PatmanInstrument::playNote( NotePlayHandle * _n,
|
||||
hdata->sample->frequency();
|
||||
|
||||
if( hdata->sample->play( _working_buffer + offset, hdata->state, frames,
|
||||
play_freq, m_loopedModel.value() ? SampleBuffer::LoopOn : SampleBuffer::LoopOff ) )
|
||||
play_freq, m_loopedModel.value() ? SampleBuffer::LoopMode::On : SampleBuffer::LoopMode::Off ) )
|
||||
{
|
||||
applyRelease( _working_buffer, _n );
|
||||
instrumentTrack()->processAudioBuffer( _working_buffer,
|
||||
@@ -201,8 +201,8 @@ void PatmanInstrument::setFile( const QString & _patch_file, bool _rename )
|
||||
// named it self
|
||||
|
||||
m_patchFile = PathUtil::toShortestRelative( _patch_file );
|
||||
LoadErrors error = loadPatch( PathUtil::toAbsolute( _patch_file ) );
|
||||
if( error )
|
||||
LoadError error = loadPatch( PathUtil::toAbsolute( _patch_file ) );
|
||||
if( error != LoadError::OK )
|
||||
{
|
||||
printf("Load error\n");
|
||||
}
|
||||
@@ -213,7 +213,7 @@ void PatmanInstrument::setFile( const QString & _patch_file, bool _rename )
|
||||
|
||||
|
||||
|
||||
PatmanInstrument::LoadErrors PatmanInstrument::loadPatch(
|
||||
PatmanInstrument::LoadError PatmanInstrument::loadPatch(
|
||||
const QString & _filename )
|
||||
{
|
||||
unloadCurrentPatch();
|
||||
@@ -222,7 +222,7 @@ PatmanInstrument::LoadErrors PatmanInstrument::loadPatch(
|
||||
if( !fd )
|
||||
{
|
||||
perror( "fopen" );
|
||||
return( LoadOpen );
|
||||
return( LoadError::Open );
|
||||
}
|
||||
|
||||
auto header = std::array<unsigned char, 239>{};
|
||||
@@ -232,19 +232,19 @@ PatmanInstrument::LoadErrors PatmanInstrument::loadPatch(
|
||||
&& memcmp(header.data(), "GF1PATCH100\0ID#000002", 22)))
|
||||
{
|
||||
fclose( fd );
|
||||
return( LoadNotGUS );
|
||||
return( LoadError::NotGUS );
|
||||
}
|
||||
|
||||
if( header[82] != 1 && header[82] != 0 )
|
||||
{
|
||||
fclose( fd );
|
||||
return( LoadInstruments );
|
||||
return( LoadError::Instruments );
|
||||
}
|
||||
|
||||
if( header[151] != 1 && header[151] != 0 )
|
||||
{
|
||||
fclose( fd );
|
||||
return( LoadLayers );
|
||||
return( LoadError::Layers );
|
||||
}
|
||||
|
||||
int sample_count = header[198];
|
||||
@@ -256,14 +256,14 @@ PatmanInstrument::LoadErrors PatmanInstrument::loadPatch(
|
||||
if ( fseek( fd, x, SEEK_CUR ) == -1 ) \
|
||||
{ \
|
||||
fclose( fd ); \
|
||||
return( LoadIO ); \
|
||||
return( LoadError::IO ); \
|
||||
}
|
||||
|
||||
#define READ_SHORT( x ) \
|
||||
if ( fread( &tmpshort, 2, 1, fd ) != 1 ) \
|
||||
{ \
|
||||
fclose( fd ); \
|
||||
return( LoadIO ); \
|
||||
return( LoadError::IO ); \
|
||||
} \
|
||||
x = (unsigned short)swap16IfBE( tmpshort );
|
||||
|
||||
@@ -271,7 +271,7 @@ PatmanInstrument::LoadErrors PatmanInstrument::loadPatch(
|
||||
if ( fread( &x, 4, 1, fd ) != 1 ) \
|
||||
{ \
|
||||
fclose( fd ); \
|
||||
return( LoadIO ); \
|
||||
return( LoadError::IO ); \
|
||||
} \
|
||||
x = (unsigned)swap32IfBE( x );
|
||||
|
||||
@@ -295,7 +295,7 @@ PatmanInstrument::LoadErrors PatmanInstrument::loadPatch(
|
||||
if ( fread( &modes, 1, 1, fd ) != 1 )
|
||||
{
|
||||
fclose( fd );
|
||||
return( LoadIO );
|
||||
return( LoadError::IO );
|
||||
}
|
||||
// skip scale frequency, scale factor, reserved space
|
||||
SKIP_BYTES( 2 + 2 + 36 );
|
||||
@@ -313,7 +313,7 @@ PatmanInstrument::LoadErrors PatmanInstrument::loadPatch(
|
||||
{
|
||||
delete[] wave_samples;
|
||||
fclose( fd );
|
||||
return( LoadIO );
|
||||
return( LoadError::IO );
|
||||
}
|
||||
sample = swap16IfBE( sample );
|
||||
if( modes & MODES_UNSIGNED )
|
||||
@@ -337,7 +337,7 @@ PatmanInstrument::LoadErrors PatmanInstrument::loadPatch(
|
||||
{
|
||||
delete[] wave_samples;
|
||||
fclose( fd );
|
||||
return( LoadIO );
|
||||
return( LoadError::IO );
|
||||
}
|
||||
if( modes & MODES_UNSIGNED )
|
||||
{
|
||||
@@ -374,7 +374,7 @@ PatmanInstrument::LoadErrors PatmanInstrument::loadPatch(
|
||||
delete[] data;
|
||||
}
|
||||
fclose( fd );
|
||||
return( LoadOK );
|
||||
return( LoadError::OK );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -98,17 +98,17 @@ private:
|
||||
BoolModel m_tunedModel;
|
||||
|
||||
|
||||
enum LoadErrors
|
||||
enum class LoadError
|
||||
{
|
||||
LoadOK,
|
||||
LoadOpen,
|
||||
LoadNotGUS,
|
||||
LoadInstruments,
|
||||
LoadLayers,
|
||||
LoadIO
|
||||
OK,
|
||||
Open,
|
||||
NotGUS,
|
||||
Instruments,
|
||||
Layers,
|
||||
IO
|
||||
} ;
|
||||
|
||||
LoadErrors loadPatch( const QString & _filename );
|
||||
LoadError loadPatch( const QString & _filename );
|
||||
void unloadCurrentPatch();
|
||||
|
||||
void selectSample( NotePlayHandle * _n );
|
||||
|
||||
@@ -48,7 +48,7 @@ Plugin::Descriptor PLUGIN_EXPORT peakcontrollereffect_plugin_descriptor =
|
||||
"Plugin for controlling knobs with sound peaks" ),
|
||||
"Paul Giblock <drfaygo/at/gmail.com>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader("logo"),
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -76,7 +76,7 @@ PeakControllerEffect::PeakControllerEffect(
|
||||
{
|
||||
Engine::getSong()->addController( m_autoController );
|
||||
}
|
||||
PeakController::s_effects.append( this );
|
||||
PeakController::s_effects.push_back(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,11 +84,11 @@ PeakControllerEffect::PeakControllerEffect(
|
||||
|
||||
PeakControllerEffect::~PeakControllerEffect()
|
||||
{
|
||||
int idx = PeakController::s_effects.indexOf( this );
|
||||
if( idx >= 0 )
|
||||
auto it = std::find(PeakController::s_effects.begin(), PeakController::s_effects.end(), this);
|
||||
if (it != PeakController::s_effects.end())
|
||||
{
|
||||
PeakController::s_effects.remove( idx );
|
||||
Engine::getSong()->removeController( m_autoController );
|
||||
PeakController::s_effects.erase(it);
|
||||
Engine::getSong()->removeController(m_autoController);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,32 +49,32 @@ PeakControllerEffectControlDialog::PeakControllerEffectControlDialog(
|
||||
setPalette( pal );
|
||||
setFixedSize( 240, 80 );
|
||||
|
||||
m_baseKnob = new Knob( knobBright_26, this );
|
||||
m_baseKnob = new Knob( KnobType::Bright26, this );
|
||||
m_baseKnob->setLabel( tr( "BASE" ) );
|
||||
m_baseKnob->setModel( &_controls->m_baseModel );
|
||||
m_baseKnob->setHintText( tr( "Base:" ) , "" );
|
||||
|
||||
m_amountKnob = new Knob( knobBright_26, this );
|
||||
m_amountKnob = new Knob( KnobType::Bright26, this );
|
||||
m_amountKnob->setLabel( tr( "AMNT" ) );
|
||||
m_amountKnob->setModel( &_controls->m_amountModel );
|
||||
m_amountKnob->setHintText( tr( "Modulation amount:" ) , "" );
|
||||
|
||||
m_amountMultKnob = new Knob( knobBright_26, this );
|
||||
m_amountMultKnob = new Knob( KnobType::Bright26, this );
|
||||
m_amountMultKnob->setLabel( tr( "MULT" ) );
|
||||
m_amountMultKnob->setModel( &_controls->m_amountMultModel );
|
||||
m_amountMultKnob->setHintText( tr( "Amount multiplicator:" ) , "" );
|
||||
|
||||
m_attackKnob = new Knob( knobBright_26, this );
|
||||
m_attackKnob = new Knob( KnobType::Bright26, this );
|
||||
m_attackKnob->setLabel( tr( "ATCK" ) );
|
||||
m_attackKnob->setModel( &_controls->m_attackModel );
|
||||
m_attackKnob->setHintText( tr( "Attack:" ) , "" );
|
||||
|
||||
m_decayKnob = new Knob( knobBright_26, this );
|
||||
m_decayKnob = new Knob( KnobType::Bright26, this );
|
||||
m_decayKnob->setLabel( tr( "DCAY" ) );
|
||||
m_decayKnob->setModel( &_controls->m_decayModel );
|
||||
m_decayKnob->setHintText( tr( "Release:" ) , "" );
|
||||
|
||||
m_tresholdKnob = new Knob( knobBright_26, this );
|
||||
m_tresholdKnob = new Knob( KnobType::Bright26, this );
|
||||
m_tresholdKnob->setLabel( tr( "TRSH" ) );
|
||||
m_tresholdKnob->setModel( &_controls->m_tresholdModel );
|
||||
m_tresholdKnob->setHintText( tr( "Treshold:" ) , "" );
|
||||
|
||||
@@ -42,7 +42,7 @@ Plugin::Descriptor PLUGIN_EXPORT reverbsc_plugin_descriptor =
|
||||
QT_TRANSLATE_NOOP( "PluginBrowser", "Reverb algorithm by Sean Costello" ),
|
||||
"Paul Batchelor",
|
||||
0x0123,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
||||
@@ -42,25 +42,25 @@ ReverbSCControlDialog::ReverbSCControlDialog( ReverbSCControls* controls ) :
|
||||
setPalette( pal );
|
||||
setFixedSize( 185, 55 );
|
||||
|
||||
auto inputGainKnob = new Knob(knobBright_26, this);
|
||||
auto inputGainKnob = new Knob(KnobType::Bright26, this);
|
||||
inputGainKnob -> move( 16, 10 );
|
||||
inputGainKnob->setModel( &controls->m_inputGainModel );
|
||||
inputGainKnob->setLabel( tr( "Input" ) );
|
||||
inputGainKnob->setHintText( tr( "Input gain:" ) , "dB" );
|
||||
|
||||
auto sizeKnob = new Knob(knobBright_26, this);
|
||||
auto sizeKnob = new Knob(KnobType::Bright26, this);
|
||||
sizeKnob -> move( 57, 10 );
|
||||
sizeKnob->setModel( &controls->m_sizeModel );
|
||||
sizeKnob->setLabel( tr( "Size" ) );
|
||||
sizeKnob->setHintText( tr( "Size:" ) , "" );
|
||||
|
||||
auto colorKnob = new Knob(knobBright_26, this);
|
||||
auto colorKnob = new Knob(KnobType::Bright26, this);
|
||||
colorKnob -> move( 98, 10 );
|
||||
colorKnob->setModel( &controls->m_colorModel );
|
||||
colorKnob->setLabel( tr( "Color" ) );
|
||||
colorKnob->setHintText( tr( "Color:" ) , "" );
|
||||
|
||||
auto outputGainKnob = new Knob(knobBright_26, this);
|
||||
auto outputGainKnob = new Knob(KnobType::Bright26, this);
|
||||
outputGainKnob -> move( 139, 10 );
|
||||
outputGainKnob->setModel( &controls->m_outputGainModel );
|
||||
outputGainKnob->setLabel( tr( "Output" ) );
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <QDomElement>
|
||||
#include <QLabel>
|
||||
|
||||
#include "ArrayVector.h"
|
||||
#include "AudioEngine.h"
|
||||
#include "ConfigManager.h"
|
||||
#include "FileDialog.h"
|
||||
@@ -63,7 +64,7 @@ Plugin::Descriptor PLUGIN_EXPORT sf2player_plugin_descriptor =
|
||||
QT_TRANSLATE_NOOP( "PluginBrowser", "Player for SoundFont files" ),
|
||||
"Paul Giblock <drfaygo/at/gmail/dot/com>",
|
||||
0x0100,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
"sf2,sf3",
|
||||
nullptr,
|
||||
@@ -71,17 +72,47 @@ Plugin::Descriptor PLUGIN_EXPORT sf2player_plugin_descriptor =
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* A non-owning reference to a single FluidSynth voice, for tracking whether the
|
||||
* referenced voice is still the same voice that was passed to the constructor.
|
||||
*/
|
||||
class FluidVoice
|
||||
{
|
||||
public:
|
||||
//! Create a reference to the voice currently pointed at by `voice`.
|
||||
explicit FluidVoice(fluid_voice_t* voice) :
|
||||
m_voice{voice},
|
||||
m_id{fluid_voice_get_id(voice)}
|
||||
{ }
|
||||
|
||||
//! Get a pointer to the referenced voice.
|
||||
fluid_voice_t* get() const noexcept { return m_voice; }
|
||||
|
||||
//! Test whether this object still refers to the original voice.
|
||||
bool isValid() const
|
||||
{
|
||||
return fluid_voice_get_id(m_voice) == m_id && fluid_voice_is_playing(m_voice);
|
||||
}
|
||||
|
||||
private:
|
||||
fluid_voice_t* m_voice;
|
||||
unsigned int m_id;
|
||||
};
|
||||
|
||||
struct Sf2PluginData
|
||||
{
|
||||
int midiNote;
|
||||
int lastPanning;
|
||||
float lastVelocity;
|
||||
fluid_voice_t * fluidVoice;
|
||||
// The soundfonts I checked used at most two voices per note, so space for
|
||||
// four should be safe. This may need to be increased if a soundfont with
|
||||
// more voices per note is found.
|
||||
ArrayVector<FluidVoice, 4> fluidVoices;
|
||||
bool isNew;
|
||||
f_cnt_t offset;
|
||||
bool noteOffSent;
|
||||
} ;
|
||||
panning_t panning;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -200,8 +231,8 @@ Sf2Instrument::Sf2Instrument( InstrumentTrack * _instrument_track ) :
|
||||
Sf2Instrument::~Sf2Instrument()
|
||||
{
|
||||
Engine::audioEngine()->removePlayHandlesOfTypes( instrumentTrack(),
|
||||
PlayHandle::TypeNotePlayHandle
|
||||
| PlayHandle::TypeInstrumentPlayHandle );
|
||||
PlayHandle::Type::NotePlayHandle
|
||||
| PlayHandle::Type::InstrumentPlayHandle );
|
||||
freeFont();
|
||||
delete_fluid_synth( m_synth );
|
||||
delete_fluid_settings( m_settings );
|
||||
@@ -616,7 +647,7 @@ void Sf2Instrument::reloadSynth()
|
||||
|
||||
m_synthMutex.lock();
|
||||
if( Engine::audioEngine()->currentQualitySettings().interpolation >=
|
||||
AudioEngine::qualitySettings::Interpolation_SincFastest )
|
||||
AudioEngine::qualitySettings::Interpolation::SincFastest )
|
||||
{
|
||||
fluid_synth_set_interp_method( m_synth, -1, FLUID_INTERP_7THORDER );
|
||||
}
|
||||
@@ -663,8 +694,6 @@ void Sf2Instrument::playNote( NotePlayHandle * _n, sampleFrame * )
|
||||
return;
|
||||
}
|
||||
|
||||
const f_cnt_t tfp = _n->totalFramesPlayed();
|
||||
|
||||
int masterPitch = instrumentTrack()->useMasterPitchModel()->value() ? Engine::getSong()->masterPitch() : 0;
|
||||
int baseNote = instrumentTrack()->baseNoteModel()->value();
|
||||
int midiNote = _n->midiKey() - baseNote + DefaultBaseKey + masterPitch;
|
||||
@@ -675,7 +704,7 @@ void Sf2Instrument::playNote( NotePlayHandle * _n, sampleFrame * )
|
||||
return;
|
||||
}
|
||||
|
||||
if (tfp == 0)
|
||||
if (!_n->m_pluginData)
|
||||
{
|
||||
const int baseVelocity = instrumentTrack()->midiPort()->baseVelocity();
|
||||
|
||||
@@ -683,10 +712,10 @@ void Sf2Instrument::playNote( NotePlayHandle * _n, sampleFrame * )
|
||||
pluginData->midiNote = midiNote;
|
||||
pluginData->lastPanning = 0;
|
||||
pluginData->lastVelocity = _n->midiVelocity( baseVelocity );
|
||||
pluginData->fluidVoice = nullptr;
|
||||
pluginData->isNew = true;
|
||||
pluginData->offset = _n->offset();
|
||||
pluginData->noteOffSent = false;
|
||||
pluginData->panning = _n->getPanning();
|
||||
|
||||
_n->m_pluginData = pluginData;
|
||||
|
||||
@@ -705,6 +734,17 @@ void Sf2Instrument::playNote( NotePlayHandle * _n, sampleFrame * )
|
||||
m_playingNotes.append( _n );
|
||||
m_playingNotesMutex.unlock();
|
||||
}
|
||||
|
||||
// Update the pitch of all the voices
|
||||
if (const auto data = static_cast<Sf2PluginData*>(_n->m_pluginData)) {
|
||||
const auto detuning = _n->currentDetuning();
|
||||
for (const auto& voice : data->fluidVoices) {
|
||||
if (voice.isValid()) {
|
||||
fluid_voice_gen_set(voice.get(), GEN_COARSETUNE, detuning);
|
||||
fluid_voice_update_param(voice.get(), GEN_COARSETUNE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -717,35 +757,47 @@ void Sf2Instrument::noteOn( Sf2PluginData * n )
|
||||
const int poly = fluid_synth_get_polyphony( m_synth );
|
||||
#ifndef _MSC_VER
|
||||
fluid_voice_t* voices[poly];
|
||||
unsigned int id[poly];
|
||||
#else
|
||||
const auto voices = static_cast<fluid_voice_t**>(_alloca(poly * sizeof(fluid_voice_t*)));
|
||||
const auto id = static_cast<unsigned int*>(_alloca(poly * sizeof(unsigned int)));
|
||||
#endif
|
||||
fluid_synth_get_voicelist( m_synth, voices, poly, -1 );
|
||||
for( int i = 0; i < poly; ++i )
|
||||
{
|
||||
id[i] = 0;
|
||||
}
|
||||
for( int i = 0; i < poly && voices[i]; ++i )
|
||||
{
|
||||
id[i] = fluid_voice_get_id( voices[i] );
|
||||
}
|
||||
|
||||
fluid_synth_noteon( m_synth, m_channel, n->midiNote, n->lastVelocity );
|
||||
|
||||
// get new voice and save it
|
||||
fluid_synth_get_voicelist( m_synth, voices, poly, -1 );
|
||||
for( int i = 0; i < poly && voices[i]; ++i )
|
||||
// Get any new voices and store them in the plugin data
|
||||
fluid_synth_get_voicelist(m_synth, voices, poly, -1);
|
||||
for (int i = 0; i < poly && voices[i] && !n->fluidVoices.full(); ++i)
|
||||
{
|
||||
const unsigned int newID = fluid_voice_get_id( voices[i] );
|
||||
if( id[i] != newID || newID == 0 )
|
||||
{
|
||||
n->fluidVoice = voices[i];
|
||||
break;
|
||||
const auto voice = voices[i];
|
||||
// FluidSynth stops voices with the same channel and pitch upon note-on,
|
||||
// so voices with the current channel and pitch are playing this note.
|
||||
if (fluid_voice_get_channel(voice) == m_channel
|
||||
&& fluid_voice_get_key(voice) == n->midiNote
|
||||
&& fluid_voice_is_on(voice)
|
||||
) {
|
||||
n->fluidVoices.emplace_back(voices[i]);
|
||||
}
|
||||
}
|
||||
|
||||
#if FLUIDSYNTH_VERSION_MAJOR >= 2
|
||||
// Smallest balance value that results in full attenuation of one channel.
|
||||
// Corresponds to internal FluidSynth macro `FLUID_CB_AMP_SIZE`.
|
||||
constexpr static auto maxBalance = 1441.f;
|
||||
// Convert panning from linear to exponential for FluidSynth
|
||||
const auto panning = n->panning;
|
||||
const auto factor = 1.f - std::abs(panning) / static_cast<float>(PanningRight);
|
||||
const auto balance = std::copysign(
|
||||
factor <= 0 ? maxBalance : std::min(-200.f * std::log10(factor), maxBalance),
|
||||
panning
|
||||
);
|
||||
// Set note panning on all the voices
|
||||
for (const auto& voice : n->fluidVoices) {
|
||||
if (voice.isValid()) {
|
||||
fluid_voice_gen_set(voice.get(), GEN_CUSTOM_BALANCE, balance);
|
||||
fluid_voice_update_param(voice.get(), GEN_CUSTOM_BALANCE);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
m_synthMutex.unlock();
|
||||
|
||||
m_notesRunningMutex.lock();
|
||||
@@ -861,6 +913,7 @@ void Sf2Instrument::play( sampleFrame * _working_buffer )
|
||||
void Sf2Instrument::renderFrames( f_cnt_t frames, sampleFrame * buf )
|
||||
{
|
||||
m_synthMutex.lock();
|
||||
fluid_synth_get_gain(m_synth); // This flushes voice updates as a side effect
|
||||
if( m_internalSampleRate < Engine::audioEngine()->processingSampleRate() &&
|
||||
m_srcState != nullptr )
|
||||
{
|
||||
@@ -938,7 +991,7 @@ class Sf2Knob : public Knob
|
||||
{
|
||||
public:
|
||||
Sf2Knob( QWidget * _parent ) :
|
||||
Knob( knobStyled, _parent )
|
||||
Knob( KnobType::Styled, _parent )
|
||||
{
|
||||
setFixedSize( 31, 38 );
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
|
||||
Flags flags() const override
|
||||
{
|
||||
return IsSingleStreamed;
|
||||
return Flag::IsSingleStreamed;
|
||||
}
|
||||
|
||||
gui::PluginView* instantiateView( QWidget * _parent ) override;
|
||||
|
||||
@@ -67,7 +67,7 @@ Plugin::Descriptor PLUGIN_EXPORT sfxr_plugin_descriptor =
|
||||
"LMMS port of sfxr" ),
|
||||
"Wong Cho Ching",
|
||||
0x0100,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -350,7 +350,7 @@ SfxrInstrument::SfxrInstrument( InstrumentTrack * _instrument_track ) :
|
||||
m_lpFilResoModel(0.0f, this, "LP Filter Resonance"),
|
||||
m_hpFilCutModel(0.0f, this, "HP Filter Cutoff"),
|
||||
m_hpFilCutSweepModel(0.0f, this, "HP Filter Cutoff Sweep"),
|
||||
m_waveFormModel( SQR_WAVE, 0, WAVES_NUM-1, this, tr( "Wave" ) )
|
||||
m_waveFormModel( static_cast<int>(SfxrWave::Square), 0, NumSfxrWaves-1, this, tr( "Wave" ) )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -446,9 +446,9 @@ void SfxrInstrument::playNote( NotePlayHandle * _n, sampleFrame * _working_buffe
|
||||
{
|
||||
float currentSampleRate = Engine::audioEngine()->processingSampleRate();
|
||||
|
||||
fpp_t frameNum = _n->framesLeftForCurrentPeriod();
|
||||
const f_cnt_t offset = _n->noteOffset();
|
||||
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == nullptr )
|
||||
fpp_t frameNum = _n->framesLeftForCurrentPeriod();
|
||||
const f_cnt_t offset = _n->noteOffset();
|
||||
if (!_n->m_pluginData)
|
||||
{
|
||||
_n->m_pluginData = new SfxrSynth( this );
|
||||
}
|
||||
@@ -549,7 +549,7 @@ class SfxrKnob : public Knob
|
||||
{
|
||||
public:
|
||||
SfxrKnob( QWidget * _parent ) :
|
||||
Knob( knobStyled, _parent )
|
||||
Knob( KnobType::Styled, _parent )
|
||||
{
|
||||
setFixedSize( 20, 20 );
|
||||
setCenterPointX( 10.0 );
|
||||
|
||||
@@ -37,10 +37,11 @@ namespace lmms
|
||||
{
|
||||
|
||||
|
||||
enum SfxrWaves
|
||||
enum class SfxrWave
|
||||
{
|
||||
SQR_WAVE, SAW_WAVE, SINE_WAVE, NOISE_WAVE, WAVES_NUM
|
||||
Square, Saw, Sine, Noise, Count
|
||||
};
|
||||
constexpr auto NumSfxrWaves = static_cast<std::size_t>(SfxrWave::Count);
|
||||
|
||||
const int WAVEFORM_BASE_X = 20;
|
||||
const int WAVEFORM_BASE_Y = 15;
|
||||
|
||||
@@ -83,7 +83,7 @@ Plugin::Descriptor PLUGIN_EXPORT sid_plugin_descriptor =
|
||||
"Csaba Hruska <csaba.hruska/at/gmail.com>"
|
||||
"Attila Herman <attila589/at/gmail.com>",
|
||||
0x0100,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -105,7 +105,7 @@ VoiceObject::VoiceObject( Model * _parent, int _idx ) :
|
||||
tr( "Voice %1 release" ).arg( _idx+1 ) ),
|
||||
m_coarseModel( 0.0f, -24.0, 24.0, 1.0f, this,
|
||||
tr( "Voice %1 coarse detuning" ).arg( _idx+1 ) ),
|
||||
m_waveFormModel( TriangleWave, 0, NumWaveShapes-1, this,
|
||||
m_waveFormModel( static_cast<int>(WaveForm::Triangle), 0, NumWaveShapes-1, this,
|
||||
tr( "Voice %1 wave shape" ).arg( _idx+1 ) ),
|
||||
|
||||
m_syncModel( false, this, tr( "Voice %1 sync" ).arg( _idx+1 ) ),
|
||||
@@ -121,12 +121,12 @@ SidInstrument::SidInstrument( InstrumentTrack * _instrument_track ) :
|
||||
// filter
|
||||
m_filterFCModel( 1024.0f, 0.0f, 2047.0f, 1.0f, this, tr( "Cutoff frequency" ) ),
|
||||
m_filterResonanceModel( 8.0f, 0.0f, 15.0f, 1.0f, this, tr( "Resonance" ) ),
|
||||
m_filterModeModel( LowPass, 0, NumFilterTypes-1, this, tr( "Filter type" )),
|
||||
m_filterModeModel( static_cast<int>(FilterType::LowPass), 0, NumFilterTypes-1, this, tr( "Filter type" )),
|
||||
|
||||
// misc
|
||||
m_voice3OffModel( false, this, tr( "Voice 3 off" ) ),
|
||||
m_volumeModel( 15.0f, 0.0f, 15.0f, 1.0f, this, tr( "Volume" ) ),
|
||||
m_chipModel( sidMOS8580, 0, NumChipModels-1, this, tr( "Chip model" ) )
|
||||
m_chipModel( static_cast<int>(ChipModel::MOS8580), 0, NumChipModels-1, this, tr( "Chip model" ) )
|
||||
{
|
||||
for( int i = 0; i < 3; ++i )
|
||||
{
|
||||
@@ -297,12 +297,10 @@ static int sid_fillbuffer(unsigned char* sidreg, SID *sid, int tdelta, short *pt
|
||||
void SidInstrument::playNote( NotePlayHandle * _n,
|
||||
sampleFrame * _working_buffer )
|
||||
{
|
||||
const f_cnt_t tfp = _n->totalFramesPlayed();
|
||||
|
||||
const int clockrate = C64_PAL_CYCLES_PER_SEC;
|
||||
const int samplerate = Engine::audioEngine()->processingSampleRate();
|
||||
|
||||
if ( tfp == 0 )
|
||||
if (!_n->m_pluginData)
|
||||
{
|
||||
SID *sid = new SID();
|
||||
sid->set_sampling_parameters( clockrate, SAMPLE_FAST, samplerate );
|
||||
@@ -325,7 +323,7 @@ void SidInstrument::playNote( NotePlayHandle * _n,
|
||||
reg = 0x00;
|
||||
}
|
||||
|
||||
if( (ChipModel)m_chipModel.value() == sidMOS6581 )
|
||||
if( (ChipModel)m_chipModel.value() == ChipModel::MOS6581 )
|
||||
{
|
||||
sid->set_chip_model( MOS6581 );
|
||||
}
|
||||
@@ -362,13 +360,13 @@ void SidInstrument::playNote( NotePlayHandle * _n,
|
||||
data8 += m_voice[i]->m_syncModel.value()?2:0;
|
||||
data8 += m_voice[i]->m_ringModModel.value()?4:0;
|
||||
data8 += m_voice[i]->m_testModel.value()?8:0;
|
||||
switch( m_voice[i]->m_waveFormModel.value() )
|
||||
switch( static_cast<VoiceObject::WaveForm>(m_voice[i]->m_waveFormModel.value()) )
|
||||
{
|
||||
default: break;
|
||||
case VoiceObject::NoiseWave: data8 += 128; break;
|
||||
case VoiceObject::SquareWave: data8 += 64; break;
|
||||
case VoiceObject::SawWave: data8 += 32; break;
|
||||
case VoiceObject::TriangleWave: data8 += 16; break;
|
||||
case VoiceObject::WaveForm::Noise: data8 += 128; break;
|
||||
case VoiceObject::WaveForm::Square: data8 += 64; break;
|
||||
case VoiceObject::WaveForm::Saw: data8 += 32; break;
|
||||
case VoiceObject::WaveForm::Triangle: data8 += 16; break;
|
||||
}
|
||||
sidreg[base+4] = data8&0x00FF;
|
||||
// ad
|
||||
@@ -408,12 +406,12 @@ void SidInstrument::playNote( NotePlayHandle * _n,
|
||||
data8 = data16&0x000F;
|
||||
data8 += m_voice3OffModel.value()?128:0;
|
||||
|
||||
switch( m_filterModeModel.value() )
|
||||
switch( static_cast<FilterType>(m_filterModeModel.value()) )
|
||||
{
|
||||
default: break;
|
||||
case LowPass: data8 += 16; break;
|
||||
case BandPass: data8 += 32; break;
|
||||
case HighPass: data8 += 64; break;
|
||||
case FilterType::LowPass: data8 += 16; break;
|
||||
case FilterType::BandPass: data8 += 32; break;
|
||||
case FilterType::HighPass: data8 += 64; break;
|
||||
}
|
||||
|
||||
sidreg[24] = data8&0x00FF;
|
||||
@@ -461,7 +459,7 @@ class sidKnob : public Knob
|
||||
{
|
||||
public:
|
||||
sidKnob( QWidget * _parent ) :
|
||||
Knob( knobStyled, _parent )
|
||||
Knob( KnobType::Styled, _parent )
|
||||
{
|
||||
setFixedSize( 16, 16 );
|
||||
setCenterPointX( 7.5 );
|
||||
|
||||
@@ -50,13 +50,15 @@ class VoiceObject : public Model
|
||||
Q_OBJECT
|
||||
MM_OPERATORS
|
||||
public:
|
||||
enum WaveForm {
|
||||
SquareWave = 0,
|
||||
TriangleWave,
|
||||
SawWave,
|
||||
NoiseWave,
|
||||
NumWaveShapes
|
||||
enum class WaveForm {
|
||||
Square = 0,
|
||||
Triangle,
|
||||
Saw,
|
||||
Noise,
|
||||
Count
|
||||
};
|
||||
constexpr static auto NumWaveShapes = static_cast<std::size_t>(WaveForm::Count);
|
||||
|
||||
VoiceObject( Model * _parent, int _idx );
|
||||
~VoiceObject() override = default;
|
||||
|
||||
@@ -82,19 +84,20 @@ class SidInstrument : public Instrument
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum FilerType {
|
||||
enum class FilterType {
|
||||
HighPass = 0,
|
||||
BandPass,
|
||||
LowPass,
|
||||
NumFilterTypes
|
||||
Count
|
||||
};
|
||||
constexpr static auto NumFilterTypes = static_cast<std::size_t>(FilterType::Count);
|
||||
|
||||
enum ChipModel {
|
||||
sidMOS6581 = 0,
|
||||
sidMOS8580,
|
||||
NumChipModels
|
||||
enum class ChipModel {
|
||||
MOS6581 = 0,
|
||||
MOS8580,
|
||||
Count
|
||||
};
|
||||
|
||||
constexpr static auto NumChipModels = static_cast<std::size_t>(ChipModel::Count);
|
||||
|
||||
SidInstrument( InstrumentTrack * _instrument_track );
|
||||
~SidInstrument() override = default;
|
||||
|
||||
@@ -48,7 +48,7 @@ extern "C" {
|
||||
QT_TRANSLATE_NOOP("PluginBrowser", "A graphical spectrum analyzer."),
|
||||
"Martin Pavelek <he29/dot/HS/at/gmail/dot/com>",
|
||||
0x0112,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader("logo"),
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
||||
@@ -66,7 +66,7 @@ SaControls::SaControls(Analyzer *effect) :
|
||||
m_zeroPaddingModel(2.0f, 0.0f, 4.0f, 1.0f, this, tr("FFT zero padding"))
|
||||
{
|
||||
// Frequency and amplitude ranges; order must match
|
||||
// FREQUENCY_RANGES and AMPLITUDE_RANGES defined in SaControls.h
|
||||
// FrequencyRange and AmplitudeRange defined in SaControls.h
|
||||
m_freqRangeModel.addItem(tr("Full (auto)"));
|
||||
m_freqRangeModel.addItem(tr("Audible"));
|
||||
m_freqRangeModel.addItem(tr("Bass"));
|
||||
@@ -99,7 +99,7 @@ SaControls::SaControls(Analyzer *effect) :
|
||||
}
|
||||
m_blockSizeModel.setValue(m_blockSizeModel.findText("2048"));
|
||||
|
||||
// Window type order must match FFT_WINDOWS defined in fft_helpers.h
|
||||
// Window type order must match FFTWindow defined in fft_helpers.h
|
||||
m_windowModel.addItem(tr("Rectangular (Off)"));
|
||||
m_windowModel.addItem(tr("Blackman-Harris (Default)"));
|
||||
m_windowModel.addItem(tr("Hamming"));
|
||||
|
||||
@@ -236,7 +236,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor)
|
||||
controls_layout->setStretchFactor(advanced_widget, 10);
|
||||
|
||||
// Peak envelope resolution
|
||||
auto envelopeResolutionKnob = new Knob(knobSmall_17, this);
|
||||
auto envelopeResolutionKnob = new Knob(KnobType::Small17, this);
|
||||
envelopeResolutionKnob->setModel(&controls->m_envelopeResolutionModel);
|
||||
envelopeResolutionKnob->setLabel(tr("Envelope res."));
|
||||
envelopeResolutionKnob->setToolTip(tr("Increase envelope resolution for better details, decrease for better GUI performance."));
|
||||
@@ -244,7 +244,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor)
|
||||
advanced_layout->addWidget(envelopeResolutionKnob, 0, 0, 1, 1, Qt::AlignCenter);
|
||||
|
||||
// Spectrum graph resolution
|
||||
auto spectrumResolutionKnob = new Knob(knobSmall_17, this);
|
||||
auto spectrumResolutionKnob = new Knob(KnobType::Small17, this);
|
||||
spectrumResolutionKnob->setModel(&controls->m_spectrumResolutionModel);
|
||||
spectrumResolutionKnob->setLabel(tr("Spectrum res."));
|
||||
spectrumResolutionKnob->setToolTip(tr("Increase spectrum resolution for better details, decrease for better GUI performance."));
|
||||
@@ -252,7 +252,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor)
|
||||
advanced_layout->addWidget(spectrumResolutionKnob, 1, 0, 1, 1, Qt::AlignCenter);
|
||||
|
||||
// Peak falloff speed
|
||||
auto peakDecayFactorKnob = new Knob(knobSmall_17, this);
|
||||
auto peakDecayFactorKnob = new Knob(KnobType::Small17, this);
|
||||
peakDecayFactorKnob->setModel(&controls->m_peakDecayFactorModel);
|
||||
peakDecayFactorKnob->setLabel(tr("Falloff factor"));
|
||||
peakDecayFactorKnob->setToolTip(tr("Decrease to make peaks fall faster."));
|
||||
@@ -260,7 +260,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor)
|
||||
advanced_layout->addWidget(peakDecayFactorKnob, 0, 1, 1, 1, Qt::AlignCenter);
|
||||
|
||||
// Averaging weight
|
||||
auto averagingWeightKnob = new Knob(knobSmall_17, this);
|
||||
auto averagingWeightKnob = new Knob(KnobType::Small17, this);
|
||||
averagingWeightKnob->setModel(&controls->m_averagingWeightModel);
|
||||
averagingWeightKnob->setLabel(tr("Averaging weight"));
|
||||
averagingWeightKnob->setToolTip(tr("Decrease to make averaging slower and smoother."));
|
||||
@@ -268,7 +268,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor)
|
||||
advanced_layout->addWidget(averagingWeightKnob, 1, 1, 1, 1, Qt::AlignCenter);
|
||||
|
||||
// Waterfall history size
|
||||
auto waterfallHeightKnob = new Knob(knobSmall_17, this);
|
||||
auto waterfallHeightKnob = new Knob(KnobType::Small17, this);
|
||||
waterfallHeightKnob->setModel(&controls->m_waterfallHeightModel);
|
||||
waterfallHeightKnob->setLabel(tr("Waterfall height"));
|
||||
waterfallHeightKnob->setToolTip(tr("Increase to get slower scrolling, decrease to see fast transitions better. Warning: medium CPU usage."));
|
||||
@@ -278,7 +278,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor)
|
||||
connect(&controls->m_waterfallHeightModel, &FloatModel::dataChanged, [=] {processor->reallocateBuffers();});
|
||||
|
||||
// Waterfall gamma correction
|
||||
auto waterfallGammaKnob = new Knob(knobSmall_17, this);
|
||||
auto waterfallGammaKnob = new Knob(KnobType::Small17, this);
|
||||
waterfallGammaKnob->setModel(&controls->m_waterfallGammaModel);
|
||||
waterfallGammaKnob->setLabel(tr("Waterfall gamma"));
|
||||
waterfallGammaKnob->setToolTip(tr("Decrease to see very weak signals, increase to get better contrast."));
|
||||
@@ -286,7 +286,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor)
|
||||
advanced_layout->addWidget(waterfallGammaKnob, 1, 2, 1, 1, Qt::AlignCenter);
|
||||
|
||||
// FFT window overlap
|
||||
auto windowOverlapKnob = new Knob(knobSmall_17, this);
|
||||
auto windowOverlapKnob = new Knob(KnobType::Small17, this);
|
||||
windowOverlapKnob->setModel(&controls->m_windowOverlapModel);
|
||||
windowOverlapKnob->setLabel(tr("Window overlap"));
|
||||
windowOverlapKnob->setToolTip(tr("Increase to prevent missing fast transitions arriving near FFT window edges. Warning: high CPU usage."));
|
||||
@@ -294,7 +294,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor)
|
||||
advanced_layout->addWidget(windowOverlapKnob, 0, 3, 1, 1, Qt::AlignCenter);
|
||||
|
||||
// FFT zero padding
|
||||
auto zeroPaddingKnob = new Knob(knobSmall_17, this);
|
||||
auto zeroPaddingKnob = new Knob(KnobType::Small17, this);
|
||||
zeroPaddingKnob->setModel(&controls->m_zeroPaddingModel);
|
||||
zeroPaddingKnob->setLabel(tr("Zero padding"));
|
||||
zeroPaddingKnob->setToolTip(tr("Increase to get smoother-looking spectrum. Warning: high CPU usage."));
|
||||
|
||||
@@ -58,7 +58,7 @@ SaProcessor::SaProcessor(const SaControls *controls) :
|
||||
m_reallocating(false)
|
||||
{
|
||||
m_fftWindow.resize(m_inBlockSize, 1.0);
|
||||
precomputeWindow(m_fftWindow.data(), m_inBlockSize, BLACKMAN_HARRIS);
|
||||
precomputeWindow(m_fftWindow.data(), m_inBlockSize, FFTWindow::BlackmanHarris);
|
||||
|
||||
m_bufferL.resize(m_inBlockSize, 0);
|
||||
m_bufferR.resize(m_inBlockSize, 0);
|
||||
@@ -402,7 +402,7 @@ void SaProcessor::reallocateBuffers()
|
||||
|
||||
// allocate new space, create new plan and resize containers
|
||||
m_fftWindow.resize(new_in_size, 1.0);
|
||||
precomputeWindow(m_fftWindow.data(), new_in_size, (FFT_WINDOWS) m_controls->m_windowModel.value());
|
||||
precomputeWindow(m_fftWindow.data(), new_in_size, (FFTWindow) m_controls->m_windowModel.value());
|
||||
m_bufferL.resize(new_in_size, 0);
|
||||
m_bufferR.resize(new_in_size, 0);
|
||||
m_filteredBufferL.resize(new_fft_size, 0);
|
||||
@@ -448,7 +448,7 @@ void SaProcessor::rebuildWindow()
|
||||
{
|
||||
// computation is done in fft_helpers
|
||||
QMutexLocker lock(&m_dataAccess);
|
||||
precomputeWindow(m_fftWindow.data(), m_inBlockSize, (FFT_WINDOWS) m_controls->m_windowModel.value());
|
||||
precomputeWindow(m_fftWindow.data(), m_inBlockSize, (FFTWindow) m_controls->m_windowModel.value());
|
||||
}
|
||||
|
||||
|
||||
@@ -545,28 +545,28 @@ float SaProcessor::binBandwidth() const
|
||||
|
||||
float SaProcessor::getFreqRangeMin(bool linear) const
|
||||
{
|
||||
switch (m_controls->m_freqRangeModel.value())
|
||||
switch (static_cast<FrequencyRange>(m_controls->m_freqRangeModel.value()))
|
||||
{
|
||||
case FRANGE_AUDIBLE: return FRANGE_AUDIBLE_START;
|
||||
case FRANGE_BASS: return FRANGE_BASS_START;
|
||||
case FRANGE_MIDS: return FRANGE_MIDS_START;
|
||||
case FRANGE_HIGH: return FRANGE_HIGH_START;
|
||||
case FrequencyRange::Audible: return FRANGE_AUDIBLE_START;
|
||||
case FrequencyRange::Bass: return FRANGE_BASS_START;
|
||||
case FrequencyRange::Mids: return FRANGE_MIDS_START;
|
||||
case FrequencyRange::High: return FRANGE_HIGH_START;
|
||||
default:
|
||||
case FRANGE_FULL: return linear ? 0 : LOWEST_LOG_FREQ;
|
||||
case FrequencyRange::Full: return linear ? 0 : LOWEST_LOG_FREQ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
float SaProcessor::getFreqRangeMax() const
|
||||
{
|
||||
switch (m_controls->m_freqRangeModel.value())
|
||||
switch (static_cast<FrequencyRange>(m_controls->m_freqRangeModel.value()))
|
||||
{
|
||||
case FRANGE_AUDIBLE: return FRANGE_AUDIBLE_END;
|
||||
case FRANGE_BASS: return FRANGE_BASS_END;
|
||||
case FRANGE_MIDS: return FRANGE_MIDS_END;
|
||||
case FRANGE_HIGH: return FRANGE_HIGH_END;
|
||||
case FrequencyRange::Audible: return FRANGE_AUDIBLE_END;
|
||||
case FrequencyRange::Bass: return FRANGE_BASS_END;
|
||||
case FrequencyRange::Mids: return FRANGE_MIDS_END;
|
||||
case FrequencyRange::High: return FRANGE_HIGH_END;
|
||||
default:
|
||||
case FRANGE_FULL: return getNyquistFreq();
|
||||
case FrequencyRange::Full: return getNyquistFreq();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -619,26 +619,26 @@ float SaProcessor::getAmpRangeMin(bool linear) const
|
||||
{
|
||||
// return very low limit to make sure zero gets included at linear grid
|
||||
if (linear) {return -900;}
|
||||
switch (m_controls->m_ampRangeModel.value())
|
||||
switch (static_cast<AmplitudeRange>(m_controls->m_ampRangeModel.value()))
|
||||
{
|
||||
case ARANGE_EXTENDED: return ARANGE_EXTENDED_START;
|
||||
case ARANGE_SILENT: return ARANGE_SILENT_START;
|
||||
case ARANGE_LOUD: return ARANGE_LOUD_START;
|
||||
case AmplitudeRange::Extended: return ARANGE_EXTENDED_START;
|
||||
case AmplitudeRange::Silent: return ARANGE_SILENT_START;
|
||||
case AmplitudeRange::Loud: return ARANGE_LOUD_START;
|
||||
default:
|
||||
case ARANGE_AUDIBLE: return ARANGE_AUDIBLE_START;
|
||||
case AmplitudeRange::Audible: return ARANGE_AUDIBLE_START;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
float SaProcessor::getAmpRangeMax() const
|
||||
{
|
||||
switch (m_controls->m_ampRangeModel.value())
|
||||
switch (static_cast<AmplitudeRange>(m_controls->m_ampRangeModel.value()))
|
||||
{
|
||||
case ARANGE_EXTENDED: return ARANGE_EXTENDED_END;
|
||||
case ARANGE_SILENT: return ARANGE_SILENT_END;
|
||||
case ARANGE_LOUD: return ARANGE_LOUD_END;
|
||||
case AmplitudeRange::Extended: return ARANGE_EXTENDED_END;
|
||||
case AmplitudeRange::Silent: return ARANGE_SILENT_END;
|
||||
case AmplitudeRange::Loud: return ARANGE_LOUD_END;
|
||||
default:
|
||||
case ARANGE_AUDIBLE: return ARANGE_AUDIBLE_END;
|
||||
case AmplitudeRange::Audible: return ARANGE_AUDIBLE_END;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ Plugin::Descriptor PLUGIN_EXPORT stereoenhancer_plugin_descriptor =
|
||||
"Plugin for enhancing stereo separation of a stereo input file" ),
|
||||
"Lou Herard <lherard/at/gmail.com>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader("logo"),
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
||||
@@ -40,7 +40,7 @@ StereoEnhancerControlDialog::StereoEnhancerControlDialog(
|
||||
{
|
||||
auto l = new QHBoxLayout(this);
|
||||
|
||||
auto widthKnob = new Knob(knobBright_26, this);
|
||||
auto widthKnob = new Knob(KnobType::Bright26, this);
|
||||
widthKnob->setModel( &_controls->m_widthModel );
|
||||
widthKnob->setLabel( tr( "WIDTH" ) );
|
||||
widthKnob->setHintText( tr( "Width:" ) , " samples" );
|
||||
|
||||
@@ -43,7 +43,7 @@ Plugin::Descriptor PLUGIN_EXPORT stereomatrix_plugin_descriptor =
|
||||
"Plugin for freely manipulating stereo output" ),
|
||||
"Paul Giblock <drfaygo/at/gmail.com>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader("logo"),
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
||||
@@ -48,22 +48,22 @@ StereoMatrixControlDialog::StereoMatrixControlDialog(
|
||||
PLUGIN_NAME::getIconPixmap( "artwork" ) );
|
||||
setPalette( pal );
|
||||
|
||||
auto llKnob = new Knob(knobBright_26, this);
|
||||
auto llKnob = new Knob(KnobType::Bright26, this);
|
||||
llKnob->setModel( &_controls->m_llModel );
|
||||
llKnob->setHintText( tr( "Left to Left Vol:" ) , "" );
|
||||
llKnob->move( 10, 79 );
|
||||
|
||||
auto lrKnob = new Knob(knobBright_26, this);
|
||||
auto lrKnob = new Knob(KnobType::Bright26, this);
|
||||
lrKnob->setModel( &_controls->m_lrModel );
|
||||
lrKnob->setHintText( tr( "Left to Right Vol:" ) , "" );
|
||||
lrKnob->move( 48, 79 );
|
||||
|
||||
auto rlKnob = new Knob(knobBright_26, this);
|
||||
auto rlKnob = new Knob(KnobType::Bright26, this);
|
||||
rlKnob->setModel( &_controls->m_rlModel );
|
||||
rlKnob->setHintText( tr( "Right to Left Vol:" ) , "" );
|
||||
rlKnob->move( 85, 79 );
|
||||
|
||||
auto rrKnob = new Knob(knobBright_26, this);
|
||||
auto rrKnob = new Knob(KnobType::Bright26, this);
|
||||
rrKnob->setModel( &_controls->m_rrModel );
|
||||
rrKnob->setHintText( tr( "Right to Right Vol:" ) , "" );
|
||||
rrKnob->move( 123, 79 );
|
||||
|
||||
@@ -59,7 +59,7 @@ Plugin::Descriptor PLUGIN_EXPORT malletsstk_plugin_descriptor =
|
||||
"Tuneful things to bang on" ),
|
||||
"Danny McRae <khjklujn/at/users.sf.net>",
|
||||
0x0100,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -286,7 +286,7 @@ void MalletsInstrument::playNote( NotePlayHandle * _n,
|
||||
int p = m_presetsModel.value();
|
||||
|
||||
const float freq = _n->frequency();
|
||||
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == nullptr )
|
||||
if (!_n->m_pluginData)
|
||||
{
|
||||
// If newer projects, adjust velocity to within stk's limits
|
||||
float velocityAdjust =
|
||||
@@ -409,7 +409,7 @@ MalletsInstrumentView::MalletsInstrumentView( MalletsInstrument * _instrument,
|
||||
connect( &_instrument->m_presetsModel, SIGNAL( dataChanged() ),
|
||||
this, SLOT( changePreset() ) );
|
||||
|
||||
m_spreadKnob = new Knob( knobVintage_32, this );
|
||||
m_spreadKnob = new Knob( KnobType::Vintage32, this );
|
||||
m_spreadKnob->setLabel( tr( "Spread" ) );
|
||||
m_spreadKnob->move( 190, 140 );
|
||||
m_spreadKnob->setHintText( tr( "Spread:" ), "" );
|
||||
@@ -445,27 +445,27 @@ QWidget * MalletsInstrumentView::setupModalBarControls( QWidget * _parent )
|
||||
auto widget = new QWidget(_parent);
|
||||
widget->setFixedSize( 250, 250 );
|
||||
|
||||
m_hardnessKnob = new Knob( knobVintage_32, widget );
|
||||
m_hardnessKnob = new Knob( KnobType::Vintage32, widget );
|
||||
m_hardnessKnob->setLabel( tr( "Hardness" ) );
|
||||
m_hardnessKnob->move( 30, 90 );
|
||||
m_hardnessKnob->setHintText( tr( "Hardness:" ), "" );
|
||||
|
||||
m_positionKnob = new Knob( knobVintage_32, widget );
|
||||
m_positionKnob = new Knob( KnobType::Vintage32, widget );
|
||||
m_positionKnob->setLabel( tr( "Position" ) );
|
||||
m_positionKnob->move( 110, 90 );
|
||||
m_positionKnob->setHintText( tr( "Position:" ), "" );
|
||||
|
||||
m_vibratoGainKnob = new Knob( knobVintage_32, widget );
|
||||
m_vibratoGainKnob = new Knob( KnobType::Vintage32, widget );
|
||||
m_vibratoGainKnob->setLabel( tr( "Vibrato gain" ) );
|
||||
m_vibratoGainKnob->move( 30, 140 );
|
||||
m_vibratoGainKnob->setHintText( tr( "Vibrato gain:" ), "" );
|
||||
|
||||
m_vibratoFreqKnob = new Knob( knobVintage_32, widget );
|
||||
m_vibratoFreqKnob = new Knob( KnobType::Vintage32, widget );
|
||||
m_vibratoFreqKnob->setLabel( tr( "Vibrato frequency" ) );
|
||||
m_vibratoFreqKnob->move( 110, 140 );
|
||||
m_vibratoFreqKnob->setHintText( tr( "Vibrato frequency:" ), "" );
|
||||
|
||||
m_stickKnob = new Knob( knobVintage_32, widget );
|
||||
m_stickKnob = new Knob( KnobType::Vintage32, widget );
|
||||
m_stickKnob->setLabel( tr( "Stick mix" ) );
|
||||
m_stickKnob->move( 190, 90 );
|
||||
m_stickKnob->setHintText( tr( "Stick mix:" ), "" );
|
||||
@@ -481,27 +481,27 @@ QWidget * MalletsInstrumentView::setupTubeBellControls( QWidget * _parent )
|
||||
auto widget = new QWidget(_parent);
|
||||
widget->setFixedSize( 250, 250 );
|
||||
|
||||
m_modulatorKnob = new Knob( knobVintage_32, widget );
|
||||
m_modulatorKnob = new Knob( KnobType::Vintage32, widget );
|
||||
m_modulatorKnob->setLabel( tr( "Modulator" ) );
|
||||
m_modulatorKnob->move( 30, 90 );
|
||||
m_modulatorKnob->setHintText( tr( "Modulator:" ), "" );
|
||||
|
||||
m_crossfadeKnob = new Knob( knobVintage_32, widget );
|
||||
m_crossfadeKnob = new Knob( KnobType::Vintage32, widget );
|
||||
m_crossfadeKnob->setLabel( tr( "Crossfade" ) );
|
||||
m_crossfadeKnob->move( 110, 90 );
|
||||
m_crossfadeKnob->setHintText( tr( "Crossfade:" ), "" );
|
||||
|
||||
m_lfoSpeedKnob = new Knob( knobVintage_32, widget );
|
||||
m_lfoSpeedKnob = new Knob( KnobType::Vintage32, widget );
|
||||
m_lfoSpeedKnob->setLabel( tr( "LFO speed" ) );
|
||||
m_lfoSpeedKnob->move( 30, 140 );
|
||||
m_lfoSpeedKnob->setHintText( tr( "LFO speed:" ), "" );
|
||||
|
||||
m_lfoDepthKnob = new Knob( knobVintage_32, widget );
|
||||
m_lfoDepthKnob = new Knob( KnobType::Vintage32, widget );
|
||||
m_lfoDepthKnob->setLabel( tr( "LFO depth" ) );
|
||||
m_lfoDepthKnob->move( 110, 140 );
|
||||
m_lfoDepthKnob->setHintText( tr( "LFO depth:" ), "" );
|
||||
|
||||
m_adsrKnob = new Knob( knobVintage_32, widget );
|
||||
m_adsrKnob = new Knob( KnobType::Vintage32, widget );
|
||||
m_adsrKnob->setLabel( tr( "ADSR" ) );
|
||||
m_adsrKnob->move( 190, 90 );
|
||||
m_adsrKnob->setHintText( tr( "ADSR:" ), "" );
|
||||
@@ -521,22 +521,22 @@ QWidget * MalletsInstrumentView::setupBandedWGControls( QWidget * _parent )
|
||||
/* m_strikeLED = new LedCheckBox( tr( "Bowed" ), widget );
|
||||
m_strikeLED->move( 138, 25 );*/
|
||||
|
||||
m_pressureKnob = new Knob( knobVintage_32, widget );
|
||||
m_pressureKnob = new Knob( KnobType::Vintage32, widget );
|
||||
m_pressureKnob->setLabel( tr( "Pressure" ) );
|
||||
m_pressureKnob->move( 30, 90 );
|
||||
m_pressureKnob->setHintText( tr( "Pressure:" ), "" );
|
||||
|
||||
/* m_motionKnob = new Knob( knobVintage_32, widget );
|
||||
/* m_motionKnob = new Knob( KnobType::Vintage32, widget );
|
||||
m_motionKnob->setLabel( tr( "Motion" ) );
|
||||
m_motionKnob->move( 110, 90 );
|
||||
m_motionKnob->setHintText( tr( "Motion:" ), "" );*/
|
||||
|
||||
m_velocityKnob = new Knob( knobVintage_32, widget );
|
||||
m_velocityKnob = new Knob( KnobType::Vintage32, widget );
|
||||
m_velocityKnob->setLabel( tr( "Speed" ) );
|
||||
m_velocityKnob->move( 30, 140 );
|
||||
m_velocityKnob->setHintText( tr( "Speed:" ), "" );
|
||||
|
||||
/* m_vibratoKnob = new Knob( knobVintage_32, widget, tr( "Vibrato" ) );
|
||||
/* m_vibratoKnob = new Knob( KnobType::Vintage32, widget, tr( "Vibrato" ) );
|
||||
m_vibratoKnob->setLabel( tr( "Vibrato" ) );
|
||||
m_vibratoKnob->move( 110, 140 );
|
||||
m_vibratoKnob->setHintText( tr( "Vibrato:" ), "" );*/
|
||||
|
||||
3
plugins/TapTempo/CMakeLists.txt
Normal file
3
plugins/TapTempo/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(taptempo TapTempo.cpp TapTempoView.cpp MOCFILES TapTempo.h TapTempoView.h EMBEDDED_RESOURCES logo.png)
|
||||
85
plugins/TapTempo/TapTempo.cpp
Normal file
85
plugins/TapTempo/TapTempo.cpp
Normal file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* TapTempo.cpp - Plugin to count beats per minute
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2022 saker <sakertooth@gmail.com>
|
||||
*
|
||||
*
|
||||
* This file is part of LMMS - https://lmms.io
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "TapTempo.h"
|
||||
|
||||
#include <QFont>
|
||||
#include <QKeyEvent>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
#include <cfloat>
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
|
||||
#include "AudioEngine.h"
|
||||
#include "Engine.h"
|
||||
#include "LedCheckBox.h"
|
||||
#include "SamplePlayHandle.h"
|
||||
#include "Song.h"
|
||||
#include "embed.h"
|
||||
#include "plugin_export.h"
|
||||
|
||||
namespace lmms {
|
||||
|
||||
extern "C" {
|
||||
Plugin::Descriptor PLUGIN_EXPORT taptempo_plugin_descriptor
|
||||
= {LMMS_STRINGIFY(PLUGIN_NAME), "Tap Tempo", QT_TRANSLATE_NOOP("PluginBrowser", "Tap to the beat"),
|
||||
"saker <sakertooth@gmail.com>", 0x0100, Plugin::Type::Tool, new PluginPixmapLoader("logo"), nullptr, nullptr};
|
||||
|
||||
PLUGIN_EXPORT Plugin* lmms_plugin_main(Model*, void*)
|
||||
{
|
||||
return new TapTempo;
|
||||
}
|
||||
}
|
||||
|
||||
TapTempo::TapTempo()
|
||||
: ToolPlugin(&taptempo_plugin_descriptor, nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
void TapTempo::onBpmClick()
|
||||
{
|
||||
const auto currentTime = clock::now();
|
||||
if (m_numTaps == 0)
|
||||
{
|
||||
m_startTime = currentTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
const auto secondsElapsed = (currentTime - m_startTime) / 1.0s;
|
||||
if (m_numTaps >= m_tapsNeededToDisplay) { m_bpm = m_numTaps / secondsElapsed * 60; }
|
||||
}
|
||||
|
||||
++m_numTaps;
|
||||
}
|
||||
|
||||
QString TapTempo::nodeName() const
|
||||
{
|
||||
return taptempo_plugin_descriptor.name;
|
||||
}
|
||||
} // namespace lmms
|
||||
61
plugins/TapTempo/TapTempo.h
Normal file
61
plugins/TapTempo/TapTempo.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* TapTempo.h - Plugin to count beats per minute
|
||||
*
|
||||
* Copyright (c) 2022 saker <sakertooth@gmail.com>
|
||||
*
|
||||
* This file is part of LMMS - https://lmms.io
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LMMS_TAP_TEMPO_H
|
||||
#define LMMS_TAP_TEMPO_H
|
||||
|
||||
#include <chrono>
|
||||
|
||||
#include "TapTempoView.h"
|
||||
#include "ToolPlugin.h"
|
||||
|
||||
namespace lmms {
|
||||
|
||||
class TapTempo : public ToolPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
using clock = std::chrono::steady_clock;
|
||||
|
||||
TapTempo();
|
||||
void onBpmClick();
|
||||
|
||||
QString nodeName() const override;
|
||||
void saveSettings(QDomDocument&, QDomElement&) override {}
|
||||
void loadSettings(const QDomElement&) override {}
|
||||
|
||||
gui::PluginView* instantiateView(QWidget*) override { return new gui::TapTempoView(this); }
|
||||
|
||||
private:
|
||||
std::chrono::time_point<clock> m_startTime;
|
||||
int m_numTaps = 0;
|
||||
int m_tapsNeededToDisplay = 2;
|
||||
double m_bpm = 0.0;
|
||||
bool m_showDecimal = false;
|
||||
|
||||
friend class gui::TapTempoView;
|
||||
};
|
||||
} // namespace lmms
|
||||
|
||||
#endif // LMMS_TAP_TEMPO_H
|
||||
168
plugins/TapTempo/TapTempoView.cpp
Normal file
168
plugins/TapTempo/TapTempoView.cpp
Normal file
@@ -0,0 +1,168 @@
|
||||
/*
|
||||
* TapTempoView.cpp - Plugin to count beats per minute
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2022 saker <sakertooth@gmail.com>
|
||||
*
|
||||
*
|
||||
* This file is part of LMMS - https://lmms.io
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
#include "TapTempoView.h"
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <QKeyEvent>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
#include <QVariant>
|
||||
#include <QWidget>
|
||||
|
||||
#include "Engine.h"
|
||||
#include "SamplePlayHandle.h"
|
||||
#include "Song.h"
|
||||
#include "TapTempo.h"
|
||||
|
||||
namespace lmms::gui {
|
||||
TapTempoView::TapTempoView(TapTempo* plugin)
|
||||
: ToolPluginView(plugin)
|
||||
, m_plugin(plugin)
|
||||
{
|
||||
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
|
||||
auto font = QFont();
|
||||
font.setPointSize(24);
|
||||
|
||||
m_tapButton = new QPushButton();
|
||||
m_tapButton->setFixedSize(200, 200);
|
||||
m_tapButton->setFont(font);
|
||||
m_tapButton->setText(tr("0"));
|
||||
|
||||
auto precisionCheckBox = new QCheckBox(tr("Precision"));
|
||||
precisionCheckBox->setFocusPolicy(Qt::NoFocus);
|
||||
precisionCheckBox->setToolTip(tr("Display in high precision"));
|
||||
precisionCheckBox->setText(tr("Precision"));
|
||||
|
||||
auto muteCheckBox = new QCheckBox(tr("0.0 ms"));
|
||||
muteCheckBox->setFocusPolicy(Qt::NoFocus);
|
||||
muteCheckBox->setToolTip(tr("Mute metronome"));
|
||||
muteCheckBox->setText(tr("Mute"));
|
||||
|
||||
m_msLabel = new QLabel();
|
||||
m_msLabel->setFocusPolicy(Qt::NoFocus);
|
||||
m_msLabel->setToolTip(tr("BPM in milliseconds"));
|
||||
m_msLabel->setText(tr("0 ms"));
|
||||
|
||||
m_hzLabel = new QLabel();
|
||||
m_hzLabel->setFocusPolicy(Qt::NoFocus);
|
||||
m_hzLabel->setToolTip(tr("Frequency of BPM"));
|
||||
m_hzLabel->setText(tr("0.0000 hz"));
|
||||
|
||||
auto resetButton = new QPushButton(tr("Reset"));
|
||||
resetButton->setFocusPolicy(Qt::NoFocus);
|
||||
resetButton->setToolTip(tr("Reset counter and sidebar information"));
|
||||
|
||||
auto syncButton = new QPushButton(tr("Sync"));
|
||||
syncButton->setFocusPolicy(Qt::NoFocus);
|
||||
syncButton->setToolTip(tr("Sync with project tempo"));
|
||||
|
||||
auto optionLayout = new QVBoxLayout();
|
||||
optionLayout->addWidget(precisionCheckBox);
|
||||
optionLayout->addWidget(muteCheckBox);
|
||||
|
||||
auto bpmInfoLayout = new QVBoxLayout();
|
||||
bpmInfoLayout->addWidget(m_msLabel, 0, Qt::AlignHCenter);
|
||||
bpmInfoLayout->addWidget(m_hzLabel, 0, Qt::AlignHCenter);
|
||||
|
||||
auto sidebarLayout = new QHBoxLayout();
|
||||
sidebarLayout->addLayout(optionLayout);
|
||||
sidebarLayout->addLayout(bpmInfoLayout);
|
||||
|
||||
auto buttonsLayout = new QHBoxLayout();
|
||||
buttonsLayout->addWidget(resetButton, 0, Qt::AlignCenter);
|
||||
buttonsLayout->addWidget(syncButton, 0, Qt::AlignCenter);
|
||||
|
||||
auto mainLayout = new QVBoxLayout(this);
|
||||
mainLayout->addWidget(m_tapButton, 0, Qt::AlignCenter);
|
||||
mainLayout->addLayout(buttonsLayout);
|
||||
mainLayout->addLayout(sidebarLayout);
|
||||
|
||||
connect(m_tapButton, &QPushButton::pressed, this, [this, muteCheckBox]() {
|
||||
if (!muteCheckBox->isChecked())
|
||||
{
|
||||
const auto timeSigNumerator = Engine::getSong()->getTimeSigModel().getNumerator();
|
||||
Engine::audioEngine()->addPlayHandle(new SamplePlayHandle(
|
||||
m_plugin->m_numTaps % timeSigNumerator == 0 ? "misc/metronome02.ogg" : "misc/metronome01.ogg"));
|
||||
}
|
||||
|
||||
m_plugin->onBpmClick();
|
||||
updateLabels();
|
||||
});
|
||||
|
||||
connect(resetButton, &QPushButton::pressed, this, [this]() { closeEvent(nullptr); });
|
||||
|
||||
connect(precisionCheckBox, &QCheckBox::toggled, [this](bool checked) {
|
||||
m_plugin->m_showDecimal = checked;
|
||||
updateLabels();
|
||||
});
|
||||
|
||||
connect(syncButton, &QPushButton::clicked, this, [this]() {
|
||||
const auto& tempoModel = Engine::getSong()->tempoModel();
|
||||
if (m_plugin->m_bpm < tempoModel.minValue() || m_plugin->m_bpm > tempoModel.maxValue()) { return; }
|
||||
Engine::getSong()->setTempo(std::round(m_plugin->m_bpm));
|
||||
});
|
||||
|
||||
hide();
|
||||
if (parentWidget())
|
||||
{
|
||||
parentWidget()->hide();
|
||||
parentWidget()->layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||
|
||||
Qt::WindowFlags flags = parentWidget()->windowFlags();
|
||||
flags |= Qt::MSWindowsFixedSizeDialogHint;
|
||||
flags &= ~Qt::WindowMaximizeButtonHint;
|
||||
parentWidget()->setWindowFlags(flags);
|
||||
}
|
||||
}
|
||||
|
||||
void TapTempoView::updateLabels()
|
||||
{
|
||||
const double bpm = m_plugin->m_showDecimal ? m_plugin->m_bpm : std::round(m_plugin->m_bpm);
|
||||
const double hz = bpm / 60;
|
||||
const double ms = bpm > 0 ? 1 / hz * 1000 : 0;
|
||||
|
||||
m_tapButton->setText(QString::number(bpm, 'f', m_plugin->m_showDecimal ? 1 : 0));
|
||||
m_msLabel->setText(tr("%1 ms").arg(ms, 0, 'f', m_plugin->m_showDecimal ? 1 : 0));
|
||||
m_hzLabel->setText(tr("%1 hz").arg(hz, 0, 'f', 4));
|
||||
}
|
||||
|
||||
void TapTempoView::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
QWidget::keyPressEvent(event);
|
||||
if (!event->isAutoRepeat()) { m_plugin->onBpmClick(); }
|
||||
}
|
||||
|
||||
void TapTempoView::closeEvent(QCloseEvent*)
|
||||
{
|
||||
m_plugin->m_numTaps = 0;
|
||||
m_plugin->m_bpm = 0;
|
||||
updateLabels();
|
||||
}
|
||||
|
||||
} // namespace lmms::gui
|
||||
64
plugins/TapTempo/TapTempoView.h
Normal file
64
plugins/TapTempo/TapTempoView.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* TapTempoView.h - Plugin to count beats per minute
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2022 saker <sakertooth@gmail.com>
|
||||
*
|
||||
*
|
||||
* This file is part of LMMS - https://lmms.io
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LMMS_GUI_TAP_TEMPO_VIEW_H
|
||||
#define LMMS_GUI_TAP_TEMPO_VIEW_H
|
||||
|
||||
#include "ToolPluginView.h"
|
||||
|
||||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
class QPushButton;
|
||||
class QLabel;
|
||||
class QCloseEvent;
|
||||
class QKeyEvent;
|
||||
class QCheckBox;
|
||||
|
||||
namespace lmms {
|
||||
class TapTempo;
|
||||
}
|
||||
|
||||
namespace lmms::gui {
|
||||
|
||||
class TapTempoView : public ToolPluginView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TapTempoView(TapTempo* plugin);
|
||||
void updateLabels();
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
void closeEvent(QCloseEvent*) override;
|
||||
|
||||
private:
|
||||
QPushButton* m_tapButton;
|
||||
QLabel* m_msLabel;
|
||||
QLabel* m_hzLabel;
|
||||
TapTempo* m_plugin;
|
||||
friend class TapTempo;
|
||||
};
|
||||
} // namespace lmms::gui
|
||||
|
||||
#endif // LMMS_GUI_TAP_TEMPO_VIEW_H
|
||||
BIN
plugins/TapTempo/logo.png
Normal file
BIN
plugins/TapTempo/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 510 B |
@@ -57,7 +57,7 @@ Plugin::Descriptor PLUGIN_EXPORT tripleoscillator_plugin_descriptor =
|
||||
"in several ways" ),
|
||||
"Tobias Doerffel <tobydox/at/users.sf.net>",
|
||||
0x0110,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -84,10 +84,10 @@ OscillatorObject::OscillatorObject( Model * _parent, int _idx ) :
|
||||
tr( "Osc %1 phase-offset" ).arg( _idx+1 ) ),
|
||||
m_stereoPhaseDetuningModel( 0.0f, 0.0f, 360.0f, 1.0f, this,
|
||||
tr( "Osc %1 stereo phase-detuning" ).arg( _idx+1 ) ),
|
||||
m_waveShapeModel( Oscillator::SineWave, 0,
|
||||
m_waveShapeModel( static_cast<int>(Oscillator::WaveShape::Sine), 0,
|
||||
Oscillator::NumWaveShapes-1, this,
|
||||
tr( "Osc %1 wave shape" ).arg( _idx+1 ) ),
|
||||
m_modulationAlgoModel( Oscillator::SignalMix, 0,
|
||||
m_modulationAlgoModel( static_cast<int>(Oscillator::ModulationAlgo::SignalMix), 0,
|
||||
Oscillator::NumModulationAlgos-1, this,
|
||||
tr( "Modulation type %1" ).arg( _idx+1 ) ),
|
||||
m_useWaveTableModel(true),
|
||||
@@ -308,7 +308,7 @@ QString TripleOscillator::nodeName() const
|
||||
void TripleOscillator::playNote( NotePlayHandle * _n,
|
||||
sampleFrame * _working_buffer )
|
||||
{
|
||||
if( _n->totalFramesPlayed() == 0 || _n->m_pluginData == nullptr )
|
||||
if (!_n->m_pluginData)
|
||||
{
|
||||
auto oscs_l = std::array<Oscillator*, NUM_OF_OSCILLATORS>{};
|
||||
auto oscs_r = std::array<Oscillator*, NUM_OF_OSCILLATORS>{};
|
||||
@@ -426,7 +426,7 @@ class TripleOscKnob : public Knob
|
||||
{
|
||||
public:
|
||||
TripleOscKnob( QWidget * _parent ) :
|
||||
Knob( knobStyled, _parent )
|
||||
Knob( KnobType::Styled, _parent )
|
||||
{
|
||||
setFixedSize( 28, 35 );
|
||||
}
|
||||
@@ -554,7 +554,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
|
||||
int knob_y = osc_y + i * osc_h;
|
||||
|
||||
// setup volume-knob
|
||||
auto vk = new Knob(knobStyled, this);
|
||||
auto vk = new Knob(KnobType::Styled, this);
|
||||
vk->setVolumeKnob( true );
|
||||
vk->setFixedSize( 28, 35 );
|
||||
vk->move( 6, knob_y );
|
||||
|
||||
@@ -79,7 +79,7 @@ VecControlsDialog::VecControlsDialog(VecControls *controls) :
|
||||
config_layout->addStretch();
|
||||
|
||||
// Persistence knob
|
||||
auto persistenceKnob = new Knob(knobSmall_17, this);
|
||||
auto persistenceKnob = new Knob(KnobType::Small17, this);
|
||||
persistenceKnob->setModel(&controls->m_persistenceModel);
|
||||
persistenceKnob->setLabel(tr("Persist."));
|
||||
persistenceKnob->setToolTip(tr("Trace persistence: higher amount means the trace will stay bright for longer time."));
|
||||
|
||||
@@ -39,7 +39,7 @@ extern "C" {
|
||||
QT_TRANSLATE_NOOP("PluginBrowser", "A stereo field visualizer."),
|
||||
"Martin Pavelek <he29/dot/HS/at/gmail/dot/com>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
Plugin::Type::Effect,
|
||||
new PluginPixmapLoader("logo"),
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
||||
@@ -77,7 +77,7 @@ Plugin::Descriptor Q_DECL_EXPORT vestige_plugin_descriptor =
|
||||
"VST-host for using VST(i)-plugins within LMMS" ),
|
||||
"Tobias Doerffel <tobydox/at/users.sf.net>",
|
||||
0x0100,
|
||||
Plugin::Instrument,
|
||||
Plugin::Type::Instrument,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
#ifdef LMMS_BUILD_LINUX
|
||||
"dll,so",
|
||||
@@ -185,8 +185,8 @@ VestigeInstrument::~VestigeInstrument()
|
||||
}
|
||||
|
||||
Engine::audioEngine()->removePlayHandlesOfTypes( instrumentTrack(),
|
||||
PlayHandle::TypeNotePlayHandle
|
||||
| PlayHandle::TypeInstrumentPlayHandle );
|
||||
PlayHandle::Type::NotePlayHandle
|
||||
| PlayHandle::Type::InstrumentPlayHandle );
|
||||
closePlugin();
|
||||
}
|
||||
|
||||
@@ -1004,7 +1004,7 @@ ManageVestigeInstrumentView::ManageVestigeInstrumentView( Instrument * _instrume
|
||||
sprintf(paramStr.data(), "param%d", i);
|
||||
s_dumpValues = dump[paramStr.data()].split(":");
|
||||
|
||||
vstKnobs[ i ] = new CustomTextKnob( knobBright_26, this, s_dumpValues.at( 1 ) );
|
||||
vstKnobs[ i ] = new CustomTextKnob( KnobType::Bright26, this, s_dumpValues.at( 1 ) );
|
||||
vstKnobs[ i ]->setDescription( s_dumpValues.at( 1 ) + ":" );
|
||||
vstKnobs[ i ]->setLabel( s_dumpValues.at( 1 ).left( 15 ) );
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
|
||||
virtual Flags flags() const
|
||||
{
|
||||
return IsSingleStreamed | IsMidiBased;
|
||||
return Flag::IsSingleStreamed | Flag::IsMidiBased;
|
||||
}
|
||||
|
||||
virtual bool handleMidiEvent( const MidiEvent& event, const TimePos& time, f_cnt_t offset = 0 );
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(vibedstrings Vibed.cpp NineButtonSelector.cpp StringContainer.cpp VibratingString.cpp Vibed.h NineButtonSelector.h StringContainer.h VibratingString.h MOCFILES Vibed.h NineButtonSelector.h EMBEDDED_RESOURCES *.png)
|
||||
BUILD_PLUGIN(vibedstrings Vibed.cpp NineButtonSelector.cpp VibratingString.cpp
|
||||
Vibed.h NineButtonSelector.h VibratingString.h
|
||||
MOCFILES Vibed.h NineButtonSelector.h
|
||||
EMBEDDED_RESOURCES *.png)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user