forked from gronod/squeezelite-esp32
237 lines
6.6 KiB
JavaScript
237 lines
6.6 KiB
JavaScript
// source: Equalizer.proto
|
|
/**
|
|
* @fileoverview
|
|
* @enhanceable
|
|
* @suppress {missingRequire} reports error on implicit type usages.
|
|
* @suppress {messageConventions} JS Compiler reports an error if a variable or
|
|
* field starts with 'MSG_' and isn't a translatable message.
|
|
* @public
|
|
*/
|
|
// GENERATED CODE -- DO NOT EDIT!
|
|
/* eslint-disable */
|
|
// @ts-nocheck
|
|
|
|
var jspb = require('google-protobuf');
|
|
var goog = jspb;
|
|
var global =
|
|
(typeof globalThis !== 'undefined' && globalThis) ||
|
|
(typeof window !== 'undefined' && window) ||
|
|
(typeof global !== 'undefined' && global) ||
|
|
(typeof self !== 'undefined' && self) ||
|
|
(function () { return this; }).call(null) ||
|
|
Function('return this')();
|
|
|
|
var nanopb_pb = require('./nanopb_pb.js');
|
|
goog.object.extend(proto, nanopb_pb);
|
|
goog.exportSymbol('proto.sys.Equalizer', null, global);
|
|
/**
|
|
* Generated by JsPbCodeGenerator.
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
* valid.
|
|
* @extends {jspb.Message}
|
|
* @constructor
|
|
*/
|
|
proto.sys.Equalizer = function(opt_data) {
|
|
jspb.Message.initialize(this, opt_data, 0, -1, proto.sys.Equalizer.repeatedFields_, null);
|
|
};
|
|
goog.inherits(proto.sys.Equalizer, jspb.Message);
|
|
if (goog.DEBUG && !COMPILED) {
|
|
/**
|
|
* @public
|
|
* @override
|
|
*/
|
|
proto.sys.Equalizer.displayName = 'proto.sys.Equalizer';
|
|
}
|
|
|
|
/**
|
|
* List of repeated fields within this message type.
|
|
* @private {!Array<number>}
|
|
* @const
|
|
*/
|
|
proto.sys.Equalizer.repeatedFields_ = [1];
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
/**
|
|
* Creates an object representation of this proto.
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
* Optional fields that are not set will be set to undefined.
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
* For the list of reserved names please see:
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
* JSPB instance for transitional soy proto support:
|
|
* http://goto/soy-param-migration
|
|
* @return {!Object}
|
|
*/
|
|
proto.sys.Equalizer.prototype.toObject = function(opt_includeInstance) {
|
|
return proto.sys.Equalizer.toObject(opt_includeInstance, this);
|
|
};
|
|
|
|
|
|
/**
|
|
* Static version of the {@see toObject} method.
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
* the JSPB instance for transitional soy proto support:
|
|
* http://goto/soy-param-migration
|
|
* @param {!proto.sys.Equalizer} msg The msg instance to transform.
|
|
* @return {!Object}
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
*/
|
|
proto.sys.Equalizer.toObject = function(includeInstance, msg) {
|
|
var f, obj = {
|
|
gainsList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 1)) == null ? undefined : f,
|
|
loudness: jspb.Message.getFloatingPointFieldWithDefault(msg, 2, 0.0)
|
|
};
|
|
|
|
if (includeInstance) {
|
|
obj.$jspbMessageInstance = msg;
|
|
}
|
|
return obj;
|
|
};
|
|
}
|
|
|
|
|
|
/**
|
|
* Deserializes binary data (in protobuf wire format).
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
* @return {!proto.sys.Equalizer}
|
|
*/
|
|
proto.sys.Equalizer.deserializeBinary = function(bytes) {
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
var msg = new proto.sys.Equalizer;
|
|
return proto.sys.Equalizer.deserializeBinaryFromReader(msg, reader);
|
|
};
|
|
|
|
|
|
/**
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
* given reader into the given message object.
|
|
* @param {!proto.sys.Equalizer} msg The message object to deserialize into.
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
* @return {!proto.sys.Equalizer}
|
|
*/
|
|
proto.sys.Equalizer.deserializeBinaryFromReader = function(msg, reader) {
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup()) {
|
|
break;
|
|
}
|
|
var field = reader.getFieldNumber();
|
|
switch (field) {
|
|
case 1:
|
|
var values = /** @type {!Array<number>} */ (reader.isDelimited() ? reader.readPackedFloat() : [reader.readFloat()]);
|
|
for (var i = 0; i < values.length; i++) {
|
|
msg.addGains(values[i]);
|
|
}
|
|
break;
|
|
case 2:
|
|
var value = /** @type {number} */ (reader.readFloat());
|
|
msg.setLoudness(value);
|
|
break;
|
|
default:
|
|
reader.skipField();
|
|
break;
|
|
}
|
|
}
|
|
return msg;
|
|
};
|
|
|
|
|
|
/**
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
* @return {!Uint8Array}
|
|
*/
|
|
proto.sys.Equalizer.prototype.serializeBinary = function() {
|
|
var writer = new jspb.BinaryWriter();
|
|
proto.sys.Equalizer.serializeBinaryToWriter(this, writer);
|
|
return writer.getResultBuffer();
|
|
};
|
|
|
|
|
|
/**
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
* format), writing to the given BinaryWriter.
|
|
* @param {!proto.sys.Equalizer} message
|
|
* @param {!jspb.BinaryWriter} writer
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
*/
|
|
proto.sys.Equalizer.serializeBinaryToWriter = function(message, writer) {
|
|
var f = undefined;
|
|
f = message.getGainsList();
|
|
if (f.length > 0) {
|
|
writer.writePackedFloat(
|
|
1,
|
|
f
|
|
);
|
|
}
|
|
f = message.getLoudness();
|
|
if (f !== 0.0) {
|
|
writer.writeFloat(
|
|
2,
|
|
f
|
|
);
|
|
}
|
|
};
|
|
|
|
|
|
/**
|
|
* repeated float gains = 1;
|
|
* @return {!Array<number>}
|
|
*/
|
|
proto.sys.Equalizer.prototype.getGainsList = function() {
|
|
return /** @type {!Array<number>} */ (jspb.Message.getRepeatedFloatingPointField(this, 1));
|
|
};
|
|
|
|
|
|
/**
|
|
* @param {!Array<number>} value
|
|
* @return {!proto.sys.Equalizer} returns this
|
|
*/
|
|
proto.sys.Equalizer.prototype.setGainsList = function(value) {
|
|
return jspb.Message.setField(this, 1, value || []);
|
|
};
|
|
|
|
|
|
/**
|
|
* @param {number} value
|
|
* @param {number=} opt_index
|
|
* @return {!proto.sys.Equalizer} returns this
|
|
*/
|
|
proto.sys.Equalizer.prototype.addGains = function(value, opt_index) {
|
|
return jspb.Message.addToRepeatedField(this, 1, value, opt_index);
|
|
};
|
|
|
|
|
|
/**
|
|
* Clears the list making it empty but non-null.
|
|
* @return {!proto.sys.Equalizer} returns this
|
|
*/
|
|
proto.sys.Equalizer.prototype.clearGainsList = function() {
|
|
return this.setGainsList([]);
|
|
};
|
|
|
|
|
|
/**
|
|
* optional float loudness = 2;
|
|
* @return {number}
|
|
*/
|
|
proto.sys.Equalizer.prototype.getLoudness = function() {
|
|
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0));
|
|
};
|
|
|
|
|
|
/**
|
|
* @param {number} value
|
|
* @return {!proto.sys.Equalizer} returns this
|
|
*/
|
|
proto.sys.Equalizer.prototype.setLoudness = function(value) {
|
|
return jspb.Message.setProto3FloatField(this, 2, value);
|
|
};
|
|
|
|
|
|
goog.object.extend(exports, proto.sys);
|