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
Get properties in a range of castmembers
Valentina Spider 1.0
BrowserController
Select It
toggle a global variable with button
Yes/No Dialog Box
Sub Rect
CD Autorun
ProMix
Shocksites.com
 

 

 

Behavior VideoCodecCheck II

Added on 11/13/2001

 

Compatibilities:
behavior D7 D8 D8_5

Required Xtras:
Buddy API

This item has not yet been rated

Author: eldemir (website)

What this script does, is perform a check for a videocodec on a Windows 95/98/ME/NT/2000 and XP.

----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------
--    VideoCodecCheck [ added DivX Codec & NT/2000/XP registry ] --
------------------------
--
-- What this script does, is perform a check for a videocodec on a Windows 95/98/ME O.S...
-- BuddyAPI Xtra is used to read a string under 'System.ini'[drivers32] section,
-- all available videocodecs are listed here.If the proper string doesn't
-- exist,the "NotPresent" string is returned...
-- Other operating systems, NT, 2000 and XP read the registry
--
--    
--     Kurt Koenig * Belgium                       8/2/2001
--    
--     Modified by Emre Eldemir                  13/11/2001
--
----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------

property pVideoCodec, pThePath

on getpropertydescriptionlist me
  -- you can add your own videocodec to this list, then you also have to add
  -- the corresponding string from the [drivers32] section of the system.ini file
  -- to the 'case' statement in the 'on beginsprite' handler.
  -- for registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32
  
  desclist = [:]
  addprop desclist,  #pVideoCodec,[ #comment: "The videocodec to check for:", #format: #string, #range: [ "DivX [TM]","Cinepak [TM]", "Indeo [TM] R3.1", "Indeo [TM] R3.2",  "Indeo [TM] R4.1",  "Video 1",  "RLE",  "msh263 [M263]",  "msh261 [M261]", "Indeo video 5.04", "Etymonix MPEG2 video codec", "Fast AV Master video codec"], #default: "" ]
  addprop desclist,  #pThePath , [ #comment:  "the path (relative to the movie) to your videocodec installer :" , #format:  #string ,  #default: "" ]
  return desclist
end getpropertydescriptionlist

on getBehaviorDescription me
  return " VideoCodecCheck"&RETURN&" Check for Windows 95/98/ME/2000/XP"&RETURN&" Use this behavior in the first frame"&RETURN&" on a sprite or in the scriptchannel"&RETURN&" This behavior uses two functions"&RETURN&" from the buddyAPI xtra. the first"&RETURN&" reads a string in the system.ini file ,"&RETURN&" the second starts your videocodec's setup-"&RETURN&" program and pauses your Director movie"&RETURN&" in the meanwhile. I only used the codec's "&RETURN&" I found on my computer in this behavior."&RETURN&" it's not to difficult to add your desired"&RETURN&" codec to the 'getpropertydescriptionlist'"&RETURN&"   Kurt Koenig * Belgium"&RETURN&RETURN& "   Modified by   Emre Eldemir"
end getBehaviorDescription

on beginsprite
  
  -- IniString is the corresponding string from system.ini
  
  case pVideoCodec.string of
    "DivX [TM]"                  : IniString = "vidc.DIVX"
    "Cinepak [TM]"               : IniString = "vidc.CVID"
    "Indeo [TM] R3.1"            : IniString = "VIDC.IV31"
    "Indeo [TM] R3.2"            : IniString = "VIDC.IV32"
    "Indeo [TM] R4.1"            : IniString = "VIDC.IV41"
    "Video 1"                    : IniString = "vidc.MSVC"
    "RLE"                        : IniString = "VIDC.MRLE"
    "msh263 [M263]"              : IniString = "vidc.M263"
    "msh261 [M261]"              : IniString = "vidc.M261"
    "Indeo video 5.04"           : IniString = "VIDC.IV50"
    "Etymonix MPEG2 video codec" : IniString = "vidc.EM2V"
    "Fast AV Master video codec" : IniString = "vidc.mjpg"
  end case
  
  if baVersion("os") = "WinNT" OR baVersion("os") = "Win2000" then
    
    -- WinNT / Win2000 / XP
    -- if the baReadRegString function returns "NotPresent" it means that
    -- the string isn't found, (the codec isn't present)
    
    CodecInstalled =  baReadRegString( "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32", IniString, "NotPresent", "HKEY_LOCAL_MACHINE" )
    
  else
    -- Win95 / Win98
    -- if the baReadIni function returns "NotPresent" it means that
    -- the string isn't found, (the codec isn't present)
    
    CodecInstalled = baReadIni( "drivers32", IniString , "NotPresent", "System.ini" )
    
  end if
  
  --  and the baRunProgram function will start your setup program...
  
  if  CodecInstalled = "NotPresent" then
    baRunProgram( pThePath , "normal", true )
  end if
  
end beginsprite

 


Contact

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

Send e-mail