Changeset 35426
- Timestamp:
- 2021-09-20T10:06:23+12:00 (3 years ago)
- Location:
- main/trunk/model-interfaces-dev/atea/korero-maori-asr/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/App.vue
r35411 r35426 126 126 } 127 127 128 setTimeout(p, 50);128 setTimeout(p, 33); // Slightly more than 30hz 129 129 })(); 130 130 } -
main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/components/AudioTimeBar.vue
r35413 r35426 1 1 <template> 2 2 <div class="root"> 3 <input type="range" class="slider-continuous" v-model ="sliderValue" :max="audioLength" step="0.01" />4 <span>{{ s liderValue }}</span>3 <input type="range" class="slider-continuous" v-model.number="sliderValue" :max="audioLength" step="0.01" /> 4 <span>{{ stringSliderValue }}</span> 5 5 </div> 6 6 </template> … … 32 32 sliderValue: { 33 33 get() { 34 if (this.m yValue < 0) {34 if (this.modelValue < 0) { 35 35 return 0; 36 36 } 37 37 38 if (this.m yValue > this.audioLength) {38 if (this.modelValue > this.audioLength) { 39 39 return this.audioLength; 40 40 } 41 41 42 return this.m yValue;42 return this.modelValue; 43 43 }, 44 44 set(newValue) { 45 // this.myValue = newValue; 45 46 this.$emit("update:modelValue", newValue); 46 this.myValue = newValue;47 47 } 48 48 }, 49 49 stringSliderValue() { 50 return Util.formatSecondsTimeString(this.sliderValue );50 return Util.formatSecondsTimeString(this.sliderValue, false, 2); 51 51 } 52 52 } -
main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/components/TranscriptionItemEditor.vue
r35413 r35426 2 2 <div> 3 3 <div class="editor-controls"> 4 <audio-time-bar v-model ="currentPlaybackTime" :audio-length="2" />4 <audio-time-bar v-model.number="currentPlaybackTime" :audio-length="2" /> 5 5 6 6 <toggle-button v-model="enableEditing"> … … 125 125 } 126 126 }, 127 computed: mapState({ 128 playbackState: state => state.playbackState, 129 currentPlaybackTime: state => state.playbackState.currentTime, 130 translations: state => state.translations 131 }), 127 computed: { 128 currentPlaybackTime: { 129 get() { 130 return this.$store.state.playbackState.currentTime; 131 }, 132 set(value) { 133 this.$store.commit("setCurrentPlaybackTime", value); 134 } 135 }, 136 ...mapState({ 137 playbackState: state => state.playbackState, 138 translations: state => state.translations 139 }) 140 }, 132 141 methods: { 133 142 playAudio(startTime) { -
main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/js/Util.js
r35413 r35426 48 48 * @param {Number} seconds The number of seconds. 49 49 * @param {Boolean} includeHoursIfNone Defines whether to include the hours component if it is empty. 50 * @param {Number} fractionDigits The number of millisecond digits to include in the time string. 50 51 * @returns {String} The formatted time string. 51 52 */ 52 static formatSecondsTimeString(seconds, includeHoursIfNone ) {53 static formatSecondsTimeString(seconds, includeHoursIfNone, fractionDigits = 3) { 53 54 const hours = (seconds / 3600) | 0; 54 55 const minutes = ((seconds - (hours * 60)) / 60) | 0; … … 65 66 66 67 result += minutes.toLocaleString("en-US", { maximumFractionDigits: 0, minimumIntegerDigits: 2 }); 67 result += ":" + actualSeconds.toLocaleString("en-US", { minimumFractionDigits: 3, maximumFractionDigis: 3, minimumIntegerDigits: 2 });68 result += ":" + actualSeconds.toLocaleString("en-US", { minimumFractionDigits: fractionDigits, maximumFractionDigits: fractionDigits, minimumIntegerDigits: 2 }); 68 69 69 70 return result; -
main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/main.js
r35412 r35426 37 37 * @param {Numbe} currentTime The current time in the audio playback. 38 38 */ 39 constructor(id = "", isPlaying = false, currentTime = -1) {39 constructor(id = "", isPlaying = false, currentTime = 0) { 40 40 /** @type {String} The ID of the transcription for which audio is currently being played. */ 41 41 this.id = id;
Note:
See TracChangeset
for help on using the changeset viewer.