|
|
|
VideoCodecCheck
Added on 8/14/2001
|
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, who don't have the codeclist in a system.ini file can not use this script.(in NT for example you have to read it in the registry), for the most
part, the users of your cd will have one of the above operating systems...
-- so, if you do your authoring on another O.S, you can only test this script on one of the above O.S's
Download PC Source Download Mac Source
----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------
-- VideoCodecCheck --
------------------------
--
-- 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, who don't have the codeclist in a system.ini file can not
-- use this script.(in NT for example you have to read it in the registry), for the most
-- part, the users of your cd will have one of the above operating systems...
-- so, if you do your authoring on another O.S, you can only test this script on one
-- of the above O.S's
--
--
-- Kurt Koenig * Belgium 8/2/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.
desclist = [:]
addprop desclist, #pVideoCodec,[ #comment: "The videocodec to check for:", #format: #string, #range: [ "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 and ME"&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"
end getBehaviorDescription
on beginsprite
-- IniString is the corresponding string from system.ini
case pVideoCodec.string of
"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
CodecInstalled = baReadIni( "drivers32", IniString , "NotPresent", "System.ini" )
-- if the baReadIni function returns "NotPresent" it means that
-- the string isn't found, (the codec isn't present) and the baRunProgram
-- function will start your setupprogram...
if CodecInstalled = "NotPresent" then
baRunProgram( pThePath , "normal", true )
end if
end beginsprite
|
|