API Guide Home (Online version only) |

# PalmSoundCustomCtrl.h

Go to the documentation of this file.

    00001 /******************************************************************************
    00002  * Copyright (c) 2004 palmOne, Inc. or its subsidiaries.
    00003  * All rights reserved.
    00004  *****************************************************************************/
    00005 /**
    00006  * @ingroup Sound
    00007  *
    00008  */
    00009
    00010 /**
    00011  *
    00012  * @file    PalmSoundCustomCtrl.h
    00013  *
    00014  * @brief   Public 68K include file for the Sound Manager custom controls for the
    00015  *          IMA_ADPCM codec for Treo 600 and Treo 650 smartphones.
    00016  *
    00017  * This header file and associated header files support the specific sound
    00018  * functionality of the Treo smartphones. You should use the Palm OS Sound
    00019  * Manager APIs for most of your work.
    00020  *
    00021  * Notes:
    00022  * How to use the IMA_ADPCM code custom control:
    00023  *
    00024  * When you create a stream, make sure you set the format to sndFormatIMA_ADPCM and
    00025  * that the type is set to 0.
    00026  *
    00027  * Then use the custom control to set the block align  paramter:
    00028  *
    00029  * SndCodecCustomControlType ct;
    00030  * UInt16 blockAlign= Swap16(blockAlign); // This needs to be in little endian
    00031  * ct.apiCreator    = Swap32(codecDriverIMAADPCM);
    00032  * ct.apiSelector   = Swap32(codecIMAADPCMSetBlockSize);
    00033  * ct.valueP        = (void*)Swap32(&blockAlign);
    00034  * ct.valueLenP     = NULL;
    00035  * err = SndStreamDeviceControl(streamRef, sndControlCodecCustomControl, &ct, sizeof(ct));
    00036  *
    00037  * The calling application should always load this library with
    00038  * SysLibLoad() before use, even if it is already open by another
    00039  * application(ie, SysLibFind() returns a valid refnum). When
    00040  * the application is done with the library, it should be
    00041  * unloaded with SysLibRemove(). We do this because there is
    00042  * no good way to synchronize loading and unloading of libraries
    00043  * among multiple applications. It also greatly simplifies internal
    00044  * synchronization.
    00045  */
    00046
    00047 #ifndef __PALMSOUNDCUSTOMCTRL_H__
    00048 #define __PALMSOUNDCUSTOMCTRL_H__
    00049
    00050 /**
    00051  * @name Custom Control for the IMA_ADPCM codec
    00052  *
    00053  */
    00054 /*@{*/
    00055 #define codecDriverIMAADPCM                 'APCM'  /**< IMA ADPCM codec driver. */
    00056 #define codecIMAADPCMSetBlockSize           0x0001  /**< IMA ADPCM block size set command. */
    00057 /*@}*/
    00058
    00059 /**
    00060  * IMA_ADPCM codec Custom Control type
    00061  *
    00062  */
    00063 enum {
    00064     sndControlCodecCustomControl = 12   /**< Param is a SndCodecCustomControlType*. */
    00065 };
    00066
    00067 /**
    00068  * @brief Holds Custom Control type information for the Extended Sound Manager.
    00069  *
    00070  * This structure is used to set/get values specific to a codec.
    00071  * Note that if this custom control comes from a 68K app, it's the responsibility
    00072  * of the 68K app to flip and align the fields of the structure correctly. The fields
    00073  * are defined as being in little-endian format.
    00074  */
    00075 typedef struct {
    00076     UInt32  apiCreator;     /**<Codec creator. (codecDriverIMAADPCM...) */
    00077     UInt32  apiSelector;    /**<Codec selector. (codecIMAADPCMSetBlockSize...) */
    00078     void    *valueP;        /**<Pointer to the parameters to be passed to the codec. */
    00079     UInt16  *valueLenP;     /**<Size of the parameters to be passed to the codec. */
    00080 } SndCodecCustomControlType;
    00081
    00082
    00083 #endif // __PALMSOUNDCUSTOMCTRL_H__
    00084

Top | Palm Developer Network © 2004-2008, Palm, Inc. All rights reserved. Generated on Fri Jun 13 10:06:54 2008 for Palm API Guide