chromium/out/Default/gen/extensions/common/api/audio.h

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// GENERATED FROM THE API DEFINITION IN
//   extensions/common/api/audio.idl
// by tools/json_schema_compiler.
// DO NOT EDIT.

#ifndef EXTENSIONS_COMMON_API_AUDIO_H__
#define EXTENSIONS_COMMON_API_AUDIO_H__

#include <stdint.h>

#include <map>
#include <memory>
#include <optional>
#include <string>
#include <vector>

#include "base/values.h"
#include <string_view>


namespace extensions {
namespace api {
namespace audio {

//
// Types
//

// Type of stream an audio device provides.
enum class StreamType {};


const char* ToString(StreamType as_enum);
StreamType ParseStreamType(std::string_view as_string);
std::u16string GetStreamTypeParseError(std::string_view as_string);

// Available audio device types.
enum class DeviceType {};


const char* ToString(DeviceType as_enum);
DeviceType ParseDeviceType(std::string_view as_string);
std::u16string GetDeviceTypeParseError(std::string_view as_string);

struct AudioDeviceInfo {};

struct DeviceFilter {};

struct DeviceProperties {};

struct DeviceIdLists {};

struct MuteChangedEvent {};

struct LevelChangedEvent {};


//
// Functions
//

namespace GetDevices {

struct Params {};

namespace Results {

base::Value::List Create(const std::vector<AudioDeviceInfo>& devices);
}  // namespace Results

}  // namespace GetDevices

namespace SetActiveDevices {

struct Params {};

namespace Results {

base::Value::List Create();
}  // namespace Results

}  // namespace SetActiveDevices

namespace SetProperties {

struct Params {};

namespace Results {

base::Value::List Create();
}  // namespace Results

}  // namespace SetProperties

namespace GetMute {

struct Params {};

namespace Results {

base::Value::List Create(bool value);
}  // namespace Results

}  // namespace GetMute

namespace SetMute {

struct Params {};

namespace Results {

base::Value::List Create();
}  // namespace Results

}  // namespace SetMute

//
// Events
//

namespace OnLevelChanged {

extern const char kEventName[];  // "audio.onLevelChanged"

base::Value::List Create(const LevelChangedEvent& event);
}  // namespace OnLevelChanged

namespace OnMuteChanged {

extern const char kEventName[];  // "audio.onMuteChanged"

base::Value::List Create(const MuteChangedEvent& event);
}  // namespace OnMuteChanged

namespace OnDeviceListChanged {

extern const char kEventName[];  // "audio.onDeviceListChanged"

// List of all present audio devices after the change.
base::Value::List Create(const std::vector<AudioDeviceInfo>& devices);
}  // namespace OnDeviceListChanged

}  // namespace audio
}  // namespace api
}  // namespace extensions

#endif  // EXTENSIONS_COMMON_API_AUDIO_H__