HISE Logo Forum
    • Categories
    • Register
    • Login

    Building develop for C++ API

    Scheduled Pinned Locked Moved C++ Development
    6 Posts 2 Posters 342 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.
    • danielD
      daniel
      last edited by daniel

      Hi @Christoph-Hart and all,

      following your advice here (updating streaming_example) I setup a fresh JUCE 6 project and added the necessary modules.
      Without adding any own code and not even at the point to call the factory it doesn't compile. The reason seems to be internal changes, that many containers use now ReferenceCountedObject<>::Ptr (which is great I think).
      But the accessor functions return raw pointers, like seen here:
      Screenshot 2021-10-25 at 11.32.25.png

      There are two ways to fix it, either we return a Ptr or add .get() to each return statement. A warning, they are many!

      I would volunteer to go through the code and fix those making it compile, if you will integrate those changes upstream (I don't intend to maintain a fork).

      Which way do you want me to fix it?

      My advice would be adding
      using Ptr = ReferenceCountedObjectPtr<ActionBase>;
      and return an ActionBase::Ptr instead.

      Thanks,
      Daniel

      1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart
        last edited by

        Sorry @daniel I've overlooked this thread.

        You can temporarily disable JUCE_STRICT_REFCOUNTER preprocessor from the juce_core module in order to proceed (it's disabled by default in all HISE projects, but you might have it enabled in your project).

        I'll be crawling through the codebase and try to make it compile with the flag enabled. It's a boring task, but sometimes I find other weird stuff lurking around when doing one of these tasks.

        danielD 1 Reply Last reply Reply Quote 0
        • danielD
          daniel @Christoph Hart
          last edited by daniel

          @christoph-hart no worries, thanks for answering.
          Switching off the strict ref counter check indeed is a suitable workaround. I was using the defaults in my Projucer project.

          It gets me a lot further. Now I am stuck with the ModulatorChain.
          Seems you have some trick to create the Modulators from a template, I have no idea how that is working. I did find the `XyzModulatorFactoryType::fillTypeNameList()``` methods but have no idea if or where to call them. They are not static. I guess there is some entry point that sets up all that properly.

          Thanks again,
          Daniel

          1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart
            last edited by

            FYI I went through the codebase today and fixed compilation with the flag, but I haven't pushed it yet. It was only about 1200 compilation errors, so that was easy :)

            Check the raw::Builder class for setting up your module tree:

            Link Preview Image
            HISE | Docs

            favicon

            (docs.hise.audio)

            A real world example can be found here:

            Link Preview Image
            vcsl_hise/AdditionalSourceCode/Raw.cpp at master · christophhart/vcsl_hise

            The VCSL - HISE Edition. Contribute to christophhart/vcsl_hise development by creating an account on GitHub.

            favicon

            GitHub (github.com)

            danielD 1 Reply Last reply Reply Quote 1
            • danielD
              daniel @Christoph Hart
              last edited by

              @christoph-hart said in Building develop for C++ API:

              FYI I went through the codebase today and fixed compilation with the flag, but I haven't pushed it yet. It was only about 1200 compilation errors, so that was easy :)

              Oh wow, that's awesome! Thank you so much for that, looking forward to the update. I didn't dare to hope!
              I'm curious which way you fixed it :-)

              And thanks for the pointers, I will read into that.

              Christoph HartC 1 Reply Last reply Reply Quote 0
              • Christoph HartC
                Christoph Hart @daniel
                last edited by

                @daniel said in Building develop for C++ API:

                I'm curious which way you fixed it

                I would estimate I've added .get() in 90% of all cases and only returned / passed a ref counted pointer where the caller & callee actually takes / shares the ownership.

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

                52

                Online

                1.7k

                Users

                11.7k

                Topics

                101.9k

                Posts