7.8 Source information functions
When specifying segment effects - i.e. effects that are to be applied to source clips - you can use these functions to determine the kind of source that the effect will be applied to and some of its properties. The most common use is probably to distinguish between portrait images, landscape images and video.
All the source information functions take an optional segment index parameter. You may use the function (segment-index) to get the “current” segment index. You may safely add/subtract 1 from this number to get the segment index for the neighbouring segment without generating any boundary warnings. For all the functions below, if the seg-index parameter is omitted, then it is taken to mean “index of current segment”.
Note: These functions are only available for use within a segment level effect specification or within a transition.
(source-file-name seg-index) → string |
seg-index : integer |
Evaluates to the full path to the file that the source clip refers to.
(source-type seg-index) → symbol |
seg-index : integer |
Evaluates to 'image, 'video or ()
(source-is-image? seg-index) → symbol-or-nil |
seg-index : integer |
Evaluates to 'image if the source is an image and to () otherwise.
(source-is-video? seg-index) → symbol-or-nil |
seg-index : integer |
Evaluates to 'video if the source is a video clip and to () otherwise.
(source-is-intertitle? seg-index) → symbol-or-nil |
seg-index : integer |
Evaluates to 'intertitle if the source is an intertitle card and to () otherwise.
(source-start-time seg-index) → number |
seg-index : integer |
For video clips, evaluates to the mstart time.
(source-stop-time seg-index) → number |
seg-index : integer |
For video clips, evaluates to the mstop time.
(source-duration seg-index) → number |
seg-index : integer |
For video clips, evaluates to mstop-mstart.
(source-width seg-index) → integer |
seg-index : integer |
For image clips, evaluates to the actual pixel width of the original image.
(source-height seg-index) → integer |
seg-index : integer |
For image clips, evaluates to the actual pixel height of the original image.
(source-aspect-ratio seg-index) → number |
seg-index : integer |
For image clips, evaluates to width/height.
(source-orientation seg-index) → symbol |
seg-index : integer |
For image clips, evaluates to 'portrait or 'landscape.
(source-rotation-deg seg-index) → number-in-degrees |
seg-index : integer |
For image clips, evaluates to the user specified rotation value in degrees. This is a multiple fo 90 degrees.
(source-highlights seg-index) → (list-of (cons mstart mstop)) |
seg-index : integer |
Evaluates to a list of highlight intervals expressed as (mstart . mstop) pairs that overlap with the media interval of the current or given segment index. The list will be empty if the segment does not contain any highlights. The highlight intervals will all be clipped to the segment’s own media interval.
(source-captions seg-index) |
→ (list-of (list start stop caption-string)) |
seg-index : integer |
This primitive gives the style author access to the caption text entered by the user and used within a muvee. Evaluates to a list of triplets
that tells the locations within the current or given segment where the user has added captions. Note that the interval is specified in play back time and not in media time. For pictures, the interval will span the whole segment. For video clips, it can be a sub-interval of the whole segment.
(source-rectangles seg-index) |
| → | | (or (list 'auto ((x1 y1) (x2 y2))) | (list 'manual ((sx1 sy1) (sx2 sy2)) ((ex1 ey1) (ex2 ey2)))) |
|
|
seg-index : integer |
Returns any rectangles analyzed for the picture at the given segment index (or the current index) or those set by the user using magicSpot. If the segment isn’t a picture, it results in (). The other values can be -
('auto ((x1 y1) (x2 y2)))
Means the given rectangle is one that’s automatically determined by the analyzer.
('manual ((sx1 sy1) (sx2 sy2)) ((ex1 ey1) (ex2 ey2)))
Means the user has set manual pan/zoom rectangles. The start rectangle is given by the [(sx1,sy1),(sx2,sy2)] and the end rect is given by [(ex1,ey1),(ex2,ey2)].