Replace tLimit() with qBound() and remove templates.h (#5040)

* Replace tLimit() with qBound()

* Remove templates.h
This commit is contained in:
Hussam al-Homsi
2019-06-15 23:33:29 +03:00
committed by GitHub
parent f141ae68e0
commit 5431cc7942
29 changed files with 45 additions and 100 deletions

View File

@@ -39,7 +39,6 @@
#include <math.h>
#include "lmms_basics.h"
#include "templates.h"
#include "lmms_constants.h"
#include "interpolation.h"
#include "MemoryManager.h"

View File

@@ -31,7 +31,6 @@
#include "Engine.h"
#include "Model.h"
#include "JournallingObject.h"
#include "templates.h"
#include "ValueBuffer.h"
class ControllerDialog;
@@ -112,7 +111,7 @@ public:
inline static float fittedValue( float _val )
{
return tLimit<float>( _val, 0.0f, 1.0f );
return qBound<float>( 0.0f, _val, 1.0f );
}
static long runningPeriods()

View File

@@ -27,7 +27,6 @@
#define DSP_EFFECT_LIBRARY_H
#include "lmms_math.h"
#include "templates.h"
#include "lmms_constants.h"
#include "lmms_basics.h"

View File

@@ -30,7 +30,6 @@
#include <QtCore/QPoint>
#include "AutomatableModelView.h"
#include "templates.h"
class QPixmap;

View File

@@ -28,7 +28,6 @@
#include "lmms_basics.h"
#include "volume.h"
#include "templates.h"
#include "panning_constants.h"
#include "Midi.h"

View File

@@ -1,39 +0,0 @@
/*
* templates.h - miscellanous templates and algorithms
*
* Copyright (c) 2004-2008 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
* 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 TEMPLATES_H
#define TEMPLATES_H
#include <QtCore/QtAlgorithms>
template<class T>
inline T tLimit( const T x, const T x1, const T x2 )
{
return qBound( x1, x, x2 );
}
#endif