HISE Logo Forum
    • Categories
    • Register
    • Login

    Add extra data to common components (Button, Slider)

    Scheduled Pinned Locked Moved General Questions
    2 Posts 2 Posters 105 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.
    • oskarshO
      oskarsh
      last edited by

      Hey I am working on a project where I am using one base knob and have a couple of variations. For example I have one knob where I want to show a label, others where I want to hide the arc around it. Basically these are all the same Slider Knobs but just with some slight variations.

      Currently what I am doing is to copy the LAF and create a variation like LAF_knobNoLabel or LAF_knobNoArc and assign that to the respected knob. Is there a way that I can assign extra data for a common component like

      {
          arc: false,
          label: true
      }
      

      This would allow for a lot less code duplication in general.

      breathing HISE

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

        You don't need to duplicate your code. Put the code that the three functions share into a separate inline function and call that from the laf functions. Then you just add the part that's different to the laf functions.

        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

        49

        Online

        1.7k

        Users

        11.7k

        Topics

        101.8k

        Posts