]> git.tdb.fi Git - xinema.git/blobdiff - remote/qml/pages/PlaybackPage.qml
Add channel selection controls in the remote
[xinema.git] / remote / qml / pages / PlaybackPage.qml
index 4a487a4f8cd9b80add977b1ad9b3e52931ef7fce..7bf7cc9069ab1f923659b6036070229a50ec83db 100644 (file)
@@ -19,12 +19,21 @@ Page
                Label
                {
                        text: streamControl.title
+                       anchors
+                       {
+                               left: parent.left
+                               right: parent.right
+                               margins: Theme.horizontalPageMargin
+                       }
+                       horizontalAlignment: Text.AlignHCenter
+                       wrapMode: Text.WordWrap
                }
 
                Slider
                {
                        id: slider
                        width: parent.width
+
                        minimumValue: 0.0
                        maximumValue: Math.max(streamControl.duration, 1.0)
                        valueText:
@@ -49,6 +58,43 @@ Page
 
                                return str+secs;
                        }
+
+                       onDownChanged:
+                       {
+                               if(!down)
+                                       streamControl.position = value;
+                       }
+               }
+
+               IconButton
+               {
+                       id: playPauseButton
+                       anchors.horizontalCenter: parent.horizontalCenter
+                       property string action: (streamControl.playbackState==StreamControl.Playing ? "pause" : "play")
+                       icon.source: "image://theme/icon-l-"+action
+                       onPressed:
+                       {
+                               if(action=="play")
+                                       streamControl.playbackState = StreamControl.Playing;
+                               else if(action=="pause")
+                                       streamControl.playbackState = StreamControl.Paused;
+                       }
+               }
+
+               ChannelSelect
+               {
+                       id: audioSelect
+                       label: "Audio"
+                       channels: streamControl.audioChannels
+                       onCurrentChannelChanged: streamControl.currentAudioChannel = currentChannel
+               }
+
+               ChannelSelect
+               {
+                       id: spuSelect
+                       label: "Subtitles"
+                       channels: streamControl.spuChannels
+                       onCurrentChannelChanged: streamControl.currentSpuChannel = currentChannel
                }
        }
 
@@ -59,7 +105,9 @@ Page
                onPositionChanged:
                {
                        if(!slider.down)
-                               slider.value = streamControl.position
+                               slider.value = position;
                }
+               onCurrentAudioChannelChanged: audioSelect.currentChannel = streamControl.currentAudioChannel;
+               onCurrentSpuChannelChanged: spuSelect.currentChannel = streamControl.currentSpuChannel;
        }
 }