-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add tooltip plugin for AudioStream #77069
Add tooltip plugin for AudioStream #77069
Conversation
4270e80
to
8780f6f
Compare
Well, since there's no proposal, I'll leave my opinion here. I really appreciate the effort put into doing something like this with tooltips, but I don't think playback controls in them is a good idea.
Unrelated suggestion to my dissent above - having the length is nice, but I'd suggest that we:
|
Well the letters next to icons imply enough that they are shortcuts, so even if someone tries to click it and fails, it's rather self-explanatory that you should use keyboard.
It's not a problem. The tooltip is still rather small overall.
IMO stealing key input is fine, because the tooltip is temporary. I can't imagine someone being bothered because they hovered an audio file while writing code and it made 4 letters unusable. Although focus stealing is a problem and I don't really know how to solve it. Perfectly the tooltip should only accept events, but right now it acts like a regular popup.
Makes sense, although I'll do it a bit differently 🤔 tbh tooltip audio player is an overkill, especially with controls. It has one advantage though (at least if focus issues were resolved) - you can quickly preview multiple samples. I can't make it default to autoplay though, because it requires loading the audio stream. This could be easily implemented in GDScript, but the way tooltip plugins are designed doesn't allow more than 1 to handle the same file type. Maybe the API could be changed a bit to allow chaining multiple plugins. They mostly use box containers anyway. |
I think the dialog that opens on double-click, while not the prettiest, is quick enough to play several tracks for all practical purposes. So I'd still prefer to keep the convention of tooltips only showing info here. Also if I get this right, there will be a possibility of a sound jumpscare after hovering an audio file (i.e. forgetting you enabled autoplay earlier)? I don't like the idea of this too. Ik I probably sound a bit nitpicky, I just think the many little negatives of audio playback from tooltips outweigh the utility. |
I'd agree if it had an autoplay or at least a shortcut of some sort. In the default layout it's even on the opposite side of the screen.
The autoplay is only stored for the current editor session. |
8780f6f
to
a31470d
Compare
Removed the audio player, the tooltip now only includes length and stream image: I noticed a problem though 🤔 The metadata is filled when the preview is generated, so if you have a cached preview, the tooltip will show length of 0. This also applies to texture tooltips. All previews generated before tooltip plugins were added will have invalid data. I'll try to invalidate it if the metadata is empty, but in another PR. Here's a patch with rebased audio player btw: |
a31470d
to
0c30de3
Compare
0c30de3
to
ae1d89c
Compare
0e3bea0
to
9ed8429
Compare
9ed8429
to
1fce8d8
Compare
Thanks! |
btw there is complementary PR, because resource previews cached before this change will have outdated data: #77697 |
Follow-up to #63263
EDIT: Updated version here: #77069 (comment)
This PR adds a tooltip plugin for AudioStream resource. Normally the tooltip would show simply the length and visual preview of the stream, but that would be too boring, so I added playback functionality 🤪
ezgif.com-crop.mp4
It comes with play/pause, autoplay and 5s forward/backward seeking. I couldn't find a good way to add keyboard input to the tooltip, so I had to switch some flags and the tooltip causes some focus problems.
I initially came up with this idea as a fix for #63683, but #63263 wasn't merged in time and the issue was resolved in the meantime.