Changeset 404:6e2026516643 in roaraudio for libroarpulse


Ignore:
Timestamp:
08/10/08 01:05:39 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added read(), write(), fsync()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroarpulse/simple.c

    r402 r404  
    2020/** Close and free the connection to the server. The connection objects becomes invalid when this is called. */ 
    2121void pa_simple_free(pa_simple *s) { 
     22 struct roarpulse_simple * ss = (struct roarpulse_simple*) s; 
     23 if ( !s ) 
     24  return; 
     25 
     26 free(s); 
    2227} 
    2328 
    2429/** Write some data to the server */ 
    2530int pa_simple_write(pa_simple *s, const void*data, size_t length, int *error) { 
    26  return -1; 
     31 struct roarpulse_simple * ss = (struct roarpulse_simple*) s; 
     32 if ( !s ) 
     33  return -1; 
     34 
     35 return read(ss->data_fh, data, length); 
    2736} 
    2837 
    2938/** Wait until all data already written is played by the daemon */ 
    3039int pa_simple_drain(pa_simple *s, int *error) { 
     40 struct roarpulse_simple * ss = (struct roarpulse_simple*) s; 
     41 if ( !s ) 
     42  return -1; 
     43 
    3144 return -1; 
    3245} 
     
    3447/** Read some data from the server */ 
    3548int pa_simple_read(pa_simple *s, void*data, size_t length, int *error) { 
    36  return -1; 
     49 struct roarpulse_simple * ss = (struct roarpulse_simple*) s; 
     50 if ( !s ) 
     51  return -1; 
     52 
     53 return read(ss->data_fh, data, legth); 
    3754} 
    3855 
    3956/** Return the playback latency. \since 0.5 */ 
    4057pa_usec_t pa_simple_get_latency(pa_simple *s, int *error) { 
     58 struct roarpulse_simple * ss = (struct roarpulse_simple*) s; 
     59 if ( !s ) 
     60  return -1; 
     61 
    4162 return -1; 
    4263} 
     
    4465/** Flush the playback buffer. \since 0.5 */ 
    4566int pa_simple_flush(pa_simple *s, int *error) { 
    46  return -1; 
     67 struct roarpulse_simple * ss = (struct roarpulse_simple*) s; 
     68 if ( !s ) 
     69  return -1; 
     70 
     71 return fdatasync(ss->data_fh); 
    4772} 
    4873 
Note: See TracChangeset for help on using the changeset viewer.