added panningToMidi function to easily convert panning to a midi value, dragging around a note in the piano roll makes the correct volume and panning noises

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1921 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Andrew Kelley
2008-12-14 11:01:05 +00:00
parent 20f50350e6
commit 167180e670
5 changed files with 100 additions and 34 deletions

View File

@@ -30,6 +30,7 @@
#include "volume.h"
#include "templates.h"
#include "panning_constants.h"
#include "midi.h"
inline stereoVolumeVector panningToVolumeVector( panning _p,
float _scale = 1.0f )
@@ -40,4 +41,12 @@ inline stereoVolumeVector panningToVolumeVector( panning _p,
return v;
}
inline Sint16 panningToMidi( panning _p )
{
return MidiMinPanning +
( (float)( _p - PanningLeft ) ) /
( (float)( PanningRight - PanningLeft ) ) *
( (float)( MidiMaxPanning - MidiMinPanning ) );
}
#endif

View File

@@ -182,6 +182,8 @@ private:
void shiftSemiTone(int amount);
bool isSelection() const;
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;