If you want a label to show the name of the last changed modulator, you can do that by selecting a special property on the label component
“Label displays last changed modulator”
and the property
“When displaying last changed modulator, use this format” describes what should be shown in the label:
%N – components visible name
%s – components text (if any)
%v – modulator value
%h – modulator value in HEX
%x – modulator’s midi message in HEX
%g – modulator’s group name (if any)
In order to display date and time, you need to write a Lua script and attach it to some atcion, or display it using a timer, this is a bit more complex task to do. Bo to get you started, create a Button component and find the property “Called when the modulator value changes”, click on the “new” icon, give the method a name, selecte the new method from the combo so it’s associated with the component, and then click the edit button. The Lua editor will open up and you can write a piece of Lua that will run when you click this button.
(assuming you called your method myNewMethod, it could look like this)
--
-- Called when a modulator value changes
-- @mod http://ctrlr.org/api/class_ctrlr_modulator.html
-- @value new numeric value of the modulator
--
myNewMethod = function(mod, value)
s = Time.getCurrentTime():toString(true,true,true,true)
panel:getComponent("timeAndDateLabel"):setText (s)
end
Now if you have a label on your panel called “timeAndDaateLabel”, after you click the button it should show the current date and time (something like 10 Sep 2014 12:59:18).
To get the details on the Time object in Lua, have a look at the Juce docs: http://www.juce.com/juce/api/classTime.html
I’m attaching an example panel below.
-
This reply was modified 9 years, 7 months ago by atom.
Attachments:
You must be
logged in to view attached files.