|
virtual | ~CDRomDevice () |
|
void | prepare () |
| Prepares the CDRom subsystem.
|
|
void | reset (eastl::function< void(bool)> &&callback) |
| Resets the CDRom controller.
|
|
TaskQueue::Task | scheduleReset () |
|
bool | resetBlocking (GPU &) |
|
ResetAwaiter | reset () |
|
void | readSectors (uint32_t sector, uint32_t count, void *buffer, eastl::function< void(bool)> &&callback) override |
| Reads sectors from the CDRom.
|
|
bool | readSectorsBlocking (uint32_t sector, uint32_t count, void *buffer, GPU &) |
|
void | getTOCSize (unsigned *size, eastl::function< void(bool)> &&callback) |
| Gets the size of the Table of Contents from the CDRom. Note that while the blocking variant is available because it is a fairly short operation with the CDRom controller, it can still block the system for roughly 2ms, which is a long time in the context of a 33MHz CPU.
|
|
TaskQueue::Task | scheduleGetTOCSize (unsigned *size) |
|
unsigned | getTOCSizeBlocking (GPU &) |
|
GetTOCSizeAwaiter | getTOCSize () |
|
void | readTOC (MSF *toc, unsigned size, eastl::function< void(bool)> &&callback) |
| Reads the Table of Contents from the CDRom.
|
|
TaskQueue::Task | scheduleReadTOC (MSF *toc, unsigned size) |
|
bool | readTOCBlocking (MSF *toc, unsigned size, GPU &) |
|
ReadTOCAwaiter | readTOC (MSF *toc, unsigned size) |
|
void | mute (eastl::function< void(bool)> &&callback) |
| Mutes the CD audio for both CDDA and CDXA.
|
|
TaskQueue::Task | scheduleMute () |
|
void | muteBlocking (GPU &) |
|
MuteAwaiter | mute () |
|
void | unmute (eastl::function< void(bool)> &&callback) |
| Unmutes the CD audio for both CDDA and CDXA.
|
|
TaskQueue::Task | scheduleUnmute () |
|
void | unmuteBlocking (GPU &) |
|
UnmuteAwaiter | unmute () |
|
void | playCDDATrack (MSF start, eastl::function< void(bool)> &&callback) |
| Begins playing CDDA audio from a given starting point.
|
|
void | playCDDATrack (unsigned track, eastl::function< void(bool)> &&callback) |
|
void | playCDDADisc (MSF start, eastl::function< void(bool)> &&callback) |
|
void | playCDDADisc (unsigned track, eastl::function< void(bool)> &&callback) |
|
void | resumeCDDA (eastl::function< void(bool)> &&callback) |
|
void | pauseCDDA () |
| Pauses CDDA playback.
|
|
void | stopCDDA () |
| Stops CDDA playback.
|
|
void | getPlaybackLocation (PlaybackLocation *location, eastl::function< void(PlaybackLocation *)> &&callback) |
| Get the Playback location of the CDDA audio.
|
|
void | getPlaybackLocation (eastl::function< void(PlaybackLocation *)> &&callback) |
|
TaskQueue::Task | scheduleGetPlaybackLocation (PlaybackLocation *location) |
|
GetPlaybackLocationAwaiter | getPlaybackLocation () |
|
void | setVolume (uint8_t leftToLeft, uint8_t rightToLeft, uint8_t leftToRight, uint8_t rightToRight) |
| Set the Volume of the CDDA audio.
|
|
bool | isIdle () const |
| Checks if the CDROM device is in idle state.
|
|
virtual | ~CDRom () |
|
TaskQueue::Task | scheduleReadSectors (uint32_t sector, uint32_t count, void *buffer) |
| Schedule a read operation.
|
|
TaskQueue::Task | scheduleReadRequest (ReadRequest *request) |
| Schedule a read operation.
|
|
ReadSectorsAwaiter | readSectorsForCoroutine (uint32_t sector, uint32_t count, void *buffer) |
| Wrapper around the readSectors method for coroutines.
|
|
A specialization of the CDRom interface.
This class is a specialization of the CDRom interface, which provides a way to read from the physical CDRom drive of the console. All of the methods in this class are asynchronous, and will call the provided callback when the operation is complete. The class also provides a blocking variant for some of the methods, which can be used to perform the operation synchronously. Note that the blocking variants are only provided for methods that are expected to complete quickly, and should not be used in performance-critical code, as they can still block the system for several milliseconds. The callbacks will be called from the main thread, and have a boolean parameter that indicates whether the operation was successful. Last but not least, the class provides a coroutine-friendly API, which allows the use of the co_await
keyword to suspend the coroutine until the operation is complete.
void psyqo::CDRomDevice::playCDDATrack |
( |
MSF |
start, |
|
|
eastl::function< void(bool)> && |
callback |
|
) |
| |
Begins playing CDDA audio from a given starting point.
This method will begin playing CDDA audio from a given starting point. The starting point is either a track number or an MSF value. Unlike other APIs here, upon success, the callback will be called twice: once when the playback actually started, and once when the playback is complete or paused, which can be after the end of the track, at the end of the disc if the last track is reached, or if the playback is paused or stopped using the pauseCDDA
or stopCDDA
methods. The first callback will be called with true
if the playback started successfully, and false
if it failed. In the case of failure, the second callback will not be called. The Track variant will stop playback at the end of the track, while the Disc variant will stop playback at the end of the disc. The resume method can be used to resume playback after a pause. Its callback argument will function similarly to the callback argument of the playCDDA
methods.
- Parameters
-
start | The starting point for playback. |
stopAtEndOfTrack | If true, playback will stop at the end of the track. |
callback | The callback to call when playback is complete. |
void psyqo::CDRomDevice::setVolume |
( |
uint8_t |
leftToLeft, |
|
|
uint8_t |
rightToLeft, |
|
|
uint8_t |
leftToRight, |
|
|
uint8_t |
rightToRight |
|
) |
| |
Set the Volume of the CDDA audio.
This method will set the volume of the CDDA audio. The volume is set using four values, which represent the volume of the left channel to the left speaker, the right channel to the left speaker, the left channel to the right speaker, and the right channel to the right speaker. The given output value should be in the range of 0 to 128, where 0 is silence and 128 is full volume. The values for a given output speaker will be added together, so clipping can occur if the sum of the values is greater than 128. The method can be used at any time, unlike the mute/unmute methods, which can only be used when the drive is idle. The normal volume setting is 0x80, 0x00, 0x00, 0x80.
- Parameters
-
leftToLeft | The volume of the left channel to the left speaker. |
rightToLeft | The volume of the right channel to the left speaker. |
leftToRight | The volume of the left channel to the right speaker. |
rightToRight | The volume of the right channel to the right speaker. |