EpgDialog::EpgDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf ) { setWindowTitle( qtr( "Program Guide" ) ); QVBoxLayout *layout = new QVBoxLayout( this ); layout->setMargin( 0 ); epg = new EPGWidget( this ); QGroupBox *descBox = new QGroupBox( qtr( "Description" ), this ); QVBoxLayout *boxLayout = new QVBoxLayout( descBox ); description = new QTextEdit( this ); description->setReadOnly( true ); description->setFrameStyle( QFrame::Sunken | QFrame::StyledPanel ); description->setAutoFillBackground( true ); description->setAlignment( Qt::AlignLeft | Qt::AlignTop ); description->setFixedHeight( 100 ); QPalette palette; palette.setBrush(QPalette::Active, QPalette::Window, palette.brush( QPalette::Base ) ); description->setPalette( palette ); title = new QLabel( qtr( "Title" ), this ); title->setWordWrap( true ); boxLayout->addWidget( title ); boxLayout->addWidget( description ); layout->addWidget( epg, 10 ); layout->addWidget( descBox ); CONNECT( epg, itemSelectionChanged( EPGItem *), this, displayEvent( EPGItem *) ); CONNECT( epg, programActivated(int), THEMIM->getIM(), changeProgram(int) ); CONNECT( THEMIM->getIM(), epgChanged(), this, scheduleUpdate() ); CONNECT( THEMIM, inputChanged( bool ), this, inputChanged() ); QDialogButtonBox *buttonsBox = new QDialogButtonBox( this ); #if 0 QPushButton *update = new QPushButton( qtr( "Update" ) ); // Temporary to test buttonsBox->addButton( update, QDialogButtonBox::ActionRole ); BUTTONACT( update, updateInfos() ); #endif buttonsBox->addButton( new QPushButton( qtr( "&Close" ) ), QDialogButtonBox::RejectRole ); boxLayout->addWidget( buttonsBox ); CONNECT( buttonsBox, rejected(), this, close() ); timer = new QTimer( this ); timer->setSingleShot( true ); timer->setInterval( 5000 ); CONNECT( timer, timeout(), this, timeout() ); updateInfos(); restoreWidgetPosition( "EPGDialog", QSize( 650, 450 ) ); }
void EpgDialog::timeout() { if( !isVisible() ) scheduleUpdate(); else updateInfos(); }
bool RawReaderPlugin::getRegionOfDefinition(const OFX::RegionOfDefinitionArguments& args, OfxRectD& rod) { updateInfos(args.time); RawReaderProcessParams<Scalar> params = getProcessParams(args.time); LibRaw rawProcessor; libraw_image_sizes_t& sizes = rawProcessor.imgdata.sizes; // libraw_output_params_t& out = rawProcessor.imgdata.params; // out.half_size = 1; if(rawProcessor.open_file(params._filepath.c_str())) { BOOST_THROW_EXCEPTION(exception::FileNotExist() << exception::user("RAW: Unable to open file") << exception::filename(params._filepath)); } if(rawProcessor.adjust_sizes_info_only()) { BOOST_THROW_EXCEPTION(exception::File() << exception::user("RAW: Cannot decode infos") << exception::filename(params._filepath)); } // point2<ptrdiff_t> dims( sizes.raw_width, sizes.raw_height ); point2<ptrdiff_t> dims(sizes.width, sizes.height); // TUTTLE_LOG_VAR( TUTTLE_INFO, dims ); rod.x1 = 0; rod.x2 = dims.x * this->_clipDst->getPixelAspectRatio(); rod.y1 = 0; rod.y2 = dims.y; return true; }
void ClipRenderer::setClip( Clip* clip ) { // if the clip is different (or NULL) we have to stop playback. if ( m_selectedClip != NULL && ( ( clip != NULL && clip->uuid() != m_selectedClip->uuid() ) || clip == NULL ) ) { clipUnloaded( m_selectedClip->uuid() ); } if ( clip == NULL ) { m_selectedClip = NULL; m_clipLoaded = false; return ; } m_selectedClip = clip; if ( clip->length() == 0 ) return ; updateInfos( clip ); }
void ClipRenderer::startPreview() { if ( m_selectedClip == NULL || m_selectedClip->length() == 0 ) return ; updateInfos( m_selectedClip ); //If an old media is found, we delete it, and disconnect if ( m_vlcMedia != NULL ) delete m_vlcMedia; m_vlcMedia = new LibVLCpp::Media( m_selectedClip->getMedia()->mrl() ); m_mediaPlayer->setKeyInput( false ); m_mediaPlayer->setMedia( m_vlcMedia ); m_mediaPlayer->play(); m_mediaPlayer->setPosition( (double)m_begin / (double)m_selectedClip->getMedia()->nbFrames() ); m_clipLoaded = true; m_isRendering = true; m_paused = false; m_mediaChanged = false; }