Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Petal Hero
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dos
Petal Hero
Commits
95b27a3b
Verified
Commit
95b27a3b
authored
1 year ago
by
dos
Browse files
Options
Downloads
Patches
Plain Diff
Song previews
parent
0c99eb7b
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
__init__.py
+1
-0
1 addition, 0 deletions
__init__.py
difficulty.py
+2
-0
2 additions, 0 deletions
difficulty.py
select.py
+11
-5
11 additions, 5 deletions
select.py
song.py
+1
-0
1 addition, 0 deletions
song.py
with
15 additions
and
5 deletions
__init__.py
+
1
−
0
View file @
95b27a3b
...
...
@@ -181,6 +181,7 @@ class PetalHero(Application):
self
.
load
()
else
:
self
.
blm
.
foreground
=
True
media
.
set_volume
(
1.0
)
media
.
load
(
self
.
path
+
'
/sounds/menu.mp3
'
)
self
.
time
=
-
1
leds
.
set_slew_rate
(
255
)
...
...
This diff is collapsed.
Click to expand it.
difficulty.py
+
2
−
0
View file @
95b27a3b
...
...
@@ -115,6 +115,8 @@ class DifficultyView(BaseView):
self
.
_sc
.
think
(
ins
,
delta_ms
)
return
media
.
set_volume
(
min
(
1.0
,
media
.
get_volume
()
+
delta_ms
/
1000
))
if
self
.
input
.
buttons
.
app
.
left
.
pressed
or
self
.
input
.
buttons
.
app
.
left
.
repeated
:
self
.
_sc
.
scroll_left
()
self
.
_scroll_pos
=
0.0
...
...
This diff is collapsed.
Click to expand it.
select.py
+
11
−
5
View file @
95b27a3b
...
...
@@ -259,11 +259,6 @@ class SelectView(BaseView):
if
pos
<
0
:
pos
=
0
if
pos
>
len
(
self
.
songs
)
-
1
:
pos
=
len
(
self
.
songs
)
-
1
if
pos
!=
cur_target
:
song
=
self
.
songs
[
pos
].
load
()
media
.
load
(
song
.
dirName
+
"
/song.mp3
"
)
self
.
first_scroll_think
=
True
if
media
.
get_position
()
==
media
.
get_duration
():
media
.
seek
(
0
)
...
...
@@ -277,6 +272,14 @@ class SelectView(BaseView):
self
.
first_scroll_think
=
False
else
:
self
.
_sc
.
think
(
ins
,
delta_ms
)
media
.
set_volume
(
min
(
1.0
,
media
.
get_volume
()
+
delta_ms
/
1000
))
if
pos
!=
cur_target
:
song
=
self
.
songs
[
pos
].
load
()
media
.
load
(
song
.
dirName
+
"
/song.mp3
"
)
media
.
seek
(
media
.
get_duration
()
*
0.1
)
media
.
set_volume
(
0.0
)
self
.
first_scroll_think
=
True
def
on_enter
(
self
,
vm
:
Optional
[
ViewManager
])
->
None
:
super
().
on_enter
(
vm
)
...
...
@@ -290,6 +293,9 @@ class SelectView(BaseView):
if
self
.
songs
:
song
=
self
.
songs
[
self
.
_sc
.
target_position
()].
load
()
media
.
load
(
song
.
dirName
+
"
/song.mp3
"
)
media
.
seek
(
media
.
get_duration
()
*
0.1
)
media
.
set_volume
(
0.0
)
self
.
first_scroll_think
=
True
else
:
media
.
stop
()
...
...
This diff is collapsed.
Click to expand it.
song.py
+
1
−
0
View file @
95b27a3b
...
...
@@ -480,6 +480,7 @@ class SongView(BaseView):
self
.
first_think
=
True
if
self
.
vm
.
direction
==
ViewTransitionDirection
.
FORWARD
:
# self-pushed
return
media
.
set_volume
(
1.0
)
if
self
.
app
:
media
.
load
(
self
.
app
.
path
+
'
/sounds/start.mp3
'
)
utils
.
volume
(
self
.
app
,
8000
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment