Merge stable-1.2 into master

This commit is contained in:
liushuyu
2017-09-09 13:55:36 -06:00
12 changed files with 301 additions and 126 deletions

View File

@@ -29,6 +29,7 @@
#include <QtCore/QTimer>
#include <QtCore/QList>
#include <QMainWindow>
#include <QThread>
#include "ConfigManager.h"
#include "SubWindow.h"
@@ -248,4 +249,11 @@ signals:
} ;
class AutoSaveThread : public QThread
{
Q_OBJECT
public:
void run();
} ;
#endif

View File

@@ -25,6 +25,8 @@
#ifndef PLUGINFACTORY_H
#define PLUGINFACTORY_H
#include <memory>
#include <QtCore/QFileInfo>
#include <QtCore/QList>
@@ -39,14 +41,15 @@ public:
struct PluginInfo
{
PluginInfo() : library(nullptr), descriptor(nullptr) {}
const QString name() const;
QFileInfo file;
QLibrary* library;
std::shared_ptr<QLibrary> library;
Plugin::Descriptor* descriptor;
bool isNull() const {return library == 0;}
bool isNull() const {return ! library;}
};
typedef QList<PluginInfo*> PluginInfoList;
typedef QList<PluginInfo> PluginInfoList;
typedef QMultiMap<Plugin::PluginTypes, Plugin::Descriptor*> DescriptorMap;
PluginFactory();
@@ -80,11 +83,11 @@ public slots:
private:
DescriptorMap m_descriptors;
PluginInfoList m_pluginInfos;
QMap<QString, PluginInfo*> m_pluginByExt;
QMap<QString, PluginInfo> m_pluginByExt;
QHash<QString, QString> m_errors;
static PluginFactory* s_instance;
static std::unique_ptr<PluginFactory> s_instance;
};
#define pluginFactory PluginFactory::instance()

View File

@@ -424,6 +424,7 @@ enum RemoteMessageIDs
IdChangeSharedMemoryKey,
IdChangeInputCount,
IdChangeOutputCount,
IdChangeInputOutputCount,
IdShowUI,
IdHideUI,
IdSaveSettingsToString,
@@ -919,6 +920,15 @@ public:
sendMessage( message( IdChangeOutputCount ).addInt( _i ) );
}
void setInputOutputCount( int i, int o )
{
m_inputCount = i;
m_outputCount = o;
sendMessage( message( IdChangeInputOutputCount )
.addInt( i )
.addInt( o ) );
}
virtual int inputCount() const
{
return m_inputCount;
@@ -1072,6 +1082,14 @@ RemotePluginBase::message RemotePluginBase::waitForMessage(
const message & _wm,
bool _busy_waiting )
{
#ifndef BUILD_REMOTE_PLUGIN_CLIENT
if( _busy_waiting )
{
// No point processing events outside of the main thread
_busy_waiting = QThread::currentThread() ==
QCoreApplication::instance()->thread();
}
#endif
while( !isInvalid() )
{
#ifndef BUILD_REMOTE_PLUGIN_CLIENT

View File

@@ -2,7 +2,7 @@
* Song.h - class song - the root of the model-tree
*
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
*
* This file is part of LMMS - https://lmms.io
*
* This program is free software; you can redistribute it and/or
@@ -254,7 +254,7 @@ public:
void addController( Controller * c );
void removeController( Controller * c );
const ControllerVector & controllers() const
{
@@ -325,13 +325,13 @@ private:
{
return m_playPos[m_playMode].getTicks();
}
inline f_cnt_t currentFrame() const
{
return m_playPos[m_playMode].getTicks() * Engine::framesPerTick() +
return m_playPos[m_playMode].getTicks() * Engine::framesPerTick() +
m_playPos[m_playMode].currentFrame();
}
void setPlayPos( tick_t ticks, PlayModes playMode );
void saveControllerStates( QDomDocument & doc, QDomElement & element );
@@ -367,7 +367,7 @@ private:
bool m_loadingProject;
QList<QString> m_errors;
QStringList m_errors;
PlayModes m_playMode;
PlayPos m_playPos[Mode_Count];