App-Music-ChordPro

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

      It can create songbooks from folders of songs.

    !Other improvements

    - Centered chords (top, bottom, below) are now evenly spread over multiple lines.

    - (Wx) Remove ChordPro preset.
    - (macos) Use _NSGetExecutablePath() to get the correct script location.
    - Sync config files between git and MANIFEST.
    - (Paths) Allow absolute filenames in findres.
    - (Makefile) Add Ref::Util dependency.
    - Progress reporting. Options `progress_callback` and -I. Also
      enabled with --verbose.
    - New meta: page.class (first, title, default) and page.side (left, right).
    - Distinct page classes for even pages; filler class for alignment pages.
    - Add "omit" property for delegated images.
    - Allow 'mi' as short for 'min' chord quality.
    - Make properties parsing in directives more robust.
    - (ChordPro) Include ABC if generating for MSPro.
    - Allow %{} substitutions in grid sections.
    - Add labelfont, labelsize and labelcolour directives.

META.json  view on Meta::CPAN

            "Image::Info" : "1.41",
            "JSON::PP" : "2.27203",
            "JSON::XS" : "4.03",
            "JavaScript::QuickJS" : "0.18",
            "LWP::Protocol::https" : "6.14",
            "List::Util" : "1.46",
            "Mozilla::CA" : "20230801",
            "Object::Pad" : "0.818",
            "PDF::API2" : "2.045",
            "Pod::Usage" : "2.03",
            "Ref::Util" : "0.204",
            "Scalar::Util" : "1.63",
            "Storable" : "3.08",
            "String::Interpolate::Named" : "1.06",
            "Text::Layout" : "0.045",
            "Unicode::Collate" : "1.31",
            "Unicode::Normalize" : "1.26"
         }
      },
      "configure" : {
         "requires" : {

META.json  view on Meta::CPAN

            "Image::Info" : "1.41",
            "JSON::PP" : "2.27203",
            "JSON::XS" : "4.03",
            "JavaScript::QuickJS" : "0.18",
            "LWP::Protocol::https" : "6.14",
            "List::Util" : "1.46",
            "Mozilla::CA" : "20230801",
            "Object::Pad" : "0.818",
            "PDF::API2" : "2.045",
            "Pod::Usage" : "2.03",
            "Ref::Util" : "0.204",
            "Scalar::Util" : "1.63",
            "Storable" : "3.08",
            "String::Interpolate::Named" : "1.06",
            "Text::Layout" : "0.045",
            "Unicode::Collate" : "1.31",
            "Unicode::Normalize" : "1.26",
            "perl" : "5.026"
         }
      },
      "test" : {

META.json  view on Meta::CPAN

            "Image::Info" : "1.41",
            "JSON::PP" : "2.27203",
            "JSON::XS" : "4.03",
            "JavaScript::QuickJS" : "0.18",
            "LWP::Protocol::https" : "6.14",
            "List::Util" : "1.46",
            "Mozilla::CA" : "20230801",
            "Object::Pad" : "0.818",
            "PDF::API2" : "2.045",
            "Pod::Usage" : "2.03",
            "Ref::Util" : "0.204",
            "Scalar::Util" : "1.63",
            "Storable" : "3.08",
            "String::Interpolate::Named" : "1.06",
            "Text::Layout" : "0.045",
            "Unicode::Collate" : "1.31",
            "Unicode::Normalize" : "1.26"
         }
      }
   },
   "provides" : {

META.yml  view on Meta::CPAN

  Image::Info: '1.41'
  JSON::PP: '2.27203'
  JSON::XS: '4.03'
  JavaScript::QuickJS: '0.18'
  LWP::Protocol::https: '6.14'
  List::Util: '1.46'
  Mozilla::CA: '20230801'
  Object::Pad: '0.818'
  PDF::API2: '2.045'
  Pod::Usage: '2.03'
  Ref::Util: '0.204'
  Scalar::Util: '1.63'
  Storable: '3.08'
  String::Interpolate::Named: '1.06'
  Text::Layout: '0.045'
  Unicode::Collate: '1.31'
  Unicode::Normalize: '1.26'
configure_requires:
  ExtUtils::MakeMaker: '7.24'
dynamic_config: 1
generated_by: 'ExtUtils::MakeMaker version 7.76, CPAN::Meta::Converter version 2.150010'

META.yml  view on Meta::CPAN

  Image::Info: '1.41'
  JSON::PP: '2.27203'
  JSON::XS: '4.03'
  JavaScript::QuickJS: '0.18'
  LWP::Protocol::https: '6.14'
  List::Util: '1.46'
  Mozilla::CA: '20230801'
  Object::Pad: '0.818'
  PDF::API2: '2.045'
  Pod::Usage: '2.03'
  Ref::Util: '0.204'
  Scalar::Util: '1.63'
  Storable: '3.08'
  String::Interpolate::Named: '1.06'
  Text::Layout: '0.045'
  Unicode::Collate: '1.31'
  Unicode::Normalize: '1.26'
  perl: '5.026'
resources:
  bugtracker: https://github.com/ChordPro/chordpro/issues
  homepage: https://chordpro.org

Makefile.PL  view on Meta::CPAN

    'IPC::Run3'			   => 0.049,
    'Image::Info'		   => 1.41,
    'JSON::PP'			   => 2.27203,
    'JSON::XS'			   => 4.03,
    'JavaScript::QuickJS'	   => 0.18,
    'LWP::Protocol::https'	   => 6.14, # File::LoadLines
    'List::Util'		   => 1.46,
    'Mozilla::CA'		   => 20230801, # File::LoadLines
    'Object::Pad'		   => 0.818,
    'Pod::Usage'		   => 2.03, # Core
    'Ref::Util'			   => 0.204,
    'Scalar::Util'		   => 1.63,
    'Storable'			   => 3.08,
    'Unicode::Collate'		   => 1.31,
    'Unicode::Normalize'	   => 1.26,
  };

