VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtProceduralSoundsSettingsWidget.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvAudioQt/dllExport.h>
15 
16 #include <QtWidgets/QWidget>
17 
18 #include <vector>
19 
20 class QTreeWidget;
21 class QStackedWidget;
22 class QLabel;
23 class QLineEdit;
24 class QRadioButton;
25 class QDoubleSpinBox;
26 class QSpinBox;
27 class QPushButton;
28 
29 namespace makVrv
30 {
31  class DtDe;
32  class DtProceduralSoundLayerPlayer;
33  class DtStyledQTableWidget;
34 
49  : public QWidget
51  {
52  Q_OBJECT
53 
54  public:
57  QWidget* parent = nullptr,
58  Qt::WindowFlags f = Qt::Widget);
59 
62 
64  virtual void setSounds(
65  const std::vector<DtProceduralSoundConfig>& sounds) override;
66 
67  protected slots:
68  // ---- Tree navigation ----
70  void slot_treeSelectionChanged();
71 
72  // ---- Sound-level ----
74  void slot_addSound();
76  void slot_removeSound();
77 
78  // ---- Layer table (Page 1 - sound selected) ----
79  void slot_layerTableCellChanged(int row, int col);
81  void slot_layerTableSelectionChanged();
83  void slot_addLayer();
85  void slot_removeLayer();
86 
87  // ---- Layer properties form (Page 2 - layer selected) ----
90  void slot_layerNameEdited(const QString& text);
94  void slot_layerNameEditingFinished();
97  void slot_schedulingModePoisson(bool checked);
100  void slot_schedulingModeFixed(bool checked);
103  void slot_densityValueChanged(double value);
106  void slot_fixedEventsValueChanged(int value);
109  void slot_gainMinValueChanged(double value);
112  void slot_gainMaxValueChanged(double value);
115  void slot_pitchMinValueChanged(double value);
118  void slot_pitchMaxValueChanged(double value);
119 
120  // ---- Clip table (Page 2) ----
121  void slot_clipTableCellClicked(int row, int col);
122  void slot_clipTableCellChanged(int row, int col);
123  void slot_addClip();
124  void slot_removeClip();
125 
132  void slot_clipPreviewButtonClicked(int row);
133 
134  // ---- Layer audio preview (Page 2) ----
137  void slot_playLayerClicked();
141  void slot_playbackStateChanged(bool playing);
142 
143  protected:
145  void setupGui();
146 
148  void refreshTree();
149 
151  void refreshLayerTable(int soundIndex);
152 
154  void refreshClipTable(int soundIndex, int layerIndex);
155 
158  void refreshLayerForm(int soundIndex, int layerIndex);
159 
163  void refreshSoundPage(int soundIndex);
164 
171  void refreshLayerInsight();
172 
178  void reselectLayerInTree(int soundIndex, int layerIndex);
179 
181  void emitChanged();
182 
184  int selectedSoundIndex() const;
185 
187  std::pair<int,int> selectedLayerIndices() const;
188 
189  protected:
191 
193  std::vector<DtProceduralSoundConfig> myConfigs;
194 
195  // ---- Left panel ----
199 
200  // ---- Right panel pages ----
201  QStackedWidget* myStack;
202 
203  // Page 1: sound selected
209 
210  // Page 2: layer selected
212  QRadioButton* myPoissonRadio;
213  QRadioButton* myFixedRadio;
230 
232 
234  std::vector<QPushButton*> myClipPreviewButtons;
235 
238 
241 
246  bool myIsDirty;
247  };
248 
249 } // namespace makVrv
QLabel * myFixedEventsLabel
Label for myFixedEventsSpin (FixedParallel mode only).
Definition: DtProceduralSoundsSettingsWidget.h:218
QDoubleSpinBox * myPitchMinSpin
Minimum pitch ratio for randomized events.
Definition: DtProceduralSoundsSettingsWidget.h:222
QLabel * myMinPolyphonyLabel
Inline rich-HTML min-polyphony estimate below the layer table.
Definition: DtProceduralSoundsSettingsWidget.h:208
QPushButton * myAddLayerButton
Adds a new layer.
Definition: DtProceduralSoundsSettingsWidget.h:206
std::vector< DtProceduralSoundConfig > myConfigs
Full in-memory config list mirrored from the manager.
Definition: DtProceduralSoundsSettingsWidget.h:193
int myPreviewingClipRow
Row index of the currently-previewing clip; -1 when no clip preview is active.
Definition: DtProceduralSoundsSettingsWidget.h:231
QSpinBox * myFixedEventsSpin
Fixed simultaneous event count for fixed mode.
Definition: DtProceduralSoundsSettingsWidget.h:217
QPushButton * myRemoveClipButton
Removes the selected clip.
Definition: DtProceduralSoundsSettingsWidget.h:227
QDoubleSpinBox * myGainMinSpin
Minimum linear gain for randomized events.
Definition: DtProceduralSoundsSettingsWidget.h:219
QPushButton * myPlayLayerButton
Play/Stop sample button below the clip table.
Definition: DtProceduralSoundsSettingsWidget.h:229
QPushButton * myGainHelpIcon
&quot;?&quot; icon with a gain-range insight tooltip.
Definition: DtProceduralSoundsSettingsWidget.h:221
QPushButton * myRemoveLayerButton
Removes the selected layer.
Definition: DtProceduralSoundsSettingsWidget.h:207
#define DT_DLL_VRVAUDIOQT
Definition: dllExport.h:22
QPushButton * myRemoveSoundButton
Removes the selected sound config.
Definition: DtProceduralSoundsSettingsWidget.h:198
QDoubleSpinBox * myGainMaxSpin
Maximum linear gain for randomized events.
Definition: DtProceduralSoundsSettingsWidget.h:220
QRadioButton * myPoissonRadio
Selects Poisson (random) scheduling mode.
Definition: DtProceduralSoundsSettingsWidget.h:212
QPushButton * myPitchHelpIcon
&quot;?&quot; icon with a pitch-range insight tooltip.
Definition: DtProceduralSoundsSettingsWidget.h:224
A styled version of the QTableWidget. Cells in this table widget can be styled when enabled or disabl...
Definition: DtStyledQTableWidget.h:33
QDoubleSpinBox * myPitchMaxSpin
Maximum pitch ratio for randomized events.
Definition: DtProceduralSoundsSettingsWidget.h:223
Contains the declaration for makVrv::DtProceduralSoundsSettingsWidgetInterface.
Contains makVrv::DtProceduralClipConfig, DtProceduralLayerConfig, and DtProceduralSoundConfig structs...
QTreeWidget * myTree
Tree showing Sound &gt; Layer &gt; Clip hierarchy.
Definition: DtProceduralSoundsSettingsWidget.h:196
std::vector< QPushButton * > myClipPreviewButtons
Per-row preview buttons in the clip table (rebuilt each refreshClipTable; cells own the pointers)...
Definition: DtProceduralSoundsSettingsWidget.h:234
QDoubleSpinBox * myDensitySpin
Events-per-second density for Poisson mode.
Definition: DtProceduralSoundsSettingsWidget.h:215
DtDe & myDe
Definition: DtProceduralSoundsSettingsWidget.h:190
bool myIsUpdating
true while setSounds() / refreshTree() is running to suppress re-entrant signals. ...
Definition: DtProceduralSoundsSettingsWidget.h:240
QPushButton * myAddClipButton
Adds a new clip to the selected layer.
Definition: DtProceduralSoundsSettingsWidget.h:226
QPushButton * mySchedulingHelpIcon
&quot;?&quot; icon with a scheduling insight tooltip.
Definition: DtProceduralSoundsSettingsWidget.h:214
QStackedWidget * myStack
Stacked right-panel pages (0 = none, 1 = sound, 2 = layer).
Definition: DtProceduralSoundsSettingsWidget.h:201
QLabel * myDensityLabel
Label for myDensitySpin (Poisson mode only).
Definition: DtProceduralSoundsSettingsWidget.h:216
QLineEdit * mySoundKeyEdit
Factory key for the selected sound.
Definition: DtProceduralSoundsSettingsWidget.h:204
QLineEdit * myLayerNameEdit
Editable name for the selected layer.
Definition: DtProceduralSoundsSettingsWidget.h:211
DtStyledQTableWidget * myLayerTable
Editable table of layers for the selected sound.
Definition: DtProceduralSoundsSettingsWidget.h:205
DtProceduralSoundLayerPlayer * myLayerPlayer
Owns the per-layer audio audition state (DtProceduralSound + tick timer).
Definition: DtProceduralSoundsSettingsWidget.h:237
DtStyledQTableWidget * myClipTable
Clip pool table for the selected layer.
Definition: DtProceduralSoundsSettingsWidget.h:225
QPushButton * myClipsHelpIcon
&quot;?&quot; icon with a clip-probability tooltip.
Definition: DtProceduralSoundsSettingsWidget.h:228
Abstract interface for the Procedural Sounds settings widget.
Definition: DtProceduralSoundsSettingsWidgetInterface.h:26
QRadioButton * myFixedRadio
Selects fixed parallel event scheduling mode.
Definition: DtProceduralSoundsSettingsWidget.h:213
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
QPushButton * myAddSoundButton
Adds a new sound config.
Definition: DtProceduralSoundsSettingsWidget.h:197
Owns a single one-layer procedural-sound audition on behalf of DtProceduralSoundsSettingsWidget.
Definition: DtProceduralSoundLayerPlayer.h:35
Programmatic Qt widget for editing the procedural sound config list.
Definition: DtProceduralSoundsSettingsWidget.h:48
bool myIsDirty
true when myConfigs has been mutated by a user edit and not yet published via emitChanged(). Used by the destructor to flush the last in-flight edit only when something actually changed, avoiding a spurious runtime reload + .psndx autosave on a no-op close.
Definition: DtProceduralSoundsSettingsWidget.h:246

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)