Skip to content
GitLab
Menu
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
1f8cf700
Commit
1f8cf700
authored
Jun 12, 2021
by
Yann Boucher
Browse files
bad apple linux fix
parent
ec64f451
Pipeline
#79776
passed with stages
in 17 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
forms/interface.ui
View file @
1f8cf700
...
...
@@ -11,7 +11,7 @@
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
MainWindow
</string>
<string>
Cellulut
</string>
</property>
<widget
class=
"QWidget"
name=
"centralwidget"
>
<property
name=
"sizePolicy"
>
...
...
src/interface.cpp
View file @
1f8cf700
...
...
@@ -720,9 +720,8 @@ void MainWindow::play_bad_apple()
static
bool
bad_apple_connected
;
#ifdef BAD_APPLE_AUDIO
static
QMediaPlayer
bad_apple_player
;
#else
static
QElapsedTimer
bad_apple_elapsed
;
#endif
static
QElapsedTimer
bad_apple_elapsed
;
QFile
f
(
"extras/bad_apple.json"
);
if
(
!
f
.
open
(
QFile
::
ReadOnly
|
QFile
::
Text
))
...
...
@@ -744,7 +743,11 @@ void MainWindow::play_bad_apple()
bad_apple_timer
.
callOnTimeout
([
this
]
{
#ifdef BAD_APPLE_AUDIO
unsigned
frame_idx
=
bad_apple_player
.
position
()
/
(
1000.
f
/
30
);
unsigned
frame_idx
;
if
(
bad_apple_player
.
state
()
==
QMediaPlayer
::
PlayingState
)
frame_idx
=
bad_apple_player
.
position
()
/
(
1000.
f
/
30
);
else
frame_idx
=
bad_apple_elapsed
.
elapsed
()
/
(
1000.
f
/
30
);
#else
unsigned
frame_idx
=
bad_apple_elapsed
.
elapsed
()
/
(
1000.
f
/
30
);
#endif
...
...
@@ -786,9 +789,9 @@ void MainWindow::play_bad_apple()
bad_apple_player
.
play
();
#else
QMessageBox
::
information
(
this
,
""
,
"Music functionnality is only available with Qt 5"
);
bad_apple_elapsed
.
start
();
#endif
bad_apple_elapsed
.
start
();
bad_apple_timer
.
start
(
11
);
statusBar
()
->
showMessage
(
"Original :
\"
Bad Apple!!
\"
feat. Nomico by Alstroemeria Records"
,
60000
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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