Compare commits

..
Author SHA1 Message Date
chrisgarrity d390e67542 Merge pull request #5210 from LLK/greenkeeper/scratch-blocks-0.1.0-prerelease.1569422127
Update scratch-blocks to the latest version 🚀
2019-09-25 15:54:21 +01:00
greenkeeper[bot] a8b7be6197 chore(package): update lockfile package-lock.json 2019-09-25 14:38:29 +00:00
greenkeeper[bot] 35da6ace36 chore(package): update scratch-blocks to version 0.1.0-prerelease.1569422127 2019-09-25 14:38:25 +00:00
chrisgarrity 8590ceb4ce Merge pull request #5209 from LLK/greenkeeper/scratch-l10n-3.5.20190924223720
Update scratch-l10n to the latest version 🚀
2019-09-25 15:06:51 +01:00
greenkeeper[bot] 96e637cfc0 chore(package): update lockfile package-lock.json 2019-09-25 00:52:57 +00:00
greenkeeper[bot] f1470feb0a chore(package): update scratch-l10n to version 3.5.20190924223720 2019-09-25 00:52:53 +00:00
DD Liu abe79b30ff Merge pull request #5203 from LLK/greenkeeper/scratch-paint-0.2.0-prerelease.20190923154429
Greenkeeper/scratch paint 0.2.0 prerelease.20190923154429
2019-09-23 12:38:24 -04:00
greenkeeper[bot] 5d1b1fb4c0 chore(package): update lockfile package-lock.json 2019-09-23 15:57:57 +00:00
greenkeeper[bot] 9265ee6323 chore(package): update scratch-paint to version 0.2.0-prerelease.20190923154429
Closes #5201
2019-09-23 15:57:51 +00:00
Ray Schamp 519256c50c Merge pull request #5194 from rschamp/dont-build-tags
Don’t push tags to gh-pages
2019-09-23 11:14:50 -04:00
Eric Rosenbaum 17324e5340 Merge pull request #5149 from ericrosenbaum/feature/limit-louder-rms
Limit louder effect with a max RMS
2019-09-23 10:52:17 -04:00
Ray Schamp 7d01844371 Merge pull request #5196 from rschamp/max-old-space-size
Allow Node to use more memory for old space
2019-09-20 14:35:40 -04:00
rschamp bc1b787974 Allow Node to use more memory for old space
This flag essentially configures how much memory Node can use. If it’s too low, then Node processes may hang as Node spends time garbage collecting. Increasing it allows more memory to be used before garbage collection is necessary.  Travis VMs have 7.5GB of memory, so set the limit to just below that to avoid running out of memory completely.
2019-09-20 13:41:34 -04:00
rschamp 3d1ad740dd Don’t push tags to gh-pages
These builds make our gh-pages branch too large for GitHub to handle.
2019-09-20 10:18:15 -04:00
DD Liu 4c76f654b7 Merge pull request #5189 from fsih/reupdateAssets
Reupdate watermelon a and basketball background with asset exported from sketch
2019-09-19 16:31:57 -04:00
DD Liu bd835adcd4 Reupdate watermelon a and basketball background with asset exported from sketch 2019-09-19 15:21:17 -04:00
Karishma Chadha 78e4cfce68 Merge pull request #5183 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190918022946
Update scratch-vm to the latest version 🚀
2019-09-18 09:34:28 -07:00
Eric Rosenbaum deb5889a2c Merge pull request #5182 from LLK/greenkeeper/scratch-l10n-3.5.20190917223712
Update scratch-l10n to the latest version 🚀
2019-09-18 11:10:26 -04:00
greenkeeper[bot] 2030ad54bc chore(package): update lockfile package-lock.json 2019-09-18 02:32:41 +00:00
greenkeeper[bot] a95604008d chore(package): update scratch-vm to version 0.2.0-prerelease.20190918022946 2019-09-18 02:32:37 +00:00
greenkeeper[bot] bb21288cff chore(package): update lockfile package-lock.json 2019-09-17 22:39:32 +00:00
greenkeeper[bot] f31977489f chore(package): update scratch-l10n to version 3.5.20190917223712 2019-09-17 22:39:28 +00:00
Paul Kaplan f179587c2e Merge pull request #5180 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190917163837
Update scratch-vm to the latest version 🚀
2019-09-17 14:07:04 -04:00
greenkeeper[bot] fa3d9c9e1e chore(package): update lockfile package-lock.json 2019-09-17 16:41:32 +00:00
greenkeeper[bot] 459eb2b767 chore(package): update scratch-vm to version 0.2.0-prerelease.20190917163837 2019-09-17 16:41:29 +00:00
Paul Kaplan 4e1c6afe02 Merge pull request #5178 from paulkaplan/skip-flakey
Skip flakey test
2019-09-17 12:35:56 -04:00
Paul Kaplan dc69ccea64 Skip flakey test 2019-09-17 12:18:03 -04:00
Paul Kaplan 03d9f8f2c6 Merge pull request #5169 from LLK/recording-glitch
Use a larger buffer size for recording to prevent glitching
2019-09-17 11:10:20 -04:00
Paul Kaplan 5d006cf677 Merge pull request #5175 from LLK/greenkeeper/chromedriver-77.0.0
Update chromedriver to the latest version 🚀
2019-09-17 10:54:50 -04:00
DD Liu 6c9657e453 Merge pull request #5172 from fsih/fixAndroidAssets
Fix assets that aren't working correctly in Android libraries
2019-09-17 10:24:24 -04:00
greenkeeper[bot] e82ec50e7b chore(package): update lockfile package-lock.json 2019-09-17 00:00:43 +00:00
greenkeeper[bot] 09ccbb4c01 chore(package): update chromedriver to version 77.0.0 2019-09-17 00:00:38 +00:00
Karishma Chadha e3b2ab22a6 Merge pull request #5170 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190916185023
Update scratch-vm to the latest version 🚀
2019-09-16 18:56:29 -04:00
DD Liu a2bc04e5d4 Fix assets that aren't working correctly in Android libraries 2019-09-16 16:27:55 -04:00
greenkeeper[bot] a4c81e55c0 chore(package): update lockfile package-lock.json 2019-09-16 18:57:52 +00:00
greenkeeper[bot] 2b571d9d83 chore(package): update scratch-vm to version 0.2.0-prerelease.20190916185023 2019-09-16 18:57:47 +00:00
Ray Schamp 6caaaf6f36 Merge pull request #5166 from rschamp/debug-chromedriver
Use not broken Travis VM distribution
2019-09-16 10:53:12 -04:00
Paul Kaplan 2b9550f3d9 Use single setState call instead of two 2019-09-13 14:05:07 -04:00
Paul Kaplan 94bb677fd8 Force meter and waveform to separate paint layer 2019-09-13 14:04:54 -04:00
Paul Kaplan 5b6f33e1a4 Use a larger buffer size for recording to prevent glitching 2019-09-13 12:46:25 -04:00
Paul Kaplan 32723a8876 Merge pull request #5114 from LLK/default-last-asset
Default blocks to last asset instead of first
2019-09-13 09:51:54 -04:00
rschamp a1fc068dd1 Un-hack 2019-09-12 14:50:32 -04:00
rschamp 225fc772f6 Bump travis dist version 2019-09-12 14:42:20 -04:00
Karishma Chadha 2a167ba775 Merge pull request #5165 from LLK/greenkeeper/scratch-render-0.1.0-prerelease.20190912174749
Update scratch-render to the latest version 🚀
2019-09-12 13:59:54 -04:00
greenkeeper[bot] 193717a1a9 chore(package): update lockfile package-lock.json 2019-09-12 17:49:51 +00:00
greenkeeper[bot] 4fc140ec2c chore(package): update scratch-render to version 0.1.0-prerelease.20190912174749 2019-09-12 17:49:47 +00:00
Ray Schamp 2ffac96579 Merge pull request #5163 from rschamp/bump-chromedriver
Ugly hack to keep being able to publish
2019-09-12 11:50:41 -04:00
rschamp bc57adc12c Ugly hack to keep being able to publish 2019-09-12 11:32:02 -04:00
Karishma Chadha dc64aa92fd Merge pull request #5151 from LLK/greenkeeper/scratch-vm-0.2.0-prerelease.20190904154449
Update scratch-vm to the latest version 🚀
2019-09-11 12:41:30 -04:00
chrisgarrity 8b5ff14ac9 Merge pull request #5161 from LLK/greenkeeper/scratch-l10n-3.5.20190910223701
Greenkeeper/scratch l10n 3.5.20190910223701
2019-09-11 11:56:30 -04:00
Karishma Chadha 6641c4696b Merge pull request #5154 from LLK/greenkeeper/scratch-render-0.1.0-prerelease.20190905011937
Update scratch-render to the latest version 🚀
2019-09-11 10:16:16 -04:00
Paul Kaplan a680d30930 Merge pull request #5143 from towerofnix/selector-padding
Use list-area:after to pad scroll area
2019-09-11 09:22:10 -04:00
Paul Kaplan 1dce71e787 Merge pull request #5115 from paulkaplan/fix-bluetooth-keyboards
Fix bluetooth keyboards with iOS keypress blocks
2019-09-11 09:12:40 -04:00
greenkeeper[bot] 1451416e6b chore(package): update lockfile package-lock.json 2019-09-10 22:39:16 +00:00
greenkeeper[bot] f4f20203f4 chore(package): update scratch-l10n to version 3.5.20190910223701
Closes #5150
2019-09-10 22:39:12 +00:00
Eric Rosenbaum 2df0c80b30 Simplify chunk counting logic 2019-09-10 10:35:19 -04:00
Eric Rosenbaum 6414985461 Calc tooLoud with chunkLevels, disable louder btn 2019-09-05 13:49:22 -04:00
greenkeeper[bot] 230debb911 chore(package): update lockfile package-lock.json 2019-09-05 01:21:30 +00:00
greenkeeper[bot] b42291d10b chore(package): update scratch-render to version 0.1.0-prerelease.20190905011937 2019-09-05 01:21:26 +00:00
greenkeeper[bot] f9ea1088e8 chore(package): update lockfile package-lock.json 2019-09-04 15:56:55 +00:00
greenkeeper[bot] bb837f57e2 chore(package): update scratch-vm to version 0.2.0-prerelease.20190904154449 2019-09-04 15:56:47 +00:00
Eric Rosenbaum 059d3f709b Use a waveshaper to hard limit samples 2019-09-04 11:01:10 -04:00
Eric Rosenbaum 26ca5da725 Limit louder effect with a max RMS 2019-09-03 18:13:45 -04:00
Florrie b74f19e6e6 Use list-area:after to pad scroll area 2019-09-02 23:26:46 -03:00
Paul Kaplan 7b9aed73f3 Fix multi-word matching in the blocks 2019-08-22 09:44:22 -04:00
Paul Kaplan 280f139ba2 Fix costume test 2019-08-21 16:05:29 -04:00
Paul Kaplan def5cdc450 Send keyCode if the key information is gone 2019-08-21 15:28:04 -04:00
Paul Kaplan 79fe377f19 Update integration tests 2019-08-21 15:17:34 -04:00
Paul Kaplan b2dd3ed421 Default blocks to last asset instead of first 2019-08-21 14:56:46 -04:00
17 changed files with 163 additions and 84 deletions

