Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

Device::Audiotron
Perl module to interface with the Audiotron API.

Device::Audiotron - Perl module to interface with the Audiotron API.



SYNOPSIS

use Device::Audiotron; $at = new Device::Audiotron(``Audiotron IP address'',``username'',``password''); if(!$at){die ``Audiotron object failed to initialize.'';}

my ($ref_status, $ref_shares, $ref_hosts) = $at->GlobalInfo(); my $firmware_version = $ref_status->{``Version''};


DESCRIPTION

Device::Audiotron provides a tie-in into the API included in the latest firmware for Voyetra Turtle Beach's Audiotron.

I highly suggest reading through the API documentation located at http://www.turtlebeach.com/site/products/audiotron/api/dl_api.asp before attempting to implement this module.

The available methods for the Audiotron object and an example of usage for each are listed below. The native API call is listed in brackets below each method for informational purposes and for ease in referencing Voyetra's API documentation.




   GetInfo(Type,[Count],[Criteria])

   [Apigetinfo.asp]



        Returns a string containing the results from the command request.



        $type = "Global";

        $info = $at->GetInfo($type);



        OR



        $type = "artist";

        $count = 4;

        $criteria = "Staind";

        $info = $at->GetInfo($type,$count,$criteria);

   Qfile(Type,Criteria)

   [Apiqfile.asp]

        Returns a string containing the results from the command request.

        $type = "File";

        $file = q|\\\\LITHIUM\MP3\Bush\deconstructed\Comedown.mp3|;

        $cmd_result = $at->Qfile($type, $file);






   AddFile(Full_File_Name)

   [Apiaddfile.asp]

   

        Returns a string containing the results from the command request.




        $file = q|\\\\COBALT\MP3\new_song.mp3|;

        $cmd_result = $at->AddFile($file);






   Cmd(Command,[Arg])

   [Apicmd.asp]

   

        Returns a string containing the results from the command request.

        

        $cmd_name = "play";

        $cmd_result = $at->Cmd($cmd_name);

        

        OR

        

        $cmd_name = "goto";

        $cmd_arg = "18";

        $cmd_result = $at->Cmd($cmd_name, $cmd_arg);






   GetStatus()

   [Apigetstatus.asp]

   

        Returns a hash containing element names equivalent to the 'field' names returned by the Audiotron.




        %status = $at->GetStatus();

        print $status{'State'};






   GlobalInfo()

   [See GetInfo]

   

        Returns references to a hash, an array, and an array of hashes.

        

        This is simply a call to GetInfo with "Global" passed as the type but has been customized to pre-parse the results.

        

          ($ref_status, $ref_shares, $ref_hosts) = $at->GlobalInfo();

        

        In the above example '$ref_status' is a reference to a hash containing element names equivalent to the 'field' names returned from the "status" portion of the results. So for example, to get the version number of the firmware:

        

          $firmware_version = $ref_status->{"Version"};

        

        Next, $ref_shares is a reference to an array where each element contains the UNC name for the share as listed in the Audiotron.

        

        Lastly, $ref_hosts is a reference to an array of hashes, one hash per host known by the Audiotron. Each hash in the array contains three elements named 'Host','IP', and 'State'. So for example, to get the IP address of the first host in the array:

        

          $ip_add = $ref_hosts->[0]->{"IP"};






   Msg(Text_line1,[Text_line2],[Timeout])

   [Apimsg.api]

   

        Returns a string containing the results from the command request.

        

        $line1 = "This is a test.";

        $line2 = "Just Another Perl Hacker";

        $time_out = "5";

        $cmd_result = $at->Msg($line1, $line2, $time_out);

        




   DumpToc(Share_name)

   [Apidumptoc.asp]

   

        Returns a (sometimes huge!) string containing the results from the command request.

   

        $share = q|\\\\LITHIUM\MP3|;

        $toc = $at->DumpToc($share);

        

        NOTE:

        This is here just as a 'placeholder', newer versions will allow the output to be written to a file instead of be handed back as a string. Very inefficient in it's current form.

   

   




   Copyright (c) 2002 Dave Crawford. All rights reserved.

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




EXPORT

None by default.


AUTHOR

Dave Crawford, crawford@dcrawford.com =cut

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy