Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F618169
sound.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
sound.h
View Options
#ifndef _paintown_sound_h
#define _paintown_sound_h
#include
<string>
#include
"load_exception.h"
#ifdef USE_SDL
#include
"sdl/sound.h"
#endif
#ifdef USE_ALLEGRO
#include
"allegro/sound.h"
#endif
#ifdef USE_ALLEGRO5
#include
"allegro5/sound.h"
#endif
struct
SAMPLE
;
/* a sound! */
class
Sound
{
public
:
Sound
();
/* create from wav file (riff header + pcm) */
Sound
(
const
char
*
data
,
int
length
);
/* load from path */
Sound
(
const
std
::
string
&
path
)
throw
(
LoadException
);
Sound
(
const
Sound
&
copy
);
/* do any global initialization necessary */
static
void
initialize
();
/* cleanup */
static
void
uninitialize
();
Sound
&
operator
=
(
const
Sound
&
rhs
);
void
play
();
void
play
(
double
volume
,
int
pan
);
void
playLoop
();
void
stop
();
virtual
~
Sound
();
/* global frequency to use */
// static const int FREQUENCY = 22050;
struct
SoundInfo
{
SoundInfo
()
:
frequency
(
44100
),
channels
(
2
),
format
(
0
){
}
int
frequency
;
int
channels
;
/* format is mostly for SDL */
int
format
;
};
static
SoundInfo
Info
;
protected
:
/* scale to the configuration sound level */
static
double
scale
(
double
in
);
void
destroy
();
// SAMPLE * my_sound;
SoundData
data
;
/* reference counting */
int
*
own
;
};
#endif
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Sat, Nov 14, 2:47 PM (4 m, 42 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
142031
Default Alt Text
sound.h (1 KB)
Attached To
Mode
R75 R-Tech1
Attached
Detach File
Event Timeline