applying defaults API to control classes

This commit is contained in:
Yotam Mann 2017-04-25 22:37:01 -04:00
parent b3dd6513b9
commit 4057252566
5 changed files with 9 additions and 4 deletions

View file

@ -24,7 +24,8 @@ define(["Tone/core/Tone", "Tone/type/Type"], function (Tone) {
*/ */
Tone.CtrlInterpolate = function(){ Tone.CtrlInterpolate = function(){
var options = this.optionsObject(arguments, ["values", "index"], Tone.CtrlInterpolate.defaults); var options = Tone.defaults(arguments, ["values", "index"], Tone.CtrlInterpolate);
Tone.call(this, options);
/** /**
* The values to interpolate between * The values to interpolate between

View file

@ -32,6 +32,8 @@ define(["Tone/core/Tone"], function (Tone) {
*/ */
Tone.CtrlMarkov = function(values, initial){ Tone.CtrlMarkov = function(values, initial){
Tone.call(this);
/** /**
* The Markov values with states as the keys * The Markov values with states as the keys
* and next state(s) as the values. * and next state(s) as the values.

View file

@ -23,7 +23,8 @@ define(["Tone/core/Tone"], function (Tone) {
*/ */
Tone.CtrlPattern = function(){ Tone.CtrlPattern = function(){
var options = this.optionsObject(arguments, ["values", "type"], Tone.CtrlPattern.defaults); var options = Tone.defaults(arguments, ["values", "type"], Tone.CtrlPattern);
Tone.call(this);
/** /**
* The array of values to arpeggiate over * The array of values to arpeggiate over

View file

@ -18,7 +18,8 @@ define(["Tone/core/Tone", "Tone/type/Type"], function (Tone) {
*/ */
Tone.CtrlRandom = function(){ Tone.CtrlRandom = function(){
var options = this.optionsObject(arguments, ["min", "max"], Tone.CtrlRandom.defaults); var options = Tone.defaults(arguments, ["min", "max"], Tone.CtrlRandom);
Tone.call(this);
/** /**
* The minimum return value * The minimum return value

View file

@ -1,4 +1,4 @@
define(["Tone/control/CtrlInterpolate", "helper/Basic"], function (CtrlInterpolate, Basic) { define(["Tone/control/CtrlInterpolate", "helper/Basic", "Tone/core/Transport"], function (CtrlInterpolate, Basic, Transport) {
describe("CtrlInterpolate", function(){ describe("CtrlInterpolate", function(){