renoise.Document.ObservableStringList
A observable list of number values.
- Functions
- to_string(self)
- from_string(self, string :
any
) - size(self)
- has_notifier(self, notifier :
ListNotifierFunction
) - add_notifier(self, notifier :
ListNotifierFunction
) - remove_notifier(self, notifier :
ListNotifierFunction
|ListNotifierMemberContext
) - property(self, index :
integer
) - find(self, start_pos :
integer
, value :number
) - insert(self, pos :
integer
, value :number
) - remove(self, pos :
integer
) - swap(self, pos1 :
integer
, pos2 :integer
)
- Local Aliases
Functions
to_string(self)
->
string
Serialize an object to a string.
from_string(self, string : any
)
->
string
Assign the object's value from a string - when possible. Errors are silently ignored.
size(self)
->
integer
Returns the number of entries of the list.
has_notifier(self, notifier : ListNotifierFunction
)
Checks if the given function, method was already registered as notifier.
add_notifier(self, notifier : ListNotifierFunction
)
Register a function or method as a notifier, which will be called as soon as the observable lists layout changed. The passed notifier can either be a function or a table with a function and some context (an "object") -> method.
remove_notifier(self, notifier : ListNotifierFunction
| ListNotifierMemberContext
)
Unregister a previously registered list notifier. When only passing an object, all notifier functions that match the given object will be removed. This will not fire errors when no methods for the given object are attached. Trying to unregister a function or method which wasn't registered, will resolve into an error.
property(self, index : integer
)
->
renoise.Document.ObservableString
?
List item access by index. returns nil for non existing items.
find(self, start_pos : integer
, value : number
)
Find a value in the list by comparing the list values with the passed value. The first successful match is returned. When no match is found, nil is returned.
insert(self, pos : integer
, value : number
)
->
renoise.Document.ObservableString
Insert a new item to the end of the list when no position is specified, or at the specified position. Returns the newly created and inserted Observable.
remove(self, pos : integer
)
Removes an item (or the last one if no index is specified) from the list.
swap(self, pos1 : integer
, pos2 : integer
)
Swaps the positions of two items without adding/removing the items. With a series of swaps you can move the item from/to any position.
Local Aliases
ListElementAdded
{ index : integer
, type : "insert"
}
ListElementChange
ListElementAdded
| ListElementRemoved
| ListElementsSwapped
ListElementRemoved
{ index : integer
, type : "removed"
}
ListElementsSwapped
{ index1 : integer
, index2 : integer
, type : "swapped"
}
ListNotifierFunction
(change : ListElementChange
)