michael@0: /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_audiochannelservicechild_h__ michael@0: #define mozilla_dom_audiochannelservicechild_h__ michael@0: michael@0: #include "nsAutoPtr.h" michael@0: #include "nsISupports.h" michael@0: michael@0: #include "AudioChannelService.h" michael@0: #include "AudioChannelCommon.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: class AudioChannelServiceChild : public AudioChannelService michael@0: { michael@0: public: michael@0: michael@0: /** michael@0: * Returns the AudioChannelServce singleton. Only to be called from main michael@0: * thread. michael@0: * michael@0: * @return NS_OK on proper assignment, NS_ERROR_FAILURE otherwise. michael@0: */ michael@0: static AudioChannelService* GetAudioChannelService(); michael@0: michael@0: static void Shutdown(); michael@0: michael@0: virtual void RegisterAudioChannelAgent(AudioChannelAgent* aAgent, michael@0: AudioChannel aChannel, michael@0: bool aWithVideo); michael@0: virtual void UnregisterAudioChannelAgent(AudioChannelAgent* aAgent); michael@0: michael@0: /** michael@0: * Return the state to indicate this agent should keep playing/ michael@0: * fading volume/muted. michael@0: */ michael@0: virtual AudioChannelState GetState(AudioChannelAgent* aAgent, michael@0: bool aElementHidden); michael@0: michael@0: virtual void SetDefaultVolumeControlChannel(int32_t aChannel, michael@0: bool aHidden); michael@0: michael@0: protected: michael@0: AudioChannelServiceChild(); michael@0: virtual ~AudioChannelServiceChild(); michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: #endif michael@0: