Skip to content

Commit e0d6597

Browse files
authored
Merge pull request #32 from leedave/orgasmotron_ui
Added UI to orgasmotron
2 parents 31b65d7 + 728753a commit e0d6597

13 files changed

+266
-22
lines changed

Misc/orgasmotron/.clang-format

+191
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
---
2+
Language: Cpp
3+
AccessModifierOffset: -4
4+
AlignAfterOpenBracket: AlwaysBreak
5+
AlignArrayOfStructures: None
6+
AlignConsecutiveMacros: None
7+
AlignConsecutiveAssignments: None
8+
AlignConsecutiveBitFields: None
9+
AlignConsecutiveDeclarations: None
10+
AlignEscapedNewlines: Left
11+
AlignOperands: Align
12+
AlignTrailingComments: false
13+
AllowAllArgumentsOnNextLine: true
14+
AllowAllParametersOfDeclarationOnNextLine: false
15+
AllowShortEnumsOnASingleLine: true
16+
AllowShortBlocksOnASingleLine: Never
17+
AllowShortCaseLabelsOnASingleLine: false
18+
AllowShortFunctionsOnASingleLine: None
19+
AllowShortLambdasOnASingleLine: All
20+
AllowShortIfStatementsOnASingleLine: WithoutElse
21+
AllowShortLoopsOnASingleLine: true
22+
AlwaysBreakAfterDefinitionReturnType: None
23+
AlwaysBreakAfterReturnType: None
24+
AlwaysBreakBeforeMultilineStrings: false
25+
AlwaysBreakTemplateDeclarations: Yes
26+
AttributeMacros:
27+
- __capability
28+
BinPackArguments: false
29+
BinPackParameters: false
30+
BraceWrapping:
31+
AfterCaseLabel: false
32+
AfterClass: false
33+
AfterControlStatement: Never
34+
AfterEnum: false
35+
AfterFunction: false
36+
AfterNamespace: false
37+
AfterObjCDeclaration: false
38+
AfterStruct: false
39+
AfterUnion: false
40+
AfterExternBlock: false
41+
BeforeCatch: false
42+
BeforeElse: false
43+
BeforeLambdaBody: false
44+
BeforeWhile: false
45+
IndentBraces: false
46+
SplitEmptyFunction: true
47+
SplitEmptyRecord: true
48+
SplitEmptyNamespace: true
49+
BreakBeforeBinaryOperators: None
50+
BreakBeforeConceptDeclarations: true
51+
BreakBeforeBraces: Attach
52+
BreakBeforeInheritanceComma: false
53+
BreakInheritanceList: BeforeColon
54+
BreakBeforeTernaryOperators: false
55+
BreakConstructorInitializersBeforeComma: false
56+
BreakConstructorInitializers: BeforeComma
57+
BreakAfterJavaFieldAnnotations: false
58+
BreakStringLiterals: false
59+
ColumnLimit: 99
60+
CommentPragmas: '^ IWYU pragma:'
61+
QualifierAlignment: Leave
62+
CompactNamespaces: false
63+
ConstructorInitializerIndentWidth: 4
64+
ContinuationIndentWidth: 4
65+
Cpp11BracedListStyle: true
66+
DeriveLineEnding: true
67+
DerivePointerAlignment: false
68+
DisableFormat: false
69+
EmptyLineAfterAccessModifier: Never
70+
EmptyLineBeforeAccessModifier: LogicalBlock
71+
ExperimentalAutoDetectBinPacking: false
72+
PackConstructorInitializers: BinPack
73+
BasedOnStyle: ''
74+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
75+
AllowAllConstructorInitializersOnNextLine: true
76+
FixNamespaceComments: false
77+
ForEachMacros:
78+
- foreach
79+
- Q_FOREACH
80+
- BOOST_FOREACH
81+
IfMacros:
82+
- KJ_IF_MAYBE
83+
IncludeBlocks: Preserve
84+
IncludeCategories:
85+
- Regex: '.*'
86+
Priority: 1
87+
SortPriority: 0
88+
CaseSensitive: false
89+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
90+
Priority: 3
91+
SortPriority: 0
92+
CaseSensitive: false
93+
- Regex: '.*'
94+
Priority: 1
95+
SortPriority: 0
96+
CaseSensitive: false
97+
IncludeIsMainRegex: '(Test)?$'
98+
IncludeIsMainSourceRegex: ''
99+
IndentAccessModifiers: false
100+
IndentCaseLabels: false
101+
IndentCaseBlocks: false
102+
IndentGotoLabels: true
103+
IndentPPDirectives: None
104+
IndentExternBlock: AfterExternBlock
105+
IndentRequires: false
106+
IndentWidth: 4
107+
IndentWrappedFunctionNames: true
108+
InsertTrailingCommas: None
109+
JavaScriptQuotes: Leave
110+
JavaScriptWrapImports: true
111+
KeepEmptyLinesAtTheStartOfBlocks: false
112+
LambdaBodyIndentation: Signature
113+
MacroBlockBegin: ''
114+
MacroBlockEnd: ''
115+
MaxEmptyLinesToKeep: 1
116+
NamespaceIndentation: None
117+
ObjCBinPackProtocolList: Auto
118+
ObjCBlockIndentWidth: 4
119+
ObjCBreakBeforeNestedBlockParam: true
120+
ObjCSpaceAfterProperty: true
121+
ObjCSpaceBeforeProtocolList: true
122+
PenaltyBreakAssignment: 10
123+
PenaltyBreakBeforeFirstCallParameter: 30
124+
PenaltyBreakComment: 10
125+
PenaltyBreakFirstLessLess: 0
126+
PenaltyBreakOpenParenthesis: 0
127+
PenaltyBreakString: 10
128+
PenaltyBreakTemplateDeclaration: 10
129+
PenaltyExcessCharacter: 100
130+
PenaltyReturnTypeOnItsOwnLine: 60
131+
PenaltyIndentedWhitespace: 0
132+
PointerAlignment: Left
133+
PPIndentWidth: -1
134+
ReferenceAlignment: Pointer
135+
ReflowComments: false
136+
RemoveBracesLLVM: false
137+
SeparateDefinitionBlocks: Leave
138+
ShortNamespaceLines: 1
139+
SortIncludes: Never
140+
SortJavaStaticImport: Before
141+
SortUsingDeclarations: false
142+
SpaceAfterCStyleCast: false
143+
SpaceAfterLogicalNot: false
144+
SpaceAfterTemplateKeyword: true
145+
SpaceBeforeAssignmentOperators: true
146+
SpaceBeforeCaseColon: false
147+
SpaceBeforeCpp11BracedList: false
148+
SpaceBeforeCtorInitializerColon: true
149+
SpaceBeforeInheritanceColon: true
150+
SpaceBeforeParens: Never
151+
SpaceBeforeParensOptions:
152+
AfterControlStatements: false
153+
AfterForeachMacros: false
154+
AfterFunctionDefinitionName: false
155+
AfterFunctionDeclarationName: false
156+
AfterIfMacros: false
157+
AfterOverloadedOperator: false
158+
BeforeNonEmptyParentheses: false
159+
SpaceAroundPointerQualifiers: Default
160+
SpaceBeforeRangeBasedForLoopColon: true
161+
SpaceInEmptyBlock: false
162+
SpaceInEmptyParentheses: false
163+
SpacesBeforeTrailingComments: 1
164+
SpacesInAngles: Never
165+
SpacesInConditionalStatement: false
166+
SpacesInContainerLiterals: false
167+
SpacesInCStyleCastParentheses: false
168+
SpacesInLineCommentPrefix:
169+
Minimum: 1
170+
Maximum: -1
171+
SpacesInParentheses: false
172+
SpacesInSquareBrackets: false
173+
SpaceBeforeSquareBrackets: false
174+
BitFieldColonSpacing: Both
175+
Standard: c++03
176+
StatementAttributeLikeMacros:
177+
- Q_EMIT
178+
StatementMacros:
179+
- Q_UNUSED
180+
- QT_REQUIRE_VERSION
181+
TabWidth: 4
182+
UseCRLF: false
183+
UseTab: Never
184+
WhitespaceSensitiveMacros:
185+
- STRINGIZE
186+
- PP_STRINGIZE
187+
- BOOST_PP_STRINGIZE
188+
- NS_SWIFT_NAME
189+
- CF_SWIFT_NAME
190+
...
191+

Misc/orgasmotron/application.fam

+7-2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,10 @@ App(
88
stack_size=1 * 1024,
99
order=20,
1010
fap_icon="orgasmotron_10px.png",
11-
fap_category="Misc",
12-
)
11+
fap_icon_assets="icons",
12+
fap_category="Tools",
13+
fap_version="1.0",
14+
fap_author="Leedave",
15+
fap_description="Vibrate Flipper in different modes",
16+
fap_weburl="https://github.com/leedave/Leeds-Flipper-Zero-Applications",
17+
)

Misc/orgasmotron/docs/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Orgasmotron
2+
3+
Allows Flipper Zero to vibrate in different patterns

Misc/orgasmotron/docs/changelog.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## v0.7
2+
Original release from qqmajikpp
3+
4+
## v0.8
5+
Extended with different vibro modes
6+
7+
## v0.9
8+
Fixed deprecated Mutex
9+
10+
## v1.0
11+
First release to Application Catalog
12+
- Added UI with dolphin GFX

Misc/orgasmotron/icons/center_7x7.png

1.41 KB
Loading

Misc/orgasmotron/icons/down_7x4.png

102 Bytes
Loading

Misc/orgasmotron/icons/left_4x7.png

1.38 KB
Loading

Misc/orgasmotron/icons/right_4x7.png

