### start() Source: https://openframeworks.cc/documentation/sound/ofSoundStream Starts the audio stream. Note that `setup()` typically starts the stream automatically, but this can be used for explicit control. ```APIDOC ## void start() ### Description Starts a stream. Note that setup() will start the stream on its own. ### Method `start` ``` -------------------------------- ### Setup() Source: https://openframeworks.cc/documentation/ofxNetwork/ofxUDPManager Initializes the UDP manager and prepares it for communication. This is a general setup method. ```APIDOC ## Setup() ### Description Initializes the UDP manager and prepares it for communication. This is a general setup method that might encompass creating the socket and setting initial configurations. ### Method `void Setup()` ``` -------------------------------- ### enableSetupScreen Source: https://openframeworks.cc/documentation/application/ofAppBaseWindow Enables the setup screen that appears before the main application loop starts. ```APIDOC ## enableSetupScreen() ### Description Enables the setup screen that appears before the main application loop starts. ### Method void ofAppBaseWindow::enableSetupScreen() ### Endpoint N/A (Method call) ### Parameters None ### Response None ``` -------------------------------- ### setup(const ofxOscReceiverSettings &settings) Source: https://openframeworks.cc/documentation/ofxOsc/ofxOscReceiver Configures the OSC receiver with specified settings and optionally starts listening. ```APIDOC ## bool setup(const ofxOscReceiverSettings &settings) ### Description Sets up the receiver with the given settings. It starts listening if `start` is true (default is true). Multiple receivers can share the same port if port reuse is enabled (default is true). Returns true if listening was started or if `start` was not required. ### Method member function ### Parameters * **settings** (const ofxOscReceiverSettings &) - The settings to configure the receiver with. ``` -------------------------------- ### Setup Receiver with Settings Source: https://openframeworks.cc/documentation/ofxOsc/ofxOscReceiver Configures the receiver using provided settings. Optionally starts listening immediately. ```cpp bool ofxOscReceiver::setup(const ofxOscReceiverSettings &settings) ``` -------------------------------- ### setup Source: https://openframeworks.cc/documentation/application/ofBaseApp This function is called once at the beginning of the application, before the main loop starts. It's a good place to initialize variables, load data, and set up the initial state of your application. ```APIDOC ## setup() ### Description This function is called once at the beginning of the application, before the main loop starts. It's a good place to initialize variables, load data, and set up the initial state of your application. ### Method void ``` -------------------------------- ### setup(int port) Source: https://openframeworks.cc/documentation/ofxOsc/ofxOscReceiver Configures the OSC receiver to listen on a specific port and starts listening. ```APIDOC ## bool setup(int port) ### Description Sets up the receiver with the specified port to listen for messages on and starts listening. Multiple receivers can share the same port if port reuse is enabled (default is true). Returns true if listening started. ### Method member function ### Parameters * **port** (int) - The network port to listen on. ``` -------------------------------- ### Update and Draw Cycle Example Source: https://openframeworks.cc/documentation/application/ofBaseApp Demonstrates the typical setup, update, and draw functions for an openFrameworks application. The update function is called repeatedly before draw, ideal for variable updates. ```cpp void setup(){ xpos = 0; } void update(){ xpos += 1; if (xPos > ofGetWidth()) xPos = 0; } void draw(){ ofDrawRectangle(xpos, 30,10,10); } ``` -------------------------------- ### Setup ofxOscSender with Settings Source: https://openframeworks.cc/documentation/ofxOsc/ofxOscSender Initializes the sender using a predefined settings object. Returns true on successful setup. ```cpp bool ofxOscSender::setup(const ofxOscSenderSettings &settings) ``` -------------------------------- ### Basic ofxTCPClient Setup and Communication Source: https://openframeworks.cc/documentation/ofxNetwork/ofxTCPClient Demonstrates the basic setup, connection check, receiving, and sending of data using ofxTCPClient. Ensure the client is connected before attempting to send or receive. ```cpp void ofApp::setup() { bool connected = tcpClient.setup("127.0.0.1", 11999); } void ofApp::update() { if(tcpClient.isConnected()) { string str = tcpClient.receive(); // did anything come in } } void ofApp::keyReleased(int key) { if(tcpClient.isConnected()) { tcpClient.send("HELLO WORLD!"); } } ``` -------------------------------- ### Setup ofxOscSender with Host and Port Source: https://openframeworks.cc/documentation/ofxOsc/ofxOscSender Initializes the sender by specifying the destination host (IP address or hostname) and port number. Returns true on successful setup. ```cpp bool ofxOscSender::setup(const string &host, int port) ``` -------------------------------- ### Setup Serial Device by Port Name and Baud Rate (Windows) Source: https://openframeworks.cc/documentation/communication/ofSerial Opens a serial port using its system-defined name and a specified baud rate. This example shows the typical naming convention on Windows. ```cpp ofSerial mySerial; mySerial.setup("COM4", 57600); ``` -------------------------------- ### Setup Screen Settings Source: https://openframeworks.cc/documentation/ofxiOS/ofAppiOSWindow Methods to enable, disable, and check the status of the setup screen. ```APIDOC ## disableSetupScreen() ### Description Disables the setup screen for the window. ## enableSetupScreen() ### Description Enables the setup screen for the window. ## isSetupScreenEnabled() ### Description Checks if the setup screen is currently enabled. ### Returns `bool` - True if the setup screen is enabled, false otherwise. ``` -------------------------------- ### setup Source: https://openframeworks.cc/documentation/ofxGui/ofxToggle Initializes the ofxToggle with specified parameters. ```APIDOC ## setup(const string &toggleName, bool _bVal, float width, float height) ### Description Sets up the ofxToggle with a name, initial boolean value, and dimensions. ### Method ofxToggle * ofxToggle::setup(const string &toggleName, bool _bVal, float width, float height) ### Parameters - **toggleName** (const string &) - The name of the toggle. - **_bVal** (bool) - The initial boolean value. - **width** (float) - The width of the toggle. - **height** (float) - The height of the toggle. ### Returns - **ofxToggle *** - A pointer to the setup ofxToggle instance. ## setup(ofParameter< bool > _bVal, float width, float height) ### Description Sets up the ofxToggle with a boolean parameter and dimensions. ### Method ofxToggle * ofxToggle::setup(ofParameter< bool > _bVal, float width, float height) ### Parameters - **_bVal** (ofParameter< bool >) - The boolean parameter to control the toggle. - **width** (float) - The width of the toggle. - **height** (float) - The height of the toggle. ### Returns - **ofxToggle *** - A pointer to the setup ofxToggle instance. ``` -------------------------------- ### Setup Serial Device by Port Name and Baud Rate (macOS/Linux) Source: https://openframeworks.cc/documentation/communication/ofSerial Opens a serial port using its system-defined name and a specified baud rate. This example shows the typical naming convention on macOS and Linux. ```cpp ofSerial mySerial; mySerial.setup("/dev/cu.USA19H181P1.1", 57600); ``` -------------------------------- ### start() Source: https://openframeworks.cc/documentation/ofxOsc/ofxOscReceiver Manually starts the OSC receiver listening for messages using the current settings. ```APIDOC ## bool start() ### Description Starts listening manually using the current settings. This is not required if `setup(port)` or `setup(settings)` was called with `start` set to true. Returns true if listening started or was already running. ### Method member function ### Parameters None ``` -------------------------------- ### Setup First Available Serial Device Source: https://openframeworks.cc/documentation/communication/ofSerial Attempts to set up the first available serial device with a default baud rate of 9600. Check the return value to confirm successful setup. ```cpp ofSerial mySerial; if( mySerial.setup() ){ printf("serial is setup!\n"); } ``` -------------------------------- ### setup() Source: https://openframeworks.cc/documentation/ofxEmscripten/ofxEmscriptenSoundStream Initializes the sound stream with the specified settings. ```APIDOC ## setup(const ofSoundStreamSettings &settings) ### Description Initializes the sound stream with the provided `ofSoundStreamSettings`. ### Parameters #### Path Parameters - **settings** (const ofSoundStreamSettings &) - An object containing configuration for the audio stream (sample rate, buffer size, channels, etc.). ### Method `bool setup(const ofSoundStreamSettings &settings)` ``` -------------------------------- ### Start Listening Manually Source: https://openframeworks.cc/documentation/ofxOsc/ofxOscReceiver Manually starts the receiver to listen for messages using its current settings. Useful if setup was called with start=false. ```cpp bool ofxOscReceiver::start() ``` -------------------------------- ### setup() Source: https://openframeworks.cc/documentation/video/ofDirectShowGrabber Initializes the video grabber with specified width and height. ```APIDOC ## setup(int w, int h) ### Description Initializes the video grabber with specified width and height. ### Method bool setup(int w, int h) ``` -------------------------------- ### getPointAtLength Source: https://openframeworks.cc/documentation/graphics/ofPolyline Get the point along the path at a given length from the start. ```APIDOC ## getPointAtLength(f) ### Description Get point long the path at a given length (e.g. `f=150` => 150 units along the path). ### Parameters - **f** (float) - The length along the path from the start. ### Returns - `T`: The point on the polyline at the specified length. ``` -------------------------------- ### setup() Source: https://openframeworks.cc/documentation/video/ofVideoGrabber Initializes the video grabber with specified width, height, and texture usage. ```APIDOC ## setup() ### Description Initializes the video grabber with specified width, height, and texture usage. ### Method void ### Signature void setup(int w, int h, bool bTexture = true) ``` -------------------------------- ### getTickCount() Source: https://openframeworks.cc/documentation/types/ofBaseSoundStream Gets the number of audio ticks that have occurred since the stream started. ```APIDOC ## getTickCount() ### Description Returns the number of audio ticks (frames processed) since the stream started. ### Method uint64_t ### Signature uint64_t ofBaseSoundStream::getTickCount() ``` -------------------------------- ### setup Source: https://openframeworks.cc/documentation/application/ofAppBaseWindow Initializes the application window with specified settings. ```APIDOC ## setup(...) ### Description Initializes the application window with specified settings. ### Method void ofAppBaseWindow::setup(const ofWindowSettings &settings) ### Endpoint N/A (Method call) ### Parameters - **settings** (const ofWindowSettings &) - An object containing window settings like size, position, and mode. ### Response None ``` -------------------------------- ### Start Sound Stream Source: https://openframeworks.cc/documentation/sound/ofSoundStream Initiates the audio stream, enabling the `audioIn()` and `audioOut()` callback functions to be called. Ensure the stream is set up before starting. ```cpp ofSoundStreamStart() ``` -------------------------------- ### setup(int outChannels, int inChannels, int sampleRate, int bufferSize, int nBuffers) Source: https://openframeworks.cc/documentation/sound/ofPASoundStream Initializes the audio stream with specified parameters for output channels, input channels, sample rate, buffer size, and number of buffers. ```APIDOC ## setup(int outChannels, int inChannels, int sampleRate, int bufferSize, int nBuffers) ### Description Initializes the audio stream with the specified audio parameters. ### Method bool ### Endpoint N/A ### Parameters - **outChannels** (int) - Required - The number of output channels. - **inChannels** (int) - Required - The number of input channels. - **sampleRate** (int) - Required - The desired sample rate in Hz. - **bufferSize** (int) - Required - The size of the audio buffer in frames. - **nBuffers** (int) - Required - The number of buffers to use. ``` -------------------------------- ### disableSetupScreen Source: https://openframeworks.cc/documentation/application/ofAppBaseWindow Disables the setup screen that appears before the main application loop starts. ```APIDOC ## disableSetupScreen() ### Description Disables the setup screen that appears before the main application loop starts. ### Method void ofAppBaseWindow::disableSetupScreen() ### Endpoint N/A (Method call) ### Parameters None ### Response None ``` -------------------------------- ### setup() - Overload 2 Source: https://openframeworks.cc/documentation/ofxiOS/ofxiOSSoundStream Initializes the audio stream with specified parameters and an application reference. ```APIDOC ## setup(ofBaseApp *app, int numOfOutChannels, int numOfInChannels, int sampleRate, int bufferSize, int numOfBuffers) ### Description Initializes the audio stream with the given application reference and audio stream parameters. Similar to the other setup overload, the number of buffers is fixed to 1 on iOS and the maximum buffer size is 4096. ### Method bool setup(ofBaseApp *app, int numOfOutChannels, int numOfInChannels, int sampleRate, int bufferSize, int numOfBuffers) ``` -------------------------------- ### Basic ofxCvHaarFinder Setup and Usage Source: https://openframeworks.cc/documentation/ofxOpenCv/ofxCvHaarFinder Demonstrates the fundamental setup and usage of ofxCvHaarFinder for object detection in an application. Ensure the Haar cascade XML file is placed in the /data/ directory. ```cpp app::setup() { haarFinder.setup("haarcascade.xml"); // must be in /data/ } app::update() { haarFinder.findHaarObjects(imageToExamine); } app::draw() { for(int i = 0; i < haarFinder.blobs.size(); i++) { ofDrawRectangle( haarFinder.blobs[i].boundingRect ); } } ``` -------------------------------- ### ofGetElapsedTimeMillis Source: https://openframeworks.cc/documentation/utils/ofUtils Gets the elapsed time in milliseconds since the application started or ofResetElapsedTimeCounter() was called. ```APIDOC ## ofGetElapsedTimeMillis ### Description Get the elapsed time in milliseconds. This returns the elapsed time since ofResetElapsedTimeCounter() was called. Usually ofResetElapsedTimeCounter() is called automatically once during program startup. ### Returns * (uint64_t) - The elapsed time in milliseconds (1000 milliseconds = 1 second). ``` -------------------------------- ### setup() Source: https://openframeworks.cc/documentation/video/ofQTKitGrabber Sets up the grabber with specified width and height. ```APIDOC ## setup(int w, int h) ### Description Sets up the grabber with specified width and height. ### Method bool ofQTKitGrabber::setup(int w, int h) ### Parameters - **w** (int) - The desired width. - **h** (int) - The desired height. ``` -------------------------------- ### setup (with buffer details) Source: https://openframeworks.cc/documentation/ofxAndroid/ofxAndroidSoundStream Initializes the audio stream with specified parameters. ```APIDOC ## setup(...) ### Description Initializes the audio stream with the specified number of output and input channels, sample rate, buffer size, and number of buffers. ### Method `bool ofxAndroidSoundStream::setup(int outChannels, int inChannels, int sampleRate, int bufferSize, int nBuffers)` ### Parameters * **outChannels** (int) - The number of output channels. * **inChannels** (int) - The number of input channels. * **sampleRate** (int) - The desired sample rate. * **bufferSize** (int) - The desired buffer size in frames. * **nBuffers** (int) - The number of buffers to use. ### Returns * **bool** - `true` if setup was successful, `false` otherwise. ``` -------------------------------- ### ofGetElapsedTimeMicros Source: https://openframeworks.cc/documentation/utils/ofUtils Gets the elapsed time in microseconds since the application started or ofResetElapsedTimeCounter() was called. ```APIDOC ## ofGetElapsedTimeMicros ### Description Get the elapsed time in microseconds. This returns the elapsed time since ofResetElapsedTimeCounter() was called. Usually ofResetElapsedTimeCounter() is called automatically upon program startup. ### Returns * (uint64_t) - The elapsed time in microseconds (1000000 microseconds = 1 second). ``` -------------------------------- ### getTickCount() Source: https://openframeworks.cc/documentation/sound/ofPASoundStream Gets the total number of audio frames processed since the stream started. ```APIDOC ## getTickCount() ### Description Returns the total number of audio frames processed by the stream since it started. ### Method long unsigned long ### Endpoint N/A ### Parameters None ### Request Example N/A ### Response - **return value** (long unsigned long) - The total tick count. ``` -------------------------------- ### setup() Source: https://openframeworks.cc/documentation/ofxGui/ofxColorSlider Sets up the ofxColorSlider with various configuration options. ```APIDOC ## setup(...) ### Description Sets up the ofxColorSlider with a control name, initial value, min/max values, width, and height. ### Method `setup` ### Parameters * **controlName** (const string &) - The name of the control. * **value** (const ofColor_< ColorType > &) - The initial color value. * **min** (const ofColor_< ColorType > &) - The minimum color value. * **max** (const ofColor_< ColorType > &) - The maximum color value. * **width** (float) - The width of the slider. * **height** (float) - The height of the slider. ### Returns * **ofxColorSlider_< ColorType > * - A pointer to the setup ofxColorSlider instance. ``` ```APIDOC ## setup(...) ### Description Sets up the ofxColorSlider using an existing ofParameter. ### Method `setup` ### Parameters * **value** (ofParameter) - The ofParameter to use for the slider's value. * **width** (float) - The width of the slider. * **height** (float) - The height of the slider. ### Returns * **ofxColorSlider_< ColorType > * - A pointer to the setup ofxColorSlider instance. ``` -------------------------------- ### startRecording() Source: https://openframeworks.cc/documentation/video/ofQTKitGrabber Starts recording the video stream to a file. ```APIDOC ## startRecording(string filePath) ### Description Starts recording the video stream to a file. ### Method void ofQTKitGrabber::startRecording(string filePath) ### Parameters - **filePath** (string) - The path to the file where the recording will be saved. ``` -------------------------------- ### setup (settings) Source: https://openframeworks.cc/documentation/application/ofAppGLFWWindow Initializes the application window with the specified GLFW settings. ```APIDOC ## void ofAppGLFWWindow::setup(const ofGLFWWindowSettings &settings) ### Description Initializes the application window with the specified GLFW settings. ### Method void ### Parameters #### Path Parameters - **settings** (const ofGLFWWindowSettings &) - An object containing settings for the GLFW window. ``` -------------------------------- ### ofGetElapsedTimef Source: https://openframeworks.cc/documentation/utils/ofUtils Gets the elapsed time in seconds as a float since the application started or ofResetElapsedTimeCounter() was called. ```APIDOC ## ofGetElapsedTimef ### Description Get the elapsed time in seconds. This returns the elapsed time since ofResetElapsedTimeCounter() was called. Usually ofResetElapsedTimeCounter() is called automatically once during program startup. ### Returns * (float) - The floating point elapsed time in seconds. ``` -------------------------------- ### setup (with app reference) Source: https://openframeworks.cc/documentation/ofxAndroid/ofxAndroidSoundStream Initializes the audio stream with a reference to the application. ```APIDOC ## setup(...) ### Description Initializes the audio stream with a reference to the `ofBaseApp`, along with the number of output and input channels, sample rate, buffer size, and number of buffers. ### Method `bool ofxAndroidSoundStream::setup(ofBaseApp *app, int outChannels, int inChannels, int sampleRate, int bufferSize, int nBuffers)` ### Parameters * **app** (ofBaseApp*) - A pointer to the main application object. * **outChannels** (int) - The number of output channels. * **inChannels** (int) - The number of input channels. * **sampleRate** (int) - The desired sample rate. * **bufferSize** (int) - The desired buffer size in frames. * **nBuffers** (int) - The number of buffers to use. ### Returns * **bool** - `true` if setup was successful, `false` otherwise. ``` -------------------------------- ### Setup Receiver with Port Source: https://openframeworks.cc/documentation/ofxOsc/ofxOscReceiver Configures the receiver to listen on a specific port and starts listening immediately. ```cpp bool ofxOscReceiver::setup(int port) ``` -------------------------------- ### setup() Source: https://openframeworks.cc/documentation/communication/ofSerial Initializes the serial connection to a specified port and baud rate. ```APIDOC ## setup() ### Description Initializes the serial connection to a specified port and baud rate. ### Method `void setup(int deviceIndex, int baudRate)` ### Parameters - **deviceIndex** (int) - The index of the serial device to connect to. - **baudRate** (int) - The communication speed in bits per second (baud). ``` -------------------------------- ### setup() Source: https://openframeworks.cc/documentation/ofxNetwork/ofxTCPClient Initializes and attempts to connect the TCP client to a specified IP address and port. ```APIDOC ## setup() ### Description Initializes the ofxTCPClient and attempts to establish a connection to the specified IP address and port. This method must be called before other network operations can be performed. ### Method `bool setup(string ip, int port)` ### Parameters #### Path Parameters - **ip** (string) - The IP address of the server to connect to. - **port** (int) - The port number of the server to connect to. ### Request Example ```cpp bool connected = tcpClient.setup("127.0.0.1", 11999); ``` ``` -------------------------------- ### setup(int w, int h) Source: https://openframeworks.cc/documentation/ofxAndroid/ofxAndroidVideoGrabber Initializes the video grabber with the specified width and height. ```APIDOC ## setup(int w, int h) ### Description Initializes the video grabber with the specified width and height. ### Parameters #### Path Parameters - **w** (int) - The desired width of the video capture. - **h** (int) - The desired height of the video capture. ### Method bool ``` -------------------------------- ### setup Source: https://openframeworks.cc/documentation/application/ofAppNoWindow Initializes the application with the specified window settings. This method is called once at the beginning of the application lifecycle. ```APIDOC ## setup(const ofWindowSettings &settings) ### Description Initializes the application with the given window settings. ### Method `void setup(const ofWindowSettings &settings)` ### Parameters #### Path Parameters - **settings** (`const ofWindowSettings &`) - Required - The settings for the application window. ``` -------------------------------- ### Get Pixel Data Example Source: https://openframeworks.cc/documentation/video/ofVideoPlayer Provides an example of how to access individual pixel color values (red, green, blue) from the video frame's pixel data. It calculates the memory offset for a specific pixel. ```cpp unsigned char * pixels = myMovie.getPixels(); int nChannels = movie.getPixelsRef().getNumChannels(); int widthOfLine = myMovie.width; // how long is a line of pixels int red = pixels[(20 * widthOfLine + 100) * nChannels ]; int green = pixels[(20 * widthOfLine + 100) * nChannels + 1]; int blue = pixels[(20 * widthOfLine + 100) * nChannels + 2]; ``` -------------------------------- ### setup(ofBaseApp *app, int outChannels, int inChannels, int sampleRate, int bufferSize, int nBuffers) Source: https://openframeworks.cc/documentation/sound/ofPASoundStream Initializes the audio stream, associating it with an ofBaseApp instance and specifying audio parameters. ```APIDOC ## setup(ofBaseApp *app, int outChannels, int inChannels, int sampleRate, int bufferSize, int nBuffers) ### Description Initializes the audio stream, linking it to an ofBaseApp instance and configuring audio parameters. ### Method bool ### Endpoint N/A ### Parameters - **app** (ofBaseApp*) - Required - A pointer to the application instance. - **outChannels** (int) - Required - The number of output channels. - **inChannels** (int) - Required - The number of input channels. - **sampleRate** (int) - Required - The desired sample rate in Hz. - **bufferSize** (int) - Required - The size of the audio buffer in frames. - **nBuffers** (int) - Required - The number of buffers to use. ``` -------------------------------- ### Get Push Level Source: https://openframeworks.cc/documentation/ofxXmlSettings/ofxXmlSettings Retrieves the current nesting level of tags. Starts at 0 and increments with pushTag, decrements with popTag. ```cpp int ofxXmlSettings::getPushLevel() ``` -------------------------------- ### Get Absolute Path of Directory Source: https://openframeworks.cc/documentation/utils/ofDirectory Retrieves the full, absolute path of the directory. For example, 'images' might become '/Users/mickey/of/apps/myApps/Donald/bin/data/images'. ```cpp string ofDirectory::getAbsolutePath() ``` -------------------------------- ### setup (GL settings) Source: https://openframeworks.cc/documentation/application/ofAppGLFWWindow Initializes the application window with the specified OpenGL settings. ```APIDOC ## void ofAppGLFWWindow::setup(const ofGLWindowSettings &settings) ### Description Initializes the application window with the specified OpenGL settings. ### Method void ### Parameters #### Path Parameters - **settings** (const ofGLWindowSettings &) - An object containing settings for the OpenGL window. ``` -------------------------------- ### ofGetFrameNum Source: https://openframeworks.cc/documentation/application/ofAppRunner Gets the current frame number, which increments with each rendered frame. It returns the number of frames rendered since the program started. ```APIDOC ## uint64_t ofGetFrameNum() This returns the current frame as an int, counting up to (depending on your system) 2147483647 before rolling over back to 0. Don't worry though, at 60 frames a second you have 68 years until it rolls over though. **_Documentation from code comments_** Get the number of frames rendered since the program started. **Returns** : the number of frames rendered since the program started. ``` -------------------------------- ### Get Current Frame Number Source: https://openframeworks.cc/documentation/application/ofAppRunner Returns the number of frames rendered since the program started. This count will eventually roll over after a very long time. ```cpp uint64_t ofGetFrameNum() ``` ```text Get the number of frames rendered since the program started. **Returns** : the number of frames rendered since the program started. ``` -------------------------------- ### setup() - Overload 1 Source: https://openframeworks.cc/documentation/ofxiOS/ofxiOSSoundStream Initializes the audio stream with specified parameters. Note: Number of buffers is fixed to 1 on iOS. ```APIDOC ## setup(int numOfOutChannels, int numOfInChannels, int sampleRate, int bufferSize, int numOfBuffers) ### Description Initializes the audio stream with the given number of output and input channels, sample rate, buffer size, and number of buffers. On iOS, the number of buffers is always 1 and setting `numOfBuffers` has no effect. The maximum buffer size is 4096. ### Method bool setup(int numOfOutChannels, int numOfInChannels, int sampleRate, int bufferSize, int numOfBuffers) ``` -------------------------------- ### setup() Source: https://openframeworks.cc/documentation/ofxOsc/ofxOscParameterSync Sets up the OSC parameter synchronization with the specified parameters and network configuration. ```APIDOC ## void ofxOscParameterSync::setup(ofParameterGroup &group, int localPort, const string &remoteHost, int remotePort) ### Description Sets up the OSC parameter synchronization. The remote and local ports must be different to avoid collisions. ### Method `setup(ofParameterGroup &group, int localPort, const string &remoteHost, int remotePort)` ### Parameters * **group** (ofParameterGroup&) - The parameter group to synchronize. * **localPort** (int) - The local port for OSC communication. * **remoteHost** (const string&) - The hostname or IP address of the remote host. * **remotePort** (int) - The remote port for OSC communication. ``` -------------------------------- ### Get Value as Int and Type Conversion Example Source: https://openframeworks.cc/documentation/ofxXmlSettings/ofxXmlSettings Retrieves the value of a specified tag as an integer. Demonstrates how the return type can be inferred from the default value provided, allowing for string, int, or double interpretation. ```cpp int ofxXmlSettings::getValue(const __cxx11::string &tag, int defaultValue, int which=0) ``` ```cpp //returns "9.8" string myString = settings.getValue("myTag", ""); //returns the integer value 9 int myInt = settings.getValue("myTag", 0); //returns the double value 9.8 double myDouble = settings.getValue("myTag", 0.0); ``` -------------------------------- ### setup Source: https://openframeworks.cc/documentation/ofxNetwork/ofxTCPServer Initializes the TCP server with the provided settings, including port and other configurations. ```APIDOC ## setup ### Description Initializes the TCP server with the provided settings, including port and other configurations. ### Method POST ### Endpoint /setup ### Parameters #### Request Body - **settings** (ofxTCPSettings) - Required - The settings object containing server configuration. ``` -------------------------------- ### setup Method with Full Parameters Source: https://openframeworks.cc/documentation/ofxGui/ofxColorSlider Sets up the ofxColorSlider with a control name, initial value, min/max color values, and dimensions. ```cpp ofxColorSlider_< ColorType > *setup(const string &controlName, const ofColor_< ColorType > &value, const ofColor_< ColorType > &min, const ofColor_< ColorType > &max, float width, float height); ``` -------------------------------- ### setup (file, type, multiPage, b3D, outputsize) Source: https://openframeworks.cc/documentation/graphics/ofCairoRenderer Initializes the Cairo renderer, optionally with a filename, type, multi-page support, 3D support, and output size. ```APIDOC ## void ofCairoRenderer::setup(string filename, ofCairoRenderer::Type type=FROM_FILE_EXTENSION, bool multiPage=true, bool b3D=false, ofRectangle outputsize) ### Description Initializes the Cairo renderer with specified parameters. ### Parameters #### Path Parameters - **filename** (string) - Required - The filename to associate with the renderer. - **type** (ofCairoRenderer::Type) - Optional - The type of renderer (default: FROM_FILE_EXTENSION). - **multiPage** (bool) - Optional - Whether to support multi-page output (default: true). - **b3D** (bool) - Optional - Whether to enable 3D rendering (default: false). - **outputsize** (ofRectangle) - Optional - The desired output size of the rendered content. ``` -------------------------------- ### Start Source: https://openframeworks.cc/documentation/ofxiOS/BackgroundTrackMgr Starts the background audio playback. ```APIDOC ## OSStatus BackgroundTrackMgr::Start() ### Description Starts the background audio playback. ### Method BackgroundTrackMgr::Start ``` -------------------------------- ### Setup Method Source: https://openframeworks.cc/documentation/ofxGui/ofxColorPicker Initializes the ofxColorPicker with a parameter and dimensions. ```APIDOC ## setup(...) ### Description Sets up the ofxColorPicker with an `ofParameter`, width, and height. Returns a pointer to the setup ofxColorPicker. ### Method `ofxColorPicker< ColorType > * ofxColorPicker_::setup(ofParameter parameter, float w, float h)` ``` -------------------------------- ### start Source: https://openframeworks.cc/documentation/ofxAndroid/ofxAndroidSoundStream Starts the audio stream processing. ```APIDOC ## start() ### Description Starts the audio stream, enabling input and output processing. ### Method `void ofxAndroidSoundStream::start()` ### Parameters None ``` -------------------------------- ### setup Source: https://openframeworks.cc/documentation/video/ofVideoGrabber Sets up the video grabber with specified width and height, optionally configuring texture usage. ```APIDOC ## setup(int w, int h) ### Description Sets up the video grabber with the specified width and height. ### Method `bool` ### Parameters * **w** (int) - The desired width. * **h** (int) - The desired height. ``` ```APIDOC ## setup(int w, int h, bool bTexture) ### Description Sets up the video grabber with the specified width, height, and texture usage. ### Method `bool` ### Parameters * **w** (int) - The desired width. * **h** (int) - The desired height. * **bTexture** (bool) - Whether to use a texture. ``` -------------------------------- ### Get Rectangle Width Source: https://openframeworks.cc/documentation/types/ofRectangle Gets the width of the rectangle as a float. ```cpp float getWidth(); ``` -------------------------------- ### Setup Source: https://openframeworks.cc/documentation/ofxNetwork/ofxUDPManager Initializes the UDP manager with the provided settings. ```APIDOC ## Setup ### Description Initializes the UDP manager with the provided settings. ### Signature `bool ofxUDPManager::Setup(const ofxUDPSettings &settings)` ``` -------------------------------- ### Get Rectangle Y-coordinate Source: https://openframeworks.cc/documentation/types/ofRectangle Gets the y-coordinate of the rectangle's position as a float. ```cpp float getY(); ``` -------------------------------- ### setup(const string &host, int port) Source: https://openframeworks.cc/documentation/ofxOsc/ofxOscSender Sets up the sender with a specific host and port. ```APIDOC ## setup(const string &host, int port) ### Description Sets up the sender with the destination host name/IP and port. ### Parameters #### Path Parameters - **host** (const string &) - The hostname or IP address of the destination. - **port** (int) - The port number of the destination. ### Returns - **bool**: true on success, false otherwise. ``` -------------------------------- ### Get Rectangle X-coordinate Source: https://openframeworks.cc/documentation/types/ofRectangle Gets the x-coordinate of the rectangle's position as a float. ```cpp float getX(); ``` -------------------------------- ### setup() Overloads Source: https://openframeworks.cc/documentation/application/ofAppBaseGLWindow Initializes the ofAppBaseGLWindow with specified OpenGL window settings. Two overloads are provided to accommodate different configuration types. ```APIDOC ## setup(const ofGLWindowSettings &settings) ### Description Sets up the OpenGL window with specific GL settings. ### Method `void setup(const ofGLWindowSettings &settings)` ### Endpoint N/A ### Parameters - **settings** (const ofGLWindowSettings &) - Required - The OpenGL window settings. ### Request Example N/A ### Response N/A ``` ```APIDOC ## setup(const ofWindowSettings &settings) ### Description Sets up the window with general window settings. ### Method `void setup(const ofWindowSettings &settings)` ### Endpoint N/A ### Parameters - **settings** (const ofWindowSettings &) - Required - The window settings. ### Request Example N/A ### Response N/A ``` -------------------------------- ### Setting up ofxTCPClient with IP and Port Source: https://openframeworks.cc/documentation/ofxNetwork/ofxTCPClient Use the setup method to configure the client's connection details. Specify the IP address and port number to connect to. ```cpp tcpClient.setup("127.0.0.1", 11999); ``` -------------------------------- ### setup() Source: https://openframeworks.cc/documentation/ofxAndroid/ofxAndroidCircBuffer Initializes or reconfigures the circular buffer with a specified size and initial element value. ```APIDOC ## void ofxAndroidCircBuffer::setup(int _size, const Content &init_val) ### Description Sets up the circular buffer with a given size and initializes all its elements to a specified value. ### Parameters * **_size** (int) - The desired size of the circular buffer. * **init_val** (const Content &) - The value to initialize each element of the buffer with. ``` -------------------------------- ### ofxTCPServer Setup and Usage Source: https://openframeworks.cc/documentation/ofxNetwork/ofxTCPServer Demonstrates how to set up an ofxTCPServer and handle incoming client connections and data. ```APIDOC ## ofxTCPServer Setup and Usage ### Description This section covers the basic setup of an `ofxTCPServer` and provides an example of how to manage client connections and data exchange. ### Setup To set up the server, create an instance of `ofxTCPServer` and call the `setup()` method with the desired port number. ```cpp TCP.setup(8080); ``` ### Client Management and Data Handling Clients are assigned a unique ID upon connection. You can check the number of connected clients using `getNumClients()` and iterate through them using `getLastID()`. ```cpp for(int i = 0; i < TCP.getLastID(); i++) { if( TCP.isClientConnected(i) ) { string str = TCP.receive(i); TCP.send(i, "You sent: " + str); } } ``` ### Sending Data There are methods for sending ASCII strings with a delimiter (`send`, `sendToAll`) and raw data without a delimiter (`sendRawMsg`, `sendRawMsgToAll`, `sendRawBytes`, `sendRawBytesToAll`). ### Methods - **`setup(int port)`**: Initializes the TCP server to listen on the specified port. - **`getNumClients()`**: Returns the number of currently connected clients. - **`getLastID()`**: Returns the highest client ID assigned, useful for iterating through all potential clients. - **`isClientConnected(int clientID)`**: Checks if a client with the given ID is currently connected. - **`receive(int clientID)`**: Receives data from a specific client. - **`send(int clientID, string message)`**: Sends a string message to a specific client. - **`sendToAll(string message)`**: Sends a string message to all connected clients. - **`close()`**: Closes the server and disconnects all clients. - **`disconnectClient(int clientID)`**: Disconnects a specific client. - **`disconnectAllClients()`**: Disconnects all connected clients. - **`getClientIP(int clientID)`**: Returns the IP address of the client. - **`getClientPort(int clientID)`**: Returns the port the client is connected on. - **`setVerbose(bool verbose)`**: Enables or disables verbose logging. ``` -------------------------------- ### ofSoundStreamStart Source: https://openframeworks.cc/documentation/sound/ofSoundStream Starts the audio stream. Once started, the audioIn() and audioOut() callback functions will begin to be called. ```APIDOC ## void ofSoundStreamStart() ### Description Starts the sound stream. After this call, audioIn() and audioOut() will start being called. ### Method POST ``` -------------------------------- ### Setup with OF Window Settings Source: https://openframeworks.cc/documentation/application/ofAppBaseGLESWindow Configures the window using general window settings. This method is part of the ofAppBaseGLESWindow class. ```cpp void ofAppBaseGLESWindow::setup(const ofWindowSettings &settings) ``` -------------------------------- ### Start Thread Source: https://openframeworks.cc/documentation/utils/ofThread Starts the execution of the thread. Subclasses can directly access the mutex for custom locking strategies. ```cpp void ofThread::startThread() ``` -------------------------------- ### Get Top Edge Y-coordinate Source: https://openframeworks.cc/documentation/types/ofRectangle Gets the y-coordinate of the top edge of the rectangle. This is equivalent to calling getMinY(). ```cpp float getTop(); ``` -------------------------------- ### Setup with OFWindowSettings Source: https://openframeworks.cc/documentation/application/ofAppBaseGLWindow Initializes the window using general window settings. This overloaded method is part of the ofAppBaseGLWindow class. ```cpp void ofAppBaseGLWindow::setup(const ofWindowSettings &settings) ``` -------------------------------- ### Get Right Edge X-coordinate Source: https://openframeworks.cc/documentation/types/ofRectangle Gets the x-coordinate of the right edge of the rectangle. This is equivalent to calling getMaxX(). ```cpp float getRight(); ``` -------------------------------- ### setup(...) - Method 1 Source: https://openframeworks.cc/documentation/ofxGui/ofxVecSlider Sets up the ofxVecSlider with a control name, initial value, min/max range, and dimensions. ```APIDOC ## setup(...) ### Description Sets up the ofxVecSlider with a control name, initial value, min/max range, and dimensions. ### Method SETUP ### Parameters * **controlName** (const string &) - The name of the control. * **value** (const VecType &) - The initial vector value. * **min** (const VecType &) - The minimum allowed vector value. * **max** (const VecType &) - The maximum allowed vector value. * **width** (float) - The width of the slider. * **height** (float) - The height of the slider. ### Returns * **ofxVecSlider< VecType > *** - A pointer to the setup ofxVecSlider instance. ``` -------------------------------- ### Undistort Usage Example Source: https://openframeworks.cc/documentation/ofxOpenCv/ofxCvImage An example demonstrating how to apply distortion correction to simulate an old TV monitor effect. ```cpp undistort( 0, 1, 0, 0, 200, 200, cwidth/2, cheight/2 ); ``` -------------------------------- ### setup(...) - Method 2 Source: https://openframeworks.cc/documentation/ofxGui/ofxVecSlider Sets up the ofxVecSlider with an ofParameter, width, and height. ```APIDOC ## setup(...) ### Description Sets up the ofxVecSlider using an existing ofParameter, along with specified width and height. ### Method SETUP ### Parameters * **value** (ofParameter< VecType >) - The ofParameter to use for the slider. * **width** (float) - The width of the slider. * **height** (float) - The height of the slider. ### Returns * **ofxVecSlider< VecType > *** - A pointer to the setup ofxVecSlider instance. ``` -------------------------------- ### Creating and Opening an ofFile by Path Source: https://openframeworks.cc/documentation/utils/ofFile Demonstrates creating an ofFile instance with a specified path and mode. If the file does not exist, it is created upon calling the create() method. ```cpp ofFile fileToRead(ofToDataPath("dictionary.txt")); // a file that exists ``` ```cpp ofFile newFile(ofToDataPath("temp.txt"), ofFile::Write); // file doesn't exist yet newFile.create(); // now file exists ``` -------------------------------- ### Setup ofxSlider with Parameter and Size Source: https://openframeworks.cc/documentation/ofxGui/ofxSlider Initializes the ofxSlider using an ofParameter and specifies its dimensions. Returns a pointer to the setup slider. ```cpp ofxSlider< Type > *ofxSlider::setup(ofParameter< Type > _val, float width, float height) ``` -------------------------------- ### get(const string &url) Source: https://openframeworks.cc/documentation/types/ofBaseURLFileLoader Makes an HTTP GET request to the specified URL and blocks until a response is received or the request times out. ```APIDOC ## get(const string &url) ### Description Makes an HTTP request and blocks until a response is returned or the request times out. ### Method ofHttpResponse get(const string &url) ### Parameters #### Path Parameters - **url** (string) - Required - HTTP url to request, ie. "http://somewebsite.com/someapi/someimage.jpg" ### Returns HTTP response on success or failure ``` -------------------------------- ### setup(int port) Source: https://openframeworks.cc/documentation/ofxNetwork/ofxTCPServer Initializes the TCP server to listen on a specific port. ```APIDOC ## setup(int port) ### Description Initializes and starts the `ofxTCPServer` to listen for incoming TCP connections on the specified port number. This method must be called before the server can accept clients. ### Method `bool setup(int port)` ### Parameters - **port** (int) - The port number on which the server will listen for connections. ### Returns `true` if the server was set up successfully, `false` otherwise. ``` -------------------------------- ### setup (string, float, float) Source: https://openframeworks.cc/documentation/ofxGui/ofxButton Sets up the ofxButton with a name, width, and height. ```APIDOC ## ofxButton *ofxButton::setup(const string &toggleName, float width, float height) ### Description Sets up the ofxButton with a given name, width, and height. ### Method ofxButton * ### Parameters * **toggleName** (const string &) - The name of the button. * **width** (float) - The width of the button. * **height** (float) - The height of the button. ### Returns A pointer to the ofxButton instance. ``` -------------------------------- ### WarpIntoMe Example Source: https://openframeworks.cc/documentation/ofxOpenCv/ofxCvImage Example demonstrating how to use warpIntoMe to transform an image's perspective using source and destination point arrays. ```cpp ofPoint[4] src; src[0] = ofPoint(0, 0); src[1] = ofPoint(320, 0); src[2] = ofPoint(320, 240); src[3] = ofPoint(0, 240); ofPoint[4] dst; dst[0] = ofPoint(10, 0); dst[1] = ofPoint(310, 0); dst[2] = ofPoint(310, 230); dst[3] = ofPoint(10, 230); image.warpIntoMe(parent, src, dst); ``` -------------------------------- ### begin() Source: https://openframeworks.cc/documentation/3d/ofEasyCam Begins using the camera for rendering. All drawing commands after this call will be affected by the camera's view. ```APIDOC ## begin() ### Description Begins using the camera for rendering. This method should be called before drawing scene elements that need to be viewed through this camera. Remember to call `end()` after drawing. ### Method void ``` ```APIDOC ## begin(const ofRectangle &viewport) ### Description Begins using the camera for rendering within a specified viewport. This is useful for multi-viewport applications. ### Parameters * **viewport** (const ofRectangle &) - Required - The rectangular area defining the camera's viewport. ``` -------------------------------- ### Get Camera Target Node Source: https://openframeworks.cc/documentation/3d/ofEasyCam Get a reference to the camera's target node. This is the point in space that the camera is looking at and orbiting around. ```cpp const ofNode & ofEasyCam::getTarget() ``` -------------------------------- ### SetupBuffers Source: https://openframeworks.cc/documentation/ofxiOS/BackgroundTrackMgr Sets up the necessary audio buffers for playback. ```APIDOC ## OSStatus BackgroundTrackMgr::SetupBuffers(BG_FileInfo *inFileInfo) ### Description Sets up the audio buffers required for playback based on the provided file information. ### Parameters #### Path Parameters - **inFileInfo** (BG_FileInfo *) - Pointer to the file information structure. ### Method BackgroundTrackMgr::SetupBuffers ``` -------------------------------- ### Setting up an ofxTCPServer Source: https://openframeworks.cc/documentation/ofxNetwork/ofxTCPServer Initialize the TCP server to listen on a specific port. Ensure setup() is called before the server can accept connections. ```cpp TCP.setup(8080); ``` -------------------------------- ### ofxVecSlider Setup with Name and Range Source: https://openframeworks.cc/documentation/ofxGui/ofxVecSlider Sets up the ofxVecSlider with a control name, initial value, min/max range, and dimensions. Returns a pointer to the setup ofxVecSlider object. ```cpp ofxVecSlider_< VecType > * ofxVecSlider_::setup(const string &controlName, const VecType &value, const VecType &min, const VecType &max, float width, float height) ``` -------------------------------- ### Setup with OFGLWindowSettings Source: https://openframeworks.cc/documentation/application/ofAppBaseGLWindow Initializes the window using specific OpenGL settings. This method is part of the ofAppBaseGLWindow class. ```cpp void ofAppBaseGLWindow::setup(const ofGLWindowSettings &settings) ``` -------------------------------- ### Setting and Getting Box Resolution (Single Value) Source: https://openframeworks.cc/documentation/3d/of3dGraphics Demonstrates setting and getting the resolution for a box using a single integer parameter. The resolution can be modified by key presses. ```cpp int res; ``` ```cpp void ofApp::setup(){ res = 1; } //-------------------------------------------------------------- void ofApp::draw(){ ofSetColor(0, 255, 0); ofFill(); ofSetBoxResolution(res); ofDrawBox(ofGetWidth() * .5, ofGetHeight() * .5, 0, 100, 200, 300); string boxres = ofToString(ofGetBoxResolution()); ofDrawBitmapString("Box Resolution: " + boxres, 30, 30); //NOTE: to better see the 3D shape you need to create a light spot... //check `ofLight' documentation } //-------------------------------------------------------------- void ofApp::keyPressed(int key){ switch (key) { case 'q': res--; break; case 'w': res++; break; default: break; } } ``` -------------------------------- ### Setup ofxSlider with Name, Value, Min, Max, Size Source: https://openframeworks.cc/documentation/ofxGui/ofxSlider Initializes the ofxSlider with a name, initial value, min/max limits, and dimensions. Returns a pointer to the setup slider. ```cpp ofxSlider< Type > *ofxSlider::setup(const string &sliderName, Type _val, Type _min, Type _max, float width, float height) ``` -------------------------------- ### setup(string haarFile) Source: https://openframeworks.cc/documentation/ofxOpenCv/ofxCvHaarFinder Loads a Haar cascade file into the finder, required before using the finder with images. ```APIDOC ## void ofxCvHaarFinder::setup(string haarFile) This loads a Haar cascade file into the finder. This needs to be done before the Haar finder can be used with images. ``` -------------------------------- ### setup(const ofxOscSenderSettings &settings) Source: https://openframeworks.cc/documentation/ofxOsc/ofxOscSender Sets up the sender with the provided settings object. ```APIDOC ## setup(const ofxOscSenderSettings &settings) ### Description Sets up the sender with the provided settings object. ### Parameters #### Path Parameters - **settings** (const ofxOscSenderSettings &) - The settings to configure the sender. ### Returns - **bool**: true on success, false otherwise. ``` -------------------------------- ### startPipeline Source: https://openframeworks.cc/documentation/video/ofGstUtils Starts the GStreamer pipeline. ```APIDOC ## bool ofGstUtils::startPipeline() ### Description Starts the GStreamer pipeline. ### Method bool ### Parameters None ```