1
0
Fork 0

Remove QML based subtitles.

This commit is contained in:
namedkitten 2020-05-12 14:57:26 +01:00
parent c1662f2fb4
commit 1f8b14f72e
13 changed files with 0 additions and 135 deletions

View file

@ -171,7 +171,6 @@ MPVBackend::MPVBackend(QQuickItem* parent)
mpv_observe_property(mpv, 0, "mute", MPV_FORMAT_NONE);
mpv_observe_property(mpv, 0, "duration", MPV_FORMAT_DOUBLE);
mpv_observe_property(mpv, 0, "media-title", MPV_FORMAT_STRING);
mpv_observe_property(mpv, 0, "sub-text", MPV_FORMAT_STRING);
mpv_observe_property(mpv, 0, "time-pos", MPV_FORMAT_DOUBLE);
mpv_observe_property(mpv, 0, "demuxer-cache-duration", MPV_FORMAT_DOUBLE);
mpv_observe_property(mpv, 0, "pause", MPV_FORMAT_NODE);

View file

@ -80,7 +80,6 @@ signals:
void cachedDurationChanged(const double& duration);
void playlistPositionChanged(const double& position);
void titleChanged(const QString& title);
void subtitlesChanged(const QString& subtitles);
void durationStringChanged(const QString& string);
void tracksChanged(const QVariantList& tracks);
void audioDevicesChanged(const QVariantMap& devices);

View file

@ -476,11 +476,6 @@ void handle_mpv_event(BackendInterface* b, mpv_event* event)
char* title = *(char**)prop->data;
emit b->titleChanged(QString(title));
}
} else if (strcmp(prop->name, "sub-text") == 0) {
if (prop->format == MPV_FORMAT_STRING) {
char* subs = *(char**)prop->data;
emit b->subtitlesChanged(QString(subs));
}
} else if (strcmp(prop->name, "demuxer-cache-duration") == 0) {
if (prop->format == MPV_FORMAT_DOUBLE) {
double duration = *(double*)prop->data;

View file

@ -94,7 +94,6 @@ MPVNoFBOBackend::MPVNoFBOBackend(QQuickItem* parent)
mpv_observe_property(mpv, 0, "mute", MPV_FORMAT_NONE);
mpv_observe_property(mpv, 0, "duration", MPV_FORMAT_DOUBLE);
mpv_observe_property(mpv, 0, "media-title", MPV_FORMAT_STRING);
mpv_observe_property(mpv, 0, "sub-text", MPV_FORMAT_STRING);
mpv_observe_property(mpv, 0, "time-pos", MPV_FORMAT_DOUBLE);
mpv_observe_property(mpv, 0, "demuxer-cache-duration", MPV_FORMAT_DOUBLE);
mpv_observe_property(mpv, 0, "pause", MPV_FORMAT_NODE);

View file

@ -98,7 +98,6 @@ signals:
void cachedDurationChanged(const double& duration);
void playlistPositionChanged(const double& position);
void titleChanged(const QString& title);
void subtitlesChanged(const QString& subtitles);
void durationStringChanged(const QString& string);
void tracksChanged(const QVariantList& tracks);
void audioDevicesChanged(const QVariantMap& devices);

View file

@ -34,7 +34,6 @@ signals:
virtual void cachedDurationChanged(const double& duration) = 0;
virtual void playlistPositionChanged(const double& position) = 0;
virtual void titleChanged(const QString& title) = 0;
virtual void subtitlesChanged(const QString& subtitles) = 0;
virtual void durationStringChanged(const QString& string) = 0;
virtual void tracksChanged(const QVariantList& tracks) = 0;
virtual void audioDevicesChanged(const QVariantMap& devices) = 0;

View file

@ -96,30 +96,6 @@ Dialog {
onEditingFinished: setFont()
}
}
Item {
Layout.leftMargin: 30
Layout.bottomMargin: 10
height: 30
Text {
id: subtitlesFontSizeLabel
height: 30
text: translate.getTranslation("SUBTITLES_FONT_SIZE", i18n.language)
verticalAlignment: Text.AlignVCenter
}
TextField {
id: subtitlesFontSizeInput
anchors.left: subtitlesFontSizeLabel.right
anchors.leftMargin: 10
validator: IntValidator {}
inputMethodHints: Qt.ImhFormattedNumbersOnly
text: appearance.subtitlesFontSize
function setSubtitlesFontSize() {
appearance.subtitlesFontSize = parseInt(
subtitlesFontSizeInput.text)
}
onEditingFinished: setSubtitlesFontSize()
}
}
Item {
Layout.leftMargin: 30
Layout.bottomMargin: 10
@ -154,7 +130,6 @@ Dialog {
onAccepted: {
seekBy.setSeekBy()
fontInput.setFont()
subtitlesFontSizeInput.setSubtitlesFontSize()
uiFadeTimeInput.setUIFadeTime()
settingsDialog.done()
}

View file

@ -1,67 +0,0 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.2
import player 1.0
Item {
id: subtitlesBar
visible: !appearance.useMpvSubs
height: player.height / 8
anchors {
bottomMargin: 5
right: parent.right
left: parent.left
}
RowLayout {
id: nativeSubtitles
height: childrenRect.height
visible: true
anchors {
left: subtitlesBar.left
right: subtitlesBar.right
bottom: parent.bottom
bottomMargin: 10
}
Item {
id: subsContainer
height: childrenRect.height
Layout.fillWidth: true
Layout.fillHeight: true
Layout.rightMargin: 0
Layout.leftMargin: 0
Layout.maximumWidth: nativeSubtitles.width
Label {
id: nativeSubs
objectName: "nativeSubs"
anchors.horizontalCenter: parent.horizontalCenter
color: "white"
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
horizontalAlignment: Text.AlignHCenter
opacity: 1
font {
pixelSize: appearance.subtitlesFontSize
family: appearance.fontName
}
background: Rectangle {
id: subsBackground
color: getAppearanceValueForTheme(appearance.themeName,
"mainBackground")
width: subsContainer.childrenRect.width
height: subsContainer.childrenRect.height
}
onWidthChanged: {
if (width > parent.width - 10)
width = parent.width - 10
}
onTextChanged: if (width <= parent.width - 10)
width = undefined
Connections {
target: player
onSubtitlesChanged: function (subtitles) {
nativeSubs.text = subtitles
}
}
}
}
}
}

View file

@ -31,10 +31,6 @@ Item {
component.createObject(controlsBar, {})
}
SubtitlesBar {
anchors.bottom: controlsBackground.top
}
VideoProgress {
id: progressBar
visible: mainWindow.controlsShowing

View file

@ -393,13 +393,6 @@ MenuBar {
}
shortcut: keybinds.cycleSub
}
Action {
text: translate.getTranslation("TOGGLE_MPV_SUBS", i18n.language)
onTriggered: {
appearance.useMpvSubs = !appearance.useMpvSubs
}
shortcut: keybinds.cycleSubBackwards
}
MenuSeparator {}
CustomMenu {

View file

@ -39,7 +39,6 @@ var translations = {
SUBTITLES: "Subtitles",
CYCLE_SUB_TRACK: "Cycle Subtitle Track",
CYCLE_AUDIO_TRACK: "Cycle Audio Track",
TOGGLE_MPV_SUBS: "Toggle MPV Subtitles",
VIEW: "View",
FULLSCREEN: "Fullscreen",
STATS: "Statistics",
@ -91,7 +90,6 @@ var translations = {
SUBTITLES: "Subtítulos",
CYCLE_SUB_TRACK: "Siguientes subtítulos",
CYCLE_AUDIO_TRACK: "Siguiente pista de audio",
TOGGLE_MPV_SUBS: "Activar subtítulos MPV",
VIEW: "Ver",
FULLSCREEN: "Pantalla completa",
STATS: "Estadísticas",
@ -129,7 +127,6 @@ var translations = {
SUBTITLES: "Untertitel",
CYCLE_SUB_TRACK: "Wechsle Untertitel-Spur",
CYCLE_AUDIO_TRACK: "Wechsle Audiospur",
TOGGLE_MPV_SUBS: "Schalte MPV Untertitel An/Aus",
VIEW: "Ansicht",
FULLSCREEN: "Vollbild",
STATS: "Statistiken",
@ -180,7 +177,6 @@ var translations = {
CYCLE_VIDEO: "Changer de vidéo",
SUBTITLES: "Sous-titres",
CYCLE_SUB_TRACK: "Changer de piste de sous-titres",
TOGGLE_MPV_SUBS: "Basculer les sous-titres MPV",
VIEW: "Voir",
FULLSCREEN: "Plein écran",
STATS: "Statistiques",
@ -221,7 +217,6 @@ var translations = {
SUBTITLES: "Sottotitoli",
CYCLE_SUB_TRACK: "Ripeti traccia sottotitoli",
CYCLE_AUDIO_TRACK: "Ripeti traccia audio",
TOGGLE_MPV_SUBS: "Attiva MPV Sottotitoli",
VIEW: "Vedi",
FULLSCREEN: "Schermo intero",
STATS: "Statistiche",
@ -272,7 +267,6 @@ var translations = {
SUBTITLES: "Субтитры",
CYCLE_SUB_TRACK: "Зациклить дорожку субтитров",
CYCLE_AUDIO_TRACK: "Зациклить аудиодорожку",
TOGGLE_MPV_SUBS: "Переключить MPV-субтитры",
VIEW: "Вид",
FULLSCREEN: "Во весь экран",
STATS: "Статистика",
@ -309,7 +303,6 @@ var translations = {
SUBTITLES: "Undertekster",
CYCLE_SUB_TRACK: "Sirkuler Gjennom Undertekster",
CYCLE_AUDIO_TRACK: "Sirkuler Gjennom Lydspor",
TOGGLE_MPV_SUBS: "Skru Av/På MPV Undertekster",
VIEW: "Vis",
FULLSCREEN: "Fullskjerm",
STATS: "Statistikk",
@ -347,7 +340,6 @@ var translations = {
SUBTITLES: "sitelen anpa",
CYCLE_SUB_TRACK: "ante e sitelen anpa",
CYCLE_AUDIO_TRACK: "ante e kalama",
TOGGLE_MPV_SUBS: "open anu awen e sitelen MPV",
VIEW: "lukin",
FULLSCREEN: "lupa lukin ale",
STATS: "nanpa",
@ -399,7 +391,6 @@ var translations = {
SUBTITLES: "ఉపశీర్షిక/subtitles",
CYCLE_SUB_TRACK: "ఉపశీర్షిక ట్రాక్ ని సైకిల్ చేయి",
CYCLE_AUDIO_TRACK: "ఆడియో ట్రాక్ ని సైకిల్ చేయి",
TOGGLE_MPV_SUBS: "ఉపశీర్షిక MPV నుండి/కు మార్చు",
VIEW: "దర్శన",
FULLSCREEN: "స్క్రీన్ నింపు",
STATS: "గణాంకాలు",
@ -451,7 +442,6 @@ var translations = {
SUBTITLES: "Phụ đề",
CYCLE_SUB_TRACK: "Đảo Subtitle Track",
CYCLE_AUDIO_TRACK: "Đảo Audio Track",
TOGGLE_MPV_SUBS: "Bật/Tắt phụ đề MPV",
VIEW: "Nhìn",
FULLSCREEN: "Toàn màn hình",
STATS: "Thống kê",

View file

@ -62,7 +62,6 @@ Window {
id: appearance
category: "Appearance"
property bool titleOnlyOnFullscreen: true
property bool useMpvSubs: false
property string themeName: "YouTube"
property string fontName: "Roboto"
property double scaleFactor: 1.0
@ -237,16 +236,6 @@ Window {
var args = Qt.application.arguments
var len = Qt.application.arguments.length
var argNo = 0
if (!appearance.useMpvSubs) {
player.setOption("sub-ass-override", "force")
player.setOption("sub-ass", "off")
player.setOption("sub-border-size", "0")
player.setOption("sub-color", "0.0/0.0/0.0/0.0")
player.setOption("sub-border-color", "0.0/0.0/0.0/0.0")
player.setOption("sub-back-color", "0.0/0.0/0.0/0.0")
}
if (len > 1) {
for (argNo = 1; argNo < len; argNo++) {
var argument = args[argNo]

View file

@ -2,7 +2,6 @@
<qresource prefix="/">
<file>icon.png</file>
<file>main.qml</file>
<file>SubtitlesBar.qml</file>
<file alias="YouTubeButtonLayout.qml">UIComponents/ControlsLayouts/YouTubeButtonLayout.qml</file>
<file alias="NiconicoButtonLayout.qml">UIComponents/ControlsLayouts/NiconicoButtonLayout.qml</file>
<file alias="RoosterTeethButtonLayout.qml">UIComponents/ControlsLayouts/RoosterTeethButtonLayout.qml</file>