Added example audio setting control from the interface, and drafted some configuration documentation

This commit is contained in:
2025-10-11 23:29:11 +10:00
parent 1808c80479
commit eca4db0b40
5 changed files with 121 additions and 23 deletions

View File

@@ -12,7 +12,9 @@
extern configHandler_config_t* configObj;
bool bLikedSongsShow = false;
bool bAudioSettingsShow = false;
void showLikedSongs();
void showAudioSettings();
int qt_gui_entry(int argc, char** argv) {
// Initialize SDL
@@ -89,6 +91,12 @@ int qt_gui_entry(int argc, char** argv) {
bLikedSongsShow = true;
}
ImGui::SameLine();
if (ImGui::Button("Audio Settings")) {
bAudioSettingsShow = true;
}
ImGui::End();
}
@@ -96,6 +104,10 @@ int qt_gui_entry(int argc, char** argv) {
showLikedSongs();
}
if (bAudioSettingsShow) {
showAudioSettings();
}
// Render
ImGui::Render();
glViewport(0, 0, (int)io.DisplaySize.x, (int)io.DisplaySize.y);
@@ -155,13 +167,15 @@ void showLikedSongs() {
}
static int selectedSong = -1;
if (ImGui::BeginChild("Liked Songs", ImVec2(0, 200), ImGuiChildFlags_Border)) {
for (int i = 0; i < starredStruct->songCount; i++) {
if (ImGui::Selectable(starredStruct->songs[i].title, selectedSong == i)) {
selectedSong = i;
if (haveLikedSongsInfo) {
if (ImGui::BeginChild("Liked Songs", ImVec2(0, 200), ImGuiChildFlags_Border)) {
for (int i = 0; i < starredStruct->songCount; i++) {
if (ImGui::Selectable(starredStruct->songs[i].title, selectedSong == i)) {
selectedSong = i;
}
}
}
ImGui::EndChild();
}
}
if (selectedSong != -1) {
@@ -173,3 +187,22 @@ void showLikedSongs() {
ImGui::End();
}
float in_volume_val = 0;
bool hasInVolumeFirstRun = false;
void showAudioSettings() {
ImGui::Begin("Audio Settings");
if (!hasInVolumeFirstRun) {
in_volume_val = OSSPlayer_GstECont_InVolume_Get();
hasInVolumeFirstRun = true;
}
// Idk what that field is, styling?, Size, Storage, Low, High
if (ImGui::VSliderFloat("##v", ImVec2(35, 160), &in_volume_val, 0.0f, 1.0f)) {
// Data has changed
OSSPlayer_GstECont_InVolume_set(in_volume_val);
}
ImGui::End();
}