'dependencies': [
'tvdisplay/tvdisplay.gyp:*',
# 'tvchannel/tvchannel.gyp:*',
- # 'tvaudio/tvaudio.gyp:*',
+ 'tvaudio/tvaudio.gyp:*',
],
},
], # end tv
+{
+ 'includes':[
+ '../common/common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'tizen_tvaudio',
+ 'type': 'loadable_module',
+ 'sources': [
+ 'tvaudio_api.js',
+ 'tvaudio_extension.cc',
+ 'tvaudio_extension.h',
+ 'tvaudio_instance.cc',
+ 'tvaudio_instance.h',
+ 'tvaudio_manager.cc',
+ 'tvaudio_manager.h'
+ ],
+ 'includes': [
+ '../common/pkg-config.gypi',
+ ],
+ 'conditions': [
+ ['tizen == 1', {
+ 'variables': {
+ 'packages': [
+ 'glib-2.0',
+ 'libavoc',
+ 'capi-media-audio-io',
+ ]
+ },
+ }],
+ ],
+ },
+ ],
+}
--- /dev/null
+/* global xwalk, extension, tizen */
+
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+
+
+/**
+ * This class provides access to the API functionalities through the tizen.tvaudiocontrol interface.
+ * @constructor
+ */
+function AudioControlManager() {
+ if (!(this instanceof AudioControlManager)) {
+ throw new TypeError;
+ }
+}
+
+
+/**
+ * Turns on or off the silent mode.
+ * @param {!boolean} mute The mute state
+ * (true = turn on the silent mode, false = turn off the silent mode)
+ */
+AudioControlManager.prototype.setMute = function(mute) {
+ return undefined;
+};
+
+
+/**
+ * Gets the mute state.
+ */
+AudioControlManager.prototype.isMute = function() {
+ return undefined;
+};
+
+
+/**
+ * Changes the volume level.
+ * @param {!number} volume The value of volume
+ * (the available volume range is 0 ~ 100)
+ */
+AudioControlManager.prototype.setVolume = function(volume) {
+ return undefined;
+};
+
+
+/**
+ * Increases the volume by 1 level.
+ */
+AudioControlManager.prototype.setVolumeUp = function() {
+ return undefined;
+};
+
+
+/**
+ * Decreases the volume by 1 level.
+ */
+AudioControlManager.prototype.setVolumeDown = function() {
+ return undefined;
+};
+
+
+/**
+ * Gets the current volume level.
+ * @return {number} The current volume (the volume range is 0 ~ 100)
+ */
+AudioControlManager.prototype.getVolume = function() {
+ return undefined;
+};
+
+
+/**
+ * Registers a volume change callback for getting notified when TV volume has been changed.
+ * @param {!function} listener The method to invoke when the volume has been changed.
+ */
+AudioControlManager.prototype.setVolumeChangeListener = function(listener) {
+ return undefined;
+};
+
+
+/**
+ * Unregisters the volume change callback for detecting the volume changes.
+ */
+AudioControlManager.prototype.unsetVolumeChangeListener = function() {
+ return undefined;
+};
+
+
+/**
+ * Gets the current audio output mode.
+ * @return {AudioOutputMode} The current audio output mode
+ */
+AudioControlManager.prototype.getOutputMode = function() {
+ return undefined;
+};
+
+
+// Exports
+exports = new AudioControlManager();
--- /dev/null
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "tvaudio/tvaudio_extension.h"
+#include "tvaudio/tvaudio_instance.h"
+
+// This will be generated from tvaudio_api.js
+extern const char kSource_tvaudio_api[];
+
+namespace extension {
+namespace tvaudio {
+
+TVAudioExtension::TVAudioExtension() {
+ SetExtensionName("tizen.tvaudio");
+ SetJavaScriptAPI(kSource_tvaudio_api);
+}
+
+TVAudioExtension::~TVAudioExtension() {}
+
+AudioControlManager& TVAudioExtension::manager() {
+ // Initialize API on first request
+ return AudioControlManager::getInstance();
+}
+
+common::Instance* TVAudioExtension::CreateInstance() {
+ return new TVAudioInstance;
+}
+
+} // namespace tvaudio
+} // namespace extension
+
+common::Extension* CreateExtension() {
+ return new extension::tvaudio::TVAudioExtension;
+}
--- /dev/null
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SRC_TVAUDIO_TVAUDIO_EXTENSION_H_
+#define SRC_TVAUDIO_TVAUDIO_EXTENSION_H_
+
+#include "common/extension.h"
+#include "tvaudio/tvaudio_manager.h"
+
+namespace extension {
+namespace tvaudio {
+
+class TVAudioExtension : public common::Extension {
+ public:
+ TVAudioExtension();
+ virtual ~TVAudioExtension();
+
+ AudioControlManager& manager();
+
+ private:
+ virtual common::Instance* CreateInstance();
+};
+
+} // namespace tvaudio
+} // namespace extension
+
+#endif // SRC_TVAUDIO_TVAUDIO_EXTENSION_H_
+
--- /dev/null
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "tvaudio/tvaudio_instance.h"
+
+namespace extension {
+namespace tvaudio {
+
+TVAudioInstance::TVAudioInstance() {}
+
+TVAudioInstance::~TVAudioInstance() {}
+
+} // namespace tvaudio
+} // namespace extension
--- /dev/null
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SRC_TVAUDIO_TVAUDIO_INSTANCE_H_
+#define SRC_TVAUDIO_TVAUDIO_INSTANCE_H_
+
+#include "common/extension.h"
+
+namespace extension {
+namespace tvaudio {
+
+class TVAudioInstance : public common::ParsedInstance {
+ public:
+ TVAudioInstance();
+ virtual ~TVAudioInstance();
+};
+
+} // namespace tvaudio
+} // namespace extension
+
+#endif // SRC_TVAUDIO_TVAUDIO_INSTANCE_H_
--- /dev/null
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "tvaudio/tvaudio_manager.h"
+
+namespace extension {
+namespace tvaudio {
+
+AudioControlManager::AudioControlManager() {
+}
+
+AudioControlManager::~AudioControlManager() {
+}
+
+AudioControlManager& AudioControlManager::getInstance() {
+ static AudioControlManager instance;
+ return instance;
+}
+
+} // namespace tvaudio
+} // namespace extension
+
--- /dev/null
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SRC_TVAUDIO_TVAUDIO_MANAGER_H_
+#define SRC_TVAUDIO_TVAUDIO_MANAGER_H_
+
+namespace extension {
+namespace tvaudio {
+
+class AudioControlManager {
+ public:
+ // Not copyable, assignable, movable
+ AudioControlManager(AudioControlManager const&) = delete;
+ void operator=(AudioControlManager const&) = delete;
+ AudioControlManager(AudioControlManager &&) = delete;
+
+ static AudioControlManager& getInstance();
+ private:
+ AudioControlManager();
+ virtual ~AudioControlManager();
+};
+
+} // namespace tvaudio
+} // namespace extension
+
+#endif // SRC_TVAUDIO_TVAUDIO_MANAGER_H_
+