Merge remote-tracking branch 'origin/stable-0.4' into ghostPeakController
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
|
||||
#include "lmms_basics.h"
|
||||
#include "JournallingObject.h"
|
||||
#include "midi_time.h"
|
||||
#include "MidiTime.h"
|
||||
#include "AutomationPattern.h"
|
||||
#include "ComboBoxModel.h"
|
||||
|
||||
@@ -127,7 +127,7 @@ protected slots:
|
||||
void pasteValues();
|
||||
void deleteSelectedValues();
|
||||
|
||||
void updatePosition( const midiTime & _t );
|
||||
void updatePosition( const MidiTime & _t );
|
||||
|
||||
void zoomingXChanged();
|
||||
void zoomingYChanged();
|
||||
@@ -218,7 +218,7 @@ private:
|
||||
QScrollBar * m_leftRightScroll;
|
||||
QScrollBar * m_topBottomScroll;
|
||||
|
||||
midiTime m_currentPosition;
|
||||
MidiTime m_currentPosition;
|
||||
|
||||
actions m_action;
|
||||
|
||||
@@ -258,7 +258,7 @@ private:
|
||||
|
||||
signals:
|
||||
void currentPatternChanged();
|
||||
void positionChanged( const midiTime & );
|
||||
void positionChanged( const MidiTime & );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
|
||||
class AutomationTrack;
|
||||
class midiTime;
|
||||
class MidiTime;
|
||||
|
||||
|
||||
|
||||
@@ -72,12 +72,12 @@ public:
|
||||
}
|
||||
void setTension( QString _new_tension );
|
||||
|
||||
virtual midiTime length() const;
|
||||
virtual MidiTime length() const;
|
||||
|
||||
midiTime putValue( const midiTime & _time, const float _value,
|
||||
MidiTime putValue( const MidiTime & _time, const float _value,
|
||||
const bool _quant_pos = true );
|
||||
|
||||
void removeValue( const midiTime & _time );
|
||||
void removeValue( const MidiTime & _time );
|
||||
|
||||
inline const timeMap & getTimeMap() const
|
||||
{
|
||||
@@ -104,8 +104,8 @@ public:
|
||||
return m_timeMap.isEmpty() == false;
|
||||
}
|
||||
|
||||
float valueAt( const midiTime & _time ) const;
|
||||
float *valuesAfter( const midiTime & _time ) const;
|
||||
float valueAt( const MidiTime & _time ) const;
|
||||
float *valuesAfter( const MidiTime & _time ) const;
|
||||
|
||||
const QString name() const;
|
||||
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
return classNodeName();
|
||||
}
|
||||
|
||||
void processMidiTime( const midiTime & _time );
|
||||
void processMidiTime( const MidiTime & _time );
|
||||
|
||||
virtual trackContentObjectView * createView( trackView * _tv );
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
AutomationTrack( TrackContainer* tc, bool _hidden = false );
|
||||
virtual ~AutomationTrack();
|
||||
|
||||
virtual bool play( const midiTime & _start, const fpp_t _frames,
|
||||
virtual bool play( const MidiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 );
|
||||
|
||||
virtual QString nodeName() const
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
}
|
||||
|
||||
virtual trackView * createView( TrackContainerView* );
|
||||
virtual trackContentObject * createTCO( const midiTime & _pos );
|
||||
virtual trackContentObject * createTCO( const MidiTime & _pos );
|
||||
|
||||
virtual void saveTrackSpecificSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
|
||||
44
include/FileDialog.h
Normal file
44
include/FileDialog.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* FileDialog.h - declaration of class FileDialog
|
||||
*
|
||||
* Copyright (c) 2014 Lukas W <lukaswhl/at/gmail.com>
|
||||
*
|
||||
* 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 FILEDIALOG_H
|
||||
#define FILEDIALOG_H
|
||||
|
||||
#include <QtGui/QFileDialog>
|
||||
|
||||
#include "export.h"
|
||||
|
||||
class EXPORT FileDialog : public QFileDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit FileDialog( QWidget *parent = 0, const QString &caption = QString(),
|
||||
const QString &directory = QString(),
|
||||
const QString &filter = QString() );
|
||||
|
||||
void clearSelection();
|
||||
};
|
||||
|
||||
#endif // FILEDIALOG_HPP
|
||||
@@ -35,8 +35,8 @@
|
||||
// forward-declarations
|
||||
class InstrumentTrack;
|
||||
class InstrumentView;
|
||||
class midiEvent;
|
||||
class midiTime;
|
||||
class MidiEvent;
|
||||
class MidiTime;
|
||||
class notePlayHandle;
|
||||
class track;
|
||||
|
||||
@@ -99,9 +99,9 @@ public:
|
||||
|
||||
// sub-classes can re-implement this for receiving all incoming
|
||||
// MIDI-events
|
||||
inline virtual bool handleMidiEvent( const midiEvent &, const midiTime & )
|
||||
inline virtual bool handleMidiEvent( const MidiEvent&, const MidiTime& = MidiTime() )
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual QString fullDisplayName() const;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* InstrumentFunctionViews.h - views for instrument-functions-tab
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@@ -35,23 +35,23 @@ class groupBox;
|
||||
class knob;
|
||||
class TempoSyncKnob;
|
||||
|
||||
class Arpeggiator;
|
||||
class ChordCreator;
|
||||
class InstrumentFunctionArpeggio;
|
||||
class InstrumentFunctionNoteStacking;
|
||||
|
||||
|
||||
|
||||
class ChordCreatorView : public QWidget, public ModelView
|
||||
class InstrumentFunctionNoteStackingView : public QWidget, public ModelView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ChordCreatorView( ChordCreator * _cc, QWidget * _parent );
|
||||
virtual ~ChordCreatorView();
|
||||
InstrumentFunctionNoteStackingView( InstrumentFunctionNoteStacking* cc, QWidget* parent = NULL );
|
||||
virtual ~InstrumentFunctionNoteStackingView();
|
||||
|
||||
|
||||
private:
|
||||
virtual void modelChanged();
|
||||
|
||||
ChordCreator * m_cc;
|
||||
InstrumentFunctionNoteStacking * m_cc;
|
||||
|
||||
groupBox * m_chordsGroupBox;
|
||||
comboBox * m_chordsComboBox;
|
||||
@@ -63,26 +63,24 @@ private:
|
||||
|
||||
|
||||
|
||||
class ArpeggiatorView : public QWidget, public ModelView
|
||||
class InstrumentFunctionArpeggioView : public QWidget, public ModelView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ArpeggiatorView( Arpeggiator * _arp, QWidget * _parent );
|
||||
virtual ~ArpeggiatorView();
|
||||
InstrumentFunctionArpeggioView( InstrumentFunctionArpeggio* arp, QWidget* parent = NULL );
|
||||
virtual ~InstrumentFunctionArpeggioView();
|
||||
|
||||
|
||||
private:
|
||||
virtual void modelChanged();
|
||||
|
||||
Arpeggiator * m_a;
|
||||
InstrumentFunctionArpeggio * m_a;
|
||||
groupBox * m_arpGroupBox;
|
||||
comboBox * m_arpComboBox;
|
||||
knob * m_arpRangeKnob;
|
||||
TempoSyncKnob * m_arpTimeKnob;
|
||||
knob * m_arpGateKnob;
|
||||
|
||||
QLabel * m_arpDirectionLbl;
|
||||
|
||||
comboBox * m_arpDirectionComboBox;
|
||||
comboBox * m_arpModeComboBox;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class notePlayHandle;
|
||||
|
||||
|
||||
|
||||
class ChordCreator : public Model, public JournallingObject
|
||||
class InstrumentFunctionNoteStacking : public Model, public JournallingObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -48,8 +48,8 @@ private:
|
||||
typedef int8_t ChordSemiTones [MAX_CHORD_POLYPHONY];
|
||||
|
||||
public:
|
||||
ChordCreator( Model * _parent );
|
||||
virtual ~ChordCreator();
|
||||
InstrumentFunctionNoteStacking( Model * _parent );
|
||||
virtual ~InstrumentFunctionNoteStacking();
|
||||
|
||||
void processNote( notePlayHandle * _n );
|
||||
|
||||
@@ -149,14 +149,14 @@ private:
|
||||
FloatModel m_chordRangeModel;
|
||||
|
||||
|
||||
friend class ChordCreatorView;
|
||||
friend class InstrumentFunctionNoteStackingView;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
class Arpeggiator : public Model, public JournallingObject
|
||||
class InstrumentFunctionArpeggio : public Model, public JournallingObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -169,8 +169,8 @@ public:
|
||||
NumArpDirections
|
||||
} ;
|
||||
|
||||
Arpeggiator( Model * _parent );
|
||||
virtual ~Arpeggiator();
|
||||
InstrumentFunctionArpeggio( Model * _parent );
|
||||
virtual ~InstrumentFunctionArpeggio();
|
||||
|
||||
void processNote( notePlayHandle * _n );
|
||||
|
||||
@@ -203,7 +203,7 @@ private:
|
||||
|
||||
friend class FlpImport;
|
||||
friend class InstrumentTrack;
|
||||
friend class ArpeggiatorView;
|
||||
friend class InstrumentFunctionArpeggioView;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -34,13 +34,14 @@
|
||||
#include "note_play_handle.h"
|
||||
#include "Piano.h"
|
||||
#include "PianoView.h"
|
||||
#include "Pitch.h"
|
||||
#include "track.h"
|
||||
|
||||
|
||||
class QLineEdit;
|
||||
template<class T> class QQueue;
|
||||
class ArpeggiatorView;
|
||||
class ChordCreatorView;
|
||||
class InstrumentFunctionArpeggioView;
|
||||
class InstrumentFunctionNoteStackingView;
|
||||
class EffectRackView;
|
||||
class InstrumentSoundShapingView;
|
||||
class fadeButton;
|
||||
@@ -69,12 +70,10 @@ public:
|
||||
void processAudioBuffer( sampleFrame * _buf, const fpp_t _frames,
|
||||
notePlayHandle * _n );
|
||||
|
||||
midiEvent applyMasterKey( const midiEvent & _me );
|
||||
MidiEvent applyMasterKey( const MidiEvent& event );
|
||||
|
||||
virtual void processInEvent( const midiEvent & _me,
|
||||
const midiTime & _time );
|
||||
virtual void processOutEvent( const midiEvent & _me,
|
||||
const midiTime & _time );
|
||||
virtual void processInEvent( const MidiEvent& event, const MidiTime& time = MidiTime() );
|
||||
virtual void processOutEvent( const MidiEvent& event, const MidiTime& time = MidiTime() );
|
||||
// silence all running notes played by this track
|
||||
void silenceAllNotes();
|
||||
|
||||
@@ -113,17 +112,23 @@ public:
|
||||
// translate pitch to midi-pitch [0,16383]
|
||||
int midiPitch() const
|
||||
{
|
||||
return (int)( ( m_pitchModel.value()+100 ) * 16383 ) / 200;
|
||||
return static_cast<int>( ( ( m_pitchModel.value() + m_pitchModel.range()/2 ) * MidiMaxPitchBend ) / m_pitchModel.range() );
|
||||
}
|
||||
|
||||
/*! \brief Returns current range for pitch bend in semitones */
|
||||
int midiPitchRange() const
|
||||
{
|
||||
return m_pitchRangeModel.value();
|
||||
}
|
||||
|
||||
// play everything in given frame-range - creates note-play-handles
|
||||
virtual bool play( const midiTime & _start, const fpp_t _frames,
|
||||
virtual bool play( const MidiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 );
|
||||
// create new view for me
|
||||
virtual trackView * createView( TrackContainerView* tcv );
|
||||
|
||||
// create new track-content-object = pattern
|
||||
virtual trackContentObject * createTCO( const midiTime & _pos );
|
||||
virtual trackContentObject * createTCO( const MidiTime & _pos );
|
||||
|
||||
|
||||
// called by track
|
||||
@@ -162,9 +167,9 @@ public:
|
||||
return &m_piano;
|
||||
}
|
||||
|
||||
bool isArpeggiatorEnabled() const
|
||||
bool isArpeggioEnabled() const
|
||||
{
|
||||
return m_arpeggiator.m_arpEnabledModel.value();
|
||||
return m_arpeggio.m_arpEnabledModel.value();
|
||||
}
|
||||
|
||||
// simple helper for removing midiport-XML-node when loading presets
|
||||
@@ -199,8 +204,8 @@ public:
|
||||
signals:
|
||||
void instrumentChanged();
|
||||
void newNote();
|
||||
void noteOn( const note & _n );
|
||||
void noteOff( const note & _n );
|
||||
void midiNoteOn( const note& );
|
||||
void midiNoteOff( const note& );
|
||||
void nameChanged();
|
||||
|
||||
|
||||
@@ -238,8 +243,8 @@ private:
|
||||
|
||||
Instrument * m_instrument;
|
||||
InstrumentSoundShaping m_soundShaping;
|
||||
Arpeggiator m_arpeggiator;
|
||||
ChordCreator m_chordCreator;
|
||||
InstrumentFunctionArpeggio m_arpeggio;
|
||||
InstrumentFunctionNoteStacking m_noteStacking;
|
||||
|
||||
Piano m_piano;
|
||||
|
||||
@@ -402,8 +407,8 @@ private:
|
||||
tabWidget * m_tabWidget;
|
||||
PluginView * m_instrumentView;
|
||||
InstrumentSoundShapingView * m_ssView;
|
||||
ChordCreatorView * m_chordView;
|
||||
ArpeggiatorView * m_arpView;
|
||||
InstrumentFunctionNoteStackingView* m_noteStackingView;
|
||||
InstrumentFunctionArpeggioView* m_arpeggioView;
|
||||
InstrumentMidiIOView * m_midiView;
|
||||
EffectRackView * m_effectView;
|
||||
|
||||
|
||||
@@ -75,6 +75,8 @@ protected:
|
||||
|
||||
sample_t (*m_sampleFunction)( const float );
|
||||
|
||||
private:
|
||||
SampleBuffer * m_userDefSampleBuffer;
|
||||
|
||||
protected slots:
|
||||
void updateSampleFunction();
|
||||
@@ -107,6 +109,13 @@ protected:
|
||||
automatableButtonGroup * m_waveBtnGrp;
|
||||
automatableButtonGroup * m_multiplierBtnGrp;
|
||||
|
||||
|
||||
private:
|
||||
pixmapButton * m_userWaveBtn;
|
||||
|
||||
private slots:
|
||||
void askUserDefWave();
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -102,6 +102,7 @@ public slots:
|
||||
void openProject( void );
|
||||
bool saveProject( void );
|
||||
bool saveProjectAs( void );
|
||||
bool saveProjectAsNewVersion( void );
|
||||
void showSettingsDialog( void );
|
||||
void aboutLMMS( void );
|
||||
void help( void );
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* midi.h - constants, structs etc. concerning MIDI
|
||||
* Midi.h - constants, structs etc. concerning MIDI
|
||||
*
|
||||
* Copyright (c) 2005-2013 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
|
||||
*
|
||||
@@ -26,8 +26,6 @@
|
||||
#define _MIDI_H
|
||||
|
||||
#include "lmms_basics.h"
|
||||
#include "panning_constants.h"
|
||||
#include <cstdlib>
|
||||
|
||||
|
||||
enum MidiEventTypes
|
||||
@@ -60,7 +58,7 @@ enum MidiEventTypes
|
||||
MidiMetaEvent = 0xFF
|
||||
} ;
|
||||
|
||||
enum MidiMetaEvents
|
||||
enum MidiMetaEventTypes
|
||||
{
|
||||
MidiMetaInvalid = 0x00,
|
||||
MidiCopyright = 0x02,
|
||||
@@ -79,6 +77,7 @@ enum MidiMetaEvents
|
||||
MidiMetaCustom = 0x80,
|
||||
MidiNotePanning
|
||||
} ;
|
||||
typedef MidiMetaEventTypes MidiMetaEventType;
|
||||
|
||||
|
||||
enum MidiStandardControllers
|
||||
@@ -88,6 +87,7 @@ enum MidiStandardControllers
|
||||
MidiControllerBreathController = 2,
|
||||
MidiControllerFootController = 4,
|
||||
MidiControllerPortamentoTime = 5,
|
||||
MidiControllerDataEntry = 6,
|
||||
MidiControllerMainVolume = 7,
|
||||
MidiControllerBalance = 8,
|
||||
MidiControllerPan = 10,
|
||||
@@ -98,6 +98,8 @@ enum MidiStandardControllers
|
||||
MidiControllerSostenuto = 66,
|
||||
MidiControllerSoftPedal = 67,
|
||||
MidiControllerLegatoFootswitch = 68,
|
||||
MidiControllerRegisteredParameterNumberLSB = 100,
|
||||
MidiControllerRegisteredParameterNumberMSB = 101,
|
||||
// Channel Mode Messages are controllers too...
|
||||
MidiControllerAllSoundOff = 120,
|
||||
MidiControllerResetAllControllers = 121,
|
||||
@@ -110,6 +112,17 @@ enum MidiStandardControllers
|
||||
|
||||
};
|
||||
|
||||
enum MidiControllerRegisteredParameterNumbers
|
||||
{
|
||||
MidiPitchBendSensitivityRPN = 0x0000,
|
||||
MidiChannelFineTuningRPN = 0x0001,
|
||||
MidiChannelCoarseTuningRPN = 0x0002,
|
||||
MidiTuningProgramChangeRPN = 0x0003,
|
||||
MidiTuningBankSelectRPN = 0x0004,
|
||||
MidiModulationDepthRangeRPN = 0x0005,
|
||||
MidiNullFunctionNumberRPN = 0x7F7F
|
||||
};
|
||||
|
||||
const int MidiChannelCount = 16;
|
||||
const int MidiControllerCount = 128;
|
||||
const int MidiProgramCount = 128;
|
||||
@@ -120,139 +133,7 @@ const int MidiMaxNote = 127;
|
||||
const int MidiMaxPanning = 127;
|
||||
const int MidiMinPanning = -128;
|
||||
|
||||
|
||||
struct midiEvent
|
||||
{
|
||||
midiEvent( MidiEventTypes _type = MidiActiveSensing,
|
||||
int8_t _channel = 0,
|
||||
int16_t _param1 = 0,
|
||||
int16_t _param2 = 0,
|
||||
const void * _sourcePort = NULL ) :
|
||||
m_type( _type ),
|
||||
m_metaEvent( MidiMetaInvalid ),
|
||||
m_channel( _channel ),
|
||||
m_sysExData( NULL ),
|
||||
m_sourcePort( _sourcePort ),
|
||||
m_fromMidiPort( false )
|
||||
{
|
||||
m_data.m_param[0] = _param1;
|
||||
m_data.m_param[1] = _param2;
|
||||
}
|
||||
|
||||
midiEvent( MidiEventTypes _type, const char * _sysex_data,
|
||||
int _data_len ) :
|
||||
m_type( _type ),
|
||||
m_metaEvent( MidiMetaInvalid ),
|
||||
m_channel( 0 ),
|
||||
m_sysExData( _sysex_data ),
|
||||
m_sourcePort( NULL ),
|
||||
m_fromMidiPort( false )
|
||||
{
|
||||
m_data.m_sysExDataLen = _data_len;
|
||||
}
|
||||
|
||||
midiEvent( const midiEvent & _copy ) :
|
||||
m_type( _copy.m_type ),
|
||||
m_metaEvent( _copy.m_metaEvent ),
|
||||
m_channel( _copy.m_channel ),
|
||||
m_data( _copy.m_data ),
|
||||
m_sysExData( _copy.m_sysExData ),
|
||||
m_sourcePort( _copy.m_sourcePort ),
|
||||
m_fromMidiPort( _copy.m_fromMidiPort )
|
||||
{
|
||||
}
|
||||
|
||||
inline MidiEventTypes type() const
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
|
||||
inline int channel() const
|
||||
{
|
||||
return m_channel;
|
||||
}
|
||||
|
||||
inline int16_t key() const
|
||||
{
|
||||
return m_data.m_param[0];
|
||||
}
|
||||
|
||||
inline int16_t & key()
|
||||
{
|
||||
return m_data.m_param[0];
|
||||
}
|
||||
|
||||
inline uint8_t controllerNumber() const
|
||||
{
|
||||
return m_data.m_param[0];
|
||||
}
|
||||
|
||||
inline uint8_t controllerValue() const
|
||||
{
|
||||
return m_data.m_param[1];
|
||||
}
|
||||
|
||||
inline int16_t velocity() const
|
||||
{
|
||||
return m_data.m_param[1];
|
||||
}
|
||||
|
||||
inline int16_t & velocity()
|
||||
{
|
||||
return m_data.m_param[1];
|
||||
}
|
||||
|
||||
inline int16_t midiPanning() const
|
||||
{
|
||||
return m_data.m_param[1];
|
||||
}
|
||||
|
||||
inline volume_t getVolume() const
|
||||
{
|
||||
return (volume_t)( velocity() * 100 / MidiMaxVelocity );
|
||||
}
|
||||
|
||||
inline const void * sourcePort() const
|
||||
{
|
||||
return m_sourcePort;
|
||||
}
|
||||
|
||||
inline panning_t getPanning() const
|
||||
{
|
||||
return (panning_t) ( PanningLeft +
|
||||
( (float)( midiPanning() - MidiMinPanning ) ) /
|
||||
( (float)( MidiMaxPanning - MidiMinPanning ) ) *
|
||||
( (float)( PanningRight - PanningLeft ) ) );
|
||||
}
|
||||
|
||||
void setFromMidiPort( bool enabled )
|
||||
{
|
||||
m_fromMidiPort = enabled;
|
||||
}
|
||||
|
||||
bool isFromMidiPort() const
|
||||
{
|
||||
return m_fromMidiPort;
|
||||
}
|
||||
|
||||
MidiEventTypes m_type; // MIDI event type
|
||||
MidiMetaEvents m_metaEvent; // Meta event (mostly unused)
|
||||
int8_t m_channel; // MIDI channel
|
||||
union
|
||||
{
|
||||
int16_t m_param[2]; // first/second parameter (key/velocity)
|
||||
uint8_t m_bytes[4]; // raw bytes
|
||||
int32_t m_sysExDataLen; // len of m_sysExData
|
||||
} m_data;
|
||||
|
||||
const char * m_sysExData;
|
||||
const void * m_sourcePort;
|
||||
|
||||
|
||||
private:
|
||||
bool m_fromMidiPort;
|
||||
|
||||
} ;
|
||||
|
||||
const int MidiMinPitchBend = 0;
|
||||
const int MidiMaxPitchBend = 16383;
|
||||
|
||||
#endif
|
||||
@@ -62,8 +62,8 @@ public:
|
||||
|
||||
|
||||
|
||||
virtual void processOutEvent( const midiEvent & _me,
|
||||
const midiTime & _time,
|
||||
virtual void processOutEvent( const MidiEvent & _me,
|
||||
const MidiTime & _time,
|
||||
const MidiPort * _port );
|
||||
|
||||
virtual void applyPortMode( MidiPort * _port );
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
}
|
||||
|
||||
// return name of port which specified MIDI event came from
|
||||
virtual QString sourcePortName( const midiEvent & ) const;
|
||||
virtual QString sourcePortName( const MidiEvent & ) const;
|
||||
|
||||
// (un)subscribe given MidiPort to/from destination-port
|
||||
virtual void subscribeReadablePort( MidiPort * _port,
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <QtCore/QVector>
|
||||
|
||||
|
||||
#include "midi.h"
|
||||
#include "MidiEvent.h"
|
||||
#include "MidiEventProcessor.h"
|
||||
#include "tab_widget.h"
|
||||
|
||||
@@ -45,8 +45,8 @@ public:
|
||||
virtual ~MidiClient();
|
||||
|
||||
// to be implemented by sub-classes
|
||||
virtual void processOutEvent( const midiEvent & _me,
|
||||
const midiTime & _time,
|
||||
virtual void processOutEvent( const MidiEvent & _me,
|
||||
const MidiTime & _time,
|
||||
const MidiPort * _port ) = 0;
|
||||
|
||||
// inheriting classes can re-implement this for being able to update
|
||||
@@ -78,13 +78,13 @@ public:
|
||||
}
|
||||
|
||||
// return name of port which specified MIDI event came from
|
||||
virtual QString sourcePortName( const midiEvent & ) const
|
||||
virtual QString sourcePortName( const MidiEvent & ) const
|
||||
{
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
// (un)subscribe given MidiPort to/from destination-port
|
||||
// (un)subscribe given MidiPort to/from destination-port
|
||||
virtual void subscribeReadablePort( MidiPort * _port,
|
||||
const QString & _dest,
|
||||
bool _subscribe = true );
|
||||
@@ -167,7 +167,7 @@ protected:
|
||||
private:
|
||||
// this does MIDI-event-process
|
||||
void processParsedEvent();
|
||||
virtual void processOutEvent( const midiEvent& event, const midiTime& time, const MidiPort* port );
|
||||
virtual void processOutEvent( const MidiEvent& event, const MidiTime& time, const MidiPort* port );
|
||||
|
||||
// small helper function returning length of a certain event - this
|
||||
// is necessary for parsing raw-MIDI-data
|
||||
@@ -188,7 +188,7 @@ private:
|
||||
// event type include?
|
||||
uint32_t m_buffer[RAW_MIDI_PARSE_BUF_SIZE];
|
||||
// buffer for incoming data
|
||||
midiEvent m_midiEvent; // midi-event
|
||||
MidiEvent m_midiEvent; // midi-event
|
||||
} m_midiParseData;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -43,11 +43,11 @@ public:
|
||||
MidiController( Model * _parent );
|
||||
virtual ~MidiController();
|
||||
|
||||
virtual void processInEvent( const midiEvent & _me,
|
||||
const midiTime & _time );
|
||||
virtual void processInEvent( const MidiEvent & _me,
|
||||
const MidiTime & _time );
|
||||
|
||||
virtual void processOutEvent( const midiEvent& _me,
|
||||
const midiTime & _time)
|
||||
virtual void processOutEvent( const MidiEvent& _me,
|
||||
const MidiTime & _time)
|
||||
{
|
||||
// No output yet
|
||||
}
|
||||
|
||||
209
include/MidiEvent.h
Normal file
209
include/MidiEvent.h
Normal file
@@ -0,0 +1,209 @@
|
||||
/*
|
||||
* MidiEvent.h - MidiEvent class
|
||||
*
|
||||
* Copyright (c) 2005-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 _MIDI_EVENT_H
|
||||
#define _MIDI_EVENT_H
|
||||
|
||||
#include <cstdlib>
|
||||
#include "Midi.h"
|
||||
#include "panning_constants.h"
|
||||
|
||||
class MidiEvent
|
||||
{
|
||||
public:
|
||||
MidiEvent( MidiEventTypes type = MidiActiveSensing,
|
||||
int8_t channel = 0,
|
||||
int16_t param1 = 0,
|
||||
int16_t param2 = 0,
|
||||
const void* sourcePort = NULL ) :
|
||||
m_type( type ),
|
||||
m_metaEvent( MidiMetaInvalid ),
|
||||
m_channel( channel ),
|
||||
m_sysExData( NULL ),
|
||||
m_sourcePort( sourcePort )
|
||||
{
|
||||
m_data.m_param[0] = param1;
|
||||
m_data.m_param[1] = param2;
|
||||
}
|
||||
|
||||
MidiEvent( MidiEventTypes type, const char* sysExData, int dataLen ) :
|
||||
m_type( type ),
|
||||
m_metaEvent( MidiMetaInvalid ),
|
||||
m_channel( 0 ),
|
||||
m_sysExData( sysExData ),
|
||||
m_sourcePort( NULL )
|
||||
{
|
||||
m_data.m_sysExDataLen = dataLen;
|
||||
}
|
||||
|
||||
MidiEvent( const MidiEvent& other ) :
|
||||
m_type( other.m_type ),
|
||||
m_metaEvent( other.m_metaEvent ),
|
||||
m_channel( other.m_channel ),
|
||||
m_data( other.m_data ),
|
||||
m_sysExData( other.m_sysExData ),
|
||||
m_sourcePort( other.m_sourcePort )
|
||||
{
|
||||
}
|
||||
|
||||
MidiEventTypes type() const
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
|
||||
void setType( MidiEventTypes type )
|
||||
{
|
||||
m_type = type;
|
||||
}
|
||||
|
||||
void setMetaEvent( MidiMetaEventType metaEvent )
|
||||
{
|
||||
m_metaEvent = metaEvent;
|
||||
}
|
||||
|
||||
MidiMetaEventType metaEvent() const
|
||||
{
|
||||
return m_metaEvent;
|
||||
}
|
||||
|
||||
int8_t channel() const
|
||||
{
|
||||
return m_channel;
|
||||
}
|
||||
|
||||
void setChannel( int8_t channel )
|
||||
{
|
||||
m_channel = channel;
|
||||
}
|
||||
|
||||
int16_t param( int i ) const
|
||||
{
|
||||
return m_data.m_param[i];
|
||||
}
|
||||
|
||||
void setParam( int i, uint16_t value )
|
||||
{
|
||||
m_data.m_param[i] = value;
|
||||
}
|
||||
|
||||
int16_t key() const
|
||||
{
|
||||
return param( 0 );
|
||||
}
|
||||
|
||||
void setKey( int16_t key )
|
||||
{
|
||||
m_data.m_param[0] = key;
|
||||
}
|
||||
|
||||
uint8_t velocity() const
|
||||
{
|
||||
return m_data.m_param[1] & 0x7F;
|
||||
}
|
||||
|
||||
void setVelocity( int16_t velocity )
|
||||
{
|
||||
m_data.m_param[1] = velocity;
|
||||
}
|
||||
|
||||
panning_t panning() const
|
||||
{
|
||||
return (panning_t) ( PanningLeft +
|
||||
( (float)( midiPanning() - MidiMinPanning ) ) /
|
||||
( (float)( MidiMaxPanning - MidiMinPanning ) ) *
|
||||
( (float)( PanningRight - PanningLeft ) ) );
|
||||
}
|
||||
int16_t midiPanning() const
|
||||
{
|
||||
return m_data.m_param[1];
|
||||
}
|
||||
|
||||
volume_t volume() const
|
||||
{
|
||||
return (volume_t)( velocity() * 100 / MidiMaxVelocity );
|
||||
}
|
||||
|
||||
const void* sourcePort() const
|
||||
{
|
||||
return m_sourcePort;
|
||||
}
|
||||
|
||||
uint8_t controllerNumber() const
|
||||
{
|
||||
return param( 0 ) & 0x7F;
|
||||
}
|
||||
|
||||
void setControllerNumber( uint8_t num )
|
||||
{
|
||||
setParam( 0, num );
|
||||
}
|
||||
|
||||
uint8_t controllerValue() const
|
||||
{
|
||||
return param( 1 );
|
||||
}
|
||||
|
||||
void setControllerValue( uint8_t value )
|
||||
{
|
||||
setParam( 1, value );
|
||||
}
|
||||
|
||||
uint8_t program() const
|
||||
{
|
||||
return param( 0 );
|
||||
}
|
||||
|
||||
uint8_t channelPressure() const
|
||||
{
|
||||
return param( 0 );
|
||||
}
|
||||
|
||||
int16_t pitchBend() const
|
||||
{
|
||||
return param( 0 );
|
||||
}
|
||||
|
||||
void setPitchBend( uint16_t pitchBend )
|
||||
{
|
||||
setParam( 0, pitchBend );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
MidiEventTypes m_type; // MIDI event type
|
||||
MidiMetaEventType m_metaEvent; // Meta event (mostly unused)
|
||||
int8_t m_channel; // MIDI channel
|
||||
union
|
||||
{
|
||||
int16_t m_param[2]; // first/second parameter (key/velocity)
|
||||
uint8_t m_bytes[4]; // raw bytes
|
||||
int32_t m_sysExDataLen; // len of m_sysExData
|
||||
} m_data;
|
||||
|
||||
const char* m_sysExData;
|
||||
const void* m_sourcePort;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
@@ -25,27 +25,25 @@
|
||||
#ifndef _MIDI_EVENT_PROCESSOR_H
|
||||
#define _MIDI_EVENT_PROCESSOR_H
|
||||
|
||||
class midiEvent;
|
||||
class midiTime;
|
||||
#include "MidiEvent.h"
|
||||
#include "MidiTime.h"
|
||||
|
||||
|
||||
// all classes being able to process MIDI-events should inherit from this
|
||||
class MidiEventProcessor
|
||||
{
|
||||
public:
|
||||
inline MidiEventProcessor()
|
||||
MidiEventProcessor()
|
||||
{
|
||||
}
|
||||
|
||||
virtual inline ~MidiEventProcessor()
|
||||
virtual ~MidiEventProcessor()
|
||||
{
|
||||
}
|
||||
|
||||
// to be implemented by inheriting classes
|
||||
virtual void processInEvent( const midiEvent & _me,
|
||||
const midiTime & _time ) = 0;
|
||||
virtual void processOutEvent( const midiEvent & _me,
|
||||
const midiTime & _time ) = 0;
|
||||
virtual void processInEvent( const MidiEvent& event, const MidiTime& time = MidiTime() ) = 0;
|
||||
virtual void processOutEvent( const MidiEvent& event, const MidiTime& time = MidiTime() ) = 0;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* MidiPort.h - abstraction of MIDI ports which are part of LMMS's MIDI-
|
||||
* MidiPort.h - abstraction of MIDI ports which are part of LMMS' MIDI
|
||||
* sequencing system
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@@ -28,16 +28,17 @@
|
||||
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QPair>
|
||||
#include <QtCore/QMap>
|
||||
|
||||
#include "midi.h"
|
||||
#include "Midi.h"
|
||||
#include "MidiTime.h"
|
||||
#include "AutomatableModel.h"
|
||||
|
||||
|
||||
class MidiClient;
|
||||
class MidiEvent;
|
||||
class MidiEventProcessor;
|
||||
class MidiPortMenu;
|
||||
class midiTime;
|
||||
|
||||
|
||||
// class for abstraction of MIDI-port
|
||||
@@ -72,67 +73,66 @@ public:
|
||||
Output, // from MIDI-event-processor to MIDI-client
|
||||
Duplex // both directions
|
||||
} ;
|
||||
typedef Modes Mode;
|
||||
|
||||
MidiPort( const QString & _name,
|
||||
MidiClient * _mc,
|
||||
MidiEventProcessor * _mep,
|
||||
Model * _parent = NULL,
|
||||
Modes _mode = Disabled );
|
||||
MidiPort( const QString& name,
|
||||
MidiClient* client,
|
||||
MidiEventProcessor* eventProcessor,
|
||||
Model* parent = NULL,
|
||||
Mode mode = Disabled );
|
||||
virtual ~MidiPort();
|
||||
|
||||
void setName( const QString & _name );
|
||||
void setName( const QString& name );
|
||||
|
||||
inline Modes mode() const
|
||||
Mode mode() const
|
||||
{
|
||||
return m_mode;
|
||||
}
|
||||
|
||||
void setMode( Modes _mode );
|
||||
void setMode( Mode mode );
|
||||
|
||||
inline bool inputEnabled() const
|
||||
bool isInputEnabled() const
|
||||
{
|
||||
return mode() == Input || mode() == Duplex;
|
||||
}
|
||||
|
||||
inline bool outputEnabled() const
|
||||
bool isOutputEnabled() const
|
||||
{
|
||||
return mode() == Output || mode() == Duplex;
|
||||
}
|
||||
|
||||
inline int realOutputChannel() const
|
||||
int realOutputChannel() const
|
||||
{
|
||||
return outputChannel() - 1;
|
||||
}
|
||||
|
||||
void processInEvent( const midiEvent & _me, const midiTime & _time );
|
||||
void processOutEvent( const midiEvent & _me, const midiTime & _time );
|
||||
void processInEvent( const MidiEvent& event, const MidiTime& time = MidiTime() );
|
||||
void processOutEvent( const MidiEvent& event, const MidiTime& time = MidiTime() );
|
||||
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
virtual void saveSettings( QDomDocument& doc, QDomElement& thisElement );
|
||||
virtual void loadSettings( const QDomElement& thisElement );
|
||||
|
||||
virtual QString nodeName() const
|
||||
{
|
||||
return "midiport";
|
||||
}
|
||||
|
||||
void subscribeReadablePort( const QString & _port,
|
||||
bool _subscribe = true );
|
||||
void subscribeWritablePort( const QString & _port,
|
||||
bool _subscribe = true );
|
||||
void subscribeReadablePort( const QString& port, bool subscribe = true );
|
||||
void subscribeWritablePort( const QString& port, bool subscribe = true );
|
||||
|
||||
const Map & readablePorts() const
|
||||
const Map& readablePorts() const
|
||||
{
|
||||
return m_readablePorts;
|
||||
}
|
||||
|
||||
const Map & writablePorts() const
|
||||
const Map& writablePorts() const
|
||||
{
|
||||
return m_writablePorts;
|
||||
}
|
||||
|
||||
MidiPortMenu * m_readablePortsMenu;
|
||||
MidiPortMenu * m_writablePortsMenu;
|
||||
MidiPortMenu* m_readablePortsMenu;
|
||||
MidiPortMenu* m_writablePortsMenu;
|
||||
|
||||
|
||||
public slots:
|
||||
@@ -146,10 +146,10 @@ private slots:
|
||||
|
||||
|
||||
private:
|
||||
MidiClient * m_midiClient;
|
||||
MidiEventProcessor * m_midiEventProcessor;
|
||||
MidiClient* m_midiClient;
|
||||
MidiEventProcessor* m_midiEventProcessor;
|
||||
|
||||
Modes m_mode;
|
||||
Mode m_mode;
|
||||
|
||||
IntModel m_inputChannelModel;
|
||||
IntModel m_outputChannelModel;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* midi_time.h - declaration of class midiTime which provides data-type for
|
||||
* position- and length-variables
|
||||
* MidiTime.h - declaration of class MidiTime which provides data type for
|
||||
* position- and length-variables
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@@ -35,25 +35,25 @@ const int DefaultStepsPerTact = 16;
|
||||
const int DefaultBeatsPerTact = DefaultTicksPerTact / DefaultStepsPerTact;
|
||||
|
||||
|
||||
class EXPORT midiTime
|
||||
class EXPORT MidiTime
|
||||
{
|
||||
public:
|
||||
inline midiTime( const tact_t _tact, const tick_t _ticks ) :
|
||||
m_ticks( _tact * s_ticksPerTact + _ticks )
|
||||
MidiTime( const tact_t tact, const tick_t ticks ) :
|
||||
m_ticks( tact * s_ticksPerTact + ticks )
|
||||
{
|
||||
}
|
||||
|
||||
inline midiTime( const tick_t _ticks = 0 ) :
|
||||
m_ticks( _ticks )
|
||||
MidiTime( const tick_t ticks = 0 ) :
|
||||
m_ticks( ticks )
|
||||
{
|
||||
}
|
||||
|
||||
inline midiTime( const midiTime & _t ) :
|
||||
m_ticks( _t.m_ticks )
|
||||
MidiTime( const MidiTime& time ) :
|
||||
m_ticks( time.m_ticks )
|
||||
{
|
||||
}
|
||||
|
||||
inline midiTime toNearestTact() const
|
||||
MidiTime toNearestTact() const
|
||||
{
|
||||
if( m_ticks % s_ticksPerTact >= s_ticksPerTact/2 )
|
||||
{
|
||||
@@ -62,30 +62,30 @@ public:
|
||||
return getTact() * s_ticksPerTact;
|
||||
}
|
||||
|
||||
inline midiTime & operator=( const midiTime & _t )
|
||||
MidiTime& operator=( const MidiTime& time )
|
||||
{
|
||||
m_ticks = _t.m_ticks;
|
||||
m_ticks = time.m_ticks;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline midiTime & operator+=( const midiTime & _t )
|
||||
MidiTime& operator+=( const MidiTime& time )
|
||||
{
|
||||
m_ticks += _t.m_ticks;
|
||||
m_ticks += time.m_ticks;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline midiTime & operator-=( const midiTime & _t )
|
||||
MidiTime& operator-=( const MidiTime& time )
|
||||
{
|
||||
m_ticks -= _t.m_ticks;
|
||||
m_ticks -= time.m_ticks;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline tact_t getTact() const
|
||||
tact_t getTact() const
|
||||
{
|
||||
return m_ticks / s_ticksPerTact;
|
||||
}
|
||||
|
||||
inline tact_t nextFullTact() const
|
||||
tact_t nextFullTact() const
|
||||
{
|
||||
if( m_ticks % s_ticksPerTact == 0 )
|
||||
{
|
||||
@@ -94,37 +94,34 @@ public:
|
||||
return m_ticks / s_ticksPerTact + 1;
|
||||
}
|
||||
|
||||
inline void setTicks( tick_t _t )
|
||||
void setTicks( tick_t ticks )
|
||||
{
|
||||
m_ticks = _t;
|
||||
m_ticks = ticks;
|
||||
}
|
||||
|
||||
inline tick_t getTicks() const
|
||||
tick_t getTicks() const
|
||||
{
|
||||
return m_ticks;
|
||||
}
|
||||
|
||||
inline operator int() const
|
||||
operator int() const
|
||||
{
|
||||
return m_ticks;
|
||||
}
|
||||
|
||||
// calculate number of frame that are needed this time
|
||||
inline f_cnt_t frames( const float _frames_per_tick ) const
|
||||
f_cnt_t frames( const float framesPerTick ) const
|
||||
{
|
||||
if( m_ticks >= 0 )
|
||||
{
|
||||
return static_cast<f_cnt_t>( m_ticks *
|
||||
_frames_per_tick );
|
||||
return static_cast<f_cnt_t>( m_ticks * framesPerTick );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline midiTime fromFrames( const f_cnt_t _frames,
|
||||
const float _frames_per_tick )
|
||||
static MidiTime fromFrames( const f_cnt_t frames, const float framesPerTick )
|
||||
{
|
||||
return midiTime( static_cast<int>( _frames /
|
||||
_frames_per_tick ) );
|
||||
return MidiTime( static_cast<int>( frames / framesPerTick ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -143,6 +140,7 @@ public:
|
||||
s_ticksPerTact = _tpt;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
tick_t m_ticks;
|
||||
|
||||
@@ -56,8 +56,8 @@ public:
|
||||
|
||||
|
||||
|
||||
virtual void processOutEvent( const midiEvent & _me,
|
||||
const midiTime & _time,
|
||||
virtual void processOutEvent( const MidiEvent & _me,
|
||||
const MidiTime & _time,
|
||||
const MidiPort * _port );
|
||||
|
||||
virtual void applyPortMode( MidiPort * _port );
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
#endif
|
||||
|
||||
// return name of port which specified MIDI event came from
|
||||
virtual QString sourcePortName( const midiEvent & ) const;
|
||||
virtual QString sourcePortName( const MidiEvent & ) const;
|
||||
|
||||
// (un)subscribe given MidiPort to/from destination-port
|
||||
virtual void subscribeReadablePort( MidiPort * _port,
|
||||
|
||||
38
include/Pitch.h
Normal file
38
include/Pitch.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Pitch.h - declaration of some constants and types concerning instrument pitch
|
||||
*
|
||||
* Copyright (c) 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 _PITCH_H
|
||||
#define _PITCH_H
|
||||
|
||||
#include "lmms_basics.h"
|
||||
#include "Midi.h"
|
||||
|
||||
typedef int16_t pitch_t;
|
||||
|
||||
const pitch_t CentsPerSemitone = 100;
|
||||
const pitch_t MinPitchDefault = -CentsPerSemitone;
|
||||
const pitch_t MaxPitchDefault = CentsPerSemitone;
|
||||
const pitch_t DefaultPitch = 0;
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* RemotePlugin.h - base class providing RPC like mechanisms
|
||||
*
|
||||
* Copyright (c) 2008-2012 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
|
||||
*
|
||||
@@ -26,7 +26,7 @@
|
||||
#define _REMOTE_PLUGIN_H
|
||||
|
||||
#include "export.h"
|
||||
#include "midi.h"
|
||||
#include "MidiEvent.h"
|
||||
#include "VST_sync_shm.h"
|
||||
|
||||
#include <vector>
|
||||
@@ -724,7 +724,7 @@ public:
|
||||
|
||||
bool process( const sampleFrame * _in_buf, sampleFrame * _out_buf );
|
||||
|
||||
void processMidiEvent( const midiEvent &, const f_cnt_t _offset );
|
||||
void processMidiEvent( const MidiEvent&, const f_cnt_t _offset );
|
||||
|
||||
void updateSampleRate( sample_rate_t _sr )
|
||||
{
|
||||
@@ -820,8 +820,7 @@ public:
|
||||
virtual void process( const sampleFrame * _in_buf,
|
||||
sampleFrame * _out_buf ) = 0;
|
||||
|
||||
virtual void processMidiEvent( const midiEvent &,
|
||||
const f_cnt_t /* _offset */ )
|
||||
virtual void processMidiEvent( const MidiEvent&, const f_cnt_t /* _offset */ )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1120,7 +1119,7 @@ bool RemotePluginClient::processMessage( const message & _m )
|
||||
|
||||
case IdMidiEvent:
|
||||
processMidiEvent(
|
||||
midiEvent( static_cast<MidiEventTypes>(
|
||||
MidiEvent( static_cast<MidiEventTypes>(
|
||||
_m.getInt( 0 ) ),
|
||||
_m.getInt( 1 ),
|
||||
_m.getInt( 2 ),
|
||||
|
||||
@@ -172,7 +172,8 @@ public:
|
||||
return m_data;
|
||||
}
|
||||
|
||||
QString openAudioFile() const;
|
||||
QString openAudioFile() const;
|
||||
QString openAndSetAudioFile();
|
||||
|
||||
QString & toBase64( QString & _dst ) const;
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ private:
|
||||
typedef QList<QPair<sampleFrame *, f_cnt_t> > bufferList;
|
||||
bufferList m_buffers;
|
||||
f_cnt_t m_framesRecorded;
|
||||
midiTime m_minLength;
|
||||
MidiTime m_minLength;
|
||||
|
||||
track * m_track;
|
||||
bbTrack * m_bbTrack;
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
SampleTCO( track * _track );
|
||||
virtual ~SampleTCO();
|
||||
|
||||
virtual void changeLength( const midiTime & _length );
|
||||
virtual void changeLength( const MidiTime & _length );
|
||||
const QString & sampleFile() const;
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
return m_sampleBuffer;
|
||||
}
|
||||
|
||||
midiTime sampleLength() const;
|
||||
MidiTime sampleLength() const;
|
||||
|
||||
virtual trackContentObjectView * createView( trackView * _tv );
|
||||
|
||||
@@ -121,10 +121,10 @@ public:
|
||||
SampleTrack( TrackContainer* tc );
|
||||
virtual ~SampleTrack();
|
||||
|
||||
virtual bool play( const midiTime & _start, const fpp_t _frames,
|
||||
virtual bool play( const MidiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 );
|
||||
virtual trackView * createView( TrackContainerView* tcv );
|
||||
virtual trackContentObject * createTCO( const midiTime & _pos );
|
||||
virtual trackContentObject * createTCO( const MidiTime & _pos );
|
||||
|
||||
|
||||
virtual void saveTrackSpecificSettings( QDomDocument & _doc,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* TempoSyncKnob.h - adds bpm to ms conversion for knob class
|
||||
*
|
||||
* Copyright (c) 2005-2008 Danny McRae <khjklujn/at/yahoo.com>
|
||||
* Copyright (c) 2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2009-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -38,8 +38,7 @@ class EXPORT TempoSyncKnob : public knob
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TempoSyncKnob( int _knob_num, QWidget * _parent,
|
||||
const QString & _name = QString() );
|
||||
TempoSyncKnob( int knobNum, QWidget* parent = NULL, const QString& name = QString() );
|
||||
virtual ~TempoSyncKnob();
|
||||
|
||||
const QString & syncDescription();
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
return( m_scrollArea );
|
||||
}
|
||||
|
||||
inline const midiTime & currentPosition() const
|
||||
inline const MidiTime & currentPosition() const
|
||||
{
|
||||
return( m_currentPosition );
|
||||
}
|
||||
@@ -142,7 +142,7 @@ protected:
|
||||
virtual void undoStep( JournalEntry & _je );
|
||||
virtual void redoStep( JournalEntry & _je );
|
||||
|
||||
midiTime m_currentPosition;
|
||||
MidiTime m_currentPosition;
|
||||
|
||||
|
||||
private:
|
||||
@@ -180,7 +180,7 @@ private:
|
||||
|
||||
|
||||
signals:
|
||||
void positionChanged( const midiTime & _pos );
|
||||
void positionChanged( const MidiTime & _pos );
|
||||
|
||||
|
||||
} ;
|
||||
|
||||
53
include/VersionedSaveDialog.h
Normal file
53
include/VersionedSaveDialog.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* VersionedSaveDialog.h - declaration of class VersionedSaveDialog, a file save
|
||||
* dialog that provides buttons to increment or decrement a version which is
|
||||
* appended to the file name. (e.g. "MyProject-01.mmpz")
|
||||
*
|
||||
* Copyright (c) 2014 Lukas W <lukaswhl/at/gmail.com>
|
||||
*
|
||||
* 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 VERSIONEDSAVEDIALOG_H
|
||||
#define VERSIONEDSAVEDIALOG_H
|
||||
|
||||
#include "FileDialog.h"
|
||||
|
||||
class QLineEdit;
|
||||
|
||||
|
||||
class VersionedSaveDialog : public FileDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit VersionedSaveDialog( QWidget *parent = 0,
|
||||
const QString &caption = QString(),
|
||||
const QString &directory = QString(),
|
||||
const QString &filter = QString() );
|
||||
|
||||
// Returns true if file name was changed, returns false if it wasn't
|
||||
static bool changeFileNameVersion( QString &fileName, bool increment );
|
||||
|
||||
public slots:
|
||||
void incrementVersion();
|
||||
void decrementVersion();
|
||||
};
|
||||
|
||||
#endif // VERSIONEDSAVEDIALOG_H
|
||||
@@ -175,7 +175,7 @@ public:
|
||||
// 04
|
||||
void *reserved;
|
||||
// 08
|
||||
VstEvent * events[];
|
||||
VstEvent* events[1];
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -109,10 +109,10 @@ public:
|
||||
bbTrack( TrackContainer* tc );
|
||||
virtual ~bbTrack();
|
||||
|
||||
virtual bool play( const midiTime & _start, const fpp_t _frames,
|
||||
virtual bool play( const MidiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 );
|
||||
virtual trackView * createView( TrackContainerView* tcv );
|
||||
virtual trackContentObject * createTCO( const midiTime & _pos );
|
||||
virtual trackContentObject * createTCO( const MidiTime & _pos );
|
||||
|
||||
virtual void saveTrackSpecificSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
bbTrackContainer();
|
||||
virtual ~bbTrackContainer();
|
||||
|
||||
virtual bool play( midiTime _start, const fpp_t _frames,
|
||||
virtual bool play( MidiTime _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 );
|
||||
|
||||
virtual void updateAfterTrackAdd();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* combobox.h - class comboBox, a very cool combo-box
|
||||
* combobox.h - class ComboBox, a combo box view for models
|
||||
*
|
||||
* Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -38,31 +38,33 @@ class EXPORT comboBox : public QWidget, public IntModelView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
comboBox( QWidget * _parent, const QString & _name = QString() );
|
||||
comboBox( QWidget* parent = NULL, const QString& name = QString() );
|
||||
virtual ~comboBox();
|
||||
|
||||
ComboBoxModel * model()
|
||||
ComboBoxModel* model()
|
||||
{
|
||||
return( castModel<ComboBoxModel>() );
|
||||
return castModel<ComboBoxModel>();
|
||||
}
|
||||
|
||||
const ComboBoxModel * model() const
|
||||
const ComboBoxModel* model() const
|
||||
{
|
||||
return( castModel<ComboBoxModel>() );
|
||||
return castModel<ComboBoxModel>();
|
||||
}
|
||||
|
||||
virtual QSize sizeHint() const;
|
||||
|
||||
|
||||
protected:
|
||||
virtual void contextMenuEvent( QContextMenuEvent * _me );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void wheelEvent( QWheelEvent * _we );
|
||||
virtual void contextMenuEvent( QContextMenuEvent* event );
|
||||
virtual void mousePressEvent( QMouseEvent* event );
|
||||
virtual void paintEvent( QPaintEvent* event );
|
||||
virtual void wheelEvent( QWheelEvent* event );
|
||||
|
||||
|
||||
private:
|
||||
static QPixmap * s_background;
|
||||
static QPixmap * s_arrow;
|
||||
static QPixmap * s_arrowSelected;
|
||||
static QPixmap* s_background;
|
||||
static QPixmap* s_arrow;
|
||||
static QPixmap* s_arrowSelected;
|
||||
|
||||
QMenu m_menu;
|
||||
|
||||
@@ -70,7 +72,7 @@ private:
|
||||
|
||||
|
||||
private slots:
|
||||
void setItem( QAction * _item );
|
||||
void setItem( QAction* item );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -31,10 +31,12 @@
|
||||
// set whether debug-stuff (like messages on the console, asserts and other
|
||||
// additional range-checkings) should be compiled
|
||||
|
||||
/*#ifdef LMMS_DEBUG*/
|
||||
#include <assert.h>
|
||||
#ifdef LMMS_DEBUG
|
||||
#include <assert.h>
|
||||
#else
|
||||
#define assert(x) ((void)(x))
|
||||
#endif
|
||||
#include <cstdio>
|
||||
/*#endif*/
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -151,7 +151,7 @@ public slots:
|
||||
void setWaveToSaw();
|
||||
void setWaveToSquare();
|
||||
void setWaveToNoise();
|
||||
//void setWaveToUser( );
|
||||
QString setWaveToUser( );
|
||||
|
||||
void smooth();
|
||||
void normalize();
|
||||
|
||||
@@ -60,7 +60,7 @@ class EXPORT knob : public QWidget, public FloatModelView
|
||||
Q_PROPERTY(QColor outerColor READ outerColor WRITE setOuterColor)
|
||||
mapPropertyFromModel(bool,isVolumeKnob,setVolumeKnob,m_volumeKnob);
|
||||
public:
|
||||
knob( int _knob_num, QWidget * _parent, const QString & _name = QString() );
|
||||
knob( int _knob_num, QWidget * _parent = NULL, const QString & _name = QString() );
|
||||
virtual ~knob();
|
||||
|
||||
// TODO: remove
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#include "volume.h"
|
||||
#include "panning.h"
|
||||
#include "midi_time.h"
|
||||
#include "MidiTime.h"
|
||||
#include "SerializingObject.h"
|
||||
|
||||
class DetuningHelper;
|
||||
@@ -81,8 +81,8 @@ const float MaxDetuning = 4 * 12.0f;
|
||||
class EXPORT note : public SerializingObject
|
||||
{
|
||||
public:
|
||||
note( const midiTime & _length = midiTime( 0 ),
|
||||
const midiTime & _pos = midiTime( 0 ),
|
||||
note( const MidiTime & _length = MidiTime( 0 ),
|
||||
const MidiTime & _pos = MidiTime( 0 ),
|
||||
int key = DefaultKey,
|
||||
volume_t _volume = DefaultVolume,
|
||||
panning_t _panning = DefaultPanning,
|
||||
@@ -93,8 +93,8 @@ public:
|
||||
// used by GUI
|
||||
inline void setSelected( const bool _selected ){ m_selected = _selected; }
|
||||
inline void setOldKey( const int _oldKey ){ m_oldKey = _oldKey; }
|
||||
inline void setOldPos( const midiTime & _oldPos ){ m_oldPos = _oldPos; }
|
||||
inline void setOldLength( const midiTime & _oldLength )
|
||||
inline void setOldPos( const MidiTime & _oldPos ){ m_oldPos = _oldPos; }
|
||||
inline void setOldLength( const MidiTime & _oldLength )
|
||||
{
|
||||
m_oldLength = _oldLength;
|
||||
}
|
||||
@@ -104,11 +104,11 @@ public:
|
||||
}
|
||||
|
||||
|
||||
void setLength( const midiTime & _length );
|
||||
void setPos( const midiTime & _pos );
|
||||
void setLength( const MidiTime & _length );
|
||||
void setPos( const MidiTime & _pos );
|
||||
void setKey( const int _key );
|
||||
virtual void setVolume( const volume_t _volume = DefaultVolume );
|
||||
void setPanning( const panning_t _panning = DefaultPanning );
|
||||
virtual void setVolume( const volume_t volume = DefaultVolume );
|
||||
virtual void setPanning( const panning_t panning = DefaultPanning );
|
||||
void quantizeLength( const int _q_grid );
|
||||
void quantizePos( const int _q_grid );
|
||||
|
||||
@@ -129,12 +129,12 @@ public:
|
||||
return m_oldKey;
|
||||
}
|
||||
|
||||
inline midiTime oldPos() const
|
||||
inline MidiTime oldPos() const
|
||||
{
|
||||
return m_oldPos;
|
||||
}
|
||||
|
||||
inline midiTime oldLength() const
|
||||
inline MidiTime oldLength() const
|
||||
{
|
||||
return m_oldLength;
|
||||
}
|
||||
@@ -144,23 +144,23 @@ public:
|
||||
return m_isPlaying;
|
||||
}
|
||||
|
||||
inline midiTime endPos() const
|
||||
inline MidiTime endPos() const
|
||||
{
|
||||
const int l = length();
|
||||
return pos() + l;
|
||||
}
|
||||
|
||||
inline const midiTime & length() const
|
||||
inline const MidiTime & length() const
|
||||
{
|
||||
return m_length;
|
||||
}
|
||||
|
||||
inline const midiTime & pos() const
|
||||
inline const MidiTime & pos() const
|
||||
{
|
||||
return m_pos;
|
||||
}
|
||||
|
||||
inline midiTime pos( midiTime _base_pos ) const
|
||||
inline MidiTime pos( MidiTime _base_pos ) const
|
||||
{
|
||||
const int bp = _base_pos;
|
||||
return m_pos - bp;
|
||||
@@ -191,7 +191,7 @@ public:
|
||||
return classNodeName();
|
||||
}
|
||||
|
||||
static midiTime quantized( const midiTime & _m, const int _q_grid );
|
||||
static MidiTime quantized( const MidiTime & _m, const int _q_grid );
|
||||
|
||||
DetuningHelper * detuning() const
|
||||
{
|
||||
@@ -226,15 +226,15 @@ private:
|
||||
// for piano roll editing
|
||||
bool m_selected;
|
||||
int m_oldKey;
|
||||
midiTime m_oldPos;
|
||||
midiTime m_oldLength;
|
||||
MidiTime m_oldPos;
|
||||
MidiTime m_oldLength;
|
||||
bool m_isPlaying;
|
||||
|
||||
int m_key;
|
||||
volume_t m_volume;
|
||||
panning_t m_panning;
|
||||
midiTime m_length;
|
||||
midiTime m_pos;
|
||||
MidiTime m_length;
|
||||
MidiTime m_pos;
|
||||
DetuningHelper * m_detuning;
|
||||
|
||||
void createDetuning();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* note_play_handle.h - declaration of class notePlayHandle which is needed
|
||||
* by LMMS-Play-Engine
|
||||
*
|
||||
* Copyright (c) 2004-2012 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
|
||||
*
|
||||
@@ -48,17 +48,33 @@ public:
|
||||
void * m_pluginData;
|
||||
basicFilters<> * m_filter;
|
||||
|
||||
// specifies origin of NotePlayHandle
|
||||
enum Origins
|
||||
{
|
||||
OriginPattern, /*! playback of a note from a pattern */
|
||||
OriginMidiInput, /*! playback of a MIDI note input event */
|
||||
OriginCount
|
||||
};
|
||||
typedef Origins Origin;
|
||||
|
||||
notePlayHandle( InstrumentTrack * _instrument_track,
|
||||
const f_cnt_t _offset,
|
||||
const f_cnt_t _frames, const note & _n,
|
||||
notePlayHandle * _parent = NULL,
|
||||
const bool _part_of_arp = false );
|
||||
const bool _part_of_arp = false,
|
||||
int midiEventChannel = -1,
|
||||
Origin origin = OriginPattern );
|
||||
virtual ~notePlayHandle();
|
||||
|
||||
virtual void setVolume( const volume_t _volume = DefaultVolume );
|
||||
virtual void setVolume( const volume_t volume = DefaultVolume );
|
||||
virtual void setPanning( const panning_t panning = DefaultPanning );
|
||||
|
||||
int midiVelocity() const;
|
||||
int midiKey() const;
|
||||
int midiChannel() const
|
||||
{
|
||||
return m_midiChannel;
|
||||
}
|
||||
|
||||
const float & frequency() const
|
||||
{
|
||||
@@ -189,15 +205,15 @@ public:
|
||||
m_bbTrack = _bb_track;
|
||||
}
|
||||
|
||||
void processMidiTime( const midiTime & _time );
|
||||
void processMidiTime( const MidiTime & _time );
|
||||
void resize( const bpm_t _new_tempo );
|
||||
|
||||
void setSongGlobalParentOffset( const midiTime &offset )
|
||||
void setSongGlobalParentOffset( const MidiTime &offset )
|
||||
{
|
||||
m_songGlobalParentOffset = offset;
|
||||
}
|
||||
|
||||
const midiTime &songGlobalParentOffset() const
|
||||
const MidiTime &songGlobalParentOffset() const
|
||||
{
|
||||
return m_songGlobalParentOffset;
|
||||
}
|
||||
@@ -266,13 +282,16 @@ private:
|
||||
bpm_t m_origTempo; // original tempo
|
||||
f_cnt_t m_origFrames; // original m_frames
|
||||
|
||||
int m_origBaseNote;
|
||||
const int m_origBaseNote;
|
||||
|
||||
float m_frequency;
|
||||
float m_unpitchedFrequency;
|
||||
|
||||
BaseDetuning * m_baseDetuning;
|
||||
midiTime m_songGlobalParentOffset;
|
||||
MidiTime m_songGlobalParentOffset;
|
||||
|
||||
const int m_midiChannel;
|
||||
const Origin m_origin;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* panning.h - declaration of some types, concerning the
|
||||
* panning of a note
|
||||
*
|
||||
* 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,7 +30,7 @@
|
||||
#include "volume.h"
|
||||
#include "templates.h"
|
||||
#include "panning_constants.h"
|
||||
#include "midi.h"
|
||||
#include "Midi.h"
|
||||
|
||||
inline stereoVolumeVector panningToVolumeVector( panning_t _p,
|
||||
float _scale = 1.0f )
|
||||
|
||||
@@ -64,8 +64,8 @@ public:
|
||||
void init();
|
||||
|
||||
|
||||
virtual midiTime length() const;
|
||||
midiTime beatPatternLength() const;
|
||||
virtual MidiTime length() const;
|
||||
MidiTime beatPatternLength() const;
|
||||
|
||||
// note management
|
||||
note * addNote( const note & _new_note, const bool _quant_pos = true );
|
||||
|
||||
@@ -135,8 +135,8 @@ protected slots:
|
||||
void pasteNotes();
|
||||
void deleteSelectedNotes();
|
||||
|
||||
void updatePosition( const midiTime & _t );
|
||||
void updatePositionAccompany( const midiTime & _t );
|
||||
void updatePosition( const MidiTime & _t );
|
||||
void updatePositionAccompany( const MidiTime & _t );
|
||||
|
||||
void zoomingChanged();
|
||||
void quantizeChanged();
|
||||
@@ -203,9 +203,9 @@ private:
|
||||
pianoRoll( const pianoRoll & );
|
||||
virtual ~pianoRoll();
|
||||
|
||||
void autoScroll( const midiTime & _t );
|
||||
void autoScroll( const MidiTime & _t );
|
||||
|
||||
midiTime newNoteLen() const;
|
||||
MidiTime newNoteLen() const;
|
||||
|
||||
void shiftPos(int amount);
|
||||
void shiftSemiTone(int amount);
|
||||
@@ -276,7 +276,7 @@ private:
|
||||
QScrollBar * m_leftRightScroll;
|
||||
QScrollBar * m_topBottomScroll;
|
||||
|
||||
midiTime m_currentPosition;
|
||||
MidiTime m_currentPosition;
|
||||
bool m_recording;
|
||||
QList<note> m_recordingNotes;
|
||||
|
||||
@@ -315,7 +315,7 @@ private:
|
||||
|
||||
// remember these values to use them
|
||||
// for the next note that is set
|
||||
midiTime m_lenOfNewNotes;
|
||||
MidiTime m_lenOfNewNotes;
|
||||
volume_t m_lastNoteVolume;
|
||||
panning_t m_lastNotePanning;
|
||||
|
||||
@@ -345,7 +345,7 @@ private:
|
||||
|
||||
|
||||
signals:
|
||||
void positionChanged( const midiTime & );
|
||||
void positionChanged( const MidiTime & );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* preset_preview_play_handle.h - play-handle for playing a short preview-sound
|
||||
* of a preset or a file processed by a plugin
|
||||
*
|
||||
* Copyright (c) 2005-2008 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
|
||||
*
|
||||
@@ -34,7 +34,7 @@ class InstrumentTrack;
|
||||
class previewTrackContainer;
|
||||
|
||||
|
||||
class presetPreviewPlayHandle : public playHandle
|
||||
class EXPORT presetPreviewPlayHandle : public playHandle
|
||||
{
|
||||
public:
|
||||
presetPreviewPlayHandle( const QString & _preset_file,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* setup_dialog.h - dialog for setting up LMMS
|
||||
*
|
||||
* Copyright (c) 2005-2011 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
|
||||
*
|
||||
@@ -102,8 +102,6 @@ private slots:
|
||||
void openDefaultSoundfont();
|
||||
void openBackgroundArtwork();
|
||||
|
||||
void toggleDisableChActInd( bool _disabled );
|
||||
void toggleManualChPiano( bool _enabled );
|
||||
void toggleSmoothScroll( bool _enabled );
|
||||
void toggleAutoSave( bool _enabled );
|
||||
void toggleOneInstrumentTrackWindow( bool _enabled );
|
||||
@@ -154,8 +152,6 @@ private:
|
||||
#endif
|
||||
QString m_backgroundArtwork;
|
||||
|
||||
bool m_disableChActInd;
|
||||
bool m_manualChPiano;
|
||||
bool m_smoothScroll;
|
||||
bool m_enableAutoSave;
|
||||
bool m_oneInstrumentTrackWindow;
|
||||
|
||||
@@ -65,11 +65,11 @@ public:
|
||||
} ;
|
||||
|
||||
|
||||
class playPos : public midiTime
|
||||
class playPos : public MidiTime
|
||||
{
|
||||
public:
|
||||
playPos( const int _abs = 0 ) :
|
||||
midiTime( _abs ),
|
||||
MidiTime( _abs ),
|
||||
m_timeLine( NULL ),
|
||||
m_timeLineUpdate( true ),
|
||||
m_currentFrame( 0.0f )
|
||||
|
||||
@@ -84,7 +84,7 @@ private slots:
|
||||
void masterPitchReleased();
|
||||
|
||||
void updateScrollBar( int );
|
||||
void updatePosition( const midiTime & _t );
|
||||
void updatePosition( const MidiTime & _t );
|
||||
|
||||
void zoomingChanged();
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
|
||||
|
||||
timeLine( int _xoff, int _yoff, float _ppt, song::playPos & _pos,
|
||||
const midiTime & _begin, QWidget * _parent );
|
||||
const MidiTime & _begin, QWidget * _parent );
|
||||
virtual ~timeLine();
|
||||
|
||||
inline song::playPos & pos()
|
||||
@@ -84,23 +84,23 @@ public:
|
||||
return m_loopPoints == LoopPointsEnabled;
|
||||
}
|
||||
|
||||
inline const midiTime & loopBegin() const
|
||||
inline const MidiTime & loopBegin() const
|
||||
{
|
||||
return ( m_loopPos[0] < m_loopPos[1] ) ?
|
||||
m_loopPos[0] : m_loopPos[1];
|
||||
}
|
||||
|
||||
inline const midiTime & loopEnd() const
|
||||
inline const MidiTime & loopEnd() const
|
||||
{
|
||||
return ( m_loopPos[0] > m_loopPos[1] ) ?
|
||||
m_loopPos[0] : m_loopPos[1];
|
||||
}
|
||||
|
||||
inline void savePos( const midiTime & _pos )
|
||||
inline void savePos( const MidiTime & _pos )
|
||||
{
|
||||
m_savedPos = _pos;
|
||||
}
|
||||
inline const midiTime & savedPos() const
|
||||
inline const MidiTime & savedPos() const
|
||||
{
|
||||
return m_savedPos;
|
||||
}
|
||||
@@ -121,18 +121,18 @@ public:
|
||||
return "timeline";
|
||||
}
|
||||
|
||||
inline int markerX( const midiTime & _t ) const
|
||||
inline int markerX( const MidiTime & _t ) const
|
||||
{
|
||||
return m_xOffset + static_cast<int>( ( _t - m_begin ) *
|
||||
m_ppt / midiTime::ticksPerTact() );
|
||||
m_ppt / MidiTime::ticksPerTact() );
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
void updatePosition( const midiTime & );
|
||||
void updatePosition( const MidiTime & );
|
||||
void updatePosition()
|
||||
{
|
||||
updatePosition( midiTime() );
|
||||
updatePosition( MidiTime() );
|
||||
}
|
||||
void toggleAutoScroll( int _n );
|
||||
void toggleLoopPoints( int _n );
|
||||
@@ -162,10 +162,10 @@ private:
|
||||
int m_posMarkerX;
|
||||
float m_ppt;
|
||||
song::playPos & m_pos;
|
||||
const midiTime & m_begin;
|
||||
midiTime m_loopPos[2];
|
||||
const MidiTime & m_begin;
|
||||
MidiTime m_loopPos[2];
|
||||
|
||||
midiTime m_savedPos;
|
||||
MidiTime m_savedPos;
|
||||
|
||||
|
||||
textFloat * m_hint;
|
||||
@@ -183,7 +183,7 @@ private:
|
||||
|
||||
|
||||
signals:
|
||||
void positionChanged( const midiTime & _t );
|
||||
void positionChanged( const MidiTime & _t );
|
||||
void loopPointStateLoaded( int _n );
|
||||
|
||||
} ;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
#include "lmms_basics.h"
|
||||
#include "midi_time.h"
|
||||
#include "MidiTime.h"
|
||||
#include "rubberband.h"
|
||||
#include "JournallingObject.h"
|
||||
#include "AutomatableModel.h"
|
||||
@@ -101,24 +101,24 @@ public:
|
||||
}
|
||||
|
||||
|
||||
inline const midiTime & startPosition() const
|
||||
inline const MidiTime & startPosition() const
|
||||
{
|
||||
return m_startPosition;
|
||||
}
|
||||
|
||||
inline midiTime endPosition() const
|
||||
inline MidiTime endPosition() const
|
||||
{
|
||||
const int sp = m_startPosition;
|
||||
return sp + m_length;
|
||||
}
|
||||
|
||||
inline const midiTime & length() const
|
||||
inline const MidiTime & length() const
|
||||
{
|
||||
return m_length;
|
||||
}
|
||||
|
||||
virtual void movePosition( const midiTime & _pos );
|
||||
virtual void changeLength( const midiTime & _length );
|
||||
virtual void movePosition( const MidiTime & _pos );
|
||||
virtual void changeLength( const MidiTime & _length );
|
||||
|
||||
virtual trackContentObjectView * createView( trackView * _tv ) = 0;
|
||||
|
||||
@@ -151,8 +151,8 @@ private:
|
||||
track * m_track;
|
||||
QString m_name;
|
||||
|
||||
midiTime m_startPosition;
|
||||
midiTime m_length;
|
||||
MidiTime m_startPosition;
|
||||
MidiTime m_length;
|
||||
|
||||
BoolModel m_mutedModel;
|
||||
BoolModel m_soloModel;
|
||||
@@ -230,7 +230,7 @@ private:
|
||||
|
||||
textFloat * m_hint;
|
||||
|
||||
midiTime m_oldTime;// used for undo/redo while mouse-button is pressed
|
||||
MidiTime m_oldTime;// used for undo/redo while mouse-button is pressed
|
||||
|
||||
} ;
|
||||
|
||||
@@ -258,11 +258,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
midiTime endPosition( const midiTime & _pos_start );
|
||||
MidiTime endPosition( const MidiTime & _pos_start );
|
||||
|
||||
public slots:
|
||||
void update();
|
||||
void changePosition( const midiTime & _new_pos = midiTime( -1 ) );
|
||||
void changePosition( const MidiTime & _new_pos = MidiTime( -1 ) );
|
||||
|
||||
|
||||
protected:
|
||||
@@ -289,7 +289,7 @@ private:
|
||||
} ;
|
||||
|
||||
track * getTrack();
|
||||
midiTime getPosition( int _mouse_x );
|
||||
MidiTime getPosition( int _mouse_x );
|
||||
|
||||
trackView * m_trackView;
|
||||
|
||||
@@ -382,12 +382,12 @@ public:
|
||||
return m_type;
|
||||
}
|
||||
|
||||
virtual bool play( const midiTime & _start, const fpp_t _frames,
|
||||
virtual bool play( const MidiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 ) = 0;
|
||||
|
||||
|
||||
virtual trackView * createView( TrackContainerView * _view ) = 0;
|
||||
virtual trackContentObject * createTCO( const midiTime & _pos ) = 0;
|
||||
virtual trackContentObject * createTCO( const MidiTime & _pos ) = 0;
|
||||
|
||||
virtual void saveTrackSpecificSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent ) = 0;
|
||||
@@ -415,13 +415,13 @@ public:
|
||||
{
|
||||
return( m_trackContentObjects );
|
||||
}
|
||||
void getTCOsInRange( tcoVector & _tco_v, const midiTime & _start,
|
||||
const midiTime & _end );
|
||||
void getTCOsInRange( tcoVector & _tco_v, const MidiTime & _start,
|
||||
const MidiTime & _end );
|
||||
void swapPositionOfTCOs( int _tco_num1, int _tco_num2 );
|
||||
|
||||
|
||||
void insertTact( const midiTime & _pos );
|
||||
void removeTact( const midiTime & _pos );
|
||||
void insertTact( const MidiTime & _pos );
|
||||
void removeTact( const MidiTime & _pos );
|
||||
|
||||
tact_t length() const;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* volume.h - declaration of some constants and types, concerning the volume
|
||||
* of a note
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "lmmsconfig.h"
|
||||
|
||||
#include "lmms_basics.h"
|
||||
#include "midi.h"
|
||||
#include "Midi.h"
|
||||
|
||||
const volume_t MinVolume = 0;
|
||||
const volume_t MaxVolume = 200;
|
||||
|
||||
Reference in New Issue
Block a user