Coder Social home page Coder Social logo

bengtmartensson / remotelocator Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 0.0 2.63 MB

This program operates on data bases of IR remotes. It either generates a data base of download information, or, using a previously generated such file, allows for easy download of therein registered remotes.

License: GNU General Public License v3.0

Java 2.29% Shell 0.21% XSLT 1.55% Makefile 0.08% HTML 95.87%
ir infrared girr lirc jp1 remotes

remotelocator's Introduction

RemoteLocator

This program helps the user to locate and download infrared remotes. It operates on data bases of IR remotes. It either generates am XML index of download information, or, using a previously generated such file, allows for easy download and conversion of therein registered remotes. It can handle collections of remotes in the following formats:

  • IRDB format: This collection was until recently available at the server irdb.ik, which is now defunct. The IRDB format is a very simple CSV format ("the IT version of the stone axe"), containing command name, protocol and the device and subdevice parameters, but no meta information. Instead, information on the manufacturer and the device class are gleaned from the file path.
  • The Lirc collection of remotes, which are collected in the Sourceforge project lirc-remotes. This format also contains no meta information. The manufacturer information is gleaned from the file path; however there are no information on device class, so all the Lirc remotes have device class "unknown" in the generated list.
  • Girr is a very versatile format for IR remotes. It is the native format for IrScrutinizer, and also supported by main program RMIR of the JP1 project. Meta information, including manufacturer and device class, is contained in the Girr file. There is a small collection (GirrLib), which is more of a proof-of-concept than a sizeable collection of remotes.
  • The JP1 project has a large collection of "device upgrades". These are summarized in an Excel file. His list also contains meta information such as manufacturer and device class. This can be read into the present program, and used to browse the therein contained remotes (or rather, "device upgrades"). These can, with some manual work be translated to Girr files.

Basically, there are three use case for the program:

  1. Generaton of the index file, remotelocator.xml, and
  2. Using said index file (possibly as an URL rather than a local file) for extracting information of its content,
  3. Using the index file and information from 2. to downloading or browse a contained remote.

Generation of the index file

Typically, only an "administrator" invokes this use case. This is achieved by calling the main-routine of the RemoteDatabase class. From (a subset of) the four sources, a local file is generated. The --out option is (effectively) mandatory, and must point to a local (preferably non-existing) write-able file. Using the options --girrdirr, --lircdir, --irdbdirare used to point to a locally clone of the respective GitHub/Sourceforge repositories (to the extent desired). Use the option--jp1fileto point to an OpenOffice format XML export of the JP1 master list. (One such export is contained in the present project as src/test/jp1/jp1-master-1.17.fods`.) If Lirc is not involved, this takes a few seconds. If Lirc is included, this is slightly constlier (half a minute CPU time, 1 GB memory) since all the commands in the (almost 3000) Lirc files have to be rendered and decoded.

Global file

It is planned to make a current version of the complete file available for download, for example as http://harctoolbox.org/downloads/remotelocator.xml.

HTML version of the remotelocator file

There exists an XSLT transformation src/main/xslt/remotelocator2html.xsl that turnes the XML file into a HTML file containing clickable a-elements for download/browsing. It is planned to make a current version of the HTML file available for download, for example as http://harctoolbox.org/downloads/remotelocator.html.

Gathering information from the file

For this use case, the argument of --config must be a correct, readable file or URL. By using the options --manufacturer, --deviceclass (possibly with an argument of ?) information on contained manufacturers, their device classes, and the contained remotes can be queried.

Downloading/browsing/converting remotes

For this use case, the argument of --config must be a correct, readable file or URL. By using the options --manufacturer, --deviceclass and the name-less last argument, denoting the remote name, the corresponing remote can be fetched. With the option --browse the remote is browse in the way the user's desktop is configured. The option --url just prints the URL where the remote can be downloaded. Finally, the options --Girr, --pronto and --csv prints the (possibly converted) remote in Girr, Pronto Hex or IRDB CSV-format respectivelly.

Integration in IrScrutinizer

This program is integrated in IrScrutinizer version 2.3.1 and later, giving it a GUI. I can be accessed as the pane Import -> RemoteLocator. By "Select me to load" a global remotelocator.xml file is downloaded, once per session.

Appendix. All program options:

./remotelocator --help
Usage: RemoteLocator [options] Arguments to the program
  Options:
    -b, --browse
      Browse the remote, do not directly download it.
      Default: false
  * -c, --config
      Name or URL of config file, to be read or written.
    --csv
      Produce output in IRDB CVS format.
      Default: false
    -d, --deviceclass
      Device class, "?" for list.
    -g, --girr
      Produce output in Girr format.
      Default: false
    -h, --help, -?
      Display help message.
      Default: false
    -m, --manufacturer
      Manufacturer, "?" for list.
    -o, --output
      File name to write to, "-" for stdout.
      Default: -
    -p, --prontohex
      Produce output in Pronto Hex format.
      Default: false
    -u, --url
      Do not get the remote, just print its url.
      Default: false
    -v, --version
      Display version information.
      Default: false

remotelocator's People

Contributors

bengtmartensson avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

remotelocator's Issues

irdb csv parsing does not handle fields with embedded commas

https://github.com/probonopd/irdb/blob/master/codes/Denon/Receiver/2%2C-1.csv#L87-L88

These two lines are where parsing will fail on account of function names containing commas.

My PR handled this with some special casing I did not particularly like. Given that this issue is only likely to arise from commas in function names, splitting from the right with a limit would be an easy fix if we had rsplit().

This is not particularly urgent given it only affects two codes for one remote in all of the irdb.

irdb character set

/**
* There is to my knowledge not an official character set for IRDB;
* This is "be liberal in what you accept".
*/
public static final String IRDB_CHARSET = "WINDOWS-1252"; // ?

I would go with UTF-8 (less liberal in what is valid) or ISO-8859-1 over WINDOWS-1252. At present, file(1) detects all irdb content as ASCII text, so this makes no difference now and is really about predicting the future. I wonder what @probonopd says.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.