Recording widget/options visibility
Only show the recording widget in the sample clip if the audio engine has a device configured that can capture audio. For simplicity of the code, i.e. no nullptr checks, the widget is always created but only shown if capture capabilities are available. Rename the context menu entry "Set/clear record" to "Toggle record" and only enable it if capture is possible. In `SampleClipView` the test for the availability of a capture device is abstracted behind the helper method `recordingCapabilitiesAvailable`. Technical details ------------------ Add the method `captureDeviceAvailable` to `AudioEngine` because clients should not be concerned with driver details. Drivers should mostly be used by the audio engine and therefore hidden to clients. Add a private `const` version of the method `audioDev` so that `captureDeviceAvailable` can be implemented in a `const` correct way. Use `captureDeviceAvailable` in the constructor of `SongEditorWindow`.
This commit is contained in:
@@ -172,6 +172,8 @@ public:
|
||||
return m_audioDev;
|
||||
}
|
||||
|
||||
bool captureDeviceAvailable() const;
|
||||
|
||||
|
||||
// audio-port-stuff
|
||||
inline void addAudioPort(AudioPort * port)
|
||||
@@ -355,6 +357,11 @@ private:
|
||||
AudioDevice * tryAudioDevices();
|
||||
MidiClient * tryMidiClients();
|
||||
|
||||
inline const AudioDevice* audioDev() const
|
||||
{
|
||||
return m_audioDev;
|
||||
}
|
||||
|
||||
void renderStageNoteSetup();
|
||||
void renderStageInstruments();
|
||||
void renderStageEffects();
|
||||
|
||||
@@ -67,6 +67,7 @@ protected:
|
||||
private:
|
||||
QWidget* buildRecordWidget(BoolModel& recordModel);
|
||||
void adjustRecordWidget();
|
||||
bool recordingCapabilitiesAvailable() const;
|
||||
|
||||
private:
|
||||
SampleClip * m_clip;
|
||||
|
||||
Reference in New Issue
Block a user