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
385d5f2b
Valider
385d5f2b
rédigé
Il y a 3 ans
par
Elliu
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Display correct times on audio axis
parent
20ab443f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion
!29
Improve timingView with display of the ASS lines
Pipeline
#2408
réussi
Il y a 3 ans
Étape : build
Modifications
3
Pipelines
1
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
3 fichiers modifiés
src/UI/DocumentViews/AudioVisualizer.cc
+2
-2
2 ajouts, 2 suppressions
src/UI/DocumentViews/AudioVisualizer.cc
src/UI/DocumentViews/TimingAxis.cc
+30
-17
30 ajouts, 17 suppressions
src/UI/DocumentViews/TimingAxis.cc
src/UI/DocumentViews/TimingAxis.hh
+6
-5
6 ajouts, 5 suppressions
src/UI/DocumentViews/TimingAxis.hh
avec
38 ajouts
et
24 suppressions
src/UI/DocumentViews/AudioVisualizer.cc
+
2
−
2
Voir le fichier @
385d5f2b
...
@@ -6,8 +6,8 @@ using namespace Vivy;
...
@@ -6,8 +6,8 @@ using namespace Vivy;
#define MAXPIXVALUE 7 // Some magix AV magic stuff
#define MAXPIXVALUE 7 // Some magix AV magic stuff
AudioVisualizer
::
AudioVisualizer
(
AudioContext
::
StreamPtr
stream
,
QWidget
*
parent
)
AudioVisualizer
::
AudioVisualizer
(
AudioContext
::
StreamPtr
stream
,
QWidget
*
parent
)
:
audioStream
(
stream
),
:
QWidget
(
parent
)
QWidget
(
parent
)
,
audioStream
(
stream
)
{
{
if
(
!
audioStream
->
isDecoded
())
{
if
(
!
audioStream
->
isDecoded
())
{
qDebug
()
<<
"Need to decode data for stream"
<<
audioStream
->
getStreamIndex
();
qDebug
()
<<
"Need to decode data for stream"
<<
audioStream
->
getStreamIndex
();
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/UI/DocumentViews/TimingAxis.cc
+
30
−
17
Voir le fichier @
385d5f2b
...
@@ -37,12 +37,13 @@ TimingAxis::refreshTicks()
...
@@ -37,12 +37,13 @@ TimingAxis::refreshTicks()
{
{
qDebug
()
<<
"Refreshing ticks..."
;
qDebug
()
<<
"Refreshing ticks..."
;
int
nbAvailableTicks
=
availableTicks
.
size
();
int
nbAvailableTicks
=
availableTicks
.
size
();
int
minorTicksIndex
=
0
;
QGraphicsScene
*
parentScene
=
scene
();
QGraphicsScene
*
parentScene
=
scene
();
int
minorTicksIndex
=
0
;
quint64
length
{
audioStream
->
getLength
()
};
quint64
width
{
quint64
(
scene
()
->
width
())
};
if
(
parentScene
!=
nullptr
){
if
(
parentScene
!=
nullptr
){
for
(
minorTicksIndex
=
0
;
minorTicksIndex
<
nbAvailableTicks
;
minorTicksIndex
++
){
for
(
minorTicksIndex
=
0
;
minorTicksIndex
<
nbAvailableTicks
;
minorTicksIndex
++
){
if
(
parentScene
->
width
()
/
(
qreal
(
audioStream
->
getLength
())
*
availableTicks
[
minorTicksIndex
])
<
minBetweenMinor
){
if
(
width
*
quint64
(
availableTicks
[
minorTicksIndex
])
/
length
>=
minBetweenMinor
){
minorTicksIndex
=
minorTicksIndex
==
0
?
0
:
minorTicksIndex
-
1
;
break
;
break
;
}
}
}
}
...
@@ -52,7 +53,7 @@ TimingAxis::refreshTicks()
...
@@ -52,7 +53,7 @@ TimingAxis::refreshTicks()
minorTicks
=
availableTicks
[
minorTicksIndex
];
minorTicks
=
availableTicks
[
minorTicksIndex
];
majorTicks
=
availableTicks
[
minorTicksIndex
+
1
];
majorTicks
=
availableTicks
[
minorTicksIndex
+
1
];
}
else
{
}
else
{
minorTicks
=
-
1
;
minorTicks
=
0
;
majorTicks
=
availableTicks
[
minorTicksIndex
];
majorTicks
=
availableTicks
[
minorTicksIndex
];
}
}
}
}
...
@@ -61,31 +62,43 @@ void TimingAxis::paint(QPainter *painter, const QStyleOptionGraphicsItem *option
...
@@ -61,31 +62,43 @@ void TimingAxis::paint(QPainter *painter, const QStyleOptionGraphicsItem *option
if
(
audioStream
->
getLength
()
==
0
)
if
(
audioStream
->
getLength
()
==
0
)
return
;
return
;
qDebug
()
<<
"Painting axis..."
;
int
ticks_base
=
y
+
ticksBase
;
int
ticks_base
=
y
+
ticksBase
;
int
yText
=
ticks_base
-
majorTicksHeight
-
timeDigitsMargin
;
int
yText
=
ticks_base
-
majorTicksHeight
-
timeDigitsMargin
;
int
majorTicksUp
=
ticks_base
-
majorTicksHeight
;
int
majorTicksUp
=
ticks_base
-
majorTicksHeight
;
int
minorTicksUp
=
ticks_base
-
minorTicksHeight
;
int
minorTicksUp
=
ticks_base
-
minorTicksHeight
;
quint64
length
{
audioStream
->
getLength
()
};
quint64
width
{
quint64
(
scene
()
->
width
())
};
painter
->
drawLine
(
x0
,
ticks_base
,
x1
,
ticks_base
);
painter
->
drawLine
(
x0
,
ticks_base
,
x1
,
ticks_base
);
for
(
int
i
=
majorTicks
;
i
<
x1
-
x0
;
i
+=
majorTicks
){
for
(
quint64
i
=
0
;
i
<
length
;
i
+=
majorTicks
){
painter
->
drawText
(
QPoint
(
x0
+
i
,
yText
),
msToString
(
i
));
int
pos
=
x0
+
int
(
posFromMs
(
i
,
width
,
length
));
painter
->
drawLine
(
int
(
x0
+
i
),
majorTicksUp
,
int
(
x0
+
i
),
ticks_base
);
painter
->
drawText
(
QPoint
(
pos
,
yText
),
msToString
(
i
));
painter
->
drawLine
(
int
(
pos
),
majorTicksUp
,
int
(
pos
),
ticks_base
);
}
}
if
(
minorTicks
>=
0
)
if
(
minorTicks
>
0
){
for
(
int
i
=
minorTicks
;
i
<
x1
-
x0
;
i
+=
minorTicks
)
for
(
quint64
i
=
0
;
i
<
length
;
i
+=
minorTicks
){
quint64
pos
=
quint64
(
x0
)
+
posFromMs
(
i
,
width
,
length
);
if
(
fmod
(
i
,
majorTicks
)
!=
0
)
if
(
fmod
(
i
,
majorTicks
)
!=
0
)
painter
->
drawLine
(
int
(
x0
+
i
),
minorTicksUp
,
int
(
x0
+
i
),
ticks_base
);
painter
->
drawLine
(
int
(
pos
),
minorTicksUp
,
int
(
pos
),
ticks_base
);
}
}
}
}
QString
QString
TimingAxis
::
msToString
(
int
t
)
const
noexcept
TimingAxis
::
msToString
(
qu
int
64
i
)
const
noexcept
{
{
qDebug
()
<<
"GOT "
<<
t
;
QString
ret
(
QStringLiteral
(
"%1"
).
arg
(
i
%
60000
/
1000
,
i
>=
60000
?
2
:
1
,
10
,
QLatin1Char
(
'0'
))
+
QString
(
"."
)
+
QString
::
number
(
i
%
1000
/
majorTicks
));
QString
ret
(
QString
::
number
(
t
/
1000
)
+
QString
(
"."
)
+
QString
::
number
(
t
%
1000
/
majorTicks
));
if
(
i
>=
60000
)
if
(
t
>=
60000
)
ret
.
prepend
(
QString
::
number
(
i
/
60000
)
+
QString
(
":"
));
ret
.
prepend
(
QString
::
number
(
t
/
60000
)
+
QString
(
":"
));
if
(
i
>=
360000
)
if
(
t
>=
360000
)
ret
.
prepend
(
QString
::
number
(
i
/
360000
)
+
QString
(
":"
));
ret
.
prepend
(
QString
::
number
(
t
/
360000
)
+
QString
(
":"
));
return
ret
;
return
ret
;
}
}
inline
quint64
TimingAxis
::
posFromMs
(
quint64
t
,
quint64
width
,
quint64
length
)
const
noexcept
{
return
t
*
width
/
length
;
}
Ce diff est replié.
Cliquez pour l'agrandir.
src/UI/DocumentViews/TimingAxis.hh
+
6
−
5
Voir le fichier @
385d5f2b
...
@@ -34,10 +34,10 @@ private:
...
@@ -34,10 +34,10 @@ private:
* qPainter->drawLine() and qPainter->drawText()
* qPainter->drawLine() and qPainter->drawText()
* restrict us to ints anyways
* restrict us to ints anyways
*/
*/
QVector
<
int
>
availableTicks
=
{
10
,
100
,
1000
,
10000
,
60000
,
3600000
,
86400000
};
QVector
<
qu
int
64
>
availableTicks
=
{
10
,
100
,
1000
,
10000
,
60000
,
3600000
,
86400000
};
q
real
minBetweenMinor
{
5
};
q
uint64
minBetweenMinor
{
10
};
int
minorTicks
;
qu
int
64
minorTicks
;
int
majorTicks
;
qu
int
64
majorTicks
;
int
minorTicksHeight
{
3
};
int
minorTicksHeight
{
3
};
int
majorTicksHeight
{
7
};
int
majorTicksHeight
{
7
};
...
@@ -49,7 +49,8 @@ private:
...
@@ -49,7 +49,8 @@ private:
int
x1
{
0
};
int
x1
{
0
};
int
y
{
0
};
int
y
{
0
};
QString
msToString
(
int
t
)
const
noexcept
;
QString
msToString
(
quint64
i
)
const
noexcept
;
inline
quint64
posFromMs
(
quint64
t
,
quint64
width
,
quint64
length
)
const
noexcept
;
protected
:
protected
:
public
slots
:
public
slots
:
...
...
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