HISE Logo Forum
    • Categories
    • Register
    • Login

    How to reset referToData?

    Scheduled Pinned Locked Moved Solved Scripting
    refertodatatableconnect
    15 Posts 4 Posters 935 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.
    • d.healeyD
      d.healey @Dan Korneff
      last edited by

      @dustbro Not quite what I'm after but I might be able to use this. I want to completely disconnect the tables from a data object.

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

      ustkU 1 Reply Last reply Reply Quote 0
      • ustkU
        ustk @d.healey
        last edited by ustk

        @d-healey I imagine this would need another function that cancels what's made here:

        void referToDataBase(var newData)
        {
        	if (auto td = dynamic_cast<ScriptingObjects::ScriptComplexDataReferenceBase*>(newData.getObject()))
        	{
        		if (td->getDataType() != type)
        			reportScriptError("Data Type mismatch");
        
        		otherHolder = td->getHolder();
        
        		setScriptObjectPropertyWithChangeMessage(getIdFor(getIndexPropertyId()), td->getIndex(), sendNotification);
        		updateCachedObjectReference();
        	}
        	else if (auto cd = dynamic_cast<ComplexDataScriptComponent*>(newData.getObject()))
        	{
        		if (cd->type != type)
        			reportScriptError("Data Type mismatch");
        
        		otherHolder = cd;
        		updateCachedObjectReference();
        	}
        }
        

        Can't help pressing F5 in the forum...

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

          @ustk Yes I considered that too but not sure how to implement it. I might have another go at it.

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

          ustkU 1 Reply Last reply Reply Quote 0
          • ustkU
            ustk @d.healey
            last edited by ustk

            @d-healey I tried with no luck. First I just set the otherHolder to nullptr but it didn't work.
            something like this:

            void removeFromDataBase()
            {
            	otherHolder = nullptr;
            }
            

            So I thought the message notification had to change so I copied everything from de referToData function, set otherHolder to nullptr, and set the notifications to dontSendNotification, but that didn't work either so I gave up...
            something like this:

            void removeFromDataBase(var data)
            {
            	if (auto td = dynamic_cast<ScriptingObjects::ScriptComplexDataReferenceBase*>(data.getObject()))
            	{
            		if (td->getDataType() != type)
            			reportScriptError("Data Type mismatch");
            
            		otherHolder = nullptr;
            
            		setScriptObjectPropertyWithChangeMessage(getIdFor(getIndexPropertyId()), td->getIndex(), dontSendNotification);
            		updateCachedObjectReference();
            	}
            	else if (auto cd = dynamic_cast<ComplexDataScriptComponent*>(data.getObject()))
            	{
            		if (cd->type != type)
            			reportScriptError("Data Type mismatch");
            
            		otherHolder = nullptr;
            		updateCachedObjectReference();
            	}
            }
            

            and of course adding a removeFromData that calls this one to related components...

            Can't help pressing F5 in the forum...

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

              @ustk
              bool removeDataObject(ExternalData::DataType t, int index) override { return true; }

              Smells interesting...

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

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

                @d-healey Seems like another dead-end :(

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

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

                  A related issue. How can I change the tableData that the table is referring to?

                  This doesn't work:

                  HiseSnippet 984.3ocsV8taaaCDmxIrnxacaEXO.B4SxHcFx1ccCHaXdwNovXKIdydECHHnfVhJhHzjBTTo0XXXEC6AaOH6C6QXuAaGojiTZMbhM5zGr0Qd+386Nc+giUxPZVlTgbbmtHkhb9P7jEBcxfDBSfFMD47wXMYFm98LwUSoYZzgKRIYYzHjiyNO2nji6tH6y+7MGR3DQHsZID5ERVH.dNSWs539eGiyOlDQmxlWS6m1eTnTLPxk4.g1AGfRIgWQtjdJwnVCLx4AGEwzR0DMQSy.cNTFsXRh7UhB8eAKiAj0HzAMANnhkQCRX7nwKc1LDxY2wUt9NEt9mhOgEwtY8pPvmX2vqBQ8XfSi0QoNa.kbpQocKnziwSBUrTc0NF97A3QBMUESfPccpTnKpwez.OPBZHzsmSthdrBDtAg+yBBdhG7SqCZ1DB2YZO8Lt2W6c9EGzDd67fK.gk3ujpGHmmJEff+dSMYBc1qUghctCE6tWkItln7rK1a8X5UCyrbsFdojZMikJOeFHEbfGy6q75B+s+9sZ9KMcK0rcZdVh+pO8Csprm29lyXeuNsZAFZIvyYWzNyntPqj7ADNeFj34KEE6WtN.3Wa1jI3LA0KNWDpYRg2aoje3Ra9Dvo44TKA4xPB2iIhnuFbfkz0JeVbEDiu6xh87KQ55VDTZqnwT0T4Phl3aB8VjWXHTMdbpTSOS3aMHvTu2dq33UtWIw4T0J21ThpVGPeQ97YTUc20nHjCe6BiGb+JLBK97USQoXjfoOKkVJerjGYR3Mu+tkQnxu+PA0NkLDnh1VN8nxxIaTEwfy3g3hbZjk70abEAwZaOGz89T59d4T5stS4mFYxALMKJcSv0SoJMyDgcFRuF51Vz5vEOjlckVlhbv2TG.eEtyHwqq2PdQkvv9uhEoSfiy4u.wDJ6xDsQ52Q1n981DcqYh+TU2DideYhd0LwahqYh9oanI9nRSTz+vZCWbgP8P0a9gZF4u+s9JRDS9bkLOsHOMibMcjXrhBsYLsp2LKUOh0WtgV5cmp.yyjQ4bh91C4LSyK2.Jvu0jEyzCQFSun9z9MXxWvZm7ceo3iwiY5vjUywFqfiPcx+Gbr79BOBeTbLMTWQvcwG+ya6kCtCy+ixbMSb4IDshAIC3SymOAtlTHErtPP4Ylb3FlT3B4.irIBLgJhrB+K7TtYGirS4lcVtIZNITIeYXQiJyMRdncEfSB6EvbwmXj8toaIFGzN.MGtbzKCCMt+mAcjWMltaAldaAlmtEX97s.yy1BLewVf4KWKFy8R+1bsbdQ4.rv3irCHbbNRXZDZyBQ+WzdNyT
                  

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

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

                    Christoph committed a solution yesterday. Now referToData(-1) will reset back to the tables internal object.

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

                    DanHD 1 Reply Last reply Reply Quote 2
                    • d.healeyD d.healey marked this topic as a question on
                    • d.healeyD d.healey has marked this topic as solved on
                    • DanHD
                      DanH @d.healey
                      last edited by

                      @d-healey can you export on latest commit? Having issues here on osx....

                      DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                      https://dhplugins.com/ | https://dcbreaks.com/
                      London, UK

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

                        @DanH Yes on GNU/Linux and Windows, haven't tried MacOS yet.

                        What issue are you having?

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

                        DanHD 1 Reply Last reply Reply Quote 0
                        • DanHD
                          DanH @d.healey
                          last edited by

                          @d-healey a bunch of errors... Will have another go

                          DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                          https://dhplugins.com/ | https://dcbreaks.com/
                          London, UK

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

                          47

                          Online

                          1.7k

                          Users

                          11.7k

                          Topics

                          102.2k

                          Posts