-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
160 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
INPUT = src/ | ||
OUTPUT_DIRECTORY = docs/ | ||
|
||
GENERATE_HTML = NO | ||
GENERATE_LATEX = NO | ||
GENERATE_XML = YES | ||
|
||
INLINE_SIMPLE_STRUCTS = YES | ||
|
||
FILE_PATTERNS = *.c *.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
API documentation | ||
================= | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
:glob: | ||
|
||
api/wav | ||
api/mzf | ||
api/write | ||
api/methods |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Tape write methods | ||
================== | ||
|
||
.. code-block:: cpp | ||
#include "methods.h" | ||
.. doxygenfile:: methods.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
MZF files | ||
========= | ||
|
||
.. code-block:: cpp | ||
#include "mzf.h" | ||
.. doxygenfile:: mzf.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
WAV files | ||
========= | ||
|
||
.. code-block:: cpp | ||
#include "wav.h" | ||
.. doxygenfile:: wav.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Tape write functions | ||
==================== | ||
|
||
.. code-block:: cpp | ||
#include "write.h" | ||
.. doxygenfile:: write.h |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
project = 'mzf2wav' | ||
author = 'Jeroen F.J. Laros' | ||
copyright = '2003-2023, {}'.format(author) | ||
|
||
extensions = ['breathe'] | ||
breathe_projects = {'doxygen': 'xml'} | ||
breathe_default_project = 'doxygen' | ||
breathe_default_members = ('members',) | ||
|
||
master_doc = 'index' | ||
|
||
highlight_language = 'none' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ | |
install | ||
cli | ||
usage | ||
api | ||
credits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
breathe>=4.3.1 | ||
docutils>=0.17.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,30 +15,6 @@ uint16_t const turboDefaults_[][4] = { | |
Options const default_ = { | ||
NULL, NULL, fast, false, 44100, {0}, {0}, false, false, false}; | ||
|
||
char const usage[] = | ||
"usage: %s [-c] [-t] [-p] [-b BITRATE] [-n SPEED] [-s SPEED] " | ||
"[-N FMT] [-S FMT] MZF WAV\n\n" | ||
"positional arguments:\n" | ||
" MZF input file in MZF format\n" | ||
" WAV input file in WAV format\n\n" | ||
"options:\n" | ||
" -h display help information and exit\n" | ||
" -v display version information and exit\n" | ||
" -c conventional mode\n" | ||
" -t turbo mode\n" | ||
" -p invert polarity\n" | ||
" -b BITRATE bit rate (dafault: 44100)\n" | ||
" -n SPEED normal mode speed 0 or 1 (default: 0)\n" | ||
" -s SPEED turbo mode speed 0, 1 or 2 (default: 0)\n" | ||
" -N FMT custom waveform for normal mode\n" | ||
" -S FMT custom waveform for turbo mode\n\n" | ||
"FMT: long_up,long_down,short_up,short_down\n"; | ||
|
||
char const version[] = | ||
"MZF2WAV version 2.0.0\n" | ||
"Copyright (c) 2003-2023 Jeroen F.J. Laros <[email protected]>\n" | ||
"Homepage: https://mzf2wav.readthedocs.io\n"; | ||
|
||
|
||
size_t parseInt_(char const *const text, size_t const range) { | ||
size_t idx = strtoul(text, NULL, 10); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,30 @@ | |
|
||
#include "argparse.h" | ||
|
||
char const usage_[] = | ||
"usage: %s [-c] [-t] [-p] [-b BITRATE] [-n SPEED] [-s SPEED] " | ||
"[-N FMT] [-S FMT] MZF WAV\n\n" | ||
"positional arguments:\n" | ||
" MZF input file in MZF format\n" | ||
" WAV input file in WAV format\n\n" | ||
"options:\n" | ||
" -h display help information and exit\n" | ||
" -v display version information and exit\n" | ||
" -c conventional mode\n" | ||
" -t turbo mode\n" | ||
" -p invert polarity\n" | ||
" -b BITRATE bit rate (dafault: 44100)\n" | ||
" -n SPEED normal mode speed 0 or 1 (default: 0)\n" | ||
" -s SPEED turbo mode speed 0, 1 or 2 (default: 0)\n" | ||
" -N FMT custom waveform for normal mode\n" | ||
" -S FMT custom waveform for turbo mode\n\n" | ||
"FMT: long_up,long_down,short_up,short_down\n"; | ||
|
||
char const version_[] = | ||
"MZF2WAV version 2.0.0\n" | ||
"Copyright (c) 2003-2023 Jeroen F.J. Laros <[email protected]>\n" | ||
"Homepage: https://mzf2wav.readthedocs.io\n"; | ||
|
||
|
||
unsigned int fileSize_(FILE *handle) { | ||
fseek(handle, 0, SEEK_END); | ||
|
@@ -79,14 +103,16 @@ bool mzf2wav(Options const *const options) { | |
|
||
int main(int const argc, char *const *const argv) { | ||
Options options = argParse(argc, argv); | ||
if (options.version) { | ||
printf(version); | ||
if (options.help) { | ||
printf(usage_, argv[0]); | ||
return 0; | ||
} | ||
if (options.help || options.error) { | ||
printf(usage, argv[0]); | ||
if (options.version) { | ||
printf(version_); | ||
return 0; | ||
} | ||
if (options.error || !mzf2wav(&options)) { | ||
printf(usage_, argv[0]); | ||
return 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters