コード例 #1
0
ファイル: OptionsPrefabs.cpp プロジェクト: Joincheng/lithtech
// Load/Save
BOOL COptionsPrefabs::Load()
{
	m_eContentsView		= (EViewMode)GetDWordValue("ContentsViewMode", VIEWPREFAB_CONTENTS);
	m_bShowOutline		= GetBoolValue("ShowOutline", TRUE);
	m_bShowOrientation	= GetBoolValue("ShowOrientation", TRUE);

	return TRUE;
}
コード例 #2
0
void CGridAlerts::OnCellChange(wxGridEvent &e)
{
  if( !(m_nInCellChangeEvent || IsTableReadOnly()) )
  {
    CIncrementer x(m_nInCellChangeEvent);
    nwxGridBatch xxxx(this);
    int nRow = e.GetRow();
    int nCol = e.GetCol();
    COARmessage *pMsg = m_pMsgEdit->GetMessage((size_t) nRow);
    int nCols = GetNumberCols();
    const wxString &sName(pMsg->GetMessageName());
    if(nCol == (nCols - 1))
    {
      UpdateTextFromRow(nRow,pMsg);
    }
    else if(nCol == (nCols - 2))
    {
      UpdateDisabledFromRow(nRow,pMsg);
      if((!sName.IsEmpty()) && GetBoolValue(nRow,nCol))
      {
        // a row has been enabled
        // check for mutually exclusive rows
        // that are enabled and disable them

        set<wxString> ss;
        const COARmsgExportMap *pMsgExp = m_pMsgEdit->GetMsgExport();
        if(pMsgExp->GetGroupsByMsgName(sName,&ss))
        {
          // we found group names
          size_t nCount = m_pMsgEdit->GetMessageCount();
          size_t iRow;
          for(iRow = 0; iRow < nCount; iRow++)
          {
            if(iRow == (size_t)nRow)
            {}
            else if(!GetBoolValue(iRow,nCol))
            {} // already unchecked, fuhgeddaboudit.
            else
            {
              COARmessage *pMsgA = m_pMsgEdit->GetMessage(iRow);
              const wxString &sNameA(pMsgA->GetMessageName());
              if(sNameA.IsEmpty())
              {}
              else if( (sNameA == sName) ||
                  (pMsgExp->HasGroupByMsgName(sNameA,ss)) )
              {
                // need to uncheck message
                SetBoolValue(iRow,nCol,false);
                UpdateDisabledFromRow(iRow,pMsgA);
              }
            }
          }
        }
      }
    }
  }
  e.Skip(true);
}
コード例 #3
0
ファイル: OptionsModels.cpp プロジェクト: Joincheng/lithtech
// Load/Save
BOOL COptionsModels::Load()
{
	m_bRunLowPriority	= GetBoolValue	("RunLowPriority",		TRUE) ? true : false;
	m_bLimitMemoryUse	= GetBoolValue	("LimitMemoryUse",		FALSE)	? true : false;
	m_nMaxMemoryUse		= GetDWordValue	("MaxMemoryUse",		10);
	m_bRenderBoxAtDist	= GetBoolValue	("RenderBoxAtDist",		FALSE) ? true : false;
	m_nRenderBoxDist	= GetDWordValue	("RenderBoxDist",		1000);
	m_nPerspectiveMode	= GetDWordValue	("PerspectiveViewMode", VIEWMODEL_TEXTURED);
	m_nOrthoMode		= GetDWordValue	("OrthoViewMode",		VIEWMODEL_WIREFRAME);
	m_bAlwaysShowModels = GetBoolValue  ("AlwaysShowModels",	TRUE) ? true : false;

	return TRUE;
}
コード例 #4
0
NS_IMETHODIMP nsAbLDAPDirectory::GetReadOnly(PRBool *aReadOnly)
{
    NS_ENSURE_ARG_POINTER(aReadOnly);

    *aReadOnly = PR_TRUE;

#ifdef MOZ_EXPERIMENTAL_WRITEABLE_LDAP
    PRBool readOnly;
    nsresult rv = GetBoolValue("readonly", PR_FALSE, &readOnly);
    NS_ENSURE_SUCCESS(rv, rv);

    if (readOnly)
        return NS_OK;

    // when online, we'll allow writing as well
    PRBool offline;
    nsCOMPtr <nsIIOService> ioService =
        do_GetService(NS_IOSERVICE_CONTRACTID, &rv);
    NS_ENSURE_SUCCESS(rv,rv);

    rv = ioService->GetOffline(&offline);
    NS_ENSURE_SUCCESS(rv,rv);

    if (!offline)
        *aReadOnly = PR_FALSE;
#endif

    return NS_OK;
}
コード例 #5
0
ファイル: CGridLocus.cpp プロジェクト: Klortho/osiris
bool CGridLocus::XferName(int nCol, COARallele *pAllele)
{
    bool bRtn = true;
    if(!GetBoolValue(ROW_DISABLE,nCol))
    {
        bool bAmel = m_pLocusEdited->IsAmel();
        s = GetCellValue(ROW_ALLELE,nCol);
        nwxString::Trim(&s);
        if(bAmel)
        {
            s.MakeUpper();
            const char *ps = s.c_str();
            if( (!*ps) || (strchr("XY12",*ps) == NULL) )
            {
                // not x/y
                bRtn = false;
                mainApp::ShowError(_T("Invalid allele name"),this);
                SetCellValue(ROW_ALLELE,nCol,pAllele->FormatName(true,false));
                SetGridCursor(ROW_ALLELE,nCol);
                SelectBlock(ROW_ALLELE,nCol,ROW_ALLELE,nCol);
            }
        }
        if(bRtn)
        {
            pAllele->SetName(s,bAmel);
        }
    }
    return bRtn;
}
コード例 #6
0
ファイル: inifile.cpp プロジェクト: DoubleKing/spell_correct
/* 获取section段第一个键为key的bool值,成功返回获取的值,否则返回默认值 */
void IniFile::GetBoolValueOrDefault(const string &section, const string &key, bool *value, bool defaultValue)
{
    if (GetBoolValue(section, key, value) != 0) {
        *value = defaultValue;
    }

    return;
}
コード例 #7
0
ファイル: CGridLocus.cpp プロジェクト: Klortho/osiris
void CGridLocus::XferOL(int nCol, COARallele *pAllele)
{
    if(!GetBoolValue(ROW_DISABLE,nCol))
    {
        s = GetCellValue(ROW_OFF_LADDER,nCol);
        bool b = IsTrue(s.c_str());
        pAllele->SetOffLadderString(b ? IOARpeak::OL_TRUE : IOARpeak::OL_FALSE);
    }
}
コード例 #8
0
ファイル: CGridLocus.cpp プロジェクト: Klortho/osiris
void CGridLocus::XferHomozygous(int nCol, COARallele *pAllele)
{
    if(!GetBoolValue(ROW_DISABLE,nCol))
    {
        s = GetCellValue(ROW_HOMOZYGOUS,nCol);
        bool b = IsTrue(s.c_str());
        pAllele->SetCountBool(b);
    }
}
コード例 #9
0
ファイル: CGridLocus.cpp プロジェクト: Klortho/osiris
void CGridLocus::XferBPS(int nCol, COARallele *pAllele)
{
    if(!GetBoolValue(ROW_DISABLE,nCol))
    {
        s = GetCellValue(ROW_BPS,nCol);
        nwxString::Trim(&s);
        pAllele->SetBPS(atof(s.c_str()));
    }
}
コード例 #10
0
void CGridAlerts::UpdateDisabledFromRow(
  int nRow, COARmessage *pMsg)
{
  int nCols = GetNumberCols() - 2;
  bool bHidden = !GetBoolValue(nRow,nCols++);
  pMsg->SetHidden(bHidden);
  DisableEdit(nRow,nCols,bHidden);
  Refresh();
}
コード例 #11
0
void wxGxDBConnectionFactory::Serialize(wxXmlNode* const pConfig, bool bStore)
{
    wxGxObjectFactory::Serialize(pConfig, bStore);
    if(bStore)
    {
        if(pConfig->HasAttribute(wxT("load_system_tables_schemes")))
            pConfig->DeleteAttribute(wxT("load_system_tables_schemes"));
        SetBoolValue(pConfig, wxT("load_system_tables_schemes"), m_bLoadSystemTablesAndSchemes);    
    }
    else
    {
        m_bLoadSystemTablesAndSchemes = GetBoolValue(pConfig, wxT("load_system_tables_schemes"), m_bLoadSystemTablesAndSchemes);
    }
}
コード例 #12
0
BOOL CXTPMarkupKeyboardNavigation::IsTabStop(CXTPMarkupObject* e)
{
	if (e->IsKindOf(MARKUP_TYPE(CXTPMarkupFrameworkElement)))
	{
		CXTPMarkupFrameworkElement* pElement = (CXTPMarkupFrameworkElement*)e;
		return pElement->IsFocusable() && GetBoolValue(pElement, m_pIsTabStopProperty) && pElement->IsEnabled() && pElement->IsVisible();
	}
	else if (e->IsKindOf(MARKUP_TYPE(CXTPMarkupFrameworkContentElement)))
	{
		return FALSE;
	}

	return FALSE;
}
コード例 #13
0
ファイル: CGridLocus.cpp プロジェクト: Klortho/osiris
void CGridLocus::UpdateDisabledAlleles(int nCol)
{
    bool b;
    nwxGridBatch xxxx(this);
    b = GetBoolValue(ROW_DISABLE,nCol);
    if(IsTableReadOnly())
    {
        SetGrayBackgroundCol(nCol,b);
    }
    else
    {
        DisableEdit(ROW_ALLELE,nCol,b);
        DisableEdit(ROW_BPS,nCol,b);
        DisableEdit(ROW_OFF_LADDER,nCol,b);
        DisableEdit(ROW_HOMOZYGOUS,nCol,b);
    }
    Refresh();
}
コード例 #14
0
ファイル: ldl_attr.cpp プロジェクト: jleclanche/darkdust-ctp2
char *ldl_attribute::GetValueText()
{
	static char buf[1024];
	switch(m_type) {
		case ATTRIBUTE_TYPE_BOOL:
			sprintf(buf, "%s", GetBoolValue() ? "true" : "false");
			break;
		case ATTRIBUTE_TYPE_INT:
			sprintf(buf, "%d", GetIntValue());
			break;
		case ATTRIBUTE_TYPE_DOUBLE:
			sprintf(buf, "%lf", GetFloatValue());
			break;
		case ATTRIBUTE_TYPE_STRING:
			sprintf(buf, "%s", GetStringValue());
			break;
	}
	return buf;
}
コード例 #15
0
void CMediaStream::SetUpSRTPKeys (void) 
{
  if (GetBoolValue(STREAM_VIDEO_USE_SRTP)) {
    srandom(GetTimestamp());
    if (GetBoolValue(STREAM_VIDEO_SRTP_FIXED_KEYS)) {
      CHECK_AND_FREE(m_video_key);
      m_video_key = strdup(GetStringValue(STREAM_VIDEO_SRTP_KEY));
      CHECK_AND_FREE(m_video_salt);
      m_video_salt = strdup(GetStringValue(STREAM_VIDEO_SRTP_SALT));
    } else {
      if (m_video_key == NULL)
	m_video_key = generate_random(16);
      if(m_video_salt == NULL) 
	m_video_salt = generate_random(14);
    }
  }
  if (GetBoolValue(STREAM_AUDIO_USE_SRTP)) {
    if (GetBoolValue(STREAM_AUDIO_SRTP_FIXED_KEYS)) {
      CHECK_AND_FREE(m_audio_key);
      m_audio_key = strdup(GetStringValue(STREAM_AUDIO_SRTP_KEY));
      CHECK_AND_FREE(m_audio_salt);
      m_audio_salt = strdup(GetStringValue(STREAM_AUDIO_SRTP_SALT));
    } else {
      if (m_audio_key == NULL)
	m_audio_key = generate_random(16);
      if(m_audio_salt == NULL) 
	m_audio_salt = generate_random(14);
    }
  }
  if (GetBoolValue(STREAM_TEXT_USE_SRTP)) {
    if (GetBoolValue(STREAM_TEXT_SRTP_FIXED_KEYS)) {
      CHECK_AND_FREE(m_text_key);
      m_text_key = strdup(GetStringValue(STREAM_TEXT_SRTP_KEY));
      CHECK_AND_FREE(m_text_salt);
      m_text_salt = strdup(GetStringValue(STREAM_TEXT_SRTP_SALT));
    } else {
      if (m_text_key == NULL)
	m_text_key = generate_random(16);
      if(m_text_salt == NULL) 
	m_text_salt = generate_random(14);
    }
  }

}
コード例 #16
0
ファイル: SFSUserVariable.cpp プロジェクト: ThiQuocCuong/RPS
// -------------------------------------------------------------------
// PopulateArrayWithValue
// -------------------------------------------------------------------
void SFSUserVariable::PopulateArrayWithValue(boost::shared_ptr<ISFSArray> arr)
{
	switch(type)
	{
	case VARIABLETYPE_UNKNOWN :
		break;

	case VARIABLETYPE_NULL :
		arr->AddNull();
		break;
					
	case VARIABLETYPE_BOOL:
		arr->AddBool(GetBoolValue());
		break;
					
	case VARIABLETYPE_INT:
		arr->AddInt(GetIntValue());
		break;
					
	case VARIABLETYPE_DOUBLE:
		arr->AddDouble(GetDoubleValue());
		break;
					
	case VARIABLETYPE_STRING:
		arr->AddUtfString(GetStringValue());
		break;
					
	case VARIABLETYPE_OBJECT:
		arr->AddSFSObject(GetSFSObjectValue());
		break;
					
	case VARIABLETYPE_ARRAY:
		arr->AddSFSArray(GetSFSArrayValue());
		break;
	}
}
コード例 #17
0
bool RDRecording::fri() const
{
  return GetBoolValue("FRI");
}
コード例 #18
0
ファイル: rdtty.cpp プロジェクト: WMFO/rivendell
bool RDTty::active()
{
  return GetBoolValue("ACTIVE");
}
コード例 #19
0
bool RDRecording::oneShot() const
{
  return GetBoolValue("ONE_SHOT");
}
コード例 #20
0
bool wxRadioButton::GetValue() const
{
    return GetBoolValue();
}
コード例 #21
0
ファイル: checkbox.cpp プロジェクト: gitrider/wxsj2
bool wxCheckBox::GetValue() const
{
    return GetBoolValue();
}
コード例 #22
0
void wxGxContentView::Serialize(wxXmlNode* pRootNode, bool bStore)
{
	if(pRootNode == NULL)
		return;

	if(bStore)
	{
        if(pRootNode->HasAttribute(wxT("style")))
            pRootNode->DeleteAttribute(wxT("style"));
        SetDecimalValue(pRootNode, wxT("style"), m_current_style);
        if(pRootNode->HasAttribute(wxT("sort")))
            pRootNode->DeleteAttribute(wxT("sort"));
        SetBoolValue(pRootNode, wxT("sort"), m_bSortAsc);
        if(pRootNode->HasAttribute(wxT("sort_col")))
            pRootNode->DeleteAttribute(wxT("sort_col"));
        SetDecimalValue(pRootNode, wxT("sort_col"), m_currentSortCol);

        if(m_current_style == enumGISCVReport)
        {
            //store values
            m_anWidth.Clear();
            for (int i = 0; i < GetColumnCount(); ++i)
            {
                m_anWidth.Add( GetColumnWidth(i) );
            }
    #ifdef wxHAS_LISTCTRL_COLUMN_ORDER
            m_anOrder = GetColumnsOrder();
    #endif
        }

        wxString sCols;
        for(size_t i = 0; i < m_anWidth.GetCount(); ++i)
        {
            sCols += wxString::Format(wxT("%d"), m_anWidth[i]);
            sCols += wxT("|");
        }
        if(pRootNode->HasAttribute(wxT("cols_width")))
            pRootNode->DeleteAttribute(wxT("cols_width"));
        pRootNode->AddAttribute(wxT("cols_width"), sCols);

#ifdef wxHAS_LISTCTRL_COLUMN_ORDER
        wxString sOrd;
        for(size_t i = 0; i < m_anOrder.GetCount(); ++i)
        {
            sOrd += wxString::Format(wxT("%d"), m_anOrder[i]);
            sOrd += wxT("|");
        }

        if(pRootNode->HasAttribute(wxT("cols_order")))
            pRootNode->DeleteAttribute(wxT("cols_order"));
        pRootNode->AddAttribute(wxT("cols_order"), sOrd);
#endif

	}
	else
	{
		m_bSortAsc = GetBoolValue(pRootNode, wxT("sort"), true);
		m_currentSortCol = GetDecimalValue(pRootNode, wxT("sort_col"), 0);
		wxGISEnumContentsViewStyle style = (wxGISEnumContentsViewStyle)GetDecimalValue(pRootNode, wxT("style"), 0);
        //load col width
        wxString sCol = pRootNode->GetAttribute(wxT("cols_width"));
	    wxStringTokenizer tkz(sCol, wxString(wxT("|")), wxTOKEN_RET_EMPTY );
	    while ( tkz.HasMoreTokens() )
	    {
		    wxString token = tkz.GetNextToken();
		    //token.Replace(wxT("|"), wxT(""));
		    int nWidth = wxAtoi(token); //wxLIST_AUTOSIZE
            m_anWidth.Add(nWidth);
	    }

#ifdef wxHAS_LISTCTRL_COLUMN_ORDER
        //load col order
        wxString sOrd = pRootNode->GetAttribute(wxT("cols_order"));
	    wxStringTokenizer tkz_ord(sOrd, wxString(wxT("|")), wxTOKEN_RET_EMPTY );
	    while ( tkz_ord.HasMoreTokens() )
	    {
		    wxString token = tkz_ord.GetNextToken();
		    //token.Replace(wxT("|"), wxT(""));
		    m_anOrder.Add( wxAtoi(token) );
	    }
#endif

        SetStyle(style);

        SORTDATA sortdata = {m_bSortAsc, m_currentSortCol};
		SortItems(GxObjectCVCompareFunction, (long)&sortdata);
	}
}
コード例 #23
0
bool RDRecording::enableMetadata() const
{
  return GetBoolValue("ENABLE_METADATA");
}
コード例 #24
0
void CMediaStream::Initialize (bool check_config_name)

