early-access version 2824
This commit is contained in:
@@ -37,13 +37,16 @@ Result DeviceSession::Initialize(std::string_view name_, SampleFormat sample_for
|
||||
sink = &system.AudioCore().GetOutputSink();
|
||||
}
|
||||
stream = sink->AcquireSinkStream(system, channel_count, name, type);
|
||||
initialized = true;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
void DeviceSession::Finalize() {
|
||||
Stop();
|
||||
sink->CloseStream(stream);
|
||||
stream = nullptr;
|
||||
if (initialized) {
|
||||
Stop();
|
||||
sink->CloseStream(stream);
|
||||
stream = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void DeviceSession::Start() {
|
||||
|
@@ -100,7 +100,7 @@ private:
|
||||
/// System
|
||||
Core::System& system;
|
||||
/// Output sink this device will use
|
||||
Sink::Sink* sink;
|
||||
Sink::Sink* sink{};
|
||||
/// The backend stream for this device session to send samples to
|
||||
Sink::SinkStream* stream{};
|
||||
/// Name of this device session
|
||||
@@ -119,6 +119,8 @@ private:
|
||||
u64 applet_resource_user_id{};
|
||||
/// Total number of samples played by this device session
|
||||
u64 played_sample_count{};
|
||||
/// Is this session initialised?
|
||||
bool initialized{};
|
||||
};
|
||||
|
||||
} // namespace AudioCore
|
||||
|
Reference in New Issue
Block a user