HISE Logo Forum
    • Categories
    • Register
    • Login

    Playhead colour in Waveform component

    Scheduled Pinned Locked Moved General Questions
    5 Posts 3 Posters 221 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.
    • P
      paper_lung
      last edited by paper_lung

      Does anyone know if it's possible to change the colour of the playhead in the AudioWaveform component?

      Screenshot 2023-12-12 at 16.09.27.png

      DabDabD 1 Reply Last reply Reply Quote 0
      • DabDabD
        DabDab @paper_lung
        last edited by DabDab

        @paper_lung
        By using Look And Feel.

        drawThumbnailRuler
        ```Function```
        

        Bollywood Music Producer and Trance Producer.

        P 1 Reply Last reply Reply Quote 0
        • P
          paper_lung @DabDab
          last edited by paper_lung

          @DabDab I tried that but it doesn't work. I'm using the code from the LAF glossary but the playhead doesn't change, even when I change the values in the code. What am I missing?

          const var laf = Engine.createGlobalScriptLookAndFeel();
          
          laf.registerFunction("drawTableRuler", function(g, obj)
          {
              g.setColour(Colours.withAlpha(obj.bgColour, 0.1));
              
              var x = obj.position * obj.area[2];
              
              g.drawLine(x, x, 0, obj.area[3], 10.0);
              g.setColour(obj.bgColour);
              g.drawLine(x, x, 0, obj.area[3], 0.5);
          });
          
          ulrikU 1 Reply Last reply Reply Quote 0
          • ulrikU
            ulrik @paper_lung
            last edited by

            @paper_lung as DabDab says, use "drawThumbnailRuler"

            const var laf = Engine.createGlobalScriptLookAndFeel();
            
            laf.registerFunction("drawThumbnailRuler", function(g, obj)
            {
            	g.setColour(Colours.red); // you can fetch the colour from the component colours as well
                    // g.setColour(obj.itemColour);
            	g.drawVerticalLine(obj.xPosition, 0, obj.area[3]);
            });
            

            Hise Develop branch
            MacOs 15.3.1, Xcode 16.2
            http://musikboden.se

            P 1 Reply Last reply Reply Quote 2
            • P
              paper_lung @ulrik
              last edited by

              @ulrik Ah, sorry my mistake! I was using the wrong function. Thanks for that.

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

              13

              Online

              1.7k

              Users

              11.8k

              Topics

              102.6k

              Posts