KinsonDigital / Velaptor

2D game development framework
https://docs.velaptor.io
MIT License
70 stars 16 forks source link

🚧Update to use latest version of CASL #934

Closed CalvinWilkinson closed 4 months ago

CalvinWilkinson commented 4 months ago

Complete The Item Below

Description

Update to the latest version of CASL. This update will involve some breaking changes.

  1. Change the name of the Sound class to Audio
  2. Change the name of the ISound class to IAudio
  3. Remove the ICASLSound implementation from the ISound interface.

Velaptor ISound Changes: The entire API of the CASL.ISound, (this is now named CASL.IAudio), was being inherited by Velaptor.ISound. This is not ideal because this means indirectly, the public API from CASL is being exposed in Velaptor. This means a change in the public API of CASL would cause a breaking change in Velaptor.

All of these methods from the CASL.ISound need to be implemented in Velaptor.ISound as much as possible. This will remove future issues with the public API.

Replace data types for the following in Velaptor.IAudio:

The result will be that Velaptor.Sound will end up being a thin wrapper around CASL.IAudio. The API of Velaptor.ISound will end up being different to meet the requirements of Velaptor.

[!Warning] Do not implement the Reset() method. The Stop() method in CASL has been removed and Reset() takes its place. But with Velaptor, keep the Stop() and use the CASL.Reset() for the implementation. This will introduce https://github.com/KinsonDigital/Velaptor/labels/%F0%9F%A7%A8breaking%20changes

[!Note] This issue will require some doc changes to the VelaptorDocs website


Sound/Audio Content Creation Changes:

The SoundLoader, Audio(used to be Sound), and internal SoundFactory types and maybe more will need to be changed to accommodate the loading of audio as full or streaming types.

Changes to the Sound class will be the removal of the public constructor. This is going to be a change in the direction of how content is created. Only factories and the content loader will be used to create content.


Extra: Update the sound scene UI in the VelaptorTesting application to use a slider for the sound. The center drag button in the slider should move along the slider automatically to show the current position of the sound visually. Also, possibly the current time should be at the left end of the slider, and the total length should be at the right end.

Acceptance Criteria

### The items to complete to satisfy the Definition of Done.
- [x] All unit tests executed and passed locally after PR work is complete. _(Why? Refer to 'Additional Information' below.)_
- [x] `Sound` class name refactored to `Audio` - BREAKING CHANGE
- [x] `ISound` class name refactored to `IAudio` - BREAKING CHANGE
- [x] `ICASLSound` inheritance removed from `Velaptor.ISound`
- [x] Required API added to `ISound` to replace API removed when removing the `ICASLSound` interface inheritance
- [x] `Position` property converted to `TimeSpan` - BREAKING CHANGE
- [x] `Length` property converted to `TimeSpan` - BREAKING CHANGE
- [x] `State` property expanded out into `bool` properties - BREAKING CHANGE
- [x] Public ctor of the `Sound` class removed. - BREAKING CHANGE
- [x] All factories and loaders updated to accommodate the new buffer type feature.
- [x] All docs with the word _**Sound**_ are replaced with _**Audio**_
- [x] Create an issue to remove the public constructor of all content types/objects.  If the content is created by a factory, then the public constructor will be removed.
- [x] `SoundLoader` class renamed to `AudioLoader`
### Optional Tasks
- [x] Sound scene UI updated.

ToDo Items

### The items to complete to satisfy the Definition of Done.
- [x] Change type labels added to this issue.  Refer to the _**Change Type Labels**_ section below.
- [x] Priority label added to this issue.  Refer to the _**Priority Type Labels**_ section below.
- [x] Issue linked to the correct milestone _(if applicable)_.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡 If the unit tests pass remotely and are not executed locally, we could let a bug slip into production. Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct