|
JP1 Remotes
|
View previous topic :: View next topic |
Author |
Message |
Barf Expert
Joined: 24 Oct 2008 Posts: 1415 Location: Munich, Germany |
Posted: Wed Mar 18, 2020 9:09 am Post subject: |
|
|
Graham. thanx for the fixes. It works!!
Enclosed is a fix that makes the "Auto assign" feature slightly more creative (more things match). Patch against current SVN, i.e. revision 1675.
Code: |
Index: com/hifiremote/jp1/DeviceUpgrade.java
===================================================================
--- com/hifiremote/jp1/DeviceUpgrade.java (revision 1675)
+++ com/hifiremote/jp1/DeviceUpgrade.java (working copy)
@@ -3894,8 +3894,7 @@
Button b = buttons[ i ];
if ( assignments.getAssignment( b ) == null )
{
- if ( b.getName().equalsIgnoreCase( func.getName() )
- || b.getStandardName().equalsIgnoreCase( func.getName() ) )
+ if ( func.matchingName(b) )
{
assignments.assign( b, func );
break;
Index: com/hifiremote/jp1/Function.java
===================================================================
--- com/hifiremote/jp1/Function.java (revision 1675)
+++ com/hifiremote/jp1/Function.java (working copy)
@@ -386,4 +386,41 @@
/** Default value used in upgrade when index==null */
public static final int defaultGID = 0;
+ boolean matchingName(Button b) {
+ return matchingName(b.getName()) || matchingName(b.getStandardName());
+ }
+
+ private boolean matchingName(String candidate) {
+ String nameLower = name.toLowerCase();
+ String candidateLower = candidate.toLowerCase();
+ return name.equals(candidateLower) || canonicalize(nameLower).equals(canonicalize(candidateLower));
+ }
+
+ private static String[][] substitutes = {
+ {"key_", ""}, // Lirc
+ {"cursor", ""},
+ {"arrow", ""},
+ {"toggle", ""},
+ {"return", "exit"},
+ {"-", "down"},
+ {"\\+", "up"},
+ {">", "play"},
+ {"<", "reverse"},
+ {"\\|\\|", "pause"},
+ {"fwd", "forward"},
+ {"volume", "vol"},
+ {"channel", "ch"},
+ {"\\s+", ""}
+ };
+
+ private String canonicalize(String str) {
+ String work = str;
+ for (String[] substitute : substitutes) {
+ String from = substitute[0];
+ String to = substitute[1];
+ work = work.replaceAll(from, to);
+ }
+
+ return work;
+ }
}
|
|
|
Back to top |
|
|
mathdon Expert
Joined: 22 Jul 2008 Posts: 4523 Location: Cambridge, UK |
Posted: Wed Mar 18, 2020 12:25 pm Post subject: |
|
|
Bengt, thanks for the patch. It will be in the next upload to the SVN. _________________ Graham |
|
Back to top |
|
|
mathdon Expert
Joined: 22 Jul 2008 Posts: 4523 Location: Cambridge, UK |
Posted: Fri Mar 20, 2020 9:44 am Post subject: |
|
|
I have now posted development build 2 of RMIR v2.10 in the RMIR Development Folder on SourceForge. In addition to the RF support included in build 1 and described in an earlier post, this build provides enhanced identification of the various NEC protocols in the Learned Signals tab of RMIR and improvements to the range of executors that can be used in the automated conversion of learned signals to device upgrades. See this thread for more details. _________________ Graham |
|
Back to top |
|
|
mathdon Expert
Joined: 22 Jul 2008 Posts: 4523 Location: Cambridge, UK |
Posted: Wed Mar 25, 2020 8:21 am Post subject: |
|
|
RMIR v2.10 has now been officially released, and supersedes version 2.09 and the development builds of version 2.10. See this announcement for details. _________________ Graham |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|