void TTraceRecorder::slotNewTrack(QString name) { QMutexLocker locker(&_mutex); if(_recordState == started) { endTrack(); _trackName = (name == QString("")) ? QString("Transit") : name; _samples = 0; emit signalRecordInfo(_filename, 0); } }
int Part::lyricCount() { if (!score()) return 0; int count = 0; Segment::Type st = Segment::Type::ChordRest; for (Segment* seg = score()->firstMeasure()->first(st); seg; seg = seg->next1(st)) { for (int i = startTrack(); i < endTrack() ; ++i) { ChordRest* cr = toChordRest(seg->element(i)); if (cr) count += cr->lyrics().size(); } } return count; }
Player::Player(QWidget *parent) : QWidget(parent), ui(new Ui::Player) { ui->setupUi(this); m_vlc = new QlibVLC(); connect(m_vlc, SIGNAL(positionChanged(int)), this, SLOT(timeChanged(int))); connect(m_vlc, SIGNAL(endTrack()), this, SLOT(endPlaying())); m_fileLoaded = false; std::vector<QlibVLCOutput> outputs = m_vlc->getOutputs(); ui->comboBoxOutputs->addItem("No specified"); for(int i=0; i<outputs.size(); i++) { ui->comboBoxOutputs->addItem(outputs[i].description); } connect(ui->comboBoxOutputs, SIGNAL(currentIndexChanged(QString)), this, SLOT(outputSelected_change(QString))); connect(ui->sliderVolume, SIGNAL(sliderMoved(int)), m_vlc, SLOT(setVolume(int))); }
void TTraceRecorder::close() { if(_tracks != NULL) { endTrack(); delete _tracks; delete _waypoints; _tracks = NULL; _waypoints = NULL; QFile meta(_tmpDir + '/' + _filename + ".met"); if(meta.open(QIODevice::WriteOnly)) { QString str; str = QString("\n <metadata>\n"); str += QString(" <link href=\"http://tvuillaume.free.fr/NeronGPS\">\n"); str += QString(" <text>NeronGPS</text>\n"); str += QString(" </link>\n"); if(!_firstSample) { str += QString(" <bounds"); str += QString(" minlat=\"") + QString("%1").arg(_minLat, 0, 'f', 10) + QString("\""); str += QString(" minlon=\"") + QString("%1").arg(_minLon, 0, 'f', 10) + QString("\""); str += QString(" maxlat=\"") + QString("%1").arg(_maxLat, 0, 'f', 10) + QString("\""); str += QString(" maxlon=\"") + QString("%1").arg(_maxLon, 0, 'f', 10) + QString("\""); str += QString("/>\n"); } str += QString(" </metadata>\n"); meta.write(str.toAscii()); meta.close(); } QStringList input; input += QString(_tmpDir + '/' + _filename + ".met"); input += QString(_tmpDir + '/' + _filename + ".wpt"); input += QString(_tmpDir + '/' + _filename + ".trk"); TGpxBuilder *builder = new TGpxBuilder(_dir + '/' + _filename + ".gpx", input); _threads.addThread(builder); } }
void FastSimModelTracker::DoIt(const G4FastTrack& aFastTrack, G4FastStep& aFastStep) { // Calculate the position of the particle at the end of volume const G4Track* track = aFastTrack.GetPrimaryTrack(); G4ThreeVector spin = track->GetPolarization() ; G4FieldTrack aFieldTrack('t'); G4FieldTrackUpdator::Update(&aFieldTrack,track); G4double retSafety= -1.0; ELimited retStepLimited; G4FieldTrack endTrack('a'); G4double currentMinimumStep= 10*m; // TODO change that to sth connected to particle momentum and geometry G4PathFinder* fPathFinder = G4PathFinder::GetInstance(); fPathFinder->ComputeStep( aFieldTrack, currentMinimumStep, 0, track->GetCurrentStepNumber(), retSafety, retStepLimited, endTrack, track->GetVolume() ); aFastStep.ProposePrimaryTrackFinalPosition( endTrack.GetPosition() ); // Smear particle's momentum according to the tracker resolution G4ThreeVector Psm = track->GetMomentum(); m_smearTool->smearMomentum(Psm); G4ThreeVector DeltaP = track->GetMomentum() - Psm; G4double Ekinorg = track->GetKineticEnergy(); aFastStep.ClearDebugFlag(); // to disable Geant checks on energy aFastStep.ProposePrimaryTrackFinalKineticEnergyAndDirection(Ekinorg+DeltaP.mag(), Psm.unit()); // Keep track of smeared momentum if(track->GetParentID()==0) { ParticleInformation* info = dynamic_cast<ParticleInformation*>(track->GetDynamicParticle()->GetPrimaryParticle()->GetUserInformation()); info->setSmeared(true); info->setEndStatus(1); // how it is defined ???? as in HepMC ? info->setEndMomentum(Psm); info->setVertexPosition( track->GetVertexPosition()); } }
void FastSimModelTracker::DoIt(const G4FastTrack& aFastTrack, G4FastStep& aFastStep) { // Calculate the position of the particle at the end of volume const G4Track* track = aFastTrack.GetPrimaryTrack(); G4ThreeVector spin = track->GetPolarization() ; G4FieldTrack theFieldTrack = G4FieldTrack( track->GetPosition(), track->GetMomentumDirection(), 0.0, track->GetKineticEnergy(), track->GetDynamicParticle()->GetDefinition()->GetPDGMass(), 0.0, track->GetGlobalTime(), // Lab. track->GetProperTime(), // Part. &spin) ; G4double retSafety= -1.0; ELimited retStepLimited; G4FieldTrack endTrack('a'); G4double currentMinimumStep= 10*m; // TODO change that to sth connected to particle momentum and geometry G4PathFinder* fPathFinder = G4PathFinder::GetInstance(); fPathFinder->ComputeStep( theFieldTrack, currentMinimumStep, 0, track->GetCurrentStepNumber(), retSafety, retStepLimited, endTrack, track->GetVolume() ); aFastStep.ProposePrimaryTrackFinalPosition( endTrack.GetPosition() ); // Smear particle's momentum according to the tracker resolution (set in SimpleSmear) G4ThreeVector Psm = track->GetMomentum(); m_smearTool->smearMomentum(Psm); G4ThreeVector DeltaP = track->GetMomentum() - Psm; G4double Ekinorg = track->GetKineticEnergy(); aFastStep.ClearDebugFlag(); // to disable Geant checks on energy aFastStep.ProposePrimaryTrackFinalKineticEnergyAndDirection(Ekinorg+DeltaP.mag(), Psm.unit()); }
int Part::harmonyCount() { if (!score()) return 0; int count = 0; Segment::Type st = Segment::Type::ChordRest; for (Segment* seg = score()->firstMeasure()->first(st); seg; seg = seg->next1(st)) { for (Element* e : seg->annotations()) { if (e->type() == Element::Type::HARMONY && e->track() >= startTrack() && e->track() < endTrack()) count++; } } return count; }