xremote_scene_pause_set.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #include "../xremote.h"
  2. #include "../views/xremote_pause_set.h"
  3. void xremote_scene_pause_set_callback(XRemoteCustomEvent event, void* context) {
  4. furi_assert(context);
  5. XRemote* app = context;
  6. view_dispatcher_send_custom_event(app->view_dispatcher, event);
  7. }
  8. void xremote_scene_pause_set_on_enter(void* context) {
  9. furi_assert(context);
  10. XRemote* app = context;
  11. xremote_pause_set_set_callback(app->xremote_pause_set, xremote_scene_pause_set_callback, app);
  12. view_dispatcher_switch_to_view(app->view_dispatcher, XRemoteViewIdPauseSet);
  13. }
  14. bool xremote_scene_pause_set_on_event(void* context, SceneManagerEvent event) {
  15. XRemote* app = context;
  16. bool consumed = false;
  17. if(event.type == SceneManagerEventTypeCustom) {
  18. switch(event.event) {
  19. case XRemoteCustomEventInfoscreenLeft:
  20. case XRemoteCustomEventInfoscreenRight:
  21. break;
  22. case XRemoteCustomEventInfoscreenUp:
  23. case XRemoteCustomEventInfoscreenDown:
  24. break;
  25. case XRemoteCustomEventInfoscreenOk:
  26. scene_manager_next_scene(app->scene_manager, XRemoteSceneMenu);
  27. consumed = true;
  28. break;
  29. case XRemoteCustomEventPauseSetBack:
  30. if(!scene_manager_search_and_switch_to_previous_scene(
  31. app->scene_manager, XRemoteSceneCreateAdd)) {
  32. scene_manager_stop(app->scene_manager);
  33. view_dispatcher_stop(app->view_dispatcher);
  34. }
  35. consumed = true;
  36. break;
  37. case XRemoteCustomEventPauseSetOk:
  38. //xremote_cross_remote_add_pause(app->cross_remote, time);
  39. scene_manager_search_and_switch_to_previous_scene(
  40. app->scene_manager, XRemoteSceneCreate);
  41. consumed = true;
  42. break;
  43. }
  44. }
  45. return consumed;
  46. }
  47. void xremote_scene_pause_set_on_exit(void* context) {
  48. UNUSED(context);
  49. }