Merge branch 'master' into arpDownUp
52
data/presets/Kicker/Clap.xpf
Normal file
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE lmms-project>
|
||||
<lmms-project version="1.0" creator="LMMS" creatorversion="1.0.0" type="instrumenttracksettings">
|
||||
<head/>
|
||||
<instrumenttracksettings muted="0" type="0" name="Clap" solo="0">
|
||||
<instrumenttrack pan="0" fxch="0" pitchrange="1" pitch="0" basenote="57" vol="200">
|
||||
<instrument name="kicker">
|
||||
<kicker click="0.4" endnote="0" decay="439" noise="1" slope="0.06" dist="0" env="0.708" startnote="0" startfreq="150" endfreq="40" gain="1" version="1"/>
|
||||
</instrument>
|
||||
<eldata fres="1.64" ftype="8" fcut="2765" fwet="1">
|
||||
<elvol lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="-1" syncmode="0" latt="0" rel="0.1" amt="0" x100="1" att="0" lpdel="0" hold="0.5" lshp="2" lspd="0.0997" ctlenvamt="0" lspd_numerator="4"/>
|
||||
<elcut lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="1" syncmode="0" latt="0" rel="0.1" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="2" lspd="0.001" ctlenvamt="1" lspd_numerator="4"/>
|
||||
<elres lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="0" syncmode="0" latt="0" rel="0.1" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="0" lspd="0.1" ctlenvamt="0" lspd_numerator="4"/>
|
||||
</eldata>
|
||||
<chordcreator chord="0" chordrange="1" chord-enabled="0"/>
|
||||
<arpeggiator arptime="100" arprange="1" arptime_denominator="4" syncmode="0" arpmode="0" arp-enabled="0" arp="0" arptime_numerator="4" arpdir="0" arpgate="100"/>
|
||||
<midiport inputcontroller="0" fixedoutputvelocity="-1" inputchannel="0" outputcontroller="0" writable="0" outputchannel="1" fixedinputvelocity="-1" fixedoutputnote="-1" outputprogram="1" basevelocity="63" readable="0"/>
|
||||
<fxchain numofeffects="2" enabled="1">
|
||||
<effect autoquit_numerator="4" autoquit_denominator="4" syncmode="0" autoquit="1" gate="0" name="ladspaeffect" wet="1" on="1">
|
||||
<ladspacontrols ports="10">
|
||||
<port02 data="0"/>
|
||||
<port03 data="0"/>
|
||||
<port04 data="0"/>
|
||||
<port05 data="0"/>
|
||||
<port06 data="0"/>
|
||||
<port07 data="0"/>
|
||||
<port08 data="0"/>
|
||||
<port09 data="4.14"/>
|
||||
<port010 data="9.9"/>
|
||||
<port011 data="0"/>
|
||||
</ladspacontrols>
|
||||
<key>
|
||||
<attribute value="caps" name="file"/>
|
||||
<attribute value="Eq2x2" name="plugin"/>
|
||||
</key>
|
||||
</effect>
|
||||
<effect autoquit_numerator="4" autoquit_denominator="4" syncmode="0" autoquit="8000" gate="0" name="ladspaeffect" wet="1" on="1">
|
||||
<ladspacontrols ports="4">
|
||||
<port02 data="0.121765"/>
|
||||
<port03 data="0.10486"/>
|
||||
<port04 data="0.687156"/>
|
||||
<port05 data="0.31"/>
|
||||
</ladspacontrols>
|
||||
<key>
|
||||
<attribute value="caps" name="file"/>
|
||||
<attribute value="Plate2x2" name="plugin"/>
|
||||
</key>
|
||||
</effect>
|
||||
</fxchain>
|
||||
</instrumenttrack>
|
||||
</instrumenttracksettings>
|
||||
</lmms-project>
|
||||
21
data/presets/Kicker/HihatClosed.xpf
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE lmms-project>
|
||||
<lmms-project version="1.0" creator="LMMS" creatorversion="1.0.0" type="instrumenttracksettings">
|
||||
<head/>
|
||||
<instrumenttracksettings muted="0" type="0" name="Closed Hihat" solo="0">
|
||||
<instrumenttrack pan="0" fxch="0" pitchrange="1" pitch="0" basenote="57" vol="100">
|
||||
<instrument name="kicker">
|
||||
<kicker click="0.4" endnote="0" decay="440" noise="1" slope="0.06" dist="0.8" env="0.202" startnote="0" startfreq="150" endfreq="40" gain="1" version="1"/>
|
||||
</instrument>
|
||||
<eldata fres="2.66" ftype="1" fcut="4184" fwet="1">
|
||||
<elvol lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="0" syncmode="0" latt="0" rel="0.1" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="0" lspd="0.1" ctlenvamt="0" lspd_numerator="4"/>
|
||||
<elcut lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="0" syncmode="0" latt="0" rel="0.1" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="0" lspd="0.1" ctlenvamt="0" lspd_numerator="4"/>
|
||||
<elres lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="0" syncmode="0" latt="0" rel="0.1" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="0" lspd="0.1" ctlenvamt="0" lspd_numerator="4"/>
|
||||
</eldata>
|
||||
<chordcreator chord="0" chordrange="1" chord-enabled="0"/>
|
||||
<arpeggiator arptime="100" arprange="1" arptime_denominator="4" syncmode="0" arpmode="0" arp-enabled="0" arp="0" arptime_numerator="4" arpdir="0" arpgate="100"/>
|
||||
<midiport inputcontroller="0" fixedoutputvelocity="-1" inputchannel="0" outputcontroller="0" writable="0" outputchannel="1" fixedinputvelocity="-1" fixedoutputnote="-1" outputprogram="1" basevelocity="63" readable="0"/>
|
||||
<fxchain numofeffects="0" enabled="0"/>
|
||||
</instrumenttrack>
|
||||
</instrumenttracksettings>
|
||||
</lmms-project>
|
||||
21
data/presets/Kicker/HihatOpen.xpf
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE lmms-project>
|
||||
<lmms-project version="1.0" creator="LMMS" creatorversion="1.0.0" type="instrumenttracksettings">
|
||||
<head/>
|
||||
<instrumenttracksettings muted="0" type="0" name="Open Hihat" solo="0">
|
||||
<instrumenttrack pan="0" fxch="0" pitchrange="1" pitch="0" basenote="57" vol="100">
|
||||
<instrument name="kicker">
|
||||
<kicker click="0.4" endnote="0" decay="1605" noise="1" slope="0.06" dist="0.8" env="0.273" startnote="0" startfreq="150" endfreq="40" gain="1" version="1"/>
|
||||
</instrument>
|
||||
<eldata fres="2.2" ftype="1" fcut="5062" fwet="1">
|
||||
<elvol lspd_denominator="4" sustain="0.002" pdel="0" userwavefile="" dec="0.216" lamt="0" syncmode="0" latt="0" rel="0" amt="1" x100="0" att="0" lpdel="0" hold="0.008" lshp="0" lspd="0.1" ctlenvamt="0" lspd_numerator="4"/>
|
||||
<elcut lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="0" syncmode="0" latt="0" rel="0.1" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="0" lspd="0.1" ctlenvamt="0" lspd_numerator="4"/>
|
||||
<elres lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="0" syncmode="0" latt="0" rel="0.1" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="0" lspd="0.1" ctlenvamt="0" lspd_numerator="4"/>
|
||||
</eldata>
|
||||
<chordcreator chord="0" chordrange="1" chord-enabled="0"/>
|
||||
<arpeggiator arptime="100" arprange="1" arptime_denominator="4" syncmode="0" arpmode="0" arp-enabled="0" arp="0" arptime_numerator="4" arpdir="0" arpgate="100"/>
|
||||
<midiport inputcontroller="0" fixedoutputvelocity="-1" inputchannel="0" outputcontroller="0" writable="0" outputchannel="1" fixedinputvelocity="-1" fixedoutputnote="-1" outputprogram="1" basevelocity="63" readable="0"/>
|
||||
<fxchain numofeffects="0" enabled="0"/>
|
||||
</instrumenttrack>
|
||||
</instrumenttracksettings>
|
||||
</lmms-project>
|
||||
21
data/presets/Kicker/Shaker.xpf
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE lmms-project>
|
||||
<lmms-project version="1.0" creator="LMMS" creatorversion="1.0.0" type="instrumenttracksettings">
|
||||
<head/>
|
||||
<instrumenttracksettings muted="0" type="0" name="Shaker" solo="0">
|
||||
<instrumenttrack pan="0" fxch="0" pitchrange="1" pitch="0" basenote="105" vol="22.7">
|
||||
<instrument name="kicker">
|
||||
<kicker click="0.95" endnote="1" decay="2000" noise="0.65" slope="1" dist="7.4" env="0.737" startnote="1" startfreq="150" endfreq="132" gain="1" version="1"/>
|
||||
</instrument>
|
||||
<eldata fres="0.5" ftype="1" fcut="3085" fwet="1">
|
||||
<elvol lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="0" syncmode="0" latt="0" rel="0.1" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="0" lspd="0.1" ctlenvamt="0" lspd_numerator="4"/>
|
||||
<elcut lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="0" syncmode="0" latt="0" rel="0.1" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="0" lspd="0.1" ctlenvamt="0" lspd_numerator="4"/>
|
||||
<elres lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="0" syncmode="0" latt="0" rel="0.1" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="0" lspd="0.1" ctlenvamt="0" lspd_numerator="4"/>
|
||||
</eldata>
|
||||
<chordcreator chord="0" chordrange="1" chord-enabled="0"/>
|
||||
<arpeggiator arptime="100" arprange="1" arptime_denominator="4" syncmode="0" arpmode="0" arp-enabled="0" arp="0" arptime_numerator="4" arpdir="0" arpgate="100"/>
|
||||
<midiport inputcontroller="0" fixedoutputvelocity="-1" inputchannel="0" outputcontroller="0" writable="0" outputchannel="1" fixedinputvelocity="-1" fixedoutputnote="-1" outputprogram="1" basevelocity="127" readable="0"/>
|
||||
<fxchain numofeffects="0" enabled="0"/>
|
||||
</instrumenttrack>
|
||||
</instrumenttracksettings>
|
||||
</lmms-project>
|
||||
21
data/presets/Kicker/SnareLong.xpf
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE lmms-project>
|
||||
<lmms-project version="1.0" creator="LMMS" creatorversion="1.0.0" type="instrumenttracksettings">
|
||||
<head/>
|
||||
<instrumenttracksettings muted="0" type="0" name="Snare" solo="0">
|
||||
<instrumenttrack pan="0" fxch="0" pitchrange="1" pitch="0" basenote="57" vol="100">
|
||||
<instrument name="kicker">
|
||||
<kicker click="0.4" endnote="0" decay="861" noise="1" slope="0.06" dist="0" env="1" startnote="0" startfreq="150" endfreq="40" gain="1" version="1"/>
|
||||
</instrument>
|
||||
<eldata fres="0.64" ftype="3" fcut="988" fwet="1">
|
||||
<elvol lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="0" syncmode="0" latt="0" rel="0.1" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="2" lspd="0.0997" ctlenvamt="0" lspd_numerator="4"/>
|
||||
<elcut lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="0" syncmode="0" latt="0" rel="0.1" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="2" lspd="0.001" ctlenvamt="0" lspd_numerator="4"/>
|
||||
<elres lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="0" syncmode="0" latt="0" rel="0.1" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="0" lspd="0.1" ctlenvamt="0" lspd_numerator="4"/>
|
||||
</eldata>
|
||||
<chordcreator chord="0" chordrange="1" chord-enabled="0"/>
|
||||
<arpeggiator arptime="100" arprange="1" arptime_denominator="4" syncmode="0" arpmode="0" arp-enabled="0" arp="0" arptime_numerator="4" arpdir="0" arpgate="100"/>
|
||||
<midiport inputcontroller="0" fixedoutputvelocity="-1" inputchannel="0" outputcontroller="0" writable="0" outputchannel="1" fixedinputvelocity="-1" fixedoutputnote="-1" outputprogram="1" basevelocity="63" readable="0"/>
|
||||
<fxchain numofeffects="0" enabled="0"/>
|
||||
</instrumenttrack>
|
||||
</instrumenttracksettings>
|
||||
</lmms-project>
|
||||
|
Before Width: | Height: | Size: 522 B |
BIN
data/themes/default/loop_point_b.png
Normal file
|
After Width: | Height: | Size: 472 B |
BIN
data/themes/default/loop_point_e.png
Normal file
|
After Width: | Height: | Size: 474 B |
|
Before Width: | Height: | Size: 467 B After Width: | Height: | Size: 916 B |
|
Before Width: | Height: | Size: 471 B After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 267 B After Width: | Height: | Size: 270 B |
@@ -245,6 +245,18 @@ nStateButton {
|
||||
min-width: 26px;
|
||||
}
|
||||
|
||||
/* track background colors */
|
||||
trackContentWidget {
|
||||
qproperty-darkerColor1: rgb( 50, 50, 50 );
|
||||
qproperty-darkerColor2: rgb( 20, 20, 20 );
|
||||
qproperty-darkerColor3: rgb( 15, 15, 15 );
|
||||
qproperty-lighterColor1: rgb( 50, 50, 50 );
|
||||
qproperty-lighterColor2: rgb( 40, 40, 40 );
|
||||
qproperty-lighterColor3: rgb( 30, 30, 30 );
|
||||
qproperty-gradMidPoint: 0.33;
|
||||
}
|
||||
|
||||
|
||||
/* gear button in tracks */
|
||||
|
||||
trackOperationsWidget > QPushButton {
|
||||
@@ -472,16 +484,27 @@ TrackContainerView QLabel
|
||||
/* instrument pattern */
|
||||
patternView {
|
||||
color: rgb( 119, 199, 216 );
|
||||
qproperty-fgColor: rgb( 187, 227, 236 );
|
||||
qproperty-textColor: rgb( 255, 255, 255 );
|
||||
}
|
||||
|
||||
/* sample track pattern */
|
||||
SampleTCOView {
|
||||
color: rgb( 74, 253, 133 );
|
||||
qproperty-fgColor: rgb( 187, 227, 236 );
|
||||
qproperty-textColor: rgb( 255, 60, 60 );
|
||||
}
|
||||
|
||||
/* automation pattern */
|
||||
AutomationPatternView {
|
||||
color: #99afff;
|
||||
qproperty-fgColor: rgb( 204, 215, 255 );
|
||||
qproperty-textColor: rgb( 255, 255, 255 );
|
||||
}
|
||||
|
||||
/* bb-pattern */
|
||||
bbTCOView {
|
||||
qproperty-textColor: rgb( 255, 255, 255 );
|
||||
}
|
||||
|
||||
/* Plugins */
|
||||
@@ -644,6 +667,16 @@ WatsynView knob#xtalkKnob {
|
||||
qproperty-outerColor: #fb50fb;
|
||||
}
|
||||
|
||||
MonstroView knob {
|
||||
color: #ffffff;
|
||||
qproperty-outerColor: #aaaaaa;
|
||||
qproperty-outerRadius: 9;
|
||||
qproperty-innerRadius: 6;
|
||||
qproperty-centerPointX: 10;
|
||||
qproperty-centerPointY: 10;
|
||||
qproperty-lineWidth: 2.5;
|
||||
}
|
||||
|
||||
/* palette information - each colour definition must be on a single line, and the line must begin with "palette:", with no leading whitespace
|
||||
* colour codes MUST be of the form #RRGGBB */
|
||||
|
||||
|
||||
@@ -33,11 +33,15 @@ class AutomationPattern;
|
||||
class AutomationPatternView : public trackContentObjectView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
// theming qproperties
|
||||
Q_PROPERTY( QColor fgColor READ fgColor WRITE setFgColor )
|
||||
Q_PROPERTY( QColor textColor READ textColor WRITE setTextColor )
|
||||
|
||||
public:
|
||||
AutomationPatternView( AutomationPattern * _pat, trackView * _parent );
|
||||
virtual ~AutomationPatternView();
|
||||
|
||||
|
||||
public slots:
|
||||
virtual void update();
|
||||
|
||||
@@ -67,7 +71,6 @@ private:
|
||||
bool m_needsUpdate;
|
||||
|
||||
void scaleTimemapToFit( float oldMin, float oldMax );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -46,6 +46,11 @@ class EXPORT SampleBuffer : public QObject, public sharedObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum LoopMode {
|
||||
LoopOff = 0,
|
||||
LoopOn,
|
||||
LoopPingPong
|
||||
};
|
||||
class EXPORT handleState
|
||||
{
|
||||
public:
|
||||
@@ -62,11 +67,21 @@ public:
|
||||
m_frameIndex = _index;
|
||||
}
|
||||
|
||||
inline bool isBackwards() const
|
||||
{
|
||||
return m_isBackwards;
|
||||
}
|
||||
|
||||
inline void setBackwards( bool _backwards )
|
||||
{
|
||||
m_isBackwards = _backwards;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
f_cnt_t m_frameIndex;
|
||||
const bool m_varyingPitch;
|
||||
bool m_isBackwards;
|
||||
SRC_STATE * m_resamplingData;
|
||||
|
||||
friend class SampleBuffer;
|
||||
@@ -86,7 +101,7 @@ public:
|
||||
bool play( sampleFrame * _ab, handleState * _state,
|
||||
const fpp_t _frames,
|
||||
const float _freq,
|
||||
const bool _looped = false );
|
||||
const LoopMode _loopmode = LoopOff );
|
||||
|
||||
void visualize( QPainter & _p, const QRect & _dr, const QRect & _clip, f_cnt_t _from_frame = 0, f_cnt_t _to_frame = 0 );
|
||||
inline void visualize( QPainter & _p, const QRect & _dr, f_cnt_t _from_frame = 0, f_cnt_t _to_frame = 0 )
|
||||
@@ -108,7 +123,7 @@ public:
|
||||
{
|
||||
return m_endFrame;
|
||||
}
|
||||
|
||||
|
||||
inline f_cnt_t loopStartFrame() const
|
||||
{
|
||||
return m_loopStartFrame;
|
||||
@@ -133,6 +148,16 @@ public:
|
||||
m_varLock.unlock();
|
||||
}
|
||||
|
||||
void setAllPointFrames( f_cnt_t _start, f_cnt_t _end, f_cnt_t _loopstart, f_cnt_t _loopend )
|
||||
{
|
||||
m_varLock.lock();
|
||||
m_startFrame = _start;
|
||||
m_endFrame = _end;
|
||||
m_loopStartFrame = _loopstart;
|
||||
m_loopEndFrame = _loopend;
|
||||
m_varLock.unlock();
|
||||
}
|
||||
|
||||
inline f_cnt_t frames() const
|
||||
{
|
||||
return m_frames;
|
||||
@@ -207,23 +232,13 @@ public:
|
||||
|
||||
inline sample_t userWaveSample( const float _sample ) const
|
||||
{
|
||||
// Precise implementation
|
||||
// const float frame = fraction( _sample ) * m_frames;
|
||||
// const f_cnt_t f1 = static_cast<f_cnt_t>( frame );
|
||||
// const f_cnt_t f2 = ( f1 + 1 ) % m_frames;
|
||||
// sample_t waveSample = linearInterpolate( m_data[f1][0],
|
||||
// m_data[f2][0],
|
||||
// fraction( frame ) );
|
||||
// return waveSample;
|
||||
|
||||
// Fast implementation
|
||||
const float frame = _sample * m_frames;
|
||||
f_cnt_t f1 = static_cast<f_cnt_t>( frame ) % m_frames;
|
||||
if( f1 < 0 )
|
||||
{
|
||||
f1 += m_frames;
|
||||
}
|
||||
return m_data[f1][0];
|
||||
return linearInterpolate( m_data[f1][0], m_data[ (f1 + 1) % m_frames ][0], fraction( frame ) );
|
||||
}
|
||||
|
||||
static QString tryToMakeRelative( const QString & _file );
|
||||
@@ -245,7 +260,7 @@ private:
|
||||
void convertIntToFloat ( int_sample_t * & _ibuf, f_cnt_t _frames, int _channels);
|
||||
void directFloatWrite ( sample_t * & _fbuf, f_cnt_t _frames, int _channels);
|
||||
|
||||
f_cnt_t decodeSampleSF( const char * _f, int_sample_t * & _buf,
|
||||
f_cnt_t decodeSampleSF( const char * _f, sample_t * & _buf,
|
||||
ch_cnt_t & _channels,
|
||||
sample_rate_t & _sample_rate );
|
||||
#ifdef LMMS_HAVE_OGGVORBIS
|
||||
@@ -272,10 +287,13 @@ private:
|
||||
float m_frequency;
|
||||
sample_rate_t m_sampleRate;
|
||||
|
||||
sampleFrame * getSampleFragment( f_cnt_t _start, f_cnt_t _frames,
|
||||
bool _looped,
|
||||
sampleFrame * * _tmp ) const;
|
||||
f_cnt_t getLoopedIndex( f_cnt_t _index ) const;
|
||||
sampleFrame * getSampleFragment( f_cnt_t _index, f_cnt_t _frames,
|
||||
LoopMode _loopmode,
|
||||
sampleFrame * * _tmp,
|
||||
bool * _backwards, f_cnt_t _loopstart, f_cnt_t _loopend,
|
||||
f_cnt_t _end ) const;
|
||||
f_cnt_t getLoopedIndex( f_cnt_t _index, f_cnt_t _startf, f_cnt_t _endf ) const;
|
||||
f_cnt_t getPingPongIndex( f_cnt_t _index, f_cnt_t _startf, f_cnt_t _endf ) const;
|
||||
|
||||
|
||||
signals:
|
||||
|
||||
@@ -88,6 +88,11 @@ signals:
|
||||
class SampleTCOView : public trackContentObjectView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
// theming qproperties
|
||||
Q_PROPERTY( QColor fgColor READ fgColor WRITE setFgColor )
|
||||
Q_PROPERTY( QColor textColor READ textColor WRITE setTextColor )
|
||||
|
||||
public:
|
||||
SampleTCOView( SampleTCO * _tco, trackView * _tv );
|
||||
virtual ~SampleTCOView();
|
||||
@@ -108,7 +113,6 @@ protected:
|
||||
|
||||
private:
|
||||
SampleTCO * m_tco;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -113,16 +113,24 @@ const int effGetVstVersion = 58; // currently unused
|
||||
const int kEffectMagic = CCONST( 'V', 's', 't', 'P' );
|
||||
const int kVstLangEnglish = 1;
|
||||
const int kVstMidiType = 1;
|
||||
const int kVstParameterUsesFloatStep = 1 << 2;
|
||||
const int kVstPpqPosValid = 1 << 9;
|
||||
const int kVstTempoValid = 1 << 10;
|
||||
const int kVstBarsValid = 1 << 11;
|
||||
const int kVstCyclePosValid = 1 << 12;
|
||||
const int kVstTimeSigValid = 1 << 13;
|
||||
|
||||
const int kVstTransportPlaying = 1 << 1;
|
||||
const int kVstTransportCycleActive = 1 << 2;
|
||||
const int kVstTransportChanged = 1;
|
||||
|
||||
/* validity flags for a VstTimeInfo structure, this info comes from the web */
|
||||
|
||||
const int kVstNanosValid (1 << 8);
|
||||
const int kVstPpqPosValid (1 << 9);
|
||||
const int kVstTempoValid (1 << 10);
|
||||
const int kVstBarsValid (1 << 11);
|
||||
const int kVstCyclePosValid (1 << 12);
|
||||
const int kVstTimeSigValid (1 << 13);
|
||||
const int kVstSmpteValid (1 << 14);
|
||||
const int kVstClockValid (1 << 15);
|
||||
|
||||
|
||||
|
||||
|
||||
class RemoteVstPlugin;
|
||||
|
||||
@@ -180,43 +188,50 @@ public:
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
// Not finished, neither really used
|
||||
class VstParameterProperties
|
||||
/* constants from http://www.rawmaterialsoftware.com/juceforum/viewtopic.php?t=3740&sid=183f74631fee71a493316735e2b9f28b */
|
||||
enum Vestige2StringConstants
|
||||
{
|
||||
public:
|
||||
/* float stepFloat;
|
||||
char label[64];
|
||||
int flags;
|
||||
int minInteger;
|
||||
int maxInteger;
|
||||
int stepInteger;
|
||||
char shortLabel[8];
|
||||
int category;
|
||||
char categoryLabel[24];
|
||||
char empty[128];*/
|
||||
|
||||
float stepFloat;
|
||||
float smallStepFloat;
|
||||
float largeStepFloat;
|
||||
char label[64];
|
||||
unsigned int flags;
|
||||
unsigned int minInteger;
|
||||
unsigned int maxInteger;
|
||||
unsigned int stepInteger;
|
||||
unsigned int largeStepInteger;
|
||||
char shortLabel[8];
|
||||
unsigned short displayIndex;
|
||||
unsigned short category;
|
||||
unsigned short numParametersInCategory;
|
||||
unsigned short reserved;
|
||||
char categoryLabel[24];
|
||||
char future[16];
|
||||
|
||||
} ;
|
||||
VestigeMaxNameLen = 64,
|
||||
VestigeMaxLabelLen = 64,
|
||||
VestigeMaxShortLabelLen = 8,
|
||||
VestigeMaxCategLabelLen = 24,
|
||||
VestigeMaxFileNameLen = 100
|
||||
};
|
||||
|
||||
|
||||
/* this struct taken from http://asseca.com/vst-24-specs/efGetParameterProperties.html */
|
||||
struct VstParameterProperties
|
||||
{
|
||||
float stepFloat; /* float step */
|
||||
float smallStepFloat; /* small float step */
|
||||
float largeStepFloat; /* large float step */
|
||||
char label[VestigeMaxLabelLen]; /* parameter label */
|
||||
int32_t flags; /* @see VstParameterFlags */
|
||||
int32_t minInteger; /* integer minimum */
|
||||
int32_t maxInteger; /* integer maximum */
|
||||
int32_t stepInteger; /* integer step */
|
||||
int32_t largeStepInteger; /* large integer step */
|
||||
char shortLabel[VestigeMaxShortLabelLen]; /* short label, recommended: 6 + delimiter */
|
||||
int16_t displayIndex; /* index where this parameter should be displayed (starting with 0) */
|
||||
int16_t category; /* 0: no category, else group index + 1 */
|
||||
int16_t numParametersInCategory; /* number of parameters in category */
|
||||
int16_t reserved; /* zero */
|
||||
char categoryLabel[VestigeMaxCategLabelLen]; /* category label, e.g. "Osc 1" */
|
||||
char future[16]; /* reserved for future use */
|
||||
};
|
||||
|
||||
|
||||
/* this enum taken from http://asseca.com/vst-24-specs/efGetParameterProperties.html */
|
||||
enum VstParameterFlags
|
||||
{
|
||||
kVstParameterIsSwitch = 1 << 0, /* parameter is a switch (on/off) */
|
||||
kVstParameterUsesIntegerMinMax = 1 << 1, /* minInteger, maxInteger valid */
|
||||
kVstParameterUsesFloatStep = 1 << 2, /* stepFloat, smallStepFloat, largeStepFloat valid */
|
||||
kVstParameterUsesIntStep = 1 << 3, /* stepInteger, largeStepInteger valid */
|
||||
kVstParameterSupportsDisplayIndex = 1 << 4, /* displayIndex valid */
|
||||
kVstParameterSupportsDisplayCategory = 1 << 5, /* category, etc. valid */
|
||||
kVstParameterCanRamp = 1 << 6 /* set if parameter value can ramp up/down */
|
||||
};
|
||||
|
||||
|
||||
class AEffect
|
||||
@@ -274,7 +289,7 @@ public:
|
||||
// 08
|
||||
double sampleRate;
|
||||
// unconfirmed 10
|
||||
char empty1[8];
|
||||
double nanoSeconds;
|
||||
// 18
|
||||
double ppqPos;
|
||||
// 20?
|
||||
@@ -286,13 +301,15 @@ public:
|
||||
// 38?
|
||||
double cycleEndPos;
|
||||
// 40?
|
||||
int timeSigNumerator;
|
||||
int32_t timeSigNumerator;
|
||||
// 44?
|
||||
int timeSigDenominator;
|
||||
// unconfirmed 48 4c 50
|
||||
char empty3[4 + 4 + 4];
|
||||
int32_t timeSigDenominator;
|
||||
|
||||
int32_t smpteOffset;
|
||||
int32_t smpteFrameRate;
|
||||
int32_t samplesToNextClock;
|
||||
// 54
|
||||
int flags;
|
||||
int32_t flags;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _INTERPOLATION_H
|
||||
#define _INTERPOLATION_H
|
||||
#ifndef INTERPOLATION_H
|
||||
#define INTERPOLATION_H
|
||||
|
||||
#ifndef __USE_XOPEN
|
||||
#define __USE_XOPEN
|
||||
@@ -80,14 +80,21 @@ inline float cubicInterpolate( float v0, float v1, float v2, float v3, float x )
|
||||
inline float cosinusInterpolate( float v0, float v1, float x )
|
||||
{
|
||||
float f = cosf( x * ( F_PI_2 ) );
|
||||
return( v0*f + v1*( 1.0f-f ) );
|
||||
return( v1 - f * (v1-v0) );
|
||||
// return( v0*f + v1*( 1.0f-f ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline float linearInterpolate( float v0, float v1, float x )
|
||||
{
|
||||
return( v0*( 1.0f-x ) + v1*x );
|
||||
// take advantage of fma function if present in hardware
|
||||
|
||||
#ifdef FP_FAST_FMAF
|
||||
return fmaf( x, v1-v0, v0 );
|
||||
#else
|
||||
return x * (v1-v0) + v0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#ifndef _LMMS_MATH_H
|
||||
#define _LMMS_MATH_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __INTEL_COMPILER
|
||||
|
||||
@@ -106,5 +107,18 @@ static inline int fast_rand()
|
||||
|
||||
|
||||
|
||||
// source: http://martin.ankerl.com/2007/10/04/optimized-pow-approximation-for-java-and-c-c/
|
||||
static inline double fastPow( double a, double b )
|
||||
{
|
||||
union
|
||||
{
|
||||
double d;
|
||||
int32_t x[2];
|
||||
} u = { a };
|
||||
u.x[1] = static_cast<int32_t>( b * ( u.x[1] - 1072632447 ) + 1072632447 );
|
||||
u.x[0] = 0;
|
||||
return u.d;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -147,6 +147,10 @@ private:
|
||||
class patternView : public trackContentObjectView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
// theming qproperties
|
||||
Q_PROPERTY( QColor fgColor READ fgColor WRITE setFgColor )
|
||||
Q_PROPERTY( QColor textColor READ textColor WRITE setTextColor )
|
||||
public:
|
||||
patternView( pattern * _pattern, trackView * _parent );
|
||||
virtual ~patternView();
|
||||
@@ -185,7 +189,6 @@ private:
|
||||
pattern * m_pat;
|
||||
QPixmap m_paintPixmap;
|
||||
bool m_needsUpdate;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -149,7 +149,8 @@ protected:
|
||||
private:
|
||||
static QPixmap * s_timeLinePixmap;
|
||||
static QPixmap * s_posMarkerPixmap;
|
||||
static QPixmap * s_loopPointPixmap;
|
||||
static QPixmap * s_loopPointBeginPixmap;
|
||||
static QPixmap * s_loopPointEndPixmap;
|
||||
static QPixmap * s_loopPointDisabledPixmap;
|
||||
|
||||
AutoScrollStates m_autoScroll;
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <QtCore/QVector>
|
||||
#include <QtCore/QList>
|
||||
#include <QtGui/QWidget>
|
||||
#include <QColor>
|
||||
|
||||
#include "lmms_basics.h"
|
||||
#include "MidiTime.h"
|
||||
@@ -162,6 +163,11 @@ private:
|
||||
class trackContentObjectView : public selectableObject, public ModelView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
// theming qproperties
|
||||
Q_PROPERTY( QColor fgColor READ fgColor WRITE setFgColor )
|
||||
Q_PROPERTY( QColor textColor READ textColor WRITE setTextColor )
|
||||
|
||||
public:
|
||||
trackContentObjectView( trackContentObject * _tco, trackView * _tv );
|
||||
virtual ~trackContentObjectView();
|
||||
@@ -172,7 +178,11 @@ public:
|
||||
{
|
||||
return m_tco;
|
||||
}
|
||||
|
||||
// qproperty access func
|
||||
QColor fgColor() const;
|
||||
QColor textColor() const;
|
||||
void setFgColor( const QColor & _c );
|
||||
void setTextColor( const QColor & _c );
|
||||
|
||||
public slots:
|
||||
virtual bool close();
|
||||
@@ -227,6 +237,9 @@ private:
|
||||
|
||||
MidiTime m_oldTime;// used for undo/redo while mouse-button is pressed
|
||||
|
||||
// qproperty fields
|
||||
QColor * m_fgColor;
|
||||
QColor * m_textColor;
|
||||
} ;
|
||||
|
||||
|
||||
@@ -236,6 +249,18 @@ private:
|
||||
class trackContentWidget : public QWidget, public JournallingObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
// qproperties for track background gradients
|
||||
Q_PROPERTY( QColor darkerColor1 READ darkerColor1 WRITE setDarkerColor1 )
|
||||
Q_PROPERTY( QColor darkerColor2 READ darkerColor2 WRITE setDarkerColor2 )
|
||||
Q_PROPERTY( QColor darkerColor3 READ darkerColor3 WRITE setDarkerColor3 )
|
||||
|
||||
Q_PROPERTY( QColor lighterColor1 READ lighterColor1 WRITE setLighterColor1 )
|
||||
Q_PROPERTY( QColor lighterColor2 READ lighterColor2 WRITE setLighterColor2 )
|
||||
Q_PROPERTY( QColor lighterColor3 READ lighterColor3 WRITE setLighterColor3 )
|
||||
|
||||
Q_PROPERTY( float gradMidPoint READ gradMidPoint WRITE setGradMidPoint )
|
||||
|
||||
public:
|
||||
trackContentWidget( trackView * _parent );
|
||||
virtual ~trackContentWidget();
|
||||
@@ -255,6 +280,28 @@ public:
|
||||
|
||||
MidiTime endPosition( const MidiTime & _pos_start );
|
||||
|
||||
// qproperty access methods
|
||||
|
||||
QColor darkerColor1() const;
|
||||
QColor darkerColor2() const;
|
||||
QColor darkerColor3() const;
|
||||
|
||||
QColor lighterColor1() const;
|
||||
QColor lighterColor2() const;
|
||||
QColor lighterColor3() const;
|
||||
|
||||
float gradMidPoint() const;
|
||||
|
||||
void setDarkerColor1( const QColor & _c );
|
||||
void setDarkerColor2( const QColor & _c );
|
||||
void setDarkerColor3( const QColor & _c );
|
||||
|
||||
void setLighterColor1( const QColor & _c );
|
||||
void setLighterColor2( const QColor & _c );
|
||||
void setLighterColor3( const QColor & _c );
|
||||
|
||||
void setGradMidPoint( float _g );
|
||||
|
||||
public slots:
|
||||
void update();
|
||||
void changePosition( const MidiTime & _new_pos = MidiTime( -1 ) );
|
||||
@@ -295,6 +342,14 @@ private:
|
||||
|
||||
QPixmap m_background;
|
||||
|
||||
// qproperty fields
|
||||
QColor * m_darkerColor1;
|
||||
QColor * m_darkerColor2;
|
||||
QColor * m_darkerColor3;
|
||||
QColor * m_lighterColor1;
|
||||
QColor * m_lighterColor2;
|
||||
QColor * m_lighterColor3;
|
||||
float m_gradMidPoint;
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ ADD_SUBDIRECTORY(LadspaEffect)
|
||||
ADD_SUBDIRECTORY(lb302)
|
||||
#ADD_SUBDIRECTORY(lb303)
|
||||
ADD_SUBDIRECTORY(midi_import)
|
||||
ADD_SUBDIRECTORY(monstro)
|
||||
ADD_SUBDIRECTORY(organic)
|
||||
ADD_SUBDIRECTORY(opl2)
|
||||
ADD_SUBDIRECTORY(papu)
|
||||
|
||||
@@ -70,7 +70,7 @@ seed()
|
||||
extern "C" {
|
||||
|
||||
__attribute__ ((constructor))
|
||||
void _init()
|
||||
void caps_so_init()
|
||||
{
|
||||
DescriptorStub ** d = descriptors;
|
||||
|
||||
@@ -126,7 +126,7 @@ void _init()
|
||||
}
|
||||
|
||||
__attribute__ ((destructor))
|
||||
void _fini()
|
||||
void caps_so_fini()
|
||||
{
|
||||
for (ulong i = 0; i < N; ++i)
|
||||
delete descriptors[i];
|
||||
|
||||
@@ -233,10 +233,10 @@ LADSPA_Descriptor * mono_descriptor = NULL;
|
||||
|
||||
|
||||
|
||||
/* __attribute__((constructor)) _init() is called automatically when the plugin library is first
|
||||
/* _init() is called automatically when the plugin library is first
|
||||
loaded. */
|
||||
void
|
||||
__attribute__((constructor)) _init() {
|
||||
_init() {
|
||||
|
||||
int i;
|
||||
char ** port_names;
|
||||
@@ -341,9 +341,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) {
|
||||
}
|
||||
|
||||
|
||||
/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */
|
||||
/* _fini() is called automatically when the library is unloaded. */
|
||||
void
|
||||
__attribute__((destructor)) _fini() {
|
||||
_fini() {
|
||||
delete_descriptor(mono_descriptor);
|
||||
}
|
||||
|
||||
|
||||
@@ -436,10 +436,10 @@ LADSPA_Descriptor * stereo_descriptor = NULL;
|
||||
|
||||
|
||||
|
||||
/* __attribute__((constructor)) _init() is called automatically when the plugin library is first
|
||||
/* _init() is called automatically when the plugin library is first
|
||||
loaded. */
|
||||
void
|
||||
__attribute__((constructor)) _init() {
|
||||
_init() {
|
||||
|
||||
char ** port_names;
|
||||
LADSPA_PortDescriptor * port_descriptors;
|
||||
@@ -575,9 +575,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) {
|
||||
}
|
||||
|
||||
|
||||
/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */
|
||||
/* _fini() is called automatically when the library is unloaded. */
|
||||
void
|
||||
__attribute__((destructor)) _fini() {
|
||||
_fini() {
|
||||
delete_descriptor(stereo_descriptor);
|
||||
}
|
||||
|
||||
|
||||
@@ -349,10 +349,10 @@ LADSPA_Descriptor * mono_descriptor = NULL;
|
||||
|
||||
|
||||
|
||||
/* __attribute__((constructor)) _init() is called automatically when the plugin library is first
|
||||
/* _init() is called automatically when the plugin library is first
|
||||
loaded. */
|
||||
void
|
||||
__attribute__((constructor)) _init() {
|
||||
_init() {
|
||||
|
||||
int i;
|
||||
char ** port_names;
|
||||
@@ -471,9 +471,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) {
|
||||
}
|
||||
|
||||
|
||||
/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */
|
||||
/* _fini() is called automatically when the library is unloaded. */
|
||||
void
|
||||
__attribute__((destructor)) _fini() {
|
||||
_fini() {
|
||||
delete_descriptor(mono_descriptor);
|
||||
}
|
||||
|
||||
|
||||
@@ -574,10 +574,10 @@ LADSPA_Descriptor * stereo_descriptor = NULL;
|
||||
|
||||
|
||||
|
||||
/* __attribute__((constructor)) _init() is called automatically when the plugin library is first
|
||||
/* _init() is called automatically when the plugin library is first
|
||||
loaded. */
|
||||
void
|
||||
__attribute__((constructor)) _init() {
|
||||
_init() {
|
||||
|
||||
char ** port_names;
|
||||
LADSPA_PortDescriptor * port_descriptors;
|
||||
@@ -717,9 +717,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) {
|
||||
}
|
||||
|
||||
|
||||
/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */
|
||||
/* _fini() is called automatically when the library is unloaded. */
|
||||
void
|
||||
__attribute__((destructor)) _fini() {
|
||||
_fini() {
|
||||
delete_descriptor(stereo_descriptor);
|
||||
}
|
||||
|
||||
|
||||
@@ -516,10 +516,10 @@ LADSPA_Descriptor * mono_descriptor = NULL;
|
||||
|
||||
|
||||
|
||||
/* __attribute__((constructor)) _init() is called automatically when the plugin library is first
|
||||
/* _init() is called automatically when the plugin library is first
|
||||
loaded. */
|
||||
void
|
||||
__attribute__((constructor)) _init() {
|
||||
_init() {
|
||||
|
||||
char ** port_names;
|
||||
LADSPA_PortDescriptor * port_descriptors;
|
||||
@@ -646,9 +646,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) {
|
||||
}
|
||||
|
||||
|
||||
/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */
|
||||
/* _fini() is called automatically when the library is unloaded. */
|
||||
void
|
||||
__attribute__((destructor)) _fini() {
|
||||
_fini() {
|
||||
delete_descriptor(mono_descriptor);
|
||||
}
|
||||
|
||||
|
||||
@@ -696,10 +696,10 @@ LADSPA_Descriptor * stereo_descriptor = NULL;
|
||||
|
||||
|
||||
|
||||
/* __attribute__((constructor)) _init() is called automatically when the plugin library is first
|
||||
/* _init() is called automatically when the plugin library is first
|
||||
loaded. */
|
||||
void
|
||||
__attribute__((constructor)) _init() {
|
||||
_init() {
|
||||
|
||||
char ** port_names;
|
||||
LADSPA_PortDescriptor * port_descriptors;
|
||||
@@ -857,9 +857,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) {
|
||||
}
|
||||
|
||||
|
||||
/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */
|
||||
/* _fini() is called automatically when the library is unloaded. */
|
||||
void
|
||||
__attribute__((destructor)) _fini() {
|
||||
_fini() {
|
||||
delete_descriptor(stereo_descriptor);
|
||||
}
|
||||
|
||||
|
||||
@@ -436,10 +436,10 @@ LADSPA_Descriptor * stereo_descriptor = NULL;
|
||||
|
||||
|
||||
|
||||
/* __attribute__((constructor)) _init() is called automatically when the plugin library is first
|
||||
/* _init() is called automatically when the plugin library is first
|
||||
loaded. */
|
||||
void
|
||||
__attribute__((constructor)) _init() {
|
||||
_init() {
|
||||
|
||||
char ** port_names;
|
||||
LADSPA_PortDescriptor * port_descriptors;
|
||||
@@ -607,9 +607,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) {
|
||||
}
|
||||
|
||||
|
||||
/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */
|
||||
/* _fini() is called automatically when the library is unloaded. */
|
||||
void
|
||||
__attribute__((destructor)) _fini() {
|
||||
_fini() {
|
||||
delete_descriptor(stereo_descriptor);
|
||||
}
|
||||
|
||||
|
||||
@@ -494,7 +494,7 @@ run_adding_eq(LADSPA_Handle instance, unsigned long sample_count) {
|
||||
|
||||
|
||||
void
|
||||
__attribute__((constructor)) _init() {
|
||||
_init() {
|
||||
|
||||
char **port_names;
|
||||
LADSPA_PortDescriptor *port_descriptors;
|
||||
@@ -765,7 +765,7 @@ __attribute__((constructor)) _init() {
|
||||
|
||||
|
||||
void
|
||||
__attribute__((destructor)) _fini() {
|
||||
_fini() {
|
||||
|
||||
if (eqDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)eqDescriptor->PortDescriptors);
|
||||
|
||||
@@ -596,7 +596,7 @@ run_adding_eq(LADSPA_Handle instance, unsigned long sample_count) {
|
||||
|
||||
|
||||
void
|
||||
__attribute__((constructor)) _init() {
|
||||
_init() {
|
||||
|
||||
char **port_names;
|
||||
LADSPA_PortDescriptor *port_descriptors;
|
||||
@@ -955,7 +955,7 @@ __attribute__((constructor)) _init() {
|
||||
|
||||
|
||||
void
|
||||
__attribute__((destructor)) _fini() {
|
||||
_fini() {
|
||||
|
||||
if (eqDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)eqDescriptor->PortDescriptors);
|
||||
|
||||
@@ -324,10 +324,10 @@ LADSPA_Descriptor * mono_descriptor = NULL;
|
||||
|
||||
|
||||
|
||||
/* __attribute__((constructor)) _init() is called automatically when the plugin library is first
|
||||
/* _init() is called automatically when the plugin library is first
|
||||
loaded. */
|
||||
void
|
||||
__attribute__((constructor)) _init() {
|
||||
_init() {
|
||||
|
||||
char ** port_names;
|
||||
LADSPA_PortDescriptor * port_descriptors;
|
||||
@@ -423,9 +423,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) {
|
||||
}
|
||||
|
||||
|
||||
/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */
|
||||
/* _fini() is called automatically when the library is unloaded. */
|
||||
void
|
||||
__attribute__((destructor)) _fini() {
|
||||
_fini() {
|
||||
delete_descriptor(mono_descriptor);
|
||||
}
|
||||
|
||||
|
||||
@@ -225,10 +225,10 @@ LADSPA_Descriptor * mono_descriptor = NULL;
|
||||
|
||||
|
||||
|
||||
/* __attribute__((constructor)) _init() is called automatically when the plugin library is first
|
||||
/* _init() is called automatically when the plugin library is first
|
||||
loaded. */
|
||||
void
|
||||
__attribute__((constructor)) _init() {
|
||||
_init() {
|
||||
|
||||
char ** port_names;
|
||||
LADSPA_PortDescriptor * port_descriptors;
|
||||
@@ -325,9 +325,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) {
|
||||
}
|
||||
|
||||
|
||||
/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */
|
||||
/* _fini() is called automatically when the library is unloaded. */
|
||||
void
|
||||
__attribute__((destructor)) _fini() {
|
||||
_fini() {
|
||||
delete_descriptor(mono_descriptor);
|
||||
}
|
||||
|
||||
|
||||
@@ -418,10 +418,10 @@ LADSPA_Descriptor * mono_descriptor = NULL;
|
||||
|
||||
|
||||
|
||||
/* __attribute__((constructor)) _init() is called automatically when the plugin library is first
|
||||
/* _init() is called automatically when the plugin library is first
|
||||
loaded. */
|
||||
void
|
||||
__attribute__((constructor)) _init() {
|
||||
_init() {
|
||||
|
||||
int i;
|
||||
char ** port_names;
|
||||
@@ -536,9 +536,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) {
|
||||
}
|
||||
|
||||
|
||||
/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */
|
||||
/* _fini() is called automatically when the library is unloaded. */
|
||||
void
|
||||
__attribute__((destructor)) _fini() {
|
||||
_fini() {
|
||||
delete_descriptor(mono_descriptor);
|
||||
}
|
||||
|
||||
|
||||
@@ -378,10 +378,10 @@ LADSPA_Descriptor * mono_descriptor = NULL;
|
||||
|
||||
|
||||
|
||||
/* __attribute__((constructor)) _init() is called automatically when the plugin library is first
|
||||
/* _init() is called automatically when the plugin library is first
|
||||
loaded. */
|
||||
void
|
||||
__attribute__((constructor)) _init() {
|
||||
_init() {
|
||||
|
||||
int i;
|
||||
char ** port_names;
|
||||
@@ -480,9 +480,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) {
|
||||
}
|
||||
|
||||
|
||||
/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */
|
||||
/* _fini() is called automatically when the library is unloaded. */
|
||||
void
|
||||
__attribute__((destructor)) _fini() {
|
||||
_fini() {
|
||||
delete_descriptor(mono_descriptor);
|
||||
}
|
||||
|
||||
|
||||
@@ -665,10 +665,10 @@ LADSPA_Descriptor * stereo_descriptor = NULL;
|
||||
|
||||
|
||||
|
||||
/* __attribute__((constructor)) _init() is called automatically when the plugin library is first
|
||||
/* _init() is called automatically when the plugin library is first
|
||||
loaded. */
|
||||
void
|
||||
__attribute__((constructor)) _init() {
|
||||
_init() {
|
||||
|
||||
char ** port_names;
|
||||
LADSPA_PortDescriptor * port_descriptors;
|
||||
@@ -815,9 +815,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) {
|
||||
}
|
||||
|
||||
|
||||
/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */
|
||||
/* _fini() is called automatically when the library is unloaded. */
|
||||
void
|
||||
__attribute__((destructor)) _fini() {
|
||||
_fini() {
|
||||
delete_descriptor(stereo_descriptor);
|
||||
}
|
||||
|
||||
|
||||
@@ -624,10 +624,10 @@ LADSPA_Descriptor * stereo_descriptor = NULL;
|
||||
|
||||
|
||||
|
||||
/* __attribute__((constructor)) _init() is called automatically when the plugin library is first
|
||||
/* _init() is called automatically when the plugin library is first
|
||||
loaded. */
|
||||
void
|
||||
__attribute__((constructor)) _init() {
|
||||
_init() {
|
||||
|
||||
int i;
|
||||
char ** port_names;
|
||||
@@ -748,9 +748,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) {
|
||||
}
|
||||
|
||||
|
||||
/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */
|
||||
/* _fini() is called automatically when the library is unloaded. */
|
||||
void
|
||||
__attribute__((destructor)) _fini() {
|
||||
_fini() {
|
||||
delete_descriptor(stereo_descriptor);
|
||||
}
|
||||
|
||||
|
||||
@@ -228,10 +228,10 @@ cleanup_Sigmoid(LADSPA_Handle Instance) {
|
||||
LADSPA_Descriptor * mono_descriptor = NULL;
|
||||
|
||||
|
||||
/* __attribute__((constructor)) _init() is called automatically when the plugin library is first
|
||||
/* _init() is called automatically when the plugin library is first
|
||||
loaded. */
|
||||
void
|
||||
__attribute__((constructor)) _init() {
|
||||
_init() {
|
||||
|
||||
char ** port_names;
|
||||
LADSPA_PortDescriptor * port_descriptors;
|
||||
@@ -318,9 +318,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) {
|
||||
}
|
||||
|
||||
|
||||
/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */
|
||||
/* _fini() is called automatically when the library is unloaded. */
|
||||
void
|
||||
__attribute__((destructor)) _fini() {
|
||||
_fini() {
|
||||
delete_descriptor(mono_descriptor);
|
||||
}
|
||||
|
||||
|
||||
@@ -220,10 +220,10 @@ LADSPA_Descriptor * mono_descriptor = NULL;
|
||||
|
||||
|
||||
|
||||
/* __attribute__((constructor)) _init() is called automatically when the plugin library is first
|
||||
/* _init() is called automatically when the plugin library is first
|
||||
loaded. */
|
||||
void
|
||||
__attribute__((constructor)) _init() {
|
||||
_init() {
|
||||
|
||||
char ** port_names;
|
||||
LADSPA_PortDescriptor * port_descriptors;
|
||||
@@ -323,9 +323,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) {
|
||||
}
|
||||
|
||||
|
||||
/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */
|
||||
/* _fini() is called automatically when the library is unloaded. */
|
||||
void
|
||||
__attribute__((destructor)) _fini() {
|
||||
_fini() {
|
||||
delete_descriptor(mono_descriptor);
|
||||
}
|
||||
|
||||
|
||||
@@ -381,10 +381,10 @@ LADSPA_Descriptor * mono_descriptor = NULL;
|
||||
|
||||
|
||||
|
||||
/* __attribute__((constructor)) _init() is called automatically when the plugin library is first
|
||||
/* _init() is called automatically when the plugin library is first
|
||||
loaded. */
|
||||
void
|
||||
__attribute__((constructor)) _init() {
|
||||
_init() {
|
||||
|
||||
char ** port_names;
|
||||
LADSPA_PortDescriptor * port_descriptors;
|
||||
@@ -471,9 +471,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) {
|
||||
}
|
||||
|
||||
|
||||
/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */
|
||||
/* _fini() is called automatically when the library is unloaded. */
|
||||
void
|
||||
__attribute__((destructor)) _fini() {
|
||||
_fini() {
|
||||
delete_descriptor(mono_descriptor);
|
||||
}
|
||||
|
||||
|
||||
@@ -308,10 +308,10 @@ LADSPA_Descriptor * mono_descriptor = NULL;
|
||||
|
||||
|
||||
|
||||
/* __attribute__((constructor)) _init() is called automatically when the plugin library is first
|
||||
/* _init() is called automatically when the plugin library is first
|
||||
loaded. */
|
||||
void
|
||||
__attribute__((constructor)) _init() {
|
||||
_init() {
|
||||
|
||||
int i;
|
||||
char ** port_names;
|
||||
@@ -425,9 +425,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) {
|
||||
}
|
||||
|
||||
|
||||
/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */
|
||||
/* _fini() is called automatically when the library is unloaded. */
|
||||
void
|
||||
__attribute__((destructor)) _fini() {
|
||||
_fini() {
|
||||
delete_descriptor(mono_descriptor);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* audio_file_processor.cpp - instrument for using audio-files
|
||||
*
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -76,9 +76,10 @@ audioFileProcessor::audioFileProcessor( InstrumentTrack * _instrument_track ) :
|
||||
m_endPointModel( 1, 0, 1, 0.0000001f, this, tr( "End of sample" ) ),
|
||||
m_loopPointModel( 0, 0, 1, 0.0000001f, this, tr( "Loopback point" ) ),
|
||||
m_reverseModel( false, this, tr( "Reverse sample" ) ),
|
||||
m_loopModel( false, this, tr( "Loop enabled" ) ),
|
||||
m_loopModel( 0, 0, 2, this, tr( "Loop mode" ) ),
|
||||
m_stutterModel( false, this, tr( "Stutter" ) ),
|
||||
m_nextPlayStartPoint( 0 )
|
||||
m_nextPlayStartPoint( 0 ),
|
||||
m_nextPlayBackwards( false )
|
||||
{
|
||||
connect( &m_reverseModel, SIGNAL( dataChanged() ),
|
||||
this, SLOT( reverseModelChanged() ) );
|
||||
@@ -116,6 +117,7 @@ void audioFileProcessor::playNote( NotePlayHandle * _n,
|
||||
if( m_stutterModel.value() == true && _n->frequency() < 20.0 )
|
||||
{
|
||||
m_nextPlayStartPoint = m_sampleBuffer.startFrame();
|
||||
m_nextPlayBackwards = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -126,9 +128,11 @@ void audioFileProcessor::playNote( NotePlayHandle * _n,
|
||||
// Restart playing the note if in stutter mode, not in loop mode,
|
||||
// and we're at the end of the sample.
|
||||
m_nextPlayStartPoint = m_sampleBuffer.startFrame();
|
||||
m_nextPlayBackwards = false;
|
||||
}
|
||||
_n->m_pluginData = new handleState( _n->hasDetuningInfo() );
|
||||
((handleState *)_n->m_pluginData)->setFrameIndex( m_nextPlayStartPoint );
|
||||
((handleState *)_n->m_pluginData)->setBackwards( m_nextPlayBackwards );
|
||||
|
||||
// debug code
|
||||
/* qDebug( "frames %d", m_sampleBuffer.frames() );
|
||||
@@ -141,7 +145,7 @@ void audioFileProcessor::playNote( NotePlayHandle * _n,
|
||||
if( m_sampleBuffer.play( _working_buffer,
|
||||
(handleState *)_n->m_pluginData,
|
||||
frames, _n->frequency(),
|
||||
m_loopModel.value() ) )
|
||||
static_cast<SampleBuffer::LoopMode>( m_loopModel.value() ) ) )
|
||||
{
|
||||
applyRelease( _working_buffer, _n );
|
||||
instrumentTrack()->processAudioBuffer( _working_buffer,
|
||||
@@ -161,6 +165,7 @@ void audioFileProcessor::playNote( NotePlayHandle * _n,
|
||||
if( m_stutterModel.value() == true )
|
||||
{
|
||||
m_nextPlayStartPoint = ((handleState *)_n->m_pluginData)->frameIndex();
|
||||
m_nextPlayBackwards = ((handleState *)_n->m_pluginData)->isBackwards();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,17 +217,18 @@ void audioFileProcessor::loadSettings( const QDomElement & _this )
|
||||
m_reverseModel.loadSettings( _this, "reversed" );
|
||||
m_loopModel.loadSettings( _this, "looped" );
|
||||
m_ampModel.loadSettings( _this, "amp" );
|
||||
m_startPointModel.loadSettings( _this, "sframe" );
|
||||
m_endPointModel.loadSettings( _this, "eframe" );
|
||||
|
||||
|
||||
// compat code for not having a separate loopback point
|
||||
if( _this.hasAttribute( "lframe" ) )
|
||||
{
|
||||
m_loopPointModel.loadSettings( _this, "lframe" );
|
||||
m_startPointModel.loadSettings( _this, "sframe" );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_loopPointModel.setValue( m_startPointModel.value() );
|
||||
m_loopPointModel.loadSettings( _this, "sframe" );
|
||||
m_startPointModel.setValue( m_loopPointModel.value() );
|
||||
}
|
||||
|
||||
m_stutterModel.loadSettings( _this, "stutter" );
|
||||
@@ -307,6 +313,7 @@ void audioFileProcessor::ampModelChanged( void )
|
||||
void audioFileProcessor::stutterModelChanged()
|
||||
{
|
||||
m_nextPlayStartPoint = m_sampleBuffer.startFrame();
|
||||
m_nextPlayBackwards = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -321,29 +328,36 @@ void audioFileProcessor::loopPointChanged( void )
|
||||
m_endPointModel.setValue( m_startPointModel.value() );
|
||||
m_startPointModel.setValue( tmp );
|
||||
}
|
||||
|
||||
|
||||
// check if start & end overlap and nudge end up if so
|
||||
if( m_startPointModel.value() == m_endPointModel.value() )
|
||||
{
|
||||
m_endPointModel.setValue( qMin( m_endPointModel.value() + 0.001f, 1.0f ) );
|
||||
}
|
||||
|
||||
const f_cnt_t f_start = static_cast<f_cnt_t>( m_startPointModel.value() *
|
||||
( m_sampleBuffer.frames()-1 ) );
|
||||
const f_cnt_t f_end = static_cast<f_cnt_t>( m_endPointModel.value() *
|
||||
( m_sampleBuffer.frames()-1 ) );
|
||||
m_nextPlayStartPoint = f_start;
|
||||
|
||||
// check that loop point is between start-end points
|
||||
// check that loop point is between start-end points and not overlapping with endpoint
|
||||
// ...and move start/end points ahead if loop point is moved over them
|
||||
if( m_loopPointModel.value() >= m_endPointModel.value() )
|
||||
{
|
||||
m_endPointModel.setValue( m_loopPointModel.value() + 0.001f );
|
||||
if( m_endPointModel.value() == 1.0f )
|
||||
{
|
||||
m_loopPointModel.setValue( 1.0f - 0.001f );
|
||||
}
|
||||
}
|
||||
if( m_loopPointModel.value() < m_startPointModel.value() )
|
||||
m_loopPointModel.setValue( m_startPointModel.value() );
|
||||
if( m_loopPointModel.value() > m_endPointModel.value() )
|
||||
m_loopPointModel.setValue( m_endPointModel.value() );
|
||||
{
|
||||
m_startPointModel.setValue( m_loopPointModel.value() );
|
||||
}
|
||||
|
||||
m_sampleBuffer.setStartFrame( f_start );
|
||||
m_sampleBuffer.setEndFrame( f_end );
|
||||
m_sampleBuffer.setLoopStartFrame( static_cast<f_cnt_t>( m_loopPointModel.value() * ( m_sampleBuffer.frames()-1 ) ) );
|
||||
m_sampleBuffer.setLoopEndFrame( f_end );
|
||||
const f_cnt_t f_start = static_cast<f_cnt_t>( m_startPointModel.value() * ( m_sampleBuffer.frames()-1 ) );
|
||||
const f_cnt_t f_end = static_cast<f_cnt_t>( m_endPointModel.value() * ( m_sampleBuffer.frames()-1 ) );
|
||||
const f_cnt_t f_loop = static_cast<f_cnt_t>( m_loopPointModel.value() * ( m_sampleBuffer.frames()-1 ) );
|
||||
|
||||
m_nextPlayStartPoint = f_start;
|
||||
m_nextPlayBackwards = false;
|
||||
|
||||
m_sampleBuffer.setAllPointFrames( f_start, f_end, f_loop, f_end );
|
||||
emit dataChanged();
|
||||
}
|
||||
|
||||
@@ -377,13 +391,13 @@ AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument,
|
||||
m_openAudioFileButton->setWhatsThis(
|
||||
tr( "Click here, if you want to open another audio-file. "
|
||||
"A dialog will appear where you can select your file. "
|
||||
"Settings like looping-mode, start and end-points, "
|
||||
"Settings like looping-mode, start and end-points, "
|
||||
"amplify-value, and so on are not reset. So, it may not "
|
||||
"sound like the original sample.") );
|
||||
|
||||
m_reverseButton = new pixmapButton( this );
|
||||
m_reverseButton->setCheckable( TRUE );
|
||||
m_reverseButton->move( 174, 124 );
|
||||
m_reverseButton->move( 200, 124 );
|
||||
m_reverseButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"reverse_on" ) );
|
||||
m_reverseButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
@@ -394,18 +408,51 @@ AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument,
|
||||
"This is useful for cool effects, e.g. a reversed "
|
||||
"crash." ) );
|
||||
|
||||
m_loopButton = new pixmapButton( this );
|
||||
m_loopButton->setCheckable( TRUE );
|
||||
m_loopButton->move( 200, 124 );
|
||||
m_loopButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"loop_on" ) );
|
||||
m_loopButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"loop_off" ) );
|
||||
toolTip::add( m_loopButton, tr( "Enable loop" ) );
|
||||
m_loopButton->setWhatsThis(
|
||||
tr( "This button enables looping. "
|
||||
// loop button group
|
||||
|
||||
pixmapButton * m_loopOffButton = new pixmapButton( this );
|
||||
m_loopOffButton->setCheckable( TRUE );
|
||||
m_loopOffButton->move( 174, 144 );
|
||||
m_loopOffButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"loop_off_on" ) );
|
||||
m_loopOffButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"loop_off_off" ) );
|
||||
toolTip::add( m_loopOffButton, tr( "Disable loop" ) );
|
||||
m_loopOffButton->setWhatsThis(
|
||||
tr( "This button disables looping. "
|
||||
"The sample plays only once from start to end. " ) );
|
||||
|
||||
|
||||
pixmapButton * m_loopOnButton = new pixmapButton( this );
|
||||
m_loopOnButton->setCheckable( TRUE );
|
||||
m_loopOnButton->move( 200, 144 );
|
||||
m_loopOnButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"loop_on_on" ) );
|
||||
m_loopOnButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"loop_on_off" ) );
|
||||
toolTip::add( m_loopOnButton, tr( "Enable loop" ) );
|
||||
m_loopOnButton->setWhatsThis(
|
||||
tr( "This button enables forwards-looping. "
|
||||
"The sample loops between the end point and the loop point." ) );
|
||||
|
||||
|
||||
pixmapButton * m_loopPingPongButton = new pixmapButton( this );
|
||||
m_loopPingPongButton->setCheckable( TRUE );
|
||||
m_loopPingPongButton->move( 226, 144 );
|
||||
m_loopPingPongButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"loop_pingpong_on" ) );
|
||||
m_loopPingPongButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"loop_pingpong_off" ) );
|
||||
toolTip::add( m_loopPingPongButton, tr( "Enable loop" ) );
|
||||
m_loopPingPongButton->setWhatsThis(
|
||||
tr( "This button enables ping-pong-looping. "
|
||||
"The sample loops backwards and forwards between the end point "
|
||||
"and the loop point." ) );
|
||||
|
||||
m_loopGroup = new automatableButtonGroup( this );
|
||||
m_loopGroup->addButton( m_loopOffButton );
|
||||
m_loopGroup->addButton( m_loopOnButton );
|
||||
m_loopGroup->addButton( m_loopPingPongButton );
|
||||
|
||||
m_stutterButton = new pixmapButton( this );
|
||||
m_stutterButton->setCheckable( true );
|
||||
m_stutterButton->move( 226, 124 );
|
||||
@@ -604,7 +651,7 @@ void AudioFileProcessorView::modelChanged( void )
|
||||
m_endKnob->setModel( &a->m_endPointModel );
|
||||
m_loopKnob->setModel( &a->m_loopPointModel );
|
||||
m_reverseButton->setModel( &a->m_reverseModel );
|
||||
m_loopButton->setModel( &a->m_loopModel );
|
||||
m_loopGroup->setModel( &a->m_loopModel );
|
||||
m_stutterButton->setModel( &a->m_stutterModel );
|
||||
sampleUpdated();
|
||||
}
|
||||
@@ -675,16 +722,18 @@ void AudioFileProcessorWaveView::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
m_isDragging = true;
|
||||
m_draggingLastPoint = _me->pos();
|
||||
|
||||
const int start_dist = qAbs( m_startFrameX - _me->x() );
|
||||
const int end_dist = qAbs( m_endFrameX - _me->x() );
|
||||
const int loop_dist = qAbs( m_loopFrameX - _me->x() );
|
||||
|
||||
|
||||
const int x = _me->x();
|
||||
|
||||
const int start_dist = qAbs( m_startFrameX - x );
|
||||
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; }
|
||||
if( end_dist < start_dist ) { dt = sample_end; md = end_dist; }
|
||||
|
||||
if( md < 3 )
|
||||
else if( end_dist < loop_dist ) { dt = sample_end; md = end_dist; }
|
||||
|
||||
if( md < 4 )
|
||||
{
|
||||
m_draggingType = dt;
|
||||
}
|
||||
@@ -780,7 +829,6 @@ void AudioFileProcessorWaveView::paintEvent( QPaintEvent * _pe )
|
||||
|
||||
p.drawPixmap( s_padding, s_padding, m_graph );
|
||||
|
||||
p.setPen( QColor( 0xFF, 0xFF, 0xFF ) ); //TODO: put into a qproperty
|
||||
const QRect graph_rect( s_padding, s_padding, width() - 2 * s_padding, height() - 2 * s_padding );
|
||||
const f_cnt_t frames = m_to - m_from;
|
||||
m_startFrameX = graph_rect.x() + ( m_sampleBuffer.startFrame() - m_from ) *
|
||||
@@ -792,17 +840,21 @@ void AudioFileProcessorWaveView::paintEvent( QPaintEvent * _pe )
|
||||
const int played_width_px = ( m_framesPlayed - m_from ) *
|
||||
double( graph_rect.width() ) / frames;
|
||||
|
||||
// loop point line
|
||||
p.setPen( QColor( 0x7F, 0xFF, 0xFF ) ); //TODO: put into a qproperty
|
||||
p.drawLine( m_loopFrameX, graph_rect.y(),
|
||||
m_loopFrameX,
|
||||
graph_rect.height() + graph_rect.y() );
|
||||
|
||||
// start/end lines
|
||||
p.setPen( QColor( 0xFF, 0xFF, 0xFF ) ); //TODO: put into a qproperty
|
||||
p.drawLine( m_startFrameX, graph_rect.y(),
|
||||
m_startFrameX,
|
||||
graph_rect.height() + graph_rect.y() );
|
||||
p.drawLine( m_endFrameX, graph_rect.y(),
|
||||
m_endFrameX,
|
||||
graph_rect.height() + graph_rect.y() );
|
||||
|
||||
p.setPen( QColor( 0x7F, 0xFF, 0xFF ) ); //TODO: put into a qproperty
|
||||
p.drawLine( m_loopFrameX, graph_rect.y(),
|
||||
m_loopFrameX,
|
||||
graph_rect.height() + graph_rect.y() );
|
||||
|
||||
|
||||
if( m_endFrameX - m_startFrameX > 2 )
|
||||
{
|
||||
@@ -1006,7 +1058,7 @@ void AudioFileProcessorWaveView::setKnobs( knob * _start, knob * _end, knob * _l
|
||||
|
||||
m_endKnob->setWaveView( this );
|
||||
m_endKnob->setRelatedKnob( m_startKnob );
|
||||
|
||||
|
||||
m_loopKnob->setWaveView( this );
|
||||
}
|
||||
|
||||
@@ -1130,7 +1182,7 @@ bool AudioFileProcessorWaveView::knob::checkBound( double _v ) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if( ( m_relatedKnob->model()->value() - _v > 0 ) !=
|
||||
( m_relatedKnob->model()->value() - model()->value() >= 0 ) )
|
||||
return false;
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "SampleBuffer.h"
|
||||
#include "knob.h"
|
||||
#include "pixmap_button.h"
|
||||
#include "automatable_button.h"
|
||||
|
||||
|
||||
|
||||
@@ -91,10 +92,11 @@ private:
|
||||
FloatModel m_endPointModel;
|
||||
FloatModel m_loopPointModel;
|
||||
BoolModel m_reverseModel;
|
||||
BoolModel m_loopModel;
|
||||
IntModel m_loopModel;
|
||||
BoolModel m_stutterModel;
|
||||
|
||||
f_cnt_t m_nextPlayStartPoint;
|
||||
bool m_nextPlayBackwards;
|
||||
|
||||
friend class AudioFileProcessorView;
|
||||
|
||||
@@ -137,7 +139,7 @@ private:
|
||||
|
||||
pixmapButton * m_openAudioFileButton;
|
||||
pixmapButton * m_reverseButton;
|
||||
pixmapButton * m_loopButton;
|
||||
automatableButtonGroup * m_loopGroup;
|
||||
pixmapButton * m_stutterButton;
|
||||
|
||||
} ;
|
||||
@@ -270,7 +272,7 @@ private:
|
||||
|
||||
static bool isCloseTo( int _a, int _b )
|
||||
{
|
||||
return qAbs( _a - _b ) < 3;
|
||||
return qAbs( _a - _b ) < 4;
|
||||
}
|
||||
|
||||
} ;
|
||||
|
||||
BIN
plugins/audio_file_processor/loop_off_off.png
Normal file
|
After Width: | Height: | Size: 534 B |
BIN
plugins/audio_file_processor/loop_off_on.png
Normal file
|
After Width: | Height: | Size: 463 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
BIN
plugins/audio_file_processor/loop_pingpong_off.png
Normal file
|
After Width: | Height: | Size: 655 B |
BIN
plugins/audio_file_processor/loop_pingpong_on.png
Normal file
|
After Width: | Height: | Size: 611 B |
@@ -37,6 +37,7 @@
|
||||
#include "templates.h"
|
||||
#include "tooltip.h"
|
||||
#include "song.h"
|
||||
#include "interpolation.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
|
||||
@@ -108,9 +109,9 @@ sample_t bSynth::nextStringSample()
|
||||
}
|
||||
|
||||
// Nachkommaanteil
|
||||
float frac = sample_realindex - static_cast<int>(sample_realindex);
|
||||
const float frac = fraction( sample_realindex );
|
||||
|
||||
sample = sample_shape[a]*(1-frac) + sample_shape[b]*(frac);
|
||||
sample = linearInterpolate( sample_shape[a], sample_shape[b], frac );
|
||||
|
||||
} else {
|
||||
// No interpolation
|
||||
|
||||
@@ -25,7 +25,9 @@
|
||||
|
||||
|
||||
#include "dynamics_processor.h"
|
||||
#include <math.h>
|
||||
#include "lmms_math.h"
|
||||
#include "interpolation.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
|
||||
#ifdef LMMS_BUILD_WIN32
|
||||
@@ -107,8 +109,7 @@ bool dynProcEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
|
||||
// variables for effect
|
||||
int i = 0;
|
||||
float lookup;
|
||||
float frac;
|
||||
|
||||
float sm_peak[2] = { 0.0f, 0.0f };
|
||||
float gain;
|
||||
|
||||
@@ -182,22 +183,20 @@ bool dynProcEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
|
||||
for ( i=0; i <= 1; i++ )
|
||||
{
|
||||
if( sm_peak[i] != 0 )
|
||||
const int lookup = static_cast<int>( sm_peak[i] * 200.0f );
|
||||
const float frac = fraction( sm_peak[i] * 200.0f );
|
||||
|
||||
if( sm_peak[i] > 0 )
|
||||
{
|
||||
lookup = sm_peak[i] * 200.0f;
|
||||
|
||||
if ( lookup < 1 )
|
||||
{
|
||||
frac = lookup - truncf(lookup);
|
||||
gain = frac * m_dpControls.m_wavegraphModel.samples()[0];
|
||||
}
|
||||
else
|
||||
if ( lookup < 200 )
|
||||
{
|
||||
frac = lookup - truncf(lookup);
|
||||
gain =
|
||||
(( (1.0f-frac) * m_dpControls.m_wavegraphModel.samples()[ (int)truncf(lookup) - 1 ] ) +
|
||||
( frac * m_dpControls.m_wavegraphModel.samples()[ (int)truncf(lookup) ] ));
|
||||
gain = linearInterpolate( m_dpControls.m_wavegraphModel.samples()[ lookup - 1 ],
|
||||
m_dpControls.m_wavegraphModel.samples()[ lookup ], frac );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -206,8 +205,6 @@ bool dynProcEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
|
||||
s[i] *= ( gain / sm_peak[i] );
|
||||
}
|
||||
else { s[i] = 0.0f; }
|
||||
|
||||
}
|
||||
|
||||
// apply output gain
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "DspEffectLibrary.h"
|
||||
#include "Oscillator.h"
|
||||
|
||||
#include "fastpow.h"
|
||||
#include "lmms_math.h"
|
||||
|
||||
|
||||
template<class FX = DspEffectLibrary::StereoBypass>
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
|
||||
#ifndef FASTPOW_H
|
||||
#define FASTPOW_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/*
|
||||
* source:
|
||||
* http://martin.ankerl.com/2007/10/04/optimized-pow-approximation-for-java-and-c-c/
|
||||
*/
|
||||
|
||||
double fastPow(double a, double b) {
|
||||
union {
|
||||
double d;
|
||||
int32_t x[2];
|
||||
} u = { a };
|
||||
u.x[1] = (int32_t)(b * (u.x[1] - 1072632447) + 1072632447);
|
||||
u.x[0] = 0;
|
||||
return u.d;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -69,7 +69,8 @@ kickerInstrument::kickerInstrument( InstrumentTrack * _instrument_track ) :
|
||||
m_clickModel( 0.4f, 0.0f, 1.0f, 0.05f, this, tr( "Click" ) ),
|
||||
m_slopeModel( 0.06f, 0.001f, 1.0f, 0.001f, this, tr( "Slope" ) ),
|
||||
m_startNoteModel( false, this, tr( "Start from note" ) ),
|
||||
m_endNoteModel( false, this, tr( "End to note" ) )
|
||||
m_endNoteModel( false, this, tr( "End to note" ) ),
|
||||
m_versionModel( 0, 0, KICKER_PRESET_VERSION, this, "" )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -97,6 +98,7 @@ void kickerInstrument::saveSettings( QDomDocument & _doc,
|
||||
m_slopeModel.saveSettings( _doc, _this, "slope" );
|
||||
m_startNoteModel.saveSettings( _doc, _this, "startnote" );
|
||||
m_endNoteModel.saveSettings( _doc, _this, "endnote" );
|
||||
m_versionModel.saveSettings( _doc, _this, "version" );
|
||||
}
|
||||
|
||||
|
||||
@@ -115,6 +117,17 @@ void kickerInstrument::loadSettings( const QDomElement & _this )
|
||||
m_slopeModel.loadSettings( _this, "slope" );
|
||||
m_startNoteModel.loadSettings( _this, "startnote" );
|
||||
m_endNoteModel.loadSettings( _this, "endnote" );
|
||||
m_versionModel.loadSettings( _this, "version" );
|
||||
|
||||
// Try to maintain backwards compatibility
|
||||
if( !_this.hasAttribute( "version" ) )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -34,6 +34,9 @@
|
||||
#include "led_checkbox.h"
|
||||
|
||||
|
||||
#define KICKER_PRESET_VERSION 1
|
||||
|
||||
|
||||
class kickerInstrumentView;
|
||||
class NotePlayHandle;
|
||||
|
||||
@@ -80,6 +83,8 @@ private:
|
||||
BoolModel m_startNoteModel;
|
||||
BoolModel m_endNoteModel;
|
||||
|
||||
IntModel m_versionModel;
|
||||
|
||||
friend class kickerInstrumentView;
|
||||
|
||||
} ;
|
||||
|
||||
3
plugins/monstro/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(monstro Monstro.cpp Monstro.h MOCFILES Monstro.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
1828
plugins/monstro/Monstro.cpp
Normal file
651
plugins/monstro/Monstro.h
Normal file
@@ -0,0 +1,651 @@
|
||||
/*
|
||||
* Monstro.h - a semi-modular 3-osc synth with modulation matrix
|
||||
*
|
||||
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* 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 MONSTRO_H
|
||||
#define MONSTRO_H
|
||||
|
||||
|
||||
#include "Instrument.h"
|
||||
#include "InstrumentView.h"
|
||||
#include "AutomatableModel.h"
|
||||
#include "automatable_button.h"
|
||||
#include "TempoSyncKnob.h"
|
||||
#include "NotePlayHandle.h"
|
||||
#include "pixmap_button.h"
|
||||
#include "combobox.h"
|
||||
#include "Oscillator.h"
|
||||
#include "lmms_math.h"
|
||||
|
||||
//
|
||||
// UI Macros
|
||||
//
|
||||
|
||||
#define makeknob( name, x, y, hint, unit, oname ) \
|
||||
name = new knob( knobStyled, view ); \
|
||||
name ->move( x, y ); \
|
||||
name ->setHintText( tr( hint ) + " ", unit ); \
|
||||
name ->setObjectName( oname ); \
|
||||
name ->setFixedSize( 20, 20 );
|
||||
|
||||
#define maketsknob( name, x, y, hint, unit, oname ) \
|
||||
name = new TempoSyncKnob( knobStyled, view ); \
|
||||
name ->move( x, y ); \
|
||||
name ->setHintText( tr( hint ) + " ", unit ); \
|
||||
name ->setObjectName( oname ); \
|
||||
name ->setFixedSize( 20, 20 );
|
||||
|
||||
#define maketinyled( name, x, y, ttip ) \
|
||||
name = new pixmapButton( view, NULL ); \
|
||||
name -> setCheckable( true ); \
|
||||
name -> move( x, y ); \
|
||||
name -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "tinyled_on" ) ); \
|
||||
name -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "tinyled_off" ) ); \
|
||||
toolTip::add( name, tr( ttip ) );
|
||||
|
||||
#define setwavemodel( name ) \
|
||||
name .addItem( tr( "Sine wave" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "sin" ) ) ); \
|
||||
name .addItem( tr( "Triangle wave" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "tri" ) ) ); \
|
||||
name .addItem( tr( "Saw wave" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "saw" ) ) ); \
|
||||
name .addItem( tr( "Ramp wave" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "ramp" ) ) ); \
|
||||
name .addItem( tr( "Square wave" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "sqr" ) ) ); \
|
||||
name .addItem( tr( "Soft square wave" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "sqrsoft" ) ) ); \
|
||||
name .addItem( tr( "Moog saw wave" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "moog" ) ) ); \
|
||||
name .addItem( tr( "Abs. sine wave" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "sinabs" ) ) ); \
|
||||
name .addItem( tr( "Exponential wave" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "exp" ) ) ); \
|
||||
name .addItem( tr( "White noise" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "noise" ) ) );
|
||||
|
||||
#define setlfowavemodel( name ) \
|
||||
name .addItem( tr( "Sine wave" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "sin" ) ) ); \
|
||||
name .addItem( tr( "Triangle wave" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "tri" ) ) ); \
|
||||
name .addItem( tr( "Saw wave" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "saw" ) ) ); \
|
||||
name .addItem( tr( "Ramp wave" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "ramp" ) ) ); \
|
||||
name .addItem( tr( "Square wave" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "sqr" ) ) ); \
|
||||
name .addItem( tr( "Soft square wave" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "sqrsoft" ) ) ); \
|
||||
name .addItem( tr( "Moog saw wave" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "moog" ) ) ); \
|
||||
name .addItem( tr( "Abs. sine wave" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "sinabs" ) ) ); \
|
||||
name .addItem( tr( "Exponential wave" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "exp" ) ) ); \
|
||||
name .addItem( tr( "Random" ), static_cast<PixmapLoader*>( new PluginPixmapLoader( "rand" ) ) );
|
||||
|
||||
// UI constants
|
||||
const int O1ROW = 22;
|
||||
const int O2ROW = 22 + 39;
|
||||
const int O3ROW = 22 + 39 * 2;
|
||||
const int LFOROW = 22 + 39 * 3;
|
||||
const int E1ROW = 22 + 39 * 4;
|
||||
const int E2ROW = 22 + 39 * 5;
|
||||
|
||||
const int KNOBCOL1 = 16;
|
||||
const int KNOBCOL2 = 16 + 30;
|
||||
const int KNOBCOL3 = 16 + 30 * 2;
|
||||
const int KNOBCOL4 = 16 + 30 * 3;
|
||||
const int KNOBCOL5 = 16 + 30 * 4;
|
||||
const int KNOBCOL6 = 16 + 30 * 5;
|
||||
const int KNOBCOL7 = 16 + 30 * 6;
|
||||
|
||||
const int LFOCOL1 = KNOBCOL2;
|
||||
const int LFOCOL2 = KNOBCOL2 + 26;
|
||||
const int LFOCOL3 = KNOBCOL2 + 26*2;
|
||||
const int LFOCOL4 = 171;
|
||||
const int LFOCOL5 = 171 + 26;
|
||||
const int LFOCOL6 = 171 + 26*2;
|
||||
|
||||
const int MATCOL1 = 32;
|
||||
const int MATCOL2 = 32 + 25;
|
||||
const int MATCOL3 = 32 + 25*2;
|
||||
const int MATCOL4 = 32 + 25*3;
|
||||
const int MATCOL5 = 149;
|
||||
const int MATCOL6 = 149 + 25;
|
||||
const int MATCOL7 = 149 + 25*2;
|
||||
const int MATCOL8 = 149 + 25*3;
|
||||
|
||||
const int MATROW1 = 22;
|
||||
const int MATROW2 = 22 + 39;
|
||||
const int MATROW3 = 22 + 39*2;
|
||||
const int MATROW4 = 22 + 39*3;
|
||||
const int MATROW5 = 22 + 39*4;
|
||||
const int MATROW6 = 22 + 39*5;
|
||||
|
||||
const int OPVIEW = 0;
|
||||
const int MATVIEW = 1;
|
||||
|
||||
// waveform enumerators
|
||||
const int WAVE_SINE = 0;
|
||||
const int WAVE_TRI = 1;
|
||||
const int WAVE_SAW = 2;
|
||||
const int WAVE_RAMP = 3;
|
||||
const int WAVE_SQR = 4;
|
||||
const int WAVE_SQRSOFT = 5;
|
||||
const int WAVE_MOOG = 6;
|
||||
const int WAVE_SINABS = 7;
|
||||
const int WAVE_EXP = 8;
|
||||
const int WAVE_NOISE = 9;
|
||||
const int NUM_WAVES = 10;
|
||||
|
||||
// modulation enumerators
|
||||
const int MOD_MIX = 0;
|
||||
const int MOD_AM = 1;
|
||||
const int MOD_FM = 2;
|
||||
const int MOD_PM = 3;
|
||||
const int NUM_MODS = 4;
|
||||
|
||||
const float MODCLIP = 2.0;
|
||||
|
||||
const float MIN_FREQ = 18.0f;
|
||||
const float MAX_FREQ = 48000.0f;
|
||||
|
||||
// constants for amp delta capping - these will be divided by samplerate by the synth
|
||||
const float ADCAP1 = 44100 / 4;
|
||||
const float ADCAP2 = 44100 / 4.5;
|
||||
|
||||
|
||||
class MonstroInstrument;
|
||||
class MonstroView;
|
||||
|
||||
|
||||
class MonstroSynth
|
||||
{
|
||||
public:
|
||||
MonstroSynth( MonstroInstrument * _i, NotePlayHandle * _nph,
|
||||
const sample_rate_t _samplerate, fpp_t _frames );
|
||||
virtual ~MonstroSynth();
|
||||
|
||||
void renderOutput( fpp_t _frames, sampleFrame * _buf );
|
||||
|
||||
inline sample_rate_t samplerate() const
|
||||
{
|
||||
return m_samplerate;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
MonstroInstrument * m_parent;
|
||||
NotePlayHandle * m_nph;
|
||||
const sample_rate_t m_samplerate;
|
||||
fpp_t m_fpp;
|
||||
|
||||
sample_t * m_env1_buf;
|
||||
sample_t * m_env2_buf;
|
||||
sample_t * m_lfo1_buf;
|
||||
sample_t * m_lfo2_buf;
|
||||
|
||||
void renderModulators( fpp_t _frames );
|
||||
|
||||
// linear interpolation
|
||||
/* inline sample_t interpolate( sample_t s1, sample_t s2, float x )
|
||||
{
|
||||
return s1 + ( s2 - s1 ) * x;
|
||||
}*/ // using interpolation.h from now on
|
||||
|
||||
inline sample_t calcSlope( sample_t _s, float _slope )
|
||||
{
|
||||
if( _slope == 0.0f ) return _s;
|
||||
const double exp = fastPow( 10.0, static_cast<double>( _slope * -1.0 ) );
|
||||
return fastPow( _s, exp );
|
||||
}
|
||||
|
||||
inline sample_t oscillate( int _wave, const float _ph )
|
||||
{
|
||||
switch( _wave )
|
||||
{
|
||||
case WAVE_SINE:
|
||||
return Oscillator::sinSample( _ph );
|
||||
break;
|
||||
case WAVE_TRI:
|
||||
return Oscillator::triangleSample( _ph );
|
||||
break;
|
||||
case WAVE_SAW:
|
||||
return Oscillator::sawSample( _ph );
|
||||
break;
|
||||
case WAVE_RAMP:
|
||||
return Oscillator::sawSample( _ph ) * -1.0;
|
||||
break;
|
||||
case WAVE_SQR:
|
||||
return Oscillator::squareSample( _ph );
|
||||
break;
|
||||
case WAVE_SQRSOFT:
|
||||
{
|
||||
const float ph = fraction( _ph );
|
||||
if( ph < 0.1 ) return Oscillator::sinSample( ph * 5 + 0.75 );
|
||||
else if( ph < 0.5 ) return 1.0f;
|
||||
else if( ph < 0.6 ) return Oscillator::sinSample( ph * 5 + 0.75 );
|
||||
else return -1.0f;
|
||||
break;
|
||||
}
|
||||
case WAVE_MOOG:
|
||||
return Oscillator::moogSawSample( _ph );
|
||||
break;
|
||||
case WAVE_SINABS:
|
||||
return qAbs( Oscillator::sinSample( _ph ) );
|
||||
break;
|
||||
case WAVE_EXP:
|
||||
return Oscillator::expSample( _ph );
|
||||
break;
|
||||
case WAVE_NOISE:
|
||||
default:
|
||||
return Oscillator::noiseSample( _ph );
|
||||
break;
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
||||
float m_osc1l_phase;
|
||||
float m_osc1r_phase;
|
||||
float m_osc2l_phase;
|
||||
float m_osc2r_phase;
|
||||
float m_osc3l_phase;
|
||||
float m_osc3r_phase;
|
||||
|
||||
sample_t m_env1_phase;
|
||||
sample_t m_env2_phase;
|
||||
|
||||
float m_lfo1_phase;
|
||||
float m_lfo2_phase;
|
||||
|
||||
sample_t m_lfo1_last;
|
||||
sample_t m_lfo2_last;
|
||||
|
||||
sample_t m_osc1l_last;
|
||||
sample_t m_osc1r_last;
|
||||
|
||||
sample_t m_osc2l_last;
|
||||
sample_t m_osc2r_last;
|
||||
|
||||
sample_t m_osc3l_last;
|
||||
sample_t m_osc3r_last;
|
||||
|
||||
sample_t m_l_last;
|
||||
sample_t m_r_last;
|
||||
|
||||
float m_adcap1;
|
||||
float m_adcap2;
|
||||
};
|
||||
|
||||
class MonstroInstrument : public Instrument
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MonstroInstrument( InstrumentTrack * _instrument_track );
|
||||
virtual ~MonstroInstrument();
|
||||
|
||||
virtual void playNote( NotePlayHandle * _n,
|
||||
sampleFrame * _working_buffer );
|
||||
virtual void deleteNotePluginData( NotePlayHandle * _n );
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
|
||||
virtual QString nodeName() const;
|
||||
|
||||
virtual f_cnt_t desiredReleaseFrames() const;
|
||||
|
||||
virtual PluginView * instantiateView( QWidget * _parent );
|
||||
|
||||
public slots:
|
||||
void updateVolumes();
|
||||
void updateFreq();
|
||||
void updatePO();
|
||||
void updateEnvelope1();
|
||||
void updateEnvelope2();
|
||||
void updateLFOAtts();
|
||||
void updateSamplerate();
|
||||
|
||||
protected:
|
||||
float m_osc1l_vol;
|
||||
float m_osc1r_vol;
|
||||
float m_osc2l_vol;
|
||||
float m_osc2r_vol;
|
||||
float m_osc3l_vol;
|
||||
float m_osc3r_vol;
|
||||
|
||||
float m_osc1l_freq;
|
||||
float m_osc1r_freq;
|
||||
float m_osc2l_freq;
|
||||
float m_osc2r_freq;
|
||||
float m_osc3_freq;
|
||||
|
||||
float m_osc1l_po;
|
||||
float m_osc1r_po;
|
||||
float m_osc2l_po;
|
||||
float m_osc2r_po;
|
||||
float m_osc3l_po;
|
||||
float m_osc3r_po;
|
||||
|
||||
float m_env1_pre;
|
||||
float m_env1_att;
|
||||
float m_env1_hold;
|
||||
float m_env1_dec;
|
||||
float m_env1_rel;
|
||||
|
||||
float m_env2_pre;
|
||||
float m_env2_att;
|
||||
float m_env2_hold;
|
||||
float m_env2_dec;
|
||||
float m_env2_rel;
|
||||
|
||||
f_cnt_t m_env1_len;
|
||||
f_cnt_t m_env2_len;
|
||||
|
||||
f_cnt_t m_env1_relF;
|
||||
f_cnt_t m_env2_relF;
|
||||
|
||||
f_cnt_t m_lfo1_att;
|
||||
f_cnt_t m_lfo2_att;
|
||||
|
||||
sample_rate_t m_samplerate;
|
||||
fpp_t m_fpp;
|
||||
|
||||
private:
|
||||
inline float leftCh( float _vol, float _pan )
|
||||
{
|
||||
return ( _pan <= 0 ? 1.0 : 1.0 - ( _pan / 100.0 ) ) * _vol / 100.0;
|
||||
}
|
||||
|
||||
inline float rightCh( float _vol, float _pan )
|
||||
{
|
||||
return ( _pan >= 0 ? 1.0 : 1.0 + ( _pan / 100.0 ) ) * _vol / 100.0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// models of //
|
||||
// operator view knobs //
|
||||
// //
|
||||
//////////////////////////////////////
|
||||
|
||||
FloatModel m_osc1Vol;
|
||||
FloatModel m_osc1Pan;
|
||||
FloatModel m_osc1Crs;
|
||||
FloatModel m_osc1Ftl;
|
||||
FloatModel m_osc1Ftr;
|
||||
FloatModel m_osc1Spo;
|
||||
FloatModel m_osc1Pw;
|
||||
BoolModel m_osc1SSR;
|
||||
BoolModel m_osc1SSF;
|
||||
|
||||
FloatModel m_osc2Vol;
|
||||
FloatModel m_osc2Pan;
|
||||
FloatModel m_osc2Crs;
|
||||
FloatModel m_osc2Ftl;
|
||||
FloatModel m_osc2Ftr;
|
||||
FloatModel m_osc2Spo;
|
||||
ComboBoxModel m_osc2Wave;
|
||||
BoolModel m_osc2Sync;
|
||||
|
||||
FloatModel m_osc3Vol;
|
||||
FloatModel m_osc3Pan;
|
||||
FloatModel m_osc3Crs;
|
||||
FloatModel m_osc3Spo;
|
||||
FloatModel m_osc3Sub;
|
||||
ComboBoxModel m_osc3Wave1;
|
||||
ComboBoxModel m_osc3Wave2;
|
||||
BoolModel m_osc3Sync;
|
||||
|
||||
ComboBoxModel m_lfo1Wave;
|
||||
TempoSyncKnobModel m_lfo1Att;
|
||||
TempoSyncKnobModel m_lfo1Rate;
|
||||
FloatModel m_lfo1Phs;
|
||||
|
||||
ComboBoxModel m_lfo2Wave;
|
||||
TempoSyncKnobModel m_lfo2Att;
|
||||
TempoSyncKnobModel m_lfo2Rate;
|
||||
FloatModel m_lfo2Phs;
|
||||
|
||||
TempoSyncKnobModel m_env1Pre;
|
||||
TempoSyncKnobModel m_env1Att;
|
||||
TempoSyncKnobModel m_env1Hold;
|
||||
TempoSyncKnobModel m_env1Dec;
|
||||
FloatModel m_env1Sus;
|
||||
TempoSyncKnobModel m_env1Rel;
|
||||
FloatModel m_env1Slope;
|
||||
|
||||
TempoSyncKnobModel m_env2Pre;
|
||||
TempoSyncKnobModel m_env2Att;
|
||||
TempoSyncKnobModel m_env2Hold;
|
||||
TempoSyncKnobModel m_env2Dec;
|
||||
FloatModel m_env2Sus;
|
||||
TempoSyncKnobModel m_env2Rel;
|
||||
FloatModel m_env2Slope;
|
||||
|
||||
IntModel m_o23Mod;
|
||||
|
||||
IntModel m_selectedView;
|
||||
|
||||
//////////////////////////////////////
|
||||
// models of //
|
||||
// modulation matrix view knobs //
|
||||
// //
|
||||
//////////////////////////////////////
|
||||
|
||||
FloatModel m_vol1env1;
|
||||
FloatModel m_vol1env2;
|
||||
FloatModel m_vol1lfo1;
|
||||
FloatModel m_vol1lfo2;
|
||||
|
||||
FloatModel m_vol2env1;
|
||||
FloatModel m_vol2env2;
|
||||
FloatModel m_vol2lfo1;
|
||||
FloatModel m_vol2lfo2;
|
||||
|
||||
FloatModel m_vol3env1;
|
||||
FloatModel m_vol3env2;
|
||||
FloatModel m_vol3lfo1;
|
||||
FloatModel m_vol3lfo2;
|
||||
|
||||
FloatModel m_phs1env1;
|
||||
FloatModel m_phs1env2;
|
||||
FloatModel m_phs1lfo1;
|
||||
FloatModel m_phs1lfo2;
|
||||
|
||||
FloatModel m_phs2env1;
|
||||
FloatModel m_phs2env2;
|
||||
FloatModel m_phs2lfo1;
|
||||
FloatModel m_phs2lfo2;
|
||||
|
||||
FloatModel m_phs3env1;
|
||||
FloatModel m_phs3env2;
|
||||
FloatModel m_phs3lfo1;
|
||||
FloatModel m_phs3lfo2;
|
||||
|
||||
FloatModel m_pit1env1;
|
||||
FloatModel m_pit1env2;
|
||||
FloatModel m_pit1lfo1;
|
||||
FloatModel m_pit1lfo2;
|
||||
|
||||
FloatModel m_pit2env1;
|
||||
FloatModel m_pit2env2;
|
||||
FloatModel m_pit2lfo1;
|
||||
FloatModel m_pit2lfo2;
|
||||
|
||||
FloatModel m_pit3env1;
|
||||
FloatModel m_pit3env2;
|
||||
FloatModel m_pit3lfo1;
|
||||
FloatModel m_pit3lfo2;
|
||||
|
||||
FloatModel m_pw1env1;
|
||||
FloatModel m_pw1env2;
|
||||
FloatModel m_pw1lfo1;
|
||||
FloatModel m_pw1lfo2;
|
||||
|
||||
FloatModel m_sub3env1;
|
||||
FloatModel m_sub3env2;
|
||||
FloatModel m_sub3lfo1;
|
||||
FloatModel m_sub3lfo2;
|
||||
|
||||
friend class MonstroSynth;
|
||||
friend class MonstroView;
|
||||
|
||||
};
|
||||
|
||||
class MonstroView : public InstrumentView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MonstroView( Instrument * _instrument,
|
||||
QWidget * _parent );
|
||||
virtual ~MonstroView();
|
||||
|
||||
protected slots:
|
||||
void updateLayout();
|
||||
|
||||
private:
|
||||
virtual void modelChanged();
|
||||
|
||||
void setWidgetBackground( QWidget * _widget, const QString & _pic );
|
||||
QWidget * setupOperatorsView( QWidget * _parent );
|
||||
QWidget * setupMatrixView( QWidget * _parent );
|
||||
|
||||
//////////////////////////////////////
|
||||
// //
|
||||
// operator view knobs //
|
||||
// //
|
||||
//////////////////////////////////////
|
||||
|
||||
knob * m_osc1VolKnob;
|
||||
knob * m_osc1PanKnob;
|
||||
knob * m_osc1CrsKnob;
|
||||
knob * m_osc1FtlKnob;
|
||||
knob * m_osc1FtrKnob;
|
||||
knob * m_osc1SpoKnob;
|
||||
knob * m_osc1PwKnob;
|
||||
pixmapButton * m_osc1SSRButton;
|
||||
pixmapButton * m_osc1SSFButton;
|
||||
|
||||
knob * m_osc2VolKnob;
|
||||
knob * m_osc2PanKnob;
|
||||
knob * m_osc2CrsKnob;
|
||||
knob * m_osc2FtlKnob;
|
||||
knob * m_osc2FtrKnob;
|
||||
knob * m_osc2SpoKnob;
|
||||
comboBox * m_osc2WaveBox;
|
||||
pixmapButton * m_osc2SyncButton;
|
||||
|
||||
knob * m_osc3VolKnob;
|
||||
knob * m_osc3PanKnob;
|
||||
knob * m_osc3CrsKnob;
|
||||
knob * m_osc3SpoKnob;
|
||||
knob * m_osc3SubKnob;
|
||||
comboBox * m_osc3Wave1Box;
|
||||
comboBox * m_osc3Wave2Box;
|
||||
pixmapButton * m_osc3SyncButton;
|
||||
|
||||
comboBox * m_lfo1WaveBox;
|
||||
TempoSyncKnob * m_lfo1AttKnob;
|
||||
TempoSyncKnob * m_lfo1RateKnob;
|
||||
knob * m_lfo1PhsKnob;
|
||||
|
||||
comboBox * m_lfo2WaveBox;
|
||||
TempoSyncKnob * m_lfo2AttKnob;
|
||||
TempoSyncKnob * m_lfo2RateKnob;
|
||||
knob * m_lfo2PhsKnob;
|
||||
|
||||
TempoSyncKnob * m_env1PreKnob;
|
||||
TempoSyncKnob * m_env1AttKnob;
|
||||
TempoSyncKnob * m_env1HoldKnob;
|
||||
TempoSyncKnob * m_env1DecKnob;
|
||||
knob * m_env1SusKnob;
|
||||
TempoSyncKnob * m_env1RelKnob;
|
||||
knob * m_env1SlopeKnob;
|
||||
|
||||
TempoSyncKnob * m_env2PreKnob;
|
||||
TempoSyncKnob * m_env2AttKnob;
|
||||
TempoSyncKnob * m_env2HoldKnob;
|
||||
TempoSyncKnob * m_env2DecKnob;
|
||||
knob * m_env2SusKnob;
|
||||
TempoSyncKnob * m_env2RelKnob;
|
||||
knob * m_env2SlopeKnob;
|
||||
|
||||
automatableButtonGroup * m_o23ModGroup;
|
||||
|
||||
automatableButtonGroup * m_selectedViewGroup;
|
||||
|
||||
QWidget * m_operatorsView;
|
||||
QWidget * m_matrixView;
|
||||
|
||||
/////////////////////////////////
|
||||
// //
|
||||
// matrix view knobs //
|
||||
// //
|
||||
/////////////////////////////////
|
||||
|
||||
knob * m_vol1env1Knob;
|
||||
knob * m_vol1env2Knob;
|
||||
knob * m_vol1lfo1Knob;
|
||||
knob * m_vol1lfo2Knob;
|
||||
|
||||
knob * m_vol2env1Knob;
|
||||
knob * m_vol2env2Knob;
|
||||
knob * m_vol2lfo1Knob;
|
||||
knob * m_vol2lfo2Knob;
|
||||
|
||||
knob * m_vol3env1Knob;
|
||||
knob * m_vol3env2Knob;
|
||||
knob * m_vol3lfo1Knob;
|
||||
knob * m_vol3lfo2Knob;
|
||||
|
||||
knob * m_phs1env1Knob;
|
||||
knob * m_phs1env2Knob;
|
||||
knob * m_phs1lfo1Knob;
|
||||
knob * m_phs1lfo2Knob;
|
||||
|
||||
knob * m_phs2env1Knob;
|
||||
knob * m_phs2env2Knob;
|
||||
knob * m_phs2lfo1Knob;
|
||||
knob * m_phs2lfo2Knob;
|
||||
|
||||
knob * m_phs3env1Knob;
|
||||
knob * m_phs3env2Knob;
|
||||
knob * m_phs3lfo1Knob;
|
||||
knob * m_phs3lfo2Knob;
|
||||
|
||||
knob * m_pit1env1Knob;
|
||||
knob * m_pit1env2Knob;
|
||||
knob * m_pit1lfo1Knob;
|
||||
knob * m_pit1lfo2Knob;
|
||||
|
||||
knob * m_pit2env1Knob;
|
||||
knob * m_pit2env2Knob;
|
||||
knob * m_pit2lfo1Knob;
|
||||
knob * m_pit2lfo2Knob;
|
||||
|
||||
knob * m_pit3env1Knob;
|
||||
knob * m_pit3env2Knob;
|
||||
knob * m_pit3lfo1Knob;
|
||||
knob * m_pit3lfo2Knob;
|
||||
|
||||
knob * m_pw1env1Knob;
|
||||
knob * m_pw1env2Knob;
|
||||
knob * m_pw1lfo1Knob;
|
||||
knob * m_pw1lfo2Knob;
|
||||
|
||||
knob * m_sub3env1Knob;
|
||||
knob * m_sub3env2Knob;
|
||||
knob * m_sub3lfo1Knob;
|
||||
knob * m_sub3lfo2Knob;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
BIN
plugins/monstro/am_active.png
Normal file
|
After Width: | Height: | Size: 730 B |
BIN
plugins/monstro/am_inactive.png
Normal file
|
After Width: | Height: | Size: 525 B |
BIN
plugins/monstro/artwork_mat.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
plugins/monstro/artwork_op.png
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
plugins/monstro/exp.png
Normal file
|
After Width: | Height: | Size: 367 B |
BIN
plugins/monstro/fm_active.png
Normal file
|
After Width: | Height: | Size: 678 B |
BIN
plugins/monstro/fm_inactive.png
Normal file
|
After Width: | Height: | Size: 484 B |
BIN
plugins/monstro/logo.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
plugins/monstro/matview_active.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
plugins/monstro/matview_inactive.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
plugins/monstro/mix_active.png
Normal file
|
After Width: | Height: | Size: 776 B |
BIN
plugins/monstro/mix_inactive.png
Normal file
|
After Width: | Height: | Size: 510 B |
BIN
plugins/monstro/moog.png
Normal file
|
After Width: | Height: | Size: 402 B |
BIN
plugins/monstro/noise.png
Normal file
|
After Width: | Height: | Size: 478 B |
BIN
plugins/monstro/opview_active.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
plugins/monstro/opview_inactive.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
plugins/monstro/pm_active.png
Normal file
|
After Width: | Height: | Size: 724 B |
BIN
plugins/monstro/pm_inactive.png
Normal file
|
After Width: | Height: | Size: 481 B |
BIN
plugins/monstro/ramp.png
Normal file
|
After Width: | Height: | Size: 333 B |
BIN
plugins/monstro/rand.png
Normal file
|
After Width: | Height: | Size: 407 B |
BIN
plugins/monstro/saw.png
Normal file
|
After Width: | Height: | Size: 365 B |
BIN
plugins/monstro/sin.png
Normal file
|
After Width: | Height: | Size: 398 B |
BIN
plugins/monstro/sinabs.png
Normal file
|
After Width: | Height: | Size: 399 B |
BIN
plugins/monstro/sqr.png
Normal file
|
After Width: | Height: | Size: 342 B |
BIN
plugins/monstro/sqrsoft.png
Normal file
|
After Width: | Height: | Size: 393 B |
BIN
plugins/monstro/tinyled_off.png
Normal file
|
After Width: | Height: | Size: 397 B |
BIN
plugins/monstro/tinyled_on.png
Normal file
|
After Width: | Height: | Size: 594 B |
BIN
plugins/monstro/tri.png
Normal file
|
After Width: | Height: | Size: 380 B |
@@ -149,7 +149,7 @@ void patmanInstrument::playNote( NotePlayHandle * _n,
|
||||
hdata->sample->frequency();
|
||||
|
||||
if( hdata->sample->play( _working_buffer, hdata->state, frames,
|
||||
play_freq, m_loopedModel.value() ) )
|
||||
play_freq, m_loopedModel.value() ? SampleBuffer::LoopOn : SampleBuffer::LoopOff ) )
|
||||
{
|
||||
applyRelease( _working_buffer, _n );
|
||||
instrumentTrack()->processAudioBuffer( _working_buffer,
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "tooltip.h"
|
||||
#include "song.h"
|
||||
#include "lmms_math.h"
|
||||
#include "interpolation.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
|
||||
@@ -132,10 +133,10 @@ void WatsynObject::renderOutput( fpp_t _frames )
|
||||
if( A1_rphase < 0 ) A1_rphase += WAVELEN;
|
||||
}
|
||||
// A1
|
||||
sample_t A1_L = interpolate( m_A1wave[ static_cast<int>( A1_lphase ) ],
|
||||
sample_t A1_L = linearInterpolate( m_A1wave[ static_cast<int>( A1_lphase ) ],
|
||||
m_A1wave[ static_cast<int>( A1_lphase + 1 ) % WAVELEN ],
|
||||
fraction( A1_lphase ) ) * m_parent->m_lvol[A1_OSC];
|
||||
sample_t A1_R = interpolate( m_A1wave[ static_cast<int>( A1_rphase ) ],
|
||||
sample_t A1_R = linearInterpolate( m_A1wave[ static_cast<int>( A1_rphase ) ],
|
||||
m_A1wave[ static_cast<int>( A1_rphase + 1 ) % WAVELEN ],
|
||||
fraction( A1_rphase ) ) * m_parent->m_rvol[A1_OSC];
|
||||
|
||||
@@ -168,10 +169,10 @@ void WatsynObject::renderOutput( fpp_t _frames )
|
||||
if( B1_rphase < 0 ) B1_rphase += WAVELEN;
|
||||
}
|
||||
// B1
|
||||
sample_t B1_L = interpolate( m_B1wave[ static_cast<int>( B1_lphase ) % WAVELEN ],
|
||||
sample_t B1_L = linearInterpolate( m_B1wave[ static_cast<int>( B1_lphase ) % WAVELEN ],
|
||||
m_B1wave[ static_cast<int>( B1_lphase + 1 ) % WAVELEN ],
|
||||
fraction( B1_lphase ) ) * m_parent->m_lvol[B1_OSC];
|
||||
sample_t B1_R = interpolate( m_B1wave[ static_cast<int>( B1_rphase ) % WAVELEN ],
|
||||
sample_t B1_R = linearInterpolate( m_B1wave[ static_cast<int>( B1_rphase ) % WAVELEN ],
|
||||
m_B1wave[ static_cast<int>( B1_rphase + 1 ) % WAVELEN ],
|
||||
fraction( B1_rphase ) ) * m_parent->m_rvol[B1_OSC];
|
||||
|
||||
|
||||
@@ -103,10 +103,10 @@ public:
|
||||
|
||||
private:
|
||||
// linear interpolation
|
||||
inline sample_t interpolate( sample_t s1, sample_t s2, float x )
|
||||
/* inline sample_t interpolate( sample_t s1, sample_t s2, float x )
|
||||
{
|
||||
return s1 + ( s2 - s1 ) * x;
|
||||
}
|
||||
}*/ // we use the one in interpolation.h now
|
||||
|
||||
int m_amod;
|
||||
int m_bmod;
|
||||
|
||||
@@ -25,8 +25,9 @@
|
||||
|
||||
|
||||
#include "waveshaper.h"
|
||||
#include <math.h>
|
||||
#include "lmms_math.h"
|
||||
#include "embed.cpp"
|
||||
#include "interpolation.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
@@ -77,9 +78,6 @@ bool waveShaperEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
|
||||
// variables for effect
|
||||
int i = 0;
|
||||
float lookup;
|
||||
float frac;
|
||||
float posneg;
|
||||
|
||||
double out_sum = 0.0;
|
||||
const float d = dryLevel();
|
||||
@@ -101,23 +99,20 @@ bool waveShaperEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
|
||||
// start effect
|
||||
|
||||
for ( i=0; i <= 1; ++i )
|
||||
for( i=0; i <= 1; ++i )
|
||||
{
|
||||
lookup = fabsf( s[i] ) * 200.0f;
|
||||
posneg = s[i] < 0 ? -1.0f : 1.0f;
|
||||
const int lookup = static_cast<int>( fabsf( s[i] ) * 200.0f );
|
||||
const float frac = fraction( fabsf( s[i] ) * 200.0f );
|
||||
const float posneg = s[i] < 0 ? -1.0f : 1.0f;
|
||||
|
||||
if ( lookup < 1 )
|
||||
if( lookup < 1 )
|
||||
{
|
||||
frac = lookup - truncf(lookup);
|
||||
s[i] = frac * m_wsControls.m_wavegraphModel.samples()[0] * posneg;
|
||||
}
|
||||
else
|
||||
if ( lookup < 200 )
|
||||
{
|
||||
frac = lookup - truncf(lookup);
|
||||
s[i] =
|
||||
(( (1.0f-frac) * m_wsControls.m_wavegraphModel.samples()[ (int)truncf(lookup) - 1 ] ) +
|
||||
( frac * m_wsControls.m_wavegraphModel.samples()[ (int)truncf(lookup) ] ))
|
||||
else if( lookup < 200 )
|
||||
{
|
||||
s[i] = linearInterpolate( m_wsControls.m_wavegraphModel.samples()[ lookup - 1 ],
|
||||
m_wsControls.m_wavegraphModel.samples()[ lookup ], frac )
|
||||
* posneg;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -186,6 +186,7 @@ void SampleBuffer::update( bool _keep_settings )
|
||||
char * f = qstrdup( file.toUtf8().constData() );
|
||||
#endif
|
||||
int_sample_t * buf = NULL;
|
||||
sample_t * fbuf = NULL;
|
||||
ch_cnt_t channels = DEFAULT_CHANNELS;
|
||||
sample_rate_t samplerate = engine::mixer()->baseSampleRate();
|
||||
m_frames = 0;
|
||||
@@ -210,7 +211,7 @@ void SampleBuffer::update( bool _keep_settings )
|
||||
#endif
|
||||
if( m_frames == 0 )
|
||||
{
|
||||
m_frames = decodeSampleSF( f, buf, channels,
|
||||
m_frames = decodeSampleSF( f, fbuf, channels,
|
||||
samplerate );
|
||||
}
|
||||
#ifdef LMMS_HAVE_OGGVORBIS
|
||||
@@ -377,7 +378,7 @@ void SampleBuffer::normalizeSampleRate( const sample_rate_t _src_sr,
|
||||
|
||||
|
||||
f_cnt_t SampleBuffer::decodeSampleSF( const char * _f,
|
||||
int_sample_t * & _buf,
|
||||
sample_t * & _buf,
|
||||
ch_cnt_t & _channels,
|
||||
sample_rate_t & _samplerate )
|
||||
{
|
||||
@@ -385,29 +386,19 @@ f_cnt_t SampleBuffer::decodeSampleSF( const char * _f,
|
||||
SF_INFO sf_info;
|
||||
f_cnt_t frames = 0;
|
||||
bool sf_rr = false;
|
||||
sample_t * fbuf = 0;
|
||||
|
||||
if( ( snd_file = sf_open( _f, SFM_READ, &sf_info ) ) != NULL )
|
||||
{
|
||||
frames = sf_info.frames;
|
||||
|
||||
// check if float
|
||||
if ( (sf_info.format & SF_FORMAT_SUBMASK) == SF_FORMAT_FLOAT ) // if yes, use float format for buffer
|
||||
{
|
||||
fbuf = new sample_t[sf_info.channels * frames];
|
||||
sf_rr = sf_read_float( snd_file, fbuf, sf_info.channels * frames );
|
||||
}
|
||||
else // otherwise, use int
|
||||
{
|
||||
_buf = new int_sample_t[sf_info.channels * frames];
|
||||
sf_rr = sf_read_short( snd_file, _buf, sf_info.channels * frames );
|
||||
}
|
||||
_buf = new sample_t[sf_info.channels * frames];
|
||||
sf_rr = sf_read_float( snd_file, _buf, sf_info.channels * frames );
|
||||
|
||||
if( sf_rr < sf_info.channels * frames )
|
||||
{
|
||||
#ifdef DEBUG_LMMS
|
||||
printf( "SampleBuffer::decodeSampleSF(): could not read"
|
||||
" sample %s: %s\n", _f, sf_strerror( NULL ) );
|
||||
qDebug( "SampleBuffer::decodeSampleSF(): could not read"
|
||||
" sample %s: %s", _f, sf_strerror( NULL ) );
|
||||
#endif
|
||||
}
|
||||
_channels = sf_info.channels;
|
||||
@@ -418,19 +409,15 @@ f_cnt_t SampleBuffer::decodeSampleSF( const char * _f,
|
||||
else
|
||||
{
|
||||
#ifdef DEBUG_LMMS
|
||||
printf( "SampleBuffer::decodeSampleSF(): could not load "
|
||||
"sample %s: %s\n", _f, sf_strerror( NULL ) );
|
||||
qDebug( "SampleBuffer::decodeSampleSF(): could not load "
|
||||
"sample %s: %s", _f, sf_strerror( NULL ) );
|
||||
#endif
|
||||
}
|
||||
//write down either directly or convert i->f depending on file type
|
||||
|
||||
if ( frames > 0 && fbuf != NULL )
|
||||
if ( frames > 0 && _buf != NULL )
|
||||
{
|
||||
directFloatWrite ( fbuf, frames, _channels);
|
||||
}
|
||||
else if ( frames > 0 && _buf != NULL )
|
||||
{
|
||||
convertIntToFloat ( _buf, frames, _channels);
|
||||
directFloatWrite ( _buf, frames, _channels);
|
||||
}
|
||||
|
||||
return frames;
|
||||
@@ -610,23 +597,29 @@ f_cnt_t SampleBuffer::decodeSampleDS( const char * _f,
|
||||
bool SampleBuffer::play( sampleFrame * _ab, handleState * _state,
|
||||
const fpp_t _frames,
|
||||
const float _freq,
|
||||
const bool _looped )
|
||||
const LoopMode _loopmode )
|
||||
{
|
||||
QMutexLocker ml( &m_varLock );
|
||||
|
||||
engine::mixer()->clearAudioBuffer( _ab, _frames );
|
||||
f_cnt_t startFrame = m_startFrame;
|
||||
f_cnt_t endFrame = m_endFrame;
|
||||
f_cnt_t loopStartFrame = m_loopStartFrame;
|
||||
f_cnt_t loopEndFrame = m_loopEndFrame;
|
||||
|
||||
if( m_endFrame == 0 || _frames == 0 )
|
||||
if( endFrame == 0 || _frames == 0 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// variable for determining if we should currently be playing backwards in a ping-pong loop
|
||||
bool is_backwards = _state->isBackwards();
|
||||
|
||||
const double freq_factor = (double) _freq / (double) m_frequency *
|
||||
m_sampleRate / engine::mixer()->processingSampleRate();
|
||||
|
||||
// calculate how many frames we have in requested pitch
|
||||
const f_cnt_t total_frames_for_current_pitch = static_cast<f_cnt_t>( (
|
||||
m_endFrame - m_startFrame ) /
|
||||
endFrame - startFrame ) /
|
||||
freq_factor );
|
||||
|
||||
if( total_frames_for_current_pitch == 0 )
|
||||
@@ -634,37 +627,36 @@ bool SampleBuffer::play( sampleFrame * _ab, handleState * _state,
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// this holds the number of the first frame to play
|
||||
f_cnt_t play_frame = _state->m_frameIndex;
|
||||
if( play_frame < m_startFrame )
|
||||
|
||||
if( play_frame < startFrame )
|
||||
{
|
||||
play_frame = m_startFrame;
|
||||
play_frame = startFrame;
|
||||
}
|
||||
|
||||
// this holds the number of remaining frames in current loop
|
||||
f_cnt_t frames_for_loop;
|
||||
if( _looped )
|
||||
if( _loopmode == LoopOff )
|
||||
{
|
||||
play_frame = getLoopedIndex( play_frame );
|
||||
frames_for_loop = static_cast<f_cnt_t>(
|
||||
( m_loopEndFrame - play_frame ) /
|
||||
freq_factor );
|
||||
if( play_frame >= endFrame )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if( ( endFrame - play_frame ) / freq_factor == 0 ) return false;
|
||||
}
|
||||
|
||||
else if( _loopmode == LoopOn )
|
||||
{
|
||||
play_frame = getLoopedIndex( play_frame, loopStartFrame, loopEndFrame );
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if( play_frame >= m_endFrame )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
frames_for_loop = static_cast<f_cnt_t>(
|
||||
( m_endFrame - play_frame ) /
|
||||
freq_factor );
|
||||
if( frames_for_loop == 0 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
play_frame = getPingPongIndex( play_frame, loopStartFrame, loopEndFrame );
|
||||
}
|
||||
|
||||
|
||||
sampleFrame * tmp = NULL;
|
||||
|
||||
// check whether we have to change pitch...
|
||||
@@ -673,10 +665,10 @@ bool SampleBuffer::play( sampleFrame * _ab, handleState * _state,
|
||||
SRC_DATA src_data;
|
||||
// Generate output
|
||||
const f_cnt_t margin = 64;
|
||||
f_cnt_t fragment_size = (f_cnt_t)( _frames * freq_factor )
|
||||
+ margin;
|
||||
src_data.data_in = getSampleFragment( play_frame,
|
||||
fragment_size, _looped, &tmp )[0];
|
||||
f_cnt_t fragment_size = (f_cnt_t)( _frames * freq_factor ) + margin;
|
||||
src_data.data_in =
|
||||
getSampleFragment( play_frame, fragment_size, _loopmode, &tmp, &is_backwards,
|
||||
loopStartFrame, loopEndFrame, endFrame )[0];
|
||||
src_data.data_out = _ab[0];
|
||||
src_data.input_frames = fragment_size;
|
||||
src_data.output_frames = _frames;
|
||||
@@ -695,10 +687,32 @@ bool SampleBuffer::play( sampleFrame * _ab, handleState * _state,
|
||||
src_data.output_frames_gen, _frames );
|
||||
}
|
||||
// Advance
|
||||
play_frame += src_data.input_frames_used;
|
||||
if( _looped )
|
||||
switch( _loopmode )
|
||||
{
|
||||
play_frame = getLoopedIndex( play_frame );
|
||||
case LoopOff:
|
||||
play_frame += src_data.input_frames_used;
|
||||
break;
|
||||
case LoopOn:
|
||||
play_frame += src_data.input_frames_used;
|
||||
play_frame = getLoopedIndex( play_frame, loopStartFrame, loopEndFrame );
|
||||
break;
|
||||
case LoopPingPong:
|
||||
{
|
||||
f_cnt_t left = src_data.input_frames_used;
|
||||
if( _state->isBackwards() )
|
||||
{
|
||||
play_frame -= src_data.input_frames_used;
|
||||
if( play_frame < loopStartFrame )
|
||||
{
|
||||
left -= ( loopStartFrame - play_frame );
|
||||
play_frame = loopStartFrame;
|
||||
}
|
||||
else left = 0;
|
||||
}
|
||||
play_frame += left;
|
||||
play_frame = getPingPongIndex( play_frame, loopStartFrame, loopEndFrame );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -708,19 +722,43 @@ bool SampleBuffer::play( sampleFrame * _ab, handleState * _state,
|
||||
|
||||
// Generate output
|
||||
memcpy( _ab,
|
||||
getSampleFragment( play_frame, _frames, _looped, &tmp ),
|
||||
getSampleFragment( play_frame, _frames, _loopmode, &tmp, &is_backwards,
|
||||
loopStartFrame, loopEndFrame, endFrame ),
|
||||
_frames * BYTES_PER_FRAME );
|
||||
// Advance
|
||||
play_frame += _frames;
|
||||
if( _looped )
|
||||
switch( _loopmode )
|
||||
{
|
||||
play_frame = getLoopedIndex( play_frame );
|
||||
case LoopOff:
|
||||
play_frame += _frames;
|
||||
break;
|
||||
case LoopOn:
|
||||
play_frame += _frames;
|
||||
play_frame = getLoopedIndex( play_frame, loopStartFrame, loopEndFrame );
|
||||
break;
|
||||
case LoopPingPong:
|
||||
{
|
||||
f_cnt_t left = _frames;
|
||||
if( _state->isBackwards() )
|
||||
{
|
||||
play_frame -= _frames;
|
||||
if( play_frame < loopStartFrame )
|
||||
{
|
||||
left -= ( loopStartFrame - play_frame );
|
||||
play_frame = loopStartFrame;
|
||||
}
|
||||
else left = 0;
|
||||
}
|
||||
play_frame += left;
|
||||
play_frame = getPingPongIndex( play_frame, loopStartFrame, loopEndFrame );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
delete[] tmp;
|
||||
if( tmp != NULL ) delete[] tmp;
|
||||
|
||||
_state->m_frameIndex = play_frame;
|
||||
_state->setBackwards( is_backwards );
|
||||
_state->setFrameIndex( play_frame );
|
||||
|
||||
return true;
|
||||
|
||||
@@ -729,45 +767,104 @@ bool SampleBuffer::play( sampleFrame * _ab, handleState * _state,
|
||||
|
||||
|
||||
|
||||
sampleFrame * SampleBuffer::getSampleFragment( f_cnt_t _start,
|
||||
f_cnt_t _frames, bool _looped, sampleFrame * * _tmp ) const
|
||||
sampleFrame * SampleBuffer::getSampleFragment( f_cnt_t _index,
|
||||
f_cnt_t _frames, LoopMode _loopmode, sampleFrame * * _tmp, bool * _backwards,
|
||||
f_cnt_t _loopstart, f_cnt_t _loopend, f_cnt_t _end ) const
|
||||
{
|
||||
if( _looped )
|
||||
|
||||
if( _loopmode == LoopOff )
|
||||
{
|
||||
if( _start + _frames <= m_loopEndFrame )
|
||||
if( _index + _frames <= _end )
|
||||
{
|
||||
return m_data + _start;
|
||||
return m_data + _index;
|
||||
}
|
||||
}
|
||||
else if( _loopmode == LoopOn )
|
||||
{
|
||||
if( _index + _frames <= _loopend )
|
||||
{
|
||||
return m_data + _index;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( _start + _frames <= m_endFrame )
|
||||
{
|
||||
return m_data + _start;
|
||||
}
|
||||
if( ! *_backwards && _index + _frames < _loopend )
|
||||
return m_data + _index;
|
||||
}
|
||||
|
||||
*_tmp = new sampleFrame[_frames];
|
||||
|
||||
if( _looped )
|
||||
if( _loopmode == LoopOff )
|
||||
{
|
||||
f_cnt_t copied = m_loopEndFrame - _start;
|
||||
memcpy( *_tmp, m_data + _start, copied * BYTES_PER_FRAME );
|
||||
f_cnt_t loop_frames = m_loopEndFrame - m_loopStartFrame;
|
||||
while( _frames - copied > 0 )
|
||||
f_cnt_t available = _end - _index;
|
||||
memcpy( *_tmp, m_data + _index, available * BYTES_PER_FRAME );
|
||||
memset( *_tmp + available, 0, ( _frames - available ) *
|
||||
BYTES_PER_FRAME );
|
||||
}
|
||||
else if( _loopmode == LoopOn )
|
||||
{
|
||||
f_cnt_t copied = qMin( _frames, _loopend - _index );
|
||||
memcpy( *_tmp, m_data + _index, copied * BYTES_PER_FRAME );
|
||||
f_cnt_t loop_frames = _loopend - _loopstart;
|
||||
while( copied < _frames )
|
||||
{
|
||||
f_cnt_t todo = qMin( _frames - copied, loop_frames );
|
||||
memcpy( *_tmp + copied, m_data + m_loopStartFrame,
|
||||
todo * BYTES_PER_FRAME );
|
||||
memcpy( *_tmp + copied, m_data + _loopstart, todo * BYTES_PER_FRAME );
|
||||
copied += todo;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
f_cnt_t available = m_endFrame - _start;
|
||||
memcpy( *_tmp, m_data + _start, available * BYTES_PER_FRAME );
|
||||
memset( *_tmp + available, 0, ( _frames - available ) *
|
||||
BYTES_PER_FRAME );
|
||||
f_cnt_t pos = _index;
|
||||
bool backwards = pos < _loopstart
|
||||
? false
|
||||
: *_backwards;
|
||||
f_cnt_t copied = 0;
|
||||
|
||||
|
||||
if( backwards )
|
||||
{
|
||||
copied = qMin( _frames, pos - _loopstart );
|
||||
for( int i=0; i < copied; i++ )
|
||||
{
|
||||
(*_tmp)[i][0] = m_data[ pos - i ][0];
|
||||
(*_tmp)[i][1] = m_data[ pos - i ][1];
|
||||
}
|
||||
pos -= copied;
|
||||
if( pos == _loopstart ) backwards = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
copied = qMin( _frames, _loopend - pos );
|
||||
memcpy( *_tmp, m_data + pos, copied * BYTES_PER_FRAME );
|
||||
pos += copied;
|
||||
if( pos == _loopend ) backwards = true;
|
||||
}
|
||||
|
||||
while( copied < _frames )
|
||||
{
|
||||
if( backwards )
|
||||
{
|
||||
f_cnt_t todo = qMin( _frames - copied, pos - _loopstart );
|
||||
for ( int i=0; i < todo; i++ )
|
||||
{
|
||||
(*_tmp)[ copied + i ][0] = m_data[ pos - i ][0];
|
||||
(*_tmp)[ copied + i ][1] = m_data[ pos - i ][1];
|
||||
}
|
||||
pos -= todo;
|
||||
copied += todo;
|
||||
if( pos <= _loopstart ) backwards = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
f_cnt_t todo = qMin( _frames - copied, _loopend - pos );
|
||||
memcpy( *_tmp + copied, m_data + pos, todo * BYTES_PER_FRAME );
|
||||
pos += todo;
|
||||
copied += todo;
|
||||
if( pos >= _loopend ) backwards = true;
|
||||
}
|
||||
}
|
||||
*_backwards = backwards;
|
||||
}
|
||||
|
||||
return *_tmp;
|
||||
@@ -776,17 +873,30 @@ sampleFrame * SampleBuffer::getSampleFragment( f_cnt_t _start,
|
||||
|
||||
|
||||
|
||||
f_cnt_t SampleBuffer::getLoopedIndex( f_cnt_t _index ) const
|
||||
f_cnt_t SampleBuffer::getLoopedIndex( f_cnt_t _index, f_cnt_t _startf, f_cnt_t _endf ) const
|
||||
{
|
||||
if( _index < m_loopEndFrame )
|
||||
if( _index < _endf )
|
||||
{
|
||||
return _index;
|
||||
}
|
||||
return m_loopStartFrame + ( _index - m_loopStartFrame )
|
||||
% ( m_loopEndFrame - m_loopStartFrame );
|
||||
return _startf + ( _index - _startf )
|
||||
% ( _endf - _startf );
|
||||
}
|
||||
|
||||
|
||||
f_cnt_t SampleBuffer::getPingPongIndex( f_cnt_t _index, f_cnt_t _startf, f_cnt_t _endf ) const
|
||||
{
|
||||
if( _index < _endf )
|
||||
{
|
||||
return _index;
|
||||
}
|
||||
const f_cnt_t looplen = _endf - _startf;
|
||||
const f_cnt_t looppos = ( _index - _endf ) % ( looplen*2 );
|
||||
|
||||
return ( looppos < looplen )
|
||||
? _endf - looppos
|
||||
: _startf + ( looppos - looplen );
|
||||
}
|
||||
|
||||
|
||||
void SampleBuffer::visualize( QPainter & _p, const QRect & _dr,
|
||||
@@ -915,19 +1025,19 @@ QString SampleBuffer::openAndSetWaveformFile()
|
||||
{
|
||||
m_audioFile = configManager::inst()->factorySamplesDir() + "waveforms/10saw.flac";
|
||||
}
|
||||
|
||||
|
||||
QString fileName = this->openAudioFile();
|
||||
|
||||
if(!fileName.isEmpty())
|
||||
{
|
||||
this->setAudioFile( fileName );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
m_audioFile = "";
|
||||
}
|
||||
|
||||
return fileName;
|
||||
return fileName;
|
||||
}
|
||||
|
||||
|
||||
@@ -1328,7 +1438,8 @@ QString SampleBuffer::tryToMakeAbsolute( const QString & _file )
|
||||
|
||||
SampleBuffer::handleState::handleState( bool _varying_pitch ) :
|
||||
m_frameIndex( 0 ),
|
||||
m_varyingPitch( _varying_pitch )
|
||||
m_varyingPitch( _varying_pitch ),
|
||||
m_isBackwards( false )
|
||||
{
|
||||
int error;
|
||||
if( ( m_resamplingData = src_new(/*
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
|
||||
QPixmap * timeLine::s_timeLinePixmap = NULL;
|
||||
QPixmap * timeLine::s_posMarkerPixmap = NULL;
|
||||
QPixmap * timeLine::s_loopPointPixmap = NULL;
|
||||
|
||||
QPixmap * timeLine::s_loopPointBeginPixmap = NULL;
|
||||
QPixmap * timeLine::s_loopPointEndPixmap = NULL;
|
||||
|
||||
timeLine::timeLine( const int _xoff, const int _yoff, const float _ppt,
|
||||
song::playPos & _pos, const MidiTime & _begin,
|
||||
@@ -81,10 +81,15 @@ timeLine::timeLine( const int _xoff, const int _yoff, const float _ppt,
|
||||
s_posMarkerPixmap = new QPixmap( embed::getIconPixmap(
|
||||
"playpos_marker" ) );
|
||||
}
|
||||
if( s_loopPointPixmap == NULL )
|
||||
if( s_loopPointBeginPixmap == NULL )
|
||||
{
|
||||
s_loopPointPixmap = new QPixmap( embed::getIconPixmap(
|
||||
"loop_point" ) );
|
||||
s_loopPointBeginPixmap = new QPixmap( embed::getIconPixmap(
|
||||
"loop_point_b" ) );
|
||||
}
|
||||
if( s_loopPointEndPixmap == NULL )
|
||||
{
|
||||
s_loopPointEndPixmap = new QPixmap( embed::getIconPixmap(
|
||||
"loop_point_e" ) );
|
||||
}
|
||||
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
@@ -235,8 +240,8 @@ void timeLine::paintEvent( QPaintEvent * )
|
||||
p.setPen( QColor( 0, 0, 0 ) );
|
||||
|
||||
p.setOpacity( loopPointsEnabled() ? 0.9 : 0.2 );
|
||||
p.drawPixmap( markerX( loopBegin() )+2, 2, *s_loopPointPixmap );
|
||||
p.drawPixmap( markerX( loopEnd() )+2, 2, *s_loopPointPixmap );
|
||||
p.drawPixmap( markerX( loopBegin() )+2, 2, *s_loopPointBeginPixmap );
|
||||
p.drawPixmap( markerX( loopEnd() )+2, 2, *s_loopPointEndPixmap );
|
||||
p.setOpacity( 1.0 );
|
||||
|
||||
|
||||
|
||||
@@ -249,7 +249,9 @@ trackContentObjectView::trackContentObjectView( trackContentObject * _tco,
|
||||
m_action( NoAction ),
|
||||
m_autoResize( false ),
|
||||
m_initialMouseX( 0 ),
|
||||
m_hint( NULL )
|
||||
m_hint( NULL ),
|
||||
m_fgColor( NULL ),
|
||||
m_textColor( NULL )
|
||||
{
|
||||
if( s_textFloat == NULL )
|
||||
{
|
||||
@@ -275,6 +277,9 @@ trackContentObjectView::trackContentObjectView( trackContentObject * _tco,
|
||||
connect( m_tco, SIGNAL( destroyedTCO() ), this, SLOT( close() ) );
|
||||
setModel( m_tco );
|
||||
|
||||
setFgColor( QColor( 0,0,0 ) );
|
||||
setTextColor( QColor( 0,0,0 ) );
|
||||
|
||||
m_trackView->getTrackContentWidget()->addTCOView( this );
|
||||
}
|
||||
|
||||
@@ -314,6 +319,23 @@ bool trackContentObjectView::fixedTCOs()
|
||||
|
||||
|
||||
|
||||
// qproperty access functions, to be inherited & used by TCOviews
|
||||
//! \brief CSS theming qproperty access method
|
||||
QColor trackContentObjectView::fgColor() const
|
||||
{ if( m_fgColor ) return *m_fgColor; else return QColor( 0,0,0 ); }
|
||||
|
||||
//! \brief CSS theming qproperty access method
|
||||
QColor trackContentObjectView::textColor() const
|
||||
{ if( m_textColor ) return *m_textColor; else return QColor( 0,0,0 ); }
|
||||
|
||||
//! \brief CSS theming qproperty access method
|
||||
void trackContentObjectView::setFgColor( const QColor & _c )
|
||||
{ if( m_fgColor ) *m_fgColor = _c; else m_fgColor = new QColor( 0,0,0 ); }
|
||||
|
||||
//! \brief CSS theming qproperty access method
|
||||
void trackContentObjectView::setTextColor( const QColor & _c )
|
||||
{ if( m_textColor ) *m_textColor = _c; else m_textColor = new QColor( 0,0,0 ); }
|
||||
|
||||
|
||||
/*! \brief Close a trackContentObjectView
|
||||
*
|
||||
@@ -817,7 +839,14 @@ void trackContentObjectView::setAutoResizeEnabled( bool _e )
|
||||
*/
|
||||
trackContentWidget::trackContentWidget( trackView * _parent ) :
|
||||
QWidget( _parent ),
|
||||
m_trackView( _parent )
|
||||
m_trackView( _parent ),
|
||||
m_darkerColor1( NULL ),
|
||||
m_darkerColor2( NULL ),
|
||||
m_darkerColor3( NULL ),
|
||||
m_lighterColor1( NULL ),
|
||||
m_lighterColor2( NULL ),
|
||||
m_lighterColor3( NULL ),
|
||||
m_gradMidPoint( 0.0f )
|
||||
{
|
||||
setAcceptDrops( true );
|
||||
|
||||
@@ -825,6 +854,16 @@ trackContentWidget::trackContentWidget( trackView * _parent ) :
|
||||
SIGNAL( positionChanged( const MidiTime & ) ),
|
||||
this, SLOT( changePosition( const MidiTime & ) ) );
|
||||
|
||||
//initialize qproperties
|
||||
setDarkerColor1( QColor( 0, 0, 0 ) );
|
||||
setDarkerColor2( QColor( 0, 0, 0 ) );
|
||||
setDarkerColor3( QColor( 0, 0, 0 ) );
|
||||
setLighterColor1( QColor( 0, 0, 0 ) );
|
||||
setLighterColor2( QColor( 0, 0, 0 ) );
|
||||
setLighterColor3( QColor( 0, 0, 0 ) );
|
||||
|
||||
setStyle( QApplication::style() );
|
||||
|
||||
updateBackground();
|
||||
}
|
||||
|
||||
@@ -856,15 +895,15 @@ void trackContentWidget::updateBackground()
|
||||
QPainter pmp( &m_background );
|
||||
|
||||
QLinearGradient grad( 0,0, 0, h );
|
||||
grad.setColorAt( 0.0, QColor( 50, 50, 50 ) );
|
||||
grad.setColorAt( 0.33, QColor( 20, 20, 20 ) );
|
||||
grad.setColorAt( 1.0, QColor( 15, 15, 15 ) );
|
||||
grad.setColorAt( 0.0, darkerColor1() );
|
||||
grad.setColorAt( gradMidPoint(), darkerColor2() );
|
||||
grad.setColorAt( 1.0, darkerColor3() );
|
||||
pmp.fillRect( 0, 0, w, h, grad );
|
||||
|
||||
QLinearGradient grad2( 0,0, 0, h );
|
||||
grad2.setColorAt( 0.0, QColor( 50, 50, 50 ) );
|
||||
grad2.setColorAt( 0.33, QColor( 40, 40, 40 ) );
|
||||
grad2.setColorAt( 1.0, QColor( 30, 30, 30 ) );
|
||||
grad2.setColorAt( 0.0, lighterColor1() );
|
||||
grad2.setColorAt( gradMidPoint(), lighterColor2() );
|
||||
grad2.setColorAt( 1.0, lighterColor3() );
|
||||
pmp.fillRect( w, 0, w , h, grad2 );
|
||||
|
||||
// draw lines
|
||||
@@ -1195,6 +1234,62 @@ MidiTime trackContentWidget::endPosition( const MidiTime & _pos_start )
|
||||
}
|
||||
|
||||
|
||||
// qproperty access methods
|
||||
//! \brief CSS theming qproperty access method
|
||||
QColor trackContentWidget::darkerColor1() const
|
||||
{ if( m_darkerColor1 ) return *m_darkerColor1; else return QColor( 0, 0, 0 ); }
|
||||
|
||||
//! \brief CSS theming qproperty access method
|
||||
QColor trackContentWidget::darkerColor2() const
|
||||
{ if( m_darkerColor2 ) return *m_darkerColor2; else return QColor( 0, 0, 0 ); }
|
||||
|
||||
//! \brief CSS theming qproperty access method
|
||||
QColor trackContentWidget::darkerColor3() const
|
||||
{ if( m_darkerColor3 ) return *m_darkerColor3; else return QColor( 0, 0, 0 ); }
|
||||
|
||||
//! \brief CSS theming qproperty access method
|
||||
QColor trackContentWidget::lighterColor1() const
|
||||
{ if( m_lighterColor1 ) return *m_lighterColor1; else return QColor( 0, 0, 0 ); }
|
||||
|
||||
//! \brief CSS theming qproperty access method
|
||||
QColor trackContentWidget::lighterColor2() const
|
||||
{ if( m_lighterColor2 ) return *m_lighterColor2; else return QColor( 0, 0, 0 ); }
|
||||
|
||||
//! \brief CSS theming qproperty access method
|
||||
QColor trackContentWidget::lighterColor3() const
|
||||
{ if( m_lighterColor3 ) return *m_lighterColor3; else return QColor( 0, 0, 0 ); }
|
||||
|
||||
//! \brief CSS theming qproperty access method
|
||||
void trackContentWidget::setDarkerColor1( const QColor & _c )
|
||||
{ if( m_darkerColor1 ) *m_darkerColor1 = _c; else m_darkerColor1 = new QColor( _c ); }
|
||||
|
||||
//! \brief CSS theming qproperty access method
|
||||
void trackContentWidget::setDarkerColor2( const QColor & _c )
|
||||
{ if( m_darkerColor2 ) *m_darkerColor2 = _c; else m_darkerColor2 = new QColor( _c ); }
|
||||
|
||||
//! \brief CSS theming qproperty access method
|
||||
void trackContentWidget::setDarkerColor3( const QColor & _c )
|
||||
{ if( m_darkerColor3 ) *m_darkerColor3 = _c; else m_darkerColor3 = new QColor( _c ); }
|
||||
|
||||
//! \brief CSS theming qproperty access method
|
||||
void trackContentWidget::setLighterColor1( const QColor & _c )
|
||||
{ if( m_lighterColor1 ) *m_lighterColor1 = _c; else m_lighterColor1 = new QColor( _c ); }
|
||||
|
||||
//! \brief CSS theming qproperty access method
|
||||
void trackContentWidget::setLighterColor2( const QColor & _c )
|
||||
{ if( m_lighterColor2 ) *m_lighterColor2 = _c; else m_lighterColor2 = new QColor( _c ); }
|
||||
|
||||
//! \brief CSS theming qproperty access method
|
||||
void trackContentWidget::setLighterColor3( const QColor & _c )
|
||||
{ if( m_lighterColor3 ) *m_lighterColor3 = _c; else m_lighterColor3 = new QColor( _c ); }
|
||||
|
||||
//! \brief CSS theming qproperty access method
|
||||
float trackContentWidget::gradMidPoint() const
|
||||
{ return m_gradMidPoint; }
|
||||
|
||||
//! \brief CSS theming qproperty access method
|
||||
void trackContentWidget::setGradMidPoint( float _g )
|
||||
{ m_gradMidPoint = _g; }
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -273,8 +273,9 @@ void AutomationPatternView::paintEvent( QPaintEvent * )
|
||||
|
||||
QLinearGradient lin2grad( 0, min, 0, max );
|
||||
|
||||
lin2grad.setColorAt( 1, c.lighter( 200 ) );
|
||||
lin2grad.setColorAt( 0, c );
|
||||
lin2grad.setColorAt( 1, fgColor().lighter( 150 ) );
|
||||
lin2grad.setColorAt( 0.5, fgColor() );
|
||||
lin2grad.setColorAt( 0, fgColor().darker( 150 ) );
|
||||
|
||||
for( AutomationPattern::timeMap::const_iterator it =
|
||||
m_pat->getTimeMap().begin();
|
||||
@@ -313,7 +314,7 @@ void AutomationPatternView::paintEvent( QPaintEvent * )
|
||||
|
||||
QColor text_color = ( m_pat->isMuted() || m_pat->getTrack()->isMuted() )
|
||||
? QColor( 30, 30, 30 )
|
||||
: QColor( 255, 255, 255 );
|
||||
: textColor();
|
||||
|
||||
p.setPen( QColor( 0, 0, 0 ) );
|
||||
p.drawText( 4, p.fontMetrics().height()+1, m_pat->name() );
|
||||
|
||||
@@ -71,15 +71,15 @@ FxMixerView::FxMixerView() :
|
||||
|
||||
// Channel area
|
||||
m_channelAreaWidget = new QWidget;
|
||||
chLayout = new QHBoxLayout(m_channelAreaWidget);
|
||||
chLayout->setSizeConstraint(QLayout::SetMinimumSize);
|
||||
chLayout = new QHBoxLayout( m_channelAreaWidget );
|
||||
chLayout->setSizeConstraint( QLayout::SetMinimumSize );
|
||||
chLayout->setSpacing( 0 );
|
||||
chLayout->setMargin( 0 );
|
||||
m_channelAreaWidget->setLayout(chLayout);
|
||||
|
||||
// add master channel
|
||||
m_fxChannelViews.resize(m->numChannels());
|
||||
m_fxChannelViews[0] = new FxChannelView(this, this, 0);
|
||||
m_fxChannelViews.resize( m->numChannels() );
|
||||
m_fxChannelViews[0] = new FxChannelView( this, this, 0 );
|
||||
|
||||
FxChannelView * masterView = m_fxChannelViews[0];
|
||||
ml->addWidget( masterView->m_fxLine, 0, Qt::AlignTop );
|
||||
@@ -90,7 +90,7 @@ FxMixerView::FxMixerView() :
|
||||
for( int i = 1; i < m_fxChannelViews.size(); ++i )
|
||||
{
|
||||
m_fxChannelViews[i] = new FxChannelView(m_channelAreaWidget, this, i);
|
||||
chLayout->addWidget(m_fxChannelViews[i]->m_fxLine);
|
||||
chLayout->addWidget( m_fxChannelViews[i]->m_fxLine );
|
||||
}
|
||||
|
||||
// add the scrolling section to the main layout
|
||||
@@ -98,22 +98,22 @@ FxMixerView::FxMixerView() :
|
||||
class ChannelArea : public QScrollArea
|
||||
{
|
||||
public:
|
||||
ChannelArea(QWidget * parent, FxMixerView * mv) :
|
||||
QScrollArea(parent), m_mv(mv) {}
|
||||
ChannelArea( QWidget * parent, FxMixerView * mv ) :
|
||||
QScrollArea( parent ), m_mv( mv ) {}
|
||||
~ChannelArea() {}
|
||||
virtual void keyPressEvent(QKeyEvent * e)
|
||||
virtual void keyPressEvent( QKeyEvent * e )
|
||||
{
|
||||
m_mv->keyPressEvent(e);
|
||||
m_mv->keyPressEvent( e );
|
||||
}
|
||||
private:
|
||||
FxMixerView * m_mv;
|
||||
};
|
||||
channelArea = new ChannelArea(this, this);
|
||||
channelArea->setWidget(m_channelAreaWidget);
|
||||
channelArea = new ChannelArea( this, this );
|
||||
channelArea->setWidget( m_channelAreaWidget );
|
||||
channelArea->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||
channelArea->setFrameStyle( QFrame::NoFrame );
|
||||
channelArea->setMinimumWidth( fxLineSize.width() * 6 );
|
||||
channelArea->setFixedHeight( fxLineSize.height() +
|
||||
channelArea->setFixedHeight( fxLineSize.height() +
|
||||
style()->pixelMetric( QStyle::PM_ScrollBarExtent ) );
|
||||
ml->addWidget(channelArea);
|
||||
|
||||
@@ -124,10 +124,12 @@ FxMixerView::FxMixerView() :
|
||||
connect( newChannelBtn, SIGNAL(clicked()), this, SLOT(addNewChannel()));
|
||||
ml->addWidget( newChannelBtn, 0, Qt::AlignTop );
|
||||
|
||||
|
||||
|
||||
// Create EffectRack and set initial index to master channel
|
||||
m_rackView = new EffectRackView( &m->m_fxChannels[0]->m_fxChain, this );
|
||||
m_rackView->setFixedSize( 245, fxLineSize.height() );
|
||||
ml->addWidget( m_rackView, 0, Qt::AlignTop );
|
||||
|
||||
setCurrentFxLine( m_fxChannelViews[0]->m_fxLine );
|
||||
|
||||
setLayout( ml );
|
||||
@@ -344,7 +346,7 @@ void FxMixerView::deleteChannel(int index)
|
||||
|
||||
|
||||
|
||||
void FxMixerView::moveChannelLeft(int index)
|
||||
void FxMixerView::moveChannelLeft(int index)
|
||||
{
|
||||
// can't move master or first channel left or last channel right
|
||||
if( index <= 1 || index >= m_fxChannelViews.size() ) return;
|
||||
|
||||
@@ -225,6 +225,7 @@ bool fileBrowser::filterItems( QTreeWidgetItem * _item, const QString & _filter
|
||||
|
||||
void fileBrowser::reloadTree( void )
|
||||
{
|
||||
const QString text = m_filterEdit->text();
|
||||
m_filterEdit->clear();
|
||||
m_l->clear();
|
||||
QStringList paths = m_directories.split( '*' );
|
||||
@@ -232,6 +233,8 @@ void fileBrowser::reloadTree( void )
|
||||
{
|
||||
addItems( *it );
|
||||
}
|
||||
m_filterEdit->setText( text );
|
||||
filterItems( text );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -47,8 +47,8 @@ FxLine::FxLine( QWidget * _parent, FxMixerView * _mv, int _channelIndex) :
|
||||
setCursor( QCursor( embed::getIconPixmap( "hand" ), 0, 0 ) );
|
||||
|
||||
// mixer sends knob
|
||||
m_sendKnob = new knob(0, this, tr("Channel send amount"));
|
||||
m_sendKnob->move(0, 22);
|
||||
m_sendKnob = new knob( knobBright_26, this, tr("Channel send amount") );
|
||||
m_sendKnob->move(3, 22);
|
||||
m_sendKnob->setVisible(false);
|
||||
|
||||
// send button indicator
|
||||
@@ -59,7 +59,7 @@ FxLine::FxLine( QWidget * _parent, FxMixerView * _mv, int _channelIndex) :
|
||||
// channel number
|
||||
m_lcd = new LcdWidget( 2, this );
|
||||
m_lcd->setValue( m_channelIndex );
|
||||
m_lcd->move( 2, 58 );
|
||||
m_lcd->move( 4, 58 );
|
||||
m_lcd->setMarginWidth( 1 );
|
||||
}
|
||||
|
||||
|
||||
@@ -358,7 +358,7 @@ void SampleTCOView::paintEvent( QPaintEvent * _pe )
|
||||
}
|
||||
else
|
||||
{
|
||||
p.setPen( c.lighter( 200 ) );
|
||||
p.setPen( fgColor() );
|
||||
}
|
||||
QRect r = QRect( 1, 1,
|
||||
qMax( static_cast<int>( m_tco->sampleLength() *
|
||||
@@ -383,10 +383,10 @@ void SampleTCOView::paintEvent( QPaintEvent * _pe )
|
||||
|
||||
p.setPen( QColor( 0, 0, 0 ) );
|
||||
p.drawText( 10, p.fontMetrics().height()+1, "Rec" );
|
||||
p.setPen( QColor( 255, 60, 60 ) );
|
||||
p.setPen( textColor() );
|
||||
p.drawText( 9, p.fontMetrics().height(), "Rec" );
|
||||
|
||||
p.setBrush( QBrush( QColor( 255, 60, 60 ) ) );
|
||||
p.setBrush( QBrush( textColor() ) );
|
||||
p.drawEllipse( 4, 5, 4, 4 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ void bbTCOView::paintEvent( QPaintEvent * )
|
||||
|
||||
p.setPen( QColor( 0, 0, 0 ) );
|
||||
p.drawText( 4, p.fontMetrics().height()+1, m_bbTCO->name() );
|
||||
p.setPen( QColor( 255, 255, 255 ) );
|
||||
p.setPen( textColor() );
|
||||
p.drawText( 3, p.fontMetrics().height(), m_bbTCO->name() );
|
||||
|
||||
if( m_bbTCO->isMuted() )
|
||||
|
||||