Copyright © 2008-2013 MultiMedia Soft

How to use Mnemonic Constants

Previous pageReturn to chapter overviewNext page

The use of Mnemonic Constants improves the readability of your code. This version of the control implements a new internal design to expose these public enumerated types. You will see them in the drop downs on property sheets and in Microsoft's Intellisense feature.

 

The only environment where this is not the case is Microsoft Visual C++ environment (due to the manner in which the environment communicates with the control).

 

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 SoundEditStarted, SoundEditPerc and SoundEditDone events

enumTrackerCursorModes

nCursorMode parameter of the WaveformAnalyzer.SetTrackerCursors method

enumAnalyzerResolutions

nResolution member of the WAVEFORM_ANALYZER_SETTINGS_2 data structure

enumWaveformStereoModes

nStereoVisualizationMode member of the WAVEFORM_ANALYZER_SETTINGS_2 data structure and nWaveformStereoMode parameter of the WaveformAnalyzer.BitmapViewDrawToHdc method

enumWaveformLineModes

nWavePositionLineType and nWavePlaybackLineType members of the WAVEFORM_ANALYZER_SETTINGS_2 data structure, nMode parameter of the WaveformAnalyzer.VerticalLineAdd and WaveformAnalyzer.BitmapViewVerticalLineAdd methods.

enumVolumeScales

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

enumDirectXEffects

nEffect parameter of the Effects.DirectXApply method

enumChannels

nAffectedChannel parameter of the Effects.VolumeAutomationApply method

enumDspExternalFunctions

nFunctionType parameter of the Effects.CustomDspExternalSetFunction method

enumBoolean

bUseFloatSamples parameter of the Effects.CustomDspUseFloatSamples 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 WaveAnalyzerMouseNotification event

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 and nEncodeMode parameter of the LoadSoundFromRawFile, LoadSoundFromRawMemory and AppendAutomationItemAddFromFileRaw methods

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

enumCommonDialogInfo

nInfo parameter of the CommonDialogGetInfoFromLastOpen and CommonDialogGetInfoFromLastSave 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 and 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

enumPlaybackStatus

Return value of the GetPlaybackStatus method

 

 

The following examples, under different development environments, show how to use Mnemonic Constants in your code. These examples assume that one instance of the control, named AudioSoundRecorder1, exists on a form or dialog box. The purpose of this sample code is to check if the recorder is currently ripping a CD track.

 

Microsoft Visual C++ (4.0, 5.0, 6.0 and .NET)

Microsoft Visual Basic 5 and 6

 

 

Microsoft Visual C++ (4.0, 5.0, 6.0 and .NET)

 

Because of the different behaviour of these environments, you need to include the header file AdjMmsEngDef.h in order to use predefined Mnemonic Constants: This module can be found inside the product Include directory (default C:\Program Files\Active Sound Editor\include).

 

You can test the last error code using the following line of code:

 

if (ActiveSoundEditor1.GetLastError () != ERR_NOERROR)

 // do something

 .....

else

 // do something else

 .....

 

 

The GetLastError method is defined by the control wrapper class CActiveSoundEditor contained inside the ActiveSoundEditor.cpp and ActiveSoundEditor.h files: these wrapper files are automatically generated when you insert the control inside your project. So, in order to access this function, you will have to insert the following line of code somewhere in your code.

 

#include "ActiveSoundEditor.h"

 

The mnemonic constant ERR_NOERROR can be found inside the AdjMmsEngDef.h module file. So, in order to access this value, you will have to insert the following line of code somewhere in your code.

 

#include "AdjMmsEngDef.h"

 

 

Microsoft Visual Basic 5 and 6

 

In this environment you can use that IntelliSense features that make it easy to assign the intended value to the method parameter.

After typing the code...

If ActiveSoundEditor1.LastError

press the "=" key on your keyboard. IntelliSense displays the listbox of the possible values that can used to check the value of the LastError property:

asoed_i0000a2

 

Select the ERR_NOERROR value to complete the line of code as follows:

 

If ActiveSoundEditor1.LastError = ERR_NOERROR Then

 ' do something

 .....

Else

 ' do something else

 .....

End If