API Guide Home (Online version only) |

# TonesLibTypes.h File Reference

## Detailed Description

Public 68K header file for the Ring Tone library on Treo devices.

This file contains the common constants for the tones and also the structure that contains the ring-tone related sound preferences.

Definition in file TonesLibTypes.h.

Go to the source code of this file.

## Data Structures

- struct ToneIdentifier
    No definition. More...
- struct ToneItemType
    Tone characteristics. More...
- struct SoundPreferenceIM
    Structure for IM Sound Pref. More...
- struct SoundPreferencePhone
    Structure for Phone Sound Pref. More...
- struct SoundPreferenceEmail
    Structure for Email Sound Pref. More...
- struct SoundPreferenceCalendar
    Structure for Calendar Sound Pref. More...
- struct SoundPreferenceSMS
    Structure for SMS Sound Pref. More...
- struct SoundPreferenceMMS
    Structure for MMS Sound Pref. More...
- struct SoundPreferenceNetworkSounds
    Structure for network related sounds. More...
- struct SoundPreference
    Structure containing all the Sound Preference data. More...
- union SoundPreference::_tonePrefs

## Defines

- #define tonesLibName "Tones Library"
- #define tonesLibCreator hsFileCTonesLib
- #define tonesLibType sysFileTLibrary
- #define kMaxTonesNameSize 32
- #define tonesLibPlayForever 0xFFFF
- #define toneInterruptMask 0x00C0
- #define kTonesDialogFlagNonModal 0x00000001

Error Codes

- #define tonesLibErrClass 0x9000
- #define tonesLibErrCreateDBFailed tonesLibErrClass | 1
- #define tonesLibErrNoMemory tonesLibErrClass | 2
- #define tonesLibErrNoTone tonesLibErrClass | 3
- #define tonesLibErrDBNotFound tonesLibErrClass | 4
- #define tonesLibErrDBWriteFailed tonesLibErrClass | 5
- #define tonesLibErrUserCancel tonesLibErrClass | 6
- #define tonesLibErrBadParams tonesLibErrClass | 7
- #define tonesLibErrUnknown tonesLibErrClass | 8
- #define tonesLibErrNotAllowed tonesLibErrClass | 9
- #define tonesLibErrAlreadyPlaying tonesLibErrClass | 10

Utility Macros

- #define CompareToneIdentifiers(tone1, tone2) (tone1.id == tone2.id && tone1.toneType == tone2.toneType)
- #define CopyToneIdentifier(destP, src)
- #define CopyMIDIToneIdentifier(destP, src)

Function Traps

- #define tonesLibTrapGetToneList sysLibTrapCustom
- #define tonesLibTrapGetToneIDs sysLibTrapCustom+1
- #define tonesLibTrapGetToneName sysLibTrapCustom+2
- #define tonesLibTrapPlayTone sysLibTrapCustom+3
- #define tonesLibTrapAddMidiTone sysLibTrapCustom+4
- #define tonesLibTrapManageTones sysLibTrapCustom+5
- #define tonesLibTrapDeleteTone sysLibTrapCustom+6
- #define tonesLibTrapGetSoundPrefs sysLibTrapCustom+7
- #define tonesLibTrapSetSoundPrefs sysLibTrapCustom+8
- #define tonesLibTrapInitTonesDB sysLibTrapCustom+9
- #define tonesLibTrapPickTone sysLibTrapCustom+10
- #define tonesLibTrapStopTone sysLibTrapCustom+11
- #define tonesLibTrapGetSoundOnVolume sysLibTrapCustom+12
- #define tonesLibTrapSetSoundOnVolume sysLibTrapCustom+13
- #define tonesLibTrapDoDialog sysLibTrapCustom+14
- #define tonesLibTrapGetToneSize sysLibTrapCustom+15
- #define tonesLibTrapToneCreate sysLibTrapCustom+16
- #define tonesLibTrapToneWrite sysLibTrapCustom+17
- #define tonesLibTrapToneClose sysLibTrapCustom+18
- #define tonesLibTrapToneRecord sysLibTrapCustom+19
- #define tonesLibTrapEscalateRingTones sysLibTrapCustom+20
- #define tonesLibTrapPlayRingTone sysLibTrapCustom+21
- #define tonesLibTrapSaveUndeletableTones sysLibTrapCustom+22
- #define tonesLibTrapCopyBackUndeletableTones sysLibTrapCustom+23

## Typedefs

- typedef UInt16 ToneType
- typedef UInt16 SoundPrefType
- typedef UInt16 ToneVolume
- typedef UInt8 TonePlayNumberTimes
- typedef UInt8 ToneRepeatInterval
- typedef UInt8 ToneTimeUnit
- typedef UInt8 ToneVibrateType
- typedef struct ToneItemType * ToneItemPtr

## Enumerations

- enum _ToneType {
  toneTypeMIDI,
  toneTypeWAV,
  toneTypeAMR,
  toneTypeSystemSound,
  toneTypeQCELP,
  toneTypeMP3,
  toneTypeAAC
  }
- enum _SoundPrefType {
  soundPrefTypePhone,
  soundPrefTypeEmail,
  soundPrefTypeCalendar,
  soundPrefTypeIM,
  soundPrefTypeMMS,
  soundPrefTypeSMS,
  soundPrefTypeNetworkSounds,
  soundPrefTypeLast
  }
- enum _ToneVolume {
  toneVolumeOff,
  toneVolume1,
  toneVolume2,
  toneVolume3,
  toneVolume4,
  toneVolume5,
  toneVolume6,
  toneVolume7
  }
- enum _TonePlayNumberTimes {
  tonePlayOnce,
  tonePlayTwice,
  tonePlay3Times,
  tonePlay5Times,
  tonePlay10Times,
  tonePlay100Times
  }
- enum _ToneRepeatInterval {
  toneRepeatEveryMinute,
  toneRepeatEvery5Minutes,
  toneRepeatEvery10Minutes,
  toneRepeatEvery30Minutes
  }
- enum _ToneTimeUnit {
  toneTimeUnitMinutes,
  toneTimeUnitHours,
  toneTimeUnitDays
  }
- enum _ToneVibrateType {
  toneVibrateNone,
  toneVibrateRing,
  toneVibrateAlert,
  toneVibrateMail,
  toneVibrateCalender,
  toneVibrateSMS,
  toneVibrateVoicemail,
  toneVibrateThenRing,
  toneInterruptPhone = 64,
  toneInterruptMode2 = 128,
  toneInterruptMode3 = 192
  }

## Define Documentation

#define CompareToneIdentifiers | ( | tone1,
|  | tone2 |  | ) | (tone1.id == tone2.id && tone1.toneType == tone2.toneType)

No definition.

Definition at line 73 of file TonesLibTypes.h.

#define CopyMIDIToneIdentifier | ( | destP,
|  | src |  | ) |

Value:

    destP->id = src; \
                 destP->toneType = toneTypeMIDI

No definition.

Definition at line 81 of file TonesLibTypes.h.

#define CopyToneIdentifier | ( | destP,
|  | src |  | ) |

Value:

    destP->id = src.id; \
                 destP->toneType = src.toneType

No definition.

Definition at line 76 of file TonesLibTypes.h.

#define kMaxTonesNameSize 32

Maximum size of a tone name.

Definition at line 47 of file TonesLibTypes.h.

#define kTonesDialogFlagNonModal 0x00000001

Hides the Done button from the play tone dialog.

Definition at line 317 of file TonesLibTypes.h.

#define toneInterruptMask 0x00C0

Definition at line 204 of file TonesLibTypes.h.

#define tonesLibCreator hsFileCTonesLib

Creator ID of the Tone Types library.

Definition at line 44 of file TonesLibTypes.h.

#define tonesLibErrAlreadyPlaying tonesLibErrClass | 10

No definition.

Definition at line 65 of file TonesLibTypes.h.

#define tonesLibErrBadParams tonesLibErrClass | 7

No definition.

Definition at line 62 of file TonesLibTypes.h.

#define tonesLibErrClass 0x9000

No definition.

Definition at line 55 of file TonesLibTypes.h.

#define tonesLibErrCreateDBFailed tonesLibErrClass | 1

No definition.

Definition at line 56 of file TonesLibTypes.h.

#define tonesLibErrDBNotFound tonesLibErrClass | 4

No definition.

Definition at line 59 of file TonesLibTypes.h.

#define tonesLibErrDBWriteFailed tonesLibErrClass | 5

No definition.

Definition at line 60 of file TonesLibTypes.h.

#define tonesLibErrNoMemory tonesLibErrClass | 2

No definition.

Definition at line 57 of file TonesLibTypes.h.

#define tonesLibErrNotAllowed tonesLibErrClass | 9

No definition.

Definition at line 64 of file TonesLibTypes.h.

#define tonesLibErrNoTone tonesLibErrClass | 3

No definition.

Definition at line 58 of file TonesLibTypes.h.

#define tonesLibErrUnknown tonesLibErrClass | 8

No definition.

Definition at line 63 of file TonesLibTypes.h.

#define tonesLibErrUserCancel tonesLibErrClass | 6

No definition.

Definition at line 61 of file TonesLibTypes.h.

#define tonesLibName "Tones Library"

Name of the Tone Types library.

Definition at line 43 of file TonesLibTypes.h.

#define tonesLibPlayForever 0xFFFF

Used to play a tone over and over indefinitely.

Definition at line 48 of file TonesLibTypes.h.

#define tonesLibTrapAddMidiTone sysLibTrapCustom+4

Trap ID for the function to add a MIDI tone. Note: This used to be tonesLibTrapAddTone. Leaving this trap number maintains binary compatability with existing applications. Recompiling older source code will fail since the new version of TonesLibAddTone takes toneType as an additional parameter.

Definition at line 328 of file TonesLibTypes.h.

#define tonesLibTrapCopyBackUndeletableTones sysLibTrapCustom+23

Trap ID for function to copy undeletable tones back.

Definition at line 352 of file TonesLibTypes.h.

#define tonesLibTrapDeleteTone sysLibTrapCustom+6

Trap ID for function to delete a tone.

Definition at line 335 of file TonesLibTypes.h.

#define tonesLibTrapDoDialog sysLibTrapCustom+14

Trap ID for function to display the tones list.

Definition at line 343 of file TonesLibTypes.h.

#define tonesLibTrapEscalateRingTones sysLibTrapCustom+20

Trap ID for function to set/query ringtone escalation.

Definition at line 349 of file TonesLibTypes.h.

#define tonesLibTrapGetSoundOnVolume sysLibTrapCustom+12

Trap ID for function to get the on volume of a sound type.

Definition at line 341 of file TonesLibTypes.h.

#define tonesLibTrapGetSoundPrefs sysLibTrapCustom+7

Trap ID for function to get a sound preference.

Definition at line 336 of file TonesLibTypes.h.

#define tonesLibTrapGetToneIDs sysLibTrapCustom+1

Trap ID for the function that gets the list of tone ids.

Definition at line 325 of file TonesLibTypes.h.

#define tonesLibTrapGetToneList sysLibTrapCustom

Trap ID for the function that gets the tone list.

Definition at line 324 of file TonesLibTypes.h.

#define tonesLibTrapGetToneName sysLibTrapCustom+2

Trap ID for the function that gets the name of a tone.

Definition at line 326 of file TonesLibTypes.h.

#define tonesLibTrapGetToneSize sysLibTrapCustom+15

Trap ID for function to get the size of a tone.

Definition at line 344 of file TonesLibTypes.h.

#define tonesLibTrapInitTonesDB sysLibTrapCustom+9

Trap ID for function to initialize the Tones database.

Definition at line 338 of file TonesLibTypes.h.

#define tonesLibTrapManageTones sysLibTrapCustom+5

Trap ID for function to manage tones.

Definition at line 334 of file TonesLibTypes.h.

#define tonesLibTrapPickTone sysLibTrapCustom+10

Trap ID for function to pick a tone to attach.

Definition at line 339 of file TonesLibTypes.h.

#define tonesLibTrapPlayRingTone sysLibTrapCustom+21

Trap ID for function to play a ringtone.

Definition at line 350 of file TonesLibTypes.h.

#define tonesLibTrapPlayTone sysLibTrapCustom+3

Trap ID for the function that plays a tone.

Definition at line 327 of file TonesLibTypes.h.

#define tonesLibTrapSaveUndeletableTones sysLibTrapCustom+22

Trap ID for function to create backup db.

Definition at line 351 of file TonesLibTypes.h.

#define tonesLibTrapSetSoundOnVolume sysLibTrapCustom+13

Trap ID for function to set the on volume of a sound type.

Definition at line 342 of file TonesLibTypes.h.

#define tonesLibTrapSetSoundPrefs sysLibTrapCustom+8

Trap ID for function to set a sound preference.

Definition at line 337 of file TonesLibTypes.h.

#define tonesLibTrapStopTone sysLibTrapCustom+11

Trap ID for function to stop the playback of the current tone.

Definition at line 340 of file TonesLibTypes.h.

#define tonesLibTrapToneClose sysLibTrapCustom+18

Trap ID for function to finish adding a new tone.

Definition at line 347 of file TonesLibTypes.h.

#define tonesLibTrapToneCreate sysLibTrapCustom+16

Trap ID for function to begin adding a new tone.

Definition at line 345 of file TonesLibTypes.h.

#define tonesLibTrapToneRecord sysLibTrapCustom+19

Trap ID for function to record a new tone.

Definition at line 348 of file TonesLibTypes.h.

#define tonesLibTrapToneWrite sysLibTrapCustom+17

Trap ID for function to write data to a new tone.

Definition at line 346 of file TonesLibTypes.h.

#define tonesLibType sysFileTLibrary

Type of the Tone Types library.

Definition at line 45 of file TonesLibTypes.h.

## Typedef Documentation

typedef UInt16 SoundPrefType

Holds sound preference type value

Definition at line 120 of file TonesLibTypes.h.

typedef struct ToneItemType * ToneItemPtr

typedef UInt8 TonePlayNumberTimes

Holds number of times to play a tone value

Definition at line 154 of file TonesLibTypes.h.

typedef UInt8 ToneRepeatInterval

Holds the tone repeat interval value

Definition at line 168 of file TonesLibTypes.h.

typedef UInt8 ToneTimeUnit

Holds the tone time unit value

Definition at line 182 of file TonesLibTypes.h.

typedef UInt16 ToneType

Holds tone type value

Definition at line 102 of file TonesLibTypes.h.

typedef UInt8 ToneVibrateType

Holds the tone vibrate type value

Definition at line 207 of file TonesLibTypes.h.

typedef UInt16 ToneVolume

Holds tone volume value

Definition at line 138 of file TonesLibTypes.h.

## Enumeration Type Documentation

enum _SoundPrefType

Sound preferences type

Enumerator:

  soundPrefTypePhone | Tone pref for phone.
  soundPrefTypeEmail | Tone pref for email.
  soundPrefTypeCalendar | Tone pref for Calendar.
  soundPrefTypeIM | Tone pref for IM.
  soundPrefTypeMMS | Tone pref for MMS.
  soundPrefTypeSMS | Tone pref for SMS.
  soundPrefTypeNetworkSounds | Tone pref for SMS.
  soundPrefTypeLast | Last item in enum. Please keep it as last item.

Definition at line 107 of file TonesLibTypes.h.

    00121 {

enum _TonePlayNumberTimes

Number of times to play tone

Enumerator:

  tonePlayOnce | Play once.
  tonePlayTwice | Play twice.
  tonePlay3Times | Play three times.
  tonePlay5Times | Play five times.
  tonePlay10Times | Play ten times.
  tonePlay100Times | Play one hundred times.

Definition at line 143 of file TonesLibTypes.h.

    00155 {

enum _ToneRepeatInterval

Tone repeat interval

Enumerator:

  toneRepeatEveryMinute | Repeat every minute.
  toneRepeatEvery5Minutes | Repeat every 5 minutes.
  toneRepeatEvery10Minutes | Repeat every 10 minutes.
  toneRepeatEvery30Minutes | Repeat every 30 minutes.

Definition at line 159 of file TonesLibTypes.h.

    00169 {

enum _ToneTimeUnit

Tone time unit

Enumerator:

  toneTimeUnitMinutes | Minutes
  toneTimeUnitHours | Hours
  toneTimeUnitDays | Days

Definition at line 173 of file TonesLibTypes.h.

    00183 {

enum _ToneType

Tone types

Enumerator:

  toneTypeMIDI | Record in MIDI Ring Tones DB.
  toneTypeWAV | WAV in a SndFileStream.
  toneTypeAMR | AMR in a SndFIleStream.
  toneTypeSystemSound | Unused.
  toneTypeQCELP | QCELP in a SndFileStream.
  toneTypeMP3 | MP3 in a SndFileStream
  toneTypeAAC | AAC in a SndFileStream

Definition at line 91 of file TonesLibTypes.h.

    00103 {

enum _ToneVibrateType

Tone vibrate type

Enumerator:

  toneVibrateNone | None
  toneVibrateRing | Phone ring event
  toneVibrateAlert | Alert event
  toneVibrateMail | New mail
  toneVibrateCalender | Calendar event
  toneVibrateSMS | New SMS
  toneVibrateVoicemail | New Voicemail
  toneVibrateThenRing | Phone vibrate-then-ring event
  toneInterruptPhone | Interrupt mode for phone '01' in upper two bits
  toneInterruptMode2 | Reserved interrupt mode '10' in upper two bits
  toneInterruptMode3 | Reserved interrupt mode '11' in upper two bits

Definition at line 187 of file TonesLibTypes.h.

    00207                {

enum _ToneVolume

Tone volume

Enumerator:

  toneVolumeOff | Volume off
  toneVolume1 | Volume level 1
  toneVolume2 | Volume level 2
  toneVolume3 | Volume level 3
  toneVolume4 | Volume level 4
  toneVolume5 | Volume level 5
  toneVolume6 | Volume level 6
  toneVolume7 | Volume level 7

Definition at line 125 of file TonesLibTypes.h.

    00139 {

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