| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROMEOS_DBUS_AUDIO_DSP_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_AUDIO_DSP_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_AUDIO_DSP_CLIENT_H_ | 6 #define CHROMEOS_DBUS_AUDIO_DSP_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
| 9 #include "chromeos/chromeos_export.h" | 11 #include "chromeos/chromeos_export.h" |
| 10 #include "chromeos/dbus/dbus_client.h" | 12 #include "chromeos/dbus/dbus_client.h" |
| 11 #include "chromeos/dbus/dbus_method_call_status.h" | 13 #include "chromeos/dbus/dbus_method_call_status.h" |
| 12 | 14 |
| 13 namespace chromeos { | 15 namespace chromeos { |
| 14 | 16 |
| 15 // A DBus client class for the org.chromium.AudioDsp service. | 17 // A DBus client class for the org.chromium.AudioDsp service. |
| 16 class CHROMEOS_EXPORT AudioDspClient : public DBusClient { | 18 class CHROMEOS_EXPORT AudioDspClient : public DBusClient { |
| 17 public: | 19 public: |
| 18 // A callback to handle responses of methods returning a double value. | 20 // A callback to handle responses of methods returning a double value. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 31 const std::string& result2, | 33 const std::string& result2, |
| 32 const std::string& result3)> | 34 const std::string& result3)> |
| 33 ThreeStringDBusMethodCallback; | 35 ThreeStringDBusMethodCallback; |
| 34 | 36 |
| 35 // Interface for observing DSP events from a DSP client. | 37 // Interface for observing DSP events from a DSP client. |
| 36 class Observer { | 38 class Observer { |
| 37 public: | 39 public: |
| 38 virtual ~Observer() {} | 40 virtual ~Observer() {} |
| 39 | 41 |
| 40 // Called when the Error signal is received. | 42 // Called when the Error signal is received. |
| 41 virtual void OnError(int32 error_code) = 0; | 43 virtual void OnError(int32_t error_code) = 0; |
| 42 }; | 44 }; |
| 43 | 45 |
| 44 ~AudioDspClient() override; | 46 ~AudioDspClient() override; |
| 45 | 47 |
| 46 // Adds and removes observers for AUDIO_DSP events. | 48 // Adds and removes observers for AUDIO_DSP events. |
| 47 virtual void AddObserver(Observer* observer) = 0; | 49 virtual void AddObserver(Observer* observer) = 0; |
| 48 virtual void RemoveObserver(Observer* observer) = 0; | 50 virtual void RemoveObserver(Observer* observer) = 0; |
| 49 | 51 |
| 50 // Factory function; creates a new instance which is owned by the caller. | 52 // Factory function; creates a new instance which is owned by the caller. |
| 51 // For normal usage, access the singleton via DBusThreadManager::Get(). | 53 // For normal usage, access the singleton via DBusThreadManager::Get(). |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // Calls GetCapabilitiesOEM method. | 104 // Calls GetCapabilitiesOEM method. |
| 103 // |callback| will be called with a DBusMethodCallStatus indicating whether | 105 // |callback| will be called with a DBusMethodCallStatus indicating whether |
| 104 // the DBus method call succeeded, and three std::strings that constitute | 106 // the DBus method call succeeded, and three std::strings that constitute |
| 105 // the return value from the DBus method. | 107 // the return value from the DBus method. |
| 106 virtual void GetCapabilitiesOEM( | 108 virtual void GetCapabilitiesOEM( |
| 107 const ThreeStringDBusMethodCallback& callback) = 0; | 109 const ThreeStringDBusMethodCallback& callback) = 0; |
| 108 | 110 |
| 109 // Calls SetCapabilitiesOEM method. | 111 // Calls SetCapabilitiesOEM method. |
| 110 // |callback| will be called with a DBusMethodCallStatus indicating whether | 112 // |callback| will be called with a DBusMethodCallStatus indicating whether |
| 111 // the DBus method call succeeded. | 113 // the DBus method call succeeded. |
| 112 virtual void SetCapabilitiesOEM(uint32 speaker_id, | 114 virtual void SetCapabilitiesOEM(uint32_t speaker_id, |
| 113 const std::string& speaker_capabilities, | 115 const std::string& speaker_capabilities, |
| 114 const std::string& driver_capabilities, | 116 const std::string& driver_capabilities, |
| 115 const VoidDBusMethodCallback& callback) = 0; | 117 const VoidDBusMethodCallback& callback) = 0; |
| 116 | 118 |
| 117 // Calls GetFilterConfigOEM method. | 119 // Calls GetFilterConfigOEM method. |
| 118 // |callback| will be called with a DBusMethodCallStatus indicating whether | 120 // |callback| will be called with a DBusMethodCallStatus indicating whether |
| 119 // the DBus method call succeeded, and two std::strings that constitute | 121 // the DBus method call succeeded, and two std::strings that constitute |
| 120 // the return value from the DBus method. | 122 // the return value from the DBus method. |
| 121 virtual void GetFilterConfigOEM( | 123 virtual void GetFilterConfigOEM( |
| 122 uint32 speaker_id, | 124 uint32_t speaker_id, |
| 123 const TwoStringDBusMethodCallback& callback) = 0; | 125 const TwoStringDBusMethodCallback& callback) = 0; |
| 124 | 126 |
| 125 // Calls SetFilterConfigOEM method. | 127 // Calls SetFilterConfigOEM method. |
| 126 // |callback| will be called with a DBusMethodCallStatus indicating whether | 128 // |callback| will be called with a DBusMethodCallStatus indicating whether |
| 127 // the DBus method call succeeded. | 129 // the DBus method call succeeded. |
| 128 virtual void SetFilterConfigOEM(const std::string& speaker_config, | 130 virtual void SetFilterConfigOEM(const std::string& speaker_config, |
| 129 const std::string& driver_config, | 131 const std::string& driver_config, |
| 130 const VoidDBusMethodCallback& callback) = 0; | 132 const VoidDBusMethodCallback& callback) = 0; |
| 131 | 133 |
| 132 // Calls SetSourceType method. | 134 // Calls SetSourceType method. |
| 133 // |callback| will be called with a DBusMethodCallStatus indicating whether | 135 // |callback| will be called with a DBusMethodCallStatus indicating whether |
| 134 // the DBus method call succeeded. | 136 // the DBus method call succeeded. |
| 135 virtual void SetSourceType(uint16 source_type, | 137 virtual void SetSourceType(uint16_t source_type, |
| 136 const VoidDBusMethodCallback& callback) = 0; | 138 const VoidDBusMethodCallback& callback) = 0; |
| 137 | 139 |
| 138 // Calls AmplifierVolumeChanged method. | 140 // Calls AmplifierVolumeChanged method. |
| 139 // |callback| will be called with a DBusMethodCallStatus indicating whether | 141 // |callback| will be called with a DBusMethodCallStatus indicating whether |
| 140 // the DBus method call succeeded. | 142 // the DBus method call succeeded. |
| 141 virtual void AmplifierVolumeChanged( | 143 virtual void AmplifierVolumeChanged( |
| 142 double db_spl, | 144 double db_spl, |
| 143 const VoidDBusMethodCallback& callback) = 0; | 145 const VoidDBusMethodCallback& callback) = 0; |
| 144 | 146 |
| 145 protected: | 147 protected: |
| 146 // Create() should be used instead. | 148 // Create() should be used instead. |
| 147 AudioDspClient(); | 149 AudioDspClient(); |
| 148 | 150 |
| 149 private: | 151 private: |
| 150 DISALLOW_COPY_AND_ASSIGN(AudioDspClient); | 152 DISALLOW_COPY_AND_ASSIGN(AudioDspClient); |
| 151 }; | 153 }; |
| 152 | 154 |
| 153 } // namespace chromeos | 155 } // namespace chromeos |
| 154 | 156 |
| 155 #endif // CHROMEOS_DBUS_AUDIO_DSP_CLIENT_H_ | 157 #endif // CHROMEOS_DBUS_AUDIO_DSP_CLIENT_H_ |
| OLD | NEW |