SMS::Ringtone::RTTTL::Parser - parse and validate RTTTL strings. |
SMS::Ringtone::RTTTL::Parser - parse and validate RTTTL strings.
use SMS::Ringtone::RTTTL::Parser;
my $rtttl = 'Flntstn:d=4,o=5,b=200:g#,c#,8p,c#6,8a#,g#,c#,' . '8p,g#,8f#,8f,8f,8f#,8g#,c#,d#,2f,2p,g#,c#,8p,' . 'c#6,8a#,g#,c#,8p,g#,8f#,8f,8f,8f#,8g#,c#,d#,2c#';
my $r = new SMS::Ringtone::RTTTL::Parser($rtttl);
# Check for errors if ($r->has_errors()) { print "The following RTTTL errors were found:\n"; foreach (@{$r->get_errors()}) { print "$_\n"; } exit; }
# Dump parse results to STDOUT $r->puke();
SMS::Ringtone::RTTTL::Parser is a RTTTL string parser and validator. See http://members.tripod.lycos.nl/jupp/linux/soft/rtttl_player/EBNF.txt for RTTTL syntax in BNF.
get_bpm()
get_part_defaults()
get_part_name()
get_part_notes()
get_errors()
has_errors
.
get_note_count()
get_notes()
duration is the effective note duration. note is the note letter and optional sharp symbol (examples: F# C B P G#). octave is the effective octave. dots is the number of dots.
get_rtttl()
get_warnings()
has_warnings
.
has_errors()
get_errors
.
has_warnings()
get_warnings
.
is_name_valid()
is_defaults_valid()
is_notes_valid()
puke()
These are subroutines that aren't methods and don't affect anything (i.e., don't have ``side effects'') -- they just take input and/or give output.
is_valid_bpm($bpm)
is_valid_duration($dur)
is_valid_octave($octave)
nearest_bpm($bpm)
nearest_duration($dur)
nearest_octave($octave)
get_rtttl()
now returns RTTTL with valid defaults part if original RTTTL
defaults part contains invalid values. Name part is also limited to length
of 20 characters.
Craig Manley c.manley@skybound.nl
Copyright (C) 2001 Craig Manley <c.manley@skybound.nl>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SMS::Ringtone::RTTTL::Parser - parse and validate RTTTL strings. |