void FrameBook::init() { api=new FbApi(this); api->id="317511414947451"; connect(api,SIGNAL(picsLoaded()),this,SLOT(nextImage())); connect(api,SIGNAL(picLoaded(QString*)),this,SLOT(setImage(QString*))); connect(this,SIGNAL(geometryChanged()),this,SLOT(setImgSize())); setImgSize(); layout=new QGraphicsLinearLayout(Qt::Vertical,this); nextBtn = new Plasma::PushButton(this); nextBtn->setMaximumHeight(25); timer=new QTimer(this); timeout=5000; connect(timer,SIGNAL(timeout()),this,SLOT(nextImage())); nextBtn->setText("Next Image"); image=new Plasma::Label(this); connect(nextBtn,SIGNAL(clicked()),this,SLOT(nextImage())); layout->addItem(image); layout->addItem(nextBtn); layout->setAlignment(image,Qt::AlignHCenter); setLayout(layout); nextImage(); api->authenticate(); }
FakeCamera::FakeCamera(std::vector<std::string>& pictures) : Camera(I8, I8, IntPoint(640,480), 60), m_pBmpQ(new std::queue<BitmapPtr>()), m_bIsOpen(false) { for (vector<string>::iterator it = pictures.begin(); it != pictures.end(); ++it) { try { BitmapPtr pBmp = loadBitmap(*it); FilterGrayscale().applyInPlace(pBmp); setImgSize(pBmp->getSize()); m_pBmpQ->push(pBmp); } catch (Exception& ex) { AVG_LOG_ERROR(ex.getStr()); throw; } } }