wavelength 1.0.0
Loading...
Searching...
No Matches
streamplayer.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4
6
14public:
24 StreamPlayer(int nChannel, const char *pszFile, bool bAudio);
25
33
43 void Poll();
44
54 bool IsFinished();
55
63 void SetPlaying(bool bPlaying);
64
72 bool IsPlaying() const;
73
75 int GetChannel() const {
76 return mChannel;
77 }
78
81 return mBuffer.get();
82 }
83
84private:
85 int mChannel;
86 int mPlaying;
87 std::unique_ptr<FileStreamBuffer> mBuffer;
88 char *mRun;
89 float mEndMs;
90 int mEndSent;
91};
StreamBuffer that a file fills with asynchronous reads.
Definition filestreambuffer.h:14
void SetPlaying(bool bPlaying)
Set whether the stream plays.
StreamPlayer(int nChannel, const char *pszFile, bool bAudio)
Open a stream file, or SoundFX/default.str when the file does not open.
bool IsFinished()
Report whether the file ended and the end of the stream was sent.
~StreamPlayer()
Close the stream file.
bool IsPlaying() const
Report whether the stream plays.
FileStreamBuffer * GetBuffer() const
Definition streamplayer.h:80
int GetChannel() const
Definition streamplayer.h:75
void Poll()
Pass the next run of the file to the sound output, and end the stream once the file ends.