The UMSAudioFileMClass class is a metaclass. It defines the class methods for children of the UMSAudioFile base class. In particular, UMSAudioFileMClass specifies creation methods for UMSAudioFile objects.
The metaclass provides a method to construct a specific audio file based on data in the configuration file and either an application supplied alias or a pathname to a file with audio data. This allows an application to be ported to a new type of audio file by adding information in the configuration file. This is the preferred construction technique for applications.
To learn more about the UMSAudioFileMClass class, see:
For introductory information, see MetaClass Objects.
To avoid name collision on defines, integer values have been captured as enumeration lists. The set of valid values from an enumerated list can vary with the application. The detailed method descriptions describe the valid or possible values for the specific use. The enumerated lists that are defined for this object are listed as follows:
enum ReturnCode { Success, Failure, FatalUMSError, NoConfigObject, AliasNotFound, PropertyNotFound, InvalidClassName, NotAChild, UnsupportedFormat, FilePermissions, FileNotFound };
This method returns an instantiated child of the UMSAudioFile class that is capable of processing the file indicated by the pathname. The child returned depends upon interaction with a UMSConfig object.
For certain Error Codes, more specific information can be obtained from the error_string parameter.
Error Code | error_string |
---|---|
FileNotFound | The specified file does not exist. |
This method returns an instantiated child of the UMSAudioFile class as determined by the alias parameter. The child returned depends upon interaction with a UMSConfig object.
For certain Error Codes, more specific information can be obtained from the error_string parameter.
The AudioFileMClass methods use the configuration file to determine that particular subclass of the AudioFile class to instantiate. The make_by_pathname method first uses the FiletypeDetector object and the Detector.audio stanza to run a series of detectors on the file indicated by the pathname parameter. This process yields a file_type_alias.
Once the AudioFileMClass class has a file_type_alias (whether through the FiletypeDetector or through direct invocation of the make_by_alias method), it uses the Config object to look up that particular AudioFile subclass to instantiate.
detector.audio: detection_module "d_WAVE" file_type_alias "WAVE" *NEXT: detection_module "d_SND" file_type_alias "SND" *NEXT: detection_module "d_RAW" file_type_alias "RAW"
WAVE: CLASS_UMSAudioFile "UMSWavFile" audio_formats_alias "UMSAudioFormats"
For introductory information, see MetaClass Objects.