Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Header

File: Rhapsodist/Core/Includes/Header.js · Namespace: Header

Overview

Header builds the header bar and wires up the master pan/volume knobs (knbMasterPan, knbMasterVolume) and the master peak meter (fltMasterPeak).

Usage

Header builds itself once Core.js is included, there’s nothing to call directly.

Look and Feel

FunctionDraws
drawHeaderThe header panel’s whole paint routine, replacing the default drawing entirely.
drawPanVolSlidersBoth knbMasterPan and knbMasterVolume, replacing their shared default drawing entirely.

Events and communication

Master volume/pan are plugin-host-facing parameters (bound via pluginParameterName). Because of that, Header snapshots them on Presets.broadcasters.preLoad and restores them on postLoad, but only for a non-internal load, so an ordinary user preset switch doesn’t silently change the host-visible gain/pan:


reg masterVolumeValue;
reg masterPanValue;

Presets.broadcasters.preLoad.addListener({}, "Preset preload", function(isInternal)
{
  if (!isInternal)
  {
    masterVolumeValue = knbMasterVolume.getValue();
    masterPanValue = knbMasterPan.getValue();
  }
});

Presets.broadcasters.postLoad.addListener({}, "Preset post load", function(isInternal)
{
  if (!isInternal && isDefined(masterVolumeValue))
  {
    knbMasterVolume.setValue(masterVolumeValue);
    knbMasterPan.setValue(masterPanValue);

    knbMasterVolume.changed();
    knbMasterPan.changed();
  }			
});