Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
7f7c6c64
Commit
7f7c6c64
authored
20 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
The xptone() wave shape number (currently 0-6) may be specified on the
command line (-x#).
parent
faff4c83
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tone/tone.c
+28
-24
28 additions, 24 deletions
src/tone/tone.c
with
28 additions
and
24 deletions
src/tone/tone.c
+
28
−
24
View file @
7f7c6c64
...
...
@@ -58,7 +58,9 @@ int octave=4; /* Default octave */
double
pitch
=
523
.
50
/
32
.
0
;
/* low 'C' */
BOOL
use_xp_beep
=
FALSE
;
BOOL
use_xptone
=
FALSE
;
enum
WAVE_SHAPE
wave_shape
;
void
play
(
char
*
freq
,
char
*
dur
)
{
...
...
@@ -145,8 +147,8 @@ void play(char *freq, char *dur)
else
len
=
(
d
*
t
);
if
(
f
)
{
if
(
use_xp
_beep
)
xp
beep
(
f
,
len
);
if
(
use_xp
tone
)
xp
tone
(
f
,
len
,
wave_shape
);
else
BEEP
(
f
,
len
);
}
...
...
@@ -185,6 +187,8 @@ void usage(void)
printf
(
" f display frequency or note value
\n
"
);
printf
(
" n not abortable with key-stroke
\n
"
);
printf
(
" v disable visual text commands
\n
"
);
printf
(
" x# use xptone (wave/dsp output) instead of beep macro
\n
"
);
printf
(
" optionally, specify wave shape number
\n
"
);
exit
(
0
);
}
...
...
@@ -193,7 +197,7 @@ int main(int argc, char **argv)
char
*
p
;
char
str
[
128
];
char
revision
[
16
];
int
i
,
j
;
int
i
;
FILE
*
stream
;
sscanf
(
"$Revision$"
,
"%*s %s"
,
revision
);
...
...
@@ -206,26 +210,26 @@ int main(int argc, char **argv)
setvbuf
(
stdout
,
NULL
,
_IONBF
,
0
);
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
argv
[
i
][
0
]
==
'-'
)
{
for
(
j
=
1
;
argv
[
i
][
j
];
j
++
)
switch
(
toupper
(
argv
[
i
][
j
]))
{
case
'D'
:
mode
^=
SHOW_DOT
;
break
;
case
'F'
:
mode
^=
SHOW_FREQ
;
break
;
case
'N'
:
mode
^=
NOT_ABORTABLE
;
break
;
case
'V'
:
mode
^=
NO_VISUAL
;
break
;
case
'X'
:
use_xp_beep
=
TRUE
;
break
;
default:
usage
();
break
;
switch
(
toupper
(
argv
[
i
][
1
]))
{
case
'D'
:
mode
^=
SHOW_DOT
;
break
;
case
'F'
:
mode
^=
SHOW_FREQ
;
break
;
case
'N'
:
mode
^=
NOT_ABORTABLE
;
break
;
case
'V'
:
mode
^=
NO_VISUAL
;
break
;
case
'X'
:
use_xptone
=
TRUE
;
wave_shape
=
atoi
(
argv
[
i
]
+
2
)
;
break
;
default:
usage
();
break
;
}
continue
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment