Copyright © 2001-2018 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

enumDriverTypes

nDriverType parameter of the InitDriversType method

enumStates

return value of GetPlayerStatus method

enumTagVersions

return value of GetMp3TagVersion method

enumScaleUnits

ScaleUnits

enumFileTypes

return value of GetFileType method and nFormat parameter of the LoadInternetStreamWithFormat method

enumGranulType

ForwRewGranularityType property

enumTagTypes

nTagType parameter of the IsTagAvailable and GetTagString methods

enumTagFields

nField parameter of the GetFileTagField method

enumPlayListModes

nMode parameter of the PlayListLoad method

enumPlayListFormats

nFormat parameter of the PlayListSave method

enumPlayListFieldsForDj

nString parameter of the PlayListGetItemString method

enumBoolean

Several methods use this boolean value.

enumOscillType

Oscilloscope.Type

enumVuBandsMode

VUMeter.BandType

enumWaveformUpdateRes

Waveform.UpdateResolution

enumFadeOutModes

Fader.FadeOutMode

enumFadeTypes

nFadeType parameter of the Fader.Init method

enumCdActions

nAction parameter of the PerformActionOnCd method

enumCdStates

Return value of GetCdStatus method and nCdStatus parameter of the CdPlayerStatusChanged event

enumCdIdCodes

nIdentType parameter of the GetCdIdentification method

enumVolumeScales

nScaleType parameter of the StreamVolumeLevelGet, StreamVolumeLevelSet, PlayListSaveAutomation, ASIO.DeviceChannelVolumeGet, ASIO.DeviceChannelVolumeSet, ASIO.DeviceMasterVolumeGet, ASIO.DeviceMasterVolumeSet, PlayListItemVolAutomPointAdd, Fader.FadeInTargetVolumeGet, Fader.FadeInTargetVolumeSet, CoreAudioDevices.ChannelVolumeGet, CoreAudioDevices.ChannelVolumeSet, CoreAudioDevices.MasterVolumeGet, CoreAudioDevices.MasterVolumeSet methods. VolumeAutomation.ScaleType property.

enumDirectXEffects

Effects.DirectXEffectApply, Effects.DirectXEffectIsApplied, Effects.DirectXEffectParamsSet and Effects.DirectXEffectParamsGet methods

enumEaxEffects

GetEaxEffect, SetEaxEffect and SetEaxEffectPresets methods

enumEventStreaming

nState parameter of DownloadBuffering event

enumEventLoadStreamResults

nResult parameter of StreamLoaded event

enumWaveformResolutions

nResolution parameter of the Waveform.AnalyzeFullSound method

enumWaveformTypes

nWaveformType parameter of the Waveform.BitmapViewSaveToFile  and Waveform.BitmapViewSaveToMemory methods

enumSpeakersConfig

GetOutputSpeakersConfig and SetOutputSpeakersConfig methods

enumSpeakers

nSpeaker parameter of the StreamOutputSpeakerSet, Effects.PreAmplifierSpeakerValueGet and Effects.PreAmplifierSpeakerValueSet methods, return value of the StreamOutputSpeakerGet and method

enumCddbAlbumInfo

nInfo parameter of the CddbGetAlbumInfo method

enumCdCoverSizes

nCoverSize parameter of the GetCdCoverPictureURL, GetCdCoverPictureFile and AmazonStoreCdCoverPictureFileGet methods and of the CdCoverPictureFileAvailable event

enumPlayListItemType

nItemType parameter of the PlayListAddItemEx method

enumDspExternalFunctions

nFunctionType parameter of the CustomDSP.ExternalSetFunction method

enumVstInfo

nInfo parameter of the VST.GetInfoString method

enumVstParamInfo

nInfo parameter of the VST.ProgramParamGetInfo method

enumEqualizerPresets

nPreset parameter of the EqualizerLoadPresets method

enumGraphicBarOrientations

nOrientation member of the GRAPHIC_BAR_SETTINGS data structure

enumGraphicBarShapes

nShape member of the GRAPHIC_BAR_SETTINGS data structure

enumSoundDirections

Return value of the SoundDirectionGet method and nDirection parameter of the SoundDirectionSet method

enumRAWEncodeModes

