Home › Forums › General › Programming › Advice before starting the project.
- This topic has 54 replies, 3 voices, and was last updated 12 years, 3 months ago by atom.
-
AuthorPosts
-
January 11, 2012 at 8:32 pm #3661
no Ctrlr has no dependencies on any .net or any other framework.
January 11, 2012 at 10:12 pm #3662ok sorry, now I understand why.
"table", in another of my methods, had been reassigned, and since the variables are propagated, it pointed to it, not to the original function of the library.so my mistake, not a bug, sorry for the inconvenience
an advice for all the fools like me
I think that for safety you should not name the "table" with the name, table, or it will reassign another function to it.January 12, 2012 at 7:35 pm #3663Thanks for your patience atom.
I would now like to ask you, I have not found any way to get a list of files in a folder.
I was trying out the functions of the library "os" the LUA, but again I think that it is not present.
This time I tried it with a blank panel … ” title=”Smile” />
or can I use something else?January 12, 2012 at 10:24 pm #3664I didn’t bind the needed methods to do this, but i’ll add them in the new nightly build (i didn’t add them cause they require table operations). This is how to get a list of files in c: in the new nightly:
[code:16jkc61m]
t = {}
f = File("c:\") — create a file that points to the directory we want to list
f:findChildFiles (t, File.findDirectories, false, "*") — search the file for directories only, don’t recurse
for i,v in ipairs(t) do console(v:getFullPathName()) end — print each found element in the table
[/code:16jkc61m]January 13, 2012 at 8:15 am #3665Really Thank You.
I’m trying to create a panel to serve as a listbox in lua, so far looks nice, a little difficult to manage all mouse events, but we try.January 13, 2012 at 5:03 pm #3666There is a ready ListBox component in JUCE i can bring to Ctrlr, there are also ready FileListBoxes and other stuff, but i’d need to have a reason to add those. If you can give me one i’ll add it.
January 13, 2012 at 11:50 pm #3667"atom":3axjh3nf wrote:There is a ready ListBox component in JUCE i can bring to Ctrlr, there are also ready FileListBoxes and other stuff, but i’d need to have a reason to add those. If you can give me one i’ll add it.[/quote:3axjh3nf]
I try
"atom":3axjh3nf wrote:…The objective here is to make Ctrlr a bit more like a librarian program….[/quote:3axjh3nf]
I can find a reason in your words in one of your posts …
I do think that people who go to have a controller software for a hardware is pushed first to have the ability to save and categorize your presets on disk,
so a good graphics support, then to have the ability to browse, retrieve and save these files, all this will be easier to give CTRLR also as a good librarian program.I do not know how much work it takes, but it would be a nice feature.
I was attractive?
January 14, 2012 at 12:10 am #3668This job is for the program manager witch i’m doing at the moment, it’s a complicated task but it will be a part of Ctrlr. I can imagine having files loaded as Waveforms/Samples into synthesizers (like the Evolver or the Blofeld) at those are stored in files and maybe some sort of a FileBrowser component would be useful.
January 14, 2012 at 11:59 pm #3669Well then, we expect in future releases.
thanks, atom.January 16, 2012 at 5:42 pm #3670"atom":1kknlnro wrote:I didn’t bind the needed methods to do this, but i’ll add them in the new nightly build (i didn’t add them cause they require table operations). This is how to get a list of files in c: in the new nightly:
[code:1kknlnro]
t = {}
f = File("c:\") — create a file that points to the directory we want to list
f:findChildFiles (t, File.findDirectories, false, "*") — search the file for directories only, don’t recurse
for i,v in ipairs(t) do console(v:getFullPathName()) end — print each found element in the table
[/code:1kknlnro][/quote:1kknlnro]
thanks for this.
it works well, but I think I’m missing something else in the management of data in lua.
how to make this code work?[code:1kknlnro]t = {} — it store userdata
myfile = File("") — empty file ???
f = myfile.getSpecialLocation(File.userApplicationDataDirectory) — C:Users<username>AppDataRoaming
f:findChildFiles (t, File.findFilesAndDirectories, false, "/Ctrlr/*") — find and assign result to table "t"for k,v in pairs(t) do
getPathLine = v:getFullPathName() — get value but is always userdata
console(getPathLine)
console(type(getPathLine))
— how get value from userdata ??? getPathLine:getObject / not work
graphics:drawText (getPathLine, 10, 0, 100, k*40, Justification(1) ,true) — of course, does not work, It takes a userdata value in "getPathLine"
end[/code:1kknlnro]January 16, 2012 at 6:11 pm #3671what sort of data do you want to get, read the file contents or draw the file path somewhere ?
January 16, 2012 at 6:42 pm #3672Actually know how to do both, it would help.
This is what I’m trying to make. [attachment=0:1yyhqwru]Lua_List_Box.gif[/attachment:1yyhqwru]
January 16, 2012 at 6:48 pm #3673Don’t bother with that i’ll add a list box component in the next nightly it’s just a waste of your time.
In your code,
I think you need to convert the strings to lua strings using stringToLua() function
[code:346ryv3b]
graphics:drawText (stringToLua(getPathLine), 10, 0, 100, k*40, Justification(1) ,true)
[/code:346ryv3b]January 17, 2012 at 3:36 pm #3674Hehe I missed this: stringToLua
Ok I downloaded the latest nightly and I saw that you started the support of the ListBox, as a component. Great.But in the custom component, the callback does not seem to work, for double clicks and key pressed.
January 17, 2012 at 4:05 pm #3675i’ll fix those calls in the customComponent, there is also a fileListBox for browsing files give that a try (it’s a treeView based file browser i’ll also add a ListBox based file browser)
-
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.