Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
Vivy
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Elliu
Vivy
Validations
e39c45e7
Vérifiée
Valider
e39c45e7
rédigé
3 years ago
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
UI: Can now get the reply code for async commands
parent
60ea493c
Aucune branche associée trouvée
Branches contenant la validation
Aucune étiquette associée trouvée
1 requête de fusion
!15
Video playback with mpv
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
src/UI/DocumentViews/MpvContainer.cc
+19
-4
19 ajouts, 4 suppressions
src/UI/DocumentViews/MpvContainer.cc
src/UI/DocumentViews/MpvContainer.hh
+6
-0
6 ajouts, 0 suppression
src/UI/DocumentViews/MpvContainer.hh
avec
25 ajouts
et
4 suppressions
src/UI/DocumentViews/MpvContainer.cc
+
19
−
4
Voir le fichier @
e39c45e7
...
@@ -104,7 +104,7 @@ MpvContainer::handleMpvEvent(mpv_event *event) noexcept
...
@@ -104,7 +104,7 @@ MpvContainer::handleMpvEvent(mpv_event *event) noexcept
case
MPV_EVENT_LOG_MESSAGE
:
case
MPV_EVENT_LOG_MESSAGE
:
msg
=
reinterpret_cast
<
mpv_event_log_message
*>
(
event
->
data
);
msg
=
reinterpret_cast
<
mpv_event_log_message
*>
(
event
->
data
);
qDebug
(
)
<<
"MPV message: ["
<<
msg
->
prefix
<<
"]"
<<
msg
->
level
<<
":"
<<
msg
->
text
;
qDebug
(
"MPV - MSG [%s] %s: %s"
,
msg
->
prefix
,
msg
->
level
,
msg
->
text
)
;
break
;
break
;
case
MPV_EVENT_PROPERTY_CHANGE
:
case
MPV_EVENT_PROPERTY_CHANGE
:
...
@@ -142,11 +142,26 @@ MpvContainer::handleMpvEvent(mpv_event *event) noexcept
...
@@ -142,11 +142,26 @@ MpvContainer::handleMpvEvent(mpv_event *event) noexcept
qDebug
()
<<
"MPV: Reached end of file!"
;
qDebug
()
<<
"MPV: Reached end of file!"
;
break
;
break
;
case
MPV_EVENT_COMMAND_REPLY
:
qDebug
()
<<
"Got return of"
<<
event
->
reply_userdata
;
switch
(
static_cast
<
AsyncCmdType
>
(
event
->
reply_userdata
))
{
case
AsyncCmdType
::
None
:
break
;
case
AsyncCmdType
::
LoadFile
:
qDebug
()
<<
"MPV - CMD: File loaded by mpv"
;
break
;
case
AsyncCmdType
::
TogglePlayback
:
qDebug
()
<<
"MPV - CMD: Playback was toggled"
;
break
;
}
break
;
// Explicitly ignored
// Explicitly ignored
case
MPV_EVENT_NONE
:
case
MPV_EVENT_NONE
:
case
MPV_EVENT_GET_PROPERTY_REPLY
:
case
MPV_EVENT_GET_PROPERTY_REPLY
:
case
MPV_EVENT_SET_PROPERTY_REPLY
:
case
MPV_EVENT_SET_PROPERTY_REPLY
:
case
MPV_EVENT_COMMAND_REPLY
:
case
MPV_EVENT_FILE_LOADED
:
case
MPV_EVENT_FILE_LOADED
:
case
MPV_EVENT_TRACKS_CHANGED
:
case
MPV_EVENT_TRACKS_CHANGED
:
case
MPV_EVENT_TRACK_SWITCHED
:
case
MPV_EVENT_TRACK_SWITCHED
:
...
@@ -184,7 +199,7 @@ MpvContainer::loadFile(const QString &filename) noexcept
...
@@ -184,7 +199,7 @@ MpvContainer::loadFile(const QString &filename) noexcept
const
QByteArray
c_filename
=
filename
.
toUtf8
();
const
QByteArray
c_filename
=
filename
.
toUtf8
();
const
char
*
args
[]
=
{
"loadfile"
,
c_filename
.
data
(),
nullptr
};
const
char
*
args
[]
=
{
"loadfile"
,
c_filename
.
data
(),
nullptr
};
printMpvError
(
mpv_command_async
(
mpv
,
0
,
args
));
printMpvError
(
mpv_command_async
(
mpv
,
AsyncCmdType
::
LoadFile
,
args
));
}
}
void
void
...
@@ -214,5 +229,5 @@ void
...
@@ -214,5 +229,5 @@ void
MpvContainer
::
mpvTogglePlayback
()
noexcept
MpvContainer
::
mpvTogglePlayback
()
noexcept
{
{
const
char
*
cmd
[]
=
{
"cycle"
,
"pause"
,
"up"
,
nullptr
};
const
char
*
cmd
[]
=
{
"cycle"
,
"pause"
,
"up"
,
nullptr
};
printMpvError
(
mpv_command_async
(
mpv
,
0
,
cmd
));
printMpvError
(
mpv_command_async
(
mpv
,
AsyncCmdType
::
TogglePlayback
,
cmd
));
}
}
Ce diff est replié.
Cliquez pour l'agrandir.
src/UI/DocumentViews/MpvContainer.hh
+
6
−
0
Voir le fichier @
e39c45e7
...
@@ -19,6 +19,12 @@ class MpvContainer final : public QWidget {
...
@@ -19,6 +19,12 @@ class MpvContainer final : public QWidget {
Q_OBJECT
Q_OBJECT
VIVY_UNMOVABLE_OBJECT
(
MpvContainer
)
VIVY_UNMOVABLE_OBJECT
(
MpvContainer
)
enum
AsyncCmdType
:
uint64_t
{
None
,
LoadFile
,
TogglePlayback
,
};
private
:
private
:
bool
isPlaybackPaused
{
true
};
bool
isPlaybackPaused
{
true
};
mpv_handle
*
mpv
{
nullptr
};
mpv_handle
*
mpv
{
nullptr
};
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter