Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
79b7092
SampleTrack: Uncomment disabled recording-related code.
Reflexe Nov 6, 2017
50cc41a
Mixer & PlayHandle: Support PlayHandle without audioPort and set
Reflexe Nov 6, 2017
b8938fd
SampleTrack: Make sure an empty TCO with isRecord would still be
Reflexe Nov 8, 2017
ed7ff82
SampleTrack: In a case of recording, play a sample TCO even if its
Reflexe Nov 17, 2017
7184ce6
SampleRecordHandle: Obtain the offset to the record with a parameter
Reflexe Nov 17, 2017
333f43c
fixup: fix formatting issues
Reflexe May 17, 2021
cf9cea8
DataFile: Skip empty resource attributes
Reflexe Oct 23, 2021
1b39d39
Recoding: Disable recording buttons when recording is unavailable
Reflexe Dec 4, 2021
ca72d5b
Merge branch 'master'
PhysSong Feb 2, 2022
99d97fc
Fix indentation
PhysSong Feb 2, 2022
dfed374
Minor formatting changes
PhysSong Feb 3, 2022
2f02148
Merge branch 'master' into feature/recording-stage-one
PhysSong Mar 26, 2022
17efb13
Fix missing include after merge
PhysSong Mar 26, 2022
b2f3a1f
Merge branch 'master' into feature/recording-stage-one
PhysSong Aug 2, 2022
ed703c0
Merge branch 'master' into feature/recording-stage-one
PhysSong Oct 30, 2022
f254829
Merge branch 'master' into feature/recording-stage-one
PhysSong Jul 2, 2023
397b8d9
Merge branch 'master' into feature/recording-stage-one
zonkmachine Oct 10, 2023
9324658
Merge remote-tracking branch 'origin/master' into feature/recording-s…
michaelgregorius May 31, 2024
18efc12
Move "Rec" to lower left
michaelgregorius May 31, 2024
33139b9
Enable configuration of input device for SDL
michaelgregorius Jun 1, 2024
29c43c2
Provide a setting for system default input
michaelgregorius Jun 1, 2024
1ab45e4
Configuration of output device for SDL
michaelgregorius Jun 1, 2024
a123d0e
Ensure label visibility
michaelgregorius Jun 1, 2024
1f0cda4
Rename "Device"
michaelgregorius Jun 1, 2024
f9ea970
Remove repeated strings
michaelgregorius Jun 1, 2024
48c4dce
More prominent recording option
michaelgregorius Jun 2, 2024
5495530
Recording widget/options visibility
michaelgregorius Jun 2, 2024
3b7e330
Apply code review
sakertooth Jun 2, 2024
14c16be
Do not include ClipView.h
sakertooth Jun 2, 2024
d8c2716
Remove recording button
michaelgregorius Jun 14, 2024
3a3c213
Revert wording to match MIDI recording
tresf Jun 14, 2024
c1e5de5
Code review changes
michaelgregorius Jun 15, 2024
a1675e4
Adjust rendering of BarModelEditor (#7299)
michaelgregorius May 31, 2024
568abed
Add peak indicators (#7295)
michaelgregorius Jun 1, 2024
fbcf436
Change the wording of Instrument Plugin Dialogue (#7301)
AW1534 Jun 1, 2024
6ee0d9b
Modernize compiler and linker flags (#7255)
Rossmaxx Jun 2, 2024
d356b71
Fix noise generator (#7318)
LostRobotMusic Jun 13, 2024
bb03178
Add support for "factorysample:" prefix / Fix "bassloopes" typo (#7236)
michaelgregorius Jun 14, 2024
c1f3b0b
Remove `debian` folder (#7311)
Rossmaxx Jun 15, 2024
86073ed
Use `src_set_ratio` to fix artifacts within `Sample` playback (#7321)
sakertooth Jun 15, 2024
b1f0f89
arpeggiator sorted mode fixed (#7025)
szeli1 Jun 17, 2024
1ea27c0
Suppress warnings in third-party code (#7319)
DomClark Jun 17, 2024
f00f0c0
set "child subreaper" process attribute on Linux (#7315)
notaz Jun 18, 2024
a5e000f
Fix caching for macOS CI jobs (#7326)
DomClark Jun 18, 2024
b5b6e2d
Merge branch 'master' into sample-recording
Rossmaxx Jul 15, 2024
7d70c8b
remnants of master merge
Rossmaxx Jul 15, 2024
d883acc
Merge remote-tracking branch 'origin/master' into feature/recording-s…
michaelgregorius Aug 10, 2024
d586ea2
Merge remote-tracking branch 'origin/master' into feature/recording-s…
michaelgregorius Aug 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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`.
  • Loading branch information
michaelgregorius committed Jun 2, 2024
commit 54955307452fa7c639ae1c8ac6cbe530e165da9e
7 changes: 7 additions & 0 deletions include/AudioEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ class LMMS_EXPORT AudioEngine : public QObject
return m_audioDev;
}

bool captureDeviceAvailable() const;


// audio-port-stuff
inline void addAudioPort(AudioPort * port)
Expand Down Expand Up @@ -355,6 +357,11 @@ class LMMS_EXPORT AudioEngine : public QObject
AudioDevice * tryAudioDevices();
MidiClient * tryMidiClients();

inline const AudioDevice* audioDev() const
{
return m_audioDev;
}

void renderStageNoteSetup();
void renderStageInstruments();
void renderStageEffects();
Expand Down
1 change: 1 addition & 0 deletions include/SampleClipView.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public slots:
private:
QWidget* buildRecordWidget(BoolModel& recordModel);
void adjustRecordWidget();
bool recordingCapabilitiesAvailable() const;

private:
SampleClip * m_clip;
Expand Down
4 changes: 4 additions & 0 deletions src/core/AudioEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,10 @@ void AudioEngine::restoreAudioDevice()
}


bool AudioEngine::captureDeviceAvailable() const
{
return audioDev()->supportsCapture();
}


void AudioEngine::removeAudioPort(AudioPort * port)
Expand Down
15 changes: 12 additions & 3 deletions src/gui/clips/SampleClipView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <QMenu>
#include <QPainter>

#include "AudioEngine.h"
#include "GuiApplication.h"
#include "AutomationEditor.h"
#include "embed.h"
Expand Down Expand Up @@ -61,8 +62,9 @@ SampleClipView::SampleClipView( SampleClip * _clip, TrackView * _tv ) :

setStyle( QApplication::style() );

// To simplify the code we always create the widget but we do not always show it
m_recordWidget = buildRecordWidget(_clip->getRecordModel());
m_recordWidget->setVisible(true);
m_recordWidget->setVisible(recordingCapabilitiesAvailable());

adjustRecordWidget();
}
Expand All @@ -87,9 +89,11 @@ void SampleClipView::constructContextMenu(QMenu* cm)
cm->addSeparator();


cm->addAction(embed::getIconPixmap("record"),
tr("Set/clear record"),
QAction* recordToggleAction = cm->addAction(embed::getIconPixmap("record"),
tr("Toggle record"),
m_clip, SLOT(toggleRecord()));

recordToggleAction->setEnabled(recordingCapabilitiesAvailable());

cm->addAction(
embed::getIconPixmap("flip_x"),
Expand Down Expand Up @@ -405,4 +409,9 @@ void SampleClipView::adjustRecordWidget()
m_recordWidget->move(1, height() - m_recordWidget->height() - 1);
}

bool SampleClipView::recordingCapabilitiesAvailable() const
{
return Engine::audioEngine()->captureDeviceAvailable();
}

} // namespace lmms::gui
3 changes: 1 addition & 2 deletions src/gui/editors/SongEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <QTimeLine>

#include "ActionGroup.h"
#include "AudioDevice.h"
#include "AudioEngine.h"
#include "AutomatableSlider.h"
#include "ClipView.h"
Expand Down Expand Up @@ -1025,7 +1024,7 @@ SongEditorWindow::SongEditorWindow(Song* song) :

// In case our current audio device does not support capture,
// disable the record buttons.
if(!Engine::audioEngine()->audioDev()->supportsCapture()) {
if(!Engine::audioEngine()->captureDeviceAvailable()) {
for (auto &recordAction : {m_recordAccompanyAction, m_recordAction}) {
recordAction->setEnabled(false);
recordAction->setToolTip(tr("Recording is unavailable: try connecting an input device or switching backend"));
Expand Down