-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Copy selection toolbar start and stop time string into clipboard #5789
base: master
Are you sure you want to change the base?
Conversation
Copy selection toolbar start and stop time string into clipboard. Double click or right click selection toolbar label, or from menu "Select" -> "Region" -> "Selection String to Clipboard", or assign a hotkey to above menu item. It output time range string like "1m3.221s-1h22m16.331s" to clipboard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see a lot of potential here for a generalized form which would work on any time input, as well as copy-paste functionality which may replace the weird and invisible store/retrieve cursor and range functions. Doing that isn't necessary for this PR though.
There's a bit of UX cleanup to do for this PR. But already I can say: Thank you for this contribution!
src/menus/SelectMenus.cpp
Outdated
Command(wxT("SelStrToClipboard"), XXO("Selection String to &Clipboard"), | ||
FN(OnSelStrToClipboard), AlwaysEnabledFlag, | ||
Options{}.LongName(XO("Selection Time Range String to Clipboard"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Copy selection timestamp" would be the better string for this function.
Code modification completed, please review again. |
Code reduce to 45 lines, please review. |
Testing on W10 with @lededev 's latest branch: audacity-win-3.5.0-alpha-20231215+5c2f507-x64
|
That's not all, if you press the right mouse button on the time control, a menu will appear allowing you to choose more output formats. I counted 19 output formats. But don’t worry too much about side effects, because this small function only reads the string from the time control and writes it to the clipboard. The only side effect is that it will overwrite the current data of the clipboard, so I added a floating window in the system prompt bar. To prompt the user that the current data in the clipboard has changed. |
@lededev Or left click on the little downward-pointing black triangle - know colloquially as the LDPBT ;-)
Yes, I observed the message. Are you overwriting And can you explain what the UI actually is to this confused person please. |
@lededev Possibly not so good of you already have a lot of labels. |
@petersampsonaudacity You can press Win+V shortcuts on windows 10 to see them in system clipboard but not paste them. I want to simplify my steps rather than make things more complicated, so exporting a text file and opening it in an editor is contrary to my idea. If I need to save the data, I'll paste it into my notepad and then Ctrl+S to save. |
@lededev what I mean is what do I have to do in Audacity to get the selection toolbar contents copied to the clipboard? |
There are 3 ways currently:
|
Rather than "hiding" it there - why not add it as an extra item to the menu you get when left-clicking the cog-wheel? @LWinterberg does that seem sensible to you? Apart from any other consideration right-click is more normally used as a gesture to summon a context menu. |
If you put it there, you need 4 actions to complete this operation. Move, click, move, click. And it will make the audio selection area lose focus. Might as well click on the main menu to do this. Considering that I also need to copy it to Notepad, there are 4 keys including Alt+TAB and Ctrl+V, or pure mouse actions also 4: move to notepad insert location, click, hold right mouse button and down gresture(paste), which require a total of 6 actions (8 actions using your method). Since my NotepadEE has added the Alt+2 function to do this, it only requires 4 actions in total, Alt+TAB, Alt+2. I feel that if the operation is made too complex, I will be less interested in adding this small feature. |
I think the issue we're running into here is that there's a discontinuity between "feature which makes my life easier" and "feature which fits into Audacity". I totally see your point that right-clicking the label makes things very fast for you. However, in the context of Audacity and its millions of users, there are different constraints in place, which require compromise. One of these constraints is learnability and intuitiveness of the app. Peter had the intuitive sense to look inside the selections gear to look for a copy option, so that could be argued as a sensible place to put this option. There would be other places too which would work intuitively for some people (ie Ctrl+C - except that it clashes with us not having scoped shortcuts for most things, selection menu, context menu on the time display itself), and unfortunately, right-clicking or double-clicking the label to copy something else is just not something intuitive. And it's also not learnable as it's completely invisible and also the only place in the entire app that would do right-click copy. In fact, it would be unique among all apps I'm aware of; the only thing that comes close is some terminals using right-click to paste. So unfortunately, right-click copy is blocking the merge here. Again, the feature itself is a good fit for Audacity, and if put on a shortcut, it's be pretty fast as well. |
@LWinterberg xterm use right click copy select text, cmd.exe also use right click copy select text. Therefore, right-click copying is also a habitual operation for many users. |
Audacity is not a terminal program though, and most of its users have never opened a terminal. |
I am not sure about this, but I think the right-click is no harm with the uses who do not use right-click copy, But it can bring convenience to users who are used to this kind of operation. It is harmless to one party and beneficial to the other party, so I prefer to retain this feature rather than remove it. |
@petersampsonaudacity Regarding the problem that it is difficult for users to find this right-click function, I think a mouse hover prompt can be added. When the mouse hovers over the "Selection" label for a period of time, a floating tooltip will be given to prompt the user to right click to copy the timestamp. |
677e136
to
9e16503
Compare
9e16503
to
e3da2c5
Compare
@lededev Hi, where is it possible to get a version of Audacity that has this feature? as a Audacity user I completely agree with all your suggestions btw. |
You can download official audacity 3.4.2 Windows x64 zip, and overwrite Audacity.exe with my patch, but this patch only have right/double click label "Selection" on selection toolbar copy time string to clipboard feature, no menuitem and shortcut. I will make new patch if 3.5 release without this feature. |
Copy selection toolbar start and stop time string into clipboard.
Resolves: issues 5759
Double click or right click selection toolbar label, or from menu "Select" -> "Region" -> "Selection String to Clipboard", or assign a hotkey to above menu item. It output time range string like "1m3.221s-1h22m16.331s" to clipboard, and a notify from system tray.
Recommended: