-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9586468
commit f1e535d
Showing
18 changed files
with
200 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Lists all golpe types. | ||
*/ | ||
export enum GolpeType { | ||
/** | ||
* No Golpe played. | ||
*/ | ||
None, | ||
|
||
/** | ||
* Play a golpe with the thumb. | ||
*/ | ||
Thumb, | ||
|
||
/** | ||
* Play a golpe with a finger. | ||
*/ | ||
Finger | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { NotationElement } from '@src/NotationSettings'; | ||
import { EffectBarGlyphSizing } from '../EffectBarGlyphSizing'; | ||
import { Settings } from '@src/Settings'; | ||
import { Beat } from '@src/model'; | ||
import { GolpeType } from '@src/model/GolpeType'; | ||
import { EffectBarRendererInfo } from '../EffectBarRendererInfo'; | ||
import { BarRendererBase } from '../BarRendererBase'; | ||
import { EffectGlyph } from '../glyphs/EffectGlyph'; | ||
import { GuitarGolpeGlyph } from '../glyphs/GuitarGolpeGlyph'; | ||
|
||
export class GolpeEffectInfo extends EffectBarRendererInfo { | ||
private _type: GolpeType; | ||
private _shouldCreate?: (settings: Settings, beat: Beat) => boolean; | ||
|
||
public constructor(type: GolpeType, shouldCreate?: (settings: Settings, beat: Beat) => boolean) { | ||
super(); | ||
this._type = type; | ||
this._shouldCreate = shouldCreate; | ||
} | ||
|
||
public get notationElement(): NotationElement { | ||
return NotationElement.EffectGolpe; | ||
} | ||
|
||
public get hideOnMultiTrack(): boolean { | ||
return false; | ||
} | ||
|
||
public get canShareBand(): boolean { | ||
return true; | ||
} | ||
|
||
public get sizingMode(): EffectBarGlyphSizing { | ||
return EffectBarGlyphSizing.SingleOnBeat; | ||
} | ||
|
||
public shouldCreateGlyph(settings: Settings, beat: Beat): boolean { | ||
const shouldCreate = this._shouldCreate; | ||
return beat.golpe == this._type && (!shouldCreate || shouldCreate(settings, beat)); | ||
} | ||
|
||
public createNewGlyph(renderer: BarRendererBase, beat: Beat): EffectGlyph { | ||
return new GuitarGolpeGlyph(0, 0, true); | ||
} | ||
|
||
public canExpand(from: Beat, to: Beat): boolean { | ||
return false; | ||
} | ||
} |
Oops, something went wrong.