{
  // reads the configuration file
  CConfigEntry::Initialize(check_config_name);

  if (m_valid == false) { 
    return;
  }

  // set variables based on information we read
  if (GetBoolValue(STREAM_VIDEO_ENABLED)) {
    if (m_video_profile_list == NULL) {
      error_message("No video profiles to read");
      m_valid = false;
      return;
    }

    SetVideoProfile(GetStringValue(STREAM_VIDEO_PROFILE));
    if (m_pVideoProfile == NULL) {
      SetVideoProfile("default");
      if (m_pVideoProfile == NULL) {
	error_message("Video profile \"%s\" could not be found in stream %s", 
		      GetStringValue(STREAM_VIDEO_PROFILE),
		      GetStringValue(STREAM_NAME));
	m_valid = false;
	return;
      } 
      SetStringValue(STREAM_VIDEO_PROFILE, "default");
    }
      
  }

  if (GetBoolValue(STREAM_AUDIO_ENABLED)) {
    if (m_audio_profile_list == NULL) {
      error_message("No audio profiles to read");
      m_valid = false;
      return;
    }
    SetAudioProfile(GetStringValue(STREAM_AUDIO_PROFILE));
    if (m_pAudioProfile == NULL) {
      SetAudioProfile("default");
      if (m_pAudioProfile == NULL) {
	error_message("Audio profile \"%s\" could not be found in stream %s", 
		      GetStringValue(STREAM_AUDIO_PROFILE),
		      GetStringValue(STREAM_NAME));
	m_valid = false;
	return;
      } 
      SetStringValue(STREAM_AUDIO_PROFILE, "default");
    }
  }

  if (GetBoolValue(STREAM_TEXT_ENABLED)) {
    if (m_text_profile_list == NULL) {
      error_message("No text profiles to read");
      m_valid = false;
      return;
    }
    SetTextProfile(GetStringValue(STREAM_TEXT_PROFILE));
    if (m_pTextProfile == NULL) {
      SetTextProfile("default");
      if (m_pTextProfile == NULL) {
	error_message("Text profile \"%s\" could not be found in stream %s", 
		      GetStringValue(STREAM_TEXT_PROFILE),
		      GetStringValue(STREAM_NAME));
	m_valid = false;
	return;
      } 
      SetStringValue(STREAM_TEXT_PROFILE, "default");
    }
  }
  // same profile for text here...
  char buffer[PATH_MAX];
  // Set up the file names, if they do not already exist
  const char *last_sep = strrchr(m_filename, '/');
  if (last_sep == NULL) last_sep = m_filename;
  else last_sep++;
  if (GetStringValue(STREAM_SDP_FILE_NAME) == NULL) {
    snprintf(buffer, PATH_MAX, "%s.sdp", last_sep);
    SetStringValue(STREAM_SDP_FILE_NAME, buffer);
    debug_message("Setting stream %s sdp file to \"%s\"", 
		  GetName(), buffer);
  }
  if (GetStringValue(STREAM_RECORD_MP4_FILE_NAME) == NULL) {
    // set file name
    snprintf(buffer, PATH_MAX, "%s.mp4", last_sep);
    SetStringValue(STREAM_RECORD_MP4_FILE_NAME, buffer);
    debug_message("Setting stream %s file to \"%s\"",
		  GetName(), buffer);
  }

  if (GetStringValue(STREAM_CAPTION) == NULL) {
    if (GetStringValue(STREAM_NAME) == NULL)
      SetStringValue(STREAM_CAPTION, "default");
    else
      SetStringValue(STREAM_CAPTION, GetStringValue(STREAM_NAME));
    debug_message("Setting stream %s caption to \"%s\"", 
		  GetName(), GetStringValue(STREAM_NAME));
  }
}
コード例 #25
0
ファイル: ConfigMgr.cpp プロジェクト: yodergj/AppRover
/*!
  @return CFG_FILE_NOT_SPECIFIED if a filename has never been specified
  @return CFG_FILE_MISSING if the file does not exist
  @return CFG_FILE_FORMAT_ERROR if there is a problem with the file data
  @return CFG_OK if successful

  Loads the configuration of the ConfigMgr from file.
*/
ConfigMgrStatusType ConfigMgr::Load(string filename)
{
  xmlDocPtr document;
  xmlNodePtr currentNode;
  string location;
  double version;
  string name;

  if ( filename == "" )
    return CFG_FILE_NOT_SPECIFIED;

  document = xmlParseFile(filename.c_str());

  if ( !document )
    return CFG_FILE_MISSING;

  currentNode = xmlDocGetRootElement(document);
  if ( !currentNode )
  {
    printf("no root node in config\n");
    xmlFreeDoc(document);
    return CFG_FILE_FORMAT_ERROR;
  }

  mRepositoryDirectories.clear();

  version = GetDoubleValue(currentNode, VERSION_STR, 1.0);

  mInstallLogFilename = GetStringValue(currentNode, LOG_STR);
  if ( mInstallLogFilename == "" )
    return CFG_FILE_FORMAT_ERROR;

  mStorageDirectory = GetStringValue(currentNode, STORAGE_STR);
  if ( mStorageDirectory == "" )
    return CFG_FILE_FORMAT_ERROR;

  mWorkDirectory = GetStringValue(currentNode, WORK_STR);
  if ( mWorkDirectory == "" )
    return CFG_FILE_FORMAT_ERROR;

  mInstallFileDirectory = GetStringValue(currentNode, INSTALL_FILE_STR);
  if ( mInstallFileDirectory == "" )
    return CFG_FILE_FORMAT_ERROR;

  mNumProcessors = GetIntValue(currentNode, PROCESSOR_STR, 0);
  if ( mNumProcessors < 1 )
    DetectNumProcessors();

  currentNode = currentNode->children;
  while ( currentNode )
  {
    if ( !strcmp((char *)currentNode->name,REPOSITORY_STR) )
    {
      location = GetStringValue(currentNode, DIR_STR);
      if ( location != "" )
	mRepositoryDirectories.push_back(location);
    }
    else if ( !strcmp((char *)currentNode->name,FEATURE_STR) )
    {
      name = GetStringValue(currentNode, FEATURE_NAME_STR);
      if ( name != "" )
        mFeatureSettings[name] = GetBoolValue(currentNode,ENABLED_STR,false);
    }
    currentNode = currentNode->next;
  }

  mCfgFilename = filename;

  xmlFreeDoc(document);
  return CFG_OK;
}
コード例 #26
0
bool wxToggleButton::GetValue() const
{
    return GetBoolValue();
}
コード例 #27
0
ファイル: displayinfo.cpp プロジェクト: gaoyakun/atom3d
ATOM_DisplayInfo::ATOM_DisplayInfo (void)
{
  IDxDiagProvider*  pDxDiagProvider = 0;
  IDxDiagContainer* pDxDiagRoot = 0;
  BOOL bComInitialized = FALSE;
  IDxDiagContainer* pContainer = NULL;
  IDxDiagContainer* pObject = NULL;
  IDxDiagContainer* pDxDiagSystemInfo = NULL;
  DWORD nInstanceCount = 0;
  DWORD nItem = 0;

  HRESULT hr = CoInitialize (NULL);
  bComInitialized = SUCCEEDED (hr);

  hr = CoCreateInstance (CLSID_DxDiagProvider, NULL, CLSCTX_INPROC_SERVER, IID_IDxDiagProvider, (LPVOID*)&pDxDiagProvider);
  if (FAILED(hr))
    goto LCleanup;

  if (!pDxDiagProvider)
  {
    hr = E_POINTER;
    goto LCleanup;
  }

  DXDIAG_INIT_PARAMS dxDiagInitParam;
  memset(&dxDiagInitParam, 0, sizeof(DXDIAG_INIT_PARAMS));

  dxDiagInitParam.dwSize = sizeof(DXDIAG_INIT_PARAMS);
  dxDiagInitParam.dwDxDiagHeaderVersion = DXDIAG_DX9_SDK_VERSION;
  dxDiagInitParam.bAllowWHQLChecks = false;
  dxDiagInitParam.pReserved = NULL;

  hr = pDxDiagProvider->Initialize( &dxDiagInitParam );
  if( FAILED(hr) )
    goto LCleanup;

  hr = pDxDiagProvider->GetRootContainer( &pDxDiagRoot );
  if( FAILED(hr) )
    goto LCleanup;

  if( FAILED( hr = pDxDiagRoot->GetChildContainer( L"DxDiag_DisplayDevices", &pContainer ) ) )
    goto LCleanup;

  if( FAILED( hr = pContainer->GetNumberOfChildContainers( &nInstanceCount ) ) )
    goto LCleanup;

  WCHAR wszContainer[256];

  for (nItem = 0; nItem < nInstanceCount; nItem++)
  {
    DisplayDeviceInfo *di = ATOM_NEW(DisplayDeviceInfo);
    devices.push_back (di);

    hr = pContainer->EnumChildContainerNames( nItem, wszContainer, 256 );
    if(FAILED(hr))
      goto LCleanup;

    hr = pContainer->GetChildContainer( wszContainer, &pObject );
    if( FAILED( hr ) || pObject == NULL )
      goto LCleanup;

    if( FAILED( hr = GetStringValue( pObject, L"szDescription", di->m_strDescription, ARRAY_SIZE(di->m_strDescription))))
      goto LCleanup;

    if( FAILED( hr = GetStringValue( pObject, L"szManufacturer", di->m_strManufacturer, ARRAY_SIZE(di->m_strManufacturer))))
      goto LCleanup;

    if( FAILED( hr = GetStringValue( pObject, L"szChipType", di->m_strChipType, ARRAY_SIZE(di->m_strChipType))))
      goto LCleanup;

    if( FAILED( hr = GetStringValue( pObject, L"szDisplayMemoryLocalized", di->m_strDisplayMemory, ARRAY_SIZE(di->m_strDisplayMemory))))
      goto LCleanup;

    if( FAILED( hr = GetStringValue( pObject, L"szDisplayModeLocalized", di->m_strATOM_DisplayMode, ARRAY_SIZE(di->m_strATOM_DisplayMode))))
      goto LCleanup;

    if( FAILED( hr = GetStringValue( pObject, L"szDriverName", di->m_strDriverName, ARRAY_SIZE(di->m_strDriverName))))
      goto LCleanup;

    if( FAILED( hr = GetStringValue( pObject, L"szDriverVersion", di->m_strDriverVersion, ARRAY_SIZE(di->m_strDriverVersion))))
      goto LCleanup;

    if( FAILED( hr = GetStringValue( pObject, L"szDriverDateLocalized", di->m_strDriverDate, ARRAY_SIZE(di->m_strDriverDate))))
      goto LCleanup;

	if( FAILED( hr = GetStringValue( pObject, L"szVendorId", di->m_strVendorId, ARRAY_SIZE(di->m_strVendorId))))
	  goto LCleanup;

	if( FAILED( hr = GetStringValue( pObject, L"szDeviceId", di->m_strDeviceId, ARRAY_SIZE(di->m_strDeviceId))))
	  goto LCleanup;

	if( FAILED( hr = GetStringValue( pObject, L"szSubSysId", di->m_strSubSysId, ARRAY_SIZE(di->m_strSubSysId))))
	  goto LCleanup;

	if( FAILED( hr = GetStringValue( pObject, L"szRevisionId", di->m_strRevisionId, ARRAY_SIZE(di->m_strRevisionId))))
	  goto LCleanup;

    if( FAILED( hr = GetBoolValue( pObject, L"bDDAccelerationEnabled", &di->m_bDDAccelerationEnabled)))
      goto LCleanup;

    if( FAILED( hr = GetBoolValue( pObject, L"b3DAccelerationExists", &di->m_b3DAccelerationExists)))
      goto LCleanup;

    if( FAILED( hr = GetBoolValue( pObject, L"b3DAccelerationEnabled", &di->m_b3DAccelerationEnabled)))
      goto LCleanup;

    if( FAILED( hr = GetBoolValue( pObject, L"bAGPEnabled", &di->m_bAGPEnabled)))
      goto LCleanup;

    if( FAILED( hr = GetBoolValue( pObject, L"bAGPExists", &di->m_bAGPExists)))
      goto LCleanup;

    SAFE_RELEASE(pObject);
  }

  //get dx version
  if( FAILED( hr = pDxDiagRoot->GetChildContainer( L"DxDiag_SystemInfo", &pDxDiagSystemInfo ) ) )
    goto LCleanup;

  if( FAILED( hr = GetIntValue( pDxDiagSystemInfo, L"dwDirectXVersionMajor", &dxverion.nDXVersionMajor)))
    goto LCleanup;

  if( FAILED( hr = GetIntValue( pDxDiagSystemInfo, L"dwDirectXVersionMinor", &dxverion.nDXVersionMinor)))
    goto LCleanup;

  if( FAILED( hr = GetStringValue( pDxDiagSystemInfo, L"szDirectXVersionLetter", dxverion.sDXVersionLetter, ARRAY_SIZE(dxverion.sDXVersionLetter))))
    goto LCleanup;

LCleanup:
  SAFE_RELEASE(pObject);
  SAFE_RELEASE(pContainer);
  SAFE_RELEASE(pDxDiagSystemInfo);
  SAFE_RELEASE(pDxDiagRoot);
  SAFE_RELEASE(pDxDiagProvider);

  if (FAILED(hr) && !devices.empty())
  {
    ATOM_DELETE(devices.back ());
    devices.pop_back ();
  }

  if (bComInitialized)
    CoUninitialize ();
}
コード例 #28
0
bool CGridSampleLimits::TransferDataFromWindow()
{
  bool bRtn = (m_pData != NULL) && (m_pMessageBook != NULL);
  if(bRtn)
  {
    wxString s;
    double d;
    int n;
    bool bCreateIfNeeded;
    s = GetCellValue(ROW_PULLUP,0);
    n = CPanelLabSettings::Str2Int(s);
    m_pData->SetMaxNumberOfPullupsPerSample(n);

    s = GetCellValue(ROW_STUTTER,0);
    n = CPanelLabSettings::Str2Int(s);
    m_pData->SetMaxNumberOfStutterPeaksPerSample(n);

    s = GetCellValue(ROW_ADENYLATION,0);
    n = CPanelLabSettings::Str2Int(s);
    m_pData->SetMaxNumberOfAdenylationsPerSample(n);

    s = GetCellValue(ROW_OFF_LADDER,0);
    n = CPanelLabSettings::Str2Int(s);
    m_pData->SetMaxNumberOfOLAllelesPerSample(n);

    s = GetCellValue(ROW_RESIDUAL,0);
    d = CPanelLabSettings::Str2Double(s);
    m_pData->SetMaxResidualForAlleleCall(d);

    s = GetCellValue(ROW_EXCESSIVE_RESIDUAL,0);
    n = CPanelLabSettings::Str2Int(s);
    m_pData->SetMaxExcessiveResidual(n);

    s = GetCellValue(ROW_RFU_INCOMPLETE_SAMPLE,0);
    n = CPanelLabSettings::Str2Int(s);
    m_pData->SetMaxRFUForIncompleteSample(n);

    s = GetCellValue(ROW_MIN_BPS_ARTIFACTS,0);
    n = CPanelLabSettings::Str2Int(s);
    m_pData->SetMinBPSForArtifacts(n);


    // message book parameters

    int nRow = ROW_MESSAGE_BOOK_OFFSET;
    vector<const CXMLmessageBookSM *>::iterator itrMsg;
    for(itrMsg = m_vpMsgBookSM.begin();
      itrMsg != m_vpMsgBookSM.end();
      ++itrMsg)
    {
      if(!(*itrMsg)->EmptyDescriptor())
      {
        if((*itrMsg)->IsPreset())
        {
          n = GetBoolValue(nRow,0) ? 1 : 0;
        }
        else
        {
          s = GetCellValue(nRow,0);
          n = CPanelLabSettings::Str2Int(s,-1);
        }
        bCreateIfNeeded = (n != (*itrMsg)->GetThreshold());
        m_pData->SetValue((*itrMsg)->GetName(),n,bCreateIfNeeded);
        ++nRow;
      }

      // need validation
    }
  }
  return bRtn;
}
コード例 #29
0
ファイル: OptionsMisc.cpp プロジェクト: Joincheng/lithtech
// Load/Save
BOOL COptionsMisc::Load()
{
	m_bParentFolder = GetBoolValue	("ParentFolder", TRUE) ? true : false;

	// Load Icons Info
	m_bShowIcons = GetBoolValue ("ShowIcons", TRUE) ? true : false;

	// Load Thumbnails Info
	m_bShowThumbnails = GetBoolValue ("ShowThumbnails", TRUE) ? true : false;

	SetAutoExtractIcons(GetBoolValue("AutoExtractIcons", TRUE) ? true : false);
	SetAutoExtractClassHelp(GetBoolValue("AutoExtractClassHelp", TRUE) ? true : false);

	m_bShowUndoWarnings = GetBoolValue ("ShowUndoWarnings", TRUE) ? true : false;

	m_bShowFullPath = GetBoolValue("ShowFullPathInTitle", FALSE) ? true : false;

	m_bAutoLoadProj = GetBoolValue("AutoLoadProj", TRUE) ? true : false;

	m_bDefaultCompressed = GetBoolValue("DefaultCompressed", TRUE) ? true : false;
	m_bLoadLYTFile = GetBoolValue("LoadLYTFile", TRUE) ? true : false;
	m_bUndoFreezeHide = GetBoolValue("UndoFreezeHide", FALSE) ? true : false;

	// Load undo data
	m_dwUndos			= GetDWordValue("NumUndos", 40);

	SetVectorEditIncrement(atof(GetStringValue("VectorEditIncrement", "0.1")));
	SetVectorEditAutoApply(GetBoolValue("VectorEditAutoApply", TRUE) ? true : false);
	SetRotationEditAutoApply(GetBoolValue("RotationEditAutoApply", TRUE) ? true : false);

	return TRUE;
}
コード例 #30
0
bool RDRecording::sat() const
{
  return GetBoolValue("SAT");
}