Compare commits
87 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
794e697e22 | ||
|
|
2f4d9c6c66 | ||
|
|
752f48f51c | ||
|
|
565ebee7d1 | ||
|
|
33b9524346 | ||
|
|
e4340c630d | ||
|
|
f986f099da | ||
|
|
22cb12d066 | ||
|
|
6c920df328 | ||
|
|
25f2eae67f | ||
|
|
b02c351fe1 | ||
|
|
69e02fc37d | ||
|
|
e4dd6938cc | ||
|
|
13a41b5bff | ||
|
|
6a1a295cec | ||
|
|
6bb16951ad | ||
|
|
8e4417e5d9 | ||
|
|
890993bff0 | ||
|
|
71eaa4f5e3 | ||
|
|
1153e85c0c | ||
|
|
6e4fbbed87 | ||
|
|
b2c1a04df8 | ||
|
|
33ea001c31 | ||
|
|
117ca99c85 | ||
|
|
9aa6a3fbeb | ||
|
|
bdf234aeb8 | ||
|
|
cce942e5d5 | ||
|
|
d4bbaa58b4 | ||
|
|
729838fa08 | ||
|
|
b5eb4f1f7a | ||
|
|
585f95741c | ||
|
|
9ffeae441d | ||
|
|
6f5a47342b | ||
|
|
e1bebbfcad | ||
|
|
246572489b | ||
|
|
9c107f3860 | ||
|
|
40c67ac5dd | ||
|
|
7a7c9abd9b | ||
|
|
450bf3a35a | ||
|
|
87d62a6a73 | ||
|
|
2a0f268a89 | ||
|
|
376765526a | ||
|
|
34ba29cfcd | ||
|
|
0b46aa4506 | ||
|
|
ed29f2b6f6 | ||
|
|
9ab6699a26 | ||
|
|
41c154dc95 | ||
|
|
b45c0c5f02 | ||
|
|
194088db5f | ||
|
|
a4b328e28f | ||
|
|
78e14739f0 | ||
|
|
547e6dcc95 | ||
|
|
66ba074554 | ||
|
|
5e2d299360 | ||
|
|
f32c89bd13 | ||
|
|
ab4cebeea0 | ||
|
|
a1e7d9e42d | ||
|
|
fb161d5b69 | ||
|
|
719d39df76 | ||
|
|
a585650904 | ||
|
|
ce9cfa6821 | ||
|
|
91e9802993 | ||
|
|
a666df0e56 | ||
|
|
d269cfe6db | ||
|
|
0ed2b5c4a7 | ||
|
|
eb63f04f55 | ||
|
|
cf925d7c5b | ||
|
|
7dac1137bc | ||
|
|
5e3d7fa720 | ||
|
|
cf341c7bdf | ||
|
|
325a8cf842 | ||
|
|
cea7394e86 | ||
|
|
3637359506 | ||
|
|
daa0476205 | ||
|
|
847edd624c | ||
|
|
a54e665e7a | ||
|
|
dbea815931 | ||
|
|
b8e2f3f785 | ||
|
|
7af2930a45 | ||
|
|
1725498bef | ||
|
|
fab41306ac | ||
|
|
6a86fccfa1 | ||
|
|
24c5b2367e | ||
|
|
a394bb099c | ||
|
|
ba7e5e5f5c | ||
|
|
6a6711b088 | ||
|
|
ab69c2d44b |
@@ -13,9 +13,9 @@ INCLUDE(AddFileDependencies)
|
||||
INCLUDE(CheckIncludeFiles)
|
||||
INCLUDE(FindPkgConfig)
|
||||
|
||||
SET(VERSION_MAJOR "0")
|
||||
SET(VERSION_MINOR "9")
|
||||
SET(VERSION_PATCH "92")
|
||||
SET(VERSION_MAJOR "1")
|
||||
SET(VERSION_MINOR "0")
|
||||
SET(VERSION_PATCH "0")
|
||||
#SET(VERSION_SUFFIX "")
|
||||
SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
|
||||
IF(VERSION_SUFFIX)
|
||||
@@ -439,7 +439,7 @@ IF(LMMS_BUILD_WIN32)
|
||||
"${MINGW_PREFIX}/bin/libfftw3f-3.dll"
|
||||
"${MINGW_PREFIX}/bin/libFLAC-8.dll"
|
||||
"${MINGW_PREFIX}/bin/libportaudio-2.dll"
|
||||
"${MINGW_PREFIX}/bin/libpng15-15.dll"
|
||||
"${MINGW_PREFIX}/bin/libpng16-16.dll"
|
||||
"${MINGW_PREFIX}/bin/SDL.dll"
|
||||
"${MINGW_PREFIX}/bin/libglib-2.0-0.dll"
|
||||
"${MINGW_PREFIX}/bin/libgthread-2.0-0.dll"
|
||||
|
||||
2
README
@@ -1,4 +1,4 @@
|
||||
LMMS 0.9.92
|
||||
LMMS 1.0.0
|
||||
===========
|
||||
|
||||
Copyright (c) 2004-2014 by LMMS developers
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
?package(lmms):needs="X11" section="Apps/Sound" \
|
||||
title="LMMS" hints="Audio" command="/usr/bin/lmms" \
|
||||
longtitle="Linux MultiMedia Studio" \
|
||||
longtitle="LMMS" \
|
||||
icon="/usr/share/pixmaps/lmms.png"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
[Desktop Entry]
|
||||
Name=Linux MultiMedia Studio
|
||||
Name=LMMS
|
||||
GenericName=music production suite
|
||||
GenericName[ca]=Programari de producció musical
|
||||
GenericName[de]=Software zur Musik-Produktion
|
||||
Comment=easy music production for everyone!
|
||||
Comment[ca]=Producció fàcil de música per a tothom!
|
||||
Icon=lmms
|
||||
Exec=lmms
|
||||
Exec=env QT_X11_NO_NATIVE_MENUBAR=1 lmms
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Qt;AudioVideo;Audio;Midi;
|
||||
|
||||
BIN
data/lmms.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
@@ -3,7 +3,7 @@
|
||||
<multimedia-project version="1.0" creator="Linux MultiMedia Studio (LMMS)" creatorversion="0.4.0-rc2" type="instrumenttracksettings" >
|
||||
<head/>
|
||||
<instrumenttracksettings muted="0" type="0" name="Erazzor" >
|
||||
<instrumenttrack pan="0" fxch="2" pitch="0" basenote="57" vol="100" >
|
||||
<instrumenttrack pan="0" fxch="0" pitch="0" basenote="57" vol="100" >
|
||||
<instrument name="tripleoscillator" >
|
||||
<tripleoscillator phoffset2="0" userwavefile0="" finer0="-2" userwavefile1="" finer1="2" userwavefile2="" finer2="0" coarse0="0" coarse1="0" coarse2="0" finel0="0" finel1="-2" modalgo1="1" modalgo2="0" finel2="-2" pan0="0" modalgo3="2" pan1="0" stphdetun0="0" pan2="0" stphdetun1="0" wavetype0="2" stphdetun2="0" wavetype1="2" wavetype2="1" vol0="33" vol1="33" phoffset0="0" phoffset1="0" vol2="33" />
|
||||
</instrument>
|
||||
|
||||
@@ -88,7 +88,6 @@ public:
|
||||
private:
|
||||
comboBox * m_backend;
|
||||
comboBox * m_device;
|
||||
LcdSpinBox * m_channels;
|
||||
AudioPortAudioSetupUtil m_setupUtil;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _AUTOMATABLE_MODEL_H
|
||||
#define _AUTOMATABLE_MODEL_H
|
||||
#ifndef AUTOMATABLE_MODEL_H
|
||||
#define AUTOMATABLE_MODEL_H
|
||||
|
||||
#include <math.h>
|
||||
|
||||
@@ -34,24 +34,24 @@
|
||||
// simple way to map a property of a view to a model
|
||||
#define mapPropertyFromModelPtr(type,getfunc,setfunc,modelname) \
|
||||
public: \
|
||||
inline type getfunc() const \
|
||||
type getfunc() const \
|
||||
{ \
|
||||
return (type) modelname->value(); \
|
||||
} \
|
||||
public slots: \
|
||||
inline void setfunc( const type val ) \
|
||||
void setfunc( const type val ) \
|
||||
{ \
|
||||
modelname->setValue( val ); \
|
||||
}
|
||||
|
||||
#define mapPropertyFromModel(type,getfunc,setfunc,modelname) \
|
||||
public: \
|
||||
inline type getfunc() const \
|
||||
type getfunc() const \
|
||||
{ \
|
||||
return (type) modelname.value(); \
|
||||
} \
|
||||
public slots: \
|
||||
inline void setfunc( const type val ) \
|
||||
void setfunc( const type val ) \
|
||||
{ \
|
||||
modelname.setValue( (float) val ); \
|
||||
}
|
||||
@@ -80,8 +80,8 @@ public:
|
||||
const float max = 0,
|
||||
const float step = 0,
|
||||
Model* parent = NULL,
|
||||
const QString& display_name = QString(),
|
||||
bool default_constructed = false );
|
||||
const QString& displayName = QString(),
|
||||
bool defaultConstructed = false );
|
||||
|
||||
virtual ~AutomatableModel();
|
||||
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
|
||||
bool isAutomated() const;
|
||||
|
||||
inline ControllerConnection* controllerConnection() const
|
||||
ControllerConnection* controllerConnection() const
|
||||
{
|
||||
return m_controllerConnection;
|
||||
}
|
||||
@@ -103,13 +103,13 @@ public:
|
||||
|
||||
|
||||
template<class T>
|
||||
static inline T castValue( const float v )
|
||||
static T castValue( const float v )
|
||||
{
|
||||
return (T)( v );
|
||||
}
|
||||
|
||||
template<bool>
|
||||
static inline bool castValue( const float v )
|
||||
static bool castValue( const float v )
|
||||
{
|
||||
return ( qRound( v ) != 0 );
|
||||
}
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
|
||||
|
||||
template<class T>
|
||||
inline T initValue() const
|
||||
T initValue() const
|
||||
{
|
||||
return castValue<T>( m_initValue );
|
||||
}
|
||||
@@ -141,19 +141,19 @@ public:
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline T minValue() const
|
||||
T minValue() const
|
||||
{
|
||||
return castValue<T>( m_minValue );
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline T maxValue() const
|
||||
T maxValue() const
|
||||
{
|
||||
return castValue<T>( m_maxValue );
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline T step() const
|
||||
T step() const
|
||||
{
|
||||
return castValue<T>( m_step );
|
||||
}
|
||||
@@ -164,12 +164,12 @@ public:
|
||||
void setAutomatedValue( const float value );
|
||||
void setValue( const float value );
|
||||
|
||||
inline void incValue( int steps )
|
||||
void incValue( int steps )
|
||||
{
|
||||
setValue( m_value + steps * m_step );
|
||||
}
|
||||
|
||||
inline float range() const
|
||||
float range() const
|
||||
{
|
||||
return m_range;
|
||||
}
|
||||
@@ -193,10 +193,13 @@ public:
|
||||
|
||||
void unlinkAllModels();
|
||||
|
||||
virtual void saveSettings( QDomDocument& doc, QDomElement& element,
|
||||
const QString& name = QString( "value" ) );
|
||||
/*! \brief Saves settings (value, automation links and controller connections) of AutomatableModel into
|
||||
specified DOM element using <name> as attribute/node name */
|
||||
virtual void saveSettings( QDomDocument& doc, QDomElement& element, const QString& name );
|
||||
|
||||
virtual void loadSettings( const QDomElement& element, const QString& name = QString( "value" ) );
|
||||
/*! \brief Loads settings (value, automation links and controller connections) of AutomatableModel from
|
||||
specified DOM element using <name> as attribute/node name */
|
||||
virtual void loadSettings( const QDomElement& element, const QString& name );
|
||||
|
||||
virtual QString nodeName() const
|
||||
{
|
||||
@@ -240,6 +243,16 @@ protected:
|
||||
|
||||
|
||||
private:
|
||||
virtual void saveSettings( QDomDocument& doc, QDomElement& element )
|
||||
{
|
||||
saveSettings( doc, element, "value" );
|
||||
}
|
||||
|
||||
virtual void loadSettings( const QDomElement& element )
|
||||
{
|
||||
loadSettings( element, "value" );
|
||||
}
|
||||
|
||||
void linkModel( AutomatableModel* model );
|
||||
void unlinkModel( AutomatableModel* model );
|
||||
|
||||
@@ -280,22 +293,22 @@ signals:
|
||||
|
||||
|
||||
#define defaultTypedMethods(type) \
|
||||
inline type value( int frameOffset = 0 ) const \
|
||||
type value( int frameOffset = 0 ) const \
|
||||
{ \
|
||||
return AutomatableModel::value<type>( frameOffset ); \
|
||||
} \
|
||||
\
|
||||
inline type initValue() const \
|
||||
type initValue() const \
|
||||
{ \
|
||||
return AutomatableModel::initValue<type>(); \
|
||||
} \
|
||||
\
|
||||
inline type minValue() const \
|
||||
type minValue() const \
|
||||
{ \
|
||||
return AutomatableModel::minValue<type>(); \
|
||||
} \
|
||||
\
|
||||
inline type maxValue() const \
|
||||
type maxValue() const \
|
||||
{ \
|
||||
return AutomatableModel::maxValue<type>(); \
|
||||
} \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* AutomationPattern.h - declaration of class AutomationPattern, which contains
|
||||
* all information about an automation pattern
|
||||
*
|
||||
* Copyright (c) 2008-2013 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
@@ -179,8 +179,8 @@ private:
|
||||
|
||||
bool m_dragging;
|
||||
|
||||
static const float DEFAULT_MIN_VALUE = 0;
|
||||
static const float DEFAULT_MAX_VALUE = 1;
|
||||
static const float DEFAULT_MIN_VALUE;
|
||||
static const float DEFAULT_MAX_VALUE;
|
||||
|
||||
friend class AutomationPatternView;
|
||||
|
||||
|
||||
@@ -65,11 +65,8 @@ private slots:
|
||||
private:
|
||||
QVector<ControllerView *> m_controllerViews;
|
||||
|
||||
QVBoxLayout * m_mainLayout;
|
||||
QScrollArea * m_scrollArea;
|
||||
QPushButton * m_addButton;
|
||||
|
||||
int m_lastY;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -77,7 +77,6 @@ protected:
|
||||
|
||||
private:
|
||||
QPixmap m_bg;
|
||||
ledCheckBox * m_bypass;
|
||||
QMdiSubWindow * m_subWindow;
|
||||
ControllerDialog * m_controllerDlg;
|
||||
bool m_show;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* DummyInstrument.h - instrument used as fallback if an instrument couldn't
|
||||
* be loaded
|
||||
*
|
||||
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual void playNote( NotePlayHandle *, bool, sampleFrame * )
|
||||
virtual void playNote( NotePlayHandle *, sampleFrame * )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _ENVELOPE_AND_LFO_VIEW_H
|
||||
#define _ENVELOPE_AND_LFO_VIEW_H
|
||||
#ifndef ENVELOPE_AND_LFO_VIEW_H
|
||||
#define ENVELOPE_AND_LFO_VIEW_H
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* InstrumentMidiIOView.h - widget in instrument-track-window for setting
|
||||
* up MIDI-related stuff
|
||||
*
|
||||
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -23,8 +23,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _INSTRUMENT_MIDI_IO_VIEW_H
|
||||
#define _INSTRUMENT_MIDI_IO_VIEW_H
|
||||
#ifndef INSTRUMENT_MIDI_IO_VIEW_H
|
||||
#define INSTRUMENT_MIDI_IO_VIEW_H
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
@@ -39,7 +39,7 @@ class QToolButton;
|
||||
class InstrumentMidiIOView : public QWidget, public ModelView
|
||||
{
|
||||
public:
|
||||
InstrumentMidiIOView( QWidget * _parent );
|
||||
InstrumentMidiIOView( QWidget* parent );
|
||||
virtual ~InstrumentMidiIOView();
|
||||
|
||||
|
||||
@@ -58,7 +58,8 @@ private:
|
||||
LcdSpinBox * m_fixedOutputNoteSpinBox;
|
||||
QToolButton * m_wpBtn;
|
||||
|
||||
LcdSpinBox* m_baseVelocitySpinBox;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* InstrumentSoundShapingView.h - view for InstrumentSoundShaping class
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -30,6 +30,8 @@
|
||||
#include "InstrumentSoundShaping.h"
|
||||
#include "ModelView.h"
|
||||
|
||||
class QLabel;
|
||||
|
||||
class EnvelopeAndLfoView;
|
||||
class comboBox;
|
||||
class groupBox;
|
||||
@@ -61,6 +63,8 @@ private:
|
||||
knob * m_filterCutKnob;
|
||||
knob * m_filterResKnob;
|
||||
|
||||
QLabel* m_singleStreamInfoLabel;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Danny McRae <khjklujn/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
|
||||
@@ -23,8 +23,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _LADSPA_CONTROL_H
|
||||
#define _LADSPA_CONTROL_H
|
||||
#ifndef LADSPA_CONTROL_H
|
||||
#define LADSPA_CONTROL_H
|
||||
|
||||
#include <ladspa.h>
|
||||
|
||||
@@ -70,8 +70,7 @@ public:
|
||||
return m_port;
|
||||
}
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent,
|
||||
const QString & _name );
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent, const QString & _name );
|
||||
virtual void loadSettings( const QDomElement & _this, const QString & _name );
|
||||
inline virtual QString nodeName() const
|
||||
{
|
||||
@@ -90,6 +89,19 @@ protected slots:
|
||||
void tempoKnobChanged();
|
||||
void linkStateChanged();
|
||||
|
||||
protected:
|
||||
virtual void saveSettings( QDomDocument& doc, QDomElement& element )
|
||||
{
|
||||
Q_UNUSED(doc)
|
||||
Q_UNUSED(element)
|
||||
}
|
||||
|
||||
virtual void loadSettings( const QDomElement& element )
|
||||
{
|
||||
Q_UNUSED(element)
|
||||
}
|
||||
|
||||
|
||||
|
||||
private:
|
||||
bool m_link;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* main_window.h - declaration of class MainWindow, the main window of LMMS
|
||||
* MainWindow.h - declaration of class MainWindow, the main window of LMMS
|
||||
*
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2004-2013 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
|
||||
@@ -22,15 +22,13 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MAIN_WINDOW_H
|
||||
#define _MAIN_WINDOW_H
|
||||
#ifndef MAIN_WINDOW_H
|
||||
#define MAIN_WINDOW_H
|
||||
|
||||
#include <QtCore/QBasicTimer>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtCore/QList>
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QWhatsThis>
|
||||
|
||||
class QAction;
|
||||
class QDomElement;
|
||||
@@ -46,14 +44,14 @@ class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
inline QMdiArea * workspace( void )
|
||||
QMdiArea* workspace()
|
||||
{
|
||||
return( m_workspace );
|
||||
return m_workspace;
|
||||
}
|
||||
|
||||
inline QWidget * toolBar( void )
|
||||
QWidget* toolBar()
|
||||
{
|
||||
return( m_toolBar );
|
||||
return m_toolBar;
|
||||
}
|
||||
|
||||
int addWidgetToToolBar( QWidget * _w, int _row = -1, int _col = -1 );
|
||||
@@ -63,24 +61,24 @@ public:
|
||||
// every function that replaces current file (e.g. creates new file,
|
||||
// opens another file...) has to call this before and may only process
|
||||
// if this function returns true
|
||||
bool mayChangeProject( void );
|
||||
bool mayChangeProject();
|
||||
|
||||
|
||||
void clearKeyModifiers( void );
|
||||
void clearKeyModifiers();
|
||||
|
||||
inline bool isCtrlPressed( void )
|
||||
bool isCtrlPressed()
|
||||
{
|
||||
return( m_keyMods.m_ctrl );
|
||||
return m_keyMods.m_ctrl;
|
||||
}
|
||||
|
||||
inline bool isShiftPressed( void )
|
||||
bool isShiftPressed()
|
||||
{
|
||||
return( m_keyMods.m_shift );
|
||||
return m_keyMods.m_shift;
|
||||
}
|
||||
|
||||
inline bool isAltPressed( void )
|
||||
bool isAltPressed()
|
||||
{
|
||||
return( m_keyMods.m_alt );
|
||||
return m_keyMods.m_alt;
|
||||
}
|
||||
|
||||
static void saveWidgetState( QWidget * _w, QDomElement & _de );
|
||||
@@ -88,34 +86,31 @@ public:
|
||||
|
||||
|
||||
public slots:
|
||||
void resetWindowTitle( void );
|
||||
void resetWindowTitle();
|
||||
|
||||
inline void emptySlot( void )
|
||||
{
|
||||
}
|
||||
inline void enterWhatsThisMode( void )
|
||||
{
|
||||
QWhatsThis::enterWhatsThisMode();
|
||||
}
|
||||
void createNewProject( void );
|
||||
void emptySlot();
|
||||
void enterWhatsThisMode();
|
||||
void createNewProject();
|
||||
void createNewProjectFromTemplate( QAction * _idx );
|
||||
void openProject( void );
|
||||
bool saveProject( void );
|
||||
bool saveProjectAs( void );
|
||||
bool saveProjectAsNewVersion( void );
|
||||
void showSettingsDialog( void );
|
||||
void aboutLMMS( void );
|
||||
void help( void );
|
||||
void toggleAutomationEditorWin( void );
|
||||
void openProject();
|
||||
bool saveProject();
|
||||
bool saveProjectAs();
|
||||
bool saveProjectAsNewVersion();
|
||||
void showSettingsDialog();
|
||||
void aboutLMMS();
|
||||
void help();
|
||||
void toggleAutomationEditorWin();
|
||||
void toggleBBEditorWin( bool forceShow = false );
|
||||
void toggleSongEditorWin( void );
|
||||
void toggleProjectNotesWin( void );
|
||||
void toggleFxMixerWin( void );
|
||||
void togglePianoRollWin( void );
|
||||
void toggleControllerRack( void );
|
||||
void toggleSongEditorWin();
|
||||
void toggleProjectNotesWin();
|
||||
void toggleFxMixerWin();
|
||||
void togglePianoRollWin();
|
||||
void toggleControllerRack();
|
||||
|
||||
void undo( void );
|
||||
void redo( void );
|
||||
void updatePlayPauseIcons();
|
||||
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
|
||||
protected:
|
||||
@@ -127,11 +122,11 @@ protected:
|
||||
|
||||
|
||||
private:
|
||||
MainWindow( void );
|
||||
MainWindow();
|
||||
MainWindow( const MainWindow & );
|
||||
virtual ~MainWindow();
|
||||
|
||||
void finalize( void );
|
||||
void finalize();
|
||||
|
||||
void toggleWindow( QWidget *window, bool forceShow = false );
|
||||
|
||||
@@ -169,17 +164,17 @@ private:
|
||||
|
||||
|
||||
private slots:
|
||||
void browseHelp( void );
|
||||
void fillTemplatesMenu( void );
|
||||
void browseHelp();
|
||||
void fillTemplatesMenu();
|
||||
void openRecentlyOpenedProject( QAction * _action );
|
||||
void showTool( QAction * _idx );
|
||||
void updateRecentlyOpenedProjectsMenu( void );
|
||||
void updateRecentlyOpenedProjectsMenu();
|
||||
|
||||
|
||||
void autoSave();
|
||||
|
||||
signals:
|
||||
void periodicUpdate( void );
|
||||
void periodicUpdate();
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -140,9 +140,9 @@ public:
|
||||
return m_data.m_param[1];
|
||||
}
|
||||
|
||||
volume_t volume() const
|
||||
volume_t volume( int midiBaseVelocity ) const
|
||||
{
|
||||
return (volume_t)( velocity() * MaxVolume / MidiMaxVelocity );
|
||||
return (volume_t)( velocity() * DefaultVolume / midiBaseVelocity );
|
||||
}
|
||||
|
||||
const void* sourcePort() const
|
||||
|
||||
@@ -45,22 +45,15 @@ class MidiPortMenu;
|
||||
class MidiPort : public Model, public SerializingObject
|
||||
{
|
||||
Q_OBJECT
|
||||
mapPropertyFromModel(int,inputChannel,setInputChannel,
|
||||
m_inputChannelModel);
|
||||
mapPropertyFromModel(int,outputChannel,setOutputChannel,
|
||||
m_outputChannelModel);
|
||||
mapPropertyFromModel(int,inputController,setInputController,
|
||||
m_inputControllerModel);
|
||||
mapPropertyFromModel(int,outputController,setOutputController,
|
||||
m_outputControllerModel);
|
||||
mapPropertyFromModel(int,fixedInputVelocity,setFixedInputVelocity,
|
||||
m_fixedInputVelocityModel);
|
||||
mapPropertyFromModel(int,fixedOutputVelocity,setFixedOutputVelocity,
|
||||
m_fixedOutputVelocityModel);
|
||||
mapPropertyFromModel(int,fixedOutputNote,setFixedOutputNote,
|
||||
m_fixedOutputNoteModel);
|
||||
mapPropertyFromModel(int,outputProgram,setOutputProgram,
|
||||
m_outputProgramModel);
|
||||
mapPropertyFromModel(int,inputChannel,setInputChannel,m_inputChannelModel);
|
||||
mapPropertyFromModel(int,outputChannel,setOutputChannel,m_outputChannelModel);
|
||||
mapPropertyFromModel(int,inputController,setInputController,m_inputControllerModel);
|
||||
mapPropertyFromModel(int,outputController,setOutputController,m_outputControllerModel);
|
||||
mapPropertyFromModel(int,fixedInputVelocity,setFixedInputVelocity,m_fixedInputVelocityModel);
|
||||
mapPropertyFromModel(int,fixedOutputVelocity,setFixedOutputVelocity,m_fixedOutputVelocityModel);
|
||||
mapPropertyFromModel(int,fixedOutputNote,setFixedOutputNote,m_fixedOutputNoteModel);
|
||||
mapPropertyFromModel(int,outputProgram,setOutputProgram,m_outputProgramModel);
|
||||
mapPropertyFromModel(int,baseVelocity,setBaseVelocity,m_baseVelocityModel);
|
||||
mapPropertyFromModel(bool,isReadable,setReadable,m_readableModel);
|
||||
mapPropertyFromModel(bool,isWritable,setWritable,m_writableModel);
|
||||
public:
|
||||
@@ -159,6 +152,7 @@ private:
|
||||
IntModel m_fixedOutputVelocityModel;
|
||||
IntModel m_fixedOutputNoteModel;
|
||||
IntModel m_outputProgramModel;
|
||||
IntModel m_baseVelocityModel;
|
||||
BoolModel m_readableModel;
|
||||
BoolModel m_writableModel;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Model.h - declaration of Model base class
|
||||
*
|
||||
* Copyright (c) 2007-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2007-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -22,8 +22,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _MODEL_H
|
||||
#define _MODEL_H
|
||||
#ifndef MODEL_H
|
||||
#define MODEL_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QPointer>
|
||||
@@ -47,12 +47,12 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
inline bool defaultConstructed()
|
||||
bool isDefaultConstructed()
|
||||
{
|
||||
return m_defaultConstructed;
|
||||
}
|
||||
|
||||
inline Model * parentModel() const
|
||||
Model* parentModel() const
|
||||
{
|
||||
return static_cast<Model *>( parent() );
|
||||
}
|
||||
@@ -62,9 +62,9 @@ public:
|
||||
return m_displayName;
|
||||
}
|
||||
|
||||
virtual void setDisplayName( const QString & _display_name )
|
||||
virtual void setDisplayName( const QString& displayName )
|
||||
{
|
||||
m_displayName = _display_name;
|
||||
m_displayName = displayName;
|
||||
}
|
||||
|
||||
virtual QString fullDisplayName() const;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ModelView.h - declaration of ModelView base class
|
||||
*
|
||||
* Copyright (c) 2007-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2007-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -22,8 +22,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _MODEL_VIEW_H
|
||||
#define _MODEL_VIEW_H
|
||||
#ifndef MODEL_VIEW_H
|
||||
#define MODEL_VIEW_H
|
||||
|
||||
#include "Model.h"
|
||||
|
||||
@@ -31,31 +31,31 @@
|
||||
class EXPORT ModelView
|
||||
{
|
||||
public:
|
||||
ModelView( Model * _model, QWidget * _this );
|
||||
ModelView( Model* model, QWidget* widget );
|
||||
virtual ~ModelView();
|
||||
|
||||
virtual void setModel( Model * _model, bool _old_model_valid = true );
|
||||
virtual void setModel( Model* model, bool isOldModelValid = true );
|
||||
|
||||
inline Model * model()
|
||||
Model* model()
|
||||
{
|
||||
return m_model;
|
||||
}
|
||||
|
||||
inline const Model * model() const
|
||||
const Model* model() const
|
||||
{
|
||||
return m_model;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
T * castModel()
|
||||
T* castModel()
|
||||
{
|
||||
return dynamic_cast<T *>( model() );
|
||||
return dynamic_cast<T*>( model() );
|
||||
}
|
||||
|
||||
template<class T>
|
||||
const T * castModel() const
|
||||
const T* castModel() const
|
||||
{
|
||||
return dynamic_cast<const T *>( model() );
|
||||
return dynamic_cast<const T*>( model() );
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ protected:
|
||||
{
|
||||
}
|
||||
|
||||
QWidget * widget()
|
||||
QWidget* widget()
|
||||
{
|
||||
return m_widget;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ protected:
|
||||
|
||||
|
||||
private:
|
||||
QWidget * m_widget;
|
||||
QWidget* m_widget;
|
||||
QPointer<Model> m_model;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _PIANO_H
|
||||
#define _PIANO_H
|
||||
#ifndef PIANO_H
|
||||
#define PIANO_H
|
||||
|
||||
#include "note.h"
|
||||
#include "Model.h"
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
return m_pressedKeys[key];
|
||||
}
|
||||
|
||||
void handleKeyPress( int key, int midiVelocity = MidiDefaultVelocity );
|
||||
void handleKeyPress( int key, int midiVelocity = -1 );
|
||||
void handleKeyRelease( int key );
|
||||
|
||||
InstrumentTrack* instrumentTrack() const
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _PIANO_ROLL_H
|
||||
#define _PIANO_ROLL_H
|
||||
#ifndef PIANO_ROLL_H
|
||||
#define PIANO_ROLL_H
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
@@ -147,6 +147,7 @@ protected slots:
|
||||
|
||||
|
||||
signals:
|
||||
void currentPatternChanged();
|
||||
void semiToneMarkerMenuScaleSetEnabled(bool);
|
||||
void semiToneMarkerMenuChordSetEnabled(bool);
|
||||
|
||||
@@ -169,7 +170,7 @@ private:
|
||||
ActionChangeNoteProperty,
|
||||
ActionResizeNoteEditArea
|
||||
};
|
||||
|
||||
|
||||
enum noteEditMode
|
||||
{
|
||||
NoteEditVolume,
|
||||
@@ -205,7 +206,7 @@ private:
|
||||
void autoScroll( const MidiTime & _t );
|
||||
|
||||
MidiTime newNoteLen() const;
|
||||
|
||||
|
||||
void shiftPos(int amount);
|
||||
void shiftSemiTone(int amount);
|
||||
bool isSelection() const;
|
||||
@@ -213,19 +214,19 @@ private:
|
||||
void testPlayNote( note * n );
|
||||
void testPlayKey( int _key, int _vol, int _pan );
|
||||
void pauseTestNotes( bool _pause = true );
|
||||
|
||||
|
||||
inline int noteEditTop() const;
|
||||
inline int keyAreaBottom() const;
|
||||
inline int noteEditBottom() const;
|
||||
inline int keyAreaTop() const;
|
||||
inline int noteEditRight() const;
|
||||
inline int noteEditLeft() const;
|
||||
|
||||
|
||||
void dragNotes( int x, int y, bool alt, bool shift );
|
||||
|
||||
|
||||
static const int cm_scrollAmtHoriz = 10;
|
||||
static const int cm_scrollAmtVert = 1;
|
||||
|
||||
|
||||
static QPixmap * s_whiteKeyBigPm;
|
||||
static QPixmap * s_whiteKeyBigPressedPm;
|
||||
static QPixmap * s_whiteKeySmallPm;
|
||||
@@ -252,7 +253,7 @@ private:
|
||||
toolButton * m_eraseButton;
|
||||
toolButton * m_selectButton;
|
||||
toolButton * m_detuneButton;
|
||||
|
||||
|
||||
toolButton * m_cutButton;
|
||||
toolButton * m_copyButton;
|
||||
toolButton * m_pasteButton;
|
||||
@@ -287,22 +288,22 @@ private:
|
||||
int m_selectedTick;
|
||||
int m_selectStartKey;
|
||||
int m_selectedKeys;
|
||||
|
||||
|
||||
// boundary box around all selected notes when dragging
|
||||
int m_moveBoundaryLeft;
|
||||
int m_moveBoundaryTop;
|
||||
int m_moveBoundaryRight;
|
||||
int m_moveBoundaryBottom;
|
||||
|
||||
|
||||
// remember where the scrolling started when dragging so that
|
||||
// we can handle dragging while scrolling with arrow keys
|
||||
int m_mouseDownKey;
|
||||
int m_mouseDownTick;
|
||||
|
||||
|
||||
// remember the last x and y of a mouse movement
|
||||
int m_lastMouseX;
|
||||
int m_lastMouseY;
|
||||
|
||||
|
||||
// x,y of when the user starts a drag
|
||||
int m_moveStartX;
|
||||
int m_moveStartY;
|
||||
@@ -312,7 +313,7 @@ private:
|
||||
int m_ppt;
|
||||
int m_totalKeysToScroll;
|
||||
|
||||
// remember these values to use them
|
||||
// remember these values to use them
|
||||
// for the next note that is set
|
||||
MidiTime m_lenOfNewNotes;
|
||||
volume_t m_lastNoteVolume;
|
||||
@@ -323,7 +324,7 @@ private:
|
||||
|
||||
editModes m_editMode;
|
||||
editModes m_ctrlMode; // mode they were in before they hit ctrl
|
||||
|
||||
|
||||
bool m_mouseDownLeft; //true if left click is being held down
|
||||
bool m_mouseDownRight; //true if right click is being held down
|
||||
|
||||
@@ -337,7 +338,7 @@ private:
|
||||
note * noteUnderMouse();
|
||||
|
||||
// turn a selection rectangle into selected notes
|
||||
void computeSelectedNotes( bool shift );
|
||||
void computeSelectedNotes( bool shift );
|
||||
void clearSelectedNotes();
|
||||
|
||||
friend class engine;
|
||||
|
||||
@@ -474,7 +474,6 @@ private:
|
||||
#else
|
||||
int m_shmID;
|
||||
#endif
|
||||
size_t m_shmSize;
|
||||
shmData * m_data;
|
||||
#ifdef USE_QT_SEMAPHORES
|
||||
QSystemSemaphore m_dataSem;
|
||||
@@ -780,7 +779,6 @@ private:
|
||||
void resizeSharedProcessingMemory();
|
||||
|
||||
|
||||
bool m_initialized;
|
||||
bool m_failed;
|
||||
|
||||
QProcess m_process;
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
|
||||
void setHook( SerializingObjectHook * _hook );
|
||||
|
||||
SerializingObjectHook * getHook()
|
||||
SerializingObjectHook* hook()
|
||||
{
|
||||
return m_hook;
|
||||
}
|
||||
@@ -60,8 +60,8 @@ public:
|
||||
|
||||
protected:
|
||||
// to be implemented by sub-objects
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _this );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
virtual void saveSettings( QDomDocument& doc, QDomElement& element ) = 0;
|
||||
virtual void loadSettings( const QDomElement& element ) = 0;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -53,11 +53,8 @@ public:
|
||||
const QString & _display_name = QString() );
|
||||
virtual ~TempoSyncKnobModel();
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this,
|
||||
const QString & _name );
|
||||
virtual void loadSettings( const QDomElement & _this,
|
||||
const QString & _name );
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _this, const QString& name );
|
||||
void loadSettings( const QDomElement & _this, const QString& name );
|
||||
|
||||
TempoSyncMode syncMode() const
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
|
||||
static inline float minFreq()
|
||||
{
|
||||
return( 0.01f );
|
||||
return( 3.0f );
|
||||
}
|
||||
|
||||
static inline float minQ()
|
||||
@@ -488,8 +488,9 @@ public:
|
||||
/*, const bool _q_is_bandwidth = false*/ )
|
||||
{
|
||||
// temp coef vars
|
||||
_freq = qMax( _freq, minFreq() );// limit freq and q for not getting
|
||||
// bad noise out of the filter...
|
||||
_freq = qBound(minFreq(), _freq, 20000.0f); // limit freq and q for not getting
|
||||
// bad noise out of the filter...
|
||||
|
||||
_q = qMax( _q, minQ() );
|
||||
|
||||
if( m_type == Lowpass_RC12 ||
|
||||
|
||||
@@ -147,8 +147,6 @@ public:
|
||||
return s_controllerRackView;
|
||||
}
|
||||
|
||||
static void updatePlayPauseIcons();
|
||||
|
||||
static float framesPerTick()
|
||||
{
|
||||
return s_framesPerTick;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (c) 2006-2007 Andreas Brandmaier <andy/at/brandmaier/dot/de>
|
||||
* 2008 Paul Giblock <drfaygo/at/gmail/dot/com>
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -24,8 +24,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _GRAPH_H
|
||||
#define _GRAPH_H
|
||||
#ifndef GRAPH_H
|
||||
#define GRAPH_H
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtGui/QPixmap>
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
{
|
||||
return m_graphStyle;
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline void setGraphStyle( graphStyle _s )
|
||||
{
|
||||
@@ -101,10 +101,9 @@ private:
|
||||
|
||||
QPixmap m_foreground;
|
||||
QColor m_graphColor;
|
||||
|
||||
graphModel * m_graphModel;
|
||||
|
||||
graphStyle m_graphStyle;
|
||||
|
||||
|
||||
bool m_mouseDown;
|
||||
int m_lastCursorX;
|
||||
|
||||
@@ -125,7 +124,7 @@ public:
|
||||
virtual ~graphModel();
|
||||
|
||||
// TODO: saveSettings, loadSettings?
|
||||
|
||||
|
||||
inline float minValue() const
|
||||
{
|
||||
return( m_minValue );
|
||||
@@ -140,7 +139,7 @@ public:
|
||||
{
|
||||
return( m_samples.count() );
|
||||
}
|
||||
|
||||
|
||||
inline const float * samples() const
|
||||
{
|
||||
return( m_samples.data() );
|
||||
@@ -160,10 +159,12 @@ public slots:
|
||||
void setWaveToSquare();
|
||||
void setWaveToNoise();
|
||||
QString setWaveToUser( );
|
||||
|
||||
|
||||
void smooth();
|
||||
void smoothNonCyclic();
|
||||
void normalize();
|
||||
void invert();
|
||||
void shiftPhase( int _deg );
|
||||
|
||||
signals:
|
||||
void lengthChanged();
|
||||
|
||||
@@ -58,6 +58,8 @@ class EXPORT knob : public QWidget, public FloatModelView
|
||||
// correctly so we need to do this:
|
||||
Q_PROPERTY(QColor outerColor READ outerColor WRITE setOuterColor)
|
||||
mapPropertyFromModel(bool,isVolumeKnob,setVolumeKnob,m_volumeKnob);
|
||||
mapPropertyFromModel(float,volumeRatio,setVolumeRatio,m_volumeRatio);
|
||||
|
||||
public:
|
||||
knob( int _knob_num, QWidget * _parent = NULL, const QString & _name = QString() );
|
||||
virtual ~knob();
|
||||
@@ -149,6 +151,7 @@ private:
|
||||
|
||||
QPixmap * m_knobPixmap;
|
||||
BoolModel m_volumeKnob;
|
||||
FloatModel m_volumeRatio;
|
||||
|
||||
QPoint m_mouseOffset;
|
||||
QPoint m_origMousePos;
|
||||
|
||||
@@ -176,9 +176,9 @@ public:
|
||||
return m_volume;
|
||||
}
|
||||
|
||||
int midiVelocity() const
|
||||
int midiVelocity( int midiBaseVelocity ) const
|
||||
{
|
||||
return qMin( MidiMaxVelocity, getVolume() * MidiMaxVelocity / MaxVolume );
|
||||
return qMin( MidiMaxVelocity, getVolume() * midiBaseVelocity / DefaultVolume );
|
||||
}
|
||||
|
||||
inline panning_t getPanning() const
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* shared_object.h - class sharedObject for use among other objects
|
||||
*
|
||||
* Copyright (c) 2006-2007 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2008-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
|
||||
@@ -23,10 +23,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SHARED_OBJECT_H
|
||||
#define _SHARED_OBJECT_H
|
||||
|
||||
#ifndef SHARED_OBJECT_H
|
||||
#define SHARED_OBJECT_H
|
||||
|
||||
#include <QtCore/QMutex>
|
||||
|
||||
@@ -45,27 +43,33 @@ public:
|
||||
}
|
||||
|
||||
template<class T>
|
||||
static T * ref( T * _object )
|
||||
static T* ref( T* object )
|
||||
{
|
||||
_object->m_lock.lock();
|
||||
object->m_lock.lock();
|
||||
// TODO: Use QShared
|
||||
++_object->m_referenceCount;
|
||||
_object->m_lock.unlock();
|
||||
return( _object );
|
||||
++object->m_referenceCount;
|
||||
object->m_lock.unlock();
|
||||
return object;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
static void unref( T * _object )
|
||||
static void unref( T* object )
|
||||
{
|
||||
_object->m_lock.lock();
|
||||
bool delete_object = --_object->m_referenceCount <= 0;
|
||||
_object->m_lock.unlock();
|
||||
if ( delete_object )
|
||||
object->m_lock.lock();
|
||||
bool deleteObject = --object->m_referenceCount <= 0;
|
||||
object->m_lock.unlock();
|
||||
|
||||
if ( deleteObject )
|
||||
{
|
||||
delete _object;
|
||||
delete object;
|
||||
}
|
||||
}
|
||||
|
||||
// keep clang happy which complaines about unused member variable
|
||||
void dummy()
|
||||
{
|
||||
m_referenceCount = 0;
|
||||
}
|
||||
|
||||
private:
|
||||
int m_referenceCount;
|
||||
|
||||
@@ -170,12 +170,12 @@ public:
|
||||
if ( m_exportLoop )
|
||||
{
|
||||
return m_exporting == true &&
|
||||
m_playPos[Mode_PlaySong].getTact() >= length();
|
||||
m_playPos[Mode_PlaySong].getTicks() >= length() * ticksPerTact();
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_exporting == true &&
|
||||
m_playPos[Mode_PlaySong].getTact() >= length() + 1;
|
||||
m_playPos[Mode_PlaySong].getTicks() >= ( length() + 1 ) * ticksPerTact();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -360,6 +360,7 @@ private:
|
||||
|
||||
signals:
|
||||
void projectLoaded();
|
||||
void playbackStateChanged();
|
||||
void lengthChanged( int _tacts );
|
||||
void tempoChanged( bpm_t _new_bpm );
|
||||
void timeSignatureChanged( int _old_ticks_per_tact,
|
||||
|
||||
@@ -277,6 +277,17 @@ protected:
|
||||
return "trackcontentwidget";
|
||||
}
|
||||
|
||||
virtual void saveSettings( QDomDocument& doc, QDomElement& element )
|
||||
{
|
||||
Q_UNUSED(doc)
|
||||
Q_UNUSED(element)
|
||||
}
|
||||
|
||||
virtual void loadSettings( const QDomElement& element )
|
||||
{
|
||||
Q_UNUSED(element)
|
||||
}
|
||||
|
||||
virtual void undoStep( JournalEntry & _je );
|
||||
virtual void redoStep( JournalEntry & _je );
|
||||
|
||||
@@ -296,8 +307,6 @@ private:
|
||||
typedef QVector<trackContentObjectView *> tcoViewVector;
|
||||
tcoViewVector m_tcoViews;
|
||||
|
||||
int m_pixelsPerTact;
|
||||
|
||||
QPixmap m_background;
|
||||
|
||||
} ;
|
||||
@@ -544,6 +553,17 @@ protected:
|
||||
virtual void undoStep( JournalEntry & _je );
|
||||
virtual void redoStep( JournalEntry & _je );
|
||||
|
||||
virtual void saveSettings( QDomDocument& doc, QDomElement& element )
|
||||
{
|
||||
Q_UNUSED(doc)
|
||||
Q_UNUSED(element)
|
||||
}
|
||||
|
||||
virtual void loadSettings( const QDomElement& element )
|
||||
{
|
||||
Q_UNUSED(element)
|
||||
}
|
||||
|
||||
virtual QString nodeName() const
|
||||
{
|
||||
return "trackview";
|
||||
|
||||
@@ -2,7 +2,7 @@ lmmsicon ICON data/lmms.ico
|
||||
#include <windows.h>
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,9,92,0
|
||||
FILEVERSION 1,0,0,0
|
||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||
FILEOS VOS_NT_WINDOWS32
|
||||
FILETYPE VFT_APP
|
||||
|
||||
125
plugins/Amplifier/Amplifier.cpp
Normal file
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* Amplifier.cpp - A native amplifier effect plugin with sample-exact amplification
|
||||
*
|
||||
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
|
||||
* Copyright (c) 2006-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
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "Amplifier.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
Plugin::Descriptor PLUGIN_EXPORT amplifier_plugin_descriptor =
|
||||
{
|
||||
STRINGIFY( PLUGIN_NAME ),
|
||||
"Amplifier",
|
||||
QT_TRANSLATE_NOOP( "pluginBrowser", "A native amplifier plugin" ),
|
||||
"Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
NULL,
|
||||
NULL
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
AmplifierEffect::AmplifierEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key ) :
|
||||
Effect( &lifier_plugin_descriptor, parent, key ),
|
||||
m_ampControls( this )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
AmplifierEffect::~AmplifierEffect()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool AmplifierEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames )
|
||||
{
|
||||
if( !isEnabled() || !isRunning () )
|
||||
{
|
||||
return( false );
|
||||
}
|
||||
|
||||
double outSum = 0.0;
|
||||
const float d = dryLevel();
|
||||
const float w = wetLevel();
|
||||
for( fpp_t f = 0; f < frames; ++f )
|
||||
{
|
||||
// qDebug( "offset %d, value %f", f, m_ampControls.m_volumeModel.value( f ) );
|
||||
|
||||
sample_t s[2] = { buf[f][0], buf[f][1] };
|
||||
|
||||
// convert vol/pan values to left/right values
|
||||
const float left1 = m_ampControls.m_volumeModel.value( f ) *
|
||||
( m_ampControls.m_panModel.value( f ) <= 0
|
||||
? 1.0
|
||||
: 1.0 - m_ampControls.m_panModel.value( f ) / 100.0 );
|
||||
const float right1 = m_ampControls.m_volumeModel.value( f ) *
|
||||
( m_ampControls.m_panModel.value( f ) >= 0
|
||||
? 1.0
|
||||
: 1.0 + m_ampControls.m_panModel.value( f ) / 100.0 );
|
||||
|
||||
// first stage amplification
|
||||
s[0] *= ( left1 / 100.0 );
|
||||
s[1] *= ( right1 / 100.0 );
|
||||
|
||||
// second stage amplification
|
||||
s[0] *= ( m_ampControls.m_leftModel.value( f ) / 100.0 );
|
||||
s[1] *= ( m_ampControls.m_rightModel.value( f ) / 100.0 );
|
||||
|
||||
buf[f][0] = d * buf[f][0] + w * s[0];
|
||||
buf[f][1] = d * buf[f][1] + w * s[1];
|
||||
outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1];
|
||||
}
|
||||
|
||||
checkGate( outSum / frames );
|
||||
|
||||
return isRunning();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
// necessary for getting instance out of shared lib
|
||||
Plugin * PLUGIN_EXPORT lmms_plugin_main( Model* parent, void* data )
|
||||
{
|
||||
return new AmplifierEffect( parent, static_cast<const Plugin::Descriptor::SubPluginFeatures::Key *>( data ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
54
plugins/Amplifier/Amplifier.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Amplifier.h - amplifier-effect-plugin
|
||||
*
|
||||
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
|
||||
* Copyright (c) 2006-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
|
||||
* 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 AMPLIFIER_H
|
||||
#define AMPLIFIER_H
|
||||
|
||||
#include "Effect.h"
|
||||
#include "AmplifierControls.h"
|
||||
|
||||
|
||||
class AmplifierEffect : public Effect
|
||||
{
|
||||
public:
|
||||
AmplifierEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key );
|
||||
virtual ~AmplifierEffect();
|
||||
virtual bool processAudioBuffer( sampleFrame* buf, const fpp_t frames );
|
||||
|
||||
virtual EffectControls* controls()
|
||||
{
|
||||
return &m_ampControls;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
AmplifierControls m_ampControls;
|
||||
|
||||
friend class AmplifierControls;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
69
plugins/Amplifier/AmplifierControlDialog.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* AmplifierControlDialog.cpp - control dialog for amplifier effect
|
||||
*
|
||||
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
|
||||
* Copyright (c) 2006-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
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <QtGui/QLayout>
|
||||
|
||||
#include "AmplifierControlDialog.h"
|
||||
#include "AmplifierControls.h"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
|
||||
AmplifierControlDialog::AmplifierControlDialog( AmplifierControls* controls ) :
|
||||
EffectControlDialog( controls )
|
||||
{
|
||||
setAutoFillBackground( true );
|
||||
QPalette pal;
|
||||
pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) );
|
||||
setPalette( pal );
|
||||
setFixedSize( 100, 125 );
|
||||
|
||||
knob * volumeKnob = new knob( knobBright_26, this);
|
||||
volumeKnob -> move( 20, 30 );
|
||||
volumeKnob -> setVolumeKnob( true );
|
||||
volumeKnob->setModel( &controls->m_volumeModel );
|
||||
volumeKnob->setLabel( tr( "VOL" ) );
|
||||
volumeKnob->setHintText( tr( "Volume:" ) + " ", "%" );
|
||||
|
||||
knob * panKnob = new knob( knobBright_26, this);
|
||||
panKnob -> move( 60, 30 );
|
||||
panKnob->setModel( &controls->m_panModel );
|
||||
panKnob->setLabel( tr( "PAN" ) );
|
||||
panKnob->setHintText( tr( "Panning:" ) + " ", "" );
|
||||
|
||||
knob * leftKnob = new knob( knobBright_26, this);
|
||||
leftKnob -> move( 20, 80 );
|
||||
leftKnob -> setVolumeKnob( true );
|
||||
leftKnob->setModel( &controls->m_leftModel );
|
||||
leftKnob->setLabel( tr( "LEFT" ) );
|
||||
leftKnob->setHintText( tr( "Left gain:" ) + " ", "%" );
|
||||
|
||||
knob * rightKnob = new knob( knobBright_26, this);
|
||||
rightKnob -> move( 60, 80 );
|
||||
rightKnob -> setVolumeKnob( true );
|
||||
rightKnob->setModel( &controls->m_rightModel );
|
||||
rightKnob->setLabel( tr( "RIGHT" ) );
|
||||
rightKnob->setHintText( tr( "Right gain:" ) + " ", "%" );
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* pch.h - file which is used for precompiled headers
|
||||
* AmplifierControlDialog.h - control dialog for amplifier effect
|
||||
*
|
||||
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
|
||||
* Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2008 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
|
||||
@@ -22,15 +23,23 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _PCH_H
|
||||
#define _PCH_H
|
||||
#ifndef AMPLIFIER_CONTROL_DIALOG_H
|
||||
#define AMPLIFIER_CONTROL_DIALOG_H
|
||||
|
||||
#include <Qt/QtCore>
|
||||
#include <Qt/QtGui>
|
||||
#include <Qt/QtXml>
|
||||
#include "EffectControlDialog.h"
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include "Mixer.h"
|
||||
class AmplifierControls;
|
||||
|
||||
|
||||
class AmplifierControlDialog : public EffectControlDialog
|
||||
{
|
||||
public:
|
||||
AmplifierControlDialog( AmplifierControls* controls );
|
||||
virtual ~AmplifierControlDialog()
|
||||
{
|
||||
}
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
82
plugins/Amplifier/AmplifierControls.cpp
Normal file
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* AmplifierControls.cpp - controls for amplifier effect
|
||||
*
|
||||
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
|
||||
* Copyright (c) 2008-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
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtXml/QDomElement>
|
||||
|
||||
#include "AmplifierControls.h"
|
||||
#include "Amplifier.h"
|
||||
#include "engine.h"
|
||||
#include "song.h"
|
||||
|
||||
|
||||
AmplifierControls::AmplifierControls( AmplifierEffect* effect ) :
|
||||
EffectControls( effect ),
|
||||
m_effect( effect ),
|
||||
m_volumeModel( 100.0f, 0.0f, 200.0f, 0.1f, this, tr( "Volume" ) ),
|
||||
m_panModel( 0.0f, -100.0f, 100.0f, 0.1f, this, tr( "Panning" ) ),
|
||||
m_leftModel( 100.0f, 0.0f, 200.0f, 0.1f, this, tr( "Left gain" ) ),
|
||||
m_rightModel( 100.0f, 0.0f, 200.0f, 0.1f, this, tr( "Right gain" ) )
|
||||
{
|
||||
connect( &m_volumeModel, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
|
||||
connect( &m_panModel, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
|
||||
connect( &m_leftModel, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
|
||||
connect( &m_rightModel, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void AmplifierControls::changeControl()
|
||||
{
|
||||
engine::getSong()->setModified();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void AmplifierControls::loadSettings( const QDomElement& _this )
|
||||
{
|
||||
m_volumeModel.loadSettings( _this, "volume" );
|
||||
m_panModel.loadSettings( _this, "pan" );
|
||||
m_leftModel.loadSettings( _this, "left" );
|
||||
m_rightModel.loadSettings( _this, "right" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void AmplifierControls::saveSettings( QDomDocument& doc, QDomElement& _this )
|
||||
{
|
||||
m_volumeModel.saveSettings( doc, _this, "volume" );
|
||||
m_panModel.saveSettings( doc, _this, "pan" );
|
||||
m_leftModel.saveSettings( doc, _this, "left" );
|
||||
m_rightModel.saveSettings( doc, _this, "right" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "moc_AmplifierControls.cxx"
|
||||
|
||||
79
plugins/Amplifier/AmplifierControls.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* AmplifierControls.h - controls for bassboosterx -effect
|
||||
*
|
||||
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
|
||||
* Copyright (c) 2008-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
|
||||
* 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 AMPLIFIER_CONTROLS_H
|
||||
#define AMPLIFIER_CONTROLS_H
|
||||
|
||||
#include "EffectControls.h"
|
||||
#include "AmplifierControlDialog.h"
|
||||
#include "knob.h"
|
||||
|
||||
|
||||
class AmplifierEffect;
|
||||
|
||||
|
||||
class AmplifierControls : public EffectControls
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AmplifierControls( AmplifierEffect* effect );
|
||||
virtual ~AmplifierControls()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName() const
|
||||
{
|
||||
return "AmplifierControls";
|
||||
}
|
||||
|
||||
virtual int controlCount()
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
virtual EffectControlDialog* createView()
|
||||
{
|
||||
return new AmplifierControlDialog( this );
|
||||
}
|
||||
|
||||
|
||||
private slots:
|
||||
void changeControl();
|
||||
|
||||
private:
|
||||
AmplifierEffect* m_effect;
|
||||
FloatModel m_volumeModel;
|
||||
FloatModel m_panModel;
|
||||
FloatModel m_leftModel;
|
||||
FloatModel m_rightModel;
|
||||
|
||||
friend class AmplifierControlDialog;
|
||||
friend class AmplifierEffect;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
3
plugins/Amplifier/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(amplifier Amplifier.cpp AmplifierControls.cpp AmplifierControlDialog.cpp MOCFILES AmplifierControls.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
BIN
plugins/Amplifier/artwork.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
plugins/Amplifier/logo.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
@@ -81,9 +81,9 @@ void BassBoosterControls::changeRatio()
|
||||
|
||||
void BassBoosterControls::loadSettings( const QDomElement& _this )
|
||||
{
|
||||
m_freqModel.setValue( _this.attribute( "freq" ).toFloat() );
|
||||
m_gainModel.setValue( _this.attribute( "gain" ).toFloat() );
|
||||
m_ratioModel.setValue( _this.attribute( "ratio" ).toFloat() );
|
||||
m_freqModel.loadSettings( _this, "freq" );
|
||||
m_gainModel.loadSettings( _this, "gain" );
|
||||
m_ratioModel.loadSettings( _this, "ratio");
|
||||
}
|
||||
|
||||
|
||||
@@ -91,9 +91,9 @@ void BassBoosterControls::loadSettings( const QDomElement& _this )
|
||||
|
||||
void BassBoosterControls::saveSettings( QDomDocument& doc, QDomElement& _this )
|
||||
{
|
||||
_this.setAttribute( "freq", m_freqModel.value() );
|
||||
_this.setAttribute( "gain", m_gainModel.value() );
|
||||
_this.setAttribute( "ratio", m_ratioModel.value() );
|
||||
m_freqModel.saveSettings( doc, _this, "freq" );
|
||||
m_gainModel.saveSettings( doc, _this, "gain" );
|
||||
m_ratioModel.saveSettings( doc, _this, "ratio");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 15 KiB |
@@ -1,6 +1,8 @@
|
||||
ADD_SUBDIRECTORY(Amplifier)
|
||||
ADD_SUBDIRECTORY(audio_file_processor)
|
||||
ADD_SUBDIRECTORY(BassBooster)
|
||||
ADD_SUBDIRECTORY(bit_invader)
|
||||
ADD_SUBDIRECTORY(DualFilter)
|
||||
ADD_SUBDIRECTORY(dynamics_processor)
|
||||
ADD_SUBDIRECTORY(flp_import)
|
||||
ADD_SUBDIRECTORY(HydrogenImport)
|
||||
|
||||
3
plugins/DualFilter/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(dualfilter DualFilter.cpp DualFilterControls.cpp DualFilterControlDialog.cpp MOCFILES DualFilterControls.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
172
plugins/DualFilter/DualFilter.cpp
Normal file
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* DualFilter.cpp - A native dual filter effect plugin with two parallel filters
|
||||
*
|
||||
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
|
||||
* Copyright (c) 2006-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
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "DualFilter.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "basic_filters.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
Plugin::Descriptor PLUGIN_EXPORT dualfilter_plugin_descriptor =
|
||||
{
|
||||
STRINGIFY( PLUGIN_NAME ),
|
||||
"Dual Filter",
|
||||
QT_TRANSLATE_NOOP( "pluginBrowser", "A native amplifier plugin" ),
|
||||
"Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
NULL,
|
||||
NULL
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
DualFilterEffect::DualFilterEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key ) :
|
||||
Effect( &dualfilter_plugin_descriptor, parent, key ),
|
||||
m_dfControls( this )
|
||||
{
|
||||
m_filter1 = new basicFilters<2>( engine::mixer()->processingSampleRate() );
|
||||
m_filter2 = new basicFilters<2>( engine::mixer()->processingSampleRate() );
|
||||
|
||||
// ensure filters get updated
|
||||
m_filter1changed = true;
|
||||
m_filter2changed = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
DualFilterEffect::~DualFilterEffect()
|
||||
{
|
||||
delete m_filter1;
|
||||
delete m_filter2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool DualFilterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames )
|
||||
{
|
||||
if( !isEnabled() || !isRunning () )
|
||||
{
|
||||
return( false );
|
||||
}
|
||||
|
||||
double outSum = 0.0;
|
||||
const float d = dryLevel();
|
||||
const float w = wetLevel();
|
||||
|
||||
m_filter1->setFilterType( m_dfControls.m_filter1Model.value() );
|
||||
m_filter2->setFilterType( m_dfControls.m_filter2Model.value() );
|
||||
|
||||
const bool enabled1 = m_dfControls.m_enabled1Model.value();
|
||||
const bool enabled2 = m_dfControls.m_enabled2Model.value();
|
||||
|
||||
// recalculate only when necessary
|
||||
if( enabled1 && m_filter1changed )
|
||||
{
|
||||
m_filter1->calcFilterCoeffs( m_dfControls.m_cut1Model.value(), m_dfControls.m_res1Model.value() );
|
||||
m_filter1changed = false;
|
||||
}
|
||||
if( enabled2 && m_filter2changed )
|
||||
{
|
||||
m_filter2->calcFilterCoeffs( m_dfControls.m_cut2Model.value(), m_dfControls.m_res2Model.value() );
|
||||
m_filter2changed = false;
|
||||
}
|
||||
|
||||
|
||||
// buffer processing loop
|
||||
for( fpp_t f = 0; f < frames; ++f )
|
||||
{
|
||||
sample_t s[2] = { 0.0f, 0.0f }; // mix
|
||||
sample_t s1[2] = { buf[f][0], buf[f][1] }; // filter 1
|
||||
sample_t s2[2] = { buf[f][0], buf[f][1] }; // filter 2
|
||||
|
||||
// get mix amounts for wet signals of both filters
|
||||
const float mix1 = 1.0f - ( ( m_dfControls.m_mixModel.value( f ) + 1.0f ) / 2.0f );
|
||||
const float mix2 = ( ( m_dfControls.m_mixModel.value( f ) + 1.0f ) / 2.0f );
|
||||
|
||||
// update filter 1
|
||||
if( enabled1 )
|
||||
{
|
||||
s1[0] = m_filter1->update( s1[0], 0 );
|
||||
s1[1] = m_filter1->update( s1[1], 1 );
|
||||
|
||||
// apply gain
|
||||
s1[0] *= ( m_dfControls.m_gain1Model.value( f ) / 100.0f );
|
||||
s1[1] *= ( m_dfControls.m_gain1Model.value( f ) / 100.0f );
|
||||
|
||||
// apply mix
|
||||
s[0] += ( s1[0] * mix1 );
|
||||
s[1] += ( s1[1] * mix1 );
|
||||
}
|
||||
|
||||
// update filter 2
|
||||
if( enabled2 )
|
||||
{
|
||||
s2[0] = m_filter2->update( s2[0], 0 );
|
||||
s2[1] = m_filter2->update( s2[1], 1 );
|
||||
|
||||
//apply gain
|
||||
s2[0] *= ( m_dfControls.m_gain2Model.value( f ) / 100.0f );
|
||||
s2[1] *= ( m_dfControls.m_gain2Model.value( f ) / 100.0f );
|
||||
|
||||
// apply mix
|
||||
s[0] += ( s2[0] * mix2 );
|
||||
s[1] += ( s2[1] * mix2 );
|
||||
}
|
||||
|
||||
// do another mix with dry signal
|
||||
buf[f][0] = d * buf[f][0] + w * s[0];
|
||||
buf[f][1] = d * buf[f][1] + w * s[1];
|
||||
outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1];
|
||||
}
|
||||
|
||||
checkGate( outSum / frames );
|
||||
|
||||
return isRunning();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
// necessary for getting instance out of shared lib
|
||||
Plugin * PLUGIN_EXPORT lmms_plugin_main( Model* parent, void* data )
|
||||
{
|
||||
return new DualFilterEffect( parent, static_cast<const Plugin::Descriptor::SubPluginFeatures::Key *>( data ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
60
plugins/DualFilter/DualFilter.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* DualFilter.h - dual filter effect-plugin
|
||||
*
|
||||
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
|
||||
* Copyright (c) 2006-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
|
||||
* 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 DUALFILTER_H
|
||||
#define DUALFILTER_H
|
||||
|
||||
#include "Effect.h"
|
||||
#include "DualFilterControls.h"
|
||||
#include "basic_filters.h"
|
||||
|
||||
class DualFilterEffect : public Effect
|
||||
{
|
||||
public:
|
||||
DualFilterEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key );
|
||||
virtual ~DualFilterEffect();
|
||||
virtual bool processAudioBuffer( sampleFrame* buf, const fpp_t frames );
|
||||
|
||||
virtual EffectControls* controls()
|
||||
{
|
||||
return &m_dfControls;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
DualFilterControls m_dfControls;
|
||||
|
||||
basicFilters<2> * m_filter1;
|
||||
basicFilters<2> * m_filter2;
|
||||
|
||||
bool m_filter1changed;
|
||||
bool m_filter2changed;
|
||||
|
||||
friend class DualFilterControls;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
86
plugins/DualFilter/DualFilterControlDialog.cpp
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* DualFilterControlDialog.cpp - control dialog for dual filter effect
|
||||
*
|
||||
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
|
||||
* Copyright (c) 2006-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
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <QtGui/QLayout>
|
||||
|
||||
#include "DualFilterControlDialog.h"
|
||||
#include "DualFilterControls.h"
|
||||
#include "embed.h"
|
||||
#include "led_checkbox.h"
|
||||
#include "combobox.h"
|
||||
#include "tooltip.h"
|
||||
#include "gui_templates.h"
|
||||
|
||||
#define makeknob( name, x, y, model, label, hint, unit ) \
|
||||
knob * name = new knob( knobBright_26, this); \
|
||||
name -> move( x, y ); \
|
||||
name ->setModel( &controls-> model ); \
|
||||
name ->setLabel( tr( label ) ); \
|
||||
name ->setHintText( tr( hint ) + " ", unit );
|
||||
|
||||
|
||||
|
||||
DualFilterControlDialog::DualFilterControlDialog( DualFilterControls* controls ) :
|
||||
EffectControlDialog( controls )
|
||||
{
|
||||
setAutoFillBackground( true );
|
||||
QPalette pal;
|
||||
pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) );
|
||||
setPalette( pal );
|
||||
setFixedSize( 150, 220 );
|
||||
|
||||
makeknob( cut1Knob, 33, 30, m_cut1Model, "FREQ", "Cutoff frequency", "Hz" )
|
||||
makeknob( res1Knob, 75, 30, m_res1Model, "RESO", "Resonance", "" )
|
||||
makeknob( gain1Knob, 117, 30, m_gain1Model, "GAIN", "Gain", "%" )
|
||||
makeknob( mixKnob, 62, 100, m_mixModel, "MIX", "Mix", "" )
|
||||
makeknob( cut2Knob, 33, 145, m_cut2Model, "FREQ", "Cutoff frequency", "Hz" )
|
||||
makeknob( res2Knob, 75, 145, m_res2Model, "RESO", "Resonance", "" )
|
||||
makeknob( gain2Knob, 117, 145, m_gain2Model, "GAIN", "Gain", "%" )
|
||||
|
||||
gain1Knob-> setVolumeKnob( true );
|
||||
gain2Knob-> setVolumeKnob( true );
|
||||
|
||||
ledCheckBox * enabled1Toggle = new ledCheckBox( "", this,
|
||||
tr( "Filter 1 enabled" ), ledCheckBox::Green );
|
||||
ledCheckBox * enabled2Toggle = new ledCheckBox( "", this,
|
||||
tr( "Filter 2 enabled" ), ledCheckBox::Green );
|
||||
|
||||
enabled1Toggle -> move( 5, 30 );
|
||||
enabled1Toggle -> setModel( &controls -> m_enabled1Model );
|
||||
toolTip::add( enabled1Toggle, tr( "Click to enable/disable Filter 1" ) );
|
||||
enabled2Toggle -> move( 5, 145 );
|
||||
enabled2Toggle -> setModel( &controls -> m_enabled2Model );
|
||||
toolTip::add( enabled2Toggle, tr( "Click to enable/disable Filter 2" ) );
|
||||
|
||||
comboBox * m_filter1ComboBox = new comboBox( this );
|
||||
m_filter1ComboBox->setGeometry( 5, 70, 140, 22 );
|
||||
m_filter1ComboBox->setFont( pointSize<8>( m_filter1ComboBox->font() ) );
|
||||
m_filter1ComboBox->setModel( &controls->m_filter1Model );
|
||||
|
||||
comboBox * m_filter2ComboBox = new comboBox( this );
|
||||
m_filter2ComboBox->setGeometry( 5, 185, 140, 22 );
|
||||
m_filter2ComboBox->setFont( pointSize<8>( m_filter2ComboBox->font() ) );
|
||||
m_filter2ComboBox->setModel( &controls->m_filter2Model );
|
||||
}
|
||||
45
plugins/DualFilter/DualFilterControlDialog.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* DualFilterControlDialog.h - control dialog for dual filter effect
|
||||
*
|
||||
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
|
||||
* Copyright (c) 2006-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
|
||||
* 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 DUALFILTER_CONTROL_DIALOG_H
|
||||
#define DUALFILTER_CONTROL_DIALOG_H
|
||||
|
||||
#include "EffectControlDialog.h"
|
||||
|
||||
|
||||
class DualFilterControls;
|
||||
|
||||
|
||||
class DualFilterControlDialog : public EffectControlDialog
|
||||
{
|
||||
public:
|
||||
DualFilterControlDialog( DualFilterControls* controls );
|
||||
virtual ~DualFilterControlDialog()
|
||||
{
|
||||
}
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
167
plugins/DualFilter/DualFilterControls.cpp
Normal file
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
* DualFilterControls.cpp - controls for dual filter effect
|
||||
*
|
||||
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
|
||||
* Copyright (c) 2008-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
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtXml/QDomElement>
|
||||
|
||||
#include "DualFilterControls.h"
|
||||
#include "DualFilter.h"
|
||||
#include "engine.h"
|
||||
#include "song.h"
|
||||
#include "basic_filters.h"
|
||||
#include "embed.h"
|
||||
|
||||
DualFilterControls::DualFilterControls( DualFilterEffect* effect ) :
|
||||
EffectControls( effect ),
|
||||
m_effect( effect ),
|
||||
|
||||
m_enabled1Model( true, this, tr( "Filter 1 enabled" ) ),
|
||||
m_filter1Model( this, tr( "Filter 1 type" ) ),
|
||||
m_cut1Model( 7000.0f, 1.0f, 14000.0f, 1.0f, this, tr( "Cutoff 1 frequency" ) ),
|
||||
m_res1Model( 0.5, basicFilters<0>::minQ(), 10.0, 0.01, this, tr( "Q/Resonance 1" ) ),
|
||||
m_gain1Model( 100.0f, 0.0f, 200.0f, 0.1f, this, tr( "Gain 1" ) ),
|
||||
|
||||
m_mixModel( 0.0f, -1.0f, 1.0f, 0.01f, this, tr( "Mix" ) ),
|
||||
|
||||
m_enabled2Model( true, this, tr( "Filter 2 enabled" ) ),
|
||||
m_filter2Model( this, tr( "Filter 2 type" ) ),
|
||||
m_cut2Model( 7000.0f, 1.0f, 14000.0f, 1.0f, this, tr( "Cutoff 2 frequency" ) ),
|
||||
m_res2Model( 0.5, basicFilters<0>::minQ(), 10.0, 0.01, this, tr( "Q/Resonance 2" ) ),
|
||||
m_gain2Model( 100.0f, 0.0f, 200.0f, 0.1f, this, tr( "Gain 2" ) )
|
||||
{
|
||||
connect( &m_filter1Model, SIGNAL( dataChanged() ), this, SLOT( updateFilter1() ) );
|
||||
connect( &m_cut1Model, SIGNAL( dataChanged() ), this, SLOT( updateFilter1() ) );
|
||||
connect( &m_res1Model, SIGNAL( dataChanged() ), this, SLOT( updateFilter1() ) );
|
||||
|
||||
connect( &m_filter2Model, SIGNAL( dataChanged() ), this, SLOT( updateFilter2() ) );
|
||||
connect( &m_cut2Model, SIGNAL( dataChanged() ), this, SLOT( updateFilter2() ) );
|
||||
connect( &m_res2Model, SIGNAL( dataChanged() ), this, SLOT( updateFilter2() ) );
|
||||
|
||||
m_filter1Model.addItem( tr( "LowPass" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filter1Model.addItem( tr( "HiPass" ), new PixmapLoader( "filter_hp" ) );
|
||||
m_filter1Model.addItem( tr( "BandPass csg" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filter1Model.addItem( tr( "BandPass czpg" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filter1Model.addItem( tr( "Notch" ), new PixmapLoader( "filter_notch" ) );
|
||||
m_filter1Model.addItem( tr( "Allpass" ), new PixmapLoader( "filter_ap" ) );
|
||||
m_filter1Model.addItem( tr( "Moog" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filter1Model.addItem( tr( "2x LowPass" ), new PixmapLoader( "filter_2lp" ) );
|
||||
m_filter1Model.addItem( tr( "RC LowPass 12dB" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filter1Model.addItem( tr( "RC BandPass 12dB" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filter1Model.addItem( tr( "RC HighPass 12dB" ), new PixmapLoader( "filter_hp" ) );
|
||||
m_filter1Model.addItem( tr( "RC LowPass 24dB" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filter1Model.addItem( tr( "RC BandPass 24dB" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filter1Model.addItem( tr( "RC HighPass 24dB" ), new PixmapLoader( "filter_hp" ) );
|
||||
m_filter1Model.addItem( tr( "Vocal Formant Filter" ), new PixmapLoader( "filter_hp" ) );
|
||||
|
||||
m_filter2Model.addItem( tr( "LowPass" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filter2Model.addItem( tr( "HiPass" ), new PixmapLoader( "filter_hp" ) );
|
||||
m_filter2Model.addItem( tr( "BandPass csg" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filter2Model.addItem( tr( "BandPass czpg" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filter2Model.addItem( tr( "Notch" ), new PixmapLoader( "filter_notch" ) );
|
||||
m_filter2Model.addItem( tr( "Allpass" ), new PixmapLoader( "filter_ap" ) );
|
||||
m_filter2Model.addItem( tr( "Moog" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filter2Model.addItem( tr( "2x LowPass" ), new PixmapLoader( "filter_2lp" ) );
|
||||
m_filter2Model.addItem( tr( "RC LowPass 12dB" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filter2Model.addItem( tr( "RC BandPass 12dB" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filter2Model.addItem( tr( "RC HighPass 12dB" ), new PixmapLoader( "filter_hp" ) );
|
||||
m_filter2Model.addItem( tr( "RC LowPass 24dB" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filter2Model.addItem( tr( "RC BandPass 24dB" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filter2Model.addItem( tr( "RC HighPass 24dB" ), new PixmapLoader( "filter_hp" ) );
|
||||
m_filter2Model.addItem( tr( "Vocal Formant Filter" ), new PixmapLoader( "filter_hp" ) );
|
||||
|
||||
connect( engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateFilters() ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DualFilterControls::updateFilter1()
|
||||
{
|
||||
m_effect->m_filter1changed = true;
|
||||
}
|
||||
|
||||
void DualFilterControls::updateFilter2()
|
||||
{
|
||||
m_effect->m_filter2changed = true;
|
||||
}
|
||||
|
||||
|
||||
void DualFilterControls::updateFilters()
|
||||
{
|
||||
// swap filters to new ones
|
||||
|
||||
delete m_effect->m_filter1;
|
||||
delete m_effect->m_filter2;
|
||||
m_effect->m_filter1 = new basicFilters<2>( engine::mixer()->processingSampleRate() );
|
||||
m_effect->m_filter2 = new basicFilters<2>( engine::mixer()->processingSampleRate() );
|
||||
|
||||
// flag filters as needing recalculation
|
||||
|
||||
updateFilter1();
|
||||
updateFilter2();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DualFilterControls::loadSettings( const QDomElement& _this )
|
||||
{
|
||||
m_enabled1Model.loadSettings( _this, "enabled1" );
|
||||
m_filter1Model.loadSettings( _this, "filter1" );
|
||||
m_cut1Model.loadSettings( _this, "cut1" );
|
||||
m_res1Model.loadSettings( _this, "res1" );
|
||||
m_gain1Model.loadSettings( _this, "gain1" );
|
||||
|
||||
m_mixModel.loadSettings( _this, "mix" );
|
||||
|
||||
m_enabled2Model.loadSettings( _this, "enabled2" );
|
||||
m_filter2Model.loadSettings( _this, "filter2" );
|
||||
m_cut2Model.loadSettings( _this, "cut2" );
|
||||
m_res2Model.loadSettings( _this, "res2" );
|
||||
m_gain2Model.loadSettings( _this, "gain2" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void DualFilterControls::saveSettings( QDomDocument& _doc, QDomElement& _this )
|
||||
{
|
||||
m_enabled1Model.saveSettings( _doc, _this, "enabled1" );
|
||||
m_filter1Model.saveSettings( _doc, _this, "filter1" );
|
||||
m_cut1Model.saveSettings( _doc, _this, "cut1" );
|
||||
m_res1Model.saveSettings( _doc, _this, "res1" );
|
||||
m_gain1Model.saveSettings( _doc, _this, "gain1" );
|
||||
|
||||
m_mixModel.saveSettings( _doc, _this, "mix" );
|
||||
|
||||
m_enabled2Model.saveSettings( _doc, _this, "enabled2" );
|
||||
m_filter2Model.saveSettings( _doc, _this, "filter2" );
|
||||
m_cut2Model.saveSettings( _doc, _this, "cut2" );
|
||||
m_res2Model.saveSettings( _doc, _this, "res2" );
|
||||
m_gain2Model.saveSettings( _doc, _this, "gain2" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "moc_DualFilterControls.cxx"
|
||||
|
||||
91
plugins/DualFilter/DualFilterControls.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* DualFilterControls.h - controls for dual filter -effect
|
||||
*
|
||||
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
|
||||
* Copyright (c) 2008-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
|
||||
* 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 DUALFILTER_CONTROLS_H
|
||||
#define DUALFILTER_CONTROLS_H
|
||||
|
||||
#include "EffectControls.h"
|
||||
#include "DualFilterControlDialog.h"
|
||||
#include "knob.h"
|
||||
#include "ComboBoxModel.h"
|
||||
|
||||
class DualFilterEffect;
|
||||
|
||||
|
||||
class DualFilterControls : public EffectControls
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DualFilterControls( DualFilterEffect* effect );
|
||||
virtual ~DualFilterControls()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName() const
|
||||
{
|
||||
return "DualFilterControls";
|
||||
}
|
||||
|
||||
virtual int controlCount()
|
||||
{
|
||||
return 11;
|
||||
}
|
||||
|
||||
virtual EffectControlDialog* createView()
|
||||
{
|
||||
return new DualFilterControlDialog( this );
|
||||
}
|
||||
|
||||
|
||||
private slots:
|
||||
void updateFilter1();
|
||||
void updateFilter2();
|
||||
void updateFilters();
|
||||
|
||||
private:
|
||||
DualFilterEffect* m_effect;
|
||||
|
||||
BoolModel m_enabled1Model;
|
||||
ComboBoxModel m_filter1Model;
|
||||
FloatModel m_cut1Model;
|
||||
FloatModel m_res1Model;
|
||||
FloatModel m_gain1Model;
|
||||
|
||||
FloatModel m_mixModel;
|
||||
|
||||
BoolModel m_enabled2Model;
|
||||
ComboBoxModel m_filter2Model;
|
||||
FloatModel m_cut2Model;
|
||||
FloatModel m_res2Model;
|
||||
FloatModel m_gain2Model;
|
||||
|
||||
friend class DualFilterControlDialog;
|
||||
friend class DualFilterEffect;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
BIN
plugins/DualFilter/artwork.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
@@ -55,7 +55,6 @@ private:
|
||||
pixmapButton * m_openPresetButton;
|
||||
pixmapButton * m_rolLPresetButton;
|
||||
pixmapButton * m_rolRPresetButton;
|
||||
pixmapButton * m_selPresetButton;
|
||||
pixmapButton * m_managePluginButton;
|
||||
pixmapButton * m_savePresetButton;
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ Plugin::Descriptor PLUGIN_EXPORT audiofileprocessor_plugin_descriptor =
|
||||
STRINGIFY( PLUGIN_NAME ),
|
||||
"AudioFileProcessor",
|
||||
QT_TRANSLATE_NOOP( "pluginBrowser",
|
||||
"simple sampler with various settings for "
|
||||
"Simple sampler with various settings for "
|
||||
"using samples (e.g. drums) in an "
|
||||
"instrument-track" ),
|
||||
"Tobias Doerffel <tobydox/at/users.sf.net>",
|
||||
@@ -303,7 +303,7 @@ void audioFileProcessor::loopPointChanged( void )
|
||||
//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.001, 1.0d ) );
|
||||
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() *
|
||||
|
||||
@@ -101,8 +101,6 @@ private:
|
||||
|
||||
float m_normalizeFactor;
|
||||
|
||||
oscillator * m_osc;
|
||||
|
||||
friend class bitInvaderView;
|
||||
} ;
|
||||
|
||||
|
||||
@@ -58,12 +58,16 @@ dynProcControlDialog::dynProcControlDialog(
|
||||
waveGraph -> setMaximumSize( 204, 205 );
|
||||
|
||||
knob * inputKnob = new knob( knobBright_26, this);
|
||||
inputKnob -> setVolumeKnob( true );
|
||||
inputKnob -> setVolumeRatio( 1.0 );
|
||||
inputKnob -> move( 14, 251 );
|
||||
inputKnob->setModel( &_controls->m_inputModel );
|
||||
inputKnob->setLabel( tr( "INPUT" ) );
|
||||
inputKnob->setHintText( tr( "Input gain:" ) + " ", "" );
|
||||
|
||||
knob * outputKnob = new knob( knobBright_26, this );
|
||||
outputKnob -> setVolumeKnob( true );
|
||||
outputKnob -> setVolumeRatio( 1.0 );
|
||||
outputKnob -> move( 54, 251 );
|
||||
outputKnob->setModel( &_controls->m_outputModel );
|
||||
outputKnob->setLabel( tr( "OUTPUT" ) );
|
||||
|
||||
@@ -86,11 +86,11 @@ void dynProcControls::samplesChanged( int _begin, int _end)
|
||||
void dynProcControls::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
//load knobs, stereomode
|
||||
m_inputModel.setValue( _this.attribute( "inputGain" ).toFloat() );
|
||||
m_outputModel.setValue( _this.attribute( "outputGain" ).toFloat() );
|
||||
m_attackModel.setValue( _this.attribute( "attack" ).toFloat() );
|
||||
m_releaseModel.setValue( _this.attribute( "release" ).toFloat() );
|
||||
m_stereomodeModel.setValue( _this.attribute( "stereoMode" ).toInt() );
|
||||
m_inputModel.loadSettings( _this, "inputGain" );
|
||||
m_outputModel.loadSettings( _this, "outputGain" );
|
||||
m_attackModel.loadSettings( _this, "attack" );
|
||||
m_releaseModel.loadSettings( _this, "release" );
|
||||
m_stereomodeModel.loadSettings( _this, "stereoMode" );
|
||||
|
||||
//load waveshape
|
||||
int size = 0;
|
||||
@@ -109,11 +109,11 @@ void dynProcControls::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this )
|
||||
{
|
||||
//save input, output knobs
|
||||
_this.setAttribute( "inputGain", m_inputModel.value() );
|
||||
_this.setAttribute( "outputGain", m_outputModel.value() );
|
||||
_this.setAttribute( "attack", m_attackModel.value() );
|
||||
_this.setAttribute( "release", m_releaseModel.value() );
|
||||
_this.setAttribute( "stereoMode", m_stereomodeModel.value() );
|
||||
m_inputModel.saveSettings( _doc, _this, "inputGain" );
|
||||
m_outputModel.saveSettings( _doc, _this, "outputGain" );
|
||||
m_attackModel.saveSettings( _doc, _this, "attack" );
|
||||
m_releaseModel.saveSettings( _doc, _this, "release" );
|
||||
m_stereomodeModel.saveSettings( _doc, _this, "stereoMode" );
|
||||
|
||||
|
||||
//save waveshape
|
||||
|
||||
@@ -44,7 +44,7 @@ Plugin::Descriptor PLUGIN_EXPORT kicker_plugin_descriptor =
|
||||
STRINGIFY( PLUGIN_NAME ),
|
||||
"Kicker",
|
||||
QT_TRANSLATE_NOOP( "pluginBrowser",
|
||||
"versatile kick- & bassdrum-synthesizer" ),
|
||||
"Versatile kick- & bassdrum-synthesizer" ),
|
||||
"Tobias Doerffel <tobydox/at/users.sf.net>",
|
||||
0x0100,
|
||||
Plugin::Instrument,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ladspa_browser.h - dialog to display information about installed LADSPA
|
||||
* plugins
|
||||
* plugins
|
||||
*
|
||||
* Copyright (c) 2006-2008 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
* Copyright (c) 2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
@@ -68,6 +68,18 @@ public:
|
||||
|
||||
virtual QString nodeName() const;
|
||||
|
||||
virtual void saveSettings( QDomDocument& doc, QDomElement& element )
|
||||
{
|
||||
Q_UNUSED(doc)
|
||||
Q_UNUSED(element)
|
||||
}
|
||||
|
||||
virtual void loadSettings( const QDomElement& element )
|
||||
{
|
||||
Q_UNUSED(element)
|
||||
}
|
||||
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
#include "embed.cpp"
|
||||
#include "moc_lb302.cxx"
|
||||
|
||||
|
||||
// Envelope Recalculation period
|
||||
#define ENVINC 64
|
||||
|
||||
@@ -338,27 +337,25 @@ lb302Synth::lb302Synth( InstrumentTrack * _instrumentTrack ) :
|
||||
vca_a = 9;
|
||||
vca_mode = 3;
|
||||
|
||||
vcfs[0] = new lb302Filter3Pole(&fs);
|
||||
vcfs[1] = new lb302FilterIIR2(&fs);
|
||||
vcf = vcfs[1];
|
||||
vcfs[0] = new lb302FilterIIR2(&fs);
|
||||
vcfs[1] = new lb302Filter3Pole(&fs);
|
||||
db24Toggled();
|
||||
|
||||
sample_cnt = 0;
|
||||
release_frame = 1<<24;
|
||||
catch_frame = 0;
|
||||
catch_decay = 0;
|
||||
|
||||
recalcFilter();
|
||||
|
||||
last_offset = 0;
|
||||
|
||||
new_freq = -1;
|
||||
current_freq = -1;
|
||||
delete_freq = -1;
|
||||
|
||||
filterChanged();
|
||||
|
||||
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this );
|
||||
engine::mixer()->addPlayHandle( iph );
|
||||
|
||||
filterChanged();
|
||||
}
|
||||
|
||||
|
||||
@@ -401,6 +398,7 @@ void lb302Synth::loadSettings( const QDomElement & _this )
|
||||
slideToggle.loadSettings( _this, "slide");
|
||||
deadToggle.loadSettings( _this, "dead");
|
||||
db24Toggle.loadSettings( _this, "db24");
|
||||
db24Toggled();
|
||||
|
||||
filterChanged();
|
||||
}
|
||||
|
||||
@@ -151,6 +151,11 @@ public:
|
||||
|
||||
virtual QString nodeName() const;
|
||||
|
||||
virtual Flags flags() const
|
||||
{
|
||||
return IsSingleStreamed;
|
||||
}
|
||||
|
||||
virtual f_cnt_t desiredReleaseFrames() const
|
||||
{
|
||||
return 0; //4048;
|
||||
@@ -195,8 +200,6 @@ private:
|
||||
vco_slideinc, //* Slide base to use in next node. Nonzero=slide next note
|
||||
vco_slidebase; //* The base vco_inc while sliding.
|
||||
|
||||
float vco_detune;
|
||||
|
||||
enum vco_shape_t { SAWTOOTH, SQUARE, TRIANGLE, MOOG, ROUND_SQUARE, SINE, EXPONENTIAL, WHITE_NOISE };
|
||||
vco_shape_t vco_shape;
|
||||
|
||||
@@ -257,8 +260,6 @@ private:
|
||||
knob * m_vcfDecKnob;
|
||||
knob * m_vcfModKnob;
|
||||
|
||||
knob * m_vcoFineDetuneKnob;
|
||||
|
||||
knob * m_distKnob;
|
||||
knob * m_slideDecKnob;
|
||||
automatableButtonGroup * m_waveBtnGrp;
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 2.8 KiB |
@@ -229,7 +229,7 @@ INT32 *ams_table;
|
||||
INT32 *vib_table;
|
||||
static INT32 amsIncr;
|
||||
static INT32 vibIncr;
|
||||
static INT32 feedback2; /* connect for SLOT 2 */
|
||||
INT32 feedback2; /* connect for SLOT 2 */
|
||||
|
||||
/* log output level */
|
||||
#define LOG_ERR 3 /* ERROR */
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// TODO:
|
||||
// TODO:
|
||||
// - Better voice allocation: long releases get cut short :(
|
||||
// - .sbi (or similar) file loading into models
|
||||
// - RT safety = get rid of mutex = make emulator code thread-safe
|
||||
@@ -36,9 +36,9 @@
|
||||
// - SBI file import?
|
||||
|
||||
// - Envelope times in ms for UI: t[0] = 0, t[n] = ( 1<<n ) * X, X = 0.11597 for A, 0.6311 for D/R
|
||||
// - attack 0.0, 0.23194, 0.46388, 0.92776, 1.85552, 3.71104, 7.42208, 14.84416,
|
||||
// - attack 0.0, 0.23194, 0.46388, 0.92776, 1.85552, 3.71104, 7.42208, 14.84416,
|
||||
// 29.68832, 59.37664, 118.75328, 237.50656, 475.01312, 950.02624, 1900.05248, 3800.10496
|
||||
// -decay/release 0.0, 1.2622, 2.5244, 5.0488, 10.0976, 20.1952, 40.3904, 80.7808, 161.5616,
|
||||
// -decay/release 0.0, 1.2622, 2.5244, 5.0488, 10.0976, 20.1952, 40.3904, 80.7808, 161.5616,
|
||||
// 323.1232, 646.2464, 1292.4928, 2584.9856, 5169.9712, 10339.9424, 20679.8848
|
||||
|
||||
#include "opl2instrument.h"
|
||||
@@ -250,14 +250,14 @@ void opl2instrument::setVoiceVelocity(int voice, int vel) {
|
||||
} else {
|
||||
vel_adjusted = 63 - op1_lvl_mdl.value();
|
||||
}
|
||||
theEmulator->write(0x40+adlib_opadd[voice],
|
||||
theEmulator->write(0x40+adlib_opadd[voice],
|
||||
( (int)op1_scale_mdl.value() & 0x03 << 6) +
|
||||
( vel_adjusted & 0x3f ) );
|
||||
|
||||
|
||||
|
||||
vel_adjusted = 63 - ( op2_lvl_mdl.value() * vel/127.0 );
|
||||
// vel_adjusted = 63 - op2_lvl_mdl.value();
|
||||
theEmulator->write(0x43+adlib_opadd[voice],
|
||||
theEmulator->write(0x43+adlib_opadd[voice],
|
||||
( (int)op2_scale_mdl.value() & 0x03 << 6) +
|
||||
( vel_adjusted & 0x3f ) );
|
||||
}
|
||||
@@ -293,10 +293,10 @@ bool opl2instrument::handleMidiEvent( const MidiEvent& event, const MidiTime& ti
|
||||
// to get us in line with MIDI(?)
|
||||
key = event.key() +12;
|
||||
vel = event.velocity();
|
||||
|
||||
|
||||
voice = popVoice();
|
||||
if( voice != OPL2_NO_VOICE ) {
|
||||
// Turn voice on, NB! the frequencies are straight by voice number,
|
||||
// Turn voice on, NB! the frequencies are straight by voice number,
|
||||
// not by the adlib_opadd table!
|
||||
theEmulator->write(0xA0+voice, fnums[key] & 0xff);
|
||||
theEmulator->write(0xB0+voice, 32 + ((fnums[key] & 0x1f00) >> 8) );
|
||||
@@ -306,7 +306,7 @@ bool opl2instrument::handleMidiEvent( const MidiEvent& event, const MidiTime& ti
|
||||
}
|
||||
break;
|
||||
case MidiNoteOff:
|
||||
key = event.key() +12;
|
||||
key = event.key() +12;
|
||||
for(voice=0; voice<9; ++voice) {
|
||||
if( voiceNote[voice] == key ) {
|
||||
theEmulator->write(0xA0+voice, fnums[key] & 0xff);
|
||||
@@ -331,12 +331,12 @@ bool opl2instrument::handleMidiEvent( const MidiEvent& event, const MidiTime& ti
|
||||
break;
|
||||
case MidiPitchBend:
|
||||
// Update fnumber table
|
||||
// Pitchbend should be in the range 0...16383 but the new range knob gets it wrong.
|
||||
// Pitchbend should be in the range 0...16383 but the new range knob gets it wrong.
|
||||
// tmp_pb = (2*BEND_CENTS)*((float)event.m_data.m_param[0]/16383)-BEND_CENTS;
|
||||
|
||||
// Something like 100 cents = 8192, but offset by 8192 so the +/-100 cents range goes from 0...16383?
|
||||
tmp_pb = ( event.pitchBend()-8192 ) * pitchBendRange / 8192;
|
||||
|
||||
|
||||
if( tmp_pb != pitchbend ) {
|
||||
pitchbend = tmp_pb;
|
||||
tuneEqual(69, 440.0);
|
||||
@@ -349,7 +349,7 @@ bool opl2instrument::handleMidiEvent( const MidiEvent& event, const MidiTime& ti
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MidiControlChange:
|
||||
case MidiControlChange:
|
||||
switch (event.controllerNumber()) {
|
||||
case MidiControllerRegisteredParameterNumberLSB:
|
||||
RPNfine = event.controllerValue();
|
||||
@@ -385,14 +385,14 @@ PluginView * opl2instrument::instantiateView( QWidget * _parent )
|
||||
}
|
||||
|
||||
|
||||
void opl2instrument::play( sampleFrame * _working_buffer )
|
||||
void opl2instrument::play( sampleFrame * _working_buffer )
|
||||
{
|
||||
emulatorMutex.lock();
|
||||
theEmulator->update(renderbuffer, frameCount);
|
||||
|
||||
for( fpp_t frame = 0; frame < frameCount; ++frame )
|
||||
{
|
||||
sample_t s = float(renderbuffer[frame])/32768.0;
|
||||
sample_t s = float(renderbuffer[frame]) / 8192.0;
|
||||
for( ch_cnt_t ch = 0; ch < DEFAULT_CHANNELS; ++ch )
|
||||
{
|
||||
_working_buffer[frame][ch] = s;
|
||||
@@ -406,7 +406,7 @@ void opl2instrument::play( sampleFrame * _working_buffer )
|
||||
}
|
||||
|
||||
|
||||
void opl2instrument::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
void opl2instrument::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
op1_a_mdl.saveSettings( _doc, _this, "op1_a" );
|
||||
op1_d_mdl.saveSettings( _doc, _this, "op1_d" );
|
||||
@@ -577,11 +577,11 @@ opl2instrumentView::opl2instrumentView( Instrument * _instrument,
|
||||
QWidget * _parent ) :
|
||||
InstrumentView( _instrument, _parent )
|
||||
{
|
||||
/* Unnecessary?
|
||||
/* Unnecessary?
|
||||
m_patch = new LcdSpinBox( 3, this , "PRESET");
|
||||
m_patch->setLabel( "PRESET" );
|
||||
m_patch->move( 100, 1 );
|
||||
m_patch->setEnabled( true );
|
||||
m_patch->setEnabled( true );
|
||||
*/
|
||||
|
||||
#define KNOB_GEN(knobname, hinttext, hintunit,xpos,ypos) \
|
||||
@@ -608,7 +608,7 @@ opl2instrumentView::opl2instrumentView( Instrument * _instrument,
|
||||
toolTip::add( buttname, tr( tooltip ) );\
|
||||
buttname->move( xpos, ypos );\
|
||||
buttgroup->addButton(buttname);
|
||||
|
||||
|
||||
|
||||
// OP1 knobs & buttons...
|
||||
KNOB_GEN(op1_a_kn, "Attack", "", 6, 48);
|
||||
|
||||
@@ -129,15 +129,12 @@ private:
|
||||
pixmapButton * m_ch2VolSweepDirButton;
|
||||
knob * m_ch2SweepStepLengthKnob;
|
||||
|
||||
pixmapButton * m_ch3OnButton;
|
||||
knob * m_ch3VolumeKnob;
|
||||
|
||||
knob * m_ch4VolumeKnob;
|
||||
pixmapButton * m_ch4VolSweepDirButton;
|
||||
knob * m_ch4SweepStepLengthKnob;
|
||||
knob * m_ch4ShiftClockFreqKnob;
|
||||
pixmapButton * m_ch4ShiftRegWidthButton;
|
||||
knob * m_ch4FreqDivRatioKnob;
|
||||
|
||||
knob * m_so1VolumeKnob;
|
||||
knob * m_so2VolumeKnob;
|
||||
|
||||
@@ -565,8 +565,9 @@ void sf2Instrument::playNote( NotePlayHandle * _n, sampleFrame * )
|
||||
id[i] = fluid_voice_get_id( voices[i] );
|
||||
}
|
||||
|
||||
fluid_synth_noteon( m_synth, m_channel, midiNote,
|
||||
_n->midiVelocity() );
|
||||
const int baseVelocity = instrumentTrack()->midiPort()->baseVelocity();
|
||||
|
||||
fluid_synth_noteon( m_synth, m_channel, midiNote, _n->midiVelocity( baseVelocity ) );
|
||||
|
||||
// get new voice and save it
|
||||
fluid_synth_get_voicelist( m_synth, voices, poly, -1 );
|
||||
@@ -606,7 +607,7 @@ void sf2Instrument::playNote( NotePlayHandle * _n, sampleFrame * )
|
||||
}
|
||||
#endif
|
||||
|
||||
const float currentVelocity = _n->volumeLevel( tfp ) * MidiMaxVelocity * DefaultVolume / MaxVolume;
|
||||
const float currentVelocity = _n->volumeLevel( tfp ) * instrumentTrack()->midiPort()->baseVelocity();
|
||||
if( pluginData->fluidVoice &&
|
||||
pluginData->lastVelocity != currentVelocity )
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* please read readme.txt in this directory
|
||||
*
|
||||
* Copyright (c) 2014 Wong Cho Ching
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -159,7 +159,7 @@ void SfxrSynth::resetSample( bool restart )
|
||||
|
||||
|
||||
|
||||
void SfxrSynth::update( sampleFrame * buffer, const fpp_t frameNum )
|
||||
void SfxrSynth::update( sampleFrame * buffer, const int32_t frameNum )
|
||||
{
|
||||
for(int i=0;i<frameNum;i++)
|
||||
{
|
||||
@@ -452,7 +452,7 @@ QString sfxrInstrument::nodeName() const
|
||||
void sfxrInstrument::playNote( NotePlayHandle * _n, sampleFrame * _working_buffer )
|
||||
{
|
||||
float currentSampleRate = engine::mixer()->processingSampleRate();
|
||||
|
||||
|
||||
fpp_t frameNum = _n->framesLeftForCurrentPeriod();
|
||||
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL )
|
||||
{
|
||||
@@ -464,10 +464,13 @@ void sfxrInstrument::playNote( NotePlayHandle * _n, sampleFrame * _working_buffe
|
||||
return;
|
||||
}
|
||||
|
||||
fpp_t pitchedFrameNum = (_n->frequency()/BaseFreq)*frameNum;
|
||||
|
||||
int32_t pitchedFrameNum = (_n->frequency()/BaseFreq)*frameNum;
|
||||
|
||||
pitchedFrameNum /= ( currentSampleRate / 44100 );
|
||||
|
||||
|
||||
// debug code
|
||||
// qDebug( "pFN %d", pitchedFrameNum );
|
||||
|
||||
sampleFrame * pitchedBuffer = new sampleFrame[pitchedFrameNum];
|
||||
static_cast<SfxrSynth*>(_n->m_pluginData)->update( pitchedBuffer, pitchedFrameNum );
|
||||
for( fpp_t i=0; i<frameNum; i++ )
|
||||
@@ -483,7 +486,7 @@ void sfxrInstrument::playNote( NotePlayHandle * _n, sampleFrame * _working_buffe
|
||||
applyRelease( _working_buffer, _n );
|
||||
|
||||
instrumentTrack()->processAudioBuffer( _working_buffer, frameNum, _n );
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -622,7 +625,7 @@ sfxrInstrumentView::sfxrInstrumentView( Instrument * _instrument,
|
||||
m_dSlideKnob ->setObjectName( "freqKnob" );
|
||||
m_vibDepthKnob ->setObjectName( "freqKnob" );
|
||||
m_vibSpeedKnob ->setObjectName( "freqKnob" );
|
||||
|
||||
|
||||
createKnob(m_changeAmtKnob, KNOBS_BASE_X+KNOB_BLOCK_SIZE_X*0, KNOBS_BASE_Y+KNOB_BLOCK_SIZE_Y*2, "Change Amount");
|
||||
createKnob(m_changeSpeedKnob, KNOBS_BASE_X+KNOB_BLOCK_SIZE_X*1, KNOBS_BASE_Y+KNOB_BLOCK_SIZE_Y*2, "Change Speed");
|
||||
|
||||
@@ -692,6 +695,7 @@ sfxrInstrumentView::sfxrInstrumentView( Instrument * _instrument,
|
||||
|
||||
|
||||
//preview sound on generator/random/mutate button clicked
|
||||
/* // disabled for now
|
||||
connect( m_pickupBtn, SIGNAL ( clicked() ), this, SLOT ( previewSound() ) );
|
||||
connect( m_laserBtn, SIGNAL ( clicked() ), this, SLOT ( previewSound() ) );
|
||||
connect( m_explosionBtn, SIGNAL ( clicked() ), this, SLOT ( previewSound() ) );
|
||||
@@ -701,7 +705,7 @@ sfxrInstrumentView::sfxrInstrumentView( Instrument * _instrument,
|
||||
connect( m_blipBtn, SIGNAL ( clicked() ), this, SLOT ( previewSound() ) );
|
||||
connect( m_randomizeBtn, SIGNAL ( clicked() ), this, SLOT ( previewSound() ) );
|
||||
connect( m_mutateBtn, SIGNAL ( clicked() ), this, SLOT ( previewSound() ) );
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* please read readme.txt in this directory
|
||||
*
|
||||
* Copyright (c) 2014 Wong Cho Ching
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -25,8 +25,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SFXR_H
|
||||
#define _SFXR_H
|
||||
#ifndef SFXR_H
|
||||
#define SFXR_H
|
||||
|
||||
#include "Instrument.h"
|
||||
#include "InstrumentView.h"
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
virtual ~SfxrSynth();
|
||||
|
||||
void resetSample( bool restart );
|
||||
void update( sampleFrame * buffer, const fpp_t frameNum );
|
||||
void update( sampleFrame * buffer, const int32_t frameNum );
|
||||
|
||||
bool isPlaying() const;
|
||||
|
||||
|
||||
@@ -69,10 +69,9 @@ stereoEnhancerEffect::~stereoEnhancerEffect()
|
||||
{
|
||||
if( m_delayBuffer )
|
||||
{
|
||||
//delete [] m_delayBuffer;
|
||||
delete m_delayBuffer;
|
||||
|
||||
delete [] m_delayBuffer;
|
||||
}
|
||||
|
||||
m_currFrame = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ void stereoEnhancerControls::changeWideCoeff()
|
||||
|
||||
void stereoEnhancerControls::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
m_widthModel.setValue( _this.attribute( "width" ).toFloat() );
|
||||
m_widthModel.loadSettings( _this, "width" );
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ void stereoEnhancerControls::loadSettings( const QDomElement & _this )
|
||||
void stereoEnhancerControls::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this )
|
||||
{
|
||||
_this.setAttribute( "width", m_widthModel.value() );
|
||||
m_widthModel.saveSettings( _doc, _this, "width" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -59,10 +59,10 @@ void stereoMatrixControls::changeMatrix()
|
||||
|
||||
void stereoMatrixControls::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
m_llModel.setValue( _this.attribute( "l-l" ).toFloat() );
|
||||
m_lrModel.setValue( _this.attribute( "l-r" ).toFloat() );
|
||||
m_rlModel.setValue( _this.attribute( "r-l" ).toFloat() );
|
||||
m_rrModel.setValue( _this.attribute( "r-r" ).toFloat() );
|
||||
m_llModel.loadSettings( _this, "l-l" );
|
||||
m_lrModel.loadSettings( _this, "l-r" );
|
||||
m_rlModel.loadSettings( _this, "r-l" );
|
||||
m_rrModel.loadSettings( _this, "r-r" );
|
||||
}
|
||||
|
||||
|
||||
@@ -71,10 +71,10 @@ void stereoMatrixControls::loadSettings( const QDomElement & _this )
|
||||
void stereoMatrixControls::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this )
|
||||
{
|
||||
_this.setAttribute( "l-l", m_llModel.value() );
|
||||
_this.setAttribute( "l-r", m_lrModel.value() );
|
||||
_this.setAttribute( "r-l", m_rlModel.value() );
|
||||
_this.setAttribute( "r-r", m_rrModel.value() );
|
||||
m_llModel.saveSettings( _doc, _this, "l-l" );
|
||||
m_lrModel.saveSettings( _doc, _this, "l-r" );
|
||||
m_rlModel.saveSettings( _doc, _this, "r-l" );
|
||||
m_rrModel.saveSettings( _doc, _this, "r-r" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ Plugin::Descriptor PLUGIN_EXPORT tripleoscillator_plugin_descriptor =
|
||||
STRINGIFY( PLUGIN_NAME ),
|
||||
"TripleOscillator",
|
||||
QT_TRANSLATE_NOOP( "pluginBrowser",
|
||||
"three powerful oscillators you can modulate "
|
||||
"Three powerful oscillators you can modulate "
|
||||
"in several ways" ),
|
||||
"Tobias Doerffel <tobydox/at/users.sf.net>",
|
||||
0x0110,
|
||||
|
||||
@@ -119,8 +119,6 @@ protected slots:
|
||||
|
||||
|
||||
private:
|
||||
InstrumentTrack * m_InstrumentTrack;
|
||||
|
||||
OscillatorObject * m_osc[NUM_OF_OSCILLATORS];
|
||||
|
||||
struct oscPtr
|
||||
|
||||
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 7.7 KiB |
@@ -78,8 +78,6 @@ protected slots:
|
||||
private:
|
||||
void closePlugin( void );
|
||||
|
||||
int m_runningNotes[NumKeys];
|
||||
|
||||
|
||||
VstPlugin * m_plugin;
|
||||
QMutex m_pluginMutex;
|
||||
|
||||
@@ -87,8 +87,6 @@ private:
|
||||
pixmapButton * m_button;
|
||||
pixmapButton * m_lastBtn;
|
||||
|
||||
int m_selected;
|
||||
|
||||
} ;
|
||||
|
||||
typedef IntModel nineButtonSelectorModel;
|
||||
|
||||
@@ -58,12 +58,16 @@ waveShaperControlDialog::waveShaperControlDialog(
|
||||
waveGraph -> setMaximumSize( 204, 205 );
|
||||
|
||||
knob * inputKnob = new knob( knobBright_26, this);
|
||||
inputKnob -> setVolumeKnob( true );
|
||||
inputKnob -> setVolumeRatio( 1.0 );
|
||||
inputKnob -> move( 14, 251 );
|
||||
inputKnob->setModel( &_controls->m_inputModel );
|
||||
inputKnob->setLabel( tr( "INPUT" ) );
|
||||
inputKnob->setHintText( tr( "Input gain:" ) + " ", "" );
|
||||
|
||||
knob * outputKnob = new knob( knobBright_26, this );
|
||||
outputKnob -> setVolumeKnob( true );
|
||||
outputKnob -> setVolumeRatio( 1.0 );
|
||||
outputKnob -> move( 54, 251 );
|
||||
outputKnob->setModel( &_controls->m_outputModel );
|
||||
outputKnob->setLabel( tr( "OUTPUT" ) );
|
||||
|
||||
@@ -88,8 +88,8 @@ void waveShaperControls::samplesChanged( int _begin, int _end)
|
||||
void waveShaperControls::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
//load input, output knobs
|
||||
m_inputModel.setValue( _this.attribute( "inputGain" ).toFloat() );
|
||||
m_outputModel.setValue( _this.attribute( "outputGain" ).toFloat() );
|
||||
m_inputModel.loadSettings( _this, "inputGain" );
|
||||
m_outputModel.loadSettings( _this, "outputGain" );
|
||||
|
||||
m_clipModel.loadSettings( _this, "clipInput" );
|
||||
|
||||
@@ -110,9 +110,9 @@ void waveShaperControls::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this )
|
||||
{
|
||||
//save input, output knobs
|
||||
_this.setAttribute( "inputGain", m_inputModel.value() );
|
||||
_this.setAttribute( "outputGain", m_outputModel.value() );
|
||||
|
||||
m_inputModel.saveSettings( _doc, _this, "inputGain" );
|
||||
m_outputModel.saveSettings( _doc, _this, "outputGain" );
|
||||
|
||||
m_clipModel.saveSettings( _doc, _this, "clipInput" );
|
||||
|
||||
//save waveshape
|
||||
|
||||
@@ -71,7 +71,6 @@ class AnalogFilter:public Filter_
|
||||
|
||||
REALTYPE oldc[3], oldd[3]; //old coefficients(used only if some filter paremeters changes very fast, and it needs interpolation)
|
||||
|
||||
REALTYPE xd[3], yd[3]; //used if the filter is applied more times
|
||||
int needsinterpolation, firsttime; /**\todo see if bool works for these*/
|
||||
int abovenq; //this is 1 if the frequency is above the nyquist
|
||||
int oldabovenq; //if the last time was above nyquist (used to see if it needs interpolation)
|
||||
|
||||
@@ -43,7 +43,6 @@ class EffectLFO
|
||||
REALTYPE xl, xr;
|
||||
REALTYPE incx;
|
||||
REALTYPE ampl1, ampl2, ampr1, ampr2; //necessary for "randomness"
|
||||
REALTYPE lfointensity;
|
||||
REALTYPE lfornd;
|
||||
char lfotype; /**\todo GET RID OF CHAR (replace with short or enum)*/
|
||||
};
|
||||
|
||||
@@ -102,10 +102,10 @@ class Reverb:public Effect
|
||||
void setroomsize(unsigned char Proomsize);
|
||||
void setbandwidth(unsigned char Pbandwidth);
|
||||
|
||||
REALTYPE pan, erbalance;
|
||||
REALTYPE pan;
|
||||
//Parameters
|
||||
int lohidamptype; /**<0=disable,1=highdamp(lowpass),2=lowdamp(highpass)*/
|
||||
int idelaylen, rdelaylen;
|
||||
int idelaylen;
|
||||
int idelayk;
|
||||
REALTYPE lohifb, idelayfb, roomsize, rs; //rs is used to "normalise" the volume according to the roomsize
|
||||
int comblen[REV_COMBS * 2];
|
||||
|
||||
@@ -148,7 +148,7 @@ return(20.0*pow((REALTYPE)1000.0,x));} {}
|
||||
code {if (freq<0.00001) freq=0.00001;
|
||||
return(log(freq/20.0)/log(1000.0));} {}
|
||||
}
|
||||
decl {int oldx,oldy;} {}
|
||||
decl {int oldx;} {}
|
||||
decl {REALTYPE khzval;} {public
|
||||
}
|
||||
decl {EffectMgr *eff;} {}
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
REALTYPE getfreqx(REALTYPE x);
|
||||
REALTYPE getfreqpos(REALTYPE freq);
|
||||
private:
|
||||
int oldx,oldy;
|
||||
int oldx;
|
||||
public:
|
||||
REALTYPE khzval;
|
||||
private:
|
||||
|
||||
@@ -189,7 +189,7 @@ return(1);} {}
|
||||
}
|
||||
decl {Fl_Box *pair;} {}
|
||||
decl {EnvelopeParams *env;} {}
|
||||
decl {int oldx,oldy;} {}
|
||||
decl {int oldx;} {}
|
||||
decl {int currentpoint,cpx,cpdt;} {}
|
||||
decl {int lastpoint;} {public
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
private:
|
||||
Fl_Box *pair;
|
||||
EnvelopeParams *env;
|
||||
int oldx,oldy;
|
||||
int oldx;
|
||||
int currentpoint,cpx,cpdt;
|
||||
public:
|
||||
int lastpoint;
|
||||
|
||||
@@ -144,7 +144,7 @@ for (i=1;i<lx;i++){
|
||||
code {delete [] graphpoints;} {}
|
||||
}
|
||||
decl {FilterParams *pars;} {}
|
||||
decl {int oldx,oldy;} {}
|
||||
decl {int oldx;} {}
|
||||
decl {int *nvowel,*nformant;} {}
|
||||
decl {REALTYPE *graphpoints;} {}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
~FormantFilterGraph();
|
||||
private:
|
||||
FilterParams *pars;
|
||||
int oldx,oldy;
|
||||
int oldx;
|
||||
int *nvowel,*nformant;
|
||||
REALTYPE *graphpoints;
|
||||
};
|
||||
|
||||
@@ -1814,7 +1814,7 @@ void PartUI::init(Part *part_,Master *master_,int npart_,BankUI *bankui_) {
|
||||
while (klimits[k]!=0){
|
||||
sprintf(tmp,"%d",klimits[k]);
|
||||
keylimitlist->add(tmp);
|
||||
if ((val==-1)){
|
||||
if (val==-1){
|
||||
if (klimits[k]>part->Pkeylimit) val=k;
|
||||
};
|
||||
k++;
|
||||
|
||||
@@ -495,7 +495,7 @@ void AutomatableModel::copyValue()
|
||||
|
||||
|
||||
|
||||
void AutomatableModel::pasteValue()
|
||||
void AutomatableModel::pasteValue()
|
||||
{
|
||||
setValue( copiedValue() );
|
||||
}
|
||||
|
||||
@@ -37,6 +37,9 @@
|
||||
#include "song.h"
|
||||
|
||||
|
||||
const float AutomationPattern::DEFAULT_MIN_VALUE = 0;
|
||||
const float AutomationPattern::DEFAULT_MAX_VALUE = 1;
|
||||
|
||||
|
||||
AutomationPattern::AutomationPattern( AutomationTrack * _auto_track ) :
|
||||
trackContentObject( _auto_track ),
|
||||
|
||||
@@ -164,6 +164,11 @@ public:
|
||||
|
||||
void processJobQueue();
|
||||
|
||||
int workerNum() const
|
||||
{
|
||||
return m_workerNum;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
virtual void run()
|
||||
|
||||
@@ -106,9 +106,11 @@ NotePlayHandle::NotePlayHandle( InstrumentTrack* instrumentTrack,
|
||||
|
||||
if( !isTopNote() || !instrumentTrack->isArpeggioEnabled() )
|
||||
{
|
||||
const int baseVelocity = m_instrumentTrack->midiPort()->baseVelocity();
|
||||
|
||||
// send MidiNoteOn event
|
||||
m_instrumentTrack->processOutEvent(
|
||||
MidiEvent( MidiNoteOn, midiChannel(), midiKey(), midiVelocity() ),
|
||||
MidiEvent( MidiNoteOn, midiChannel(), midiKey(), midiVelocity( baseVelocity ) ),
|
||||
MidiTime::fromFrames( offset(), engine::framesPerTick() ) );
|
||||
}
|
||||
}
|
||||
@@ -152,7 +154,9 @@ void NotePlayHandle::setVolume( volume_t _volume )
|
||||
{
|
||||
note::setVolume( _volume );
|
||||
|
||||
m_instrumentTrack->processOutEvent( MidiEvent( MidiKeyPressure, midiChannel(), midiKey(), midiVelocity() ) );
|
||||
const int baseVelocity = m_instrumentTrack->midiPort()->baseVelocity();
|
||||
|
||||
m_instrumentTrack->processOutEvent( MidiEvent( MidiKeyPressure, midiChannel(), midiKey(), midiVelocity( baseVelocity ) ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* for testing + according model class
|
||||
*
|
||||
* 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
|
||||
@@ -31,7 +31,7 @@
|
||||
* \mainpage Instrument plugin keyboard display classes
|
||||
*
|
||||
* \section introduction Introduction
|
||||
*
|
||||
*
|
||||
* \todo fill this out
|
||||
* \todo write isWhite inline function and replace throughout
|
||||
*/
|
||||
@@ -95,6 +95,10 @@ void Piano::setKeyState( int key, bool state )
|
||||
*/
|
||||
void Piano::handleKeyPress( int key, int midiVelocity )
|
||||
{
|
||||
if( midiVelocity == -1 )
|
||||
{
|
||||
midiVelocity = m_instrumentTrack->midiPort()->baseVelocity();
|
||||
}
|
||||
if( isValidKey( key ) )
|
||||
{
|
||||
m_midiEvProc->processInEvent( MidiEvent( MidiNoteOn, 0, key, midiVelocity ) );
|
||||
|
||||
@@ -859,13 +859,13 @@ QString SampleBuffer::openAudioFile() const
|
||||
// set filters
|
||||
QStringList types;
|
||||
types << tr( "All Audio-Files (*.wav *.ogg *.ds *.flac *.spx *.voc "
|
||||
"*.aif *.aiff *.au *.raw *.mp3)" )
|
||||
"*.aif *.aiff *.au *.raw)" )
|
||||
<< tr( "Wave-Files (*.wav)" )
|
||||
<< tr( "OGG-Files (*.ogg)" )
|
||||
<< tr( "DrumSynth-Files (*.ds)" )
|
||||
<< tr( "FLAC-Files (*.flac)" )
|
||||
<< tr( "SPEEX-Files (*.spx)" )
|
||||
<< tr( "MP3-Files (*.mp3)" )
|
||||
//<< tr( "MP3-Files (*.mp3)" )
|
||||
//<< tr( "MIDI-Files (*.mid)" )
|
||||
<< tr( "VOC-Files (*.voc)" )
|
||||
<< tr( "AIFF-Files (*.aif *.aiff)" )
|
||||
|
||||
@@ -47,41 +47,46 @@ SerializingObject::~SerializingObject()
|
||||
|
||||
|
||||
|
||||
QDomElement SerializingObject::saveState( QDomDocument & _doc,
|
||||
QDomElement & _parent )
|
||||
QDomElement SerializingObject::saveState( QDomDocument& doc, QDomElement& parent )
|
||||
{
|
||||
QDomElement _this = _doc.createElement( nodeName() );
|
||||
_parent.appendChild( _this );
|
||||
saveSettings( _doc, _this );
|
||||
if( getHook() )
|
||||
QDomElement element = doc.createElement( nodeName() );
|
||||
parent.appendChild( element );
|
||||
|
||||
saveSettings( doc, element );
|
||||
|
||||
if( hook() )
|
||||
{
|
||||
getHook()->saveSettings( _doc, _this );
|
||||
hook()->saveSettings( doc, element );
|
||||
}
|
||||
return _this;
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void SerializingObject::restoreState( const QDomElement & _this )
|
||||
void SerializingObject::restoreState( const QDomElement& element )
|
||||
{
|
||||
loadSettings( _this );
|
||||
if( getHook() )
|
||||
loadSettings( element );
|
||||
|
||||
if( hook() )
|
||||
{
|
||||
getHook()->loadSettings( _this );
|
||||
hook()->loadSettings( element );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void SerializingObject::setHook( SerializingObjectHook * _hook )
|
||||
void SerializingObject::setHook( SerializingObjectHook* hook )
|
||||
{
|
||||
if( m_hook )
|
||||
{
|
||||
m_hook->m_hookedIn = NULL;
|
||||
}
|
||||
m_hook = _hook;
|
||||
|
||||
m_hook = hook;
|
||||
|
||||
if( m_hook )
|
||||
{
|
||||
m_hook->m_hookedIn = this;
|
||||
@@ -91,16 +96,18 @@ void SerializingObject::setHook( SerializingObjectHook * _hook )
|
||||
|
||||
|
||||
|
||||
void SerializingObject::saveSettings( QDomDocument &/* _doc*/,
|
||||
QDomElement &/* _this*/ )
|
||||
void SerializingObject::saveSettings( QDomDocument& doc, QDomElement& element )
|
||||
{
|
||||
Q_UNUSED(doc)
|
||||
Q_UNUSED(element)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void SerializingObject::loadSettings( const QDomElement & /* _this*/ )
|
||||
void SerializingObject::loadSettings( const QDomElement& element )
|
||||
{
|
||||
Q_UNUSED(element)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -146,42 +146,6 @@ void engine::destroy()
|
||||
|
||||
|
||||
|
||||
void engine::updatePlayPauseIcons()
|
||||
{
|
||||
s_songEditor->setPauseIcon( false );
|
||||
s_automationEditor->setPauseIcon( false );
|
||||
s_bbEditor->setPauseIcon( false );
|
||||
s_pianoRoll->setPauseIcon( false );
|
||||
|
||||
if( s_song->isPlaying() )
|
||||
{
|
||||
switch( s_song->playMode() )
|
||||
{
|
||||
case song::Mode_PlaySong:
|
||||
s_songEditor->setPauseIcon( true );
|
||||
break;
|
||||
|
||||
case song::Mode_PlayAutomationPattern:
|
||||
s_automationEditor->setPauseIcon( true );
|
||||
break;
|
||||
|
||||
case song::Mode_PlayBB:
|
||||
s_bbEditor->setPauseIcon( true );
|
||||
break;
|
||||
|
||||
case song::Mode_PlayPattern:
|
||||
s_pianoRoll->setPauseIcon( true );
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void engine::updateFramesPerTick()
|
||||
{
|
||||
s_framesPerTick = s_mixer->processingSampleRate() * 60.0f * 4 /
|
||||
|
||||
@@ -181,10 +181,12 @@ int main( int argc, char * * argv )
|
||||
else if( argc > i+1 && ( QString( argv[i] ) == "--upgrade" ||
|
||||
QString( argv[i] ) == "-u" ) )
|
||||
{
|
||||
DataFile dataFile( QString( argv[i + 1] ) );
|
||||
QString inFile( argv[i + 1] );
|
||||
DataFile dataFile( inFile );
|
||||
if (argc > i+2)
|
||||
{
|
||||
dataFile.writeFile( argv[i + 2] );
|
||||
const QString outFile = argv[i + 2];
|
||||
dataFile.writeFile( outFile );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||