mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-11-14 22:42:52 +01:00
More work on the stream system
This commit is contained in:
parent
48e9708d74
commit
271a77e4ce
@ -48,7 +48,6 @@ private:
|
|||||||
class StreamManager;
|
class StreamManager;
|
||||||
|
|
||||||
class AudioStream {
|
class AudioStream {
|
||||||
friend Sink;
|
|
||||||
friend StreamManager;
|
friend StreamManager;
|
||||||
public:
|
public:
|
||||||
AudioStream(StreamManager* manager, const std::string& name, dsp::stream<dsp::stereo_t>* stream, double samplerate);
|
AudioStream(StreamManager* manager, const std::string& name, dsp::stream<dsp::stereo_t>* stream, double samplerate);
|
||||||
@ -65,19 +64,40 @@ public:
|
|||||||
*/
|
*/
|
||||||
const std::string& getName();
|
const std::string& getName();
|
||||||
|
|
||||||
|
// TODO: Maybe instead we want to resample the data?
|
||||||
void bindStream(dsp::stream<dsp::stereo_t>* stream);
|
void bindStream(dsp::stream<dsp::stereo_t>* stream);
|
||||||
void unbindStream(dsp::stream<dsp::stereo_t>* stream);
|
void unbindStream(dsp::stream<dsp::stereo_t>* stream);
|
||||||
|
|
||||||
double getSamplerate();
|
double getSamplerate();
|
||||||
void setSamplerate(double samplerate);
|
void setSamplerate(double samplerate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a sink to the stream.
|
||||||
|
* @param type Type of the sink.
|
||||||
|
* @return Index of the new sink or -1 on error.
|
||||||
|
*/
|
||||||
int addSink(const std::string& type);
|
int addSink(const std::string& type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change the type of a sink.
|
||||||
|
* @param index Index of the sink.
|
||||||
|
* @param type New sink type.
|
||||||
|
*/
|
||||||
void setSinkType(int index, const std::string& type);
|
void setSinkType(int index, const std::string& type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove a sink from a stream.
|
||||||
|
* @param index Index of the sink.
|
||||||
|
*/
|
||||||
void removeSink(int index);
|
void removeSink(int index);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the list of all sinks belonging to this stream.
|
||||||
|
* @return Sink list.
|
||||||
|
*/
|
||||||
const std::vector<std::shared_ptr<SinkEntry>>& getSinks();
|
const std::vector<std::shared_ptr<SinkEntry>>& getSinks();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setSinkInputSamplerate(Sink* sink, double samplerate);
|
|
||||||
|
|
||||||
std::recursive_mutex mtx;
|
std::recursive_mutex mtx;
|
||||||
StreamManager* manager;
|
StreamManager* manager;
|
||||||
@ -134,6 +154,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
void unregisterSinkProvider(const std::string& name);
|
void unregisterSinkProvider(const std::string& name);
|
||||||
|
|
||||||
|
// TODO: Need a way to lock the list
|
||||||
/**
|
/**
|
||||||
* Get a list of streams and their associated names.
|
* Get a list of streams and their associated names.
|
||||||
* @return Map of names to stream instance.
|
* @return Map of names to stream instance.
|
||||||
|
Loading…
Reference in New Issue
Block a user