void RDCueEdit::SetStartMode(bool state) { if(state) { edit_slider->setRange(0,edit_position_bar->marker(RDMarkerBar::End)); edit_slider->setGeometry(60,30, (int)(50.0+((double)(sizeHint().width()-200)* (double)edit_position_bar-> marker(RDMarkerBar::End)/ (double)edit_logline-> forcedLength())),50); edit_slider->setValue(edit_position_bar->marker(RDMarkerBar::Start)); edit_slider->setKnobColor(RD_CUEEDITOR_START_MARKER); edit_audition_button->setAccentColor(RD_CUEEDITOR_START_MARKER); edit_start_button->setFlashingEnabled(true); edit_up_label->setPalette(edit_start_color); edit_down_label->setPalette(edit_start_color); UpdateCounters(); } else { edit_slider->setRange(0,edit_logline->forcedLength()); edit_slider->setGeometry(60,30,sizeHint().width()-150,50); edit_slider->setValue(edit_position_bar->marker(RDMarkerBar::Play)); edit_slider->setKnobColor(RD_CUEEDITOR_PLAY_MARKER); edit_audition_button->setAccentColor(RD_CUEEDITOR_PLAY_MARKER); edit_start_button->setFlashingEnabled(false); edit_up_label->setPalette(palette()); edit_down_label->setPalette(palette()); UpdateCounters(); } }
bool RDCueEdit::initialize(RDLogLine *logline) { edit_logline=logline; edit_position_bar->setLength(edit_logline->forcedLength()); edit_start_button->setOn(false); if(!(edit_logline->status()==RDLogLine::Scheduled) && !(edit_logline->status()==RDLogLine::Paused)) { edit_start_button->hide(); edit_end_button->hide(); } else { edit_start_button->show(); edit_end_button->show(); } edit_slider->setRange(0,edit_logline->forcedLength()); edit_slider->setValue(edit_logline->playPosition()); sliderChangedData(edit_logline->playPosition()); startClickedData(); edit_stop_button->on(); edit_position_bar-> setMarker(RDMarkerBar::Play,edit_logline->playPosition()); edit_position_bar-> setMarker(RDMarkerBar::Start,edit_logline->playPosition()); edit_position_bar-> setMarker(RDMarkerBar::End,edit_logline->endPoint()); edit_slider->setValue(edit_logline->playPosition()); UpdateCounters(); return true; }
char IR_Update() { // Check main sensor #ifdef USE_SAMPLING if (IsTimerExpired(TIMER_IR)) { /* char result = IsMainTriggered(); #ifdef USE_LEDS if (result) LED_OnBank(LED_BANK3, 0x1); else LED_OffBank(LED_BANK3, 0x1); #endif irState[IR_MAIN_I] = result; // Check angle sensor result = IsAngleTriggered(); #ifdef USE_LEDS if (result) LED_OnBank(LED_BANK3, 0x8); else LED_OffBank(LED_BANK3, 0x8); #endif irState[IR_ANGLE_I] = result; */ UpdateCounters(); InitTimer(TIMER_IR, UPDATE_DELAY); } #endif return TRUE; }
void RenderEngine::UpdateFilm() { boost::unique_lock<boost::mutex> lock(engineMutex); if (started) { elapsedTime = WallClockTime() - startTime; UpdateFilmLockLess(); UpdateCounters(); const float haltthreshold = renderConfig->cfg.GetFloat("batch.haltthreshold", -1.f); if (haltthreshold >= 0.f) { // Check if it is time to run the convergence test again const u_int imgWidth = film->GetWidth(); const u_int imgHeight = film->GetHeight(); const u_int pixelCount = imgWidth * imgHeight; const double now = WallClockTime(); // Do not run the test if we don't have at least 16 new samples per pixel if ((samplesCount - lastConvergenceTestSamplesCount > pixelCount * 16) && ((now - lastConvergenceTestTime) * 1000.0 >= renderConfig->GetScreenRefreshInterval())) { film->UpdateScreenBuffer(); // Required in order to have a valid convergence test convergence = 1.f - film->RunConvergenceTest() / (float)pixelCount; lastConvergenceTestTime = now; lastConvergenceTestSamplesCount = samplesCount; } } } }
void GameWorld::update(float dt) { // update the world world_->Step(dt, 8, 3); // update all game objects clown_->Update(); if(base_platform_) { base_platform_->Update(); } for(int i = 0; i < num_collectibles_active_; ++i) { ((Collectible*)active_collectibles_->objectAtIndex(i))->Update(); } // update platform if user is dragging one if(platform_->isVisible() && !touch_start_.equals(CCPointZero)) { platform_->setPosition(game_object_layer_->convertToNodeSpace(touch_start_)); } // walls must move along with clown wall_->SetTransform(b2Vec2(0, clown_->GetBody()->GetPosition().y - SCREEN_TO_WORLD(SCREEN_SIZE.height/2)), 0); // background must scroll with respect to clown background_manager_->Update( has_game_begun_ ? ((clown_->GetBody()->GetLinearVelocity().y) * -1) : 0 ); // game_object_layer_ must move in opposite direction of clown // subtract SCREEN_SIZE.height/2 so that clown always stays in centre of the screen float position_y = -1 * (clown_->getPositionY() - SCREEN_SIZE.height/2); game_object_layer_->setPositionY( position_y > 0 ? 0 : position_y ); UpdateCounters(); }
void RDCueEdit::recue() { edit_position_bar->setMarker(RDMarkerBar::Start,0); if(edit_start_button->isOn()) { edit_slider->setValue(0); } UpdateCounters(); }
void RDCueEdit::positionData(int id,int msecs) { if(id!=RDPLAYDECK_AUDITION_ID) { return; } edit_position_bar->setMarker(RDMarkerBar::Play,msecs); if((!edit_start_button->isOn())&&(!edit_end_button->isOn())) { edit_slider->setValue(msecs); } UpdateCounters(); }
// -------------------------------------------------------------------------------- // void guImportFiles::OnAddFilesClicked( wxCommandEvent &event ) { wxFileDialog * FileDialog = new wxFileDialog( this, _( "Select files" ), wxGetHomeDir(), wxEmptyString, wxString( _( "Audio files" ) ) + wxT( "|*.mp3;*.ogg;*.oga;*.flac;*.mp4;*.m4a;*.m4b;*.m4p;*.aac;*.wma;*.asf;*.ape;*.wav;*.aif;*.wv;*.tta;*.mpc|" ) + wxString( _( "mp3 files" ) ) + wxT( " (*.mp3)|*.mp3|" ) + wxString( _( "ogg files" ) ) + wxT( " (*.ogg;*.oga)|*.ogg;*.oga|" ) + wxString( _( "flac files" ) ) + wxT( " (*.flac)|*.flac|" ) + wxString( _( "mp4 files" ) ) + wxT( " (*.mp4;*.m4a)|*.mp4;*.m4a;*.m4b;*.m4p;*.aac|" ) + wxString( _( "wma files" ) ) + wxT( " (*.wma;*.asf)|*.wma;*.asf|" ) + wxString( _( "ape files" ) ) + wxT( " (*.ape)|*.ape|" ) + wxString( _( "waf files" ) ) + wxT( " (*.wav)|*.wav|" ) + wxString( _( "aif files" ) ) + wxT( " (*.aif)|*.aif|" ) + wxString( _( "wv files" ) ) + wxT( " (*.wv)|*.wv|" ) + wxString( _( "tta files" ) ) + wxT( " (*.tta)|*.tta|" ) + wxString( _( "mpc files" ) ) + wxT( " (*.mpc)|*.mpc" ), wxFD_OPEN|wxFD_FILE_MUST_EXIST|wxFD_MULTIPLE|wxFD_PREVIEW ); if( FileDialog ) { if( FileDialog->ShowModal() == wxID_OK ) { wxArrayString NewFiles; FileDialog->GetPaths( NewFiles ); int Index; int Count = NewFiles.Count(); for( Index = 0; Index < Count; Index++ ) { wxString NewFile = NewFiles[ Index ]; //guLogMessage( wxT( "Openning file '%s'" ), NewFile.c_str() ); if( wxFileExists( NewFile ) && guIsValidAudioFile( NewFile.Lower() ) ) { guTrack * Track = new guTrack(); if( Track->ReadFromFile( NewFile ) ) { Track->m_Type = guTRACK_TYPE_NOTDB; m_Tracks->Add( Track ); m_FilesListBox->Append( NewFile.AfterLast( wxT( '/' ) ) ); } else { delete Track; } } } UpdateCounters(); CheckButtons(); } FileDialog->Destroy(); } }
void CAICounter_Alertness::Update( float frameTime ) { m_bJustUpdated = false; if (m_listeners.empty()) return; float currTime = gEnv->pTimer->GetCurrTime(); if (currTime<m_timeNextUpdate) return; m_timeNextUpdate = currTime + UPDATE_INTERVAL; UpdateCounters(); }
// -------------------------------------------------------------------------------- // void guImportFiles::OnDelFilesClicked( wxCommandEvent &event ) { wxArrayInt Selected; m_FilesListBox->GetSelections( Selected ); int Index; int Count = Selected.Count(); for( Index = 0; Index < Count; Index++ ) { m_FilesListBox->Delete( Selected[ Index ] ); m_Tracks->RemoveAt( Selected[ Index ] ); } UpdateCounters(); CheckButtons(); }
void RDCueEdit::sliderChangedData(int pos) { if(edit_start_button->isOn()) { edit_position_bar->setMarker(RDMarkerBar::Start,pos); } else { if(edit_end_button->isOn()) { edit_position_bar->setMarker(RDMarkerBar::End,pos); } else { edit_position_bar->setMarker(RDMarkerBar::Play,pos); } } UpdateCounters(); }
Gui::Gui(QWidget *parent) : QMainWindow(parent), ui(new Ui::Gui) { density = 0; side = 2; model = new BoardModel(parent); model->generate(side, density); ui->setupUi(this); ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); ui->tableView->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch); ui->tableView->setModel(model); connect(model, SIGNAL(UpdateCounters()), this, SLOT(UpdateLabels())); }
void CAICounter_Alertness::InstantUpdateIfNeed() { if (!m_bJustUpdated) UpdateCounters(); }
// -------------------------------------------------------------------------------- // void guImportFiles::CreateControls( void ) { guConfig * Config = ( guConfig * ) guConfig::Get(); SetSizeHints( wxDefaultSize, wxDefaultSize ); wxBoxSizer * MainSizer = new wxBoxSizer( wxVERTICAL ); wxStaticBoxSizer * MainStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); wxFlexGridSizer * CopyToSizer = new wxFlexGridSizer( 2, 0, 0 ); CopyToSizer->AddGrowableCol( 1 ); CopyToSizer->SetFlexibleDirection( wxBOTH ); CopyToSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); wxStaticText * CopyToStaticText = new wxStaticText( this, wxID_ANY, _( "Copy to Option:" ), wxDefaultPosition, wxDefaultSize, 0 ); CopyToStaticText->Wrap( -1 ); CopyToSizer->Add( CopyToStaticText, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); wxBoxSizer * CopyToChoiceSIzer = new wxBoxSizer( wxHORIZONTAL ); wxArrayString CopyToOptions = Config->ReadAStr( CONFIG_KEY_COPYTO_OPTION, wxEmptyString, CONFIG_PATH_COPYTO ); int Index; int Count; if( ( Count = CopyToOptions.Count() ) ) { for( Index = 0; Index < Count; Index++ ) { CopyToOptions[ Index ] = CopyToOptions[ Index ].BeforeFirst( wxT( ':' ) ); } } guMediaCollection * MediaCollection = m_MediaViewer->GetMediaCollection(); int CopyToIndex = CopyToOptions.Index( MediaCollection->m_DefaultCopyAction ); m_CopyToChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, CopyToOptions, 0 ); m_CopyToChoice->SetSelection( CopyToIndex ); CopyToChoiceSIzer->Add( m_CopyToChoice, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxEXPAND, 5 ); m_CopyToSetupBtn = new wxBitmapButton( this, wxID_ANY, guImage( guIMAGE_INDEX_tiny_search_engine ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); CopyToChoiceSIzer->Add( m_CopyToSetupBtn, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 ); CopyToSizer->Add( CopyToChoiceSIzer, 1, wxEXPAND, 5 ); wxStaticText * DestPathStaticText = new wxStaticText( this, wxID_ANY, _( "Destination Folder:" ), wxDefaultPosition, wxDefaultSize, 0 ); DestPathStaticText->Wrap( -1 ); CopyToSizer->Add( DestPathStaticText, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_DestPathDirPicker = new wxDirPickerCtrl( this, wxID_ANY, wxEmptyString, _( "Select a folder" ), wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE|wxDIRP_DIR_MUST_EXIST ); m_DestPathDirPicker->SetPath( m_MediaViewer->AudioPath() ); CopyToSizer->Add( m_DestPathDirPicker, 0, wxEXPAND|wxBOTTOM|wxRIGHT, 5 ); MainStaticBoxSizer->Add( CopyToSizer, 0, wxEXPAND, 5 ); wxStaticBoxSizer * FilesSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _( " Files " ) ), wxVERTICAL ); m_FilesListBox = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_MULTIPLE ); Count = m_Tracks->Count(); for( Index = 0; Index < Count; Index++ ) { const guTrack & CurTrack = m_Tracks->Item( Index ); wxString CurFile = CurTrack.m_FileName.AfterLast( wxT( '/' ) ); if( CurTrack.m_Offset ) { CurFile += wxT( "@" ) + LenToString( CurTrack.m_Offset ); CurFile += wxT( " / " ) + LenToString( CurTrack.m_Length ); } m_FilesListBox->Append( CurFile ); } FilesSizer->Add( m_FilesListBox, 1, wxEXPAND|wxALL, 5 ); wxBoxSizer * AddFilesSizer = new wxBoxSizer( wxHORIZONTAL ); m_AddFilesBtn = new wxBitmapButton( this, wxID_ANY, guImage( guIMAGE_INDEX_tiny_add ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); AddFilesSizer->Add( m_AddFilesBtn, 0, wxLEFT, 5 ); m_DelFilesBtn = new wxBitmapButton( this, wxID_ANY, guImage( guIMAGE_INDEX_tiny_del ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); m_DelFilesBtn->Enable( false ); AddFilesSizer->Add( m_DelFilesBtn, 0, wxRIGHT, 5 ); AddFilesSizer->Add( 0, 0, 1, wxEXPAND, 5 ); m_FilesLabel = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_FilesLabel->Wrap( -1 ); AddFilesSizer->Add( m_FilesLabel, 0, wxRIGHT|wxLEFT|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); FilesSizer->Add( AddFilesSizer, 0, wxEXPAND, 5 ); MainStaticBoxSizer->Add( FilesSizer, 1, wxEXPAND, 5 ); MainSizer->Add( MainStaticBoxSizer, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); wxStdDialogButtonSizer * DlgButtons = new wxStdDialogButtonSizer(); m_DlgButtonsOK = new wxButton( this, wxID_OK ); m_DlgButtonsOK->Enable( !m_CopyToChoice->GetStringSelection().IsEmpty() && !m_DestPathDirPicker->GetPath().IsEmpty() && !m_FilesListBox->IsEmpty() ); DlgButtons->AddButton( m_DlgButtonsOK ); wxButton * DlgButtonsCancel = new wxButton( this, wxID_CANCEL ); DlgButtons->AddButton( DlgButtonsCancel ); DlgButtons->SetAffirmativeButton( m_DlgButtonsOK ); DlgButtons->SetCancelButton( DlgButtonsCancel ); DlgButtons->Realize(); MainSizer->Add( DlgButtons, 0, wxEXPAND|wxALL, 5 ); SetSizer( MainSizer ); Layout(); m_DlgButtonsOK->SetDefault(); UpdateCounters(); m_CopyToSetupBtn->Bind( wxEVT_BUTTON, &guImportFiles::OnCopyToSetupClicked, this ); m_FilesListBox->Bind( wxEVT_LISTBOX, &guImportFiles::OnFileSelected, this ); m_AddFilesBtn->Bind( wxEVT_BUTTON, &guImportFiles::OnAddFilesClicked, this ); m_DelFilesBtn->Bind( wxEVT_BUTTON, &guImportFiles::OnDelFilesClicked, this ); Bind( guConfigUpdatedEvent, &guImportFiles::OnConfigUpdated, this, ID_CONFIG_UPDATED ); }