Limit PC Volume percentage?

If you have a question or need help, this is the place to be.

Limit PC Volume percentage?

Postby debennett2 » Mon Jan 23, 2012 3:29 pm

I am new to eventghost but use o use girder back in the day so am a little familiar with the concepts in general. I am trying too find a way to limit the percentage that the Windows 7 PC master volume is alowed to increase to (percentage-wise of course). I use my PC with studio monitor speaker...so no volume control other than from the source (the PC). It would be nice to set a certain percentage as the limit.

As an extra aded bonus, if a message could be returned if I hit that limit and try o exceed (OSD), that would be even more awesome!

Anyone have any ideas on howto accomplish such a feet?!

Thanks so much!
debennett2
 
Posts: 4
Joined: Mon Jan 23, 2012 3:23 pm

Re: Limit PC Volume percentage?

Postby Pako » Tue Jan 24, 2012 8:00 am

I think it could be very simple.
I just need to confirm a single information:
The volume control will be performed exclusively through EventGhost?

Pako
User avatar
Pako
Plugin Developer
 
Posts: 1283
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic

Re: Limit PC Volume percentage?

Postby debennett2 » Sun Jan 29, 2012 3:21 pm

Yes. The only volume input would be from Eventghost. No other volumes would be touched other than the system volume.
debennett2
 
Posts: 4
Joined: Mon Jan 23, 2012 3:23 pm

Re: Limit PC Volume percentage?

Postby Pako » Sun Jan 29, 2012 3:50 pm

If the volume control will be performed exclusively through EventGhost, then you can try the following method:
LimitedVolume.png
Copy this code an paste into EG:
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1544">
    <Folder Name="Limited volume" Expanded="True">
        <Macro Name="Set volume limit and volume step" Expanded="True">
            <Event Name="Main.OnInit" />
            <Action Name="Python Script 1">
                EventGhost.PythonScript(u'#Variable settings (percentage)\neg.globals.Vol_Limit  = 75.0\neg.globals.volumeStep =  2.0')
            </Action>
        </Macro>
        <Macro Name="Change Master Volume +" Expanded="True">
            <Event Name="Remote.Vol+" />
            <Action>
                System.ChangeMasterVolumeBy(0.0, 0)
            </Action>
            <Action Name="Python Script 2">
                EventGhost.PythonScript(u'eg.globals.volumeStep = 2.0 \nif eg.globals.Vol_Limit &gt;= (eg.result + eg.globals.volumeStep):\n    eg.plugins.System.ChangeMasterVolumeBy(eg.globals.volumeStep, 0)\n    eg.result = False\nelse:\n    if eg.globals.Vol_Limit &gt; eg.result:\n        eg.plugins.System.SetMasterVolume(eg.globals.Vol_Limit, 0)\n    eg.result = True\nprint "eg.result =",eg.result\n')
            </Action>
            <Action>
                EventGhost.NewJumpIf(XmlIdLink(85), 0, False)
            </Action>
            <Action>
                System.ChangeMasterVolumeBy(0.0, 0)
            </Action>
            <Action>
                EventGhost.ShowOSD(u'Volume: {int(round(eg.result))}%', u'0;-32;0;0;0;700;0;0;0;238;3;2;1;66;Comic Sans MS', (255, 255, 0), (0, 0, 0), 0, (5, 5), 0, 3.0, True)
            </Action>
        </Macro>
        <Macro Name="Show OSD: Volume limit exceeded !" id="85" Expanded="True">
            <Action>
                EventGhost.ShowOSD(u'Volume limit exceeded!', u'0;-32;0;0;0;700;0;0;0;238;3;2;1;66;Comic Sans MS', (255, 255, 0), (0, 0, 0), 0, (5, 5), 0, 3.0, True)
            </Action>
        </Macro>
        <Macro Name="Change Master Volume: -" Expanded="True">
            <Event Name="Remote.Vol-" />
            <Action>
                EventGhost.PythonCommand(u'eg.plugins.System.ChangeMasterVolumeBy(-eg.globals.volumeStep, 0)')
            </Action>
            <Action>
                EventGhost.ShowOSD(u'Volume: {int(round(eg.result))}%', u'0;-32;0;0;0;700;0;0;0;238;3;2;1;66;Comic Sans MS', (255, 255, 0), (0, 0, 0), 0, (5, 5), 0, 3.0, True)
            </Action>
        </Macro>
    </Folder>
</EventGhost>
Limitation can be set inside the Python Script 1.

Pako
User avatar
Pako
Plugin Developer
 
Posts: 1283
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic

Re: Limit PC Volume percentage?

Postby debennett2 » Mon Jan 30, 2012 12:34 am

Can you explain the flow of the control a litle bit? I'm not following it completely...as in how it is even a;lwing volume change since none of them say they change the volume at all. Just a smidge confused on the flow.

Thanks!
debennett2
 
Posts: 4
Joined: Mon Jan 23, 2012 3:23 pm

Re: Limit PC Volume percentage?

Postby Pako » Mon Jan 30, 2012 6:19 am

debennett2 wrote:Can you explain the flow of the control a litle bit? I'm not following it completely...as in how it is even a;lwing volume change since none of them say they change the volume at all. Just a smidge confused on the flow.
I'm sorry, but I do not understand your question.
Can you please write in other words?
Unfortunately I do not speak English.

Pako
User avatar
Pako
Plugin Developer
 
Posts: 1283
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic

Re: Limit PC Volume percentage?

Postby hotbuddha » Wed Mar 28, 2012 11:51 pm

See here for real volume events, using these events you can limit volume through eventghost no mater how the volume change is made even through the system volume or some other program etc:

http://www.eventghost.net/forum/viewtopic.php?f=10&t=3744&hilit=volume+change
hotbuddha
Experienced User
 
Posts: 98
Joined: Tue Mar 29, 2011 5:14 am


Return to General Support

Who is online

Users browsing this forum: No registered users and 3 guests