From 07941706b3aa7abc43185cc33cf6ce09e0441bbd Mon Sep 17 00:00:00 2001 From: Fawn Sannar Date: Thu, 28 Nov 2024 00:00:50 -0700 Subject: [PATCH] Remove panning_constants.h Moves the four constants in panning_constants.h into panning.h, then removes panning.h. --- include/MidiEvent.h | 2 +- include/panning.h | 5 ++++- include/panning_constants.h | 41 ------------------------------------- src/tracks/SampleTrack.cpp | 2 +- 4 files changed, 6 insertions(+), 44 deletions(-) delete mode 100644 include/panning_constants.h diff --git a/include/MidiEvent.h b/include/MidiEvent.h index 453f6541098..b23f6a99f42 100644 --- a/include/MidiEvent.h +++ b/include/MidiEvent.h @@ -27,7 +27,7 @@ #include #include "Midi.h" -#include "panning_constants.h" +#include "panning.h" #include "volume.h" namespace lmms diff --git a/include/panning.h b/include/panning.h index 0fd74d1cc5a..2945988ba26 100644 --- a/include/panning.h +++ b/include/panning.h @@ -27,7 +27,6 @@ #define LMMS_PANNING_H #include "lmms_basics.h" -#include "panning_constants.h" #include "Midi.h" #include "volume.h" @@ -36,6 +35,10 @@ namespace lmms { +inline constexpr panning_t PanningRight = 100; +inline constexpr panning_t PanningLeft = -PanningRight; +inline constexpr panning_t PanningCenter = 0; +inline constexpr panning_t DefaultPanning = PanningCenter; inline StereoVolumeVector panningToVolumeVector( panning_t _p, float _scale = 1.0f ) diff --git a/include/panning_constants.h b/include/panning_constants.h deleted file mode 100644 index 8f40219f8d4..00000000000 --- a/include/panning_constants.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * panning_constants.h - declaration of some constants, concerning the - * panning of a note - * - * Copyright (c) 2004-2009 Tobias Doerffel - * - * 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 LMMS_PANNING_CONSTANTS_H -#define LMMS_PANNING_CONSTANTS_H - -namespace lmms -{ - - -constexpr panning_t PanningRight = ( 0 + 100 ); -constexpr panning_t PanningLeft = - PanningRight; -constexpr panning_t PanningCenter = 0; -constexpr panning_t DefaultPanning = PanningCenter; - - -} // namespace lmms - -#endif // LMMS_PANNING_CONSTANTS_H diff --git a/src/tracks/SampleTrack.cpp b/src/tracks/SampleTrack.cpp index 8ad75799dd0..c17e3718c68 100644 --- a/src/tracks/SampleTrack.cpp +++ b/src/tracks/SampleTrack.cpp @@ -29,7 +29,7 @@ #include "EffectChain.h" #include "Mixer.h" -#include "panning_constants.h" +#include "panning.h" #include "PatternStore.h" #include "PatternTrack.h" #include "SampleClip.h"