Jump to content

Query volume/sound DVBViewer Pro


majstang

Recommended Posts

  • 3 months later...

Three questions:

 

1) When DVBViewer is started with volume already at 0% the MsgBox retrieves nothing. Why? However If DVBV is started with volume at 4-100% it retrieves the accurate value.

 

2) How to switch between COM interfaces on two simultainously running DVBViewers without any restart...possible? If im connected to COM on lets say DVBV1 im forced to close DVBV1 and restart DVBV2 to get to the COM interface on DVBV2.

In the DVBViewer COM Interface documentation it says this about the Quit command:

Closes the DVBViewer. This function is useful if you start the DVBViewer via COM, cause it won't close down if you release the instance. This behaviour is wanted. But how the heck do you release the instance and reconnect to the other open DVBV through its COM interface? To succeed with this i should need the following:

 

3) How to retrive which DVBV instance im COM-interface-connected on? Need to know that to be abled to connect to the other instance.

Handle: OleVariant should be the one to use i think...

 

 

Set iDVBViewer = GetObject(, "DVBViewerServer.DVBViewer")
MyVolume = iDVBViewer.Datamanager.Value("#Volume")
MsgBox(MyVolume)

Edited by majstang
Link to comment
...possible? If im connected to COM on lets say DVBV1 im forced to close DVBV1 and restart DVBV2 to get to the COM interface on DVBV2.

Impossible. There can only be one COM insterface be registered. Switching (reregistering the com interface) would never work if you don't work as an administrator / elevated.

Link to comment
Impossible. There can only be one COM insterface be registered. Switching (reregistering the com interface) would never work if you don't work as an administrator / elevated.

Well, since im using XP it would be possible to register/unregister the COM interface with elevated privilegies. Dont know what DLL the COM uses though and where to find it.

And then using REGSVR32 /u on it with a script. However when this is done how to REGSVR32 the COM specific for DVBV2 if two instances already is running? I have the PID for each instance.

EDIT: Hmm...now when im thinking of it this should be possible doing in Autohotkey....which is the preferrable scripting method for me. Musch easier compared to using VBScript :) I still need the name for the DLL though.

 

Regarding

1) When DVBViewer is started with volume already at 0% the MsgBox retrieves nothing. Why? However If DVBV is started with volume at 4-100% it retrieves the accurate value.

 

It is a little bit strange the retrieved value is blank, cuz the last set volume level should have been saved when closing DVBV and when restarting it the COM should have retrived that saved value, in this case 0%. This is no biggie though, cuz i will be abled to write a failsafe script regardless of the blank value (as long as i will get accurate volume values from 4-100%). Im only curious to know the reason for this anomalie.

Edited by majstang
Link to comment
I still need the name for the DLL though.

There is no dll. DVBViewer.exe itself is a comserver and it will register the comserver on start, if possible.

 

Such a scenario has not been tested and is not supported in any way by us...

Link to comment
There is no dll. DVBViewer.exe itself is a comserver and it will register the comserver on start, if possible.

 

Such a scenario has not been tested and is not supported in any way by us...

Oh, that was bad luck! I will of cuz be able to write my script anyway, restarting my instances in the right sequence to be able to connect to the right DVBV. Then it will be failsafe...but not as smoooooooth as the other possibility had been :)

This is all for a volumescript automating volumelevels for each instance separate and for different volumelevels during the day (wakeup-alarm, morningnews, evenings and commersials as well)

 

So Lars, do you have any ideas on why regarding my first question?

Edited by majstang
Link to comment

Huh, reading reading and more reading, but havent found the answer yet, so its time to ask the power guys of DVBViewer ;)

I can so far only find one way to increase/decrease volume and it is through; iDVBViewer.SendCommand "26" and "27"

This command increases/decreases the volume by 4% each step/commandsend, but i honestly did expect there was a way to set the volume to exact values with one command with this scripting method. Would be smooth to be abled to do this cuz my script will be working with certain conditions depending on the retrieved volume level. I will of cuz be abled to work with the available method, but it will make things much more akward and not very slick (or fun).

Lets say i wanna set 50% volume level if the current level status is 0% and wanna do it in one step and not sending 13 iDVBViewer.SendCommand "26" to get somewhere near the exact vol level i wanna achieve.

 

Possible?

Edited by majstang
Link to comment
Impossible. There can only be one COM insterface be registered. Switching (reregistering the com interface) would never work if you don't work as an administrator / elevated.

I spoke too soon in the Suggestions & Ideas thread, there is still a missing peace in the puzzle...switching bewteen COM on two running instances (without any close/restart of DVBViewer). I did some research regarding unregister/register ActiveX Servers in EXE files and following the instructions im now abled to do both UnregServer and/or RegServer simply by having separate shortcuts for DVBViewer.exe and DVBViewer2.exe with these parameters that i can fire away from a script if i choose to. This does register and/or unregister the COM interface on the instance it is active on.

