1
0
Fork 0

[Backend] Add toggle stats.

This commit is contained in:
Kitteh 2018-11-08 18:17:43 +00:00
parent c492c57f82
commit d1606274cc
3 changed files with 8 additions and 3 deletions

View file

@ -163,7 +163,6 @@ MpvPlayerBackend::on_update(void* ctx)
emit self->onUpdate(); emit self->onUpdate();
} }
// connected to onUpdate(); signal makes sure it runs on the GUI thread
void void
MpvPlayerBackend::doUpdate() MpvPlayerBackend::doUpdate()
{ {
@ -322,6 +321,12 @@ MpvPlayerBackend::toggleOnTop()
AlwaysOnTop(window()->winId(), onTop); AlwaysOnTop(window()->winId(), onTop);
} }
void
MpvPlayerBackend::toggleStats()
{
command(QVariantList() << "script-binding" << "stats/display-stats-toggle");
}
void void
MpvPlayerBackend::addSpeed(const QVariant& speed) MpvPlayerBackend::addSpeed(const QVariant& speed)
{ {

View file

@ -37,6 +37,7 @@ public slots:
void prevPlaylistItem(); void prevPlaylistItem();
void nextPlaylistItem(); void nextPlaylistItem();
void toggleOnTop(); void toggleOnTop();
void toggleStats();
void updateDurationStringText(); void updateDurationStringText();
QVariant getTracks() const; QVariant getTracks() const;
void updatePrev(const QVariant& val); void updatePrev(const QVariant& val);

View file

@ -665,8 +665,7 @@ ApplicationWindow {
Action { Action {
text: translate.getTranslation("STATS", i18n.language) text: translate.getTranslation("STATS", i18n.language)
onTriggered: { onTriggered: {
player.command( player.toggleStats()
["script-binding", "stats/display-stats-toggle"])
} }
shortcut: keybinds.statsForNerds shortcut: keybinds.statsForNerds
} }