Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Channel manager #1679

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Channel manager #1679

wants to merge 6 commits into from

Conversation

LeftofZen
Copy link
Contributor

A more well-defined mechanism between code asking to play audio, channels, and openal

{
vc.stop();
}
channelManager.stopChannels(ChannelId::vehicle);
}

void stopVehicleNoise(EntityId head)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this to channel manager


namespace OpenLoco::Audio
{
static Channel* makeNewChannel(OpenAL::SourceManager& sourceManager, ChannelId channelId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best to use unique_ptr, this is currently leaking.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I will, still trying to figure out why vehicle sounds aren't playing atm, then will fix the memory issues

@@ -4,16 +4,15 @@

namespace OpenLoco::Audio
{
class VehicleChannel
class VehicleChannel : public Channel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion its best to move out vehicle specific code out entirely, the audio code should be unaware of such things, the vehicle only updates the channel parameters so it's probably best to have that with the vehicle code and not here.

Copy link
Contributor Author

@LeftofZen LeftofZen Oct 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, I'll look at including that in my refactor here

@LeftofZen LeftofZen added enhancement Changing an existing feature slightly work in progress pending improvement changelog Should get a changelog entry and removed work in progress labels May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog Should get a changelog entry enhancement Changing an existing feature slightly pending improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants