We have moved to a new Sailfish OS Forum. Please start new discussions there.
| 1 | initial version | posted 2018-12-19 14:20:42 +0200 |
I use an IconButton to allow the user to play back alarm sounds:
IconButton {
icon.source: sound.playbackState === Audio.PlayingState
? "image://theme/icon-m-pause"
: "image://theme/icon-m-play";
onClicked: {
sound.source: selectedSound;
if(sound.playbackState === Audio.PlayingState) {
sound.stop();
} else {
sound.play();
}
}
}

As can be seen, the editor "doesn't know" about the source Image, and the same seems to apply for the Audio element:
Audio {
id: sound;
audioRole: Audio.AlarmRole;
onError: {
console.log("Audio error:", errorString)
}
}
| 2 | No.2 Revision |
I use an IconButton to allow the user to play back alarm sounds:
IconButton {
icon.source: sound.playbackState === Audio.PlayingState
? "image://theme/icon-m-pause"
: "image://theme/icon-m-play";
onClicked: {
sound.source: selectedSound;
if(sound.playbackState === Audio.PlayingState) {
sound.stop();
} else {
sound.play();
}
}
}

As can be seen, the editor "doesn't know" about the source Image, and the same seems to apply for the Audio element:
Audio {
id: sound;
audioRole: Audio.AlarmRole;
onError: {
console.log("Audio error:", errorString)
}
}
I have no idea why the code rendering is so flawed here..?
| 3 | No.3 Revision |
I use an IconButton to allow the user to play back alarm sounds:
IconButton {
{
icon.source: sound.playbackState === Audio.PlayingState
Audio.PlayingState
? "image://theme/icon-m-pause"
"image://theme/icon-m-pause"
: "image://theme/icon-m-play";
"image://theme/icon-m-play";
onClicked: {
{
sound.source: selectedSound;
selectedSound;
if(sound.playbackState === Audio.PlayingState) {
sound.stop();
{
sound.stop();
} else {
sound.play();
}
}
}
{
sound.play();
}
}
}

As can be seen, the editor "doesn't know" about the source Image, and the same seems to apply for the Audio element:
Audio
I have no idea why the code rendering is so flawed here..?{
{
id: sound;
sound;
audioRole: Audio.AlarmRole;
Audio.AlarmRole;
onError: {
{
console.log("Audio error:", errorString)
}
}
errorString)
}
}
| 4 | No.4 Revision |
I use an IconButton to allow the user to play back alarm sounds:
IconButton {
icon.source: sound.playbackState === Audio.PlayingState
? "image://theme/icon-m-pause"
: "image://theme/icon-m-play";
onClicked: {
sound.source: sound.source = selectedSound;
if(sound.playbackState === Audio.PlayingState) {
sound.stop();
} else {
sound.play();
}
}
}

As can be seen, the editor "doesn't know" about the source Image, and the same seems to apply for the Audio element:
Image.
The rendering error with
Audio {
id: sound;
audioRole: Audio.AlarmRole;
onError: {
console.log("Audio error:", errorString)
}
}
sound.source: selectedSound; in the screen shot is fixed.
I have no idea why the code rendering is so flawed here..?
| 5 | No.5 Revision |
I use an IconButton to allow the user to play back alarm sounds:
IconButton {
icon.source: sound.playbackState === Audio.PlayingState
? "image://theme/icon-m-pause"
: "image://theme/icon-m-play";
onClicked: {
sound.source = selectedSound;
if(sound.playbackState === Audio.PlayingState) {
sound.stop();
} else {
sound.play();
}
}
}
}

As can be seen, the editor "doesn't know" about the source Image.
The rendering error with sound.source: selectedSound; in the screen shot is fixed.
I have no idea why the code rendering is so flawed here..?