Skip to content

Commit

Permalink
fix: Stability fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
na2axl committed Dec 11, 2024
1 parent 54df06f commit 2ac4501
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ if (BUILD_TOOLS)
add_subdirectory(tools/amac)
add_subdirectory(tools/ampk)
add_subdirectory(tools/amir)
add_subdirectory(tools/ampm)

Check failure on line 522 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / Amplitude Audio SDK / [release] Windows Latest MSVC

add_subdirectory given source "tools/ampm" which is not an existing

Check failure on line 522 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / Amplitude Audio SDK / [release] Ubuntu Latest GCC

add_subdirectory given source "tools/ampm" which is not an existing

Check failure on line 522 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / Amplitude Audio SDK / [release] macOS x64 Latest Clang

add_subdirectory given source "tools/ampm" which is not an existing

Check failure on line 522 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / Amplitude Audio SDK / [release] macOS arm64 Latest Clang

add_subdirectory given source "tools/ampm" which is not an existing

Check failure on line 522 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / Amplitude Audio SDK / [debug] Windows Latest MSVC

add_subdirectory given source "tools/ampm" which is not an existing

Check failure on line 522 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / Amplitude Audio SDK / [debug] Ubuntu Latest GCC

add_subdirectory given source "tools/ampm" which is not an existing

Check failure on line 522 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / Amplitude Audio SDK / [debug] macOS x64 Latest Clang

add_subdirectory given source "tools/ampm" which is not an existing

Check failure on line 522 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / Amplitude Audio SDK / [debug] macOS arm64 Latest Clang

add_subdirectory given source "tools/ampm" which is not an existing
endif ()

if (BUILD_SAMPLES OR UNIT_TESTS)
Expand Down
9 changes: 4 additions & 5 deletions include/SparkyStudios/Audio/Amplitude/Core/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <SparkyStudios/Audio/Amplitude/Core/Common.h>

#include <SparkyStudios/Audio/Amplitude/Core/Device.h>
#include <SparkyStudios/Audio/Amplitude/Core/Driver.h>
#include <SparkyStudios/Audio/Amplitude/Core/Entity.h>
#include <SparkyStudios/Audio/Amplitude/Core/Environment.h>
#include <SparkyStudios/Audio/Amplitude/Core/Event.h>
Expand Down Expand Up @@ -77,7 +76,7 @@ namespace SparkyStudios::Audio::Amplitude
* and provides methods to create, destroy, and manipulate them. You can also
* access to the internal state of the engine through the public API.
*
* The `Engine` is a singleton class and you can access it using the `amEngine` macro. Before
* The `Engine` is a singleton class, and you can access it using the `amEngine` macro. Before
* using most of the methods of the engine, you need to [initialize the
* engine](../../../integration/initializing-the-engine.md) first, for example:
* ```cpp
Expand Down Expand Up @@ -397,7 +396,7 @@ namespace SparkyStudios::Audio::Amplitude
* @brief Starts the loading of sound files referenced in loaded sound banks.
*
* This process will run in another thread. You must call @ref TryFinalizeLoadSoundFiles `TryFinalizeLoadSoundFiles()` to
* know when the loading has completed, and to automaticaly release used resources.
* know when the loading has completed, and to automatically release used resources.
*/
virtual void StartLoadSoundFiles() = 0;

Expand Down Expand Up @@ -578,7 +577,7 @@ namespace SparkyStudios::Audio::Amplitude
* @example
* ```cpp
* // Assuming the asset file is located in "sounds/env/forest/calm_lake_bg.amsound"
* // Note that the return value in this case is a indeed a `SoundHandle`
* // Note that the return value in this case is indeed a `SoundHandle`
* SoundObjectHandle handle = amEngine->GetSoundObjectHandleFromFile("env/forest/calm_lake_bg.amsound");
* ```
*
Expand Down Expand Up @@ -1746,7 +1745,7 @@ namespace SparkyStudios::Audio::Amplitude
#pragma region Singleton Implementation

/**
* @brief Returns an unique instance of the Amplitude Engine.
* @brief Returns a unique instance of the Amplitude Engine.
*/
[[nodiscard]] static Engine* GetInstance();

Expand Down
4 changes: 4 additions & 0 deletions src/Core/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,10 @@ namespace SparkyStudios::Audio::Amplitude

Engine* Engine::GetInstance()
{
// Cannot implement the singleton pattern with an uninitialized memory manager.
if (!MemoryManager::IsInitialized())
return nullptr;

// Amplitude Engine unique instance.
if (gAmplitude == nullptr)
gAmplitude.reset(ampoolnew(eMemoryPoolKind_Engine, EngineImpl));
Expand Down
2 changes: 1 addition & 1 deletion src/Mixer/Amplimix.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ namespace SparkyStudios::Audio::Amplitude
AmMutexHandle mutex = nullptr; // mutex for thread-safe access
std::unordered_map<AmThreadID, bool> mutexLocked; // true if mutex is locked

~AmplimixLayerImpl();
~AmplimixLayerImpl() override;

/**
* @brief Resets the layer.
Expand Down

0 comments on commit 2ac4501

Please sign in to comment.