Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finer grained audio delay slider (fixes issue #5010) #5239

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

svobs
Copy link
Contributor

@svobs svobs commented Oct 29, 2024


Description:

  • Changes the audio delay slider so it uses increments of 50ms instead of 500ms.
  • The slider's is still required to land on tick marks as it moves, so it was necessary to increase the number of tick marks per second by 10x. This turns the slider into a millipede. I changed its control size from "small" to "mini" to reduce the prominence of the taller marks, and I think it looks a little better.
  • Reduces the slider's range (was: -5 ↔︎ +5) to: -3 ↔︎ +3. The slider's relatively small size made it difficult to move very precisely otherwise. But I think it should be a reasonable tradeoff because it should be very uncommon for an audio track to be farther out of sync than that.

@low-batt low-batt linked an issue Oct 31, 2024 that may be closed by this pull request
@low-batt
Copy link
Contributor

I'll defer to the other reviewers on this one.

With my eyes I had to take a screenshot and magnify it to be able to see that there are tick marks. The marks seem to be missing at the edges?:
slider

The 0 labels don't line up (under Ventura). That can be addressed in some other PR.

Note that the audio delay is not just about miss-timed audio tracks. It is also needed when using AirPlay. Users report needing to use 2 second delays.

@svobs
Copy link
Contributor Author

svobs commented Nov 2, 2024

With my eyes I had to take a screenshot and magnify it to be able to see that there are tick marks. The marks seem to be missing at the edges?:

This seems to be the intent of the designers... if you move the slider knob, you'll see there's another missing tick in the very center. It looks like it's purely aesthetic and the slider clicks along as though the missing ticks are there. I did experiment with different sizes and found that the slider looks best when (pseudocode) slider.frame.width == tickMarkCount * Int(N) + 4. In the current PR code, N=2. Changing the slider's width by just a couple pixels in either direction resulted in spaces getting distributed unevenly between the ticks, which looked much worse.

Note that the audio delay is not just about miss-timed audio tracks. It is also needed when using AirPlay. Users report needing to use 2 second delays.

Ah, yes. Well, 3 sec either direction should be still be enough for anyone then. 😎

The 0 labels don't line up (under Ventura). That can be addressed in some other PR.

I actually spent a large amount of time on this and could not find a real solution. I think it's a great example of why AppKit UI development is so infuriating. Since it only is noticeable for the 0 value, it might be good enough to add a special constraint to align the centers of the two labels, and use code to add / remove the constraint depending on if the slider knob is at the 0 value...

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.

Fine grained audio delay slider
2 participants