nEncodeMode parameter of the LoadSoundFromRawFile, LoadSoundFromRawMemory, MediaFileDecoder.FileInfoGet and MediaFileDecoder.FileOpenRaw methods

enumLrcFileIdTags

nTagType parameter of the LrcIdTagGet method

enumEncodingFormats

nEncodeFormat parameter of the CastingCreateFromStreamMixer and CastingCreateFromPlayer methods

enumCastEncodeModes

nEncodeMode parameter of the CastingCreateFromStreamMixer and CastingCreateFromPlayer methods

enumAudioRendererModes

nMode parameter of the VideoPlayer.AudioRendererModeSet method and return value of theVideoPlayer.AudioRendererModeGet method.

enumMemoryMediaFormats

nMediaFormat parameter of the VideoPlayer.LoadFromMemory, VideoPlayer.LoadFromMemoryForEAX, VideoPlayer.LoadFromMemoryForTempoChange, VideoPlayer.LoadFromMemorySync, VideoPlayer.LoadFromMemorySyncForEAX and VideoPlayer.LoadFromMemorySyncForTempoChange methods.

enumTextAlignment

nAlignment parameter of the VideoMixer.OSDItemTextAdd and VideoMixer.OSDItemTextChange methods

enumRectAlignment

nAlignment parameter of the VideoMixer.OSDItemChangeAlignment method

enumDriverTypes

nDriverType parameter of the InitDriversType method and return value of the GetOutputDeviceDriverType method

enumAsioChannelModes

nChannelMode parameter of the ASIO.DeviceStart method

enumVolumeAutomationPosUnits

nPosUnit parameter of the PlayListSaveAutomation method, nPositionUnit parameter of the PlayListItemVolAutomPointAdd and PlayListItemCuePointAdd methods. VolumeAutomation.PositionUnit property

enumVolumeCurves

nCurveType parameter of the PlayListItemVolAutomPointAdd, VolumeAutomation.PointAdd, VolumeAutomation.PointGetParams, VolumeAutomation.PointSetParams, VolumeAutomation.PointAdd, VolumeAutomation.CurveDesigner.DisplayCurveType, StreamVolumeSlide, StreamVolumeSlideEx, StreamVolumeSmoothingSet and StreamVolumeSmoothingSetEx methods

enumWavChunkStringInfo

nInfoField parameter of the GetWavChunkStringInfo method

enumWavChunkNumericInfo

nInfoField parameter of the GetWavChunkNumericInfo method

enumWavChunkBinaryInfo

nInfoField parameter of the GetWavChunkBinaryInfo method

enumFilterNames

nFilterName parameter of the FilterApply method

enumFilterTypes

nFilterType parameter of the FilterApply method

enumCommonDialogInfo

nInfo parameter of the CommonDialogGetInfoFromLastOpen and CommonDialogGetInfoFromLastSave methods.

enumGraphicFormats

nFormat parameter of the Waveform.BitmapViewSaveToFile and VideoPlayer.FrameGrabberExecToFile methods

enumWaveformStereoModes

nWaveformStereoMode parameter of the Waveform.BitmapViewDrawToHdc method

enumWaveformLineModes

nMode parameter of the Waveform.BitmapViewVerticalLineAdd method

enumMp3BitrateTypes

Return value of the GetMp3BitrateType method

enumVideoGrabberStopTypes

nStopType parameter of the VideoPlayer.FrameGrabberExecToFile and VideoPlayer.FrameGrabberExecToMemory methods

enumFramesSet

Return value of the VideoPlayer.FrameGrabberResultsGetAvailableType method

enumTagAvailable

Return value of TagsEditor.ALL_AnalyzeSoundOnPlayer and TagsEditor.ALL_AnalyzeSoundFile methods

enumTagFields

nField parameter of the TagsEditor.ALL_CommonFrameGet, TagsEditor.ID3V1_FieldGet, TagsEditor.APE_TextFieldGet, TagsEditor.LYRICS3_TextFieldGet methods

enumMp4Frames

nFrameId parameter of the TagsEditor.MP4_TextFrameGet method

enumOggFrames

nFrameId parameter of the TagsEditor.OGG_TextFrameGet method

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 methods

