HISE Logo Forum
    • Categories
    • Register
    • Login

    A couple of expansion questions

    Scheduled Pinned Locked Moved General Questions
    expansionspaint routinepreset browser
    76 Posts 4 Posters 448 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rzrsharpeprod @d.healey
      last edited by

      @d-healey said in A couple of expansion questions:

      Ok, we'll investigate that later. Probably a simple fix.
      Thankyou, do you need another snippet or is the one further up here ok? Nothing much has changed so I think it probably will be ok.

      @d-healey said in A couple of expansion questions:

      Take a break, come back to it in a couple of days. If I find some time I'll try and make a video about child panels. I think you need one of those moments that triggers something and it will suddenly all click into place.

      You're right but that's exactly what I did when I couldn't crack this after a couple of days. That has just ended up ramping up the pressure on me to get this done as now I have less time to get it built due to the days spent basically idling.

      Yeah I agree re a trigger moment. You have done so much already and I appreciate it but would you be able to post a snippet of how you would add a label or the hover to the child panels so I can at least get my head around it and see how it should be done. I can at least then extrapolate it out to try and get some other parts of the project ticked off. Right now the only thing that is ticked off is me haha

      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @rzrsharpeprod
        last edited by

        @rzrsharpeprod said in A couple of expansion questions:

        You have done so much already and I appreciate it but would you be able to post a snippet of how you would add a label or the hover to the child panels

        Do you know how to do it for a panel - a regular panel?

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        R 1 Reply Last reply Reply Quote 0
        • R
          rzrsharpeprod @d.healey
          last edited by

          @d-healey said in A couple of expansion questions:

          @rzrsharpeprod said in A couple of expansion questions:

          You have done so much already and I appreciate it but would you be able to post a snippet of how you would add a label or the hover to the child panels

          Do you know how to do it for a panel - a regular panel?

          Yes, I was messing with hovering the other day when I was toying with using panels as buttons.

          With the label I would either add it via code the correct way or sometimes just create a label and attach it to the panel in the component list for speed.

          But this goes back to me just not getting it when it comes to the child panels and the fact that they are dynamic, can be 1 or many and all have different positions etc. I am just not understanding how it works hence me asking for the example. I just don't get it and the more I try the more I get annoyed with myself for not getting it.
          I don't think the penny is going to drop until I see it working and can pull apart the code to understand it...and then I am going to feel like a fool for not getting it sooner. But at least then I will get it.
          I'll happily take being a fool who understands it over a frustrated fool who doesn't

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @rzrsharpeprod
            last edited by

            @rzrsharpeprod I've updated the snippet and added some more comments that might help

            HiseSnippet 1718.3ocsWs0aaaCEVJMZaxaEXcXOtGHB1vja7braaRJVVQyklzZrbwnN8xaEzRzVbQlTPjNNFEc6OxdX+D2+fsygTxR1wsqHX0OHXxyE9ctxC6lICYJkLyws14SSYNtekWuoBc7AwTtvoySbb+NutTAKgjRyXBMgJhHgw7jHxq5z0Y+ooTkhE435dqmhR35upi42e+38oITQHqbKGmWJ4gri4i35xc6t6uxSRNhFwNmOpB2OX2NgRwAxD4X.c2xqkSJM7B5P1oTjsU7bdFUE63dWO58ZytWzl8u+1au4.VqM2rEay1a2ht0fVOHZvC2Zy62ue6H1VNte1gQbsLqmlpYJG2U2WFMsWrbhvd.ujq38SX3h1N8fS1t8QxjHzDwccN.s8tEtMkCnktkNwaYcheq2I7H9r8Kclesg.oThpNP2UlGd2ZN30tJ7ZUAdKARtUfzpVHcGudgY7TcIEDOeoWGglkMfBwopPwxqyJM88NPBbHzMGQufcTFrXlDAa0pUCB7o9N0pAwJklb5KN4MG95t6cZuNmcZOxi.p6P1XCx4wbEYBDmI8YDcLiHFOpOKiHGPXWkREJNHdEcbvYGiR+.ivmNi2PYx3QyX7j8d9S6bJvVa6gzCRPXvAnmvXhBdMIrYxIpBHdIMijJRdZFOBDsv5FxzGHGkJEvhf0xouFZXargMcOEqBpwEIbAiLXrHTCXlDlwffkMBfLnBpW6sD3WM7ShLjl.1cjNFNqfb0hG1qv8BpS9obqnNYiRCuXycpnDvg8bvJ.0bBUG2LjwSBVvaWpg5UkLlwGFqAAM3XGDaFpCjYj.Nr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tcRReumvTWnkoFdymYxw8y+HO5qJO1N6Ns5BSl9rM18O10lyVcGUHF01mlACTFdg.7EkJ362cY341Ey8hIO4PIOwsJTbbp.k1K.k+52WDJO6O209dnJGXoI5b8wugA+kQiSn54eM.9lobBP90bifiiYCyEqmV8MU+u8DgOVHdGutbcX7xw3JKAiPFzmBLl+vpa6cHLkWntDfq5czq+z7JJG6.KCglpYbHUwCdGRO395PnaDUfshf8bWAqDsqagqQOPOlHxr3efe4DaiqcyI1tfnyHJjQ+lPa8K9zsuvrCfIg4Yt9dmfqIsudI6H3kjuILbdUcMAu2MUv6eSE7A2TA27lJ3V2TA29lJ3C+uEDen+di0xQ1xFGmS5dnoEqq6gloxMYqN+KXFU+GF
            

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            R 2 Replies Last reply Reply Quote 0
            • R
              rzrsharpeprod @d.healey
              last edited by

              @d-healey Thankyou it is much appreciated. I will go through and have a look and try to figure it out

              1 Reply Last reply Reply Quote 0
              • R
                rzrsharpeprod @d.healey
                last edited by

                @d-healey ok the universal paint routine stuff makes sense and is how I would get around the hover, drop shadow and other shared requirements I think so thankyou for that.

                But what I still don't understand is how I would set individual, unique text labels for each panel as I am still not getting how to interact with the child panels due to their dynamic nature.
                Your example shows how to do something to all child panels or even set each one to be different so it has a unique number as the text.
                But how can I make panel 1 always say the unique text that I want it to and the same for panel 2, panel 3 etc.

                That is really where I am struggling most and maybe I haven't asked the right question or explained what I am struggling with very well?
                Do I need to write out code for each potential child panel in order for me to allow each one to have the unique text I am looking for? If index is 0 then do this, if index is 1 then do this etc etc?
                The text isn't stored anywhere like the Icon pngs are so can't be called that way I don't think as it is more than just the expansion name that I want to set for each child panel.

                d.healeyD 1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @rzrsharpeprod
                  last edited by

                  @rzrsharpeprod said in A couple of expansion questions:

                  But how can I make panel 1 always say the unique text that I want it to and the same for panel 2, panel 3 etc.

                  Can you give me an example of the text you want to apply?

                  Libre Wave - Freedom respecting instruments and effects
                  My Patreon - HISE tutorials
                  YouTube Channel - Public HISE tutorials

                  R 1 Reply Last reply Reply Quote 0
                  • R
                    rzrsharpeprod @d.healey
                    last edited by

                    @d-healey said in A couple of expansion questions:

                    Can you give me an example of the text you want to apply?

                    Sure, so it would be 2 rows at the bottom of the panel with line 1 being the expansion name and then a line underneath that is more descriptive.

                       Expansion Name
                    Dark - Gritty - Trap
                    

                    As an example

                    Hope that makes sense?

                    d.healeyD 1 Reply Last reply Reply Quote 0
                    • d.healeyD
                      d.healey @rzrsharpeprod
                      last edited by

                      @rzrsharpeprod In the loop where we create the child panels you are able to get a reference to each expansion, that will give you the name, you can set this as the child panel's text - the same as in the example where I'm setting the child panel's text to i.

                      For the description I think you might also be able to pull that information from the expansion and then you can set it as a data property of the child panel.

                      Libre Wave - Freedom respecting instruments and effects
                      My Patreon - HISE tutorials
                      YouTube Channel - Public HISE tutorials

                      R 1 Reply Last reply Reply Quote 0
                      • R
                        rzrsharpeprod @d.healey
                        last edited by

                        @d-healey said in A couple of expansion questions:

                        For the description I think you might also be able to pull that information from the expansion and then you can set it as a data property of the child panel.

                        I need to stop asking new questions and try to solve the ones I still don't know the answers to first lol But how would I pull that data from the expansion? Where would the data live? In the expansion XML file or a separate txt file?

                        Did you manage to have a look at why the images weren't loading for the child panels?

                        Finally so that I don't resort back to my temporary solution of fixed buttons as I would really rather build off this grid now it is getting somewhere, how on earth do I make it so when you click on child panel 1 it loads expansion 1, clicking on child panel 2 loads expansion 2 etc etc? This is still part of the same issue of me not understanding child panels clearly.

                        Once I have that part working I can at least start work on trying to figure out how to get the UI to display correctly when set expansion is called as it sounds like you think that should be enough to get it to display correctly?

                        d.healeyD 1 Reply Last reply Reply Quote 0
                        • d.healeyD
                          d.healey @rzrsharpeprod
                          last edited by d.healey

                          @rzrsharpeprod said in A couple of expansion questions:

                          But how would I pull that data from the expansion?

                              for (i = 0; i < NUM_EXPANSIONS; i++)
                              {
                          		local e = expList[i]; // Get a reference to the expansion
                          		local expansionData = e.getProperties();
                          		local expansionName = expansionData.Name; // Get the expansion name
                          		
                          		Console.print(trace(expansionData)); // Output all of the available data to the console	
                          

                          Check the API browser for all of the available expansion functions.

                          This is what I'm doing in Rhapsody to put all expansion properties into the child panel's data object.

                          local props = e.getProperties();
                          
                          for (x in props)
                              cp.data[x] = props[x];
                          

                          @rzrsharpeprod said in A couple of expansion questions:

                          Did you manage to have a look at why the images weren't loading for the child panels?

                          Nope, not important yet. We'll solve that later, one issue at a time.

                          I just took another look at your snippet. I don't see anywhere that you are loading the image into the panel.

                          @rzrsharpeprod said in A couple of expansion questions:

                          how on earth do I make it so when you click on child panel 1 it loads expansion 1, clicking on child panel 2 loads expansion 2 etc etc?

                          You have an array of expansions (expList) and you have an array of child panels (stored in the parent panel). In the mouse callback of the child panel, you find out its index in the parent panel's array, and use this to find the corresponding expansion in expList.

                          Edit: Actually you can do it in an even simpler way if you're already storing the expansion name with the child panel, because all you need to load the expansion is its name.

                          Libre Wave - Freedom respecting instruments and effects
                          My Patreon - HISE tutorials
                          YouTube Channel - Public HISE tutorials

                          R 1 Reply Last reply Reply Quote 0
                          • R
                            rzrsharpeprod @d.healey
                            last edited by

                            @d-healey said in A couple of expansion questions:

                            I just took another look at your snippet. I don't see anywhere that you are loading the image into the panel.

                            Sorry was in a meeting. It isn't in the most recent one as I think it got removed when you did the hover and numbering in the one late last night. It is in this one though and just gives the error

                            HiseSnippet 1485.3ocsWstaaTDEd2jrPsgJQQ7.LXIpV235XWZnfBU3bwoXQShUbuIUUplt6X6QY2YVs63DaPvq.7.vO3e71vqA+k2.3blYuYWmpV2V+mj4ba9lu4bNyY6GK8XIIxXK6JOXVDyx9icFLSnFu+XJWX06.K6q4buXtOgGRGwRHOtWeq8lEQSRX9V11qeOzL6JaXo+8ue2dz.pviUHxx5QRtG697PtpPZ+N+.OH3PpO6A7vRVe6N87jh8kAxI.jV2okUD06LXmOlhlslik8Gz0mqj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WZ9QWwCIk8DPaAZ.+mXUWXe1g.pOU6bBA55O2qAUWRG+cpVtxF3v7SfTbrTwNQXp2g5AxhpFNbo5v2eikA5GBWhZbXp3WkiX6nWvha.OGFLgkaHLgw7is3b4isTdpJOy3.kLTJPB7jHl3xl0xJcFBbDmTTAlpzC37ooC3v7eDmcQjLVYwgYYp3bdjBuTszvt7vkVOr2ATEMKXPbK5NAxNfcNL7oY5oJNGvRNSIiz1lN7hk8G9Zt0SK11eryrxKzIv4B98eqiIUNWxe9qcR7vas8nwOXL26LAvEvfrNsa0r0RAyUyFzCyjRwQZdcYbXYUBGsW.GcJii+4OR96u4uXchzY7k1vhym0KOuILoqzeR.UM+3u3L+oJfjq4l4DmqDdMRMq72D7Nal3WWHdMm9bk23kiw0VBFgzm2GXL8KItpS2gCYdpB.tgygO48ymMXYdibDzlOlCoJNGOIb.7wTdPqIp.6KAxrWCKCMqagqQFX.S3qW7evuTksw01oJamozJjBoyO2yT7heqxUzR.LIzelVEmiv0j1Y0qNNXldH7YSO2yCO92D5Lrbet0J3yWtB9b6UvmsWAe9pUvm6rB970uRevuXc2IJYnob.DzuqtuoscWAExrzYgV++e3KI.
                            

                            @d-healey said in A couple of expansion questions:

                            Check the API browser for all of the available expansion functions.

                            Ah ok so there are tags I can use by the looks of it as there is a tags property that is currently empty and I can see the tags element in the expansions info XML file now that I have looked.

                            @d-healey said in A couple of expansion questions:

                            You have an array of expansions (expList) and you have an array of child panels (stored in the parent panel). In the mouse callback of the child panel, you find out its index in the parent panel's array, and use this to find the corresponding expansion in expList.

                            Edit: Actually you can do it in an even simpler way if you're already storing the expansion name with the child panel, because all you need to load the expansion is its name.

                            I see the array for the child panels and the objects (childPanels[0],[1] etc) but how can I tie an action to those? That's what I am asking really. Am I using object under mouse?
                            Do I need to write a code along the lines of if object under mouse is [0] then do this, if object is [1] then do that and do this for all possible expansions up to say 30?

                            d.healeyD 1 Reply Last reply Reply Quote 0
                            • d.healeyD
                              d.healey @rzrsharpeprod
                              last edited by

                              @rzrsharpeprod not at the computer at the moment so I'll give a proper reply later.

                              Think of it like this, if you had one panel and one expansion, how would you achieve what you want?

                              Libre Wave - Freedom respecting instruments and effects
                              My Patreon - HISE tutorials
                              YouTube Channel - Public HISE tutorials

                              R 1 Reply Last reply Reply Quote 0
                              • R
                                rzrsharpeprod @d.healey
                                last edited by

                                Ok I just figured out how to get the expansion name as the text name for the child panel, I also added the tags in Hise (not the XML file) and can set the text as one or the other (or both concatenated).
                                Now that is loading, how can I set them as 2 separate lines one under the other as they need different font sizes and colours.

                                @d-healey said in A couple of expansion questions:

                                @rzrsharpeprod not at the computer at the moment so I'll give a proper reply later.

                                Think of it like this, if you had one panel and one expansion, how would you achieve what you want?
                                I don't know with expansions as they are not acting the same as normal presets. With none expansions projects I would just load an image or even attach one to the panel but because of the dynamic number of child panels I can't just call 1 directly and hardcode it for each. I think I have to use the wildcard reference and that seems to not be working unless it's tied to the preset browser where it works fine.

                                For the mouse callback it would be easier as I could write a control callback directly referencing the panel. If event clicked do this.
                                I can't do that or more specifically don't know how to do that with the child panels and that's what I am asking for really, how do I do it?

                                @rzrsharpeprod said in A couple of expansion questions:

                                Do I need to write a code along the lines of if object under mouse is [0] then do this, if object is [1] then do that and do this for all possible expansions up to say 30?

                                Is this the only way to do it?

                                d.healeyD 1 Reply Last reply Reply Quote 0
                                • d.healeyD
                                  d.healey @rzrsharpeprod
                                  last edited by d.healey

                                  @rzrsharpeprod said in A couple of expansion questions:

                                  Now that is loading, how can I set them as 2 separate lines one under the other as they need different font sizes and colours.

                                  This is just regular paint routine stuff, I have a few videos about paint routines. Make yourself a paint routine sandbox project and play around.

                                  @rzrsharpeprod said in A couple of expansion questions:

                                  For the mouse callback it would be easier as I could write a control callback directly referencing the panel. If event clicked do this.

                                  You have a reference to the panel that was clicked within the mouse callback already (this). That's how I'm doing the hover action.

                                  @rzrsharpeprod said in A couple of expansion questions:

                                  Is this the only way to do it?

                                  I don't really know what your saying there, so probably not. You can see how I've implemented the hover action, so you just need to add your click event in the mouse callback too.

                                  @rzrsharpeprod said in A couple of expansion questions:

                                  orry was in a meeting. It isn't in the most recent one as I think it got removed when you did the hover and numbering in the one late last night. It is in this one though and just gives the error

                                  You have not loaded the images into the panels. Start with one regular panel and one expansion, and make it all work. Once you have this you can tackle it with child panels - which is basically the same thing, but overcomplicates it and makes it seem confusing.

                                  Libre Wave - Freedom respecting instruments and effects
                                  My Patreon - HISE tutorials
                                  YouTube Channel - Public HISE tutorials

                                  R 1 Reply Last reply Reply Quote 0
                                  • R
                                    rzrsharpeprod @d.healey
                                    last edited by

                                    @d-healey said in A couple of expansion questions:

                                    You have not loaded the images into the panels. Start with one regular panel and one expansion, and make it all work. Once you have this you can tackle it with child panels - which is basically the same thing, but overcomplicates it and makes it seem confusing.

                                    Is this

                                    if (isDefined(imageList[i]) && imageList[i] != "")
                                    g.drawImage(imageList[i], [x, y, width, height], 0, 0);
                                    

                                    and this

                                    loadImages();
                                    

                                    not doing that?
                                    Regardless the error messages I'm getting are

                                    {EXP::ExpansionName}Icon.png not found
                                    

                                    for each expansion so it looks like it isn't even finding the images to load either way or have I misunderstood the error?

                                    @d-healey said in A couple of expansion questions:

                                    This is just regular paint routine stuff, I have a few videos about paint routines. Make yourself a paint routine sandbox project and play around.

                                    So it is possible to set 2 separate lines of text? I can then set the position of each through paint routines.
                                    I wasn't sure if you could set 2 separate text items or if it would have to be 1 with a carriage return or something similar?

                                    @d-healey said in A couple of expansion questions:

                                    I don't really know what your saying there, so probably not. You can see how I've implemented the hover action, so you just need to add your click event in the mouse callback too.

                                    What I mean is the hover isn't really distnguishing between an end action, regardless of what child panel it is hovering over it is doing the same action. Whereas with the load if it is child panel1 it is doing 1 thing specifically (load exp 1), child panel 2 being clicked would load exp 2 and so on.
                                    Its that unique end action that I can't get my head around. I hope that makes sense?

                                    d.healeyD 1 Reply Last reply Reply Quote 0
                                    • d.healeyD
                                      d.healey @rzrsharpeprod
                                      last edited by d.healey

                                      @rzrsharpeprod said in A couple of expansion questions:

                                      Is this

                                      if (isDefined(imageList[i]) && imageList[i] != "")
                                      g.drawImage(imageList[i], [x, y, width, height], 0, 0);

                                      and this

                                      loadImages();

                                      Nope, loadImages there is a function you wrote, so don't let the name mislead you into thinking it actually loads images into panels.

                                      Go watch my video about using images with panels, you have to load the image into the panel before you can use it in the paint routine.

                                      @rzrsharpeprod said in A couple of expansion questions:

                                      So it is possible to set 2 separate lines of text? I can then set the position of each through paint routines.
                                      I wasn't sure if you could set 2 separate text items or if it would have to be 1 with a carriage return or something similar?

                                      • set the colour
                                      • draw a line of text
                                      • set another colour
                                      • draw another line of text
                                      • etc.

                                      @rzrsharpeprod said in A couple of expansion questions:

                                      Whereas with the load if it is child panel1 it is doing 1 thing specifically (load exp 1), child panel 2 being clicked would load exp 2 and so on.

                                      Loading the expansion is also the same action for all child panels. The only thing that needs to change is the name of the expansion you are loading, and you can get that from the child panel itself (this) because you've stored it as the child panel's text - or you can do it using the array method I mentioned earlier, but I think the text method is the way I would go.

                                      @rzrsharpeprod said in A couple of expansion questions:

                                      Its that unique end action that I can't get my head around. I hope that makes sense?

                                      I see the misunderstanding here. The action is not unique, it's the same for all the children. The expansion name that you pass to the loadExpansion function is unique.

                                      I think you're getting close to that trigger moment :)

                                      Libre Wave - Freedom respecting instruments and effects
                                      My Patreon - HISE tutorials
                                      YouTube Channel - Public HISE tutorials

                                      R 1 Reply Last reply Reply Quote 0
                                      • R
                                        rzrsharpeprod @d.healey
                                        last edited by

                                        @d-healey said in A couple of expansion questions:

                                        I think you're getting close to that trigger moment :)

                                        I hope so! Maybe I am as even as I was writing that I thought I bet I can set expansion name using the variable so it is kind of the same action for each one.

                                        @d-healey said in A couple of expansion questions:

                                        set the colour
                                        draw a line of text
                                        set another colour
                                        draw another line of text
                                        etc.

                                        I also had this revelation as well while I was having lunch. I thought I wonder if setting a new colour will allow me to have a new text object and when I cam back you had said something along these lines

                                        @d-healey said in A couple of expansion questions:

                                        Nope, loadImages there is a function you wrote, so don't let the name mislead you into thinking it actually loads images into panels.

                                        Go watch my video about using images with panels, you have to load the image into the panel before you can use it in the paint routine.

                                        I watched one of yours the other day (the one with the cute little piglet) I will go back and rewatch it as I clearly missed something.
                                        Is the cant find Icon.png error misleading then or is it also not finding the image becaus eit isn't loaded?

                                        d.healeyD R 2 Replies Last reply Reply Quote 0
                                        • d.healeyD
                                          d.healey @rzrsharpeprod
                                          last edited by d.healey

                                          @rzrsharpeprod said in A couple of expansion questions:

                                          Is the cant find Icon.png error misleading then or is it also not finding the image becaus eit isn't loaded?

                                          Yes, sort of. Basically the path is correct, but because the image hasn't been loaded into the panel it can't be found within the paint routine.

                                          I can't remember the exact code but basically in the loop where you're creating the child panels you're going to need to do something like:

                                          cp.loadImage(pathToImage, "Icon");
                                          

                                          And then in the paint routine you'll be able to do something like:

                                          g.drawImage("Icon");
                                          

                                          Libre Wave - Freedom respecting instruments and effects
                                          My Patreon - HISE tutorials
                                          YouTube Channel - Public HISE tutorials

                                          R 1 Reply Last reply Reply Quote 0
                                          • R
                                            rzrsharpeprod @rzrsharpeprod
                                            last edited by

                                            @rzrsharpeprod Ok I will have a look and no doubt get back to you. Thankyou.

                                            1 quick thing on the dual line text. In your snippet it uses a text object which I modified to use the expansionName

                                                    cp.set("text", expansionName);
                                            

                                            How do I add a 2nd version? If I do this

                                                    cp.set("text", expansionName);
                                                    cp.set("text", tags);
                                            

                                            Then the 2nd just overrides the first.
                                            I have the 2 lines showing and formatted correctly but it just repeats whatever the last definition of "text" is

                                            I can't add "Text2" as that isn't a valid function.
                                            I tried calling the variables expansionName & tags directly in the drawAlignedText line but it doesn't like that.

                                            d.healeyD 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            34

                                            Online

                                            1.9k

                                            Users

                                            12.4k

                                            Topics

                                            107.8k

                                            Posts