|
-
Oct 4th, 2006, 03:10 PM
#1
Thread Starter
Lively Member
[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!
-
Oct 5th, 2006, 01:42 PM
#2
Thread Starter
Lively Member
Re: [2005] Trackbar to monitor DVD movie progress
Also wondering how I can use a trackbar to adjust the volume of the MSwebDVD.. :S
-
Oct 5th, 2006, 02:30 PM
#3
Frenzied Member
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.
-
Oct 5th, 2006, 02:35 PM
#4
Re: [2005] Trackbar to monitor DVD movie progress
 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
-
Oct 5th, 2006, 04:10 PM
#5
Thread Starter
Lively Member
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
-
Oct 5th, 2006, 04:25 PM
#6
Frenzied Member
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.
-
Oct 5th, 2006, 04:30 PM
#7
Thread Starter
Lively Member
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...
-
Oct 5th, 2006, 04:32 PM
#8
Frenzied Member
Re: [2005] Trackbar to monitor DVD movie progress
Then how are you setting the value?
-
Oct 5th, 2006, 04:36 PM
#9
Thread Starter
Lively Member
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
-
Oct 5th, 2006, 04:40 PM
#10
Frenzied Member
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:
mswebdvd.Volume = something
because you say it doesn't work. I want to see that.
-
Oct 5th, 2006, 04:43 PM
#11
Thread Starter
Lively Member
Re: [2005] Trackbar to monitor DVD movie progress
erm.. i guess it will be something like this then
VB Code:
Private Sub TrackBar1_Valuechanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.valueChanged
DVD1.Volume = TrackBar1.Value
End Sub
Optionally, multiply it by 100.. but doesnt work either
-
Oct 5th, 2006, 04:46 PM
#12
Thread Starter
Lively Member
Re: [2005] Trackbar to monitor DVD movie progress
-
Oct 5th, 2006, 05:22 PM
#13
Re: [2005] Trackbar to monitor DVD movie progress
Try to set the "Maximum" property of the TrackBar1 to 10000 and try it.
-
Oct 5th, 2006, 05:31 PM
#14
Thread Starter
Lively Member
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
-
Oct 6th, 2006, 07:42 AM
#15
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)
-
Oct 8th, 2006, 09:42 AM
#16
Thread Starter
Lively Member
Re: [2005] Trackbar to monitor DVD movie progress
good theory, but doesnt help.. using "." doesnt work either
-
Aug 2nd, 2009, 04:10 AM
#17
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|