Skip to content

OcaAudioLevelSensor#

This document describes the controller implementation of OcaAudioLevelSensor. This class is documented in the AES70 standard as:

Child of OcaLevelSensor that shall return an audio meter reading in dB relative to a known reference level, and whose value shall be calculated by the selected averaging algorithm.


Overview#

Class Declaration#

namespace aes70::controller
{
  class OcaAudioLevelSensor : public OcaLevelSensor
  {
  public:
    OcaAudioLevelSensor(std::shared_ptr<connection> connection,
            uin32_t object_number);
    OcaAudioLevelSensor(const OcaAudioLevelSensor &o);

    // Control Methods
    // Calls GetLaw and calls on_result or on_failure
    void GetLaw(auto on_result, failure_callback on_failure);
    // Calls SetLaw and calls on_result or on_failure
    void SetLaw(OcaLevelMeterLaw law, auto on_result, failure_callback on_failure);
    // Calls SetLaw and does not wait for the response
    void SetLaw(OcaLevelMeterLaw law);

    // Observing Properties
    subscription observeLaw(auto callback, failure_callback on_failure);

    // Property Changed Subscriptions
    subscription OnLawChanged(auto callback, failure_callback on_failure);
  };
}

Methods#

GetLaw#

void GetLaw(auto on_result, failure_callback on_failure)

Calls the method GetLaw in the remote device.

Parameters:#

  • auto on_result: A callable (e.g. a lambda) with the following arguments:
    • OcaLevelMeterLaw law
  • failure_callback on_failure: A callback which is called on error.

SetLaw#

void SetLaw(OcaLevelMeterLaw law, auto on_result, failure_callback on_failure)

Calls the method SetLaw in the remote device. If no result and error callback is specified, the method will be called without requesting a response.

Parameters:#

  • OcaLevelMeterLaw law
  • auto on_result: A callable (e.g. a lambda) with 0 arguments.
  • failure_callback on_failure: A callback which is called on error.

observeLaw#

subscription observeLaw(auto callback, failure_callback on_failure)

Fetches the remote property Law and subscribes for modifications. The callback is called with the initial values of Law and whenever it changes.

Parameters:#

  • auto callback: A callable (e.g. a lambda) with one argument: OcaLevelMeterLaw Law
  • failure_callback on_failure: A callback which is called on error.

OnLawChanged#

subscription OnLawChanged(auto callback, failure_callback on_failure)

Parameters#

  • auto callback: A callable (e.g. a lambda) with one argument: OcaLevelMeterLaw Law
  • failure_callback on_failure: A callback which is called on error.