22#ifndef MEDIASTATION_CLIENTS_H
23#define MEDIASTATION_CLIENTS_H
25#include "common/array.h"
26#include "common/hashmap.h"
28#include "mediastation/datafile.h"
30namespace MediaStation {
39 virtual bool attemptToReadFromStream(
Chunk &chunk, uint sectionType) = 0;
42enum DeviceOwnerSectionType {
43 kDeviceOwnerAllowMultipleSounds = 0x35,
44 kDeviceOwnerAllowMultipleStreams = 0x36,
48 kImtDeviceTypeSound = 2,
49 kImtDeviceTypeStream = 3,
55 virtual bool giveUpDevice() = 0;
57 void grantDevice(ImtDeviceType type);
58 void releaseDevice(ImtDeviceType type);
68 virtual bool attemptToReadFromStream(
Chunk &chunk, uint sectionType)
override;
70 bool hasExclusiveAccessTo(ImtDeviceType type);
75 void setMultipleSounds(
bool allowMultipleSounds);
76 void setMultipleStreams(
bool allowMultipleStreams);
79 bool _exclusiveAccessToSounds =
true;
80 bool _exclusiveAccessToStreams =
true;
82 void forceReleaseDevice(ImtDeviceType type);
87enum DocumentSectionType {
88 kDocumentContextLoadComplete = 0x10,
89 kDocumentStartupInformation = 0x2e,
90 kDocumentEntryScreen = 0x2f,
97 virtual bool attemptToReadFromStream(
Chunk &chunk, uint sectionType)
override;
98 virtual bool giveUpDevice()
override;
99 void readStartupInformation(
Chunk &chunk);
100 void readContextLoadComplete(
Chunk &chunk);
103 void startContextLoad(uint contextId);
104 bool isContextLoadInProgress(uint contextId);
105 void branchToScreen(uint screenId,
bool disableScreenAutoUpdate);
107 void streamDidClose(uint streamId);
108 void streamDidFinish(uint streamId);
111 void streamDidOpen(uint streamId) {};
112 void streamWillRead(uint streamId) {};
114 uint contextIdForScreenActorId(uint screenActorId);
115 void addToContextLoadQueue(uint contextId);
116 void removeFromContextLoadQueue(uint contextId);
117 bool isContextLoadQueued(uint contextId);
118 void contextReleaseComplete(uint contextId);
119 void contextAlreadyReleased(uint contextId);
124 uint _currentScreenActorId = 0;
127 bool _entryPointScreenIdWasOverridden =
false;
128 uint _entryPointScreenId = 0;
129 uint _entryPointStreamId = 0;
130 uint _loadingContextId = 0;
131 uint _loadingScreenActorId = 0;
132 uint _disabledScreenAutoUpdateToken = 0;
134 void contextLoadDidComplete();
135 void screenLoadDidComplete();
136 void startFeed(uint streamId);
142 void blowAwayCurrentScreen();
143 void preloadParentContexts(uint contextId);
144 void checkQueuedContextLoads();