2024-04-23 15:17:52 +00:00
|
|
|
// SPDX-FileCopyrightText: 2002-2024 PCSX2 Dev Team
|
2024-07-30 11:42:36 +00:00
|
|
|
// SPDX-License-Identifier: GPL-3.0+
|
2022-02-15 14:59:15 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2024-04-23 15:17:52 +00:00
|
|
|
#include "ui_AudioSettingsWidget.h"
|
|
|
|
|
|
|
|
#include "common/Pcsx2Defs.h"
|
|
|
|
|
2022-02-15 14:59:15 +00:00
|
|
|
#include <QtWidgets/QWidget>
|
|
|
|
|
2024-04-23 15:17:52 +00:00
|
|
|
enum class AudioBackend : u8;
|
|
|
|
enum class AudioExpansionMode : u8;
|
2022-02-15 14:59:15 +00:00
|
|
|
|
2023-10-14 08:45:09 +00:00
|
|
|
class SettingsWindow;
|
2022-02-15 14:59:15 +00:00
|
|
|
|
|
|
|
class AudioSettingsWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2023-10-14 08:45:09 +00:00
|
|
|
AudioSettingsWidget(SettingsWindow* dialog, QWidget* parent);
|
2022-02-15 14:59:15 +00:00
|
|
|
~AudioSettingsWidget();
|
|
|
|
|
2022-03-25 09:24:27 +00:00
|
|
|
private Q_SLOTS:
|
2024-04-23 15:17:52 +00:00
|
|
|
void onExpansionModeChanged();
|
|
|
|
void onSyncModeChanged();
|
2022-03-25 09:24:27 +00:00
|
|
|
|
2024-04-23 15:17:52 +00:00
|
|
|
void updateDriverNames();
|
|
|
|
void updateDeviceNames();
|
|
|
|
void updateLatencyLabel();
|
2023-01-01 12:46:07 +00:00
|
|
|
void updateVolumeLabel();
|
2024-04-23 15:17:52 +00:00
|
|
|
void onMinimalOutputLatencyChanged();
|
|
|
|
void onOutputVolumeChanged(int new_value);
|
|
|
|
void onFastForwardVolumeChanged(int new_value);
|
|
|
|
void onOutputMutedChanged(int new_state);
|
|
|
|
|
|
|
|
void onExpansionSettingsClicked();
|
|
|
|
void onStretchSettingsClicked();
|
|
|
|
|
|
|
|
private:
|
|
|
|
AudioBackend getEffectiveBackend() const;
|
|
|
|
AudioExpansionMode getEffectiveExpansionMode() const;
|
|
|
|
u32 getEffectiveExpansionBlockSize() const;
|
|
|
|
void resetVolume(bool fast_forward);
|
2023-01-01 12:46:07 +00:00
|
|
|
|
2022-02-15 14:59:15 +00:00
|
|
|
Ui::AudioSettingsWidget m_ui;
|
2024-04-23 15:17:52 +00:00
|
|
|
SettingsWindow* m_dialog;
|
2022-12-30 10:51:16 +00:00
|
|
|
u32 m_output_device_latency = 0;
|
2022-02-15 14:59:15 +00:00
|
|
|
};
|