Copyright © 2005-2008 MultiMedia Soft 
Return to Table of contents  
 
How to use enumerated types 
 
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
enumPlayerStatus
return value of GetPlayerStatus method
enumScaleUnits
enumFileTypes
nFileType property of the SoundInfo class
enumTagId3Versions
nMP3TagVersion property of the SoundInfo class
enumTagTypes
nTagType parameter of the IsTagAvailable and GetTagString methods
enumPlayListModes
nMode parameter of the PlayListLoad and PlayListCreate methods
enumPlayListFormats
nFormat parameter of the PlayListSave method
enumPlayListStrings
nString parameter of the PlayListGetItemString method
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 GetPlayerVolume and SetPlayerVolume methods
enumDirectXEffects
enumEAXEffects
SetEAXEffect method
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 enumerated types in your code. These examples assume that one instance of the control, named AudioDjStudio1, exists on a form. The purpose of this sample code is to check if a certain player is in paused state. 
  • Microsoft Visual Basic.NET 
  • Microsoft Visual C#.NET 
  •  
     
    Microsoft Visual Basic.NET 
     
    After typing the code... 
    if (audioDjStudio1.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 AudioDjStudio.enumPlayerStatus.SOUND_PAUSED value so the complete line of code will be: 
    If (AudioDjStudio1.GetPlayerStatus(0) = AudioDjStudio.enumPlayerStatus.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, 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 AudioDjStudio; 
     
    After typing the code... 
    if (audioDjStudio1.GetPlayerStatus (0) = enumPlayerStatus 
    press the "." key on your keyboard. Note that to use Intellisense, you must add enumPlayerStatus after the equal sign in order to trigger the enumPlayerStatus enumerated type. After typing a period, Intellisense is activated.    
     
     
    Select the SOUND_PAUSED value so the complete line of code will be: 
    if (audioDjStudio1.GetPlayerStatus (0) = enumPlayerStatus.SOUND_PAUSED) 
         // do something 
         .... 
    else 
         // do something else 
         .... 
     
     
     
     
     
     
     
     
     
     
    Copyright © 2005-2008 MultiMedia Soft 
    Return to Table of contents