WTHelper Documentation

Written by CyanPhase (Edward Blake)

This plugin system is the foundation for the new wavetable file browser with the graphical details view. This flexible plugin system can display folders, navigate folders, display files, import files and preview files. Eventually the functionality of the old file browser (such as the XI and SF2 formats) can be duplicated (and improved) as DLL files which can be easily maintained and easily integrated. Many many more formats can also be handled with this plugin format. With Overloader 1.5, the wavetable also allows for 24-bit packed int, 32-bit PCM and 32-bit float samples, the WaveEditor and WTHelper interfaces contain support for these alternative encodings. The API is relatively flexible and allows for a variety of functionality. Here's a description of each function of the CWTHelper class.

CWTHelper class
Function Description
Init This function is called when the wavetable helper is getting loaded.
CanPreview This function is called during initialization so the host can know if the wthelper can preview samples.
CanImport This function is called during initialization so the host can know if the wthelper can import samples.
TranslatePathForFile This function is called to know if the WTHelper can translate the path into something else.
DoubleClickUseFile This function is called to handle double clicks of files in the file browser.
DoubleClickDisplayFolders This function is called to add folders (stuff before the files) to the now blank file browser window.
DoubleClickDisplayFiles This function is called to add files (stuff after the folders) to the half blank file browser window.
Import This function is called when the user clicks the "<<" Button, or the keyboard keystrokes to import to a wavetable entry.
Export not used
SettingsChanged Called if something changed in Overloader and so on.
HelpersWebSiteURL This function is called by the host to get the web site associated with the WTHelper.
GetExtensionsClass This function is used to retrieve other extension classes, similar in a way to how COM works.
DispatchCommand This function is called for various functions, it is extendable.
DispatchCommandEx This function is called for various functions, it is extendable.


CWaveBrowserHandler (callback) class
Function Description
AddItem This adds an item to the file browser window, call it while in one of the DoubleClickDisplay* functions.
IsNormalFileSystem Specifies if the path is a normal OS path
CantLoadReason Call this if you can't load the sample (to display or not is automatically handled)
GetWaveEditorPosition Call this to get the position in the wavetable to output to.
GetWaveEditorClass Call this to get the CCBWaveEditor class to allow manipulation of samples.
GetWavePlayerBuffer The same as CCBWaveEditor::WavePlayerCreateBuffer, creates a stereo buffer of playable float samples.
WavePlayerReserve See CCBWaveEditor::WavePlayerReserve()
WavePlayerPlay See CCBWaveEditor::WavePlayerPlay()


CCBWaveEditor class (Callback)
Function Description
GetMainBuzzWindow Get the main buzz window handle
GetWaveTableWindow Get the wavetable window handle
CreateNewEntry Create a new entry in a free slot
GetNumOfNotes Get number of notes in a entry
IsThereSample Check if there is a sample in a slot
GetSampleName Get the sample's name
GetSamples Get actual Samples, this can be 16-bit, 24-bit, or 32-bit in size.
GetNumSamples Get number of samples in this entry
GetNumChannels Get number of channels
GetLoopStart Get loop start
GetLoopEnd Get loop end
GetSamplerate Get sample rate
GetRootNote Get root note
GetVolume Get the volume of the sample
IsLooped Check if this sample is looped
SetNumChannels Set the number of channels
SetLoopStart Set the loop start
SetLoopEnd Set the loop end
SetSamplerate Set the sample rate
SetRootNote Set the root note
SetVolume Set the volume
SetLooped Set if this sample is looped
SetTo16BitPCM Set this sample flags to 16bit PCM.
SetTo32BitFloat Set this sample flags to 32bit floating point. In reality, the sample is offset by 8 bytes from the beginning (this information is useful for making machines to read the format, the first byte actually has the format number), but GetSamples compensates for this.
CreateSpecificEntry Create a new sample in a specific slot.
GetFileBrowserWnd Get the file browser's current window handle.
WavePlayerReserve Reserve (Resets) the player memory buffer
WavePlayerCreateBuffer Creates a buffer of stereo float samples to play
WavePlayerPlay Plays the sample on the current audio driver
SetSampleName Sets the name of the sample
SetTo32BitPCM Set the sample flags to 32-bit PCM. In reality, the sample is offset by 8 bytes from the beginning (this information is useful for making machines to read the format, the first byte actually has the format number), but GetSamples compensates for this.
SetTo24BitPInt Set the sample flags to 24-bit packed int. 3 bytes is used for each sample. In reality, the sample is offset by 8 bytes from the beginning (this information is useful for making machines to read the format, the first byte actually has the format number), but GetSamples compensates for this.
GetSampleType Get the sample type id (bitdepth and\or format) of the sample. Can be used to know which format the sample format is in.
SetSampleType Set the sample type id (bitdepth and\or format) of the sample. Can be used to set the format of a sample manually instead of using SetToXXX. Though this is not really recommended.


CWaveEditorDirectWork class
Function Description
AboutImplementation This function is called to return a string describing your direct work player. This is optional.
WorkStereo Works basically the same as a Buzz Machine's WorkStereo Function.
Stop This function is called to stop the stream of audio. this handled by the plugin's code to stop the previewing\wave playing. This function will get called if the user presses the "stop" button in the wavetable.