Copyright © 2006-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

enumRecorderStatus

Status property

enumVuBandsMode

VUMeter.BandType property

enumOscillType

Oscilloscope.Type property

enumWaveformRes

Waveform.Resolution property

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

enumCddbAlbumInfo

nInfo parameter of the CddbGetAlbumInfo method

enumCdCoverSizes

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

enumEncodingFormats

EncodeFormats.ForRecording, EncodeFormats.ForCdRipping and EncodeFormats.ForExporting properties

enumResampleModes

EncodeFormats.ResampleMode property

enumWavEncodeModes

EncodeFormats.WAV.EncodeMode property

enumWmaEncodeModes

EncodFormats.WMA.EncodeMode property and nEncodeMode parameter of the EncodeFormats.WMA.GetEncodingProfileInfo method.

enumMp2EncodeModes

EncodeFormats.MP2.EncodeMode property

enumMp3EncodeModes

EncodeFormats.MP3.EncodeMode property

enumMp3EncodePresets

EncodeFormats.MP3.Preset property

enumOggEncodeModes

EncodeFormats.OGG.EncodeMode property

enumAacEncodeModes

EncodeFormats.AAC.EncodeMode property

enumAcmEncodeModes

EncodeFormats.ACM.EncodeMode property

enumW64EncodeModes

EncodeFormats.W64.EncodeMode property

enumAIFFEncodeModes

EncodeFormats.AIFF.EncodeMode property

enumAUEncodeModes

EncodeFormats.AU.EncodeMode property

enumPAFEncodeModes

EncodeFormats.PAF.EncodeMode property

enumSVXEncodeModes

EncodeFormats.PAF.EncodeMode property

enumNISTEncodeModes

EncodeFormats.NIST.EncodeMode property

enumVOCEncodeModes

EncodeFormats.VOC.EncodeMode property

enumIRCAMEncodeModes

EncodeFormats.IRCAM.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 StartFromFileRaw and StartFromMemoryRaw methods

enumRecordingModes

nMode parameter of the SetRecordingMode method

enumScaleUnits

nScaleUnits parameter of the RecordedSound.SeekPlayPosition and CdRippingSetRange methods

enumWaveformTypes

nWaveformType parameter of the WaveformAnalyzer.BitmapViewSaveToFile and WaveformAnalyzer.GetMinMaxPeakLevelsForRange methods

enumSoundEditCommands

nCommand parameter of the SoundEditStarted and SoundEditDone events

enumTrackerCursorModes

nCursorMode parameter of the WaveformAnalyzer.SetTrackerCursors method

enumGraphicBarOrientations

nOrientation member of the GRAPHIC_BAR_SETTINGS data structure

enumGraphicBarShapes

nShape member of the GRAPHIC_BAR_SETTINGS data structure

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.

enumMouseActions

nAction parameter of the WaveAnalyzerMouseNotification event

enumBitmapModes

nWaveformType parameter of the WaveformAnalyzer.SetBackPictureFromFile and WaveformAnalyzer.SetBackPictureFromHandle methods

enumVolumeScales

nScaleType parameter of the SetMixingParams, ASIO.DeviceChannelVolumeGet, ASIO.DeviceChannelVolumeSet, ASIO.DeviceMasterVolumeGet and ASIO.DeviceMasterVolumeSet methods; nScaleType member of the WAVEFORM_ANALYZER_SETTINGS_2 data structure

enumAsioChannelModes

nChannelMode parameter of the ASIO.DeviceStart method

enumDriverTypes

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

enumWaveAnalyzerRectangles

nIdRectangle parameter of the WaveformAnalyzer.GetRectangle method

enumInputChannelTypes

Return value of the GetInputDeviceChannelType method

enumGraphicFormats

nFormat parameter of the WaveformAnalyzer.BitmapViewSaveToFile method

enumCommonDialogInfo

nInfo parameter of the CommonDialogGetInfoFromLastOpen and CommonDialogGetInfoFromLastSave methods.

enumVolumeScales

nScaleType parameter of the OutputVolumeSet and OutputVolumeGet methods.

enumPlaybackStatus

Return value of the GetPlaybackStatus 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

enumWasapiDeviceTypes

nDeviceType parameter of the 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

 

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 Recorder\include).

 

You can test in the recorder is currently ripping a CD track using the following line of code:

 

if (AudioSoundRecorder1.GetStatus () == RECORD_STATUS_CD_RIPPING)

 // do something

 .....

else

 // do something else

 .....

 

 

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

 

The mnemonic constant RECORD_STATUS_CD_RIPPING 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 AudioSoundRecorder1.Status

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

asrec_i000062

 

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

If ActiveSoundRecorder1.Status = RECORD_STATUS_CD_RIPPING Then

 ' do something

 .....

Else

 ' do something else

 .....

End If