2013-05-28 11:19:07 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
|
|
|
/* 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/. */
|
|
|
|
|
2013-06-19 22:24:26 +00:00
|
|
|
#ifndef PeriodicWave_h_
|
|
|
|
#define PeriodicWave_h_
|
2013-05-28 11:19:07 +00:00
|
|
|
|
|
|
|
#include "nsWrapperCache.h"
|
|
|
|
#include "nsCycleCollectionParticipant.h"
|
|
|
|
#include "mozilla/Attributes.h"
|
|
|
|
#include "AudioContext.h"
|
2013-08-28 22:39:26 +00:00
|
|
|
#include "AudioNodeEngine.h"
|
2013-05-28 11:19:07 +00:00
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
namespace dom {
|
|
|
|
|
2014-02-06 13:36:46 +00:00
|
|
|
class PeriodicWave MOZ_FINAL : public nsWrapperCache
|
2013-05-28 11:19:07 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-06-19 22:24:26 +00:00
|
|
|
PeriodicWave(AudioContext* aContext,
|
|
|
|
const float* aRealData,
|
|
|
|
const float* aImagData,
|
2013-08-28 22:39:26 +00:00
|
|
|
const uint32_t aLength,
|
|
|
|
ErrorResult& aRv);
|
2013-06-19 22:24:26 +00:00
|
|
|
|
|
|
|
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(PeriodicWave)
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(PeriodicWave)
|
2013-05-28 11:19:07 +00:00
|
|
|
|
|
|
|
AudioContext* GetParentObject() const
|
|
|
|
{
|
|
|
|
return mContext;
|
|
|
|
}
|
|
|
|
|
2014-04-08 22:27:18 +00:00
|
|
|
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
|
2013-05-28 11:19:07 +00:00
|
|
|
|
2013-08-28 22:39:26 +00:00
|
|
|
uint32_t DataLength() const
|
|
|
|
{
|
|
|
|
return mLength;
|
|
|
|
}
|
|
|
|
|
|
|
|
ThreadSharedFloatArrayBufferList* GetThreadSharedBuffer() const
|
|
|
|
{
|
|
|
|
return mCoefficients;
|
|
|
|
}
|
|
|
|
|
2014-04-13 18:08:10 +00:00
|
|
|
size_t SizeOfExcludingThisIfNotShared(MallocSizeOf aMallocSizeOf) const;
|
2014-05-01 17:37:54 +00:00
|
|
|
size_t SizeOfIncludingThisIfNotShared(MallocSizeOf aMallocSizeOf) const;
|
2014-04-13 18:08:10 +00:00
|
|
|
|
2013-05-28 11:19:07 +00:00
|
|
|
private:
|
2014-06-24 16:36:43 +00:00
|
|
|
~PeriodicWave() {}
|
|
|
|
|
2013-05-28 11:19:07 +00:00
|
|
|
nsRefPtr<AudioContext> mContext;
|
2013-08-28 22:39:26 +00:00
|
|
|
nsRefPtr<ThreadSharedFloatArrayBufferList> mCoefficients;
|
|
|
|
uint32_t mLength;
|
2013-05-28 11:19:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|