Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Play Sound of Member
BehaviorChecker
Soundoftheweb Network
Ripple Button-Alphamania
FindAll
ProMusicLoops
Pass handler to next Sprite
ROLLOVER FADES
Password entry box
Tools for fulltext searching in Director and Authorware
 

 

 

Behavior Set Volume - Buddy API

Added on 6/8/2000

 

Compatibilities:
behavior D7 D8 PC

Required Xtras:
Buddy API

This item has not yet been rated

Author: KumarK

Sets system volume

---- written for Director 8 ---
---- Kumar.K kumark@icode.com ----

-- custom properties --
property mastervolume,Wavevolume,CdVolume,MidiVolume,synth,whereto,

------ Get Behavior Description List ------
on getPropertyDescriptionList me
  set description = [:]
  addProp description, #mastervolume, [#format:#Integer, #comment: "Set the Master Volume Level To :", #range:[#Min:1,#Max:100],#default:50]
  addProp description, #Wavevolume, [#format:#Integer, #comment: "Set the Wave Volume Level To :", #range:[#Min:1,#Max:100],#default:50]
  addProp description, #CdVolume, [#format:#Integer, #comment: "Set the CD Volume Level To :", #range:[#Min:1,#Max:100],#default:50]
  addProp description, #MidiVolume, [#format:#Integer, #comment: "Set the MIDI Volume Level To :", #range:[#Min:1,#Max:100],#default:50]
  addProp description, #synth, [#format:#Integer, #comment: "Set the internal FM synthesizer Volume Level To :", #range:[#Min:1,#Max:100],#default:50]  
  if the currentspritenum = 0 then
    addProp description, #WhereTo, [#comment: "Where To Attach ?" ,#format:#String,
    #range:["On EnterFrame","On ExitFrame"],#default:"On EnterFrame"]
  else
    addProp description, #WhereTo, [#comment: "Where To Attach ?" ,#format:#String,
    #range:["On MouseUp","On MouseDown","On MouseEnter","On MouseLeave"],#default:"On MouseUp"]    
  end if    
  return description
end getPropertyDescriptionList
------ Get Behavior Description List ------

-- Get Behavior description --
on getBehaviorDescription
  return "This Behavior sets the volume level of the sound card for wave files and audio CD. " & RETURN & RETURN &
  "This Behavior requires Buddy API Xtra to work, so please ensure You Have Buddy API Xtra." & RETURN & RETURN &
  "Parameters" & RETURN &
  "* Sound Option and Level." & RETURN &
  "* Where to attach this Script"
end
-- Get Behavior description --

-- Events --
on EnterFrame me
  if WhereTo = "On EnterFrame" then
    SetVolumeLevel
  end if
end EnterFrame

on ExitFrame me
  if WhereTo = "On EnterFrame" then
    SetVolumeLevel
  end if
end ExitFrame

on MouseUp
  if WhereTo = "On MouseUp" then
    SetVolumeLevel
  end if
end MouseUp

on MouseDown
  if WhereTo = "On MouseDown" then
    SetVolumeLevel
  end if
end MouseDown

on MouseEnter
  if WhereTo = "On MouseEnter" then
    SetVolumeLevel
  end if
end MouseEnter

on MouseLeave
  if WhereTo = "On MouseLeave" then
    SetVolumeLevel
  end if
end MouseLeave
------ Events ------

-- Set Volume Level --
on SetVolumeLevel
  set muteoff = baSetVolume( "master mute" ,  0 )
  set muteoff = baSetVolume( "wave mute" ,  0 )
  set muteoff = baSetVolume( "cd mute" ,  0 )
  set muteoff = baSetVolume( "synth mute" ,  0 )
  set masterlevel =baSetVolume( "master" ,  mastervolume )
  set WaveLevel =baSetVolume( "Wave" ,  Wavevolume )
  set cdlevel =baSetVolume( "CD" ,  CdVolume )
  set midilevel =baSetVolume( "midi" ,  MidiVolume )  
  set syntlecel =baSetVolume( "synth" ,  synth )  
end
-- Set Volume Level --

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail