Data from Images
The classes JPEGImporterMBS, GMImageMBS and GM16ImageMBS got the new property ExifThumbnail. This property extracts an embedded thumbnail in EXIF data and return it as a string. With this string we can use the method getData method of the Picture class or our JPEG functions to decompress and display the thumbnail.
The class JPEGImporterMBS got the ExifOrientation property that queries the orientation from the Exif data. We receive the orientation as an integer and you can use this number to determine and adjust the alignment if necessary.
The classes GMImageMBS and GM16ImageMBS include the new shared method FontMap. We can use this method to find out which fonts are currently available. The method can also help us to debug and find out the reason why a font is not loaded. The function returns a string with a XML structure.
Timecode for Audio (LTC)
If audio streams need to be synchronized, you usually use time codes embedded in the audio. With the LTC library, we now provide classes that can decode and encode time code for audio streams
Port audio Stream
In the plugin we have classes to use the open source PortAudio library in Xojo. To make it easier to use, we added the read and write methods to the PortAudioStreamBaseMBS class. For buffered streams this may help to easier send/receive audio samples.
The method “Now” returns us the count of milliseconds since the 1st January 1970. So we can determine the current time in combination with the “TimeToDateComponents” method. This function returns us a timestamp with the format YYYY-MM-DD HH:MM:SS. Here you see the script to query the current time.
New functions for Mac users
The MBS Xojo Plugins in version 10.1 offers some more new features for Mac users:
Further enhancements are available for Apple Calendar. With the method “dateFromComponents” from the “NSCalendarMBS” class we transform a “NSDateComponetsMBS” to a date. With the method “dateByAddingComponents” we add date components that’s are defined as NSDateComponetsMBS object. For example we have the date 07-15-1992 as date we can save it in a NSDateComponentsMBS object and transform it with ”dateFromComponents” to a date. Then I want to add 16 years to that date. Because that I need a second instance of the NSDateComponentsMBS class with a property year with the value 16. Then we add the years with the “dateByAddingComponents” method. The code you can looks like that.
There is another method called "isValidDateInCalendar" from the NSDateComponentsMBS class. With this method you can check if there exists a calendar entry with the combined properties of the NSDateComponents object.
Dim comp As New NSDateComponentsMBS
comp.day = 15
comp.month = 7
comp.year = 1992
Dim year As New NSDateComponentsMBS
year.year = 16
Dim cal As New NSCalendarMBS
Dim z As Date = cal.dateFromComponents(comp)
Dim sweetsixteen As Date = cal.dateByAddingComponents(year, z)
We have a new class “WKHTTPCookieStoreMBS” that manages the HTTP cookies associated with a particular “WKWebsiteDataStore”. You can use the class e.g. to create an array of all cookies and then read them one by one via their indexes.
The objects of the WKWebViewConfigurationMBS class supply a collection of properties used to initialize a web view. With this class you can determine how soon a webpage is rendered, how media playback is handled, the granularity of items that the user can select and many other options.
News from the AVFoundation
We support functionalities for Apple's latest audio/video framework for recording and playback. In the latest version of the plugins we have added a great AVRouteDetectorMBS which allows you to detects the presences of media playback routes. When route detection is enabled, AVRouteDetector reports whether multiple playback routes have been detected. Belonging to this class there is a control that displays controls for picking playback routes. By default, route detection is disabled. For this functionality you need Mac MacOS 10.15 or newer.
News from the topic MIDI
The new properties from the topic MIDI in the class “MidiThruConnectionParamsMBS” set the maximum (“HighVelocity”) and minimum velocity (“LowVelocity”). All events with a velocity outside this range will be filtered.
New functionalities for Windows users
Last but not least I want to introduce the new functionalities for Windows users.
News from the Navigation
Also new are the WinFileDialogMBS class. With this class you can set set options for an open and save dialog.
The WinFileDialogMBS class acting as the super class of the WinFileOpenDialogMBS and the WinFileSaveDialogMBS class. Both classes have events, properties and methods that’s are special for their needs.
With the new class WinFileTypeMBS we can define that only files with a certain data type can be opened. A script can then look like this:
Additionally new are the classes WinShellItemMBS and WinShellItemArrayMBS which can handle one or more shell elements. The items in the WinShellItemArrayMBS class contains single WinShellItemMBS objects. With these you can read data, create thumbnails or compare items.
Dim d As WinFileOpenDialogMBS
Dim FileTypes() As WinFileTypeMBS
FileTypes.Append New WinFileTypeMBS("JPEG image", "*.jpg")
FileTypes.Append New WinFileTypeMBS("PNG image", "*.png")
FileTypes.Append New WinFileTypeMBS("Tiff image", "*.tif;*.tiff")
New features from the HTMLViewer for Windows
With the new method “Navigate” from the class IEWebBrowserMBS you can Navigate to a resource identified by a URL or to a file identified by a full path.
The topic Windows Media Foundation Player that was added in the last version plays audio and video in your applications background under windows OS. In this version we have added a new feature to this component. You can use the “Looping” method from the “MFPMediaPlayerMBS” class to set whether, the content of the player should be repeated automatically. You can enable and disable this loop.
We hope you will also find some interesting new features. We wish you a lot of fun with MBS Xojo Plugins Version 20.1. If you need a license or have any questions, please contact us.
By Stefanie Juchmes