Platform:
Filter:
Classes | Platform

Platform : Object

handle cross-platform differencies
Source: Platform.sc
Subclasses: UnixPlatform

Description

The Platform class (along with its subclasses) handles things which differ between operating systems (mac/linux/windows/...), to simplify cross-platform aspects of SuperCollider.

Platform is an abstract class encapsulating various platform dependent constants and properties, such as directories, primitive features and startup files. The platform object is accessible through the platform method of the main process instance:

Currently implemented platforms include: OSXPlatform, LinuxPlatform, WindowsPlatform, UnixPlatform.

Class Methods

Most of Platforms class methods are simply wrappers to thisProcess.platform.method.

Platform name and platform dependent actions

Platform.case( ... cases)

Perform actions depending on the current platform (name), just like Object:switch:

Platform.ideName

returns a String indicating which IDE the language believes it is running in. (Often this is determined via the "-i" option to the sclang executable.) This is determined when sclang starts and cannot be changed dynamically.

The main purpose of this is to include/exclude folders from the class search patch depending on which IDE is in use: for example, if the value of ideName is "scapp" then folders named "scide_scapp" are included and all other folders beginning with "scide_" are excluded. The default value of this is "none".

Known IDE names in use are "scapp" (SuperCollider.app on Mac), "scvim" (vim), "scel" (emacs). Others may be used.

Directories and filesystem stuff

Platform.classLibraryDir

location of the bundled class library

Platform.