Esempio n. 1
0
void App::onInit() {
    GApp::onInit();
    s_app = this;
    cameraAdjustment = 0.7f;

    m_sonicSculptureFilename = "default.Soundscape.Any";

    m_freezeEverything = false;

    g_sampleWindowIndex = 0;
    m_lastSampleWindowProcessed = 0;
    m_initialTime = System::time();

    m_appMode = AppMode::DEFAULT;
    // TODO: Print instructions
    m_maxSavedTimeSlices = 128;
    m_lastInterestingEventTime = System::time();
    initializeAudio();

    m_rawAudioTexture = Texture::createEmpty("Raw Audio Texture", g_currentAudioBuffer.size(), 1, ImageFormat::R32F());
    m_frequencyAudioTexture = Texture::createEmpty("Frequency Audio Texture", g_currentAudioBuffer.size()/2, 1, ImageFormat::RG32F());

    m_smoothedRootMeanSquare = 0.0f;


    setFrameDuration(1.0f/30.0f);
    makeGUI();
    loadScene("Sculpting");
}
Esempio n. 2
0
/**
        \fn initialize
*/
bool GUIPlayback::initialize(void)
{
    firstPts=admPreview::getCurrentPts();
    if(getPreviewMode()==ADM_PREVIEW_NONE) // copy
    {
        videoChain=createEmptyVideoFilterChain(firstPts,1000*1000*1000*1000LL); 
    }else
    {
        videoChain=createVideoFilterChain(firstPts,1000*1000*1000*1000LL); 
    }
    if(!videoChain)
    {
        ADM_warning("Cannot create video chain\n");
        return false;
    }
    int nb=videoChain->size();
    videoFilter=(*videoChain)[nb-1];
    FilterInfo *info=videoFilter->getInfo();
    renderZoom zoom=ZOOM_AUTO;
    // if the video output has same width/height as input, we keep the same zoom
    aviInfo originalVideo;
    video_body->getVideoInfo(&originalVideo);
    renderZoom currentZoom=admPreview::getCurrentZoom();
    if(info->width==originalVideo.width && info->height==originalVideo.height)
        zoom=currentZoom;
    //
    admPreview::setMainDimension(info->width,info->height,zoom);

    initializeAudio();
    return true;
}
Esempio n. 3
0
void SoundEngine::setAudioOutputDevice(const QAudioDeviceInfo &device)
{
    if (device.deviceName() != m_audioOutputDeviceInfo.deviceName())
    {
        m_audioOutputDeviceInfo = device;
        initializeAudio();
    }
}
Esempio n. 4
0
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
    , audioPlayer(this)

{
    ui->setupUi(this);
    initializeAudio();
}
Esempio n. 5
0
 AudioTest::AudioTest()
     :   m_pullTimer(new QTimer(this))
     ,   m_modeButton(0)
     ,   m_suspendResumeButton(0)
     ,   m_deviceBox(0)
     ,   m_device(QAudioDeviceInfo::defaultOutputDevice())
     ,   m_generator(0)
     ,   m_audioOutput(0)
     ,   m_output(0)
     ,   m_buffer(BufferSize, 0)
 {
     initializeWindow();
     initializeAudio();
 }
Esempio n. 6
0
void game_setup(void)
{
	pspDebugScreenInit();
	setupCallbacks();
	graphic_init();
	sound_thid = sceKernelCreateThread("mp3_decoderThread", mp3_decoderThread, 31, STACK_SIZE, 0, 0);
	if (sound_thid >= 0) {
		sceKernelStartThread(sound_thid, 0, NULL);
		printf("Started mp3_decoderThread\n");
	} else {
		printf("Failed to create mp3_decoderThread\n");
	}
	initializeAudio();
}
Esempio n. 7
0
int main()
{
	printf("INIT: %d\n", initializeAudio());

	//testBuffer();

	startAudio();
	startRecording("test.ogg");
	sleep(5);
	stopRecording();
	stopAudio();

	printf("DEINIT: %d\n", uninitializeAudio());

	return 0;
}
Esempio n. 8
0
//--------------------------------------------------------------
void ofApp::setup(){
    
    initializeAudio();
    initializeModels();
    
    instructions.loadFont("RobotoTTF/Roboto-Bold.ttf", 20);
    header.loadFont("quantico/Quantico-Bold.ttf", 30);
    headerLG.loadFont("quantico/Quantico-Bold.ttf", 70);
    preludeFont.loadFont("RobotoTTF/Roboto-Bold.ttf", 20);
    
    ofBackground(255,255,255);
    ofSetVerticalSync(true);
    
    camera.setFov(80);
    camera.setDistance(600);
    
    //we need to call this for textures to work on models
    ofDisableArbTex();
    
    //this makes sure that the back of the model doesn't show through the front
    ofEnableDepthTest();
    
    //ofxVboParticles([max particle number], [particle size]);
    stars = new ofxVboParticles(10000, 1000);
    
    //set friction (0.0 - 1.0);
    stars->friction = 0.000;
    
    movie.loadMovie("displays/loading.gif");
    movie.setLoopState(OF_LOOP_NORMAL);
    movie.play();
    
    isIntro = true;
    skipPrelude = true; // only set to true when testing
    
    timers[0] = 0;
    timers[1] = 0;
    timers[2] = 0;
    
    time = ofGetElapsedTimef();
}
Esempio n. 9
0
File: App.cpp Progetto: Mx7f/substep
// Called before the application loop begins.  Load data here and
// not in the constructor so that common exceptions will be
// automatically caught.
void App::onInit() {
    GApp::onInit();
    m_rainbowMode = true;
    setFrameDuration(1.0f / 60.0f);
    m_showHelp = true;
    m_guiFont = GFont::fromFile(System::findDataFile("console.fnt"));
    initializeAudio();
    
    loadGrid();
    // Call setScene(shared_ptr<Scene>()) or setScene(MyScene::create()) to replace
    // the default scene here.
    
    showRenderingStats      = true;

    makeGUI();
    // For higher-quality screenshots:
    // developerWindow->videoRecordDialog->setScreenShotFormat("PNG");
    // developerWindow->videoRecordDialog->setCaptureGui(false);
    developerWindow->cameraControlWindow->moveTo(Point2(developerWindow->cameraControlWindow->rect().x0(), 0));
    loadScene("Test Scene");

}
Esempio n. 10
0
/**
        \fn initialize
*/
bool GUIPlayback::initialize(void)
{
    firstPts=admPreview::getCurrentPts();
    if(getPreviewMode()==ADM_PREVIEW_NONE) // copy
    {
        videoChain=createEmptyVideoFilterChain(firstPts,1000*1000*1000*1000LL); 
    }else
    {
        videoChain=createVideoFilterChain(firstPts,1000*1000*1000*1000LL); 
    }
    if(!videoChain)
    {
        ADM_warning("Cannot create video chain\n");
        return false;
    }
    int nb=videoChain->size();
    videoFilter=(*videoChain)[nb-1];
    FilterInfo *info=videoFilter->getInfo();
    admPreview::setMainDimension(info->width,info->height,ZOOM_AUTO);

    initializeAudio();
    return true;
}
Esempio n. 11
0
void WhistleListener::startListening() {
    initializeAudio();
    createAudioInput();
}