enumId3v2ReceivedAsType

nReceivedAs parameter of the TagsEditor.ID3V2_CommercialFrameReceivedAsGet method

enumId3v2CommercialInfo

nInfo parameter of the TagsEditor.ID3V2_CommercialFrameInfoGet method

enumId3v2SyncLyricsType

nLyricsType parameter of the TagsEditor.ID3V2_SynchLyricsFrameInfoNumGet method

enumId3v2TimeStampFormats

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

enumId3v2OwnershipInfo

nInfo parameter of the TagsEditor.ID3V2_OwnershipFrameInfoGet method

enumId3v2EventTimingTypes

nEventTimingType parameter of the TagsEditor.ID3V2_EventTimingsFrameEventInfoGet method

enumBextChunkField

nFieldId parameter of the TagsEditor.WAV_BextChunkTextFieldGet method

enumBextChunkBinaryField

nFieldId parameter of the TagsEditor.WAV_BextChunkBinaryFieldGet method

enumCartChunkTextField

nFieldId parameter of the TagsEditor.WAV_CartChunkTextFieldGet method

enumCartChunkTimeMarkerField

nFieldId parameter of the TagsEditor.WAV_CartChunkTimeMarkerFieldGet method

enumCoreAudioDeviceStates

nStateMask parameter of the CoreAudioDevices.Enum method

enumCoreAudioDataFlows

nDataFlow parameter of most methods of the CoreAudioDevices COM object

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

enumAmazonStoreInfo

nInfo parameter of the AmazonStoreCdInfoGet method

enumMidiPositionUnits

nPositionUnit parameter of the MIDI.SeekToPosition, MIDI:MarkersEnumItemGet, MIDI.StreamEventsEnumFromRange, MIDI.StreamEventsEnumItemGet,   MIDI.TriggerAdd, MIDI.TriggerSetPos methods.

enumMidiMarkerNotifications

nMarkerType parameter of the MidiMarkerNotification event and of the MIDI.MarkersEnableNotifications, MIDI.MarkersEnum and MIDI:MarkersEnumItemGet methods.

enumStreamMidiEvents

nMidiEvent parameter of the MidiStreamEventNotification event and of the MIDI.StreamEventApply, MIDI:StreamEventValueGet, MIDI.StreamEventsEnableNotifications, MIDI.StreamEventsEnum, MIDI.StreamEventsEnumFromRange, MIDI:StreamEventsEnumItemGet, MIDI.StreamEventsListItemAdd, MIDI.StreamEventsListItemModify, MIDI.StreamEventsListItemGet methods.

enumMidiKeyboardOrientations

nOrientation parameter of the MIDI.KeyboardCreate method

enumMidiSoundFontStringInfo

nInfo parameter of the MIDI.SoundFontInfoStringGet method

enumMidiSoundFontNumInfo

nInfo parameter of the MIDI.SoundFontInfoNumGet method

enumVstType

nType parameter of the VST.GetType method

enumWasapiDeviceTypes

nDeviceType parameter of the WASAPI.AttachInputDeviceToPlayer, 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

enumOSDAutoMoveDirection

nDirection parameter of the VideoMixer.OSDItemMovementSet method

enumWaveformStereoModes

nStereoVisualizationMode parameter of the WSCROLLER_SETTINGS structure

enumWaveScrollerAutoUpdate

nUpdateSpeed parameter of the WSCROLLER_SETTINGS structure

enumBitmapModes

nMode parameter of the WaveformScroller.SetBackPictureFromFile and WaveformScroller.SetBackPictureFromHandle methods

enumVideoImageAdjustProps

nProperty parameter of the VideoPlayer.ImageAdjustPropertyGet, VideoPlayer.ImageAdjustPropertySet and VideoPlayer.ImageAdjustPropertyRangeGet methods

enumGraphicItemMaskValues

nGraphicItemsMask field of the WSCROLLER_SETTINGS data structure

enumWaveformLineDashStyles

nPositionLineDashStyle field of the WSCROLLER_SETTINGS data structure

enumLineCaps

nPositionLineHighCap and nPositionLineLowCap fields of the WSCROLLER_SETTINGS data structure

enumLineDashCaps

nPositionLineDashCap field of the WSCROLLER_SETTINGS data structure

enumBassModules

nModule parameter of the BassModuleGet method

enumBassPluginStreamCreateFuncs

nType parameter of the BassPluginStreamCreateFunc method

enumComponentTypes

nComponentType parameter of the MixerVolumeSet, MixerVolumeGet, MixerMuteSet and MixerMuteGet methods

enumInternetSetting

nSetting parameter of the InternetSettingsGet and InternetSettingsSet methods

enumMediaTypes

nMediaType parameter of the Downloader.SessionStartToPlayer method

enumDataTypes

nDataType parameter of the MediaFileDecoder.FileDataGet method

enumDecodePositionUnit

nPositionUnit parameter of the MediaFileDecoder.FilePositionGet and MediaFileDecoder.FilePositionSet methods

enumPlayerEvents

nEvent parameter of the CallbackForPlayersEventsSet method

enumCdDrivesEvents

nEvent parameter of the CallbackForCdDrivesEventsSet method

enumCoreAudioEvents

nEvent parameter of the CallbackForCoreAudioEventsSet method

enumSapiVoiceAttributes

nAttribute parameter of the SoundGenerator.SpeechVoiceAttributeGet method

enumSoundGenWaveTypes

nWaveType parameter of the SoundGenerator.StreamCreateTone, SoundGenerator.StreamChannelAddTone and SoundGenerator.StreamElementToneTypeGet methods

enumSoundGenNoiseTypes

nNoiseType parameter of the SoundGenerator.StreamCreateNoise, SoundGenerator.StreamChannelAddNoise and SoundGenerator.StreamElementToneNoiseGet methods

enumSoundGenSlidingWaveTypes

nWaveType parameter of the SoundGenerator.StreamCreateSlidingTone, SoundGenerator.StreamChannelAddSlidingTone  and SoundGenerator.StreamElementSlidingToneTypeGet methods

enumSoundGeneratorTypes

nType parameter of the SoundGenerator.StreamElementTypeGet method

enumSpectrumEnhTypes

nGraphType field of the SPECTR_ENH_GENERAL_SETTINGS data structure

enumSpectrumEnhWindowTypes

nFFTWindowType field of the SPECTR_ENH_GENERAL_SETTINGS data structure

enumZipEncryptionTypes

nEncryptionType parameter of the ZIP.Create 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 MyPlayer, exists on a form or dialog box. The purpose of this sample code is to check if a certain player is in paused state.

 

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

Microsoft Visual Basic 5 and 6

Microsoft Visual Basic.NET

Microsoft Visual C#.NET

 

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

 

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

 

You can test a certain player (0 in this sample) for the "paused" state using the following line of code:

 

if (MyControl.GetPlayerStatus (0) == SOUND_PAUSED)

 // do something

 .....

else

 // do something else

 .....

 

 

The GetPlayerStatus method is defined by the control wrapper class CAmp3dj contained inside the amp3dj.cpp and amp3dj.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 "amp3dj.h"

 

The mnemonic constant SOUND_PAUSED 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 MyControl.GetPlayerStatus (0)

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

amp3dj_i000036

 

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

If MyControl.GetPlayerStatus (0) = SOUND_PAUSED Then

 ' do something

 .....

Else

 ' do something else

 .....

End If

 

Microsoft Visual Basic.NET

 

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

After typing the code...

If MyControl.GetPlayerStatus (0)

press the "=" key on your keyboard. IntelliSense displays the listbox of the possible values that can be assigned to the method parameter.

 

amp3dj_i000037

 

Select the AMP3DJLib.enumStates.SOUND_PAUSED value so the complete line of code will be:

If MyControl.GetPlayerStatus(0) = AMP3DJLib.enumStates.SOUND_PAUSED 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, the following code must be inserted at the beginning of the form management file:

using AMP3DJLib;

 

After typing the code...

if (MyControl.GetPlayerStatus (0) == enumStates

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

if (MyControl.GetPlayerStatus (0) == enumStates.

amp3dj_i000038

 

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

if (MyControl.GetPlayerStatus (0) == enumStates.SOUND_PAUSED)

   // do something

   ....

else

   // do something else

   ....