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
d9d053bb
Vérifiée
Valider
d9d053bb
rédigé
Il y a 3 ans
par
Elliu
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Fix return key, add get_elapsed and get_duration
parent
a17c6094
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion
!186
Add the Qt window module as an alternative to the SDL2 module
Modifications
2
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
src/module/qt_window/mpvwidget.cc
+7
-7
7 ajouts, 7 suppressions
src/module/qt_window/mpvwidget.cc
src/module/qt_window/mpvwidget.hh
+3
-3
3 ajouts, 3 suppressions
src/module/qt_window/mpvwidget.hh
avec
10 ajouts
et
10 suppressions
src/module/qt_window/mpvwidget.cc
+
7
−
7
Voir le fichier @
d9d053bb
...
@@ -170,13 +170,11 @@ MpvWidget::handle_mpv_event(mpv_event *event)
...
@@ -170,13 +170,11 @@ MpvWidget::handle_mpv_event(mpv_event *event)
prop
=
static_cast
<
mpv_event_property
*>
(
event
->
data
);
prop
=
static_cast
<
mpv_event_property
*>
(
event
->
data
);
if
(
strcmp
(
prop
->
name
,
"time-pos"
)
==
0
)
{
if
(
strcmp
(
prop
->
name
,
"time-pos"
)
==
0
)
{
if
(
prop
->
format
==
MPV_FORMAT_DOUBLE
)
{
if
(
prop
->
format
==
MPV_FORMAT_DOUBLE
)
{
double
time
=
*
static_cast
<
double
*>
(
prop
->
data
);
m_position
=
static_cast
<
int
>
(
*
reinterpret_cast
<
double
*>
(
prop
->
data
));
Q_EMIT
positionChanged
(
static_cast
<
int
>
(
time
));
}
}
}
else
if
(
strcmp
(
prop
->
name
,
"duration"
)
==
0
)
{
}
else
if
(
strcmp
(
prop
->
name
,
"duration"
)
==
0
)
{
if
(
prop
->
format
==
MPV_FORMAT_DOUBLE
)
{
if
(
prop
->
format
==
MPV_FORMAT_DOUBLE
)
{
double
time
=
*
static_cast
<
double
*>
(
prop
->
data
);
m_duration
=
static_cast
<
int
>
(
*
reinterpret_cast
<
double
*>
(
prop
->
data
));
Q_EMIT
durationChanged
(
static_cast
<
int
>
(
time
));
}
}
}
}
break
;
break
;
...
@@ -241,14 +239,14 @@ MpvWidget::on_update(void *ctx)
...
@@ -241,14 +239,14 @@ MpvWidget::on_update(void *ctx)
bool
bool
MpvWidget
::
get_elapsed
(
int
UNUSED
*
elapsed_sec
)
MpvWidget
::
get_elapsed
(
int
UNUSED
*
elapsed_sec
)
{
{
*
elapsed_sec
=
5
;
*
elapsed_sec
=
m_position
;
return
true
;
return
true
;
}
}
bool
bool
MpvWidget
::
get_duration
(
int
UNUSED
*
dur_sec
)
MpvWidget
::
get_duration
(
int
UNUSED
*
dur_sec
)
{
{
*
dur_sec
=
90
;
*
dur_sec
=
m_duration
;
return
true
;
return
true
;
}
}
...
@@ -345,10 +343,12 @@ MpvWidget::keyPressEvent(QKeyEvent* event)
...
@@ -345,10 +343,12 @@ MpvWidget::keyPressEvent(QKeyEvent* event)
lmpv_toggle_pause
(
mpv
);
lmpv_toggle_pause
(
mpv
);
//lkt_queue_send(m_queue, LKT_EVENT_PLAY_TOGGLE, LKT_PLAY_TOGGLE);
//lkt_queue_send(m_queue, LKT_EVENT_PLAY_TOGGLE, LKT_PLAY_TOGGLE);
break
;
break
;
case
Qt
::
Key_Enter
:
case
Qt
::
Key_Return
:
LOG_DEBUG
(
"WINDOW"
,
"RETURN PRESSED"
);
lkt_queue_send
(
m_queue
,
LKT_EVENT_PLAY_NEXT
,
nullptr
);
lkt_queue_send
(
m_queue
,
LKT_EVENT_PLAY_NEXT
,
nullptr
);
break
;
break
;
case
Qt
::
Key_Less
:
case
Qt
::
Key_Less
:
LOG_DEBUG
(
"WINDOW"
,
"LESS PRESSED"
);
lkt_queue_send
(
m_queue
,
LKT_EVENT_PLAY_PREV
,
nullptr
);
lkt_queue_send
(
m_queue
,
LKT_EVENT_PLAY_PREV
,
nullptr
);
break
;
break
;
case
Qt
::
Key_Left
:
case
Qt
::
Key_Left
:
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/module/qt_window/mpvwidget.hh
+
3
−
3
Voir le fichier @
d9d053bb
...
@@ -15,9 +15,6 @@ public:
...
@@ -15,9 +15,6 @@ public:
void
setProperty
(
const
QString
&
name
,
const
QVariant
&
value
);
void
setProperty
(
const
QString
&
name
,
const
QVariant
&
value
);
QVariant
getProperty
(
const
QString
&
name
)
const
;
QVariant
getProperty
(
const
QString
&
name
)
const
;
QSize
sizeHint
()
const
{
return
QSize
(
480
,
270
);
}
QSize
sizeHint
()
const
{
return
QSize
(
480
,
270
);
}
Q_SIGNALS
:
void
durationChanged
(
int
value
);
void
positionChanged
(
int
value
);
protected
:
protected
:
void
initializeGL
()
Q_DECL_OVERRIDE
;
void
initializeGL
()
Q_DECL_OVERRIDE
;
...
@@ -38,6 +35,9 @@ private:
...
@@ -38,6 +35,9 @@ private:
lkt_db
*
m_db
;
lkt_db
*
m_db
;
struct
module_reg
*
m_reg
;
struct
module_reg
*
m_reg
;
int
m_position
;
int
m_duration
;
protected
:
protected
:
void
keyPressEvent
(
QKeyEvent
*
event
);
void
keyPressEvent
(
QKeyEvent
*
event
);
...
...
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