
#idString HKJ,Soundcard output,
#name Soundcard output
#handle SO
#port none


#helpurl http://lygte-info.dk/project/TestControllerSoundcard%20UK.html#Output



#notes The maximum actual sample frequency may be limited by OS settings.

#outputOff on 0

#interfaceType SO ARB

#interface setFrequency FREQ (value)
#interface setAmplitude VOLUME (value)
#interface setPhase PHASE (value)
#interface setOn ON (value)

#interface getFrequency FREQ?
#interface getAmplitude VOLUME? 
#interface getPhase PHASE?
#interface getOn ON?

#interface readFrequency 0 
#interface readAmplitude 1 



; Strings to configure device in different modes
; First parameter must match a #value (4 parameter) and second parameter must match what #askMode returns
; First parameter is also used in shortcut menu
;#cmdMode 




; Setup menu functions
; The parameters on the first line is: type name page 
; Settings on the following lines are:
; read: SCPI to read value from device, is used to synchronize when opening setup page or setting equal named fields. Not always used
; askValuesReadFormat: Parse read value.
; write: Send the value to device, this field is used in combination with data fields in the details to send updates to device.
; tip: Add this tip to all components for this input field.


#cmdSetup comboboxFillHot Device
:read: audiodevice?
:write: audiodevice
:update: Bits Sample_rate
audiodevices?

#cmdSetup comboboxFillHot Bits
:read: bit?
:write: bit
:tip: More bits means cleaner output tone
bits?

#cmdSetup comboboxFillHot Sample_rate
:read: samplerate?
:write: samplerate
:update: Frequency Sweep
:tip: High sample rate makes higher output frequency possible.  The OS/output device may down sample the data before output it.
samplerates?

#cmdSetup radio Channels
:read: CHANNEL?
:write: CHANNEL
:string:
:update: Phase
Mono Mono
Left Left
Right Right
Stereo Stereo


#cmdSetup number Frequency
:read: freq?
:write: freq
:update: Mode
:tip: Actual frequency range depends on sample rate
Hz 20 80k


#cmdSetup multi Sweep
:read: sweep?
:write: sweep
:update: Mode
:tip: If start if higher than end the sweep will go down in frequency. When logging the frequency change is synchronized to logging.
Number Start Hz 20 80k
Number End Hz 20 80k
Number Time s 1 3600


#cmdSetup number Phase
:read: phase?
:write: phase
:enable: equals(Channels,"Stereo")
:tip: Phase is only used with stereo output
deg -360 360


#cmdSetup number Volume
:read: volume?
:write: volume
:tip: Not all sound devices may honor the full volume range
dB -80 6

#cmdSetup slider Volume
:read: volume?
:write: volume
:tip: Not all sound devices may honor the full volume range
dB -80 6


#cmdSetup buttonsOn Output
:read: on?
:write: on
:update: Mode
:updatealloff:
Off 0
On 1
Single 2

#cmdSetup info Mode
:read: sweepMode?
:readmath: getElement("Frequency;Sweep;Single waiting;Single sweeping;Single done",value,";");

#cmdSetup updater Updater
:update: Mode
1

