Skip to content

Commit

Permalink
Merge pull request #5 from kumboleijo/dev
Browse files Browse the repository at this point in the history
merge: branch dev into master
  • Loading branch information
kumboleijo authored May 16, 2018
2 parents 2de8e01 + 8a2b13e commit be40bdc
Show file tree
Hide file tree
Showing 7 changed files with 219 additions and 249 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,3 @@ yarn-error.log*
*.ntvs*
*.njsproj
*.sln

# special files
deploy.sh
91 changes: 58 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ Live-Demo: https://www.songbook.de.cool

## Installation

1. Download the latest release (you can find all releases [here](https://github.com/kumboleijo/Songbook/releases) - currently Songbook v1.0-beta)
> `git clone --branch v1.0-beta --single-branch https://github.com/kumboleijo/Songbook`
1. Download the latest release (you can find all releases [here](https://github.com/kumboleijo/Songbook/releases) - currently Songbook v1.0)
> `git clone --branch v1.0 --single-branch https://github.com/kumboleijo/Songbook`
2. `cd <DIRECTORY>` and run `npm i`.

## How to use it

1. Use the Songsheet Generator to convert a song from the chordpro file format to html
2. Copy this file into `src/assets/songs/{ArtistName}/`
3. You need to register your song in `Data.vue` located in `src/components/` and add it to a songbook
3. You need to register your song in `Data.vue` located in `src/components/`

```javascript
Example
Expand All @@ -39,43 +39,68 @@ data() {
currentSetlist: [ ... ],

// put your song files here
songs: [
songs:
{
id: 1, name: 'Hurt', artist: 'Johnny Cash',
files: [
{ capo: 0, file: Hurt }
], infos: [
// you can put song specific infos here
// some examples:
{ info: 'Main Vocals', value: 'Max' },
{ info: 'Backing Vocals', value: 'Tina, Laura' }
], stageDirections: {
// the stage directions allow you to set song specific instructions for mixing and stuff
// currently they will be rendered as: Part | Presence
// some examples:
parts: [
{
name: 'Intro / Solo',
values: [ 'E-Git1,', 'Synth' ]
},
{
name: 'Verse',
values: [ 'Main Vocals / Reverb' ]
}
]
hurt: {
name: 'Hurt', artist: 'Johnny Cash',
files: [
{ capo: 0, file: Hurt }
], infos: [
// you can add as many info boxes as you want per song
// structure: { info: info, value: value }
{ info: 'Main Vocals', value: 'A' },
{ info: 'Backing Vocals', value: 'B, C' },
{ info: 'Keys', value: 'E-Piano' },
{ info: 'Rh. Git', value: 'E-Git' }
], stageDirections: {
// you can put as many parts as you want per song
parts: [
{
name: 'Intro / Solo', values: [
'A-Git / Jonas', 'E-Git / A'
]
},
{
name: 'Verse', values: [
'Reverb'
]
},
{
name: 'Outro', values: [
'A-Git / Jonas', 'E-Git / A'
]
}
]
}
}
}
],
// put your songbooks here
songbooks: [
{ id: 1, name: 'Concert 1', date: '01.01.2018', songIDs: [1] },
{ id: 2, name: 'Concert 2', date: '02.01.2018', songIDs: [1] },
]
}
}
...
```
4. Add the song to a songbook
```javascript
Example
File: Data.vue

export default {
name: 'Grid',
created() {

let mySongbooks = [
// this songbook will be auto generated and will contain all songs :)
{ name: 'All Songs', date: '', songs: [] },
// #############################################################
{
name: 'My first Concert', date: '01.01.1970', songs: [
this.songs.hurt
]
}
]
...
```
## Build Setup
```bash
Expand Down
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "songbook",
"version": "1.0.0",
"description": "A Vue.js project",
"description": "A responsive web songbook.",
"author": "Jonas Schmitt <[email protected]>",
"private": true,
"scripts": {
Expand Down Expand Up @@ -62,9 +62,5 @@
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
"browserslist": ["> 1%", "last 2 versions", "not ie <= 8"]
}
21 changes: 0 additions & 21 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,6 @@
name: 'App',
components: {
Grid, NavBar, Data
},
beforeCreate() {
// console.log("App > beforeCreate()")
},
created() {
// console.log("App > created()")
},
beforeMount() {
// console.log("App > beforeMount()")
},
beforeUpdate() {
// console.log("App > beforeUpdate()")
},
updated() {
// console.log("App > updated()")
},
beforeDestroy() {
// console.log("App > beforeDestroy()")
},
destroyed() {
// console.log("App > destroyed()")
}
}
</script>
Expand Down
161 changes: 83 additions & 78 deletions src/components/Data.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,41 @@
export default {
name: 'Grid',
beforeCreate() {
// console.log("Data > beforeCreate()")
},
created() {
// console.log("Data > created()")
let mySongbooks = [
// this songbook will be auto generated and will contain all songs :)
{ name: 'All Songs', date: '', songs: [] },
// #############################################################
{
name: 'My first Concert', date: '01.01.1970', songs: [
this.songs.hurt
]
}
]
let sortedSongs = []
for (const song in this.songs) {
if (this.songs.hasOwnProperty(song)) {
const element = this.songs[song];
if (element.name != 'Pause') {
sortedSongs.push(element)
}
}
}
this.songbooks = mySongbooks
sortedSongs = sortedSongs.sort((a, b) => {
if (a.name.toLowerCase() < b.name.toLowerCase()) return -1
if (a.name.toLowerCase() > b.name.toLowerCase()) return 1
if (a.name.toLowerCase() == b.name.toLowerCase()) return 0
})
for (const song of sortedSongs) {
mySongbooks[0].songs.push(song)
}
// fire data-created event
this.$eventHub.emit('data-created', { bandName: this.bandName, bandLogo: this.bandLogo, songbooks: this.songbooks, songs: this.songs });
Expand All @@ -20,23 +50,8 @@
this.$eventHub.on('songbook-changed', ($Data) => {
this.currentSongbook = $Data
this.$eventHub.emit('current-songbook-changed', this.currentSongbook)
this.currentSetlist = []
for (let songID of this.currentSongbook.songIDs) {
for (let song of this.songs) {
if (songID == song.id) {
this.currentSetlist.push(song)
}
}
}
this.$eventHub.emit('current-setlist-changed', this.currentSetlist)
if (this.currentSetlist.length >> 0) {
this.currentSong = this.currentSetlist[0]
this.$eventHub.emit('current-song-changed', this.currentSetlist[0])
} else {
this.$eventHub.emit('current-song-changed', { id: 0, name: 'Choose Song' })
}
this.currentSong = this.currentSongbook.songs[0]
this.$eventHub.emit('current-song-changed', this.currentSongbook.songs[0])
})
this.$eventHub.on('song-changed', ($Data) => {
Expand All @@ -45,82 +60,72 @@
})
this.$eventHub.on('next-song', ($Data) => {
if (this.getCurrentSongIdofCurrentSetlist() < this.currentSetlist.length - 1) {
this.$eventHub.emit('current-song-changed', this.currentSetlist[this.getCurrentSongIdofCurrentSetlist() + 1])
this.currentSong = this.currentSetlist[this.getCurrentSongIdofCurrentSetlist() + 1]
if (this.getCurrentSongIdofCurrentSetlist() < this.currentSongbook.songs.length - 1) {
this.$eventHub.emit('current-song-changed', this.currentSongbook.songs[this.getCurrentSongIdofCurrentSetlist() + 1])
this.currentSong = this.currentSongbook.songs[this.getCurrentSongIdofCurrentSetlist() + 1]
}
})
this.$eventHub.on('previous-song', ($Data) => {
if (this.getCurrentSongIdofCurrentSetlist() >= 1) {
this.$eventHub.emit('current-song-changed', this.currentSetlist[this.getCurrentSongIdofCurrentSetlist() + -1])
this.currentSong = this.currentSetlist[this.getCurrentSongIdofCurrentSetlist() - 1]
this.$eventHub.emit('current-song-changed', this.currentSongbook.songs[this.getCurrentSongIdofCurrentSetlist() + -1])
this.currentSong = this.currentSongbook.songs[this.getCurrentSongIdofCurrentSetlist() - 1]
}
})
},
beforeMount() {
// console.log("Data > beforeMount()")
},
beforeUpdate() {
// console.log("Data > beforeUpdate()")
},
updated() {
// console.log("Data > updated()")
},
beforeDestroy() {
// console.log("Data > beforeDestroy()")
},
destroyed() {
// console.log("Data > destroyed()")
},
methods: {
getCurrentSongIdofCurrentSetlist() {
return this.currentSetlist.indexOf(this.currentSong)
if (this.currentSongbook.songs.indexOf(this.currentSong) == -1) {
return this.currentSongbook.songs.indexOf(this.currentSong) + 1
} else {
return this.currentSongbook.songs.indexOf(this.currentSong)
}
}
},
data() {
return {
bandName: 'My Band',
currentSongbook: { id: 0, name: 'Choose Songbook', songIDs: [] },
bandName: 'Your Bandname',
currentSongbook: { name: 'Choose Songbook', date: '', songs: [] },
currentSong: { id: 0, name: 'Choose Song', artist: '', file: '', infos: [] },
currentSetlist: [],
// put your song files here
songs: [
songs:
{
id: 1, name: 'Hurt', artist: 'Johnny Cash',
files: [
{ capo: 0, file: Hurt }
], infos: [
// you can put song specific infos here
// some examples:
{ info: 'Main Vocals', value: 'Max' },
{ info: 'Backing Vocals', value: 'Tina, Laura' },
{ info: '...', value: '...' },
{ info: '..', value: '..' }
], stageDirections: {
// the stage directions allow you to set song specific instructions for mixing and stuff
// currently they will be rendered as: Part | Presence
// some examples:
parts: [
{
name: 'Intro / Solo', values: [
'E-Git'
]
},
{
name: 'Verse', values: [
'Main Vocals / Reverb'
]
}
]
}
hurt: {
name: 'Hurt', artist: 'Johnny Cash',
files: [
{ capo: 0, file: Hurt }
], infos: [
// you can add as many info boxes as you want per song
// structure: { info: info, value: value }
{ info: 'Main Vocals', value: 'A' },
{ info: 'Backing Vocals', value: 'B, C' },
{ info: 'Keys', value: 'E-Piano' },
{ info: 'Rh. Git', value: 'E-Git' }
], stageDirections: {
// you can put as many parts as you want per song
parts: [
{
name: 'Intro / Solo', values: [
'A-Git / Jonas', 'E-Git / A'
]
},
{
name: 'Verse', values: [
'Reverb'
]
},
{
name: 'Outro', values: [
'A-Git / Jonas', 'E-Git / A'
]
}
]
}
},
pause: { name: 'Pause', artist: '', files: [{ capo: 0, file: '<h3>Pause</h3>' }], infos: [], stageDirections: [] }
}
],
// put your songbooks here
songbooks: [
{ id: 1, name: 'Concert 1', date: '01.01.2018', songIDs: [1] },
{ id: 2, name: 'Concert 2', date: '02.01.2018', songIDs: [1] },
]
}
}
}
Expand Down
Loading

0 comments on commit be40bdc

Please sign in to comment.