MBS Xojo Developer Conference and Training
Join us from 11th to 14th September 2013 in Koblenz.
Join us from 11th to 14th September 2013 in Koblenz.
Platforms to show: All Mac Windows Linux Cross-Platform
LastQuickTimeErrorMBS as integer
global method, QuickTime, MBS Real Studio QuickTime Plugin (QuickTime),
Plugin version: 3.2, Mac: Yes, Win: Yes, Linux: No, Console & Web: No, 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.
global method, QuickTime, MBS Real Studio QuickTime Plugin (QuickTime),
Plugin version: 3.2, Mac: Yes, Win: Yes, Linux: No, Console & Web: No, 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.
OpenMovieFromMemoryBlockMBS(mem as memoryblock, offset as integer, size as integer, name as string, mime as string) as movie
global method, QuickTime, MBS Real Studio QuickTime Plugin (QuickTime),
Mac: Yes, Win: Yes, Linux: No, Console & Web: No, 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.
global method, QuickTime, MBS Real Studio QuickTime Plugin (QuickTime),
Mac: Yes, Win: Yes, Linux: No, Console & Web: No, 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 Real Studio QuickTime Plugin (QuickTime),
Mac: Yes, Win: Yes, Linux: No, Console & Web: No, Feedback.
Function: Opens a file from a memoryblock.
Example:
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.
On Windows you need to set movieplayer to QuickTime before you assign this movie so Real Studio runtime uses QuickTime for playback. Trying Windows Media Player will fail.
global method, QuickTime, MBS Real Studio QuickTime Plugin (QuickTime),
Mac: Yes, Win: Yes, Linux: No, Console & Web: No, Feedback.
Function: Opens a file from a memoryblock.
Example:
dim data as string // global. For example in the window
dim f as FolderItem = GetFolderItem("test.mov")
dim b as BinaryStream = f.OpenAsBinaryFile(False)
if b=nil then
MsgBox "Failed to open movie file"
Return
end if
data = b.Read(b.Length) // data must exists as long as movie exists!
if lenb(data)=0 then
MsgBox "Failed to read movie file"
Return
end if
dim m as movie = OpenMovieFromStringMBS(data,"test.mov","")
if m=nil then
MsgBox "Failed to load movie"
Return
end if
MoviePlayer1.Movie=m
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.
On Windows you need to set movieplayer to QuickTime before you assign this movie so Real Studio runtime uses QuickTime for playback. Trying Windows Media Player will fail.
Some examples using this method:
OpenMovieHandleMBS(moviehandle as integer) as movie
global method, QuickTime, MBS Real Studio QuickTime Plugin (QuickTime),
Plugin version: 4.2, Mac: Yes, Win: Yes, Linux: No, Console & Web: No, Feedback.
Function: Creates a movie object from a handle.
Notes:
Don't destroy the handle after using this function.
Returns nil on any error.
global method, QuickTime, MBS Real Studio QuickTime Plugin (QuickTime),
Plugin version: 4.2, Mac: Yes, Win: Yes, Linux: No, Console & Web: No, 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 Real Studio QuickTime Plugin (QuickTime),
Plugin version: 5.4, Mac: Yes, Win: Yes, Linux: No, Console & Web: No, Feedback.
Function: Opens a movie from an URL.
Example:
Notes:
URL must be ASCII or UTF-8 encoded.
Possible flags value:
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.
global method, QuickTime, MBS Real Studio QuickTime Plugin (QuickTime),
Plugin version: 5.4, Mac: Yes, Win: Yes, Linux: No, Console & Web: No, 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)
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 Memoryblock) as movie
global method, QuickTime, MBS Real Studio QuickTime Plugin (QTDataHandler),
Plugin version: 5.1, Mac: Yes, Win: Yes, Linux: No, Console & Web: No, 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 ;-)
Mode can be 0 for no encoding and 1 for xor encoding. Mode 2 or can be used for AES.
Key length must be 16, 24 or 32 for AES.
Added new mode 5 for XOR2 which is XOR with position. See StringXOR2MBS.
global method, QuickTime, MBS Real Studio QuickTime Plugin (QTDataHandler),
Plugin version: 5.1, Mac: Yes, Win: Yes, Linux: No, Console & Web: No, 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 ;-)
Mode can be 0 for no encoding and 1 for xor encoding. Mode 2 or can be used for AES.
Key length must be 16, 24 or 32 for AES.
Added new mode 5 for XOR2 which is XOR with position. See StringXOR2MBS.
Some examples using this method:
OpenURLMovieMBS(url as string) as movie
global method, QuickTime, MBS Real Studio QuickTime Plugin (QuickTime),
Plugin version: 9.5, Mac: Yes, Win: Yes, Linux: No, Console & Web: No, Feedback.
Function: Opens a movie with the given URL.
Example:
Notes:
The URL must be in plain ASCII text encoding.
Returns nil on any error.
global method, QuickTime, MBS Real Studio QuickTime Plugin (QuickTime),
Plugin version: 9.5, Mac: Yes, Win: Yes, Linux: No, Console & Web: No, Feedback.
Function: Opens a movie with the given URL.
Example:
dim m as movie
dim s as string = "http://www.monkeybreadsoftware.de/realbasic/movies/AppleScript-iPhone.m4v"
m=OpenURLMovieMBS(s)
MoviePlayer1.movie=m
The URL must be in plain ASCII text encoding.
Returns nil on any error.
QTRegisterAccessKeyMBS(accessKeyType as string, flags as integer, accessKey as string) as integer
global method, QuickTime, MBS Real Studio QuickTime Plugin (QuickTime),
Plugin version: 6.0, Mac: Yes, Win: Yes, Linux: No, Console & Web: No, 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.
global method, QuickTime, MBS Real Studio QuickTime Plugin (QuickTime),
Plugin version: 6.0, Mac: Yes, Win: Yes, Linux: No, Console & Web: No, 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 Real Studio QuickTime Plugin (QuickTime),
Plugin version: 6.0, Mac: Yes, Win: Yes, Linux: No, Console & Web: No, 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.
global method, QuickTime, MBS Real Studio QuickTime Plugin (QuickTime),
Plugin version: 6.0, Mac: Yes, Win: Yes, Linux: No, Console & Web: No, 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 Real Studio QuickTime Plugin (QuickTime),
Mac: Yes, Win: Yes, Linux: No, Console & Web: No, Feedback.
Function: Returns a code for the speed of the line.
Example:
Notes:
You get these values:
if no rate is set the function returns 2800 for an 28k Modem.
global method, QuickTime, MBS Real Studio QuickTime Plugin (QuickTime),
Mac: Yes, Win: Yes, Linux: No, Console & Web: No, Feedback.
Function: Returns a code for the speed of the line.
Example:
msgbox str(QuickTimeGetUsersConnectionSpeedMBS)
You get these values:
| 1400 | 14k Modem |
| 2800 | 28k Modem |
| 5600 | ISDN |
| 11200 | Dual ISDN |
| 25600 | DSL with 256 KBit/s |
| 38400 | DSL with 384 KBit/s |
| 51200 | DSL with 512 KBit/s |
| 76800 | DSL with 768 KBit/s |
| 100000 | DSL with 1 MBit/s |
| 150000 | T1 |
| &h7FFFFFFF | InfiniteRate |
if no rate is set the function returns 2800 for an 28k Modem.
QuickTimePollMBS
global method, QuickTime, MBS Real Studio QuickTime Plugin (QuickTime),
Mac: Yes, Win: Yes, Linux: No, Console & Web: No, 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.
Calls internally MovieTasks(NULL).
global method, QuickTime, MBS Real Studio QuickTime Plugin (QuickTime),
Mac: Yes, Win: Yes, Linux: No, Console & Web: No, 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.
Calls internally MovieTasks(NULL).
Some examples using this method:
QuickTimePresentMBS as boolean
global method, Quicktime, MBS Real Studio QuickTime Plugin (QTImporter),
Mac: Yes, Win: Yes, Linux: No, Console & Web: Yes, Feedback.
Function: Returns true if QuickTime is present.
global method, Quicktime, MBS Real Studio QuickTime Plugin (QTImporter),
Mac: Yes, Win: Yes, Linux: No, Console & Web: Yes, Feedback.
Function: Returns true if QuickTime is present.
Some examples using this method:
QuickTimeSetUsersConnectionSpeedMBS(newspeed as integer) as boolean
global method, QuickTime, MBS Real Studio QuickTime Plugin (QuickTime),
Mac: Yes, Win: Yes, Linux: No, Console & Web: No, Feedback.
Function: Sets the connection speed.
Notes:
See QuickTimeGetUsersConnectionSpeed for the rate codes.
This function returns true if it is successfull.
global method, QuickTime, MBS Real Studio QuickTime Plugin (QuickTime),
Mac: Yes, Win: Yes, Linux: No, Console & Web: No, 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 Real Studio QuickTime Plugin (QTDataHandler),
Plugin version: 3.2, Mac: Yes, Win: Yes, Linux: No, Console & Web: No, 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".
global method, QuickTime, MBS Real Studio QuickTime Plugin (QTDataHandler),
Plugin version: 3.2, Mac: Yes, Win: Yes, Linux: No, Console & Web: No, 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 Real Studio QuickTime Plugin.
Links
MBS Real Studio Plugins