VideoColorFilterButton {
onClicked: toolBar.push(items);
},
+ VideoMuteButton {
+ },
ToolIcon {
iconSource: "image://theme/icon-m-toolbar-view-menu-white"
onClicked: openFile("VideoSettingsPage.qml");
--- /dev/null
+// -*- qml -*-
+
+/*!
+ * This file is part of CameraPlus.
+ *
+ * Copyright (C) 2012 Mohammed Sameer <msameer@foolab.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+import QtQuick 1.1
+import com.nokia.meego 1.1
+
+ToolIcon {
+ iconSource: settings.videoMuted ? "image://theme/icon-m-toolbar-volume-off-white-selected" : "image://theme/icon-m-toolbar-volume-white-selected"
+ onClicked: settings.videoMuted = !settings.videoMuted;
+}
VideoColorFilterButton {
onClicked: toolBar.push(items);
},
+ VideoMuteButton {
+ },
ToolIcon {
iconSource: "image://theme/icon-m-toolbar-view-menu-white"
onClicked: openFile("VideoSettingsPage.qml");
// TODO: disable debug builds.
// TODO: a way to get buffers to the application
// TODO: fcam like functionality (precise control over capture parameters).
-// TODO: mute video sound
PageStackWindow {
id: root
value: cam.iso.value
}
+ Binding {
+ target: cam.videoMute
+ property: "enabled"
+ value: settings.videoMuted
+ }
+
TrackerStore {
id: trackerStore
active: cam.running
#define DEFAULT_SOUND_ENABLED true
#define DEFAULT_VIDEO_TORCH_ON false
#define DEFAULT_SHOW_TOOL_BAR false
+#define DEFAULT_VIDEO_MUTE false
Settings::Settings(QObject *parent) :
QObject(parent),
emit toolBarShownChanged();
}
}
+
+bool Settings::isVideoMuted() const {
+ return m_settings->value("video/mute", DEFAULT_VIDEO_MUTE).toBool();
+}
+
+void Settings::setVideoMuted(bool muted) {
+ if (isVideoMuted() != muted) {
+ m_settings->setValue("video/mute", muted);
+ emit videoMutedChanged();
+ }
+}
+
Q_PROPERTY(bool videoTorchOn READ isVideoTorchOn WRITE setVideoTorchOn NOTIFY videoTorchOnChanged);
Q_PROPERTY(bool showToolBar READ isToolBarShown WRITE setToolBarShown NOTIFY toolBarShownChanged);
+ Q_PROPERTY(bool videoMuted READ isVideoMuted WRITE setVideoMuted NOTIFY videoMutedChanged);
public:
Settings(QObject *parent = 0);
bool isToolBarShown() const;
void setToolBarShown(bool shown);
+ bool isVideoMuted() const;
+ void setVideoMuted(bool muted);
+
signals:
void modeChanged();
void creatorNameChanged();
void soundEnabledChanged();
void videoTorchOnChanged();
void toolBarShownChanged();
+ void videoMutedChanged();
private:
QSettings *m_settings;