# PDF API.
$mv->{'PDF::API2'} = 2.045; # pref: 2.047
if ( my $a = $ENV{CHORDPRO_PDF_API} ) {
    if ( $a =~ /PDF::Builder/ ) {

lib/ChordPro/Config.pm  view on Meta::CPAN


use ChordPro;
use ChordPro::Files;
use ChordPro::Paths;
use ChordPro::Utils;
use ChordPro::Utils qw( enumerated );
use Scalar::Util qw(reftype);
use List::Util qw(any);
use Storable 'dclone';
use Hash::Util;
use Ref::Util qw( is_arrayref is_hashref );

#sub hmerge($$;$);
#sub clone($);
#sub default_config();

sub new ( $pkg, $cf = {} ) {
    bless $cf => $pkg;
}

sub pristine_config {

lib/ChordPro/Delegate/Program.pm  view on Meta::CPAN

Notes:

  * No attribute options in the input.

=cut

use ChordPro::Files;
use ChordPro::Utils qw(dimension maybe make_preprocessor);
use ChordPro::Output::Common qw(fmt_subst);
use IPC::Run3 qw(run3);
use Ref::Util qw( is_arrayref );
use Image::Info qw(image_info);

sub DEBUG() { $::config->{debug}->{x1} }

sub cmd2image( $song, %args ) {
    my $elt = $args{elt};
    my $ctl = { %{ $::config->{delegates}->{$elt->{context}} } };
    _cmd2image( $song, $ctl, %args );
}

lib/ChordPro/Files.pm  view on Meta::CPAN


# Where do filenames come from?
#
# 1. Command line arguments. Decode ASAP.
# 2. File (and directory) dialogs: Always perl string.
# 3. Preferences, configs, recents: should all be perl strings.
# 4. From filelists. We expect these lists to have UTF8 filenames that
#    get decoded when the list is read.

use Encode qw( decode_utf8 encode_utf8 );
use Ref::Util qw(is_ref);

use Exporter 'import';
our @EXPORT;
our @EXPORT_OK;

################ Platforms ################

use constant MSWIN => $^O =~ /MSWin|Windows_NT/i ? 1 : 0;

sub is_msw ()   { MSWIN }

lib/ChordPro/Output/ChordPro.pm  view on Meta::CPAN

package ChordPro::Output::ChordPro;

use v5.26;
use utf8;
use Carp;
use feature qw( signatures );
no warnings "experimental::signatures";

use ChordPro::Output::Common;
use ChordPro::Utils qw( fq qquote demarkup is_true is_ttrue );
use Ref::Util qw( is_arrayref );

my $re_meta;

sub generate_songbook ( $self, $sb ) {

    # Skip empty songbooks.
    return [] unless eval { $sb->{songs}->[0]->{body} };

    # Build regex for the known metadata items.
    $re_meta = join( '|',

lib/ChordPro/Output/Common.pm  view on Meta::CPAN


package ChordPro::Output::Common;

use strict;
use warnings;
use ChordPro::Chords;
use ChordPro::Utils qw( demarkup is_true );
use String::Interpolate::Named;
use utf8;
use POSIX qw(setlocale LC_TIME strftime);
use Ref::Util qw( is_arrayref );

use Exporter 'import';
our @EXPORT;
our @EXPORT_OK;

sub fmt_subst {
    my ( $s, $t ) = @_;
    my $res = "";
    my $m = { %{$s->{meta} || {} } };

lib/ChordPro/Output/Meta.pm  view on Meta::CPAN


use v5.26;
use Object::Pad;

# Output backend to extract meta data.

class ChordPro::Output::Meta;

use JSON::PP;
use ChordPro::Utils qw( qquote max );
use Ref::Util qw(is_arrayref);

my $sep = "; ";

method generate_songbook :common ($sb) {
    my @res = ( "[" );

    for my $song ( @{ $sb->{songs} } ) {
	my $m = $song->{meta};
	my @r;
	my $ll = 0;

lib/ChordPro/Output/PDF.pm  view on Meta::CPAN


our $ps;
our $pr;
our $dw;

package ChordPro::Output::PDF;

use strict;
use warnings;
use File::Temp ();
use Ref::Util qw(is_hashref is_arrayref is_coderef);
use Carp;
use ChordPro::Output::Common qw( prep_outlines fmt_subst );
use feature 'signatures';

use ChordPro::Output::PDF::Song;
use ChordPro::Output::PDF::Writer;
use ChordPro::Files;
use ChordPro::Paths;
use ChordPro::Utils;

lib/ChordPro/Output/PDF/Song.pm  view on Meta::CPAN


package main;

use utf8;
our $config;
our $options;

package ChordPro::Output::PDF::Song;

use Storable qw(dclone);
use Ref::Util qw(is_hashref is_arrayref is_coderef);
use Carp;
use feature 'state';
use ChordPro::Output::Common qw( roman fmt_subst );
use feature 'signatures';
no warnings qw( experimental::signatures );

use ChordPro::Files;
use ChordPro::Paths;
use ChordPro::Utils;

lib/ChordPro/Output/PDF/Writer.pm  view on Meta::CPAN

use warnings;
use Text::Layout;
use IO::String;
use Carp;
use utf8;

use ChordPro::Files;
use ChordPro::Paths;
use ChordPro::Utils qw( expand_tilde demarkup min is_corefont maybe is_true is_odd );
use ChordPro::Output::Common qw( fmt_subst prep_outlines );
use Ref::Util qw( is_arrayref is_hashref );
use feature 'state';
use Unicode::Collate;
use Unicode::Normalize;

# For regression testing, run perl with PERL_HASH_SEED set to zero.
# This eliminates the arbitrary order of font definitions and triggers
# us to pinpoint some other data that would otherwise be varying.
my $regtest = defined($ENV{PERL_HASH_SEED}) && $ENV{PERL_HASH_SEED} == 0;
my $faketime = 1465041600;

lib/ChordPro/Song.pm  view on Meta::CPAN

use ChordPro::Chords::Parser;
use ChordPro::Output::Common;
use ChordPro::Utils;
use ChordPro::Symbols qw( is_strum );

use Carp;
use List::Util qw(any);
use Storable qw(dclone);
use feature 'state';
use Text::ParseWords qw(quotewords);
use Ref::Util qw( is_arrayref );

# Parser context.
my $def_context = "";
my $in_context = $def_context;
my $skip_context = 0;
my $grid_arg;			# also used for grilles?
my $grid_cells;			# also used for grilles?
my $grid_type = 0;		# 0 = chords, 1,2 = strums
my @grille;

lib/ChordPro/Songbook.pm  view on Meta::CPAN


use ChordPro;
use ChordPro::Config;
use ChordPro::Files;
use ChordPro::Song;
use ChordPro::Utils qw(progress);

use Carp;
use List::Util qw(any);
use Storable qw(dclone);
use Ref::Util qw(is_arrayref is_plain_hashref);
use MIME::Base64;

my $regtest = defined($ENV{PERL_HASH_SEED}) && $ENV{PERL_HASH_SEED} == 0;

sub new {
    my ($pkg) = @_;
    bless { songs => [ ] }, $pkg;
}

sub parse_file {

lib/ChordPro/Symbols.pm  view on Meta::CPAN

package ChordPro::Symbols;

use Exporter qw(import);

our @EXPORT;
our @EXPORT_OK;

my $symbols;

use List::Util qw( any );
use Ref::Util qw( is_arrayref );

sub import {
    $symbols || _build();
    goto &Exporter::import;
}

sub _build {

    my @a = split( /\s+/, <<EOD );
u	\x{2190}	arrow-up

lib/ChordPro/Utils.pm  view on Meta::CPAN

#! perl

package ChordPro::Utils;

use v5.26;
use utf8;
use Carp;
use feature qw( signatures );
no warnings "experimental::signatures";
use Ref::Util qw( is_arrayref is_hashref );

use Exporter 'import';
our @EXPORT;
our @EXPORT_OK;

use ChordPro::Files;

################ Filenames ################

use File::Glob ( ":bsd_glob" );

lib/ChordPro/Utils.pm  view on Meta::CPAN

);

sub is_corefont {
    $corefonts{lc $_[0]};
}

push( @EXPORT, "is_corefont" );

# Progress reporting.

use Ref::Util qw(is_coderef);

# Progress can return a false result to allow caller to stop.

sub progress(%args) {
    state $callback;
    state $phase = "";
    state $index = 0;
    state $total = '';
    unless ( %args ) {		# reset
	undef $callback;

lib/ChordPro/Wx/Config.pm  view on Meta::CPAN

#! perl

use v5.26;
use Object::Pad;

class ChordPro::Wx::Config;

our %state;
our %preferences;

use Ref::Util qw( is_hashref is_arrayref );
use List::Util qw(uniq);

use Exporter 'import';
our @EXPORT = qw( %state %preferences );

my $cb;

use Wx qw(:everything);
use Wx::Locale gettext => '_T';
use ChordPro::Files;



( run in 0.550 second using v1.01-cache-2.11-cpan-2b1a40005be )