diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-02 11:03:28 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-02 11:03:28 +1300 |
commit | 9d00d7babffec1ea3b5605fa05ca63697bbb0c2b (patch) | |
tree | b1926988dd50a5da7fa286fee6fa2efcabd7c4ac | |
parent | Merge branch 'feature/verbose' into develop (diff) | |
parent | Update tests to reflect new method names (diff) | |
download | Music-Lyrics-LRC-9d00d7babffec1ea3b5605fa05ca63697bbb0c2b.tar.gz Music-Lyrics-LRC-9d00d7babffec1ea3b5605fa05ca63697bbb0c2b.zip |
Merge branch 'release/v0.07' into develop
* release/v0.07:
Update tests to reflect new method names
Regenerate README.markdown for 0.07
Update Changes for 0.07
Bump version number to 0.07
-rw-r--r-- | Changes | 9 | ||||
-rw-r--r-- | Makefile.PL | 2 | ||||
-rw-r--r-- | README.markdown | 27 | ||||
-rw-r--r-- | lib/Music/Lyrics/LRC.pm | 4 | ||||
-rw-r--r-- | t/basic.t | 15 |
5 files changed, 38 insertions, 19 deletions
@@ -1,5 +1,14 @@ Revision history for Music-Lyrics-LRC +0.07 2017-11-02 + + - Parse any resolution of fractional seconds in input, including no fractional + seconds at all + - Remove msec_to_ts() and ts_to_msec() functions, replaced with internals not + documented + - Add a verbose flag to the constructor to control the emission of warnings + for unparsed lines from files + 0.06 2017-11-02 - Correct syntax of output file: the format uses a period for the fractional diff --git a/Makefile.PL b/Makefile.PL index 2707497..fa6b1f2 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -25,7 +25,7 @@ WriteMakefile( 'meta-spec' => { version => 2 }, provides => { 'Music::Lyrics::LRC' => { - version => '0.06', + version => '0.07', file => 'lib/Music/Lyrics/LRC.pm', }, }, diff --git a/README.markdown b/README.markdown index 91432c9..fcaecd7 100644 --- a/README.markdown +++ b/README.markdown @@ -4,7 +4,7 @@ Music::Lyrics::LRC - Manipulate LRC karaoke timed lyrics files # VERSION -Version 0.05 +Version 0.07 # DESCRIPTION @@ -35,9 +35,16 @@ For details on the LRC file format, please see Wikipedia: # SUBROUTINES/METHODS -## `new()` +## `new(%opts)` -Constructor; no arguments. +Constructor method. Accepts a hash with one attribute `verbose`. This +specifies whether the module will `warn` explicitly when it cannot parse an +input line from a file. It defaults to 0. + + my $lrc = MRC::Lyrics::LRC->new(); + ... + my $lrc_verbose = MRC::Lyrics::LRC->new(verbose => 1); + ... ## `lyrics()` @@ -89,16 +96,6 @@ Load lyrics from the given readable filehandle. Save lyrics to the given writeable filehandle. -## `ts_to_msec(\%ts)` - -Convert the internal LRC timestamp hash structure to milliseconds. You are -probably not interested in this. - -## `msec_to_ts($msec)` - -Convert milliseconds to the internal LRC timestamp hash structure. You are -probably not interested in this, either. - # DIAGNOSTICS - `Bad lyric time` @@ -169,6 +166,10 @@ may change in future revisions. The format accepted here is very liberal, and needs to be tested with lots of different LRC files from the wild. +Fractional seconds of any length can be parsed, and preserved in the +millisecond count return by `lyrics()`, but any resolution beyond 2 decimal +places is lost on `save()`. + The test suite is skeletal, and needs a lot of fleshing out. # AUTHOR diff --git a/lib/Music/Lyrics/LRC.pm b/lib/Music/Lyrics/LRC.pm index e995b87..f665437 100644 --- a/lib/Music/Lyrics/LRC.pm +++ b/lib/Music/Lyrics/LRC.pm @@ -13,7 +13,7 @@ use English '-no_match_vars'; use 5.006; # Declare package version -our $VERSION = '0.06'; +our $VERSION = '0.07'; # Patterns to match elements of the LRC file; these are somewhat tolerant our %RE = ( @@ -270,7 +270,7 @@ Music::Lyrics::LRC - Manipulate LRC karaoke timed lyrics files =head1 VERSION -Version 0.06 +Version 0.07 =head1 DESCRIPTION @@ -8,7 +8,7 @@ use Test::More tests => 9; use Music::Lyrics::LRC; -our $VERSION = '0.06'; +our $VERSION = '0.07'; my $lrc = Music::Lyrics::LRC->new(); ok( defined $lrc, 'constructed' ); @@ -17,8 +17,17 @@ my $pkg = 'Music::Lyrics::LRC'; isa_ok( $lrc, $pkg ); can_ok( - $lrc, - qw(lyrics tags add_lyric set_tag unset_tag load save ts_to_msec msec_to_ts), + $lrc, qw( + lyrics + tags + add_lyric + set_tag + unset_tag + load + save + _min_sec_to_msec + _msec_to_min_sec + ), ); ok( $lrc->add_lyric( 0, 'lalala' ), 'add_lyric_0' ); |