ITADN

Feature: starting/ stopping a recording will also start/ stop playback

#524Pull Requestsriseley 创建于 2026-01-24
S
sriseleycommented
## Motivation The first time I used Qtractor 1.2.0 (installed from dnf), I was clicking the record button with a track armed, and from my perspective nothing was happening, I was confused and unsure if Qtractor was working correctly. I realised that starting a recording actually required two steps: 1. clicking record and 2. clicking play. This did not meet my expectations as a user accustomed to audio recording software eg Audacity. I have decided to implement the feature and raise a PR to invite discussion. I am curious to understand if there are historic or Qtractor-specific reasons why starting a recording requires two clicks as opposed to one. ## Feature description This pull request starts playback as well as recording when the record button is pressed. ## Implementation details - The Record button (m_ui.transportRecordAction) now also programmatically controls the Play action (m_ui.transportPlayAction) to synchronize recording and playback. - respects the action-slot architecture: instead of calling the Play slot directly, the code triggers the QAction. - any other UI elements or functionality bound to Play automatically respond because they share the same QAction. ## Development environment Developed and built on Fedora Linux 42 using the following build parameters: ```bash cmake -B build -DCONFIG_VST3=OFF -DCONFIG_VST3SDK=OFF -DCONFIG_CLAP=OFF -DCONFIG_DSSI=OFF -DCONFIG_LV2=OFF cmake --build build --parallel $(nproc) ``` ## Testing ### 1) Pressing record starts recording and playback Steps: - Add audio track with default input/ output. - Arm track for recording by clicking R button (alt text: "Track 1 Record") - Click record button (alt text: "Record") Expected outcome: - Record button moves to pressed/ active state ✅ - Play button moves to pressed/ active state ✅ - waveform appears in track 1 ✅ - stop button no longer greyed out ✅ ### 2) Pressing record button during recording and playback stops recording and playback Steps: - steps for test case 1. Pressing record starts playback - Click record button again Expected outcome: - stop button becomes greyed out/ not clickable ✅ - Record button no longer pressed/ active ✅ - Play button no longer pressed/ active ✅ - Waveform stops being recorded ✅ ### 3) Pressing stop button during recording and playback stops recording and playback Steps: - steps for test case 1. Pressing record starts playback - click stop button (alt text: "Stop") Expected outcome: - Same as test case 2. Pressing record button during recording and playback stops recording and playback ✅ ### 4) Pressing play button during recording and playback stops recording and playback Steps: - steps for test case 1. Pressing record starts playback - click play button (alt text: "Play") Expected outcome: - Same as test case 2. Pressing record button during recording and playback stops recording and playback ✅
合并状态:未合并 2 条评论