MBS Plugin Documentation

Search:

Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchie

New in Version 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 9.0

The list of the   themes,   classes,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

LastQuickTimeErrorMBS as integer
global method, QuickTime, MBS QuickTime Plugin (QuickTime), Plugin version: 3.2, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Asks QuickTime for the last error code.
Notes:
Returns the contents of the current error value and resets the current error value to 0.
If QuickTime is not available, the function returns -1.
OpenEditableMovieHandleMBS(moviehandle as integer) as EditableMovie
global method, QuickTime, MBS QuickTime Plugin (QuickTime), Plugin version: 4.2, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Creates an editable movie object from a handle.
Notes:
Don't destroy the handle after using this function.
Returns nil on any error.
OpenMovieFromMemoryBlockMBS(mem as memoryblock, offset as integer, size as integer, name as string, mime as string) as movie
global method, QuickTime, MBS QuickTime Plugin (QuickTime), Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Opens a file from a memoryblock.
Notes:
A Movie (loaded from file or from a network) is opened as a movie.
The name (filename) and the mime code is used to tell QuickTime what Movieimporter to use. And this function will fail most of the time if there is no name and no mime type.
Name and Mime may be "".
On any error returns nil.
If the used data string is destroyed, the movie object goes invalid and using the movie after this will certainly crash your application. So store a memoryblock reference somewhere (window or module) to keep it alive.
OpenMovieFromStringMBS(data as string, name as string, mime as string) as movie
global method, QuickTime, MBS QuickTime Plugin (QuickTime), Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Opens a file from a memoryblock.
Notes:
A Movie (loaded from file or from a network) is opened as a movie.
The name (filename) and the mime code is used to tell QuickTime what Movieimporter to use. And this function will fail most of the time if there is no name and no mime type.
Name and Mime may be "".
On any error returns nil.
If the used data string is destroyed, the movie object goes invalid and using the movie after this will certainly crash your application. So store a string reference somewhere (window or module) to keep it alive.

Some examples using this method:

OpenMovieHandleMBS(moviehandle as integer) as movie
global method, QuickTime, MBS QuickTime Plugin (QuickTime), Plugin version: 4.2, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Creates a movie object from a handle.
Notes:
Don't destroy the handle after using this function.
Returns nil on any error.
OpenMovieURLMBS(url as string, flags as integer) as movie
global method, QuickTime, MBS QuickTime Plugin (QuickTime), Plugin version: 5.4, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Opens a movie from an URL.
Example:
dim m as movie
dim n,i as integer

const newMovieAsyncOK=256 // we are trying async loading
const url="rtsp://a2047.v1411b.c1411.g.vq.akamaistream.net/5/2047/1411/2_h264_650/1a1a1ae454c430950065de4cbb2f94c226950c7ae655b61a48a91475e243acda3dac194879adde0f/oct_event_2_h264_650.mov"
// Apple Special Event Stream URL from 12th October 2005. Change if needed.

i=ticks
for n=1 to 10
m=OpenMovieURLMBS(url, newMovieAsyncOK)
m=nil
next
i=ticks-i
MsgBox str(i)

i=ticks
for n=1 to 10
m=OpenURLMovie(url)
m=nil
next
i=ticks-i
MsgBox str(i)

Notes:
URL must be ASCII or UTF-8 encoded.

Possible flags value:

newMovieActive= 1
newMovieDontResolveDataRefs= 2
newMovieDontAskUnresolvedDataRefs= 4
newMovieDontAutoAlternates= 8
newMovieDontUpdateForeBackPointers= 16
newMovieDontAutoUpdateClock= 32
newMovieAsyncOK= 256
newMovieIdleImportOK= 1024
newMovieDontInteractWithUser= 2048

Default is to use newMovieActive and newMovieDontResolveDataRefs.

Please check LoadStateMBS for the status of the movie if you used newMovieAsyncOK.

Returns nil on any error or on Linux.
OpenMovieWithCustomQTDataHandlerMBS(file as folderitem, subtype as string, Mode as integer, Key as String) as movie
global method, QuickTime, MBS QuickTime Plugin (QTDataHandler), Plugin version: 5.1, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Opens a movie file using the custom data handler.
Notes:
Specify the subtype code you used for the RegisterCustomQTDataHandlerMBS method.
The mask is used to xor the movie data when loading for decodeing it. Make the mask longer than any identifyable information in your movie. Minimum should be the header length of your QuickTime movie.
(Older plugin versions had an integer value there. Just pass chrb(oldmask) as the new mask.)
Returns nil on any error.

