[beast: 31/47] EBEAST: vc/playcontrols.vue: move project play controls



commit 9c1ceb542b84561fceb5f8358c2c039a85d3f38e
Author: Tim Janik <timj gnu org>
Date:   Fri May 26 16:56:28 2017 +0200

    EBEAST: vc/playcontrols.vue: move project play controls
    
    Signed-off-by: Tim Janik <timj gnu org>

 ebeast/vc/bundle.js        |    1 +
 ebeast/vc/playcontrols.vue |   49 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+), 0 deletions(-)
---
diff --git a/ebeast/vc/bundle.js b/ebeast/vc/bundle.js
index 2106ee7..40bb4aa 100644
--- a/ebeast/vc/bundle.js
+++ b/ebeast/vc/bundle.js
@@ -9,6 +9,7 @@ const vue_components = [
   require ('./button.vue'),
   require ('./icon-button.vue'),
   require ('./button-bar.vue'),
+  require ('./playcontrols.vue'),
 ];
 
 // register components
diff --git a/ebeast/vc/playcontrols.vue b/ebeast/vc/playcontrols.vue
new file mode 100644
index 0000000..8f67193
--- /dev/null
+++ b/ebeast/vc/playcontrols.vue
@@ -0,0 +1,49 @@
+<!-- GNU LGPL v2.1+: http://www.gnu.org/licenses/lgpl.html -->
+
+<docs>
+  ## vc-playcontrols - A container holding the play and seek controls for a song
+  ### Props:
+  - **project** - The BSE object providing playback API.
+  ### Events:
+  ### Slots:
+</docs>
+
+<style lang="less">
+  @import 'mixins.less';
+  .vc-playcontrols { }
+</style>
+
+<template>
+
+  <vc-button-bar
+      class="vc-playcontrols" >
+    <vc-icon-button hotkey="L"     icon="fa-fast-backward" @click="bclick ('...Last')"></vc-icon-button>
+    <vc-icon-button hotkey="B"     icon="fa-backward"      @click="bclick ('...Backwards')"></vc-icon-button>
+    <vc-icon-button hotkey="Space" icon="fa-stop"          @click="bclick ('stop')"></vc-icon-button>
+    <vc-icon-button hotkey="P"     icon="fa-play"          @click="bclick ('play')"></vc-icon-button>
+    <vc-icon-button hotkey="R"     icon="fa-circle"        @click="bclick ('...Record')"></vc-icon-button>
+    <vc-icon-button hotkey="F"     icon="fa-forward"       @click="bclick ('...Forwards')"></vc-icon-button>
+    <vc-icon-button hotkey="N"     icon="fa-fast-forward"  @click="bclick ('...Next')"></vc-icon-button>
+  </vc-button-bar>
+
+</template>
+
+<script>
+module.exports = {
+  name: 'vc-playcontrols',
+  methods:  {
+    bclick (method, e) {
+      let project = App.project(), m = project[method], message;
+      if (m !== undefined) {
+       let result = m.call (project);
+       if (result == undefined)
+         result = 'ok';
+       message = method + ': ' + result;
+      }
+      else
+       message = method + ': unimplemented';
+      App.status (message);
+    },
+  },
+};
+</script>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]