Classes | GUI > Views

ServerMeterView : Object

A GUI widget that displays input/output levels

Description

A ServerMeterView is a modular widget for showing the volume levels of inputs/outputs on the server. ServerMeterView can be embedded inside of your custom graphical user interfaces just like a button or slider.

NOTE: If you are looking for a quick input/output levels display without having to build your own GUI from scratch, see ServerMeter and Server: -meter

Class Methods

ServerMeterView.height

Get the height in pixels of the standard ServerMeterView widget

Returns:

ServerMeterView.getWidth(numIns, numOuts, server)

Get the width in pixels of a ServerMeterView widget with the given number of inputs and outputs

Arguments:

numIns

number of inputs used to calculate the width

numOuts

number of outputs used to calculate the width

server

the server

Returns:

ServerMeterView.new(aserver, parent, leftUp, numIns, numOuts)

Create a new ServerMeterView instance

Arguments:

aserver

The Server whose inputs/outputs will be monitored

parent

The parent View or Window where the new ServerMeterView will be embedded.

leftUp

Where to position the new ServerMeterView inside the parent. leftUp must be a Point, describing where to place the upper left corner of the new ServerMeterView.

numIns

The number of inputs to monitor

numOuts

The number of outputs to monitor

Returns:

Inherited class methods

Instance Methods

.view

get the CompositeView used to construct the various elements of the ServerMeterView widget

Returns:

.remove

Removes this ServerMeterView from its parent view (if any) and then destroys it. Once this method is called you can no longer use this ServerMeterView.

.start

Enable the monitoring of input/outputs

Returns:

.stop

Disable the monitoring of input/outputs

Returns:

Inherited instance methods

Examples

Simple Usage

// make a window and embed a ServerMeterView inside of it.
w = Window.new("Server Levels");
ServerMeterView.new(s, w, 0@0, 2, 2);
w.front; // show the window

A More Complex Example

// make a GUI to monitor two servers running simultaneously
s = Server.local;
q = Server.internal;
s.boot; q.boot; // wait a moment for the servers to boot

// make a window big enough to hold 2 ServerMeterViews
r = Rect(0, 0, ServerMeterView.getWidth(2, 2) * 2, ServerMeterView.height)
w = Window.new("Local | Internal", r);

// make one ServerMeterView to monitor the input/output of each server
ServerMeterView.new(s, w, Point(0,0), 2, 2);
ServerMeterView.new(q, w, Point(ServerMeterView.getWidth(2,2), 0), 2, 2);
w.front; // show the window