• IXJCTL_TONE_CADENCE

    ioctl(ixj1, IXJCTL_TONE_CADENCE, IXJ_CADENCE *pToneCadence)

    Return Value

    Returns TRUE if the cadence is built correctly. Can return ENOMEM if there is not enough memory to build the cadence, or EFAULT if there is a problem with the cadence.

    Parameters

    A pointer to an IXJ_CADENCE structure.

    typedef struct {
            int index;
            int tone_on_time;
            int tone_off_time;
            int freq0;
            int gain0;
            int freq1;
            int gain1;
    } IXJ_CADENCE_ELEMENT;
    
    typedef struct {
            int elements_used;
            IXJ_CADENCE_TERM termination;
            IXJ_CADENCE_ELEMENT *ce;
    } IXJ_CADENCE;
    

    Remarks

    Plays a complex tone cadence

    Valid values for cadence.termination are PLAY_ONCE, REPEAT_LAST_ELEMENT, and REPEAT_ALL

    See Also:

    PHONE_PLAY_TONE, PHONE_SET_TONE_ON_TIME, PHONE_SET_TONE_OFF_TIME,

    Example:

    This example code will play a sequence of 2 tones 950Hz and 1400Hz at .33 seconds each.

    IXJ_CADENCE_ELEMENT ce[2];
    IXJ_CADENCE cadence;
    
    ce[0].index = 13;
    ce[0].tone_on_time  = 0x0520;
    ce[0].tone_oPHONE_PLAY_TONEff_time  = 0x0000;
    ce[0].freq0 = hz950;
    ce[0].gain0 = 1;                             
    ce[0].freq1 = 0;
    ce[0].gain1 = 0;
    ce[1].index = 14;
    ce[1].tone_on_time  = 0x0520;
    ce[1].tone_off_time = 0x0000;
    ce[1].freq0 = hz1400;
    ce[1].gain0 = 1;
    ce[1].freq1 = 0;
    ce[1].gain1 = 0;
    cadence.elements_used = 2;
    cadence.termination = PLAY_ONCE;
    cadence.ce = ce;
    ioctl(ixj1, IXJCTL_TONE_CADENCE, &cadence);
    state = ioctl(ixj1, PHONE_GET_TONE_STATE);
    while(state)
    {
        usleep(40);
        state = ioctl(ixj1, PHONE_GET_TONE_STATE);
    }
    


    ©1996-2001 Quicknet Technologies, Inc.