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
1d16ebff
Commit
1d16ebff
authored
Dec 16, 2015
by
Jason Simmons
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #959 from jason-simmons/sound_track_pause
Pause and resume of all tracks in SoundTrackPlayer
parents
247dc72b
8c45c949
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
flutter_sprites.dart
packages/flutter_sprites/lib/flutter_sprites.dart
+1
-0
sound.dart
packages/flutter_sprites/lib/src/sound.dart
+9
-4
No files found.
packages/flutter_sprites/lib/flutter_sprites.dart
View file @
1d16ebff
...
...
@@ -5,6 +5,7 @@
library
flutter_sprites
;
import
'dart:async'
;
import
'dart:collection'
;
import
'dart:convert'
;
import
'dart:math'
as
math
;
import
'dart:typed_data'
;
...
...
packages/flutter_sprites/lib/src/sound.dart
View file @
1d16ebff
...
...
@@ -135,7 +135,7 @@ class SoundTrack {
SoundTrackPlayer
_sharedSoundTrackPlayer
;
class
SoundTrackPlayer
{
List
<
SoundTrack
>
_soundTracks
=
<
SoundTrack
>[]
;
Set
<
SoundTrack
>
_soundTracks
=
new
HashSet
<
SoundTrack
>()
;
static
sharedInstance
()
{
if
(
_sharedSoundTrackPlayer
==
null
)
{
...
...
@@ -175,15 +175,20 @@ class SoundTrackPlayer {
soundTrack
.
_player
.
ptr
.
setVolume
(
volume
);
soundTrack
.
_player
.
ptr
.
seekTo
((
startTime
*
1000.0
).
toInt
());
soundTrack
.
_player
.
ptr
.
start
();
_soundTracks
.
add
(
soundTrack
);
}
void
stop
(
SoundTrack
track
)
{
track
.
_player
.
ptr
.
pause
();
}
void
stop
All
()
{
for
(
SoundTrack
soundTrack
in
_soundTracks
)
{
void
pause
All
()
{
for
(
SoundTrack
soundTrack
in
_soundTracks
)
soundTrack
.
_player
.
ptr
.
pause
();
}
}
void
resumeAll
()
{
for
(
SoundTrack
soundTrack
in
_soundTracks
)
soundTrack
.
_player
.
ptr
.
start
();
}
}
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