LW4::Reader

Perl extension for reading Lightwright 4 files
Download

LW4::Reader Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Tony Tambasco
  • Publisher web site:

LW4::Reader Tags


LW4::Reader Description

Perl extension for reading Lightwright 4 files LW4::Reader is a Perl module 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->->{channel}; # The channel the item is assigned to. $lw4_info->->{dimmer}; # The dimmer the item is assigned to. $lw4_info->->{unit}; # The unit number of the item. $lw4_info->->{watts}; # The wattage of the item. $lw4_info->->{circuit}; # The circuit number of the item. $lw4_info->->{purpose}; # The purpose of the item. $lw4_info->->{position}; # The hang position of the item. $lw4_info->->{color}; # The gel color of the item. $lw4_info->->{type}; # The fixture type of the item. $lw4_info->->{pattern}; # The pattern the item carries. $lw4_info->->{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.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: $! "; # 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); Requirements: · Perl


LW4::Reader Related Software