Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

PCMExport Class Reference

PCM Export Pipe. More...

Inheritance diagram for PCMExport:

Inheritance graph
[legend]
Collaboration diagram for PCMExport:

Collaboration graph
[legend]
List of all members.

Public Member Functions

bool OpenAudio (char *output, int channels, int frequency, int bytespersample)
 Open an audio output for PCM.
bool OutputAudioFrame (int16_t *data, int length)
 Write the PCM data.
bool CloseAudio ()
 Close the output.

Private Attributes

FILE * out
int isapipe

Detailed Description

PCM Export Pipe.

Definition at line 425 of file kino_av_pipe.cc.


Member Function Documentation

bool PCMExport::CloseAudio  )  [virtual]
 

Close the output.

Implements KinoAudioPipe.

Definition at line 467 of file kino_av_pipe.cc.

References isapipe, out, sigpipe_clear(), and sigpipe_get().

00468 {
00469     sigpipe_clear();
00470     if ( isapipe )
00471         pclose( out );
00472     else
00473         fclose( out );
00474     return sigpipe_get() == 0;
00475 }

bool PCMExport::OpenAudio char *  output,
int  channels,
int  frequency,
int  bytespersample
[virtual]
 

Open an audio output for PCM.

Implements KinoAudioPipe.

Definition at line 439 of file kino_av_pipe.cc.

References isapipe, out, and sigpipe_get().

00440 {
00441     if ( output[ 0 ] == '|' )
00442     {
00443         out = popen( output + 1, "w" );
00444         isapipe = 1;
00445     }
00446     else
00447     {
00448         out = fopen( output, "w" );
00449         isapipe = 0;
00450     }
00451 
00452     return out != NULL && sigpipe_get() == 0;
00453 }

bool PCMExport::OutputAudioFrame int16_t *  data,
int  length
[virtual]
 

Write the PCM data.

Implements KinoAudioPipe.

Definition at line 458 of file kino_av_pipe.cc.

References out, sigpipe_clear(), and sigpipe_get().

00459 {
00460     sigpipe_clear();
00461     return fwrite( data, length, 1, out ) == 1 && sigpipe_get() == 0;
00462 }


Member Data Documentation

int PCMExport::isapipe [private]
 

Definition at line 429 of file kino_av_pipe.cc.

Referenced by CloseAudio(), and OpenAudio().

FILE* PCMExport::out [private]
 

Definition at line 428 of file kino_av_pipe.cc.

Referenced by CloseAudio(), OpenAudio(), and OutputAudioFrame().


The documentation for this class was generated from the following file:
Generated on Sun Mar 11 22:13:22 2007 for Kino by  doxygen 1.4.2