HISE Logo Forum
    • Categories
    • Register
    • Login

    Apple, and the interminable oddness implied by that name........

    Scheduled Pinned Locked Moved General Questions
    10 Posts 2 Posters 306 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.
    • LindonL
      Lindon
      last edited by

      sigh...so Horizen... lets you install expansions, and shows you what you have installed and what is also available - in a list.

      It does this by using some meta data about available and installed expansions, and shows you a named(in the meta data) image for each expansion.....

      It gets this image from the {AppData}/images folder... where the expansion installer has put every expansions image as part of any given expansions download....

      like this:

      // get the proper images folder.....
      if (destinations.OS == destinations.WINDOWS)
      	{
      		ifolder = destinations.IMAGES_FOLDER + "\\";
      	}else{
      		ifolder = destinations.IMAGES_FOLDER + "/";
      	};```
      
      
      
      reg imageList = FileSystem.findFiles(imageDirFile, "*.png",false);
      
      //and later...
      InstalledExpansionDisplayPanel.loadImage(ifolder + e.Image, e.Image);
      

      Still with me so far?

      So this works flawlessly on Windows for everyone, and flawlessly on MacOS for about 80% of the customer base, but for those other 20%? Well it cant seem to find the images....at all....

      I cant see what Im doing inconsistently... anyone else have MacOS behave this way? and if so do you have a work around?

      HISE Development for hire.
      www.channelrobot.com

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

        @Lindon I would avoid specifying forward slashes and back slashes manually, and use the FileSystem API to get references to files/folders.

        Don't know if that will make a difference to the problem here though.

        Does the value of imageList change later in your script?

        Do you have any more data that links the people who are having the issue, other than they are using MacOS?

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

        LindonL 1 Reply Last reply Reply Quote 0
        • LindonL
          Lindon @d.healey
          last edited by

          @d-healey said in Apple, and the interminable oddness implied by that name........:

          @Lindon I would avoid specifying forward slashes and back slashes manually, and use the FileSystem API to get references to files/folders.

          Okay, not sure how you do that, every time I use the FileSystem API I get back a path to a folder without slashes at the end - so I can get (say) AppData folder, but now I want to get the images folder inside there, how are you proposing to do this with "just" the FileSystem API?

          Don't know if that will make a difference to the problem here though.

          Does the value of imageList change later in your script?

          Nope. fixed fixed fixed at init.

          Do you have any more data that links the people who are having the issue, other than they are using MacOS?

          Sadly no - I cant see any common OS version or permissions hoo-ha going on...

          HISE Development for hire.
          www.channelrobot.com

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

            @Lindon said in Apple, and the interminable oddness implied by that name........:

            Okay, not sure how you do that, every time I use the FileSystem API I get back a path to a folder without slashes at the end - so I can get (say) AppData folder, but now I want to get the images folder inside there, how are you proposing to do this with "just" the FileSystem API?

            Let's say your image is called uberSynth.png and it lives in the Images folder within your appData folder.

            // createDirectory will return the directory if it already exists and create it if it doesn't
            const img = FileSystem.getFolder(FileSystem.AppData).createDirectory("Images").getChildFile("uberSynth.png");
            

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

            LindonL 1 Reply Last reply Reply Quote 0
            • LindonL
              Lindon @d.healey
              last edited by Lindon

              @d-healey said in Apple, and the interminable oddness implied by that name........:

              @Lindon said in Apple, and the interminable oddness implied by that name........:

              Okay, not sure how you do that, every time I use the FileSystem API I get back a path to a folder without slashes at the end - so I can get (say) AppData folder, but now I want to get the images folder inside there, how are you proposing to do this with "just" the FileSystem API?

              Let's say your image is called uberSynth.png and it lives in the Images folder within your appData folder.

              // createDirectory will return the directory if it already exists and create it if it doesn't
              const img = FileSystem.getFolder(FileSystem.AppData).createDirectory("Images").getChildFile("uberSynth.png");
              

              yeah - but sadly no. What I need to do is inspect the images folder and get out from it all the png files....so this line from above:

              reg imageList = FileSystem.findFiles(imageDirFile, "*.png",false);
              

              Sadly in this case I need to get the directory as an object not a file in that directory...maybe I just need createDirectory....

              so

              myImageDir = FileSystem.getFolder(FileSystem.AppData).createDirectory("Images");
              

              HISE Development for hire.
              www.channelrobot.com

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

                @Lindon said in Apple, and the interminable oddness implied by that name........:

                Sadly in this case I need to get the directory as an object

                const dir = FileSystem.getFolder(FileSystem.AppData).createDirectory("Images");
                

                Yep, you got it

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

                LindonL 1 Reply Last reply Reply Quote 0
                • LindonL
                  Lindon @d.healey
                  last edited by

                  @d-healey Ok I will add that in and see if it makes a difference....thanks.

                  HISE Development for hire.
                  www.channelrobot.com

                  LindonL 1 Reply Last reply Reply Quote 0
                  • LindonL
                    Lindon @Lindon
                    last edited by Lindon

                    actually thinking about it - its a bit round the houses, to get it to be useful here:

                    InstalledExpansionDisplayPanel.loadImage(ifolder + "factory.png", "factory.png");
                    

                    I end up having to say:

                    const img = FileSystem.getFolder(FileSystem.AppData).createDirectory("Images").getChildFile("factory.png");
                    InstalledExpansionDisplayPanel.loadImage(img.toString(img.FullPath), "factory.png");
                    
                    

                    HISE Development for hire.
                    www.channelrobot.com

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

                      I would use the API here too

                      local img = ifolder.getChildFile("factory.png");
                      InstalledExpansionDisplayPanel.loadImage(img.toString(img.FullPath), "factory.png");
                      

                      Yeah you came to the same conclusion :)

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

                      LindonL 1 Reply Last reply Reply Quote 0
                      • LindonL
                        Lindon @d.healey
                        last edited by

                        @d-healey yeah sorry my slow half typing skills...

                        HISE Development for hire.
                        www.channelrobot.com

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        9

                        Online

                        1.9k

                        Users

                        12.4k

                        Topics

                        108.3k

                        Posts