rem: unit->prefs.ahiup_ScaleMode   = 0;
context: void FillUnit() {  struct UnitNode *unit = NULL;  struct ModeNode *mode = NULL;  ULONG id;  double db;  unit = (struct UnitNode *) GetNode(state.UnitSelected, UnitList);  if(unit->prefs.ahiup_Unit != AHI_NO_UNIT) {    unit->prefs.ahiup_Channels    = state.ChannelsSelected;    unit->prefs.ahiup_ScaleMode   = state.ScaleModeSelected;  }  else {    unit->prefs.ahiup_Channels    = 0;    unit->prefs.ahiup_ScaleMode   = 0;  }  if( state.ModeSelected != ~0 )  {    mode = (struct ModeNode *) GetNode(state.ModeSelected, ModeList);  }  if( mode != NULL )  {    unit->prefs.ahiup_AudioMode = mode->ID;    AHI_GetAudioAttrs(mode->ID, NULL,		      AHIDB_FrequencyArg, state.FreqSelected,		      AHIDB_Frequency,    (ULONG) &unit->prefs.ahiup_Frequency,		      TAG_DONE);  }  db = state.OutVolOffset + DBSTEP *       (state.OutVolSelected - (state.OutVolMute ? 1 : 0) );  unit->prefs.ahiup_OutputVolume = pow(10.0, db/20) * 65536 + 0.5;  if(state.OutVolMute && (state.OutVolSelected == 0))    unit->prefs.ahiup_OutputVolume = 0;  db = state.MonVolOffset + DBSTEP *       (state.MonVolSelected - (state.MonVolMute ? 1 : 0) );  unit->prefs.ahiup_MonitorVolume = pow(10.0, db/20) * 65536 + 0.5;  if(state.MonVolMute && (state.MonVolSelected == 0))    unit->prefs.ahiup_MonitorVolume = 0;  db = state.GainOffset + DBSTEP *       (state.GainSelected - (state.GainMute ? 1 : 0) );  unit->prefs.ahiup_InputGain = pow(10.0, db/20) * 65536 + 0.5;  if(state.GainMute && (state.GainSelected == 0))    unit->prefs.ahiup_InputGain = 0;  unit->prefs.ahiup_Input         = state.InputSelected;  unit->prefs.ahiup_Output        = state.OutputSelected;}