Skip to content

Add new options to MISRC Capture #17

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

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

Conversation

alvin8t
Copy link

@alvin8t alvin8t commented Apr 25, 2025

Added new options:

  • A suppresses all clipping messages from ADC A
  • B suppresses all clipping messages from ADC B
  • t takes the integer entered and multiples it by 40,000,000 (for entering number of seconds)
  • w overwrites already existing files without asking
  • Fixed n where it did not work at all, but now will exit when the number of samples is reached. This takes priority over -t (if specified at the same time).

First time committing to an open source project, any advice or suggestions welcome, and please excuse my ignorance on my mistakes.

Added new options A, B, w, and t. Fixed option n that didn't work. Options A and B suppress clipping messages for their ADC. Option w forces an overwrite of files without asking. Option t multiples the number entered by 40 million (so the user can enter the number of seconds to capture). Option n now captures only the number of samples entered.
@alvin8t alvin8t changed the title Update misrc_capture.c Add new options to MISRC Capture Apr 25, 2025
@harrypm harrypm requested a review from Stefan-Olt May 3, 2025 18:02
@harrypm
Copy link
Collaborator

harrypm commented May 3, 2025

Just did a quick test, this appears to be working well.

(Ideally also need to add threads option to flac now with the v1.5.0 multithreading update)

@Stefan-Olt
Copy link
Owner

Thanks for the pull request! This is first open source project I'm maintaining, so all I can tell you is that I see nothing wrong with the way you created this pull request.
I'll have a look at your code and comment there if I notice something

Copy link
Owner

@Stefan-Olt Stefan-Olt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote comments directly in the code

@@ -102,11 +102,15 @@ void usage(void)
"Usage:\n"
"\t[-d device_index (default: 0)]\n"
"\t[-n number of samples to read (default: 0, infinite)]\n"
"\t[-t seconds to capture (-n takes priority, assumes 40msps with a single ADC)]\n"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if -t is the best option, maybe that's better for FLAC threads. Why not -s?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Harry suggested that this could be extended into hh:mm:ss (a single value is treated as seconds, if there is a single colon it's mm:ss, with two colons it's hh:mm:ss). Then -s doesn't make much sense

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds like a better method. I initially choose t for time. I thought about doing it where the user could enter "4h5m34s", but I am not well versed in the C language and didn't want to learn to deal with pointers, memory, etc. The languages I primarily work in are PHP, Java, and RPGLE, so it's hard for me to create the parsing for that in C.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most things are harder in C, but I could add that at a later point

@Stefan-Olt
Copy link
Owner

Could you fix the brackets and update your code to work with the flac threading (the command parsing string needs to be combined)? Then I would merge it and later add the hh:mm:ss parsing

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.

3 participants