// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // Procedure Name: // doSoundImportArgList // // Description: // This is helper function that is called to import a sound file. // // Input Arguments: // $version: The version of of the caller. Used to know how to // interpret the $args array. // "1" : $soundFile, $offset // // $args // Version 1 // [0] $soundFile : The sound file to import // [1] $offset : sound node offset // // Return Value: // The name of the sound node // global proc string doSoundImportArgList( string $version, string $args[] ) { global string $gPlayBackSlider; int $versionNum = $version; string $soundFile = $args[0]; float $offset = $args[1]; // Import the sound file // string $command = "sound -file \"" + $soundFile + "\" -offset " + $offset; string $soundNode; catch ($soundNode = `eval $command`); // Update the time slider (if necessary) // if (($soundNode != "") && ($gPlayBackSlider != "")) { // If there is more than one sound then go into Trax mode // string $soundNodes[] = `ls -type audio`; if (`size($soundNodes)` > 1) { timeControl -edit -displaySound true -sound "" $gPlayBackSlider; } else { timeControl -edit -displaySound true -sound $soundNode $gPlayBackSlider; } } return ($soundNode); }