Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

ofVideoPlayer and C++11

$
0
0

@Cici wrote:

Hello,

I ran into a problem and I'm not sure if this is more of a C++ or an oF question.

I'm trying to use a vector with various ofVideoPlayers.

In ofApp.h I'm declaring 4 ofVideo players player1, player2, player3 and player4 and a vector:
vector videoPlayers;

In the setup() function I'm writing:
videoPlayers.push_back(player1);
videoPlayers.push_back(player2);
videoPlayers.push_back(player3);
videoPlayers.push_back(player4);

After loading the films I tried to loop through the players with iterators:

    for (auto it = videoPlayers.begin(); it != videoPlayers.end(); it++) {
        it->play(); // or alternatively: (*it).play()
    }

I'm just starting with C++11 but I think this should work, but it doesn't. It doesn't throw an error, it just doesn't do anything.
I'd be grateful for any hints to what I'm doing wrong!! Thanks
Marko

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles