Hello,
Here's the code from CPCTuner that handles the RR interface commands:
It's possible to control the following CPCTuner functions:Code:// RR_V holds value after ';' when the command is numeric // RR_C holds RR command // RR_C1 holds value after ';' when the command is alfa-numeric // HQCTuner is the HQCT object // SendToRR is a function that sends data to RR case RRCommand of tune : begin // Check if we have to switch between AM/FM for new frequency if (RR_V < 6700) then begin // New AM freq from rr if HQCTuner.FMBand then HQCTuner.FMBand := false; if RR_V <> HQCTuner.FrequencyAM then HQCTuner.FrequencyAM := RR_V; end; if (RR_V >= 6700) then begin if not HQCTuner.FMBand then HQCTuner.FMBand := true; if RR_V <> HQCTuner.FrequencyFM then HQCTuner.FrequencyFM := RR_V; end; end; seekup : HQCTuner.ScanStations(ScanUp, false); seekdn : HQCTuner.ScanStations(ScanDown, false); mute : HQCTuner.Mute := not HQCTuner.Mute; step : HQCTuner.FMStepOffset := RR_V; source : begin case TRRSource(ansiindextext(RR_C, RRSource)) of // TunerSrc, CDSrc, PhoneSrc, NaviSrc radio : HQCTuner.SoundSource := TunerSrc; aux1 : HQCTuner.SoundSource := CDSrc; aux2 : HQCTuner.SoundSource := AUXSrc; nav : HQCTuner.SoundSource := NaviSrc; phone : HQCTuner.SoundSource := PhoneSrc; else end; end; setvol : HQCTuner.Volume := RR_V; setbass : HQCTuner.Bass := RR_V; settreble : HQCTuner.Treble := RR_V; setmute : if (RR_V > 0) then HQCTuner.Mute := true else HQCTuner.Mute := false; switchinput : begin if copy(w_s, Pos(';', w_s) + 1, 2) = 'on' then begin // Save current source CurrentSource := HQCTuner.SoundSource; // switch to new source if LeftStr(w_s, 3) = 'dio' then HQCTuner.SoundSource := TunerSrc else if LeftStr(w_s, 3) = 'ux1' then HQCTuner.SoundSource := CDSrc else if LeftStr(w_s, 3) = 'ux2' then HQCTuner.SoundSource := AUXSrc else if LeftStr(w_s, 3) = 'nav' then HQCTuner.SoundSource := NaviSrc else if LeftStr(w_s, 3) = 'one' then HQCTuner.SoundSource := PhoneSrc; end else // switch to previous source HQCTuner.SoundSource := CurrentSource; end; rvol : SendToRR('rvol;' + IntToStr(HQCTuner.Volume)); rtreble : SendToRR('rtreble;' + IntToStr(HQCTuner.Treble)); rbass : SendToRR('rbass;' + IntToStr(HQCTuner.Bass)); else end;
- switch (frequency AM/FM)
- seek (a station up)
- seek (a station down)
- mute (toggles)
- step (step is used when CPCTuner starts seek, be carefull, no value check yet, use 10 for 0.1Mhz in FM; 20 for 0.2Mhz)
- source (switch between audio sources)
- setvol (change volume between 0 and 68)
- settreble (change treble between 0 and 7)
- setbass (change bass between 0 and 7)
- setmute (0=unmute, 1=mute)
- switchinput (switch between audio sources, special)
- rvol (read current volume)
- rtreble (read current treble)
- rbass (read current bass)
A lot of these functions are specified more in detail in this post from PaulKaye.
So if you need to change the volume in the -eA version, use the setvol command with a value between 0 and 68, or the source command to change between radio/CD/phone ... So all you have to do is add a slider or button to RR and send the correct message.
Have fun!



LinkBack URL
About LinkBacks
Reply With Quote



Bookmarks