mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-16 04:24:45 -07:00
[FL-3456] Allow for larger Infrared remotes (#3164)
* Do not load all signals at once (Draft) * Minor cleanup * Refactor remote renaming * Improve function signatures * Rename infrared_remote functions * Optimise signal loading * Implement adding signals to remote * Add read_name() method * Deprecate a function * Partially implement deleting signals (draft) * Use m-array instead of m-list for signal name directory * Use plain C strings instead of furi_string * Implement deleting signals * Implement deleting signals via generalised callback * Implement renaming signals * Rename some types * Some more renaming * Remove unused type * Implement inserting signals (internal use) * Improve InfraredMoveView * Send an event to move a signal * Remove unused type * Implement moving signals * Implement creating new remotes with one signal * Un-deprecate and rename a function * Add InfraredRemote API docs * Add InfraredSignal API docs * Better error messages * Show progress pop-up when moving buttons in a remote * Copy labels to the InfraredMoveView to avoid pointer invalidation * Improve file selection scene * Show progress pop-up when renaming buttons in a remote * Refactor a scene * Show progress when deleting a button from remote * Use a random name for temp files * Add docs to infrared_brute_force.h * Rename Infrared type to InfraredApp * Add docs to infrared_app_i.h Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include "../infrared_i.h"
|
||||
#include "../infrared_app_i.h"
|
||||
|
||||
typedef enum {
|
||||
ButtonIndexPlus = -2,
|
||||
@@ -8,7 +8,7 @@ typedef enum {
|
||||
|
||||
static void
|
||||
infrared_scene_remote_button_menu_callback(void* context, int32_t index, InputType type) {
|
||||
Infrared* infrared = context;
|
||||
InfraredApp* infrared = context;
|
||||
|
||||
uint16_t custom_type;
|
||||
if(type == InputTypePress) {
|
||||
@@ -26,17 +26,15 @@ static void
|
||||
}
|
||||
|
||||
void infrared_scene_remote_on_enter(void* context) {
|
||||
Infrared* infrared = context;
|
||||
InfraredApp* infrared = context;
|
||||
InfraredRemote* remote = infrared->remote;
|
||||
ButtonMenu* button_menu = infrared->button_menu;
|
||||
SceneManager* scene_manager = infrared->scene_manager;
|
||||
|
||||
size_t button_count = infrared_remote_get_button_count(remote);
|
||||
for(size_t i = 0; i < button_count; ++i) {
|
||||
InfraredRemoteButton* button = infrared_remote_get_button(remote, i);
|
||||
for(size_t i = 0; i < infrared_remote_get_signal_count(remote); ++i) {
|
||||
button_menu_add_item(
|
||||
button_menu,
|
||||
infrared_remote_button_get_name(button),
|
||||
infrared_remote_get_signal_name(remote, i),
|
||||
i,
|
||||
infrared_scene_remote_button_menu_callback,
|
||||
ButtonMenuItemTypeCommon,
|
||||
@@ -68,7 +66,7 @@ void infrared_scene_remote_on_enter(void* context) {
|
||||
}
|
||||
|
||||
bool infrared_scene_remote_on_event(void* context, SceneManagerEvent event) {
|
||||
Infrared* infrared = context;
|
||||
InfraredApp* infrared = context;
|
||||
SceneManager* scene_manager = infrared->scene_manager;
|
||||
const bool is_transmitter_idle = !infrared->app_state.is_transmitting;
|
||||
bool consumed = false;
|
||||
@@ -116,6 +114,6 @@ bool infrared_scene_remote_on_event(void* context, SceneManagerEvent event) {
|
||||
}
|
||||
|
||||
void infrared_scene_remote_on_exit(void* context) {
|
||||
Infrared* infrared = context;
|
||||
InfraredApp* infrared = context;
|
||||
button_menu_reset(infrared->button_menu);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user