dom/system/gonk/android_audio/IAudioTrack.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/system/gonk/android_audio/IAudioTrack.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,89 @@
     1.4 +/*
     1.5 + * Copyright (C) 2007 The Android Open Source Project
     1.6 + *
     1.7 + * Licensed under the Apache License, Version 2.0 (the "License");
     1.8 + * you may not use this file except in compliance with the License.
     1.9 + * You may obtain a copy of the License at
    1.10 + *
    1.11 + *      http://www.apache.org/licenses/LICENSE-2.0
    1.12 + *
    1.13 + * Unless required by applicable law or agreed to in writing, software
    1.14 + * distributed under the License is distributed on an "AS IS" BASIS,
    1.15 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    1.16 + * See the License for the specific language governing permissions and
    1.17 + * limitations under the License.
    1.18 + */
    1.19 +
    1.20 +#ifndef ANDROID_IAUDIOTRACK_H
    1.21 +#define ANDROID_IAUDIOTRACK_H
    1.22 +
    1.23 +#include <stdint.h>
    1.24 +#include <sys/types.h>
    1.25 +
    1.26 +#include <utils/RefBase.h>
    1.27 +#include <utils/Errors.h>
    1.28 +#include <binder/IInterface.h>
    1.29 +#include <binder/IMemory.h>
    1.30 +
    1.31 +
    1.32 +namespace android {
    1.33 +
    1.34 +// ----------------------------------------------------------------------------
    1.35 +
    1.36 +class IAudioTrack : public IInterface
    1.37 +{
    1.38 +public: 
    1.39 +    DECLARE_META_INTERFACE(AudioTrack);
    1.40 +
    1.41 +    /* After it's created the track is not active. Call start() to
    1.42 +     * make it active. If set, the callback will start being called.
    1.43 +     */
    1.44 +    virtual status_t    start() = 0;
    1.45 +
    1.46 +    /* Stop a track. If set, the callback will cease being called and
    1.47 +     * obtainBuffer will return an error. Buffers that are already released 
    1.48 +     * will be processed, unless flush() is called.
    1.49 +     */
    1.50 +    virtual void        stop() = 0;
    1.51 +
    1.52 +    /* flush a stopped track. All pending buffers are discarded.
    1.53 +     * This function has no effect if the track is not stoped.
    1.54 +     */
    1.55 +    virtual void        flush() = 0;
    1.56 +
    1.57 +    /* mute or unmutes this track.
    1.58 +     * While mutted, the callback, if set, is still called.
    1.59 +     */
    1.60 +    virtual void        mute(bool) = 0;
    1.61 +    
    1.62 +    /* Pause a track. If set, the callback will cease being called and
    1.63 +     * obtainBuffer will return an error. Buffers that are already released 
    1.64 +     * will be processed, unless flush() is called.
    1.65 +     */
    1.66 +    virtual void        pause() = 0;
    1.67 +
    1.68 +    /* Attach track auxiliary output to specified effect. Use effectId = 0
    1.69 +     * to detach track from effect.
    1.70 +     */
    1.71 +    virtual status_t    attachAuxEffect(int effectId) = 0;
    1.72 +
    1.73 +    /* get this tracks control block */
    1.74 +    virtual sp<IMemory> getCblk() const = 0;    
    1.75 +};
    1.76 +
    1.77 +// ----------------------------------------------------------------------------
    1.78 +
    1.79 +class BnAudioTrack : public BnInterface<IAudioTrack>
    1.80 +{
    1.81 +public:
    1.82 +    virtual status_t    onTransact( uint32_t code,
    1.83 +                                    const Parcel& data,
    1.84 +                                    Parcel* reply,
    1.85 +                                    uint32_t flags = 0);
    1.86 +};
    1.87 +
    1.88 +// ----------------------------------------------------------------------------
    1.89 +
    1.90 +}; // namespace android
    1.91 +
    1.92 +#endif // ANDROID_IAUDIOTRACK_H

mercurial