Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
3d31273e
Commit
3d31273e
authored
Aug 13, 2015
by
Viktor Lidholt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename SoundCompleteCallback to SoundEffectStreamCallback
parent
fa82f1a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
sound.dart
examples/game/lib/sound.dart
+8
-8
No files found.
examples/game/lib/sound.dart
View file @
3d31273e
...
...
@@ -3,7 +3,7 @@ part of sprites;
// TODO: The sound effects should probably use Android's SoundPool instead of
// MediaPlayer as it is more efficient and flexible for playing back sound effects
typedef
void
Sound
CompleteCallback
(
);
typedef
void
Sound
EffectStreamCallback
(
SoundEffectStream
);
class
SoundEffect
{
SoundEffect
(
this
.
_url
);
...
...
@@ -26,7 +26,7 @@ class SoundEffectStream {
this
.
volume
,
this
.
pitch
,
this
.
pan
,
this
.
callback
this
.
onSoundComplete
);
// TODO: Make these properties work
...
...
@@ -40,20 +40,20 @@ class SoundEffectStream {
// TODO: Implement completion callback. On completion, sounds should
// also be removed from the list of playing sounds.
Sound
CompleteCallback
callback
;
Sound
EffectStreamCallback
onSoundComplete
;
MediaPlayerProxy
_player
;
}
SoundEffectPlayer
_sharedSound
Pool
;
SoundEffectPlayer
_sharedSound
EffectPlayer
;
class
SoundEffectPlayer
{
static
SoundEffectPlayer
sharedInstance
()
{
if
(
_sharedSound
Pool
==
null
)
{
_sharedSound
Pool
=
new
SoundEffectPlayer
();
if
(
_sharedSound
EffectPlayer
==
null
)
{
_sharedSound
EffectPlayer
=
new
SoundEffectPlayer
();
}
return
_sharedSound
Pool
;
return
_sharedSound
EffectPlayer
;
}
SoundEffectPlayer
()
{
...
...
@@ -92,7 +92,7 @@ class SoundEffectPlayer {
double
volume
=
1.0
,
double
pitch
=
1.0
,
double
pan
=
0.0
,
Sound
Complete
Callback
callback
=
null
])
{
Sound
EffectStream
Callback
callback
=
null
])
{
// Create new PlayingSound object
SoundEffectStream
playingSound
=
new
SoundEffectStream
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment