Skip to content

File Constants.h

File List > Amplitude > Core > Common > Constants.h

Go to the documentation of this file

// Copyright (c) 2021-present Sparky Studios. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once

#ifndef _AM_CORE_COMMON_CONSTANTS_H
#define _AM_CORE_COMMON_CONSTANTS_H

#include <SparkyStudios/Audio/Amplitude/Core/Common/Types.h>

namespace SparkyStudios::Audio::Amplitude
{
    constexpr AmObjectID kAmInvalidObjectId = 0;

    constexpr AmBusID kAmMasterBusId = 1;

    constexpr AmTime kAmSecond = 1000.0;

    constexpr AmReal32 kEpsilon = 1e-6f;

    constexpr AmTime kMinFadeDuration = 10.0;

    constexpr AmInt32 kAmFixedPointBits = 15;

    constexpr AmInt32 kAmFixedPointUnit = (1 << kAmFixedPointBits);

    constexpr AmInt32 kAmFixedPointMask = (kAmFixedPointBits - 1);

    constexpr AmUInt64 kAmMaxSupportedFrameCount = 16384;

    constexpr AmUInt32 kAmMaxSupportedAmbisonicOrder = 3;

    constexpr AmSize kAmRoomSurfaceCount = 6;

    constexpr AmSize kAmMonoChannelCount = 1;

    constexpr AmSize kAmStereoChannelCount = 2;

    constexpr AmSize kAm51SurroundChannelCount = 6;

    constexpr AmSize kAm71SurroundChannelCount = 8;

    constexpr AmSize kAmFirstOrderAmbisonicChannelCount = 4;

    constexpr AmSize kAmSecondOrderAmbisonicChannelCount = 9;

    constexpr AmSize kAmThirdOrderAmbisonicChannelCount = 16;

    constexpr AmUInt32 kAmMaxSupportedChannelCount = (kAmMaxSupportedAmbisonicOrder + 1) * (kAmMaxSupportedAmbisonicOrder + 1);

    constexpr AmUInt32 kAmAirAbsorptionBandCount = 3;

    constexpr AmReal32 kLowCutoffFrequencies[kAmAirAbsorptionBandCount] = { 0.0f, 800.0f, 8000.0f };

    constexpr AmReal32 kHighCutoffFrequencies[kAmAirAbsorptionBandCount] = { 800.0f, 8000.0f, 22000.0f };

    constexpr AmSize kAmMaxChannelInstances = 1024;
} // namespace SparkyStudios::Audio::Amplitude

#endif // _AM_CORE_COMMON_CONSTANTS_H