2024-04-24 15:13:51 +00:00
|
|
|
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
|
2022-12-04 11:03:45 +00:00
|
|
|
// 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
|
|
|
|
2023-11-06 13:01:38 +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();
|
|
|
|
|
2020-05-09 14:44:56 +00:00
|
|
|
private Q_SLOTS:
|
2024-04-16 06:45:15 +00:00
|
|
|
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();
|
2020-05-09 14:44:56 +00:00
|
|
|
void updateVolumeLabel();
|
2024-04-24 15:13:51 +00:00
|
|
|
void onMinimalOutputLatencyChecked(Qt::CheckState state);
|
2020-07-21 10:04:43 +00:00
|
|
|
void onOutputVolumeChanged(int new_value);
|
2020-12-08 14:48:00 +00:00
|
|
|
void onFastForwardVolumeChanged(int new_value);
|
2020-07-21 10:04:43 +00:00
|
|
|
void onOutputMutedChanged(int new_state);
|
2020-05-09 14:44:56 +00:00
|
|
|
|
2024-04-16 06:45:15 +00:00
|
|
|
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;
|
2024-04-25 03:21:12 +00:00
|
|
|
void resetVolume(bool fast_forward);
|
2020-01-24 04:51:13 +00:00
|
|
|
|
2024-04-24 15:13:51 +00:00
|
|
|
Ui::AudioSettingsWidget m_ui;
|
2023-11-06 13:01:38 +00:00
|
|
|
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
|
|
|
};
|