This is an old revision of the document!


Clarujust API

The following represents the expected methods/functionality provided to Clarujust when it is initialized from an external application. Also, the following shows the functionality provided by Clarujust to the external application. For the rest of this document, the external application will be referred to as ezFIT.

The ezFIT API

It is assumed Clarujust will be initialized with a reference to some kind of object that communicates with the hearing aids. The following shows this interface:

I’m guessing the method names will be similar to what has previously been provided by ezOrange.

It is assumed the hearing devices will already be connected and initialized by ezFIT when this interface is passed to Clarujust. Also, ezFIT should already have the correct memory slots selected in the hearing devices.

Here’s a short description of the methods:

Initialize Hearing Instrument

Boolean GetHAInitialized()

Returns true if the API has initialized the hearing devices; otherwise, false.

Ear Side

Int16 GetEar()
void SetEar(Int16 value)

Gets or sets the current ear. 0 = left, 1 = right. With the exception of the GetHAInitialized method, the SetEar method needs to be called before any other method is called in order to access data in the correct ear.

For example: the following code shows how to get the bump values from the right-ear hearing device:

void GetBumpExample(AudinaAPI api)
{
    if (api != null &&
        api.GetHAInitialized())
    {
        api.SetEar(1);
        short bumpQ = api.GetBumpQ();
        short bumpGain = api.GetBumpGain();
        short bumpCF = api.GetBumpCF();
    }
}

Memory

short GetMemory()

Returns the current memory slot of the current ear.

Circuit Parameters

int[] GetEthosArray()

Returns an array containing all current hearing device parameters in the current ear.

Bump

short GetBumpCF()
void  SetBumpCF(short value)
short GetBumpQ()
void  SetBumpQ(short value)
short GetBumpGain()
void  SetBumpGain(short value)
short GetGain()
void  SetGain(short value)
short GetTiltSlope()
void  SetTiltSlope(short value)

Gets or sets the associated parameter values in the current ear.

NOTE: It is unclear if we need the GetBias() or SetBias() methods, or if we’re going to handle the compression via the SetCompression() method, but those can be added if needed.

Exposed Clarujust Methods/Objects

The following shows what will be exposed to ezFit.

Instantiating Clarujust

The ClarujustApp static class provides one method:

static IClarujustWindow Create(AudinaAPI api)

Returns an instance of a Clarujust window.

Clarujust Window

The IClarujustWindow interface defines the methods that will be exposed to ezFIT while Clarujust is running. We can add/remove/modify methods in this interface depending on what we decide should be provided to ezFIT, but for the time being, here is the interface and its associated methods:

void Show()

Shows the Clarujust window.

void ShowModal()

Shows the Clarujust window as a modal dialog box.

void Hide()

Hides the Clarujust window.

Running Clarujust Proxy

The DLL files needed to run the Clarujust proxy server. The only one that needs to be registered is ClarujustProxyServer.dll.

COM DLLs built in .NET need to use a different app to register (regasm.exe). If you have the latest version of .NET installed on your machine, it should be located in the following directory: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm.exe

Use that to register the libraries. For example, place the DLLs in C:\Temp. Then create these batch files, one to register and one to unregister:

To register:

path C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\
regasm C:\Temp\ClarujustProxyServer.dll /tlb:ClarujustProxyServer.tlb /codebase
pause

To unregister:

path C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\
regasm C:\Temp\ClarujustProxyServer.dll /tlb:ClarujustProxyServer.tlb /unregister
pause

The other libraries just need to be placed in the same location as the proxy DLL and it should work.

Sample code (in C#) on how to call it:

static void Main(string[] args)
{
    //Create and initialize the optimizer object however you choose...
    EzFITOptimizerSvr.IEzFITOptimizerClarujust optimizer = ...
    Clarujust.Proxy.IClarujustApp app = new Clarujust.Proxy.ClarujustApp();
    app.Initialize(optimizer);
    app.ShowModal();
}