Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Autorepeat Last 2 Actions in a Macro

If you have a question or need help, this is the place to be.
Post Reply
kalia
Experienced User
Posts: 109
Joined: Wed Aug 12, 2009 1:10 am

Autorepeat Last 2 Actions in a Macro

Post by kalia »

I setup a macro which changes the sound card volume and then shows an OSD of the volume change. I want the entire macro to autorepeat. If I put the ''Autorepeat current macro'' after the volume change macro, then the OSD will not work (it uses eg.result). If I put the ''Autorepeat current macro'' after the OSD macro, then the volume change will not autorepeat.

Is it possible to have both macro's autorepeat? I would like both actions to autorepeat with one keypress (i.e. the OSD showing the changing volume level as the volume changes). The macro that I have setup is as follows:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1194">
    <Macro Name="Sound Mixer Ex: Increases 'Wave Out 4/5 - Wave - Volume' 4/5'" Expanded="True">
        <Event Name="Lirc.pc:volume_up" />
        <Action>
            SoundMixerEx.SetSoundFader(6, 0L, u"'Wave Out 4/5 - Wave - Volume' on 'kX Wave SB0350 10k2 [a000] 4/5'", 1.0, 1)
        </Action>
        <Action>
            EventGhost.ShowOSD(u'Room Volume: {int(eg.result)} {"|" *int(round(eg.result) * 0.5) + "-" *int(round(100-(eg.result)) * 0.5)}', u'0;-30;0;0;0;700;0;0;0;0;3;2;1;34;Arial', (255, 255, 255), (0, 0, 0), 5, (0, 0), 0, 3.0, True)
        </Action>
        <Action>
            EventGhost.AutoRepeat(0.29999999999999999, 0.01, 0.01, 3.0)
        </Action>
    </Macro>
</EventGhost>
I tried to figure it out myself by looking through some Python doc's but had no luck. I know very little about programming. Note that I do not want to use GetMasterVolume() in the OSD macro (the sound card is not the primary sound card). Can anyone help me?
stottle
Plugin Developer
Posts: 636
Joined: Sun Apr 26, 2009 10:59 pm

Re: Autorepeat Last 2 Actions in a Macro

Post by stottle »

I think you are out of luck using EG macros. My understanding is that each action in the EG tree has an id, and the AutoRepeat repeats the last (single) action. It may be possible to use something like a jump to action to go to a macro with multiple actions, or put actions in a folder and try to repeat the folder. I don't think this will work, having never tried it, but I can't say for sure.

I think you're best bet would be to write a simple plugin that performs both functions as a single action.

Good luck,
Brett
User avatar
jinxdone
Plugin Developer
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: Autorepeat Last 2 Actions in a Macro

Post by jinxdone »

I think it should work, I'm doing a volume change + showosd + autorepeat current macro, and it works as expected. I am however not using the soundmixer EX plugin.

I don't know what the problem is but it sounds like a bug to me.
Post Reply