Skip to content

Commit 61bbee6

Browse files
committed
update xremote
1 parent 83d7bdd commit 61bbee6

14 files changed

+359
-55
lines changed

non_catalog_apps/xremote/README.md

+55-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<p align="center">Advanced IR Remote App for Flipper Device</p>
2+
3+
<p align="center">
4+
Version 1.3 - <a href="https://github.com/kala13x/flipper-xremote/blob/main/docs/changelog.md">Changelog</a>
5+
</p>
6+
27
<p align="center">
3-
<img src="https://github.com/kala13x/flipper-xremote/blob/main/screens/flipperzero.png" alt="XRemote">
8+
<img src="https://github.com/kala13x/flipper-xremote/blob/main/.flipcorg/banner.png" alt="XRemote">
49
</p>
510

611
## Idea
@@ -31,6 +36,7 @@ The application is compatible with standard `.ir` files. However, to ensure func
3136
Button name | Description
3237
------------|-------------------
3338
`Power` | Power
39+
`Eject` | Eject
3440
`Setup` | Setup/Settings
3541
`Input` | Input/Source
3642
`Menu` | Menu
@@ -57,12 +63,52 @@ Button name | Description
5763
`Play` | Play
5864
`Stop` | Stop
5965

66+
## Alternative button names
67+
In addition to the predefined names, `XRemote` uses alternative button names to make it as easy as possible to interact with different types of IR dumps. That means if a button with the appropriate name is not found in the file, the application will try to find the same button with alternative names. Ensure this feature is enabled in the application settings before you use it.
68+
69+
The application stores and reads alternate names from the following file:
70+
```
71+
SD Card/apps_data/flipper_xremote/alt_names.txt
72+
```
73+
74+
If the `Alt-Names` option is enabled in the config and the file does not exist, it will be created automatically with default values during the application's startup. You can edit, add, or remove any button or alternate name values from this file. Button names must either have only the first uppercase or be entirely lowercase. As for alternate names, they are case-insensitive. The button can have one or several comma-separated alternate names.
75+
76+
This is the default `alt_names.txt` file:
77+
78+
```
79+
Filetype: XRemote Alt-Names
80+
Version: 1
81+
#
82+
Power: shutdown,off,on,standby
83+
Setup: settings,config,cfg
84+
Input: source,select
85+
Menu: osd,gui
86+
List: guide
87+
Info: display
88+
Mode: aspect,format
89+
Back: return,exit
90+
Ok: enter,select
91+
Up: uparrow
92+
Down: downarrow
93+
Left: leftarrow
94+
Right: rightarrow
95+
Mute: silence,silent,unmute
96+
Vol_up: vol+,volume+,volup,+
97+
Vol_dn: vol-,volume-,voldown,-
98+
Ch_next: ch+,channel+,chup
99+
Ch_prev: ch-,channel-,chdown
100+
Next: next,skip,ffwd
101+
Prev: prev,back,rewind,rew
102+
Fast_fo: fastfwd,fastforward,ff
103+
Fast_ba: fastback,fastrewind,fb
104+
Play_pa: playpause,play,pause
105+
```
60106

61107
## Installation options
62108

63-
1. Install the latest stable version directly from the [application catalog](https://lab.flipper.net/apps/flipper_xremote).
64-
65-
2. Manually install using `.fap` file:
109+
1. Install the latest stable version directly from the official [application catalog](https://lab.flipper.net/apps/flipper_xremote).
110+
2. Install on any firmware from the community driven application catalog [FlipC](https://flipc.org/kala13x/flipper-xremote).
111+
3. Manually install using `.fap` file:
66112
- Download the `.fap` file from the [Releases](https://github.com/kala13x/flipper-xremote/releases) section of this repository.
67113
- Write the `.fap` file to an SD card using [qFlipper](https://docs.flipper.net/qflipper) or any your preferred SD card writer.
68114

@@ -73,8 +119,10 @@ Button name | Description
73119
- Use deploy script from this repository to build and run the application on the device:
74120

75121
```bash
76-
./deploy.sh --fw=/path/to/the/firmware
122+
./deploy.sh --fw=/path/to/the/firmware -b -l
77123
```
124+
125+
Do not use `-l` (link) option of you are building the project directly from the `applications_user` directory of the firmware.
78126
2. If you don't have the firmware or the Linux please refer to the [official documentation](https://github.com/flipperdevices/flipperzero-firmware/blob/dev/documentation/AppsOnSDCard.md) for build instructions.
79127
80128
## Progress
@@ -89,6 +137,7 @@ Button name | Description
89137
- [x] Player buttons page
90138
- [x] Custom buttons page
91139
- [x] Edit custom layout
140+
- [x] Alternative button names
92141
- [ ] Add or remove button
93142
- [ ] All buttons page
94143
- [x] Application settings
@@ -98,6 +147,7 @@ Button name | Description
98147
- [x] Vertical/horizontal views
99148
- [x] IR command repeat count
100149
- [x] Exit button behavior
150+
- [x] Enable/disable alt names
101151
102152
## Screens
103153

non_catalog_apps/xremote/application.fam

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ App(
66
requires=["gui", "dialogs", "infrared"],
77
stack_size=3 * 1024,
88
order=1,
9-
fap_version="1.1",
9+
fap_version="1.3",
1010
fap_category="Infrared",
1111
fap_icon_assets="assets",
1212
fap_icon_assets_symbol="xc",

non_catalog_apps/xremote/docs/README.md

+37
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,40 @@ Play_pa | Play/Pause
4848
Pause | Pause
4949
Play | Play
5050
Stop | Stop
51+
52+
## Alternative button names
53+
54+
In addition to the predefined names, XRemote uses alternative button names to make it as easy as possible to interact with different types of IR dumps. That means if a button with the appropriate name is not found in the file, the application will try to find the same button with alternative names. Ensure this feature is enabled in the application settings before you use it.
55+
56+
The application stores and reads alternate names from the following file:
57+
SD_Card/apps_data/flipper_xremote/alt_names.txt
58+
59+
If the Alt-Names option is enabled in the config and the file does not exist, it will be created automatically with default values during the application's startup. You can edit, add, or remove any button or alternate name values from this file. Button names must either have only the first uppercase or be entirely lowercase. As for alternate names, they are case-insensitive. The button can have one or several comma-separated alternate names.
60+
61+
## Default alternative names
62+
63+
Button name | Alternative names
64+
------------|-------------------
65+
Power | shutdown,off,on,standby
66+
Setup | settings,config,cfg
67+
Input | source,select
68+
Menu | osd,gui
69+
List | guide
70+
Info | display
71+
Mode | aspect,format
72+
Back | return,exit
73+
Ok | enter,select
74+
Up | uparrow
75+
Down | downarrow
76+
Left | leftarrow
77+
Right | rightarrow
78+
Mute | silence,silent,unmute
79+
Vol_up | vol+,volume+,volup,+
80+
Vol_dn | vol-,volume-,voldown,-
81+
Ch_next | ch+,channel+,chup
82+
Ch_prev | ch-,channel-,chdown
83+
Next | next,skip,ffwd
84+
Prev | prev,back,rewind,rew
85+
Fast_fo | fastfwd,fastforward,ff
86+
Fast_ba | fastback,fastrewind,fb
87+
Play_pa | playpause,play,pause

non_catalog_apps/xremote/docs/changelog.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
## v1.3
2+
3+
Alternative names
4+
5+
- Implemented alternative names functionality
6+
- Implemented case-insensitive button search
7+
- Added Eject button support
8+
- Fixed bugs and refactored code
9+
10+
## v1.2
11+
12+
Bug fixing and performance improvements
13+
14+
- Fixed build issues with new Flipper Zero SDK
15+
- Fixed several crashes and refactored code
16+
- Improved button search performance
17+
118
## v1.1
219

320
Custom layout and bug fixing

non_catalog_apps/xremote/infrared/infrared_remote.c

+7-4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <stddef.h>
1717
#include <stdlib.h>
1818
#include <m-array.h>
19+
#include <string.h>
20+
#include <ctype.h>
1921
#include <toolbox/path.h>
2022
#include <storage/storage.h>
2123
#include <core/common_defines.h>
@@ -89,7 +91,9 @@ InfraredRemoteButton* infrared_remote_get_button(InfraredRemote* remote, size_t
8991
bool infrared_remote_find_button_by_name(InfraredRemote* remote, const char* name, size_t* index) {
9092
for(size_t i = 0; i < InfraredButtonArray_size(remote->buttons); i++) {
9193
InfraredRemoteButton* button = *InfraredButtonArray_get(remote->buttons, i);
92-
if(!strcmp(infrared_remote_button_get_name(button), name)) {
94+
FuriString* furi_name = infrared_remote_button_get_furi_name(button);
95+
96+
if(button && !furi_string_cmpi_str(furi_name, name)) {
9397
*index = i;
9498
return true;
9599
}
@@ -101,9 +105,8 @@ InfraredRemoteButton*
101105
infrared_remote_get_button_by_name(InfraredRemote* remote, const char* name) {
102106
for(size_t i = 0; i < InfraredButtonArray_size(remote->buttons); i++) {
103107
InfraredRemoteButton* button = *InfraredButtonArray_get(remote->buttons, i);
104-
if(!strcmp(infrared_remote_button_get_name(button), name)) {
105-
return button;
106-
}
108+
FuriString* furi_name = infrared_remote_button_get_furi_name(button);
109+
if(button && !furi_string_cmpi_str(furi_name, name)) return button;
107110
}
108111
return NULL;
109112
}

non_catalog_apps/xremote/infrared/infrared_remote_button.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
https://github.com/DarkFlippers/unleashed-firmware
44
55
The original project is licensed under the GNU GPLv3
6-
No modifications were made to this file.
6+
7+
Modifications made:
8+
- Added function infrared_remote_button_get_furi_name()
79
*/
810

911
#include "infrared_remote_button.h"
@@ -36,6 +38,10 @@ const char* infrared_remote_button_get_name(InfraredRemoteButton* button) {
3638
return furi_string_get_cstr(button->name);
3739
}
3840

41+
FuriString* infrared_remote_button_get_furi_name(InfraredRemoteButton* button) {
42+
return button->name;
43+
}
44+
3945
void infrared_remote_button_set_signal(InfraredRemoteButton* button, InfraredSignal* signal) {
4046
infrared_signal_set_signal(button->signal, signal);
4147
}

non_catalog_apps/xremote/infrared/infrared_remote_button.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
https://github.com/DarkFlippers/unleashed-firmware
44
55
The original project is licensed under the GNU GPLv3
6-
No modifications were made to this file.
6+
7+
Modifications made:
8+
- Added function infrared_remote_button_get_furi_name()
79
*/
810

911
#pragma once
@@ -17,6 +19,7 @@ void infrared_remote_button_free(InfraredRemoteButton* button);
1719

1820
void infrared_remote_button_set_name(InfraredRemoteButton* button, const char* name);
1921
const char* infrared_remote_button_get_name(InfraredRemoteButton* button);
22+
FuriString* infrared_remote_button_get_furi_name(InfraredRemoteButton* button);
2023

2124
void infrared_remote_button_set_signal(InfraredRemoteButton* button, InfraredSignal* signal);
2225
InfraredSignal* infrared_remote_button_get_signal(InfraredRemoteButton* button);

0 commit comments

Comments
 (0)