ACMX 2.139.0
Dual-Backend Real-Time GPU Video Synthesis
Loading...
Searching...
No Matches
audio-window.hpp
Go to the documentation of this file.
1/**
2 * @file audio-window.hpp
3 * @brief Qt6 dialog for configuring audio reactivity settings.
4 *
5 * Provides device selection (input / output), sensitivity, channel count,
6 * pass-through/file playback, recording options, and an optional file-based
7 * audio source that replaces live microphone input for audio-reactive shaders.
8 */
9
10#ifndef AUDIOSETTINGS_HPP
11#define AUDIOSETTINGS_HPP
12
13#include <QCheckBox>
14#include <QComboBox>
15#include <QDialog>
16#include <QDoubleSpinBox>
17#include <QHBoxLayout>
18#include <QLabel>
19#include <QLineEdit>
20#include <QPushButton>
21#include <QSlider>
22#include <QSpinBox>
23#include <QVBoxLayout>
24
25/**
26 * @brief Dialog for configuring live and file-based audio reactivity options.
27 */
28class AudioSettings : public QDialog {
29 Q_OBJECT
30
31 public:
32 explicit AudioSettings(QWidget *parent = nullptr);
33
34 bool isAudioReactivityEnabled() const;
35 bool isAudioPassThroughEnabled() const;
36 bool isRecordAudioEnabled() const;
37 double getRecordVolume() const;
38 int getNumberOfChannels() const;
39 double getSensitivity() const;
40 int getInputDeviceIndex() const;
41 int getOutputDeviceIndex() const;
42 /// @brief Check whether a file or M3U audio source is selected and has a path.
43 /// @return @c true when either mutually exclusive source is ready.
44 bool isAudioFileEnabled() const;
45 /// @brief Get the effective audio file or M3U playlist path.
46 /// @return The selected source path, or an empty string if none is selected.
47 QString getAudioFilePath() const;
48 /// @brief Check whether the M3U playlist overrides the single audio file.
49 bool isAudioPlaylistEnabled() const;
50 /// @brief Get the selected M3U playlist path.
51 QString getAudioPlaylistPath() const;
52 /// @brief Check whether "stop when audio ends" is selected.
53 /// @return @c true if the audio-trunc checkbox is checked.
54 bool isAudioTruncEnabled() const;
55 /// @brief Check whether file audio should restart when it reaches the end.
56 /// @return @c true if the audio-repeat checkbox is checked.
57 bool isAudioRepeatEnabled() const;
58 /// @brief Check whether spectrum history buffers are enabled.
59 /// @return @c true when --enable-audio-buffers should be emitted.
60 bool isAudioBuffersEnabled() const;
61 /// @brief Number of spectrum history frames requested.
62 /// @return Frame count for --enable-audio-buffers.
63 int getAudioBufferFrames() const;
64 /// @brief Audio startup warmup rate in 1/sec.
65 /// @return Warmup slope where 0.5 ~= 2 seconds to full intensity.
66 double getAudioWarmRate() const;
67
68 private:
70 void loadUiState();
71 void saveUiState();
73
78 QSpinBox *channelSpinBox;
82 QCheckBox *audioFileCheckBox; ///< Toggle file-based audio input.
83 QLineEdit *audioFileLineEdit; ///< Displays the selected audio file path.
84 QPushButton *audioFileBrowseButton; ///< Opens a file dialog to choose an audio file.
85 QCheckBox *audioPlaylistCheckBox; ///< Use an M3U playlist instead of the audio file.
86 QLineEdit *audioPlaylistLineEdit; ///< Displays the selected M3U playlist path.
87 QPushButton *audioPlaylistBrowseButton; ///< Opens a file dialog to choose an M3U playlist.
88 QPushButton *audioPlaylistEditButton; ///< Opens the M3U playlist editor.
89 QCheckBox *audioTruncCheckBox; ///< Stop playback when the audio file ends.
90 QCheckBox *audioRepeatCheckBox; ///< Restart playback when the audio file ends.
91 QCheckBox *audioBuffersCheckBox; ///< Enable spectrum history buffer CLI option.
92 QSpinBox *audioBuffersSpinBox; ///< Number of spectrum history frames.
93 QDoubleSpinBox *audioWarmRateSpinBox; ///< Startup warmup rate for audio intensity ramp.
94 QPushButton *okButton;
95 QPushButton *cancelButton;
96};
97
98#endif
QString getAudioFilePath() const
Get the effective audio file or M3U playlist path.
QPushButton * audioPlaylistEditButton
Opens the M3U playlist editor.
int getNumberOfChannels() const
QSpinBox * audioBuffersSpinBox
Number of spectrum history frames.
QPushButton * okButton
QCheckBox * audioReactivityCheckBox
QPushButton * cancelButton
QComboBox * inputDeviceComboBox
double getSensitivity() const
QPushButton * audioPlaylistBrowseButton
Opens a file dialog to choose an M3U playlist.
QPushButton * audioFileBrowseButton
Opens a file dialog to choose an audio file.
int getAudioBufferFrames() const
Number of spectrum history frames requested.
QCheckBox * audioRepeatCheckBox
Restart playback when the audio file ends.
QCheckBox * audioTruncCheckBox
Stop playback when the audio file ends.
QCheckBox * recordAudioCheckBox
bool isAudioFileEnabled() const
Check whether a file or M3U audio source is selected and has a path.
int getInputDeviceIndex() const
bool isAudioReactivityEnabled() const
QLineEdit * audioFileLineEdit
Displays the selected audio file path.
bool isRecordAudioEnabled() const
QString getAudioPlaylistPath() const
Get the selected M3U playlist path.
QCheckBox * audioPassThroughCheckBox
bool isAudioPlaylistEnabled() const
Check whether the M3U playlist overrides the single audio file.
bool isAudioPassThroughEnabled() const
bool isAudioRepeatEnabled() const
Check whether file audio should restart when it reaches the end.
AudioSettings(QWidget *parent=nullptr)
void populateAudioDevices()
double getRecordVolume() const
QCheckBox * audioFileCheckBox
Toggle file-based audio input.
QCheckBox * audioPlaylistCheckBox
Use an M3U playlist instead of the audio file.
QCheckBox * audioBuffersCheckBox
Enable spectrum history buffer CLI option.
int getOutputDeviceIndex() const
double getAudioWarmRate() const
Audio startup warmup rate in 1/sec.
QComboBox * outputDeviceComboBox
QDoubleSpinBox * audioWarmRateSpinBox
Startup warmup rate for audio intensity ramp.
bool isAudioTruncEnabled() const
Check whether "stop when audio ends" is selected.
bool isAudioBuffersEnabled() const
Check whether spectrum history buffers are enabled.
QSpinBox * channelSpinBox
QLineEdit * audioPlaylistLineEdit
Displays the selected M3U playlist path.
QSlider * sensitivitySlider
QSlider * recordVolumeSlider
void updateAudioSourceControls()