forked from len0rd/rockbox
Remove hosted_get_volume(), as event data is available in button_get_data().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30300 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2d0e63e136
commit
dbdbc242ac
3 changed files with 6 additions and 21 deletions
|
|
@ -622,7 +622,9 @@ long default_event_handler_ex(long event, void (*callback)(void *), void *parame
|
||||||
case SYS_VOLUME_CHANGED:
|
case SYS_VOLUME_CHANGED:
|
||||||
{
|
{
|
||||||
static bool firstvolume = true;
|
static bool firstvolume = true;
|
||||||
int volume = hosted_get_volume();
|
/* kludge: since this events go to the button_queue,
|
||||||
|
* event data is available in the last button data */
|
||||||
|
int volume = button_get_data();
|
||||||
DEBUGF("SYS_VOLUME_CHANGED: %d\n", volume);
|
DEBUGF("SYS_VOLUME_CHANGED: %d\n", volume);
|
||||||
if (global_settings.volume != volume) {
|
if (global_settings.volume != volume) {
|
||||||
global_settings.volume = volume;
|
global_settings.volume = volume;
|
||||||
|
|
|
||||||
|
|
@ -143,10 +143,6 @@ int get_cpu_boost_counter(void);
|
||||||
#undef swap32
|
#undef swap32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(PLATFORM_HAS_VOLUME_CHANGE)
|
|
||||||
int hosted_get_volume(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Get the byte offset of a type's member */
|
/* Get the byte offset of a type's member */
|
||||||
#define OFFSETOF(type, membername) ((off_t)&((type *)0)->membername)
|
#define OFFSETOF(type, membername) ((off_t)&((type *)0)->membername)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -225,16 +225,6 @@ void pcm_shutdown(void)
|
||||||
pthread_mutex_destroy(&audio_lock_mutex);
|
pthread_mutex_destroy(&audio_lock_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Due to limitations of default_event_handler(), parameters gets swallowed when
|
|
||||||
* being posted with queue_broadcast(), so workaround this by caching the last
|
|
||||||
* value.
|
|
||||||
*/
|
|
||||||
static int lastPostedVolume = -1;
|
|
||||||
int hosted_get_volume(void)
|
|
||||||
{
|
|
||||||
return lastPostedVolume;
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL
|
JNIEXPORT void JNICALL
|
||||||
Java_org_rockbox_RockboxPCM_postVolumeChangedEvent(JNIEnv *env,
|
Java_org_rockbox_RockboxPCM_postVolumeChangedEvent(JNIEnv *env,
|
||||||
jobject this,
|
jobject this,
|
||||||
|
|
@ -242,10 +232,7 @@ Java_org_rockbox_RockboxPCM_postVolumeChangedEvent(JNIEnv *env,
|
||||||
{
|
{
|
||||||
(void) env;
|
(void) env;
|
||||||
(void) this;
|
(void) this;
|
||||||
|
/* for the main queue, the volume will be available through
|
||||||
if (volume != lastPostedVolume)
|
* button_get_data() */
|
||||||
{
|
queue_broadcast(SYS_VOLUME_CHANGED, volume);
|
||||||
lastPostedVolume = volume;
|
|
||||||
queue_broadcast(SYS_VOLUME_CHANGED, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue