Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 391f1bb9 authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "AudioTrack inline short const methods"

parents fd5bc3be 01437b7c
Loading
Loading
Loading
Loading
+11 −10
Original line number Diff line number Diff line
@@ -211,27 +211,28 @@ public:
     * an uninitialized AudioTrack produces undefined results.
     * See set() method above for possible return codes.
     */
            status_t    initCheck() const;
            status_t    initCheck() const   { return mStatus; }

    /* Returns this track's estimated latency in milliseconds.
     * This includes the latency due to AudioTrack buffer size, AudioMixer (if any)
     * and audio hardware driver.
     */
            uint32_t     latency() const;
            uint32_t     latency() const    { return mLatency; }

    /* getters, see constructors and set() */

            audio_stream_type_t streamType() const;
            audio_format_t format() const;
            uint32_t    channelCount() const;
            uint32_t    frameCount() const;
            audio_stream_type_t streamType() const { return mStreamType; }
            audio_format_t format() const   { return mFormat; }

    /* Return channelCount * (bit depth per channel / 8).
     * channelCount is determined from channelMask, and bit depth comes from format.
     */
            uint32_t    channelCount() const { return mChannelCount; }

            uint32_t    frameCount() const  { return mFrameCount; }
            size_t      frameSize() const   { return mFrameSize; }

            sp<IMemory>& sharedBuffer();
            sp<IMemory> sharedBuffer() const { return mSharedBuffer; }


    /* After it's created the track is not active. Call start() to
@@ -261,7 +262,7 @@ public:
     * While muted, the callback, if set, is still called.
     */
            void        mute(bool);
            bool        muted() const;
            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.
@@ -387,7 +388,7 @@ public:
     * Returned value:
     *  AudioTrack session ID.
     */
            int    getSessionId() const;
            int    getSessionId() const { return mSessionId; }

    /* Attach track auxiliary output to specified effect. Use effectId = 0
     * to detach track from effect.
+0 −47
Original line number Diff line number Diff line
@@ -317,43 +317,6 @@ status_t AudioTrack::set(
    return NO_ERROR;
}

status_t AudioTrack::initCheck() const
{
    return mStatus;
}

// -------------------------------------------------------------------------

uint32_t AudioTrack::latency() const
{
    return mLatency;
}

audio_stream_type_t AudioTrack::streamType() const
{
    return mStreamType;
}

audio_format_t AudioTrack::format() const
{
    return mFormat;
}

uint32_t AudioTrack::channelCount() const
{
    return mChannelCount;
}

size_t AudioTrack::frameCount() const
{
    return mFrameCount;
}

sp<IMemory>& AudioTrack::sharedBuffer()
{
    return mSharedBuffer;
}

// -------------------------------------------------------------------------

void AudioTrack::start()
@@ -496,11 +459,6 @@ void AudioTrack::mute(bool e)
    mMuted = e;
}

bool AudioTrack::muted() const
{
    return mMuted;
}

status_t AudioTrack::setVolume(float left, float right)
{
    if (left < 0.0f || left > 1.0f || right < 0.0f || right > 1.0f) {
@@ -735,11 +693,6 @@ audio_io_handle_t AudioTrack::getOutput_l()
            mCblk->sampleRate, mFormat, mChannelMask, mFlags);
}

int AudioTrack::getSessionId() const
{
    return mSessionId;
}

status_t AudioTrack::attachAuxEffect(int effectId)
{
    ALOGV("attachAuxEffect(%d)", effectId);