
de.sciss.fscape.graph.Frames.scala Maven / Gradle / Ivy
The newest version!
/*
* Frames.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 generates a signal that incrementally counts the frames of its input.
* The first value output will be `1`, and the last will correspond to the number
* of frames seen, i.e. `Length(in)`.
*/
final case class Frames(in: GE) extends UGenSource.SingleOut {
protected def makeUGens(implicit b: UGenGraph.Builder): UGenInLike =
unwrap(Vector(in.expand))
protected def makeUGen(args: Vec[UGenIn])(implicit b: UGenGraph.Builder): UGenInLike =
UGen.SingleOut(this, args)
private[fscape] def makeStream(args: Vec[StreamIn])(implicit b: stream.Builder): StreamOut = {
val Vec(in) = args
stream.Frames(in = in.toAny)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy