Copyright © 2011-2016 MultiMedia Soft

How to use enumerated types

Previous pageReturn to chapter overviewNext page

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 and return value of most methods

enumStoreModes

nMode parameter of the SetStoreMode method and return value of the GetStoreMode method

enumLoadingModes

nMode parameter of the SetLoadingMode method

enumScaleUnits

nScaleUnits parameter of the SeekSound method

enumWaveformTypes

nWaveformType parameter of the WaveformAnalyzer.GetMinMaxPeakLevelsForRange methods

enumSoundEditCommands

nCommand parameter of the CallbackEditPerc delegate

enumTrackerCursorModes

nCursorMode parameter of the WaveformAnalyzer.SetTrackerCursors method

enumAnalyzerResolutions

nResolution field of the WANALYZER_GENERAL_SETTINGS data structure

enumWaveformStereoModes

nStereoVisualizationMode field of the WANALYZER_WAVEFORM_SETTINGS and WSCROLLER_SETTINGS data structures

enumVolumeScales

nScaleType parameter of the SetMixingParams, Effects.VolumeFlatApply, Effects.VolumeAutomationSetScales methods

enumChannelsMask

nAffectedChannel parameter of the Effects.VolumeFlatLevelApply, Effects.VolumeSlidingLevelApply, Effects.VolumeAutomationLevelApply, Effects.AutoWahApply, Effects.ChorusApply, Effects.CompressorApply, Effects.DistortionApply, Effects.EchoApply, Effects.FreeverbApply and Effects.PhaserApply methods

enumFilterNames

nFilterName parameter of the Effects.FilterApply method

enumFilterTypes

nFilterType parameter of the Effects.FilterApply method

enumRAWEncodeModes

EncodeFormats.RAW.EncodeMode property and nEncodeMode parameter of the LoadSoundFromRawFile and LoadSoundFromRawMemory methods

enumMouseActions

nAction parameter of the CallbackWaveformAnalyzerMouseNotif delegate

enumVstInfo

nInfo parameter of the Effects.VstGetInfoString method

enumVstParamInfo

nInfo parameter of the Effects.VstProgramParamGetInfo method

enumEqualizerPresets

nPreset parameter of the Effects.EqualizerLoadPresets method

enumEncodingFormats

EncodeFormats.FormatToUse property

enumMp2EncodeModes

EncodeFormats.MP2.EncodeMode property

enumMp3EncodeModes

EncodeFormats.MP3.EncodeMode property

enumWavEncodeModes

EncodeFormats.WAV.EncodeMode property

enumOggEncodeModes

EncodeFormats.OGG.EncodeMode 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.

enumAacEncodeModes

EncodeFormats.AAC.EncodeMode property

enumAcmEncodeModes

EncodeFormats.ACM.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

enumIRCAMEncodeModes

EncodeFormats.IRCAM.EncodeMode property

enumVOCEncodeModes

EncodeFormats.VOC.EncodeMode property

enumW64EncodeModes

EncodeFormats.W64.EncodeMode property

enumPVFEncodeModes

EncodeFormats.PVF.EncodeMode property

enumCAFEncodeModes

EncodeFormats.CAF.EncodeMode property

enumFLACEncodeModes

EncodeFormats.FLAC.EncodeMode property

enumRAWEncodeModes

EncodeFormats.RAW.EncodeMode property

enumWaveAnalyzerRectangles

nIdRectangle parameter of the WaveformAnalyzer.GetRectangle method

enumVolumeAutomationPosUnits

nPosUnit parameter of the Effects.VolumeAutomationSetScales method

enumVolumeCurves

nCurveType parameter of the Effects.VolumeAutomationPointAddNew, Effects.VolumeAutomationPointGetParameters, Effects.VolumeAutomationPointSetParameters and Effects.CurveDesigner.DisplayCurveType methods

enumWindowTypes

nWindowType parameter of the Effects.DeNoiseFilterApply method

enumGraphicFormats

nFormat parameter of the WaveformAnalyzer.SnapshotViewSaveToFile, TagsEditor.ID3V2_PictureFrameAddFromBitmap, TagsEditor.WMA_PictureFrameAddFromBitmap, TagsEditor.MP4_PictureFrameAddFromBitmap, TagsEditor.FLAC_PictureFrameAddFromBitmap, TagsEditor.ID3V2_PictureFrameFileGet, TagsEditor.ID3V2_GeneralObjectFrameFileGet, TagsEditor.WMA_PictureFrameFileGet, TagsEditor.MP4_PictureFrameFileGet, TagsEditor.FLAC_PictureFrameFileGet, TagsEditor.ID3V2_CommercialFramePictureFileGet methods

enumVolumeScales

nScaleType parameter of the OutputVolumeSet, OutputVolumeGet, SetMixingParams, Effects.VolumeFlatApply, Effects.VolumeAutomationSetScales methods and nAmplitudeScale field of the WANALYZER_RULERS_SETTINGS data structure

enumFileTypes

Return value of GetFileType method

enumEditorSoundInfo

nInfo parameter of the GetFileInfo method

enumTagAvailable

Return value of TagsEditor.ALL_AnalyzeSoundOnEditor and TagsEditor.ALL_AnalyzeSoundFile methods

enumTagFields

nField parameter of the TagsEditor.ALL_CommonFrameGet, TagsEditor.ALL_CommonFrameSet, TagsEditor.ID3V1_FieldGet, TagsEditor.ID3V1_FieldSet, TagsEditor.APE_TextFieldGet, TagsEditor.APE_TextFieldSet, TagsEditor.LYRICS3_TextFieldGet, TagsEditor.LYRICS3_TextFieldSet methods

enumId3v2Formats

nFormat parameter of the TagsEditor.ID3V2_SaveChanges method

enumId3v2Encodings

nEncoding parameter of the TagsEditor.ID3V2_SaveChanges method

enumMp4Frames

nFrameId parameter of the TagsEditor.MP4_TextFrameGet and TagsEditor.MP4_TextFrameSet methods

enumOggFrames

nFrameId parameter of the TagsEditor.OGG_TextFrameGet and TagsEditor.OGG_TextFrameSet methods

enumId3v2FrameInfo

nInfo parameter of the TagsEditor.ID3V2_PictureFrameInfoGet, TagsEditor.ID3V2_CommentFrameInfoGet, TagsEditor.ID3V2_SynchLyricsFrameInfoGet, TagsEditor.ID3V2_GeneralObjectFrameInfoGet, TagsEditor.ID3V2_UnsynchLyricsFrameInfoGet, TagsEditor.FLAC_PictureFrameInfoGet, TagsEditor.WMA_PictureFrameInfoGet methods

enumId3v2PictureType

nPictureType parameter of the TagsEditor.ID3V2_PictureFrameTypeGet, TagsEditor.WMA_PictureFrameTypeGet, TagsEditor.FLAC_PictureFrameTypeGet, TagsEditor.ID3V2_PictureFrameAddFromBitmap, TagsEditor.WMA_PictureFrameAddFromBitmap, TagsEditor.FLAC_PictureFrameAddFromBitmap, TagsEditor.ID3V2_PictureFrameAddFromFile, TagsEditor.WMA_PictureFrameAddFromFile, TagsEditor.FLAC_PictureFrameAddFromFile, TagsEditor.ID3V2_PictureFrameAddFromMemoryFile, TagsEditor.WMA_PictureFrameAddFromMemoryFile, TagsEditor.FLAC_PictureFrameAddFromMemoryFile methods

enumId3v2ReceivedAsType

nReceivedAs parameter of the TagsEditor.ID3V2_CommercialFrameAddWithBitmap, TagsEditor.ID3V2_CommercialFrameAddWithFile, TagsEditor.ID3V2_CommercialFrameAddWithMemoryFile, TagsEditor.ID3V2_CommercialFrameReceivedAsGet methods

enumId3v2CommercialInfo

nInfo parameter of the TagsEditor.ID3V2_CommercialFrameInfoGet method

enumId3v2SyncLyricsType

nLyricsType parameter of the TagsEditor.ID3V2_SynchLyricsFrameAdd and TagsEditor.ID3V2_SynchLyricsFrameInfoNumGet methods

enumId3v2TimeStampFormats

nTimeStampFormat parameter of the TagsEditor.ID3V2_SynchLyricsFrameAdd TagsEditor.ID3V2_SynchLyricsFrameInfoNumGet, TagsEditor.ID3V2_EventTimingsFrameEventCountGet methods

enumId3v2OwnershipInfo

nInfo parameter of the TagsEditor.ID3V2_OwnershipFrameInfoGet method

enumId3v2EventTimingTypes

