Más contenido relacionado
Más de Atsushi Tadokoro (20)
Sbaw090602
- 11. #pragma once
#include quot;ofMain.hquot;
#include quot;ofxAccelerometer.hquot;
#include quot;ofxMultiTouch.hquot;
#include quot;ofxALSoundPlayer.hquot;
class testApp : public ofSimpleApp, public ofxMultiTouchListener {
public:
void setup();
void update();
void draw();
void exit();
...( )...
ofxALSoundPlayer mySound;
};
- 15. #pragma once
#include quot;ofMain.hquot;
#include quot;ofxAccelerometer.hquot;
#include quot;ofxMultiTouch.hquot;
#include quot;ofxALSoundPlayer.hquot;
class testApp : public ofSimpleApp, public ofxMultiTouchListener {
public:
void setup();
void update();
void draw();
void exit();
ofxALSoundPlayer mySound;
Boolean soundOn;
};
- 17. ...( )...
//--------------------------------------------------------------
void testApp::mousePressed(int x, int y, int button){
soundOn = true;
mySound.play();
}
//--------------------------------------------------------------
void testApp::mouseReleased(){
soundOn = false;
mySound.stop();
}
...( )...
- 21. ...( )...
//--------------------------------------------------------------
void testApp::mouseDragged(int x, int y, int button){
mySound.setPan(float(mouseX) / ofGetWidth());
mySound.setPitch(float(mouseY) / ofGetHeight() * 2.0);
}
//--------------------------------------------------------------
void testApp::mousePressed(int x, int y, int button){
mySound.setPan(float(mouseX) / ofGetWidth());
mySound.setPitch(float(mouseY) / ofGetHeight() * 2.0);
mySound.play();
soundOn = true;
}
//--------------------------------------------------------------
void testApp::mouseReleased(){
mySound.stop();
soundOn = false;
}