Duckstation/src/duckstation-qt/audiosettingswidget.h

50 lines
1.2 KiB
C
Raw Normal View History

2024-04-24 15:13:51 +00:00
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
2020-01-24 04:51:13 +00:00
#pragma once
2024-04-24 15:13:51 +00:00
#include "ui_audiosettingswidget.h"
#include "common/types.h"
2020-01-24 04:51:13 +00:00
#include <QtWidgets/QWidget>
2024-04-24 15:13:51 +00:00
enum class AudioBackend : u8;
enum class AudioExpansionMode : u8;
2020-01-24 04:51:13 +00:00
class SettingsWindow;
2020-01-24 04:51:13 +00:00
class AudioSettingsWidget : public QWidget
{
Q_OBJECT
public:
2024-04-24 15:13:51 +00:00
AudioSettingsWidget(SettingsWindow* dialog, QWidget* parent);
2020-01-24 04:51:13 +00:00
~AudioSettingsWidget();
private Q_SLOTS:
void onExpansionModeChanged();
void onStretchModeChanged();
2022-08-05 07:50:28 +00:00
void updateDriverNames();
2024-04-24 15:13:51 +00:00
void updateDeviceNames();
2022-07-27 14:42:41 +00:00
void updateLatencyLabel();
void updateVolumeLabel();
2024-04-24 15:13:51 +00:00
void onMinimalOutputLatencyChecked(Qt::CheckState state);
void onOutputVolumeChanged(int new_value);
void onFastForwardVolumeChanged(int new_value);
void onOutputMutedChanged(int new_state);
void onExpansionSettingsClicked();
void onStretchSettingsClicked();
2020-01-24 04:51:13 +00:00
private:
2024-04-24 15:13:51 +00:00
AudioBackend getEffectiveBackend() const;
AudioExpansionMode getEffectiveExpansionMode() const;
u32 getEffectiveExpansionBlockSize() const;
2020-01-24 04:51:13 +00:00
2024-04-24 15:13:51 +00:00
Ui::AudioSettingsWidget m_ui;
SettingsWindow* m_dialog;
2024-04-24 15:13:51 +00:00
u32 m_output_device_latency = 0;
2020-01-24 04:51:13 +00:00
};