Merge branch 'master' into cmake_dist

# Conflicts:
#	include/Plugin.h
#	src/core/Plugin.cpp
This commit is contained in:
Lukas W
2015-03-21 11:53:00 +01:00
105 changed files with 3436 additions and 1823 deletions

View File

@@ -97,8 +97,6 @@ private:
bool m_active;
bool m_stopped;
QSemaphore m_stopSemaphore;
QVector<jack_port_t *> m_outputPorts;
jack_default_audio_sample_t * * m_tempOutBufs;
surroundSampleFrame * m_outBuf;

View File

@@ -46,7 +46,7 @@ public:
inline static QString name()
{
return QT_TRANSLATE_NOOP( "setupWidget", "PulseAudio (bad latency!)" );
return QT_TRANSLATE_NOOP( "setupWidget", "PulseAudio" );
}
static QString probeDevice();

View File

@@ -82,6 +82,7 @@ public:
public slots:
void addSteps();
void cloneSteps();
void removeSteps();
void addAutomationTrack();
@@ -91,6 +92,7 @@ protected slots:
private:
BBTrackContainer * m_bbtc;
void makeSteps( bool clone );
};

View File

@@ -35,6 +35,7 @@
#include "export.h"
#include "MemoryManager.h"
#include "lmmsversion.h"
class Engine;
@@ -100,6 +101,11 @@ public:
return dataDir() + SAMPLES_PATH;
}
QString defaultVersion() const
{
return LMMS_VERSION;
}
QString defaultArtworkDir() const
{
return m_dataDir + DEFAULT_THEME_PATH;
@@ -135,9 +141,14 @@ public:
return m_ladDir;
}
const QString & recoveryFile() const
const QString recoveryFile() const
{
return m_recoveryFile;
return m_workingDir + "recover.mmp";
}
const QString & version() const
{
return m_version;
}
#ifdef LMMS_HAVE_STK
@@ -180,6 +191,7 @@ public:
void setArtworkDir( const QString & _ad );
void setFLDir( const QString & _fd );
void setLADSPADir( const QString & _fd );
void setVersion( const QString & _cv );
void setSTKDir( const QString & _fd );
void setDefaultSoundfont( const QString & _sf );
void setBackgroundArtwork( const QString & _ba );
@@ -192,6 +204,8 @@ private:
ConfigManager( const ConfigManager & _c );
~ConfigManager();
void upgrade();
const QString m_lmmsRcFile;
QString m_workingDir;
@@ -200,7 +214,7 @@ private:
QString m_vstDir;
QString m_flDir;
QString m_ladDir;
QString m_recoveryFile;
QString m_version;
#ifdef LMMS_HAVE_STK
QString m_stkDir;
#endif

View File

@@ -58,6 +58,12 @@ public:
virtual ~DataFile();
///
/// \brief validate
/// performs basic validation, compared to file extension.
///
bool validate( QString extension );
QString nameWithExtension( const QString& fn ) const;
void write( QTextStream& strm );

64
include/ExportFilter.h Normal file
View File

