value: toFloat($('position', data).text()) * 100
});
$('#currentVolume').append(Math.round($('volume', data).text() / 2.56) + '%');
- $('#volumeSlider').slider({
- value: ($('volume', data).text() / 5.12)
- });
+ /* Don't interfere with the user's action */
+ if (!$('#volumeSlider').data('clicked')) {
+ $('#volumeSlider').slider({
+ value: ($('volume', data).text() / 5.12)
+ });
+ }
$('#rateSlider').slider({
value: ($('rate', data).text())
});
value: 50,
min: 0,
max: 100,
+ start: function (event, ui) {
+ $("#volumeSlider").data( 'clicked', true );
+ },
stop: function (event, ui) {
$("#currentVolume").empty().append(ui.value * 2 + "%");
sendCommand({
'command': 'volume',
'val': Math.round(ui.value * 5.12)
})
+ $("#volumeSlider").data( 'clicked', false );
}
});
+ /* To ensure that updateStatus() doesn't interfere while use is
+ * sliding on the control. */
+ $("#volumeSlider").data( 'clicked', false );
$('#buttonStop').click(function () {
switch (current_que) {
case 'main':