4
4
#include <gui/gui.h>
5
5
#include <input/input.h>
6
6
#include <notification/notification_messages.h>
7
+ #include "orgasmotron_icons.h"
7
8
8
9
typedef struct {
9
10
int mode ;
10
11
FuriMutex * mutex ;
11
12
} PluginState ;
12
13
13
- void vibro_test_draw_callback (Canvas * canvas , void * ctx ) {
14
+ void vibro_draw_callback (Canvas * canvas , void * ctx ) {
14
15
furi_assert (ctx );
15
16
const PluginState * plugin_state = ctx ;
16
17
furi_mutex_acquire (plugin_state -> mutex , FuriWaitForever );
17
18
canvas_clear (canvas );
18
- canvas_set_font (canvas , FontPrimary );
19
- canvas_draw_str (canvas , 2 , 10 , "Vibro Modes" );
19
+ canvas_draw_icon (canvas , 0 , 0 , & I_ui_128x64 );
20
20
canvas_set_font (canvas , FontSecondary );
21
- canvas_draw_str (canvas , 2 , 22 , "LEFT: strong / RIGHT: Soft" );
22
- canvas_set_font (canvas , FontSecondary );
23
- canvas_draw_str (canvas , 2 , 34 , "UP: Pulsed" );
24
- canvas_set_font (canvas , FontSecondary );
25
- canvas_draw_str (canvas , 2 , 46 , "DOWN Pleasure combo" );
26
- canvas_set_font (canvas , FontSecondary );
27
- canvas_draw_str (canvas , 2 , 58 , "OK: Pause" );
21
+ canvas_draw_icon (canvas , 56 , 37 , & I_left_4x7 );
22
+ canvas_draw_str (canvas , 61 , 44 , "Strong" );
23
+ canvas_draw_str (canvas , 97 , 44 , "Soft" );
24
+ canvas_draw_icon (canvas , 117 , 37 , & I_right_4x7 );
25
+ canvas_draw_str (canvas , 76 , 33 , "Pulsed" );
26
+ canvas_draw_icon (canvas , 85 , 21 , & I_up_7x4 );
27
+ canvas_draw_str (canvas , 76 , 56 , "Combo" );
28
+ canvas_draw_icon (canvas , 85 , 57 , & I_down_7x4 );
29
+ canvas_draw_str (canvas , 38 , 39 , "Off" );
30
+ canvas_draw_icon (canvas , 38 , 24 , & I_center_7x7 );
28
31
furi_mutex_release (plugin_state -> mutex );
32
+
33
+ if (plugin_state -> mode == 0 ) {
34
+ canvas_draw_box (canvas , 36 , 23 , 15 , 18 );
35
+ canvas_invert_color (canvas );
36
+ canvas_draw_str (canvas , 38 , 39 , "Off" );
37
+ canvas_draw_icon (canvas , 38 , 24 , & I_center_7x7 );
38
+ canvas_invert_color (canvas );
39
+ } else if (plugin_state -> mode == 1 ) {
40
+ canvas_draw_box (canvas , 55 , 36 , 36 , 10 );
41
+ canvas_invert_color (canvas );
42
+ canvas_draw_str (canvas , 61 , 44 , "Strong" );
43
+ canvas_draw_icon (canvas , 56 , 37 , & I_left_4x7 );
44
+ canvas_invert_color (canvas );
45
+ } else if (plugin_state -> mode == 2 ) {
46
+ canvas_draw_box (canvas , 74 , 20 , 30 , 16 );
47
+ canvas_invert_color (canvas );
48
+ canvas_draw_str (canvas , 76 , 33 , "Pulsed" );
49
+ canvas_draw_icon (canvas , 85 , 21 , & I_up_7x4 );
50
+ canvas_invert_color (canvas );
51
+ } else if (plugin_state -> mode == 3 ) {
52
+ canvas_draw_box (canvas , 95 , 36 , 28 , 10 );
53
+ canvas_invert_color (canvas );
54
+ canvas_draw_str (canvas , 97 , 44 , "Soft" );
55
+ canvas_draw_icon (canvas , 117 , 37 , & I_right_4x7 );
56
+ canvas_invert_color (canvas );
57
+ } else if (plugin_state -> mode == 4 ) {
58
+ canvas_draw_box (canvas , 74 , 47 , 32 , 16 );
59
+ canvas_invert_color (canvas );
60
+ canvas_draw_str (canvas , 76 , 56 , "Combo" );
61
+ canvas_draw_icon (canvas , 85 , 57 , & I_down_7x4 );
62
+ canvas_invert_color (canvas );
63
+ }
29
64
}
30
65
31
- void vibro_test_input_callback (InputEvent * input_event , void * ctx ) {
66
+ void vibro_input_callback (InputEvent * input_event , void * ctx ) {
32
67
furi_assert (ctx );
33
68
FuriMessageQueue * event_queue = ctx ;
34
69
furi_message_queue_put (event_queue , input_event , FuriWaitForever );
@@ -52,8 +87,8 @@ int32_t orgasmotron_app(void* p) {
52
87
53
88
// Configure view port
54
89
ViewPort * view_port = view_port_alloc ();
55
- view_port_draw_callback_set (view_port , vibro_test_draw_callback , plugin_state );
56
- view_port_input_callback_set (view_port , vibro_test_input_callback , event_queue );
90
+ view_port_draw_callback_set (view_port , vibro_draw_callback , plugin_state );
91
+ view_port_input_callback_set (view_port , vibro_input_callback , event_queue );
57
92
58
93
// Register view port in GUI
59
94
Gui * gui = furi_record_open (RECORD_GUI );
@@ -62,9 +97,8 @@ int32_t orgasmotron_app(void* p) {
62
97
NotificationApp * notification = furi_record_open (RECORD_NOTIFICATION );
63
98
64
99
InputEvent event ;
65
- //int mode = 0;
66
100
bool processing = true;
67
- //while(furi_message_queue_get(event_queue , &event, FuriWaitForever) == FuriStatusOk) {
101
+ notification_message ( notification , & sequence_display_backlight_on );
68
102
while (processing ) {
69
103
FuriStatus event_status = furi_message_queue_get (event_queue , & event , 100 );
70
104
furi_mutex_acquire (plugin_state -> mutex , FuriWaitForever );
@@ -110,27 +144,26 @@ int32_t orgasmotron_app(void* p) {
110
144
} else if (plugin_state -> mode == 2 ) {
111
145
//Pulsed Vibration
112
146
notification_message (notification , & sequence_set_vibro_on );
113
- notification_message (notification , & sequence_set_green_255 );
147
+ notification_message (notification , & sequence_set_red_255 );
114
148
delay (100 );
115
149
notification_message (notification , & sequence_reset_vibro );
116
150
} else if (plugin_state -> mode == 3 ) {
117
151
//Soft power
118
152
notification_message (notification , & sequence_set_vibro_on );
119
- notification_message (notification , & sequence_set_green_255 );
153
+ notification_message (notification , & sequence_set_blue_255 );
120
154
delay (50 );
121
155
notification_message (notification , & sequence_reset_vibro );
122
156
} else if (plugin_state -> mode == 4 ) {
123
157
//Special Sequence
124
- for (int i = 0 ; i < 15 ; i ++ ) {
158
+ notification_message (notification , & sequence_solid_yellow );
159
+ for (int i = 0 ; i < 5 ; i ++ ) {
125
160
notification_message (notification , & sequence_set_vibro_on );
126
- notification_message (notification , & sequence_set_green_255 );
127
161
delay (50 );
128
162
notification_message (notification , & sequence_reset_vibro );
129
163
delay (50 );
130
164
}
131
165
for (int i = 0 ; i < 2 ; i ++ ) {
132
166
notification_message (notification , & sequence_set_vibro_on );
133
- notification_message (notification , & sequence_set_green_255 );
134
167
delay (400 );
135
168
notification_message (notification , & sequence_reset_vibro );
136
169
delay (50 );
0 commit comments