Merge branch 'master' of github.com:highfidelity/hifi into commandLineParametersForAutotester

This commit is contained in:
NissimHadar 2018-05-03 16:44:57 -07:00
commit e07039266d
13 changed files with 113 additions and 142 deletions

View file

@ -301,7 +301,7 @@ bool QmlCommerce::uninstallApp(const QString& itemHref) {
// Read from the file to know what .js script to stop
QFile appFile(_appsPath + "/" + appHref.fileName());
if (!appFile.open(QIODevice::ReadOnly)) {
qCDebug(commerce) << "Couldn't open local .app.json file for deletion.";
qCDebug(commerce) << "Couldn't open local .app.json file for deletion. Cannot continue with app uninstallation. App filename is:" << appHref.fileName();
return false;
}
QJsonDocument appFileJsonDocument = QJsonDocument::fromJson(appFile.readAll());
@ -309,15 +309,13 @@ bool QmlCommerce::uninstallApp(const QString& itemHref) {
QString scriptUrl = appFileJsonObject["scriptURL"].toString();
if (!DependencyManager::get<ScriptEngines>()->stopScript(scriptUrl.trimmed(), false)) {
qCDebug(commerce) << "Couldn't stop script.";
return false;
qCWarning(commerce) << "Couldn't stop script during app uninstall. Continuing anyway. ScriptURL is:" << scriptUrl.trimmed();
}
// Delete the .app.json from the filesystem
// remove() closes the file first.
if (!appFile.remove()) {
qCDebug(commerce) << "Couldn't delete local .app.json file.";
return false;
qCWarning(commerce) << "Couldn't delete local .app.json file during app uninstall. Continuing anyway. App filename is:" << appHref.fileName();
}
emit appUninstalled(itemHref);

View file

@ -134,7 +134,7 @@ public:
/**jsdoc
* Get the names of all the selection lists.
* @function Selection.getListNames
* @return {list[]} An array of names of all the selection lists.
* @returns {list[]} An array of names of all the selection lists.
*/
Q_INVOKABLE QStringList getListNames() const;
@ -184,7 +184,7 @@ public:
* Get the list of avatars, entities, and overlays stored in a selection list.
* @function Selection.getList
* @param {string} listName - The name of the selection list.
* @return {Selection.SelectedItemsList} The content of a selection list. If the list name doesn't exist, the function
* @returns {Selection.SelectedItemsList} The content of a selection list. If the list name doesn't exist, the function
* returns an empty object with no properties.
*/
Q_INVOKABLE QVariantMap getSelectedItemsList(const QString& listName) const;
@ -192,7 +192,7 @@ public:
/**jsdoc
* Get the names of the highlighted selection lists.
* @function Selection.getHighlightedListNames
* @return {string[]} An array of names of the selection list currently highlight enabled.
* @returns {string[]} An array of names of the selection list currently highlight enabled.
*/
Q_INVOKABLE QStringList getHighlightedListNames() const;

View file

@ -18,7 +18,7 @@
static AvatarInputs* INSTANCE{ nullptr };
Setting::Handle<bool> showAudioToolsSetting { QStringList { "AvatarInputs", "showAudioTools" }, false };
Setting::Handle<bool> showAudioToolsSetting { QStringList { "AvatarInputs", "showAudioTools" }, true };
AvatarInputs* AvatarInputs::getInstance() {
if (!INSTANCE) {

View file

@ -47,45 +47,39 @@ public:
* @property {number} sizeCached - Size in bytes of all cached resources. <em>Read-only.</em>
*/
// Functions are copied over from ResourceCache (see ResourceCache.h for reason).
// Functions are copied over from ResourceCache (see ResourceCache.h for reason).
/**jsdoc
/**jsdoc
* Get the list of all resource URLs.
* @function AnimationCache.getResourceList
* @return {string[]}
* @returns {string[]}
*/
/**jsdoc
/**jsdoc
* @function AnimationCache.dirty
* @returns {Signal}
*/
/**jsdoc
/**jsdoc
* @function AnimationCache.updateTotalSize
* @param {number} deltaSize
*/
/**jsdoc
/**jsdoc
* Prefetches a resource.
* @function AnimationCache.prefetch
* @param {string} url
* @param {object} extra
* @returns {object}
* @param {string} url - URL of the resource to prefetch.
* @param {object} [extra=null]
* @returns {Resource}
*/
/**jsdoc
/**jsdoc
* Asynchronously loads a resource from the specified URL and returns it.
* @function AnimationCache.getResource
* @param {string} url - URL of the resource to load.
* @param {string} [fallback=""] - Fallback URL if load of the desired URL fails.
* @param {} [extra=null]
* @return {Resource}
*/
/**jsdoc
* Prefetches a resource.
* @function AnimationCache.prefetch
* @param {string} url - URL of the resource to prefetch.
* @return {Resource}
* @returns {Resource}
*/

View file

@ -10,9 +10,9 @@
// Inline functions to implement audio dynamics processing
//
#include <stddef.h>
#include <math.h>
#include <stdint.h>
#include <stddef.h>
#ifndef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
@ -21,7 +21,15 @@
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifdef _MSC_VER
#if defined(_MSC_VER)
#define FORCEINLINE __forceinline
#elif defined(__GNUC__)
#define FORCEINLINE inline __attribute__((always_inline))
#else
#define FORCEINLINE inline
#endif
#if defined(_MSC_VER)
#include <intrin.h>
#define MUL64(a,b) __emul((a), (b))
#else
@ -42,14 +50,14 @@
#include <xmmintrin.h>
// convert float to int using round-to-nearest
static inline int32_t floatToInt(float x) {
FORCEINLINE static int32_t floatToInt(float x) {
return _mm_cvt_ss2si(_mm_load_ss(&x));
}
#else
// convert float to int using round-to-nearest
static inline int32_t floatToInt(float x) {
FORCEINLINE static int32_t floatToInt(float x) {
x += (x < 0.0f ? -0.5f : 0.5f); // round
return (int32_t)x;
}
@ -60,12 +68,12 @@ static const double FIXQ31 = 2147483648.0; // convert float to Q31
static const double DB_TO_LOG2 = 0.16609640474436813; // convert dB to log2
// convert dB to amplitude
static inline double dBToGain(double dB) {
FORCEINLINE static double dBToGain(double dB) {
return pow(10.0, dB / 20.0);
}
// convert milliseconds to first-order time constant
static inline int32_t msToTc(double ms, double sampleRate) {
FORCEINLINE static int32_t msToTc(double ms, double sampleRate) {
double tc = exp(-1000.0 / (ms * sampleRate));
return (int32_t)(FIXQ31 * tc); // Q31
}
@ -144,16 +152,16 @@ static const int IEEE754_EXPN_BIAS = 127;
// x < 2^(31-LOG2_HEADROOM) returns 0x7fffffff
// x > 2^LOG2_HEADROOM undefined
//
static inline int32_t peaklog2(float* input) {
FORCEINLINE static int32_t peaklog2(float* input) {
// float as integer bits
int32_t u = *(int32_t*)input;
uint32_t u = *(uint32_t*)input;
// absolute value
int32_t peak = u & IEEE754_FABS_MASK;
uint32_t peak = u & IEEE754_FABS_MASK;
// split into e and x - 1.0
int32_t e = IEEE754_EXPN_BIAS - (peak >> IEEE754_MANT_BITS) + LOG2_HEADROOM;
int e = IEEE754_EXPN_BIAS - (peak >> IEEE754_MANT_BITS) + LOG2_HEADROOM;
int32_t x = (peak << IEEE754_EXPN_BITS) & 0x7fffffff;
// saturate
@ -180,19 +188,19 @@ static inline int32_t peaklog2(float* input) {
// x < 2^(31-LOG2_HEADROOM) returns 0x7fffffff
// x > 2^LOG2_HEADROOM undefined
//
static inline int32_t peaklog2(float* input0, float* input1) {
FORCEINLINE static int32_t peaklog2(float* input0, float* input1) {
// float as integer bits
int32_t u0 = *(int32_t*)input0;
int32_t u1 = *(int32_t*)input1;
uint32_t u0 = *(uint32_t*)input0;
uint32_t u1 = *(uint32_t*)input1;
// max absolute value
u0 &= IEEE754_FABS_MASK;
u1 &= IEEE754_FABS_MASK;
int32_t peak = MAX(u0, u1);
uint32_t peak = MAX(u0, u1);
// split into e and x - 1.0
int32_t e = IEEE754_EXPN_BIAS - (peak >> IEEE754_MANT_BITS) + LOG2_HEADROOM;
int e = IEEE754_EXPN_BIAS - (peak >> IEEE754_MANT_BITS) + LOG2_HEADROOM;
int32_t x = (peak << IEEE754_EXPN_BITS) & 0x7fffffff;
// saturate
@ -219,23 +227,23 @@ static inline int32_t peaklog2(float* input0, float* input1) {
// x < 2^(31-LOG2_HEADROOM) returns 0x7fffffff
// x > 2^LOG2_HEADROOM undefined
//
static inline int32_t peaklog2(float* input0, float* input1, float* input2, float* input3) {
FORCEINLINE static int32_t peaklog2(float* input0, float* input1, float* input2, float* input3) {
// float as integer bits
int32_t u0 = *(int32_t*)input0;
int32_t u1 = *(int32_t*)input1;
int32_t u2 = *(int32_t*)input2;
int32_t u3 = *(int32_t*)input3;
uint32_t u0 = *(uint32_t*)input0;
uint32_t u1 = *(uint32_t*)input1;
uint32_t u2 = *(uint32_t*)input2;
uint32_t u3 = *(uint32_t*)input3;
// max absolute value
u0 &= IEEE754_FABS_MASK;
u1 &= IEEE754_FABS_MASK;
u2 &= IEEE754_FABS_MASK;
u3 &= IEEE754_FABS_MASK;
int32_t peak = MAX(MAX(u0, u1), MAX(u2, u3));
uint32_t peak = MAX(MAX(u0, u1), MAX(u2, u3));
// split into e and x - 1.0
int32_t e = IEEE754_EXPN_BIAS - (peak >> IEEE754_MANT_BITS) + LOG2_HEADROOM;
int e = IEEE754_EXPN_BIAS - (peak >> IEEE754_MANT_BITS) + LOG2_HEADROOM;
int32_t x = (peak << IEEE754_EXPN_BITS) & 0x7fffffff;
// saturate
@ -261,7 +269,7 @@ static inline int32_t peaklog2(float* input0, float* input1, float* input2, floa
// Count Leading Zeros
// Emulates the CLZ (ARM) and LZCNT (x86) instruction
//
static inline int CLZ(uint32_t u) {
FORCEINLINE static int CLZ(uint32_t u) {
if (u == 0) {
return 32;
@ -294,7 +302,7 @@ static inline int CLZ(uint32_t u) {
// Compute -log2(x) for x=[0,1] in Q31, result in Q26
// x <= 0 returns 0x7fffffff
//
static inline int32_t fixlog2(int32_t x) {
FORCEINLINE static int32_t fixlog2(int32_t x) {
if (x <= 0) {
return 0x7fffffff;
@ -303,8 +311,7 @@ static inline int32_t fixlog2(int32_t x) {
// split into e and x - 1.0
uint32_t u = (uint32_t)x;
int e = CLZ(u);
u <<= e; // normalize to [0x80000000, 0xffffffff]
x = u & 0x7fffffff; // x - 1.0
x = (u << e) & 0x7fffffff;
int k = x >> (31 - LOG2_TABBITS);
@ -324,7 +331,7 @@ static inline int32_t fixlog2(int32_t x) {
// Compute exp2(-x) for x=[0,32] in Q26, result in Q31
// x <= 0 returns 0x7fffffff
//
static inline int32_t fixexp2(int32_t x) {
FORCEINLINE static int32_t fixexp2(int32_t x) {
if (x <= 0) {
return 0x7fffffff;
@ -350,12 +357,12 @@ static inline int32_t fixexp2(int32_t x) {
}
// fast TPDF dither in [-1.0f, 1.0f]
static inline float dither() {
FORCEINLINE static float dither() {
static uint32_t rz = 0;
rz = rz * 69069 + 1;
int32_t r0 = rz & 0xffff;
int32_t r1 = rz >> 16;
return (int32_t)(r0 - r1) * (1/65536.0f);
return (r0 - r1) * (1/65536.0f);
}
//

View file

@ -13,18 +13,11 @@
#include "AudioReverb.h"
#ifdef _MSC_VER
#include <intrin.h>
inline static int MULHI(int a, int b) {
long long c = __emul(a, b);
return ((int*)&c)[1];
}
#define MULHI(a,b) ((int32_t)(__emul(a, b) >> 32))
#else
#define MULHI(a,b) (int)(((long long)(a) * (b)) >> 32)
#endif // _MSC_VER
#define MULHI(a,b) ((int32_t)(((int64_t)(a) * (int64_t)(b)) >> 32))
#endif
#ifndef MAX
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
@ -1954,7 +1947,7 @@ static inline float dither() {
rz = rz * 69069 + 1;
int32_t r0 = rz & 0xffff;
int32_t r1 = rz >> 16;
return (int32_t)(r0 - r1) * (1/65536.0f);
return (r0 - r1) * (1/65536.0f);
}
// convert float to int16_t with dither, interleave stereo

View file

@ -1200,7 +1200,7 @@ static inline float dither() {
rz = rz * 69069 + 1;
int32_t r0 = rz & 0xffff;
int32_t r1 = rz >> 16;
return (int32_t)(r0 - r1) * (1/65536.0f);
return (r0 - r1) * (1/65536.0f);
}
// convert float to int16_t with dither, interleave stereo

View file

@ -41,12 +41,12 @@ public:
*/
// Functions are copied over from ResourceCache (see ResourceCache.h for reason).
// Functions are copied over from ResourceCache (see ResourceCache.h for reason).
/**jsdoc
* Get the list of all resource URLs.
* @function SoundCache.getResourceList
* @return {string[]}
* @returns {string[]}
*/
/**jsdoc
@ -60,10 +60,11 @@ public:
*/
/**jsdoc
* Prefetches a resource.
* @function SoundCache.prefetch
* @param {string} url
* @param {object} extra
* @returns {object}
* @param {string} url - URL of the resource to prefetch.
* @param {object} [extra=null]
* @returns {Resource}
*/
/**jsdoc
@ -72,14 +73,7 @@ public:
* @param {string} url - URL of the resource to load.
* @param {string} [fallback=""] - Fallback URL if load of the desired URL fails.
* @param {} [extra=null]
* @return {Resource}
*/
/**jsdoc
* Prefetches a resource.
* @function SoundCache.prefetch
* @param {string} url - URL of the resource to prefetch.
* @return {Resource}
* @returns {Resource}
*/

View file

@ -42,7 +42,7 @@ public slots:
*
* @function Graphics.getModel
* @param {UUID} entityID - The objectID of the model whose meshes are to be retrieved.
* @return {Graphics.Model} the resulting Model object
* @returns {Graphics.Model} the resulting Model object
*/
scriptable::ScriptableModelPointer getModel(QUuid uuid);
@ -57,7 +57,7 @@ public slots:
*
* @function Graphics.newMesh
* @param {Graphics.IFSData} ifsMeshData Index-Faced Set (IFS) arrays used to create the new mesh.
* @return {Graphics.Mesh} the resulting Mesh / Mesh Part object
* @returns {Graphics.Mesh} the resulting Mesh / Mesh Part object
*/
/**jsdoc
* @typedef {object} Graphics.IFSData

View file

@ -159,7 +159,7 @@ public:
/**jsdoc
* Get the list of all resource URLs.
* @function ModelCache.getResourceList
* @return {string[]}
* @returns {string[]}
*/
/**jsdoc
@ -173,10 +173,11 @@ public:
*/
/**jsdoc
* Prefetches a resource.
* @function ModelCache.prefetch
* @param {string} url
* @param {object} extra
* @returns {object}
* @param {string} url - URL of the resource to prefetch.
* @param {object} [extra=null]
* @returns {Resource}
*/
/**jsdoc
@ -185,14 +186,7 @@ public:
* @param {string} url - URL of the resource to load.
* @param {string} [fallback=""] - Fallback URL if load of the desired URL fails.
* @param {} [extra=null]
* @return {Resource}
*/
/**jsdoc
* Prefetches a resource.
* @function ModelCache.prefetch
* @param {string} url - URL of the resource to prefetch.
* @return {Resource}
* @returns {Resource}
*/

View file

@ -163,44 +163,38 @@ public:
// Functions are copied over from ResourceCache (see ResourceCache.h for reason).
/**jsdoc
* Get the list of all resource URLs.
* @function TextureCache.getResourceList
* @return {string[]}
*/
/**jsdoc
* Get the list of all resource URLs.
* @function TextureCache.getResourceList
* @returns {string[]}
*/
/**jsdoc
* @function TextureCache.dirty
* @returns {Signal}
*/
/**jsdoc
* @function TextureCache.dirty
* @returns {Signal}
*/
/**jsdoc
* @function TextureCache.updateTotalSize
* @param {number} deltaSize
*/
/**jsdoc
* @function TextureCache.updateTotalSize
* @param {number} deltaSize
*/
/**jsdoc
* @function TextureCache.prefetch
* @param {string} url
* @param {object} extra
* @returns {object}
*/
/**jsdoc
* Prefetches a resource.
* @function TextureCache.prefetch
* @param {string} url - URL of the resource to prefetch.
* @param {object} [extra=null]
* @returns {Resource}
*/
/**jsdoc
* Asynchronously loads a resource from the specified URL and returns it.
* @function TextureCache.getResource
* @param {string} url - URL of the resource to load.
* @param {string} [fallback=""] - Fallback URL if load of the desired URL fails.
* @param {} [extra=null]
* @return {Resource}
*/
/**jsdoc
* Prefetches a resource.
* @function TextureCache.prefetch
* @param {string} url - URL of the resource to prefetch.
* @return {Resource}
*/
/**jsdoc
* Asynchronously loads a resource from the specified URL and returns it.
* @function TextureCache.getResource
* @param {string} url - URL of the resource to load.
* @param {string} [fallback=""] - Fallback URL if load of the desired URL fails.
* @param {} [extra=null]
* @returns {Resource}
*/
/// Returns the ID of the permutation/normal texture used for Perlin noise shader programs. This texture
@ -249,10 +243,11 @@ signals:
protected:
/**jsdoc
* @function TextureCache.prefect
* @function TextureCache.prefetch
* @param {string} url
* @param {number} type
* @param {number} [maxNumPixels=67108864]
* @returns {Resource}
*/
// Overload ResourceCache::prefetch to allow specifying texture type for loads
Q_INVOKABLE ScriptableResource* prefetch(const QUrl& url, int type, int maxNumPixels = ABSOLUTE_MAX_TEXTURE_NUM_PIXELS);

View file

@ -167,7 +167,7 @@ private:
HifiSockAddr _assignmentServerSocket;
bool _isShuttingDown { false };
QTimer _keepAlivePingTimer;
bool _requestsDomainListData;
bool _requestsDomainListData { false };
mutable QReadWriteLock _ignoredSetLock;
tbb::concurrent_unordered_set<QUuid, UUIDHasher> _ignoredNodeIDs;

View file

@ -215,7 +215,7 @@ public:
/**jsdoc
* Get the list of all resource URLs.
* @function ResourceCache.getResourceList
* @return {string[]}
* @returns {string[]}
*/
Q_INVOKABLE QVariantList getResourceList();
@ -257,10 +257,11 @@ protected slots:
void updateTotalSize(const qint64& deltaSize);
/**jsdoc
* Prefetches a resource.
* @function ResourceCache.prefetch
* @param {string} url
* @param {object} extra
* @returns {object}
* @param {string} url - URL of the resource to prefetch.
* @param {object} [extra=null]
* @returns {Resource}
*/
// Prefetches a resource to be held by the QScriptEngine.
// Left as a protected member so subclasses can overload prefetch
@ -273,7 +274,7 @@ protected slots:
* @param {string} url - URL of the resource to load.
* @param {string} [fallback=""] - Fallback URL if load of the desired URL fails.
* @param {} [extra=null]
* @return {Resource}
* @returns {Resource}
*/
/// Loads a resource from the specified URL and returns it.
/// If the caller is on a different thread than the ResourceCache,
@ -291,12 +292,7 @@ protected:
// Pointers created through this method should be owned by the caller,
// which should be a QScriptEngine with ScriptableResource registered, so that
// the QScriptEngine will delete the pointer when it is garbage collected.
/**jsdoc
* Prefetches a resource.
* @function ResourceCache.prefetch
* @param {string} url - URL of the resource to prefetch.
* @return {Resource}
*/
// JSDoc is provided on more general function signature.
Q_INVOKABLE ScriptableResource* prefetch(const QUrl& url) { return prefetch(url, nullptr); }
/// Creates a new resource.