drowe67 / freedv-gui

GUI Application for FreeDV – open source digital voice for HF radio
https://freedv.org/
GNU Lesser General Public License v2.1
206 stars 52 forks source link

Voice keyer file/directory persistence. #728

Closed barjac closed 3 months ago

barjac commented 4 months ago

The voice keyer allows selection of a file to play but then forgets it and switches back to the one at the top of the directory. This happens in the same session if the program is stopped and re-started.

It would be better if the directory in use and the file in use were remembered between re-boots, and program re-starts.

tmiw commented 4 months ago

I thought we didn't want the "alternate" voice keyer file to persist across restarts before. Am I remembering correctly or was this a scenario we didn't test originally?

That said, we should be saving the previously used path for Tools->Start Play/Record File, so I opened #729 for that.

barjac commented 4 months ago

I thought we didn't want the "alternate" voice keyer file to persist across restarts before. Am I remembering correctly or was this a scenario we didn't test originally?

I have no idea, but I don't see much point in one default VK file! That is like one default Msg for the reporter Msg column!

I have a "VK files" directory with a dozen different CQ and testing calls. If I select one to use I expect it to be there until I change it and not have it change between re-starts, re-boots etc. I was trying to fault find an issue the other day and was calling CQ on top band with the VK. Every time I re-started the program and used the VK to call it started a message intended for 10m, so I had to stop the TX, change the VK message back to "CQ_160m700D" and re-start. This happened several times. Very frustrating!

I also think the 'current' VK filename should be visible on the main screen somewhere, to avoid transmitting the wrong message. Maybe on the Voice Keyer button with no path or file extension shown? Like:


Voice Keyer
CQ_160m700D

Note that 'Tools->Options->Audio Tab->Voice Keyer' does not allow entry of only a directory, only a 'full path to filename'. I think it should copy the way Quick Record works and only accept a 'path to directory' and allow a choice to be made from that directory. As it is now the two sections under the audio tab are inconsistent and somewhat confusing.

tmiw commented 4 months ago

