content/media/webaudio/AudioDestinationNode.cpp
author Ehsan Akhgari <ehsan@mozilla.com>
Sat, 27 Apr 2013 18:44:50 -0400
changeset 142232 b474f42bd080cb7c77ac4f99e2b88dfeb356b84e
parent 141672 1b1381894c4402d105cf59e45078bd9573facd01
child 144539 3f5529434311539cb6cb67de5d2caef294f94db5
permissions -rw-r--r--
Bug 865234 - Part 1: Add DOM bindings for the channel mixing attributes; r=roc

/* -*- 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/. */

#include "AudioDestinationNode.h"
#include "mozilla/dom/AudioDestinationNodeBinding.h"
#include "AudioNodeEngine.h"
#include "AudioNodeStream.h"
#include "MediaStreamGraph.h"

namespace mozilla {
namespace dom {

NS_IMPL_ISUPPORTS_INHERITED0(AudioDestinationNode, AudioNode)

AudioDestinationNode::AudioDestinationNode(AudioContext* aContext, MediaStreamGraph* aGraph)
  : AudioNode(aContext,
              2,
              ChannelCountMode::Explicit,
              ChannelInterpretation::Speakers)
{
  mStream = aGraph->CreateAudioNodeStream(new AudioNodeEngine(this),
                                          MediaStreamGraph::EXTERNAL_STREAM);
}

JSObject*
AudioDestinationNode::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
{
  return AudioDestinationNodeBinding::Wrap(aCx, aScope, this);
}

}
}