No files matched your search

+5 -2
View File
@@ -1,16 +1,18 @@
language: node_js
sudo: required
dist: trusty
dist: xenial
addons:
chrome: stable
node_js:
- 8
env:
global:
- CHROMEDRIVER_VERSION=LATEST
- NODE_ENV=production
- SMOKE_URL=https://llk.github.io/scratch-gui/$TRAVIS_PULL_REQUEST_BRANCH
- NODE_OPTIONS=--max-old-space-size=7250
- NPM_TAG=latest
- RELEASE_VERSION="0.1.0-prerelease.$(date +'%Y%m%d%H%M%S')"
- SMOKE_URL=https://llk.github.io/scratch-gui/$TRAVIS_PULL_REQUEST_BRANCH
cache:
directories:
- node_modules
@@ -74,6 +76,7 @@ deploy:
on:
all_branches: true
condition: $TRAVIS_EVENT_TYPE != cron && ! $TRAVIS_BRANCH =~ ^greenkeeper/
tags: false # Don't push tags to gh-pages
skip_cleanup: true
script: npm run deploy -- -x -e $TRAVIS_BRANCH -r https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
- provider: script
+24 -24
View File
@@ -928,9 +928,9 @@
"dev": true
},
"@types/babel__core": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.2.tgz",
"integrity": "sha512-cfCCrFmiGY/yq0NuKNxIQvZFy9kY/1immpSpTngOnyIbD4+eJOG5mxphhHDv3CHL9GltO4GcKr54kGBg3RNdbg==",
"version": "7.1.3",
"resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.3.tgz",
"integrity": "sha512-8fBo0UR2CcwWxeX7WIIgJ7lXjasFxoYgRnFHUj+hRvKkpiBJbxhdAPTCY6/ZKM0uxANFVzt4yObSLuTiTnazDA==",
"dev": true,
"requires": {
"@babel/parser": "^7.1.0",
@@ -941,9 +941,9 @@
}
},
"@types/babel__generator": {
"version": "7.0.2",
"resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.0.2.tgz",
"integrity": "sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ==",
"version": "7.6.0",
"resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.0.tgz",
"integrity": "sha512-c1mZUu4up5cp9KROs/QAw0gTeHrw/x7m52LcnvMxxOZ03DmLwPV0MlGmlgzV3cnSdjhJOZsj7E7FHeioai+egw==",
"dev": true,
"requires": {
"@babel/types": "^7.0.0"
@@ -2664,9 +2664,9 @@
}
},
"chromedriver": {
"version": "76.0.0",
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-76.0.0.tgz",
"integrity": "sha512-jGyqs0N+lMo9iaNQxGKNPiLJWb2L9s2rwbRr1jJeQ37n6JQ1+5YMGviv/Fx5Z08vBWYbAvrKEzFsuYf8ppl+lw==",
"version": "77.0.0",
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-77.0.0.tgz",
"integrity": "sha512-mZa1IVx4HD8rDaItWbnS470mmypgiWsDiu98r0NkiT4uLm3qrANl4vOU6no6vtWtLQiW5kt1POcIbjeNpsLbXA==",
"dev": true,
"requires": {
"del": "^4.1.1",
@@ -11339,9 +11339,9 @@
}
},
"scratch-blocks": {
"version": "0.1.0-prerelease.1568071968",
"resolved": "https://registry.npmjs.org/scratch-blocks/-/scratch-blocks-0.1.0-prerelease.1568071968.tgz",
"integrity": "sha512-oXDeEOBXadE8aEfmWa6kgwhVMN9AZMqIy54sCuNArktyfrZdZgVQr+muhEuPwiDF1vssGbVjX5Yo4uYrMJf9Mg==",
"version": "0.1.0-prerelease.1569422127",
"resolved": "https://registry.npmjs.org/scratch-blocks/-/scratch-blocks-0.1.0-prerelease.1569422127.tgz",
"integrity": "sha512-flOmjUPWVNQSPTCd4LE8xbPd1X/MePBgWNrWllevn0WilJNWMVbX6Bs3gtRIZM8rvEuKaUzcLutwGdtws9XFQQ==",
"dev": true,
"requires": {
"exports-loader": "0.6.3",
@@ -11349,9 +11349,9 @@
}
},
"scratch-l10n": {
"version": "3.5.20190827223456",
"resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.5.20190827223456.tgz",
"integrity": "sha512-Zsl9lrNW69omsxGRgwMN0i54SxPI/yJqWi1GubQw8qu2plkFHCC0ngoyaRkTxoYpHEJYSB6s8T8v6VrcEI1Y0A==",
"version": "3.5.20190924223720",
"resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.5.20190924223720.tgz",
"integrity": "sha512-5bNisTEe9WJI+w3TQQ7XVutoFZuBKtHLLfijFd2vOkLv93XoxEQvpW62uz34uyj2tX9N8JPzCB+KaJalC+Z8Mg==",
"dev": true,
"requires": {
"@babel/cli": "^7.1.2",
@@ -11361,9 +11361,9 @@
}
},
"scratch-paint": {
"version": "0.2.0-prerelease.20190822205009",
"resolved": "https://registry.npmjs.org/scratch-paint/-/scratch-paint-0.2.0-prerelease.20190822205009.tgz",
"integrity": "sha512-kkeEegtHCP9tH1YjQyY116sYWhUNlRULsDoGkGkesNgJGO2CU2rQblMnHk+F5nV2actdMdqjTXihjpZtySBaxg==",
"version": "0.2.0-prerelease.20190923154429",
"resolved": "https://registry.npmjs.org/scratch-paint/-/scratch-paint-0.2.0-prerelease.20190923154429.tgz",
"integrity": "sha512-vuHulFufVR9MZLTC015Z9/ybcgS/73Wrj4V7rt7zMquFg1YKDY5MyGm45cQtDx93+I6CRc12J4mtU8cZ0uTGaw==",
"dev": true,
"requires": {
"@scratch/paper": "0.11.20190729152410",
@@ -11476,9 +11476,9 @@
}
},
"scratch-render": {
"version": "0.1.0-prerelease.20190904212449",
"resolved": "https://registry.npmjs.org/scratch-render/-/scratch-render-0.1.0-prerelease.20190904212449.tgz",
"integrity": "sha512-AfSBYbEvG3E44pSiBniU6Lzc7YhVemc1uJLUkBrU8KvWPvCx5dRfAiASSnjHNaDZV8Vv4QRpV3i/fepjI6Eofw==",
"version": "0.1.0-prerelease.20190912174749",
"resolved": "https://registry.npmjs.org/scratch-render/-/scratch-render-0.1.0-prerelease.20190912174749.tgz",
"integrity": "sha512-GHXtprwGBFZld5wnGqw2sfySbxFZfKuQfkcEyqOZlYPgf7uQ9FEJ1MEoFhX9T6le0C9XA9f/fvh50MEWc1R3TA==",
"dev": true,
"requires": {
"grapheme-breaker": "0.3.2",
@@ -11563,9 +11563,9 @@
"dev": true
},
"scratch-vm": {
"version": "0.2.0-prerelease.20190822194548",
"resolved": "https://registry.npmjs.org/scratch-vm/-/scratch-vm-0.2.0-prerelease.20190822194548.tgz",
"integrity": "sha512-FYzGttFAoU4WnZybidzElRPY5WMLkHdzc0ANd5ALq0IhcevAy2eKJh9SCuyN9v7wsPgDAr4Q71sCgOWV1Jwy0w==",
"version": "0.2.0-prerelease.20190918022946",
"resolved": "https://registry.npmjs.org/scratch-vm/-/scratch-vm-0.2.0-prerelease.20190918022946.tgz",
"integrity": "sha512-wkKrnhIMpv9xfUH3SSruEDE7PD+Vd8cX9VKRp34POshoYGYKCK5/sGTuRi35zMEWAwxTKtxWs4B6HzH7ySBf/Q==",
"dev": true,
"requires": {
"@vernier/godirect": "1.5.0",
+6 -6
View File
@@ -44,7 +44,7 @@
"babel-loader": "^8.0.4",
"base64-loader": "1.0.0",
"bowser": "1.9.4",
"chromedriver": "76.0.0",
"chromedriver": "77.0.0",
"classnames": "2.2.6",
"computed-style-to-inline-style": "3.0.0",
"copy-webpack-plugin": "^4.5.1",
@@ -107,13 +107,13 @@
"redux-throttle": "0.1.1",
"rimraf": "^2.6.1",
"scratch-audio": "0.1.0-prerelease.20190114210212",
"scratch-l10n": "3.5.20190827223456",
"scratch-blocks": "0.1.0-prerelease.1568071968",
"scratch-paint": "0.2.0-prerelease.20190822205009",
"scratch-render": "0.1.0-prerelease.20190904212449",
"scratch-l10n": "3.5.20190924223720",
"scratch-blocks": "0.1.0-prerelease.1569422127",
"scratch-paint": "0.2.0-prerelease.20190923154429",
"scratch-render": "0.1.0-prerelease.20190912174749",
"scratch-storage": "1.3.2",
"scratch-svg-renderer": "0.2.0-prerelease.20190822202608",
"scratch-vm": "0.2.0-prerelease.20190822194548",
"scratch-vm": "0.2.0-prerelease.20190918022946",
"selenium-webdriver": "3.6.0",
"startaudiocontext": "1.2.1",
"style-loader": "^0.23.0",
+9 -1
View File
@@ -50,8 +50,16 @@ $fade-out-distance: 100px;
overflow-y: scroll;
display: flex;
flex-direction: column;
}
.list-area:after {
/* Make sure there is room to scroll beyond the last tile */
padding-bottom: 70px;
content: '';
display: block;
height: 70px;
width: 100%;
flex-shrink: 0;
order: 99999999;
}
.list-item {
+3 -1
View File
@@ -20,8 +20,10 @@
border: 1px solid $ui-black-transparent;
border-radius: 5px;
padding: 3px;
/* Force these to be on their own render layer because they update often */
transform: translateZ(0);
}
.meter-container {
margin-right: 5px;
height: 180px;
@@ -265,6 +265,7 @@ const SoundEditor = props => (
onClick={props.onSlower}
/>
<IconButton
disabled={props.tooLoud}
className={classNames(styles.effectButton, styles.flipInRtl)}
img={louderIcon}
title={<FormattedMessage {...messages.louder} />}
@@ -340,6 +341,7 @@ SoundEditor.propTypes = {
onUndo: PropTypes.func.isRequired,
playhead: PropTypes.number,
setRef: PropTypes.func,
tooLoud: PropTypes.bool.isRequired,
trimEnd: PropTypes.number,
trimStart: PropTypes.number
};
+3 -3
View File
@@ -340,9 +340,9 @@ class Blocks extends React.Component {
const targetSounds = target.getSounds();
const dynamicBlocksXML = this.props.vm.runtime.getBlocksXML();
return makeToolboxXML(target.isStage, target.id, dynamicBlocksXML,
targetCostumes[0].name,
stageCostumes[0].name,
targetSounds.length > 0 ? targetSounds[0].name : ''
targetCostumes[targetCostumes.length - 1].name,
stageCostumes[stageCostumes.length - 1].name,
targetSounds.length > 0 ? targetSounds[targetSounds.length - 1].name : ''
);
} catch {
return null;
+4 -4
View File
@@ -44,10 +44,10 @@ class RecordingStep extends React.Component {
alert(this.props.intl.formatMessage(messages.alertMsg)); // eslint-disable-line no-alert
}
handleLevelUpdate (level) {
this.setState({level});
if (this.props.recording) {
this.setState({levels: (this.state.levels || []).concat([level])});
}
this.setState({
level: level,
levels: this.props.recording ? (this.state.levels || []).concat([level]) : this.state.levels
});
}
handleRecord () {
this.audioRecorder.startRecording();
+12
View File
@@ -14,6 +14,8 @@ import log from '../lib/log.js';
const UNDO_STACK_SIZE = 99;
const MAX_RMS = 1.2;
class SoundEditor extends React.Component {
constructor (props) {
super(props);
@@ -265,6 +267,15 @@ class SoundEditor extends React.Component {
}
});
}
tooLoud () {
const numChunks = this.state.chunkLevels.length;
const startIndex = this.state.trimStart === null ?
0 : Math.floor(this.state.trimStart * numChunks);
const endIndex = this.state.trimEnd === null ?
numChunks - 1 : Math.ceil(this.state.trimEnd * numChunks);
const trimChunks = this.state.chunkLevels.slice(startIndex, endIndex);
return Math.max(...trimChunks) > MAX_RMS;
}
getUndoItem () {
return {
...this.copyCurrentBuffer(),
@@ -399,6 +410,7 @@ class SoundEditor extends React.Component {
name={this.props.name}
playhead={this.state.playhead}
setRef={this.setRef}
tooLoud={this.tooLoud()}
trimEnd={this.state.trimEnd}
trimStart={this.state.trimStart}
onChangeName={this.handleChangeName}
+14 -14
View File
@@ -1,12 +1,12 @@
import 'get-float-time-domain-data';
import getUserMedia from 'get-user-media-promise';
import SharedAudioContext from './shared-audio-context.js';
import {computeRMS} from './audio-util.js';
import {computeRMS, computeChunkedRMS} from './audio-util.js';
class AudioRecorder {
constructor () {
this.audioContext = new SharedAudioContext();
this.bufferLength = 1024;
this.bufferLength = 8192;
this.userMediaStream = null;
this.mediaStreamSource = null;
@@ -51,7 +51,7 @@ class AudioRecorder {
this.userMediaStream = userMediaStream;
this.mediaStreamSource = this.audioContext.createMediaStreamSource(userMediaStream);
this.sourceNode = this.audioContext.createGain();
this.scriptProcessorNode = this.audioContext.createScriptProcessor(this.bufferLength, 2, 2);
this.scriptProcessorNode = this.audioContext.createScriptProcessor(this.bufferLength, 1, 1);
this.scriptProcessorNode.onaudioprocess = processEvent => {
if (this.recording && !this.disposed) {
@@ -68,9 +68,9 @@ class AudioRecorder {
const update = () => {
if (this.disposed) return;
requestAnimationFrame(update);
this.analyserNode.getFloatTimeDomainData(dataArray);
onUpdate(computeRMS(dataArray));
requestAnimationFrame(update);
};
requestAnimationFrame(update);
@@ -83,7 +83,16 @@ class AudioRecorder {
}
stop () {
const chunkLevels = this.buffers.map(buffer => computeRMS(buffer));
const buffer = new Float32Array(this.buffers.length * this.bufferLength);
let offset = 0;
for (let i = 0; i < this.buffers.length; i++) {
const bufferChunk = this.buffers[i];
buffer.set(bufferChunk, offset);
offset += bufferChunk.length;
}
const chunkLevels = computeChunkedRMS(buffer);
const maxRMS = Math.max.apply(null, chunkLevels);
const threshold = maxRMS / 8;
@@ -105,15 +114,6 @@ class AudioRecorder {
trimEnd = 1;
}
const buffer = new Float32Array(this.buffers.length * this.bufferLength);
let offset = 0;
for (let i = 0; i < this.buffers.length; i++) {
const bufferChunk = this.buffers[i];
buffer.set(bufferChunk, offset);
offset += bufferChunk.length;
}
return {
levels: chunkLevels,
samples: buffer,
+9 -1
View File
@@ -14,8 +14,16 @@ class VolumeEffect {
this.gain.gain.setValueAtTime(volume, endSeconds);
this.gain.gain.exponentialRampToValueAtTime(1.0, endSeconds + this.rampLength);
// Use a waveshaper node to prevent sample values from exceeding -1 or 1.
// Without this, gain can cause samples to exceed this range, then they
// are clipped on save, and the sound is distorted on load.
this.waveShaper = this.audioContext.createWaveShaper();
this.waveShaper.curve = new Float32Array([-1, 1]);
this.waveShaper.oversample = 'none';
this.input.connect(this.gain);
this.gain.connect(this.output);
this.gain.connect(this.waveShaper);
this.waveShaper.connect(this.output);
}
}
+1 -1
View File
@@ -52,7 +52,7 @@
},
{
"name": "Basketball 1",
"md5": "e494c4f44897d94e0541f7036a302449.svg",
"md5": "ae21eac3d1814aee1d37ae82ea287816.svg",
"type": "backdrop",
"tags": [
"sports",
+4 -4
View File
@@ -2563,7 +2563,7 @@
},
{
"name": "Dinosaur1-c",
"md5": "a2bb28d5ba55ba997bec63772437cecf.svg",
"md5": "78f7e20f0e187fdca81195e4cc134175.svg",
"type": "costume",
"tags": [
"animals",
@@ -10493,7 +10493,7 @@
},
{
"name": "Watermelon-a",
"md5": "26fecef75cf3b6e0d98bff5c06475036.svg",
"md5": "8736ecc2524895733534c888cd91fa1f.svg",
"type": "costume",
"tags": [
"food",
@@ -10511,7 +10511,7 @@
},
{
"name": "Watermelon-b",
"md5": "fbdaf4d1d349edd3ddf3a1c4528aa9ec.svg",
"md5": "1ed1c8b78eae2ee7422074d7f883031d.svg",
"type": "costume",
"tags": [
"food",
@@ -10528,7 +10528,7 @@
},
{
"name": "Watermelon-c",
"md5": "5976c10412306fc093c1d1930fa05119.svg",
"md5": "677738282686d2dcce35d731c3ddc043.svg",
"type": "costume",
"tags": [
"food",
+5 -5
View File
@@ -3845,7 +3845,7 @@
{
"costumeName": "dinosaur1-c",
"baseLayerID": -1,
"baseLayerMD5": "a2bb28d5ba55ba997bec63772437cecf.svg",
"baseLayerMD5": "78f7e20f0e187fdca81195e4cc134175.svg",
"bitmapResolution": 1,
"rotationCenterX": 81,
"rotationCenterY": 91
@@ -15612,7 +15612,7 @@
},
{
"name": "Watermelon",
"md5": "26fecef75cf3b6e0d98bff5c06475036.svg",
"md5": "8736ecc2524895733534c888cd91fa1f.svg",
"type": "sprite",
"tags": [
"food",
@@ -15643,7 +15643,7 @@
{
"costumeName": "watermelon-a",
"baseLayerID": -1,
"baseLayerMD5": "26fecef75cf3b6e0d98bff5c06475036.svg",
"baseLayerMD5": "8736ecc2524895733534c888cd91fa1f.svg",
"bitmapResolution": 1,
"rotationCenterX": 40,
"rotationCenterY": 27
@@ -15651,7 +15651,7 @@
{
"costumeName": "watermelon-b",
"baseLayerID": -1,
"baseLayerMD5": "fbdaf4d1d349edd3ddf3a1c4528aa9ec.svg",
"baseLayerMD5": "1ed1c8b78eae2ee7422074d7f883031d.svg",
"bitmapResolution": 1,
"rotationCenterX": 22,
"rotationCenterY": 27
@@ -15659,7 +15659,7 @@
{
"costumeName": "watermelon-c",
"baseLayerID": -1,
"baseLayerMD5": "5976c10412306fc093c1d1930fa05119.svg",
"baseLayerMD5": "677738282686d2dcce35d731c3ddc043.svg",
"bitmapResolution": 1,
"rotationCenterX": 21,
"rotationCenterY": 15
+4 -4
View File
@@ -87,9 +87,9 @@ const vmListenerHOC = function (WrappedComponent) {
// Don't capture keys intended for Blockly inputs.
if (e.target !== document && e.target !== document.body) return;
const key = (!e.key || e.key === 'Dead') ? e.keyCode : e.key;
this.props.vm.postIOData('keyboard', {
keyCode: e.keyCode,
key: e.key,
key: key,
isDown: true
});
@@ -102,9 +102,9 @@ const vmListenerHOC = function (WrappedComponent) {
handleKeyUp (e) {
// Always capture up events,
// even those that have switched to other targets.
const key = (!e.key || e.key === 'Dead') ? e.keyCode : e.key;
this.props.vm.postIOData('keyboard', {
keyCode: e.keyCode,
key: e.key,
key: key,
isDown: false
});
+13 -14
View File
@@ -182,7 +182,8 @@ describe('Working with the blocks', () => {
// Rename the costume
await clickText('Costumes');
const el = await findByXpath("//input[@value='costume1']");
await clickText('costume2', scope.costumesTab);
const el = await findByXpath("//input[@value='costume2']");
await el.sendKeys('newname');
// Make sure it is updated in the block menu
@@ -197,7 +198,8 @@ describe('Working with the blocks', () => {
// Rename the costume
await clickText('Costumes');
const el = await findByXpath("//input[@value='costume1']");
await clickText('costume2', scope.costumesTab);
const el = await findByXpath("//input[@value='costume2']");
await el.sendKeys('<NewCostume>');
// Make sure it is updated in the block menu
@@ -209,17 +211,15 @@ describe('Working with the blocks', () => {
await clickText('Sound', scope.blocksTab);
});
// NOTE: This test describes the current behavior so that changes are not
// introduced inadvertly, but I know this is not the desired behavior
test('Adding costumes DOES NOT update the default costume name in the toolbox', async () => {
test('Adding costumes DOES update the default costume name in the toolbox', async () => {
await loadUri(uri);
// By default, costume1 is in the costume tab
// By default, costume2 is in the costume tab
await clickText('Looks', scope.blocksTab);
await driver.sleep(500); // Wait for scroll to finish
await clickText('costume1', scope.blocksTab);
await clickText('costume2', scope.blocksTab);
// Also check that adding a new costume does not update the list
// Also check that adding a new costume does update the list
await clickText('Costumes');
const el = await findByXpath('//button[@aria-label="Choose a Costume"]');
await driver.actions().mouseMove(el)
@@ -227,14 +227,13 @@ describe('Working with the blocks', () => {
await driver.sleep(500); // Wait for thermometer menu to come up
await clickXpath('//button[@aria-label="Paint"]');
await clickText('costume3', scope.costumesTab);
// Check that the menu has not been updated
// Check that the menu has been updated
await clickText('Code');
await clickText('costume1', scope.blocksTab);
await clickText('costume3', scope.blocksTab);
});
// NOTE: This test describes the current behavior so that changes are not
// introduced inadvertly, but I know this is not the desired behavior
test('Adding a sound DOES NOT update the default sound name in the toolbox', async () => {
// Skipped because it was flakey on travis, but seems to run locally ok
test.skip('Adding a sound DOES update the default sound name in the toolbox', async () => {
await loadUri(uri);
await clickText('Sounds');
await clickXpath('//button[@aria-label="Choose a Sound"]');
@@ -242,7 +241,7 @@ describe('Working with the blocks', () => {
await clickText('Code');
await clickText('Sound', scope.blocksTab);
await driver.sleep(500); // Wait for scroll to finish
await clickText('Meow', scope.blocksTab); // Meow, not A Bass
await clickText('A\u00A0Bass', scope.blocksTab); // Need &nbsp; for block text
});
// Regression test for switching between editor/player causing toolbox to stop updating
+45
View File
@@ -133,4 +133,49 @@ describe('VMListenerHOC', () => {
const actions = store.getActions();
expect(actions.length).toEqual(0);
});
test('keypresses go to the vm', () => {
const Component = () => (<div />);
const WrappedComponent = vmListenerHOC(Component);
// Mock document.addEventListener so we can trigger keypresses manually
// Cannot use the enzyme simulate method because that only works on synthetic events
const eventTriggers = {};
document.addEventListener = jest.fn((event, cb) => {
eventTriggers[event] = cb;
});
vm.postIOData = jest.fn();
store = mockStore({
scratchGui: {
mode: {isFullScreen: true},
modals: {soundRecorder: true},
vm: vm
}
});
mount(
<WrappedComponent
attachKeyboardEvents
store={store}
vm={vm}
/>
);
// keyboard events that do not target the document or body are ignored
eventTriggers.keydown({key: 'A', target: null});
expect(vm.postIOData).not.toHaveBeenLastCalledWith('keyboard', {key: 'A', isDown: true});
// keydown/up with target as the document are sent to the vm via postIOData
eventTriggers.keydown({key: 'A', target: document});
expect(vm.postIOData).toHaveBeenLastCalledWith('keyboard', {key: 'A', isDown: true});
eventTriggers.keyup({key: 'A', target: document});
expect(vm.postIOData).toHaveBeenLastCalledWith('keyboard', {key: 'A', isDown: false});
// When key is 'Dead' e.g. bluetooth keyboards on iOS, it sends keyCode instead
// because the VM can process both named keys or keyCodes as the `key` property
eventTriggers.keyup({key: 'Dead', keyCode: 10, target: document});
expect(vm.postIOData).toHaveBeenLastCalledWith('keyboard', {key: 10, isDown: false});
});
});