Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
lektor
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
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é GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Kubat
lektor
Validations
58ddfefc
Vérifiée
Valider
58ddfefc
rédigé
Il y a 2 ans
par
Elliu
Validation de
Kubat
Il y a 2 ans
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
WINDOW: use mpv_observe_property for deprecated MPV_EVENTs
parent
9d4271c2
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion
!194
WINDOW: use mpv_observe_property for deprecated MPV_EVENTs
Modifications
1
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
src/module/qt_window/mpvwidget.cc
+44
-14
44 ajouts, 14 suppressions
src/module/qt_window/mpvwidget.cc
avec
44 ajouts
et
14 suppressions
src/module/qt_window/mpvwidget.cc
+
44
−
14
Voir le fichier @
58ddfefc
...
...
@@ -50,6 +50,9 @@ MpvWidget::MpvWidget(queue *queue, lkt_db *db, module_reg *reg, bool *launched,
mpv_observe_property
(
mpv
,
0
,
"duration"
,
MPV_FORMAT_DOUBLE
);
mpv_observe_property
(
mpv
,
0
,
"time-pos"
,
MPV_FORMAT_DOUBLE
);
mpv_observe_property
(
mpv
,
0
,
"pause"
,
MPV_FORMAT_FLAG
);
mpv_observe_property
(
mpv
,
0
,
"unpause"
,
MPV_FORMAT_FLAG
);
mpv_observe_property
(
mpv
,
0
,
"idle-active"
,
MPV_FORMAT_FLAG
);
mpv_set_wakeup_callback
(
mpv
,
wakeup
,
this
);
}
...
...
@@ -130,9 +133,6 @@ MpvWidget::handle_mpv_event(mpv_event *event)
(
void
)
prop
;
switch
(
event
->
event_id
)
{
case
MPV_EVENT_PAUSE
:
lkt_queue_send
(
m_queue
,
LKT_EVENT_PLAY_TOGGLE
,
LKT_PLAY_PAUSE
);
break
;
case
MPV_EVENT_UNPAUSE
:
lkt_queue_send
(
m_queue
,
LKT_EVENT_PLAY_TOGGLE
,
LKT_PLAY_PLAY
);
break
;
case
MPV_EVENT_SHUTDOWN
:
lkt_queue_send
(
m_queue
,
LKT_EVENT_PLAY_TOGGLE
,
LKT_PLAY_STOP
);
*
m_launched
=
false
;
...
...
@@ -159,16 +159,51 @@ MpvWidget::handle_mpv_event(mpv_event *event)
if
(
prop
->
format
==
MPV_FORMAT_DOUBLE
)
{
m_duration
=
static_cast
<
int
>
(
*
reinterpret_cast
<
double
*>
(
prop
->
data
));
}
}
break
;
}
case
MPV_EVENT_IDLE
:
}
else
if
(
strcmp
(
prop
->
name
,
"pause"
)
==
0
)
{
LOG_DEBUG
(
"WINDOW"
,
"Detected pause"
);
if
(
prop
->
format
==
MPV_FORMAT_FLAG
)
{
if
(
*
static_cast
<
int
*>
(
prop
->
data
))
goto
apply_pause
;
else
goto
apply_unpause
;
}
}
else
if
(
strcmp
(
prop
->
name
,
"unpause"
)
==
0
)
{
LOG_DEBUG
(
"WINDOW"
,
"Detected unpause"
);
if
(
prop
->
format
==
MPV_FORMAT_FLAG
)
{
if
(
*
static_cast
<
int
*>
(
prop
->
data
))
goto
apply_unpause
;
else
goto
apply_pause
;
}
}
else
if
(
strcmp
(
prop
->
name
,
"idle-active"
)
==
0
)
{
LOG_DEBUG
(
"WINDOW"
,
"Detected idle"
);
if
(
prop
->
format
==
MPV_FORMAT_FLAG
&&
*
static_cast
<
int
*>
(
prop
->
data
))
{
LOG_DEBUG
(
"WINDOW"
,
"Applying idle"
);
lkt_queue_make_available
(
m_queue
,
static_cast
<
LKT_EVENT_TYPE
>
(
LKT_EVENT_PLAY
));
lkt_queue_make_available
(
m_queue
,
static_cast
<
LKT_EVENT_TYPE
>
(
LKT_EVENT_PROP
));
*
m_launched
=
true
;
emit
titleChanged
(
"[Lektord] Stopped"
);
}
}
break
;
apply_pause
:
LOG_DEBUG
(
"WINDOW"
,
"Applying pause"
);
lkt_queue_send
(
m_queue
,
LKT_EVENT_PLAY_TOGGLE
,
LKT_PLAY_PAUSE
);
break
;
apply_unpause
:
LOG_DEBUG
(
"WINDOW"
,
"Applying unpause"
);
lkt_queue_send
(
m_queue
,
LKT_EVENT_PLAY_TOGGLE
,
LKT_PLAY_PLAY
);
break
;
// TODO: deprecated events that are now monitored with observe_property but that we didn't use
// Check if we want to observe them or not
//case MPV_EVENT_TRACKS_CHANGED:
//case MPV_EVENT_TRACK_SWITCHED:
//case MPV_EVENT_TICK:
//case MPV_EVENT_METADATA_UPDATE:
//case MPV_EVENT_CHAPTER_CHANGE:
}
case
MPV_EVENT_LOG_MESSAGE
:
case
MPV_EVENT_GET_PROPERTY_REPLY
:
...
...
@@ -176,16 +211,11 @@ MpvWidget::handle_mpv_event(mpv_event *event)
case
MPV_EVENT_NONE
:
case
MPV_EVENT_COMMAND_REPLY
:
case
MPV_EVENT_FILE_LOADED
:
case
MPV_EVENT_TRACKS_CHANGED
:
case
MPV_EVENT_TRACK_SWITCHED
:
case
MPV_EVENT_TICK
:
case
MPV_EVENT_SCRIPT_INPUT_DISPATCH
:
case
MPV_EVENT_CLIENT_MESSAGE
:
case
MPV_EVENT_VIDEO_RECONFIG
:
case
MPV_EVENT_AUDIO_RECONFIG
:
case
MPV_EVENT_METADATA_UPDATE
:
case
MPV_EVENT_SEEK
:
case
MPV_EVENT_CHAPTER_CHANGE
:
case
MPV_EVENT_PLAYBACK_RESTART
:
case
MPV_EVENT_QUEUE_OVERFLOW
:
case
MPV_EVENT_HOOK
:
break
;
...
...
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