Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/PannerNode.cpp

Issue 2760353002: Define default values for options dictionaries for WebAudio (Closed)
Patch Set: Rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 PannerNode* PannerNode::Create(BaseAudioContext* context, 672 PannerNode* PannerNode::Create(BaseAudioContext* context,
673 const PannerOptions& options, 673 const PannerOptions& options,
674 ExceptionState& exception_state) { 674 ExceptionState& exception_state) {
675 PannerNode* node = Create(*context, exception_state); 675 PannerNode* node = Create(*context, exception_state);
676 676
677 if (!node) 677 if (!node)
678 return nullptr; 678 return nullptr;
679 679
680 node->HandleChannelOptions(options, exception_state); 680 node->HandleChannelOptions(options, exception_state);
681 681
682 if (options.hasPanningModel()) 682 node->setPanningModel(options.panningModel());
683 node->setPanningModel(options.panningModel()); 683 node->setDistanceModel(options.distanceModel());
684 if (options.hasDistanceModel())
685 node->setDistanceModel(options.distanceModel());
686 684
687 if (options.hasPositionX()) 685 node->positionX()->setValue(options.positionX());
688 node->positionX()->setValue(options.positionX()); 686 node->positionY()->setValue(options.positionY());
689 if (options.hasPositionY()) 687 node->positionZ()->setValue(options.positionZ());
690 node->positionY()->setValue(options.positionY());
691 if (options.hasPositionZ())
692 node->positionZ()->setValue(options.positionZ());
693 688
694 if (options.hasOrientationX()) 689 node->orientationX()->setValue(options.orientationX());
695 node->orientationX()->setValue(options.orientationX()); 690 node->orientationY()->setValue(options.orientationY());
696 if (options.hasOrientationY()) 691 node->orientationZ()->setValue(options.orientationZ());
697 node->orientationY()->setValue(options.orientationY());
698 if (options.hasOrientationZ())
699 node->orientationZ()->setValue(options.orientationZ());
700 692
701 if (options.hasRefDistance()) 693 node->setRefDistance(options.refDistance(), exception_state);
702 node->setRefDistance(options.refDistance(), exception_state); 694 node->setMaxDistance(options.maxDistance(), exception_state);
703 if (options.hasMaxDistance()) 695 node->setRolloffFactor(options.rolloffFactor());
704 node->setMaxDistance(options.maxDistance(), exception_state); 696 node->setConeInnerAngle(options.coneInnerAngle());
705 if (options.hasRolloffFactor()) 697 node->setConeOuterAngle(options.coneOuterAngle());
706 node->setRolloffFactor(options.rolloffFactor()); 698 node->setConeOuterGain(options.coneOuterGain());
707 if (options.hasConeInnerAngle())
708 node->setConeInnerAngle(options.coneInnerAngle());
709 if (options.hasConeOuterAngle())
710 node->setConeOuterAngle(options.coneOuterAngle());
711 if (options.hasConeOuterGain())
712 node->setConeOuterGain(options.coneOuterGain());
713 699
714 return node; 700 return node;
715 } 701 }
716 702
717 PannerHandler& PannerNode::GetPannerHandler() const { 703 PannerHandler& PannerNode::GetPannerHandler() const {
718 return static_cast<PannerHandler&>(Handler()); 704 return static_cast<PannerHandler&>(Handler());
719 } 705 }
720 706
721 String PannerNode::panningModel() const { 707 String PannerNode::panningModel() const {
722 return GetPannerHandler().PanningModel(); 708 return GetPannerHandler().PanningModel();
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 visitor->Trace(position_z_); 798 visitor->Trace(position_z_);
813 799
814 visitor->Trace(orientation_x_); 800 visitor->Trace(orientation_x_);
815 visitor->Trace(orientation_y_); 801 visitor->Trace(orientation_y_);
816 visitor->Trace(orientation_z_); 802 visitor->Trace(orientation_z_);
817 803
818 AudioNode::Trace(visitor); 804 AudioNode::Trace(visitor);
819 } 805 }
820 806
821 } // namespace blink 807 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698