2013-05-28 04:19:07 -07: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 15:24:26 -07:00
|
|
|
#ifndef PeriodicWave_h_
|
|
|
|
#define PeriodicWave_h_
|
2013-05-28 04:19:07 -07:00
|
|
|
|
|
|
|
#include "nsWrapperCache.h"
|
|
|
|
#include "nsCycleCollectionParticipant.h"
|
|
|
|
#include "mozilla/Attributes.h"
|
|
|
|
#include "AudioContext.h"
|
2013-08-28 15:39:26 -07:00
|
|
|
#include "AudioNodeEngine.h"
|
2013-05-28 04:19:07 -07:00
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
namespace dom {
|
|
|
|
|
2014-02-06 05:36:46 -08:00
|
|
|
class PeriodicWave MOZ_FINAL : public nsWrapperCache
|
2013-05-28 04:19:07 -07:00
|
|
|
{
|
|
|
|
public:
|
2013-06-19 15:24:26 -07:00
|
|
|
PeriodicWave(AudioContext* aContext,
|
|
|
|
const float* aRealData,
|
|
|
|
const float* aImagData,
|
2013-08-28 15:39:26 -07:00
|
|
|
const uint32_t aLength,
|
|
|
|
ErrorResult& aRv);
|
2013-06-19 15:24:26 -07:00
|
|
|
|
|
|
|
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(PeriodicWave)
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(PeriodicWave)
|
2013-05-28 04:19:07 -07:00
|
|
|
|
|
|
|
AudioContext* GetParentObject() const
|
|
|
|
{
|
|
|
|
return mContext;
|
|
|
|
}
|
|
|
|
|
2014-04-08 15:27:18 -07:00
|
|
|
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
|
2013-05-28 04:19:07 -07:00
|
|
|
|
2013-08-28 15:39:26 -07:00
|
|
|
uint32_t DataLength() const
|
|
|
|
{
|
|
|
|
return mLength;
|
|
|
|
}
|
|
|
|
|
|
|
|
ThreadSharedFloatArrayBufferList* GetThreadSharedBuffer() const
|
|
|
|
{
|
|
|
|
return mCoefficients;
|
|
|
|
}
|
|
|
|
|
2013-05-28 04:19:07 -07:00
|
|
|
private:
|
|
|
|
nsRefPtr<AudioContext> mContext;
|
2013-08-28 15:39:26 -07:00
|
|
|
nsRefPtr<ThreadSharedFloatArrayBufferList> mCoefficients;
|
|
|
|
uint32_t mLength;
|
2013-05-28 04:19:07 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|