-
Notifications
You must be signed in to change notification settings - Fork 0
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
PCMDriver forward tracks being played #282
Conversation
Warning Rate Limit Exceeded@Raffaello has exceeded the limit for the number of files or commits that can be reviewed per hour. Please wait 13 minutes and 19 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the @coderabbitai review command. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per repository. WalkthroughThe changes primarily focus on the introduction of a Changes
Poem
TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (8)
- sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/audio/IAudioStream.hpp (1 hunks)
- sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/audio/streams/PCMStream.cpp (1 hunks)
- sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/audio/streams/PCMStream.hpp (1 hunks)
- sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.cpp (2 hunks)
- sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.hpp (1 hunks)
- sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/utils/sound.cpp (1 hunks)
- sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/utils/sound.hpp (1 hunks)
- sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/utils/TestSound.cpp (1 hunks)
Files skipped from review due to trivial changes (2)
- sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/audio/IAudioStream.hpp
- sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.hpp
Additional comments: 7
sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/audio/streams/PCMStream.hpp (1)
- 21-21: The new
forward
function is introduced correctly. Ensure that it is implemented properly in the corresponding source file and that it is used correctly throughout the codebase.sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/utils/sound.hpp (1)
- 26-30: The new function
ms_toPos
is added correctly. Ensure that the function is implemented properly in the corresponding source file and that all calls to this function throughout the codebase are updated to match the new signature.sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/utils/TestSound.cpp (1)
- 85-105: The new test case
ms_toPos
looks good. It tests thems_toPos
function with a variety of inputs and checks the output against expected values. The test case is well-structured and covers both stereo and mono sound data.sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.cpp (2)
1-3: The new include directive for "sound.hpp" is appropriate for the use of
utils::ms_toPos
in theforward
function.102-106: The new
forward
function seems to be correctly implemented. It iterates over all streams and callsforward
on each one. However, it's important to ensure that theforward
function in thePCMStream
class handles any exceptions or errors that might occur when the new position exceeds the size of the sound data.sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/audio/streams/PCMStream.cpp (1)
- 41-45: The
forward
function correctly moves the current position forward by a specified number of bytes and ensures that the new position does not exceed the size of the sound data. However, it's important to note that this function does not handle the case wherebytes
is greater thanm_sound->dataSize
. If such a situation arises,m_curPos
will be set tom_sound->dataSize
, effectively moving the position to the end of the sound data. If this is the intended behavior, then the function is correct. If not, you may want to add error handling for this case.sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/utils/sound.cpp (1)
- 75-83: The new function
ms_toPos
seems to be correctly implemented. It converts the time in milliseconds to the corresponding position in the sound data. If the sound is stereo, it correctly doubles the position. However, ensure that the return value does not exceed the size of the sound data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/audio/PCMSound.hpp (1 hunks)
Files skipped from review due to trivial changes (1)
- sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/audio/PCMSound.hpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- .github/workflows/sonarcloud.yml (1 hunks)
- CMakeLists.txt (1 hunks)
Files skipped from review due to trivial changes (2)
- .github/workflows/sonarcloud.yml
- CMakeLists.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (3)
- sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/audio/streams/PCMStream.hpp (1 hunks)
- sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.cpp (2 hunks)
- sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.hpp (1 hunks)
Additional comments: 3
sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/audio/streams/PCMStream.hpp (1)
- 21-21: The new
forward
function is added correctly. Ensure that it is implemented in the corresponding.cpp
file and that it behaves as expected. Also, make sure that all calls to this function throughout the codebase are updated to match the new signature.sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.cpp (2)
1-6: The inclusion of
<HyperSonicDrivers/utils/sound.hpp>
is new and seems to be necessary for thems_toPos
function used in theforward
method. Ensure that this header file is available and correctly included.102-106: The
forward
function is a new addition and it seems to be correctly implemented. It iterates overm_PCMStreams_channels
and callsforward
on each stream with the correct parameters. Ensure that theforward
method in thePCMStream
class handles any exceptions that might occur during execution.
sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.hpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.cpp (2 hunks)
- sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.hpp (1 hunks)
Additional comments: 4
sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.hpp (1)
- 34-38: The new
forward
functions are a good addition for providing more control over audio playback. Ensure that these functions are implemented correctly in the corresponding.cpp
file and that they handle edge cases, such as attempting to forward beyond the audio stream's duration.sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.cpp (3)
1-3: New include directive for
sound.hpp
is added. Ensure that this file is available and accessible in the project structure.102-106: The
forward
function is added to move the playback position forward by a specified duration for all channels. Ensure that theforward
function in thePCMStream
class is thread-safe ifPCMDriver::forward
can be called from multiple threads.108-115: The
forward
function is added to move the playback position forward by a specified duration for a specific channel group. Ensure that theforward
function in thePCMStream
class is thread-safe ifPCMDriver::forward
can be called from multiple threads.
Kudos, SonarCloud Quality Gate passed! |
rewind if it is more than the beginning it will just from the beginningSummary by CodeRabbit