From: <pst...@us...> - 2008-04-11 17:22:15
|
Revision: 456 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=456&view=rev Author: pstieber Date: 2008-04-11 10:22:07 -0700 (Fri, 11 Apr 2008) Log Message: ----------- Changed dev to mDeviceNames and converted them from const char* to std::string. Modified Paths: -------------- trunk/jazz/src/AlsaDriver.cpp trunk/jazz/src/AlsaDriver.h Modified: trunk/jazz/src/AlsaDriver.cpp =================================================================== --- trunk/jazz/src/AlsaDriver.cpp 2008-04-11 17:18:24 UTC (rev 455) +++ trunk/jazz/src/AlsaDriver.cpp 2008-04-11 17:22:07 UTC (rev 456) @@ -134,8 +134,8 @@ pcm[PLAYBACK] = NULL; pcm[CAPTURE] = NULL; - dev[PLAYBACK] = gpConfig->GetStrValue(C_AlsaAudioOutputDevice); - dev[CAPTURE] = gpConfig->GetStrValue(C_AlsaAudioInputDevice); + mDeviceNames[PLAYBACK] = gpConfig->GetStrValue(C_AlsaAudioOutputDevice); + mDeviceNames[CAPTURE] = gpConfig->GetStrValue(C_AlsaAudioInputDevice); // FIXME mCanDuplex = 1; @@ -202,7 +202,10 @@ recbuffers.ResetBufferSize(frag_byte_size[CAPTURE]); } - if (dev[CAPTURE] != dev[PLAYBACK] || mCanDuplex || running_mode == 0) + if ( + mDeviceNames[CAPTURE] != mDeviceNames[PLAYBACK] || + mCanDuplex || + running_mode == 0) { OpenDsp(PLAYBACK, 1); mSamples.ResetBufferSize(frag_byte_size[PLAYBACK]); @@ -266,7 +269,12 @@ snd_pcm_stream_t stream = (mode == PLAYBACK) ? SND_PCM_STREAM_PLAYBACK : SND_PCM_STREAM_CAPTURE; - if (snd_pcm_open(&pcm[mode], dev[mode], stream, SND_PCM_NONBLOCK) < 0) + if ( + snd_pcm_open( + &pcm[mode], + mDeviceNames[mode].c_str(), + stream, + SND_PCM_NONBLOCK) < 0) { perror("snd_pcm_open"); audio_enabled = 0; Modified: trunk/jazz/src/AlsaDriver.h =================================================================== --- trunk/jazz/src/AlsaDriver.h 2008-04-11 17:18:24 UTC (rev 455) +++ trunk/jazz/src/AlsaDriver.h 2008-04-11 17:22:07 UTC (rev 456) @@ -94,7 +94,7 @@ int audio_enabled; // 0 means midi only int card; // card number in config - const char *dev[2]; // device names + std::string mDeviceNames[2]; // device names long frag_size[2]; long frag_byte_size[2]; int frame_shift[2]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |