diff options
Diffstat (limited to 'docs/source/luascript')
-rw-r--r-- | docs/source/luascript/ref-common.rst | 6 | ||||
-rw-r--r-- | docs/source/luascript/ref-core.rst | 8 | ||||
-rw-r--r-- | docs/source/luascript/ref-devices.rst | 49 | ||||
-rw-r--r-- | docs/source/luascript/ref-input.rst | 10 | ||||
-rw-r--r-- | docs/source/luascript/ref-render.rst | 75 |
5 files changed, 131 insertions, 17 deletions
diff --git a/docs/source/luascript/ref-common.rst b/docs/source/luascript/ref-common.rst index c08d3676621..6a7c735951c 100644 --- a/docs/source/luascript/ref-common.rst +++ b/docs/source/luascript/ref-common.rst @@ -99,6 +99,12 @@ emu.add_machine_post_load_notifier(callback) Add a callback to receive notification after the emulated system is restored to a previously saved state. Returns a :ref:`notifier subscription <luascript-ref-notifiersub>`. +emu.register_sound_update(callback) + Add a callback to receive new samples that have been created. The samples + are coming from the sound devices for which the hook property has been set + to true. The callback gets one parameter which is a hash with device tag + as key and a (channel-sized) vector of (buffer-sized) vector of samples + in the -1..1 range. emu.print_error(message) Print an error message. emu.print_warning(message) diff --git a/docs/source/luascript/ref-core.rst b/docs/source/luascript/ref-core.rst index f761b20f5de..ad6dc24d330 100644 --- a/docs/source/luascript/ref-core.rst +++ b/docs/source/luascript/ref-core.rst @@ -404,9 +404,8 @@ sound.debugger_mute (read/write) sound.system_mute (read/write) A Boolean indicating whether sound output is muted at the request of the emulated system. -sound.attenuation (read/write) - The output volume attenuation in decibels. Should generally be a negative - integer or zero. +sound.volume (read/write) + The output volume in decibels. Should generally be a negative or zero. sound.recording (read-only) A Boolean indicating whether sound output is currently being recorded to a WAV file. @@ -587,9 +586,6 @@ driver.is_bios_root (read-only) driver.requires_artwork (read-only) A Boolean indicating whether the system requires external artwork to be usable. -driver.clickable_artwork (read-only) - A Boolean indicating whether the system requires clickable artwork features - to be usable. driver.unofficial (read-only) A Boolean indicating whether this is an unofficial but common user modification to a system. diff --git a/docs/source/luascript/ref-devices.rst b/docs/source/luascript/ref-devices.rst index 1c3eabdbd2d..fe25e0b0591 100644 --- a/docs/source/luascript/ref-devices.rst +++ b/docs/source/luascript/ref-devices.rst @@ -67,6 +67,9 @@ manager.machine.images manager.machine.slots Returns a device enumerator that will iterate over :ref:`slot devices <luascript-ref-dislot>` in the system. +manager.machine.sounds + Returns a device enumerator that will iterate over + :ref:`sound devices <luascript-ref-disound>` in the system. emu.device_enumerator(device, [depth]) Returns a device enumerator that will iterate over :ref:`devices <luascript-ref-device>` in the sub-tree starting at the @@ -624,6 +627,52 @@ image.device (read-only) The underlying :ref:`device <luascript-ref-device>`. +.. _luascript-ref-disound: + +Sound device interface +--------------------- + +Wraps MAME’s ``device_sound_interface`` class which is a mix-in implemented by +devices that input and/or output sound. + +Instantiation +~~~~~~~~~~~~~ + +manager.machine.sounds[tag] + Gets an sound device by tag relative to the root machine device, or ``nil`` + if no such device exists or it is not a slot device. + +Properties +~~~~~~~~~~ + +sound.inputs (read-only) + Number of sound inputs of the device. + +sound.outputs (read-only) + Number of sound outputs of the device. + +sound.microphone (read-only) + True if the device is a microphone, false otherwise + +sound.speaker (read-only) + True if the device is a speaker, false otherwise + +sound.io_positions[] (read-only) + Non-empty only for microphones and speakers, indicates the positions of + the inputs or outputs as (x, y, z) coordinates (e.g. [-0.2, 0.0, 1.0]) + +sound.io_names[] (read-only) + Non-empty only for microphones and speakers, indicates the positions of + the inputs or outputs as strings (e.g. Front Left) + +sound.hook + A boolean indicating whether to tap the output samples of this device in + the global sound hook. + +sound.device (read-only) + The underlying :ref:`device <luascript-ref-device>`. + + .. _luascript-ref-dislot: Slot device interface diff --git a/docs/source/luascript/ref-input.rst b/docs/source/luascript/ref-input.rst index 7390d46743f..f146d6c78ff 100644 --- a/docs/source/luascript/ref-input.rst +++ b/docs/source/luascript/ref-input.rst @@ -750,16 +750,6 @@ uiinput:reset() Clears pending events and UI input states. Should be called when leaving a modal state where input is handled directly (e.g. configuring an input combination). -uiinput:find_mouse() - Returns host system mouse pointer X position, Y position, button state, and - the :ref:`render target <luascript-ref-rendertarget>` it falls in. The - position is in host pixels, where zero is at the top/left. The button state - is a Boolean indicating whether the primary mouse button is pressed. - - If the mouse pointer is not over one of MAME’s windows, this may return the - position and render target from when the mouse pointer was most recently - over one of MAME’s windows. The render target may be ``nil`` if the mouse - pointer is not over one of MAME’s windows. uiinput:pressed(type) Returns a Boolean indicating whether the specified UI input has been pressed. The input type is an enumerated value. diff --git a/docs/source/luascript/ref-render.rst b/docs/source/luascript/ref-render.rst index 265e52b5016..1ebe11df3e1 100644 --- a/docs/source/luascript/ref-render.rst +++ b/docs/source/luascript/ref-render.rst @@ -754,6 +754,10 @@ manager.machine.video.snapshot_target Properties ~~~~~~~~~~ +target.ui_container (read-only) + The :ref:`render container <luascript-ref-rendercontainer>` for drawing user + interface elements over this render target, or ``nil`` for hidden render + targets (targets that are not shown to the user directly). target.index (read-only) The 1-based index of the render target. This has O(n) complexity. target.width (read-only) @@ -810,6 +814,9 @@ Instantiation manager.machine.render.ui_container Gets the render container used to draw the user interface, including menus, sliders and pop-up messages. +manager.machine.render.targets[index].ui_container + Gets the render container used to draw user interface elements over a + particular render target. manager.machine.screens[tag].container Gets the render container used to draw a given screen. @@ -1057,6 +1064,66 @@ view:set_recomputed_callback(cb) View coordinates are recomputed in various events, including the window being resized, entering or leaving full-screen mode, and changing the zoom to screen area setting. +view:set_pointer_updated_callback(cb) + Set a function to receive notifications when a pointer enters, moves or + changes button states over the view. The function must accept nine + arguments: + + * The pointer type (``mouse``, ``pen``, ``touch`` or ``unknown``). + * The pointer ID (a non-negative integer that will not change for the + lifetime of a pointer). + * The device ID for grouping pointers to recognise multi-touch gestures + (non-negative integer). + * Horizontal position in layout coordinates. + * Vertical position in layout coordinates. + * A bit mask representing the currently pressed buttons. + * A bit mask representing the buttons that were pressed in this update. + * A bit mask representing the buttons that were released in this update. + * The click count (positive for multi-click actions, or negative if a click + is turned into a hold or drag). + + Call with ``nil`` to remove the callback. +view:set_pointer_left_callback(cb) + Set a function to receive notifications when a pointer leaves the view + normally. The function must accept seven arguments: + + * The pointer type (``mouse``, ``pen``, ``touch`` or ``unknown``). + * The pointer ID (a non-negative integer that will not change for the + lifetime of a pointer). The ID may be reused for a new pointer after + receiving this notification. + * The device ID for grouping pointers to recognise multi-touch gestures + (non-negative integer). + * Horizontal position in layout coordinates. + * Vertical position in layout coordinates. + * A bit mask representing the buttons that were released in this update. + * The click count (positive for multi-click actions, or negative if a click + is turned into a hold or drag). + + Call with ``nil`` to remove the callback. +view:set_pointer_aborted_callback(cb) + Set a function to receive notifications when a pointer leaves the view + abnormally. The function must accept seven arguments: + + * The pointer type (``mouse``, ``pen``, ``touch`` or ``unknown``). + * The pointer ID (a non-negative integer that will not change for the + lifetime of a pointer). The ID may be reused for a new pointer after + receiving this notification. + * The device ID for grouping pointers to recognise multi-touch gestures + (non-negative integer). + * Horizontal position in layout coordinates. + * Vertical position in layout coordinates. + * A bit mask representing the buttons that were released in this update. + * The click count (positive for multi-click actions, or negative if a click + is turned into a hold or drag). + + Call with ``nil`` to remove the callback. +view:set_forget_pointers_callback(cb) + Set a function to receive notifications when the view should stop processing + pointer input. The function must accept no arguments. Call with ``nil`` to + remove the callback. + + This can happen in a number of situations, including the view configuration + changing or a menu taking over input handling. Properties ~~~~~~~~~~ @@ -1085,10 +1152,16 @@ view.bounds (read-only) effective bounds of the view in its current configuration. The coordinates are in view units, which are arbitrary but assumed to have square aspect ratio. -view.has_art +view.has_art (read-only) A Boolean indicating whether the view has any non-screen items, including items that are not visible because the user has hidden the item collection that they belong to. +view.show_pointers (read/write) + A Boolean that sets whether mouse and pen pointers should be displayed for + the view. +view.hide_inactive_pointers (read/write) + A Boolean that sets whether mouse pointers for the view should be hidden + after a period of inactivity. .. _luascript-ref-renderlayitem: |