Changeset 5509:cd1927035f25 in roaraudio for libroarpulse/stream.c


Ignore:
Timestamp:
05/25/12 03:37:56 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

ported some more functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroarpulse/stream.c

    r5508 r5509  
    177177/** Return the device (sink input or source output) index this stream is connected to */ 
    178178uint32_t pa_stream_get_index(pa_stream *s) { 
    179  (void)s; 
    180  return 0; 
     179 struct roar_stream_info info; 
     180 
     181 if ( roar_stream_get_info(roar_pa_context_get_con(s->c), &(s->stream), &info) == -1 ) 
     182  return 0; 
     183 
     184 if ( info.mixer == -1 ) 
     185  return 0; 
     186 
     187 return info.mixer; 
    181188} 
    182189 
     
    697704 
    698705/** Pause (or resume) playback of this stream temporarily. Available on both playback and recording streams. \since 0.3 */ 
    699 pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata); 
     706pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata) { 
     707 int action = b ? ROAR_SET_FLAG : ROAR_RESET_FLAG; 
     708 
     709 if ( roar_stream_set_flags(roar_pa_context_get_con(s->c), &(s->stream), ROAR_FLAG_PAUSE, action) == -1 ) { 
     710  cb(s, 0, userdata); 
     711 } else { 
     712  cb(s, 1, userdata); 
     713 } 
     714 
     715 return roar_pa_operation_new(PA_OPERATION_DONE); 
     716} 
     717 
     718/** Return 1 if the this stream has been corked. This will return 0 if 
     719 * not, and negative on error. \since 0.9.11 */ 
     720int pa_stream_is_corked(pa_stream *s) { 
     721 struct roar_stream_info info; 
     722 
     723 if ( roar_stream_get_info(roar_pa_context_get_con(s->c), &(s->stream), &info) == -1 ) 
     724  return -1; 
     725 
     726 return (info.flags & ROAR_FLAG_PAUSE) ? 1 : 0; 
     727} 
    700728 
    701729/** Flush the playback buffer of this stream. Most of the time you're 
Note: See TracChangeset for help on using the changeset viewer.