1.8 KB
Loading

Misc/orgasmotron/icons/ui_128x64.png

10.9 KB
Loading

Misc/orgasmotron/icons/up_7x4.png

102 Bytes
Loading

Misc/orgasmotron/orgasmotron.c

+53-20
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,66 @@
44
#include <gui/gui.h>
55
#include <input/input.h>
66
#include <notification/notification_messages.h>
7+
#include "orgasmotron_icons.h"
78

89
typedef struct {
910
int mode;
1011
FuriMutex* mutex;
1112
} PluginState;
1213

13-
void vibro_test_draw_callback(Canvas* canvas, void* ctx) {
14+
void vibro_draw_callback(Canvas* canvas, void* ctx) {
1415
furi_assert(ctx);
1516
const PluginState* plugin_state = ctx;
1617
furi_mutex_acquire(plugin_state->mutex, FuriWaitForever);
1718
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);
2020
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);
2831
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+
}
2964
}
3065

31-
void vibro_test_input_callback(InputEvent* input_event, void* ctx) {
66+
void vibro_input_callback(InputEvent* input_event, void* ctx) {
3267
furi_assert(ctx);
3368
FuriMessageQueue* event_queue = ctx;
3469
furi_message_queue_put(event_queue, input_event, FuriWaitForever);
@@ -52,8 +87,8 @@ int32_t orgasmotron_app(void* p) {
5287

5388
// Configure view port
5489
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);
5792

5893
// Register view port in GUI
5994
Gui* gui = furi_record_open(RECORD_GUI);
@@ -62,9 +97,8 @@ int32_t orgasmotron_app(void* p) {
6297
NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
6398

6499
InputEvent event;
65-
//int mode = 0;
66100
bool processing = true;
67-
//while(furi_message_queue_get(event_queue, &event, FuriWaitForever) == FuriStatusOk) {
101+
notification_message(notification, &sequence_display_backlight_on);
68102
while(processing) {
69103
FuriStatus event_status = furi_message_queue_get(event_queue, &event, 100);
70104
furi_mutex_acquire(plugin_state->mutex, FuriWaitForever);
@@ -110,27 +144,26 @@ int32_t orgasmotron_app(void* p) {
110144
} else if(plugin_state->mode == 2) {
111145
//Pulsed Vibration
112146
notification_message(notification, &sequence_set_vibro_on);
113-
notification_message(notification, &sequence_set_green_255);
147+
notification_message(notification, &sequence_set_red_255);
114148
delay(100);
115149
notification_message(notification, &sequence_reset_vibro);
116150
} else if(plugin_state->mode == 3) {
117151
//Soft power
118152
notification_message(notification, &sequence_set_vibro_on);
119-
notification_message(notification, &sequence_set_green_255);
153+
notification_message(notification, &sequence_set_blue_255);
120154
delay(50);
121155
notification_message(notification, &sequence_reset_vibro);
122156
} else if(plugin_state->mode == 4) {
123157
//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++) {
125160
notification_message(notification, &sequence_set_vibro_on);
126-
notification_message(notification, &sequence_set_green_255);
127161
delay(50);
128162
notification_message(notification, &sequence_reset_vibro);
129163
delay(50);
130164
}
131165
for(int i = 0; i < 2; i++) {
132166
notification_message(notification, &sequence_set_vibro_on);
133-
notification_message(notification, &sequence_set_green_255);
134167
delay(400);
135168
notification_message(notification, &sequence_reset_vibro);
136169
delay(50);

Misc/orgasmotron/orgasmotron.fap

-2.26 KB
Binary file not shown.
2.37 KB
Loading

0 commit comments

Comments
 (0)