CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2001
    Location
    Arizona, USA
    Posts
    2

    Scripting for RealProducer ActiveX Control

    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...producerx.html

    and

    http://realforum.real.com/cgi-bin/re...&Board=sdkprod

    or

    http://realforum.real.com/cgi-bin/re...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.


  2. #2
    Join Date
    Apr 2001
    Location
    Arizona, USA
    Posts
    2

    Re: Scripting for RealProducer ActiveX Control

    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.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured