Results 1 to 17 of 17

Thread: [2005] Trackbar to monitor DVD movie progress

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    115

    [2005] Trackbar to monitor DVD movie progress

    Well, im still working on my DVD Player.. but ive run into some problems..

    I want to implement a trackbar (any way to make the background transparent btw? Really ruins my design), and im wondering how i can make it track a DVD movie progress? I Havent used a trackbar before, and im having some troubles finding any good documentation on it. So anyone? (using the MSwebDVD component)

    Cheers!

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    115

    Re: [2005] Trackbar to monitor DVD movie progress

    Also wondering how I can use a trackbar to adjust the volume of the MSwebDVD.. :S

  3. #3
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: [2005] Trackbar to monitor DVD movie progress

    The track bar has 3 main properties that you would be interested in.
    1. Minimum: The minimum value the trackbar can be set to.
    2. Maximum: The maximum value the trackbar can be set to.
    3. Value: The actual value of the trackbar is set to.

    Use a timer to set the trackbar's value to the current position of the DVD (I am assuming the component has some sort of Position property).

    For the volume you would use the ValueChanged event of the trackbar to change the value. This compnent probably has a volume property.

    I don't believe you can set the background of the trackbar to transparent. So it would probably be best to make your own. I've seen some good examples on www.thecodeproject.com.
    Visual Studio Team Edition 2005
    GDI+ Links: Bob Powell VB.Net Heaven
    API Links: All API Pinvoke.Net
    VB6 to VB.Net: Visual Basic 6 to .NET Function Equivalents (Thread)

  4. #4
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: [2005] Trackbar to monitor DVD movie progress

    Quote Originally Posted by Untouchab1e
    Well, im still working on my DVD Player.. but ive run into some problems..

    I want to implement a trackbar (any way to make the background transparent btw? Really ruins my design), and im wondering how i can make it track a DVD movie progress? I Havent used a trackbar before, and im having some troubles finding any good documentation on it. So anyone? (using the MSwebDVD component)

    Cheers!
    Hi,

    Here's a link about trackbars, perhaps you can find some good information about your problem;

    http://www.codeproject.com/cs/miscctrl/avfader.asp

    Wkr,

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    115

    Re: [2005] Trackbar to monitor DVD movie progress

    Yeh, i know how to use the trackbar to control the volume, only problem is the way volume is measured with the mswebdvd component

    This property is read/write with a default value of 0. Full volume is 0, and 10,000 is silence; the scale is logarithmic. Multiply the desired decibel level by 100 (for example 10,000 = 100 dB).
    However, when i try to set the value to anything other then 0, i get an invalid value message, and when i try to use commas, i get a message saying its not a valid int32 value.. So im kinda stuck

  6. #6
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: [2005] Trackbar to monitor DVD movie progress

    What do you have your Min and Max set to for the trackbar? Also post your code for the ValueChanged event of the trackbar.
    Visual Studio Team Edition 2005
    GDI+ Links: Bob Powell VB.Net Heaven
    API Links: All API Pinvoke.Net
    VB6 to VB.Net: Visual Basic 6 to .NET Function Equivalents (Thread)

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    115

    Re: [2005] Trackbar to monitor DVD movie progress

    So far, I have no code for the trackbar I basically have just played around with the "Volume" property of the mswebdvd object in my form.. its set to 0 by default, which is max volume.. but if i try to set it to anything else, i either get invalid value, or not valid int32...

  8. #8
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: [2005] Trackbar to monitor DVD movie progress

    Then how are you setting the value?
    Visual Studio Team Edition 2005
    GDI+ Links: Bob Powell VB.Net Heaven
    API Links: All API Pinvoke.Net
    VB6 to VB.Net: Visual Basic 6 to .NET Function Equivalents (Thread)

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    115

    Re: [2005] Trackbar to monitor DVD movie progress

    Sorry if I have been unclear.. But i tried to set the valuechange event of the trackbar to adjust the mswebdvd.volume to something else, however, i cant seem to figure out a correct value, as its either an invalid property value, or not a valid int32 value. So, instead of setting different values on the event, and then go through the process of loading up a DVD and test it, i just try to set the property value directly into the form. the mswebdvd component has properties which I can adjust, so i try to set the volume to something other then 0.. but just get errors.. *Confused*

    Sorry if im being vague here, i just dont know how else to put it

  10. #10
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: [2005] Trackbar to monitor DVD movie progress

    I don't want you to explain what you are doing....I want to see the code you are using. You have something to the effect of this:
    VB Code:
    1. mswebdvd.Volume = something
    because you say it doesn't work. I want to see that.
    Visual Studio Team Edition 2005
    GDI+ Links: Bob Powell VB.Net Heaven
    API Links: All API Pinvoke.Net
    VB6 to VB.Net: Visual Basic 6 to .NET Function Equivalents (Thread)

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    115

    Re: [2005] Trackbar to monitor DVD movie progress

    erm.. i guess it will be something like this then

    VB Code:
    1. Private Sub TrackBar1_Valuechanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.valueChanged
    2.         DVD1.Volume = TrackBar1.Value
    3.     End Sub
    Optionally, multiply it by 100.. but doesnt work either

  12. #12

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    115

    Re: [2005] Trackbar to monitor DVD movie progress


  13. #13
    PowerPoster VBDT's Avatar
    Join Date
    Sep 2005
    Location
    CA - USA
    Posts
    2,922

    Re: [2005] Trackbar to monitor DVD movie progress

    Try to set the "Maximum" property of the TrackBar1 to 10000 and try it.

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    115

    Re: [2005] Trackbar to monitor DVD movie progress

    ************** Exception Text **************
    System.ArgumentException: One or more arguments are invalid

    at MSWEBDVDLib.IMSWebDVD.set_Volume(Int32 pVal)
    at AxMSWEBDVDLib.AxMSWebDVD.set_Volume(Int32 value)
    at UtbDVD.Form1.TrackBar1_valuechanged(Object sender, EventArgs e) in .....\Form1.vb:line 92
    at System.Windows.Forms.TrackBar.OnValueChanged(EventArgs e)
    at System.Windows.Forms.TrackBar.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    This is what happened when i set the max value to 10000

  15. #15
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: [2005] Trackbar to monitor DVD movie progress

    In some countries, the comma is used to indicate decimal (just the opposite with what we're used to here in the US)
    For example, the value 10 is written as 10.000 in US for a decimal number, but in Vietnam it would be 10,000.
    It's possible that this is the case (the documentation was written by people from other countries)

  16. #16

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    115

    Re: [2005] Trackbar to monitor DVD movie progress

    good theory, but doesnt help.. using "." doesnt work either

  17. #17
    New Member
    Join Date
    Aug 2009
    Posts
    3

    Re: [2005] Trackbar to monitor DVD movie progress

    OK Have managed to create trackbar movement but 1 problem converting it back for user to use trackbar!

    heres my code:-

    Code:
    Dim totime As Integer
    Dim curtime As Integer
    Dim parts() As String
    Dim par as Integer
     Try
                totime = 0
                curtime = 0
                par = 0
                parts = DVDPlayer.TotalTitleTime.Split(New String() {":"}, StringSplitOptions.RemoveEmptyEntries)
                For Each part In parts
                    Select Case par
                        Case 0
                            part = part * 60 * 60 * 60
                        Case 1
                            part = part * 60 * 60
                        Case 2
                            part = part * 60
                        Case 3
                    End Select
                    par += 1
                    totime += part
                Next
                par = 0
                Position.Maximum = totime
                parts = DVDPlayer.CurrentTime.Split(New String() {":"}, StringSplitOptions.RemoveEmptyEntries)
                For Each part In parts
                    Select Case par
                        Case 0
                            part = part * 60 * 60 * 60
                        Case 1
                            part = part * 60 * 60
                        Case 2
                            part = part * 60
                        Case 3
                    End Select
                    par += 1
                    curtime += part
                Next
                Position.Value = curtime
            Catch ex As Exception
    
            End Try
    so if any1 has any ideas
    feel free to help me

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