General: Clean up inclusions

Ensures that each header includes all of its dependencies that can't be
forward declared.
This commit is contained in:
Lioncash 2019-08-25 06:28:43 -04:00
parent bc8218e183
commit d7aaff25d0
49 changed files with 286 additions and 206 deletions

View File

@ -1,10 +1,13 @@
#pragma once
#include "AudioGroupPool.hpp"
#include "AudioGroupProject.hpp"
#include "AudioGroupSampleDirectory.hpp"
#include <string>
#include <unordered_set>
#include "amuse/AudioGroupPool.hpp"
#include "amuse/AudioGroupProject.hpp"
#include "amuse/AudioGroupSampleDirectory.hpp"
#include "amuse/Common.hpp"
namespace amuse {
class AudioGroupData;
class ProjectDatabase;

View File

@ -1,6 +1,8 @@
#pragma once
#include "Common.hpp"
#include <cstddef>
#include "amuse/Common.hpp"
namespace amuse {

View File

@ -1,13 +1,19 @@
#pragma once
#include <cstdint>
#include <vector>
#include <cmath>
#include <unordered_map>
#include <array>
#include "Entity.hpp"
#include "Common.hpp"
#include "athena/MemoryReader.hpp"
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
#include "amuse/Common.hpp"
#include "amuse/Entity.hpp"
#include <athena/DNA.hpp>
#include <athena/MemoryReader.hpp>
namespace amuse {
class AudioGroupData;

View File

@ -1,11 +1,13 @@
#pragma once
#include "Entity.hpp"
#include "Common.hpp"
#include <vector>
#include <array>
#include <unordered_map>
#include <memory>
#include <unordered_map>
#include <vector>
#include "amuse/Common.hpp"
#include <athena/DNA.hpp>
namespace amuse {
class AudioGroupData;

View File

@ -1,8 +1,12 @@
#pragma once
#include <unordered_map>
#include <cstdint>
#include "Common.hpp"
#include <unordered_map>
#include <vector>
#include "amuse/Common.hpp"
#include <athena/DNA.hpp>
namespace amuse {
class AudioGroupData;

View File

@ -1,15 +1,21 @@
#pragma once
#include <boo/audiodev/IAudioVoiceEngine.hpp>
#include <cstddef>
#include <cstdint>
#include <list>
#include <memory>
#include <mutex>
#include <unordered_map>
#include <vector>
#include "amuse/IBackendVoice.hpp"
#include "amuse/IBackendSubmix.hpp"
#include "amuse/IBackendVoiceAllocator.hpp"
#include <boo/audiodev/IAudioSubmix.hpp>
#include <boo/audiodev/IAudioVoiceEngine.hpp>
#include <boo/audiodev/IMIDIReader.hpp>
#include <boo/audiodev/MIDIDecoder.hpp>
#include "IBackendVoice.hpp"
#include "IBackendSubmix.hpp"
#include "IBackendVoiceAllocator.hpp"
#include <mutex>
#include <list>
#include <unordered_map>
namespace amuse {

View File

@ -1,17 +1,16 @@
#pragma once
#include <algorithm>
#include <limits>
#include <cstdio>
#include <atomic>
#include <cstdint>
#include <cstdarg>
#include <cstdio>
#include <limits>
#include <string>
#include <string_view>
#include <cstring>
#include <atomic>
#include <unordered_map>
#include "athena/DNA.hpp"
#include "logvisor/logvisor.hpp"
#include <athena/DNA.hpp>
#include <logvisor/logvisor.hpp>
#ifndef _WIN32
#include <strings.h>

View File

@ -1,10 +1,12 @@
#pragma once
#include "AudioGroupData.hpp"
#include "Common.hpp"
#include <string>
#include <vector>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <vector>
#include "amuse/AudioGroupData.hpp"
#include "amuse/Common.hpp"
namespace amuse {

View File

@ -1,7 +1,6 @@
#pragma once
#include <cstdint>
#include <cfloat>
constexpr int16_t DSPSampClamp(int32_t val) {
if (val < -32768)

View File

@ -1,8 +1,11 @@
#pragma once
#include "Common.hpp"
#include <cstring>
#include <string>
#include <vector>
#include "amuse/Common.hpp"
namespace amuse {
struct CaseInsensitiveCompare {

View File

@ -1,8 +1,5 @@
#pragma once
#include <cstdint>
#include <cstdlib>
namespace amuse {
struct ChannelMap;

View File

@ -1,9 +1,10 @@
#pragma once
#include "EffectBase.hpp"
#include "Common.hpp"
#include <cstdint>
#include "amuse/Common.hpp"
#include "amuse/EffectBase.hpp"
namespace amuse {
template <typename T>
class EffectChorusImp;

View File

@ -1,11 +1,12 @@
#pragma once
#include "EffectBase.hpp"
#include "IBackendVoice.hpp"
#include "Common.hpp"
#include <cstdint>
#include <memory>
#include "amuse/Common.hpp"
#include "amuse/EffectBase.hpp"
#include "amuse/IBackendVoice.hpp"
namespace amuse {
template <typename T>
class EffectDelayImp;

View File

@ -1,9 +1,11 @@
#pragma once
#include "EffectBase.hpp"
#include "amuse/Common.hpp"
#include <cstdint>
#include <memory>
#include "amuse/Common.hpp"
#include "amuse/EffectBase.hpp"
namespace amuse {
/** Parameters needed to create EffectReverbStd */

View File

@ -1,11 +1,11 @@
#pragma once
#include "Entity.hpp"
#include "Common.hpp"
#include "Voice.hpp"
#include <memory>
#include <cmath>
#include <cfloat>
#include <cmath>
#include "amuse/Common.hpp"
#include "amuse/Entity.hpp"
#include "amuse/Voice.hpp"
namespace amuse {
class Listener;
@ -32,6 +32,8 @@ inline float Normalize(Vector3f& out) {
/** Voice wrapper with positional-3D level control */
class Emitter : public Entity {
friend class Engine;
ObjToken<Voice> m_vox;
Vector3f m_pos = {};
Vector3f m_dir = {};
@ -43,7 +45,6 @@ class Emitter : public Entity {
bool m_dirty = true;
Voice::VolumeCache m_attCache;
friend class Engine;
void _destroy();
float _attenuationCurve(float dist) const;
void _update();

View File

@ -1,25 +1,27 @@
#pragma once
#include <memory>
#include <cstddef>
#include <cstdint>
#include <list>
#include <memory>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include "Emitter.hpp"
#include "Listener.hpp"
#include "AudioGroupSampleDirectory.hpp"
#include "Sequencer.hpp"
#include "Studio.hpp"
#include "IBackendVoiceAllocator.hpp"
#include "amuse/AudioGroupSampleDirectory.hpp"
#include "amuse/Emitter.hpp"
#include "amuse/IBackendVoiceAllocator.hpp"
#include "amuse/Listener.hpp"
#include "amuse/Sequencer.hpp"
#include "amuse/Studio.hpp"
namespace amuse {
class IBackendVoiceAllocator;
class Voice;
class Submix;
class Emitter;
class AudioGroup;
class AudioGroupData;
class Emitter;
class IBackendVoiceAllocator;
class IMIDIReader;
class Submix;
class Voice;
enum class AmplitudeMode {
PerSample, /**< Per-sample amplitude evaluation (dt = 1.0 / sampleRate, rather CPU demanding) */
@ -28,10 +30,10 @@ enum class AmplitudeMode {
/** Main audio playback system for a single audio output */
class Engine {
friend class Voice;
friend class Emitter;
friend class Sequencer;
friend class Studio;
friend class Voice;
friend struct Sequencer::ChannelState;
IBackendVoiceAllocator& m_backend;

View File

@ -1,13 +1,11 @@
#pragma once
#include <cstdint>
#include <functional>
#include <cassert>
#include "Common.hpp"
#include "amuse/Common.hpp"
namespace amuse {
class Engine;
class AudioGroup;
class Engine;
/** Common 'engine child' class */
class Entity : public IObj {

View File

@ -1,10 +1,13 @@
#pragma once
#include "AudioGroupPool.hpp"
#include <cstdint>
namespace amuse {
class Voice;
struct ADSR;
struct ADSRDLS;
/** Per-sample state tracker for ADSR envelope data */
class Envelope {
public:

View File

@ -1,10 +1,6 @@
#pragma once
#include <memory>
namespace amuse {
class IBackendVoice;
class Voice;
enum class SubmixFormat { Int16, Int32, Float };

View File

@ -1,15 +1,14 @@
#pragma once
#include <memory>
#include <functional>
#include <vector>
namespace amuse {
class IBackendVoice;
class IBackendSubmix;
class Voice;
class Submix;
class Engine;
class IBackendSubmix;
class IBackendVoice;
class Submix;
class Voice;
/** Same enum as boo for describing speaker-configuration */
enum class AudioChannelSet { Stereo, Quad, Surround51, Surround71, Unknown = 0xff };

View File

@ -1,14 +1,16 @@
#pragma once
#include "Entity.hpp"
#include "AudioGroupProject.hpp"
#include "SongState.hpp"
#include "Studio.hpp"
#include "Voice.hpp"
#include <cstddef>
#include <cstdint>
#include <unordered_map>
#include <unordered_set>
#include <memory>
#include <list>
#include "amuse/AudioGroupProject.hpp"
#include "amuse/Common.hpp"
#include "amuse/Entity.hpp"
#include "amuse/SongState.hpp"
#include "amuse/Studio.hpp"
#include "amuse/Voice.hpp"
namespace amuse {

View File

@ -1,7 +1,7 @@
#pragma once
#include <vector>
#include <cstdint>
#include <vector>
namespace amuse {

View File

@ -1,10 +1,9 @@
#pragma once
#include <cstdint>
#include <vector>
#include <array>
#include <list>
#include "Entity.hpp"
#include <cstdint>
#include "amuse/Entity.hpp"
namespace amuse {
class Sequencer;
@ -13,8 +12,8 @@ enum class SongPlayState { Stopped, Playing };
/** Real-time state of Song execution */
class SongState {
friend class Voice;
friend class SongConverter;
friend class Voice;
/** Song header */
struct Header {

View File

@ -1,11 +1,12 @@
#pragma once
#include <cstdint>
#include <tuple>
#include <vector>
#include <list>
#include "Entity.hpp"
#include "Common.hpp"
#include "AudioGroupPool.hpp"
#include "amuse/AudioGroupPool.hpp"
#include "amuse/Common.hpp"
#include "amuse/Entity.hpp"
/* Squelch Win32 macro pollution >.< */
#undef SendMessage

View File

@ -1,10 +1,10 @@
#pragma once
#include <memory>
#include <list>
#include "Entity.hpp"
#include "Submix.hpp"
#include <type_traits>
#include "amuse/Common.hpp"
#include "amuse/Entity.hpp"
#include "amuse/Submix.hpp"
namespace amuse {
struct StudioSend;

View File

@ -1,14 +1,16 @@
#pragma once
#include <cstdint>
#include <memory>
#include "SoundMacroState.hpp"
#include "IBackendSubmix.hpp"
#include "IBackendVoice.hpp"
#include "EffectBase.hpp"
#include "EffectChorus.hpp"
#include "EffectDelay.hpp"
#include "EffectReverb.hpp"
#include <unordered_set>
#include <vector>
#include "amuse/EffectBase.hpp"
#include "amuse/EffectChorus.hpp"
#include "amuse/EffectDelay.hpp"
#include "amuse/EffectReverb.hpp"
#include "amuse/IBackendSubmix.hpp"
#include "amuse/SoundMacroState.hpp"
namespace amuse {
class IBackendSubmix;

View File

@ -2,15 +2,16 @@
#include <cstdint>
#include <cstdlib>
#include <memory>
#include <list>
#include <memory>
#include <queue>
#include "SoundMacroState.hpp"
#include "Entity.hpp"
#include "AudioGroupSampleDirectory.hpp"
#include "AudioGroup.hpp"
#include "Envelope.hpp"
#include "Studio.hpp"
#include "amuse/AudioGroup.hpp"
#include "amuse/AudioGroupSampleDirectory.hpp"
#include "amuse/Entity.hpp"
#include "amuse/Envelope.hpp"
#include "amuse/SoundMacroState.hpp"
#include "amuse/Studio.hpp"
namespace amuse {
class IBackendVoice;
@ -26,20 +27,20 @@ enum class VoiceState {
/** Individual source of audio */
class Voice : public Entity {
friend class Engine;
friend class Sequencer;
friend struct SoundMacroState;
friend class Envelope;
friend class Emitter;
friend struct SoundMacro::CmdScaleVolume;
friend struct SoundMacro::CmdKeyOff;
friend struct SoundMacro::CmdScaleVolumeDLS;
friend struct SoundMacro::CmdReturn;
friend class Engine;
friend class Envelope;
friend class Sequencer;
friend struct SoundMacro::CmdGetMessage;
friend struct SoundMacro::CmdGoSub;
friend struct SoundMacro::CmdKeyOff;
friend struct SoundMacro::CmdModeSelect;
friend struct SoundMacro::CmdReturn;
friend struct SoundMacro::CmdScaleVolume;
friend struct SoundMacro::CmdScaleVolumeDLS;
friend struct SoundMacro::CmdTrapEvent;
friend struct SoundMacro::CmdUntrapEvent;
friend struct SoundMacro::CmdGetMessage;
friend struct SoundMacro::CmdModeSelect;
friend struct SoundMacroState;
struct VolumeCache {
bool m_curDLS = false; /**< Current DLS status of cached lookup */

View File

@ -1,21 +1,21 @@
#pragma once
#include "AudioGroup.hpp"
#include "AudioGroupData.hpp"
#include "AudioGroupPool.hpp"
#include "AudioGroupProject.hpp"
#include "AudioGroupSampleDirectory.hpp"
#include "ContainerRegistry.hpp"
#include "EffectChorus.hpp"
#include "EffectDelay.hpp"
#include "EffectReverb.hpp"
#include "Emitter.hpp"
#include "Engine.hpp"
#include "Envelope.hpp"
#include "Listener.hpp"
#include "Sequencer.hpp"
#include "SoundMacroState.hpp"
#include "SongConverter.hpp"
#include "SongState.hpp"
#include "Submix.hpp"
#include "Voice.hpp"
#include "amuse/AudioGroup.hpp"
#include "amuse/AudioGroupData.hpp"
#include "amuse/AudioGroupPool.hpp"
#include "amuse/AudioGroupProject.hpp"
#include "amuse/AudioGroupSampleDirectory.hpp"
#include "amuse/ContainerRegistry.hpp"
#include "amuse/EffectChorus.hpp"
#include "amuse/EffectDelay.hpp"
#include "amuse/EffectReverb.hpp"
#include "amuse/Emitter.hpp"
#include "amuse/Engine.hpp"
#include "amuse/Envelope.hpp"
#include "amuse/Listener.hpp"
#include "amuse/Sequencer.hpp"
#include "amuse/SoundMacroState.hpp"
#include "amuse/SongConverter.hpp"
#include "amuse/SongState.hpp"
#include "amuse/Submix.hpp"
#include "amuse/Voice.hpp"

View File

@ -1,9 +1,13 @@
#include "amuse/AudioGroup.hpp"
#include "amuse/AudioGroupData.hpp"
#include <regex>
#include <sstream>
#include "amuse/AudioGroupData.hpp"
#include <athena/FileReader.hpp>
#include <fmt/ostream.h>
#include <sstream>
using namespace std::literals;

View File

@ -1,12 +1,15 @@
#include <athena/MemoryWriter.hpp>
#include "amuse/AudioGroupPool.hpp"
#include "amuse/AudioGroupData.hpp"
#include "amuse/Common.hpp"
#include "amuse/Entity.hpp"
#include "amuse/AudioGroupData.hpp"
#include "logvisor/logvisor.hpp"
#include "athena/FileWriter.hpp"
#include "athena/FileReader.hpp"
#include "athena/VectorWriter.hpp"
#include <athena/FileReader.hpp>
#include <athena/FileWriter.hpp>
#include <athena/MemoryWriter.hpp>
#include <athena/VectorWriter.hpp>
#include <logvisor/logvisor.hpp>
using namespace std::literals;

View File

@ -1,11 +1,13 @@
#include <athena/VectorWriter.hpp>
#include "amuse/AudioGroupProject.hpp"
#include "amuse/AudioGroupPool.hpp"
#include "amuse/AudioGroupSampleDirectory.hpp"
#include "amuse/AudioGroupData.hpp"
#include "athena/MemoryReader.hpp"
#include "athena/FileWriter.hpp"
#include "athena/FileReader.hpp"
#include <athena/MemoryReader.hpp>
#include <athena/FileReader.hpp>
#include <athena/FileWriter.hpp>
#include <athena/VectorWriter.hpp>
namespace amuse {

View File

@ -1,15 +1,19 @@
#include "amuse/AudioGroupSampleDirectory.hpp"
#include "amuse/Common.hpp"
#include <cstring>
#include "amuse/AudioGroup.hpp"
#include "amuse/AudioGroupData.hpp"
#include "amuse/Common.hpp"
#include "amuse/DirectoryEnumerator.hpp"
#include "amuse/DSPCodec.hpp"
#include "amuse/N64MusyXCodec.hpp"
#include "amuse/DirectoryEnumerator.hpp"
#include "amuse/AudioGroup.hpp"
#include "athena/MemoryReader.hpp"
#include "athena/FileWriter.hpp"
#include "athena/FileReader.hpp"
#include "athena/VectorWriter.hpp"
#include <cstring>
#include <athena/FileReader.hpp>
#include <athena/FileWriter.hpp>
#include <athena/MemoryReader.hpp>
#include <athena/VectorWriter.hpp>
#ifndef _WIN32
#include <fcntl.h>
#else

View File

@ -1,7 +1,8 @@
#include "amuse/BooBackend.hpp"
#include "amuse/Voice.hpp"
#include "amuse/Submix.hpp"
#include "amuse/Engine.hpp"
#include "amuse/Submix.hpp"
#include "amuse/Voice.hpp"
namespace amuse {

View File

@ -1,5 +1,11 @@
#include "amuse/Common.hpp"
#include "logvisor/logvisor.hpp"
#ifndef _WIN32
#include <cstdio>
#include <memory>
#endif
#include <logvisor/logvisor.hpp>
using namespace std::literals;

View File

@ -1,11 +1,14 @@
#include "amuse/ContainerRegistry.hpp"
#include "amuse/Common.hpp"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <memory>
#include <string>
#include <unordered_map>
#include "amuse/Common.hpp"
#include <zlib.h>
#include <lzokay.hpp>

View File

@ -1,7 +1,9 @@
#include "amuse/DSPCodec.hpp"
#include <algorithm>
#include <cfloat>
#include <cmath>
#include <memory.h>
#include <cstdlib>
#if __SWITCH__
#include "switch_math.hpp"

View File

@ -1,8 +1,10 @@
#include "amuse/EffectChorus.hpp"
#include <cmath>
#include <cstring>
#include "amuse/Common.hpp"
#include "amuse/IBackendVoice.hpp"
#include <cstring>
#include <cmath>
namespace amuse {

View File

@ -1,8 +1,10 @@
#include "amuse/EffectDelay.hpp"
#include <cmath>
#include <cstring>
#include "amuse/Common.hpp"
#include "amuse/IBackendVoice.hpp"
#include <cstring>
#include <cmath>
namespace amuse {

View File

@ -1,8 +1,10 @@
#include "amuse/EffectReverb.hpp"
#include "amuse/IBackendVoice.hpp"
#include <cmath>
#include <cstring>
#include "amuse/IBackendVoice.hpp"
namespace amuse {
/* clang-format off */

View File

@ -1,7 +1,8 @@
#include "amuse/Emitter.hpp"
#include "amuse/Engine.hpp"
#include "amuse/Listener.hpp"
#include "amuse/Voice.hpp"
#include "amuse/Engine.hpp"
namespace amuse {

View File

@ -1,12 +1,13 @@
#include "amuse/Engine.hpp"
#include "amuse/Voice.hpp"
#include "amuse/Submix.hpp"
#include "amuse/Sequencer.hpp"
#include "amuse/AudioGroup.hpp"
#include "amuse/AudioGroupData.hpp"
#include "amuse/Common.hpp"
#include "amuse/IBackendVoice.hpp"
#include "amuse/IBackendVoiceAllocator.hpp"
#include "amuse/AudioGroupData.hpp"
#include "amuse/AudioGroup.hpp"
#include "amuse/Common.hpp"
#include "amuse/Sequencer.hpp"
#include "amuse/Submix.hpp"
#include "amuse/Voice.hpp"
namespace amuse {

View File

@ -1,4 +1,6 @@
#include "amuse/Envelope.hpp"
#include "amuse/AudioGroupPool.hpp"
#include "amuse/Voice.hpp"
namespace amuse {

View File

@ -1,7 +1,7 @@
#include "amuse/N64MusyXCodec.hpp"
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include <cstdint>
#include <cstring>
/* Acknowledgements:
* SubDrag for N64 Sound Tool (http://www.goldeneyevault.com/viewfile.php?id=212)

View File

@ -1,9 +1,10 @@
#include "amuse/Sequencer.hpp"
#include "amuse/Submix.hpp"
#include "amuse/Voice.hpp"
#include "amuse/Engine.hpp"
#include <map>
#include "amuse/Engine.hpp"
#include "amuse/Voice.hpp"
namespace amuse {
void Sequencer::ChannelState::_bringOutYourDead() {

View File

@ -1,9 +1,13 @@
#include "amuse/SongConverter.hpp"
#include "amuse/SongState.hpp"
#include "amuse/Common.hpp"
#include <algorithm>
#include <array>
#include <cstdlib>
#include <map>
#include "amuse/Common.hpp"
#include "amuse/SongState.hpp"
namespace amuse {
constexpr uint8_t clamp7(uint8_t val) { return std::max(0, std::min(127, int(val))); }

View File

@ -1,7 +1,9 @@
#include "amuse/SongState.hpp"
#include <cmath>
#include "amuse/Common.hpp"
#include "amuse/Sequencer.hpp"
#include <cmath>
namespace amuse {

View File

@ -1,10 +1,13 @@
#include "amuse/SoundMacroState.hpp"
#include "amuse/Voice.hpp"
#include "amuse/Engine.hpp"
#include "amuse/Common.hpp"
#include <cmath>
#include <cstring>
#include "amuse/AudioGroup.hpp"
#include "amuse/AudioGroupPool.hpp"
#include <cstring>
#include "amuse/Common.hpp"
#include "amuse/Engine.hpp"
#include "amuse/Voice.hpp"
using namespace std::literals;

View File

@ -1,16 +1,18 @@
#include "amuse/Voice.hpp"
#include "amuse/Submix.hpp"
#include "amuse/IBackendVoice.hpp"
#include "amuse/IBackendVoiceAllocator.hpp"
#include "amuse/AudioGroup.hpp"
#include "amuse/Common.hpp"
#include "amuse/Engine.hpp"
#include "amuse/DSPCodec.hpp"
#include "amuse/N64MusyXCodec.hpp"
#include "amuse/VolumeTable.hpp"
#include <cmath>
#include <cstring>
#include "amuse/AudioGroup.hpp"
#include "amuse/Common.hpp"
#include "amuse/DSPCodec.hpp"
#include "amuse/Engine.hpp"
#include "amuse/IBackendVoice.hpp"
#include "amuse/IBackendVoiceAllocator.hpp"
#include "amuse/N64MusyXCodec.hpp"
#include "amuse/Submix.hpp"
#include "amuse/VolumeTable.hpp"
namespace amuse {
float Voice::VolumeCache::getVolume(float vol, bool dls) {

View File

@ -1,7 +1,9 @@
#include "amuse/VolumeTable.hpp"
#include "amuse/Common.hpp"
#include <cmath>
#include "amuse/Common.hpp"
namespace amuse {
static const float VolumeTable[] = {