Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Director and online database interaction
Drag and Droop
Check valid date
Hexadecimal numbers
Color Value
Authoring Authorware
Alphamania
Toast
Spell Check Xtra
simMode2.0 Xtra
MediaMacros Xtras Mall
 

 

 

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 --

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail