placed-object/protagonist [ Classes ]
[ Top ] [ placed-object ] [ Classes ]
Name
protagonist
File
protagonist.lsp
Description
Protagonists are abstract representations of the entites that "receive" the data generated by Comic. It could e.g. be a a performer, a loudspeaker, a videoscreen, etc. During render, Comic will select the closest possible protagonist for each event. An event can be rendered to a protagonist when one of its render-modes can produce data matching the output-type of of the protagonist. It can also be rendered if the value of its render-mode-slot is nil and the protagonist has a render-mode. In both cases, the event of cause also needs to provide the slot-values that the render-mode requests (required-slots). N.B.: At least one protagonist is always required when rendering events, even if Comics ability to distribute events to different Protagnoists is not used at all. In the case of only one protagonist, it can be seen as an explicit statement of the desired output-type.
Slots
output-type, output-files, can-render-simultaneous-events
Synopsis
(defclass protagonist (named-object placed-object) (;; the output-type of the protagonist, :sound, :video... (output-type :accessor output-type :initarg :output-type :initform nil) ;; all output-files will be collected here (output-files :accessor output-files :initarg :output-files :initform nil) (can-render-simultaneous-events :initarg :can-render-simultaneous-events :initform nil)))
protagonist/get-protagonist [ Functions ]
[ Top ] [ protagonist ] [ Functions ]
Name
get-protagonist
File
protagonist.lsp
Description
Returns a protagonist, that was defined using make-protagonist. Can only be used if a name was given to the protagonist, otherwise the object will not be stored in +cc-data+. The function is syntactic sugar for (cc-get :protagonist name).
Arguments
name: the name of the protagnoist
Return Value
a protagonist
Synopsis
(defun get-protagonist (name) (cc-get :protagonists name))
protagonist/make-protagonist [ Functions ]
[ Top ] [ protagonist ] [ Functions ]
Name
make-protagonist
File
protagonist.lsp
Description
Creates a protagonist. When a name is given, the protagonist will be added to +cc-data+ and can be accessed using (get-protagonist name) or (cc-get :protagonist name).
Arguments
output-type
Optional Arguments
name location (default: '(0)) expansion (default: '(0)) render-modes can-render-simultaneous-events (default: t)
Return Value
a protagonist
Synopsis
(defun make-protagonist (output-type &key name (location '(0)) (expansion '(0)) render-modes (can-render-simultaneous-events t))
Example
(make-protagonist :sound :name 'mono-sf :location '(0) :expansion '(0)) (make-protagonist :sound :name 'stereo-sf :location '(0) :expansion '(2)) (make-protagonist :sound :name '4-channel-sf :location '(0 0) :expansion '(2 2)) (make-protagonist :sound :name '8-channel-sf :location '(0 0 0) :expansion '(2 2 2)) (make-protagonist :sound :name '16-channel-sf :location '(0 0 0 0) :expansion '(2 2 2 2)) ;; -> channels as interpreted by soundfile-mode (make-protagonist :midi :name 'midi-file) ;; -> a single-channel midi-file (make-protagonist :video :name 'screen :location '(0 0) :expansion '(16 9)) ;; -> example for a videoscreen
protagonist/protagonistp [ Functions ]
[ Top ] [ protagonist ] [ Functions ]
Name
protagonistp
File
protagonist.lsp
Description
Returns t if obj is a protagonist.
Arguments
obj: any object
Return Value
boolean
Synopsis
(defun protagonistp (obj) (when (typep obj 'protagonist) t))