Merge brnach 'stable-1.2'

This commit is contained in:
Hyunin Song
2017-11-24 09:50:57 +09:00
20 changed files with 137 additions and 42 deletions

View File

@@ -80,7 +80,7 @@ public:
MidiTime putValue( const MidiTime & time,
const float value,
const bool quantPos = true,
const bool ignoreSurroundingPoints = false );
const bool ignoreSurroundingPoints = true );
void removeValue( const MidiTime & time );

View File

@@ -31,15 +31,26 @@
#ifdef LMMS_BUILD_WIN32
#include <windows.h>
#if QT_VERSION >= 0x050000
#include <QAbstractNativeEventFilter>
#endif
#endif
#if defined(LMMS_BUILD_WIN32) && QT_VERSION >= 0x050000
class MainApplication : public QApplication, public QAbstractNativeEventFilter
#else
class MainApplication : public QApplication
#endif
{
public:
MainApplication(int& argc, char** argv);
bool event(QEvent* event);
#ifdef LMMS_BUILD_WIN32
bool winEventFilter(MSG* msg, long* result);
#if QT_VERSION >= 0x050000
bool nativeEventFilter(const QByteArray& eventType, void* message,
long* result);
#endif
#endif
inline QString& queuedFile()
{

View File

@@ -155,6 +155,7 @@ public:
void initDevices();
void clear();
void clearNewPlayHandles();
// audio-device-stuff

View File

@@ -33,6 +33,7 @@
#include "TrackContainer.h"
#include "Controller.h"
#include "MeterModel.h"
#include "Mixer.h"
#include "VstSyncController.h"
@@ -256,6 +257,17 @@ public:
return m_loadingProject;
}
void loadingCancelled()
{
m_isCancelled = true;
Engine::mixer()->clearNewPlayHandles();
}
bool isCancelled()
{
return m_isCancelled;
}
bool isModified() const
{
return m_modified;
@@ -385,6 +397,7 @@ private:
volatile bool m_paused;
bool m_loadingProject;
bool m_isCancelled;
QStringList m_errors;

View File

@@ -212,11 +212,12 @@ static inline float logToLinearScale( float min, float max, float value )
static inline float linearToLogScale( float min, float max, float value )
{
static const float EXP = 1.0f / F_E;
const float val = ( value - min ) / ( max - min );
const float valueLimited = qBound( min, value, max);
const float val = ( valueLimited - min ) / ( max - min );
if( min < 0 )
{
const float mmax = qMax( qAbs( min ), qAbs( max ) );
float result = signedPowf( value / mmax, EXP ) * mmax;
float result = signedPowf( valueLimited / mmax, EXP ) * mmax;
return isnan( result ) ? 0 : result;
}
float result = powf( val, EXP ) * ( max - min ) + min;