2010-11-16 20:14:19 -08: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 04:12:37 -07: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-16 20:14:19 -08:00
|
|
|
|
|
|
|
#ifndef mozilla_dom_AudioParent_h
|
|
|
|
#define mozilla_dom_AudioParent_h
|
|
|
|
|
|
|
|
#include "mozilla/dom/PAudioParent.h"
|
2012-11-14 11:46:40 -08:00
|
|
|
#include "AudioStream.h"
|
2010-11-16 20:14:19 -08:00
|
|
|
#include "nsITimer.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
class AudioParent : public PAudioParent, public nsITimerCallback
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSITIMERCALLBACK
|
|
|
|
|
|
|
|
virtual bool
|
2012-08-22 08:56:38 -07:00
|
|
|
RecvWrite(const nsCString& data, const uint32_t& count);
|
2010-11-16 20:14:19 -08:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvSetVolume(const float& aVolume);
|
|
|
|
|
2011-05-15 03:53:55 -07:00
|
|
|
virtual bool
|
2011-09-26 20:31:18 -07:00
|
|
|
RecvMinWriteSize();
|
2011-05-15 03:53:55 -07:00
|
|
|
|
2010-11-16 20:14:19 -08:00
|
|
|
virtual bool
|
|
|
|
RecvDrain();
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvPause();
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvResume();
|
|
|
|
|
|
|
|
virtual bool
|
2011-01-28 21:40:23 -08:00
|
|
|
RecvShutdown();
|
2010-11-16 20:14:19 -08:00
|
|
|
|
2011-05-15 03:53:55 -07:00
|
|
|
virtual bool
|
2012-08-22 08:56:38 -07:00
|
|
|
SendMinWriteSizeDone(int32_t minFrames);
|
2011-05-15 03:53:55 -07:00
|
|
|
|
2011-02-15 13:58:52 -08:00
|
|
|
virtual bool
|
|
|
|
SendDrainDone();
|
|
|
|
|
2012-07-01 21:59:43 -07:00
|
|
|
virtual bool
|
|
|
|
SendWriteDone();
|
|
|
|
|
2012-10-25 03:09:39 -07:00
|
|
|
AudioParent(int32_t aNumChannels, int32_t aRate);
|
2010-11-16 20:14:19 -08:00
|
|
|
virtual ~AudioParent();
|
2010-11-25 20:13:54 -08:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason);
|
2010-11-16 20:14:19 -08:00
|
|
|
|
2012-11-14 11:46:40 -08:00
|
|
|
nsRefPtr<AudioStream> mStream;
|
2010-11-16 20:14:19 -08:00
|
|
|
nsCOMPtr<nsITimer> mTimer;
|
|
|
|
|
2010-11-25 20:13:54 -08:00
|
|
|
private:
|
2011-01-28 21:40:23 -08:00
|
|
|
void Shutdown();
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mIPCOpen;
|
2010-11-16 20:14:19 -08:00
|
|
|
};
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|