Merge branch 'stable-1.1'
Conflicts: include/Plugin.h src/core/Plugin.cpp
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* FxMixerView.h - effect-mixer-view for LMMS
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@@ -48,8 +48,9 @@ class EXPORT FxMixerView : public QWidget, public ModelView,
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
struct FxChannelView
|
||||
class FxChannelView
|
||||
{
|
||||
public:
|
||||
FxChannelView(QWidget * _parent, FxMixerView * _mv, int _chIndex );
|
||||
|
||||
FxLine * m_fxLine;
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "lmms_basics.h"
|
||||
#include "note.h"
|
||||
#include "fifo_buffer.h"
|
||||
#include "MixerProfiler.h"
|
||||
|
||||
|
||||
class AudioDevice;
|
||||
@@ -246,9 +247,14 @@ public:
|
||||
}
|
||||
|
||||
|
||||
inline int cpuLoad() const
|
||||
MixerProfiler& profiler()
|
||||
{
|
||||
return m_cpuLoad;
|
||||
return m_profiler;
|
||||
}
|
||||
|
||||
int cpuLoad() const
|
||||
{
|
||||
return m_profiler.cpuLoad();
|
||||
}
|
||||
|
||||
const qualitySettings & currentQualitySettings() const
|
||||
@@ -433,7 +439,6 @@ private:
|
||||
bool m_oldBuffer[SURROUND_CHANNELS];
|
||||
bool m_newBuffer[SURROUND_CHANNELS];
|
||||
|
||||
int m_cpuLoad;
|
||||
QVector<MixerWorkerThread *> m_workers;
|
||||
int m_numWorkers;
|
||||
QWaitCondition m_queueReadyWaitCond;
|
||||
@@ -465,6 +470,7 @@ private:
|
||||
fifo * m_fifo;
|
||||
fifoWriter * m_fifoWriter;
|
||||
|
||||
MixerProfiler m_profiler;
|
||||
|
||||
friend class engine;
|
||||
friend class MixerWorkerThread;
|
||||
|
||||
60
include/MixerProfiler.h
Normal file
60
include/MixerProfiler.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* MixerProfiler.h - class for profiling performance of Mixer
|
||||
*
|
||||
* 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 MIXER_PROFILER_H
|
||||
#define MIXER_PROFILER_H
|
||||
|
||||
#include <QFile>
|
||||
|
||||
#include "MicroTimer.h"
|
||||
|
||||
class MixerProfiler
|
||||
{
|
||||
public:
|
||||
MixerProfiler();
|
||||
~MixerProfiler();
|
||||
|
||||
void startPeriod()
|
||||
{
|
||||
m_periodTimer.reset();
|
||||
}
|
||||
|
||||
void finishPeriod( sample_rate_t sampleRate, fpp_t framesPerPeriod );
|
||||
|
||||
int cpuLoad() const
|
||||
{
|
||||
return m_cpuLoad;
|
||||
}
|
||||
|
||||
void setOutputFile( const QString& outputFile );
|
||||
|
||||
|
||||
private:
|
||||
MicroTimer m_periodTimer;
|
||||
int m_cpuLoad;
|
||||
QFile m_outputFile;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Plugin.h - class plugin, the base-class and generic interface for all plugins
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@@ -22,18 +22,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _PLUGIN_H
|
||||
#define _PLUGIN_H
|
||||
#ifndef PLUGIN_H
|
||||
#define PLUGIN_H
|
||||
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QList>
|
||||
#include <QDomDocument>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtXml/QDomDocument>
|
||||
|
||||
#include "JournallingObject.h"
|
||||
#include "Model.h"
|
||||
#include "base64.h"
|
||||
|
||||
|
||||
|
||||
class QWidget;
|
||||
@@ -72,12 +69,12 @@ public:
|
||||
PluginTypes type;
|
||||
const PixmapLoader * logo;
|
||||
const char * supportedFileTypes;
|
||||
inline bool supportsFileType( const QString & _ext ) const
|
||||
|
||||
inline bool supportsFileType( const QString& extension ) const
|
||||
{
|
||||
return QString( supportedFileTypes ).
|
||||
split( QChar( ',' ) ).
|
||||
contains( _ext );
|
||||
return QString( supportedFileTypes ).split( QChar( ',' ) ).contains( extension );
|
||||
}
|
||||
|
||||
class EXPORT SubPluginFeatures
|
||||
{
|
||||
public:
|
||||
@@ -101,11 +98,10 @@ public:
|
||||
|
||||
inline bool isValid() const
|
||||
{
|
||||
return desc != NULL &&
|
||||
name != QString::null;
|
||||
return desc != NULL && name.isNull() == false;
|
||||
}
|
||||
|
||||
const Plugin::Descriptor * desc;
|
||||
const Plugin::Descriptor* desc;
|
||||
QString name;
|
||||
AttributeMap attributes;
|
||||
} ;
|
||||
@@ -113,8 +109,8 @@ public:
|
||||
typedef QList<Key> KeyList;
|
||||
|
||||
|
||||
SubPluginFeatures( Plugin::PluginTypes _type ) :
|
||||
m_type( _type )
|
||||
SubPluginFeatures( Plugin::PluginTypes type ) :
|
||||
m_type( type )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -126,8 +122,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual void listSubPluginKeys( const Plugin::Descriptor *,
|
||||
KeyList & ) const
|
||||
virtual void listSubPluginKeys( const Plugin::Descriptor *, KeyList & ) const
|
||||
{
|
||||
}
|
||||
|
||||
@@ -144,15 +139,13 @@ public:
|
||||
typedef QList<Descriptor> DescriptorList;
|
||||
|
||||
// contructor of a plugin
|
||||
Plugin( const Descriptor * _descriptor, Model * _parent );
|
||||
Plugin( const Descriptor* descriptor, Model* parent );
|
||||
virtual ~Plugin();
|
||||
|
||||
// returns display-name out of descriptor
|
||||
virtual QString displayName() const
|
||||
{
|
||||
return Model::displayName().isEmpty() ?
|
||||
m_descriptor->displayName :
|
||||
Model::displayName();
|
||||
return Model::displayName().isEmpty() ? m_descriptor->displayName : Model::displayName();
|
||||
}
|
||||
|
||||
// return plugin-type
|
||||
@@ -162,41 +155,40 @@ public:
|
||||
}
|
||||
|
||||
// return plugin-descriptor for further information
|
||||
inline const Descriptor * descriptor() const
|
||||
inline const Descriptor* descriptor() const
|
||||
{
|
||||
return m_descriptor;
|
||||
}
|
||||
|
||||
// can be called if a file matching supportedFileTypes should be
|
||||
// loaded/processed with the help of this plugin
|
||||
virtual void loadFile( const QString & _file );
|
||||
virtual void loadFile( const QString& file );
|
||||
|
||||
// Called if external source needs to change something but we cannot
|
||||
// reference the class header. Should return null if not key not found.
|
||||
virtual AutomatableModel * childModel( const QString & _modelName );
|
||||
virtual AutomatableModel* childModel( const QString& modelName );
|
||||
|
||||
// returns an instance of a plugin whose name matches to given one
|
||||
// if specified plugin couldn't be loaded, it creates a dummy-plugin
|
||||
static Plugin * instantiate( const QString & _plugin_name,
|
||||
Model * _parent, void * _data );
|
||||
static Plugin * instantiate( const QString& pluginName, Model * parent, void * data );
|
||||
|
||||
// fills given list with descriptors of all available plugins
|
||||
static void getDescriptorsOfAvailPlugins( DescriptorList & _plugin_descs );
|
||||
static void getDescriptorsOfAvailPlugins( DescriptorList& pluginDescriptors );
|
||||
|
||||
// create a view for the model
|
||||
PluginView * createView( QWidget * _parent );
|
||||
PluginView * createView( QWidget* parent );
|
||||
|
||||
|
||||
protected:
|
||||
// create a view for the model
|
||||
virtual PluginView * instantiateView( QWidget * ) = 0;
|
||||
virtual PluginView* instantiateView( QWidget* ) = 0;
|
||||
|
||||
|
||||
private:
|
||||
const Descriptor * m_descriptor;
|
||||
const Descriptor* m_descriptor;
|
||||
|
||||
// pointer to instantiation-function in plugin
|
||||
typedef Plugin * ( * instantiationHook )( Model *, void * );
|
||||
typedef Plugin * ( * InstantiationHook )( Model*, void* );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -40,6 +40,12 @@
|
||||
#ifndef isinff
|
||||
#define isinff(x) isinf(x)
|
||||
#endif
|
||||
#ifndef _isnanf
|
||||
#define _isnanf(x) isnan(x)
|
||||
#endif
|
||||
#ifndef _isinff
|
||||
#define _isinff(x) isinf(x)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __INTEL_COMPILER
|
||||
|
||||
Reference in New Issue
Block a user