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é GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Elliu
Vivy
Validations
2b19ebd6
Vérifiée
Valider
2b19ebd6
rédigé
Il y a 4 ans
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
ASS: The Syl get its duration from the passed string
parent
b51e05ba
Branches
Branches contenant la validation
Aucune étiquette associée trouvée
1 requête de fusion
!7
Add the ASS sub document and the ASS tree
Modifications
2
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
src/Lib/Ass/Syl.cc
+16
-1
16 ajouts, 1 suppression
src/Lib/Ass/Syl.cc
src/Lib/Ass/Syl.hh
+4
-1
4 ajouts, 1 suppression
src/Lib/Ass/Syl.hh
avec
20 ajouts
et
2 suppressions
src/Lib/Ass/Syl.cc
+
16
−
1
Voir le fichier @
2b19ebd6
...
...
@@ -6,10 +6,25 @@ using namespace Vivy::Ass;
Syl
::
Syl
(
Line
*
const
line
,
const
QString
&
lineString
,
ConstructMode
mode
)
noexcept
:
content
(
lineString
)
,
styleProperties
(
line
->
getStyleProperties
())
,
dur
(
line
->
getDuration
())
,
dur
ation
(
line
->
getDuration
())
,
parentLine
(
line
)
{
// Will override the `content`, but will be heavy anyway
if
(
mode
==
ConstructMode
::
ReadAssTags
)
{
const
int
textBegin
=
lineString
.
lastIndexOf
(
'}'
)
+
1
;
content
=
(
textBegin
>=
lineString
.
size
())
?
""
:
lineString
.
mid
(
textBegin
);
duration
=
getDurationFromString
(
lineString
);
}
}
quint64
Syl
::
getDurationFromString
(
const
QString
&
line
)
noexcept
{
QRegExp
re
(
"
\\\\
(?:k|K|ko|kf)(
\\
d+)"
);
int
pos
=
0
;
quint64
duration
=
0
;
while
((
pos
=
re
.
indexIn
(
line
,
pos
))
!=
-
1
)
{
duration
+=
re
.
cap
(
1
).
toUInt
();
}
return
duration
;
}
Ce diff est replié.
Cliquez pour l'agrandir.
src/Lib/Ass/Syl.hh
+
4
−
1
Voir le fichier @
2b19ebd6
...
...
@@ -14,7 +14,7 @@ class Syl final {
private:
QString
content
;
StyleProperties
styleProperties
;
quint64
dur
{
0
};
quint64
dur
ation
{
0
};
public
:
Line
*
const
parentLine
;
...
...
@@ -31,6 +31,9 @@ public:
Syl
&
operator
=
(
const
Syl
&
)
=
delete
;
~
Syl
()
noexcept
=
default
;
private
:
static
quint64
getDurationFromString
(
const
QString
&
)
noexcept
;
};
}
...
...
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