forked from gta-reversed/gta-reversed-modern
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
source/toolsmenu/DebugModules/Audio/UserRadioTrackDebugModule.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include "StdInc.h" | ||
#include "imgui.h" | ||
|
||
#include "AEUserRadioTrackManager.h" | ||
#include "UserRadioTrackDebugModule.h" | ||
|
||
using namespace ImGui; | ||
|
||
constexpr const char* AudioTypeFileNames[] = {"Unknown", "Vorbis", "WAV", "WMA", "QuickTime (MediaFoundation)", "FLAC"}; | ||
|
||
void UserRadioTrackDebugModule::RenderWindow() { | ||
const notsa::ui::ScopedWindow window{"User Track Audio Manager", {860.f, 290.f}, m_IsOpen}; | ||
if (!m_IsOpen) { | ||
return; | ||
} | ||
|
||
BeginGroup(); | ||
|
||
Text("Supported decoders:\n"); | ||
for (auto i = 1u; i < TOTAL_AUDIO_FILE_TYPE; i++) { | ||
Text("\t%s: %s\n", AudioTypeFileNames[i], AEUserRadioTrackManager.m_baDecodersSupported[i] ? "Supported" : "Unsupported"); | ||
} | ||
|
||
Text("\nNum tracks loaded: %u\n", AEUserRadioTrackManager.m_nUserTracksCount); | ||
Text("User tracks:\n"); | ||
const auto& trackSpan = std::span{AEUserRadioTrackManager.m_pUserTracksInfo, (size_t)AEUserRadioTrackManager.m_nUserTracksCount}; | ||
for (auto&& [i, track] : notsa::enumerate(trackSpan)) { | ||
Text( | ||
"Track %u\n\tFormat: %s\n\tPath: '%s'", | ||
i, | ||
AudioTypeFileNames[track.fileType], | ||
fs::path{AEUserRadioTrackManager.GetTrackPath(i)}.filename().string().c_str() | ||
); | ||
} | ||
EndGroup(); | ||
} | ||
|
||
void UserRadioTrackDebugModule::RenderMenuEntry() { | ||
notsa::ui::DoNestedMenuIL({"Extra", "Audio"}, [&] { ImGui::MenuItem("User Track", nullptr, &m_IsOpen); }); | ||
} |
12 changes: 12 additions & 0 deletions
12
source/toolsmenu/DebugModules/Audio/UserRadioTrackDebugModule.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#pragma once | ||
|
||
#include "DebugModule.h" | ||
|
||
class UserRadioTrackDebugModule : public DebugModule { | ||
public: | ||
void RenderWindow() override final; | ||
void RenderMenuEntry() override final; | ||
|
||
private: | ||
bool m_IsOpen{}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters