Skip to content
Extraits de code Groupes Projets
Vérifiée Valider fa240d86 rédigé par Elliu's avatar Elliu
Parcourir les fichiers

Add various keybinds

parent 528640da
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!186Add the Qt window module as an alternative to the SDL2 module
......@@ -269,8 +269,6 @@ MpvWidget::load_file(const char *filepath)
} else {
LOG_ERROR("WINDOW", "Failed to load kara with path: %s", filepath);
}
//LOG_DEBUG("WINDOW", "Hinib flag at %d", win->hinib);
return ret;
}
......@@ -317,8 +315,15 @@ MpvWidget::keyPressEvent(QKeyEvent* event)
case Qt::ShiftModifier:
switch(event->key()){
case Qt::Key_J:
MPV_SEND_COMMAND_ASYNC("cycle", "sub", NULL);
MPV_SEND_COMMAND_ASYNC("osd-msg", "cycle", "sub", nullptr);
case Qt::Key_Period:
MPV_SEND_COMMAND_ASYNC("osd-msg","frame-step", nullptr);
case Qt::Key_Z:
MPV_SEND_COMMAND_ASYNC("osd-msg", "add", "sub-delay", "+0.1", nullptr);
case Qt::Key_G:
MPV_SEND_COMMAND_ASYNC("osd-msg", "add", "sub-scale", "+0.1", nullptr);
case Qt::Key_F:
MPV_SEND_COMMAND_ASYNC("osd-msg", "add", "sub-scale", "-0.1", nullptr);
}
break;
......@@ -332,39 +337,56 @@ MpvWidget::keyPressEvent(QKeyEvent* event)
//lkt_queue_send(m_queue, LKT_EVENT_PLAY_TOGGLE, LKT_PLAY_TOGGLE);
break;
case Qt::Key_Return:
LOG_DEBUG("WINDOW", "RETURN PRESSED");
case Qt::Key_Greater:
lkt_queue_send(m_queue, LKT_EVENT_PLAY_NEXT, nullptr);
break;
case Qt::Key_Less:
LOG_DEBUG("WINDOW", "LESS PRESSED");
lkt_queue_send(m_queue, LKT_EVENT_PLAY_PREV, nullptr);
break;
case Qt::Key_Left:
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "seek", "-5", "relative", NULL);
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "seek", "-5", "relative", nullptr);
case Qt::Key_Right:
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "seek", "+5", "relative", NULL);
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "seek", "+5", "relative", nullptr);
case Qt::Key_Down:
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "seek", "-60", "relative", NULL);
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "seek", "-60", "relative", nullptr);
case Qt::Key_Up:
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "seek", "+60", "relative", NULL);
case Qt::Key_O:
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "show-progress", NULL);
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "seek", "+60", "relative", nullptr);
case Qt::Key_L:
MPV_SEND_COMMAND_ASYNC("ab-loop", NULL);
MPV_SEND_COMMAND_ASYNC("osd-msg", "ab-loop", nullptr);
case Qt::Key_O:
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "show-progress", nullptr);
case Qt::Key_BracketLeft:
MPV_SEND_COMMAND_ASYNC("osd-msg", "multiply", "speed", "1/1.1", nullptr);
case Qt::Key_BracketRight:
MPV_SEND_COMMAND_ASYNC("osd-msg", "multiply", "speed", "1.1", nullptr);
case Qt::Key_BraceLeft:
MPV_SEND_COMMAND_ASYNC("osd-msg", "multiply", "speed", "0.5", nullptr);
case Qt::Key_BraceRight:
MPV_SEND_COMMAND_ASYNC("osd-msg", "multiply", "speed", "2", nullptr);
case Qt::Key_Backspace:
MPV_SEND_COMMAND_ASYNC("osd-msg", "set", "speed", "1.0", nullptr);
case Qt::Key_Semicolon:
MPV_SEND_COMMAND_ASYNC("osd-msg","frame-step", nullptr);
case Qt::Key_Comma:
MPV_SEND_COMMAND_ASYNC("osd-msg","frame-back-step", nullptr);
/* Track management */
case Qt::Key_NumberSign:
MPV_SEND_COMMAND_ASYNC("cycle", "audio", NULL);
MPV_SEND_COMMAND_ASYNC("osd-msg", "cycle", "audio", nullptr);
case Qt::Key_J:
MPV_SEND_COMMAND_ASYNC("cycle", "sub", "down", NULL);
MPV_SEND_COMMAND_ASYNC("osd-msg", "cycle", "sub", "down", nullptr);
case Qt::Key_Underscore:
MPV_SEND_COMMAND_ASYNC("cycle", "video", NULL);
MPV_SEND_COMMAND_ASYNC("osd-msg", "cycle", "video", nullptr);
/* Misc */
case Qt::Key_I:
MPV_SEND_COMMAND_ASYNC("script-binding", "stats/display-stats", NULL);
MPV_SEND_COMMAND_ASYNC("script-binding", "stats/display-stats", nullptr);
case Qt::Key_Delete:
MPV_SEND_COMMAND_ASYNC("script-message", "osc-visibility", (m_oscVisible = !m_oscVisible) ? "always" : "never", NULL);
MPV_SEND_COMMAND_ASYNC("script-message", "osc-visibility", (m_oscVisible = !m_oscVisible) ? "always" : "never", nullptr);
case Qt::Key_Z:
MPV_SEND_COMMAND_ASYNC("osd-msg", "add", "sub-delay", "-0.1", nullptr);
case Qt::Key_M:
MPV_SEND_COMMAND_ASYNC("osd-msg", "cycle", "mute", nullptr);
default:
break;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter