Copyright © 2011-2013 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

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.BitmapViewSaveToFile and WaveformAnalyzer.GetMinMaxPeakLevelsForRange methods

enumSoundEditCommands

nCommand parameter of the CallbackEditPerc delegate

enumTrackerCursorModes

nCursorMode parameter of the WaveformAnalyzer.SetTrackerCursors method

enumAnalyzerResolutions

nResolution property of the WAVEFORM_ANALYZER_SETTINGS_2 class

enumWaveformStereoModes

nStereoVisualizationMode property of the WAVEFORM_ANALYZER_SETTINGS_2 class and nWaveformStereoMode parameter of the WaveformAnalyzer.BitmapViewDrawToHdc method

enumWaveformLineModes

nWavePositionLineType and nWavePlaybackLineType properties of the WAVEFORM_ANALYZER_SETTINGS_2 class, nMode parameter of the WaveformAnalyzer.VerticalLineAdd and WaveformAnalyzer.BitmapViewVerticalLineAdd methods.

enumVolumeScales

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

enumChannels

nAffectedChannel parameter of the Effects.VolumeAutomationApply method

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.BitmapViewSaveToFile, 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 and OutputVolumeGet methods.

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

 

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.

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 listbox of the possible values that can be assigned to the method parameter.

 

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

   ....