Struct xpcom::interfaces::nsIAudioChannelAgent [] [src]

#[repr(C)]
pub struct nsIAudioChannelAgent { /* fields omitted */ }

interface nsIAudioChannelAgent : nsISupports

/**
 * This interface provides an agent for gecko components to participate
 * in the audio channel service. Gecko components are responsible for
 *   1. Notifying the agent when they start/stop using this channel.
 *   2. Notifying the agent when they are audible.
 *
 * The agent will invoke a callback to notify Gecko components of
 *   1. Changes to the playable status of this channel.
 */

Methods

impl nsIAudioChannelAgent
[src]

[src]

Cast this nsIAudioChannelAgent to one of its base interfaces.

impl nsIAudioChannelAgent
[src]

AUDIO_AGENT_STATE_NORMAL: i64 = 0

AUDIO_AGENT_STATE_MUTED: i64 = 1

AUDIO_AGENT_STATE_FADED: i64 = 2

[src]

/**
   * Initialize the agent with a channel type.
   * Note: This function should only be called once.
   *
   * @param window
   *    The window
   * @param callback
   *    1. Once the playable status changes, agent uses this callback function
   *       to notify Gecko component.
   *    2. The callback is allowed to be null. Ex: telephony doesn't need to
   *       listen change of the playable status.
   *    3. The AudioChannelAgent keeps a strong reference to the callback
   *       object.
   */

void init (in mozIDOMWindow window, in nsIAudioChannelAgentCallback callback);

[src]

/**
   * This method is just like init(), except the audio channel agent keeps a
   * weak reference to the callback object.
   *
   * In order for this to work, |callback| must implement
   * nsISupportsWeakReference.
   */

void initWithWeakCallback (in mozIDOMWindow window, in nsIAudioChannelAgentCallback callback);

[src]

/**
   * Notify the agent we no longer want to play.
   *
   * Note : even if notifyStartedPlaying() returned false, the agent would
   * still be registered with the audio channel service and receive callbacks
   * for status changes. So notifyStoppedPlaying must still eventually be
   * called to unregister the agent with the channel service.
   */

void notifyStoppedPlaying ();

[src]

/**
   * Notify agent that we already start producing audible data.
   *
   * Note : sometime audio might become silent during playing, this method is used to
   * notify the actually audible state to other services which want to know
   * about that, ex. tab sound indicator.
   */

void notifyStartedAudible (in uint8_t audible, in uint32_t reason);

Methods from Deref<Target = nsISupports>

[src]

Cast this nsISupports to one of its base interfaces.

[src]

void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);

[src]

[noscript,notxpcom] nsrefcnt AddRef ();

[src]

[noscript,notxpcom] nsrefcnt Release ();

Trait Implementations

impl XpCom for nsIAudioChannelAgent
[src]

IID: nsIID = nsID(1294018416, 23931, 17519, [147, 148, 99, 46, 53, 29, 150, 238])

[src]

Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more

impl RefCounted for nsIAudioChannelAgent
[src]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsIAudioChannelAgent
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.