Advice before starting the project.

Home Forums General Programming Advice before starting the project.

Viewing 15 posts - 41 through 55 (of 55 total)
  • Author
    Posts
  • #3661
    atom
    Keymaster
      • Topics: 159
      • Replies: 2945
      • Total: 3104
      • ★★★★★

      no Ctrlr has no dependencies on any .net or any other framework.

      #3662
      Tronic
      Participant
        • Topics: 7
        • Replies: 45
        • Total: 52

        ok 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 :oops:

        an advice for all the fools like me :mrgreen:
        I think that for safety you should not name the "table" with the name, table, or it will reassign another function to it.

        #3663
        Tronic
        Participant
          • Topics: 7
          • Replies: 45
          • Total: 52

          Thanks 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 … <img decoding=” title=”Smile” />
          or can I use something else?

          #3664
          atom
          Keymaster
            • Topics: 159
            • Replies: 2945
            • Total: 3104
            • ★★★★★

            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: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]

            #3665
            Tronic
            Participant
              • Topics: 7
              • Replies: 45
              • Total: 52

              Really 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.

              #3666
              atom
              Keymaster
                • Topics: 159
                • Replies: 2945
                • Total: 3104
                • ★★★★★

                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.

                #3667
                Tronic
                Participant
                  • Topics: 7
                  • Replies: 45
                  • Total: 52
                  "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
                  :geek:

                  "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?
                  :mrgreen:

                  #3668
                  atom
                  Keymaster
                    • Topics: 159
                    • Replies: 2945
                    • Total: 3104
                    • ★★★★★

                    This 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.

                    #3669
                    Tronic
                    Participant
                      • Topics: 7
                      • Replies: 45
                      • Total: 52

                      Well then, we expect in future releases.
                      thanks, atom.

                      #3670
                      Tronic
                      Participant
                        • Topics: 7
                        • Replies: 45
                        • Total: 52
                        "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]

                        #3671
                        atom
                        Keymaster
                          • Topics: 159
                          • Replies: 2945
                          • Total: 3104
                          • ★★★★★

                          what sort of data do you want to get, read the file contents or draw the file path somewhere ?

                          #3672
                          Tronic
                          Participant
                            • Topics: 7
                            • Replies: 45
                            • Total: 52

                            Actually 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]

                            #3673
                            atom
                            Keymaster
                              • Topics: 159
                              • Replies: 2945
                              • Total: 3104
                              • ★★★★★

                              Don’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]

                              #3674
                              Tronic
                              Participant
                                • Topics: 7
                                • Replies: 45
                                • Total: 52

                                Hehe 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.

                                #3675
                                atom
                                Keymaster
                                  • Topics: 159
                                  • Replies: 2945
                                  • Total: 3104
                                  • ★★★★★

                                  i’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)

                                Viewing 15 posts - 41 through 55 (of 55 total)
                                • The forum ‘Programming’ is closed to new topics and replies.
                                There is currently 0 users and 98 guests online
                                No users are currently active
                                Forum Statistics
                                Threads: 2,495, Posts: 17,374, Members: 77,605
                                Most users ever online was 12 on January 22, 2019 3:47 pm
                                Ctrlr