Changeset 2022


Ignore:
Timestamp:
Jun 14, 2008 8:33:44 PM (16 years ago)
Author:
bennylp
Message:

Added pjmedia_tonegen_rewind()

Location:
pjproject/trunk/pjmedia
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/tonegen.h

    r1676 r2022  
    196196 
    197197/** 
     198 * Rewind the playback. This will start the playback to the first 
     199 * tone in the playback list. 
     200 * 
     201 * @param tonegen           The tone generator instance. 
     202 * 
     203 * @return                  PJ_SUCCESS on success. 
     204 */ 
     205PJ_DECL(pj_status_t) pjmedia_tonegen_rewind(pjmedia_port *tonegen); 
     206 
     207 
     208/** 
    198209 * Instruct the tone generator to play single or dual frequency tones  
    199210 * with the specified duration. The new tones will be appended to currently 
  • pjproject/trunk/pjmedia/src/pjmedia/tonegen.c

    r1859 r2022  
    402402 
    403403/* 
     404 * Instruct the tone generator to stop current processing. 
     405 */ 
     406PJ_DEF(pj_status_t) pjmedia_tonegen_rewind(pjmedia_port *port) 
     407{ 
     408    struct tonegen *tonegen = (struct tonegen*) port; 
     409    PJ_ASSERT_RETURN(port->info.signature == SIGNATURE, PJ_EINVAL); 
     410 
     411    TRACE_((THIS_FILE, "tonegen_rewind()")); 
     412 
     413    /* Reset back to the first tone */ 
     414    pj_lock_acquire(tonegen->lock); 
     415    tonegen->cur_digit = 0; 
     416    tonegen->dig_samples = 0; 
     417    pj_lock_release(tonegen->lock); 
     418 
     419    return PJ_SUCCESS; 
     420} 
     421 
     422 
     423/* 
    404424 * Callback to destroy tonegen 
    405425 */ 
Note: See TracChangeset for help on using the changeset viewer.