void mux_dialog::on_output_available(wxCommandEvent &evt) { wxString line = evt.GetString(); log += line; if (line.Right(1) != wxT("\r")) log += wxT("\n"); if (line.Find(Z("Warning:")) == 0) tc_warnings->AppendText(line + wxT("\n")); else if (line.Find(Z("Error:")) == 0) tc_errors->AppendText(line + wxT("\n")); else if (line.Find(Z("Progress")) == 0) { if (line.Find(wxT("%")) != 0) { line.Remove(line.Find(wxT("%"))); auto tmp = line.AfterLast(wxT(' ')); long value = 0; tmp.ToLong(&value); if ((value >= 0) && (value <= 100)) update_gauge(value); } } else if (line.Length() > 0) tc_output->AppendText(line + wxT("\n")); update_remaining_time(); }
LONG PerformanceCounter::NextLong() { PDH_FMT_COUNTERVALUE value; auto status = NextValue(PDH_FMT_LONG, &value); if (status != ERROR_SUCCESS) return LONG_MIN; return ToLong(value); }
///////////////////////////////////////////////////////////// // Click on the Ok button, check and save config ///////////////////////////////////////////////////////////// void CConfigDialog::OnOk(wxCommandEvent& WXUNUSED(event)) { // Save all values CConfig::GetSingleton()->SetLanguage(m_pLanguage->GetValue()); CConfig::GetSingleton()->SetSoundFlag(m_pPlaySounds->GetValue()); if(m_pRecordOptions->GetValue() == "USB+PC") { CConfig::GetSingleton()->SetRecordOption(2); } else if(m_pRecordOptions->GetValue() == "PC") { CConfig::GetSingleton()->SetRecordOption(3); } else { CConfig::GetSingleton()->SetRecordOption(1); } if(m_pCodec->GetValue() == "720") { CConfig::GetSingleton()->SetVideoCodec(Codec_H264_720P); } else { CConfig::GetSingleton()->SetVideoCodec(Codec_H264_360P); } if(m_pHudStyle->GetValue() == "HUD1") { CConfig::GetSingleton()->SetHudStyle(1); } else { CConfig::GetSingleton()->SetHudStyle(2); } CConfig::GetSingleton()->SetHudColor(m_pHudColor->GetColour()); CConfig::GetSingleton()->SetHudLineSize(ToLong(m_pHudLineSize->GetValue())); CConfig::GetSingleton()->SetUsUnitFlag(m_pUSUnit->GetValue()); CConfig::GetSingleton()->SetLowResFlag(m_pUseLowRes->GetValue()); CConfig::GetSingleton()->SetSpeedLimit(m_pMaxSpeed->GetValue()); CConfig::GetSingleton()->SetAccelerationLimit(m_pMaxAcceleration->GetValue()); CConfig::GetSingleton()->SetAltitudeLimit(m_pMaxAltitude->GetValue()); // Save to file CConfig::GetSingleton()->SaveConfig(); EndModal(0); }
bool PerformanceCounter::Next(std::vector<LONG>* values) { DWORD count = 0; auto buffer = NextArray(PDH_FMT_LONG, &count); if (buffer == nullptr) return false; auto items = reinterpret_cast<PDH_FMT_COUNTERVALUE_ITEM*>(buffer.get()); values->clear(); values->reserve(count); for (DWORD i = 0; i < count; ++i) values->push_back(ToLong(items[i].FmtValue)); return true; }
void mux_dialog::on_output_available(wxCommandEvent &evt) { wxString line = evt.GetString(); log += line; if (line.Right(1) != wxT("\r")) log += wxT("\n"); if (line.Find(Z("Warning:")) == 0) tc_warnings->AppendText(line + wxT("\n")); else if (line.Find(Z("Error:")) == 0) tc_errors->AppendText(line + wxT("\n")); else if (line.Find(wxT("#GUI#begin_scanning_playlists")) == 0) m_scanning_playlists = true; else if (line.Find(wxT("#GUI#end_scanning_playlists")) == 0) { m_scanning_playlists = false; m_start_time = mtx::sys::get_current_time_millis(); m_next_remaining_time_update = m_start_time + 8000; } else if (line.Find(wxT("#GUI#progress ")) == 0) { if (line.Find(wxT("%")) != 0) { line.Remove(line.Find(wxT("%"))); auto tmp = line.AfterLast(wxT(' ')); long value = 0; tmp.ToLong(&value); if ((value >= 0) && (value <= 100)) update_gauge(value); } } else if (line.Length() > 0) tc_output->AppendText(line + wxT("\n")); update_remaining_time(); }
bool isZero() const { return ToLong( this->ref ) == 0; }
bool isNegative() const { return ToLong( this->ref ) < 0; }
bool isPositive() const { return ToLong( this->ref ) > 0; }