diff --git a/qml/PlayerPage.qml b/qml/PlayerPage.qml index 1a4b1f6..9bb6212 100644 --- a/qml/PlayerPage.qml +++ b/qml/PlayerPage.qml @@ -34,8 +34,8 @@ Page { id: flickable anchors.fill: parent - contentWidth: column.width - contentHeight: column.height + column.spacing + contentWidth: isPortrait ? Screen.width : Screen.height + contentHeight: isPortrait ? artColumn.height + infoColumn.height : Math.max(artColumn.height + infoColumn.height) PullDownMenu { PlayerChaptersItem { @@ -60,381 +60,353 @@ Page { } } - Column { - id: column - + Flow { + id: pageFlow width: playerPage.width - PageHeader { - title: qsTr("Player") - } + Column { + id: artColumn + width: isPortrait ? parent.width : parent.width * 0.55 - SectionHeader { - text: qsTr("Now playing") - visible: player.episode !== 0 - } + VideoOutput { + id: videoOutputPP + source: player + visible: player.hasVideo && player.status >= MediaPlayer.Loaded && player.status <= MediaPlayer.EndOfMedia + width: parent.width - VideoOutput { - id: videoOutputPP - //anchors.fill: parent - source: player - visible: player.hasVideo && player.status >= MediaPlayer.Loaded && player.status <= MediaPlayer.EndOfMedia - //flushMode: EmptyFrame //Qt 5.13+ not in SFOS (yet) :( - width: playerPage.isPortrait ? parent.width : parent.width - height: playerPage.isPortrait ? implicitHeight : implicitHeight - //Drag.active: dragArea.drag.active - - MouseArea { - id: dragArea - anchors.fill: parent - - /*onDoubleClicked: { - if(videoOutputPP.state == "videoFullScreen") { - videoOutputPP.state = "videoSmall" - } else { - videoOutputPP.state = "videoFullScreen" - } - }*/ - onClicked: { - if (player.isPlaying) { - player.pause(); - } else { - player.play(); + MouseArea { + id: dragArea + anchors.fill: parent + + /*onDoubleClicked: { + if(videoOutputPP.state == "videoFullScreen") { + videoOutputPP.state = "videoSmall" + } else { + videoOutputPP.state = "videoFullScreen" + } + }*/ + onClicked: { + if (player.isPlaying) { + player.pause(); + } else { + player.play(); + } } } - //drag.target: parent - } - /*State { - name: "videoFullScreen" - ParentChange { - target: videoOutputPP - parent: column + /*State { + name: "videoFullScreen" + ParentChange { + target: videoOutputPP + parent: column + } } + State { + name: "videoSmall" + ParentChange { + target: videoOutputPP + parent: playQueueRepeater + } + }*/ } - State { - name: "videoSmall" - ParentChange { - target: videoOutputPP - parent: playQueueRepeater - } - }*/ - } - CustomExpander { - id: expander - width: parent.width - expandedHeight: width - visible: !player.hasVideo - ArtArea { - anchors { - horizontalCenter: parent.horizontalCenter - margins: Theme.paddingMedium - } - id: coverImage - property string cover_art: '' - property string episode_art: player.episode_art - property string title_char: player.podcast_title[0] + Image { + id: art width: parent.width - height: width - } - - /*IconButton { - text: "Fullscreen" + height: isLandscape ? (implicitHeight > Screen.width ? Screen.width : paintedHeight ) : paintedHeight + fillMode: Image.PreserveAspectFit - anchors { - left: videoOutput.left - bottom: videoOutput.bottom - } - - icon: 'image://theme/icon-m-scale' - onClicked: console.log('[not implemented] switch to fullscreen') - }*/ - - } + visible: !player.hasVideo && (player.episode_art !== '' || player.podcast_cover !== '') + asynchronous: true - Item { - height: Theme.paddingSmall - width: parent.width + source: player.episode_art !== '' ? player.episode_art : player.cover_art + } } + Column { + id: infoColumn - Row { - id: playing_info_block - width: parent.width - - Image { - id: podcast_cover - height: playerPage.isPortrait ? parent.width * 0.2 : parent.width * 0.1 - width: this.height + width: isPortrait ? parent.width : parent.width * 0.45 - source: player.cover_art + SectionHeader { + text: qsTr("Now playing") + visible: player.episode !== 0 } + Item { - width: Theme.paddingSmall - height: parent.height + height: Theme.paddingSmall + width: parent.width } - Column { - Label { - id: podcast_title - anchors { - //left: podcast_cover.right - //right: parent.right - //top: parent.top - margins: Theme.paddingLarge - } + Row { + id: playing_info_block + width: parent.width + + Image { + id: podcast_cover + height: parent.width * 0.2 + width: this.height + visible: (player.cover_art !== '' && player.episode_art !== '') - truncationMode: TruncationMode.Fade - horizontalAlignment: Text.AlignHLeft - text: player.podcast_title - color: Theme.secondaryHighlightColor - font.pixelSize: Theme.fontSizeSmall + source: player.cover_art } Item { - //id: padding_podcast_title - width: parent.width - //anchors.top: podcast_title.bottom - height: Theme.paddingSmall + width: Theme.paddingSmall + height: parent.height } - Label { - id: episode_title - anchors { - //left: podcast_cover.right - //right: parent.right - //top: podcast_title.bottom - margins: Theme.paddingLarge + Column { + Label { + id: podcast_title + anchors { + margins: Theme.paddingLarge + } + + truncationMode: TruncationMode.Fade + horizontalAlignment: Text.AlignHLeft + text: player.podcast_title + color: Theme.secondaryHighlightColor + font.pixelSize: Theme.fontSizeSmall } - truncationMode: TruncationMode.Fade - horizontalAlignment: Text.AlignHLeft - text: player.episode_title - color: Theme.highlightColor - wrapMode: Text.Wrap - font.pixelSize: Theme.fontSizeSmall - } + Item { + width: parent.width + height: Theme.paddingSmall + } - Item { - //id: padding_episode_title - width: parent.width - //anchors.top: episode_title.bottom - height: Theme.paddingSmall - } - } - } + Label { + id: episode_title + anchors { + margins: Theme.paddingLarge + } - Label { - anchors { - //top: episode_title.bottom - horizontalCenter: parent.horizontalCenter + truncationMode: TruncationMode.Fade + horizontalAlignment: Text.AlignHLeft + text: player.episode_title + color: Theme.highlightColor + wrapMode: Text.Wrap + font.pixelSize: Theme.fontSizeSmall + } + + Item { + width: parent.width + height: Theme.paddingSmall + } + } } - font.pixelSize: Theme.fontSizeLarge - text: Util.formatPosition(positionSlider.value/1000, player.duration/1000) - color: positionSlider.highlighted ? Theme.highlightColor : Theme.primaryColor - } + Label { + anchors { + horizontalCenter: parent.horizontalCenter + } - Label { - anchors { - left: parent.left - right: parent.right - margins: Theme.paddingLarge + font.pixelSize: Theme.fontSizeLarge + text: Util.formatPosition(positionSlider.value/1000, player.duration/1000) + color: positionSlider.highlighted ? Theme.highlightColor : Theme.primaryColor } - visible: player.sleepTimerRunning + Label { + anchors { + left: parent.left + right: parent.right + margins: Theme.paddingLarge + } - truncationMode: TruncationMode.Fade - horizontalAlignment: Text.AlignHCenter - text: qsTr("Sleep timer: ") + Util.formatDuration(player.sleepTimerRemaining) - color: Theme.rgba(Theme.highlightColor, 0.7) - font.pixelSize: Theme.fontSizeExtraSmall - } + visible: player.sleepTimerRunning - Connections { - target: player - onPositionChanged: { - if (!positionSlider.down) { - positionSlider.value = player.position; - } + truncationMode: TruncationMode.Fade + horizontalAlignment: Text.AlignHCenter + text: qsTr("Sleep timer: ") + Util.formatDuration(player.sleepTimerRemaining) + color: Theme.rgba(Theme.highlightColor, 0.7) + font.pixelSize: Theme.fontSizeExtraSmall } - } - Slider { - id: positionSlider - width: parent.width - - value: player.position - minimumValue: 0 - maximumValue: player.duration - handleVisible: false - onDownChanged: { - if (!down) { - player.seekAndSync(sliderValue) + Connections { + target: player + onPositionChanged: { + if (!positionSlider.down) { + positionSlider.value = player.position; + } } } - } - Row { - anchors { - horizontalCenter: parent.horizontalCenter - margins: Theme.paddingMedium + Slider { + id: positionSlider + width: parent.width + + value: player.position + minimumValue: 0 + maximumValue: player.duration + handleVisible: false + onDownChanged: { + if (!down) { + player.seekAndSync(sliderValue) + } + } } - height: Theme.itemSizeLarge - spacing: Theme.paddingMedium + Row { + anchors { + horizontalCenter: parent.horizontalCenter + margins: Theme.paddingMedium + } - GpodderIconMenuItem { - text: qsTr("- 1 min") - icon.source: 'image://theme/icon-m-previous' + height: Theme.itemSizeLarge + spacing: Theme.paddingMedium - GPodderAutoFire { - running: parent.down - onFired: player.seekAndSync(player.position - 1000 * 60) + GpodderIconMenuItem { + text: qsTr("- 1 min") + icon.source: 'image://theme/icon-m-previous' + + GPodderAutoFire { + running: parent.down + onFired: player.seekAndSync(player.position - 1000 * 60) + } } - } - GpodderIconMenuItem { - text: qsTr("- 10 sec") - icon.source: 'image://theme/icon-m-previous' - GPodderAutoFire { - running: parent.down - onFired: player.seekAndSync(player.position - 1000 * 10) + GpodderIconMenuItem { + text: qsTr("- 10 sec") + icon.source: 'image://theme/icon-m-previous' + GPodderAutoFire { + running: parent.down + onFired: player.seekAndSync(player.position - 1000 * 10) + } } - } - GpodderIconMenuItem { - text: player.isPlaying ? qsTr("Pause") : qsTr("Play") - onClicked: { - if (player.isPlaying) { - player.pause(); - } else { - player.play(); + GpodderIconMenuItem { + text: player.isPlaying ? qsTr("Pause") : qsTr("Play") + onClicked: { + if (player.isPlaying) { + player.pause(); + } else { + player.play(); + } } + icon.source: player.isPlaying ? 'image://theme/icon-m-pause' : 'image://theme/icon-m-play' } - icon.source: player.isPlaying ? 'image://theme/icon-m-pause' : 'image://theme/icon-m-play' - } - GpodderIconMenuItem { - text: qsTr("+ 10 sec") - icon.source: 'image://theme/icon-m-next' - GPodderAutoFire { - running: parent.down - onFired: player.seekAndSync(player.position + 1000 * 10) + GpodderIconMenuItem { + text: qsTr("+ 10 sec") + icon.source: 'image://theme/icon-m-next' + GPodderAutoFire { + running: parent.down + onFired: player.seekAndSync(player.position + 1000 * 10) + } } - } - GpodderIconMenuItem { - text: qsTr("+ 1 min") - icon.source: 'image://theme/icon-m-next' - GPodderAutoFire { - running: parent.down - onFired: player.seekAndSync(player.position + 1000 * 60) + GpodderIconMenuItem { + text: qsTr("+ 1 min") + icon.source: 'image://theme/icon-m-next' + GPodderAutoFire { + running: parent.down + onFired: player.seekAndSync(player.position + 1000 * 60) + } } } - } - ListItem { - anchors.horizontalCenter: parent.horizontalCenter - Label { - id: playbackspeedTitle - text: qsTr("Playback speed: ") + ListItem { + anchors.horizontalCenter: parent.horizontalCenter + Label { + id: playbackspeedTitle + text: qsTr("Playback speed: ") - font.pixelSize: Theme.fontSizeMedium - color: Theme.highlightColor + font.pixelSize: Theme.fontSizeMedium + color: Theme.highlightColor - anchors { - right: parent.horizontalCenter - margins: Theme.paddingMedium - verticalCenter: parent.verticalCenter - } + anchors { + right: parent.horizontalCenter + margins: Theme.paddingMedium + verticalCenter: parent.verticalCenter + } - wrapMode: Text.WordWrap - } - Label { - id: sectionField - text: player.playbackRate + wrapMode: Text.WordWrap + } + Label { + id: sectionField + text: player.playbackRate - font.pixelSize: Theme.fontSizeMedium - color: Theme.primaryColor + font.pixelSize: Theme.fontSizeMedium + color: Theme.primaryColor - anchors { - left: parent.horizontalCenter - right: parent.right - verticalCenter: parent.verticalCenter + anchors { + left: parent.horizontalCenter + right: parent.right + verticalCenter: parent.verticalCenter + } } - } - - onClicked: openMenu() - menu: ContextMenu { - container: sectionField - MenuItem { - Slider { - id: speedSlider - width: parent.width + onClicked: openMenu() - value: player.playbackRate - valueText: Math.round(value * 100) / 100 - minimumValue: 0.5 - maximumValue: 3.0 - stepSize: 0.05 - onDownChanged: { - if (!down) { - player.playbackRate = sliderValue + menu: ContextMenu { + container: sectionField + MenuItem { + Slider { + id: speedSlider + width: parent.width + + value: player.playbackRate + valueText: Math.round(value * 100) / 100 + minimumValue: 0.5 + maximumValue: 3.0 + stepSize: 0.25 + onDownChanged: { + if (!down) { + player.playbackRate = sliderValue + } } } } } } - } - SectionHeader { - text: qsTr("Queue") - visible: playQueueRepeater.count > 0 - } + SectionHeader { + text: qsTr("Queue") + visible: playQueueRepeater.count > 0 + } - Repeater { - id: playQueueRepeater - model: player.queue - property Item contextMenu + Repeater { + id: playQueueRepeater + model: player.queue + property Item contextMenu - property var queueConnections: Connections { - target: player + property var queueConnections: Connections { + target: player - onQueueUpdated: { - playQueueRepeater.model = player.queue; + onQueueUpdated: { + playQueueRepeater.model = player.queue; + } } - } - ListItem { - id: playQueueListItem + ListItem { + id: playQueueListItem - width: parent.width + width: parent.width - menu: ContextMenu { - MenuItem { - text: qsTr("Remove from queue") - onClicked: player.removeQueueIndex(index); + menu: ContextMenu { + MenuItem { + text: qsTr("Remove from queue") + onClicked: player.removeQueueIndex(index); + } } - } - Label { - anchors { - left: parent.left - right: parent.right - margins: Theme.paddingMedium - verticalCenter: parent.verticalCenter - } + Label { + anchors { + left: parent.left + right: parent.right + margins: Theme.paddingMedium + verticalCenter: parent.verticalCenter + } - text: modelData.title - truncationMode: TruncationMode.Fade - } + text: modelData.title + truncationMode: TruncationMode.Fade + } - onClicked: { - player.jumpToQueueIndex(index); + onClicked: { + player.jumpToQueueIndex(index); + } } } + } } } diff --git a/translations/harbour-org.gpodder.sailfish-bg.ts b/translations/harbour-org.gpodder.sailfish-bg.ts index 7ba054f..faff595 100644 --- a/translations/harbour-org.gpodder.sailfish-bg.ts +++ b/translations/harbour-org.gpodder.sailfish-bg.ts @@ -275,77 +275,72 @@ PlayerPage - + Stop sleep timer - + Sleep timer Отброяване до заспиване - + Clear play queue - - Player - - - - + Now playing - + Sleep timer: Отброяване до заспиване: - + - 1 min - + - 10 sec - + Pause Паузиране - + Play Пускане - + + 10 sec - + + 1 min - + Playback speed: - + Queue - + Remove from queue diff --git a/translations/harbour-org.gpodder.sailfish-de.ts b/translations/harbour-org.gpodder.sailfish-de.ts index 733505b..f82dfc2 100644 --- a/translations/harbour-org.gpodder.sailfish-de.ts +++ b/translations/harbour-org.gpodder.sailfish-de.ts @@ -274,77 +274,72 @@ PlayerPage - + Stop sleep timer - + Sleep timer Sleeptimer - + Clear play queue - - Player - - - - + Now playing - + Sleep timer: Sleep Timer: - + - 1 min - + - 10 sec - + Pause Pause - + Play Abspielen - + + 10 sec - + + 1 min - + Playback speed: - + Queue - + Remove from queue diff --git a/translations/harbour-org.gpodder.sailfish-es.ts b/translations/harbour-org.gpodder.sailfish-es.ts index 4ddd2a0..b8ea28d 100644 --- a/translations/harbour-org.gpodder.sailfish-es.ts +++ b/translations/harbour-org.gpodder.sailfish-es.ts @@ -274,77 +274,72 @@ PlayerPage - + Stop sleep timer - + Sleep timer Temporizador - + Clear play queue - - Player - - - - + Now playing - + Sleep timer: Temporizador: - + - 1 min - + - 10 sec - + Pause Pausar - + Play Reproducir - + + 10 sec - + + 1 min - + Playback speed: - + Queue - + Remove from queue diff --git a/translations/harbour-org.gpodder.sailfish-it.ts b/translations/harbour-org.gpodder.sailfish-it.ts index c73149b..e5f669b 100644 --- a/translations/harbour-org.gpodder.sailfish-it.ts +++ b/translations/harbour-org.gpodder.sailfish-it.ts @@ -274,77 +274,72 @@ PlayerPage - + Stop sleep timer - + Sleep timer Timer spegnimento - + Clear play queue - - Player - - - - + Now playing - + Sleep timer: Timer spegnimento: - + - 1 min - + - 10 sec - + Pause Pausa - + Play Riproduci - + + 10 sec - + + 1 min - + Playback speed: - + Queue - + Remove from queue diff --git a/translations/harbour-org.gpodder.sailfish-pl.ts b/translations/harbour-org.gpodder.sailfish-pl.ts index 1f44770..408dc9d 100644 --- a/translations/harbour-org.gpodder.sailfish-pl.ts +++ b/translations/harbour-org.gpodder.sailfish-pl.ts @@ -274,77 +274,72 @@ PlayerPage - + Stop sleep timer - + Sleep timer Wyłącznik czasowy - + Clear play queue - - Player - - - - + Now playing - + Sleep timer: Wyłącznik czasowy: - + - 1 min - + - 10 sec - + Pause Pauza - + Play Odtwarzaj - + + 10 sec - + + 1 min - + Playback speed: - + Queue - + Remove from queue diff --git a/translations/harbour-org.gpodder.sailfish-ru.ts b/translations/harbour-org.gpodder.sailfish-ru.ts index 83e2e38..86a9d27 100644 --- a/translations/harbour-org.gpodder.sailfish-ru.ts +++ b/translations/harbour-org.gpodder.sailfish-ru.ts @@ -274,77 +274,72 @@ PlayerPage - + Stop sleep timer - + Sleep timer Отключиться через - + Clear play queue - - Player - - - - + Now playing - + Sleep timer: Таймер сна: - + - 1 min - + - 10 sec - + Pause Пауза - + Play Играть - + + 10 sec - + + 1 min - + Playback speed: - + Queue - + Remove from queue diff --git a/translations/harbour-org.gpodder.sailfish-sv.ts b/translations/harbour-org.gpodder.sailfish-sv.ts index d660d2b..7803b73 100644 --- a/translations/harbour-org.gpodder.sailfish-sv.ts +++ b/translations/harbour-org.gpodder.sailfish-sv.ts @@ -274,77 +274,72 @@ PlayerPage - + Stop sleep timer - + Sleep timer Insomningstimer - + Clear play queue - - Player - - - - + Now playing - + Sleep timer: Insomningstimer: - + - 1 min - + - 10 sec - + Pause Paus - + Play Spela - + + 10 sec - + + 1 min - + Playback speed: Uppspelningshastighet: - + Queue - + Remove from queue diff --git a/translations/harbour-org.gpodder.sailfish-zh_CN.ts b/translations/harbour-org.gpodder.sailfish-zh_CN.ts index f6081f7..8afa010 100644 --- a/translations/harbour-org.gpodder.sailfish-zh_CN.ts +++ b/translations/harbour-org.gpodder.sailfish-zh_CN.ts @@ -274,77 +274,72 @@ PlayerPage - + Stop sleep timer - + Sleep timer 睡眠计时器 - + Clear play queue - - Player - - - - + Now playing - + Sleep timer: 睡眠计时器: - + - 1 min - + - 10 sec - + Pause 暂停 - + Play 播放 - + + 10 sec - + + 1 min - + Playback speed: - + Queue - + Remove from queue diff --git a/translations/harbour-org.gpodder.sailfish.ts b/translations/harbour-org.gpodder.sailfish.ts index 24d67bf..330788f 100644 --- a/translations/harbour-org.gpodder.sailfish.ts +++ b/translations/harbour-org.gpodder.sailfish.ts @@ -32,7 +32,11 @@ AllEpisodesPage +<<<<<<< HEAD + +======= +>>>>>>> upstream/master No episodes found @@ -289,62 +293,57 @@ - - Player - - - - + Now playing - + Sleep timer: - + - 1 min - + - 10 sec - + Pause - + Play - + + 10 sec - + + 1 min - + Playback speed: - + Queue - + Remove from queue