Board Guidelines and Usage

If you have macros or EventGhost Configuration Tree items you wish to share this is the place to do it.

Board Guidelines and Usage

Postby yokel22 » Thu Jul 13, 2017 12:22 pm

This board is for sharing EventGhost configuration tree's/xml. If you've setup something in EG that you think would be useful to others & you feel like sharing. This is the place to do it. EventGhost uses xml to store your tree's configuration. This can be directly copy/pasted within EventGhost. To get the xml for a macro/folder, you can right click on the item and choose copy(not copy as python).
EG_copy_paste.jpg


This will give you xml similar to this(Code is using the OSD action).
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="0.5.0-rc2">
    <Macro Name="Show OSD: text" XML_Guid="{7D288B40-45FB-4654-8FDB-8B66788FE2D5}">
        <Action XML_Guid="{7750901D-63DD-46CC-AF00-81A3837EF2FF}">
            EventGhost.ShowOSD(u'OSD text string', u'0;-35;0;0;0;700;0;0;0;0;3;2;1;34;Arial', (255, 0, 128), None, 4, (1, 2), 0, 3.0, None)
        </Action>
    </Macro>
</EventGhost>


  • Please start a New topic when posting original xml
  • If you update the xml, try to attach it to the first post. Unless of course your not the Original Contributor, then upload your xml to the same thread.
  • When pasting xml to the forum, please use the "Code" tags built into the forum. It makes copying/pasting for others much easier.
  • Provide an accurate description of what the uploaded xml does. If it requires specific plugins or hardware, please provide that info as well.
  • If your xml uses the "Jump to" or "enable/disable" actions. These
    type of actions can sometimes break their reference when copy/pasting. If you want to use these types of actions in your tree. See, Kgschlosser's post below.
  • Please, No malicious code
yokel22
Experienced User
 
Posts: 130
Joined: Thu Feb 05, 2015 5:56 pm
Location: U.S. - Kansas city

Re: Board Guidelines and Usage

Postby kgschlosser » Thu Jul 13, 2017 5:14 pm

I will comment on the jump/enable/disable types of actions. these actions are preset to use XmlIdLink in the sample below i will point out the specific fields we are looking for.

This is the xml code to disable a specific macro
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="WIP">
    <Action XML_Guid="{FC3D99DA-8A3F-490E-B490-46487E48E819}">
        EventGhost.DisableItem(XmlIdLink(16))
    </Action>
</EventGhost>



if you see anything similiar to this where it has the XmlIdLink() in it.
Code: Select all
EventGhost.DisableItem(XmlIdLink(16))


this will have to get changed manually. the number contained inside of the () is the item number. which in this case is a 16


this is the xml for the macro it disables.

Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="WIP">
    <Macro Name="Switch to mode: Zoom Player" id="16" XML_Guid="{7A180F57-C883-489B-8E06-C3A6DB68128F}">
        <Event Name="Task.Activated.zplayer" XML_Guid="{B4E9E0C8-FA0B-4A07-9316-260D11E14EE8}" />
        <Action XML_Guid="{70098B8F-F168-4B5A-AB90-291732265F82}">
            EventGhost.EnableExclusive(XmlIdLink(31))
        </Action>
    </Macro>
</EventGhost>


so we took note of the 16. so we will want to locate the item number 16.
Code: Select all
<Macro Name="Switch to mode: Zoom Player" id="16" XML_Guid="{7A180F57-C883-489B-8E06-C3A6DB68128F}">


which is here and you can see id="16" so here we want to note the XML_GUID of {7A180F57-C883-489B-8E06-C3A6DB68128F}.
and now we go back to the first XML code to that same line where the 16 is

Code: Select all
EventGhost.DisableItem(XmlIdLink(16))


you are going to want to remove the XmlIdLink(16) and replace it with eg.GUID('{7A180F57-C883-489B-8E06-C3A6DB68128F}')

take care to make sure you use single quotes and not double

make it look like so
Code: Select all
EventGhost.DisableItem(eg.GUID('{7A180F57-C883-489B-8E06-C3A6DB68128F}'))


easy cheezy

This will only work in EG 0.5 and above. and actually since this has now been brought up in a manner where it could cause an issue I am going to have to make some changes to remove having to do this. but in the meantime this should work.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Board Guidelines and Usage

Postby kgschlosser » Thu Jul 13, 2017 5:23 pm

