Ejemplo n.º 1
0
GLViewer::GLViewer(QWidget *parent, GLHandler *iGLHandler, MainWindow *iMainWindow) :
  QGLViewer(parent), _glHandler(iGLHandler), _mainWindow(iMainWindow)
{
  this->setAxisIsDrawn(false);
  this->setGridIsDrawn(true);
  this->setSceneRadius(50000.0);
  this->enableGravity = false;



  this->camera()->setFlySpeed(0.0093f);

  this->camera()->setViewDirection(qglviewer::Vec(1.0, 10.0, 8.0));
resetTimer = false;

kfi_ = new KeyFrameInterpolator(new Frame());

QObject::connect(kfi_, SIGNAL(interpolated()), this, SLOT(update()));
QObject::connect(kfi_, SIGNAL(endReached()), this, SLOT(resetKfi()));
this->resetKfi ();

  if (enableGravity) {
      this->startTimer(200);
    } else {
      this->startTimer (200);
    }
}
Ejemplo n.º 2
0
 void ViewerWidget::cameraPathFinished() {
   if(camera()->keyFrameInterpolator(m_current_camera_path)) {
     disconnect(camera()->keyFrameInterpolator(m_current_camera_path), SIGNAL(interpolated()), this, SLOT(updateGL()));
     disconnect(camera()->keyFrameInterpolator(m_current_camera_path), SIGNAL(interpolated()), this, SLOT(cameraPathInterpolated()));
     disconnect(camera()->keyFrameInterpolator(m_current_camera_path), SIGNAL(endReached()), this, SLOT(cameraPathFinished()));
     emit cameraPathStopped(m_current_camera_path);
   }
 }
Ejemplo n.º 3
0
 void ViewerWidget::stopCameraPath(int id) {
   if(camera()->keyFrameInterpolator(id) && camera()->keyFrameInterpolator(id)->interpolationIsStarted()) {
     disconnect(camera()->keyFrameInterpolator(id), SIGNAL(interpolated()), this, SLOT(updateGL()));
     disconnect(camera()->keyFrameInterpolator(id), SIGNAL(interpolated()), this, SLOT(cameraPathInterpolated()));
     disconnect(camera()->keyFrameInterpolator(id), SIGNAL(endReached()), this, SLOT(cameraPathFinished()));
     camera()->keyFrameInterpolator(id)->stopInterpolation();
   }
 }
Ejemplo n.º 4
0
 void ViewerWidget::deleteCameraPath(int id) {
   if(camera()->keyFrameInterpolator(id)) {
     disconnect(camera()->keyFrameInterpolator(id), SIGNAL(interpolated()), this, SLOT(updateGL()));
     disconnect(camera()->keyFrameInterpolator(id), SIGNAL(interpolated()), this, SLOT(cameraPathInterpolated()));
     disconnect(camera()->keyFrameInterpolator(id), SIGNAL(endReached()), this, SLOT(cameraPathFinished()));
     camera()->deletePath(id);
   }
 }
Ejemplo n.º 5
0
bool copyFileSet::nextFile() {
    copiedFiles++;
    if (!endReached()) {
        it++;
        return true;
    }
    return false;
}
Ejemplo n.º 6
0
void
ClipRenderer::__endReached()
{
    m_mediaPlayer->stop();
    m_isRendering = false;
    if ( m_mediaChanged == true )
        m_clipLoaded = false;
    emit endReached();
}
Ejemplo n.º 7
0
 void ViewerWidget::playCameraPath(int id, int start_frame) {
   qglviewer::KeyFrameInterpolator *kfi = camera()->keyFrameInterpolator(id);
   if(kfi && !kfi->interpolationIsStarted() && start_frame >= 0 && start_frame < kfi->numberOfKeyFrames()) {
     m_current_camera_path = id;
     m_current_camera_frame = start_frame;
     kfi->setInterpolationTime(kfi->keyFrameTime(start_frame));
     std::cout << "Playing path of length " << kfi->numberOfKeyFrames() << ", start time " << kfi->keyFrameTime(start_frame) << std::endl;
     connect(kfi, SIGNAL(interpolated()), this, SLOT(updateGL()));
     connect(kfi, SIGNAL(interpolated()), this, SLOT(cameraPathInterpolated()));
     connect(kfi, SIGNAL(endReached()), this, SLOT(cameraPathFinished()));
     kfi->startInterpolation();
   }
 }
