void Button::setBounds(int w, int h) { bounds->w = w; bounds->h = h; addClip(0,0,w,h); addClip(w,0,w,h); }
void MainWindow::addTrack( TrackModel *trackModel ) { m_bModified = true; ui->statusBar->showMessage( "Added track '" + trackModel->sName + "'", 2500 ); qDebug() << "Adding track" << trackModel->sName; int s = m_pTrackItems.size(); int iOffset = ( s > 0 ) ? 1 : 0; // Add track item TrackItem* item = new TrackItem( trackModel ); item->setY( m_pTimeline->boundingRect().height() + s * ( item->boundingRect().height() + iOffset ) ); connect( item, SIGNAL( mouseDouble(TrackItem*) ), SLOT( on_trackDoubleClicked(TrackItem*) ) ); m_pScene->addItem( item ); m_pTrackItems.append( item ); // Add clips for ( int j = 0; j < item->pTrackModel->pClips.length(); j++ ) addClip( item->pTrackModel->pClips[j], item ); // Draw horizontal divider float fYPos = item->pos().y() + item->boundingRect().height(); float fWidth = m_pTimeline->boundingRect().width(); item->pBottomLine = m_pScene->addLine( 0, fYPos, fWidth, fYPos, QPen( QColor(45, 45, 45) ) ); }
void SLBus::addClip( std::string path, int tn ) { auto mainlog = spdlog::get( "main" ); mainlog->debug( "SLBus::addClip" ); std::shared_ptr<SLClip> clip( new SLClip( path ) ); addClip( clip ); mainlog->debug( "/SLBus::addClip" ); }
//-------------------------------------------------------------- void kThreadClipView::threadedFunction() { // this is where we load the video in a thread // whilst the texture is turned off... stopThread(); //cout << "loaddddd" << loadClips.size() << endl; vector<int>deleteClips; for (int i=0; i<loadClips.size(); i++) { // cout << "acd clip: "<< i << endl; addClip(loadClips[i]); // deleteClips.push_back(i); // loadClips.erase(loadClips.begin()+i); } if(loadClips.size()>0){ shouldSetClips=true; } // for (int i=0; i<deleteClips.size(); i++) // { // loadClips.erase( loadClips.begin() + deleteClips[deleteClips.size()-i] ); // } // // deleteClips.clear(); // bool ok = video[cueVideo]->loadMovie(name[cueVideo]); // load the movie // if (ok) { // // and start playing it //// video[cueVideo]->stop(); // and start playing it // video[cueVideo]->play(); // and start playing it // video[cueVideo]->setPaused(true); // // for (int i=0; i<10; i++) // { // video[cueVideo]->setSpeed( speed ); // video[cueVideo]->setFrame(nextPosition*video[cueVideo]->getTotalNumFrames() ); // video[cueVideo]->idleMovie(); // } // // //// video[cueVideo]->idleMovie(); // and start playing it // video[cueVideo]->setLoopState(OF_LOOP_NORMAL); // loaded[cueVideo] = true; // set flag that the video is loaded // } else { // // goVideoError err = GO_TV_MOVIE_ERROR; // ofNotifyEvent(error, err); // } }
sU32 frClipContainer::addSimpleClip(sU32 op, sInt param) { const sU32 clipID = addClip(); const sU32 curveID = g_graph->m_curves->getOperatorCurves(op).addCurve(param); FRASSERT(curveID != 0); FRDASSERT(m_clips.find(clipID) != m_clips.end()); m_clips[clipID].addElement(0, op, curveID); return clipID; }
void Footballer::setTextureClips(string path1, string path2) { loadSheetFromFile(path1); loadFlippedSheetFromFile(path2); int totalClips = 4; // enter number of sprites on sheet setNumClips(totalClips); addClip( 0, 0, 83, 125); addClip( 146, 0, 126, 125); // Had to unfortunately add these manually because addClip( 285, 0, 84, 125); // not every clip is the same width addClip( 431, 0, 122, 125); addFlippedClip(0, 0, 64, 63); addFlippedClip(93, 0, 41, 63); addFlippedClip(164, 0, 63, 63); addFlippedClip(259, 0, 40, 63); spriteBox.w = 64; spriteBox.h = 63; }
void ClipTranscode::slotTranscodeFinished(int exitCode, QProcess::ExitStatus exitStatus) { buttonBox->button(QDialogButtonBox::Abort)->setText(i18n("Close")); button_start->setEnabled(true); source_url->setEnabled(true); dest_url->setEnabled(true); m_duration = 0; if (QFileInfo(m_destination).size() <= 0) { // Destination file does not exist, transcoding failed exitCode = 1; } if (exitCode == 0 && exitStatus == QProcess::NormalExit) { log_text->setHtml(log_text->toPlainText() + "<br /><b>" + i18n("Transcoding finished.")); if (auto_add->isChecked() || m_automaticMode) { QUrl url; if (urls_list->count() > 0) { QString params = ffmpeg_params->toPlainText().simplified(); QString extension = params.section("%1", 1, 1).section(' ', 0, 0); url = QUrl(dest_url->url().path() + QDir::separator() + source_url->url().fileName() + extension); } else url = dest_url->url(); if (m_automaticMode) emit transcodedClip(source_url->url(), url); else emit addClip(url); } if (urls_list->count() > 0 && m_urls.count() > 0) { m_transcodeProcess.close(); slotStartTransCode(); return; } else if (auto_close->isChecked()) accept(); else { m_infoMessage->setMessageType(KMessageWidget::Positive); m_infoMessage->setText(i18n("Transcoding finished.")); m_infoMessage->animatedShow(); } } else { m_infoMessage->setMessageType(KMessageWidget::Warning); m_infoMessage->setText(i18n("Transcoding failed!")); m_infoMessage->animatedShow(); log_text->setVisible(true); } m_transcodeProcess.close(); //Refill url list in case user wants to transcode to another format if (urls_list->count() > 0) { m_urls.clear(); for (int i = 0; i < urls_list->count(); ++i) m_urls << urls_list->item(i)->text(); } }
void Hamburger::setTextureClips(string path1, string path2) { loadSheetFromFile(path1); loadFlippedSheetFromFile(path2); int totalClips = 1; // enter number of sprites on sheet setNumClips(totalClips); addClip(0, 0, 57, 50); setPos(getHalfOfScreen()*1.3,150); // starting position }
void TrackWorkflow::addClip( ClipHelper* ch, qint64 start ) { ClipWorkflow* cw; if ( m_trackType == Workflow::VideoTrack ) { if ( ch->clip()->getMedia()->fileType() == Media::Video ) cw = new VideoClipWorkflow( ch ); else cw = new ImageClipWorkflow( ch ); } else cw = new AudioClipWorkflow( ch ); ch->setClipWorkflow( cw ); addClip( cw, start ); }
void kClipScrollView::addClips(vector< shared_ptr<Clip> > _clips){ for (int i=0; i<_clips.size(); i++) { addClip(_clips[i]); } /*shared_ptr<kClipShow> clip; for (int i=0; i<_clips.size(); i++) { clip = make_shared<kClipShow>(); clip -> setClip( _clips[i] ); clip->set( 0, 0, CLIPVIEW_SIZE, CLIPVIEW_SIZE ); kScrollView::addWidget( clip ); } kScrollView::arrangeWidgets();*/ }
Button::Button(SDL_Rect* grab, bool& f, const string& file) { bounds = grab; capacity = 4; count = 0; clips = new SDL_Rect[capacity]; SDL_Surface* loaded = SDL_LoadBMP(file.c_str()); if (loaded != NULL) { source = SDL_ConvertSurfaceFormat(loaded, surface->getSurface()->format->format, surface->getSurface()->flags); SDL_FreeSurface(loaded); } addClip(0,0,bounds->w,bounds->h); flag = &f; }
void JobManager::slotProcessJobs() { bool firstPass = true; while (!m_jobList.isEmpty() && !m_abortAllJobs) { AbstractClipJob *job = NULL; m_jobMutex.lock(); for (int i = 0; i < m_jobList.count(); ++i) { if (m_jobList.at(i)->status() == JobWaiting) { job = m_jobList.at(i); job->setStatus(JobWorking); break; } } if (!firstPass) { updateJobCount(); } m_jobMutex.unlock(); if (job == NULL) { break; } firstPass = false; QString destination = job->destination(); // Check if the clip is still here ProjectClip *currentClip = m_bin->getBinClip(job->clipId()); if (currentClip == NULL) { job->setStatus(JobDone); continue; } // Set clip status to started currentClip->setJobStatus(job->jobType, job->status()); // Make sure destination path is writable if (!destination.isEmpty()) { QFile file(destination); if (!file.open(QIODevice::WriteOnly)) { emit updateJobStatus(job->clipId(), job->jobType, JobCrashed, i18n("Cannot write to path: %1", destination)); job->setStatus(JobCrashed); continue; } file.close(); QFile::remove(destination); } connect(job, SIGNAL(jobProgress(QString,int,int)), this, SIGNAL(processLog(QString,int,int))); connect(job, SIGNAL(cancelRunningJob(QString,QMap<QString, QString>)), m_bin, SLOT(slotCancelRunningJob(QString,QMap<QString, QString>))); if (job->jobType == AbstractClipJob::MLTJOB || job->jobType == AbstractClipJob::ANALYSECLIPJOB) { connect(job, SIGNAL(gotFilterJobResults(QString,int,int,stringMap,stringMap)), this, SIGNAL(gotFilterJobResults(QString,int,int,stringMap,stringMap))); } job->startJob(); if (job->status() == JobDone) { emit updateJobStatus(job->clipId(), job->jobType, JobDone); //TODO: replace with more generic clip replacement framework if (job->jobType == AbstractClipJob::PROXYJOB) { m_bin->gotProxy(job->clipId(), destination); } if (job->addClipToProject()) { emit addClip(destination); } } else if (job->status() == JobCrashed || job->status() == JobAborted) { emit updateJobStatus(job->clipId(), job->jobType, job->status(), job->errorMessage(), QString(), job->logDetails()); } }
void ClipListViewController::addClipsFromMedia( Media* media ) { foreach( Clip* clip, *media->clips() ) addClip( clip ); }
void InCLogo::generateClips() { //step("[InCLogo] Generating Sprite Clips."); addClip(0,40,40,40); }
void AlteredPotion::generateClips() { //step("[AlteredPotion] Generating Sprite Clips."); addClip(32,0,32,40); }
void SLBus::addClip( std::shared_ptr<Clip> clip ) { addClip( std::static_pointer_cast<SLClip>(clip) ); }
AnimationClip* Animation::createClip(const char* id, unsigned long start, unsigned long end) { AnimationClip* clip = new AnimationClip(id, this, start, end); addClip(clip); return clip; }
ElementGeometryClipper::ElementGeometryClipper(const utymap::QuadKey &quadKey, const utymap::BoundingBox &quadKeyBbox, Callback callback) : callback_(callback), quadKey_(quadKey), quadKeyBbox_(quadKeyBbox), clipper_() { addClip(clipper_, createPathFromBoundingBox(quadKeyBbox_)); }
void AntiBoss::generateClips() { //step("[AntiBoss] Generating Sprite Clips."); addClip(40,40,32,40); }
Clip* Scene::sceneSplitClip( Clip *clip, int track, double pts ) { pts = nearestPTS( pts, profile.getVideoFrameDuration() ); double start = clip->position(); if (clip->getTransition()) { start += clip->getTransition()->length(); } double end = clip->position() + clip->length(); Track *t = tracks[track]; int cc = t->clipCount(); int index = t->indexOf(clip); Transition *tail = NULL; Clip *next = NULL; if (index > -1 && index < cc - 1) { next = t->clipAt(index + 1); if (next->getTransition()) { end -= next->getTransition()->length() + profile.getVideoFrameDuration(); tail = new Transition(next->getTransition()); } } double oldLength = clip->length(); double newLength = pts - clip->position(); resize( clip, newLength, track ); Clip *nc = createClip( clip->getSource(), pts, clip->start() + newLength, oldLength - newLength ); double newPos = nc->position(); nc->setPosition( newPos ); FilterCollection *fc = FilterCollection::getGlobalInstance(); for ( int i = 0; i < clip->videoFilters.count(); ++i ) { QSharedPointer<GLFilter> f = clip->videoFilters.at( i ); for ( int j = 0; j < fc->videoFilters.count(); ++j ) { if ( fc->videoFilters[ j ].identifier == f->getIdentifier() ) { QSharedPointer<Filter> nf = fc->videoFilters[ j ].create(); GLFilter *gf = (GLFilter*)nf.data(); if ( nf->getIdentifier() == "GLCustom" ) { GLCustom *gc = (GLCustom*)gf; gc->setCustomParams( f->getParameters().last()->value.toString() ); } else if ( nf->getIdentifier() == "GLStabilize" ) { GLStabilize *gs = (GLStabilize*)gf; gs->setSource( nc->getSource() ); } f->splitParameters( gf, newLength ); nf->setPosition( nc->position() ); nf->setLength( nc->length() ); nc->videoFilters.append( nf.staticCast<GLFilter>() ); break; } } } for ( int i = 0; i < clip->audioFilters.count(); ++i ) { QSharedPointer<AudioFilter> f = clip->audioFilters.at( i ); for ( int j = 0; j < fc->audioFilters.count(); ++j ) { if ( fc->audioFilters[ j ].identifier == f->getIdentifier() ) { QSharedPointer<Filter> nf = fc->audioFilters[ j ].create(); AudioFilter *af = (AudioFilter*)nf.data(); f->splitParameters( af, newLength ); nf->setPosition( nc->position() ); nf->setLength( nc->length() ); nc->audioFilters.append( nf.staticCast<AudioFilter>() ); break; } } } addClip( nc, track ); if (tail) { next->setTransition(tail); } return nc; }
bool ClipPlanes::keyPressEvent(QKeyEvent *event) { if (event->key() == Qt::Key_C && !(event->modifiers() & Qt::ControlModifier || event->modifiers() & Qt::MetaModifier) ) { addClip(); return true; } for(int i=0; i<m_clips.count(); i++) { if (m_clips[i]->grabsMouse()) { if (event->key() == Qt::Key_G) { m_clips[i]->removeFromMouseGrabberPool(); return true; } if (event->key() == Qt::Key_Up || event->key() == Qt::Key_Down || event->key() == Qt::Key_Left || event->key() == Qt::Key_Right) { int shift = -1; if (event->key() == Qt::Key_Up || event->key() == Qt::Key_Right) shift = 1; if (event->modifiers() & Qt::ShiftModifier) shift *= 10; if (event->key() == Qt::Key_Left || event->key() == Qt::Key_Right) { if (m_clips[i]->moveAxis() < ClipObject::MoveY0) m_clips[i]->rotate(m_clips[i]->m_xaxis, shift); else if (m_clips[i]->moveAxis() < ClipObject::MoveZ) m_clips[i]->rotate(m_clips[i]->m_yaxis, shift); else m_clips[i]->rotate(m_clips[i]->m_tang, shift); } else { if (m_clips[i]->moveAxis() < ClipObject::MoveY0) m_clips[i]->translate(shift*m_clips[i]->m_xaxis); else if (m_clips[i]->moveAxis() < ClipObject::MoveZ) m_clips[i]->translate(shift*m_clips[i]->m_yaxis); else m_clips[i]->translate(shift*m_clips[i]->m_tang); } return true; } else if (event->key() == Qt::Key_Delete || event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Backtab) { m_clips[i]->removeFromMouseGrabberPool(); m_clips.removeAt(i); emit removeClipper(i); return true; } else if (event->key() == Qt::Key_V) { setShow(i, false); return true; } else if (event->key() == Qt::Key_X) { m_clips[i]->setMoveAxis(ClipGrabber::MoveX0); return true; } else if (event->key() == Qt::Key_Y && !(event->modifiers() & Qt::ControlModifier || event->modifiers() & Qt::MetaModifier) ) { m_clips[i]->setMoveAxis(ClipGrabber::MoveY0); return true; } else if (event->key() == Qt::Key_Z && !(event->modifiers() & Qt::ControlModifier || event->modifiers() & Qt::MetaModifier) ) { m_clips[i]->setMoveAxis(ClipGrabber::MoveZ); return true; } else return viewportKeypressEvent(i, event); } } return false; }
void Curupira::generateClips() { //step("[Curupira] Generating Sprite Clips."); addClip(0,0,56,15); addClip(0,0,56,30); addClip(0,0,56,45); addClip(0,0,56,60); addClip(56,0,50,63); addClip(106,0,50,65); addClip(156,0,50,65); addClip(206,0,50,65); addClip(0,80,56,65); addClip(56,80,54,65); addClip(110,80,60,63); addClip(0,160,50,63); addClip(50,160,50,65); addClip(100,160,50,65); addClip(150,160,50,65); addClip(0,240,56,65); addClip(56,240,54,65); addClip(110,240,60,63); addClip(5,5,1,1);//18 }