Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LO21_Pin_Noir_Boucher_Bouri_Detree
CellulutLO21
Commits
fe614a98
Commit
fe614a98
authored
Jun 08, 2021
by
Yann Boucher
Browse files
Removed dependency to the multimedia module
parent
e2f17afd
Pipeline
#79401
canceled with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/interface.cpp
View file @
fe614a98
...
...
@@ -18,7 +18,7 @@
#include
<QTextStream>
#include
<QInputDialog>
#include
<QTimer>
#include
<Q
MediaPlay
er>
#include
<Q
ElapsedTim
er>
MainWindow
::
MainWindow
(
QWidget
*
parent
)
:
QMainWindow
(
parent
)
...
...
@@ -637,11 +637,14 @@ void MainWindow::play_bad_apple()
static
QJsonArray
bad_apple_frame_list
;
static
QTimer
bad_apple_timer
;
static
bool
bad_apple_connected
;
static
Q
MediaPlay
er
bad_apple_
p
la
yer
;
static
Q
ElapsedTim
er
bad_apple_
e
la
psed
;
QFile
f
(
"bad_apple.json"
);
QFile
f
(
"
extras/
bad_apple.json"
);
if
(
!
f
.
open
(
QFile
::
ReadOnly
|
QFile
::
Text
))
throw
ModelLoadingException
(
"Impossible de lire le fichier"
);
{
QMessageBox
::
warning
(
this
,
""
,
"Can't find 'extras/bad_apple.json'
\n
"
);
return
;
}
QTextStream
in
(
&
f
);
QJsonParseError
parseError
;
...
...
@@ -655,10 +658,8 @@ void MainWindow::play_bad_apple()
{
bad_apple_timer
.
callOnTimeout
([
this
]
{
if
(
bad_apple_player
.
mediaStatus
()
==
QMediaPlayer
::
EndOfMedia
)
return
;
unsigned
frame_idx
=
bad_apple_
p
la
yer
.
position
()
/
(
1000.
f
/
30
);
unsigned
frame_idx
=
bad_apple_
e
la
psed
.
elapsed
()
/
(
1000.
f
/
30
);
if
((
int
)
frame_idx
>=
bad_apple_frame_list
.
size
())
{
bad_apple_timer
.
stop
();
...
...
@@ -686,9 +687,10 @@ void MainWindow::play_bad_apple()
});
}
bad_apple_player
.
setMedia
(
QUrl
::
fromLocalFile
(
"bad-apple.mp3"
));
bad_apple_player
.
play
();
//
bad_apple_player.setMedia(QUrl::fromLocalFile("bad-apple.mp3"));
//
bad_apple_player.play();
;
bad_apple_elapsed
.
start
();
bad_apple_timer
.
start
(
24
);
statusBar
()
->
showMessage
(
"Original :
\"
Bad Apple!!
\"
feat. Nomico by Alstroemeria Records"
,
60000
);
}
...
...
src/src.pro
View file @
fe614a98
QT
+=
core
gui
multimedia
QT
+=
core
gui
greaterThan
(
QT_MAJOR_VERSION
,
4
)
:
QT
+=
widgets
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment