Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Perhaps I sound like an idiot but... (REALbasic)

Perhaps I sound like an idiot but... (REALbasic)
Thread Tools
Junior Member
Join Date: Jan 2001
Location: Northbrook, IL, USA
Status: Offline
Reply With Quote
Jul 28, 2001, 02:27 AM
 
I'm trying to put a volume bar in my mp3 player in realbasic it's using quicktime to decode and i was wondering if there was a way i'm missing of using a slider control to change the volume on the movieplayer control. Is this Possible?

[ 07-28-2001: Message edited by: coolman145 ]
_ ___________________ _
http://www.wallsnetwork.com
_ ___________________ _
G4 533DP
iBook366 Keylime
     
Dedicated MacNNer
Join Date: Jan 2001
Location: Computer Error: Unknown
Status: Offline
Reply With Quote
Jul 28, 2001, 07:16 PM
 
It is possible with a toolbox call, "SetMovieVolume". I'm working on trying to figure out how to pass the appropriate volume to the call, however(It wants a decimal in an integer - weird). I'll post here when I figure it out.
"...Because the people who are crazy enough to think they can change the world,
are the ones who do."
-To the Crazy Ones

     
Dedicated MacNNer
Join Date: Jan 2001
Location: Computer Error: Unknown
Status: Offline
Reply With Quote
Jul 30, 2001, 08:48 AM
 
The folks on the REALbasic mailing lists are very helpful!

Create a method:
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
Sub SetMoviePlayerVolume(Player As MoviePlayer, Volume As Integer)
<font color = brown>//See <A HREF=<font color = red>"http://developer.apple.com/techpubs/quicktime/qtdevdocs/INMAC/QTC/imMovieContComp.a.htm"</font> TARGET=_blank>http://developer.apple.com/techpubs/quicktime/qtdevdocs/INMAC/QTC/imMovieContComp.a.htm</A> </font>
<font color = brown>//The Volume should range from <font color = blue>0</font> to <font color = blue>255</font></font>
<font color = brown>//Thanks to <font color = red>"Mike D."</font> &lt;md@xochi.com&gt;</font>

#<font color = green>if</font> TargetMacOS Then
Declare Function MCDoAction Lib <font color = red>"QuickTimeLib"</font> (mc as integer, action as Short, params as Integer) as Integer

Dim HandleToPlayer,Junk As Integer
Const kMCActionSetVolume=<font color = blue>14</font>

If Player=Nil Then
Return
End If

HandleToPlayer=Player.QTMovieController

If HandleToPlayer&lt;&gt;<font color = blue>0</font> Then
Junk=MCDoAction(HandleToPlayer,kMCActionSetVolume, Volume)
End If
#EndIf
End Sub

</font>[/code]
Pass the movieplayer that you want to set the volume of, and the volume you want to set it at (a value between 0 and 255).

Hope that helps.

[ 07-30-2001: Message edited by: graphiteman ]
"...Because the people who are crazy enough to think they can change the world,
are the ones who do."
-To the Crazy Ones

     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:09 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2