heh, i thought i had submitted the previous post. but i didn't. but in the time it was sitting there waiting for me to press that submit button. i modified the core code to overcome this problem. I am hoping it will be included in EG 0.5-rc4 I have stripped out the creation of the XmlIdLink and changed them over to eg.GUID but all of the code that is used to read the XmlIdLink is still in place for backwards compatibility.

This is a pretty major thing. because the way eventghost is now you do not have the ability to use eg.plugins.EventGhost.Disable() or things of the like that use the XmlIdLink but also if you did happen to change the location of the specific item it would have broken it even if you were able to. So the changes that have been put into place should make it so that if you do have one of the actions in use that guid should remain in use no matter if you move the item to a different location in your tree. It is in the testing phases but will alleviate any of the above when it gets added. I am not sure when it will be but hopefully if everything is right with it in the next release candidate. we are very close to finishing this version. just tying up any loose ends with it. and this project actually was the first piece of code that i had added to the core and it needed to be finished now that we know there were no errors with it being added. HOORAY!
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Board Guidelines and Usage

Postby yokel22 » Fri Jul 14, 2017 1:04 pm

Awesome.
yokel22
Experienced User
 
Posts: 130
Joined: Thu Feb 05, 2015 5:56 pm
Location: U.S. - Kansas city

Re: Board Guidelines and Usage

Postby kgschlosser » Fri Jul 14, 2017 1:31 pm

the head of the coding dept and I are in discussion about if we should add this or not to EG 0.5 I am going to toss it out there that it would be up to everyone. so maybe a poll is in order. and because it will have the most impact on this specific topic I feel it would be best here.

@yokel22 what do you think?

I will toss the same idea at topix to see what he thinks. But you all are going to have to remember that if added it has not been run through the grinder. I feel pretty confident in it working properly. it really wasn't that big of a thing to institute. and to my knowledge the only things that rely on that XmlIdLink are a bunch of actions. and they are backwards compatible.


I have an idea that may work.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Board Guidelines and Usage

Postby yokel22 » Fri Jul 14, 2017 1:40 pm

Sounds good to me. Throw a poll up. I wasn't really trying to create more work for ya. It was just an issue I thought might pop up.
yokel22
Experienced User
 
Posts: 130
Joined: Thu Feb 05, 2015 5:56 pm
Location: U.S. - Kansas city

Re: Board Guidelines and Usage

Postby kgschlosser » Fri Jul 14, 2017 2:27 pm

NO NO it has to be done at some point. it's just that we are so close to a release and don't want more issues of bugs. but since this Forum thread exists now. it really needs to be taken care of. there is a slew of reasons for this one of them being how EG is currently versioned. and that is causing a huge problem for us.

But I have added a hidden way to turn on the GUIDs instead of the XMLIdLink. this way it can be turned on by the user. and if there is a problem then it can simply be turned off. Because of how the system functions moving between them is actually fairly simple because the rest of the mechanics will use either one. it's simply for how the information gets saved or copied.

so there are some places that are a 20x20 pixel target that you would have to click on in a specific order to be able to turn it on or off.
This gives us the means to get it in there but to also get it tested at the same time. and if there is a problem it's not something that we would have to kick out another bugfix for right away. it could wait until the next version. but if it does work successfully a simple removal of the code to turn it on or off at the next release.

ya think that would work for ya??
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Board Guidelines and Usage

Postby yokel22 » Fri Jul 14, 2017 4:27 pm

Sounds great to me. The work around you posted first would be sufficient too though.
yokel22
Experienced User
 
Posts: 130
Joined: Thu Feb 05, 2015 5:56 pm
Location: U.S. - Kansas city

Re: Board Guidelines and Usage

Postby kgschlosser » Fri Jul 14, 2017 5:56 pm

yes and no. I do not think it would work honestly with how I did the code up in the core. It generates a new GUID when the item is pasted. :? so i am thinking it wouldn't. I changed up how that bit of it works. It has to be added but possibly with using the GUID in the xml turned off. but there are changes to it that are going to make this bit work. that is the reason as to why I have not deleted the instructions. Because that bug is going to be fixed regardless. and it's a one liner from there to have it use the GUID instead of the XmlIdLink. But as you know there could be ripples from not using the XmlIdLink. I can't find reference to it anywhere else in the code except for the places where it needs to be for backwards compatibility.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA


Return to Sharing Macros/Configuration Trees

Who is online

Users browsing this forum: No registered users and 1 guest