All well so far, BUT if unregister server on DVBV1 and executing shortcut DVBViewer2.exe /RegServer it does not become active on DVBV2. It simply REregisters the server it was last active on, namley DVBV1. There must be something in the registry controlling this. I have too little knowledge in the construction of ActiveX Servers and how they interact with the registry, but could i do something to make it work do you think?

 

I really did thought it might work to simply Unreg/Reg the servers on my two instances EXE files to be abled to switch freely between COM, but it was not that simple obviously. Maybe it also has something to do with the thing you talked about before, it will only work as an administrator/elevated, but i am that on this system.

Edited by majstang
Link to comment
Possible?

In the Com-Doku there is a property called "Volume"

property Volume: Double;

Sets the volume (0..1)

Set iDVBViewer = GetObject(, "DVBViewerServer.DVBViewer")
iDVBViewer.Volume("1")

Should set the Volume to 100% (imho).

Link to comment
In the Com-Doku there is a property called "Volume"

 

Set iDVBViewer = GetObject(, "DVBViewerServer.DVBViewer")
iDVBViewer.Volume("1")

Should set the Volume to 100% (imho).

Hi nuts!

 

Thank you very much for your help. Lars MQ helped me out with this in an another thread earlier. His way was this:

iDVBViewer.Volume = 0.50 (sets volume to 50%)

and it works like a charm.

 

iDVBViewer.Volume("1")

I did played around with your version before asking around about this and i didnt get it to work. I still cant get it to work.

I get a Wscript error trying to execute that line.

 

Im as you see new to this DVBViewer language and the thing i didnt grasp was you could simply skip the function (Sendcommand) and use the property (Volume) right away. I was trying

iDVBViewer. Sendcommand.Volume("x")

and that didnt work. Using = was an another thing i didnt know and The Help File didnt comment on this option either. BUT of cuz i should have know cuz = is widley used in any scripting language there is.

 

I have to ask you about my latest post before this one if you have any thoughts on some solution? Lars havent commented on it yet and hopefully he will do that later on.

Edited by majstang
Link to comment

As I understand Lars means that its not possible.

My english is not very good so I maybe not unterstand it correctly - you are runnig 2 instances and want to access the second one via com?

Link to comment

No, he wants run only one instance at a time, as far as I understood.

 

I already gave a possible solution. But it won't work for users without administrator (elevated) rights. Just start the DVBViewer.exe you want to run, it will take care of registering itself. But you're on your own there, this is highly unsupported, there is no guaranty this works without problems and has no ill sideeffects!

Link to comment

@ nuts

Yes, you are right i want to run 2 instances simultainously and be abled to flip freely back and forward using UnregServer and RegServer (on running exe's) to be abled to command my instances through COM on the fly without any close and restart of instances. Issue with this is when starting DVBV1.exe it registers the server as it should (automatic).

1) The first started exe (DVBV in this case) registers the COM interface. DVBV2 is started right after DVBV1.

2) This locks DVBV2.exe somehow and i cant reach it later on.

3) but im abled to UnregServer the first started exe (DVBV1)

4) Im no longer abled to connect to any COM interface (not DVBV1 nor DVBV2) which is expected

5) Trying to RegServer on DVBV2.exe gets DVBV1 COM registered again, cuz DVBV2 seem to be locked

6) My goal was to connect to DVBV2 COM, but something is hindering me from doing that. Only way to reach it is to close DVBV1 and restart DVBV2.

 

@Lars

Yes, i understand this being unsupported, but i will not miss an opportunity to nose around as much as i can to learn what is doable or not. I will try to figure this one out on my own. Thanks for your help guys...both of you :bye:

Edited by majstang
Link to comment

Either I'm talking to myself or I'm missing something here. :bye: The way I described doesn't work for you?

Sorry now I got it.

 

i want to run 2 instances simultainously

This is simply impossible. both COM Servers have the same GUID. COM doesn't allow this.

Link to comment
Either I'm talking to myself or I'm missing something here. :lol: The way I described doesn't work for you?

Sorry now I got it.

 

 

This is simply impossible. both COM Servers have the same GUID. COM doesn't allow this.

Yes, i did noticed that when checking the DVBViewerServer.DVBViewer Clsid in registry. It was the same when running DVBV1 and DVBV2 alone. The thing i must do now is to find a way to change the GUID for one of my instances so i can separate them. I have read somewhere this is possible at least with other types of servers.

Microsoft has even a tool for changing the GUID (guidgen), but how to apply this for DVBViewer is the question. Well, it is now back to Google to do some major research.

Many Thanks for your help Lars :bye:

Edited by majstang
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...