|
-
Jul 4th, 2001, 06:39 PM
#1
Thread Starter
Fanatic Member
Volume and Position Max For Mediaplayer Control
How do i set a slider's value to a max that corresponds to the end of a movie file? Also how do i set the volume on a slider?
-
Jul 4th, 2001, 06:48 PM
#2
Try this for volume:
[code]
Private Sub Slider1_Change()
MediaPlayer1.Volume = Slider1.Value
End Sub
Private Sub Slider1_Scroll()
MediaPlayer1.Volume = Slider1.Value
End Sub
[/code[
Set max of slider to 100 (If u using a vertical slider, set to -100, and use the ABS function - "MediaPlayer1.Volume = ABS(Slider1.Value)")
Set the min of slider to 0 (If u using a vertical slider, set to 0)
-
Jul 4th, 2001, 06:52 PM
#3
Thread Starter
Fanatic Member
-
Jul 4th, 2001, 06:54 PM
#4
PowerPoster
it stops your car without locking the wheels 
Actually, it's this...
Returns a value of the same type that is passed to it specifying the absolute value of a number.
Syntax
Abs( number)
The required number argument can be any validnumeric expression. If number contains Null, Null is returned; if it is an uninitialized variable, zero is returned.
Remarks
The absolute value of a number is its unsigned magnitude. For example, ABS(-1) and ABS(1) both return 1.
Example
VB Code:
Dim MyNumber
MyNumber = Abs(50.3) ' Returns 50.3.
MyNumber = Abs(-50.3) ' Returns 50.3.
-
Jul 4th, 2001, 06:55 PM
#5
Thread Starter
Fanatic Member
So where should i be putting it? Also does nayone know anything about setting the max for a position slider because if i set to just like 100 it only goes like 2 minutes into the movie?
Last edited by stickman373; Jul 4th, 2001 at 07:01 PM.
-
Jul 4th, 2001, 07:02 PM
#6
ABS function returns the absolute value of a number.
for xample:
Number=-85
if u call the ABS function:
ABS(Number)
the return value is 85
BUT if u Number=85 and u call the ABS function, the return value will b 85 again. (and not the oposite, -85)
U need to put the ABS funstion ONLY if u using a vertical slider, just like i xplained
-
Jul 4th, 2001, 07:04 PM
#7
PowerPoster
Originally posted by stickman373
set to just like 100 it only goes like 2 minutes into the movie?
maybe it's in minutes?
-
Jul 4th, 2001, 07:06 PM
#8
Thread Starter
Fanatic Member
So this should be the code:
Code:
Private Sub Slider2_Change()
MediaPlayer1.Volume = Abs(Slider2.Value)
End Sub
Private Sub Slider2_Scroll()
MediaPlayer1.Volume = Abs(Slider2.Value)
End Sub
Because i use this and when i change the scroll it gives me a mediaplayer error?
Also Chrisjk i only got a few seconds when i had it at 100 as a max. Anyways there has to be a way to get a exact value it should be set at otherwise there is blank space at the end if i set it to a lareg number like 5000. Every movie is different!
Last edited by stickman373; Jul 4th, 2001 at 07:09 PM.
-
Jul 4th, 2001, 07:08 PM
#9
Sory man, but i'm completly sure about the code i gave u...neway, what's the error?
-
Jul 4th, 2001, 07:11 PM
#10
Sory man, but i'm completly sure about the code i gave u...neway, what's the error?
***??? nm, i'll type slower:
Sorry man, but i'm NOT completly sure about the code i gave u here, what's the error?
-
Jul 4th, 2001, 07:13 PM
#11
Thread Starter
Fanatic Member
runtime error -2247352567 (80020009)
Methosd 'Volume' of object 'IMediaplayer2' failed
that's the error whe i go to change the slider?
-
Jul 4th, 2001, 07:17 PM
#12
Do u get this error when u using the Change sub, the Scroll sub, or both??
-
Jul 4th, 2001, 07:18 PM
#13
Thread Starter
Fanatic Member
scroll sub gives the error.
-
Jul 4th, 2001, 07:22 PM
#14
Sorry, i can't figure out what's the prob....
-
Jul 4th, 2001, 07:24 PM
#15
Thread Starter
Fanatic Member
-
Jul 4th, 2001, 07:28 PM
#16
Thread Starter
Fanatic Member
does this slider control i gave you work with that code?
-
Jul 8th, 2001, 08:54 PM
#17
New Member
I have the solution for Windows 95 media player
HI I had the same problem that stickman373 with the Media Player's error.
Stiletto said to use the volume's property but I get the next error tring to set positive values, so I tried with the opposite values and found that the maximun volume is getting whit 0 and the minimum volume with the -2300 aprox.
So the range of values are between 0 (maximun volume) and -2300 (minimun volume).
But I don't remember if some of this values (negatives) cause error cause I used the instruction On Error Resume Next to provide break the application with positive values.
So here's the code
private sub Command1_Click()
On error Resume Next
MediaPlayer1.Volume=Text1.text
End Sub
I'm working with a value located in a TextBox
So you performance this code without the Instruction On error Resume next, but remember the range of values
I don't know if Stiletto have Windows 98 or any different version of Media Player provided in Windows 95 (sorry I can't check the version cause I isn't in my computer) but I hope the code work good at all version even in Media Player 7
Ok that's all.
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
|