Startseite › Foren › Deutsches LiveCode-Forum › Eigener Lautstärkeregler › Antwort auf: Eigener Lautstärkeregler
Februar 22, 2020 um 20:29 Uhr
#19133
Hallo,
ich bin gerade dabei deinen letzten Tip in den Slider für die Lautstärke zu integrieren, aber irgendwie funktioniert der Regler nicht so wie er soll.
Sobald ich den Regler berühre, startet der Hintergrundsound und laässt sich dann auch nicht mehr regeln.
hier mal der Ausschnit des Scriptes für den Slider mit Ergänzung.
on mouseMove x,y
if not canMove then exit mouseMove
put min(Bstop,max(Tstop,y)) into yLoc
set loc of me to xLoc,yLoc-cY
# you may need to add values to following: xLoc and yLoc
# to position the value fld where you want
# Möglicherweise müssen Sie folgende Werte hinzufügen: xLoc und yLoc
#, um den Wert fld an der gewünschten Stelle zu positionieren
set the loc of fld "theValue_v4" to xLoc-40,yLoc-cY+10
# The following line calculates the value which you would want to
# also put into use for the actual functioning of the slider
# Die folgende Zeile berechnet den Wert, den Sie möchten
# wird auch für die tatsächliche Funktion des Schiebereglers verwendet
put round((yLoc-Tstop)*tScaleFactor)+topValue into fld "theValue_v4"
put round((yLoc-Tstop)*tScaleFactor)+topValue into sBackground ##diese Zeile hinzugefügt
if the environment = "mobile" then
## mobileSetSoundChannelVolume noise1, "noiseOne" ##diese Zeile hinzugefügt
## Der Channel Name in Anführungszeichen, die Variable noiseOne aber nicht!
if (mobileSoundOnChannel("background") is empty) or (mobileSoundOnChannel("background") is "could not find channel") then
put (specialFolderPath("resources") & "/sound/background.wav") into tPath
put "background" into tChannelName
put "looping" into tType
mobileSetSoundChannelVolume "background", sBackground ##diese Zeile hinzugefügt
if the value of Field "theValue_v4" >2 then
mobilePlaySoundOnChannel tPath, tChannelName, tType
if the value of Field "theValue_v4" <2 then
mobileStopPlayingOnChannel "background"
end if
end if
end if
else
set the playloudness to sBackground
end if
end mouseMove