Skip to content

Create loop region only when control key is pressed - #9712

Merged
embarc-gabriel merged 3 commits into
audacity:masterfrom
embarc-gabriel:9672-create-loop-region-only-when-control-down
Oct 23, 2025
Merged

embarc-gabriel merged 3 commits into
audacity:masterfrom
embarc-gabriel:9672-create-loop-region-only-when-control-down

Conversation

@embarc-gabriel

Copy link
Copy Markdown
Contributor

Resolves: #9672

Following the new design, only create the loop region if control key is pressed.

  • I signed CLA
  • The title of the pull request describes an issue it addresses
  • If changes are extensive, then there is a sequence of easily reviewable commits
  • Each commit's message describes its purpose and effects
  • There are no behavior changes unnecessary for the stated purpose of the PR

Recommended:

  • Each commit compiles and runs on my machine without known undesirable changes of behavior

QA:

  • Autobot test cases have been run

@luapmartin

Copy link
Copy Markdown
Contributor

Hi @embarc-gabriel this one will conflict with this one #9692 I guess


function onCtrlPressedChanged() {
if (!root.ctrlPressed) {
playRegionController.mouseUp(prv.positionX)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's really hard to understand what's going on here, but the problem is probably in the name of the mouseUp method

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also because of prv.positionX
We usually use the prv object for private parts throughout the file, but here it's used for MouseArea. For MouseArea, it's not needed at all, we can simply use the property.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Sometimes I feel dumb! Thank you for pointing out the MouseArea problem.
I have renamed the function name. Probably is more readable now. @Eism

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have also removed the positionX variable

@embarc-gabriel
embarc-gabriel force-pushed the 9672-create-loop-region-only-when-control-down branch from cf2c46b to 31c670d Compare October 21, 2025 14:34
@@ -23,7 +24,7 @@ void PlayRegionController::init()
updateIsActive();
}

void PlayRegionController::mouseDown(double pos)
void PlayRegionController::startInteraction(double pos, bool cntrlPressed)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

little typo (just looks strange):
cntrl -> ctrl

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@embarc-gabriel
embarc-gabriel force-pushed the 9672-create-loop-region-only-when-control-down branch 2 times, most recently from 97f86b0 to 0c2fb74 Compare October 22, 2025 12:01
@embarc-gabriel
embarc-gabriel force-pushed the 9672-create-loop-region-only-when-control-down branch from bd7781a to cd5dc00 Compare October 23, 2025 11:24
@embarc-gabriel
embarc-gabriel merged commit fd4536d into audacity:master Oct 23, 2025
@embarc-gabriel
embarc-gabriel deleted the 9672-create-loop-region-only-when-control-down branch August 28, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Region for Triggering Looping Region

4 participants