[][src]Struct purezen::message::object::Object

pub struct Object { /* fields omitted */ }

Message objects

Methods

impl Object[src]

Important traits for &'_ mut I
pub fn new<A>(allocator: &mut A) -> &mut Self where
    A: Allocator<Self>, 
[src]

Create a new message object

pub fn get_connection_type(&self, _outlet_index: Index) -> Type[src]

Returns the connection type of the given outlet

pub fn should_distribute_message_to_inlets(&self) -> bool[src]

Returns true if this object should distribute the elements of the incoming message across the inlets.

A message is otherwise only distributed if the message arrivs on the left-most inlet and has more than one inlet. This function returns true by default and should be overridden to return false if this behaviour is not desired (e.g. as in the element::Type::of the line object).

This behaviour is set to false for all DspObject objects.

pub fn receive_message<'pd, N>(
    &self,
    inlet_index: Index,
    message: &Message<'pd, N>
) where
    N: ArrayLength<Atom<'pd>>, 
[src]

The generic entrypoint of a message into an object.

This function usually either passes the message directly to process_message in the element::Type of an object which only processes messages, or queues the message for later processing.

pub fn send_message<'pd, N>(
    &self,
    context: &mut Context<'pd>,
    outlet_index: Index,
    message: &Message<'pd, N>
) where
    N: ArrayLength<Atom<'pd>>, 
[src]

Sends the given message to all connected objects at the given outlet index.

This function can be overridden in order to take some other action, such as additionally scheduling a new message as in the case of MessageMetro.

pub fn process_message<'pd, N>(
    &self,
    _inlet_index: Index,
    _message: &Message<'pd, N>
) where
    N: ArrayLength<Atom<'pd>>, 
[src]

The message logic of an object

pub fn add_connection_from_object_to_inlet(
    &mut self,
    message_obj_id: Id,
    outlet_index: Index,
    inlet_index: Index
) -> Result<(), Error>
[src]

Establish a connection from another object to this object

pub fn add_connection_to_object_from_outlet(
    &mut self,
    message_obj_id: Id,
    inlet_index: Index,
    outlet_index: Index
) -> Result<(), Error>
[src]

Establish a connection to another object from this object

pub fn remove_connection_from_object_to_inlet(
    &mut self,
    message_obj_id: Id,
    outlet_index: Index,
    inlet_index: Index
) -> Result<(), Error>
[src]

Remove a connection from another object to this object.

This function does not remove the connection reference at the connecting object. It must be removed separately.

pub fn remove_connection_to_object_from_outlet(
    &mut self,
    message_obj: Id,
    inlet_index: Index,
    outlet_index: Index
) -> Result<(), Error>
[src]

Remove a connection to another object from this object.

This function does not remove the connection reference at the connecting object. It must be removed separately.

pub fn get_incoming_connections(&self, inlet_index: Index) -> &List[src]

Get incoming connections

pub fn get_outgoing_connections(&self, outlet_index: Index) -> &List[src]

Get outgoing connections

pub fn get_num_inlets(&self) -> usize[src]

Get the number of message inlets

pub fn get_num_outlets(&self) -> usize[src]

Get the number of message outlets

pub fn get_object_type() -> Type[src]

Get the type of this object

pub fn get_coordinates(&self) -> Coordinates[src]

Get the position of an object on a graphical canvas.

pub fn set_coordinates(&mut self, coordinates: Coordinates)[src]

Set the position of an object on a graphical canvas.

pub fn is_leaf_node(&self) -> bool[src]

Returns true if this object is a leaf in the Pd tree. false otherwise.

This function is used only while computing the process order of objects. For this reason it also returns true in the cases when the object is send, send~, or throw~.

pub fn reset_ordered_flag(&mut self)[src]

Reset the is_ordered flag to false. This is necessary in order to recompute the process order.

pub fn update_incoming_message_connection(
    &self,
    _message_obj_id: Id,
    _old_outlet_index: Index,
    _inlet_index: Index,
    _new_outlet_index: Index
)
[src]

Analogue of update_outgoing_message_connection, but for incoming messages

pub fn update_outgoing_message_connection(
    &self,
    _message_obj_id: Id,
    _old_inlet_index: Index,
    _outlet_index: Index,
    _new_inlet_index: Index
)
[src]

The destination inlet of an outgoing message connection can change if an inlet object in a graph is moved (and the inlet ordering changes).

The connection index change has no effect on the graph ordering and thus it is not necessary to remove and readd a connection.

However, the connection must be updated such that message will still be addressed to the correct inlet.

Trait Implementations

impl Allocated for Object[src]

Trait implemented by all types that can be used by this allocator

type Id = Id

Identifier type for this allocatable value

impl Debug for Object[src]

Auto Trait Implementations

impl Send for Object

impl Sync for Object

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T[src]

type Output = T

Should always be Self