API Guide Home (Online version only) |

# palmOneSndFileStream.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  * @file    palmOneSndFileStream.h
    00012  *
    00013  * @brief   Public 68K include file for sound files stream support for Treo 600
    00014  *          and Treo 650 smartphones.
    00015  *
    00016  * This header file and associated header files support the specific sound
    00017  * functionality of the Treo smartphones. You should use the Palm OS Sound
    00018  * Manager APIs for most of your work.
    00019  *
    00020  * Notes:
    00021  * The calling application should always load this library with
    00022  * SysLibLoad() before use, even if it is already open by another
    00023  * application(ie, SysLibFind() returns a valid refnum). When
    00024  * the application is done with the library, it should be
    00025  * unloaded with SysLibRemove(). We do this because there is
    00026  * no good way to synchronize loading and unloading of libraries
    00027  * among multiple applications. It also greatly simplifies internal
    00028  * synchronization.
    00029  */
    00030
    00031
    00032 #ifndef __SNDFILESTREAM_H__
    00033 #define __SNDFILESTREAM_H__
    00034
    00035 /***********************************************************************
    00036  * Palm OS common definitions
    00037  ***********************************************************************/
    00038
    00039 #include <PalmTypes.h>
    00040 #include <SystemMgr.h>
    00041 #include <SystemResources.h>
    00042
    00043 #if defined( BUILDING_SNDFILESTREAM ) || defined( BUILDING_SNDFILESTREAM_INTO_APP )
    00044 #define SNDFILESTREAM_TRAP( x ) /**<Helper macro */
    00045 #else
    00046 #define SNDFILESTREAM_TRAP( x ) SYS_TRAP( x ) /**<Helper macro. */
    00047 #endif
    00048
    00049 #include <FileStream.h>
    00050 #include <SoundMgr.h>
    00051 #include <VFSMgr.h>
    00052
    00053 /**
    00054  * @name Type and creator of the Sound File Stream library
    00055  *
    00056  * Used with FtrGet.
    00057  */
    00058 /*@{*/
    00059 #define kSndFileStreamLibType       sysFileTLibrary                                     /**<Type of the sound file stream library. */
    00060 #define kSndFileStreamLibCreator    'sfsL'                                              /**<Creator ID of the sound file stream library. */
    00061 #define kSndFileStreamLibName       "SndFileStream-sfsL"                                /**<Name of the sound file stream library. */
    00062 #define kSndFileStreamLibVersion    sysMakeROMVersion(1, 4, 0, sysROMStageRelease, 20)  /**<Version of the sound file stream library. */
    00063 /*@}*/
    00064
    00065 /**
    00066  * @name Utility macros
    00067  *
    00068  * These macros take care of opening and closing the sound file stream library
    00069  * in various situations.
    00070  */
    00071 /*@{*/
    00072 #if defined( BUILDING_SNDFILESTREAM_INTO_APP )
    00073 #define SndFileStreamOpenLibrary( refNum, err )     \
    00074     {                                               \
    00075         (refNum)    = 0;                            \
    00076         (err)       = errNone;                      \
    00077     }
    00078 #define SndFileStreamCloseLibrary( refNum, err )    \
    00079     {                                               \
    00080         (refNum)    = sysInvalidRefNum;             \
    00081         (err)       = errNone;                      \
    00082     }
    00083 #else
    00084 #define SndFileStreamOpenLibrary( refNum, err )                 \
    00085     {                                                           \
    00086         Boolean loaded;                                         \
    00087                                                                 \
    00088         loaded = false;                                         \
    00089         (err) = SysLibFind( kSndFileStreamLibName, &(refNum) ); \
    00090         if ( sysErrLibNotFound == (err) )                       \
    00091         {                                                       \
    00092             (err) = SysLibLoad( kSndFileStreamLibType,          \
    00093                 kSndFileStreamLibCreator, &(refNum) );          \
    00094             loaded = true;                                      \
    00095         }                                                       \
    00096                                                                 \
    00097         if ( errNone == (err) )                                 \
    00098         {                                                       \
    00099             (err) = SndFileStreamLibOpen( (refNum) );           \
    00100             if ( errNone != (err) )                             \
    00101             {                                                   \
    00102                 if ( loaded )                                   \
    00103                 {                                               \
    00104                     SysLibRemove( (refNum) );                   \
    00105                 }                                               \
    00106                                                                 \
    00107                 (refNum) = sysInvalidRefNum;                    \
    00108             }                                                   \
    00109         }                                                       \
    00110         else                                                    \
    00111         {                                                       \
    00112             (refNum) = sysInvalidRefNum;                        \
    00113         }                                                       \
    00114     }
    00115 #define SndFileStreamCloseLibrary( refNum, err )                \
    00116     {                                                           \
    00117         if ( sysInvalidRefNum == (refNum) )                     \
    00118         {                                                       \
    00119             (err) = sysErrParamErr;                             \
    00120         }                                                       \
    00121         else                                                    \
    00122         {                                                       \
    00123             (err) = SndFileStreamLibClose( (refNum) );          \
    00124             if ( errNone == (err) )                             \
    00125             {                                                   \
    00126                 (err) = SysLibRemove( (refNum) );               \
    00127                 (refNum) = sysInvalidRefNum;                    \
    00128             }                                                   \
    00129             else if ( kSndFileStreamLibErrStillOpen == (err) )  \
    00130             {                                                   \
    00131                 (err) = errNone;                                \
    00132             }                                                   \
    00133         }                                                       \
    00134     }
    00135 #endif
    00136 /*@}*/
    00137
    00138 /**
    00139  * @name Error codes
    00140  *
    00141  * These macros take care of opening and closing the sound file stream library
    00142  * in various situations.
    00143  */
    00144 /*@{*/
    00145 #define kSndFileStreamLibErrNone                    errNone
    00146 #define kSndFileStreamLibErrAlreadyOpen             1
    00147 #define kSndFileStreamLibErrNotOpen                 2
    00148 #define kSndFileStreamLibErrStillOpen               3
    00149 #define kSndFileStreamLibErrOutOfMemory             4
    00150 #define kSndFileStreamLibErrCantOpenFile            5
    00151 #define kSndFileStreamLibErrUnsupportedFile         6
    00152 #define kSndFileStreamLibErrCancel                  7
    00153 #define kSndFileStreamLibErrOperationNotSupported   8
    00154 /*@}*/
    00155
    00156 /**
    00157  * @name Play back sound file stream
    00158  *
    00159  * Use for playbackCount parameter of tagSndFileStreamData to play back a
    00160  * stream indefinitely.
    00161  */
    00162 /*@{*/
    00163 #define kSndFileStreamLibPlaybackForever    0xFFFF
    00164 /*@}*/
    00165
    00166 /**
    00167  * Notification broadcast by SndFileStream when it has completed playing a stream.
    00168  * This is an alternative to using callbacks in the case where SndFileStream is used
    00169  * by an ARM app (eg. Blazer) or by a 68K app.
    00170  *
    00171  * In playback mode, it means that the file has completely played.
    00172  * In recording mode, it means that it reaches the recording limit.
    00173  */
    00174 /*@{*/
    00175 #define sndFileStreamNotifyStreamComplete   'StrC'
    00176 /*@}*/
    00177
    00178 /**
    00179  * Notification broadcast by SndFileStream when it exceeds the recording limit.
    00180  * Currently this notification is handled by the libary itself, for example,
    00181  * stop the recording stream. The application should NOT expect to recieve this notification
    00182  * even it register it. Instead it should expect sndFileStreamNotifyStreamComplete notification to
    00183  * indicate that the recording limit has been reached.
    00184  */
    00185 /*@{*/
    00186 #define sndFileStreamNotifyRecComplete      'RecC'
    00187 /*@}*/
    00188
    00189 /**
    00190  * Sound file format
    00191  *
    00192  * The sound file format of the stream.
    00193  */
    00194 typedef enum tagSndFileFormatEnum
    00195 {
    00196     kSndFileFormatRaw = 0,  /**<Raw bytes. */
    00197     kSndFileFormatWAV,      /**<RIFF-WAVE. */
    00198     kSndFileFormatTreoQCP,  /**<RIFF-QLCM. */
    00199     kSndFileFormatTreoAMR,  /**<Raw RTP packets. */
    00200     kSndFileFormatMP3,      /**<MP3 format */
    00201     kSndFileFormatAAC       /**<AAC format */
    00202 }
    00203 SndFileFormatType;
    00204
    00205 /** Reference to sound file stream returned by SndFileStreamCreate()/Open() */
    00206 typedef void *SndFileStreamRef;
    00207
    00208 /**
    00209  * @brief Holds data about a sound file stream.
    00210  */
    00211 typedef struct tagSndFileStreamData
    00212 {
    00213     UInt16      streamFlags;        /**<Flag for the sound file stream. */
    00214     UInt16      streamMode;         /**<Use mode sndInput or sndOutput for sound file stream.*/
    00215     UInt32      streamRefCon;       /**<Reserved for third party use. */
    00216
    00217     UInt16      playbackCount;      /**<How many times to play the sound. Values of 0 and 1 both cause
    00218                                         the sound to be played back one time.  Is decremented each time
    00219                                         play back of the sound is restarted. */
    00220
    00221     UInt16      streamComplete;     /**<Set to true when the stream has stopped because
    00222                                         the playbackCount has been decremented to zero, maximumBytes is reached, or
    00223                                         maximumMilliseconds is reached */
    00224
    00225     UInt32      dataSize;           /**<Size of the audio data in bytes. */
    00226     UInt32      dataDuration;       /**<Duration of the audio data in milliseconds. */
    00227     UInt32      customDataSize;     /**<Size of custom data in bytes. */
    00228
    00229     UInt32      fileFormat;         /**<Format of the sound file stream.  For example, kSndFileFormatWAV. */
    00230     UInt32      sampleFormat;       /**<Format of the soud sample. Example: palmCodecAudioIMA_ADPCM */
    00231     UInt32      sampleRate;         /**<Sample rate of hte sound file in frames/sec.  For example, 8000. */
    00232     UInt32      sampleType;         /**<Type of the sound file.  For example, sndInt16. */
    00233     UInt32      sampleWidth;        /**<Whether the sound is stereo, mono, and so forth.  For example, sndMono. */
    00234     UInt32      sampleBlockAlign;   /**<Block alignment of the sound file.  For example, 256 for IMA ADPCM. */
    00235
    00236     UInt32      maximumMilliseconds;/**<Maximum milliseconds of play back. */
    00237     UInt32      maximumBytes;       /**<Maximum value for lastPlayedBytes. */
    00238
    00239     UInt32      currentMillisecond; /**<Current millisecond of audio. */
    00240     UInt32      lastByte;           /**<Last byte played or recorded on channel, */
    00241
    00242     MemPtr      customDataP;        /**<Pointer to custom data. */
    00243 }
    00244 SndFileStreamData, *SndFileStreamDataPtr;
    00245
    00246 /// Callback function passed when calling SndFileStreamCreate() and
    00247 /// SndFileStreamOpen(). It will be called during playback and recording.
    00248 ///
    00249 /// @param stream:              IN:  Reference to stream returned by SndFileStreamCreate()/SndFileStreamOpen().
    00250 /// @param streamDataP:         IN:  @see SndFileStreamData
    00251 /// @param customDataModified:  OUT: If true, custom data has been modified.
    00252 /// @retval Err Error code.
    00253 typedef Err (*SndFileStreamCallbackPtr)( SndFileStreamRef stream,
    00254     SndFileStreamDataPtr streamDataP, Boolean *customDataModified );
    00255
    00256 /**
    00257  * @brief Descriptions of the stream file.
    00258  *
    00259  * Used with SndFileStreamCreate()/SndFileStreamOpen()
    00260  */
    00261 typedef struct tagSndFileStreamFileSpec
    00262 {
    00263     UInt16  flags;      /**< Set to kSndFileStreamFileSpecFlagVFS or kSndFileStreamFileSpecFlagFileStream */
    00264
    00265     UInt16  volRefNum;  /**< The volume reference number returned from VFSVolumeEnumerate(). */
    00266
    00267     Char    *fileNameP; /**< Name of the stream file */
    00268
    00269     UInt32  fileCreator;/**< Creator ID of the stream file  */
    00270     UInt32  fileType;   /**< See File Stream Database Types */
    00271 }
    00272 SndFileStreamFileSpec, *SndFileStreamFileSpecPtr;
    00273
    00274 /**
    00275  * @name File Flags
    00276  *
    00277  */
    00278 /*@{*/
    00279 #define kSndFileStreamFileSpecFlagVFS           (0x0001) /**<VFS file */
    00280 #define kSndFileStreamFileSpecFlagFileStream    (0x0002) /**<File stream*/
    00281 /*@}*/
    00282
    00283 /**
    00284  * @name File stream database types
    00285  *
    00286  * File stream databases opened using kSndFileStreamFileSpecFlagFileStream.
    00287  *
    00288  */
    00289 /*@{*/
    00290 #define kSndFileTypeWAV 'WAVf'  /**<WAV file   -> kSndFileFormatWAV .    */
    00291 #define kSndFileTypeQCP 'QCPf'  /**<QCELP file -> kSndFileFormatTreoQCP. */
    00292 #define kSndFileTypeAMR 'AMRf'  /**<AMR file   -> kSndFileFormatTreoAMR. */
    00293 #define kSndFileTypeMP3 'MP3f'  /**<MP3 file   -> kSndFileFormatMP3      */
    00294 #define kSndFileTypeAAC 'AACf'  /**<AAC file   -> kSndFileFormatAAC      */
    00295 /*@}*/
    00296
    00297 /**
    00298  * @brief SndFileStreamDeviceControl param when cmd == hsSoundLibCreatorID
    00299  *
    00300  * Contains hsFormat/hsCmd pair to be used with PmSndStream() calls.
    00301  */
    00302 typedef struct tagSndFileStreamHsSoundCommandParam
    00303 {
    00304     UInt16  hsFormat;
    00305     UInt16  hsCmd;
    00306 }
    00307 SndFileStreamHsSoundCommandParam, *SndFileStreamHsSoundCommandParamPtr;
    00308
    00309 /**
    00310  * @name Library traps
    00311  *
    00312  */
    00313 /*@{*/
    00314 #define kSndFileStreamLibTrapVersion                (sysLibTrapCustom + 0)
    00315 #define kSndFileStreamLibTrapCreate                 (sysLibTrapCustom + 1)
    00316 #define kSndFileStreamLibTrapOpen                   (sysLibTrapCustom + 2)
    00317 #define kSndFileStreamLibTrapClose                  (sysLibTrapCustom + 3)
    00318 #define kSndFileStreamLibTrapStart                  (sysLibTrapCustom + 4)
    00319 #define kSndFileStreamLibTrapPause                  (sysLibTrapCustom + 5)
    00320 #define kSndFileStreamLibTrapStop                   (sysLibTrapCustom + 6)
    00321 #define kSndFileStreamLibTrapSeek                   (sysLibTrapCustom + 7)
    00322 #define kSndFileStreamLibTrapGetCurrentStreamData   (sysLibTrapCustom + 8)
    00323 #define kSndFileStreamLibTrapDeviceControl          (sysLibTrapCustom + 9)
    00324 #define kSndFileStreamLibTrapSetVolume              (sysLibTrapCustom + 10)
    00325 #define kSndFileStreamLibTrapGetVolume              (sysLibTrapCustom + 11)
    00326 #define kSndFileStreamLibTrapSetPan                 (sysLibTrapCustom + 12)
    00327 #define kSndFileStreamLibTrapGetPan                 (sysLibTrapCustom + 13)
    00328 #define kSndFileStreamLibTrapUIPlay                 (sysLibTrapCustom + 14)
    00329 #define kSndFileStreamLibTrapUIRecord               (sysLibTrapCustom + 15)
    00330 /*@}*/
    00331
    00332 #ifdef __cplusplus
    00333 extern "C" {
    00334 #endif
    00335
    00336 /// Opens the Sound File Stream library.
    00337 ///
    00338 /// @param libRefNum: IN:  Library reference number
    00339 /// @retval Err Error code.
    00340 extern Err SndFileStreamLibOpen( UInt16 libRefNum )
    00341     SNDFILESTREAM_TRAP( sysLibTrapOpen );
    00342
    00343 /// Closes the Sound File Stream library.
    00344 ///
    00345 /// @param libRefNum: IN:  Library reference number
    00346 /// @retval Err Error code.
    00347 extern Err SndFileStreamLibClose( UInt16 libRefNum )
    00348     SNDFILESTREAM_TRAP( sysLibTrapClose );
    00349
    00350 /// Standard library sleep routine.
    00351 ///
    00352 /// @param libRefNum: IN:  Library reference number
    00353 /// @retval Err Error code.
    00354 extern Err SndFileStreamLibSleep( UInt16 libRefNum )
    00355     SNDFILESTREAM_TRAP( sysLibTrapSleep );
    00356
    00357 /// Standard library wake routine.
    00358 ///
    00359 /// @param libRefNum: IN:  Library reference number
    00360 /// @retval Err Error code.
    00361 extern Err SndFileStreamLibWake( UInt16 libRefNum )
    00362     SNDFILESTREAM_TRAP( sysLibTrapWake );
    00363
    00364 /// Retrieve the library version number.
    00365 ///
    00366 /// @param libRefNum:    IN:  Library reference number
    00367 /// @param *versionP:    OUT: Library version number.
    00368 /// @retval Err Error code.
    00369 extern Err SndFileStreamLibVersion( UInt16 libRefNum, UInt32 *versionP )
    00370     SNDFILESTREAM_TRAP( kSndFileStreamLibTrapVersion );
    00371
    00372 /// Create a new sound file stream.
    00373 ///
    00374 /// @param libRefNum:    IN:  Library reference number
    00375 /// @param streamP:      OUT: Reference to the created sound stream
    00376 /// @param streamDataP:  IN:  @see SndFileStreamData
    00377 /// @param fileSpecP:    IN:  Description of the file to be created
    00378 /// @param callbackP:    IN:  User defined callback function, to be called on playback/recording.
    00379 /// @retval Err Error code.
    00380 extern Err SndFileStreamCreate( UInt16 libRefNum, SndFileStreamRef *streamP,
    00381         SndFileStreamDataPtr streamDataP, SndFileStreamFileSpecPtr fileSpecP,
    00382         SndFileStreamCallbackPtr callbackP )
    00383     SNDFILESTREAM_TRAP( kSndFileStreamLibTrapCreate );
    00384
    00385 /// Open an already existing sound file stream.
    00386 ///
    00387 /// @param libRefNum:    IN:  Library reference number
    00388 /// @param streamP:      OUT: Reference to the opened sound stream.
    00389 /// @param streamDataP:  IN:  @see SndFileStreamData
    00390 /// @param fileSpecP:    IN:  Description of the file to be opened.
    00391 /// @param callbackP:    IN:  User defined callback function, to be called on playback/recording.
    00392 /// @retval Err Error code.
    00393 extern Err SndFileStreamOpen( UInt16 libRefNum, SndFileStreamRef *streamP,
    00394         SndFileStreamDataPtr streamDataP, SndFileStreamFileSpecPtr fileSpecP,
    00395         SndFileStreamCallbackPtr callbackP )
    00396     SNDFILESTREAM_TRAP( kSndFileStreamLibTrapOpen );
    00397
    00398 /// Close the reference to the file stream.
    00399 ///
    00400 /// @param libRefNum:    IN: Library reference number
    00401 /// @param stream:       IN: Reference to the sound stream, returned when creating/opening file stream.
    00402 /// @retval Err Error code.
    00403 extern Err SndFileStreamClose( UInt16 libRefNum, SndFileStreamRef stream )
    00404     SNDFILESTREAM_TRAP( kSndFileStreamLibTrapClose );
    00405
    00406 /// Start streaming sound into file.
    00407 ///
    00408 /// @param libRefNum:    IN: Library reference number
    00409 /// @param stream:       IN: Reference to the sound stream, returned when creating/opening stream.
    00410 /// @retval Err Error code.
    00411 extern Err SndFileStreamStart( UInt16 libRefNum, SndFileStreamRef stream )
    00412     SNDFILESTREAM_TRAP( kSndFileStreamLibTrapStart );
    00413
    00414 /// Pause sound streaming.
    00415 ///
    00416 /// @param libRefNum:    IN: Library reference number
    00417 /// @param stream:       IN: Reference to the sound stream, returned when creating/opening stream.
    00418 /// @param pause:        IN: If true, pause. Otherwise, resume.
    00419 /// @retval Err Error code.
    00420 extern Err SndFileStreamPause( UInt16 libRefNum, SndFileStreamRef stream,
    00421         Boolean pause )
    00422     SNDFILESTREAM_TRAP( kSndFileStreamLibTrapPause );
    00423
    00424 /// Stop sound streaming.
    00425 ///
    00426 /// @param libRefNum:    IN: Library reference number
    00427 /// @param stream:       IN: Reference to the sound stream, returned when creating/opening stream.
    00428 /// @retval Err Error code.
    00429 extern Err SndFileStreamStop( UInt16 libRefNum, SndFileStreamRef stream )
    00430     SNDFILESTREAM_TRAP( kSndFileStreamLibTrapStop );
    00431
    00432 /// Move the pointer to the stream to a user-defined offset.
    00433 ///
    00434 /// @param libRefNum:       IN: Library reference number
    00435 /// @param stream:          IN: Reference to the sound stream, returned when creating/opening stream.
    00436 /// @param seekMilliseconds IN: Offset in milliseconds.
    00437 /// @retval Err Error code.
    00438 extern Err SndFileStreamSeek( UInt16 libRefNum, SndFileStreamRef stream,
    00439         UInt32 seekMilliseconds )
    00440     SNDFILESTREAM_TRAP( kSndFileStreamLibTrapSeek );
    00441
    00442 /// Get streaming data.
    00443 ///
    00444 /// @param libRefNum:    IN:  Library reference number
    00445 /// @param stream:       IN:  Reference to the sound stream, returned when creating/opening stream.
    00446 /// @param streamDataP:  OUT: @see SndFileStreamData
    00447 /// @retval Err Error code.
    00448 extern Err SndFileStreamGetCurrentStreamData( UInt16 libRefNum,
    00449         SndFileStreamRef stream, SndFileStreamDataPtr streamDataP )
    00450     SNDFILESTREAM_TRAP( kSndFileStreamLibTrapGetCurrentStreamData );
    00451
    00452 /// Control device when streaming.
    00453 ///
    00454 /// @param libRefNum:    IN: Library reference number
    00455 /// @param stream:       IN: Reference to the sound stream, returned when creating/opening stream.
    00456 /// @param cmd:          IN: No definition.
    00457 /// @param param:        IN: No definition.
    00458 /// @param size:         IN: No definition.
    00459 /// @retval Err Error code.
    00460 extern Err SndFileStreamDeviceControl( UInt16 libRefNum,
    00461         SndFileStreamRef stream, Int32 cmd, void *param, Int32 size )
    00462     SNDFILESTREAM_TRAP( kSndFileStreamLibTrapDeviceControl );
    00463
    00464 /// See SndStreamSetVolume() documented under Palm OS Sound Manager API.
    00465 ///
    00466 /// @param libRefNum:    IN: Library reference number
    00467 /// @param stream:       IN: Reference to the sound stream, returned when creating/opening stream.
    00468 /// @param volume:       IN: No definition.
    00469 /// @retval Err Error code.
    00470 extern Err SndFileStreamSetVolume( UInt16 libRefNum, SndFileStreamRef stream,
    00471         Int32 volume )
    00472     SNDFILESTREAM_TRAP( kSndFileStreamLibTrapSetVolume );
    00473
    00474 /// See SndStreamGetVolume() documented under Palm OS Sound Manager API.
    00475 ///
    00476 /// @param libRefNum:   IN:  Library reference number
    00477 /// @param stream:      IN:  Reference to the sound stream, returned when creating/opening stream.
    00478 /// @param volumeP:     OUT: Range 0 - 32k. See Palm OS SoundMgr API documentation for more details.
    00479 /// @retval Err Error code.
    00480 extern Err SndFileStreamGetVolume( UInt16 libRefNum, SndFileStreamRef stream,
    00481         Int32 *volumeP )
    00482     SNDFILESTREAM_TRAP( kSndFileStreamLibTrapGetVolume );
    00483
    00484 /// Set stereo balance.
    00485 /// See SndStreamSetPan() documented under Palm OS Sound Manager API.
    00486 ///
    00487 /// @param libRefNum:    IN: Library reference number
    00488 /// @param stream:       IN: Reference to the sound stream.
    00489 /// @param panPosition:  IN: Range [-1024, 1024]
    00490 /// @retval Err Error code.
    00491 extern Err SndFileStreamSetPan( UInt16 libRefNum, SndFileStreamRef stream,
    00492         Int32 panPosition )
    00493     SNDFILESTREAM_TRAP( kSndFileStreamLibTrapSetPan );
    00494
    00495 /// Get stereo balance.
    00496 /// See SndStreamGetPan() documented under Palm OS Sound Manager API.
    00497 ///
    00498 /// @param libRefNum:        IN:  Library reference number
    00499 /// @param stream:           IN:  Reference to the sound stream.
    00500 /// @param panPositionP:     OUT: Range [-1024, 1024]
    00501 /// @retval Err Error code.
    00502 extern Err SndFileStreamGetPan( UInt16 libRefNum, SndFileStreamRef stream,
    00503         Int32 *panPositionP )
    00504     SNDFILESTREAM_TRAP( kSndFileStreamLibTrapGetPan );
    00505
    00506 /// Play sound stream with UI
    00507 ///
    00508 /// @param libRefNum:        IN: Library reference number
    00509 /// @param fileSpecP:        IN: Pointer to the sound file to be played.
    00510 /// @param allowRerecord:    IN: No definition.
    00511 /// @retval Err Error code.
    00512 extern Err SndFileStreamUIPlay( UInt16 libRefNum,
    00513         SndFileStreamFileSpecPtr fileSpecP, Boolean allowRerecord )
    00514     SNDFILESTREAM_TRAP( kSndFileStreamLibTrapUIPlay );
    00515
    00516 /// Record sound stream with UI
    00517 ///
    00518 /// @param libRefNum:        IN: Library reference number
    00519 /// @param streamDataP:      IN: Stream data to be used for recording.
    00520 /// @param fileSpecP:        IN: Pointer to the sound file to be recorded.
    00521 /// @param allowRerecord:    IN: No definition.
    00522 /// @retval Err Error code.
    00523 extern Err SndFileStreamUIRecord( UInt16 libRefNum,
    00524         SndFileStreamDataPtr streamDataP, SndFileStreamFileSpecPtr fileSpecP,
    00525         Boolean allowRerecord )
    00526     SNDFILESTREAM_TRAP( kSndFileStreamLibTrapUIRecord );
    00527
    00528 #ifdef __cplusplus
    00529 }
    00530 #endif
    00531
    00532 #endif //__SNDFILESTREAM_H__

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