← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

Re: [Merge] lp:~mzanetti/ubuntu-clock-app/detect-qtmm-version into lp:ubuntu-clock-app

 

fixed the inline comment.


For me, the volume controls during preview were working fine. Probably the issue was because before it was using the "alert" role, which seems to be wrong in any case.

As written in the description, I'm not really sure if we should merge this branch, or instead just go with the much simpler https://code.launchpad.net/~mzanetti/ubuntu-clock-app/drop-audioRole/+merge/275179  

The outcome is pretty much the same with the current audio system.


Diff comments:

> 
> === added file 'app/components/AlarmAudio.qml'
> --- app/components/AlarmAudio.qml	1970-01-01 00:00:00 +0000
> +++ app/components/AlarmAudio.qml	2015-10-21 12:33:11 +0000
> @@ -0,0 +1,35 @@
> +import QtQuick 2.4
> +
> +Item {
> +    id: root
> +    property string source: ""
> +    readonly property alias playbackState: priv.playbackState
> +
> +    function play() {
> +        priv.audio.play();
> +    }
> +    function stop() {
> +        priv.audio.stop();
> +    }
> +
> +    QtObject {
> +        id: priv
> +        property var audio: null
> +        property var playbackState: null
> +    }
> +
> +    Binding {
> +        target: priv
> +        property: "playbackState"
> +        value: priv.audio ? priv.audio.playbackState : 0
> +    }
> +
> +    Component.onCompleted: {
> +        try {
> +            priv.audio = Qt.createQmlObject("import QtMultimedia 5.5; Audio { source: root.source; audioRole: MediaPlayer.AlarmRole }", priv)
> +        } catch(err) {
> +            print("QtMultimedia 5.5 not installed. Falling back to 5.4.");

because it is less to type and does the same :)

Sorry, I didn't realize there is this convention in the clock app. Will update to use console.log

> +            priv.audio = Qt.createQmlObject("import QtMultimedia 5.4; Audio { source: root.source; audioRole: MediaPlayer.alarm }", priv)
> +        }
> +    }
> +}


-- 
https://code.launchpad.net/~mzanetti/ubuntu-clock-app/detect-qtmm-version/+merge/275177
Your team Ubuntu Clock Developers is subscribed to branch lp:ubuntu-clock-app.