How to use enumerated types |
|
The use of enumerated types improves the readability of your code and, thanks to the features offered by Microsoft's Intellisense, will ease the coding phase.
The following is the full list of enumerated types with their associated properties:
Enumerated type |
Corresponding properties or parameters |
enumErrorCodes |
LastError property |
enumRecorderStates |
Status property |
enumVuBandsMode |
VUMeter.BandType property |
enumOscillType |
Oscilloscope.Type property |
enumWaveformRes |
Waveform.Resolution property |
enumCdActions |
nAction parameter of the PerformActionOnCd method |
enumCdStates |
return value of GetCdStatus method |
enumCdIdCodes |
nIdentType parameter of the GetCdIdentification method |
enumCddbAlbumInfo |
nInfo parameter of the CddbGetAlbumInfo method |
enumCdCoverSizes |
nCoverSize parameter of the GetCdCoverPictureURL, GetCdCoverPictureFile methods |
enumEncodingFormats |
EncodeFormats.ForRecording, EncodeFormats.ForCdRipping and EncodeFormats.ForExporting properties |
enumResampleModes |
EncodeFormats.ResampleMode property |
enumWmaEncodeModes |
EncodeFormats.WMA.EncodeMode property and nEncodeMode parameter of the EncodeFormats.WMA.GetEncodingProfileInfo, EncodeFormats.WMA.GetEncodingCBRCount, EncodeFormats.WMA.GetEncodingCBR, EncodeFormats.WMA.GetEncodingProfileProCount and EncodeFormats.WMA.GetEncodingProfileProInfo methods. |
enumMp2EncodeModes |
EncodeFormats.MP2.EncodeMode property |
enumMp3EncodeModes |
EncodeFormats.MP3.EncodeMode property |
enumMp3EncodePresets |
EncodeFormats.MP3.Preset property |
enumOggEncodeModes |
EncodeFormats.OGG.EncodeMode property |
enumAacEncodeModes |
EncodeFormats.AAC.EncodeMode property |
enumWavEncodeModes |
EncodeFormats.WAV.EncodeMode property |
enumAcmEncodeModes |
EncodeFormats.ACM.EncodeMode property |
enumW64EncodeModes |
EncodeFormats.W64.EncodeMode property |
enumAIFFEncodeModes |
EncodeFormats.AIFF.EncodeMode property |
enumAUEncodeModes |
EncodeFormats.AU.EncodeMode property |
enumPAFEncodeModes |
EncodeFormats.PAF.EncodeMode property |
enumSVXEncodeModes |
EncodeFormats.SVX.EncodeMode property |
enumNISTEncodeModes |
EncodeFormats.NIST.EncodeMode property |
enumVOCEncodeModes |
EncodeFormats.VOC.EncodeMode property |
enumIRCAMEncodeModes |
EncodeFormats.IRCAM.EncodeMode property |
enumPVFEncodeModes |
EncodeFormats.PVF.EncodeMode property |
enumCAFEncodeModes |
EncodeFormats.CAF.EncodeMode property |
enumFLACEncodeModes |
EncodeFormats.FLAC.EncodeMode property |
enumRAWEncodeModes |
EncodeFormats.RAW.EncodeMode property and nEncodeMode parameter of the StartFromFileRaw, StartFromMemoryRaw and StartFromQueueRaw methods |
enumRecordingModes |
nMode parameter of the SetRecordingMode method |
enumScaleUnits |
nScaleUnits parameter of the RecordedSound.SeekPlayPosition and CdRippingSetRange methods |
enumWaveformTypes |
nWaveformType parameter of the WaveformAnalyzer.GetMinMaxPeakLevelsForRange method |
enumTrackerCursorModes |
nCursorMode parameter of the WaveformAnalyzer.SetTrackerCursors method |
enumGraphicBarOrientations |
nOrientation member of the GRAPHIC_BAR_SETTINGS class |
enumGraphicBarShapes |
nShape member of the GRAPHIC_BAR_SETTINGS class |
enumAnalyzerResolutions |
nResolution field of the WANALYZER_GENERAL_SETTINGS data structure |
enumWaveformStereoModes |
nStereoVisualizationMode field of the WANALYZER_WAVEFORM_SETTINGS and WSCROLLER_SETTINGS data structures |
enumMouseActions |
nAction parameter of the CallbackWaveformAnalyzerMouseNotif and CallbackWaveformScrollerMouseNotif delegates |
enumBitmapModes |
nWaveformType parameter of the WaveformAnalyzer.SetBackPictureFromFile and WaveformAnalyzer.SetBackPictureFromHandle methods |
enumVolumeScales |
nScaleType parameter of the ASIO.DeviceChannelVolumeGet, ASIO.DeviceChannelVolumeSet, ASIO.DeviceMasterVolumeGet and ASIO.DeviceMasterVolumeSet, OutputVolumeSet and OutputVolumeGet methods and nAmplitudeScale field of the WANALYZER_RULERS_SETTINGS data structure |
enumAsioChannelModes |
nChannelMode parameter of the ASIO.DeviceStart method |
enumDriverTypes |
nDriverType parameter of the InitDriversType method and return value of the GetInputDeviceDriverType method |
enumWaveAnalyzerRectangles |
nIdRectangle parameter of the WaveformAnalyzer.GetRectangle method and nRectangle parameter of the WaveformAnalyzer.MouseActionRectangleGet method |
enumInputChannelTypes |
Return value of the GetInputDeviceChannelType method |
enumVolumeScales |
nScaleType parameter of the OutputVolumeSet and OutputVolumeGet methods. |
enumGraphicFormats |
nFormat parameter of the WaveformAnalyzer.SnapshotViewSaveToFile |
enumPlaybackStatus |
Return value of the GetPlaybackStatus method |
enumCoreAudioDeviceStates |
nStateMask parameter of the CoreAudio.Enum method |
enumCoreAudioDataFlows |
nDataFlow parameter of most methods of the CoreAudioDevicesMan class |
enumCoreAudioDeviceNames |
nTypeOfName parameter of the CoreAudioDevices.DescGet method |
enumCoreAudioRoles |
nRole parameter of the CoreAudioDevices.DefaultGet method |
enumCoreAudioDeviceStates |
nStatus parameter of the CoreAudioDevices.StatusGet method |
enumCoreAudioCaptureParts |
nPartId parameter of the CoreAudioDevices.CapturePartChannelCountGet, CoreAudioDevices.CapturePartChannelVolumeGet and CoreAudioDevices.CapturePartChannelVolumeSet methods |
enumCoreAudioRenderParts |
nPartId parameter of the CoreAudioDevices.RenderPartChannelCountGet, CoreAudioDevices.RenderPartChannelVolumeGet. CoreAudioDevices.RenderPartChannelVolumeSet, CoreAudioDevices.RenderPartMuteGet and CoreAudioDevices.RenderPartMuteSet methods |
enumWasapiDeviceTypes |
nDeviceType parameter of the WASAPI.DeviceCoreAudioIndexGet, WASAPI.DeviceGetCount, WASAPI.DeviceGetDesc, WASAPI.DeviceIsFormatSupported, WASAPI.DeviceIsStarted, WASAPI.DeviceLatencyGet, WASAPI.DeviceMuteGet, WASAPI.DeviceMuteSet, WASAPI.DeviceSharedFormatGet, WASAPI.DeviceStartExcusive, WASAPI.DeviceStartShared, WASAPI.DeviceStop, WASAPI.DeviceVolumeGet, WASAPI.DeviceVolumeSet methods |
enumWasapiChannelModes |
nChannelMode parameter of the WASAPI.DeviceStartShared method |
enumCoreAudioDeviceTypes |
nDeviceType parameter of the CoreAudioDevices.TypeGet method |
enumHorizontalLineHeadlineType |
nHeadlineType parameter of the WaveformAnalyzer.GraphicItemHorizontalLineAdd and WaveformAnalyzer.GraphicItemHorizontalLineParamsSet methods |
enumHorizontalLineChannel |
nChannel parameter of the WaveformAnalyzer.GraphicItemHorizontalLineAdd, WaveformAnalyzer.GraphicItemHorizontalLineParamsSet methods and nChannel field of the WANALYZER_HORIZONTAL_LINE data structure |
enumGraphicItemType |
nType parameter of the WaveformAnalyzer.GraphicItemTypeGet, WaveformAnalyzer.GraphicItemsTypeShow and WaveformAnalyzer.GraphicItemUniqueIdGet methods |
enumGraphicItemMaskValues |
nGraphicItemsMask parameter of the WaveformAnalyzer.GraphicItemsMouseMoveEnable and WaveformAnalyzer.SnapshotViewGraphicItemsMaskSet methods and nGraphicItemsMask field of the WANALYZER_SCROLLBARS_SETTINGS and WSCROLLER_SETTINGS data structures |
enumWaveformLineDashStyles |
Some field of the WANALYZER_GENERAL_SETTINGS, WANALYZER_VERTICAL_LINE, WANALYZER_HORIZONTAL_LINE and WSCROLLER_SETTINGS data structures |
enumLineCaps |
Some field of the WANALYZER_GENERAL_SETTINGS, WANALYZER_VERTICAL_LINE, WANALYZER_HORIZONTAL_LINE and WSCROLLER_SETTINGS data structures |
enumLineDashCaps |
Some field of the WANALYZER_GENERAL_SETTINGS, WANALYZER_VERTICAL_LINE, WANALYZER_HORIZONTAL_LINE and WSCROLLER_SETTINGS data structures |
enumBuddyAlignment |
nAlignment field of the WANALYZER_BUDDY_PICTURE and WANALYZER_BUDDY_TEXT data structures |
enumWaveformSelectionMode |
nSelectionMode field of the WANALYZER_WAVEFORM_SETTINGS data structure |
enumTranspGlassType |
nTransparentGlassType field of the WANALYZER_WAVEFORM_SETTINGS and WANALYZER_SCROLLBARS_SETTINGS data structures |
enumWaveScrollbarType |
nType field of the WANALYZER_SCROLLBARS_SETTINGS data structure |
enumScrollbarWaveVisibleRangeType |
nVisibleRangeType field of the WANALYZER_SCROLLBARS_SETTINGS data structure |
enumWaveScrollerAutoUpdate |
nUpdateSpeed field of the WSCROLLER_SETTINGS data structure |
enumAsioRecordMonoToStereoMode |
nMonoChanToStereoOutMode parameter of the ASIO.DeviceRecordParamsGet and ASIO.DeviceRecordParamsSet methods |
enumCommonDialogInfo |
nInfo parameter of the CommonDialogGetInfoFromLastOpen and CommonDialogGetInfoFromLastSave methods |
enumWaveSnapshotViewMode |
nMode parameter of the WaveformAnalyzer.SnapshotViewSaveToFile, WaveformAnalyzer.SnapshotViewSaveToMemory , and WaveformAnalyzer.SnapshotViewDrawToHdc methods |
enumWaveformChannels |
nChannel parameter of the WaveformAnalyzer.SnapshotViewSaveToFile, WaveformAnalyzer.SnapshotViewSaveToMemory , and WaveformAnalyzer.SnapshotViewDrawToHdc methods |
enumWaveAnalyzerViewModes |
nMode parameter of the WaveformAnalyzer.ViewModeSet and WaveformAnalyzer.ViewModeGet methods |
enumFilterNames |
nFilterName parameter of the FilterApply, FilterParametersSet, FilterParametersGet and RecordedSound.FilterApply methods |
enumFilterTypes |
nFilterType parameter of the FilterApply, FilterParametersSet, FilterParametersGet and RecordedSound.FilterApply methods |
enumZipEncryptionTypes |
nEncryptionType parameter of the ZIP.Create method |
enumAacPlusEncodeModes |
EncodeFormats.AACPlus.EncodeMode property |
enumEqualizerPresets |
nPreset parameter of the EqualizerLoadPresets method |
The following examples, under different development environments, show how to use enumerated types in your code. These examples assume that one instance of the control, named AudioSoundRecorder1, exists on a form. The purpose of this sample code is to check if the recorder is currently ripping a CD track.
After typing the code
If AudioSoundRecorder1.Status
press the "=" key on your keyboard. IntelliSense displays the listbox of the possible values that can be assigned to the method parameter.
Select the AudioSoundRecorder.enumRecorderStates.RECORD_STATUS_CD_RIPPING value so the complete line of code will be:
If AudioSoundRecorder1.Status = AudioSoundRecorder.enumRecorderStates.RECORD_STATUS_CD_RIPPING
' do something
...
Else
' do something else
...
End If
This environment requires a couple of additional lines of code to make use of Intellisense. First, you must add the components namespace to your code so the following line must be inserted at the beginning of the form management file:
using AudioSoundRecorder;
After typing the code...
if (audioSoundRecorder1.Status == enumRecorderStates
press the "." key on your keyboard. Note that to use Intellisense, you must add enumRecorderStates after the equal sign in order to trigger the enumRecorderStates enumerated type. After typing a period, Intellisense is activated.
Select the RECORD_STATUS_CD_RIPPING value so the complete line of code will be:
if (audioSoundRecorder1.Status == enumRecorderStates.RECORD_STATUS_CD_RIPPING)
// do something
....
else
// do something else
....