@@ -0,0 +1,64 @@
/*
* ExportFilter.h - declaration of class ExportFilter, the base-class for all
* file export filters
*
* Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of LMMS - http://lmms.io
*
* 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 EXPORT_FILTER_H
#define EXPORT_FILTER_H
#include <QtCore/QFile>
#include "TrackContainer.h"
#include "Plugin.h"
class EXPORT ExportFilter : public Plugin
{
public:
ExportFilter( const Descriptor * _descriptor ) : Plugin( _descriptor, NULL ) {}
virtual ~ExportFilter() {}
virtual bool tryExport( const TrackContainer::TrackList &tracks, int tempo, const QString &filename ) = 0;
protected:
virtual void saveSettings( QDomDocument &, QDomElement & )
{
}
virtual void loadSettings( const QDomElement & )
{
}
virtual QString nodeName() const
{
return "import_filter";
}
private:
} ;
#endif

View File

@@ -39,6 +39,7 @@ public:
_activated_color, QWidget * _parent );
virtual ~FadeButton();
void setActiveColor( const QColor & activated_color );
public slots:

View File

@@ -306,6 +306,9 @@ public:
static void cleanupWindowCache();
// Create a menu for assigning/creating channels for this track
QMenu * createFxMenu( QString title, QString newFxLabel );
protected:
virtual void dragEnterEvent( QDragEnterEvent * _dee );
@@ -320,6 +323,10 @@ private slots:
void midiInSelected();
void midiOutSelected();
void midiConfigChanged();
void muteChanged();
void assignFxLine( int channelIndex );
void createFxLine();
private:
@@ -374,6 +381,12 @@ public:
void setInstrumentTrackView( InstrumentTrackView * _tv );
InstrumentTrackView *instrumentTrackView()
{
return m_itv;
}
PianoView * pianoView()
{
return m_pianoView;

View File

@@ -69,10 +69,12 @@ public:
/// opens another file...) must call this before and may only proceed if
/// this function returns true.
///
/// \param stopPlayback whether playback should be stopped upon prompting. If set to false, the caller should ensure that Engine::getSong()->stop() is called before unloading/loading a song.
///
/// \return true if the user allows the software to proceed, false if they
/// cancel the action.
///
bool mayChangeProject();
bool mayChangeProject(bool stopPlayback);
void clearKeyModifiers();
@@ -172,6 +174,7 @@ private:
friend class GuiApplication;
QMenu * m_viewMenu;
private slots:
void browseHelp();
@@ -179,6 +182,8 @@ private slots:
void openRecentlyOpenedProject( QAction * _action );
void showTool( QAction * _idx );
void updateRecentlyOpenedProjectsMenu();
void updateViewMenu( void );
void updateConfig( QAction * _who );
void autoSave();

View File

@@ -81,36 +81,37 @@ 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,
DetuningHelper * _detuning = NULL );
Note( const Note & _note );
volume_t volume = DefaultVolume,
panning_t panning = DefaultPanning,
DetuningHelper * detuning = NULL );
Note( const Note & note );
virtual ~Note();
// 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 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 )
{
m_oldLength = _oldLength;
m_oldLength = oldLength;
}
inline void setIsPlaying( const bool _isPlaying )
inline void setIsPlaying( const bool isPlaying )
{
m_isPlaying = _isPlaying;
m_isPlaying = isPlaying;
}
void setLength( const MidiTime & _length );
void setPos( const MidiTime & _pos );
void setKey( const int _key );
void setLength( const MidiTime & length );
void setPos( const MidiTime & pos );
void setKey( const int key );
virtual void setVolume( volume_t volume );
virtual void setPanning( panning_t panning );
void quantizeLength( const int _q_grid );
void quantizePos( const int _q_grid );
void quantizeLength( const int qGrid );
void quantizePos( const int qGrid );
static inline bool lessThan( Note * &lhs, Note * &rhs )
{
@@ -160,9 +161,9 @@ public:
return m_pos;
}
inline MidiTime pos( MidiTime _base_pos ) const
inline MidiTime pos( MidiTime basePos ) const
{
const int bp = _base_pos;
const int bp = basePos;
return m_pos - bp;
}
@@ -196,20 +197,20 @@ public:
return classNodeName();
}
static MidiTime quantized( const MidiTime & _m, const int _q_grid );
static MidiTime quantized( const MidiTime & m, const int qGrid );
DetuningHelper * detuning() const
{
return m_detuning;
}
bool hasDetuningInfo() const;
bool withinRange(int tickStart, int tickEnd) const;
void createDetuning();
protected:
virtual void saveSettings( QDomDocument & _doc,
QDomElement & _parent );
virtual void saveSettings( QDomDocument & doc, QDomElement & parent );
virtual void loadSettings( const QDomElement & _this );
@@ -234,4 +235,3 @@ typedef QVector<Note *> NoteVector;
#endif

View File

@@ -127,6 +127,7 @@ protected:
protected slots:
void addSteps();
void cloneSteps();
void removeSteps();
void clear();
void changeTimeSignature();
@@ -179,8 +180,8 @@ protected slots:
protected:
virtual void constructContextMenu( QMenu * );
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
virtual void mousePressEvent( QMouseEvent * _me );
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
virtual void paintEvent( QPaintEvent * _pe );
virtual void resizeEvent( QResizeEvent * _re )
{

View File

@@ -85,19 +85,19 @@ public:
{
typedef QMap<QString, QString> AttributeMap;
inline Key( const Plugin::Descriptor * _desc = NULL,
const QString & _name = QString(),
const AttributeMap & _am = AttributeMap() )
inline Key( const Plugin::Descriptor * desc = NULL,
const QString & name = QString(),
const AttributeMap & am = AttributeMap() )
:
desc( _desc ),
name( _name ),
attributes( _am )
desc( desc ),
name( name ),
attributes( am )
{
}
Key( const QDomElement & _key );
Key( const QDomElement & key );
QDomElement saveXML( QDomDocument & _doc ) const;
QDomElement saveXML( QDomDocument & doc ) const;
inline bool isValid() const
{
@@ -134,22 +134,22 @@ public:
const Plugin::PluginTypes m_type;
} ;
SubPluginFeatures *subPluginFeatures;
SubPluginFeatures * subPluginFeatures;
} ;
// typedef a list so we can easily work with list of plugin descriptors
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();
? m_descriptor->displayName
: Model::displayName();
}
// return plugin-type
@@ -159,38 +159,38 @@ 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& pluginName, Model *parent, void * data );
static Plugin * instantiate( const QString& pluginName, Model * parent, void * data );
// 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;
void collectErrorForUI( QString err_msg );
virtual PluginView* instantiateView( QWidget * ) = 0;
void collectErrorForUI( QString errMsg );
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 * );
} ;

View File

@@ -35,7 +35,7 @@ class PreviewTrackContainer;
class EXPORT PresetPreviewPlayHandle : public PlayHandle
{
public:
PresetPreviewPlayHandle( const QString& presetFile, bool loadByPlugin = false );
PresetPreviewPlayHandle( const QString& presetFile, bool loadByPlugin = false, DataFile *dataFile = 0 );
virtual ~PresetPreviewPlayHandle();
virtual void play( sampleFrame* buffer );

View File

@@ -61,7 +61,6 @@ private:
CompareType m_compareType;
} ;
/*
* ProjectVersion v. ProjectVersion
*/
@@ -72,5 +71,4 @@ inline bool operator>=(const ProjectVersion & v1, const ProjectVersion & v2) { r
inline bool operator==(const ProjectVersion & v1, const ProjectVersion & v2) { return ProjectVersion::compare(v1, v2) == 0; }
inline bool operator!=(const ProjectVersion & v1, const ProjectVersion & v2) { return ProjectVersion::compare(v1, v2) != 0; }
#endif

View File

@@ -36,17 +36,12 @@
#include <string>
#include <cassert>
#ifdef LMMS_BUILD_WIN32
#if defined(LMMS_HAVE_SYS_IPC_H) && defined(LMMS_HAVE_SEMAPHORE_H)
#include <sys/ipc.h>
#include <semaphore.h>
#else
#define USE_QT_SEMAPHORES
#define USE_QT_SHMEM
#endif
#ifdef LMMS_BUILD_APPLE
#define USE_QT_SEMAPHORES
#endif
#ifdef USE_QT_SEMAPHORES
#ifdef LMMS_HAVE_PROCESS_H
#include <process.h>
@@ -54,39 +49,25 @@
#include <QtCore/QtGlobal>
#include <QtCore/QSystemSemaphore>
#else /* USE_QT_SEMAPHORES */
#ifdef LMMS_HAVE_SYS_IPC_H
#include <sys/ipc.h>
#endif
#ifdef LMMS_HAVE_SEMAPHORE_H
#include <semaphore.h>
#endif
#endif
#ifdef USE_QT_SHMEM
#include <QtCore/QtGlobal>
#include <QtCore/QSharedMemory>
typedef int32_t key_t;
#else /* USE_QT_SHMEM */
#ifdef LMMS_HAVE_SYS_SHM_H
#include <sys/shm.h>
#endif
#ifdef LMMS_HAVE_UNISTD_H
#include <unistd.h>
#endif
#else
#define USE_QT_SHMEM
#include <QtCore/QtGlobal>
#include <QtCore/QSharedMemory>
#if !defined(LMMS_HAVE_SYS_TYPES_H) || defined(LMMS_BUILD_WIN32)
typedef int32_t key_t;
#endif
#endif
#ifdef LMMS_HAVE_LOCALE_H

View File

@@ -49,10 +49,9 @@ const tick_t MaxSongLength = 9999 * DefaultTicksPerTact;
class EXPORT Song : public TrackContainer
{
Q_OBJECT
mapPropertyFromModel(int,getTempo,setTempo,m_tempoModel);
mapPropertyFromModel(int,masterPitch,setMasterPitch,m_masterPitchModel);
mapPropertyFromModel(int,masterVolume,setMasterVolume,
m_masterVolumeModel);
mapPropertyFromModel( int,getTempo,setTempo,m_tempoModel );
mapPropertyFromModel( int,masterPitch,setMasterPitch,m_masterPitchModel );
mapPropertyFromModel( int,masterVolume,setMasterVolume, m_masterVolumeModel );
public:
enum PlayModes
{
@@ -70,19 +69,19 @@ public:
bool hasErrors();
QString* errorSummary();
class playPos : public MidiTime
class PlayPos : public MidiTime
{
public:
playPos( const int _abs = 0 ) :
MidiTime( _abs ),
PlayPos( const int abs = 0 ) :
MidiTime( abs ),
m_timeLine( NULL ),
m_timeLineUpdate( true ),
m_currentFrame( 0.0f )
{
}
inline void setCurrentFrame( const float _f )
inline void setCurrentFrame( const float f )
{
m_currentFrame = _f;
m_currentFrame = f;
}
inline float currentFrame() const
{
@@ -104,9 +103,9 @@ public:
{
return m_elapsedMilliSeconds;
}
inline void setMilliSeconds( float _ellapsedMilliSeconds )
inline void setMilliSeconds( float ellapsedMilliSeconds )
{
m_elapsedMilliSeconds = (_ellapsedMilliSeconds);
m_elapsedMilliSeconds = ellapsedMilliSeconds;
}
inline int getTacts() const
{
@@ -123,14 +122,14 @@ public:
// Returns the beat position inside the bar, 0-based
inline int getBeat() const
{
return (currentTick() - currentTact()*ticksPerTact()) /
(ticksPerTact() / m_timeSigModel.getNumerator() );
return ( currentTick() - currentTact() * ticksPerTact() ) /
( ticksPerTact() / m_timeSigModel.getNumerator() );
}
// the remainder after bar and beat are removed
inline int getBeatTicks() const
{
return (currentTick() - currentTact()*ticksPerTact()) %
(ticksPerTact() / m_timeSigModel.getNumerator() );
return ( currentTick() - currentTact() * ticksPerTact() ) %
( ticksPerTact() / m_timeSigModel.getNumerator() );
}
inline int getTicks() const
{
@@ -151,7 +150,7 @@ public:
inline bool isPlaying() const
{
return m_playing && m_exporting == false;
return m_playing == true && m_exporting == false;
}
inline bool isStopped() const
@@ -186,9 +185,9 @@ public:
return m_playMode;
}
inline playPos & getPlayPos( PlayModes _pm )
inline PlayPos & getPlayPos( PlayModes pm )
{
return m_playPos[_pm];
return m_playPos[pm];
}
void updateLength();
@@ -208,11 +207,11 @@ public:
// file management
void createNewProject();
void createNewProjectFromTemplate( const QString & _template );
void loadProject( const QString & _filename );
void createNewProjectFromTemplate( const QString & templ );
void loadProject( const QString & filename );
bool guiSaveProject();
bool guiSaveProjectAs( const QString & _filename );
bool saveProjectFile( const QString & _filename );
bool guiSaveProjectAs( const QString & filename );
bool saveProjectFile( const QString & filename );
const QString & projectFileName() const
{
@@ -239,8 +238,8 @@ public:
return false;
}
void addController( Controller * _c );
void removeController( Controller * _c );
void addController( Controller * c );
void removeController( Controller * c );
const ControllerVector & controllers() const
@@ -259,15 +258,16 @@ public slots:
void playSong();
void record();
void playAndRecord();
void playTrack( Track * _trackToPlay );
void playTrack( Track * trackToPlay );
void playBB();
void playPattern(const Pattern* patternToPlay, bool _loop = true );
void playPattern( const Pattern * patternToPlay, bool loop = true );
void togglePause();
void stop();
void importProject();
void exportProject(bool multiExport=false);
void exportProject( bool multiExport = false );
void exportProjectTracks();
void exportProjectMidi();
void startExport();
void stopExport();
@@ -315,13 +315,14 @@ private:
inline f_cnt_t currentFrame() const
{
return m_playPos[m_playMode].getTicks() * Engine::framesPerTick() + m_playPos[m_playMode].currentFrame();
return m_playPos[m_playMode].getTicks() * Engine::framesPerTick() +
m_playPos[m_playMode].currentFrame();
}
void setPlayPos( tick_t _ticks, PlayModes _play_mode );
void setPlayPos( tick_t ticks, PlayModes playMode );
void saveControllerStates( QDomDocument & _doc, QDomElement & _this );
void restoreControllerStates( const QDomElement & _this );
void saveControllerStates( QDomDocument & doc, QDomElement & element );
void restoreControllerStates( const QDomElement & element );
AutomationTrack * m_globalAutomationTrack;
@@ -351,7 +352,7 @@ private:
QList<QString> * m_errors;
PlayModes m_playMode;
playPos m_playPos[Mode_Count];
PlayPos m_playPos[Mode_Count];
tact_t m_length;
Track * m_trackToPlay;
@@ -374,10 +375,9 @@ signals:
void projectLoaded();
void playbackStateChanged();
void playbackPositionChanged();
void lengthChanged( int _tacts );
void tempoChanged( bpm_t _new_bpm );
void timeSignatureChanged( int _old_ticks_per_tact,
int _ticks_per_tact );
void lengthChanged( int tacts );
void tempoChanged( bpm_t newBPM );
void timeSignatureChanged( int oldTicksPerTact, int ticksPerTact );
} ;

View File

@@ -62,11 +62,11 @@ public:
} ;
TimeLineWidget( int _xoff, int _yoff, float _ppt, Song::playPos & _pos,
const MidiTime & _begin, QWidget * _parent );
TimeLineWidget( int xoff, int yoff, float ppt, Song::PlayPos & pos,
const MidiTime & begin, QWidget * parent );
virtual ~TimeLineWidget();
inline Song::playPos & pos()
inline Song::PlayPos & pos()
{
return( m_pos );
}
@@ -169,7 +169,7 @@ private:
int m_xOffset;
int m_posMarkerX;
float m_ppt;
Song::playPos & m_pos;
Song::PlayPos & m_pos;
const MidiTime & m_begin;
MidiTime m_loopPos[2];

View File

@@ -81,7 +81,7 @@ class TrackContentObject : public Model, public JournallingObject
mapPropertyFromModel(bool,isMuted,setMuted,m_mutedModel);
mapPropertyFromModel(bool,isSolo,setSolo,m_soloModel);
public:
TrackContentObject( Track * _track );
TrackContentObject( Track * track );
virtual ~TrackContentObject();
inline Track * getTrack() const
@@ -94,9 +94,9 @@ public:
return m_name;
}
inline void setName( const QString & _name )
inline void setName( const QString & name )
{
m_name = _name;
m_name = name;
emit dataChanged();
}
@@ -122,9 +122,9 @@ public:
return m_length;
}
inline void setAutoResize( const bool _r )
inline void setAutoResize( const bool r )
{
m_autoResize = _r;
m_autoResize = r;
}
inline const bool getAutoResize() const
@@ -132,10 +132,10 @@ public:
return m_autoResize;
}
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;
virtual TrackContentObjectView * createView( TrackView * tv ) = 0;
inline void selectViewOnCreate( bool select )
{
@@ -195,7 +195,7 @@ class TrackContentObjectView : public selectableObject, public ModelView
Q_PROPERTY( QColor textColor READ textColor WRITE setTextColor )
public:
TrackContentObjectView( TrackContentObject * _tco, TrackView * _tv );
TrackContentObjectView( TrackContentObject * tco, TrackView * tv );
virtual ~TrackContentObjectView();
bool fixedTCOs();
@@ -207,8 +207,8 @@ public:
// qproperty access func
QColor fgColor() const;
QColor textColor() const;
void setFgColor( const QColor & _c );
void setTextColor( const QColor & _c );
void setFgColor( const QColor & c );
void setTextColor( const QColor & c );
public slots:
virtual bool close();
@@ -220,13 +220,13 @@ protected:
{
}
virtual void contextMenuEvent( QContextMenuEvent * _cme );
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
virtual void leaveEvent( QEvent * _e );
virtual void mousePressEvent( QMouseEvent * _me );
virtual void mouseMoveEvent( QMouseEvent * _me );
virtual void mouseReleaseEvent( QMouseEvent * _me );
virtual void contextMenuEvent( QContextMenuEvent * cme );
virtual void dragEnterEvent( QDragEnterEvent * dee );
virtual void dropEvent( QDropEvent * de );
virtual void leaveEvent( QEvent * e );
virtual void mousePressEvent( QMouseEvent * me );
virtual void mouseMoveEvent( QMouseEvent * me );
virtual void mouseReleaseEvent( QMouseEvent * me );
float pixelsPerTact();
@@ -276,7 +276,7 @@ private:
m_initialMouseGlobalPos = mapToGlobal( pos );
}
bool mouseMovedDistance( QMouseEvent * _me, int distance );
bool mouseMovedDistance( QMouseEvent * me, int distance );
} ;
@@ -293,46 +293,46 @@ class TrackContentWidget : public QWidget, public JournallingObject
Q_PROPERTY( QBrush lighterColor READ lighterColor WRITE setLighterColor )
public:
TrackContentWidget( TrackView * _parent );
TrackContentWidget( TrackView * parent );
virtual ~TrackContentWidget();
/*! \brief Updates the background tile pixmap. */
void updateBackground();
void addTCOView( TrackContentObjectView * _tcov );
void removeTCOView( TrackContentObjectView * _tcov );
void removeTCOView( int _tco_num )
void addTCOView( TrackContentObjectView * tcov );
void removeTCOView( TrackContentObjectView * tcov );
void removeTCOView( int tcoNum )
{
if( _tco_num >= 0 && _tco_num < m_tcoViews.size() )
if( tcoNum >= 0 && tcoNum < m_tcoViews.size() )
{
removeTCOView( m_tcoViews[_tco_num] );
removeTCOView( m_tcoViews[tcoNum] );
}
}
bool canPasteSelection( MidiTime tcoPos, const QMimeData * mimeData );
bool pasteSelection( MidiTime tcoPos, QDropEvent * _de );
bool pasteSelection( MidiTime tcoPos, QDropEvent * de );
MidiTime endPosition( const MidiTime & _pos_start );
MidiTime endPosition( const MidiTime & posStart );
// qproperty access methods
QBrush darkerColor() const;
QBrush lighterColor() const;
void setDarkerColor( const QBrush & _c );
void setLighterColor( const QBrush & _c );
void setDarkerColor( const QBrush & c );
void setLighterColor( const QBrush & c );
public slots:
void update();
void changePosition( const MidiTime & _new_pos = MidiTime( -1 ) );
void changePosition( const MidiTime & newPos = MidiTime( -1 ) );
protected:
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
virtual void mousePressEvent( QMouseEvent * _me );
virtual void paintEvent( QPaintEvent * _pe );
virtual void resizeEvent( QResizeEvent * _re );
virtual void dragEnterEvent( QDragEnterEvent * dee );
virtual void dropEvent( QDropEvent * de );
virtual void mousePressEvent( QMouseEvent * me );
virtual void paintEvent( QPaintEvent * pe );
virtual void resizeEvent( QResizeEvent * re );
virtual QString nodeName() const
{
@@ -353,7 +353,7 @@ protected:
private:
Track * getTrack();
MidiTime getPosition( int _mouse_x );
MidiTime getPosition( int mouseX );
TrackView * m_trackView;
@@ -375,13 +375,13 @@ class TrackOperationsWidget : public QWidget
{
Q_OBJECT
public:
TrackOperationsWidget( TrackView * _parent );
TrackOperationsWidget( TrackView * parent );
~TrackOperationsWidget();
protected:
virtual void mousePressEvent( QMouseEvent * _me );
virtual void paintEvent( QPaintEvent * _pe );
virtual void mousePressEvent( QMouseEvent * me );
virtual void paintEvent( QPaintEvent * pe );
private slots:
@@ -391,8 +391,6 @@ private slots:
void recordingOn();
void recordingOff();
void clearTrack();
void assignFxLine( int channelIndex );
void createFxLine();
private:
static QPixmap * s_grip;
@@ -407,7 +405,7 @@ private:
friend class TrackView;
signals:
void trackRemovalScheduled( TrackView * _t );
void trackRemovalScheduled( TrackView * t );
} ;
@@ -437,12 +435,12 @@ public:
NumTrackTypes
} ;
Track( TrackTypes _type, TrackContainer * _tc );
Track( TrackTypes type, TrackContainer * tc );
virtual ~Track();
static Track * create( TrackTypes _tt, TrackContainer * _tc );
static Track * create( const QDomElement & _this,
TrackContainer * _tc );
static Track * create( TrackTypes tt, TrackContainer * tc );
static Track * create( const QDomElement & element,
TrackContainer * tc );
void clone();
@@ -452,20 +450,20 @@ public:
return m_type;
}
virtual bool play( const MidiTime & _start, const fpp_t _frames,
const f_cnt_t _frame_base, int _tco_num = -1 ) = 0;
virtual bool play( const MidiTime & start, const fpp_t frames,
const f_cnt_t frameBase, int tcoNum = -1 ) = 0;
virtual TrackView * createView( TrackContainerView * _view ) = 0;
virtual TrackContentObject * createTCO( const MidiTime & _pos ) = 0;
virtual TrackView * createView( TrackContainerView * view ) = 0;
virtual TrackContentObject * createTCO( const MidiTime & pos ) = 0;
virtual void saveTrackSpecificSettings( QDomDocument & _doc,
QDomElement & _parent ) = 0;
virtual void loadTrackSpecificSettings( const QDomElement & _this ) = 0;
virtual void saveTrackSpecificSettings( QDomDocument & doc,
QDomElement & parent ) = 0;
virtual void loadTrackSpecificSettings( const QDomElement & element ) = 0;
virtual void saveSettings( QDomDocument & _doc, QDomElement & _this );
virtual void loadSettings( const QDomElement & _this );
virtual void saveSettings( QDomDocument & doc, QDomElement & element );
virtual void loadSettings( const QDomElement & element );
void setSimpleSerializing()
{
@@ -473,26 +471,26 @@ public:
}
// -- for usage by TrackContentObject only ---------------
TrackContentObject * addTCO( TrackContentObject * _tco );
void removeTCO( TrackContentObject * _tco );
TrackContentObject * addTCO( TrackContentObject * tco );
void removeTCO( TrackContentObject * tco );
// -------------------------------------------------------
void deleteTCOs();
int numOfTCOs();
TrackContentObject * getTCO( int _tco_num );
int getTCONum(const TrackContentObject* _tco );
TrackContentObject * getTCO( int tcoNum );
int getTCONum(const TrackContentObject* tco );
const tcoVector & getTCOs() const
{
return( m_trackContentObjects );
return m_trackContentObjects;
}
void getTCOsInRange( tcoVector & _tco_v, const MidiTime & _start,
const MidiTime & _end );
void swapPositionOfTCOs( int _tco_num1, int _tco_num2 );
void getTCOsInRange( tcoVector & tcoV, const MidiTime & start,
const MidiTime & end );
void swapPositionOfTCOs( int tcoNum1, int tcoNum2 );
void insertTact( const MidiTime & _pos );
void removeTact( const MidiTime & _pos );
void insertTact( const MidiTime & pos );
void removeTact( const MidiTime & pos );
tact_t length() const;
@@ -505,21 +503,25 @@ public:
// name-stuff
virtual const QString & name() const
{
return( m_name );
return m_name;
}
virtual QString displayName() const
{
return( name() );
return name();
}
using Model::dataChanged;
inline int getHeight() {
return ( m_height >= MINIMAL_TRACK_HEIGHT ? m_height : DEFAULT_TRACK_HEIGHT );
inline int getHeight()
{
return m_height >= MINIMAL_TRACK_HEIGHT
? m_height
: DEFAULT_TRACK_HEIGHT;
}
inline void setHeight( int _height ) {
m_height = _height;
inline void setHeight( int height )
{
m_height = height;
}
void lock()
@@ -536,9 +538,9 @@ public:
}
public slots:
virtual void setName( const QString & _new_name )
virtual void setName( const QString & newName )
{
m_name = _new_name;
m_name = newName;
emit nameChanged();
}
@@ -585,12 +587,12 @@ public:
inline const Track * getTrack() const
{
return( m_track );
return m_track;
}
inline Track * getTrack()
{
return( m_track );
return m_track;
}
inline TrackContainerView* trackContainerView()
@@ -600,22 +602,22 @@ public:
inline TrackOperationsWidget * getTrackOperationsWidget()
{
return( &m_trackOperationsWidget );
return &m_trackOperationsWidget;
}
inline trackSettingsWidget * getTrackSettingsWidget()
{
return( &m_trackSettingsWidget );
return &m_trackSettingsWidget;
}
inline TrackContentWidget * getTrackContentWidget()
{
return( &m_trackContentWidget );
return &m_trackContentWidget;
}
bool isMovingTrack() const
{
return( m_action == MoveTrack );
return m_action == MoveTrack;
}
virtual void update();
@@ -645,13 +647,13 @@ protected:
}
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
virtual void mousePressEvent( QMouseEvent * _me );
virtual void mouseMoveEvent( QMouseEvent * _me );
virtual void mouseReleaseEvent( QMouseEvent * _me );
virtual void paintEvent( QPaintEvent * _pe );
virtual void resizeEvent( QResizeEvent * _re );
virtual void dragEnterEvent( QDragEnterEvent * dee );
virtual void dropEvent( QDropEvent * de );
virtual void mousePressEvent( QMouseEvent * me );
virtual void mouseMoveEvent( QMouseEvent * me );
virtual void mouseReleaseEvent( QMouseEvent * me );
virtual void paintEvent( QPaintEvent * pe );
virtual void resizeEvent( QResizeEvent * re );
private:
@@ -676,7 +678,7 @@ private:
private slots:
void createTCOView( TrackContentObject * _tco );
void createTCOView( TrackContentObject * tco );
} ;

