libretro.api.location¶
Geographic location service interface types.
Allows cores to access the host device’s geographic location.
See also
Module Attributes
Set the desired update rate for the location service. |
|
Start listening to the host device's location service. |
|
Stop listening to the host device's location service. |
|
Return the device's most recent geographic position. |
|
Notify the core that the location service has been initialized or deinitialized. |
Classes
Corresponds to |
- class retro_location_callback[source]¶
Bases:
StructureCorresponds to
retro_location_callbackinlibretro.h.A set of callbacks for managing location services.
>>> from libretro.api import retro_location_callback >>> loc = retro_location_callback() >>> loc.start is None True
- start¶
Starts the location service. Set by the frontend.
- stop¶
Stops the location service. Set by the frontend.
- __init__(*args, **kwargs)¶
- classmethod __new__(*args, **kwargs)¶
- get_position¶
Returns the device’s current geographic coordinates. Set by the frontend.
- set_interval¶
Sets the location update interval. Set by the frontend.
- initialized¶
Called when the location service is initialized. Set by the core. Optional.
- deinitialized¶
Called when the location service is deinitialized. Set by the core. Optional.
- __deepcopy__(_)[source]¶
Return a deep copy of this object. Intended for use with
copy.deepcopy().>>> import copy >>> from libretro.api import retro_location_callback >>> copy.deepcopy(retro_location_callback()).start is None True
- retro_location_get_position_t¶
Return the device’s most recent geographic position.
Registered by the frontend and called by the core. Each output parameter is set to
0.0if no change has occurred since the last call.- Parameters:
- Returns:
Trueon success.
Corresponds to
retro_location_get_position_tinlibretro.h.
- retro_location_lifetime_status_t¶
Notify the core that the location service has been initialized or deinitialized.
Registered by the core and called by the frontend when the location service starts or stops.
Corresponds to
retro_location_lifetime_status_tinlibretro.h.
- retro_location_set_interval_t¶
Set the desired update rate for the location service.
Registered by the frontend and called by the core to hint how often it would like new location updates. Some platforms may honor only one of the two parameters.
- Parameters:
interval_ms – Desired period between updates, in milliseconds.
interval_distance – Desired distance between updates, in meters.
Corresponds to
retro_location_set_interval_tinlibretro.h.
- retro_location_start_t¶
Start listening to the host device’s location service.
Registered by the frontend and called by the core.
- Returns:
Trueif location services were successfully started,Falseif they are unavailable or the frontend lacks permission.
Corresponds to
retro_location_start_tinlibretro.h.