-
Notifications
You must be signed in to change notification settings - Fork 31
Man edits and more #274
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
Man edits and more #274
Conversation
Edit for recommended practices of formatting manual pages. Added formatting tips and documentation references at the top of the file. Completed up through the USAGE section.
Presumably this was a typo and should just be an alteration test for a local versus the file located in the user's PATH.
As installation places the soundlog script into ${prefix}/bin, avoid requiring the user to copy it to the ~/tlf/soundlogs directory. It works just fine from PATH when called from inside the directory.
The -w option on the rec commandline probably dates from the Open Sound System (OSS) version of rec. This option is not recognized by the SoX version of rec which is the only version available on modern Debian. This command line has been commented out so users can restore it easily if needed. Instead add an example command for Sox rec as the default. The -c 1 option forces single channel recording. This needs to be documented in the manual page so users can remove it as two channel recording is the default for this version of rec. Two channel recording may be useful for transceivers that output two channel audio, such as the Elecraft K3. The -q option makes the rec utility quiet, quelling its normal output.
The opendir() function is not in a context where it understands the value of $HOME, unlike the system() calls used elsewhere which operate in a user's shell environment. To make this work, query the environment for the value of HOME and concatenate it to the hard coded directory and pass that to opendir(). Add some error handling so if in the future the directory is exposed to user configuration, the user won't be completely in the dark if there is a typo in the entered path.
First try at only stopping TX when Escape is pressed the first time. This is very simplistic and likely will need more refinement for general deployment.
char *path = g_strdup_printf("%s%s", | ||
g_getenv("HOME"), | ||
"/tlf/soundlogs"); | ||
|
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.
A point we should think about: Until now no other part of TLF requires a dedicated ~/tlf directory. Do we like to have a central one or keep our old tradition, that 'soundlog' should be a subdirectory of the actual contest directory in use?
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.
Added some comments and a question.
@@ -258,6 +258,9 @@ int cwstart = 0; /**< number characters after which | |||
int sending_call = 0; | |||
int early_started = 0; /**< 1 if sending call started early, | |||
strlen(hiscall)>cwstart or 'space' */ | |||
int escape_pressed = 0; /**< 0. Escape not last key pressed. |
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 prefer using bool
for actually boolean values. Also x = true
or if (x) {..
/if (!x) {..
makes code a bit more readable.
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.
Agreed. Originally I'd planned on the values 0-3 for counting all presses until all fields are cleared. Then I decided that isn't necessary.
As stated, this PR is mostly for review and discussion. I say cherry pick anything that's good and improve/discard the rest as needed.
@@ -147,6 +147,7 @@ int callinput(void) { | |||
int j, t, x = 0; | |||
char instring[2] = { '\0', '\0' }; | |||
static int lastwindow; | |||
extern int escape_pressed; |
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.
let's add globals to globalvars.h
. This avoids having to list all used globals separately.
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 think that should be useful.
@@ -796,9 +801,15 @@ int callinput(void) { | |||
// <Escape>, clear call input or stop sending. | |||
case ESCAPE: { | |||
if (early_started == 0) { | |||
if (escape_pressed == 0) { |
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.
Is the point of using escape_pressed
is to stoptx()
for the first ESC and cleanup()
+ clear_display()
for the second?
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.
Exactly.
I find the combination of stopping TX and clearing the exchange field to be rather irritating. Other programs I've used never did that, in fact they only used Escape to stop TX and another key/combination to clear the fields.
For CW this worked very well this past weekend. I gave up on stopping the voice keyer as per Tom and my discussion on the mailing list. I still think that should be implemented but there is likely a better way than the hack I came up with (not part of this PR).
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.
OK, it took some time for me to figure out. :-)
How about putting it more explicitly, something like
if (x==ESC) { ++esc_count } else {esc_count=0}
switch(x) {
case ESC:
if (esc_count==1) { stop_tx() }
else if (esc_count>1) { clear... }
Would there be a way to avoid code duplication in callinput and getexechange? I mean some keys should behave the same, so it could warrant a common code. Not sure how to do it best.
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.
That looks clean to me.
Sometimes there are subtle differences depending on whether a key is input in the call input or exchange field. I suppose that can be worked out but it would be a big refactor and I'm not sure what the gain would be.
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.
Factor out the handling of common keys is something we should go for.
For the keys which are handled differently we could even add a state variable telling us the actual input field we are in.
Also provide commented play command for OSS.
Tom, please merge all of the commits except f9be31b, especially the two for the manual page updates. I have also modified |
My apologies for mixing PR topics. |
Seems mail mail from Saturday did not made it as a reply :-(, sorry. Will pick up the commit shortly. I think it is ok to merge related commits (e.g. the man page updates). |
A question came up for ef0696c: The change does not simply allow having 'soundlog' in PATH - instead it is now REQUIRED to be in PATH. Before I commit it - do we want to keep it so? |
Tom, |
Ok, I'll pick up the actual solution and take the extension on the todo list. |
Cherry-picked, squashed and applied all commits (besides f9be31b) as requested. |
Hi Nate, while working on the $HOME problem did you have success with playing the recorded sound log files? The whole sound handling is in a bad shape. Some parts use hardcoded script names, some use hard coded command strings and some use external command given by logcfg.dat. We should choose a common mode for determining the play and record commands to use. What makes it more demanding is that we need to record from different sources (microphone or rig) and also have to play to different sinks (radio or speaker). Any idea how to specify that in SoX? |
Once I changed things in the code, yes, it worked. I don't think I pushed that stuff out, though.
I would think that opting for a default that can be overridden by a setting in
That, I don't know. As I run Gnome and PulseAudio and run Tlf in an Xterm, I use the |
Ok, I will look into it.
Same preference here. I will go that way.
I did some more research and I found some ways to use different sound devices at the same time. Just have |
Just found how to control the device for recording and/playing sound.
will do. I will finally add these to the man page. |
.B QSO | ||
or | ||
.B DXPED | ||
modes). | ||
. | ||
.TP | ||
.B IGNOREDUPES |
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.
Just came across this: it's spelled in singular, IGNOREDUPE
.
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.
Good catch. Fixed.
Could this be merged? Master is drifting away... |
Accept the commit mentioned by Nate
all got merged in already in commit e26dfde in September last year. I kept the PR open to kept the discussion about the audio recording around until PR #276 got finished. That one is overdue and I had planned to complete it in next weeks after finishing the move to use qso_array instead of qsos[] (PR #305). So please let us wait with closing the PR here for some days longer. |
* On 2021 30 Aug 05:49 -0500, Thomas Beierlein wrote:
@dl1jbe commented on this pull request.
>
- if (sounddir == NULL)
+ /* Must query the environment for the value of $HOME
+ * and build the path to the soundlogs.
+ */
+ char *path = g_strdup_printf("%s%s",
+ g_getenv("HOME"),
+ "/tlf/soundlogs");
+
A point we should think about: Until now no other part of TLF requires
a dedicated ~/tlf directory. Do we like to have a central one or keep
our old tradition, that 'soundlog' should be a subdirectory of the
actual contest directory in use?
I think that making soundlog a subdirectory of the working directory is
a good idea. Such audio logs should be contest/event specific and
putting them all together makes it easy to back them up, etc.
As an example, in my home directory is a subdirectory named 'logs'.
Under that I have directories for each event, e.g. 'KSQP-2021', etc.,
under each of those are all of the files/directory(ies) for an event.
73, Nate
P.S. I guess I did not catch this when it first hit my email box almost
six months ago!
…--
"The optimist proclaims that we live in the best of all
possible worlds. The pessimist fears this is true."
Web: https://www.n0nb.us
Projects: https://github.com/N0NB
GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819
|
Nate, there is an unfinished branch stop_tx in PR #276 which I plan to complete next. In it I made the soundlog directory configurable by keyword in logcfg.dat. At the moment the default is '~/tlf/soundlogs' but I agree that just './soundlogs' would be better. That can be easily done. |
* On 2022 27 Feb 02:49 -0600, Thomas Beierlein wrote:
Nate, there is an unfinished branch stop_tx in PR #276 which I plan to
complete next.
I noticed that things were still as before when I did some of the CQ 160
last month. I appreciate the careful evaluation of features.
In it I made the soundlog directory configurable by keyword in
logcfg.dat. At the moment the default is '~/tlf/soundlogs' but I agree
that just './soundlogs' would be better. That can be easily done.
Good. I'd not thought of that directory before and I think yours is a
reasonable approach.
73, Nate
…--
"The optimist proclaims that we live in the best of all
possible worlds. The pessimist fears this is true."
Web: https://www.n0nb.us
Projects: https://github.com/N0NB
GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819
|
I was not closely following this PR, sorry. |
This is related to issue 272 (please do not close it yet!)
There are some script fixes and a simple implementation of Escape only stops TX on the first press which likely needs more refinement.
I'm requesting review and discussion.