I found the original PR that implemented that VK file selection (https://github.com/drowe67/freedv-gui/pull/493) and it looks like we were fine with how it's currently behaving back then:

I could see a situation where someone forgets what they used previously and ends up transmitting the wrong WAV file out the next day. How about the following?

  1. The selected VK file is persistent but just for the current FreeDV run.
  2. The default VK file is still set in Tools->Options->Audio and is what starts off as the "selected" one.
  3. When doing (1), the folder the selected file is in persists across restarts (i.e. if you restart FreeDV and attempt to choose a VK file again, the window will start off in that folder instead of whatever random folder).

I'm guessing that's no longer the case? If so, to make sure I'm understanding the proposal:

  1. Tools->Options->Audio should only configure the folder and not any specific file name for the voice keyer file.
  2. Left-clicking on the Voice Keyer button for the first time FreeDV is ever run (or right-clicking at any time) should mandate selection of the specific voice keyer file at that point, with the file selection window defaulting to the folder specified in (1).
  3. Left-clicking on the Voice Keyer button when there's a file already selected just uses that one, even if selected during a previous execution.
  4. Whenever the exact file name changes in (2), store the full path to that file somewhere separate from where (1) is stored.

Let me know if I missed anything. I wonder if others who use the voice keyer should comment on this as well since this would be a significant change to how the feature woks.

(BTW the currently playing voice keyer filename does display on the bottom of the FreeDV window.)

barjac commented 4 months ago

I found the original PR that implemented that VK file selection (#493) and it looks like we were fine with how it's currently behaving back then:

I could see a situation where someone forgets what they used previously and ends up transmitting the wrong WAV file out the next day. How about the following?

  1. The selected VK file is persistent but just for the current FreeDV run.
  2. The default VK file is still set in Tools->Options->Audio and is what starts off as the "selected" one.
  3. When doing (1), the folder the selected file is in persists across restarts (i.e. if you restart FreeDV and attempt to choose a VK file again, the window will start off in that folder instead of whatever random folder).

I'm guessing that's no longer the case? If so, to make sure I'm understanding the proposal:

1. Tools->Options->Audio should only configure the folder and _not_ any specific file name for the voice keyer file.

Yes. The text entry field should only accept a path to the directory to be used, optionally using the choose button. Function is then similar to the 'Quick record' below it.

2. Left-clicking on the Voice Keyer button for the first time FreeDV is ever run (or right-clicking at any time) should mandate selection of the specific voice keyer file at that point, with the file selection window defaulting to the folder specified in (1).

It should mandate the specifying of a directory for the VK files if one has not been set up in (1) but not the file as none may yet exist. If the directory exists the user will see that it is empty and cancel.

On selecting a file it would then be the 'current selection' which would persist for ever unless changed so I suppose it becomes your 'default'?. I think the term 'default' is confusing, 'current selection' makes more sense to me.

3. Left-clicking on the Voice Keyer button when there's a file already selected just uses that one, even if selected during a previous execution.

...or session or boot - yes

4. Whenever the exact file name changes in (2), store the full path to that file somewhere separate from where (1) is stored.

The full path would not be needed as the path to the current VK file directory would be stored in (1). Any newly selected file or new file would already be in, or be being stored in that directory.

I don't understand the reasoning behind "somewhere separate from where (1) is stored."

Let me know if I missed anything. I wonder if others who use the voice keyer should comment on this as well since this would be a significant change to how the feature woks.

Certainly if you think.

(BTW the currently playing voice keyer filename does display on the bottom of the FreeDV window.)

Yes but there is no way of knowing what the 'current VK file' is without starting to play it, which is a bit late! I think the button label would be the right place. Users will learn to keep file names short!

tmiw commented 4 months ago
2. Left-clicking on the Voice Keyer button for the first time FreeDV is ever run (or right-clicking at any time) should mandate selection of the specific voice keyer file at that point, with the file selection window defaulting to the folder specified in (1).

It should mandate the specifying of a directory for the VK files if one has not been set up in (1) but not the file as none may yet exist. If the directory exists the user will see that it is empty and cancel.

Quick Record actually defaults to the user's Documents folder the first time FreeDV's started. That seems reasonable to do here as well, no? That way, only the file would need to be selected.

4. Whenever the exact file name changes in (2), store the full path to that file somewhere separate from where (1) is stored.

The full path would not be needed as the path to the current VK file directory would be stored in (1). Any newly selected file or new file would already be in, or be being stored in that directory.

I don't understand the reasoning behind "somewhere separate from where (1) is stored."

What if the user wants to choose a file located outside of the configured VK directory? Only storing the file name would restrict use of the voice keyer to the files in the configured folder, correct?

Let me know if I missed anything. I wonder if others who use the voice keyer should comment on this as well since this would be a significant change to how the feature woks.

Certainly if you think.

Pinging @Tyrbiter in case he hasn't seen this thread yet.

(BTW the currently playing voice keyer filename does display on the bottom of the FreeDV window.)

Yes but there is no way of knowing what the 'current VK file' is without starting to play it, which is a bit late! I think the button label would be the right place. Users will learn to keep file names short!

Would putting the file name in the tooltip work?

Tyrbiter commented 4 months ago
2. Left-clicking on the Voice Keyer button for the first time FreeDV is ever run (or right-clicking at any time) should mandate selection of the specific voice keyer file at that point, with the file selection window defaulting to the folder specified in (1).

It should mandate the specifying of a directory for the VK files if one has not been set up in (1) but not the file as none may yet exist. If the directory exists the user will see that it is empty and cancel.

Quick Record actually defaults to the user's Documents folder the first time FreeDV's started. That seems reasonable to do here as well, no? That way, only the file would need to be selected.

I'm not strongly decided on where this should be, ~/Documents is a reasonable default, I would hope that most people would realise that it is sensible to choose somewhere devoted to freedv, personally I use ~/freedv for recordings and ~/freedv/voice for vk files.

4. Whenever the exact file name changes in (2), store the full path to that file somewhere separate from where (1) is stored.

The full path would not be needed as the path to the current VK file directory would be stored in (1). Any newly selected file or new file would already be in, or be being stored in that directory. I don't understand the reasoning behind "somewhere separate from where (1) is stored."

What if the user wants to choose a file located outside of the configured VK directory? Only storing the file name would restrict use of the voice keyer to the files in the configured folder, correct?

Let me know if I missed anything. I wonder if others who use the voice keyer should comment on this as well since this would be a significant change to how the feature woks.

Certainly if you think.

Pinging @Tyrbiter in case he hasn't seen this thread yet.

(BTW the currently playing voice keyer filename does display on the bottom of the FreeDV window.)

Yes but there is no way of knowing what the 'current VK file' is without starting to play it, which is a bit late! I think the button label would be the right place. Users will learn to keep file names short!

Would putting the file name in the tooltip work?

I wonder if the tooltip could be changed once a new user has understood what the various buttons do. Maybe have a new user setting which could be unticked to allow alternative tooltips or captions.

tmiw commented 4 months ago

I'm not strongly decided on where this should be, ~/Documents is a reasonable default, I would hope that most people would realise that it is sensible to choose somewhere devoted to freedv, personally I use ~/freedv for recordings and ~/freedv/voice for vk files.

Do you think it's fairly common to want to play back voice keyer files from anywhere other than a single location? For instance, normally you'd play back a file from ~/freedv/voice but maybe you need to play one from ~/Downloads once or twice. I ask because based on what's been proposed so far, it sounds like the latter wouldn't be an option; you'd only be able to play back a file from that one pre-configured location.

I wonder if the tooltip could be changed once a new user has understood what the various buttons do. Maybe have a new user setting which could be unticked to allow alternative tooltips or captions.

The tooltip should be able to be dynamically changed, but I'm of the mind that for basic day to day use, features should be self-explanatory.

Tyrbiter commented 4 months ago

I'm not strongly decided on where this should be, ~/Documents is a reasonable default, I would hope that most people would realise that it is sensible to choose somewhere devoted to freedv, personally I use ~/freedv for recordings and ~/freedv/voice for vk files.

Do you think it's fairly common to want to play back voice keyer files from anywhere other than a single location? For instance, normally you'd play back a file from ~/freedv/voice but maybe you need to play one from ~/Downloads once or twice. I ask because based on what's been proposed so far, it sounds like the latter wouldn't be an option; you'd only be able to play back a file from that one pre-configured location.

Yes, which is probably not the best idea, so maybe there should be an Other... selection which allows freer choice.

I wonder if the tooltip could be changed once a new user has understood what the various buttons do. Maybe have a new user setting which could be unticked to allow alternative tooltips or captions.

The tooltip should be able to be dynamically changed, but I'm of the mind that for basic day to day use, features should be self-explanatory.

If possible yes. I like the idea of the filename in the button but that could look bad if the button was stretched ad infinitum.

tmiw commented 4 months ago

Do you think it's fairly common to want to play back voice keyer files from anywhere other than a single location? For instance, normally you'd play back a file from ~/freedv/voice but maybe you need to play one from ~/Downloads once or twice. I ask because based on what's been proposed so far, it sounds like the latter wouldn't be an option; you'd only be able to play back a file from that one pre-configured location.

Yes, which is probably not the best idea, so maybe there should be an Other... selection which allows freer choice.

I'm imagining using the normal file selection dialog here with the "initial" folder being the pre-configured one, which should allow users to select something else in another location. After selecting a file from another location, though, do we just not preserve the selected file? (i.e. transmit it until VK turns off, but don't use it next time the VK button's pushed)

Tyrbiter commented 4 months ago

Do you think it's fairly common to want to play back voice keyer files from anywhere other than a single location? For instance, normally you'd play back a file from ~/freedv/voice but maybe you need to play one from ~/Downloads once or twice. I ask because based on what's been proposed so far, it sounds like the latter wouldn't be an option; you'd only be able to play back a file from that one pre-configured location.

Yes, which is probably not the best idea, so maybe there should be an Other... selection which allows freer choice.

I'm imagining using the normal file selection dialog here with the "initial" folder being the pre-configured one, which should allow users to select something else in another location. After selecting a file from another location, though, do we just not preserve the selected file? (i.e. transmit it until VK turns off, but don't use it next time the VK button's pushed)

That ought to be OK, I don't think we should make it any more complex than necessary. @barjac might like this, but a comment would be useful.

Displaying the filename in the button is OK if it's a short name, but how to deal with a longer name?

barjac commented 3 months ago

I have had a re-think after reading and re-reading all the above as I can see this becoming over complicated.

To summarize:

I think that an initial path to a sensible location for the OS is fine for new users.

If the path/directory is changed in Audio tab then that becomes current.

If a user navigates to a file elsewhere then the path is extracted and that becomes the new current path and is then shown in the Audio tab.

The current path/directory and current file are always persistent.

Displaying the filename in the button is OK if it's a short name, but how to deal with a longer name?

You just truncate them for display? As I said before users will soon realize that short names are best :)

The filename in a tooltip would be OK once the user knows about it.

The above would suit my use case and seems to cover other issues raised above in comments, whilst keeping things uncomplicated.

If a user has several VK file directories like maybe for CQs, testing, VHF, HF etc. then switching directories would be seamless using the standard file chooser.

WDYT?

Tyrbiter commented 3 months ago

I think that's a fair summary, it would work for me as described.

tmiw commented 3 months ago

See https://github.com/drowe67/freedv-gui/pull/730, which should implement most of what @barjac mentioned. The one exception is the display of the VK filename; it's tooltip-only for now since I'm still not sure about having it in the button itself (regardless of how long the filename is). Example of what the tooltip looks like:

Screenshot 2024-06-30 at 9 20 12 AM
Tyrbiter commented 3 months ago

Seems adequate to me on first sight, but time will tell I expect.