/*
   HARK Library
   Copyright (C) 2021 Honda Research Institute Japan Inc.
 */

#if !defined(_HARKLIB_SOURCE_H_INCLUDED_)
#define _HARKLIB_SOURCE_H_INCLUDED_ 1

#include "hark-lib/hark-lib.h"
#include "hark-lib/object.h"

namespace hark
{
    class Source: public object
    {
    public:
        enum TFDim {
            TFHeight,
            TFDirection,
            TFRange
        };
        enum CompareMode {
            DEG,
            TFINDEX
        };

    public:
        Source();
        Source(const Source &src);

    public:
        int tfindexDistance(const int *y) const;
        int tfindexDistance(const Source &src) const;

        float angle(const float *y) const;
        float angle(const Source &src) const;

        // virtual ObjectRef clone();
        // virtual void printOn(std::ostream &out) const;
        // void readFrom(std::istream &in);

    public:
        float x[3];
        float power;
        int id;
        int sub_id;
        int mic_id;
        float remaining;
        int count;
        int first_found_count;
        int last_found_count;

        int tfindex[3];
        int tfindex_max[3];
        int tfindex_min[3];
        CompareMode compare_mode;

    };

    class UtteranceInfo: public object
    {
    public:
        UtteranceInfo();
        UtteranceInfo(const UtteranceInfo &src);
        
    public:
        int64_t client_id;
        int mic_index;
        int source_id;
        int sub_id;
        float azimuth;
        float elevation;
        long tv_sec, tv_usec;
    };
}

#endif /* #if !defined(_HARKLIB_SOURCE_H_INCLUDED_) */

/* end of file */
