HISE Logo Forum
    • Categories
    • Register
    • Login

    Update db.json Favorites

    Scheduled Pinned Locked Moved General Questions
    7 Posts 2 Posters 63 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.
    • bendursoB
      bendurso
      last edited by

      I'm referring to the db.json file located in the UserPresets folder inside each expansion.

      • In HISE: When I save a favorite preset from an expansion, the db.json file is not updated immediately. It only gets updated after saving the XML file.

      • In the plugin: The db.json file is not updated after saving a favorite preset. So the favorites are lost after closing the plugin or changing the expansion.

      How can I update the db.json file immediately after marking a preset as a favorite?

      bendursoB 2 Replies Last reply Reply Quote 0
      • bendursoB
        bendurso @bendurso
        last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • bendursoB
          bendurso @bendurso
          last edited by bendurso

          @bendurso Or I've already figured out the problem. The database is saved when the plugin is closed.

          So if the user decides to change the expansion, he lose their saved favorites.

          Is there an API to save the database?

          bendursoB 1 Reply Last reply Reply Quote 0
          • bendursoB
            bendurso @bendurso
            last edited by

            @bendurso Actually, you could modify the source code to save the database before changing the expansion:

            Just like this:

            void PresetBrowser::expansionPackLoaded(Expansion* currentExpansion)
            {
                if (rootFile.isDirectory())
                    savePresetDatabase(rootFile);
            
            	refreshColumnUpdatesAfterExpansionSwitch = true;
            
                if(currentExpansion != nullptr)
                    selectionChanged(-1, -1, currentExpansion->getRootFolder(), false);
                else
                    selectionChanged(-1, -1, File(), false);
            }
            

            It works :)

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

              @bendurso I like that you're giving yourself help now :)

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

              bendursoB 1 Reply Last reply Reply Quote 2
              • bendursoB
                bendurso @d.healey
                last edited by

                @d-healey I'm starting to think like you :) hehe

                I think this change should be also submited to the hise code right?

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

                  @bendurso If it doesn't break anything else then why not

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

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

                  38

                  Online

                  1.7k

                  Users

                  11.7k

                  Topics

                  102.0k

                  Posts