All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.sciss.fscape.graph.DebugOut.scala Maven / Gradle / Ivy

/*
 *  DebugAudioFileOut.scala
 *  (FScape)
 *
 *  Copyright (c) 2001-2016 Hanns Holger Rutz. All rights reserved.
 *
 *  This software is published under the GNU General Public License v2+
 *
 *
 *  For further information, please contact Hanns Holger Rutz at
 *  [email protected]
 */

package de.sciss.fscape
package graph

import de.sciss.fscape.stream.{StreamIn, StreamOut}

import scala.collection.immutable.{IndexedSeq => Vec}

/** A UGen that reads in an audio file. The output signal
  * is the monotonously increasing number of frames written,
  * which can be used to monitor progress or determine the
  * end of the writing process. The UGen keeps running until
  * the `in` signal ends.
  *
  * @param in     the signal to write.
  */
final case class DebugOut(in: GE) extends UGenSource.ZeroOut {
  protected def makeUGens(implicit b: UGenGraph.Builder): Unit = unwrap(Vector(in.expand))

  protected def makeUGen(args: Vec[UGenIn])(implicit b: UGenGraph.Builder): Unit =
    UGen.ZeroOut(this, inputs = args, isIndividual = true)

  private[fscape] def makeStream(args: Vec[StreamIn])(implicit b: stream.Builder): Unit = {
    val Vec(in) = args
    stream.DebugOut(in = in.toDouble)
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy