| 1 | #! perl | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 92 | ▶ | use v5.26; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 92 | ▶ | use Object::Pad; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 92 | ▶ | use utf8; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 92 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | class ChordPro::Chords::Appearance :strict(params); | ||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 92 | =begin md | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | key The bare chord name, e.g., "Am7". | ||||||||||||||||||||||||||||
| 13 | Also index in chordinfo. | ||||||||||||||||||||||||||||
| 14 | Transposed/transcoded if applicable. | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | info The chord info (chord props, diagram props, etc.) | ||||||||||||||||||||||||||||
| 17 | This should be chordsinfo->{key} | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | orig The chord as it appeared in the song, e.g. "(<b>Am7</b>)" | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | format The format for the chord, e.g. "%{root}%{qual}<sup>%{ext}</sup>", | ||||||||||||||||||||||||||||
| 22 | but more likely something like "(<b>%{formatted}</b>)". | ||||||||||||||||||||||||||||
| 23 | %{formatted} will be replaced by the result of applying the | ||||||||||||||||||||||||||||
| 24 | global config.chord-format. | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | raw ???? | ||||||||||||||||||||||||||||
| 27 | Key with parens if (%{formatted}). | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | =cut | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | field $key :mutator :param = undef; | ||||||||||||||||||||||||||||
| 32 | 1544 | ▶ | field $format :mutator :param = undef; | ||||||||||||||||||||||||||
|
Subroutine
key: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 33 | 58 | ▶ | field $info :mutator :param = undef; | ||||||||||||||||||||||||||
|
Subroutine
format: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 34 | 1915 | ▶ | field $orig :mutator :param = undef; | ||||||||||||||||||||||||||
|
Subroutine
info: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | # For convenience. | ||||||||||||||||||||||||||||
| 37 | 0 | ▶ | method chord_display { | ||||||||||||||||||||||||||
|
Subroutine
chord_display: called CC=3 SCAR=17.3
Subroutine
orig: not called CC=1 SCAR=2.6
Pod
undocumented
Pod
undocumented
| |||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 667 | ▶ | unless ( $info | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$info and UNIVERSAL::isa($info, "ChordPro::Chord::Base")
MC/DC0%0/2
$info and UNIVERSAL::isa($info, "ChordPro::Chord::Base")
$info
UNIVERSAL::isa($info, "ChordPro::Chord::Base")
Truth table33%1/3
A and B
A= $infoB= UNIVERSAL::isa($info, "ChordPro::Chord::Base")
| |||||||||||||||||||||||||||||
| 40 | && UNIVERSAL::isa( $info, 'ChordPro::Chord::Base' ) ) { | ||||||||||||||||||||||||||||
| 41 | 0 | $Carp::Internal{ (__PACKAGE__) }++; | |||||||||||||||||||||||||||
| 42 | local $Carp::RefArgFormatter = | ||||||||||||||||||||||||||||
| 43 | 0 | ▶ | sub { my $t = $_[0]; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 44 | 0 | $t =~ s/^(ChordPro::.*)=HASH.*/<<$1>>/; | |||||||||||||||||||||||||||
| 45 | 0 | $t }; | |||||||||||||||||||||||||||
| 46 | 0 | my $m = Carp::longmess(); | |||||||||||||||||||||||||||
| 47 | 0 | die("Missing info for $key$m"); | |||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 667 | local $info->{chordformat} = $format; | |||||||||||||||||||||||||||
| 51 | 667 | $info->chord_display; | |||||||||||||||||||||||||||
| 52 | 92 | } | |||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | 16 | ▶ | method raw { | ||||||||||||||||||||||||||
|
Subroutine
raw: called CC=3 SCAR=19.2
Pod
undocumented
| |||||||||||||||||||||||||||||
| 55 | 16 | ▶ | return $key unless defined $format; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 56 | 0 | ▶ | if ( $format eq '(%{formatted})' ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 57 | 0 | return '(' . $key . ')'; | |||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||
| 59 | 0 | $key; | |||||||||||||||||||||||||||
| 60 | 92 | } | |||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 0 | ▶ | method CARP_TRACE { | ||||||||||||||||||||||||||
|
Subroutine
CARP_TRACE: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 63 | 0 | "<<Appearance(\"$key\")>>"; | |||||||||||||||||||||||||||
| 64 | 92 | } | |||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | 0 | ▶ | method _data_printer($ddp) { | ||||||||||||||||||||||||||
|
Subroutine
_data_printer: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 67 | 0 | "$key (" . __CLASS__ . ")"; | |||||||||||||||||||||||||||
| 68 | 92 | } | |||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | 92 | 1; | |||||||||||||||||||||||||||