Vuo  2.0.0
Functions | Variables
VuoApp.h File Reference

Description

VuoApp interface.

Definition in file VuoApp.h.

Go to the source code of this file.

Functions

bool VuoApp_isMainThread (void)
 Is the current thread the main thread? More...
 
void VuoApp_executeOnMainThread (void(^block)(void))
 Executes the specified block on the main thread, then returns. More...
 
char * VuoApp_getName (void)
 Returns the composition's name. More...
 
void VuoApp_init (bool requiresDockIcon)
 Creates an NSApplication instance (if one doesn't already exist). More...
 
void * VuoApp_setMenuItems (void *items)
 Replaces the top-level menus in the menu bar, except for application-wide menus, with the given menus. More...
 
void VuoApp_setMenu (void *menu)
 Replaces the top-level menus in the menu bar with the given menu. More...
 

Variables

const double VuoApp_windowFadeSeconds
 The duration of the window fade in/out animation. More...
 

Function Documentation

◆ VuoApp_executeOnMainThread()

void VuoApp_executeOnMainThread ( void(^)(void)  block)

Executes the specified block on the main thread, then returns.

Can be called from any thread, including the main thread (avoids deadlock).

Don't call this from __attribute__((constructor)) functions, since this function depends on initialization which might not happen before your constructor is called.

Definition at line 79 of file VuoApp.m.

◆ VuoApp_getName()

char* VuoApp_getName ( void  )

Returns the composition's name.

If the composition is running in Vuo Editor (via VuoCompositionLoader), it extracts the name from the most-recently-loaded dylib's path. If the composition has been saved, this matches the composition's source filename. If not, it returns the text "Vuo Composition".

If the composition is running via VuoRunner (but not via VuoCompositionLoader), it returns the name of the VuoRunner process.

If the composition is running standalone, it tries the following Info.plist keys:

  • CFBundleDisplayName
  • CFBundleName
  • CFBundleExecutable

If none of those keys exist, it uses the composition executable's filename.

The caller is responsible for freeing the returned string.

Definition at line 117 of file VuoApp.m.

◆ VuoApp_init()

void VuoApp_init ( bool  requiresDockIcon)

Creates an NSApplication instance (if one doesn't already exist).

This causes the process's icon to appear in the dock.

VuoWindow methods call this automatically as needed, so you only need to call this if you need an NSApplication without using VuoWindow (like, for example, VuoAudioFile does).

If requiresDockIcon is true, the app will show up in the dock. If requiresDockIcon is false, the app won't necessarily show up in the dock (if VuoApp_init was previously called with requiresDockIcon=true, the icon will remain).

This function may be called from any thread.

Changed in Vuo 2.0.0:
Added requiresDockIcon parameter.

Definition at line 217 of file VuoApp.m.

◆ VuoApp_isMainThread()

bool VuoApp_isMainThread ( void  )

Is the current thread the main thread?

Definition at line 43 of file VuoApp.m.

◆ VuoApp_setMenu()

void VuoApp_setMenu ( void *  menu)

Replaces the top-level menus in the menu bar with the given menu.

menu should be an NSMenu.

Definition at line 96 of file VuoAppMenu.m.

◆ VuoApp_setMenuItems()

void* VuoApp_setMenuItems ( void *  items)

Replaces the top-level menus in the menu bar, except for application-wide menus, with the given menus.

items should be an NSArray of NSMenuItems.

Returns the old menu.

Definition at line 43 of file VuoAppMenu.m.

Variable Documentation

◆ VuoApp_windowFadeSeconds

const double VuoApp_windowFadeSeconds

The duration of the window fade in/out animation.

Changed in Vuo 2.0.0:
New.

Definition at line 38 of file VuoApp.m.