-
Notifications
You must be signed in to change notification settings - Fork 1
/
MusicMod_241_v1.pbp
186 lines (156 loc) · 4.33 KB
/
MusicMod_241_v1.pbp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
; This patch changes buttons layout of stock Music app.
; Short press on up/down buttons will change volume,
; and long press will switch tracks.
#ver 230
; Possible options:
;WIP @music_mimic_musicboss (FIXME: doesn't work yet with 2.3 fw)
; This will cause stock Music app
; to mimic MusicBoss UUID.
; This allows switching to Music app
; from Glance app (just tell it to switch to MusicBoss).
; Warning: don't use this together with MusicBoss app!
; Or else your watch will reboot or behave badly.
; So only use it if you don't use MusicBoss at all.
;WIP @music_return_to_glance
; This will cause stock Music app
; to (try to) launch Glance app on exit,
; just like MusicBoss with appropriate option enabled.
;@music_volume_on_longpress
; Default behaviour is to change volume on short press
; and skip tracks on long press;
; this option will reverse this.
;@music_vibe_length_ms val
; This option controls length of vibe pulse
; on button longpress (track change).
#default music_vibe_length 75
;and also these:
;@global_longpress_delay_ms val
; This option controls longpress delay. 250 ms means 1/4 seconds, 1000 ms means 1 second, etc.
#default global_longpress_delay_ms 250
10 b5 20 4c ?4 4f f4 7a 71 00 22 ?4 20 78 ?4 00 28 {
proc music_app_select_click
}
10 b5 04 46 ?4 4f f4 7a 71 00 22 {
proc music_app_volume_buttons_handler
}
10 b5 04 46 ?4 00 22 4f f4 7a 71 ?4 {
proc music_app_track_buttons_handler
}
#include includes/click_config_230.pbi
#include includes/vibes_230.pbi
#ifdef music_mimic_musicboss
; if mimicking MusicBoss, replace Music app's empty UUID
; with MusicBoss' one:
43 00 00 00 c7 00 00 00 cf 01 00 00 df 03 00 00 ; some Music-related icon for disambig
@ ; our empty uuid:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
18 00 00 00 ?4 00 00 00 00 ?4 ; and other parts of appinfo_music
{
; change empty uuid to MusicBoss':
; E4168F6C-B485-4B6F-99C4-94AA957E86D5
db E4 16 8f 6c b4 85 4b 6f 99 c4 94 aa 95 7e 86 d5
}
#endif
; replace (full) music_app_click_config_provider proc:
10 b5 0c 4c 01 20 22 46 c8 21 ?4
02 20 09 49 ?4
02 20 4f f4 fa 71 07 4a 00 23 ?4
03 20 c8 21 22 46 bd e8 10 40 ?4
00 bf ?4 ?4 ?4
{
PUSH {LR}
MOV R0, 2 ; button_id_select
LDR R1, pSelClick
BL window_single_click_subscribe
MOV R0, 1 ; button_id_up
LDR R1, pShortClick
BL window_single_click_subscribe
MOV R0, 3 ; button_id_down
LDR R1, pShortClick
BL window_single_click_subscribe
B.W my_clickconfig
ALIGN 4
pSelClick: DCD music_app_select_click+1
pShortClick: DCD my_click_handler+1
}
{
proc my_clickconfig
MOV R0, 1 ; button_id_up
MOV R1, ${global_longpress_delay_ms}
LDR R2, pLongClick ; down_handler(press)
LDR R3, pRelease ; up_handler(release)
BL window_long_click_subscribe
MOV R0, 3 ; button_id_down
MOV R1, ${global_longpress_delay_ms}
LDR R2, pLongClick ; down_handler(press)
LDR R3, pRelease ; up_handler(release)
BL window_long_click_subscribe
#ifdef music_return_to_glance
MOV R0, 0 ; button_id_back
LDR R1, pBackPressed
BL window_single_click_subscribe
#endif
POP {PC}
ALIGN 4
pLongClick: DCD my_longclick_handler+1
pRelease: DCD my_release_handler+1
#ifdef music_return_to_glance
pBackPressed: DCD back_pressed+1
#endif
}
{
proc my_click_handler
#ifdef music_volume_on_longpress
B.W music_app_track_buttons_handler
#else
B.W music_app_volume_buttons_handler
#endif
}
{
proc my_longclick_handler
PUSH {R0-R3,LR}
ADR R0, shortvibe_arr ; ptr to segments array
MOV R1, 1 ; segments count
BL vibes_enqueue_custom_pattern
POP {R0-R3,LR}
#ifdef music_volume_on_longpress
B.W music_app_volume_buttons_handler
#else
B.W music_app_track_buttons_handler
#endif
ALIGN 4
shortvibe_arr:
DCD ${music_vibe_length}
}
{
proc my_release_handler
BX LR
}
#ifdef music_return_to_glance
; for 2.0.x: 30 b5 85 b0 05 46 00 21 68 46 10 22 {
38 b5 05 46 ?4 08 b1 {
proc app_manager_find_app_info_by_uuid
}
1f b5 04 46 20 b9 09 48 {
proc app_manager_launch
}
10 b5 04 46 ?4 18 b1 20 46 ?4 fa e7 {
proc window_stack_pop_all
}
{
proc back_pressed
PUSH {LR}
MOV R0, 0 ; animated (bool)
BL window_stack_pop_all ; terminate app
ADR R0, uuidGlance
BL app_manager_find_app_info_by_uuid
CBZ R0, ret ; no glance installed? -> just exit
BL app_manager_launch
ret:
POP {PC}
; data:
ALIGN 4
; glance UUID: 4B760064-1488-4044-967A-1B1D3AB30574
uuidGlance: db 4b 76 00 64 14 88 40 44 96 7a 1b 1d 3a b3 05 74
}
#endif