|
@@ -1,5 +1,6 @@
|
|
|
#include <gui/canvas.h>
|
|
#include <gui/canvas.h>
|
|
|
#include <gui/modules/menu.h>
|
|
#include <gui/modules/menu.h>
|
|
|
|
|
+#include <gui/modules/submenu.h>
|
|
|
|
|
|
|
|
/* generated by fbt from .png files in images folder */
|
|
/* generated by fbt from .png files in images folder */
|
|
|
#include <tone_gen_icons.h>
|
|
#include <tone_gen_icons.h>
|
|
@@ -46,6 +47,11 @@ int setupViews(struct AppContext_t** appContext) {
|
|
|
sharedMenuView->viewId = ToneGenAppView_SharedMenu;
|
|
sharedMenuView->viewId = ToneGenAppView_SharedMenu;
|
|
|
sharedMenuView->type = MENU;
|
|
sharedMenuView->type = MENU;
|
|
|
|
|
|
|
|
|
|
+ struct View_t* submenuView = malloc(sizeof(struct View_t));
|
|
|
|
|
+ submenuView->viewData = submenu_alloc();
|
|
|
|
|
+ submenuView->viewId = ToneGenAppView_Submenu;
|
|
|
|
|
+ submenuView->type = SUBMENU;
|
|
|
|
|
+
|
|
|
struct View_t* playbackView = malloc(sizeof(struct View_t));
|
|
struct View_t* playbackView = malloc(sizeof(struct View_t));
|
|
|
playbackView->viewData = view_alloc();
|
|
playbackView->viewData = view_alloc();
|
|
|
playbackView->viewId = ToneGenAppView_PlaybackView;
|
|
playbackView->viewId = ToneGenAppView_PlaybackView;
|
|
@@ -59,6 +65,12 @@ int setupViews(struct AppContext_t** appContext) {
|
|
|
return -1;
|
|
return -1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ result = addViewToAppContext(appContext, submenuView);
|
|
|
|
|
+ if(result != APP_CONTEXT_OK) {
|
|
|
|
|
+ FURI_LOG_E(TAG, "There was a problem adding the view %d!", submenuView->viewId);
|
|
|
|
|
+ return -1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
result = addViewToAppContext(appContext, playbackView);
|
|
result = addViewToAppContext(appContext, playbackView);
|
|
|
if(result != APP_CONTEXT_OK) {
|
|
if(result != APP_CONTEXT_OK) {
|
|
|
FURI_LOG_E(TAG, "There was a problem adding the view %d!", playbackView->viewId);
|
|
FURI_LOG_E(TAG, "There was a problem adding the view %d!", playbackView->viewId);
|
|
@@ -71,10 +83,12 @@ int setupViews(struct AppContext_t** appContext) {
|
|
|
(*appContext)->view_dispatcher,
|
|
(*appContext)->view_dispatcher,
|
|
|
sharedMenuView->viewId,
|
|
sharedMenuView->viewId,
|
|
|
menu_get_view(sharedMenuView->viewData));
|
|
menu_get_view(sharedMenuView->viewData));
|
|
|
- FURI_LOG_I(TAG, "Adding next view to app context");
|
|
|
|
|
|
|
+ view_dispatcher_add_view(
|
|
|
|
|
+ (*appContext)->view_dispatcher,
|
|
|
|
|
+ submenuView->viewId,
|
|
|
|
|
+ submenu_get_view(submenuView->viewData));
|
|
|
view_dispatcher_add_view(
|
|
view_dispatcher_add_view(
|
|
|
(*appContext)->view_dispatcher, playbackView->viewId, playbackView->viewData);
|
|
(*appContext)->view_dispatcher, playbackView->viewId, playbackView->viewData);
|
|
|
- FURI_LOG_I(TAG, "Done making views");
|
|
|
|
|
|
|
|
|
|
// On the playback view, ensure we only allocate for the model once
|
|
// On the playback view, ensure we only allocate for the model once
|
|
|
FURI_LOG_I(TAG, "allocating view model for playback");
|
|
FURI_LOG_I(TAG, "allocating view model for playback");
|