mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
[FL-3564] New IR universal remote graphics (#3006)
* New IR universal remote layout * Remove redundant checks Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "../infrared_i.h"
|
||||
|
||||
#include "common/infrared_scene_universal_common.h"
|
||||
#include <furi_hal_rtc.h>
|
||||
|
||||
void infrared_scene_universal_ac_on_enter(void* context) {
|
||||
infrared_scene_universal_common_on_enter(context);
|
||||
@@ -18,24 +19,26 @@ void infrared_scene_universal_ac_on_enter(void* context) {
|
||||
i,
|
||||
0,
|
||||
0,
|
||||
3,
|
||||
22,
|
||||
&I_Off_25x27,
|
||||
&I_Off_hvr_25x27,
|
||||
6,
|
||||
15,
|
||||
&I_power_19x20,
|
||||
&I_power_hover_19x20,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
button_panel_add_icon(button_panel, 4, 37, &I_power_text_24x5);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Off");
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
1,
|
||||
0,
|
||||
36,
|
||||
22,
|
||||
&I_Dehumidify_25x27,
|
||||
&I_Dehumidify_hvr_25x27,
|
||||
39,
|
||||
15,
|
||||
&I_dry_19x20,
|
||||
&I_dry_hover_19x20,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
button_panel_add_icon(button_panel, 41, 37, &I_dry_text_15x5);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Dh");
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
@@ -43,9 +46,9 @@ void infrared_scene_universal_ac_on_enter(void* context) {
|
||||
0,
|
||||
1,
|
||||
3,
|
||||
59,
|
||||
&I_CoolHi_25x27,
|
||||
&I_CoolHi_hvr_25x27,
|
||||
49,
|
||||
&I_max_24x23,
|
||||
&I_max_hover_24x23,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Cool_hi");
|
||||
@@ -54,39 +57,71 @@ void infrared_scene_universal_ac_on_enter(void* context) {
|
||||
i,
|
||||
1,
|
||||
1,
|
||||
36,
|
||||
59,
|
||||
&I_HeatHi_25x27,
|
||||
&I_HeatHi_hvr_25x27,
|
||||
37,
|
||||
49,
|
||||
&I_max_24x23,
|
||||
&I_max_hover_24x23,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Heat_hi");
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
0,
|
||||
2,
|
||||
3,
|
||||
91,
|
||||
&I_CoolLo_25x27,
|
||||
&I_CoolLo_hvr_25x27,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
if(furi_hal_rtc_get_locale_units() == FuriHalRtcLocaleUnitsMetric) {
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
0,
|
||||
2,
|
||||
3,
|
||||
100,
|
||||
&I_celsius_24x23,
|
||||
&I_celsius_hover_24x23,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
} else {
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
0,
|
||||
2,
|
||||
3,
|
||||
100,
|
||||
&I_fahren_24x23,
|
||||
&I_fahren_hover_24x23,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
}
|
||||
infrared_brute_force_add_record(brute_force, i++, "Cool_lo");
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
1,
|
||||
2,
|
||||
36,
|
||||
91,
|
||||
&I_HeatLo_25x27,
|
||||
&I_HeatLo_hvr_25x27,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
|
||||
if(furi_hal_rtc_get_locale_units() == FuriHalRtcLocaleUnitsMetric) {
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
1,
|
||||
2,
|
||||
37,
|
||||
100,
|
||||
&I_celsius_24x23,
|
||||
&I_celsius_hover_24x23,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
} else {
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
1,
|
||||
2,
|
||||
37,
|
||||
100,
|
||||
&I_fahren_24x23,
|
||||
&I_fahren_hover_24x23,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
}
|
||||
infrared_brute_force_add_record(brute_force, i++, "Heat_lo");
|
||||
|
||||
button_panel_add_label(button_panel, 6, 10, FontPrimary, "AC remote");
|
||||
button_panel_add_icon(button_panel, 0, 60, &I_cool_30x51);
|
||||
button_panel_add_icon(button_panel, 34, 60, &I_heat_30x51);
|
||||
|
||||
button_panel_add_label(button_panel, 4, 10, FontPrimary, "AC remote");
|
||||
|
||||
view_set_orientation(view_stack_get_view(infrared->view_stack), ViewOrientationVertical);
|
||||
view_dispatcher_switch_to_view(infrared->view_dispatcher, InfraredViewStack);
|
||||
|
||||
@@ -18,82 +18,88 @@ void infrared_scene_universal_audio_on_enter(void* context) {
|
||||
i,
|
||||
0,
|
||||
0,
|
||||
3,
|
||||
11,
|
||||
&I_Power_25x27,
|
||||
&I_Power_hvr_25x27,
|
||||
6,
|
||||
13,
|
||||
&I_power_19x20,
|
||||
&I_power_hover_19x20,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
button_panel_add_icon(button_panel, 4, 35, &I_power_text_24x5);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Power");
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
1,
|
||||
0,
|
||||
36,
|
||||
11,
|
||||
&I_Mute_25x27,
|
||||
&I_Mute_hvr_25x27,
|
||||
39,
|
||||
13,
|
||||
&I_mute_19x20,
|
||||
&I_mute_hover_19x20,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
button_panel_add_icon(button_panel, 39, 35, &I_mute_text_19x5);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Mute");
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
0,
|
||||
1,
|
||||
3,
|
||||
41,
|
||||
&I_Play_25x27,
|
||||
&I_Play_hvr_25x27,
|
||||
6,
|
||||
42,
|
||||
&I_play_19x20,
|
||||
&I_play_hover_19x20,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
button_panel_add_icon(button_panel, 6, 64, &I_play_text_19x5);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Play");
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
1,
|
||||
1,
|
||||
36,
|
||||
41,
|
||||
&I_Pause_25x27,
|
||||
&I_Pause_hvr_25x27,
|
||||
0,
|
||||
2,
|
||||
6,
|
||||
71,
|
||||
&I_pause_19x20,
|
||||
&I_pause_hover_19x20,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
button_panel_add_icon(button_panel, 4, 93, &I_pause_text_23x5);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Pause");
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
0,
|
||||
2,
|
||||
3,
|
||||
71,
|
||||
&I_TrackPrev_25x27,
|
||||
&I_TrackPrev_hvr_25x27,
|
||||
6,
|
||||
101,
|
||||
&I_prev_19x20,
|
||||
&I_prev_hover_19x20,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
button_panel_add_icon(button_panel, 6, 123, &I_prev_text_19x5);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Prev");
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
1,
|
||||
2,
|
||||
36,
|
||||
71,
|
||||
&I_TrackNext_25x27,
|
||||
&I_TrackNext_hvr_25x27,
|
||||
3,
|
||||
39,
|
||||
101,
|
||||
&I_next_19x20,
|
||||
&I_next_hover_19x20,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
button_panel_add_icon(button_panel, 39, 123, &I_next_text_19x6);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Next");
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
0,
|
||||
3,
|
||||
3,
|
||||
101,
|
||||
&I_Vol_down_25x27,
|
||||
&I_Vol_down_hvr_25x27,
|
||||
1,
|
||||
2,
|
||||
37,
|
||||
77,
|
||||
&I_voldown_24x21,
|
||||
&I_voldown_hover_24x21,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Vol_dn");
|
||||
@@ -101,16 +107,17 @@ void infrared_scene_universal_audio_on_enter(void* context) {
|
||||
button_panel,
|
||||
i,
|
||||
1,
|
||||
3,
|
||||
36,
|
||||
101,
|
||||
&I_Vol_up_25x27,
|
||||
&I_Vol_up_hvr_25x27,
|
||||
1,
|
||||
37,
|
||||
43,
|
||||
&I_volup_24x21,
|
||||
&I_volup_hover_24x21,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Vol_up");
|
||||
|
||||
button_panel_add_label(button_panel, 1, 8, FontPrimary, "Mus. remote");
|
||||
button_panel_add_label(button_panel, 1, 10, FontPrimary, "Mus. remote");
|
||||
button_panel_add_icon(button_panel, 34, 56, &I_vol_ac_text_30x30);
|
||||
|
||||
view_set_orientation(view_stack_get_view(infrared->view_stack), ViewOrientationVertical);
|
||||
view_dispatcher_switch_to_view(infrared->view_dispatcher, InfraredViewStack);
|
||||
|
||||
@@ -11,59 +11,62 @@ void infrared_scene_universal_projector_on_enter(void* context) {
|
||||
|
||||
infrared_brute_force_set_db_filename(brute_force, EXT_PATH("infrared/assets/projector.ir"));
|
||||
|
||||
button_panel_reserve(button_panel, 2, 2);
|
||||
button_panel_reserve(button_panel, 2, 3);
|
||||
uint32_t i = 0;
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
0,
|
||||
0,
|
||||
3,
|
||||
19,
|
||||
&I_Power_25x27,
|
||||
&I_Power_hvr_25x27,
|
||||
6,
|
||||
23,
|
||||
&I_power_19x20,
|
||||
&I_power_hover_19x20,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
button_panel_add_icon(button_panel, 4, 45, &I_power_text_24x5);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Power");
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
1,
|
||||
0,
|
||||
36,
|
||||
19,
|
||||
&I_Mute_25x27,
|
||||
&I_Mute_hvr_25x27,
|
||||
39,
|
||||
23,
|
||||
&I_mute_19x20,
|
||||
&I_mute_hover_19x20,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
button_panel_add_icon(button_panel, 39, 45, &I_mute_text_19x5);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Mute");
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
0,
|
||||
1,
|
||||
3,
|
||||
66,
|
||||
&I_Vol_up_25x27,
|
||||
&I_Vol_up_hvr_25x27,
|
||||
20,
|
||||
59,
|
||||
&I_volup_24x21,
|
||||
&I_volup_hover_24x21,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Vol_up");
|
||||
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
1,
|
||||
1,
|
||||
36,
|
||||
66,
|
||||
&I_Vol_down_25x27,
|
||||
&I_Vol_down_hvr_25x27,
|
||||
0,
|
||||
2,
|
||||
20,
|
||||
93,
|
||||
&I_voldown_24x21,
|
||||
&I_voldown_hover_24x21,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Vol_dn");
|
||||
|
||||
button_panel_add_label(button_panel, 2, 11, FontPrimary, "Proj. remote");
|
||||
button_panel_add_label(button_panel, 17, 62, FontSecondary, "Volume");
|
||||
button_panel_add_label(button_panel, 3, 11, FontPrimary, "Proj. remote");
|
||||
button_panel_add_icon(button_panel, 17, 72, &I_vol_ac_text_30x30);
|
||||
|
||||
view_set_orientation(view_stack_get_view(infrared->view_stack), ViewOrientationVertical);
|
||||
view_dispatcher_switch_to_view(infrared->view_dispatcher, InfraredViewStack);
|
||||
|
||||
@@ -18,77 +18,82 @@ void infrared_scene_universal_tv_on_enter(void* context) {
|
||||
i,
|
||||
0,
|
||||
0,
|
||||
3,
|
||||
19,
|
||||
&I_Power_25x27,
|
||||
&I_Power_hvr_25x27,
|
||||
6,
|
||||
16,
|
||||
&I_power_19x20,
|
||||
&I_power_hover_19x20,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
button_panel_add_icon(button_panel, 4, 38, &I_power_text_24x5);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Power");
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
1,
|
||||
0,
|
||||
36,
|
||||
19,
|
||||
&I_Mute_25x27,
|
||||
&I_Mute_hvr_25x27,
|
||||
39,
|
||||
16,
|
||||
&I_mute_19x20,
|
||||
&I_mute_hover_19x20,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
button_panel_add_icon(button_panel, 39, 38, &I_mute_text_19x5);
|
||||
|
||||
button_panel_add_icon(button_panel, 0, 66, &I_ch_text_31x34);
|
||||
button_panel_add_icon(button_panel, 35, 66, &I_vol_tv_text_29x34);
|
||||
|
||||
infrared_brute_force_add_record(brute_force, i++, "Mute");
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
1,
|
||||
1,
|
||||
38,
|
||||
53,
|
||||
&I_volup_24x21,
|
||||
&I_volup_hover_24x21,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
|
||||
infrared_brute_force_add_record(brute_force, i++, "Vol_up");
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
0,
|
||||
1,
|
||||
3,
|
||||
66,
|
||||
&I_Vol_up_25x27,
|
||||
&I_Vol_up_hvr_25x27,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Vol_up");
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
1,
|
||||
1,
|
||||
36,
|
||||
66,
|
||||
&I_Up_25x27,
|
||||
&I_Up_hvr_25x27,
|
||||
53,
|
||||
&I_ch_up_24x21,
|
||||
&I_ch_up_hover_24x21,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Ch_next");
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
98,
|
||||
&I_Vol_down_25x27,
|
||||
&I_Vol_down_hvr_25x27,
|
||||
38,
|
||||
91,
|
||||
&I_voldown_24x21,
|
||||
&I_voldown_hover_24x21,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Vol_dn");
|
||||
button_panel_add_item(
|
||||
button_panel,
|
||||
i,
|
||||
1,
|
||||
0,
|
||||
2,
|
||||
36,
|
||||
98,
|
||||
&I_Down_25x27,
|
||||
&I_Down_hvr_25x27,
|
||||
3,
|
||||
91,
|
||||
&I_ch_down_24x21,
|
||||
&I_ch_down_hover_24x21,
|
||||
infrared_scene_universal_common_item_callback,
|
||||
context);
|
||||
infrared_brute_force_add_record(brute_force, i++, "Ch_prev");
|
||||
|
||||
button_panel_add_label(button_panel, 6, 11, FontPrimary, "TV remote");
|
||||
button_panel_add_label(button_panel, 9, 64, FontSecondary, "Vol");
|
||||
button_panel_add_label(button_panel, 43, 64, FontSecondary, "Ch");
|
||||
button_panel_add_label(button_panel, 5, 10, FontPrimary, "TV remote");
|
||||
|
||||
view_set_orientation(view_stack_get_view(infrared->view_stack), ViewOrientationVertical);
|
||||
view_dispatcher_switch_to_view(infrared->view_dispatcher, InfraredViewStack);
|
||||
|
||||
Reference in New Issue
Block a user