Wallpaper Engine

Wallpaper Engine

View Stats:
audiodata events / webwallpaper
I got some bug reports on my VU Meter wallpaper and have done some testing.

If the wallpaper starts with audioprocessing off ( not if audioprocessing is changed when already active ), and you toggle audio processing, the audio event wont get triggers. This problem does not seem to occur with the audiophile wallpaper, so possible related to web wallpapers only.

To reproduce:
- check off audio processing on my wallpaper ( or an html with the code below )
- select a different wallpaper, then reselect mine
- now its started with audioprocessing turned off, if you would check audio processing again, it wont trigger audio events
- If the state of the wallpaper ( running/paused ) changes, then it does get triggered again. But if you got all options on "Always Running" it wont trigger the event.

Some code I tested with to isolate it:
<script type="text/javascript"> var count = 0; // added to avoid being spammed by alerts var registerAudioListener = function() { if( window.wallpaperRegisterAudioListener ) { window.wallpaperRegisterAudioListener(function(data) { // alert only shows on first event if(0 === count++) { alert( 'data received'); } }); } else { alert( 'can\'t register audio listener' ); } }; window.onload = function() { /*/ window.wallpaperPropertyListener = { applyUserProperties: function( properties ) {registerAudioListener();}, applyGeneralProperties: function( properties ) {registerAudioListener();} }; /**/ registerAudioListener(); }; </script>

I think it's a bug, or I am missing something obvious :spazdunno:



On a related note, I noticed that when re-registering the audiolistener, the old ones aren't used anymore. So you can't subscribe multiple callbacks. Can I assume this will remain the case? Should I even re-register the callback?
< >
Showing 1-2 of 2 comments
Oct 29, 2016 @ 11:45am 
Fixed.

Yeah, only one callback will be stored on the C++ side. Registering it through window.onload one single time should keep it valid until the wallpaper changes (which either destroys the web processes or navigates to a different URL).

Edit: Do you need multiple callbacks? I think the overhead of sending the data multiple times may not be worth it, though I'm not sure about a potential use case you may have?
That was a quick fix :) And I will stick to that if thats the correct implementation. Was considering reregistering in case for some reason it didn't work the first time.
< >
Showing 1-2 of 2 comments
Per page: 1530 50

Date Posted: Oct 29, 2016 @ 11:31am
Posts: 2