notifications.cxx 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "notifications.h"
  2. static const NotificationMessage* nm_list[16];
  3. void notify_table_bump(PinballApp* app) {
  4. int n = 0;
  5. if(app->settings.vibrate_enabled) {
  6. nm_list[n++] = &message_vibro_on;
  7. }
  8. if(app->settings.led_enabled) {
  9. nm_list[n++] = &message_red_255;
  10. }
  11. nm_list[n++] = &message_delay_100;
  12. if(app->settings.vibrate_enabled) {
  13. nm_list[n++] = &message_vibro_off;
  14. }
  15. if(app->settings.led_enabled) {
  16. nm_list[n++] = &message_red_0;
  17. }
  18. nm_list[n] = NULL;
  19. notification_message(app->notify, &nm_list);
  20. }
  21. void notify_error_message(PinballApp* app) {
  22. int n = 0;
  23. if(app->settings.sound_enabled) {
  24. nm_list[n++] = &message_note_c6;
  25. nm_list[n++] = &message_delay_50;
  26. nm_list[n++] = &message_sound_off;
  27. nm_list[n++] = &message_delay_50;
  28. nm_list[n++] = &message_note_c5;
  29. nm_list[n++] = &message_delay_250;
  30. nm_list[n++] = &message_sound_off;
  31. }
  32. nm_list[n] = NULL;
  33. notification_message(app->notify, &nm_list);
  34. }