|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.cycling74.max.MaxSystem
public class MaxSystem
Collection of functions relating primarily to interaction with the Max environment and other information about the environment mxj is executing within.
Field Summary | |
---|---|
static int |
PATH_STYLE_COLON
Used with the nameConform method. |
static int |
PATH_STYLE_MAX
Used with the nameConform method. |
static int |
PATH_STYLE_NATIVE
Used with the nameConform method. |
static int |
PATH_STYLE_NATIVE_WIN
Used with the nameConform method.The Windows backslash path style (not recommended for outletting, since the backslash is a special character in Max). |
static int |
PATH_STYLE_SLASH
Used with the nameConform method.The cross-platform path style used by Max 4.3 and later. |
static int |
PATH_TYPE_ABSOLUTE
Used with the nameConform method.Do not use a path type. |
static int |
PATH_TYPE_BOOT
Used with the nameConform method.A path relative to the boot volume |
static int |
PATH_TYPE_C74
Used with the nameConform method.A path relative to the Cycling 74 app support folder. |
static int |
PATH_TYPE_IGNORE
Used with the nameConform method.Do not use a path type. |
static int |
PATH_TYPE_RELATIVE
Used with the nameConform method.A path relative to the Max application folder. |
Constructor Summary | |
---|---|
MaxSystem()
|
Method Summary | |
---|---|
static void |
defer(Executable fn)
Defer the execution of fn to the low priority cue. |
static void |
deferFront(Executable fn)
Defer the execution of fn to the front of the low priority queue regardless whether or not the calling thread is the low or high priority thread(scheduler). |
static void |
deferLow(Executable fn)
Defer the execution of fn to the back of the low priority queue regardless whether or not the calling thread is the low or high priority thread(scheduler). |
static void |
deferMedium(Executable fn)
Defer the execution of fn to the back of the low priority queue if the calling thread is the high priority thread(scheduler). |
static boolean |
doGetIsRuntime()
|
static void |
error(java.lang.String message)
Post an error message to the Max console. |
static java.lang.String[] |
getClassPath()
|
static java.lang.String |
getDefaultPath()
Get the absolute path of the current default directory of the Max application. |
static short |
getMaxVersion()
Get the version number of the Max system. |
static int[] |
getMaxVersionInts()
A utility method to get the current version of max as an array of ints. |
static java.lang.String |
getPreferencesPath()
Get the absolute path of the preferences directory of the Max application. |
static java.lang.String[] |
getSearchPath()
Get the current Max search path list as an array of Strings where each String is an absolute path to a directory in the current Max search path. |
static java.lang.String[] |
getSearchPathForContext()
Get the contextual Max search path list as an array of Strings where each String is an absolute path to a directory in the contextual (project- or collective-specific) search path. |
static java.lang.String[] |
getSystemClassPath()
|
static void |
hideCursor()
Hide the cursor via native OS call. |
static boolean |
inMainThread()
|
static boolean |
inMaxThread()
|
static boolean |
inTimerThread()
|
static boolean |
isOsMacOsX()
|
static boolean |
isOsWindows()
|
static boolean |
isRuntime()
|
static boolean |
isStandAlone()
|
static void |
loadObject(java.lang.String objname)
Force loads a max external for things like Jitter Java support. |
static java.lang.String |
locateFile(java.lang.String filename)
Get the absolute path of first file named filename found in the MAX search path |
static java.lang.String |
maxPathToNativePath(java.lang.String maxpath)
Convert a max style path (vol:/path/to/some/file) to a path native to the current OS. |
static java.lang.String |
nameConform(java.lang.String filename,
int style,
int type)
change format of a path from one style/type to another. |
static void |
nextWindowIsModal()
This is a workaround for a bug in swing on OSX jaguar. |
static java.lang.String |
openDialog()
Shows an open file dialog using the Max API. |
static java.lang.String |
openDialog(java.lang.String prompt)
Shows an open file dialog using the Max API. |
static void |
ouch(java.lang.String message)
Put up an error window. |
static void |
post(java.lang.String message)
Post a message to the Max console. |
static void |
registerCommandAccelerator(char c)
The interaction between Max/MSP and Swing/AWT Frames is a bit complex on OS X. |
static void |
registerCommandAccelerators(char[] c)
The interaction between Max/MSP and Swing/AWT Frames is a bit complex on OS X. |
static java.lang.String |
saveAsDialog(java.lang.String prompt,
java.lang.String default_filename)
Shows a save as.. |
static void |
schedule(Executable fn,
double abs_time)
Schedule the execution of fn at an absolute time in the future by the high priority thread. |
static void |
scheduleDefer(Executable fn,
double delay)
Creates a clock to execute at some time in the future. |
static void |
scheduleDelay(Executable fn,
double delay)
Schedule the execution of fn delay millis from now by the high priority thread. |
static boolean |
sendMessageToBoundObject(java.lang.String sym_name,
java.lang.String msg,
Atom[] args)
This method provides and easy way for mxj objects to communicate with other max objects or libraries written in C by passing messages. |
static void |
showCursor()
Show the cursor via native OS call. |
static double |
sysTimerGetTime()
|
static void |
unregisterCommandAccelerator(char c)
Unregister a command accelerator. |
static void |
unregisterCommandAccelerators(char[] c)
Unregister command accelerators. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PATH_STYLE_MAX
public static final int PATH_STYLE_NATIVE
public static final int PATH_STYLE_COLON
public static final int PATH_STYLE_SLASH
public static final int PATH_STYLE_NATIVE_WIN
public static final int PATH_TYPE_IGNORE
public static final int PATH_TYPE_ABSOLUTE
public static final int PATH_TYPE_RELATIVE
public static final int PATH_TYPE_BOOT
public static final int PATH_TYPE_C74
Constructor Detail |
---|
public MaxSystem()
Method Detail |
---|
public static void defer(Executable fn)
fn
- is the instance of Executable to be executed by the low
priority thread.public static void deferLow(Executable fn)
fn
- is the instance of Executable to be executed by the low
priority thread.public static void deferMedium(Executable fn)
fn
- is the instance of Executable to be executed by the low
priority thread.public static void deferFront(Executable fn)
fn
- is the instance of Executable to be executed by the low
priority thread.public static void schedule(Executable fn, double abs_time)
fn
- is the instance of Executable to be executed by the scheduler
thread.abs_time
- the absolute time when at which fn should be executed.public static void scheduleDelay(Executable fn, double delay)
fn
- is the instance of Executable to be executed by the scheduler
thread.delay
- the offset in millis from now at which fn should be executed.public static void scheduleDefer(Executable fn, double delay)
fn
- is the instance of Executable to be executed by the scheduler
thread.delay
- the offset in millis from now at which fn should be executed.public static boolean inMaxThread()
public static boolean inTimerThread()
public static boolean inMainThread()
public static void showCursor()
public static void hideCursor()
public static void nextWindowIsModal()
public static boolean sendMessageToBoundObject(java.lang.String sym_name, java.lang.String msg, Atom[] args)
void main(void) { ...blah addmess((method)my_obj_setstate, "setstate", A_GIMME, 0) ..blah } t_my_obj *x; blah blah... gensym("__my_special_lib__")->s_thing = (t_object *)x;IN JAVA:
private static final String LIBNAME = "__my_special_lib__"; private static final int STATE_INIT = 0; private static final int STATE_ACTIVE = 1; blah blah.. public void setBackendState() { Atom[] args = new Atom[1]; args[0]= Atom.newAtom(STATE_INIT); boolean res = MaxSystem.sendMessageToBoundObject(LIBNAME,"setstate",args); ... }Args can be null if message takes no arguments.
sym_name
- the symbol to which the object is boundmsg
- the message to passargs
- arguments to pass with the message
public static java.lang.String openDialog()
public static java.lang.String openDialog(java.lang.String prompt)
prompt
- message to display in dialog.
public static java.lang.String saveAsDialog(java.lang.String prompt, java.lang.String default_filename)
prompt
- message to display in dialog.default_filename
- default file chosen when dialog is shown.
public static java.lang.String locateFile(java.lang.String filename)
filename
- file to look for in Max search path
public static java.lang.String getDefaultPath()
public static java.lang.String getPreferencesPath()
public static java.lang.String[] getSearchPath()
public static java.lang.String[] getSearchPathForContext()
public static java.lang.String nameConform(java.lang.String filename, int style, int type)
filename
- old pathstyle
- path styletype
- path type
public static java.lang.String maxPathToNativePath(java.lang.String maxpath)
maxpath
- the path to convert
public static double sysTimerGetTime()
public static short getMaxVersion()
public static boolean isRuntime()
public static boolean isStandAlone()
public static int[] getMaxVersionInts()
public static boolean doGetIsRuntime()
public static boolean isOsWindows()
public static boolean isOsMacOsX()
public static java.lang.String[] getSystemClassPath()
public static java.lang.String[] getClassPath()
public static void registerCommandAccelerators(char[] c)
// from MXJEditor.java // call before frame is visible. private static final char[] __accs = new char[] { 'X', 'C', 'V', 'S', 'Z', 'O', 'N', 'W', 'F', 'G', 'H', 'L', 'K', 'D' }; com.cycling74.max.MaxSystem.registerCommandAccelerators(__accs);
c
- array of command accelerators.public static void registerCommandAccelerator(char c)
c
- command accelerator to disable when your AWT/Swing Frame has
focus.public static void unregisterCommandAccelerators(char[] c)
c
- array of command acceleratorspublic static void unregisterCommandAccelerator(char c)
c
- the command acceleratorpublic static void post(java.lang.String message)
message
- the String
to post in the Max console.public static void loadObject(java.lang.String objname)
objname
- the String
of the max object name.public static void error(java.lang.String message)
message
- the String
to post as an error to the Max
console.public static void ouch(java.lang.String message)
message
- the text to display in the error window.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |