Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

include/dsound.h File Reference

Interface: direct control of sound. More...

#include <config.h>
#include <time.h>
#include <unistd.h>

Include dependency graph for dsound.h:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  note_t
 the note structure describing a single note. More...


Defines

#define PITCH_PAUSE   97
 specify a pause (rest)

#define PITCH_MAX   98
 maximum pitch value

#define PITCH_END   255
 mark the end of a list of note_t entries

#define DSOUND_BEEP   0
 system sounds

#define DSOUND_SYS_MAX   1
 max system sound

#define DSOUND_DEFAULT_16th_ms   200
 default duration of 1/16th note in ms

#define DSOUND_DEFAULT_internote_ms   15
 default duration internote spacing in ms


Functions

void dsound_play (const note_t *notes)
 play a sequence of notes

void dsound_system (unsigned nr)
 play a system sound

unsigned dsound_set_duration (unsigned duration)
 set duration of a 16th note in ms; return the previous duration.

void dsound_set_internote (unsigned duration)
 set duration of inter-note spacing (subtracted from note duration)

int dsound_playing (void)
 returns nonzero value if a sound is playing

wakeup_t dsound_finished (wakeup_t data)
 sound finished event wakeup function

void dsound_stop (void)
 stop playing sound


Detailed Description

Interface: direct control of sound.

Author:
Markus L. Noga <markus@noga.de>

Definition in file dsound.h.


Define Documentation

#define DSOUND_BEEP   0
 

system sounds

Definition at line 197 of file dsound.h.

#define DSOUND_DEFAULT_16th_ms   200
 

default duration of 1/16th note in ms

Definition at line 204 of file dsound.h.

#define DSOUND_DEFAULT_internote_ms   15
 

default duration internote spacing in ms

Definition at line 207 of file dsound.h.

#define DSOUND_SYS_MAX   1
 

max system sound

Definition at line 200 of file dsound.h.

Referenced by dsound_system().

#define EIGHTH   2
 

Eighth note in terms of sixteenths.

Definition at line 75 of file dsound.h.

#define HALF   8
 

Half note in terms of sixteenths.

Definition at line 69 of file dsound.h.

#define PITCH_A0   0
 

Note Pitch Value.

Definition at line 86 of file dsound.h.

#define PITCH_A1   12
 

Note Pitch Value.

Definition at line 98 of file dsound.h.

#define PITCH_A2   24
 

Note Pitch Value.

Definition at line 110 of file dsound.h.

#define PITCH_A3   36
 

Note Pitch Value.

Definition at line 122 of file dsound.h.

#define PITCH_A4   48
 

Note Pitch Value.

Definition at line 134 of file dsound.h.

#define PITCH_A5   60
 

Note Pitch Value.

Definition at line 146 of file dsound.h.

#define PITCH_A6   72
 

Note Pitch Value.

Definition at line 158 of file dsound.h.

#define PITCH_A7   84
 

Note Pitch Value.

Definition at line 170 of file dsound.h.

#define PITCH_A8   96
 

Note Pitch Value.

Definition at line 182 of file dsound.h.

#define PITCH_Am0   1
 

Note Pitch Value.

Definition at line 87 of file dsound.h.

#define PITCH_Am1   13
 

Note Pitch Value.

Definition at line 99 of file dsound.h.

#define PITCH_Am2   25
 

Note Pitch Value.

Definition at line 111 of file dsound.h.

#define PITCH_Am3   37
 

Note Pitch Value.

Definition at line 123 of file dsound.h.

#define PITCH_Am4   49
 

Note Pitch Value.

Definition at line 135 of file dsound.h.

#define PITCH_Am5   61
 

Note Pitch Value.

Definition at line 147 of file dsound.h.

#define PITCH_Am6   73
 

Note Pitch Value.

Definition at line 159 of file dsound.h.

#define PITCH_Am7   85
 

Note Pitch Value.

Definition at line 171 of file dsound.h.

#define PITCH_C1   3
 

Note Pitch Value.

Definition at line 89 of file dsound.h.

#define PITCH_C2   15
 

Note Pitch Value.

Definition at line 101 of file dsound.h.

#define PITCH_C3   27
 

Note Pitch Value.

Definition at line 113 of file dsound.h.

#define PITCH_C4   39
 

Note Pitch Value.

Definition at line 125 of file dsound.h.

#define PITCH_C5   51
 

Note Pitch Value.

Definition at line 137 of file dsound.h.

#define PITCH_C6   63
 

Note Pitch Value.

Definition at line 149 of file dsound.h.

#define PITCH_C7   75
 

Note Pitch Value.

Definition at line 161 of file dsound.h.

#define PITCH_C8   87
 

Note Pitch Value.

Definition at line 173 of file dsound.h.

#define PITCH_Cm1   4
 

Note Pitch Value.

Definition at line 90 of file dsound.h.

#define PITCH_Cm2   16
 

Note Pitch Value.

Definition at line 102 of file dsound.h.

#define PITCH_Cm3   28
 

Note Pitch Value.

Definition at line 114 of file dsound.h.

#define PITCH_Cm4   40
 

Note Pitch Value.

Definition at line 126 of file dsound.h.

#define PITCH_Cm5   52
 

Note Pitch Value.

Definition at line 138 of file dsound.h.

#define PITCH_Cm6   64
 

Note Pitch Value.

Definition at line 150 of file dsound.h.

#define PITCH_Cm7   76
 

Note Pitch Value.

Definition at line 162 of file dsound.h.

#define PITCH_Cm8   88
 

Note Pitch Value.

Definition at line 174 of file dsound.h.

#define PITCH_D1   5
 

Note Pitch Value.

Definition at line 91 of file dsound.h.

#define PITCH_D2   17
 

Note Pitch Value.

Definition at line 103 of file dsound.h.

#define PITCH_D3   29
 

Note Pitch Value.

Definition at line 115 of file dsound.h.

#define PITCH_D4   41
 

Note Pitch Value.

Definition at line 127 of file dsound.h.

#define PITCH_D5   53
 

Note Pitch Value.

Definition at line 139 of file dsound.h.

#define PITCH_D6   65
 

Note Pitch Value.

Definition at line 151 of file dsound.h.

#define PITCH_D7   77
 

Note Pitch Value.

Definition at line 163 of file dsound.h.

#define PITCH_D8   89
 

Note Pitch Value.

Definition at line 175 of file dsound.h.

#define PITCH_Dm1   6
 

Note Pitch Value.

Definition at line 92 of file dsound.h.

#define PITCH_Dm2   18
 

Note Pitch Value.

Definition at line 104 of file dsound.h.

#define PITCH_Dm3   30
 

Note Pitch Value.

Definition at line 116 of file dsound.h.

#define PITCH_Dm4   42
 

Note Pitch Value.

Definition at line 128 of file dsound.h.

#define PITCH_Dm5   54
 

Note Pitch Value.

Definition at line 140 of file dsound.h.

#define PITCH_Dm6   66
 

Note Pitch Value.

Definition at line 152 of file dsound.h.

#define PITCH_Dm7   78
 

Note Pitch Value.

Definition at line 164 of file dsound.h.

#define PITCH_Dm8   90
 

Note Pitch Value.

Definition at line 176 of file dsound.h.

#define PITCH_E1   7
 

Note Pitch Value.

Definition at line 93 of file dsound.h.

#define PITCH_E2   19
 

Note Pitch Value.

Definition at line 105 of file dsound.h.

#define PITCH_E3   31
 

Note Pitch Value.

Definition at line 117 of file dsound.h.

#define PITCH_E4   43
 

Note Pitch Value.

Definition at line 129 of file dsound.h.

#define PITCH_E5   55
 

Note Pitch Value.

Definition at line 141 of file dsound.h.

#define PITCH_E6   67
 

Note Pitch Value.

Definition at line 153 of file dsound.h.

#define PITCH_E7   79
 

Note Pitch Value.

Definition at line 165 of file dsound.h.

#define PITCH_E8   91
 

Note Pitch Value.

Definition at line 177 of file dsound.h.

#define PITCH_END   255
 

mark the end of a list of note_t entries

Definition at line 193 of file dsound.h.

#define PITCH_F1   8
 

Note Pitch Value.

Definition at line 94 of file dsound.h.

#define PITCH_F2   20
 

Note Pitch Value.

Definition at line 106 of file dsound.h.

#define PITCH_F3   32
 

Note Pitch Value.

Definition at line 118 of file dsound.h.

#define PITCH_F4   44
 

Note Pitch Value.

Definition at line 130 of file dsound.h.

#define PITCH_F5   56
 

Note Pitch Value.

Definition at line 142 of file dsound.h.

#define PITCH_F6   68
 

Note Pitch Value.

Definition at line 154 of file dsound.h.

#define PITCH_F7   80
 

Note Pitch Value.

Definition at line 166 of file dsound.h.

#define PITCH_F8   92
 

Note Pitch Value.

Definition at line 178 of file dsound.h.

#define PITCH_Fm1   9
 

Note Pitch Value.

Definition at line 95 of file dsound.h.

#define PITCH_Fm2   21
 

Note Pitch Value.

Definition at line 107 of file dsound.h.

#define PITCH_Fm3   33
 

Note Pitch Value.

Definition at line 119 of file dsound.h.

#define PITCH_Fm4   45
 

Note Pitch Value.

Definition at line 131 of file dsound.h.

#define PITCH_Fm5   57
 

Note Pitch Value.

Definition at line 143 of file dsound.h.

#define PITCH_Fm6   69
 

Note Pitch Value.

Definition at line 155 of file dsound.h.

#define PITCH_Fm7   81
 

Note Pitch Value.

Definition at line 167 of file dsound.h.

#define PITCH_Fm8   93
 

Note Pitch Value.

Definition at line 179 of file dsound.h.

#define PITCH_G1   10
 

Note Pitch Value.

Definition at line 96 of file dsound.h.

#define PITCH_G2   22
 

Note Pitch Value.

Definition at line 108 of file dsound.h.

#define PITCH_G3   34
 

Note Pitch Value.

Definition at line 120 of file dsound.h.

#define PITCH_G4   46
 

Note Pitch Value.

Definition at line 132 of file dsound.h.

#define PITCH_G5   58
 

Note Pitch Value.

Definition at line 144 of file dsound.h.

#define PITCH_G6   70
 

Note Pitch Value.

Definition at line 156 of file dsound.h.

#define PITCH_G7   82
 

Note Pitch Value.

Definition at line 168 of file dsound.h.

#define PITCH_G8   94
 

Note Pitch Value.

Definition at line 180 of file dsound.h.

#define PITCH_Gm1   11
 

Note Pitch Value.

Definition at line 97 of file dsound.h.

#define PITCH_Gm2   23
 

Note Pitch Value.

Definition at line 109 of file dsound.h.

#define PITCH_Gm3   35
 

Note Pitch Value.

Definition at line 121 of file dsound.h.

#define PITCH_Gm4   47
 

Note Pitch Value.

Definition at line 133 of file dsound.h.

#define PITCH_Gm5   59
 

Note Pitch Value.

Definition at line 145 of file dsound.h.

#define PITCH_Gm6   71
 

Note Pitch Value.

Definition at line 157 of file dsound.h.

#define PITCH_Gm7   83
 

Note Pitch Value.

Definition at line 169 of file dsound.h.

#define PITCH_Gm8   95
 

Note Pitch Value.

Definition at line 181 of file dsound.h.

#define PITCH_H0   2
 

Note Pitch Value.

Definition at line 88 of file dsound.h.

#define PITCH_H1   14
 

Note Pitch Value.

Definition at line 100 of file dsound.h.

#define PITCH_H2   26
 

Note Pitch Value.

Definition at line 112 of file dsound.h.

#define PITCH_H3   38
 

Note Pitch Value.

Definition at line 124 of file dsound.h.

#define PITCH_H4   50
 

Note Pitch Value.

Definition at line 136 of file dsound.h.

#define PITCH_H5   62
 

Note Pitch Value.

Definition at line 148 of file dsound.h.

#define PITCH_H6   74
 

Note Pitch Value.

Definition at line 160 of file dsound.h.

#define PITCH_H7   86
 

Note Pitch Value.

Definition at line 172 of file dsound.h.

#define PITCH_MAX   98
 

maximum pitch value

Definition at line 190 of file dsound.h.

#define PITCH_PAUSE   97
 

specify a pause (rest)

Definition at line 187 of file dsound.h.

#define QUARTER   4
 

Quater note in terms of sixteenths.

Definition at line 72 of file dsound.h.

#define WHOLE   16
 

Whole note in terms of sixteenths.

Definition at line 66 of file dsound.h.


Function Documentation

wakeup_t dsound_finished wakeup_t  data  ) 
 

sound finished event wakeup function

void dsound_play const note_t notes  )  [inline, static]
 

play a sequence of notes

Definition at line 234 of file dsound.h.

Referenced by dsound_system().

int dsound_playing void   )  [inline, static]
 

returns nonzero value if a sound is playing

Definition at line 260 of file dsound.h.

unsigned dsound_set_duration unsigned  duration  )  [inline, static]
 

set duration of a 16th note in ms; return the previous duration.

Definition at line 246 of file dsound.h.

void dsound_set_internote unsigned  duration  )  [inline, static]
 

set duration of inter-note spacing (subtracted from note duration)

set to 0 for perfect legato.

Definition at line 255 of file dsound.h.

void dsound_stop void   ) 
 

stop playing sound

void dsound_system unsigned  nr  )  [inline, static]
 

play a system sound

Definition at line 240 of file dsound.h.

References dsound_play(), and DSOUND_SYS_MAX.


brickOS is released under the Mozilla Public License.
Original code copyright 1998-2002 by the authors.

Generated on Mon Feb 16 21:01:54 2004 for brickOS C by doxygen 1.3.5