Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Is it possible to assign a single keyboard key to cycle through RG options? (Read 1673 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Is it possible to assign a single keyboard key to cycle through RG options?

Hi all

I know it isn't really that important...  I know it is a bit pedantic...  But I also know some people like to get their software set up EXACTLY how they like it :)  So here goes.... 

I currently have three separate keyboard keys assigned to the three different RG options.  F9 = None.  F10 = Track.  F11 = Album.  Granted, it's close to perfect.  But it would be even better if I could assign a single button to cycle through these. 

Is it possible?

Many thanks

Re: Is it possible to assign a single keyboard key to cycle through RG options?

Reply #1
One way that comes to mind would be literally a handful of lines of jscript code.

You would need a JScript Panel with on_main_menu(index) callback, where you could cycle through the RG modes and set fb.ReplayGainMode to the desired value. Then you can assign a keyboard shortcut to Main->File->Jscript Panel->n where n would correspond to the index in the callback.

Re: Is it possible to assign a single keyboard key to cycle through RG options?

Reply #2
That sounds great PleasantSounds but is unfortunately way over my head!  If anyone knows how to do this and is willing to help out, that would be fantastic! 

Thanks for the reply.

Re: Is it possible to assign a single keyboard key to cycle through RG options?

Reply #3
OK, in case you knew how to code I didn't want to take all the fun away  :D
From what you have written, I gather you know how to map the keys.
Can you handle downloading and installing the Jscript panel? If so, just add it to your user interface, click on it, and replace the content with:

Code: [Select]
var ww = 0, wh = 0;
var bkg = 0;

function on_size() {
    ww = window.Width;
    wh = window.Height;
}

function on_paint( gr ) {
    gr.FillSolidRect( 0, 0, ww, wh, bkg );  // sets the panel colour to your background colour
}


function on_main_menu(index) {
    if (index == 1) {                             // activate only on File -> Jscript Panel -> 1
        if (fb.ReplaygainMode == 2) fb.ReplaygainMode = 0
        else fb.ReplaygainMode = fb.ReplaygainMode+1;
    }
}

function get_colours() {
    bkg = window.InstanceType ? window.GetColourDUI(1) : window.GetColourCUI(3);
}

get_colours();



Re: Is it possible to assign a single keyboard key to cycle through RG options?

Reply #4
WOW - thanks for that :) 

I've got to shoot off right now but will return in a bit and give this a go. 

Cheers

Re: Is it possible to assign a single keyboard key to cycle through RG options?

Reply #5
Apologies - life got in the way! 

OK, so I've had a look and cannot find where to download the Jscript panel from.  Any chance of a link please?



Re: Is it possible to assign a single keyboard key to cycle through RG options?

Reply #7
Great - thank you. 

I'm away fro a week as from tomorrow.  Hopefully I'll get a chance to look at this before I go but if not I'll get back on it once I return.  Just wanted to drop in to say thanks though, and so that you know I'm not ignoring your kind help. 

Cheers guys!