Jump to content

COM interface: Add set exact volume level?


majstang

Recommended Posts

Im missing a function in iDVBViewer that makes it possible to set exact volume level with one commandline. There is one for mute, but when setting volumelevel through COM you are forced to step up the volume by 4% each iDVBViewer.SendCommand "26". Would be great to be abled to be more free and precise when using COM, especially when dealing with a major control like volume. As it is today there is almost no point in controlling volume through COM, cuz of this restraint. More specialized directcontrol of DVBViewer volume with COM is wanted and not something that is exactly like the ordinary volumecontrol in main window (mouse or keystrokes). Adding a exact volume function would also make scripting easier, when incoporating volume calls.

 

Hope you agree!?

Is it possible we could get such a function?

Edited by majstang
Link to comment

Oh, so it is possible then ;)

I wrote here because i asked around about this in script lounge and since nobody answered me i thought it was not possible. Have experimented a lot using the volume property, but cant get it to work. I get error when i tried to use it with the sendcommand function. The other functions in iDVBViewer seem not to apply to the thing i wanna do.

This is the line i tried to execute:

iDVBViewer.SendCommand.Volume(24)

and

iDVBViewer.SendCommand.Volume "24"

and also did try variants of it. Nothing worked.

Edited by majstang
Link to comment

Blasted again...my lack of basic skills of the DVBViewer language keeps on showing :bye:

Could you bear with me one more time Lars and explain why i only are abled to set two vol levels with:

iDVBViewer.Volume = xx

I get 100% even if set to 50%. If set to 0% it works though, but if set to everyting in between 1-99 maxes out volume to 100%. Cant understand why?

Link to comment

I'm sorry I messed up. You set the value between 0 and 1 as a float. 0.5 = 50%, 1 = 100% etc...

 

 

BUT: One look into the help file would have shown you this :bye: (well me also :lol: )

 

property Volume: Double;

Sets the volume (0..1)

Link to comment

Ah, that explains it! Yes, i have read the help file so many times and had the answer right under my nose all this time, but still wasnt abled to interpret a simple (0..1) :bye:

SUPERDUPER, that was the last bit of the puzzle. Now i have everything i need to make my script alright.

I thank thou King Lars :lol:

Link to comment
  • 5 years later...

The volume property of the IDVBViewer Interface is not good enough for you? wink.gif

 

let me hook up this old thread:

 

any idea how to implement that in eventghost?

 

i'd like to use a slider in terremote (android) together with eventghost and the dvbviewerr plugin, but i can't figure out the way to implement setting the absolute volume in DVBViewer with it.

 

I get

19:32:14 TCP.DVBViewer.volume.set ['192.168.1.200', u'0.6']

as a result from clicking the slider. but what do i have to do next?

 

greets, michael

Link to comment

I have no idea what you are trying do, what should happen or even which EG Plugins you are using.

Please try to explain better.

 

ok, the more brief version:

 

1) samsung note II and samsung galaxy tab 4, each with eventghost and terremote installed

2) pc with windows 7, DVBViewer and eventghost (network receiver, network sender and DVBViewer plugins) installed

 

on 1) i created a remote control (working) with a lot of buttons. those control the DVBViewer at 2) quite well. right now i'm starting the finetuning. for example: the "volume up" and "volume down" buttons are working. but now i want to add a slider (kind of progressbar, trackbar, ...) to control the volume.

 

I can set the action to send "DVBViewer.volume.set" as an action and send the slider value (0.00 .. 1.00) as the payload of that action. thus, the output

19:32:14 TCP.DVBViewer.volume.set ['192.168.1.200', u'0.6']

is received by the eventghost at the pc/win7 side.

 

clicking the "volume up" button on the remote results in

23:43:40 TCP.DVBViewer.volume.up ['192.168.1.200']

received by the pc and

23:43:40 DVBViewer.Action:26

the volume is getting up by 4% through the eventghost DVBViewer plugin that sends the action to the com interface of DVBViewer.

 

unfortunately i don't know which value of volume is set within DVBViewer. and i don't know how to set the value at, let's say, 60%, no matter at which the value is at that very moment.

 

i think the event "8251" sent by DVBViewer after volume change might give me some feedback, perhaps about the volume level. but i'm struggling at the first step: setting the volume. The second step, synchronizing the slider with the actual volume level, will be thought of after that...

 

greets, michael

Link to comment

I think you have to create a python script [,,,] for this.

 

;-) well, i think i deserve this asking for "any idea"... ;-)

 

frankly, i already got to this point... the DVBViewer plugin is a huge python script itself. unfortunately i have no experience with python.

 

so i thought it might be possible to

1) modify the DVBViewer plugin python script to extend it by that event or

2) use the "python script" command to react on the event triggered by the slider. (see screenshot)

 

eventghost_python.png

 

but _what_ exactly_ has to be done to apply 1) or 2) now? i think i have to build a reference to the idvbviewer object first. but how?

 

michael

Link to comment

 

but _what_ exactly_ has to be done to apply 1) or 2) now?

 

first try, almost happy:

 

from win32com.client.gencache import EnsureDispatch

DVBViewer = EnsureDispatch("DVBViewerServer.DVBViewer")

DVBViewer.Volume = 0.50

 

(and you definitely have to use the capital "V" in "Volume"...)

 

that sets the volume to 50%, but i'm not able to get the payload correctly yet:

 

an example from http://www.terremote.com/tutorials/example_get_volume_information:

eg.plugins.NetworkSender.plugin.Send("System.Volume", [str(eg.event.payload)])

 

but

DVBViewer.Volume = [str(eg.event.payload)]

results in

21:10:23 com_error: (-2147352571, 'Typkonflikt.', None, 1)

 

and

DVBViewer.Volume = [eg.event.payload]

does

21:11:26 com_error: (-2147352571, 'Typkonflikt.', None, 1)

exactly the same.

 

but there is a payload:

21:15:28 TCP.DVBViewer.volume.set ['192.168.1.200', u'0.45']

 

so what is the correct syntax for it?

 

michael

Link to comment

so what is the correct syntax for it?

 

ah, ok, forget it... figured it out:

 

from win32com.client.gencache import EnsureDispatch

DVBViewer = EnsureDispatch("DVBViewerServer.DVBViewer")

DVBViewer.Volume = float(eg.event.payload[1])

 

michael

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...