Ejemplo n.º 1
0
void AudioChannelAgent::NotifyAudioChannelStateChanged()
{
    if (mCallback != nullptr) {
        AudioChannelService *service = AudioChannelService::GetAudioChannelService();
        mCallback->CanPlayChanged(!service->GetMuted(this, !mVisible));
    }
}
Ejemplo n.º 2
0
/* void setVisibilityState (in boolean visible); */
NS_IMETHODIMP AudioChannelAgent::SetVisibilityState(bool visible)
{
    bool oldVisibility = mVisible;

    mVisible = visible;
    if (mIsRegToService && oldVisibility != mVisible && mCallback != nullptr) {
        AudioChannelService *service = AudioChannelService::GetAudioChannelService();
        mCallback->CanPlayChanged(!service->GetMuted(this, !mVisible));
    }
    return NS_OK;
}
Ejemplo n.º 3
0
/* boolean startPlaying (); */
NS_IMETHODIMP AudioChannelAgent::StartPlaying(bool *_retval)
{
    AudioChannelService *service = AudioChannelService::GetAudioChannelService();
    if (mAudioChannelType == AUDIO_AGENT_CHANNEL_ERROR ||
            service == nullptr) {
        return NS_ERROR_FAILURE;
    }

    service->RegisterAudioChannelAgent(this,
                                       static_cast<AudioChannelType>(mAudioChannelType));
    *_retval = !service->GetMuted(this, !mVisible);
    mIsRegToService = true;
    return NS_OK;
}