Public 型 | Public メソッド | Private メソッド | Private 変数

クラス NSHarkBinaural::EventHistoryManager

#include <EventHistoryManager.hpp>

すべてのメンバ一覧

Public 型

typedef boost::shared_ptr
< HarmonicSound
HarmonicSoundPtr
typedef std::vector
< HarmonicSoundPtr
HarmonicSoundVector
typedef boost::shared_ptr
< HarmonicSoundVector
HarmonicSoundVectorPtr
typedef boost::tuple< EventID,
Band,
NSDimensionPromise::Angle
UpdateInfo

Public メソッド

 EventHistoryManager ()
void CheckSoundHistory (HarmonicSoundVectorPtr sounds, const timeval &currentTime)
 ヒストリーを調べ、soundsの要素にイベントIDを割り振る.
void CheckSoundHistory (boost::shared_ptr< std::vector< NSDimensionPromise::Angle > > directions, const timeval &currentTime)
void SetValidPausePeriod (const timeval &validPausePeriod)
 有効なPAUSE期間を設定する.
void SetNearDirectionThreshold (NSDimensionPromise::Angle nearDirectionThreshold)
 近い音だと判断する角度の範囲を設定する.
const std::list< EventHistory > & GetAllEvents () const
void SetEventUpdateRatioThreshold (double threshold)

Private メソッド

void Update (std::vector< UpdateInfo > &updateInfoList, const timeval &currentTime)
EventID FindNearestEvent (Band fundamental, NSDimensionPromise::Angle direction, const timeval &currentTime)
 与えられた基音と方向に一番近いイベントを見つける.
bool IsNear (NSDimensionPromise::Angle dir1, NSDimensionPromise::Angle dir2)
 二つの方向が十分近いかどうか.
void EraseOutOfDateEvents ()
 既に終了したイベントをリストから消去する.
void MakeNewEvents (std::vector< UpdateInfo > &updateInfoList, const timeval &currentTime)
 イベントIDが割り当てられていないものに対し、新しいイベントを生成し割り当てる.
EventID MakeNewEvent (const timeval &currentTime, Band fundamental, NSDimensionPromise::Angle direction)
 新しいイベントを生成し、管理リストに追加する.
EventID NextEID ()
 次の未使用のイベントIDを生成する.

Private 変数

Loggerlogger
std::list< EventHistoryeventHistories
 イベントヒストリー一覧(有効なイベントのみ格納している)
NSDimensionPromise::Angle nearDirectionThreshold
 二つの方向が近いかどうかを決める閾値.
timeval validPausePeriod
 PAUSE状態が続いても、一つの有効なイベントだとみなす期間.
int headid
 現在の最大イベントID
double eventUpdateRatioThreshold
 イベントの更新頻度の閾値(これ以下になるとイベント終了)

型定義


コンストラクタとデストラクタ

NSHarkBinaural::EventHistoryManager::EventHistoryManager (  ) 

関数

void NSHarkBinaural::EventHistoryManager::CheckSoundHistory ( HarmonicSoundVectorPtr  sounds,
const timeval &  currentTime 
)

ヒストリーを調べ、soundsの要素にイベントIDを割り振る.

void NSHarkBinaural::EventHistoryManager::CheckSoundHistory ( boost::shared_ptr< std::vector< NSDimensionPromise::Angle > >  directions,
const timeval &  currentTime 
)
void NSHarkBinaural::EventHistoryManager::EraseOutOfDateEvents (  )  [private]

既に終了したイベントをリストから消去する.

EventID NSHarkBinaural::EventHistoryManager::FindNearestEvent ( Band  fundamental,
NSDimensionPromise::Angle  direction,
const timeval &  currentTime 
) [private]

与えられた基音と方向に一番近いイベントを見つける.

const std::list<EventHistory>& NSHarkBinaural::EventHistoryManager::GetAllEvents (  )  const [inline]
bool NSHarkBinaural::EventHistoryManager::IsNear ( NSDimensionPromise::Angle  dir1,
NSDimensionPromise::Angle  dir2 
) [private]

二つの方向が十分近いかどうか.

EventID NSHarkBinaural::EventHistoryManager::MakeNewEvent ( const timeval &  currentTime,
Band  fundamental,
NSDimensionPromise::Angle  direction 
) [private]

新しいイベントを生成し、管理リストに追加する.

void NSHarkBinaural::EventHistoryManager::MakeNewEvents ( std::vector< UpdateInfo > &  updateInfoList,
const timeval &  currentTime 
) [private]

イベントIDが割り当てられていないものに対し、新しいイベントを生成し割り当てる.

updateInfoListの中で、get<0>(updateInfoList[i]).IsConnected() == false であるi番目の要素に、新しくイベントを生成して代入する。

EventID NSHarkBinaural::EventHistoryManager::NextEID (  )  [private]

次の未使用のイベントIDを生成する.

void NSHarkBinaural::EventHistoryManager::SetEventUpdateRatioThreshold ( double  threshold  )  [inline]
void NSHarkBinaural::EventHistoryManager::SetNearDirectionThreshold ( NSDimensionPromise::Angle  nearDirectionThreshold  )  [inline]

近い音だと判断する角度の範囲を設定する.

実際には、この角度の2倍の角度に含まれる音は近いと判断する

void NSHarkBinaural::EventHistoryManager::SetValidPausePeriod ( const timeval &  validPausePeriod  )  [inline]

有効なPAUSE期間を設定する.

デフォルト値は1秒

void NSHarkBinaural::EventHistoryManager::Update ( std::vector< UpdateInfo > &  updateInfoList,
const timeval &  currentTime 
) [private]

変数

イベントヒストリー一覧(有効なイベントのみ格納している)

イベントの更新頻度の閾値(これ以下になるとイベント終了)

現在の最大イベントID

二つの方向が近いかどうかを決める閾値.

PAUSE状態が続いても、一つの有効なイベントだとみなす期間.


このクラスの説明は次のファイルから生成されました: