3
Copyright (C) 2000 Martin Vogt
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU Library General Public License as published by
7
the Free Software Foundation.
9
For more information look at the file COPYRIGHT in this package
16
#ifndef __ARTSOUTPUTSTREAM_H
17
#define __ARTSOUTPUTSTREAM_H
19
#include "outputStream.h"
20
#include "../input/bufferInputStream.h"
21
#include "audioTime.h"
31
a word about synchronisation: Arts currently has not asynchronous
32
starting of stream, which means, poll if stream is initialized
33
or set a callbackfunction.
35
mpeglib is threaded and would not have much problems
36
with a "callback" but currently we only support blocking wait
39
I think, if people realize that smooth mixing of streams
40
is impossible(because of the blocking start behaviour),
41
this will become a desired feature :-)
47
This class offers a blocking device, its behaviour is similar
48
to /dev/dsp we use a buffer to store the pcm data, if
49
we open/close the buffer the stored data is removed
50
and the blocking thread is "kicked"
52
Arts must first wait for an init signal. it has its own
53
method to check for eof. during seek we close this
54
device, after seek we reopen it.
56
close and open have the same functionality, they simply
62
class ArtsOutputStream : public OutputStream {
64
BufferInputStream* stream;
67
void (*streamStateChangeCallback)(void*);
71
int privateBufferSize;
72
class ThreadQueue* threadQueue;
75
ArtsOutputStream(void (*streamStateChangeCallback)(void*));
80
int audioSetup(int freq,int stereo,int sign,int big,int sampleSize);
85
int audioPlay(TimeStamp* startStamp,
86
TimeStamp* endStamp,char *buffer, int size);
89
AudioTime* getAudioTime();
91
int getPreferredDeliverSize();
95
int openWindow(int width, int height,const char *title);
99
PictureArray* lockPictureArray();
100
void unlockPictureArray(PictureArray* pictureArray);
104
void config(const char* key,const char* value,void* user_data);
106
// Remote read extension
108
int read(char** buffer,int bytes);
109
void forwardReadPtr(int bytes);
112
int getBufferFillgrade();
115
void setAudioBufferSize(int size);
118
void sendSignal(int state,int value);