The base CDRom class.
More...
#include <psyqo/cdrom.hh>
The base CDRom class.
The CDRom system is meant to be swappable between multiple implementations, so the base class is a pure abstraction. This allows the ISO9660 parser to be used with any CDRom implementation.
◆ ~CDRom()
virtual psyqo::CDRom::~CDRom |
( |
| ) |
|
|
inlinevirtual |
◆ readSectors()
Read a sector from the CDRom.
The function will make reasonable attempts at reading the disk, but it is not guaranteed to succeed. Failures may be caused by the disk being faulty, the lid being opened, or no valid disk being present. Only one operation can be in progress at a time.
- Parameters
-
sector | The sector to read. |
buffer | The buffer to read into. |
size | The size of the buffer. |
callback | The callback to call when the read is done. It will be called from the main thread when possible. Its one argument is a boolean indicating whether the read was successful. |
Implemented in psyqo::CDRomDevice.
◆ readSectorsForCoroutine()
ReadSectorsAwaiter psyqo::CDRom::readSectorsForCoroutine |
( |
uint32_t |
sector, |
|
|
uint32_t |
count, |
|
|
void * |
buffer |
|
) |
| |
|
inline |
Wrapper around the readSectors method for coroutines.
This method will return an Awaiter
object that can be used to suspend the coroutine until the read operation is complete. This is meant to be used in conjunction with the co_await
keyword, in a coroutine.
- Parameters
-
sector | The sector to read. |
count | The number of sectors to read. |
buffer | The buffer to read into. |
- Returns
- ReadSectorsAwaiter The awaitable object to be used with the
co_await
keyword.
◆ scheduleReadRequest()
Schedule a read operation.
This is a convenience function that will schedule a read operation and return a task that can be waited on. The difference with scheduleReadSectors
is that this method will read its arguments right before the operation is processed, so the request data can be filled in at the last moment.
- Parameters
-
[in] | request | The request to schedule. |
- Returns
- A task that can be queued into a
TaskQueue
◆ scheduleReadSectors()
Schedule a read operation.
This is a convenience function that will schedule a read operation and return a task that can be waited on.
- Parameters
-
sector | The sector to read. |
buffer | The buffer to read into. |
size | The size of the buffer. |
- Returns
- A task that can be queued into a
TaskQueue
The documentation for this class was generated from the following files: