Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import Qt 4.7
  2. import QtMultimediaKit 1.1
  3.  
  4. Item {
  5.    
  6.     id: mainview
  7.     height: 360; width: 640
  8.     property string statepoint: "start"
  9.     property bool muted: false
  10.  
  11.     states: [
  12.         State { name: "intro"; when: statepoint == "intro"
  13.             PropertyChanges { target: introtrack; property: "playing"; value: !muted }
  14.         },
  15.         State { name: "menu"; when: statepoint == "menu"
  16.             PropertyChanges { target: introtrack; property: "playing"; value: !muted }
  17.         },
  18.         State { name: "carbrowser"; when: statepoint == "carbrowser" }
  19.     ]
  20.  
  21.     Rectangle { anchors.fill: parent; color: "black" } // Canvas
  22.  
  23.     Intro { id: intr; height: parent.height; width: parent.width; visible: statepoint == "intro" }
  24.     MainMenu { height: parent.height; width: parent.width; visible: statepoint == "menu" }
  25.     CarBrowser { height: parent.height; width: parent.width; visible: statepoint == "carbrowser" }
  26.     Audio {
  27.         id: introtrack
  28.         volume: 0.5
  29.         source: "sounds/intro.mp3"
  30.         playing: { statepoint == "intro" || statepoint == "menu" || statepoint == "carbrowser" ? true : false }
  31.     }
  32.  
  33.     Component.onCompleted: { statepoint = "intro"; intr.begin() }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement