View Single Post
Copernicus's Avatar
Posts: 1,986 | Thanked: 7,698 times | Joined on Dec 2010 @ Dayton, Ohio
#1147
Macros! I've finally started to clean up Pierogi's macro mechanism. I've realized that there were two major design issues holding me back; first, I was too caught up in the notion of making macros into "user-defined buttons". Ultimately, macros work by doing exactly what the user does -- selecting and sending commands to the IR port. You just can't have the user and a macro controlling Pierogi at the same time. So now, while a macro is running, a modal dialog box will pop up, showing what the macro is doing, but also blocking the UI; if the user closes the dialog box, he or she will regain access to the UI, but the macro will be aborted. Very simple, very clean.

The other issue was attempting to create, edit, and save macros completely from within Pierogi itself. This allowed me to hide some of the internal ugliness from the user, but ultimately it's just way, way too complex of a UI for me to maintain. So, I have instead moved to storing macros in an XML file. I admit that writing and loading these files will be a burden on the user, but it can't be as much of a burden as trying to negotiate the previous macro editor UI.

Ok, so Pierogi 1.1.32, with a first attempt at this new macro system, is now working its way up into extras-devel.

To get the bad news out of the way: if you've been using the existing macro mechanism, this is going to break your macros. I apologize, but the existing system was just such a mess, that I didn't think I could easily find some way to transition to the new system.

The good news is that the new system should be working just as well as the old one. (I've more or less just repackaged the existing macro functionality.) So, you should be able to do as much with the new system as with the old one.

As mentioned, macros are now defined in an XML file. I haven't put a whole lot of effort into defining the file format yet (I don't even have a DTD for it), but I've got a little bit of documentation set up describing how to create this XML file.

The previous "User" panel has been renamed "Macros", and has a new button allowing you to load an XML file. Along with the previous six user-defined buttons, it also has a combo box allowing you to access any macro from the file.

Another side-effect of this new macro system is that it allows you to access the entire set of keys defined within Pierogi (which you can now find listed in the above-mentioned documentation). This means that, for example, you now have access to some of the commands that I've been too nervous to place into the main user interface. So, if you want to access the service menu of a TV (which I have defined for some LG, Samsung, and Sanyo keysets), the following XML file will do the trick for you:

Code:
<? xml version=1.0 ?>

<macropack name="Factory Controls">

 <macro name="Service Menu" button="1">
  <send key="Service Menu"/>
 </macro>

</macropack>
The nice thing about using XML is that it should be much easier for me to extend the macro functionality. Timers, loops, conditionals, pretty much anything should be fair game...

As always, please be prepared for a lot of bugs. (Especially with the entirely new XML parser! Also, the keyboard controls are currently broken, but I think they were broken before...)

P.S., new Pierogi website!
 

The Following 15 Users Say Thank You to Copernicus For This Useful Post: