openframeworks/openFrameworks — Issue #1001: OF app sound out not available from Jack
Author: enrike
Created: 2012-02-27 14:59:34+00:00
State: open

I have a simple app that plays video files. I try to route (under windows) its output using Jack and Vitual Audio Cable but none can access it. I am just using the basic functionality of ofVideoPlayer, this is the class that deals with the video playing

#include "oscVPlayer.h"
#include "ofMain.h"

oscVPlayer::oscVPlayer()
{
reset();
}

void oscVPlayer::reset()
{ //defaults to fullscreen
w = NULL;
h = NULL;
x = 0;
y = 0;
donereported = false;
loopflag = OF_LOOP_NONE;

col.r = 0;
col.g = 0;
col.b = 0;
col.a = 255;

if (isLoaded())
{
setFrame(0);
setUseTexture(1);
setPaused(0);
setLoopState(OF_LOOP_NORMAL);
setSpeed(1);
setVolume(255);
stop();
}
}

void oscVPlayer::setUpVideo(string movie)
{
if (movie != "none")
{
if ( loadMovie(movie) )
{
printf("movie loaded\n");
ofVideoPlayer::update();
}
else
{
printf("CANNOT load movie\n");
}
}
else
{
printf("movie parameter is none, cannot load it\n");
}
}

void oscVPlayer::setLoop()
{
setLoopState(loopflag); // go back to your state. otherwise play resets it to loop ON
}

void oscVPlayer::resetSize()
{
w = NULL;
h = NULL;
}

void oscVPlayer::draw()
{
if (isLoaded())
{
if (col.a < 255) ofEnableAlphaBlending();
ofSetColor(col.r,col.g,col.b, col.a);
ofVideoPlayer::update();
if (w==NULL && h==NULL)
{
ofVideoPlayer::draw(x, y);
}
else
{
ofVideoPlayer::draw(x, y, w, h);
}
if (col.a < 255) ofDisableAlphaBlending();
}
}