Skip to content

Commit a054c2a

Browse files
committed
Rename Menus to Scenes
[Problem] Right now the naming for the menu folder is incorrect, as these are actually scenes. As a result, it should be renamed. [Solution] Renamed the folder and corresponding dependencies. [Testing] Confirmed still builds and runs on device.
1 parent c442af4 commit a054c2a

File tree

5 files changed

+27
-27
lines changed

5 files changed

+27
-27
lines changed

application.fam

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ App(
1313
fap_author="Gerald McAlister",
1414
fap_weburl="https://github.com/GEMISIS/tone_gen",
1515
fap_icon_assets="images", # Image assets to compile for this application
16-
sources=["src/*.c", "src/menus/*.c", "src/utils/*.c"],
16+
sources=["src/*.c", "src/scenes/*.c", "src/utils/*.c"],
1717
)

src/menus/main_menu.h

-11
This file was deleted.

src/menus/main_menu.c src/scenes/starting_scene.c

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <gui/modules/menu.h>
22
#include <gui/modules/popup.h>
33

4-
#include "main_menu.h"
4+
#include "starting_scene.h"
55
#include "../app_context.h"
66
#include "../tone_gen.h"
77
#include "../utils/linked_list.h"
@@ -13,8 +13,8 @@ typedef enum {
1313
} ToneGenAppMenuSelection;
1414

1515
/** main menu callback - sends a custom event to the scene manager based on the menu selection */
16-
void menu_callback_main_menu(void* context, uint32_t index) {
17-
FURI_LOG_I(TAG, "menu_callback_main_menu");
16+
void menu_callback_starting_scene(void* context, uint32_t index) {
17+
FURI_LOG_I(TAG, "menu_callback_starting_scene");
1818
UNUSED(context);
1919
// struct AppContext_t* app = context;
2020
switch(index) {
@@ -30,8 +30,8 @@ void menu_callback_main_menu(void* context, uint32_t index) {
3030
}
3131

3232
/** resets the menu, gives it content, callbacks and selection enums */
33-
void scene_on_enter_main_menu(void* context) {
34-
FURI_LOG_I(TAG, "scene_on_enter_main_menu");
33+
void scene_on_enter_starting_scene(void* context) {
34+
FURI_LOG_I(TAG, "scene_on_enter_starting_scene");
3535
struct AppContext_t* app = (struct AppContext_t*)context;
3636
// Setup our menu
3737
FURI_LOG_D(TAG, "Adding view menu");
@@ -55,21 +55,21 @@ void scene_on_enter_main_menu(void* context) {
5555
"Play Tone",
5656
NULL,
5757
ToneGenAppMenuSelection_Play,
58-
menu_callback_main_menu,
58+
menu_callback_starting_scene,
5959
app);
6060
menu_add_item(
6161
menuView->viewData,
6262
"Adjust Tone",
6363
NULL,
6464
ToneGenAppMenuSelection_Adjust,
65-
menu_callback_main_menu,
65+
menu_callback_starting_scene,
6666
app);
6767
view_dispatcher_switch_to_view(app->view_dispatcher, ToneGenAppView_Menu);
6868
}
6969

7070
/** main menu event handler - switches scene based on the event */
71-
bool scene_on_event_main_menu(void* context, SceneManagerEvent event) {
72-
FURI_LOG_I(TAG, "scene_on_event_main_menu");
71+
bool scene_on_event_starting_scene(void* context, SceneManagerEvent event) {
72+
FURI_LOG_I(TAG, "scene_on_event_starting_scene");
7373
UNUSED(context);
7474
// struct AppContext_t* app = context;
7575
bool consumed = false;
@@ -93,8 +93,8 @@ bool scene_on_event_main_menu(void* context, SceneManagerEvent event) {
9393
return consumed;
9494
}
9595

96-
void scene_on_exit_main_menu(void* context) {
97-
FURI_LOG_I(TAG, "scene_on_exit_main_menu");
96+
void scene_on_exit_starting_scene(void* context) {
97+
FURI_LOG_I(TAG, "scene_on_exit_starting_scene");
9898
struct AppContext_t* app = context;
9999
freeAppContextViews(&app);
100100
}

src/scenes/starting_scene.h

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#ifndef _STARTING_SCENE_H_
2+
3+
#define _STARTING_SCENE_H_
4+
5+
#include <gui/scene_manager.h>
6+
7+
void scene_on_enter_starting_scene(void* context);
8+
bool scene_on_event_starting_scene(void* context, SceneManagerEvent event);
9+
void scene_on_exit_starting_scene(void* context);
10+
11+
#endif

src/tone_gen.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@
66
#include "app_context.h"
77
#include "tone_gen.h"
88

9-
#include "menus/main_menu.h"
9+
#include "scenes/starting_scene.h"
1010

1111
/** collection of all scene on_enter handlers - in the same order as their enum */
1212
void (*const scene_on_enter_handlers[])(void*) = {
13-
scene_on_enter_main_menu,
13+
scene_on_enter_starting_scene,
1414
};
1515

1616
/** collection of all scene on event handlers - in the same order as their enum */
1717
bool (*const scene_on_event_handlers[])(void*, SceneManagerEvent) = {
18-
scene_on_event_main_menu,
18+
scene_on_event_starting_scene,
1919
};
2020

2121
/** collection of all scene on exit handlers - in the same order as their enum */
2222
void (*const scene_on_exit_handlers[])(void*) = {
23-
scene_on_exit_main_menu,
23+
scene_on_exit_starting_scene,
2424
};
2525

2626
const SceneManagerHandlers scene_event_handlers = {

0 commit comments

Comments
 (0)