platform_hardware_libhardwa.../audio/AudioPolicyCompatClient.h
Dima Zavin d17f66f332 audio: update for audio/audio_policy header names/locations
Change-Id: I7a414a2e173c2bfd72ae70d57b251fa0d4dbdfa0
Signed-off-by: Dima Zavin <dima@android.com>
2011-06-13 18:18:55 -07:00

79 lines
3.5 KiB
C++

/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_AUDIOPOLICYCLIENTLEGACY_H
#define ANDROID_AUDIOPOLICYCLIENTLEGACY_H
#include <system/audio.h>
#include <system/audio_policy.h>
#include <hardware/audio_policy.h>
#include <hardware_legacy/AudioSystemLegacy.h>
#include <hardware_legacy/AudioPolicyInterface.h>
/************************************/
/* FOR BACKWARDS COMPATIBILITY ONLY */
/************************************/
namespace android_audio_legacy {
class AudioPolicyCompatClient : public AudioPolicyClientInterface {
public:
AudioPolicyCompatClient(struct audio_policy_service_ops *serviceOps,
void *service) :
mServiceOps(serviceOps) , mService(service) {}
virtual audio_io_handle_t openOutput(uint32_t *pDevices,
uint32_t *pSamplingRate,
uint32_t *pFormat,
uint32_t *pChannels,
uint32_t *pLatencyMs,
AudioSystem::output_flags flags);
virtual audio_io_handle_t openDuplicateOutput(audio_io_handle_t output1,
audio_io_handle_t output2);
virtual status_t closeOutput(audio_io_handle_t output);
virtual status_t suspendOutput(audio_io_handle_t output);
virtual status_t restoreOutput(audio_io_handle_t output);
virtual audio_io_handle_t openInput(uint32_t *pDevices,
uint32_t *pSamplingRate,
uint32_t *pFormat,
uint32_t *pChannels,
uint32_t acoustics);
virtual status_t closeInput(audio_io_handle_t input);
virtual status_t setStreamOutput(AudioSystem::stream_type stream, audio_io_handle_t output);
virtual status_t moveEffects(int session,
audio_io_handle_t srcOutput,
audio_io_handle_t dstOutput);
virtual String8 getParameters(audio_io_handle_t ioHandle, const String8& keys);
virtual void setParameters(audio_io_handle_t ioHandle,
const String8& keyValuePairs,
int delayMs = 0);
virtual status_t setStreamVolume(AudioSystem::stream_type stream,
float volume,
audio_io_handle_t output,
int delayMs = 0);
virtual status_t startTone(ToneGenerator::tone_type tone, AudioSystem::stream_type stream);
virtual status_t stopTone();
virtual status_t setVoiceVolume(float volume, int delayMs = 0);
private:
struct audio_policy_service_ops* mServiceOps;
void* mService;
};
}; // namespace android_audio_legacy
#endif // ANDROID_AUDIOPOLICYCLIENTLEGACY_H