view release on metacpan or search on metacpan
lib/ChordPro/Chords/Parser.pm view on Meta::CPAN
103510361037103810391040104110421043104410451046104710481049105010511052105310541055
$info
->{name} =
$info
->{name_canon} =
$info
->canonical;
$info
->{
system
} =
$p
->{
system
};
bless
$info
=>
$p
->{target};
# ::dump($info);
#warn("_<_XCODE = $xcode, CHORD = ", $info->canonical);
return
$info
;
}
sub
chord_display (
$self
) {
$self
->SUPER::chord_display
( $::config->{
"chord-formats"
}->{common}
// $::config->{settings}->{
"chord-format"
}
//
"%{name}"
);
}
################ Chord objects: Nashville ################
package
ChordPro::Chord::Nashville;
our
@ISA
=
'ChordPro::Chord::Base'
;
lib/ChordPro/Chords/Parser.pm view on Meta::CPAN
10631064106510661067106810691070107110721073107410751076107710781079108010811082sub
canonical (
$self
) {
my
$res
=
$self
->{root_canon} .
$self
->{qual} .
$self
->{ext};
if
(
$self
->{bass} &&
$self
->{bass} ne
""
) {
$res
.=
"/"
.
lc
(
$self
->{bass});
}
return
$res
;
}
sub
chord_display (
$self
) {
$self
->SUPER::chord_display
( $::config->{
"chord-formats"
}->{nashville}
//
"%{name}"
);
}
################ Chord objects: Roman ################
package
ChordPro::Chord::Roman;
our
@ISA
=
'ChordPro::Chord::Base'
;
lib/ChordPro/Chords/Parser.pm view on Meta::CPAN
10901091109210931094109510961097109810991100110111021103110411051106110711081109sub
canonical (
$self
) {
my
$res
=
$self
->{root_canon} .
$self
->{qual} .
$self
->{ext};
if
(
$self
->{bass} &&
$self
->{bass} ne
""
) {
$res
.=
"/"
.
lc
(
$self
->{bass});
}
return
$res
;
}
sub
chord_display (
$self
) {
$self
->SUPER::chord_display
( $::config->{
"chord-formats"
}->{roman}
//
"%{name}"
);
}
################ Chord objects: Annotations ################
package
ChordPro::Chord::Annotation;
lib/ChordPro/Output/HTML.pm view on Meta::CPAN
348349350351352353354355356357358359360361362363364365366367368package
Text::Layout::Text;
# Eliminate warning when HTML backend is loaded together with Text backend.
no
warnings
'redefine'
;
sub
new {
my
(
$pkg
,
@data
) =
@_
;
my
$self
=
$pkg
->SUPER::new;
$self
->{_currentfont} = {
family
=>
'default'
,
style
=>
'normal'
,
weight
=>
'normal'
};
$self
->{_currentcolor} =
'black'
;
$self
->{_currentsize} = 12;
$self
;
}
sub
render {
my
(
$self
) =
@_
;
lib/ChordPro/Output/Markdown.pm view on Meta::CPAN
352353354355356357358359360361362363364365366367368369370371372# package Text::Layout::Text;
# use parent 'Text::Layout';
# # Eliminate warning when HTML backend is loaded together with Text backend.
# no warnings 'redefine';
# sub new {
# my ( $pkg, @data ) = @_;
# my $self = $pkg->SUPER::new;
# $self;
# }
# sub render {
# my ( $self ) = @_;
# my $res = "";
# foreach my $fragment ( @{ $self->{_content} } ) {
# next unless length($fragment->{text});
# $res .= $fragment->{text};
# }
lib/ChordPro/Output/PDF.pm view on Meta::CPAN
356135623563356435653566356735683569357035713572357335743575357635773578357935803581
$p
= ChordPro::Output::PDF::KeyboardDiagram->new(
ps
=>
$ps
);
}
else
{
$p
= ChordPro::Output::PDF::StringDiagram->new(
ps
=>
$ps
);
}
$xo
=
$p
->diagram_xo(
$info
);
}
}
$xo
//
$self
->SUPER::getimage(
$fragment
) // alert(
$fragment
->{size} );
};
}
sub
alert (
$size
) {
my
$scale
=
$size
/20;
my
$xo
=
$ps
->{pr}->{pdf}->xo_form;
$xo
->bbox( 0, -18
*$scale
, 20
*$scale
, 0 );
$xo
->matrix(
$scale
, 0, 0, -
$scale
, 0, 0 );
$xo
->line_width(2)->line_join(1);
$xo
->stroke_color(
"red"
);
lib/ChordPro/Output/Text.pm view on Meta::CPAN
281282283284285286287288289290291292293294295296297298299300301package
Text::Layout::Text;
# Eliminate warning when HTML backend is loaded together with Text backend.
no
warnings
'redefine'
;
sub
new {
my
(
$pkg
,
@data
) =
@_
;
my
$self
=
$pkg
->SUPER::new;
$self
;
}
sub
render {
my
(
$self
) =
@_
;
my
$res
=
""
;
foreach
my
$fragment
( @{
$self
->{_content} } ) {
next
unless
length
(
$fragment
->{text});
$res
.= fq(
$fragment
->{text});
}
lib/ChordPro/Wx/Editor.pm view on Meta::CPAN
243244245246247248249250251252253254255256257258259260261262use
ChordPro::Wx::Config;
use
ChordPro::Wx::Utils;
sub
new(
$class
,
$parent
,
$id
=
undef
) {
my
$self
=
$class
->SUPER::new(
$parent
, wxID_ANY,
""
,
wxDefaultPosition, wxDefaultSize,
wxHSCROLL|wxTE_MULTILINE );
return
$self
;
}
sub
refresh(
$self
,
$prefs
=
undef
) {
my
$ctrl
=
$self
;
$prefs
//= \
%preferences
;
lib/ChordPro/Wx/Editor.pm view on Meta::CPAN
299300301302303304305306307308309310311312313314sub
SetColour(
$self
,
$colour
) {
$self
->SetStyle( 0,
$self
->GetLastPosition,
Wx::TextAttr->new( Wx::Colour->new(
$colour
) ) );
}
sub
EmptyUndoBuffer(
$self
) {
}
sub
OSXDisableAllSmartSubstitutions(
$self
) {
return
unless
is_macos;
$self
->SUPER::OSXDisableAllSmartSubstitutions;
}
################
1;
lib/ChordPro/Wx/EditorPanel_wxg.pm view on Meta::CPAN
252627282930313233343536373839404142434445$id
= -1
unless
defined
$id
;
$pos
= wxDefaultPosition
unless
defined
$pos
;
$size
= wxDefaultSize
unless
defined
$size
;
$name
=
""
unless
defined
$name
;
# begin wxGlade: ChordPro::Wx::EditorPanel_wxg::new
use
ChordPro::Wx::Utils;
$style
= wxTAB_TRAVERSAL
unless
defined
$style
;
$self
=
$self
->SUPER::new(
$parent
,
$id
,
$pos
,
$size
,
$style
,
$name
);
$self
->{sz_outer} = Wx::BoxSizer->new(wxVERTICAL);
$self
->{sz_toolbar} = Wx::BoxSizer->new(wxHORIZONTAL);
$self
->{sz_outer}->Add(
$self
->{sz_toolbar}, 0, wxBOTTOM|wxEXPAND, 3);
$self
->{l_status} = Wx::StaticText->new(
$self
, wxID_ANY, _T(
"ChordPro"
));
$self
->{l_status}->SetForegroundColour(Wx::Colour->new(0, 104, 217));
$self
->{l_status}->SetFont(Wx::Font->new(20, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, 0,
""
));
$self
->{sz_toolbar}->Add(
$self
->{l_status}, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5);
lib/ChordPro/Wx/FileDirPickerCtrl.pm view on Meta::CPAN
202122232425262728293031323334353637383940field
$picker
;
field
$picker_event
;
my
@args
;
sub
BUILDARGS {
my
$class
=
shift
;
my
(
$parent
,
$id
,
$path
,
$message
,
$wildcard
,
$new
) =
@args
=
@_
;
# Args for SUPER::new.
(
$parent
,
$id
, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
}
BUILD {
my
(
$parent
,
$id
,
$path
,
$message
,
$wildcard
,
$new
) =
@args
;
if
(
$wildcard
eq
""
&& !
$new
) {
$picker
= Wx::DirDialog->new(
$self
,
$message
,
$path
,
wxDD_DIR_MUST_EXIST
lib/ChordPro/Wx/Main_wxg.pm view on Meta::CPAN
262728293031323334353637383940414243444546$title
=
""
unless
defined
$title
;
$pos
= wxDefaultPosition
unless
defined
$pos
;
$size
= wxDefaultSize
unless
defined
$size
;
$name
=
""
unless
defined
$name
;
# begin wxGlade: ChordPro::Wx::Main_wxg::new
use
ChordPro::Wx::Utils;
$style
= wxDEFAULT_FRAME_STYLE
unless
defined
$style
;
$self
=
$self
->SUPER::new(
$parent
,
$id
,
$title
,
$pos
,
$size
,
$style
,
$name
);
$self
->SetTitle(_T(
"ChordPro"
));
$self
->{sz_outer} = Wx::BoxSizer->new(wxVERTICAL);
$self
->{sz_main} = Wx::BoxSizer->new(wxVERTICAL);
$self
->{sz_outer}->Add(
$self
->{sz_main}, 1, wxALL|wxEXPAND, 5);
$self
->{p_initial} = Wx::Panel->new(
$self
, wxID_ANY);
$self
->{sz_main}->Add(
$self
->{p_initial}, 1, wxEXPAND, 0);
lib/ChordPro/Wx/NewSongDialog.pm view on Meta::CPAN
101112131415161718192021222324252627282930use
ChordPro::Wx::Config;
use
ChordPro::Wx::Utils;
no
warnings
'redefine'
;
# TODO
method new :common (
$parent
,
$id
,
$title
) {
my
$self
=
$class
->SUPER::new(
$parent
,
$id
,
$title
);
$self
->refresh;
$self
;
}
method refresh() {
for
(
qw(title subtitle artist key)
) {
$self
->{
"t_$_"
}->Clear;
}
my
$sel
= 8;
lib/ChordPro/Wx/NewSongDialog_wxg.pm view on Meta::CPAN
262728293031323334353637383940414243444546$id
= -1
unless
defined
$id
;
$title
=
""
unless
defined
$title
;
$pos
= wxDefaultPosition
unless
defined
$pos
;
$size
= wxDefaultSize
unless
defined
$size
;
$name
=
""
unless
defined
$name
;
# begin wxGlade: ChordPro::Wx::NewSongDialog_wxg::new
$style
= wxDEFAULT_DIALOG_STYLE
unless
defined
$style
;
$self
=
$self
->SUPER::new(
$parent
,
$id
,
$title
,
$pos
,
$size
,
$style
,
$name
);
$self
->SetTitle(
"Create New Song"
);
$self
->{sizer_1} = Wx::BoxSizer->new(wxVERTICAL);
my
$label_3
= Wx::StaticText->new(
$self
, wxID_ANY,
"New Song"
, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL);
$label_3
->SetMinSize(Wx::Size->new(-1, 35));
$label_3
->SetForegroundColour(Wx::Colour->new(0, 104, 217));
$label_3
->SetFont(Wx::Font->new(18, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, 0,
""
));
$self
->{sizer_1}->Add(
$label_3
, 0, wxALL|wxEXPAND, 5);
lib/ChordPro/Wx/RenderDialog.pm view on Meta::CPAN
202122232425262728293031323334353637383940
"german"
=>
"C, ... A, Ais/B, H"
,
"latin"
=>
"Do, Re, Mi, Fa, Sol, ..."
,
"scandinavian"
=>
"C, ... A, A#/Bb, H"
,
"solfege"
=>
"Do, Re, Mi, Fa, So, ..."
,
"solfège"
=>
"Do, Re, Mi, Fa, So, ..."
,
"nashville"
=>
"1, 2, 3, ..."
,
"roman"
=>
"I, II, III, ..."
,
};
sub
new {
my
$self
=
shift
->SUPER::new(
@_
);
if
( @{
$state
{tasks}} ) {
$self
->{l_customtasks}->Show(1);
my
$index
= 0;
for
my
$task
( @{
$state
{tasks}} ) {
my
$id
= Wx::NewId();
$self
->{sz_customtasks}->Add
(
$self
->{
"cb_customtask_$index"
} = Wx::CheckBox->new
(
$self
,
$id
,
$task
->[0] ),
0, 0, 0 );
lib/ChordPro/Wx/RenderDialog_wxg.pm view on Meta::CPAN
262728293031323334353637383940414243444546$title
=
""
unless
defined
$title
;
$pos
= wxDefaultPosition
unless
defined
$pos
;
$size
= wxDefaultSize
unless
defined
$size
;
$name
=
""
unless
defined
$name
;
# begin wxGlade: ChordPro::Wx::RenderDialog_wxg::new
use
ChordPro::Wx::Utils;
$style
= wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER
unless
defined
$style
;
$self
=
$self
->SUPER::new(
$parent
,
$id
,
$title
,
$pos
,
$size
,
$style
,
$name
);
$self
->SetTitle(_T(
"Preview Tasks"
));
$self
->{sz_prefs_outer} = Wx::BoxSizer->new(wxVERTICAL);
my
$label_3
= Wx::StaticText->new(
$self
, wxID_ANY, _T(
"Preview Tasks"
), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL);
$label_3
->SetForegroundColour(Wx::Colour->new(0, 104, 217));
$label_3
->SetFont(Wx::Font->new(18, wxDEFAULT, wxNORMAL, wxNORMAL, 0,
""
));
$self
->{sz_prefs_outer}->Add(
$label_3
, 0, wxALL|wxEXPAND, 5);
$self
->{sz_prefs_inner} = Wx::BoxSizer->new(wxVERTICAL);
lib/ChordPro/Wx/SettingsDialog_wxg.pm view on Meta::CPAN
252627282930313233343536373839404142434445$id
= -1
unless
defined
$id
;
$title
=
""
unless
defined
$title
;
$pos
= wxDefaultPosition
unless
defined
$pos
;
$size
= wxDefaultSize
unless
defined
$size
;
$name
=
""
unless
defined
$name
;
# begin wxGlade: ChordPro::Wx::SettingsDialog_wxg::new
$style
= wxDEFAULT_DIALOG_STYLE
unless
defined
$style
;
$self
=
$self
->SUPER::new(
$parent
,
$id
,
$title
,
$pos
,
$size
,
$style
,
$name
);
$self
->SetTitle(_T(
"Settings"
));
$self
->{sz_main} = Wx::BoxSizer->new(wxVERTICAL);
$self
->{sz_prefs_outer} = Wx::BoxSizer->new(wxVERTICAL);
$self
->{sz_main}->Add(
$self
->{sz_prefs_outer}, 1, wxEXPAND, 0);
$self
->{nb_preferences} = Wx::Notebook->new(
$self
, wxID_ANY);
$self
->{sz_prefs_outer}->Add(
$self
->{nb_preferences}, 1, wxEXPAND|wxLEFT|wxRIGHT, 5);
lib/ChordPro/Wx/SongbookExportPanel_wxg.pm view on Meta::CPAN
222324252627282930313233343536373839404142sub
new {
my
(
$self
,
$parent
,
$id
,
$pos
,
$size
,
$style
,
$name
) =
@_
;
$parent
=
undef
unless
defined
$parent
;
$id
= -1
unless
defined
$id
;
$pos
= wxDefaultPosition
unless
defined
$pos
;
$size
= wxDefaultSize
unless
defined
$size
;
$name
=
""
unless
defined
$name
;
# begin wxGlade: ChordPro::Wx::SongbookExportPanel_wxg::new
$self
=
$self
->SUPER::new(
$parent
,
$id
,
$pos
,
$size
,
$style
,
$name
);
$self
->{sizer_1} = Wx::BoxSizer->new(wxVERTICAL);
$self
->{sz_outer} = Wx::BoxSizer->new(wxVERTICAL);
$self
->{sizer_1}->Add(
$self
->{sz_outer}, 1, wxEXPAND, 0);
$self
->{sz_toolbar} = Wx::BoxSizer->new(wxHORIZONTAL);
$self
->{sz_outer}->Add(
$self
->{sz_toolbar}, 0, wxBOTTOM|wxEXPAND, 3);
$self
->{l_status} = Wx::StaticText->new(
$self
, wxID_ANY, _T(
"Create a Songbook"
));
script/wxchordpro.pl view on Meta::CPAN
123124125126127128129130131132133134135136137138139140141142143package
ChordPro::Wx::WxUpdateRequired;
# Dialog to be shown if Wx is not up to date.
use
strict;
sub
new {
my
$self
=
shift
->SUPER::new(
undef
, wxID_ANY,
"Update Required"
,
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
# Main sizer.
my
$sz
= Wx::BoxSizer->new(wxVERTICAL);
# sz3: Icon (left), info lines (right side).
my
$sz3
= Wx::BoxSizer->new(wxHORIZONTAL);
# sz4: Information lines, right side,
my
$sz4
= Wx::BoxSizer->new(wxVERTICAL);