The idea behind this function is to have QuickTime movies shipping with your applications which are not useable for the user without your application.
There can be legal problems if people redistribute for example the music files of your game, so you may just xor the movie files, name them something with .dat and load them using this function.

The average user will not be able to hack this, but if you tell someone that you use this plugin for the encryption, they may be able to get the mask back if they know what text is inside the movie (e.g. Copyright information) and write a decoder to calc mask parts from known text found. I could write this ;-)

Add Mode parameter in the version 8.7.
Mode can be 0 for no encoding and 1 for xor encoding.

Some examples using this method:

QTRegisterAccessKeyMBS(accessKeyType as string, flags as integer, accessKey as string) as integer
global method, QuickTime, MBS QuickTime Plugin (QuickTime), Plugin version: 6.0, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Registers an access key.
Notes:
accessKeyType: The access key type of the key to be registered.
flags: Flags that specify the operation of this function. To register a system access key, set the kAccessKeySystemFlag flag (see below). To register an application access key, set this parameter to 0.
accessKey: A handle to the key to be registered.

Returns an error code (-1 if function is missing).

Most access keys are binary strings.

const kAccessKeySystemFlag=1

accessKeyType and accessKey must have the needed text encoding.
QTUnregisterAccessKeyMBS(accessKeyType as string, flags as integer, accessKey as string) as integer
global method, QuickTime, MBS QuickTime Plugin (QuickTime), Plugin version: 6.0, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Removes a previously registered access key.
Notes:
accessKeyType: The access key type of the key to be removed.
flags: Flags (see below) that specify the operation of this function. To remove a system access key, set the kAccessKeySystemFlag flag. To remove an application access key, set this parameter to 0.
accessKey: The key to be removed.

Returns an error code (-1 if function is missing).

Most access keys are binary strings.

const kAccessKeySystemFlag=1

accessKeyType and accessKey must have the needed text encoding.
QuickTimeGetUsersConnectionSpeedMBS as integer
global method, QuickTime, MBS QuickTime Plugin (QuickTime), Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Returns a code for the speed of the line.
Example:
msgbox str(QuickTimeGetUsersConnectionSpeedMBS)

Notes:
You get these values:

140014k Modem
280028k Modem
5600ISDN
11200Dual ISDN
25600DSL with 256 KBit/s
38400DSL with 384 KBit/s
51200DSL with 512 KBit/s
76800DSL with 768 KBit/s
100000DSL with 1 MBit/s
150000T1
&h7FFFFFFFInfiniteRate

if no rate is set the function returns 2800 for an 28k Modem.
QuickTimePollMBS
global method, QuickTime, MBS QuickTime Plugin (QuickTime), Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Gives CPU time to QuickTime to update movies.
Notes:
Some people cry about missing performance on playing movies in RB. This function may help there. if you use threads it may be good to call it from time to time.

Suggested timer period setting is 50 ms.

Some examples using this method:

QuickTimePresentMBS as boolean
global method, Quicktime, MBS QuickTime Plugin (QTImporter), Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Returns true if QuickTime is present.

Some examples using this method:

QuickTimeSetUsersConnectionSpeedMBS(newspeed as integer) as boolean
global method, QuickTime, MBS QuickTime Plugin (QuickTime), Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Sets the connection speed.
Notes:
See QuickTimeGetUsersConnectionSpeed for the rate codes.
This function returns true if it is successfull.
RegisterCustomQTDataHandlerMBS(subtype as string, manufacturer as string)
global method, QuickTime, MBS QuickTime Plugin (QTDataHandler), Plugin version: 3.2, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Registers a custom QuickTime data handler.
Notes:
The plugin defines a new QuickTime data handler with a low encryption.
You define the subtype and the manufacturer key which you want to have the data handler to be found in the QTComponent class.
Apple reserved low letter type and manufacturer codes like "appl".

Some examples using this method:

The items on this page are in the following plugins: MBS QuickTime Plugin.