A couple of expansion questions
-
@d-healey Ok I messed around a bit this morning with paint routines and then attempted to add images. I added one at first and then I tried to implement a similar loop to the one drawing the panels.
I am at work right now so don't have access to everything so don't have a project with expansions etc setup but I think this will be the same image called for each panel.
HiseSnippet 1330.3ocsW80aaaCDmJIpaxaEXcXe.HBv.jabcr6ZZ2P1vb9agwZbLha6JvvVAqDcLQjHEnnSrQP6S68sWGvdXeh1Wi859FrcGkjkbpSQm6p.hB3w6N96N9S2ctuVEvSSUZhi2imlvINer6foRyn8FwDRR28QAOTKB6FyNkeWxtSSXoo7PhiypOD0vwaMh84u+1cYQLY.uTDg7TkHf+HQrvTJsemuSDEcHKj+XQbEsuWmtAJ4dpH0X.Mq51hjvBNCN0dLTsUbIN23fPgQoGXXFdJwYscUgSGLRcgLS+mJREuHhiKZSF.NJS7gpnPDwnTxdiDQg8Kh5TB3k9k4fUyxAel6QhPwL4k4hOwtAszhp4CmUlGdqNG7ZWEdsp.uE.ImJPZsLHcK2AAZQhobGDOejaWogqGxfzdUnjoKYke6Ft6o.Mjllwry3GpgEyrvu8c2pUC5CZ0p910pA49TCs2SN54G7r96zaP2i6Mf9Mz1asMcyMoOdjHkdAbuQeAmZFwoxwwufqopgT9jDlLU.lWwG6c7iPqum03dyzMPEMNdlhGsyIOraOPs6aUa.beyA+atfykEpRYxPpVcQZsBHdNSSSjQHoDLsH7Nka1SEmnjvB+0y2ecLv1by.LASATxipIjQBImNbrLv.XlFn4vsU1U.pPpe8ZWRgmZ3qHU.KBh6PyH3r7ycKdXeOJyuN8N4QQc5lkAdgvsq3DHgcBDFfaNhYF0LfKh7uR1tzC0qZ4Ht3zQFvPKN1rcysf6D.fVUFpzTeArYqsoB5WekKPP1FaT2p3k12kdMHALpHfXggko.+7SuTWgLjOAS.B5mWEiddY6i6keYtAnjU6amA25UkjmpJMbZQ5XXjRoA2WIE.56mG5aLKIuwbYVur2AIMS4l9pTAdk5OoAcZirSuQdxq9b5Wy6k0fWEAOXq+5Y5sdiL3Dylje1Mlcwca5UPCBvhM2f1tdcLvp8RfnVwy8gRGlSTiM.qyuf04eZ8YY3KqUyCozuCjLq8+W4WVitNpEjcdqHVdWVyCCBzWWOIwdTKAGwZ26.EAhBuSaNDpZsSTjeqI1BcdYRC0rKr8z7WWf+a8F+vB3M+XCJTgblYuD+Cqo75kQh3Ls8SHMW5mkXrYvIPdgV4Js7yrGIRM90AU8lzTyiUmikmi6yzXEL7DAlzUbqsL4IVcgBiPw3JU1fhpudorsmAPkrmxvOFw1kVVJ8paMb3B2CKvpUQQb8B2F6gqeSF5m0onAvQhFymoHzXa9tktWe2xpMyCxp2WQQkrqTXNNgKutV7j7lDXm0bTApZr8U+z79p7vmJ3WjnzFh.Zg54ddhAuyHVXWclFxS5tOyvJbF3W3rR3Zi.CCm84mCy7j0z1yced5YFUhU27tSDmO3s7nmTdr+TmoUWXIoyD7q+RmL55LI+wq5jFf2Z6xzPq6fyjPt.lexscqlsVHXtYw7EHyIGG4z1p3fPpfi1WAGcphi+7q9qeO8U+bmDKgtxAVFejWeLGX.KU33HlY9otvQMy2.HWyMpCNNCL9gYZ0QQ+eaTr2VHdK29BSvnEiwUV.FA5y6CLlO.6McOX3PdfoDfq4d3yd+LsJIq61oPQZs.nJtv3dCfY3CfRQLIVGBj4rB9YX15V3ZLCLfKCsK9G3Iey13Zm7MaWrIIlAz4mGj8wKNh7GZk.XRZ+0AdtGgqosK9d00EY5wvz5OOH.C+6.UFVrM2cIr4KVBat2RXyVKgM2eIr4AKgMe4azF7GJsyXiJN6yAPP+Cr0McbNPx.lkkER9W.U2c+LB
As you said, babysteps but feels like some progress is being made.
Long term would I need to call individual images to separate child panels or would a loop that is linked to the exp handler read the images inside the expansions in a similar ay to the image based preset browser uses the icon.png inside each expansion?
-
@rzrsharpeprod said in A couple of expansion questions:
would a loop that is linked to the exp handler read the images inside the expansions
That's exactly what you should do. Loop over the expansions when you create the child panels and load the image into each one
-
@d-healey Ok so I am getting somewhere. I can try it in my actual project later - albeit using a new preset so as not to ruin anything. That has expansions and the icon.png in each images folder of the expansions.
-
@d-healey ok this is where it starts to get confusing again.
I tried to implement the load Icon.png from my other project and your tutorial but I just get error messages
Image {EXP::ExpansionName}Icon.png not found
I have edited the error to say ExpansionName as it is doing for each expansion.
Each expansion has Icon.png in it's folder correctly.
I just created a presetbrowser quickly and copied the code in exactly from my other project and it worked for the preset browser so I know that the Icon.png files are ok as they loaded fine in the preset browser.Here is my updated snippet, what do I need to do to get the Icon.png files to populate the child panels please?
HiseSnippet 1520.3ocsW0saaaCElJIpq1aEXcXO.bFXExMdN1IN0MvqXN+3zZrDGi31zBTzUvHQaSDIRAI5D6Uz8Jr8.rK1c6sYuF618FrcnnrjriaVmaW.BR342Od3GO7ntABaZXnH.Yj+oS7oHiOyr2Dtb39CILNp8AHi6Z93.lCl4QFPCwOucWzdS7IggTGjgwpOVYlQt0PQ+7We2dDWB2llJBgNSvroGw7XxToca98LW2CINzmx7xXcslssE78EthQ.jV0rBxmXeAj4NDkYqXhdBIbHx39l02gV+75aW6gatEYmpUs2bGG6ZaVYq5a6rYsG7fyqTcqsp8vyqiLtUKGlTDzSRjzPjwZ6Iblzan3JtNAmwBYm6RUKph5AYVK9PgqiZKpjh1eHy0o6zZUHBhR2zJ2p5J2WZdLygkHOsB94QJvodjs.Zrxrva0YfW0rvqRF3s.HYjARqogzcM6YGv7koZT34SMaykzf9D3bJKTz1hV4V21beAXAWV1ibA8v.XQhGVU2b6Jkv0qToXi742XCLXZnjvkg4sU+G9RR.1m6FQZdDdZfFPk6K77EbXgUgX8EfPj5zw6d5ia2A7oZkrh67rie89mbTOPQMHiZEzw9OgvcboAf3V7ALNsrc.EJgsF6S3gLAOVuURN.eNhA+8QY7VgqDOTZsJNeta8ht61oW6S5zS6oxpxtT9.4P.NAzA5qFwg9kuRWUNRPbvETj4x97AEv8CDdXJwdnJD5zkmwcAbi6OhaKg0XWvm1QWyrJl+M4ykD2x1tTRzNIet9h.rEEy327tn3cxm6Mvu4bE1DW.hCTnW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ugehUVUs1HVY0oJQdDfx+Za8Eb02rb6HI.l3QeeWNyiUqwUu9cZO3Sndss8rg5ZNt4x53VKqi0VVG2dYc7AKqi0WVGe3+tipuvc2QRgm95DBcb2VQ8fMLZwI.aLh4h9GrTa0NN
-
for (e in expHandler.getExpansionList())
You've already saved the expansion list in a const on line 9, so no need to call the function again, just use the variable name
expList
.I would combine the creation of the child panels and the loading of the images.
for (i = 0; i < expList.length; i++) { local e = expList[i]; // Create the child panel local img = e.getWildcardReference("Icon.png"); cp.loadImage(img, "icon"); // Load the image into the child panel }
-
@d-healey I'm still getting the same errors
Interface:! Image {EXP::xxxx}Icon.png not found
I have commented out lines 33 to 35 in the snippet and on compile it creates the panels without images based on the number of installed expansions.
If I remove the commenting out then I get the error above for each expansion.
I have probably put your suggested code in the wrong place but I tried it in a few different places and got the same error each time using this project in the snippet. I really can't see why it isn't reading the Icon.png files, I thought the wildcard reference would point to the path and find the images?HiseSnippet 1473.3ocsW8taaTDD+tjbTrgJQAd.VrDUmSbcrKMTPgJx+bJVj3XE2VpTUoZ6cqsWk618zcqSrAUdEfG.9.ei2FdLfuxa.Lyt2+bpaUqaq+RxN+82L6LyNW+XoGKIQFaYW4dyhXV1enyfYB038GS4BqtGXY+IN2Ml6S5FRGwRHGPOm6as2rHZRBy2x1d06hBZWYMK8u+8a2iFPEdrBRVVOPx8XGwC4pBp82464AAGR8Y2iGVR5asSWOoXeYfbB.pUcZYEQ8NC7cOJJ1JNV1uWGetRFOPQUrDK601S5OavX4EBi7OfmveZ.COz1Z.XHC4CkA9HhQpV6OlG32OK3Sr.qzuHUrpIU7oNGy844zKRIejlAoPix4C6UlGdqNG7ZWFdsJAuE.I6RPZMCjtly.uXdjpfChmOvoqPwhGRgzdYnXj0Zk+9JN6KAIDplgzyXGFCGx0vs8M2pUCxsa0p91Uqt4lDPzDEUnRp5g+G4bZLIRDnqBtCIyPiXp8kgQRAbvsVJ+ZfIJT53cO8tc6A5ztUYx8t+wOY+SNZ.v3VfG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DPt.VF0ocqlsVHXtZ1xZXoTJNRqpKiCKqR3n8kvwNkww+76I+0W+mrchz06kbXQ7Y876LBaqJ8mDPUyuBKt2dJCn3Zt8FwcCgEnTyJuW+as8ZeUg30b5yUdiWLFWYAXDJedWfwzuF3pNcFNj4oJ.3ZNG9v2Mq9aYdfbDL2OlCkJN8lDN.9fHOX1DUfCl.Z1qfsglysvyXFX.S3qO7evuTlswy1oLamwzJjBkyOwyz7heuw6qo.XRn+TqJNGimIsy5WcbvJ8P3SedhmGF92.lLrXct4RnyWrD5bqkPmsVBc9xkPmauD57UuTcvu5b2IJYnoc.HzuidtoscGAEprzUgV+eNG2GO
-
@rzrsharpeprod It might only work once the expansions are compressed
imageList should be a const, not sure you need it though
-
@d-healey with the .hxi created you mean?
Did the code look ok or at least as if it should work?
-
@rzrsharpeprod The code looked good. Yeah with the hxi.
-
@d-healey ok I'll give that a go once I go back up to the laptop in a little while.
Presumably the type of expansion I have chosen won't have made a difference? I just chose encrypted with the standard 1234 encryption.
Presuming that the images then load correctly, how do I go about making the clickable so be that the correct expansion loads when clicked?
-
@rzrsharpeprod said in A couple of expansion questions:
Presumably the type of expansion I have chosen won't have made a difference?
Yeah pretty sure encrypted is the correct one - been a while since I used it.
@rzrsharpeprod said in A couple of expansion questions:
Presuming that the images then load correctly, how do I go about making the clickable so be that the correct expansion loads when clicked?
You can assign a mouse callback to each child panel.
-
@d-healey I just encoded each expansion so there was a .hxi file for each of them, closed HISE and reopened the project but still getting the same error unfortunately
Image {EXP::ExpansionName}Icon.png not found
I really don't know why it isn't working? I have tried various different codes but get the same outcome.
Is this the same method you have used in the past for Rhapsody or have I done something differently to you?@d-healey said in A couple of expansion questions:
You can assign a mouse callback to each child panel.
Even with this though I am going to be back to my original issue I think where I am unable to directly load a preset from an expansion aren't I?
I can use set expansion when something is clicked as I was doing that further up, but if I don't load a preset directly then the BG, control repaint etc doesn't change and it just shows whatever the last BG & control colour scheme was until the user clicks a preset which looks wrong/bad.
When the expansion is clicked I would like it to also load the correct BG, paint routine etc but I was struggling with it for a few days before I posted and can't find a way to do it.
I can do it easily from regular presets but not from expansions. -
@rzrsharpeprod said in A couple of expansion questions:
Is this the same method you have used in the past for Rhapsody or have I done something differently to you?
I'm not using encrypted expansions with Rhapsody so probably not useful.
@rzrsharpeprod said in A couple of expansion questions:
I really don't know why it isn't working?
I suspect that within HISE it reads the files, and once you export it will read the hxi from the app data folder. Test this.
@rzrsharpeprod said in A couple of expansion questions:
where I am unable to directly load a preset from an expansion aren't I?
Yep, this is still bugged. You'll need a different workflow until it's fixed.
@rzrsharpeprod said in A couple of expansion questions:
but if I don't load a preset directly then the BG, control repaint etc doesn't change
We can work on this later, I think we can make it load based on the expansion rather than the preset.
-
@d-healey said in A couple of expansion questions:
I suspect that within HISE it reads the files, and once you export it will read the hxi from the app data folder. Test this.
Oh do you mean build it and test it in DAW? I only encrypted and then tested again in HISE so I misunderstood if you meant test in DAW.
Regarding the mouse events for the child panels, as I can't individually set the child panel to allow callbacks if I set the main panel to allow callbacks do the child panels then inherit those same properties?
What is the best way to distinguish which of the child panels is being hovered over/clicked etc? Presumably I can do it dynamically somehow (how) rather than coding the x & y values for each to say if x & y = this then load exp 1, if x & y = that then load exp 2 etc
@d-healey said in A couple of expansion questions:
We can work on this later, I think we can make it load based on the expansion rather than the preset.
I hope so but I tried the methods that were obvious to me and I think a lot of the issues were whatever I tried would end up clashing with other parts of the code that were working fine before that.
I am not sure if it is making it worse because I am using radio buttons to control the background selection and to drive which paint routine is used?
I did this to reduce the amount of code, but it seems if you call a radio button in more than 1 function it doesn't like it and stops one or both from working.Otherwise I could leave the preset selecting the relevant radio buttons which is working fine and then have the when x is clicked to load the expansion from the grid also set the radio buttons values but it didn't seem to like that at all and just stopped the presets working as an example.
-
@rzrsharpeprod said in A couple of expansion questions:
Oh do you mean build it and test it in DAW? I only encrypted and then tested again in HISE so I misunderstood if you meant test in DAW.
Don't get a DAW involved it just adds complexity. Make a standalone build of the test project.
@rzrsharpeprod said in A couple of expansion questions:
I can't individually set the child panel to allow callbacks
Why not?
-
@d-healey said in A couple of expansion questions:
Why not?
Because I don't know how to essentially. I don't know much about child panels as I have never even come across the concept until a couple of days ago and when I did I tried to research on the forum etc first as I always do as I like to try and solve issues myself if I can. There doesn't seem to be that much info on them and the bit there are mainly threads with specific issues.
I have no idea what you can do with them really, other than they seem to be the only way to get this grid working.
I have been spinning my wheels for nearly a week now and have made little to no progress which is very unlike me and it has me extremely frustrated.
Whenever I do anything with expansions it never goes smoothly due to the added complexity. The grid on top is just a whole different beast in this caseWhat I have to figure out in order to get the project back on track is the following. :
- How to get the images loaded onto the child panels in the grid
- How to add a drop shadow to the child panels
- How to add a dynamic label to the child panels for the name. I could include the text in the image to get around this but I would rather not but it isn't as clean looking
- How to change the child panel colour slightly when it is being hovered over.
- How to load the expansion AND change all of the elements that should be displayed for that expansion (BG, control paint routine etc)
1 & 5 are proving particularly difficult as you know so I haven't even attempted 2,3 or 4 yet and at least 2 of those are going to require me to reference the child panels individually I assume which brings me back to the start of this reply...
I even just did a quick callback test on the main panel and even that didn't go smoothly. The hover event worked fine but the click event only registered if you click somewhere where there wasn't a child panel. So even something as simple as that isn't going smoothly so I am starting to question my own sanity.
Admittedly part of that is my lack of understanding of the child panels so it's all feeding into each other and slowly chipping away to make me feel dumber by the day -
@rzrsharpeprod said in A couple of expansion questions:
I don't know much about child panels
They are just the same as any old regular panel, the only difference is they are created dynamically.
Any property you can set for a panel also applies to a child panel - you have to do it through code though instead of the interface designer.
-
@d-healey ok first off I didn't see your reply before I started building it so I ended up testing it in DAW as it was built. Still the same result with the XXX placeholders/missing images.
If I delete the expansion folders in AppData and open it in DAW they are gone and it's just a blank background so it is reading them. If I put them back and reopen it reads the correct amount so that part is working, it just won't load the images in HISE or in DAW. Something must be wrong with the code surely? Or it is a bug but I wouldn't be confident saying that.@d-healey said in A couple of expansion questions:
They are just the same as any old regular panel, the only difference is they are created dynamically.
Any property you can set for a panel also applies to a child panel - you have to do it through code though instead of the interface designer.
But that is the part that I can't quite get my head around. Because they are dynamic how do I code/tell HISE what to do for a specific one? In some cases there may only be 1, others there could be 5 or more expansions installed so the tiles are on different rows etc. I know I don't have to code every possible example using if elses and xy references as that would be bonkers, but I don't know how to reference them dynamically as they may or may not be there.
It just isn't making sense to me. I can do all of the children as I did last night with the images and I can do stuff to the parent panel but I do not know how to reference child 1, child 2 etc and have actions specific to them
-
@rzrsharpeprod said in A couple of expansion questions:
Something must be wrong with the code surely?
Maybe, is the Icon.png in the expansion's images folder?
@rzrsharpeprod said in A couple of expansion questions:
how do I code/tell HISE what to do for a specific one?
The parent panel has an array that contains all the children. You can access any one of them individually by their index and set the properties you want.
Or the simplest way is to do it in the creation loop because at that point you have each individual child stored in the
cp
variable as it's created. So you can enable mouse callbacks and stuff at that point.The great thing is you don't need to treat them all separately. Thing of this, when you create the child panel you store the expansion name associated with it in its data property.
Then in the generic mouse click callback which you apply to all children, you just check which expansion this particular panel is associated with and load the expansion. One function to rule them all :)