Click to See Complete Forum and Search --> : Scripting for RealProducer ActiveX Control


johnt
April 23rd, 2001, 06:25 PM
Hi all,

I am writing a visual basic (or vbscript) application where I am using the Real Producer ActiveX control to encode an audio file. This works fine. However, after encoding is finished, I am wanting to move on to another function called "sendFile".

When I try to create a loop to test to see if the encoding process is completed, I receive the following error message, "object does not support this property or method."

I believe the issue has something to do with getting information out of the ActiveX control, (as opposed to sending information to the control). I have also heard the term "Callback" used in this context on the RealNetworks Developers discussion board, although I do not know the exact syntax for using callbacks.

Documentation and further info can be found at:

http://service.real.com/help/library/guides/activex/producerx.html

and

http://realforum.real.com/cgi-bin/realforum/postlist.pl?Cat=&Board=sdkprod

or

http://realforum.real.com/cgi-bin/realforum/showflat.pl?Cat=&Board=sdkprod&Number=3913&page=0&view=collapsed&sb=5

I have heard that I should test for "OnEncodingStopped" or "ProducerControl1.OnEncodingProgressChanged" and that part of the solution should look something like this:

Private Sub ProducerControl1_OnEncodingStopped()

..

End Sub

However, I am not that well versed in VBscript and if you could show me the right syntax to handle this, I'd be doing great.


Here is my code:

Sub CommandButton1_Click()

SetFileName

ProducerControl1.InputFilename = CStr(OutputFilename) + ".wav"
ProducerControl1.OutputFilename = CStr(OutputFilename) + ".rm"

ProducerControl1.title = txtTitle.text
ProducerControl1.copyright = txtCopyright.text
ProducerControl1.keywords = txtKeywords.text
ProducerControl1.description = txtDescription.text
ProducerControl1.author = txtAuthor.text
Call ProducerControl1.StartEncoding

' one way I thought I could go about it...
' Do While ProducerControl1.OnEncodingStopped() = False
' if ProducerControl1.OnEncodingStopped() = True


' another way I thought would work...
' Do While ProducerControl1.OnEncodingProgressChanged(PercentDone) > 100
' If ProducerControl1.OnEncodingProgressChanged(PercentDone) = 100 Then

' still another attempt...
Do Until ProducerControl1.OnEncodingStopped() = True

Loop

sendFile

End Sub


Thanks for your time. Any advice is most appreciated.

Sincerely,

John T.

johnt
May 1st, 2001, 01:49 AM
Thought I would follow up my own post. Someone at the RealNetworks Developer's forum sent along the following answer which cleared up all my questions:


Sub CommandButton1_Click()
'initiate the properties and stuff

'...

Call ProducerControl1.StartEncoding
End Sub

private Sub ProducerControl1_OnEncodingStopped()
sendFile

End Sub





Thanks,

John T.