Пример #1
0
  public void configureAndConnectHeadSet() {
    EHeadSetType type = getAppSettings().getHeadSetType();
    if (m_AppSettings.isUsingHeadSet() && m_HeadSet == null) {
      switch (type) {
        case MindWave:
          m_HeadSet = new MindWave();
          Logs.info(APP_MANAGER, "Connected to: MINDWAVE :)");
          break;
        case Moker:
          Logs.info(APP_MANAGER, "Connected to: MOCKER");
          m_HeadSet = new MockerHeadSet();
          break;
      }
    }

    connectToHeadSet();
  }
Пример #2
0
  public void raiseOnHeadSetChangedState(String headSetName, EConnectionState connectionState) {
    Logs.info(EEGHEADSET_STR, headSetName + " connecetd!");

    for (IHeadSetData headSetData : m_HeadSetData) {
      if (headSetData != null) {
        headSetData.onHeadSetChangedState(headSetName, connectionState);
      }
    }
  }
Пример #3
0
  public static AppManager getInstance() {
    if (m_Instance == null) {
      m_Instance = new AppManager();
      Logs.info(
          APP_MANAGER, "~ * ~ * ~ * Just created AppManager instance (Singleton)! * ~ * ~ * ~");
    }

    return m_Instance;
  }
Пример #4
0
  public void raiseOnAttention(int attValue) {
    Logs.info(EEGHEADSET_STR, ATTENTION_STR + ": " + attValue);

    for (IHeadSetData headSetData : m_HeadSetData) {
      if (headSetData != null) {
        headSetData.onAttentionReceived(attValue);
      }
    }
  }
Пример #5
0
 public void connectToHeadSet() {
   if (m_AppSettings.isUsingHeadSet() && m_HeadSet != null) {
     m_HeadSet.connect();
     Logs.info(APP_MANAGER, "Try to connect to MindWave");
   }
   // mocker
   else {
     m_HeadSet.connect();
   }
 }
Пример #6
0
  public void raiseOnMeditation(int medValue) {

    Logs.info(EEGHEADSET_STR, MEDITATION_STR + ": " + medValue);

    for (IHeadSetData headSetData : m_HeadSetData) {
      if (headSetData != null) {
        headSetData.onMeditationReceived(medValue);
      }
    }
  }
Пример #7
0
 @Override
 public void onHeadSetChangedState(String headSetName, EConnectionState connectionState) {
   // While the HeadSet is not connected we try to connect
   switch (connectionState) {
     case DEVICE_CONNECTED:
     case DEVICE_CONNECTING:
     case BLUETOOTH_NOT_AVAILABLE:
       break;
     case DEVICE_NOT_FOUND:
     case DEVICE_NOT_CONNECTED:
       connectToHeadSet();
       Logs.info(APP_MANAGER, "Connection fail from some reason, try to connect again...");
       break;
   }
 }
Пример #8
0
  public void raiseOnPoorSignal(int poorSignalValue) {
    Logs.info(EEGHEADSET_STR, POOR_SIGNAL_STR + ": " + poorSignalValue);

    ESignalVolume signalVolume = ESignalVolume.getSignalVolume(poorSignalValue);

    if (signalVolume != ESignalVolume.GOOD_SIGNAL || m_CurrentPoorSignal != poorSignalValue) {
      for (IHeadSetData headSetData : m_HeadSetData) {
        if (headSetData != null) {
          headSetData.onPoorSignalReceived(signalVolume);
        }
      }
    }

    m_CurrentPoorSignal = poorSignalValue;
  }
Пример #9
0
 // C'tor
 private AppManager() {
   m_AppSettings = new AppSettings();
   Logs.info("APP_MANAGER", "APP_MANAGER");
   //        configureAndConnectHeadSet();
 }