SuperCollider CLASSES

MovieView

A view responding to Wacom tablet
Location: NOT INSTALLED!

Description

MovieView can play movies such as .mov and mpg, and image files like jpg, png, tiff and others.

NOTE: Not available in Qt GUI
NOTE: prerequisites in SwingOSC

JSCMovieView is currently based on the Java Media Framework (JMF) which is not part of the standard java environment (Java SE) but needs to be installed separately. There is a reference implementation from Sun available for Linux, Windows and Mac OS X. It can be downloaded from http://java.sun.com/products/java-media/jmf/index.jsp (note: for Mac OS X you need the generic cross-platform version).

The reference implementation has rather poor media support (check this page: http://java.sun.com/products/java-media/jmf/2.1.1/formats.html ), so you might need to convert your movies or look out for extra JMF plug-ins. A really good plug-in is fobs4j !(ffpmeg objects for java) -> http://fobs.sourceforge.net/ ! You need to install the "jmf.jar" file in your system's java extensions folder, e.g. on Mac OS X that's "/Library/Java/Extensions". For fobs, do the same with "fobs4jmf.jar" and copy "jmf.properties" into "SwingOSC/build".

(in the future, FMJ (freedom for media in java) might be an alternative: http://fmj-sf.net)

Class Methods

Inherited class methods

Instance Methods

-path

The path to the movie.

Movie Control

-start

-stop

-stepForward

-stepBack

-gotoEnd

-gotoBeginning

-frame

Go to frame.

Arguments:

The frame index; an Integer.

-playSelectionOnly

Arguments:

A Boolean.

-skipFrames

Arguments:

An Integer.

-muted

Arguments:

A Boolean.

-loopMode

Possible loop modes:

Arguments:

One of the above Integers.

-rate

Arguments:

An instance of Float. 1.0 is the normal rate.

Movie Editing

-copy

-clear

-cut

-paste

-editable

Arguments:

A Boolean.

-currentTime

The current time.

Arguments:

Defaults to nil.

Appearance

-showControllerAndAdjustSize

Arguments:

show

A Boolean. Default is true.

adjust

A Boolean. Default is true.

-resizeWithMagnification

Resizes the whole view, adjusts its contents.

Arguments:

size

A Float.

-fixedAspectRatio

Arguments:

A Boolean.

Inherited instance methods

Examples

(
w = Window("mov").front;
b = Button(w, Rect(0, 0, 150, 20))
    .states_([["pick a file"]])
    .action_({ File.openDialog("", { |path| m.path_(path) }) });
m = MovieView(w, Rect(0,20,360, 260));
)
    // random-pick a tiff from the Help folder
m.path_("Help/*/*/*.tiff".pathMatch.choose);

    // or point it to a movie (you may have that one too):
m.path_("/Library/Application\ Support/iDVD/Tutorial/Movies/Our\ First\ Snowman.mov");


m.start;            // playback
m.muted_(false);    // thank god
m.stop;

    //rate
m.rate_(1);
    // backwards
m.gotoEnd.rate_(-1).start;

    // select a range on the controller and play it
m.rate_(1).playSelectionOnly_(true).start;

    // loopModes:
m.loopMode_(1); // only one direction
m.loopMode_(0).start;   // back and forth



m.stop;
m.gotoBeginning;

    // single steps
m.stepForward;

10.do { m.stepForward; };
m.stepBack;

    // select with shift-drag, copy paste between movieviews or quicktime player
m.editable_(true);


m.showControllerAndAdjustSize(true, true);
    // resize compared to image size:
m.resizeWithMagnification(0.25);

    //goto time (in seconds)
m.currentTime_(1);

    // not there yet, but would be nice to have:
    // startFrame, length
m.setSelection_(20, 15);


m.frame_(frame);    // jump to frame
m.frame.postln; // poll current frame pos