2010-11-17 07:14:19 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* vim: set sw=4 ts=8 et tw=80 : */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-11-17 07:14:19 +03:00
|
|
|
|
|
|
|
#ifndef mozilla_dom_AudioParent_h
|
|
|
|
#define mozilla_dom_AudioParent_h
|
|
|
|
|
|
|
|
#include "mozilla/dom/PAudioParent.h"
|
|
|
|
#include "nsAudioStream.h"
|
|
|
|
#include "nsITimer.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
class AudioParent : public PAudioParent, public nsITimerCallback
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSITIMERCALLBACK
|
|
|
|
|
|
|
|
virtual bool
|
2011-09-27 07:31:18 +04:00
|
|
|
RecvWrite(const nsCString& data, const PRUint32& count);
|
2010-11-17 07:14:19 +03:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvSetVolume(const float& aVolume);
|
|
|
|
|
2011-05-15 14:53:55 +04:00
|
|
|
virtual bool
|
2011-09-27 07:31:18 +04:00
|
|
|
RecvMinWriteSize();
|
2011-05-15 14:53:55 +04:00
|
|
|
|
2010-11-17 07:14:19 +03:00
|
|
|
virtual bool
|
|
|
|
RecvDrain();
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvPause();
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvResume();
|
|
|
|
|
|
|
|
virtual bool
|
2011-01-29 08:40:23 +03:00
|
|
|
RecvShutdown();
|
2010-11-17 07:14:19 +03:00
|
|
|
|
2011-05-15 14:53:55 +04:00
|
|
|
virtual bool
|
2011-09-27 07:31:18 +04:00
|
|
|
SendMinWriteSizeDone(PRInt32 minFrames);
|
2011-05-15 14:53:55 +04:00
|
|
|
|
2011-02-16 00:58:52 +03:00
|
|
|
virtual bool
|
|
|
|
SendDrainDone();
|
|
|
|
|
2010-11-17 07:14:19 +03:00
|
|
|
AudioParent(PRInt32 aNumChannels, PRInt32 aRate, PRInt32 aFormat);
|
|
|
|
virtual ~AudioParent();
|
2010-11-26 07:13:54 +03:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason);
|
2010-11-17 07:14:19 +03:00
|
|
|
|
|
|
|
nsRefPtr<nsAudioStream> mStream;
|
|
|
|
nsCOMPtr<nsITimer> mTimer;
|
|
|
|
|
2010-11-26 07:13:54 +03:00
|
|
|
private:
|
2011-01-29 08:40:23 +03:00
|
|
|
void Shutdown();
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mIPCOpen;
|
2010-11-17 07:14:19 +03:00
|
|
|
};
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|