libvisual  0.5.0
Public Member Functions | Static Public Member Functions | Friends | List of all members
LV::Input Class Reference

Public Member Functions

VisPluginData * get_plugin ()
 Returns the plugin object. More...
 
bool realize ()
 Realizes this Input. More...
 
void set_callback (std::function< bool(Audio &)> const &callback)
 Sets a PCM data callback. More...
 
Audio const & get_audio ()
 
bool run ()
 Runs this Input. More...
 

Static Public Member Functions

static InputPtr load (std::string const &name)
 Creates a new Input with a plugin of a given name. More...
 

Friends

void intrusive_ptr_add_ref (Input const *input)
 
void intrusive_ptr_release (Input const *input)
 

Detailed Description

Definition at line 46 of file lv_input.h.

Member Function Documentation

VisPluginData * LV::Input::get_plugin ( )

Returns the plugin object.

Returns
Plugin object

Definition at line 102 of file lv_input.cpp.

InputPtr LV::Input::load ( std::string const &  name)
static

Creates a new Input with a plugin of a given name.

Parameters
nameName of plugin to load
Returns
A new Input, or nullptr on failure.

Definition at line 63 of file lv_input.cpp.

bool LV::Input::realize ( )

Realizes this Input.

Returns
true on success, false otherwise

Definition at line 93 of file lv_input.cpp.

bool LV::Input::run ( )

Runs this Input.

This function will call the plugin upload() method to retrieve audio samples. If a custom callback is set via set_callback(), the callback will be used instead.

Returns
true on success, false otherwise

Definition at line 117 of file lv_input.cpp.

void LV::Input::set_callback ( std::function< bool(Audio &)> const &  callback)

Sets a PCM data callback.

Used for adding a custom upload function.

Note
Setting a callback will bypass the plugin upload() method.
Parameters
callbackCallback

Definition at line 107 of file lv_input.cpp.


The documentation for this class was generated from the following files: