The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Audio::ScratchLive::Track - Store Track information from a crate/DB file

SYNOPSIS

    use Audio::ScratchLive::Track;
    use Audio::ScratchLive::Constants;
    my $slt = WWW::ScratchLive::Track->new(
        empty => 1,
        type => Audio::ScratchLive::Constants::DB
    ) or die $!;

    -OR-

    my $slt = WWW::ScratchLive::Track->new(
        empty => 1,
        type => Audio::ScratchLive::Constants::CRATE
    ) or die $!;
    
    -OR-
    
    my $slt = WWW::ScratchLive::Track->new(
        buffer => $buffer_from_db_file,
        type => Audio::ScratchLive::Constants::DB
    ) or die $!;

    -OR-
    
    my $slt = WWW::ScratchLive::Track->new(
        buffer => $buffer_from_crate_file,
        type => Audio::ScratchLive::Constants::CRATE
    ) or die $!;

DESCRIPTION

This class provides a way to store track information from ScratchLIVE's binary crate and database files.

METHODS

new( HASH )

The new method returns an object of type Audio::Scratchlive::Track if everything was successful, and 0 otherwise. Upon failure, $! is set containing the error and a 0 is returned.

The following are the accepted input parameters:

empty

Defaults to 0. Provide a true value to create an empty shell of a track and return it. Otherwise, we'll create the empty shell and then fill in the info from the buffer.

buffer

This is the binary information for this particular track from the file. This is required unless you're creating an empty shell of a track.

type

This tells us what type of track object we're creating. DB tracks contain lots of information, CRATE tracks contain only a file path. See Audio::ScratchLive::Constants or the listing of fields.

get_keys()

The get_keys method returns a sorted reference to an array of the field keys for this track. You can then go through the keys and request the value for that given key.

get_value( $key )

The get_value method returns the value stored for the requested $key. If it can't find the $key you've requested, it generates a warning and returns an empty string ''.

SUPPORT

Please visit EFNet #perl for assistance with this module. "genio" is the author.

CAVEATS

Not enough test cases built into the install yet. More to be added.

No way yet to create tracks other than from the crate or DB file.

A few of the fields for the tracks in a DB file are still unknown as to what they do.

No way to output the track data back in binary form for the crate or DB file.

A lot of other problems probably.

Not enough documentation.

SEE ALSO

    Author's Web site that will eventually contain a cookbook
    L<http://www.cwhitener.org>
    
    Rane/Serato's ScratchLIVE web site and forums
    L<http://www.scratchlive.net>

    ScratchTools (Java app)
    L<http://www.scratchtools.de>

    

AUTHORS

Chase Whitener <cwhitener at gmail dot com>

COPYRIGHT

Copyright 2009, Chase Whitener. All rights reserved.

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