~vthompson/+junk/sort-etag

« back to all changes in this revision

Viewing changes to Player.qml

  • Committer: Andrew Hayzen
  • Date: 2014-10-22 16:03:45 UTC
  • mto: This revision was merged to the branch mainline in revision 692.
  • Revision ID: ahayzen@gmail.com-20141022160345-20p0s54gw6g4w5mz
* Move to using Qt.labs.settings and remove settings.js

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import QtQuick 2.3
21
21
import QtMultimedia 5.0
22
22
import QtQuick.LocalStorage 2.0
23
 
import "settings.js" as Settings
 
23
import Qt.labs.settings 1.0
24
24
 
25
25
/*
26
26
 * This file should *only* manage the media playing and the relevant settings
42
42
    property bool isPlaying: player.playbackState === MediaPlayer.PlayingState
43
43
    property alias playbackState: mediaPlayer.playbackState
44
44
    property alias position: mediaPlayer.position
45
 
    property bool repeat: Settings.getSetting("repeat") === "1"
46
 
    property bool shuffle: Settings.getSetting("shuffle") === "1"
 
45
    property alias repeat: settings.repeat
 
46
    property alias shuffle: settings.shuffle
47
47
    property alias source: mediaPlayer.source
48
48
    property alias volume: mediaPlayer.volume
49
49
 
50
50
    signal stopped()
51
51
 
52
 
    onRepeatChanged: {
53
 
        Settings.setSetting("repeat", repeat ? "1" : "0")
54
 
        console.debug("Repeat:", Settings.getSetting("repeat") === "1")
55
 
    }
 
52
    Settings {
 
53
        id: settings
 
54
        category: "PlayerSettings"
56
55
 
57
 
    onShuffleChanged: {
58
 
        Settings.setSetting("shuffle", shuffle ? "1" : "0")
59
 
        console.debug("Shuffle:", Settings.getSetting("shuffle") === "1")
 
56
        property bool repeat: true
 
57
        property bool shuffle: false
60
58
    }
61
59
 
62
60
    Connections {