コード例 #1
0
void Options::load() {
  try {
    RegistryKey settings = getKey();
    const DefaultOptions defaultOptions;
    m_dirList           = settings.getString(_T("dirlist")         , defaultOptions.m_dirList           );
    m_startSelectDir    = settings.getString(_T("startselectdir")  , defaultOptions.m_startSelectDir    );
    m_confirmChoise     = settings.getBool(  _T("confirmchoise")   , defaultOptions.m_confirmChoise     );
    m_autoSelect        = settings.getBool(  _T("autoselect")      , defaultOptions.m_autoSelect        );
    m_allowDuplicates   = settings.getBool(  _T("allowduplicates") , defaultOptions.m_allowDuplicates   );
    m_md5password       = settings.getString(_T("password")        , defaultOptions.m_md5password       );
    m_maxChoise         = settings.getInt(   _T("maxchoise")       , defaultOptions.m_maxChoise         );
    m_volume            = settings.getInt(   _T("volume")          , defaultOptions.m_volume            );
    m_backgroundColor   = settings.getUint(  _T("backgroundcolor") , defaultOptions.m_backgroundColor   );
    m_currentTrackColor = settings.getUint(  _T("currentcolor")    , defaultOptions.m_currentTrackColor );
    m_mediaQueueColor   = settings.getUint(  _T("playqueuecolor")  , defaultOptions.m_mediaQueueColor   );
  } catch(Exception e) {
    showException(e);
  }
}
コード例 #2
0
void InitializeParameters::load() {
  try {
    InitializeParameters defaultValues;
    RegistryKey key = getKey();
    m_elementCount        =  key.getInt(   _T("elementcount")    , (UINT)defaultValues.m_elementCount);
    m_elementSize         =  key.getInt(   _T("elementsize")     , defaultValues.m_elementSize );
    String initMethodName =  key.getString(_T("initmethod")      , _T("random")                    );
    m_initMethod = nameToInitMethod(initMethodName);

    m_randomizationMethod = (RandomizationMethod)key.getInt(    _T("randomize")       , defaultValues.m_randomizationMethod);
    m_seed                = key.getUint(   _T("seed")            , defaultValues.m_seed        );
    m_periodCount         = key.getUint(   _T("periodcount")     , defaultValues.m_periodCount );
    m_fileName            = key.getString( _T("filename")        , defaultValues.m_fileName    );
    if(m_initMethod == IDC_RADIO_FILEDATA) {
      readTextFile(m_fileName);
    }
  } catch(Exception e) {
    setDefault();
  }
}