New to this. I want to load several video files in an array and then randomly select one for playback. Here’s what I’ve got so far:
.h:
ofVideoPlayer chunks[3];
.cpp:
#include "testApp.h"
#include <iostream>
using namespace std;
//--------------------------------------------------------------
void testApp::setup(){
char* chunk;
for (int i = 0; i < 3; i++)
{
sprintf(chunk, "%03i.ogv", i);
chunks[i].loadMovie(chunk);
cout << i << endl;
}
ofBackground(255,255,255);
srand(time(0));
int randNumb = rand() % 3;
chunks[randNumb].play();
}
//--------------------------------------------------------------
void testApp::update(){
chunks.idleMovie();
}
//--------------------------------------------------------------
void testApp::draw(){
ofSetColor(0xFFFFFF);
chunks.draw(20,20);
}
This is the message I’m receiving on build:
|24|error: request for member idleMovie in ((testApp*)this)->testApp::chunks, which is of non-class type ofVideoPlayer [3]|
|31|error: request for member draw in ((testApp*)this)->testApp::chunks, which is of non-class type ofVideoPlayer [3]|
No idea what this means or what to do next. Any help is greatly appreciated. Thanks!