Tony Tambasco > LW4-Reader-0.01 > LW4::Reader

Download:
LW4-Reader-0.01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

LW4::Reader - Perl extension for reading Lightwright 4 files.

SYNOPSIS ^

  use LW4::Reader qw( read_header read_item_info );

  # Open a file.

  my $lw4_file_name = 't/test.lw4';

  open my $lw4_file_fh, "$lw4_file_name"
      or die "Couldn't open $lw4_file_name:   $!\n";

  # Get file header info.

  my $lw4_header = read_header($lw4_file_fh)

  # Get file contents.

  my $lw4_items_AoH = read_item_info($lw4_file_fh);

DESCRIPTION ^

This module is designed to read basic information out of a file generated by John McKernon's "Lightwright 4" software. At the time of this writing, Lightwright is not available for POSIX compliant operating systems, and these functions are convenient to use for the purpose of converting the basic item info of a Lightwright file into a spreadsheet (or some other data format).

read_header($file_handle)

This subroutine reads the header information out of an open file handle and returns it as a hashref. Access as follows:

my $lw4_header = read_header($file_handle);

$lw4_header->{save_date}; # The date the file was last saved. $lw4_header->{save_time}; # The time the file was last saved. $lw4_header->{show_name}; # The name of the show. $lw4_header->{sub_head_1}; # File sub heading 1. $lw4_header->{sub_head_2}; # File sub heading 2. $lw4_header->{sub_head_3}; # File sub heading 3. $lw4_header->{sub_head_4}; # File sub heading 4. $lw4_header->{sub_head_5}; # File sub heading 5. $lw4_header->{sub_head_6}; # File sub heading 6. $lw4_header->{num_fixtures}; # Current number of fixtures in the file. $lw4_header->{max_num_fixtures}; # The maximum number of fixtures the file # has had. $lw4_header->{file_ident}; # The unique identifier for the file.

read_item_info($file_handle)

This subroutine reads the items out of an open file handle and returns a ref to an array of hashes. The items are read into a hashref, and then stored sequentially in an array, the ref to which is returned to caller. Access to item info is as follows:

my $lw4_info = read_item_info($file_handle)

$lw4_info->[0]->{channel}; # The channel the item is assigned to. $lw4_info->[0]->{dimmer}; # The dimmer the item is assigned to. $lw4_info->[0]->{unit}; # The unit number of the item. $lw4_info->[0]->{watts}; # The wattage of the item. $lw4_info->[0]->{circuit}; # The circuit number of the item. $lw4_info->[0]->{purpose}; # The purpose of the item. $lw4_info->[0]->{position}; # The hang position of the item. $lw4_info->[0]->{color}; # The gel color of the item. $lw4_info->[0]->{type}; # The fixture type of the item. $lw4_info->[0]->{pattern}; # The pattern the item carries. $lw4_info->[0]->{item_key}; # The unique key identifier of the item, # generated by Lightwright.

There are several pieces of information that Lightwright stores for each item that have not yet been identified. They are presently stored in the hash, and are accessable: if you know what one of these is, see the code for which unknown type you're looking for, and please drop the author an email so he can update the software accordingly.

EXPORT

None by default.

read_header and read_item_info by request.

build_category_phrases by request, if you have a good reason for it, but probably you don't.

SEE ALSO ^

Lightwright software and documentation is available through John McKernon Software at http://www.mckernon.com

AUTHOR ^

Tony Tambasco, <tambascot(at)yahoo{dot}com>

This library is not developed by or with, or endorsed by John McKernon Software, nor is the author affiliated with John McKernon Software in any way.

If you have questions about Lightwright software itself, or would like to purchase Lightwright, please contact John McKernon at <help2006(at)mckernon{dot}com> or visit his website: http://www.mckernon.com

COPYRIGHT AND LICENSE ^

Copyright 2009 by Tony Tambasco

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

This library is not developed by or with, or endorsed by John McKernon Software, nor is the author affiliated with John McKernon Software in any way.

"Lightwright" is copyright 1999 - 2003 by John McKernon Software, all rights reserved.

syntax highlighting: