Volume Slider

Forum to ask for any help
Post Reply
karenlee
Posts: 17
Joined: Sat Nov 03, 2012 1:41 pm

Volume Slider

Post by karenlee » Sun Nov 11, 2012 6:42 pm

Hi

I am attempting to create a slider for the volume for my Sonos device. I have a horizontal line, which lights up green as you drag your finger along, and the volume increase and decreases (although with an annoying lag*).

1) How does one create a speaker icon to drag along the bar, like the Sonos app?

2) I have a plus and minus at either end of the horizontal line - if I tap these, how do I get the green horizontal display to react accordingly, ie give visual feedback?

If anyone has a project to share where they have implemented such a thing, I'd be grateful...

Thanks
Karen

*Has anyone else noticed that adding flags creates a noticeable delay in response times?

User avatar
DemoPad
Site Admin
Posts: 769
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: Volume Slider

Post by DemoPad » Sun Nov 11, 2012 6:58 pm

For the plus and minus buttons, the next release of the app (due in a week or so) allows you to specify commands for numbers using [+] and [-] followed by a value, eg to increase a number by one, the data you would enter as the command would be:

Action Type: Set a Number
Data: [+]1

Adding flags should not affect response times at all - if you'd like to email your project to support@demopad.com we can have a look to see why you are experiencing issues.

karenlee
Posts: 17
Joined: Sat Nov 03, 2012 1:41 pm

Re: Volume Slider

Post by karenlee » Sun Nov 11, 2012 7:24 pm

Action Type: Set a Number
Data: [+]1
Ah - I actually tried that, so that is a good, intuitive approach! :D I look forward in having it actually work, in the next release.
Adding flags should not affect response times at all - if you'd like to email your project to support@demopad.com we can have a look to see why you are experiencing issues.
I have implemented a mute toggle button, but before I did that, when I was learning the basics, I had a simple MUTE=OFF if flag SonosMute = ON, followed by a play command. The play reacted immediately before I added the flag, but had a slight (but noticeable) delay after. May just be my network, though.

Thanks for the support!
Karen

PS - any ideas for sliding an icon along a bar?

User avatar
DemoPad
Site Admin
Posts: 769
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: Volume Slider

Post by DemoPad » Sun Nov 11, 2012 8:02 pm

For sliding an icon across the bar, you simply need the '100%' image to have the icon at the top (or the right if using a horizontal gauge), gauges just slide one image over the top of another. The only issue would be when sliding to 0%, as the icon would completely vanish. You might be able to combat that by altering your 0% image to show something at the bottom, but it depends on the icon..either that or use a normally hidden icon that is shown in response to a flag, which is set when the gauge goes to 0%...

karenlee
Posts: 17
Joined: Sat Nov 03, 2012 1:41 pm

Re: Volume Slider

Post by karenlee » Mon Nov 12, 2012 11:12 pm

Okay, I've downloaded the new version, and tried the [+]1, but it doesn't work.

I have a speaker icon which sets a VolUp flag to ON while pressed, and OFF when released, and another which sets a VolDown flag in the same manner (ie as for a repeating key).

I have a custom number variable (SonosVolume) which manages the commands to the Sonos device, increments the volume by 5 between the values 5 and 95.

I have a page load action which sets SonosVolume to [+]5 (repeating every 0.25 sec) while VolUp flag is ON.
I have another action which sets SonosVolume to [-]5 (repeating every 0.25 sec) while VolDown flag is ON.

It does nothing. In fact, tapping either of the icons (whether the page loads are there or not) results in the volume jumping down to about 5%.

Should this work/am I doing something wrong, or am I just trying to force the gauges/numbers to do something they're not designed to do, and thus what I'm attempting will never work?

Thanks
Karen

dansonamission
Posts: 37
Joined: Mon Jul 16, 2012 3:35 pm
Location: UK
Contact:

Re: Volume Slider

Post by dansonamission » Tue Nov 13, 2012 8:58 am

karenlee wrote:Okay, I've downloaded the new version, and tried the [+]1, but it doesn't work.
DemoPad wrote:For the plus and minus buttons, the next release of the app (due in a week or so)
Thats a new function that has yet to be released. I'm guessing there will be an updated version of the iOS app and Designer to support this.

karenlee
Posts: 17
Joined: Sat Nov 03, 2012 1:41 pm

Re: Volume Slider

Post by karenlee » Tue Nov 13, 2012 9:02 am

Oh, okay! I downloaded the new designer yesterday, and it says: You can now use [+]1 and [-]1 actions to increase or decrease number variables. But silly me, I skimmed this part without taking it in properly (requires app version 1.4.1 or later). My app version is 1.3.9.

Thanks very much for your response, saved me some more hair-tear :lol:

Post Reply