chatgui: add sound playback via miniaudio (MP3 notification sounds)
- SoundManager singleton wraps ma_engine + ma_sound (non-blocking, background thread) - MP3 files embedded in QRC, decoded to PCM at startup with MA_SOUND_FLAG_DECODE - miniaudio.h (MIT) in lib/, IMPLEMENTATION in separate miniaudio_impl.c - Sound settings page in SettingsDialog: enable/disable, volume slider (0-100%) - Config keys [gui] sound_enabled, sound_volume - Incoming messages trigger msg_incoming.mp3 sound
This commit is contained in:
1 parent
f6f7e12192
commit
c2ad2e78c3
25 files changed
+101647
-2
No files matched your search
@@ -4,6 +4,7 @@
|
||||
#include "databasesettingspage.h"
|
||||
#include "statuspage.h"
|
||||
#include "nodespage.h"
|
||||
#include "soundsettingspage.h"
|
||||
#include "../transport/gui_bridge.h"
|
||||
#include "../../lib/mem.h"
|
||||
#include "../db/db_manager.h"
|
||||
@@ -44,6 +45,7 @@ SettingsDialog::SettingsDialog(const QString& configPath, DbManager* db, QWidget
|
||||
m_categoryList->addItem("Database");
|
||||
m_categoryList->addItem("Status");
|
||||
m_categoryList->addItem("Nodes");
|
||||
m_categoryList->addItem("Sound");
|
||||
mainLayout->addWidget(m_categoryList);
|
||||
|
||||
// --- Right panel: stacked pages ---
|
||||
@@ -83,6 +85,9 @@ SettingsDialog::SettingsDialog(const QString& configPath, DbManager* db, QWidget
|
||||
// Nodes page
|
||||
m_nodesPage = new NodesPage(db, m_pages);
|
||||
m_pages->addWidget(m_nodesPage);
|
||||
|
||||
m_soundPage = new SoundSettingsPage(m_pages);
|
||||
m_pages->addWidget(m_soundPage);
|
||||
rightLayout->addWidget(m_pages, 1);
|
||||
|
||||
// --- Bottom buttons ---
|
||||
@@ -119,6 +124,7 @@ SettingsDialog::SettingsDialog(const QString& configPath, DbManager* db, QWidget
|
||||
// Load current values
|
||||
loadProfileFromConfig(m_configPath);
|
||||
m_networkPage->loadFromConfig(m_configPath);
|
||||
m_soundPage->loadFromConfig(m_configPath);
|
||||
m_categoryList->setCurrentRow(0);
|
||||
}
|
||||
|
||||
@@ -142,6 +148,7 @@ void SettingsDialog::onCategoryChanged(int row) {
|
||||
if (row == 2) m_databasePage->refreshStatus();
|
||||
if (row == 3) m_statusPage->refreshStatus();
|
||||
if (row == 4) m_nodesPage->refreshNodes();
|
||||
if (row == 5) m_soundPage->loadFromConfig(m_configPath);
|
||||
}
|
||||
|
||||
void SettingsDialog::onSave() {
|
||||
@@ -181,5 +188,6 @@ void SettingsDialog::onSave() {
|
||||
f.close();
|
||||
|
||||
m_networkPage->saveToConfig(m_configPath);
|
||||
m_soundPage->saveToConfig(m_configPath);
|
||||
accept();
|
||||
}
|
||||
Reference in new issue
Block a user