]> git.vpit.fr Git - perl/modules/Bit-MorseSignals.git/blobdiff - lib/Bit/MorseSignals/Emitter.pm
Importing Bit-MorseSignals-0.05.tar.gz
[perl/modules/Bit-MorseSignals.git] / lib / Bit / MorseSignals / Emitter.pm
index 34862f02b9aff6a38c12c9df43f69e63d43ddb01..441e6e4cc5dd5702f3f4aa4d34c3d5589244578a 100644 (file)
@@ -15,11 +15,11 @@ Bit::MorseSignals::Emitter - Base class for Bit::MorseSignals emitters.
 
 =head1 VERSION
 
-Version 0.03
+Version 0.05
 
 =cut
 
-our $VERSION = '0.03';
+our $VERSION = '0.05';
 
 =head1 SYNOPSIS
 
@@ -81,7 +81,7 @@ sub new {
  return $self;
 }
 
-=head2 C<< post $msg, [ type => $type ] >>
+=head2 C<< post $msg, < type => $type > >>
 
 Adds C<$msg> to the message queue and, if no other message is currently processed, dequeue the oldest item and prepare it. The type is automatically chosen, but you may want to try to force it with the C<type> option : C<$type> is then one of the C<BM_DATA_*> constants listed in L<Bit::MorseSignals/CONSTANTS>
 
@@ -176,6 +176,30 @@ sub pop {
  return $bit;
 }
 
+=head2 C<len>
+
+The length of the currently posted message.
+
+=cut
+
+sub len {
+ my ($self) = @_;
+ _check_self($self);
+ return $self->{len};
+}
+
+=head2 C<pos>
+
+The number of bits that have already been sent for the current message.
+
+=cut
+
+sub pos {
+ my ($self) = @_;
+ _check_self($self);
+ return $self->{pos};
+}
+
 =head2 C<reset>
 
 Cancels the current transfer, but does not empty the queue.