1
1
cdef extern void android_sound_queue(int , char * , char * , long long , long long )
2
2
cdef extern void android_sound_play(int , char * , char * , long long , long long )
3
3
cdef extern void android_sound_stop(int )
4
+ cdef extern void android_sound_seek(int , float )
4
5
cdef extern void android_sound_dequeue(int )
5
6
cdef extern void android_sound_playing_name(int , char * , int )
6
7
cdef extern void android_sound_pause(int )
@@ -11,15 +12,17 @@ cdef extern void android_sound_set_secondary_volume(int, float)
11
12
cdef extern void android_sound_set_pan(int , float )
12
13
13
14
cdef extern int android_sound_queue_depth(int )
15
+ cdef extern int android_sound_get_pos(int )
16
+ cdef extern int android_sound_get_length(int )
14
17
15
18
channels = set ()
16
19
volumes = { }
17
20
18
21
def queue (channel , file , name , fadein = 0 , tight = False ):
19
22
20
23
channels.add(channel)
21
-
22
- real_fn = file .name
24
+
25
+ real_fn = file .name
23
26
base = getattr (file , " base" , - 1 )
24
27
length = getattr (file , " length" , - 1 )
25
28
@@ -28,13 +31,16 @@ def queue(channel, file, name, fadein=0, tight=False):
28
31
def play (channel , file , name , paused = False , fadein = 0 , tight = False ):
29
32
30
33
channels.add(channel)
31
-
34
+
32
35
real_fn = file .name
33
36
base = getattr (file , " base" , - 1 )
34
37
length = getattr (file , " length" , - 1 )
35
38
36
39
android_sound_play(channel, name, real_fn, base, length)
37
40
41
+ def seek (channel , position ):
42
+ android_sound_seek(channel, position)
43
+
38
44
def stop (channel ):
39
45
android_sound_stop(channel)
40
46
@@ -70,20 +76,23 @@ def unpause_all():
70
76
def pause_all ():
71
77
for i in channels:
72
78
pause(i)
73
-
79
+
74
80
def fadeout (channel , ms ):
75
81
stop(channel)
76
82
77
83
def busy (channel ):
78
84
return playing_name(channel) != None
79
85
80
86
def get_pos (channel ):
81
- return 0
87
+ return android_sound_get_pos(channel)
88
+
89
+ def get_length (channel ):
90
+ return android_sound_get_length(channel)
82
91
83
92
def set_volume (channel , volume ):
84
93
android_sound_set_volume(channel, volume)
85
94
volumes[channel] = volume
86
-
95
+
87
96
def set_secondary_volume (channel , volume ):
88
97
android_sound_set_secondary_volume(channel, volume)
89
98
0 commit comments