From 68a70cc914fc6b4afab71edad730f32205abf210 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 30 Sep 2014 09:40:54 -0700 Subject: [PATCH] don't use dashes in settings JSON keys --- assignment-client/src/audio/AudioMixer.cpp | 22 +++++++-------- .../resources/describe-settings.json | 28 +++++++++---------- domain-server/src/DomainServer.cpp | 4 +-- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/assignment-client/src/audio/AudioMixer.cpp b/assignment-client/src/audio/AudioMixer.cpp index 3670653493..2fb7342b0c 100644 --- a/assignment-client/src/audio/AudioMixer.cpp +++ b/assignment-client/src/audio/AudioMixer.cpp @@ -643,7 +643,7 @@ void AudioMixer::run() { QJsonObject audioGroupObject = settingsObject[AUDIO_GROUP_KEY].toObject(); // check the payload to see if we have asked for dynamicJitterBuffer support - const QString DYNAMIC_JITTER_BUFFER_JSON_KEY = "dynamic-jitter-buffer"; + const QString DYNAMIC_JITTER_BUFFER_JSON_KEY = "dynamic_jitter_buffer"; _streamSettings._dynamicJitterBuffers = audioGroupObject[DYNAMIC_JITTER_BUFFER_JSON_KEY].toBool(); if (_streamSettings._dynamicJitterBuffers) { qDebug() << "Enable dynamic jitter buffers."; @@ -652,21 +652,21 @@ void AudioMixer::run() { } bool ok; - const QString DESIRED_JITTER_BUFFER_FRAMES_KEY = "static-desired-jitter-buffer-frames"; + const QString DESIRED_JITTER_BUFFER_FRAMES_KEY = "static_desired_jitter_buffer_frames"; _streamSettings._staticDesiredJitterBufferFrames = audioGroupObject[DESIRED_JITTER_BUFFER_FRAMES_KEY].toString().toInt(&ok); if (!ok) { _streamSettings._staticDesiredJitterBufferFrames = DEFAULT_STATIC_DESIRED_JITTER_BUFFER_FRAMES; } qDebug() << "Static desired jitter buffer frames:" << _streamSettings._staticDesiredJitterBufferFrames; - const QString MAX_FRAMES_OVER_DESIRED_JSON_KEY = "max-frames-over-desired"; + const QString MAX_FRAMES_OVER_DESIRED_JSON_KEY = "max_frames_over_desired"; _streamSettings._maxFramesOverDesired = audioGroupObject[MAX_FRAMES_OVER_DESIRED_JSON_KEY].toString().toInt(&ok); if (!ok) { _streamSettings._maxFramesOverDesired = DEFAULT_MAX_FRAMES_OVER_DESIRED; } qDebug() << "Max frames over desired:" << _streamSettings._maxFramesOverDesired; - const QString USE_STDEV_FOR_DESIRED_CALC_JSON_KEY = "use-stdev-for-desired-calc"; + const QString USE_STDEV_FOR_DESIRED_CALC_JSON_KEY = "use_stdev_for_desired_calc"; _streamSettings._useStDevForJitterCalc = audioGroupObject[USE_STDEV_FOR_DESIRED_CALC_JSON_KEY].toBool(); if (_streamSettings._useStDevForJitterCalc) { qDebug() << "Using Philip's stdev method for jitter calc if dynamic jitter buffers enabled"; @@ -674,28 +674,28 @@ void AudioMixer::run() { qDebug() << "Using Fred's max-gap method for jitter calc if dynamic jitter buffers enabled"; } - const QString WINDOW_STARVE_THRESHOLD_JSON_KEY = "window-starve-threshold"; + const QString WINDOW_STARVE_THRESHOLD_JSON_KEY = "window_starve_threshold"; _streamSettings._windowStarveThreshold = audioGroupObject[WINDOW_STARVE_THRESHOLD_JSON_KEY].toString().toInt(&ok); if (!ok) { _streamSettings._windowStarveThreshold = DEFAULT_WINDOW_STARVE_THRESHOLD; } qDebug() << "Window A starve threshold:" << _streamSettings._windowStarveThreshold; - const QString WINDOW_SECONDS_FOR_DESIRED_CALC_ON_TOO_MANY_STARVES_JSON_KEY = "window-seconds-for-desired-calc-on-too-many-starves"; + const QString WINDOW_SECONDS_FOR_DESIRED_CALC_ON_TOO_MANY_STARVES_JSON_KEY = "window_seconds_for_desired_calc_on_too_many_starves"; _streamSettings._windowSecondsForDesiredCalcOnTooManyStarves = audioGroupObject[WINDOW_SECONDS_FOR_DESIRED_CALC_ON_TOO_MANY_STARVES_JSON_KEY].toString().toInt(&ok); if (!ok) { _streamSettings._windowSecondsForDesiredCalcOnTooManyStarves = DEFAULT_WINDOW_SECONDS_FOR_DESIRED_CALC_ON_TOO_MANY_STARVES; } qDebug() << "Window A length:" << _streamSettings._windowSecondsForDesiredCalcOnTooManyStarves << "seconds"; - const QString WINDOW_SECONDS_FOR_DESIRED_REDUCTION_JSON_KEY = "window-seconds-for-desired-reduction"; + const QString WINDOW_SECONDS_FOR_DESIRED_REDUCTION_JSON_KEY = "window_seconds_for_desired_reduction"; _streamSettings._windowSecondsForDesiredReduction = audioGroupObject[WINDOW_SECONDS_FOR_DESIRED_REDUCTION_JSON_KEY].toString().toInt(&ok); if (!ok) { _streamSettings._windowSecondsForDesiredReduction = DEFAULT_WINDOW_SECONDS_FOR_DESIRED_REDUCTION; } qDebug() << "Window B length:" << _streamSettings._windowSecondsForDesiredReduction << "seconds"; - const QString REPETITION_WITH_FADE_JSON_KEY = "repetition-with-fade"; + const QString REPETITION_WITH_FADE_JSON_KEY = "repetition_with_fade"; _streamSettings._repetitionWithFade = audioGroupObject[REPETITION_WITH_FADE_JSON_KEY].toBool(); if (_streamSettings._repetitionWithFade) { qDebug() << "Repetition with fade enabled"; @@ -703,13 +703,13 @@ void AudioMixer::run() { qDebug() << "Repetition with fade disabled"; } - const QString PRINT_STREAM_STATS_JSON_KEY = "print-stream-stats"; + const QString PRINT_STREAM_STATS_JSON_KEY = "print_stream_stats"; _printStreamStats = audioGroupObject[PRINT_STREAM_STATS_JSON_KEY].toBool(); if (_printStreamStats) { qDebug() << "Stream stats will be printed to stdout"; } - const QString FILTER_KEY = "enable-filter"; + const QString FILTER_KEY = "enable_filter"; if (audioGroupObject[FILTER_KEY].isBool()) { _enableFilter = audioGroupObject[FILTER_KEY].toBool(); } @@ -717,7 +717,7 @@ void AudioMixer::run() { qDebug() << "Filter enabled"; } - const QString UNATTENUATED_ZONE_KEY = "unattenuated-zone"; + const QString UNATTENUATED_ZONE_KEY = "unattenuated_zone"; QString unattenuatedZoneString = audioGroupObject[UNATTENUATED_ZONE_KEY].toString(); if (!unattenuatedZoneString.isEmpty()) { diff --git a/domain-server/resources/describe-settings.json b/domain-server/resources/describe-settings.json index 19c293b610..cec1aabe75 100644 --- a/domain-server/resources/describe-settings.json +++ b/domain-server/resources/describe-settings.json @@ -4,7 +4,7 @@ "label": "Metaverse Registration", "settings": [ { - "name": "access-token", + "name": "access_token", "label": "Access Token", "help": "This is an access token generated on the My Tokens page of your High Fidelity account.
Generate a token with the 'domains' scope and paste it here.
This is required to associate this domain-server with a domain in your account." }, @@ -20,12 +20,12 @@ "label": "Security", "settings": [ { - "name": "http-username", + "name": "http_username", "label": "HTTP Username", "help": "Username used for basic HTTP authentication." }, { - "name": "http-password", + "name": "http_password", "label": "HTTP Password", "type": "password", "help": "Password used for basic HTTP authentication. Leave this blank if you do not want to change it.", @@ -39,20 +39,20 @@ "assignment-types": [0], "settings": [ { - "name": "enable-filter", + "name": "enable_filter", "type": "checkbox", "label": "Enable Positional Filter", "help": "positional audio stream uses lowpass filter", "default": true }, { - "name": "unattenuated-zone", + "name": "unattenuated_zone", "label": "Unattenuated Zone", "help": "Boxes for source and listener (corner x, corner y, corner z, size x, size y, size z, corner x, corner y, corner z, size x, size y, size z)", "placeholder": "no zone" }, { - "name": "dynamic-jitter-buffer", + "name": "dynamic_jitter_buffer", "type": "checkbox", "label": "Dynamic Jitter Buffers", "help": "dynamically buffer client audio based on perceived jitter in packet receipt timing", @@ -60,7 +60,7 @@ "advanced": true }, { - "name": "static-desired-jitter-buffer-frames", + "name": "static_desired_jitter_buffer_frames", "label": "Static Desired Jitter Buffer Frames", "help": "If dynamic jitter buffers is disabled, this determines the target number of frames maintained by the AudioMixer's jitter buffers", "placeholder": "1", @@ -68,7 +68,7 @@ "advanced": true }, { - "name": "max-frames-over-desired", + "name": "max_frames_over_desired", "label": "Max Frames Over Desired", "help": "The highest number of frames an AudioMixer's ringbuffer can exceed the desired jitter buffer frames by", "placeholder": "10", @@ -76,7 +76,7 @@ "advanced": true }, { - "name": "use-stdev-for-desired-calc", + "name": "use_stdev_for_desired_calc", "type": "checkbox", "label": "Use Stdev for Desired Jitter Frames Calc:", "help": "use Philip's method (stdev of timegaps) to calculate desired jitter frames (otherwise Fred's max timegap method is used)", @@ -84,7 +84,7 @@ "advanced": true }, { - "name": "window-starve-threshold", + "name": "window_starve_threshold", "label": "Window Starve Threshold", "help": "If this many starves occur in an N-second window (N is the number in the next field), then the desired jitter frames will be re-evaluated using Window A.", "placeholder": "3", @@ -92,7 +92,7 @@ "advanced": true }, { - "name": "window-seconds-for-desired-calc-on-too-many-starves", + "name": "window_seconds_for_desired_calc_on_too_many_starves", "label": "Timegaps Window (A) Seconds:", "help": "Window A contains a history of timegaps. Its max timegap is used to re-evaluate the desired jitter frames when too many starves occur within it.", "placeholder": "50", @@ -100,7 +100,7 @@ "advanced": true }, { - "name": "window-seconds-for-desired-reduction", + "name": "window_seconds_for_desired_reduction", "label": "Timegaps Window (B) Seconds:", "help": "Window B contains a history of timegaps. Its max timegap is used as a ceiling for the desired jitter frames value.", "placeholder": "10", @@ -108,7 +108,7 @@ "advanced": true }, { - "name": "repetition-with-fade", + "name": "repetition_with_fade", "type": "checkbox", "label": "Repetition with Fade:", "help": "dropped frames and mixing during starves repeat the last frame, eventually fading to silence", @@ -116,7 +116,7 @@ "advanced": true }, { - "name": "print-stream-stats", + "name": "print_stream_stats", "type": "checkbox", "label": "Print Stream Stats:", "help": "audio upstream and downstream stats of each agent printed to audio-mixer stdout", diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 4f048a2ec9..eccd52dfc1 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1396,8 +1396,8 @@ bool DomainServer::isAuthenticatedRequest(HTTPConnection* connection, const QUrl const QByteArray HTTP_COOKIE_HEADER_KEY = "Cookie"; const QString ADMIN_USERS_CONFIG_KEY = "admin-users"; const QString ADMIN_ROLES_CONFIG_KEY = "admin-roles"; - const QString BASIC_AUTH_USERNAME_KEY_PATH = "security.http-username"; - const QString BASIC_AUTH_PASSWORD_KEY_PATH = "security.http-password"; + const QString BASIC_AUTH_USERNAME_KEY_PATH = "security.http_username"; + const QString BASIC_AUTH_PASSWORD_KEY_PATH = "security.http_password"; const QByteArray UNAUTHENTICATED_BODY = "You do not have permission to access this domain-server.";