View Single Post
Posts: 1,086 | Thanked: 2,964 times | Joined on Jan 2010
#17
Originally Posted by AgogData View Post
Despite what retsaw is saying i just tested Mosquito's Hunter with no mosquito and :
1- When i press again on classic/extreme i can't pause, there is no stand by option by un-pressing cl./ext.
Ah some good feedback!

At the moment it's just a simple toggle between the two, once those mosquitos start singing they won't stop until the app exits :P The pause functionality could be added quite simply though - santiago would you like to practise your coding?

On the button click you just need to check if that mosquito is currently selected and, if so, to stop playing the sound file and to change the button background to the dark colour.

You might want to introduce a new variable, similar to the new soundFile variable, that remembers if it's the classic, the extreme, or no mosquito currently selected. In each play sound method you'd check this new variable, eg

in playClassicSound method

if selectedMosquito variable is not classic (ie. is either none or extreme){
set soundFile = start.wav
set selectedMosquito to classic
set button backgrounds to red/dark grey
}

else (ie. selectedMosquito variable is currently classic, so classic is currently running){
set selectedMosquito to 'none'
stop sound playing
change button background to dark grey color
}
Something like that will enable your users to pause the sound by re-clicking on the button. Let me know if you try it and it doesn't work, we'll soon fix it

Im interested to hear the results of Nicholes experiment. Fortunately we don't have many mosquitos here so i can't test it myself. if only we could have an app to repel cold weather and rain
__________________
Follow me on my neglected twitter @kojacker

Cybot950 - Control a robot with your N9/N950
SMSPetFeeder - Build a Bluetooth/SMS dog feeder with Qt, N950, and arduino
Nerf950 - Use your N9/N950 to fire a Nerf gun
 

The Following 2 Users Say Thank You to kojacker For This Useful Post: