wavelength 1.0.0
Loading...
Searching...
No Matches
streamqueue.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <vector>
5
6#include "game/streamtask.h"
7#include "os/string.h"
9
17public:
24 ~StreamQueue() override;
25
32 void Stop();
33
42 void Enqueue(const char *pszName, bool bSkipIfBusy);
43
50 void Poll();
51
59 void SetPaused(bool bPaused);
60
69 void NotifyWhenDone(Task *pTask, const char *pszName) override;
70
72 const std::vector<std::unique_ptr<StreamTask>> &GetStreams() const {
73 return mStreams;
74 }
75
81 void SetDirectory(const char *pszDirectory) {
82 mDirectory = pszDirectory;
83 }
84
86 const String &GetDirectory() const {
87 return mDirectory;
88 }
89
90private:
91 std::vector<std::unique_ptr<StreamTask>>
92 mStreams;
93 String mDirectory;
94};
Queue of narration streams that plays one stream at a time.
Definition streamqueue.h:16
const String & GetDirectory() const
Definition streamqueue.h:86
const std::vector< std::unique_ptr< StreamTask > > & GetStreams() const
Definition streamqueue.h:72
void SetDirectory(const char *pszDirectory)
Set the directory the stream files are read from.
Definition streamqueue.h:81
void Enqueue(const char *pszName, bool bSkipIfBusy)
Append a stream to the queue.
void Stop()
Stop the stream at the head of the queue.
void Poll()
Poll the stream at the head, and start the next one when the head is done.
void NotifyWhenDone(Task *pTask, const char *pszName) override
Arrange for a task to learn when the named stream is done.
~StreamQueue() override
Release the queue and every stream in it.
void SetPaused(bool bPaused)
Pause or resume the stream at the head.
Growable text buffer that is also a PrnStream.
Definition string.h:19
Object a task can ask to report when a named piece of work is done.
Definition taskdonenotifier.h:10
Unit of work an owner starts, polls until it reports that it is done, and stops.
Definition task.h:9