//-------------------------------------------------------------- void AssetManager::loadAssets() { loadImages(); loadVideos(); loadGrabbers(); loadStreams(); }
QList<Joschy::Video> Config::loadVideos() const { QList<Joschy::Video> videos; loadVideos(&videos); return videos; }
void YTSingleVideoSource::loadVideos(int max, int startIndex) { aborted = false; this->startIndex = startIndex; this->max = max; QUrl url; if (startIndex == 1) { if (video) { QList<Video*> videos; videos << video->clone(); if (name.isEmpty()) { name = videos.first()->title(); qDebug() << "Emitting name changed" << name; emit nameChanged(name); } emit gotVideos(videos); loadVideos(max - 1, 2); return; } url = YT3::instance().method("videos"); { QUrlQueryHelper urlHelper(url); urlHelper.addQueryItem("part", "snippet"); urlHelper.addQueryItem("id", videoId); } } else { url = YT3::instance().method("search"); { QUrlQueryHelper urlHelper(url); urlHelper.addQueryItem("part", "snippet"); urlHelper.addQueryItem("type", "video"); urlHelper.addQueryItem("relatedToVideoId", videoId); urlHelper.addQueryItem("maxResults", QString::number(max)); if (startIndex > 2) { if (maybeReloadToken(max, startIndex)) return; urlHelper.addQueryItem("pageToken", nextPageToken); } } } lastUrl = url; QObject *reply = The::http()->get(url); connect(reply, SIGNAL(data(QByteArray)), SLOT(parseResults(QByteArray))); connect(reply, SIGNAL(error(QNetworkReply*)), SLOT(requestError(QNetworkReply*))); }
void YTSingleVideoSource::parse(QByteArray data) { if (aborted) return; YTFeedReader reader(data); QList<Video*> videos = reader.getVideos(); if (name.isEmpty() && !videos.isEmpty() && startIndex == 1) { name = videos.first()->title(); emit nameChanged(name); } emit gotVideos(videos); if (startIndex == 1) loadVideos(max - 1, 2); else if (startIndex == 2) emit finished(videos.size() + 1); else emit finished(videos.size()); }
void Scene::initializeGL() { initializeGLFunctions(); glClearColor( 0, 0, 0, 0 ); glShadeModel( GL_SMOOTH ); glEnable( GL_DEPTH_TEST ); GLfloat lightAmbient[4]; lightAmbient[0] = 0.5f; lightAmbient[1] = 0.5f; lightAmbient[2] = 0.5f; lightAmbient[3] = 1.0f; GLfloat lightDiffuse[4]; lightDiffuse[0] = 1.0f; lightDiffuse[1] = 1.0f; lightDiffuse[2] = 1.0f; lightDiffuse[3] = 1.0f; GLfloat lightPosition[4];lightPosition[0]= 0.0f; lightPosition[1]= 0.0f; lightPosition[2]= 2.0f; lightPosition[3]= 1.0f; glLightfv( GL_LIGHT1, GL_AMBIENT, lightAmbient ); glLightfv( GL_LIGHT1, GL_DIFFUSE, lightDiffuse ); glLightfv( GL_LIGHT1, GL_POSITION,lightPosition ); glEnable( GL_LIGHT1 ); textures->append( new Texture( "CameraTexture" ) ); loadTextures(); emit message( "Texturas cargadas" ); loadModels(); emit message( "Modelos cargadas" ); loadVideos(); emit message( "Videos cargados" ); }
//-------------------------------------------------------------- void testApp::setup(){ ofBackground(0,0,0); ofSetFrameRate(60); ofSetVerticalSync(true); ofSetColor(255,255,255); firstTimeFaded = true; moodSelected = 0; howareyou.loadMovie("movies/howareyou.mp4"); howareyou.play(); loadVideos(); menuNOSTALGIC.setup(30,385,135,25,"menunostalgic"); menuINTROSPECTIVE.setup(45,430,110,25, "menuintrospective"); menuLOST.setup(25,475, 100, 25,"menulost"); menuDETERMINED.setup(15,520,115,20, "menudetermined"); }
void Video::init() { loadVideos(); }