*/
void pause();
- /* Mute or unmute this track.
- * While muted, the callback, if set, is still called.
- */
- void mute(bool);
- bool muted() const { return mMuted; }
-
/* Set volume for this track, mostly used for games' sound effects
* left and right volumes. Levels must be >= 0.0 and <= 1.0.
* This is the older API. New applications should use setVolume(float) when possible.
audio_format_t mFormat; // as requested by client, not forced to 16-bit
audio_stream_type_t mStreamType;
- uint8_t mChannelCount;
- uint8_t mMuted;
- uint8_t mReserved;
+ uint32_t mChannelCount;
audio_channel_mask_t mChannelMask;
// mFrameSize is equal to mFrameSizeAF for non-PCM or 16-bit PCM data.
*/
virtual void flush() = 0;
- /* Mute or unmute this track.
- * While muted, the callback, if set, is still called.
- */
- virtual void mute(bool) = 0;
-
/* Pause a track. If set, the callback will cease being called and
* obtainBuffer will return an error. Buffers that are already released
* will continue to be processed, unless/until flush() is called.
}
mSharedBuffer = sharedBuffer;
- mMuted = false;
mActive = false;
mUserData = user;
mLoopCount = 0;
}
}
-void AudioTrack::mute(bool e)
-{
- mAudioTrack->mute(e);
- mMuted = e;
-}
-
status_t AudioTrack::setVolume(float left, float right)
{
if (left < 0.0f || left > 1.0f || right < 0.0f || right > 1.0f) {
snprintf(buffer, 255, " format(%d), channel count(%d), frame count(%d)\n", mFormat,
mChannelCount, mFrameCount);
result.append(buffer);
- snprintf(buffer, 255, " sample rate(%u), status(%d), muted(%d)\n",
- (cblk == 0) ? 0 : cblk->sampleRate, mStatus, mMuted);
+ snprintf(buffer, 255, " sample rate(%u), status(%d)\n",
+ (cblk == 0) ? 0 : cblk->sampleRate, mStatus);
result.append(buffer);
snprintf(buffer, 255, " active(%d), latency (%d)\n", mActive, mLatency);
result.append(buffer);
START,
STOP,
FLUSH,
- MUTE,
+ RESERVED, // was MUTE
PAUSE,
ATTACH_AUX_EFFECT,
ALLOCATE_TIMED_BUFFER,
remote()->transact(FLUSH, data, &reply);
}
- virtual void mute(bool e)
- {
- Parcel data, reply;
- data.writeInterfaceToken(IAudioTrack::getInterfaceDescriptor());
- data.writeInt32(e);
- remote()->transact(MUTE, data, &reply);
- }
-
virtual void pause()
{
Parcel data, reply;
flush();
return NO_ERROR;
} break;
- case MUTE: {
- CHECK_INTERFACE(IAudioTrack, data, reply);
- mute( data.readInt32() );
- return NO_ERROR;
- } break;
case PAUSE: {
CHECK_INTERFACE(IAudioTrack, data, reply);
pause();
virtual status_t start();
virtual void stop();
virtual void flush();
- virtual void mute(bool);
virtual void pause();
virtual status_t attachAuxEffect(int effectId);
virtual status_t allocateTimedBuffer(size_t size,
void flush();
void destroy();
- void mute(bool);
int name() const { return mName; }
audio_stream_type_t streamType() const {
virtual size_t framesReady() const;
- bool isMuted() const { return mMute; }
bool isPausing() const {
return mState == PAUSING;
}
protected:
- // written by Track::mute() called by binder thread(s), without a mutex or barrier.
- // read by Track::isMuted() called by playback thread, also without a mutex or barrier.
- // The lack of mutex or barrier is safe because the mute status is only used by itself.
- bool mMute;
-
// FILLED state is used for suppressing volume ramp at begin of playing
enum {FS_INVALID, FS_FILLING, FS_FILLED, FS_ACTIVE};
mutable uint8_t mFillingUpStatus;
}
// cache the combined master volume and stream type volume for fast mixer; this
// lacks any synchronization or barrier so VolumeProvider may read a stale value
- track->mCachedVolume = track->isMuted() ?
- 0 : masterVolume * mStreamTypes[track->streamType()].volume;
+ track->mCachedVolume = masterVolume * mStreamTypes[track->streamType()].volume;
++fastTracks;
} else {
// was it previously active?
// compute volume for this track
uint32_t vl, vr, va;
- if (track->isMuted() || track->isPausing() ||
- mStreamTypes[track->streamType()].mute) {
+ if (track->isPausing() || mStreamTypes[track->streamType()].mute) {
vl = vr = va = 0;
if (track->isPausing()) {
track->setPaused();
// compute volume for this track
float left, right;
- if (track->isMuted() || mMasterMute || track->isPausing() ||
- mStreamTypes[track->streamType()].mute) {
+ if (mMasterMute || track->isPausing() || mStreamTypes[track->streamType()].mute) {
left = right = 0;
if (track->isPausing()) {
track->setPaused();
mTrack->flush();
}
-void AudioFlinger::TrackHandle::mute(bool e) {
- mTrack->mute(e);
-}
-
void AudioFlinger::TrackHandle::pause() {
mTrack->pause();
}
IAudioFlinger::track_flags_t flags)
: TrackBase(thread, client, sampleRate, format, channelMask, frameCount, sharedBuffer,
sessionId),
- mMute(false),
mFillingUpStatus(FS_INVALID),
// mRetryCount initialized later when needed
mSharedBuffer(sharedBuffer),
/*static*/ void AudioFlinger::PlaybackThread::Track::appendDumpHeader(String8& result)
{
- result.append(" Name Client Type Fmt Chn mask Session StpCnt fCount S M F SRate "
+ result.append(" Name Client Type Fmt Chn mask Session StpCnt fCount S F SRate "
"L dB R dB Server User Main buf Aux Buf Flags Underruns\n");
}
nowInUnderrun = '?';
break;
}
- snprintf(&buffer[7], size-7, " %6d %4u %3u 0x%08x %7u %6u %6u %1c %1d %1d %5u %5.2g %5.2g "
+ snprintf(&buffer[7], size-7, " %6d %4u %3u 0x%08x %7u %6u %6u %1c %1d %5u %5.2g %5.2g "
"0x%08x 0x%08x 0x%08x 0x%08x %#5x %9u%c\n",
(mClient == 0) ? getpid_cached : mClient->pid(),
mStreamType,
mStepCount,
mFrameCount,
stateChar,
- mMute,
mFillingUpStatus,
mCblk->sampleRate,
20.0 * log10((vlr & 0xFFFF) / 4096.0),
}
}
-void AudioFlinger::PlaybackThread::Track::mute(bool muted)
-{
- mMute = muted;
-}
-
status_t AudioFlinger::PlaybackThread::Track::attachAuxEffect(int EffectId)
{
status_t status = DEAD_OBJECT;