Permalink
Browse files

deviceName set as internal variable to be used in the callback

  • Loading branch information...
jocabola committed Feb 23, 2011
1 parent dc62857 commit 1aba217e62e8a623f5bf74192f004a4e71442e89
@@ -32,6 +32,7 @@ ofxSoundStream::ofxSoundStream(){
nInputChannels = 0;
nOutputChannels = 0;
deviceID = 0;
+ deviceName = "";
}
//------------------------------------------------------------------------------
@@ -49,11 +50,12 @@ void ofxSoundStream::setDeviceId(int _deviceID){
else{
cout << "Device ID set to : " << _deviceID << endl;
}
- deviceID=_deviceID;
+ deviceID = _deviceID;
+ deviceName = getDeviceName();
}
//------------------------------------------------------------------------------
-void ofxSoundStream::setDeviceIdByName(string deviceName){
+void ofxSoundStream::setDeviceIdByName(string _deviceName){
RtAudio *audioTemp = 0;
bool found = false;
try {
@@ -66,14 +68,15 @@ void ofxSoundStream::setDeviceIdByName(string deviceName){
for(int i=0;i<devices;i++){
info = audioTemp->getDeviceInfo(i);
- if(info.name == deviceName){
+ if(info.name == _deviceName){
found = true;
- if(audio && deviceID!=i){
+ if(audio && deviceID != i){
//ofLog(OF_ERROR,"cannot change device with stream already setup");
cout << "ERROR: cannot change device with stream already setup" << endl;
}
else{
deviceID = i;
+ deviceName = _deviceName;
cout << "Device ID set to : " << i << endl;
}
break;
@@ -237,7 +240,7 @@ int ofxSoundStream::receiveAudioBuffer(void *outputBuffer, void *inputBuffer, in
audioEventArgs.bufferSize = bufferSize;
audioEventArgs.nChannels = nInputChannels;
audioEventArgs.deviceID = deviceID;
- audioEventArgs.deviceName = getDeviceName();
+ audioEventArgs.deviceName = deviceName;
ofNotifyEvent( audioReceivedEvent, audioEventArgs, this);
#endif
memset(fPtrIn, 0, bufferSize * nInputChannels * sizeof(float));
@@ -251,7 +254,7 @@ int ofxSoundStream::receiveAudioBuffer(void *outputBuffer, void *inputBuffer, in
audioEventArgs.bufferSize = bufferSize;
audioEventArgs.nChannels = nOutputChannels;
audioEventArgs.deviceID = deviceID;
- audioEventArgs.deviceName = getDeviceName();
+ audioEventArgs.deviceName = deviceName;
ofNotifyEvent( audioRequestedEvent, audioEventArgs, this);
#endif
}
@@ -43,6 +43,7 @@ class ofxSoundStream{
int nOutputChannels;
ofxAudioEventArgs audioEventArgs;
int deviceID;
+ string deviceName;
string getDeviceName();
@@ -208,15 +208,13 @@
<dict>
<key>ChosenToolbarItems</key>
<array>
- <string>active-target-popup</string>
- <string>active-buildstyle-popup</string>
+ <string>active-combo-popup</string>
<string>action</string>
<string>NSToolbarFlexibleSpaceItem</string>
- <string>buildOrClean</string>
- <string>build-and-goOrGo</string>
+ <string>debugger-enable-breakpoints</string>
+ <string>build-and-go</string>
<string>com.apple.ide.PBXToolbarStopButton</string>
<string>get-info</string>
- <string>toggle-editor</string>
<string>NSToolbarFlexibleSpaceItem</string>
<string>com.apple.pbx.toolbar.searchfield</string>
</array>
@@ -237,7 +235,6 @@
<array>
<string>1C37FBAC04509CD000000102</string>
<string>1C37FAAC04509CD000000102</string>
- <string>1C08E77C0454961000C914BD</string>
<string>1C37FABC05509CD000000102</string>
<string>1C37FABC05539CD112110102</string>
<string>E2644B35053B69B200211256</string>
@@ -337,26 +334,15 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>0E33411A1152A00900952357</string>
+ <string>0E1F47D0131526A3003958D8</string>
<key>history</key>
<array>
<string>0EBE6A1811443700006ECD71</string>
<string>0E2F820F11457CAC000B70FD</string>
<string>0E2F821111457CAC000B70FD</string>
<string>0E49CAF21149678E0005733A</string>
<string>0E33410B11529E6200952357</string>
- <string>0E33410C11529E6200952357</string>
- </array>
- <key>prevStack</key>
- <array>
- <string>0E92485911429D52001105D9</string>
- <string>0E92485A11429D52001105D9</string>
- <string>0E92485B11429D52001105D9</string>
- <string>0E92485C11429D52001105D9</string>
- <string>0E92485F11429D52001105D9</string>
- <string>0EBE6A2F11443700006ECD71</string>
- <string>0E33410D11529E6200952357</string>
- <string>0E33410E11529E6200952357</string>
+ <string>0E33411A1152A00900952357</string>
</array>
</dict>
<key>SplitCount</key>
@@ -414,12 +400,14 @@
</array>
<key>TableOfContents</key>
<array>
- <string>0E3340FF11529D9C00952357</string>
+ <string>0E1F47CD1315269B003958D8</string>
<string>1CE0B1FE06471DED0097A5F4</string>
- <string>0E33410011529D9C00952357</string>
+ <string>0E1F47CE1315269B003958D8</string>
<string>1CE0B20306471E060097A5F4</string>
<string>1CE0B20506471E060097A5F4</string>
</array>
+ <key>ToolbarConfigUserDefaultsMinorVersion</key>
+ <string>2</string>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.defaultV3</string>
</dict>
@@ -550,10 +538,8 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>1C78EAAD065D492600B07095</string>
<string>0EA4B160114295B900CBA2C2</string>
- <string>1CD10A99069EF8BA00B06720</string>
- <string>/Users/jocabola/Documents/jocabola/OF/of_preRelease_v0061_osx_FAT/apps/stereophonic_audio_scanner/audioMultiInputExample/audioMultiInputExample.xcodeproj</string>
+ <string>/Users/jocabola/Documents/works/jocabola/OF/ofxSoundStream/apps/addonsExamples/audioMultiInputExample/audioMultiInputExample.xcodeproj</string>
</array>
<key>WindowString</key>
<string>75 144 1550 873 0 0 1680 1028 </string>
@@ -599,7 +585,7 @@
<key>PBXProjectModuleGUID</key>
<string>XCMainBuildResultsModuleGUID</string>
<key>PBXProjectModuleLabel</key>
- <string>Build</string>
+ <string>Build Results</string>
<key>XCBuildResultsTrigger_Collapse</key>
<integer>1021</integer>
<key>XCBuildResultsTrigger_Open</key>
@@ -633,7 +619,7 @@
<key>TableOfContents</key>
<array>
<string>0EA4B160114295B900CBA2C2</string>
- <string>0E33410111529D9C00952357</string>
+ <string>0E1F47CF1315269B003958D8</string>
<string>1CD0528F0623707200166675</string>
<string>XCMainBuildResultsModuleGUID</string>
</array>
@@ -1,5 +1,15 @@
// !$*UTF8*$!
{
+ 0E1F47D0131526A3003958D8 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */;
+ name = "testApp.cpp: 89";
+ rLen = 0;
+ rLoc = 2191;
+ rType = 0;
+ vrLen = 1246;
+ vrLoc = 133;
+ };
0E2F820F11457CAC000B70FD /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 0EBE6A101144368F006ECD71 /* ofxAudioEvent.h */;
@@ -30,36 +40,6 @@
vrLen = 715;
vrLoc = 0;
};
- 0E33410C11529E6200952357 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */;
- name = "testApp.cpp: 10";
- rLen = 0;
- rLoc = 265;
- rType = 0;
- vrLen = 1524;
- vrLoc = 162;
- };
- 0E33410D11529E6200952357 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */;
- name = "testApp.cpp: 10";
- rLen = 0;
- rLoc = 265;
- rType = 0;
- vrLen = 1562;
- vrLoc = 162;
- };
- 0E33410E11529E6200952357 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = E4B69E1F0A3A1BDC003C02F2 /* testApp.h */;
- name = "testApp.h: 28";
- rLen = 0;
- rLoc = 626;
- rType = 0;
- vrLen = 715;
- vrLoc = 0;
- };
0E33411A1152A00900952357 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */;
@@ -95,56 +75,6 @@
sepNavVisRange = "{0, 1299}";
};
};
- 0E92485911429D52001105D9 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = E4B69E1D0A3A1BDC003C02F2 /* main.cpp */;
- name = "main.cpp: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 414;
- vrLoc = 0;
- };
- 0E92485A11429D52001105D9 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */;
- name = "testApp.cpp: 20";
- rLen = 0;
- rLoc = 161;
- rType = 0;
- vrLen = 725;
- vrLoc = 0;
- };
- 0E92485B11429D52001105D9 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = 0E92484211429B1A001105D9 /* ofxSoundStream.cpp */;
- name = "ofxSoundStream.cpp: 1";
- rLen = 0;
- rLoc = 113;
- rType = 0;
- vrLen = 1261;
- vrLoc = 0;
- };
- 0E92485C11429D52001105D9 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = 0E92484311429B1A001105D9 /* ofxSoundStream.h */;
- name = "ofxSoundStream.h: 1";
- rLen = 0;
- rLoc = 111;
- rType = 0;
- vrLen = 1001;
- vrLoc = 0;
- };
- 0E92485F11429D52001105D9 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = E4B69E1F0A3A1BDC003C02F2 /* testApp.h */;
- name = "testApp.h: 25";
- rLen = 0;
- rLoc = 587;
- rType = 0;
- vrLen = 545;
- vrLoc = 0;
- };
0EA4B1121142959400CBA2C2 /* audioMultiInputExample */ = {
isa = PBXExecutable;
activeArgIndices = (
@@ -156,6 +86,9 @@
configStateDict = {
};
customDataFormattersEnabled = 1;
+ dataTipCustomDataFormattersEnabled = 1;
+ dataTipShowTypeColumn = 1;
+ dataTipSortType = 0;
debuggerPlugin = GDBDebugging;
disassemblyDisplayState = 0;
dylibVariantSuffix = "";
@@ -168,6 +101,7 @@
name = audioMultiInputExample;
savedGlobals = {
};
+ showTypeColumn = 0;
sourceDirectories = (
);
variableFormatDictionary = {
@@ -178,6 +112,9 @@
fallbackIsa = XCSourceControlManager;
isSCMEnabled = 0;
scmConfiguration = {
+ repositoryNamesForRoots = {
+ "" = "";
+ };
};
};
0EA4B1361142959700CBA2C2 /* Code sense */ = {
@@ -201,16 +138,6 @@
vrLen = 414;
vrLoc = 0;
};
- 0EBE6A2F11443700006ECD71 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = 0EBE6A101144368F006ECD71 /* ofxAudioEvent.h */;
- name = "ofxSoundEvent.h: 9";
- rLen = 0;
- rLoc = 106;
- rType = 0;
- vrLen = 157;
- vrLoc = 0;
- };
E45BE2E00E8CC69C009D7055 /* RtAudio.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1281, 13748}}";
@@ -274,25 +201,17 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 290626946;
- PBXWorkspaceStateSaveDate = 290626946;
+ PBXPerProjectTemplateStateSaveDate = 320153237;
+ PBXWorkspaceStateSaveDate = 320153237;
};
perUserProjectItems = {
+ 0E1F47D0131526A3003958D8 /* PBXTextBookmark */ = 0E1F47D0131526A3003958D8 /* PBXTextBookmark */;
0E2F820F11457CAC000B70FD /* PBXTextBookmark */ = 0E2F820F11457CAC000B70FD /* PBXTextBookmark */;
0E2F821111457CAC000B70FD /* PBXTextBookmark */ = 0E2F821111457CAC000B70FD /* PBXTextBookmark */;
0E33410B11529E6200952357 /* PBXTextBookmark */ = 0E33410B11529E6200952357 /* PBXTextBookmark */;
- 0E33410C11529E6200952357 /* PBXTextBookmark */ = 0E33410C11529E6200952357 /* PBXTextBookmark */;
- 0E33410D11529E6200952357 /* PBXTextBookmark */ = 0E33410D11529E6200952357 /* PBXTextBookmark */;
- 0E33410E11529E6200952357 /* PBXTextBookmark */ = 0E33410E11529E6200952357 /* PBXTextBookmark */;
0E33411A1152A00900952357 /* PBXTextBookmark */ = 0E33411A1152A00900952357 /* PBXTextBookmark */;
0E49CAF21149678E0005733A /* PBXTextBookmark */ = 0E49CAF21149678E0005733A /* PBXTextBookmark */;
- 0E92485911429D52001105D9 /* PBXTextBookmark */ = 0E92485911429D52001105D9 /* PBXTextBookmark */;
- 0E92485A11429D52001105D9 /* PBXTextBookmark */ = 0E92485A11429D52001105D9 /* PBXTextBookmark */;
- 0E92485B11429D52001105D9 /* PBXTextBookmark */ = 0E92485B11429D52001105D9 /* PBXTextBookmark */;
- 0E92485C11429D52001105D9 /* PBXTextBookmark */ = 0E92485C11429D52001105D9 /* PBXTextBookmark */;
- 0E92485F11429D52001105D9 /* PBXTextBookmark */ = 0E92485F11429D52001105D9 /* PBXTextBookmark */;
0EBE6A1811443700006ECD71 /* PBXTextBookmark */ = 0EBE6A1811443700006ECD71 /* PBXTextBookmark */;
- 0EBE6A2F11443700006ECD71 /* PBXTextBookmark */ = 0EBE6A2F11443700006ECD71 /* PBXTextBookmark */;
};
sourceControlManager = 0EA4B1351142959700CBA2C2 /* Source Control */;
userBuildSettings = {
@@ -313,9 +232,9 @@
};
E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {1281, 1918}}";
+ sepNavIntBoundsRect = "{{0, 0}, {1281, 2192}}";
sepNavSelRange = "{2191, 0}";
- sepNavVisRange = "{0, 1379}";
+ sepNavVisRange = "{133, 1246}";
sepNavWindowFrame = "{{335, 19}, {1170, 839}}";
};
};
@@ -489,7 +489,14 @@
isa = PBXProject;
buildConfigurationList = E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "audioMultiInputExample" */;
compatibilityVersion = "Xcode 2.4";
+ developmentRegion = English;
hasScannedForEncodings = 0;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
mainGroup = E4B69B4A0A3A1720003C02F2;
productRefGroup = E4B69B4A0A3A1720003C02F2;
projectDirPath = "";

0 comments on commit 1aba217

Please sign in to comment.