nEventTimingType parameter of the TagsEditor.ID3V2_EventTimingsFrameEventAdd and TagsEditor.ID3V2_EventTimingsFrameEventInfoGet methods

enumBextChunkField

nFieldId parameter of the TagsEditor.WAV_BextChunkTextFieldGet and TagsEditor.WAV_BextChunkTextFieldSet methods

enumBextChunkBinaryField

nFieldId parameter of the TagsEditor.WAV_BextChunkBinaryFieldGet and TagsEditor.WAV_BextChunkBinaryFieldSet methods

enumCartChunkTextField

nFieldId parameter of the TagsEditor.WAV_CartChunkTextFieldGet and TagsEditor.WAV_CartChunkTextFieldSet methods

enumCartChunkTimeMarkerField

nFieldId parameter of the TagsEditor.WAV_CartChunkTimeMarkerFieldGet and TagsEditor.WAV_CartChunkTimeMarkerFieldSet methods

enumOperationsWithPercentage

nOperation parameter of the CallbackPercentage delegate

enumPlaybackStatus

Return value of the GetPlaybackStatus method and nStatus parameter of the CallbackSoundPlaybackStatusChanged delegate

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

enumMouseButtons

nButton parameter of the CallbackWaveformAnalyzerGraphItemClick and CallbackWaveformAnalyzerGraphItemDblClick delegates

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

enumMultiChanDownmixModes

nMode parameter of the MultiChannelLoadingModeGet and MultiChannelLoadingModeSet methods

enumOpusEncodeModes

Value of the EncodeFormats.OPUS.EncodeMode property

enumOpusDownmixModes

Value of the EncodeFormats.OPUS.DownmixMode property

enumSapiVoiceAttributes

nAttribute parameter of the SpeechVoiceAttributeGet method

enumSoundGenWaveTypes

nType parameter of the SoundComposer.ItemWaveToneAdd, SoundComposer.ItemWaveToneTypeGet and SoundComposer.ItemWaveToneTypeSet methods, nWaveType parameter of the SoundGenerator.WaveToneGenerate method

enumSoundGenNoiseTypes

nType parameter of the SoundComposer.ItemNoiseAdd, SoundComposer.ItemNoiseTypeGet and SoundComposer.ItemNoiseTypeSet methods, nNoiseType parameter of the SoundGenerator.NoiseGenerate method

enumSoundGenSlidingWaveTypes

nWaveType parameter of the SoundComposer.ItemSlidingWaveToneAdd, SoundComposer.ItemSlidingWaveToneTypeGet, SoundComposer.ItemSlidingWaveToneTypeSet and SoundGenerator.SlidingWaveToneGenerate methods

enumSoundComposerTypes

nType parameter of the SoundComposer.ItemTypeGet method

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

enumZipEncryptionTypes

nEncryptionType parameter of the ZIP.Create method

enumSoundFileInfo

nInfo parameter of the SoundFileInfoGet and SoundLoadedInfoGet methods

enumRemapChannels

Elements added to the table passed through the mapChans parameter of the Effects.ChannelsRemapApply method

 

The following examples, under different development environments, show how to use enumerated types in your code.

 

Microsoft Visual Basic.NET

Microsoft Visual C#.NET

 

 

Microsoft Visual Basic.NET

 

After typing the code

 

If AudioSoundEditor1.LastError

 

press the "=" key on your keyboard: IntelliSense displays the list box of possible values that can be assigned to a parameter passed to a method or to a property as seen on the screenshot below:

 

asoednet_i000091

 

Select the AudioSoundEditor.enumErrorCodes.ERR_NOERROR value so the complete line of code will be:

 

If AudioSoundEditor1.LastError = AudioSoundEditor.enumErrorCodes.ERR_NOERROR Then

 ' do something

 ...

Else

 ' do something else

 ...

End If

 

 

Microsoft Visual C#.NET

 

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 AudioSoundEditor;

 

After typing the code...

 

if (audioSoundEditor1.LastError == enumErrorCodes

 

press the "." key on your keyboard. Note that to use Intellisense, you must add enumErrorCodes after the equal sign in order to trigger the enumErrorCodes enumerated type. After typing a period, Intellisense is activated.

 

asoednet_i000090

 

Select the ERR_NOERROR value so the complete line of code will be:

 

if (audioSoundEditor1.LastError == enumErrorCodes.ERR_NOERROR)

   // do something

   ....

else

   // do something else

   ....