-
Notifications
You must be signed in to change notification settings - Fork 254
Expand file tree
/
Copy pathTabBarRendererFactory.ts
More file actions
29 lines (25 loc) · 1.12 KB
/
TabBarRendererFactory.ts
File metadata and controls
29 lines (25 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import type { Bar } from '@coderline/alphatab/model/Bar';
import type { Staff } from '@coderline/alphatab/model/Staff';
import type { Track } from '@coderline/alphatab/model/Track';
import type { BarRendererBase } from '@coderline/alphatab/rendering/BarRendererBase';
import { BarRendererFactory, type EffectBandInfo } from '@coderline/alphatab/rendering/BarRendererFactory';
import type { ScoreRenderer } from '@coderline/alphatab/rendering/ScoreRenderer';
import { TabBarRenderer } from '@coderline/alphatab/rendering/TabBarRenderer';
/**
* This Factory produces TabBarRenderer instances
* @internal
*/
export class TabBarRendererFactory extends BarRendererFactory {
public get staffId(): string {
return TabBarRenderer.StaffId;
}
public constructor(effectBands: EffectBandInfo[]) {
super(effectBands);
}
public override canCreate(track: Track, staff: Staff): boolean {
return staff.showTablature && staff.tuning.length > 0 && super.canCreate(track, staff);
}
public create(renderer: ScoreRenderer, bar: Bar): BarRendererBase {
return new TabBarRenderer(renderer, bar);
}
}