diff options
author | Thomas Martitz <kugel@rockbox.org> | 2011-03-16 15:17:24 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2011-03-16 15:17:24 +0000 |
commit | 8c46ddf9d719fb29f483dc21993167907953f39c (patch) | |
tree | 03d99235b88ba6f327db503f65e67061ae5568e3 /firmware/target/hosted/android/pcm-android.c | |
parent | 046cec3aa7fd58a9519cad8d693b47a2400e1742 (diff) | |
download | rockbox-8c46ddf9d719fb29f483dc21993167907953f39c.tar.gz rockbox-8c46ddf9d719fb29f483dc21993167907953f39c.zip |
Android: Implement app shutdown and thus, sleep timer.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29602 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/hosted/android/pcm-android.c')
-rw-r--r-- | firmware/target/hosted/android/pcm-android.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/firmware/target/hosted/android/pcm-android.c b/firmware/target/hosted/android/pcm-android.c index edb3503262..cc8bd9c48a 100644 --- a/firmware/target/hosted/android/pcm-android.c +++ b/firmware/target/hosted/android/pcm-android.c | |||
@@ -36,6 +36,7 @@ static char *pcm_data_start; | |||
36 | static jmethodID play_pause_method; | 36 | static jmethodID play_pause_method; |
37 | static jmethodID stop_method; | 37 | static jmethodID stop_method; |
38 | static jmethodID set_volume_method; | 38 | static jmethodID set_volume_method; |
39 | static jclass RockboxPCM_class; | ||
39 | static jobject RockboxPCM_instance; | 40 | static jobject RockboxPCM_instance; |
40 | 41 | ||
41 | 42 | ||
@@ -159,7 +160,7 @@ void pcm_play_dma_init(void) | |||
159 | **/ | 160 | **/ |
160 | JNIEnv e = *env_ptr; | 161 | JNIEnv e = *env_ptr; |
161 | /* get the class and its constructor */ | 162 | /* get the class and its constructor */ |
162 | jclass RockboxPCM_class = e->FindClass(env_ptr, "org/rockbox/RockboxPCM"); | 163 | RockboxPCM_class = e->FindClass(env_ptr, "org/rockbox/RockboxPCM"); |
163 | jmethodID constructor = e->GetMethodID(env_ptr, RockboxPCM_class, "<init>", "()V"); | 164 | jmethodID constructor = e->GetMethodID(env_ptr, RockboxPCM_class, "<init>", "()V"); |
164 | /* instance = new RockboxPCM() */ | 165 | /* instance = new RockboxPCM() */ |
165 | RockboxPCM_instance = e->NewObject(env_ptr, RockboxPCM_class, constructor); | 166 | RockboxPCM_instance = e->NewObject(env_ptr, RockboxPCM_class, constructor); |
@@ -180,6 +181,15 @@ void pcm_set_mixer_volume(int volume) | |||
180 | (*env_ptr)->CallVoidMethod(env_ptr, RockboxPCM_instance, set_volume_method, volume); | 181 | (*env_ptr)->CallVoidMethod(env_ptr, RockboxPCM_instance, set_volume_method, volume); |
181 | } | 182 | } |
182 | 183 | ||
184 | /* | ||
185 | * release audio resources */ | ||
186 | void pcm_shutdown(void) | ||
187 | { | ||
188 | JNIEnv e = *env_ptr; | ||
189 | jmethodID release = e->GetMethodID(env_ptr, RockboxPCM_class, "release", "()V"); | ||
190 | e->CallVoidMethod(env_ptr, RockboxPCM_instance, release); | ||
191 | } | ||
192 | |||
183 | /* Due to limitations of default_event_handler(), parameters gets swallowed when | 193 | /* Due to limitations of default_event_handler(), parameters gets swallowed when |
184 | * being posted with queue_broadcast(), so workaround this by caching the last | 194 | * being posted with queue_broadcast(), so workaround this by caching the last |
185 | * value. | 195 | * value. |