Skip to content

Commit 0876a7d

Browse files
authored
Merge pull request #42 from leedave/feature/orgasmotron_ani
Added animations
2 parents 0b2e761 + d3c1668 commit 0876a7d

13 files changed

+48
-13
lines changed

Misc/orgasmotron/application.fam

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ App(
1010
fap_icon="orgasmotron_10px.png",
1111
fap_icon_assets="icons",
1212
fap_category="Tools",
13-
fap_version="1.0",
13+
fap_version="1.1",
1414
fap_author="Leedave",
1515
fap_description="Vibrate Flipper in different modes",
1616
fap_weburl="https://github.com/leedave/Leeds-Flipper-Zero-Applications",

Misc/orgasmotron/docs/changelog.md

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
## v0.7
2-
Original release from qqmajikpp
1+
## v1.1
2+
Added animations, because it is fun
33

4-
## v0.8
5-
Extended with different vibro modes
4+
## v1.0
5+
First release to Application Catalog
6+
- Added UI with dolphin GFX
67

78
## v0.9
89
Fixed deprecated Mutex
910

10-
## v1.0
11-
First release to Application Catalog
12-
- Added UI with dolphin GFX
11+
## v0.8
12+
Extended with different vibro modes
13+
14+
## v0.7
15+
Original release from qqmajikpp
611 Bytes
Loading
616 Bytes
Loading
611 Bytes
Loading
8.45 KB
Loading
620 Bytes
Loading
618 Bytes
Loading
623 Bytes
Loading
636 Bytes
Loading
637 Bytes
Loading
636 Bytes
Loading

Misc/orgasmotron/orgasmotron.c

+37-5
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,27 @@
88

99
typedef struct {
1010
int mode;
11+
int animation;
1112
FuriMutex* mutex;
1213
} PluginState;
1314

15+
void render_awake(Canvas* canvas, void* ctx) {
16+
const PluginState* plugin_state = ctx;
17+
if (plugin_state->animation == 0) {
18+
canvas_draw_icon(canvas, 30, 5, &I_eye_1_18x14);
19+
canvas_draw_icon(canvas, 32, 40, &I_fin_1_20x21);
20+
canvas_draw_icon(canvas, 1, 6, &I_nose_1_28x18);
21+
} else if(plugin_state->animation == 1) {
22+
canvas_draw_icon(canvas, 30, 5, &I_eye_2_18x14);
23+
canvas_draw_icon(canvas, 32, 40, &I_fin_2_20x21);
24+
canvas_draw_icon(canvas, 1, 6, &I_nose_2_28x18);
25+
} else if(plugin_state->animation == 2) {
26+
canvas_draw_icon(canvas, 30, 5, &I_eye_3_18x14);
27+
canvas_draw_icon(canvas, 32, 40, &I_fin_3_20x21);
28+
canvas_draw_icon(canvas, 1, 6, &I_nose_3_28x18);
29+
}
30+
}
31+
1432
void vibro_draw_callback(Canvas* canvas, void* ctx) {
1533
furi_assert(ctx);
1634
const PluginState* plugin_state = ctx;
@@ -30,36 +48,41 @@ void vibro_draw_callback(Canvas* canvas, void* ctx) {
3048
canvas_draw_icon(canvas, 38, 24, &I_center_7x7);
3149
furi_mutex_release(plugin_state->mutex);
3250

33-
if(plugin_state->mode == 0) {
51+
if(plugin_state->mode == 0){
52+
canvas_draw_icon(canvas, 30, 5, &I_eye_closed_18x14);
3453
canvas_draw_box(canvas, 36, 23, 15, 18);
3554
canvas_invert_color(canvas);
3655
canvas_draw_str(canvas, 38, 39, "Off");
3756
canvas_draw_icon(canvas, 38, 24, &I_center_7x7);
3857
canvas_invert_color(canvas);
39-
} else if(plugin_state->mode == 1) {
58+
} else if(plugin_state->mode == 1){
4059
canvas_draw_box(canvas, 55, 36, 36, 10);
4160
canvas_invert_color(canvas);
4261
canvas_draw_str(canvas, 61, 44, "Strong");
4362
canvas_draw_icon(canvas, 56, 37, &I_left_4x7);
4463
canvas_invert_color(canvas);
45-
} else if(plugin_state->mode == 2) {
64+
render_awake(canvas, ctx);
65+
} else if(plugin_state->mode == 2){
4666
canvas_draw_box(canvas, 74, 20, 30, 16);
4767
canvas_invert_color(canvas);
4868
canvas_draw_str(canvas, 76, 33, "Pulsed");
4969
canvas_draw_icon(canvas, 85, 21, &I_up_7x4);
5070
canvas_invert_color(canvas);
51-
} else if(plugin_state->mode == 3) {
71+
render_awake(canvas, ctx);
72+
} else if(plugin_state->mode == 3){
5273
canvas_draw_box(canvas, 95, 36, 28, 10);
5374
canvas_invert_color(canvas);
5475
canvas_draw_str(canvas, 97, 44, "Soft");
5576
canvas_draw_icon(canvas, 117, 37, &I_right_4x7);
5677
canvas_invert_color(canvas);
57-
} else if(plugin_state->mode == 4) {
78+
render_awake(canvas, ctx);
79+
} else if(plugin_state->mode == 4){
5880
canvas_draw_box(canvas, 74, 47, 32, 16);
5981
canvas_invert_color(canvas);
6082
canvas_draw_str(canvas, 76, 56, "Combo");
6183
canvas_draw_icon(canvas, 85, 57, &I_down_7x4);
6284
canvas_invert_color(canvas);
85+
render_awake(canvas, ctx);
6386
}
6487
}
6588

@@ -99,7 +122,11 @@ int32_t orgasmotron_app(void* p) {
99122
InputEvent event;
100123
bool processing = true;
101124
notification_message(notification, &sequence_display_backlight_on);
125+
plugin_state->animation = 0;
102126
while(processing) {
127+
if (plugin_state->animation > 2) {
128+
plugin_state->animation = 0;
129+
}
103130
FuriStatus event_status = furi_message_queue_get(event_queue, &event, 100);
104131
furi_mutex_acquire(plugin_state->mutex, FuriWaitForever);
105132
if(event_status == FuriStatusOk) {
@@ -114,6 +141,7 @@ int32_t orgasmotron_app(void* p) {
114141
if(event.key == InputKeyOk &&
115142
(event.type == InputTypePress || event.type == InputTypeRelease)) {
116143
plugin_state->mode = 0;
144+
plugin_state->animation = 0;
117145
}
118146
if(event.key == InputKeyLeft &&
119147
(event.type == InputTypePress || event.type == InputTypeRelease)) {
@@ -141,18 +169,21 @@ int32_t orgasmotron_app(void* p) {
141169
//Full power
142170
notification_message(notification, &sequence_set_vibro_on);
143171
notification_message(notification, &sequence_set_green_255);
172+
plugin_state->animation++;
144173
} else if(plugin_state->mode == 2) {
145174
//Pulsed Vibration
146175
notification_message(notification, &sequence_set_vibro_on);
147176
notification_message(notification, &sequence_set_red_255);
148177
delay(100);
149178
notification_message(notification, &sequence_reset_vibro);
179+
plugin_state->animation++;
150180
} else if(plugin_state->mode == 3) {
151181
//Soft power
152182
notification_message(notification, &sequence_set_vibro_on);
153183
notification_message(notification, &sequence_set_blue_255);
154184
delay(50);
155185
notification_message(notification, &sequence_reset_vibro);
186+
plugin_state->animation++;
156187
} else if(plugin_state->mode == 4) {
157188
//Special Sequence
158189
notification_message(notification, &sequence_solid_yellow);
@@ -168,6 +199,7 @@ int32_t orgasmotron_app(void* p) {
168199
notification_message(notification, &sequence_reset_vibro);
169200
delay(50);
170201
}
202+
plugin_state->animation++;
171203
}
172204
furi_mutex_release(plugin_state->mutex);
173205
}

0 commit comments

Comments
 (0)