Ejemplo n.º 8
0
void
MetaDataWorker::prepareAudioSpectrumComputing()
{
    m_media->vlcMedia()->addOption( ":no-sout-video" );
    m_media->vlcMedia()->addOption( ":sout=#transcode{}:smem" );
    m_media->vlcMedia()->setAudioDataCtx( this );
    m_media->vlcMedia()->setAudioLockCallback( reinterpret_cast<void*>( lock ) );
    m_media->vlcMedia()->setAudioUnlockCallback( reinterpret_cast<void*>( unlock ) );
    m_media->vlcMedia()->addOption( ":sout-transcode-acodec=fl32" );
    m_media->vlcMedia()->addOption( ":no-sout-smem-time-sync" );
    m_media->vlcMedia()->addOption( ":no-sout-keep" );
    connect( m_mediaPlayer, SIGNAL( endReached() ), this, SLOT( generateAudioSpectrum() ), Qt::QueuedConnection );
}
Ejemplo n.º 9
0
string copyFileSet::getDestinationPath() {
    if (endReached())
        return NULL;
    
    // destination is a file
    if (destIsFile) {
        return dest;
    }
    
    string ret = *it; // arrFiles[copiedFiles];
    ret.erase(0, rootDir.length());
    ret = dest + ret;
    return ret;
}
Ejemplo n.º 10
0
ClipRenderer::ClipRenderer() :
    GenericRenderer(),
    m_clipLoaded( false ),
    m_vlcMedia( NULL ),
    m_selectedClip( NULL ),
    m_begin( 0 ),
    m_end( -1 ),
    m_mediaChanged( false )
{
    connect( m_mediaPlayer,     SIGNAL( stopped() ),            this,   SLOT( __videoStopped() ) );
    connect( m_mediaPlayer,     SIGNAL( paused() ),             this,   SIGNAL( paused() ) );
    connect( m_mediaPlayer,     SIGNAL( playing() ),            this,   SIGNAL( playing() ) );
    connect( m_mediaPlayer,     SIGNAL( volumeChanged() ),      this,   SIGNAL( volumeChanged() ) );
    connect( m_mediaPlayer,     SIGNAL( timeChanged( qint64 ) ),this,   SLOT( __timeChanged( qint64 ) ) );
    connect( m_mediaPlayer,     SIGNAL( endReached() ),         this,   SLOT( __endReached() ) );
}
Ejemplo n.º 11
0
void
Transcoder::transcodeToPs()
{
    QString             outputDir = VLMC_PROJECT_GET_STRING( "general/Workspace" );
    LibVLCpp::Media     *media = new LibVLCpp::Media( m_media->fileInfo()->absoluteFilePath() );

    if ( outputDir.length() == 0 )
        outputDir = m_media->fileInfo()->absolutePath();
    m_destinationFile = outputDir + '/' + m_media->fileInfo()->baseName() + ".ps";
    QString         option = ":sout=file://" + m_destinationFile;
    media->addOption( option.toUtf8().constData() );
    LibVLCpp::MediaPlayer   *mp = new LibVLCpp::MediaPlayer( media );
    connect( mp, SIGNAL( positionChanged( float ) ), this, SIGNAL( progress( float ) ) );
    connect( mp, SIGNAL( endReached() ), this, SLOT( transcodeFinished() ) );
    emit notify( "Transcoding " + m_media->fileInfo()->absoluteFilePath() + " to " + m_destinationFile );
    mp->play();
}
Ejemplo n.º 12
0
// signals
void VlcMediaPlayer::d_connect()
{
#define SIG(signal) connect(d, signal, signal)
    SIG(SIGNAL(libvlcEvent(const libvlc_event_t *)));
    SIG(SIGNAL(mediaChanged(libvlc_media_t *)));
    SIG(SIGNAL(buffering(const float &)));
    SIG(SIGNAL(stateChanged(const VlcState::Type &)));
    SIG(SIGNAL(forward()));
    SIG(SIGNAL(backward()));
    SIG(SIGNAL(endReached()));
    SIG(SIGNAL(encounteredError()));
    SIG(SIGNAL(timeChanged(const qint64 &)));
    SIG(SIGNAL(positionChanged(const float &)));
    SIG(SIGNAL(seekableChanged(const int &)));
    SIG(SIGNAL(pausableChanged(const int &)));
    SIG(SIGNAL(titleChanged(const int &)));
    SIG(SIGNAL(snapshotTaken(const QString &)));
    SIG(SIGNAL(lengthChanged(const qint64 &)));
    SIG(SIGNAL(voutChanged(const int &)));
#undef SIG
}
int qglviewer::KeyFrameInterpolator::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: interpolated(); break;
        case 1: endReached(); break;
        case 2: addKeyFrame((*reinterpret_cast< const Frame(*)>(_a[1]))); break;
        case 3: addKeyFrame((*reinterpret_cast< const Frame(*)>(_a[1])),(*reinterpret_cast< float(*)>(_a[2]))); break;
        case 4: addKeyFrame((*reinterpret_cast< const Frame*const(*)>(_a[1]))); break;
        case 5: addKeyFrame((*reinterpret_cast< const Frame*const(*)>(_a[1])),(*reinterpret_cast< float(*)>(_a[2]))); break;
        case 6: deletePath(); break;
        case 7: setFrame((*reinterpret_cast< Frame*const(*)>(_a[1]))); break;
        case 8: setInterpolationTime((*reinterpret_cast< float(*)>(_a[1]))); break;
        case 9: setInterpolationSpeed((*reinterpret_cast< float(*)>(_a[1]))); break;
        case 10: setInterpolationPeriod((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 11: setLoopInterpolation((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 12: setLoopInterpolation(); break;
        case 13: setClosedPath((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 14: setClosedPath(); break;
        case 15: startInterpolation((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 16: startInterpolation(); break;
        case 17: stopInterpolation(); break;
        case 18: resetInterpolation(); break;
        case 19: toggleInterpolation(); break;
        case 20: interpolateAtTime((*reinterpret_cast< float(*)>(_a[1]))); break;
        case 21: update(); break;
        case 22: invalidateValues(); break;
        default: ;
        }
        _id -= 23;
    }
    return _id;
}
Ejemplo n.º 14
0
string copyFileSet::getSourcePath() {
    if (!endReached())
        return *it; // arrFiles[copiedFiles];
    return NULL;
}