1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-22 12:33:29 +00:00

Added discussion of media target.

Thomas Harte 2019-03-07 15:03:15 -05:00
parent 6954e0ab4c
commit 629679b942

@ -138,3 +138,13 @@ _As per comments elsewhere, I'm still considering the ramifications of the type
The best-effort updater, `Concurrency/BestEffortUpdater.hpp` is a helper class currently used by both the Mac and SDL ports, though it's entirely optional. It provides a thread-safe `update` method that can be called to request that 'more' emulation occurs. It will tell a delegate how long to run emulation for, but it will do so only if a call to the delegate isn't already happening. The best-effort updater, `Concurrency/BestEffortUpdater.hpp` is a helper class currently used by both the Mac and SDL ports, though it's entirely optional. It provides a thread-safe `update` method that can be called to request that 'more' emulation occurs. It will tell a delegate how long to run emulation for, but it will do so only if a call to the delegate isn't already happening.
So the scheme used by both ports is simply to call `update` any time that more output — video or audio — is required, on whichever thread it learns that. So the scheme used by both ports is simply to call `update` any time that more output — video or audio — is required, on whichever thread it learns that.
## Inserting Different or Additional Media
Use `Analyser::Static::GetMedia` to obtain an instance of `Analyser::Static::Media` for the file. E.g. if it's a single disc image, the piece of media returned will be a single disc.
Grab the dynamic machine's `media_target()` if it provides one. Not all machines do — for example, there's nothing you can insert into a Master System once it's running. Call `insert_media` on the media target with the media object that the static analyser returned. Its return result will tell you whether the insertion was successful.
_Commentary: the media target interface doesn't currently allow the caller to be more specific than merely 'insert this media', e.g. it isn't possible for a port to allow the user to select which drive they want to insert a disc image into. This primarily a relic of my desire not to provide a complicated UI. It's something I'd like to correct, however._
`Analyser::Static::GetMedia` will simply determine the type of the file and return the proper disk(s), tape(s) and/or cartridge(s). That piece of media is not bound to a specific type of machine — e.g. it's possible to insert any disk into any machine that has a disk drive, it just won't necessarily be something the drive can read.