Changeset 35445 for main/trunk


Ignore:
Timestamp:
2021-09-21T14:36:58+12:00 (3 years ago)
Author:
cstephen
Message:

Create AudioPlaybackModule

Location:
main/trunk/model-interfaces-dev/atea/korero-maori-asr/src
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/App.vue

    r35442 r35445  
    154154        if (audioElement.currentTime !== lastTime) {
    155155            lastTime = audioElement.currentTime;
    156             store.commit("setCurrentPlaybackTime", lastTime);
    157             store.commit("setCurrentlyPlaying", true);
     156            store.commit("playbackStateSetCurrentTime", lastTime);
     157            store.commit("playbackStateSetIsPlaying", true);
    158158        }
    159159        else {
    160             store.commit("setCurrentlyPlaying", false);
     160            store.commit("playbackStateSetIsPlaying", false);
    161161        }
    162162
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/components/TranscriptionItem.vue

    r35439 r35445  
    33        <!-- Header containing info and actions for the transcription -->
    44        <div class="transcription__header">
    5             <button class="btn-fab" v-on:click="playAudio(0)" type="button" title="Play Audio">
    6                 <span class="material-icons mdi-l">play_arrow</span>
     5            <button class="btn-fab" v-on:click="playAudio(-1)" type="button" title="Play Audio">
     6                <span class="material-icons mdi-l play-button" v-if="!isPlaying">play_arrow</span>
     7                <span class="material-icons mdi-l play-button" v-if="isPlaying">pause</span>
    78            </button>
    89
     
    113114    },
    114115    computed: mapState({
    115         translations: state => state.translations
     116        translations: state => state.translations,
     117        isPlaying: state => state.playbackState.isPlaying
    116118    }),
    117119    methods: {
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/components/TranscriptionItemEditor.vue

    r35439 r35445  
    130130            },
    131131            set(value) {
    132                 this.$store.commit("setCurrentPlaybackTime", value);
     132                this.$store.commit("playbackStateSetCurrentTime", value);
    133133            }
    134134        },
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/main.js

    r35439 r35445  
    11import { createApp } from "vue";
    22import { createStore } from "vuex"
     3import AudioPlayback from "./js/AudioPlaybackModule";
    34import App from "./App.vue";
    45import ToggleButton from "./components/ToggleButton.vue"
     
    9495        },
    9596
     97        playbackStateSetID(state, id) {
     98            state.playbackState.id = id;
     99        },
     100        playbackStateSetIsPlaying(state, isPlaying) {
     101            state.playbackState.isPlaying = isPlaying;
     102        },
     103        playbackStateSetCurrentTime(state, time) {
     104            state.playbackState.currentTime = time;
     105        },
     106
    96107        /**
    97108         * Sets the current playback state.
     
    101112        setPlaybackState(state, playbackState) {
    102113            state.playbackState = playbackState;
    103         },
    104         setCurrentlyPlaying(state, isPlaying) {
    105             state.playbackState.isPlaying = isPlaying;
    106         },
    107         setCurrentPlaybackTime(state, time) {
    108             state.playbackState.currentTime = time;
    109         },
    110         setCurrentlyPlayingId(state, id) {
    111             state.playbackState.id = id;
    112114        },
    113115        setTranslations(state, translations) {
     
    122124    }
    123125});
     126
     127AudioPlayback.initialise(store);
    124128
    125129createApp(App)
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/styles/_material.scss

    r35443 r35445  
    55
    66:root {
     7    // Set these to adjust the colour palette
    78    --primary-bg-color-l1: 36, 156, 207;
    89    --primary-bg-color: 33, 145, 192;
     
    2526    --transition-duration: 0.15s;
    2627
    27 
     28    // Default theme
    2829    @extend .theme-primary;
    2930}
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/styles/theme.scss

    r35431 r35445  
    1414
    1515:root {
    16     --monospace-font: 16px 'Roboto Mono', sans-serif;
     16    --monospace-font: 1rem 'Roboto Mono', sans-serif;
    1717    --page-bg-color: #f7f4f0;
    1818}
     
    2121    background-color: var(--page-bg-color);
    2222    font-family: 'Roboto', sans-serif;
    23     font-size: 16px;
    2423   
    2524    margin: 0;
Note: See TracChangeset for help on using the changeset viewer.