View File

@@ -34,7 +34,7 @@
#include <cmath>
using namespace std;
#if defined (LMMS_BUILD_WIN32) || defined (LMMS_BUILD_APPLE)
#if defined (LMMS_BUILD_WIN32) || defined (LMMS_BUILD_APPLE) || defined(LMMS_BUILD_HAIKU)
#ifndef isnanf
#define isnanf(x) isnan(x)
#endif
@@ -217,9 +217,11 @@ static inline float logToLinearScale( float min, float max, float value )
{
const float mmax = qMax( qAbs( min ), qAbs( max ) );
const float val = value * ( max - min ) + min;
return signedPowf( val / mmax, F_E ) * mmax;
float result = signedPowf( val / mmax, F_E ) * mmax;
return isnan( result ) ? 0 : result;
}
return powf( value, F_E ) * ( max - min ) + min;
float result = powf( value, F_E ) * ( max - min ) + min;
return isnan( result ) ? 0 : result;
}
@@ -231,9 +233,11 @@ static inline float linearToLogScale( float min, float max, float value )
if( min < 0 )
{
const float mmax = qMax( qAbs( min ), qAbs( max ) );
return signedPowf( value / mmax, EXP ) * mmax;
float result = signedPowf( value / mmax, EXP ) * mmax;
return isnan( result ) ? 0 : result;
}
return powf( val, EXP ) * ( max - min ) + min;
float result = powf( val, EXP ) * ( max - min ) + min;
return isnan( result ) ? 0 : result;
}

View File

@@ -27,3 +27,7 @@
#ifdef LMMS_BUILD_WIN32
#define PLATFORM "win32"
#endif
#ifdef LMMS_BUILD_HAIKU
#define PLATFORM "Haiku"
#endif