Copyright © 2001-2008 MultiMedia Soft 
Return to Table of contents  
 
How to use Mnemonic Constant
 
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
enumStates
return value of GetPlayerStatus method
enumTagVersions
return value of GetMp3TagVersion method
enumScaleUnits
enumFileTypes
return value of GetFileType method
enumTag1Fields
iField parameter of the GetMp3Tag1Field method
enumGranulType
ForwRewGranularityType
enumTagTypes
nTagType parameter of the IsTagAvailable and GetTagString methods
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
enumVuBandsMode
enumWaveformUpdateRes
enumFadeOutModes
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 GetPlayerVolumeEx and SetPlayerVolumeEx methods
enumDirectXEffects
enumEaxEffects
enumEventStreaming
nState parameter of DownloadBuffering event
enumEventLoadStreamResults
nResult parameter of StreamLoaded event
enumWaveformResolutions
enumWaveformTypes
enumSpeakersConfig
enumSpeakers
nSpeaker parameter of the SetPlayerSpeaker  PreAmplifierGetSpeakerValue and PreAmplifierSetSpeakerValue methods, return value of the GetPlayerSpeaker and method
enumCddbAlbumInfo
nInfo parameter of the CddbGetAlbumInfo method
enumCdCoverSizes
nCoverSize parameter of the GetCdCoverPictureURL, GetCdCoverPictureFile 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 and LoadSoundFromRawMemory methods
enumLrcFileIdTags
nTagType parameter of the LrcIdTagGet 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: 
     
    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.  
     
     
     
    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. 
     
    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 
         .... 
     
     
     
     
     
     
     
     
     
    Copyright © 2001-2008 MultiMedia Soft 
    Return to Table of contents